@shijiu/jsview-vue 0.9.766 → 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 (64) 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/package.json +1 -1
  4. package/samples/DemoHomepage/App.vue +30 -6
  5. package/samples/DemoHomepage/components/TabFrame.vue +7 -0
  6. package/samples/DemoHomepage/router.js +16 -18
  7. package/samples/DemoHomepage/views/Homepage.vue +5 -1
  8. package/samples/FocusBlockDemos/AutoFocus/App.vue +51 -0
  9. package/samples/FocusBlockDemos/AutoFocus/BaseBlock.vue +82 -0
  10. package/samples/FocusBlockDemos/AutoFocus/DialogBlock.vue +89 -0
  11. package/samples/FocusBlockDemos/AutoFocus/DialogContorls.js +42 -0
  12. package/samples/FocusBlockDemos/AutoFocus/FocusNamesDefine.js +9 -0
  13. package/samples/FocusBlockDemos/AutoFocus/PlaneBlock.vue +71 -0
  14. package/samples/FocusBlockDemos/ProgressiveFocusControl/App.vue +78 -0
  15. package/samples/FocusBlockDemos/ProgressiveFocusControl/BaseBlock.vue +77 -0
  16. package/samples/FocusBlockDemos/ProgressiveFocusControl/DownPlaneBlock.vue +83 -0
  17. package/samples/FocusBlockDemos/ProgressiveFocusControl/FocusNamesDefine.js +12 -0
  18. package/samples/FocusBlockDemos/ProgressiveFocusControl/UpPlaneBlock.vue +83 -0
  19. package/samples/Marquee/App.vue +34 -3
  20. package/samples/MetroWidgetDemos/PingPong/App.vue +22 -11
  21. package/samples/MetroWidgetDemos/PingPong/AppPage.vue +3 -3
  22. package/samples/MetroWidgetDemos/{Item.vue → PingPong/Item.vue} +1 -3
  23. package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +3 -3
  24. package/samples/MetroWidgetDemos/{WidgetItem.vue → PingPong/WidgetItem.vue} +6 -1
  25. package/samples/MetroWidgetDemos/basic/App.vue +162 -0
  26. package/samples/MetroWidgetDemos/basic/Item.vue +43 -0
  27. package/samples/MetroWidgetDemos/direction/App.vue +158 -0
  28. package/samples/MetroWidgetDemos/direction/Item.vue +45 -0
  29. package/samples/MetroWidgetDemos/focusableItemBasic/App.vue +67 -0
  30. package/samples/MetroWidgetDemos/{Advanced → focusableItemBasic}/ButtonItem.vue +16 -20
  31. package/samples/MetroWidgetDemos/focusableItemMetroWidget/App.vue +74 -0
  32. package/samples/MetroWidgetDemos/{Advanced/widgets → focusableItemMetroWidget}/Item.vue +12 -30
  33. package/samples/MetroWidgetDemos/{Advanced/widgets → focusableItemMetroWidget}/WidgetItem.vue +10 -9
  34. package/samples/MetroWidgetDemos/focusableItemMix/App.vue +88 -0
  35. package/samples/MetroWidgetDemos/focusableItemMix/ButtonItem.vue +86 -0
  36. package/samples/MetroWidgetDemos/focusableItemMix/Item.vue +43 -0
  37. package/samples/MetroWidgetDemos/index.js +6 -0
  38. package/samples/MetroWidgetDemos/layoutType/App.vue +180 -0
  39. package/samples/MetroWidgetDemos/layoutType/Item.vue +45 -0
  40. package/samples/MetroWidgetDemos/padding/App.vue +222 -0
  41. package/samples/MetroWidgetDemos/padding/Item.vue +64 -0
  42. package/samples/MetroWidgetDemos/routeList.js +64 -0
  43. package/samples/MetroWidgetDemos/slideSetting/App.vue +225 -0
  44. package/samples/MetroWidgetDemos/slideSetting/Item.vue +45 -0
  45. package/samples/NinePatchDemo/App.vue +78 -122
  46. package/samples/NinePatchDemo/Item.vue +28 -26
  47. package/samples/Swiper/App.vue +148 -0
  48. package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +15 -12
  49. package/utils/JsViewEngineWidget/TemplateParser.js +6 -1
  50. package/utils/JsViewPlugin/JsvPlayer/version.js +4 -4
  51. package/utils/JsViewVueTools/JsvTextTools.js +24 -3
  52. package/utils/JsViewVueWidget/JsvMarquee.vue +81 -20
  53. package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +115 -79
  54. package/utils/JsViewVueWidget/JsvSwiper/index.js +3 -2
  55. package/samples/MetroWidgetDemos/Advanced/App.vue +0 -46
  56. package/samples/MetroWidgetDemos/Advanced/Buttons.vue +0 -70
  57. package/samples/MetroWidgetDemos/Advanced/Mixed.vue +0 -77
  58. package/samples/MetroWidgetDemos/Advanced/widgets/Widgets.vue +0 -116
  59. package/samples/MetroWidgetDemos/Advanced/widgets/focus1.png +0 -0
  60. package/samples/MetroWidgetDemos/Simple/AbsoluteTemplate.vue +0 -75
  61. package/samples/MetroWidgetDemos/Simple/App.vue +0 -45
  62. package/samples/MetroWidgetDemos/Simple/RelativeTemplate.vue +0 -111
  63. package/samples/MetroWidgetDemos/data.js +0 -205
  64. package/utils/JsViewVueWidget/JsvSwiper/Indicator.vue +0 -35
