pixuireactcomponents 1.3.94 → 1.3.96
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pixuireactcomponents",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.96",
|
|
4
4
|
"description": "pixui react components",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"typescript": "^5.3.3"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@babel/core": "^7.
|
|
32
|
+
"@babel/core": "^7.24.6",
|
|
33
33
|
"@babel/plugin-proposal-class-properties": "^7.8.3",
|
|
34
34
|
"@babel/plugin-proposal-decorators": "^7.8.3",
|
|
35
35
|
"@babel/plugin-syntax-jsx": "^7.8.3",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"@babel/plugin-transform-react-jsx": "^7.9.4",
|
|
38
38
|
"@babel/preset-env": "^7.9.6",
|
|
39
39
|
"@babel/preset-typescript": "^7.9.0",
|
|
40
|
+
"@babel/traverse": "^7.24.6",
|
|
40
41
|
"@types/jest": "25.2.1",
|
|
41
42
|
"@types/node": "13.11.1",
|
|
42
|
-
"
|
|
43
|
-
"@typescript-eslint/parser": "^2.28.0",
|
|
43
|
+
"ajv": "^8.14.0",
|
|
44
44
|
"babel-loader": "^8.1.0",
|
|
45
45
|
"babel-plugin-import": "^1.12.0",
|
|
46
46
|
"babel-plugin-jsx-pragmatic": "^1.0.2",
|
|
@@ -50,19 +50,19 @@
|
|
|
50
50
|
"comment-json": "^4.2.2",
|
|
51
51
|
"cross-env": "^7.0.3",
|
|
52
52
|
"css-loader": "^6.10.0",
|
|
53
|
-
"
|
|
54
|
-
"eslint": "^6.8.0",
|
|
55
|
-
"eslint-plugin-jest": "^23.8.2",
|
|
53
|
+
"ejs": "^3.1.10",
|
|
56
54
|
"extract-text-webpack-plugin": "^3.0.2",
|
|
57
55
|
"file-loader": "^6.0.0",
|
|
58
56
|
"fork-ts-checker-webpack-plugin": "^4.1.3",
|
|
57
|
+
"glob-parent": "^6.0.2",
|
|
59
58
|
"html-webpack-plugin": "^4.2.0",
|
|
59
|
+
"json5": "^2.2.3",
|
|
60
60
|
"less": "^3.11.1",
|
|
61
61
|
"less-loader": "^5.0.0",
|
|
62
|
+
"node-forge": "^1.3.1",
|
|
62
63
|
"prettier": "2.0.4",
|
|
63
|
-
"sass": "^1.
|
|
64
|
+
"sass": "^1.77.4",
|
|
64
65
|
"sass-loader": "^8.0.2",
|
|
65
|
-
"source-map-explorer": "^2.0.1",
|
|
66
66
|
"style-loader": "^3.3.4",
|
|
67
67
|
"ts-loader": "^9.5.1",
|
|
68
68
|
"ts-protoc-gen": "^0.10.0",
|
|
@@ -29,7 +29,7 @@ export var PreloadImg = function (props) {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}, [src]);
|
|
32
|
-
return (h("div", __assign({
|
|
32
|
+
return (h("div", __assign({ style: __assign(__assign({}, props.style), { backgroundImage: "url(".concat(realSrc, ")"), backgroundSize: '100% 100%', backgroundRepeat: 'no-repeat' }) }, props)));
|
|
33
33
|
};
|
|
34
34
|
var isJssdkEnv = function () {
|
|
35
35
|
return GameletAPI.getRuntimeEnv() == 'jssdk-appwindow' || GameletAPI.getRuntimeEnv() == 'jssdk-preprocessor';
|
|
@@ -9,7 +9,7 @@ export declare namespace assetCache {
|
|
|
9
9
|
* @returns 返回本地缓存文件路径,成功后resolve资源的本地路径,失败后reject函数的url参数
|
|
10
10
|
*/
|
|
11
11
|
const cache: (url: string, force?: boolean, retryTimes?: number) => Promise<string>;
|
|
12
|
-
const
|
|
12
|
+
const getFileCachePath: (url: string) => string;
|
|
13
13
|
/**
|
|
14
14
|
*
|
|
15
15
|
* @param url 资源url
|
|
@@ -67,12 +67,13 @@ export var assetCache;
|
|
|
67
67
|
if (!isJssdkEnv) {
|
|
68
68
|
console.log('非jssdk环境');
|
|
69
69
|
reject(url);
|
|
70
|
+
return [2 /*return*/];
|
|
70
71
|
}
|
|
71
72
|
urlWithoutParams = url.split('?')[0];
|
|
72
73
|
localPath = getLocalPath(urlWithoutParams);
|
|
73
74
|
if (!localPath) {
|
|
74
75
|
console.log('getLocalPath failed');
|
|
75
|
-
reject();
|
|
76
|
+
reject(url);
|
|
76
77
|
return [2 /*return*/];
|
|
77
78
|
}
|
|
78
79
|
console.log('cacheAsset getlocalPath', localPath);
|
|
@@ -80,9 +81,10 @@ export var assetCache;
|
|
|
80
81
|
if (OPLib.fileExists(localPath)) {
|
|
81
82
|
console.log('cacheAsset file exist', localPath);
|
|
82
83
|
resolve(localPath);
|
|
84
|
+
return [2 /*return*/];
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
|
-
console.log('cacheAsset
|
|
87
|
+
console.log('cacheAsset download start -- ', url, localPath);
|
|
86
88
|
xhr = new XMLHttpRequest();
|
|
87
89
|
xhr.open('GET', url, true);
|
|
88
90
|
xhr.responseType = 'arraybuffer';
|
|
@@ -94,9 +96,11 @@ export var assetCache;
|
|
|
94
96
|
if (localPath) {
|
|
95
97
|
OPLib.saveToFile(localPath, xhr.response);
|
|
96
98
|
resolve(localPath);
|
|
99
|
+
return [2 /*return*/];
|
|
97
100
|
}
|
|
98
101
|
else {
|
|
99
102
|
reject(url);
|
|
103
|
+
return [2 /*return*/];
|
|
100
104
|
}
|
|
101
105
|
}
|
|
102
106
|
else {
|
|
@@ -129,7 +133,7 @@ export var assetCache;
|
|
|
129
133
|
});
|
|
130
134
|
});
|
|
131
135
|
};
|
|
132
|
-
assetCache.
|
|
136
|
+
assetCache.getFileCachePath = function (url) {
|
|
133
137
|
console.log('getCachePath', url);
|
|
134
138
|
if (!isJssdkEnv) {
|
|
135
139
|
console.log('非jssdk环境');
|
|
@@ -195,7 +199,12 @@ export var assetCache;
|
|
|
195
199
|
};
|
|
196
200
|
var getLocalPath = function (url) {
|
|
197
201
|
console.log('getLocalPath', url);
|
|
198
|
-
var
|
|
202
|
+
var cachePath = OPLib.getCachePath();
|
|
203
|
+
if (!cachePath) {
|
|
204
|
+
console.warn('getLocalPath failed', url);
|
|
205
|
+
return '';
|
|
206
|
+
}
|
|
207
|
+
var filePath = path.join(cachePath, 'assetcache');
|
|
199
208
|
//检查assetcache文件夹
|
|
200
209
|
if (!OPLib.dirExists(filePath)) {
|
|
201
210
|
OPLib.makeDir(filePath);
|