@umituz/react-native-ai-generation-content 1.17.258 → 1.17.260
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-ai-generation-content",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.260",
|
|
4
4
|
"description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -53,8 +53,10 @@
|
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@expo/vector-icons": "^15.0.3",
|
|
56
|
+
"@gorhom/bottom-sheet": "^5.2.8",
|
|
56
57
|
"@react-native-async-storage/async-storage": "^2.2.0",
|
|
57
58
|
"@react-native-community/datetimepicker": "^8.5.1",
|
|
59
|
+
"@react-native-community/slider": "^5.1.1",
|
|
58
60
|
"@react-navigation/bottom-tabs": "^7.9.0",
|
|
59
61
|
"@react-navigation/native": "^7.1.26",
|
|
60
62
|
"@react-navigation/stack": "^7.6.13",
|
|
@@ -76,11 +78,16 @@
|
|
|
76
78
|
"expo-crypto": "^15.0.8",
|
|
77
79
|
"expo-device": "^8.0.10",
|
|
78
80
|
"expo-file-system": "^19.0.21",
|
|
81
|
+
"expo-font": "^14.0.10",
|
|
79
82
|
"expo-haptics": "^15.0.8",
|
|
80
83
|
"expo-image": "^3.0.11",
|
|
84
|
+
"expo-image-manipulator": "^14.0.8",
|
|
85
|
+
"expo-linear-gradient": "^15.0.8",
|
|
81
86
|
"expo-localization": "^17.0.8",
|
|
82
87
|
"expo-media-library": "^18.2.1",
|
|
88
|
+
"expo-modules-core": "^3.0.29",
|
|
83
89
|
"expo-network": "^8.0.8",
|
|
90
|
+
"expo-secure-store": "^15.0.8",
|
|
84
91
|
"expo-sharing": "^14.0.8",
|
|
85
92
|
"expo-video": "^3.0.15",
|
|
86
93
|
"firebase": "^12.6.0",
|
|
@@ -118,6 +118,26 @@ export const useResultActions = (
|
|
|
118
118
|
}
|
|
119
119
|
}, [imageUrl, onSaveSuccess, onSaveError]);
|
|
120
120
|
|
|
121
|
+
/**
|
|
122
|
+
* Download image from URL to file
|
|
123
|
+
*/
|
|
124
|
+
const downloadUrlToFile = async (url: string): Promise<string> => {
|
|
125
|
+
const timestamp = Date.now();
|
|
126
|
+
const filename = `ai_generation_${timestamp}.jpg`;
|
|
127
|
+
const file = new File(Paths.cache, filename);
|
|
128
|
+
|
|
129
|
+
const response = await fetch(url);
|
|
130
|
+
if (!response.ok) {
|
|
131
|
+
throw new Error(`Failed to download image: ${response.statusText}`);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const arrayBuffer = await response.arrayBuffer();
|
|
135
|
+
const bytes = new Uint8Array(arrayBuffer);
|
|
136
|
+
file.write(bytes);
|
|
137
|
+
|
|
138
|
+
return file.uri;
|
|
139
|
+
};
|
|
140
|
+
|
|
121
141
|
/**
|
|
122
142
|
* Share image
|
|
123
143
|
*/
|
|
@@ -134,9 +154,11 @@ export const useResultActions = (
|
|
|
134
154
|
const normalizedUrl = toDataUrl(imageUrl);
|
|
135
155
|
let shareUrl = normalizedUrl;
|
|
136
156
|
|
|
137
|
-
//
|
|
157
|
+
// Download to file for sharing (works for both base64 and remote URLs)
|
|
138
158
|
if (isBase64DataUrl(normalizedUrl)) {
|
|
139
159
|
shareUrl = await saveBase64ToFile(normalizedUrl);
|
|
160
|
+
} else if (normalizedUrl.startsWith("http")) {
|
|
161
|
+
shareUrl = await downloadUrlToFile(normalizedUrl);
|
|
140
162
|
}
|
|
141
163
|
|
|
142
164
|
// Use expo-sharing for cross-platform file sharing
|