@shijiu/jsview-vue 1.9.915 → 1.9.931
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/JsViewVueTools/ForgeHandles.js +13 -0
- package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +5 -5
- package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +1 -1
- package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +1 -0
- package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +5 -4
- package/utils/JsViewVueWidget/JsvNinePatch.vue +63 -53
- package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +5 -4
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +3 -2
- package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +3 -2
- package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +4 -3
- package/utils/JsViewVueWidget/JsvTransparentDiv.vue +5 -5
package/package.json
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
let handles = {
|
|
2
|
+
TextureManager: null,
|
|
3
|
+
RootView: null,
|
|
4
|
+
RootActivity: null
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
window.JsvCode.ForgeHandles.listenToReady(()=>{
|
|
8
|
+
handles.TextureManager = window.JsvCode.ForgeHandles.TextureManager;
|
|
9
|
+
handles.RootView = window.JsvCode.ForgeHandles.RootView;
|
|
10
|
+
handles.RootActivity = window.JsvCode.ForgeHandles.RootActivity;
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
export default handles;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* play(): 开始播放
|
|
21
21
|
-->
|
|
22
22
|
<script>
|
|
23
|
-
import
|
|
23
|
+
import ForgeHandles from "../../JsViewVueTools/ForgeHandles";
|
|
24
24
|
|
|
25
25
|
let LOOP_DEFAULT = 0;
|
|
26
26
|
let LOOP_INFINITE = 1;
|
|
@@ -69,7 +69,7 @@ export default {
|
|
|
69
69
|
play() {
|
|
70
70
|
if (this.$refs.element) {
|
|
71
71
|
let mainViewTexture = this.$refs.element.jsvGetProxyTexture(
|
|
72
|
-
|
|
72
|
+
ForgeHandles.TextureManager
|
|
73
73
|
);
|
|
74
74
|
|
|
75
75
|
let params = {
|
|
@@ -93,7 +93,7 @@ export default {
|
|
|
93
93
|
stop() {
|
|
94
94
|
if (this.$refs.element) {
|
|
95
95
|
let mainViewTexture = this.$refs.element.jsvGetProxyTexture(
|
|
96
|
-
|
|
96
|
+
ForgeHandles.TextureManager
|
|
97
97
|
);
|
|
98
98
|
mainViewTexture.DispatchCommand(Forge.NativeConstant.APIC_STOP, "");
|
|
99
99
|
}
|
|
@@ -106,7 +106,7 @@ export default {
|
|
|
106
106
|
if (this.onLoad) {
|
|
107
107
|
if (this.$refs.element) {
|
|
108
108
|
let mainViewTexture = this.$refs.element.jsvGetProxyTexture(
|
|
109
|
-
|
|
109
|
+
ForgeHandles.TextureManager
|
|
110
110
|
);
|
|
111
111
|
mainViewTexture.RegisterLoadImageCallback(null, this.onLoad, null);
|
|
112
112
|
}
|
|
@@ -116,7 +116,7 @@ export default {
|
|
|
116
116
|
this.stop();
|
|
117
117
|
if (this.$refs.element) {
|
|
118
118
|
let mainViewTexture = this.$refs.element.jsvGetProxyTexture(
|
|
119
|
-
|
|
119
|
+
ForgeHandles.TextureManager
|
|
120
120
|
);
|
|
121
121
|
|
|
122
122
|
if (this.onStart) {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
-->
|
|
7
7
|
<script>
|
|
8
8
|
import { EdgeDirection } from "jsview/utils/JsViewEngineWidget";
|
|
9
|
-
import { Forge
|
|
9
|
+
import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
|
|
10
10
|
import CursorVue from "./Cursor.vue";
|
|
11
11
|
|
|
12
12
|
const InputType = {
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
-->
|
|
9
9
|
|
|
10
10
|
<script>
|
|
11
|
-
import { Forge
|
|
11
|
+
import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
|
|
12
|
+
import ForgeHandles from "../JsViewVueTools/ForgeHandles";
|
|
12
13
|
|
|
13
14
|
export default {
|
|
14
15
|
props: {
|
|
@@ -44,7 +45,7 @@ export default {
|
|
|
44
45
|
let textureSetting = null;
|
|
45
46
|
if (this.seeThrough) {
|
|
46
47
|
const seeThroughTexture =
|
|
47
|
-
|
|
48
|
+
ForgeHandles.TextureManager.GetColorTexture("rgba(0,0,0,0)");
|
|
48
49
|
textureSetting = new Forge.TextureSetting(
|
|
49
50
|
seeThroughTexture,
|
|
50
51
|
null,
|
|
@@ -55,7 +56,7 @@ export default {
|
|
|
55
56
|
|
|
56
57
|
// 通过内置函数构造定制的NativeSharedView
|
|
57
58
|
this.jsvMainView = new Forge.NativeSharedView(textureSetting);
|
|
58
|
-
this.innerViewId =
|
|
59
|
+
this.innerViewId = ForgeHandles.RootActivity.ViewStore.add(
|
|
59
60
|
new Forge.ViewInfo(this.jsvMainView)
|
|
60
61
|
);
|
|
61
62
|
|
|
@@ -76,7 +77,7 @@ export default {
|
|
|
76
77
|
|
|
77
78
|
// 清理View管理缓存
|
|
78
79
|
if (this.innerViewId !== -1) {
|
|
79
|
-
|
|
80
|
+
ForgeHandles.RootActivity.ViewStore.remove(this.innerViewId);
|
|
80
81
|
this.innerViewId = -1;
|
|
81
82
|
this.jsvMainView = null;
|
|
82
83
|
}
|
|
@@ -16,64 +16,77 @@
|
|
|
16
16
|
* waitForInit {boolean} (选填)尺寸为0时是否进行描画(例如: 首次显示不展示动画的场合,设置为true),默认值为true
|
|
17
17
|
-->
|
|
18
18
|
|
|
19
|
-
<script>
|
|
20
|
-
|
|
21
|
-
name: "JsvNinePatch",
|
|
22
|
-
props: {
|
|
23
|
-
style: {
|
|
24
|
-
type: Object,
|
|
25
|
-
default: () => {
|
|
26
|
-
return {};
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
top: { type: Number, default: 0 },
|
|
30
|
-
left: { type: Number, default: 0 },
|
|
31
|
-
waitForInit: { type: Boolean, default: true },
|
|
32
|
-
|
|
33
|
-
imageUrl: { type:String, required: true },
|
|
34
|
-
imageWidth: { type:Number, required: true },
|
|
35
|
-
imageDspWidth: { type:Number, default:0 },
|
|
36
|
-
contentWidth: { type:Number, default: -1},
|
|
37
|
-
centerWidth: { type:Number, default: -1, required: true },
|
|
38
|
-
borderOutset: { type:Number, required: true },
|
|
39
|
-
animTime: Number,
|
|
40
|
-
},
|
|
19
|
+
<script setup>
|
|
20
|
+
import { ref, watchEffect, computed } from "vue";
|
|
41
21
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
return this.style && this.style.width !== 0 && this.style.height !== 0;
|
|
48
|
-
},
|
|
49
|
-
getTransition() {
|
|
50
|
-
let transition = "";
|
|
51
|
-
if (this.animTime) {
|
|
52
|
-
transition = `left ${this.animTime}s, top ${this.animTime}s, width ${this.animTime}s, height ${this.animTime}s`;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return transition;
|
|
22
|
+
const props = defineProps({
|
|
23
|
+
style: {
|
|
24
|
+
type: Object,
|
|
25
|
+
default: () => {
|
|
26
|
+
return {};
|
|
56
27
|
},
|
|
57
28
|
},
|
|
29
|
+
top: { type: Number, default: 0 },
|
|
30
|
+
left: { type: Number, default: 0 },
|
|
31
|
+
waitForInit: { type: Boolean, default: true },
|
|
58
32
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
33
|
+
imageUrl: { type: String, required: true },
|
|
34
|
+
imageWidth: { type: Number, required: true },
|
|
35
|
+
imageDspWidth: { type: Number, default: 0 },
|
|
36
|
+
contentWidth: { type: Number, default: -1 },
|
|
37
|
+
centerWidth: { type: Number, default: -1, required: true },
|
|
38
|
+
borderOutset: { type: Number, required: true },
|
|
39
|
+
animTime: { type: Number, default: 0 },
|
|
40
|
+
});
|
|
64
41
|
|
|
65
|
-
|
|
66
|
-
|
|
42
|
+
const isReady = () => {
|
|
43
|
+
if (!props.waitForInit) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
return props.style && props.style.width !== 0 && props.style.height !== 0;
|
|
47
|
+
};
|
|
67
48
|
|
|
68
|
-
|
|
49
|
+
const getTransition = () => {
|
|
50
|
+
let transition = "";
|
|
51
|
+
if (props.animTime && props.animTime > 0) {
|
|
52
|
+
transition = `left ${props.animTime}s, top ${props.animTime}s, width ${props.animTime}s, height ${props.animTime}s`;
|
|
53
|
+
}
|
|
69
54
|
|
|
70
|
-
|
|
71
|
-
sliceWidth: slice_width,
|
|
72
|
-
borderDspWidth: Math.ceil(slice_width * image_dsp_width / this.imageWidth), // 跟进图片的缩放信息
|
|
73
|
-
convertedBorderOutset: Math.ceil(this.borderOutset * image_dsp_width / this.imageWidth),
|
|
74
|
-
};
|
|
75
|
-
},
|
|
55
|
+
return transition;
|
|
76
56
|
};
|
|
57
|
+
|
|
58
|
+
let centerWidth = props.contentWidth >= 0 ? props.contentWidth : 0; // 兼容处理,contentWidth变更为centerWidth
|
|
59
|
+
if (props.centerWidth >= 0) {
|
|
60
|
+
centerWidth = props.centerWidth;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const imageDspWidthInner = computed(() =>
|
|
64
|
+
props.imageDspWidth > 0 ? props.imageDspWidth : props.imageWidth
|
|
65
|
+
);
|
|
66
|
+
// slice_width 获取
|
|
67
|
+
const sliceWidth = ref(
|
|
68
|
+
Math.ceil(Math.max(0, (props.imageWidth - centerWidth) / 2))
|
|
69
|
+
);
|
|
70
|
+
const borderDspWidth = ref(
|
|
71
|
+
Math.ceil((sliceWidth.value * imageDspWidthInner.value) / props.imageWidth)
|
|
72
|
+
);
|
|
73
|
+
const convertedBorderOutset = ref(
|
|
74
|
+
Math.ceil((props.borderOutset * imageDspWidthInner.value) / props.imageWidth)
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
watchEffect(() => {
|
|
78
|
+
if (
|
|
79
|
+
(props.style?.width && props.style.width <= imageDspWidthInner.value) ||
|
|
80
|
+
(props.style?.height && props.style.height <= imageDspWidthInner.value)
|
|
81
|
+
) {
|
|
82
|
+
console.warn(
|
|
83
|
+
"JsvNinePatch: style size must be larger than imageDspWidth. style is",
|
|
84
|
+
props.style,
|
|
85
|
+
"imageDspWidth is",
|
|
86
|
+
imageDspWidthInner.value
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
77
90
|
</script>
|
|
78
91
|
|
|
79
92
|
<template>
|
|
@@ -88,6 +101,3 @@ export default {
|
|
|
88
101
|
}"
|
|
89
102
|
/>
|
|
90
103
|
</template>
|
|
91
|
-
|
|
92
|
-
<style scoped>
|
|
93
|
-
</style>
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
* net_setting {object}: (未实现)网络加载参数,cookie, refer等,默认值 null
|
|
35
35
|
-->
|
|
36
36
|
<script>
|
|
37
|
-
import { Forge
|
|
37
|
+
import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
|
|
38
|
+
import ForgeHandles from "../../JsViewVueTools/ForgeHandles";
|
|
38
39
|
|
|
39
40
|
const CONST_FORMAT_TOKEN = "_JsvP_";
|
|
40
41
|
const buildPreloadInfo = (
|
|
@@ -191,9 +192,9 @@ export default {
|
|
|
191
192
|
(image_url.toLowerCase().indexOf(".webp") >= 0 ||
|
|
192
193
|
image_url.toLowerCase().indexOf(".gif") >= 0)
|
|
193
194
|
) {
|
|
194
|
-
texture =
|
|
195
|
+
texture = ForgeHandles.TextureManager.GetGifImage(image_url, false);
|
|
195
196
|
} else {
|
|
196
|
-
texture =
|
|
197
|
+
texture = ForgeHandles.TextureManager.GetImage2(
|
|
197
198
|
image_url,
|
|
198
199
|
false,
|
|
199
200
|
target_size,
|
|
@@ -274,7 +275,7 @@ export default {
|
|
|
274
275
|
image_url = new window.JsView.Dom.UrlRef(base_url).href;
|
|
275
276
|
}
|
|
276
277
|
}
|
|
277
|
-
const texture =
|
|
278
|
+
const texture = ForgeHandles.TextureManager.GetDownloadTexture(
|
|
278
279
|
image_url,
|
|
279
280
|
null,
|
|
280
281
|
item.getImageSize
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
*/
|
|
17
17
|
-->
|
|
18
18
|
<script>
|
|
19
|
-
import { Forge
|
|
19
|
+
import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
|
|
20
|
+
import ForgeHandles from "../../JsViewVueTools/ForgeHandles";
|
|
20
21
|
|
|
21
22
|
export default {
|
|
22
23
|
props: {
|
|
@@ -57,7 +58,7 @@ export default {
|
|
|
57
58
|
|
|
58
59
|
let view = null;
|
|
59
60
|
let lp_params = null;
|
|
60
|
-
const texture_manager =
|
|
61
|
+
const texture_manager = ForgeHandles.TextureManager;
|
|
61
62
|
const qrcode_texture = texture_manager.GetQRCodeTexture(
|
|
62
63
|
this.value,
|
|
63
64
|
this.size,
|
|
@@ -31,13 +31,14 @@
|
|
|
31
31
|
* enableShrink {boolean} 粒子缩小开关, 默认为false
|
|
32
32
|
-->
|
|
33
33
|
<script>
|
|
34
|
-
import { Forge
|
|
34
|
+
import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
|
|
35
|
+
import ForgeHandles from "../../JsViewVueTools/ForgeHandles";
|
|
35
36
|
|
|
36
37
|
let buildForgeView = (pointRes, sprayStyle, sizeRef, ignoreClip) => {
|
|
37
38
|
if (!pointRes) {
|
|
38
39
|
return -1;
|
|
39
40
|
}
|
|
40
|
-
const texture_manager =
|
|
41
|
+
const texture_manager = ForgeHandles.TextureManager;
|
|
41
42
|
let texture_setting;
|
|
42
43
|
if (pointRes.trim().startsWith("#") || pointRes.trim().startsWith("rgba")) {
|
|
43
44
|
texture_setting = new Forge.TextureSetting(
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script>
|
|
9
|
-
import { Forge
|
|
9
|
+
import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
|
|
10
|
+
import ForgeHandles from "../../JsViewVueTools/ForgeHandles";
|
|
10
11
|
import {
|
|
11
12
|
numberCheckSet,
|
|
12
13
|
urlCheckSet,
|
|
@@ -194,7 +195,7 @@ export default {
|
|
|
194
195
|
},
|
|
195
196
|
|
|
196
197
|
_createNinePatchAlphaMixView(view_texture, decorate_setting) {
|
|
197
|
-
const textureManager =
|
|
198
|
+
const textureManager = ForgeHandles.TextureManager;
|
|
198
199
|
|
|
199
200
|
// NinePatch alpha mix view
|
|
200
201
|
let texture_set = new Forge.ExternalTextureSetting(view_texture);
|
|
@@ -298,7 +299,7 @@ export default {
|
|
|
298
299
|
|
|
299
300
|
created() {
|
|
300
301
|
if (window.JsView) {
|
|
301
|
-
const textureManager =
|
|
302
|
+
const textureManager = ForgeHandles.TextureManager;
|
|
302
303
|
|
|
303
304
|
// 1.获得主view的展示内容图片 texture
|
|
304
305
|
let image_url = urlCheckSet(this.src);
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
<script>
|
|
10
|
-
import { Forge
|
|
10
|
+
import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
|
|
11
|
+
import ForgeHandles from "../JsViewVueTools/ForgeHandles";
|
|
11
12
|
|
|
12
13
|
export default {
|
|
13
14
|
inheritAttrs: false,
|
|
@@ -29,8 +30,7 @@ export default {
|
|
|
29
30
|
// 初始化View
|
|
30
31
|
|
|
31
32
|
// 创建JsView图层穿透的texture,抠洞处理
|
|
32
|
-
const seeThroughTexture =
|
|
33
|
-
ForgeExtension.TextureManager.GetColorTexture("rgba(0,0,0,0)");
|
|
33
|
+
const seeThroughTexture = ForgeHandles.TextureManager.GetColorTexture("rgba(0,0,0,0)");
|
|
34
34
|
const textureSetting = new Forge.TextureSetting(
|
|
35
35
|
seeThroughTexture,
|
|
36
36
|
null,
|
|
@@ -40,7 +40,7 @@ export default {
|
|
|
40
40
|
|
|
41
41
|
// 通过内置函数构造定制的LayoutView
|
|
42
42
|
this.innerView = new Forge.LayoutView(textureSetting);
|
|
43
|
-
this.innerViewId =
|
|
43
|
+
this.innerViewId = ForgeHandles.RootActivity.ViewStore.add(
|
|
44
44
|
new Forge.ViewInfo(this.innerView)
|
|
45
45
|
);
|
|
46
46
|
}
|
|
@@ -54,7 +54,7 @@ export default {
|
|
|
54
54
|
},
|
|
55
55
|
beforeUnmount() {
|
|
56
56
|
if (this.innerViewId !== -1) {
|
|
57
|
-
|
|
57
|
+
ForgeHandles.RootActivity.ViewStore.remove(this.innerViewId);
|
|
58
58
|
this.innerViewId = -1;
|
|
59
59
|
this.innerView = null;
|
|
60
60
|
}
|