@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 +1 -1
- package/src/features/text-to-image/domain/constants/index.ts +1 -1
- package/src/features/text-to-image/domain/constants/prompts.constants.ts +3 -3
- package/src/features/text-to-image/index.ts +1 -1
- package/src/features/text-to-image/infrastructure/services/text-to-image-executor.ts +15 -1
package/package.json
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
* @note Use translationKey for localization - apps should translate these
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
export interface
|
|
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
|
|
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
|
|
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." },
|
|
@@ -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) => {
|