@umituz/react-native-ai-generation-content 1.17.99 → 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.99",
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",
@@ -16,5 +16,5 @@ export {
16
16
  export {
17
17
  DEFAULT_TEXT_TO_IMAGE_PROMPTS,
18
18
  DEFAULT_TEXT_TO_VOICE_PROMPTS,
19
- type ExamplePrompt,
19
+ type PromptSuggestion,
20
20
  } from "./prompts.constants";
@@ -5,13 +5,13 @@
5
5
  * @note Use translationKey for localization - apps should translate these
6
6
  */
7
7
 
8
- export interface ExamplePrompt {
8
+ export interface PromptSuggestion {
9
9
  id: string;
10
10
  translationKey: string;
11
11
  fallbackText: string;
12
12
  }
13
13
 
14
- export const DEFAULT_TEXT_TO_IMAGE_PROMPTS: readonly ExamplePrompt[] = [
14
+ export const DEFAULT_TEXT_TO_IMAGE_PROMPTS: readonly PromptSuggestion[] = [
15
15
  { id: "sunset", translationKey: "prompts.image.sunset", fallbackText: "A beautiful sunset over mountains with vibrant colors" },
16
16
  { id: "cityscape", translationKey: "prompts.image.cityscape", fallbackText: "Futuristic cityscape at night with neon lights" },
17
17
  { id: "forest", translationKey: "prompts.image.forest", fallbackText: "Enchanted forest with magical glowing mushrooms" },
@@ -22,7 +22,7 @@ export const DEFAULT_TEXT_TO_IMAGE_PROMPTS: readonly ExamplePrompt[] = [
22
22
  { id: "castle", translationKey: "prompts.image.castle", fallbackText: "Medieval castle on a cliff during golden hour" },
23
23
  ] as const;
24
24
 
25
- export const DEFAULT_TEXT_TO_VOICE_PROMPTS: readonly ExamplePrompt[] = [
25
+ export const DEFAULT_TEXT_TO_VOICE_PROMPTS: readonly PromptSuggestion[] = [
26
26
  { id: "welcome", translationKey: "prompts.voice.welcome", fallbackText: "Welcome to our amazing product! We're excited to have you here." },
27
27
  { id: "story", translationKey: "prompts.voice.story", fallbackText: "Once upon a time, in a land far away, there lived a wise old wizard." },
28
28
  { id: "news", translationKey: "prompts.voice.news", fallbackText: "Breaking news: Scientists have made a groundbreaking discovery." },
@@ -54,7 +54,7 @@ export {
54
54
  DEFAULT_FORM_VALUES,
55
55
  DEFAULT_TEXT_TO_IMAGE_PROMPTS,
56
56
  DEFAULT_TEXT_TO_VOICE_PROMPTS,
57
- type ExamplePrompt,
57
+ type PromptSuggestion,
58
58
  } from "./domain";
59
59
 
60
60
  // =============================================================================
@@ -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) => {