@umituz/react-native-design-system 2.9.48 → 2.9.49
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": "@umituz/react-native-design-system",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.49",
|
|
4
4
|
"description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive, safe area, exception, infinite scroll, UUID, image, timezone, offline, onboarding, and loading utilities",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -35,6 +35,19 @@ export function getExtensionFromMimeType(mimeType: string): string {
|
|
|
35
35
|
return ext ?? "jpg";
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Convert base64 string to Uint8Array
|
|
40
|
+
* Required for binary file writing in new expo-file-system API
|
|
41
|
+
*/
|
|
42
|
+
function base64ToUint8Array(base64: string): Uint8Array {
|
|
43
|
+
const binaryString = atob(base64);
|
|
44
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
45
|
+
for (let i = 0; i < binaryString.length; i++) {
|
|
46
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
47
|
+
}
|
|
48
|
+
return bytes;
|
|
49
|
+
}
|
|
50
|
+
|
|
38
51
|
/**
|
|
39
52
|
* Write base64 to a temp file and return the file URI
|
|
40
53
|
* This is React Native compatible (no Blob/ArrayBuffer needed)
|
|
@@ -50,7 +63,10 @@ export async function base64ToTempFile(
|
|
|
50
63
|
|
|
51
64
|
const file = new File(Paths.cache, name);
|
|
52
65
|
await file.create();
|
|
53
|
-
|
|
66
|
+
|
|
67
|
+
// Convert base64 to Uint8Array for binary writing
|
|
68
|
+
const binaryData = base64ToUint8Array(cleanBase64);
|
|
69
|
+
file.write(binaryData);
|
|
54
70
|
|
|
55
71
|
return file.uri;
|
|
56
72
|
}
|