@@ -1,145 +1,101 @@
1
1
  <script setup>
2
- import {
3
- jJsvRuntimeBridge,
4
- MetroWidget,
5
- HORIZONTAL,
6
- JsvNinePatch,
7
- } from "jsview";
2
+ import { MetroWidget, HORIZONTAL, JsvNinePatch, useFocusHub } from "jsview";
8
3
  import Item from "./Item.vue";
9
4
  import borderImageUrl from "./assets/border.png";
10
- import { ref, shallowRef, onMounted } from "vue";
11
- import { useRouter, useRoute } from "vue-router";
5
+ import { reactive, provide, onMounted } from "vue";
12
6
 
13
- const router = useRouter();
7
+ const focusHub = useFocusHub();
14
8
 
15
- const data = [
16
- {
17
- blocks: {
18
- w: 160,
19
- h: 160,
9
+ const focusSize = reactive({
10
+ width: 0,
11
+ height: 0,
12
+ left: 0,
13
+ top: 0,
14
+ });
15
+ provide("focusSize", focusSize);
16
+
17
+ const provideData = () => {
18
+ return [
19
+ {
20
+ width: 160,
21
+ height: 160,
22
+ color: "#FF9900",
23
+ content: 0,
20
24
  },
21
- color: "#FF9900",
22
- content: 0,
23
- },
24
- {
25
- blocks: {
26
- w: 300,
27
- h: 300,
25
+ {
26
+ width: 300,
27
+ height: 300,
28
+ color: "#0099FF",
29
+ content: 1,
28
30
  },
29
- color: "#0099FF",
30
- content: 1,
31
- },
32
- {
33
- blocks: {
34
- w: 160,
35
- h: 160,
31
+ {
32
+ width: 160,
33
+ height: 160,
34
+ color: "#FF9900",
35
+ content: 2,
36
36
  },
37
- color: "#FF9900",
38
- content: 2,
39
- },
40
- ];
41
-
42
- const framePosition = ref({
43
- x: 0,
44
- y: 0,
45
- width: 50,
46
- height: 50,
47
- });
48
-
49
- const _onFramePositionChanged = (new_x, new_y, new_width, new_height) => {
50
- console.log(
51
- `new x=${new_x} y=${new_y} width=${new_width} height=${new_height}`
52
- );
53
-
54
- framePosition.value = {
55
- x: new_x,
56
- y: new_y,
57
- width: new_width,
58
- height: new_height,
59
- };
37
+ ];
60
38
  };
61
39
 
62
- const _measures = (item) => {
40
+ const measures = (item) => {
63
41
  return {
64
- width: item.blocks.w,
65
- height: item.blocks.h,
42
+ width: item.width,
43
+ height: item.height,
66
44
  marginRight: 10,
67
- marginTop: 10,
68
45
  };
69
46
  };
70
47
 
71
- const _onKeyDown = (ev) => {
72
- // 8:Backspace, 27:Escape, 10000:盒子返回键
73
- if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
74
- router?.go(-1); // 有router时,是从DemoHomepage进入,回退
75
- return true;
76
- }
77
- return false;
78
- };
79
-
80
- const myFocusWidget = shallowRef(null);
81
-
82
48
  onMounted(() => {
83
- myFocusWidget.value.getFocusBlockRef().requestFocus();
84
- jJsvRuntimeBridge.notifyPageLoaded();
49
+ focusHub.setFocus("myWidget");
85
50
  });
86
51
  </script>
87
52
 
88
53
  <template>
89
54
  <div :style="{ width: 1280, height: 720, backgroundColor: '#FFFFFF' }">
90
- <jsv-focus-block ref="focusNode" :onKeyDown="_onKeyDown">
91
- <div
92
- :style="{
93
- textAlign: 'center',
94
- fontSize: 30,
95
- lineHeight: 50,
96
- color: '#ffffff',
97
- left: 140,
98
- top: 20,
99
- width: 1000,
100
- height: 50,
101
- backgroundColor: 'rgba(27,38,151,0.8)',
102
- }"
103
- >
104
- NinePatch展示,框的四个角的方形中心和项目的四个顶点严格对齐
105
- </div>
106
- <metro-widget
107
- ref="myFocusWidget"
108
- :top="100"
109
- :left="250"
110
- :width="1000"
111
- :height="400"
112
- :direction="HORIZONTAL"
113
- :data="data"
114
- :measures="_measures"
115
- :padding="{ left: 50, right: 50, top: 50, height: 50 }"
116
- >
117
- <template #renderItem="{ data, query, onEdge, onAction }">
118
- <item
119
- :data="data"
120
- :query="query"
121
- :onEdge="onEdge"
122
- :onAction="onAction"
123
- :frameChanged="_onFramePositionChanged"
124
- />
125
- </template>
126
- </metro-widget>
127
- <div :style="{ top: 150, left: 300 }">
128
- <jsv-nine-patch
129
- :style="{
130
- width: framePosition.width,
131
- height: framePosition.height,
132
- top: framePosition.y,
133
- left: framePosition.x,
134
- }"
135
- :imageUrl="borderImageUrl"
136
- :imageWidth="81"
137
- :centerWidth="25"
138
- :borderOutset="14"
139
- :imageDspWidth="81"
140
- :animTime="0.2"
141
- ></jsv-nine-patch>
142
- </div>
143
- </jsv-focus-block>
55
+ <div
56
+ :style="{
57
+ textAlign: 'center',
58
+ fontSize: 30,
59
+ lineHeight: 50,
60
+ color: '#ffffff',
61
+ left: 140,
62
+ top: 20,
63
+ width: 1000,
64
+ height: 50,
65
+ backgroundColor: 'rgba(27,38,151,0.8)',
66
+ }"
67
+ >
68
+ NinePatch展示,框的四个角的方形中心和项目的四个顶点严格对齐
69
+ </div>
70
+ <metro-widget
71
+ name="myWidget"
72
+ :top="100"
73
+ :left="250"
74
+ :width="1000"
75
+ :height="400"
76
+ :direction="HORIZONTAL"
77
+ :provideData="provideData"
78
+ :measures="measures"
79
+ :padding="{ left: 50, right: 50, top: 50, height: 50 }"
80
+ >
81
+ <template #renderItem="{ data, onAction }">
82
+ <item :data="data" :onAction="onAction" />
83
+ </template>
84
+ </metro-widget>
85
+ <jsv-nine-patch
86
+ :style="{
87
+ width: focusSize.width,
88
+ height: focusSize.height,
89
+ top: focusSize.top,
90
+ left: focusSize.left,
91
+ }"
92
+ :imageUrl="borderImageUrl"
93
+ :imageWidth="81"
94
+ :centerWidth="25"
95
+ :borderOutset="14"
96
+ :imageDspWidth="81"
97
+ :animTime="0.2"
98
+ :waitForInit="true"
99
+ ></jsv-nine-patch>
144
100
  </div>
