@umituz/react-native-ai-generation-content 1.17.70 → 1.17.72
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/domains/flashcard-generation/FlashcardGenerationService.ts +48 -44
- package/src/features/ai-hug/presentation/components/AIHugFeature.tsx +1 -7
- package/src/features/ai-kiss/presentation/components/AIKissFeature.tsx +1 -7
- package/src/features/anime-selfie/presentation/components/AnimeSelfieFeature.tsx +2 -6
- package/src/features/face-swap/presentation/components/FaceSwapFeature.tsx +1 -7
- package/src/features/hd-touch-up/presentation/components/HDTouchUpFeature.tsx +2 -6
- package/src/features/image-to-video/index.ts +0 -2
- package/src/features/image-to-video/presentation/components/index.ts +2 -2
- package/src/features/photo-restoration/presentation/components/PhotoRestoreFeature.tsx +2 -6
- package/src/features/photo-restoration/presentation/components/PhotoRestoreResultView.tsx +1 -1
- package/src/features/remove-background/presentation/components/RemoveBackgroundFeature.tsx +2 -6
- package/src/features/remove-object/presentation/components/RemoveObjectFeature.tsx +0 -1
- package/src/features/script-generator/domain/constants/index.ts +1 -1
- package/src/features/script-generator/domain/types/script.types.ts +6 -0
- package/src/features/script-generator/infrastructure/services/ScriptGenerationService.ts +3 -3
- package/src/features/script-generator/presentation/components/ScriptDisplay.tsx +1 -1
- package/src/features/script-generator/presentation/components/VideoTypeSelector.tsx +2 -7
- package/src/features/script-generator/presentation/components/index.ts +2 -2
- package/src/features/script-generator/presentation/hooks/useScriptGenerator.ts +4 -1
- package/src/features/text-to-image/index.ts +0 -6
- package/src/features/text-to-image/presentation/components/index.ts +15 -15
- package/src/features/text-to-voice/index.ts +0 -2
- package/src/features/text-to-voice/presentation/components/index.ts +5 -5
- package/src/features/upscaling/presentation/components/UpscaleFeature.tsx +1 -1
- package/src/presentation/components/AIGenerationForm.tsx +2 -2
- package/src/presentation/components/AIGenerationForm.types.ts +2 -1
- package/src/presentation/components/AIGenerationHero.tsx +3 -3
- package/src/presentation/components/PhotoUploadCard/PhotoUploadCard.tsx +1 -1
- package/src/presentation/components/PromptInput.tsx +2 -2
- package/src/presentation/components/buttons/GenerateButton.tsx +3 -3
- package/src/presentation/components/display/AIGenerationResult.tsx +2 -5
- package/src/presentation/components/moderation/ModerationSummary.tsx +2 -2
- package/src/presentation/components/prompts/ExamplePrompts.tsx +2 -2
- package/src/presentation/components/prompts/index.ts +1 -0
- package/src/presentation/components/selectors/GridSelector.tsx +3 -3
- package/src/presentation/hooks/useFlashcardGeneration.ts +2 -1
package/package.json
CHANGED
|
@@ -3,14 +3,6 @@
|
|
|
3
3
|
* AI-powered flashcard generation for educational content
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type {
|
|
7
|
-
GenerationRequest,
|
|
8
|
-
GenerationResult,
|
|
9
|
-
GenerationStatus,
|
|
10
|
-
PhotoGenerationInput,
|
|
11
|
-
DirectExecutionResult,
|
|
12
|
-
} from "../domain/entities";
|
|
13
|
-
|
|
14
6
|
export interface FlashcardGenerationRequest {
|
|
15
7
|
topic: string;
|
|
16
8
|
difficulty: "beginner" | "intermediate" | "advanced";
|
|
@@ -66,18 +58,8 @@ export class FlashcardGenerationService {
|
|
|
66
58
|
// Create AI generation prompt
|
|
67
59
|
const prompt = this.buildFlashcardPrompt(request);
|
|
68
60
|
|
|
69
|
-
//
|
|
70
|
-
const
|
|
71
|
-
prompt,
|
|
72
|
-
type: "text_to_text" as any,
|
|
73
|
-
options: {
|
|
74
|
-
maxTokens: this.calculateMaxTokens(request.count),
|
|
75
|
-
temperature: 0.7,
|
|
76
|
-
language: request.language || "en",
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const result = await this.executeGeneration(generationRequest);
|
|
61
|
+
// Execute generation
|
|
62
|
+
const result = await this.executeGeneration(prompt, request.count);
|
|
81
63
|
|
|
82
64
|
// Parse AI response into flashcards
|
|
83
65
|
const flashcards = this.parseFlashcardsFromResult(result, request);
|
|
@@ -118,9 +100,6 @@ export class FlashcardGenerationService {
|
|
|
118
100
|
overall: number;
|
|
119
101
|
}> {
|
|
120
102
|
// Simple validation heuristic
|
|
121
|
-
const frontLength = front.length;
|
|
122
|
-
const backLength = back.length;
|
|
123
|
-
|
|
124
103
|
const accuracy = this.calculateAccuracy(front, back);
|
|
125
104
|
const relevance = this.calculateRelevance(front, back);
|
|
126
105
|
const clarity = this.calculateClarity(front, back);
|
|
@@ -185,16 +164,25 @@ Output format: JSON array with structure:
|
|
|
185
164
|
return Math.max(count * 50, 200);
|
|
186
165
|
}
|
|
187
166
|
|
|
188
|
-
private async executeGeneration(
|
|
167
|
+
private async executeGeneration(
|
|
168
|
+
prompt: string,
|
|
169
|
+
count: number,
|
|
170
|
+
): Promise<{
|
|
171
|
+
success: boolean;
|
|
172
|
+
result: string;
|
|
173
|
+
metadata: { tokensUsed: number; processingTime: number };
|
|
174
|
+
jobId: string;
|
|
175
|
+
}> {
|
|
189
176
|
// This would integrate with the actual AI generation orchestrator
|
|
190
177
|
// For now, return mock result
|
|
191
178
|
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
192
179
|
|
|
180
|
+
const maxTokens = this.calculateMaxTokens(count);
|
|
193
181
|
return {
|
|
194
182
|
success: true,
|
|
195
|
-
result: this.generateMockContent(
|
|
183
|
+
result: this.generateMockContent(maxTokens),
|
|
196
184
|
metadata: {
|
|
197
|
-
tokensUsed:
|
|
185
|
+
tokensUsed: maxTokens,
|
|
198
186
|
processingTime: 2000,
|
|
199
187
|
},
|
|
200
188
|
jobId: `job_${Date.now()}`,
|
|
@@ -227,11 +215,16 @@ Output format: JSON array with structure:
|
|
|
227
215
|
}
|
|
228
216
|
|
|
229
217
|
private parseFlashcardsFromResult(
|
|
230
|
-
result:
|
|
218
|
+
result: {
|
|
219
|
+
success: boolean;
|
|
220
|
+
result: string | unknown[];
|
|
221
|
+
metadata: { tokensUsed: number; processingTime: number };
|
|
222
|
+
jobId: string;
|
|
223
|
+
},
|
|
231
224
|
request: FlashcardGenerationRequest,
|
|
232
225
|
): GeneratedFlashcard[] {
|
|
233
226
|
try {
|
|
234
|
-
let flashcards:
|
|
227
|
+
let flashcards: unknown[];
|
|
235
228
|
|
|
236
229
|
if (typeof result.result === "string") {
|
|
237
230
|
flashcards = JSON.parse(result.result);
|
|
@@ -241,23 +234,34 @@ Output format: JSON array with structure:
|
|
|
241
234
|
throw new Error("Invalid AI response format");
|
|
242
235
|
}
|
|
243
236
|
|
|
244
|
-
return flashcards.map((item, index) =>
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
237
|
+
return flashcards.map((item: unknown, index) => {
|
|
238
|
+
const flashcard = item as {
|
|
239
|
+
front?: string;
|
|
240
|
+
back?: string;
|
|
241
|
+
difficulty?: "easy" | "medium" | "hard";
|
|
242
|
+
tags?: string | string[];
|
|
243
|
+
};
|
|
244
|
+
return {
|
|
245
|
+
id: `generated_${Date.now()}_${index}`,
|
|
246
|
+
front: flashcard.front || "",
|
|
247
|
+
back: flashcard.back || "",
|
|
248
|
+
difficulty: flashcard.difficulty || "medium",
|
|
249
|
+
tags: Array.isArray(flashcard.tags)
|
|
250
|
+
? flashcard.tags
|
|
251
|
+
: flashcard.tags
|
|
252
|
+
? [flashcard.tags]
|
|
253
|
+
: [],
|
|
254
|
+
source: "ai_generated" as const,
|
|
255
|
+
generationRequest: request,
|
|
256
|
+
confidence: 0.8 + Math.random() * 0.2, // 0.8-1.0
|
|
257
|
+
createdAt: new Date().toISOString(),
|
|
258
|
+
};
|
|
259
|
+
});
|
|
259
260
|
} catch (error) {
|
|
260
|
-
|
|
261
|
+
if (__DEV__) {
|
|
262
|
+
// eslint-disable-next-line no-console
|
|
263
|
+
console.error("Failed to parse AI response:", error);
|
|
264
|
+
}
|
|
261
265
|
return [];
|
|
262
266
|
}
|
|
263
267
|
}
|
|
@@ -6,11 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import React, { useCallback } from "react";
|
|
8
8
|
import { View, ScrollView, StyleSheet, Dimensions } from "react-native";
|
|
9
|
-
import {
|
|
10
|
-
useAppDesignTokens,
|
|
11
|
-
AtomicText,
|
|
12
|
-
AtomicButton,
|
|
13
|
-
} from "@umituz/react-native-design-system";
|
|
9
|
+
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
14
10
|
import { DualImagePicker } from "../../../../presentation/components/image-picker/DualImagePicker";
|
|
15
11
|
import { AIGenerationForm } from "../../../../presentation/components/AIGenerationForm";
|
|
16
12
|
import { AIGenerationResult } from "../../../../presentation/components/display/AIGenerationResult";
|
|
@@ -74,8 +70,6 @@ export const AIHugFeature: React.FC<AIHugFeatureProps> = ({
|
|
|
74
70
|
void feature.selectTargetImage();
|
|
75
71
|
}, [feature]);
|
|
76
72
|
|
|
77
|
-
const canProcess = feature.sourceImageUri && feature.targetImageUri && !feature.isProcessing;
|
|
78
|
-
|
|
79
73
|
if (feature.processedVideoUrl) {
|
|
80
74
|
const screenWidth = Dimensions.get("window").width;
|
|
81
75
|
const videoSize = screenWidth - 48;
|
|
@@ -6,11 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import React, { useCallback } from "react";
|
|
8
8
|
import { View, ScrollView, StyleSheet, Dimensions } from "react-native";
|
|
9
|
-
import {
|
|
10
|
-
useAppDesignTokens,
|
|
11
|
-
AtomicText,
|
|
12
|
-
AtomicButton,
|
|
13
|
-
} from "@umituz/react-native-design-system";
|
|
9
|
+
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
14
10
|
import { DualImagePicker } from "../../../../presentation/components/image-picker/DualImagePicker";
|
|
15
11
|
import { AIGenerationForm } from "../../../../presentation/components/AIGenerationForm";
|
|
16
12
|
import { AIGenerationResult } from "../../../../presentation/components/display/AIGenerationResult";
|
|
@@ -68,8 +64,6 @@ export const AIKissFeature: React.FC<AIKissFeatureProps> = ({
|
|
|
68
64
|
void feature.selectTargetImage();
|
|
69
65
|
}, [feature]);
|
|
70
66
|
|
|
71
|
-
const canProcess = feature.sourceImageUri && feature.targetImageUri && !feature.isProcessing;
|
|
72
|
-
|
|
73
67
|
if (feature.processedVideoUrl) {
|
|
74
68
|
const screenWidth = Dimensions.get("window").width;
|
|
75
69
|
const videoSize = screenWidth - 48;
|
|
@@ -5,12 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import React, { useCallback, useMemo } from "react";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
useAppDesignTokens,
|
|
11
|
-
AtomicText,
|
|
12
|
-
AtomicButton,
|
|
13
|
-
} from "@umituz/react-native-design-system";
|
|
8
|
+
import { ScrollView, StyleSheet, Image, Dimensions } from "react-native";
|
|
9
|
+
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
14
10
|
import { PhotoUploadCard } from "../../../../presentation/components/PhotoUploadCard";
|
|
15
11
|
import { AIGenerationForm } from "../../../../presentation/components/AIGenerationForm";
|
|
16
12
|
import { AIGenerationResult } from "../../../../presentation/components/display/AIGenerationResult";
|
|
@@ -6,11 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import React, { useCallback } from "react";
|
|
8
8
|
import { View, ScrollView, StyleSheet, Image, Dimensions } from "react-native";
|
|
9
|
-
import {
|
|
10
|
-
useAppDesignTokens,
|
|
11
|
-
AtomicText,
|
|
12
|
-
AtomicButton,
|
|
13
|
-
} from "@umituz/react-native-design-system";
|
|
9
|
+
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
14
10
|
import { DualImagePicker } from "../../../../presentation/components/image-picker/DualImagePicker";
|
|
15
11
|
import { AIGenerationForm } from "../../../../presentation/components/AIGenerationForm";
|
|
16
12
|
import { AIGenerationResult } from "../../../../presentation/components/display/AIGenerationResult";
|
|
@@ -65,8 +61,6 @@ export const FaceSwapFeature: React.FC<FaceSwapFeatureProps> = ({
|
|
|
65
61
|
void feature.selectTargetImage();
|
|
66
62
|
}, [feature]);
|
|
67
63
|
|
|
68
|
-
const canProcess = feature.sourceImageUri && feature.targetImageUri && !feature.isProcessing;
|
|
69
|
-
|
|
70
64
|
if (feature.processedUrl) {
|
|
71
65
|
const screenWidth = Dimensions.get("window").width;
|
|
72
66
|
const imageSize = screenWidth - 48;
|
|
@@ -5,12 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import React, { useCallback, useMemo } from "react";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
useAppDesignTokens,
|
|
11
|
-
AtomicText,
|
|
12
|
-
AtomicButton,
|
|
13
|
-
} from "@umituz/react-native-design-system";
|
|
8
|
+
import { ScrollView, StyleSheet, Image, Dimensions } from "react-native";
|
|
9
|
+
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
14
10
|
import { PhotoUploadCard } from "../../../../presentation/components/PhotoUploadCard";
|
|
15
11
|
import { AIGenerationForm } from "../../../../presentation/components/AIGenerationForm";
|
|
16
12
|
import { AIGenerationResult } from "../../../../presentation/components/display/AIGenerationResult";
|
|
@@ -99,7 +99,6 @@ export {
|
|
|
99
99
|
ImageToVideoDurationSelector,
|
|
100
100
|
ImageToVideoMusicMoodSelector,
|
|
101
101
|
ImageToVideoSelectionGrid,
|
|
102
|
-
ImageToVideoHeroSection,
|
|
103
102
|
ImageToVideoGenerateButton,
|
|
104
103
|
} from "./presentation";
|
|
105
104
|
|
|
@@ -109,6 +108,5 @@ export type {
|
|
|
109
108
|
ImageToVideoMusicMoodSelectorProps,
|
|
110
109
|
ImageToVideoSelectionGridProps,
|
|
111
110
|
ImageToVideoSelectionGridTranslations,
|
|
112
|
-
ImageToVideoHeroSectionProps,
|
|
113
111
|
ImageToVideoGenerateButtonProps,
|
|
114
112
|
} from "./presentation";
|
|
@@ -26,5 +26,5 @@ export type {
|
|
|
26
26
|
// export type { HeroSectionProps as ImageToVideoHeroSectionProps } from "./HeroSection";
|
|
27
27
|
|
|
28
28
|
// Action Components
|
|
29
|
-
export { GenerateButton as ImageToVideoGenerateButton } from "
|
|
30
|
-
export type { GenerateButtonProps as ImageToVideoGenerateButtonProps } from "
|
|
29
|
+
export { GenerateButton as ImageToVideoGenerateButton } from "../../../../presentation/components/buttons";
|
|
30
|
+
export type { GenerateButtonProps as ImageToVideoGenerateButtonProps } from "../../../../presentation/components/buttons";
|
|
@@ -5,12 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import React, { useCallback, useMemo } from "react";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
useAppDesignTokens,
|
|
11
|
-
AtomicText,
|
|
12
|
-
AtomicButton,
|
|
13
|
-
} from "@umituz/react-native-design-system";
|
|
8
|
+
import { ScrollView, StyleSheet } from "react-native";
|
|
9
|
+
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
14
10
|
import { PhotoUploadCard } from "../../../../presentation/components/PhotoUploadCard";
|
|
15
11
|
import { AIGenerationForm } from "../../../../presentation/components/AIGenerationForm";
|
|
16
12
|
import { PhotoRestoreResultView } from "./PhotoRestoreResultView";
|
|
@@ -5,12 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import React, { useCallback, useMemo } from "react";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
useAppDesignTokens,
|
|
11
|
-
AtomicText,
|
|
12
|
-
AtomicButton,
|
|
13
|
-
} from "@umituz/react-native-design-system";
|
|
8
|
+
import { ScrollView, StyleSheet, Image, Dimensions } from "react-native";
|
|
9
|
+
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
14
10
|
import { PhotoUploadCard } from "../../../../presentation/components/PhotoUploadCard";
|
|
15
11
|
import { AIGenerationForm } from "../../../../presentation/components/AIGenerationForm";
|
|
16
12
|
import { AIGenerationResult } from "../../../../presentation/components/display/AIGenerationResult";
|
|
@@ -9,7 +9,6 @@ import { View, ScrollView, StyleSheet, Image, Dimensions, TextInput } from "reac
|
|
|
9
9
|
import {
|
|
10
10
|
useAppDesignTokens,
|
|
11
11
|
AtomicText,
|
|
12
|
-
AtomicButton,
|
|
13
12
|
} from "@umituz/react-native-design-system";
|
|
14
13
|
import { PhotoUploadCard } from "../../../../presentation/components/PhotoUploadCard";
|
|
15
14
|
import { AIGenerationForm } from "../../../../presentation/components/AIGenerationForm";
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
* AI Script Generator Types
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
export interface VideoTypeOption {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly emoji: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
5
11
|
export interface ScriptSection {
|
|
6
12
|
readonly id: string;
|
|
7
13
|
readonly type: "hook" | "intro" | "main" | "transition" | "cta";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ScriptSection,
|
|
3
3
|
ScriptGenerationRequest,
|
|
4
|
-
} from "
|
|
5
|
-
import { DEFAULT_VIDEO_TYPES } from "
|
|
4
|
+
} from "../../domain/types/script.types";
|
|
5
|
+
import { DEFAULT_VIDEO_TYPES } from "../../domain/constants";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* ScriptGenerationService
|
|
@@ -51,7 +51,7 @@ Format as JSON with this structure:
|
|
|
51
51
|
* Generate script from request
|
|
52
52
|
*/
|
|
53
53
|
async generateScript(
|
|
54
|
-
|
|
54
|
+
_request: ScriptGenerationRequest,
|
|
55
55
|
): Promise<readonly ScriptSection[] | null> {
|
|
56
56
|
// NOTE: This will be implemented by the app using a specific AI provider (like OpenAI or FAL)
|
|
57
57
|
// The package provides the structure and prompt building.
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
AtomicIcon,
|
|
11
11
|
useAppDesignTokens,
|
|
12
12
|
} from "@umituz/react-native-design-system";
|
|
13
|
-
import type { ScriptSection } from "
|
|
13
|
+
import type { ScriptSection } from "../../domain/types/script.types";
|
|
14
14
|
|
|
15
15
|
export interface ScriptDisplayProps {
|
|
16
16
|
readonly script: readonly ScriptSection[];
|
|
@@ -9,12 +9,7 @@ import {
|
|
|
9
9
|
AtomicText,
|
|
10
10
|
useAppDesignTokens,
|
|
11
11
|
} from "@umituz/react-native-design-system";
|
|
12
|
-
|
|
13
|
-
export interface VideoTypeOption {
|
|
14
|
-
readonly id: string;
|
|
15
|
-
readonly name: string;
|
|
16
|
-
readonly emoji: string;
|
|
17
|
-
}
|
|
12
|
+
import { VideoTypeOption } from "../../domain/types/script.types";
|
|
18
13
|
|
|
19
14
|
export interface VideoTypeSelectorProps {
|
|
20
15
|
readonly selectedType: string;
|
|
@@ -68,7 +63,7 @@ export const VideoTypeSelector: React.FC<VideoTypeSelectorProps> = ({
|
|
|
68
63
|
style={{
|
|
69
64
|
color:
|
|
70
65
|
selectedType === type.id
|
|
71
|
-
?
|
|
66
|
+
? tokens.colors.onPrimary
|
|
72
67
|
: tokens.colors.textPrimary,
|
|
73
68
|
fontWeight: selectedType === type.id ? "600" : "400",
|
|
74
69
|
marginTop: 8,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export { ScriptDisplay } from "./ScriptDisplay";
|
|
2
|
+
export { VideoTypeSelector, type VideoTypeSelectorProps } from "./VideoTypeSelector";
|
|
@@ -45,7 +45,10 @@ export function useScriptGenerator({
|
|
|
45
45
|
setGeneratedScript(script);
|
|
46
46
|
}
|
|
47
47
|
} catch (error) {
|
|
48
|
-
|
|
48
|
+
if (__DEV__) {
|
|
49
|
+
// eslint-disable-next-line no-console
|
|
50
|
+
console.error("Script generation error:", error);
|
|
51
|
+
}
|
|
49
52
|
} finally {
|
|
50
53
|
setIsGenerating(false);
|
|
51
54
|
}
|
|
@@ -102,14 +102,8 @@ export {
|
|
|
102
102
|
export type {
|
|
103
103
|
TextToImagePromptInputProps,
|
|
104
104
|
TextToImageExamplePromptsProps,
|
|
105
|
-
TextToImageNumImagesSelectorProps,
|
|
106
105
|
TextToImageStyleSelectorProps,
|
|
107
106
|
TextToImageAspectRatioSelectorProps,
|
|
108
|
-
TextToImageAspectRatioOption,
|
|
109
|
-
TextToImageSizeSelectorProps,
|
|
110
|
-
TextToImageSizeOption,
|
|
111
|
-
TextToImageOutputFormatSelectorProps,
|
|
112
|
-
TextToImageOutputFormatOption,
|
|
113
107
|
TextToImageGenerateButtonProps,
|
|
114
108
|
TextToImageSettingsSheetProps,
|
|
115
109
|
} from "./presentation";
|
|
@@ -4,27 +4,27 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Input Components
|
|
7
|
-
export { PromptInput as TextToImagePromptInput } from "
|
|
8
|
-
export type { PromptInputProps as TextToImagePromptInputProps } from "
|
|
7
|
+
export { PromptInput as TextToImagePromptInput } from "../../../../presentation/components/PromptInput";
|
|
8
|
+
export type { PromptInputProps as TextToImagePromptInputProps } from "../../../../presentation/components/PromptInput";
|
|
9
9
|
|
|
10
|
-
export { ExamplePrompts as TextToImageExamplePrompts } from "
|
|
11
|
-
export type { ExamplePromptsProps as TextToImageExamplePromptsProps } from "
|
|
10
|
+
export { ExamplePrompts as TextToImageExamplePrompts } from "../../../../presentation/components/prompts";
|
|
11
|
+
export type { ExamplePromptsProps as TextToImageExamplePromptsProps } from "../../../../presentation/components/prompts";
|
|
12
12
|
|
|
13
13
|
// Selector Components
|
|
14
|
-
export { StyleSelector as TextToImageStyleSelector } from "
|
|
15
|
-
export type { StyleSelectorProps as TextToImageStyleSelectorProps } from "
|
|
14
|
+
export { StyleSelector as TextToImageStyleSelector } from "../../../../presentation/components/selectors";
|
|
15
|
+
export type { StyleSelectorProps as TextToImageStyleSelectorProps } from "../../../../presentation/components/selectors";
|
|
16
16
|
|
|
17
|
-
export { AspectRatioSelector as TextToImageAspectRatioSelector } from "
|
|
18
|
-
export type { AspectRatioSelectorProps as TextToImageAspectRatioSelectorProps } from "
|
|
17
|
+
export { AspectRatioSelector as TextToImageAspectRatioSelector } from "../../../../presentation/components/selectors";
|
|
18
|
+
export type { AspectRatioSelectorProps as TextToImageAspectRatioSelectorProps } from "../../../../presentation/components/selectors";
|
|
19
19
|
|
|
20
|
-
export { GridSelector as TextToImageSizeSelector } from "
|
|
21
|
-
export { GridSelector as TextToImageOutputFormatSelector } from "
|
|
22
|
-
export { GridSelector as TextToImageNumImagesSelector } from "
|
|
20
|
+
export { GridSelector as TextToImageSizeSelector } from "../../../../presentation/components/selectors";
|
|
21
|
+
export { GridSelector as TextToImageOutputFormatSelector } from "../../../../presentation/components/selectors";
|
|
22
|
+
export { GridSelector as TextToImageNumImagesSelector } from "../../../../presentation/components/selectors";
|
|
23
23
|
|
|
24
24
|
// Action Components
|
|
25
|
-
export { GenerateButton as TextToImageGenerateButton } from "
|
|
26
|
-
export type { GenerateButtonProps as TextToImageGenerateButtonProps } from "
|
|
25
|
+
export { GenerateButton as TextToImageGenerateButton } from "../../../../presentation/components/buttons";
|
|
26
|
+
export type { GenerateButtonProps as TextToImageGenerateButtonProps } from "../../../../presentation/components/buttons";
|
|
27
27
|
|
|
28
28
|
// Sheet Components
|
|
29
|
-
export { SettingsSheet as TextToImageSettingsSheet } from "
|
|
30
|
-
export type { SettingsSheetProps as TextToImageSettingsSheetProps } from "
|
|
29
|
+
export { SettingsSheet as TextToImageSettingsSheet } from "../../../../presentation/components/modals/SettingsSheet";
|
|
30
|
+
export type { SettingsSheetProps as TextToImageSettingsSheetProps } from "../../../../presentation/components/modals/SettingsSheet";
|
|
@@ -20,7 +20,6 @@ export type {
|
|
|
20
20
|
TextToVoiceGenerateButtonProps,
|
|
21
21
|
TextToVoiceAudioPlayerProps,
|
|
22
22
|
TextToVoiceErrorMessageProps,
|
|
23
|
-
TextToVoiceHeaderProps,
|
|
24
23
|
TextToVoiceScreenConfig,
|
|
25
24
|
TextToVoiceTranslationKeys,
|
|
26
25
|
TextToVoiceInputBuilder,
|
|
@@ -51,5 +50,4 @@ export {
|
|
|
51
50
|
TextToVoiceGenerateButton,
|
|
52
51
|
TextToVoiceAudioPlayer,
|
|
53
52
|
TextToVoiceErrorMessage,
|
|
54
|
-
TextToVoiceHeader,
|
|
55
53
|
} from "./presentation";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { PromptInput as TextToVoiceTextInput } from "
|
|
2
|
-
export { PromptInput as TextToVoiceOptionalInput } from "
|
|
3
|
-
export { ExamplePrompts as TextToVoiceExamplePrompts } from "
|
|
4
|
-
export { GenerateButton as TextToVoiceGenerateButton } from "
|
|
5
|
-
export { ErrorDisplay as TextToVoiceErrorMessage } from "
|
|
1
|
+
export { PromptInput as TextToVoiceTextInput } from "../../../../presentation/components/PromptInput";
|
|
2
|
+
export { PromptInput as TextToVoiceOptionalInput } from "../../../../presentation/components/PromptInput";
|
|
3
|
+
export { ExamplePrompts as TextToVoiceExamplePrompts } from "../../../../presentation/components/prompts";
|
|
4
|
+
export { GenerateButton as TextToVoiceGenerateButton } from "../../../../presentation/components/buttons";
|
|
5
|
+
export { ErrorDisplay as TextToVoiceErrorMessage } from "../../../../presentation/components/display";
|
|
6
6
|
export { TextToVoiceAudioPlayer } from "./TextToVoiceAudioPlayer";
|
|
7
7
|
// TextToVoiceHeader removed in favor of common AIGenerationHero
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { TouchableOpacity, StyleSheet } from "react-native";
|
|
3
3
|
import {
|
|
4
4
|
AtomicText,
|
|
5
5
|
AtomicIcon,
|
|
@@ -70,7 +70,7 @@ export const AIGenerationForm: React.FC<AIGenerationFormProps> = ({
|
|
|
70
70
|
<AtomicIcon
|
|
71
71
|
name={showAdvanced ? "chevron-up" : "chevron-down"}
|
|
72
72
|
size="sm"
|
|
73
|
-
|
|
73
|
+
customColor={tokens.colors.textSecondary}
|
|
74
74
|
/>
|
|
75
75
|
</TouchableOpacity>
|
|
76
76
|
)}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from "react";
|
|
2
|
-
import type { StyleOption, AspectRatioOption
|
|
2
|
+
import type { StyleOption, AspectRatioOption } from "./selectors/types";
|
|
3
|
+
import type { StylePreset } from "./StylePresetsGrid";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Translations for AIGenerationForm
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import React from "react";
|
|
8
|
-
import { View, StyleSheet } from "react-native";
|
|
8
|
+
import { View, StyleSheet, type ViewStyle } from "react-native";
|
|
9
9
|
import { LinearGradient } from "expo-linear-gradient";
|
|
10
10
|
import {
|
|
11
11
|
AtomicText,
|
|
@@ -18,7 +18,7 @@ export interface AIGenerationHeroProps {
|
|
|
18
18
|
readonly subtitle?: string;
|
|
19
19
|
readonly iconName?: string;
|
|
20
20
|
readonly gradientColors?: readonly [string, string, ...string[]];
|
|
21
|
-
readonly style?:
|
|
21
|
+
readonly style?: ViewStyle;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export const AIGenerationHero: React.FC<AIGenerationHeroProps> = ({
|
|
@@ -38,7 +38,7 @@ export const AIGenerationHero: React.FC<AIGenerationHeroProps> = ({
|
|
|
38
38
|
return (
|
|
39
39
|
<View style={[styles.container, style]}>
|
|
40
40
|
<LinearGradient
|
|
41
|
-
colors={finalColors as
|
|
41
|
+
colors={finalColors as [string, string, ...string[]]}
|
|
42
42
|
start={{ x: 0, y: 0 }}
|
|
43
43
|
end={{ x: 1, y: 1 }}
|
|
44
44
|
style={styles.gradient}
|
|
@@ -234,7 +234,7 @@ export const PhotoUploadCard: React.FC<PhotoUploadCardProps> = ({
|
|
|
234
234
|
style={styles.iconGradient}
|
|
235
235
|
>
|
|
236
236
|
<AtomicIcon
|
|
237
|
-
name={(icon as
|
|
237
|
+
name={(icon as string) || "camera"}
|
|
238
238
|
size={cfg.iconSize}
|
|
239
239
|
customColor={tokens.colors.primary}
|
|
240
240
|
/>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import React from "react";
|
|
8
|
-
import { View, TextInput, StyleSheet } from "react-native";
|
|
8
|
+
import { View, TextInput, StyleSheet, type ViewStyle } from "react-native";
|
|
9
9
|
import {
|
|
10
10
|
AtomicText,
|
|
11
11
|
useAppDesignTokens,
|
|
@@ -22,7 +22,7 @@ export interface PromptInputProps {
|
|
|
22
22
|
readonly isDisabled?: boolean;
|
|
23
23
|
readonly showCharacterCount?: boolean;
|
|
24
24
|
readonly characterCountLabel?: string;
|
|
25
|
-
readonly style?:
|
|
25
|
+
readonly style?: ViewStyle;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export const PromptInput: React.FC<PromptInputProps> = ({
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import React from "react";
|
|
8
|
-
import { View, StyleSheet, TouchableOpacity, ActivityIndicator } from "react-native";
|
|
8
|
+
import { View, StyleSheet, TouchableOpacity, ActivityIndicator, type ViewStyle } from "react-native";
|
|
9
9
|
import {
|
|
10
10
|
AtomicText,
|
|
11
11
|
useAppDesignTokens,
|
|
@@ -26,7 +26,7 @@ export interface GenerateButtonProps {
|
|
|
26
26
|
readonly costLabel?: string;
|
|
27
27
|
readonly accessoryRight?: React.ReactNode;
|
|
28
28
|
readonly onAccessoryRightPress?: () => void;
|
|
29
|
-
readonly style?:
|
|
29
|
+
readonly style?: ViewStyle;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export const GenerateButton: React.FC<GenerateButtonProps> = ({
|
|
@@ -98,7 +98,7 @@ export const GenerateButton: React.FC<GenerateButtonProps> = ({
|
|
|
98
98
|
onPress={onPress}
|
|
99
99
|
disabled={disabled}
|
|
100
100
|
activeOpacity={0.85}
|
|
101
|
-
style={[styles.buttonWrapper, accessoryRight
|
|
101
|
+
style={[styles.buttonWrapper, accessoryRight ? { flex: 1 } : undefined]}
|
|
102
102
|
>
|
|
103
103
|
<LinearGradient
|
|
104
104
|
colors={disabled ? ["#9CA3AF", "#6B7280"] : gradientColors}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from "react";
|
|
2
|
-
import { View, StyleSheet, Dimensions } from "react-native";
|
|
2
|
+
import { View, StyleSheet, Dimensions, type ViewStyle } from "react-native";
|
|
3
3
|
import {
|
|
4
4
|
useAppDesignTokens,
|
|
5
5
|
AtomicText,
|
|
@@ -29,7 +29,7 @@ export interface AIGenerationResultProps extends PropsWithChildren {
|
|
|
29
29
|
/** Standard translations */
|
|
30
30
|
translations?: AIGenerationResultTranslations;
|
|
31
31
|
/** Custom style for the content container */
|
|
32
|
-
contentStyle?:
|
|
32
|
+
contentStyle?: ViewStyle;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/**
|
|
@@ -73,7 +73,6 @@ export const AIGenerationResult: React.FC<AIGenerationResultProps> = ({
|
|
|
73
73
|
onPress={primaryAction.onPress}
|
|
74
74
|
variant="primary"
|
|
75
75
|
size="lg"
|
|
76
|
-
leftIcon={primaryAction.icon}
|
|
77
76
|
/>
|
|
78
77
|
)}
|
|
79
78
|
|
|
@@ -83,7 +82,6 @@ export const AIGenerationResult: React.FC<AIGenerationResultProps> = ({
|
|
|
83
82
|
onPress={secondaryAction.onPress}
|
|
84
83
|
variant="secondary"
|
|
85
84
|
size="lg"
|
|
86
|
-
leftIcon={secondaryAction.icon}
|
|
87
85
|
/>
|
|
88
86
|
)}
|
|
89
87
|
|
|
@@ -94,7 +92,6 @@ export const AIGenerationResult: React.FC<AIGenerationResultProps> = ({
|
|
|
94
92
|
onPress={action.onPress}
|
|
95
93
|
variant={action.variant || "outline"}
|
|
96
94
|
size="lg"
|
|
97
|
-
leftIcon={action.icon}
|
|
98
95
|
/>
|
|
99
96
|
))}
|
|
100
97
|
</View>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import React from "react";
|
|
7
|
-
import { View, StyleSheet } from "react-native";
|
|
7
|
+
import { View, StyleSheet, type ViewStyle } from "react-native";
|
|
8
8
|
import {
|
|
9
9
|
AtomicText,
|
|
10
10
|
useAppDesignTokens,
|
|
@@ -14,7 +14,7 @@ export interface ModerationSummaryProps {
|
|
|
14
14
|
readonly ageRating?: string;
|
|
15
15
|
readonly contentWarnings: readonly string[];
|
|
16
16
|
readonly title?: string;
|
|
17
|
-
readonly style?:
|
|
17
|
+
readonly style?: ViewStyle;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export const ModerationSummary: React.FC<ModerationSummaryProps> = ({
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import React from "react";
|
|
8
|
-
import { View, ScrollView, TouchableOpacity, StyleSheet } from "react-native";
|
|
8
|
+
import { View, ScrollView, TouchableOpacity, StyleSheet, type ViewStyle } from "react-native";
|
|
9
9
|
import {
|
|
10
10
|
AtomicText,
|
|
11
11
|
useAppDesignTokens,
|
|
@@ -16,7 +16,7 @@ export interface ExamplePromptsProps {
|
|
|
16
16
|
readonly onSelectPrompt: (prompt: string) => void;
|
|
17
17
|
readonly title?: string;
|
|
18
18
|
readonly cardWidth?: number;
|
|
19
|
-
readonly style?:
|
|
19
|
+
readonly style?: ViewStyle;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export const ExamplePrompts: React.FC<ExamplePromptsProps> = ({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ExamplePrompts, type ExamplePromptsProps } from "./ExamplePrompts";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { View, TouchableOpacity, StyleSheet } from "react-native";
|
|
2
|
+
import { View, TouchableOpacity, StyleSheet, type ViewStyle } from "react-native";
|
|
3
3
|
import {
|
|
4
4
|
AtomicText,
|
|
5
5
|
useAppDesignTokens,
|
|
@@ -19,7 +19,7 @@ export interface GridSelectorProps<T> {
|
|
|
19
19
|
readonly title?: string;
|
|
20
20
|
readonly columns?: number;
|
|
21
21
|
readonly disabled?: boolean;
|
|
22
|
-
readonly style?:
|
|
22
|
+
readonly style?: ViewStyle;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export function GridSelector<T>({
|
|
@@ -30,7 +30,7 @@ export function GridSelector<T>({
|
|
|
30
30
|
columns = 2,
|
|
31
31
|
disabled = false,
|
|
32
32
|
style,
|
|
33
|
-
}: GridSelectorProps<T>):
|
|
33
|
+
}: GridSelectorProps<T>): React.ReactElement {
|
|
34
34
|
const tokens = useAppDesignTokens();
|
|
35
35
|
|
|
36
36
|
return (
|
|
@@ -8,7 +8,7 @@ import type {
|
|
|
8
8
|
FlashcardGenerationRequest,
|
|
9
9
|
GeneratedFlashcard,
|
|
10
10
|
FlashcardGenerationResult,
|
|
11
|
-
} from "
|
|
11
|
+
} from "../../domains/flashcard-generation/FlashcardGenerationService";
|
|
12
12
|
|
|
13
13
|
export interface UseFlashcardGenerationResult {
|
|
14
14
|
generateFlashcards: (
|
|
@@ -17,6 +17,7 @@ export interface UseFlashcardGenerationResult {
|
|
|
17
17
|
isGenerating: boolean;
|
|
18
18
|
result: FlashcardGenerationResult | null;
|
|
19
19
|
error: string | null;
|
|
20
|
+
reset: () => void;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export const useFlashcardGeneration = (): UseFlashcardGenerationResult => {
|