@shijiu/jsview-vue 2.1.200 → 2.1.340-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
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* 【模块 export 内容】
|
|
3
|
+
* JsvSpriteLoader: 雪碧图资源加载器
|
|
4
|
+
* prop说明:
|
|
5
|
+
* imageUrl: http打头的远程图片加载器
|
|
6
|
+
* configUrl: http打头的远程configUrl文件
|
|
7
|
+
* onConfigReady: config文件下载完成后的回调(data, PromiseResolve)
|
|
8
|
+
* noNeedResource: 是否需要等待imageUrl和json记载完毕后再激活子内容, 默认为false, 可设置为true
|
|
9
|
+
-->
|
|
10
|
+
<script setup>
|
|
11
|
+
import { shallowRef, watch } from "vue";
|
|
12
|
+
import JsvPreload from "../JsvPreload";
|
|
13
|
+
import { buildPreloadInfo } from "../JsvPreload";
|
|
14
|
+
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
imageUrl: String,
|
|
17
|
+
configUrl: String,
|
|
18
|
+
onConfigReady: Function,
|
|
19
|
+
noNeedResource: { type: Boolean, default: false },
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// ******** 内部状态 ********
|
|
23
|
+
let resetId = shallowRef(0);
|
|
24
|
+
let dataReady = shallowRef(false);
|
|
25
|
+
let igonreLoad = shallowRef(false);
|
|
26
|
+
let preloadInfo;
|
|
27
|
+
let imageResolve = null;
|
|
28
|
+
let configResolve = null;
|
|
29
|
+
let imagePromise = new Promise((resolve) => {
|
|
30
|
+
imageResolve = resolve;
|
|
31
|
+
});
|
|
32
|
+
let configPromise = new Promise((resolve) => {
|
|
33
|
+
configResolve = resolve;
|
|
34
|
+
});
|
|
35
|
+
let cachedProps = {
|
|
36
|
+
imageUrl: props.imageUrl,
|
|
37
|
+
noNeedResource: props.noNeedResource,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// ******** private function ********
|
|
41
|
+
let _onPreloadDone = () => {
|
|
42
|
+
imageResolve();
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
function fetchConfig(configUrl) {
|
|
46
|
+
// TODO: 后续需要jsview支持去使用缓存
|
|
47
|
+
// 动态导入 JSON 文件
|
|
48
|
+
var xhr = new XMLHttpRequest();
|
|
49
|
+
// 配置请求,第三个参数指定请求是否异步
|
|
50
|
+
xhr.open("GET", configUrl, true);
|
|
51
|
+
xhr.onload = function () {
|
|
52
|
+
if (xhr.status >= 200 && xhr.status < 300) {
|
|
53
|
+
// 请求成功
|
|
54
|
+
var jsonData = JSON.parse(xhr.responseText);
|
|
55
|
+
props.onConfigReady(jsonData, configResolve);
|
|
56
|
+
} else {
|
|
57
|
+
// 请求失败
|
|
58
|
+
console.error("Failed to load JSON file. Status:", xhr.status);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
xhr.onerror = function () {
|
|
62
|
+
console.error("Network error occurred");
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// 发送请求
|
|
66
|
+
xhr.send();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
let _OnReset = () => {
|
|
70
|
+
// 重置可视设置
|
|
71
|
+
dataReady.value = false;
|
|
72
|
+
igonreLoad.value = props.noNeedResource;
|
|
73
|
+
|
|
74
|
+
// preload
|
|
75
|
+
if (!props.noNeedResource && props.imageUrl) {
|
|
76
|
+
// 加载图片
|
|
77
|
+
preloadInfo = [buildPreloadInfo(props.imageUrl)];
|
|
78
|
+
|
|
79
|
+
// 获取远程数据
|
|
80
|
+
if (props.configUrl && props.onConfigReady) {
|
|
81
|
+
fetchConfig(props.configUrl);
|
|
82
|
+
} else {
|
|
83
|
+
console.log(
|
|
84
|
+
`no config: configUrlSet=${props.configUrl} func=${props.onConfigReady}`
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
Promise.all([imagePromise, configPromise]).then(() => {
|
|
89
|
+
dataReady.value = true;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
cachedProps.imageUrl = props.imageUrl;
|
|
93
|
+
cachedProps.noNeedResource = props.noNeedResource;
|
|
94
|
+
resetId.value++;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// ******** 初始化处理 ********
|
|
98
|
+
_OnReset();
|
|
99
|
+
|
|
100
|
+
// 监听props变化
|
|
101
|
+
watch(props, (newProps) => {
|
|
102
|
+
// 属性变化重置缓存
|
|
103
|
+
if (
|
|
104
|
+
newProps.imageUrl != cachedProps.imageUrl ||
|
|
105
|
+
cachedProps.noNeedResource != newProps.noNeedResource
|
|
106
|
+
) {
|
|
107
|
+
console.log("SpriteLoader reset for url or needFlag changed");
|
|
108
|
+
_OnReset();
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
</script>
|
|
112
|
+
|
|
113
|
+
<template>
|
|
114
|
+
<div id="sprite-loader" :key="resetId">
|
|
115
|
+
<jsv-preload :preloadList="preloadInfo" :onPreloadDone="_onPreloadDone" />
|
|
116
|
+
<slot v-if="dataReady || igonreLoad" />
|
|
117
|
+
</div>
|
|
118
|
+
</template>
|
|
119
|
+
|
|
120
|
+
<style scoped></style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import JsvSpriteAnim from "./JsvSpriteAnim.vue";
|
|
2
|
+
import JsvSpriteLoader from "./JsvSpriteLoader.vue";
|
|
2
3
|
import { SpriteController } from "./SpriteController.js";
|
|
3
4
|
|
|
4
|
-
export
|
|
5
|
-
export { SpriteController };
|
|
5
|
+
export { JsvSpriteAnim, JsvSpriteLoader, SpriteController };
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
|
|
34
34
|
<script>
|
|
35
35
|
import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
|
|
36
|
-
import
|
|
37
|
-
JsvActorMoveControl,
|
|
38
|
-
} from "jsview/utils/JsViewVueWidget/JsvActorMove";
|
|
39
|
-
import JsvVisibleSensor from "jsview/utils/JsViewVueWidget/JsvVisibleSensor";
|
|
40
|
-
import { EdgeDirection } from "../../JsViewEngineWidget/WidgetCommon";
|
|
36
|
+
import { EdgeDirection } from "../../JsViewEngineWidget";
|
|
41
37
|
import { ref } from "vue";
|
|
38
|
+
import JsvActorMove, {
|
|
39
|
+
JsvActorMoveControl
|
|
40
|
+
} from "../JsvActorMove";
|
|
41
|
+
import JsvVisibleSensor from "../JsvVisibleSensor";
|
|
42
42
|
|
|
43
43
|
const VIEW_NUM = 3;
|
|
44
44
|
|