@umituz/react-native-ai-generation-content 1.17.211 → 1.17.213
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/meme-generator/presentation/components/MemeGeneratorFeature.tsx +23 -16
- package/src/presentation/screens/ai-feature/index.ts +2 -1
- package/src/presentation/screens/ai-feature/registry.ts +9 -0
- package/src/presentation/screens/ai-feature/translations.ts +21 -1
- package/src/presentation/screens/ai-feature/types.ts +16 -0
package/package.json
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MemeGeneratorFeature Component
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Unified Text-to-Image feature component for Meme Generation.
|
|
5
5
|
* Integrates PromptInput, StyleSelector, and Generation logic using useTextToImageFeature.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React, { useMemo, useCallback } from "react";
|
|
9
|
-
import { View, ScrollView, StyleSheet,
|
|
10
|
-
import { useAppDesignTokens,
|
|
9
|
+
import { View, ScrollView, StyleSheet, KeyboardAvoidingView, Platform } from "react-native";
|
|
10
|
+
import { useAppDesignTokens, AtomicCard, AtomicText } from "@umituz/react-native-design-system";
|
|
11
11
|
import { getAuthService } from "../../../../infrastructure/config";
|
|
12
12
|
import { useTextToImageFeature } from "../../../text-to-image/presentation/hooks/useTextToImageFeature";
|
|
13
13
|
import { PromptInput } from "../../../../presentation/components/PromptInput";
|
|
14
|
-
import { StyleSelector } from "../../../../presentation/components/selectors/StyleSelector";
|
|
15
14
|
import { GenerateButton } from "../../../../presentation/components/buttons/GenerateButton";
|
|
16
15
|
import { GridSelector } from "../../../../presentation/components/selectors/GridSelector";
|
|
17
|
-
import {
|
|
16
|
+
import { GenerationResultContent } from "../../../../presentation/components/result/GenerationResultContent";
|
|
18
17
|
|
|
19
18
|
// Constants (Using default provided styles if config doesn't override)
|
|
20
|
-
import { DEFAULT_IMAGE_STYLES } from "../../../text-to-image/domain/constants/
|
|
19
|
+
import { DEFAULT_IMAGE_STYLES } from "../../../text-to-image/domain/constants/styles.constants";
|
|
21
20
|
|
|
22
21
|
export interface MemeGeneratorFeatureProps {
|
|
23
22
|
config: any; // AIFeatureConfig merged with extraConfig
|
|
@@ -92,30 +91,38 @@ export const MemeGeneratorFeature: React.FC<MemeGeneratorFeatureProps> = ({
|
|
|
92
91
|
|
|
93
92
|
if (state.imageUrl) {
|
|
94
93
|
return (
|
|
95
|
-
<
|
|
94
|
+
<GenerationResultContent
|
|
96
95
|
imageUrl={state.imageUrl}
|
|
97
96
|
onSave={handleSave}
|
|
98
97
|
onTryAgain={reset}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
resultConfig={{
|
|
99
|
+
header: {
|
|
100
|
+
title: translations.successText || "Your meme is ready!",
|
|
101
|
+
},
|
|
102
|
+
actions: {
|
|
103
|
+
save: {
|
|
104
|
+
label: translations.saveButtonText || "Save to Gallery",
|
|
105
|
+
},
|
|
106
|
+
tryAgain: {
|
|
107
|
+
label: translations.tryAnotherText || "Create Another",
|
|
108
|
+
},
|
|
109
|
+
},
|
|
103
110
|
}}
|
|
104
111
|
/>
|
|
105
112
|
);
|
|
106
113
|
}
|
|
107
114
|
|
|
108
115
|
return (
|
|
109
|
-
<KeyboardAvoidingView
|
|
116
|
+
<KeyboardAvoidingView
|
|
110
117
|
behavior={Platform.OS === "ios" ? "padding" : "height"}
|
|
111
118
|
style={styles.container}
|
|
112
119
|
>
|
|
113
120
|
<ScrollView contentContainerStyle={styles.content} keyboardShouldPersistTaps="handled">
|
|
114
|
-
|
|
121
|
+
|
|
115
122
|
{/* Prompt Input */}
|
|
116
123
|
<View style={styles.section}>
|
|
117
124
|
<AtomicText type="labelLarge" style={{color: tokens.colors.textPrimary}}>
|
|
118
|
-
{translations.
|
|
125
|
+
{translations.description || "Describe your meme idea"}
|
|
119
126
|
</AtomicText>
|
|
120
127
|
<PromptInput
|
|
121
128
|
value={state.prompt}
|
|
@@ -141,9 +148,9 @@ export const MemeGeneratorFeature: React.FC<MemeGeneratorFeatureProps> = ({
|
|
|
141
148
|
{/* Generate Button */}
|
|
142
149
|
<GenerateButton
|
|
143
150
|
onPress={handleGenerate}
|
|
144
|
-
|
|
151
|
+
isProcessing={state.isProcessing}
|
|
145
152
|
isDisabled={!isReady}
|
|
146
|
-
|
|
153
|
+
text={translations.processButtonText || "Generate Meme"}
|
|
147
154
|
/>
|
|
148
155
|
|
|
149
156
|
{/* Error Display */}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
export { AIFeatureScreen } from "./AIFeatureScreen";
|
|
7
7
|
export { AI_FEATURE_CONFIGS, getAIFeatureConfig, hasAIFeature, getAllAIFeatureIds, getAIFeaturesByMode } from "./registry";
|
|
8
|
-
export { createFeatureTranslations, createSingleImageTranslations, createDualImageTranslations, createComparisonTranslations, createPromptTranslations } from "./translations";
|
|
8
|
+
export { createFeatureTranslations, createSingleImageTranslations, createDualImageTranslations, createComparisonTranslations, createPromptTranslations, createTextInputTranslations } from "./translations";
|
|
9
9
|
export type {
|
|
10
10
|
AIFeatureId,
|
|
11
11
|
AIFeatureMode,
|
|
@@ -17,4 +17,5 @@ export type {
|
|
|
17
17
|
DualImageTranslationKeys,
|
|
18
18
|
ComparisonTranslationKeys,
|
|
19
19
|
PromptTranslationKeys,
|
|
20
|
+
TextInputTranslationKeys,
|
|
20
21
|
} from "./types";
|
|
@@ -70,6 +70,15 @@ export const AI_FEATURE_CONFIGS: Record<AIFeatureId, AIFeatureConfig> = {
|
|
|
70
70
|
extraConfig: { featureType: "replace-background" },
|
|
71
71
|
},
|
|
72
72
|
|
|
73
|
+
// Text-input features (no image upload)
|
|
74
|
+
"meme-generator": {
|
|
75
|
+
id: "meme-generator",
|
|
76
|
+
mode: "text-input",
|
|
77
|
+
outputType: "image",
|
|
78
|
+
creditType: "image",
|
|
79
|
+
translationPrefix: "meme-generator",
|
|
80
|
+
},
|
|
81
|
+
|
|
73
82
|
// Dual image features
|
|
74
83
|
"face-swap": {
|
|
75
84
|
id: "face-swap",
|
|
@@ -48,6 +48,25 @@ export function createPromptTranslations(prefix: string, t: TranslateFunction) {
|
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Create text-input translations (text-to-image, meme-generator)
|
|
53
|
+
* For pure text-to-image features without image upload
|
|
54
|
+
*/
|
|
55
|
+
export function createTextInputTranslations(prefix: string, t: TranslateFunction) {
|
|
56
|
+
return {
|
|
57
|
+
title: t(`${prefix}.title`),
|
|
58
|
+
description: t(`${prefix}.description`),
|
|
59
|
+
promptPlaceholder: t(`${prefix}.promptPlaceholder`),
|
|
60
|
+
processButtonText: t(`${prefix}.processButtonText`),
|
|
61
|
+
processingText: t(`${prefix}.processingText`),
|
|
62
|
+
successText: t(`${prefix}.successText`),
|
|
63
|
+
saveButtonText: t(`${prefix}.saveButtonText`),
|
|
64
|
+
tryAnotherText: t(`${prefix}.tryAnotherText`),
|
|
65
|
+
styleLabel: t(`${prefix}.styleLabel`),
|
|
66
|
+
tipsLabel: t(`${prefix}.tipsLabel`),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
51
70
|
/**
|
|
52
71
|
* Create dual image translations (face-swap, ai-hug, ai-kiss)
|
|
53
72
|
*/
|
|
@@ -84,8 +103,9 @@ export function createFeatureTranslations(config: AIFeatureConfig, t: TranslateF
|
|
|
84
103
|
? createComparisonTranslations(translationPrefix, t)
|
|
85
104
|
: createSingleImageTranslations(translationPrefix, t);
|
|
86
105
|
case "single-with-prompt":
|
|
87
|
-
case "text-input":
|
|
88
106
|
return createPromptTranslations(translationPrefix, t);
|
|
107
|
+
case "text-input":
|
|
108
|
+
return createTextInputTranslations(translationPrefix, t);
|
|
89
109
|
case "dual":
|
|
90
110
|
case "dual-video":
|
|
91
111
|
return createDualImageTranslations(translationPrefix, t);
|
|
@@ -91,6 +91,22 @@ export interface DualImageTranslationKeys {
|
|
|
91
91
|
modalBackgroundHint?: string;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Translation keys structure for text-input features (text-to-image, meme-generator)
|
|
96
|
+
*/
|
|
97
|
+
export interface TextInputTranslationKeys {
|
|
98
|
+
title: string;
|
|
99
|
+
description: string;
|
|
100
|
+
promptPlaceholder: string;
|
|
101
|
+
processButtonText: string;
|
|
102
|
+
processingText: string;
|
|
103
|
+
successText: string;
|
|
104
|
+
saveButtonText: string;
|
|
105
|
+
tryAnotherText: string;
|
|
106
|
+
styleLabel?: string;
|
|
107
|
+
tipsLabel?: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
94
110
|
/**
|
|
95
111
|
* Static feature configuration (doesn't change at runtime)
|
|
96
112
|
*/
|