145
101
  </template>
@@ -1,37 +1,30 @@
1
1
  <script setup>
2
- import { ref, shallowRef, computed } from "vue";
2
+ import { ref, inject } from "vue";
3
+
4
+ const focusSize = inject("focusSize");
3
5
 
4
6
  const props = defineProps({
5
7
  data: Object,
6
- query: Object,
7
- onEdge: Function,
8
8
  onAction: Object,
9
- frameChanged: Function,
10
9
  });
11
10
 
12
- let focused = ref(false);
13
-
14
- let styleValue = computed(() => {
15
- return {
16
- width: props.data.blocks.w,
17
- height: props.data.blocks.h,
18
- color: "#FFFFFF",
19
- backgroundColor: props.data.color,
20
- };
21
- });
11
+ const focused = ref(false);
12
+ const divRef = ref(null);
22
13
 
23
14
  const onFocus = () => {
24
15
  focused.value = true;
25
- if (props.frameChanged) {
26
- let pos = props.query.position(props.query.id);
27
-
28
- // 焦点时套在放大的item外缘,所以要计算按照中心放大后的焦点框x,y,width,height
29
- const new_x = pos.left + (pos.width - pos.width * 1.05) / 2;
30
- const new_y = pos.top + (pos.height - pos.height * 1.05) / 2;
31
- const new_width = pos.width * 1.05;
32
- const new_height = pos.height * 1.05;
33
-
34
- props.frameChanged(new_x, new_y, new_width, new_height);
16
+ if (focusSize) {
17
+ divRef.value?.getBoundingClientRect().then(
18
+ (data) => {
19
+ focusSize.width = data.width;
20
+ focusSize.height = data.height;
21
+ focusSize.left = data.left;
22
+ focusSize.top = data.top;
23
+ },
24
+ (error) => {
25
+ console.log("get absolute position failed", error);
26
+ }
27
+ );
35
28
  }
36
29
  };
37
30
 
@@ -40,7 +33,7 @@ const onBlur = () => {
40
33
  };
41
34
 
42
35
  const onClicked = () => {
43
- onsole.log(`item ${props.query.id} clicked`);
36
+ console.log("item clicked", props.data);
44
37
  };
45
38
 
46
39
  props.onAction.register("onFocus", onFocus);
@@ -49,7 +42,16 @@ props.onAction.register("onClick", onClicked);
49
42
  </script>
50
43
 
51
44
  <template>
52
- <div :class="focused ? 'focus' : 'blur'" :style="styleValue">
45
+ <div
46
+ ref="divRef"
47
+ :class="focused ? 'focus' : 'blur'"
48
+ :style="{
49
+ width: data.width,
50
+ height: data.height,
51
+ color: '#FFFFFF',
52
+ backgroundColor: data.color,
53
+ }"
54
+ >
53
55
  {{ data.content }}
