@umituz/react-native-ai-generation-content 1.17.85 → 1.17.87
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 +2 -2
- package/src/domains/creations/index.ts +6 -3
- package/src/domains/creations/presentation/components/CreationActions.tsx +3 -3
- package/src/domains/creations/presentation/components/CreationBadges.tsx +3 -3
- package/src/domains/creations/presentation/components/CreationDetail/DetailStory.tsx +5 -8
- package/src/domains/creations/presentation/components/CreationPreview.tsx +3 -2
- package/src/domains/creations/presentation/components/CreationThumbnail.tsx +1 -1
- package/src/domains/creations/presentation/components/index.ts +0 -3
- package/src/domains/creations/presentation/screens/CreationDetailScreen.tsx +5 -4
- package/src/domains/creations/presentation/screens/CreationsGalleryScreen.tsx +2 -11
- package/src/domains/creations/presentation/utils/filterUtils.ts +18 -1
- package/src/domains/face-detection/presentation/components/FaceValidationStatus.tsx +3 -2
- package/src/domains/flashcard-generation/FlashcardGenerationService.ts +85 -311
- package/src/domains/flashcard-generation/builders/flashcard-prompt.builder.ts +55 -0
- package/src/domains/flashcard-generation/parsers/flashcard-response.parser.ts +68 -0
- package/src/domains/flashcard-generation/types/flashcard.types.ts +56 -0
- package/src/domains/flashcard-generation/validators/flashcard.validator.ts +67 -0
- package/src/features/image-to-video/presentation/components/MusicMoodSelector.tsx +3 -3
- package/src/features/meme-generator/presentation/screens/MemeGeneratorScreen.tsx +2 -2
- package/src/features/replace-background/domain/entities/component.types.ts +0 -9
- package/src/features/replace-background/domain/entities/index.ts +0 -1
- package/src/features/replace-background/index.ts +0 -2
- package/src/features/replace-background/presentation/components/BackgroundFeature.tsx +3 -6
- package/src/features/replace-background/presentation/components/GenerateButton.tsx +3 -2
- package/src/features/replace-background/presentation/components/ResultDisplay.tsx +1 -2
- package/src/features/replace-background/presentation/components/index.ts +0 -1
- package/src/features/script-generator/presentation/components/ScriptDisplay.tsx +3 -4
- package/src/features/text-to-image/domain/constants/index.ts +3 -3
- package/src/features/text-to-image/domain/constants/options.constants.ts +12 -25
- package/src/features/text-to-image/index.ts +3 -3
- package/src/features/text-to-video/presentation/components/HeroSection.tsx +2 -8
- package/src/features/text-to-video/presentation/components/OptionsPanel.tsx +3 -5
- package/src/presentation/components/AIGenerationForm.tsx +0 -1
- package/src/presentation/components/AIGenerationHero.tsx +27 -24
- package/src/presentation/components/AIGenerationProgressInline.tsx +4 -3
- package/src/presentation/components/GenerationProgressContent.tsx +4 -2
- package/src/presentation/components/PendingJobCard.tsx +5 -5
- package/src/presentation/components/PhotoUploadCard/PhotoUploadCard.tsx +14 -28
- package/src/presentation/components/StylePresetsGrid.tsx +5 -3
- package/src/presentation/components/buttons/GenerateButton.tsx +38 -100
- package/src/presentation/components/headers/FeatureHeader.tsx +15 -9
- package/src/presentation/components/image-picker/DualImagePicker.tsx +0 -6
- package/src/presentation/components/image-picker/ImagePickerBox.tsx +27 -16
- package/src/presentation/components/modals/SettingsSheet.tsx +4 -2
- package/src/presentation/components/result/ResultImageCard.tsx +12 -35
- package/src/presentation/components/result/ResultStoryCard.tsx +10 -16
- package/src/domains/creations/presentation/components/CreationsProvider.tsx +0 -56
- package/src/features/replace-background/presentation/components/ProcessingModal.tsx +0 -113
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-ai-generation-content",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.87",
|
|
4
4
|
"description": "Provider-agnostic AI generation orchestration for React Native",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -84,9 +84,9 @@
|
|
|
84
84
|
"expo-haptics": "^15.0.8",
|
|
85
85
|
"expo-image": "^3.0.11",
|
|
86
86
|
"expo-linear-gradient": "~15.0.7",
|
|
87
|
-
"expo-video": "^2.0.0",
|
|
88
87
|
"expo-localization": "^17.0.8",
|
|
89
88
|
"expo-sharing": "^14.0.8",
|
|
89
|
+
"expo-video": "^2.0.0",
|
|
90
90
|
"firebase": "^12.6.0",
|
|
91
91
|
"i18next": "^25.7.3",
|
|
92
92
|
"react": "19.1.0",
|
|
@@ -149,10 +149,13 @@ export {
|
|
|
149
149
|
// Gallery Components
|
|
150
150
|
export { CreationsHomeCard } from "./presentation/components/CreationsHomeCard";
|
|
151
151
|
export { EmptyState } from "./presentation/components/EmptyState";
|
|
152
|
+
|
|
153
|
+
// Utilities
|
|
152
154
|
export {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
155
|
+
getLocalizedTitle,
|
|
156
|
+
getFilterCategoriesFromConfig,
|
|
157
|
+
getTranslatedTypes,
|
|
158
|
+
} from "./presentation/utils/filterUtils";
|
|
156
159
|
|
|
157
160
|
// =============================================================================
|
|
158
161
|
// PRESENTATION LAYER - Screens
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
View,
|
|
9
9
|
StyleSheet,
|
|
10
10
|
TouchableOpacity,
|
|
11
|
-
ActivityIndicator,
|
|
12
11
|
} from "react-native";
|
|
13
12
|
import {
|
|
14
13
|
useAppDesignTokens,
|
|
15
14
|
AtomicIcon,
|
|
15
|
+
AtomicSpinner,
|
|
16
16
|
} from "@umituz/react-native-design-system";
|
|
17
17
|
|
|
18
18
|
export interface CreationAction {
|
|
@@ -102,8 +102,8 @@ export function CreationActions({
|
|
|
102
102
|
activeOpacity={0.7}
|
|
103
103
|
>
|
|
104
104
|
{action.loading ? (
|
|
105
|
-
<
|
|
106
|
-
size="
|
|
105
|
+
<AtomicSpinner
|
|
106
|
+
size="sm"
|
|
107
107
|
color={action.filled ? tokens.colors.textInverse : tokens.colors.primary}
|
|
108
108
|
/>
|
|
109
109
|
) : (
|
|
@@ -78,17 +78,17 @@ export function CreationBadges({
|
|
|
78
78
|
paddingHorizontal: 8,
|
|
79
79
|
paddingVertical: 4,
|
|
80
80
|
borderRadius: 12,
|
|
81
|
-
backgroundColor:
|
|
81
|
+
backgroundColor: tokens.colors.modalOverlay,
|
|
82
82
|
gap: 4,
|
|
83
83
|
},
|
|
84
84
|
typeText: {
|
|
85
85
|
fontSize: 10,
|
|
86
86
|
fontWeight: "600",
|
|
87
|
-
color:
|
|
87
|
+
color: tokens.colors.textInverse,
|
|
88
88
|
textTransform: "capitalize",
|
|
89
89
|
},
|
|
90
90
|
}),
|
|
91
|
-
[statusColor]
|
|
91
|
+
[statusColor, tokens]
|
|
92
92
|
);
|
|
93
93
|
|
|
94
94
|
return (
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { View, StyleSheet } from 'react-native';
|
|
4
4
|
import { AtomicText, useAppDesignTokens, type DesignTokens } from "@umituz/react-native-design-system";
|
|
5
|
-
import { LinearGradient } from 'expo-linear-gradient';
|
|
6
5
|
|
|
7
6
|
interface DetailStoryProps {
|
|
8
7
|
readonly story: string;
|
|
@@ -16,16 +15,13 @@ export const DetailStory: React.FC<DetailStoryProps> = ({ story }) => {
|
|
|
16
15
|
|
|
17
16
|
return (
|
|
18
17
|
<View style={styles.container}>
|
|
19
|
-
<
|
|
20
|
-
colors={[tokens.colors.primary + '15', tokens.colors.primary + '05']}
|
|
21
|
-
style={styles.gradient}
|
|
22
|
-
>
|
|
18
|
+
<View style={styles.storyContainer}>
|
|
23
19
|
<AtomicText style={styles.quoteMark}>"</AtomicText>
|
|
24
20
|
<AtomicText style={styles.text}>{story}</AtomicText>
|
|
25
21
|
<View style={styles.quoteEndRow}>
|
|
26
22
|
<AtomicText style={[styles.quoteMark, styles.quoteEnd]}>"</AtomicText>
|
|
27
23
|
</View>
|
|
28
|
-
</
|
|
24
|
+
</View>
|
|
29
25
|
</View>
|
|
30
26
|
);
|
|
31
27
|
};
|
|
@@ -35,11 +31,12 @@ const useStyles = (tokens: DesignTokens) => StyleSheet.create({
|
|
|
35
31
|
paddingHorizontal: tokens.spacing.lg,
|
|
36
32
|
marginBottom: tokens.spacing.lg,
|
|
37
33
|
},
|
|
38
|
-
|
|
34
|
+
storyContainer: {
|
|
39
35
|
padding: tokens.spacing.lg,
|
|
40
36
|
borderRadius: 20,
|
|
41
37
|
borderWidth: 1,
|
|
42
|
-
borderColor: tokens.colors.
|
|
38
|
+
borderColor: tokens.colors.border,
|
|
39
|
+
backgroundColor: tokens.colors.surface,
|
|
43
40
|
},
|
|
44
41
|
quoteMark: {
|
|
45
42
|
fontSize: 48,
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import React, { useMemo } from "react";
|
|
7
|
-
import { View, StyleSheet, Image
|
|
7
|
+
import { View, StyleSheet, Image } from "react-native";
|
|
8
8
|
import {
|
|
9
9
|
useAppDesignTokens,
|
|
10
10
|
AtomicIcon,
|
|
11
|
+
AtomicSpinner,
|
|
11
12
|
} from "@umituz/react-native-design-system";
|
|
12
13
|
import type { CreationStatus, CreationTypeId } from "../../domain/types";
|
|
13
14
|
import { isInProgress } from "../../domain/utils";
|
|
@@ -86,7 +87,7 @@ export function CreationPreview({
|
|
|
86
87
|
<View style={styles.container}>
|
|
87
88
|
<View style={styles.loadingContainer}>
|
|
88
89
|
<View style={styles.loadingIcon}>
|
|
89
|
-
<
|
|
90
|
+
<AtomicSpinner size="lg" color="primary" />
|
|
90
91
|
</View>
|
|
91
92
|
</View>
|
|
92
93
|
</View>
|
|
@@ -35,7 +35,7 @@ export function CreationThumbnail({
|
|
|
35
35
|
},
|
|
36
36
|
overlay: {
|
|
37
37
|
...StyleSheet.absoluteFillObject,
|
|
38
|
-
backgroundColor:
|
|
38
|
+
backgroundColor: tokens.colors.modalOverlay,
|
|
39
39
|
borderRadius: tokens.spacing.sm,
|
|
40
40
|
justifyContent: "center",
|
|
41
41
|
alignItems: "center",
|
|
@@ -31,9 +31,6 @@ export { CreationsHomeCard } from "./CreationsHomeCard";
|
|
|
31
31
|
export { CreationImageViewer } from "./CreationImageViewer";
|
|
32
32
|
export { CreationsGrid } from "./CreationsGrid";
|
|
33
33
|
|
|
34
|
-
// Provider
|
|
35
|
-
export { CreationsProvider, useCreationsProvider } from "./CreationsProvider";
|
|
36
|
-
|
|
37
34
|
// Detail Components
|
|
38
35
|
export { DetailHeader } from "./CreationDetail/DetailHeader";
|
|
39
36
|
export { DetailImage } from "./CreationDetail/DetailImage";
|
|
@@ -3,20 +3,21 @@ import { View, ScrollView, StyleSheet } from 'react-native';
|
|
|
3
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
4
|
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
5
5
|
import type { Creation } from '../../domain/entities/Creation';
|
|
6
|
+
import type { CreationsConfig } from '../../domain/value-objects/CreationsConfig';
|
|
6
7
|
import { hasVideoContent, getPreviewUrl } from '../../domain/utils';
|
|
7
8
|
import { DetailHeader } from '../components/CreationDetail/DetailHeader';
|
|
8
9
|
import { DetailImage } from '../components/CreationDetail/DetailImage';
|
|
9
10
|
import { DetailVideo } from '../components/CreationDetail/DetailVideo';
|
|
10
11
|
import { DetailStory } from '../components/CreationDetail/DetailStory';
|
|
11
12
|
import { DetailActions } from '../components/CreationDetail/DetailActions';
|
|
12
|
-
|
|
13
|
-
import { useCreationsProvider } from '../components/CreationsProvider';
|
|
13
|
+
import { getLocalizedTitle } from '../utils/filterUtils';
|
|
14
14
|
|
|
15
15
|
/** Video creation types */
|
|
16
16
|
const VIDEO_TYPES = ['text-to-video', 'image-to-video'] as const;
|
|
17
17
|
|
|
18
18
|
interface CreationDetailScreenProps {
|
|
19
19
|
readonly creation: Creation;
|
|
20
|
+
readonly config: CreationsConfig;
|
|
20
21
|
readonly onClose: () => void;
|
|
21
22
|
readonly onShare: (creation: Creation) => void;
|
|
22
23
|
readonly onDelete: (creation: Creation) => void;
|
|
@@ -32,6 +33,7 @@ interface CreationMetadata {
|
|
|
32
33
|
|
|
33
34
|
export const CreationDetailScreen: React.FC<CreationDetailScreenProps> = ({
|
|
34
35
|
creation,
|
|
36
|
+
config,
|
|
35
37
|
onClose,
|
|
36
38
|
onShare,
|
|
37
39
|
onDelete,
|
|
@@ -39,7 +41,6 @@ export const CreationDetailScreen: React.FC<CreationDetailScreenProps> = ({
|
|
|
39
41
|
}) => {
|
|
40
42
|
const tokens = useAppDesignTokens();
|
|
41
43
|
const insets = useSafeAreaInsets();
|
|
42
|
-
const { getLocalizedTitle } = useCreationsProvider();
|
|
43
44
|
|
|
44
45
|
// Extract data safely
|
|
45
46
|
const metadata = (creation.metadata || {}) as CreationMetadata;
|
|
@@ -48,7 +49,7 @@ export const CreationDetailScreen: React.FC<CreationDetailScreenProps> = ({
|
|
|
48
49
|
// 1. Manually set names in metadata
|
|
49
50
|
// 2. Localized title from config types mapping
|
|
50
51
|
// 3. Fallback to raw creation type (formatted)
|
|
51
|
-
const title = metadata.names || getLocalizedTitle(creation.type);
|
|
52
|
+
const title = metadata.names || getLocalizedTitle(config, t, creation.type);
|
|
52
53
|
const story = metadata.story || metadata.description || "";
|
|
53
54
|
const date = metadata.date || new Date(creation.createdAt).toLocaleDateString();
|
|
54
55
|
|
|
@@ -19,7 +19,6 @@ import type { Creation } from "../../domain/entities/Creation";
|
|
|
19
19
|
import type { CreationsConfig } from "../../domain/value-objects/CreationsConfig";
|
|
20
20
|
import type { ICreationsRepository } from "../../domain/repositories/ICreationsRepository";
|
|
21
21
|
import { CreationDetailScreen } from "./CreationDetailScreen";
|
|
22
|
-
import { CreationsProvider } from "../components/CreationsProvider";
|
|
23
22
|
|
|
24
23
|
interface CreationsGalleryScreenProps {
|
|
25
24
|
readonly userId: string | null;
|
|
@@ -34,15 +33,7 @@ interface CreationsGalleryScreenProps {
|
|
|
34
33
|
readonly showFilter?: boolean;
|
|
35
34
|
}
|
|
36
35
|
|
|
37
|
-
export function CreationsGalleryScreen(
|
|
38
|
-
return (
|
|
39
|
-
<CreationsProvider config={props.config} t={props.t}>
|
|
40
|
-
<CreationsGalleryScreenContent {...props} />
|
|
41
|
-
</CreationsProvider>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function CreationsGalleryScreenContent({
|
|
36
|
+
export function CreationsGalleryScreen({
|
|
46
37
|
userId,
|
|
47
38
|
repository,
|
|
48
39
|
config,
|
|
@@ -164,7 +155,7 @@ function CreationsGalleryScreenContent({
|
|
|
164
155
|
), [isLoading, creations, filters.isFiltered, tokens, t, config, emptyActionLabel, onEmptyAction, filters.clearAllFilters]);
|
|
165
156
|
|
|
166
157
|
if (selectedCreation) {
|
|
167
|
-
return <CreationDetailScreen creation={selectedCreation} onClose={() => setSelectedCreation(null)} onShare={handleShare} onDelete={handleDelete} t={t} />;
|
|
158
|
+
return <CreationDetailScreen creation={selectedCreation} config={config} onClose={() => setSelectedCreation(null)} onShare={handleShare} onDelete={handleDelete} t={t} />;
|
|
168
159
|
}
|
|
169
160
|
|
|
170
161
|
return (
|
|
@@ -36,7 +36,7 @@ export const getFilterCategoriesFromConfig = (
|
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* Translates the creation types for display.
|
|
39
|
-
*
|
|
39
|
+
*
|
|
40
40
|
* @param config The creations configuration object
|
|
41
41
|
* @param t Translation function
|
|
42
42
|
* @returns Array of types with translated labels
|
|
@@ -50,3 +50,20 @@ export const getTranslatedTypes = (
|
|
|
50
50
|
labelKey: t(type.labelKey)
|
|
51
51
|
}));
|
|
52
52
|
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Gets the localized title for a creation type.
|
|
56
|
+
*
|
|
57
|
+
* @param config The creations configuration object
|
|
58
|
+
* @param t Translation function
|
|
59
|
+
* @param typeId The creation type ID
|
|
60
|
+
* @returns Localized title string
|
|
61
|
+
*/
|
|
62
|
+
export const getLocalizedTitle = (
|
|
63
|
+
config: CreationsConfig,
|
|
64
|
+
t: (key: string) => string,
|
|
65
|
+
typeId: string
|
|
66
|
+
): string => {
|
|
67
|
+
const typeConfig = config.types.find(type => type.id === typeId);
|
|
68
|
+
return typeConfig ? t(typeConfig.labelKey) : typeId;
|
|
69
|
+
};
|
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import * as React from "react";
|
|
9
|
-
import { View, StyleSheet
|
|
9
|
+
import { View, StyleSheet } from "react-native";
|
|
10
10
|
import {
|
|
11
11
|
AtomicText,
|
|
12
12
|
AtomicIcon,
|
|
13
|
+
AtomicSpinner,
|
|
13
14
|
useAppDesignTokens,
|
|
14
15
|
} from "@umituz/react-native-design-system";
|
|
15
16
|
import type { FaceValidationState } from "../../domain/entities/FaceDetection";
|
|
@@ -38,7 +39,7 @@ export const FaceValidationStatus: React.FC<FaceValidationStatusProps> = ({
|
|
|
38
39
|
<View
|
|
39
40
|
style={[styles.container, { backgroundColor: tokens.colors.surface }]}
|
|
40
41
|
>
|
|
41
|
-
<
|
|
42
|
+
<AtomicSpinner size="sm" color="primary" />
|
|
42
43
|
<AtomicText
|
|
43
44
|
style={[styles.text, { color: tokens.colors.textSecondary }]}
|
|
44
45
|
>
|