@shijiu/jsview-vue 2.1.6-alpha.0 → 2.1.25
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.
- package/package.json +1 -1
- package/utils/JsViewEngineWidget/JsvFocusBlock.vue +22 -1
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +6 -0
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +24 -15
- package/utils/JsViewPlugin/JsvAudio/JsvAudio.vue +3 -3
- package/utils/JsViewPlugin/JsvPlayer/GetVersion.js +20 -0
- package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +1847 -0
- package/utils/JsViewPlugin/JsvPlayer/JsvMediaBrowserInterface.js +101 -0
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +369 -0
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser-0.9.vue +53 -0
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser.vue +505 -0
- package/utils/JsViewPlugin/JsvPlayer/index-0.9.js +60 -0
- package/utils/JsViewPlugin/JsvPlayer/index.js +59 -0
- package/utils/JsViewPlugin/JsvPlayer/version.mjs +18 -0
- package/utils/JsViewPlugin/index.js +1 -0
- package/utils/JsViewVueTools/JsvRuntimeBridge.js +5 -4
- package/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.js +112 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/CallbackManager.js +68 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/CommonTools.js +18 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/FreeMoveActor.vue +46 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.js +216 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.js +66 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.js +38 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/TypeDefine.js +12 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/index.js +3 -0
- package/utils/JsViewVueWidget/JsvPosterImage.vue +16 -10
- package/utils/JsViewVueWidget/JsvRipple/Constant.js +4 -0
- package/utils/JsViewVueWidget/JsvRipple/JsvRipple.vue +134 -0
- package/utils/JsViewVueWidget/JsvRipple/index.js +7 -0
- package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +55 -68
- package/utils/JsViewVueWidget/index.js +2 -0
package/package.json
CHANGED
|
@@ -35,8 +35,11 @@ import {
|
|
|
35
35
|
inject,
|
|
36
36
|
provide,
|
|
37
37
|
onUnmounted,
|
|
38
|
+
onActivated,
|
|
39
|
+
onDeactivated,
|
|
38
40
|
} from "vue";
|
|
39
41
|
import { HUB_NS_PROVIDE_NAME } from "./JsvFocusManager.js";
|
|
42
|
+
|
|
40
43
|
const props = defineProps({
|
|
41
44
|
name: String,
|
|
42
45
|
namespace: String,
|
|
@@ -111,7 +114,7 @@ const exportObject = {
|
|
|
111
114
|
getFullName,
|
|
112
115
|
requestFocus,
|
|
113
116
|
bubbleCustomerEvent,
|
|
114
|
-
returnFocusToParent
|
|
117
|
+
returnFocusToParent,
|
|
115
118
|
};
|
|
116
119
|
const _mountToFocusSystem = () => {
|
|
117
120
|
const focusNode = toRaw(fDivRef.value)?.FocusNodeRef;
|
|
@@ -213,6 +216,24 @@ onUnmounted(() => {
|
|
|
213
216
|
focusNodeRef = null;
|
|
214
217
|
});
|
|
215
218
|
|
|
219
|
+
onActivated(() => {
|
|
220
|
+
//TODO 首次mounted后会调用onActivated, 考虑避免重复添加
|
|
221
|
+
focusNodeRef = toRaw(fDivRef.value)?.FocusNodeRef;
|
|
222
|
+
_mountToFocusSystem();
|
|
223
|
+
|
|
224
|
+
if (!!props.autoFocus || props.autoFocus === "") {
|
|
225
|
+
requestFocus(props.autoFocus !== "exact");
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
onDeactivated(() => {
|
|
230
|
+
focusNodeRef?.onUnMount();
|
|
231
|
+
if (focusNodeRef?.jsvVueComponent) {
|
|
232
|
+
focusNodeRef.jsvVueComponent = undefined;
|
|
233
|
+
}
|
|
234
|
+
focusNodeRef = null;
|
|
235
|
+
});
|
|
236
|
+
|
|
216
237
|
defineExpose(exportObject);
|
|
217
238
|
</script>
|
|
218
239
|
|
|
@@ -148,6 +148,12 @@
|
|
|
148
148
|
3. EdgeDirection
|
|
149
149
|
getCustomerDataSize
|
|
150
150
|
@description 获取用户数据长度
|
|
151
|
+
setZIndex
|
|
152
|
+
@description 设置item的zIndex
|
|
153
|
+
@params {int} index: item的index
|
|
154
|
+
@params {int} blurZIndex: blur状态下的zIndex
|
|
155
|
+
@params {int} focusZIndex: focus状态下的zIndex, 缺省时采用blurZIndex相同的值
|
|
156
|
+
|
|
151
157
|
slots:
|
|
152
158
|
renderItem: 该slot用于描画每个单元格
|
|
153
159
|
background: 该slot描画在item后, 一般用于描画需要跟随MetroWidget滚动的内容
|
|
@@ -286,6 +286,7 @@ export const setup = (
|
|
|
286
286
|
} else if (item.itemConfig.normalZIndex >= 0) {
|
|
287
287
|
i = item.itemConfig.normalZIndex;
|
|
288
288
|
}
|
|
289
|
+
|
|
289
290
|
item.renderStyle.zIndex = i;
|
|
290
291
|
}
|
|
291
292
|
};
|
|
@@ -445,11 +446,23 @@ export const setup = (
|
|
|
445
446
|
}
|
|
446
447
|
};
|
|
447
448
|
|
|
449
|
+
const setZIndex = (index, normalZIndex, focusZIndex) => {
|
|
450
|
+
const targetItem = getItemByIndex(index);
|
|
451
|
+
if (targetItem) {
|
|
452
|
+
const n = normalZIndex, f = focusZIndex ?? normalZIndex;
|
|
453
|
+
|
|
454
|
+
targetItem.itemConfig.focusZIndex = f;
|
|
455
|
+
targetItem.itemConfig.normalZIndex = n;
|
|
456
|
+
const focused = isFocus && focusId == index2Id(index);
|
|
457
|
+
setItemZIndex(targetItem, focused ? f : n, focused);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
448
461
|
const slideToItem = (index, doAnim) => {
|
|
449
462
|
templateItemAdder.tryAddItemByIndex(index);
|
|
450
463
|
const targetItem = getItemByIndex(index);
|
|
451
464
|
if (targetItem) {
|
|
452
|
-
const direction = index - preAnchorItemIndex
|
|
465
|
+
const direction = index - preAnchorItemIndex >= 0 ? 1 : -1;
|
|
453
466
|
const visible_start = _calculateVisibleStart(targetItem.templateInfo, direction);
|
|
454
467
|
slideTo(visible_start, doAnim);
|
|
455
468
|
}
|
|
@@ -466,14 +479,9 @@ export const setup = (
|
|
|
466
479
|
_force_update = true;
|
|
467
480
|
}
|
|
468
481
|
let new_list = toRaw(props.provideData());
|
|
469
|
-
let needSlide = false;
|
|
470
482
|
if (focusId >= new_list.length) {
|
|
471
|
-
focusId =
|
|
483
|
+
focusId = new_list.length - 1;
|
|
472
484
|
preFocusId = -1;
|
|
473
|
-
if (visibleInfo.start !== 0) {
|
|
474
|
-
visibleInfo.start = 0;
|
|
475
|
-
needSlide = true;
|
|
476
|
-
}
|
|
477
485
|
}
|
|
478
486
|
let new_index = 0;
|
|
479
487
|
if (!_force_update) {
|
|
@@ -562,11 +570,7 @@ export const setup = (
|
|
|
562
570
|
);
|
|
563
571
|
updater.apply();
|
|
564
572
|
onItemFocus(getItemById(focusId), null);
|
|
565
|
-
|
|
566
|
-
_slideTo(visibleInfo.start, null);
|
|
567
|
-
} else if (need_update_content) {
|
|
568
|
-
_onScroll();
|
|
569
|
-
}
|
|
573
|
+
slideToItem(focusId, false);
|
|
570
574
|
};
|
|
571
575
|
|
|
572
576
|
const getVisibleItems = () => {
|
|
@@ -578,10 +582,12 @@ export const setup = (
|
|
|
578
582
|
return {
|
|
579
583
|
start: visibleStart,
|
|
580
584
|
end: visibleEnd,
|
|
581
|
-
dataList: dataList.slice(
|
|
585
|
+
dataList: dataList.slice(visibleStart, visibleEnd + 1),
|
|
582
586
|
};
|
|
583
587
|
};
|
|
584
588
|
|
|
589
|
+
window.aaa = getVisibleItems;
|
|
590
|
+
|
|
585
591
|
const moveFocus = (direction) => {
|
|
586
592
|
if (direction == "left" || direction == 37 || direction == EdgeDirection.left) {
|
|
587
593
|
_moveToNext(-1, 0);
|
|
@@ -614,6 +620,7 @@ export const setup = (
|
|
|
614
620
|
getVisibleItems,
|
|
615
621
|
moveFocus,
|
|
616
622
|
getCustomerDataSize,
|
|
623
|
+
setZIndex,
|
|
617
624
|
};
|
|
618
625
|
|
|
619
626
|
const _calculateNearestItemByRect = (visibleSet, enter_rect_info) => {
|
|
@@ -1847,8 +1854,9 @@ export const setup = (
|
|
|
1847
1854
|
if (visibleInfo.start) {
|
|
1848
1855
|
_slideTo(visibleInfo.start, null);
|
|
1849
1856
|
}
|
|
1850
|
-
|
|
1851
|
-
|
|
1857
|
+
if (isFocus) {
|
|
1858
|
+
onItemFocus(getItemById(focusId), preEdgeRect);
|
|
1859
|
+
}
|
|
1852
1860
|
|
|
1853
1861
|
if (props.enableItemRenderBreak) {
|
|
1854
1862
|
nextTick(() => {
|
|
@@ -1877,6 +1885,7 @@ export const setup = (
|
|
|
1877
1885
|
focusBlockOnCustomerEvent,
|
|
1878
1886
|
_onFocusableItemEdge,
|
|
1879
1887
|
exportObject,
|
|
1888
|
+
setZIndex,
|
|
1880
1889
|
}
|
|
1881
1890
|
}
|
|
1882
1891
|
|
|
@@ -94,9 +94,9 @@ const props = defineProps({
|
|
|
94
94
|
},
|
|
95
95
|
});
|
|
96
96
|
|
|
97
|
-
let key = "JsvAudio_" + getKeyToken();
|
|
97
|
+
let key = "JsvAudio_" + window.JsView?.getJsContextId?.() + "_" + getKeyToken();
|
|
98
98
|
if (props.playerKey) {
|
|
99
|
-
key = props.playerKey;
|
|
99
|
+
key = props.playerKey + "_" + window.JsView?.getJsContextId?.();
|
|
100
100
|
}
|
|
101
101
|
console.log("player key:" + key);
|
|
102
102
|
const audio = sAudioManager.createAudio(key);
|
|
@@ -137,4 +137,4 @@ onBeforeUnmount(() => {
|
|
|
137
137
|
|
|
138
138
|
<template>
|
|
139
139
|
<div :style="{ width: 1, height: 1 }" backgroundColor="rgba(0,0,0,1)"></div>
|
|
140
|
-
</template>
|
|
140
|
+
</template>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import PluginInfo from './version.mjs'
|
|
2
|
+
|
|
3
|
+
function reconfigPluginInfo() {
|
|
4
|
+
if(typeof window.jJsvRuntimeBridge!=='undefined' && window.jJsvRuntimeBridge && typeof window.jJsvRuntimeBridge.getPluginBaseUrl !== "undefined"){
|
|
5
|
+
let plugin_base_url = window.jJsvRuntimeBridge.getPluginBaseUrl();
|
|
6
|
+
if(plugin_base_url){
|
|
7
|
+
PluginInfo.downloadUrl = (plugin_base_url[plugin_base_url.length-1]==="/"?plugin_base_url:(plugin_base_url+"/"))+PluginInfo.packageName+"/JsvPlayer-"+PluginInfo.versionCodeMax+".dat?md5="+PluginInfo.md5;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
reconfigPluginInfo();
|
|
13
|
+
|
|
14
|
+
function getPluginInfo(){
|
|
15
|
+
return PluginInfo;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
getPluginInfo
|
|
20
|
+
}
|