54
56
  </div>
55
57
  </template>
@@ -0,0 +1,148 @@
1
+ <!--
2
+ * @Author: ChenChanghua
3
+ * @Date: 2023-02-10 14:45:39
4
+ * @Description: file content
5
+ -->
6
+ <script setup>
7
+ import { JsvSwiper, useFocusHub, EdgeDirection } from "jsview";
8
+ import { ref, onMounted } from "vue";
9
+
10
+ const focusHub = useFocusHub();
11
+
12
+ const mySwiper = ref(null);
13
+
14
+ function randomColor() {
15
+ let randomColor = Math.round(Math.random() * 2 ** 24).toString(16);
16
+ return (
17
+ "#" + new Array(6 - randomColor.length).fill("0").join("") + randomColor
18
+ );
19
+ }
20
+ let data = [];
21
+ for (let i = 0; i < 10; i++) {
22
+ data.push({
23
+ width: 400,
24
+ height: 300,
25
+ index: i,
26
+ backgroundColor: randomColor(),
27
+ });
28
+ }
29
+
30
+ const swiper1 = {
31
+ onChange: (currentId) => {
32
+ console.log("swiper1: onChange", currentId);
33
+ },
34
+ onClick: (currentId) => {
35
+ console.log("swiper1: onClick", currentId);
36
+ },
37
+ onEdge: (info) => {
38
+ if (info.direction == EdgeDirection.bottom) {
39
+ focusHub.setFocus("mySwiper2");
40
+ }
41
+ },
42
+ };
43
+
44
+ const swiper2 = {
45
+ onChange: (currentId) => {
46
+ console.log("swiper2: onChange", currentId);
47
+ },
48
+ onClick: (currentId) => {
49
+ console.log("swiper2: onClick", currentId);
50
+ },
51
+ onEdge: (info) => {
52
+ if (info.direction == EdgeDirection.top) {
53
+ focusHub.setFocus("mySwiper1");
54
+ }
55
+ },
56
+ };
57
+ onMounted(() => {
58
+ focusHub.setFocus("mySwiper1");
59
+ });
60
+ </script>
61
+
62
+ <template>
63
+ <div>
64
+ <jsv-swiper
65
+ name="mySwiper1"
66
+ ref="mySwiper1"
67
+ :totalFrame="data.length"
68
+ :layoutInfo="{
69
+ left: 50,
70
+ top: 50,
71
+ width: 400,
72
+ height: 200,
73
+ }"
74
+ :animation="{
75
+ duration: 300,
76
+ easing: 'linear',
77
+ }"
78
+ :autoplayInterval="1000"
79
+ :onChange="swiper1.onChange"
80
+ :onClick="swiper1.onClick"
81
+ :onEdge="swiper1.onEdge"
82
+ >
83
+ <template #itemView="{ dataIndex, focused }">
84
+ <div
85
+ :style="{
86
+ width: data[dataIndex].width,
87
+ height: data[dataIndex].height,
88
+ backgroundColor: data[dataIndex].backgroundColor,
89
+ fontSize: 40,
90
+ color: focused ? '#FF0000' : '#FFFFFF',
91
+ }"
92
+ >
93
+ {{ data[dataIndex].index }}
94
+ </div>
95
+ </template>
96
+ </jsv-swiper>
97
+
98
+ <jsv-swiper
99
+ name="mySwiper2"
100
+ ref="mySwiper2"
101
+ :totalFrame="data.length"
102
+ :layoutInfo="{
103
+ left: 50,
104
+ top: 300,
105
+ width: 400,
106
+ height: 200,
107
+ }"
108
+ :animation="{
109
+ duration: 300,
110
+ easing: 'linear',
111
+ }"
112
+ :autoplayInterval="1000"
113
+ :onChange="swiper2.onChange"
114
+ :onClick="swiper2.onClick"
115
+ :onEdge="swiper2.onEdge"
116
+ :reverseSwipe="true"
117
+ :dotSize="20"
118
+ :disableLoopWhenFocus="true"
119
+ >
120
+ <template #itemView="{ dataIndex, focused }">
121
+ <div
122
+ :style="{
123
+ width: data[dataIndex].width,
124
+ height: data[dataIndex].height,
125
+ backgroundColor: data[dataIndex].backgroundColor,
126
+ fontSize: 40,
127
+ color: focused ? '#FF0000' : '#FFFFFF',
128
+ }"
129
+ >
130
+ {{ data[dataIndex].index }}
131
+ </div>
132
+ </template>
133
+ <template #indicatorDot="{ dataIndex, currentIndex }">
134
+ <div
135
+ :style="{
136
+ width: 20,
137
+ height: 20,
138
+ backgroundColor:
139
+ dataIndex == currentIndex
140
+ ? 'rgba(100, 100, 100, 0.7)'
141
+ : '#ff0000',
142
+ borderRadius: '15px',
143
+ }"
144
+ ></div>
145
+ </template>
146
+ </jsv-swiper>
147
+ </div>
148
+ </template>
@@ -1,8 +1,8 @@
1
1
  <!--
