@umituz/react-native-ai-generation-content 1.17.100 → 1.17.101

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.100",
3
+ "version": "1.17.101",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -27,10 +27,24 @@ function defaultExtractResult(
27
27
 
28
28
  const r = result as Record<string, unknown>;
29
29
 
30
+ // GeminiClient returns imageUrl (data URL) or imageBase64
31
+ if (typeof r.imageUrl === "string") {
32
+ return { imageUrl: r.imageUrl, imageUrls: [r.imageUrl] };
33
+ }
34
+
35
+ // Fallback: construct data URL from imageBase64
36
+ if (typeof r.imageBase64 === "string") {
37
+ const mimeType = typeof r.mimeType === "string" ? r.mimeType : "image/png";
38
+ const dataUrl = `data:${mimeType};base64,${r.imageBase64}`;
39
+ return { imageUrl: dataUrl, imageUrls: [dataUrl] };
40
+ }
41
+
42
+ // Legacy: check for 'image' field
30
43
  if (typeof r.image === "string") {
31
- return { imageUrl: r.image };
44
+ return { imageUrl: r.image, imageUrls: [r.image] };
32
45
  }
33
46
 
47
+ // Legacy: check for 'images' array
34
48
  if (Array.isArray(r.images)) {
35
49
  const urls = r.images
36
50
  .map((img) => {