@shijiu/jsview-vue 2.1.200 → 2.1.339-test.0
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/bin/browser/BrowserApic.vue.mjs +124 -0
- package/bin/browser/BrowserApic2.vue.mjs +118 -0
- package/bin/browser/BrowserApicLib.mjs +424 -0
- package/bin/browser/BrowserAudio.vue.mjs +263 -0
- package/bin/browser/BrowserJsvLatex.vue.mjs +110 -0
- package/bin/browser/BrowserJsvPlayer.vue.mjs +573 -0
- package/bin/browser/BrowserPreload.vue.mjs +154 -0
- package/bin/browser/BrowserQrcode.vue.mjs +178 -0
- package/bin/browser/BrowserSpray.vue.mjs +66 -0
- package/bin/browser/BrowserTextureAnim.vue.mjs +324 -0
- package/bin/export-sfc.mjs +12 -0
- package/bin/jsview-common.mjs +39 -0
- package/bin/jsview-vue.mjs +21106 -0
- package/index.js +3 -4
- package/package.json +1 -2
- package/tools/config/rollup.config.mjs +52 -0
- package/tools/config/tsconfig.json +18 -0
- package/tools/config/vite.config.ts +60 -0
- package/tools/jsview-vue-build.mjs +125 -0
- package/utils/JsViewEngineWidget/{JsvFocusBlock.vue → JsvFocus/JsvFocusBlock.vue} +11 -11
- package/utils/JsViewEngineWidget/{JsvFocusHub.ts → JsvFocus/JsvFocusHub.ts} +9 -3
- package/utils/JsViewEngineWidget/{JsvFocusManager.js → JsvFocus/JsvFocusManager.js} +6 -5
- package/utils/JsViewEngineWidget/MetroWidget/AnimationManager.ts +33 -10
- package/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue +89 -57
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +118 -62
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +504 -60
- package/utils/JsViewEngineWidget/MetroWidget/RenderItem.ts +11 -1
- package/utils/JsViewEngineWidget/MetroWidget/SlotComponent.vue +13 -0
- package/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.ts +1 -1
- package/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.ts +1 -1
- package/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.ts +34 -1
- package/utils/JsViewEngineWidget/TemplateParser/TemplateItemAdder.ts +52 -11
- package/utils/JsViewEngineWidget/index.js +3 -3
- package/utils/JsViewPlugin/JsvAudio/AudioProxy.js +9 -0
- package/utils/JsViewPlugin/JsvAudio/BrowserAudio/BrowserAudio.vue +11 -3
- package/utils/JsViewPlugin/JsvAudio/JsvAudio.vue +1 -0
- package/utils/JsViewPlugin/JsvAudio/JsvAudioBridgeProxy.js +8 -0
- package/utils/JsViewPlugin/JsvAudio/ScreenLockManager.js +16 -0
- package/utils/JsViewPlugin/JsvAudio/version.js +3 -3
- package/utils/JsViewPlugin/JsvAudio/version.mjs +3 -3
- package/utils/JsViewPlugin/JsvLatex/index.js +1 -1
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +1 -1
- package/utils/JsViewPlugin/JsvPlayer/index-0.9.js +3 -3
- package/utils/JsViewPlugin/JsvPlayer/index.js +2 -2
- package/utils/JsViewVueTools/DebugTool.js +2 -2
- package/utils/JsViewVueTools/DefaultKeyMap.js +1 -1
- package/utils/JsViewVueTools/JsvDynamicCssStyle.js +1 -1
- package/utils/JsViewVueTools/JsvDynamicKeyFrames.js +2 -2
- package/utils/JsViewVueTools/JsvImpactTracer.js +7 -7
- package/utils/JsViewVueTools/JsvPreDownloader.ts +1 -1
- package/utils/JsViewVueTools/JsvRefTaker.js +2 -1
- package/utils/JsViewVueTools/JsvRuntimeBridge.js +29 -29
- package/utils/JsViewVueTools/JsvStyleClass.js +3 -3
- package/utils/JsViewVueTools/JsvStyleSheetsDeclarer.js +1 -1
- package/utils/JsViewVueTools/JsvTextTools.js +4 -4
- package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CanvasTexture.ts +29 -1
- package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CommandList.ts +6 -5
- package/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.ts +60 -2
- package/utils/JsViewVueTools/NinePatchHelper.js +1 -1
- package/utils/JsViewVueWidget/JsvActorMove/ActorControlBase.js +1 -1
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMoveControl.js +1 -1
- package/utils/JsViewVueWidget/JsvApic/{BrowserApic → JsvApic}/BrowserApic.vue +20 -23
- package/utils/JsViewVueWidget/JsvApic/{JsvApic.vue → JsvApic/JsvApic.vue} +3 -14
- package/utils/JsViewVueWidget/JsvApic/{index.js → JsvApic/index.js} +2 -4
- package/utils/JsViewVueWidget/JsvApic/JsvApic2/BrowserApic2.vue +116 -0
- package/utils/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue +137 -0
- package/utils/JsViewVueWidget/JsvApic/JsvApic2/index.js +17 -0
- package/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/BrowserApicLib.js +4 -0
- package/utils/JsViewVueWidget/JsvApic/{BrowserApic → JsvBrowserApicLib}/NormalLoopTool.js +16 -18
- package/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/PartLoopTool.js +90 -0
- package/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/SingleLoopTool.js +17 -0
- package/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/Viewer.js +111 -0
- package/utils/JsViewVueWidget/JsvApic/JsvCommonLoopToolBase.js +48 -0
- package/utils/JsViewVueWidget/JsvConnectLine/ArcLineManager.js +71 -0
- package/utils/JsViewVueWidget/JsvConnectLine/JsvConnectLine.vue +354 -0
- package/utils/JsViewVueWidget/JsvConnectLine/index.js +2 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.ts +37 -18
- package/utils/JsViewVueWidget/JsvFreeMoveActor/ForgeTypeDefine.ts +7 -3
- package/utils/JsViewVueWidget/JsvFreeMoveActor/FreeMoveActor.vue +28 -2
- package/utils/JsViewVueWidget/JsvFreeMoveActor/JsvEnvBlocker.vue +12 -5
- package/utils/JsViewVueWidget/JsvFreeMoveActor/NexusNode.ts +21 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.ts +47 -59
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.ts +129 -12
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.ts +45 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/index.js +10 -2
- package/utils/JsViewVueWidget/JsvGrid.vue +1 -1
- package/utils/JsViewVueWidget/JsvHole.js +1 -1
- package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +1 -1
- package/utils/JsViewVueWidget/JsvLine/JsvLine.vue +2 -2
- package/utils/JsViewVueWidget/JsvLine/LineManager.js +6 -4
- package/utils/JsViewVueWidget/JsvMarquee.vue +7 -4
- package/utils/JsViewVueWidget/JsvPieChart.vue +1 -1
- package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +1 -1
- package/utils/JsViewVueWidget/JsvPreload/index.js +1 -1
- package/utils/JsViewVueWidget/JsvProgressBar.vue +172 -0
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +0 -1
- package/utils/JsViewVueWidget/JsvQrcode/index.js +1 -1
- package/utils/JsViewVueWidget/JsvRadarChart.vue +1 -1
- package/utils/JsViewVueWidget/JsvScaleTextBox.vue +0 -2
- package/utils/JsViewVueWidget/JsvSector.vue +1 -1
- package/utils/JsViewVueWidget/JsvSoundPool.js +1 -1
- package/utils/JsViewVueWidget/JsvSpray/index.js +1 -1
- package/utils/JsViewVueWidget/JsvSpriteAnim/FrameBuidler.ts +235 -0
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +433 -401
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteLoader.vue +120 -0
- package/utils/JsViewVueWidget/JsvSpriteAnim/index.js +2 -2
- package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +5 -5
- package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +425 -422
- package/utils/JsViewVueWidget/JsvVisibleSensor/index.js +1 -1
- package/utils/JsViewVueWidget/index.js +7 -3
- package/utils/index.js +4 -0
- package/utils/JsViewVueWidget/JsvApic/BrowserApic/LoopToolBase.js +0 -25
- package/utils/JsViewVueWidget/JsvApic/BrowserApic/PartLoopTool.js +0 -119
- package/utils/JsViewVueWidget/JsvApic/BrowserApic/Viewer.js +0 -106
- /package/utils/JsViewPlugin/JsvLatex/{JsvLatexBrowser.vue → BrowserJsvLatex.vue} +0 -0
- /package/utils/JsViewPlugin/JsvPlayer/{JsvPlayerBrowser-0.9.vue → BrowserJsvPlayer-0.9.vue} +0 -0
- /package/utils/JsViewPlugin/JsvPlayer/{JsvPlayerBrowser.vue → BrowserJsvPlayer.vue} +0 -0
- /package/utils/JsViewVueWidget/JsvApic/{BrowserApic → JsvBrowserApicLib}/ApicDataBase.js +0 -0
- /package/utils/JsViewVueWidget/JsvApic/{BrowserApic → JsvBrowserApicLib}/GifData.js +0 -0
- /package/utils/JsViewVueWidget/JsvApic/{BrowserApic → JsvBrowserApicLib}/WebpData.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
1
|
+
import { ref, computed } from "vue";
|
|
2
2
|
import type { Ref } from "vue";
|
|
3
3
|
import { TemplateItem } from "../TemplateParser/MetroTemplate"
|
|
4
4
|
|
|
@@ -21,6 +21,7 @@ interface CustomerCallbackMap {
|
|
|
21
21
|
onFocus?: (rect: object) => void,
|
|
22
22
|
onBlur?: () => void,
|
|
23
23
|
onClick?: () => void,
|
|
24
|
+
onTap?: () => void,
|
|
24
25
|
onWidgetEdge?: (rect: object) => void,
|
|
25
26
|
}
|
|
26
27
|
|
|
@@ -35,6 +36,7 @@ export class RenderItem {
|
|
|
35
36
|
public mounted: Ref<boolean> = ref(false);
|
|
36
37
|
public touchInit: boolean = false;
|
|
37
38
|
public rootDiv: HTMLDivElement | null = null;
|
|
39
|
+
public enableTap: boolean = false;
|
|
38
40
|
|
|
39
41
|
private customerCallbackMap: CustomerCallbackMap = {};
|
|
40
42
|
private onRef: (() => void) | null;
|
|
@@ -112,6 +114,10 @@ export class RenderItem {
|
|
|
112
114
|
}
|
|
113
115
|
}
|
|
114
116
|
|
|
117
|
+
public readonly onTap = computed(() => {
|
|
118
|
+
return this.enableTap ? { click: this.onClick.bind(this) } : {};
|
|
119
|
+
})
|
|
120
|
+
|
|
115
121
|
public onClick(): boolean {
|
|
116
122
|
if (this.mounted.value) {
|
|
117
123
|
this.customerCallbackMap.onClick?.();
|
|
@@ -143,6 +149,10 @@ export class RenderItem {
|
|
|
143
149
|
})
|
|
144
150
|
}
|
|
145
151
|
this.divMountedCallback = [];
|
|
152
|
+
if (this.enableTap && this.rootDiv) {
|
|
153
|
+
const divView = (this.rootDiv as any).jsvGetProxyView();
|
|
154
|
+
divView.DragEnables?.(0x01); // 只激活tap
|
|
155
|
+
}
|
|
146
156
|
}
|
|
147
157
|
|
|
148
158
|
private onDivUnmounted(): void {
|
|
@@ -201,7 +201,7 @@ class CommonMetroTemplate extends MetroTemplate {
|
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
public
|
|
204
|
+
public addItemInner(itemObj: MeasureInfo): TemplateItem {
|
|
205
205
|
const templateItem = MetroTemplate.getTemplateItem(itemObj);
|
|
206
206
|
// Layout template items
|
|
207
207
|
const fenceStack = this._FenceStack;
|
|
@@ -11,7 +11,7 @@ class ListMetroTemplate extends MetroTemplate {
|
|
|
11
11
|
|
|
12
12
|
public calculateNeighborWhenAddStop(): void { }
|
|
13
13
|
|
|
14
|
-
public
|
|
14
|
+
public addItemInner(itemObj: MeasureInfo): TemplateItem {
|
|
15
15
|
const templateItem = MetroTemplate.getTemplateItem(itemObj);
|
|
16
16
|
this._addTemplateItem(templateItem);
|
|
17
17
|
this.tailItemIndex = templateItem.index;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { checkType, toRawType, getTypeName } from "../CheckType.js";
|
|
2
2
|
import { METRO_WIDGET } from "../MetroWidget/Const";
|
|
3
|
+
import { VERTICAL } from "../WidgetCommon";
|
|
3
4
|
|
|
4
5
|
const TAG = "MetroTemplate";
|
|
5
6
|
|
|
@@ -160,6 +161,7 @@ interface TemplateItem {
|
|
|
160
161
|
}
|
|
161
162
|
findNextAnchor: FindNextAnchor | null,
|
|
162
163
|
layoutCache: { top: number, left: number, width: number, height: number } | null,
|
|
164
|
+
uid?: string,
|
|
163
165
|
}
|
|
164
166
|
|
|
165
167
|
interface MeasureInfo {
|
|
@@ -175,11 +177,13 @@ interface MeasureInfo {
|
|
|
175
177
|
itemSlide?: number,
|
|
176
178
|
permanent?: boolean,
|
|
177
179
|
zIndex?: number | object,
|
|
180
|
+
uid?: string,
|
|
178
181
|
}
|
|
179
182
|
|
|
180
183
|
abstract class MetroTemplate {
|
|
181
184
|
protected supportHistoryPath: boolean;
|
|
182
185
|
protected idsMap: Array<number>;
|
|
186
|
+
protected uidMap: Object;
|
|
183
187
|
public templateList: Array<TemplateItem>;
|
|
184
188
|
public readonly direction: Symbol;
|
|
185
189
|
public readonly lineMax: number;
|
|
@@ -196,6 +200,7 @@ abstract class MetroTemplate {
|
|
|
196
200
|
this.layoutType = layoutType
|
|
197
201
|
this.pageSize = pageSize;
|
|
198
202
|
this.supportHistoryPath = supportHistoryPath;
|
|
203
|
+
this.uidMap = {};
|
|
199
204
|
}
|
|
200
205
|
|
|
201
206
|
get size(): number {
|
|
@@ -247,9 +252,22 @@ abstract class MetroTemplate {
|
|
|
247
252
|
return item ? item : null;
|
|
248
253
|
}
|
|
249
254
|
|
|
255
|
+
public getItemByUid(uid: string): TemplateItem | null {
|
|
256
|
+
return this.uidMap[uid];
|
|
257
|
+
}
|
|
258
|
+
|
|
250
259
|
public abstract calculateNeighborWhenAddStop(): void;
|
|
251
260
|
|
|
252
|
-
public abstract
|
|
261
|
+
public abstract addItemInner(itemObj: MeasureInfo): TemplateItem;
|
|
262
|
+
|
|
263
|
+
public addItem(itemObj: MeasureInfo): TemplateItem {
|
|
264
|
+
const item = this.addItemInner(itemObj);
|
|
265
|
+
//检查uid
|
|
266
|
+
if (itemObj.uid) {
|
|
267
|
+
this.uidMap[itemObj.uid] = item;
|
|
268
|
+
}
|
|
269
|
+
return item;
|
|
270
|
+
}
|
|
253
271
|
|
|
254
272
|
public abstract getNextItem(baseId: number, hOffset: number, vOffset: number, moveType: number): TemplateItem | null;
|
|
255
273
|
|
|
@@ -258,6 +276,21 @@ abstract class MetroTemplate {
|
|
|
258
276
|
public abstract updateItemSize(index: number,
|
|
259
277
|
newSize: { width: number, height: number }): void;
|
|
260
278
|
|
|
279
|
+
public getBoundingBoxSize() {
|
|
280
|
+
const lastItem = this.templateList[this.templateList.length - 1];
|
|
281
|
+
if (this.direction == VERTICAL) {
|
|
282
|
+
return {
|
|
283
|
+
width: this.lineMax,
|
|
284
|
+
height: lastItem.height + lastItem.top - 1,
|
|
285
|
+
}
|
|
286
|
+
} else {
|
|
287
|
+
return {
|
|
288
|
+
height: this.lineMax,
|
|
289
|
+
width: lastItem.width + lastItem.left - 1,
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
261
294
|
public getTailItemIndex() {
|
|
262
295
|
return this.tailItemIndex;
|
|
263
296
|
}
|
|
@@ -12,6 +12,7 @@ class TemplateItemAdder {
|
|
|
12
12
|
private _SideEffect: Function;
|
|
13
13
|
private _Key: string;
|
|
14
14
|
private _ID: number;
|
|
15
|
+
private _OnAddDone: Function | null;
|
|
15
16
|
|
|
16
17
|
constructor(
|
|
17
18
|
template_parser: MetroTemplate,
|
|
@@ -19,7 +20,8 @@ class TemplateItemAdder {
|
|
|
19
20
|
measure_func: Function,
|
|
20
21
|
page_range: number,
|
|
21
22
|
side_effect: Function,
|
|
22
|
-
id: number
|
|
23
|
+
id: number,
|
|
24
|
+
onAddDone: Function | null = null,
|
|
23
25
|
) {
|
|
24
26
|
this._MetroTemplate = template_parser;
|
|
25
27
|
this._Data = data;
|
|
@@ -28,6 +30,7 @@ class TemplateItemAdder {
|
|
|
28
30
|
this._CurIndex = 0;
|
|
29
31
|
this._CurPage = 0;
|
|
30
32
|
this._SideEffect = side_effect;
|
|
33
|
+
this._OnAddDone = onAddDone;
|
|
31
34
|
this._Key =
|
|
32
35
|
this._MetroTemplate.direction === HORIZONTAL
|
|
33
36
|
? "left"
|
|
@@ -41,14 +44,14 @@ class TemplateItemAdder {
|
|
|
41
44
|
|
|
42
45
|
//过期属性警告
|
|
43
46
|
if (typeof measureObj.doSlide !== "undefined") {
|
|
44
|
-
measureObj.itemSlide = measureObj.doSlide ?
|
|
45
|
-
|
|
47
|
+
measureObj.itemSlide = measureObj.doSlide ?
|
|
48
|
+
METRO_WIDGET_CONST.ITEM_SLIDE.ACT_ITEM_FOCUS : METRO_WIDGET_CONST.ITEM_SLIDE.ACT_FOCUS_RECT_EVENT;
|
|
46
49
|
console.warn("MetroWidget: doSlide will be deprecated soon. use itemSlide instead.");
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
let templateItem = this._MetroTemplate.addItem(measureObj);
|
|
50
53
|
this._SideEffect?.(itemData, templateItem, measureObj);
|
|
51
|
-
return templateItem;
|
|
54
|
+
return { templateObj: templateItem, measureObj: measureObj };
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
public tryAddItem(cur_item: TemplateItem | null = null, page_num: number = 1) {
|
|
@@ -60,9 +63,9 @@ class TemplateItemAdder {
|
|
|
60
63
|
) {
|
|
61
64
|
while (this._CurIndex < this._Data.length) {
|
|
62
65
|
try {
|
|
63
|
-
let
|
|
66
|
+
let { templateObj } = this.addDataToTemplate(this._Data, this._CurIndex);
|
|
64
67
|
this._CurIndex++;
|
|
65
|
-
if (
|
|
68
|
+
if (templateObj[this._Key] >= (this._CurPage + page_num) * this._PageRange) {
|
|
66
69
|
this._CurPage += page_num;
|
|
67
70
|
break;
|
|
68
71
|
}
|
|
@@ -77,6 +80,7 @@ class TemplateItemAdder {
|
|
|
77
80
|
this._MetroTemplate.calculateNeighborWhenAddStop();
|
|
78
81
|
added = true;
|
|
79
82
|
}
|
|
83
|
+
this._OnAddDone?.();
|
|
80
84
|
// 添加完成需要计算neighbor
|
|
81
85
|
return added;
|
|
82
86
|
}
|
|
@@ -86,6 +90,7 @@ class TemplateItemAdder {
|
|
|
86
90
|
if (page_num > this._CurPage) {
|
|
87
91
|
this.tryAddItem(null, page_num - this._CurPage);
|
|
88
92
|
}
|
|
93
|
+
this._OnAddDone?.();
|
|
89
94
|
}
|
|
90
95
|
|
|
91
96
|
tryAddItemByIndex(index: number) {
|
|
@@ -94,9 +99,9 @@ class TemplateItemAdder {
|
|
|
94
99
|
while (this._CurIndex <= _index) {
|
|
95
100
|
added = true;
|
|
96
101
|
try {
|
|
97
|
-
let
|
|
102
|
+
let { templateObj } = this.addDataToTemplate(this._Data, this._CurIndex);
|
|
98
103
|
this._CurIndex++;
|
|
99
|
-
if (
|
|
104
|
+
if (templateObj[this._Key] >= (this._CurPage + 1) * this._PageRange) {
|
|
100
105
|
this._CurPage++;
|
|
101
106
|
}
|
|
102
107
|
} catch (e) {
|
|
@@ -112,6 +117,7 @@ class TemplateItemAdder {
|
|
|
112
117
|
}
|
|
113
118
|
//再添加一屏
|
|
114
119
|
this.tryAddItem(this._MetroTemplate.getItemByIndex(index), 2);
|
|
120
|
+
this._OnAddDone?.();
|
|
115
121
|
}
|
|
116
122
|
|
|
117
123
|
tryAddItemById(id: number) {
|
|
@@ -123,9 +129,9 @@ class TemplateItemAdder {
|
|
|
123
129
|
while (cur_id < _id && this._CurIndex < this._Data.length) {
|
|
124
130
|
added = true;
|
|
125
131
|
try {
|
|
126
|
-
let
|
|
127
|
-
cur_id =
|
|
128
|
-
if (
|
|
132
|
+
let { templateObj } = this.addDataToTemplate(this._Data, this._CurIndex);
|
|
133
|
+
cur_id = templateObj.id;
|
|
134
|
+
if (templateObj[this._Key] >= (this._CurPage + 1) * this._PageRange) {
|
|
129
135
|
this._CurPage++;
|
|
130
136
|
}
|
|
131
137
|
this._CurIndex++;
|
|
@@ -143,6 +149,41 @@ class TemplateItemAdder {
|
|
|
143
149
|
}
|
|
144
150
|
//再添加一屏
|
|
145
151
|
this.tryAddItem(this._MetroTemplate.getItemById(id), 2);
|
|
152
|
+
this._OnAddDone?.();
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
tryAddItemByUid(uid: string) {
|
|
156
|
+
if (this._MetroTemplate.getItemByUid(uid)) {
|
|
157
|
+
//已经添加
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
let added = false;
|
|
161
|
+
let targetItem: TemplateItem | null = null;
|
|
162
|
+
while (!targetItem && this._CurIndex < this._Data.length) {
|
|
163
|
+
added = true;
|
|
164
|
+
try {
|
|
165
|
+
let { templateObj, measureObj } = this.addDataToTemplate(this._Data, this._CurIndex);
|
|
166
|
+
if (measureObj.uid == uid) {
|
|
167
|
+
targetItem = templateObj;
|
|
168
|
+
}
|
|
169
|
+
this._CurIndex++;
|
|
170
|
+
if (templateObj[this._Key] >= (this._CurPage + 1) * this._PageRange) {
|
|
171
|
+
this._CurPage++;
|
|
172
|
+
}
|
|
173
|
+
} catch (e) {
|
|
174
|
+
console.error(
|
|
175
|
+
`MetroWidget: ${this._ID} parse template item ${this._CurIndex} failed. data:`,
|
|
176
|
+
this._Data
|
|
177
|
+
);
|
|
178
|
+
throw e;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
if (added) {
|
|
182
|
+
this._MetroTemplate.calculateNeighborWhenAddStop();
|
|
183
|
+
}
|
|
184
|
+
if (targetItem) {
|
|
185
|
+
this.tryAddItem(targetItem, 2);
|
|
186
|
+
}
|
|
146
187
|
}
|
|
147
188
|
|
|
148
189
|
updateData(data: Array<object>) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*!
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2021-06-16 10:07:20
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
@@ -13,5 +13,5 @@ export { default as MetroWidget } from "./MetroWidget/MetroWidget.vue";
|
|
|
13
13
|
export { default as ListWidget } from "./MetroWidget/ListWidget.vue";
|
|
14
14
|
export { METRO_WIDGET, METRO_WIDGET_CONST } from "./MetroWidget/Const.ts";
|
|
15
15
|
|
|
16
|
-
export { default as JsvFocusBlock } from "./JsvFocusBlock.vue";
|
|
17
|
-
export { jsvCreateFocusManager, useFocusHub } from "./JsvFocusManager";
|
|
16
|
+
export { default as JsvFocusBlock } from "./JsvFocus/JsvFocusBlock.vue";
|
|
17
|
+
export { jsvCreateFocusManager, useFocusHub } from "./JsvFocus/JsvFocusManager";
|
|
@@ -7,6 +7,7 @@ import JsvAudioBridgeProxy from "./JsvAudioBridgeProxy";
|
|
|
7
7
|
import { checkType, toRawType } from "./CheckType";
|
|
8
8
|
import sPluginLoader from "./PluginLoader";
|
|
9
9
|
import Events from "./Events.js"
|
|
10
|
+
import { ScreenLockManager } from "./ScreenLockManager.js";
|
|
10
11
|
|
|
11
12
|
const TAG = "JsvAudio";
|
|
12
13
|
|
|
@@ -325,6 +326,14 @@ class AudioProxy {
|
|
|
325
326
|
this.pause();
|
|
326
327
|
}
|
|
327
328
|
}
|
|
329
|
+
|
|
330
|
+
//屏保开关
|
|
331
|
+
closeScreenSaver() {
|
|
332
|
+
ScreenLockManager.lock();
|
|
333
|
+
}
|
|
334
|
+
openScreenSaver() {
|
|
335
|
+
ScreenLockManager.unlock();
|
|
336
|
+
}
|
|
328
337
|
}
|
|
329
338
|
|
|
330
339
|
export { sAudioManager, getKeyToken };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
// import playerExMethods from "./JsvMediaBrowserInterface.js"
|
|
3
|
-
import JsvSystemAudio from
|
|
3
|
+
import JsvSystemAudio from "./JsvSystemAudio.vue";
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
components: {
|
|
@@ -16,8 +16,15 @@ export default {
|
|
|
16
16
|
},
|
|
17
17
|
methods: {
|
|
18
18
|
onRefProxy(audio_ref) {
|
|
19
|
+
if (audio_ref != null) {
|
|
20
|
+
audio_ref.closeScreenSaver = () => {
|
|
21
|
+
//浏览器端仅提供接口, 不实现功能
|
|
22
|
+
};
|
|
23
|
+
audio_ref.openScreenSaver = () => {
|
|
24
|
+
//浏览器端仅提供接口, 不实现功能
|
|
25
|
+
};
|
|
26
|
+
}
|
|
19
27
|
this.audioRef = audio_ref;
|
|
20
|
-
|
|
21
28
|
// 不在此直接回调 onRef,因为onRefProxy可能会因为 .src的设置导致重新触发一次调用(vue本身问题)
|
|
22
29
|
// 参照vue-core处理的 componentUpdateFn处理, onMounted 一次, src设置后会再次 onPatch 一次
|
|
23
30
|
},
|
|
@@ -37,6 +44,7 @@ export default {
|
|
|
37
44
|
}
|
|
38
45
|
},
|
|
39
46
|
beforeUnmount() {
|
|
47
|
+
this.audioRef?.closeScreenSaver();
|
|
40
48
|
if (this.onRef) {
|
|
41
49
|
// audio_ref为null,代表video标签卸载处理
|
|
42
50
|
this.onRef(null);
|
|
@@ -47,4 +55,4 @@ export default {
|
|
|
47
55
|
|
|
48
56
|
<template>
|
|
49
57
|
<jsv-system-audio :onRef="onRefProxy" v-bind="$attrs" />
|
|
50
|
-
</template>
|
|
58
|
+
</template>
|
|
@@ -7,6 +7,7 @@ export default class {
|
|
|
7
7
|
static isReady() {
|
|
8
8
|
return typeof window.jsvAudioBridge != "undefined" && !!window.jsvAudioBridge;
|
|
9
9
|
}
|
|
10
|
+
|
|
10
11
|
static CreateAudio(key) {
|
|
11
12
|
if (typeof window.jsvAudioBridge != "undefined"
|
|
12
13
|
&& typeof window.jsvAudioBridge.CreateAudio != "undefined") {
|
|
@@ -40,4 +41,11 @@ export default class {
|
|
|
40
41
|
return window.jsvAudioBridge.SetProperty(key, params);
|
|
41
42
|
}
|
|
42
43
|
}
|
|
44
|
+
|
|
45
|
+
static ScreenWakeLock(lock) {
|
|
46
|
+
if (typeof window.jsvAudioBridge != "undefined"
|
|
47
|
+
&& typeof window.jsvAudioBridge.ScreenWakeLock != "undefined") {
|
|
48
|
+
window.jsvAudioBridge.ScreenWakeLock(lock);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
43
51
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import JsvAudioBridgeProxy from "./JsvAudioBridgeProxy";
|
|
2
|
+
|
|
3
|
+
export class ScreenLockManager {
|
|
4
|
+
static refCount = 0;
|
|
5
|
+
static lock() {
|
|
6
|
+
ScreenLockManager.refCount++;
|
|
7
|
+
JsvAudioBridgeProxy.ScreenWakeLock(true)
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
static unlock() {
|
|
11
|
+
ScreenLockManager.refCount = Math.max(0, ScreenLockManager.refCount - 1);
|
|
12
|
+
if (ScreenLockManager.refCount == 0) {
|
|
13
|
+
JsvAudioBridgeProxy.ScreenWakeLock(false)
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -7,9 +7,9 @@ let PluginInfo = {
|
|
|
7
7
|
// downloadUrl:"http://192.168.0.63:8080/plugin/JsvAudio-164.zip", //插件下载地址
|
|
8
8
|
packageName: "com.qcode.jsvaudio",
|
|
9
9
|
name: "音频插件",
|
|
10
|
-
version: "1.0.
|
|
11
|
-
versionCodeMin:
|
|
12
|
-
versionCodeMax:
|
|
10
|
+
version: "1.0.26", //插件需要的版本号
|
|
11
|
+
versionCodeMin: 26,
|
|
12
|
+
versionCodeMax: 26,
|
|
13
13
|
bridgeName: "jsvAudioBridge", //插件bridge注册到jsview的名称
|
|
14
14
|
className: "com.qcode.jsvaudio.JsvAudio", //插件初始化类名称
|
|
15
15
|
initMethod: "createInstance", //插件初始化方法
|
|
@@ -7,9 +7,9 @@ let PluginInfo = {
|
|
|
7
7
|
// downloadUrl:"http://192.168.0.63:8080/plugin/JsvAudio-164.zip", //插件下载地址
|
|
8
8
|
packageName: "com.qcode.jsvaudio",
|
|
9
9
|
name: "音频插件",
|
|
10
|
-
version: "1.0.
|
|
11
|
-
versionCodeMin:
|
|
12
|
-
versionCodeMax:
|
|
10
|
+
version: "1.0.26", //插件需要的版本号
|
|
11
|
+
versionCodeMin: 26,
|
|
12
|
+
versionCodeMax: 26,
|
|
13
13
|
bridgeName: "jsvAudioBridge", //插件bridge注册到jsview的名称
|
|
14
14
|
className: "com.qcode.jsvaudio.JsvAudio", //插件初始化类名称
|
|
15
15
|
initMethod: "createInstance", //插件初始化方法
|
|
@@ -10,7 +10,7 @@ let globalLoadJsvLatexPlugin;
|
|
|
10
10
|
let _JsvLatex;
|
|
11
11
|
|
|
12
12
|
if (!window.JsView) {
|
|
13
|
-
const BrowserJsvLatex = await import("./
|
|
13
|
+
const BrowserJsvLatex = await import("./BrowserJsvLatex.vue");
|
|
14
14
|
//browser
|
|
15
15
|
globalLoadJsvLatexPlugin = (listener) => {
|
|
16
16
|
setTimeout(listener, 0);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import {JsvMediaVideo, JsvMediaAudio, findMediaObjectByKey, logDebug} from './JsvMedia'
|
|
3
|
-
import JsvNativeSharedDiv from '
|
|
3
|
+
import { JsvNativeSharedDiv } from '../../JsViewVueWidget'
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
export default {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
//! 考虑到.vue文件除了export default的component外,还有可能export其他对象,因此使用import * as
|
|
2
2
|
import { default as JsvPlayer } from "./JsvPlayer.vue";
|
|
3
3
|
import { globalLoadJsvPlayerPlugin as initPlugin } from "./JsvMedia.js"
|
|
4
4
|
import { globalPreLoadJsvPlayerPlugin as preLoadPlugin } from "./JsvMedia.js"
|
|
@@ -6,7 +6,7 @@ import { getJsvPlayerCapabilitySet as getCapabilitySet } from "./JsvMedia.js"
|
|
|
6
6
|
import { setJsvPlayerDebugMode as setDebugMode } from "./JsvMedia.js"
|
|
7
7
|
import { getJsvPlayerRunningNum as getRunningPlayerNum } from "./JsvMedia.js"
|
|
8
8
|
import { globalLoadSetOperator as setOperator } from "./JsvMedia.js"
|
|
9
|
-
import {default as BrowserPlayer} from "./
|
|
9
|
+
import {default as BrowserPlayer} from "./BrowserJsvPlayer-0.9.vue"
|
|
10
10
|
let _JsvPlayer = JsvPlayer;
|
|
11
11
|
|
|
12
12
|
let globalLoadJsvPlayerPlugin = initPlugin;
|
|
@@ -17,7 +17,7 @@ let getJsvPlayerRunningNum = getRunningPlayerNum;
|
|
|
17
17
|
let globalLoadSetOperator = setOperator;
|
|
18
18
|
|
|
19
19
|
if (window.jsvIsBrowserDebug) {
|
|
20
|
-
// const BrowserPlayer = await import("./
|
|
20
|
+
// const BrowserPlayer = await import("./BrowserJsvPlayer.vue");
|
|
21
21
|
// 浏览器版本
|
|
22
22
|
_JsvPlayer = BrowserPlayer;
|
|
23
23
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
//! 考虑到.vue文件除了export default的component外,还有可能export其他对象,因此使用import * as
|
|
2
2
|
import { default as JsvPlayer } from "./JsvPlayer.vue";
|
|
3
3
|
import { globalLoadJsvPlayerPlugin as initPlugin } from "./JsvMedia.js"
|
|
4
4
|
import { globalPreLoadJsvPlayerPlugin as preLoadPlugin } from "./JsvMedia.js"
|
|
@@ -16,7 +16,7 @@ let getJsvPlayerRunningNum = getRunningPlayerNum;
|
|
|
16
16
|
let globalLoadSetOperator = setOperator;
|
|
17
17
|
|
|
18
18
|
if (window.jsvIsBrowserDebug) {
|
|
19
|
-
const BrowserPlayer = await import("./
|
|
19
|
+
const BrowserPlayer = await import("./BrowserJsvPlayer.vue");
|
|
20
20
|
// 浏览器版本
|
|
21
21
|
_JsvPlayer = BrowserPlayer.default;
|
|
22
22
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
//! 用于存储用于Debug的全局引用
|
|
4
4
|
let DebugObjectRefer = {
|
|
5
5
|
RootRouter: null,
|
|
6
6
|
};
|
|
@@ -34,7 +34,7 @@ function DebugWrap81WarnStack() {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
//! 全局引用,以便于在devtools中能直接进行查询
|
|
38
38
|
window.JsvDebugTools = DebugTools;
|
|
39
39
|
|
|
40
40
|
export {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Created by donglin.lu@qcast.cn on 11/13/2020.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/*!
|
|
6
6
|
* 【模块 export 内容】
|
|
7
7
|
* getKeyFramesGroup: 函数,获取KeyFrame操作类 KeyFrameStyleSheet
|
|
8
8
|
* KeyFrameStyleSheet:面向对象类,KeyFrames CSS rule的操作类,用于添加和删除KeyFrame
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* hasRule(name) 查询KeyFrame是否存在
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
/*!
|
|
17
17
|
* getKeyFramesGroup 参数说明:
|
|
18
18
|
* anchor_tag (String) keyFrame的名称,可以不设置或者为undefined
|
|
19
19
|
* 返回值:
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Created by donglin.lu@qcast.cn on 4/30/2020.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
/*!
|
|
13
13
|
* 【模块 export 内容】
|
|
14
14
|
* createImpactTracer: 函数,创建碰撞跟踪对象
|
|
15
15
|
* createImpactCallback: 函数,创建碰撞发生后的回调函数
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
/*!
|
|
23
23
|
* createImpactCallback 参数说明:
|
|
24
24
|
* on_contact (function[]) 接受碰撞事件的回调
|
|
25
25
|
* on_dis_contact (function[]) 接受物体分离事件的回调
|
|
@@ -30,7 +30,7 @@ function createImpactCallback(on_contact, on_dis_contact) {
|
|
|
30
30
|
return new Forge.sImpactSensorManager.Callback(on_contact, on_dis_contact);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
/*!
|
|
34
34
|
* createImpactTracer 参数说明:
|
|
35
35
|
* ele1 (Element) html element句柄,1号碰撞体
|
|
36
36
|
* ele2 (Element) html element句柄,2号碰撞体
|
|
@@ -43,8 +43,8 @@ function createImpactTracer(ele1, ele2, callback, auto_froze) {
|
|
|
43
43
|
return Forge.sImpactSensorManager.StartTrace(ele1.jsvGetProxyView(), ele2.jsvGetProxyView(), callback, auto_froze);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
//! 创建用于设置碰撞即停管理对象的参数
|
|
47
|
+
//! 结果用于函数 createImpactAutoFroze 和 updateImpactAutoFroze
|
|
48
48
|
function _ConvertToViewsList(elements_array) {
|
|
49
49
|
const views_array = [];
|
|
50
50
|
if (elements_array) {
|
|
@@ -55,7 +55,7 @@ function _ConvertToViewsList(elements_array) {
|
|
|
55
55
|
return views_array;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
/*!
|
|
59
59
|
* createImpactAutoFroze 参数说明:
|
|
60
60
|
* element_auto_froze_pre_impact (Array<Element>) 关联运动元素的列表,这些元素碰撞前一帧停止运动
|
|
61
61
|
* element_auto_froze_on_impact (Array<Element>) 关联运动元素的列表,这些元素碰撞当前帧停止运动
|
|
@@ -81,7 +81,7 @@ function createImpactAutoFroze(element_auto_froze_pre_impact, element_auto_froze
|
|
|
81
81
|
(on_impact_list.length > 0 ? on_impact_list : null));
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
/*!
|
|
85
85
|
* updateImpactAutoFroze 参数说明:
|
|
86
86
|
* handler (Object) 由 createImpactAutoFroze 创建的句柄
|
|
87
87
|
* element_auto_froze_pre_impact (Array<Element>) 关联运动元素的列表,这些元素碰撞前一帧停止运动
|