2
2
  * @Author: ChenChanghua
3
3
  * @Date: 2021-09-22 16:08:58
4
- * @LastEditors: ChenChanghua
5
- * @LastEditTime: 2022-12-19 11:17:10
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2023-03-09 11:17:00
6
6
  * @Description: file content
7
7
  -->
8
8
 
@@ -36,7 +36,7 @@
36
36
  @description 整页滚动的设置类
37
37
  @constructor {Object} {speed, easing, boundProtect}
38
38
  SeamlessSlide
39
- @description 平滑滚动的设置类
39
+ @description 无缝滚动的设置类
40
40
  @constructor {Object} {startPercent, endPercent, speed, easing, boundProtect}
41
41
  FixPositionSlide
42
42
  @description 固定位置滚动的设置类
@@ -371,7 +371,7 @@ const props = defineProps({
371
371
  slideSetting: {
372
372
  type: SlideSetting,
373
373
  default() {
374
- return new SeamlessSlide(0.2, 0.8);
374
+ return new SeamlessSlide({ startPercent: 0.2, endPercent: 0.8 });
375
375
  },
376
376
  },
377
377
  layoutType: {
@@ -548,24 +548,26 @@ const _dispatchEvent = (event) => {
548
548
  };
549
549
 
550
550
  const onItemClick = (index) => {
551
- if (isFocus && innerData[index].callbacks.callable("onClick")) {
551
+ if (isFocus && innerData[index]?.callbacks.callable("onClick")) {
552
552
  innerData[index].callbacks.onClick();
553
553
  }
554
554
  };
555
555
 
556
556
  const onItemBlur = (index) => {
557
- if (isFocus && innerData[index].callbacks.callable("onBlur")) {
557
+ if (isFocus && innerData[index]?.callbacks.callable("onBlur")) {
558
558
  innerData[index].callbacks.onBlur();
559
559
  }
560
560
  };
561
561
 
562
562
  const onItemFocus = (index, rect) => {
563
563
  if (isFocus) {
564
- _itemOnFocusSideEffect(innerData[index], rect);
565
- if (innerData[index].callbacks.callable("onFocus")) {
566
- innerData[index].callbacks.onFocus(rect);
567
- } else {
568
- callFocusAfterUpdate = true;
564
+ if (innerData[index]) {
565
+ _itemOnFocusSideEffect(innerData[index], rect);
566
+ if (innerData[index].callbacks.callable("onFocus")) {
567
+ innerData[index].callbacks.onFocus(rect);
568
+ } else {
569
+ callFocusAfterUpdate = true;
570
+ }
569
571
  }
570
572
  }
571
573
  };
@@ -1320,7 +1322,7 @@ const _moveToNext = (
1320
1322
  let rect;
1321
1323
  let x_off_set = cur_focus_item.xPos - next_focus_item.xPos;
1322
1324
  let y_off_set = cur_focus_item.yPos - next_focus_item.yPos;
1323
- if (item_edge_rect) {
1325
+ if (item_edge_rect && item_edge_rect.rect) {
1324
1326
  item_edge_rect.rect.x += x_off_set;
1325
1327
  item_edge_rect.rect.y += y_off_set;
1326
1328
  rect = item_edge_rect;
@@ -1551,6 +1553,7 @@ const _onFocus = (params) => {
1551
1553
  focus_id = _ifValidEnterRect(enterFocusRect)
1552
1554
  ? _calculateNearestItemByRect(pageUpdater.getRange(), enterFocusRect)
1553
1555
  : focus_id;
1556
+
1554
1557
  preEdgeRect = enterFocusRect;
1555
1558
  focusId = focus_id;
1556
1559
  enterFocusId = -1;
@@ -1065,7 +1065,12 @@ class TemplateParser {
1065
1065
  }
1066
1066
 
1067
1067
  IdToIndex(id) {
1068
- return this._Template.IdsMap[id];
1068
+ const index = this._Template.IdsMap[id];
1069
+ if (typeof index !== "undefined") {
1070
+ return index;
1071
+ } else {
1072
+ return -1;
1073
+ }
1069
1074
  }
1070
1075
 
1071
1076
  /**
@@ -2,16 +2,16 @@ let PluginInfo={
2
2
  // downloadUrl:"http://10.61.2.170:8080/plugin/JsvPlayer-194.zip", //插件下载地址
3
3
  packageName:"com.qcode.jsvplayer",
4
4
  name:"播放器插件",
5
- version:"1.9.6", //插件需要的版本号
6
- versionCodeMin:196,
7
- versionCodeMax:196,
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:"e671a5c28a8fece02115625430c6b56d"
14
+ md5:"2e7ee4fa5776346ecf2d4cecf002d74c"
15
15
  };
16
16
 
17
17
  // 不要用export default,update-env脚本不能解析
@@ -1,8 +1,8 @@
1
1
  /*
2
2
  * @Author: ChenChanghua
3
3
  * @Date: 2022-11-29 14:26:20
4
- * @LastEditors: ChenChanghua
5
- * @LastEditTime: 2022-11-29 14:27:03
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) => {
@@ -15,4 +15,25 @@ const getTextWidth = (text, style) => {
15
15
  };
16
16
  return window.PlatformUtils.GetTextWidth(textParams);
17
17
  };
18
- export { getTextWidth };
18
+
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 };