@shijiu/jsview-vue 2.1.448-test.0 → 2.1.476-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 +4 -4
- package/bin/browser/BrowserApic2.vue.mjs +4 -4
- package/bin/browser/BrowserApicLib.mjs +24 -24
- package/bin/browser/BrowserAudio.vue.mjs +8 -8
- package/bin/browser/BrowserJsvLatex.vue.mjs +27 -15
- package/bin/browser/BrowserPreload.vue.mjs +4 -4
- package/bin/browser/BrowserQrcode.vue.mjs +4 -4
- package/bin/browser/BrowserSpray.vue.mjs +4 -4
- package/bin/browser/BrowserTextureAnim.vue.mjs +4 -4
- package/bin/export-sfc.mjs +3 -3
- package/bin/jsview-vue-common.mjs +3 -3
- package/bin/jsview-vue.mjs +12053 -13883
- package/bin/types/browser/BrowserApic.vue.d.mts +33 -0
- package/bin/types/browser/BrowserApic2.vue.d.mts +16 -0
- package/bin/types/browser/BrowserApicLib.d.mts +56 -0
- package/bin/types/browser/BrowserAudio.vue.d.mts +2 -0
- package/bin/types/browser/BrowserJsvLatex.vue.d.mts +55 -0
- package/bin/types/browser/BrowserPreload.vue.d.mts +14 -0
- package/bin/types/browser/BrowserQrcode.vue.d.mts +29 -0
- package/bin/types/browser/BrowserSpray.vue.d.mts +2 -0
- package/bin/types/browser/BrowserTextureAnim.vue.d.mts +2 -0
- package/bin/types/export-sfc.d.mts +2 -0
- package/bin/types/jsview-vue-common.d.mts +23 -0
- package/bin/types/jsview-vue.d.mts +2511 -0
- package/index.d.ts +3 -4
- package/package.json +1 -1
- package/tools/config/tsconfig.json +7 -10
- package/tools/jsview-vue-build.mjs +25 -4
- package/utils/JsViewEngineWidget/MetroWidget/SlotComponent.vue +0 -1
- package/utils/JsViewPlugin/JsvAudio/AudioProxy.js +11 -3
- package/utils/JsViewPlugin/JsvAudio/JsvAudio.vue +6 -3
- package/utils/JsViewPlugin/JsvAudio/JsvAudioProxy.vue +20 -0
- package/utils/JsViewPlugin/JsvAudio/PluginLoader.js +13 -3
- package/utils/JsViewPlugin/JsvAudio/index.js +11 -16
- package/utils/JsViewPlugin/JsvLatex/BrowserJsvLatex.vue +22 -5
- package/utils/JsViewPlugin/JsvLatex/JsvLatex.vue +3 -1
- package/utils/JsViewPlugin/JsvLatex/JsvLatexProxy.vue +20 -0
- package/utils/JsViewPlugin/JsvLatex/PluginLoader.js +13 -3
- package/utils/JsViewPlugin/JsvLatex/index.js +11 -16
- package/utils/JsViewPlugin/index.js +1 -1
- package/utils/JsViewVueTools/ForgeHandles.ts +14 -0
- package/utils/JsViewVueTools/{JsvDynamicKeyFrames.js → JsvDynamicKeyFrames.ts} +2 -2
- package/utils/JsViewVueTools/JsvFederationTools.ts +35 -0
- package/utils/JsViewVueTools/JsvPreDownloader.ts +36 -37
- package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CanvasTexture.ts +1 -1
- package/utils/JsViewVueTools/index.js +2 -1
- package/utils/JsViewVueWidget/JsvFreeMoveActor/JsvEnvBlocker.vue +4 -0
- package/utils/JsViewVueWidget/JsvMindMap/JsvMindMap.vue +1 -1
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +2 -1
- package/utils/JsViewVueWidget/JsvSpriteAnim/FrameBuidler.ts +11 -7
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +135 -61
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteTools.ts +26 -0
- package/utils/JsViewVueWidget/JsvSpriteAnim/index.js +8 -1
- package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +6 -0
- package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +1 -1
- package/bin/browser/BrowserJsvPlayer.vue.mjs +0 -573
- package/utils/JsViewEngineWidget/index.d.ts +0 -28
- package/utils/JsViewPlugin/JsvLatex/mathjax-tex-svg.txt +0 -1
- package/utils/JsViewPlugin/index.d.ts +0 -1
- package/utils/JsViewVueTools/ForgeHandles.js +0 -13
- package/utils/JsViewVueTools/index.d.ts +0 -13
- /package/utils/JsViewVueWidget/JsvSpriteAnim/{sAnimationToken.js → sAnimationToken.ts} +0 -0
package/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./utils
|
|
4
|
-
export * from "./utils/JsViewVueWidget";
|
|
1
|
+
// 二选一 "./bin" 用于执行打包的js,"./utils" 用于调试
|
|
2
|
+
export * from "./bin/types/jsview-vue.d.mjs";
|
|
3
|
+
// export * from "./utils";
|
package/package.json
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"target": "
|
|
3
|
+
"target": "es2022",
|
|
4
4
|
"module": "es2022",
|
|
5
5
|
"moduleResolution": "node",
|
|
6
6
|
"strict": true,
|
|
7
|
-
"jsx": "preserve",
|
|
8
|
-
"resolveJsonModule": true,
|
|
9
|
-
"noEmit": true,
|
|
10
7
|
"allowJs": true,
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"emitDeclarationOnly": true,
|
|
10
|
+
"declarationDir": "../../bin/types"
|
|
14
11
|
},
|
|
15
|
-
"include": [
|
|
16
|
-
"
|
|
17
|
-
]
|
|
12
|
+
"include": [
|
|
13
|
+
"../../bin/jsview-vue.mjs"
|
|
14
|
+
],
|
|
18
15
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
import fs from 'node:fs';
|
|
5
|
-
import path from 'path';
|
|
6
|
-
import url from 'url';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import url from 'node:url';
|
|
7
7
|
import {
|
|
8
8
|
checkNodeVersion,
|
|
9
9
|
execCommand,
|
|
@@ -11,12 +11,30 @@ import {
|
|
|
11
11
|
parseArguments,
|
|
12
12
|
} from '../../../@shijiu/jsview/tools/jsview-common.mjs';
|
|
13
13
|
|
|
14
|
+
function formatBannerRecursive(dir)
|
|
15
|
+
{
|
|
16
|
+
const fileNameList = fs.readdirSync(dir);
|
|
17
|
+
for(const fileName of fileNameList) {
|
|
18
|
+
const filePath = path.resolve(dir, fileName);
|
|
19
|
+
const stat = fs.statSync(filePath);
|
|
20
|
+
if(stat.isDirectory()) {
|
|
21
|
+
formatBannerRecursive(filePath);
|
|
22
|
+
} else {
|
|
23
|
+
let content = fs.readFileSync(filePath, 'utf-8');
|
|
24
|
+
content = content.replace(/\/\/!/g, '//');
|
|
25
|
+
content = content.replace(/\/\*!/g, '/*');
|
|
26
|
+
fs.writeFileSync(filePath, content, 'utf-8');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
14
31
|
async function main(argv)
|
|
15
32
|
{
|
|
16
33
|
checkNodeVersion();
|
|
17
34
|
|
|
18
35
|
const currJsFilePath = url.fileURLToPath(import.meta.url)
|
|
19
36
|
const jsviewVueDir = path.resolve(currJsFilePath, '../../') // jsview-framework/@shijiu/jsview-vue
|
|
37
|
+
const jsviewVueBinDir = path.resolve(jsviewVueDir, 'bin') // jsview-framework/@shijiu/jsview-vue/bin
|
|
20
38
|
|
|
21
39
|
const noSavePkgList = [
|
|
22
40
|
// jsview
|
|
@@ -27,6 +45,7 @@ async function main(argv)
|
|
|
27
45
|
// vue + vite
|
|
28
46
|
'vue@3.2.45',
|
|
29
47
|
'vue-router@4.1.6',
|
|
48
|
+
'@babel/types',
|
|
30
49
|
'@vitejs/plugin-vue@4.0.0',
|
|
31
50
|
'typescript@4.9.3',
|
|
32
51
|
'vite@4.0.0',
|
|
@@ -41,7 +60,7 @@ async function main(argv)
|
|
|
41
60
|
|
|
42
61
|
let batchCommand = []
|
|
43
62
|
|
|
44
|
-
fs.rmSync(
|
|
63
|
+
fs.rmSync(jsviewVueBinDir, { recursive: true, force: true });
|
|
45
64
|
if(!argv.withoutNpmInstall
|
|
46
65
|
|| fs.existsSync(`${jsviewVueDir}/node_modules`) == false) {
|
|
47
66
|
const registry = getNpmRegistry();
|
|
@@ -54,14 +73,16 @@ async function main(argv)
|
|
|
54
73
|
}
|
|
55
74
|
batchCommand = [
|
|
56
75
|
...batchCommand,
|
|
57
|
-
`${jsviewVueDir}/node_modules/.bin/vue-tsc --project ${jsviewVueDir}/tools/config/tsconfig.json`,
|
|
58
76
|
`JSVIEW_DISABLE_MANUALCHUNKS=true ${jsviewVueDir}/node_modules/.bin/vite build --config ${jsviewVueDir}/tools/config/vite.config.ts`,
|
|
59
77
|
`${version ? 'JSVIEW_VUE_VERSION='+version : ''} ${jsviewVueDir}/node_modules/.bin/rollup --config ${jsviewVueDir}/tools/config/rollup.config.mjs`,
|
|
78
|
+
`${jsviewVueDir}/node_modules/.bin/vue-tsc --project ${jsviewVueDir}/tools/config/tsconfig.json`,
|
|
60
79
|
];
|
|
61
80
|
for(const command of batchCommand) {
|
|
62
81
|
execCommand(`cd ${jsviewVueDir} && ${command}`);
|
|
63
82
|
}
|
|
64
83
|
|
|
84
|
+
formatBannerRecursive(jsviewVueBinDir);
|
|
85
|
+
|
|
65
86
|
if(!argv.withoutNpmInstall) {
|
|
66
87
|
fs.rmSync(`${jsviewVueDir}/node_modules`, { recursive: true, force: true });
|
|
67
88
|
fs.rmSync(`${jsviewVueDir}/package-lock.json`, { recursive: true, force: true });
|
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import JsvAudioBridgeProxy from "./JsvAudioBridgeProxy";
|
|
7
7
|
import { checkType, toRawType } from "./CheckType";
|
|
8
|
-
import
|
|
8
|
+
import { GetPluginLoader } from "./PluginLoader";
|
|
9
9
|
import Events from "./Events.js"
|
|
10
10
|
import { ScreenLockManager } from "./ScreenLockManager.js";
|
|
11
11
|
|
|
12
|
+
let sPluginLoader = GetPluginLoader();
|
|
13
|
+
|
|
12
14
|
const TAG = "JsvAudio";
|
|
13
15
|
|
|
14
16
|
let keyToken = 0;
|
|
@@ -47,8 +49,14 @@ class AudioManager {
|
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
|
-
const sAudioManager = new AudioManager();
|
|
51
52
|
|
|
53
|
+
let sAudioManager = null;
|
|
54
|
+
function getAudioManager() {
|
|
55
|
+
if (sAudioManager == null) {
|
|
56
|
+
sAudioManager = new AudioManager();
|
|
57
|
+
}
|
|
58
|
+
return sAudioManager;
|
|
59
|
+
}
|
|
52
60
|
|
|
53
61
|
const AUDIO_PROPS = {
|
|
54
62
|
"src": { type: Object },
|
|
@@ -336,4 +344,4 @@ class AudioProxy {
|
|
|
336
344
|
}
|
|
337
345
|
}
|
|
338
346
|
|
|
339
|
-
export {
|
|
347
|
+
export { getAudioManager, getKeyToken };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
import { getAudioManager, getKeyToken } from "./AudioProxy.js";
|
|
3
3
|
import { onBeforeUnmount } from "vue";
|
|
4
4
|
|
|
5
5
|
const props = defineProps({
|
|
@@ -94,9 +94,12 @@ const props = defineProps({
|
|
|
94
94
|
},
|
|
95
95
|
});
|
|
96
96
|
|
|
97
|
+
let sAudioManager = getAudioManager();
|
|
98
|
+
|
|
97
99
|
//同进程起不同版本的core时, pluginMananger是一个对象, 因此java端的JsvAudio是同一个map, 所以要加jsviewCoreInfo避免id重复导致bug
|
|
98
|
-
const jsviewCoreInfo =
|
|
99
|
-
|
|
100
|
+
const jsviewCoreInfo =
|
|
101
|
+
window.JsView?.getJsContextId?.() + "_" + window.JsView.CodeRevision;
|
|
102
|
+
let key = "JsvAudio_" + jsviewCoreInfo + "_" + getKeyToken();
|
|
100
103
|
if (props.playerKey) {
|
|
101
104
|
key = props.playerKey + "_" + jsviewCoreInfo;
|
|
102
105
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { defineAsyncComponent } from "vue";
|
|
3
|
+
import JsvAudio from "./JsvAudio.vue";
|
|
4
|
+
|
|
5
|
+
const AsyncComp = defineAsyncComponent(() => {
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
if (!window.JsView) {
|
|
8
|
+
console.log("Load BrowserAudio");
|
|
9
|
+
const BrowserAudio = import("./BrowserAudio/BrowserAudio.vue");
|
|
10
|
+
resolve(BrowserAudio);
|
|
11
|
+
} else {
|
|
12
|
+
resolve(JsvAudio);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<AsyncComp v-bind="$attrs" />
|
|
20
|
+
</template>
|
|
@@ -135,6 +135,16 @@ class PluginLoader {
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
let sPluginLoader = null;
|
|
139
|
+
|
|
140
|
+
function GetPluginLoader() {
|
|
141
|
+
if (sPluginLoader == null) {
|
|
142
|
+
sPluginLoader = new PluginLoader();
|
|
143
|
+
sPluginLoader.registerGlobalListener();
|
|
144
|
+
}
|
|
145
|
+
return sPluginLoader;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export {
|
|
149
|
+
GetPluginLoader
|
|
150
|
+
}
|
|
@@ -3,26 +3,21 @@
|
|
|
3
3
|
* @Date: 2023-02-28 10:18:42
|
|
4
4
|
* @Description: file content
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
7
|
-
import JsvAudio from "./
|
|
6
|
+
import { GetPluginLoader } from "./PluginLoader.js";
|
|
7
|
+
import JsvAudio from "./JsvAudioProxy.vue"
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (!window.JsView) {
|
|
13
|
-
const BrowserJsvAudio = await import("./BrowserAudio/BrowserAudio.vue");
|
|
14
|
-
//browser
|
|
15
|
-
globalLoadJsvAudioPlugin = (listener) => {
|
|
9
|
+
const globalLoadJsvAudioPlugin = (listener) => {
|
|
10
|
+
if (!window.JsView) {
|
|
16
11
|
setTimeout(listener, 0);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
} else {
|
|
13
|
+
//jsview
|
|
14
|
+
let pluginLoader = GetPluginLoader();
|
|
15
|
+
let innerFunc = pluginLoader.loadPlugin.bind(pluginLoader);
|
|
16
|
+
innerFunc(listener);
|
|
17
|
+
}
|
|
23
18
|
}
|
|
24
19
|
|
|
25
20
|
export {
|
|
26
|
-
|
|
21
|
+
JsvAudio,
|
|
27
22
|
globalLoadJsvAudioPlugin,
|
|
28
23
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
// import "./mathjax-tex-svg.js";
|
|
3
3
|
import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
|
|
4
|
-
import {
|
|
4
|
+
import { shallowRef, onBeforeUnmount } from "vue";
|
|
5
5
|
import { getHtmlStr } from "./BrowserDomBuilder.js";
|
|
6
|
-
import libPath from "./mathjax-tex-svg.txt";
|
|
7
6
|
|
|
8
7
|
const props = defineProps({
|
|
9
8
|
latexStr: {
|
|
@@ -40,11 +39,29 @@ const props = defineProps({
|
|
|
40
39
|
},
|
|
41
40
|
});
|
|
42
41
|
|
|
43
|
-
let
|
|
42
|
+
let innerViewId = shallowRef(-1);
|
|
44
43
|
|
|
44
|
+
let layoutView = new Forge.IFrameView();
|
|
45
45
|
layoutView.SetIframeSize(props.width, props.height);
|
|
46
|
-
layoutView.SetInnerHtml(
|
|
47
|
-
|
|
46
|
+
layoutView.SetInnerHtml(
|
|
47
|
+
getHtmlStr(
|
|
48
|
+
"https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewTestResource/DocResource/mathjax-tex-svg.txt",
|
|
49
|
+
props.latexStr,
|
|
50
|
+
props.fontSize,
|
|
51
|
+
props.width,
|
|
52
|
+
props.height,
|
|
53
|
+
props.color
|
|
54
|
+
)
|
|
55
|
+
);
|
|
56
|
+
innerViewId.value = Forge.sViewStore.add(new Forge.ViewInfo(layoutView));
|
|
57
|
+
|
|
58
|
+
onBeforeUnmount(() => {
|
|
59
|
+
if (innerViewId.value != -1) {
|
|
60
|
+
Forge.sViewStore.remove(innerViewId.value);
|
|
61
|
+
innerViewId.value = -1;
|
|
62
|
+
console.log("success remove innerview");
|
|
63
|
+
}
|
|
64
|
+
});
|
|
48
65
|
</script>
|
|
49
66
|
<template>
|
|
50
67
|
<div
|
|
@@ -26,7 +26,9 @@ import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
|
|
|
26
26
|
import ForgeHandles from "../../JsViewVueTools/ForgeHandles";
|
|
27
27
|
import JsvLatexBridgeProxy from "./JsvLatexBridgeProxy";
|
|
28
28
|
import { cssColor2Android } from "./Color";
|
|
29
|
-
import
|
|
29
|
+
import { GetPluginLoader } from "./PluginLoader";
|
|
30
|
+
|
|
31
|
+
let sPluginLoader = GetPluginLoader();
|
|
30
32
|
|
|
31
33
|
const props = defineProps({
|
|
32
34
|
latexStr: {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { defineAsyncComponent } from "vue";
|
|
3
|
+
import JsvLatex from "./JsvLatex.vue";
|
|
4
|
+
|
|
5
|
+
const AsyncComp = defineAsyncComponent(() => {
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
if (!window.JsView) {
|
|
8
|
+
console.log("Load BrowserJsvLatex");
|
|
9
|
+
const BrowserJsvLatex = import("./BrowserJsvLatex.vue");
|
|
10
|
+
resolve(BrowserJsvLatex);
|
|
11
|
+
} else {
|
|
12
|
+
resolve(JsvLatex);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<AsyncComp v-bind="$attrs" />
|
|
20
|
+
</template>
|
|
@@ -166,6 +166,16 @@ class PluginLoader {
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
let sPluginLoader = null;
|
|
170
|
+
|
|
171
|
+
function GetPluginLoader() {
|
|
172
|
+
if (sPluginLoader == null) {
|
|
173
|
+
sPluginLoader = new PluginLoader();
|
|
174
|
+
sPluginLoader.registerGlobalListener();
|
|
175
|
+
}
|
|
176
|
+
return sPluginLoader;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export {
|
|
180
|
+
GetPluginLoader
|
|
181
|
+
}
|
|
@@ -3,26 +3,21 @@
|
|
|
3
3
|
* @Date: 2023-02-28 10:18:42
|
|
4
4
|
* @Description: file content
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
7
|
-
import JsvLatex from "./
|
|
6
|
+
import { GetPluginLoader } from "./PluginLoader.js";
|
|
7
|
+
import JsvLatex from "./JsvLatexProxy.vue"
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (!window.JsView) {
|
|
13
|
-
const BrowserJsvLatex = await import("./BrowserJsvLatex.vue");
|
|
14
|
-
//browser
|
|
15
|
-
globalLoadJsvLatexPlugin = (listener) => {
|
|
9
|
+
const globalLoadJsvLatexPlugin = (listener) => {
|
|
10
|
+
if (!window.JsView) {
|
|
16
11
|
setTimeout(listener, 0);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
} else {
|
|
13
|
+
//jsview
|
|
14
|
+
let pluginLoader = GetPluginLoader();
|
|
15
|
+
let innerFunc = pluginLoader.loadPlugin.bind(pluginLoader);
|
|
16
|
+
innerFunc(listener);
|
|
17
|
+
}
|
|
23
18
|
}
|
|
24
19
|
|
|
25
20
|
export {
|
|
26
|
-
|
|
21
|
+
JsvLatex,
|
|
27
22
|
globalLoadJsvLatexPlugin,
|
|
28
23
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
let handles = {
|
|
2
|
+
TextureManager: null,
|
|
3
|
+
RootView: null,
|
|
4
|
+
RootActivity: null
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const jsvCode = (window as any).JsvCode;
|
|
8
|
+
jsvCode.ForgeHandles.listenToReady(()=>{
|
|
9
|
+
handles.TextureManager = jsvCode.ForgeHandles.TextureManager;
|
|
10
|
+
handles.RootView = jsvCode.ForgeHandles.RootView;
|
|
11
|
+
handles.RootActivity = jsvCode.ForgeHandles.RootActivity;
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
export default handles;
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
* 返回值:
|
|
20
20
|
* KeyFrameStyleSheet 以anchor_tag为锚点,找到对应的cssRule,以此cssRule创建出的KeyFrame管理句柄
|
|
21
21
|
*/
|
|
22
|
-
function getKeyFramesGroup(anchor_tag) {
|
|
23
|
-
return window.JsvCode.Dom.getKeyFrameGroup(anchor_tag);
|
|
22
|
+
function getKeyFramesGroup(anchor_tag: string | null) {
|
|
23
|
+
return (window as any).JsvCode.Dom.getKeyFrameGroup(anchor_tag);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* alterModuleUrl
|
|
4
|
+
*
|
|
5
|
+
* 配置federation remote模块的加载url
|
|
6
|
+
* 注意: 需要在模块进行加载前使用才能生效,否则不生效
|
|
7
|
+
*
|
|
8
|
+
* @param {string} moduleName
|
|
9
|
+
* 远程模块名,例如: RemoteEntry
|
|
10
|
+
* @param {string} newUrl
|
|
11
|
+
* 模块远程url, 此url对应remote build后dist部署的服务器位置,例如: "http://localhost:8088/dist/js/remoteEntry.js"
|
|
12
|
+
*/
|
|
13
|
+
function alterModuleUrl(moduleName: string, newUrl: string) {
|
|
14
|
+
let moduleRef = (window as any).JsvCode.Federation.remotesMap[moduleName];
|
|
15
|
+
if (moduleRef) {
|
|
16
|
+
if (moduleRef.inited) { // 按照Module federation 1.3.4的数据规则, 未加载时, inited为false
|
|
17
|
+
console.error(`Error: can't change INITED module name '${moduleName}'`);
|
|
18
|
+
} else {
|
|
19
|
+
moduleRef.url = newUrl;
|
|
20
|
+
console.log(`Info: set '${moduleName}' to '${newUrl}' succcess`);
|
|
21
|
+
}
|
|
22
|
+
} else {
|
|
23
|
+
console.error(`Error: module '${moduleName}' not found`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const JsvFederationTools = {
|
|
28
|
+
alterModuleUrl
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
JsvFederationTools
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
@@ -24,7 +24,7 @@ interface DownloadListItem {
|
|
|
24
24
|
netSetting?: string,
|
|
25
25
|
isImage?: boolean,
|
|
26
26
|
}
|
|
27
|
-
interface infoObject{
|
|
27
|
+
interface infoObject {
|
|
28
28
|
errorCode: number
|
|
29
29
|
errorInfo: string
|
|
30
30
|
url: null
|
|
@@ -39,16 +39,16 @@ abstract class JsvPreDownloaderBase {
|
|
|
39
39
|
if (typeof url === "string") {
|
|
40
40
|
this.downloadInner(url, netSetting, isImage).then(resolve, reject);
|
|
41
41
|
} else if (Array.isArray(url) && url.length > 0) {
|
|
42
|
-
const downloadResult = new Array(url.length);
|
|
42
|
+
const downloadResult = new Array(url.length);
|
|
43
43
|
const check = () => {
|
|
44
44
|
let allDone = false;
|
|
45
|
-
let allSuccess = true;
|
|
45
|
+
let allSuccess = true;
|
|
46
46
|
for (let i of downloadResult) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
if (!i?.succeed) {
|
|
48
|
+
allSuccess = false;
|
|
49
|
+
}
|
|
50
50
|
}
|
|
51
|
-
if(isNullNumber + workNumber == url.length
|
|
51
|
+
if (isNullNumber + workNumber == url.length) {
|
|
52
52
|
|
|
53
53
|
allDone = true;
|
|
54
54
|
}
|
|
@@ -61,10 +61,10 @@ abstract class JsvPreDownloaderBase {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
for (let i = 0; i < url.length; ++i) {
|
|
64
|
-
if(url[i]==null || url[i].url == null
|
|
65
|
-
downloadResult[i]={
|
|
66
|
-
succeed:false,
|
|
67
|
-
info:{
|
|
64
|
+
if (url[i] == null || url[i].url == null) {
|
|
65
|
+
downloadResult[i] = {
|
|
66
|
+
succeed: false,
|
|
67
|
+
info: {
|
|
68
68
|
errorCode: 100,
|
|
69
69
|
errorInfo: "This item is null or url is null",
|
|
70
70
|
url: null
|
|
@@ -73,24 +73,24 @@ abstract class JsvPreDownloaderBase {
|
|
|
73
73
|
isNullNumber += 1
|
|
74
74
|
} else {
|
|
75
75
|
this.downloadInner(url[i].url, url[i].netSetting, !!url[i].isImage)
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
76
|
+
.then(
|
|
77
|
+
(info) => {
|
|
78
|
+
downloadResult[i] = {
|
|
79
|
+
succeed: true,
|
|
80
|
+
info: info,
|
|
81
|
+
};
|
|
82
|
+
workNumber += 1
|
|
83
|
+
check();
|
|
84
|
+
},
|
|
85
|
+
(errorInfo) => {
|
|
86
|
+
downloadResult[i] = {
|
|
87
|
+
succeed: false,
|
|
88
|
+
info: errorInfo,
|
|
89
|
+
};
|
|
90
|
+
workNumber += 1
|
|
91
|
+
check();
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
94
|
}
|
|
95
95
|
} else {
|
|
96
96
|
console.error(TAG, "download url invalid", url);
|
|
@@ -99,13 +99,13 @@ abstract class JsvPreDownloaderBase {
|
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
public buildDownloadItem(url: string, netSetting: string = "", isImage: boolean = false)
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
102
|
+
public buildDownloadItem(url: string, netSetting: string = "", isImage: boolean = false): DownloadListItem {
|
|
103
|
+
const item: DownloadListItem = {
|
|
104
|
+
url: url,
|
|
105
|
+
netSetting: netSetting,
|
|
106
|
+
isImage: isImage,
|
|
107
|
+
}
|
|
108
|
+
return item
|
|
109
109
|
}
|
|
110
110
|
protected abstract downloadInner(url: string, netSetting: string | undefined, isImage: boolean): Promise<Object>;
|
|
111
111
|
}
|
|
@@ -181,5 +181,4 @@ class JsvPreDownloaderInBrowser extends JsvPreDownloaderBase {
|
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
const exportObj = (window as any).JsView ? JsvPreDownloaderInJsView : JsvPreDownloaderInBrowser;
|
|
184
|
-
(window as any).Test = exportObj;
|
|
185
184
|
export { exportObj as JsvPreDownloader }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ForgeHandles from "../../../JsViewVueTools/ForgeHandles
|
|
1
|
+
import ForgeHandles from "../../../JsViewVueTools/ForgeHandles";
|
|
2
2
|
import { TextureBase } from "../Texture"
|
|
3
3
|
import * as Constants from "./CommandList"
|
|
4
4
|
import { RectPath, CirclePath, CustomPath } from "./Path"
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
export * from "./JsvHashHistory";
|
|
8
8
|
export * from "./JsvDynamicCssStyle.js";
|
|
9
|
-
export * from "./JsvDynamicKeyFrames.
|
|
9
|
+
export * from "./JsvDynamicKeyFrames.ts";
|
|
10
10
|
export * from "./JsvRuntimeBridge.js";
|
|
11
11
|
export * from "./NinePatchHelper";
|
|
12
12
|
export * from "./TypeCheckAndSet";
|
|
@@ -23,3 +23,4 @@ export * from "./JsvDemoTester.js"
|
|
|
23
23
|
export * from "./JsvPerformance.ts"
|
|
24
24
|
export * from "./JsvTextureStore/JsvTextureStore.ts"
|
|
25
25
|
export * from "./JsvTextureDefines.ts"
|
|
26
|
+
export * from "./JsvFederationTools.ts"
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
* 【模块 export 内容】
|
|
3
3
|
* JsvEnvBlocker: 触发FreeMoveAnimation的 blockerCondition 的全屏碰撞体
|
|
4
|
+
* 与FreeMoveAnimation的 setCondition.onHitBlock 配合使用
|
|
4
5
|
* props说明:
|
|
5
6
|
* top, left, width, height(Number): 关联的div的定位信息
|
|
6
7
|
* topGID(Number): 上边缘响应监听的组id(用于blockerCondition的组参数), 0或者undefined代表不激活这条边的测试
|
|
7
8
|
* bottomGID(Number): 下边缘响应监听的组id
|
|
8
9
|
* leftGID(Number): 左边缘响应监听的组id
|
|
9
10
|
* rightGID(Number): 右边缘响应监听的组id
|
|
11
|
+
*
|
|
12
|
+
* 特别说明 GID 是全局共享的,例如多个EnvBlocker都有GID=2设置的边时,某个FreeMove实例设置setCondition.onHitBlock(2),
|
|
13
|
+
* 意味着此FreeMoveAnimation碰撞任何一个EnvBlocker的GID=2的边都会触发回调
|
|
10
14
|
*
|
|
11
15
|
-->
|
|
12
16
|
|
|
@@ -154,11 +154,12 @@ export default {
|
|
|
154
154
|
qrCodeView: null,
|
|
155
155
|
};
|
|
156
156
|
},
|
|
157
|
-
|
|
157
|
+
beforeUnmount() {
|
|
158
158
|
if (this.innerViewId !== -1) {
|
|
159
159
|
Forge.sViewStore.remove(this.innerViewId);
|
|
160
160
|
this.innerViewId = -1;
|
|
161
161
|
this.jsvBaseView = null;
|
|
162
|
+
console.log("success remove innerview");
|
|
162
163
|
}
|
|
163
164
|
},
|
|
164
165
|
};
|