esoftplay 0.0.121-k → 0.0.121-m
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/import_migrator.mjs +4 -3
- package/modules/lib/picture.tsx +2 -1
- package/package.json +1 -1
package/import_migrator.mjs
CHANGED
|
@@ -34,9 +34,10 @@ if (fs.existsSync('./modules')) {
|
|
|
34
34
|
})
|
|
35
35
|
}
|
|
36
36
|
dFile = dFile.replace(cmatch, "\nimport { " + espMod.join(", ") + " } from 'esoftplay';\n" + adder)
|
|
37
|
-
if (matchGlobal)
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
// if (matchGlobal) {
|
|
38
|
+
// dFile = dFile.replace(matchGlobal, "")
|
|
39
|
+
// dFile = dFile.replace("\n", "\nimport useGlobalState from 'esoftplay/global';\n")
|
|
40
|
+
// }
|
|
40
41
|
fs.writeFileSync('./modules/' + module + '/' + task, dFile, { encoding: 'utf8' })
|
|
41
42
|
}
|
|
42
43
|
})
|
package/modules/lib/picture.tsx
CHANGED
|
@@ -41,6 +41,7 @@ const getCacheEntry = async (uri: string, toSize: number): Promise<{ exists: boo
|
|
|
41
41
|
const fetchPicture = Worker.registerJobAsync('lib_picture_fetch', (url: string, toSize: number) => {
|
|
42
42
|
'show source';
|
|
43
43
|
return new Promise((resolve, reject) => {
|
|
44
|
+
'show source';
|
|
44
45
|
fetch(url, { mode: 'cors' })
|
|
45
46
|
.then(response => response.blob())
|
|
46
47
|
.then(blob => {
|
|
@@ -121,7 +122,7 @@ export default function m(props: LibPictureProps): any {
|
|
|
121
122
|
if (exists) {
|
|
122
123
|
setUri(path)
|
|
123
124
|
} else {
|
|
124
|
-
fetchPicture
|
|
125
|
+
fetchPicture([b_uri, PixelRatio.getPixelSizeForLayoutSize(toSize)], (uri) => {
|
|
125
126
|
setUri("data:image/png;base64," + uri)
|
|
126
127
|
if (!props.noCache)
|
|
127
128
|
LibWorkloop.execNextTix(FileSystem.writeAsStringAsync, [path, uri, { encoding: "base64" }])
|