@umituz/react-native-ai-generation-content 1.42.0 → 1.44.0
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/domain/interfaces/ai-provider.interface.ts +19 -37
- package/src/domain/interfaces/index.ts +8 -0
- package/src/domain/interfaces/provider-capabilities.interface.ts +22 -0
- package/src/domain/interfaces/provider-executor.interface.ts +28 -0
- package/src/domain/interfaces/provider-image-features.interface.ts +24 -0
- package/src/domain/interfaces/provider-job-manager.interface.ts +26 -0
- package/src/domain/interfaces/provider-lifecycle.interface.ts +23 -0
- package/src/domain/interfaces/provider-video-features.interface.ts +24 -0
- package/src/domains/prompts/domain/repositories/IAIPromptServices.ts +10 -10
- package/src/domains/prompts/domain/repositories/IPromptHistoryRepository.ts +2 -2
- package/src/domains/prompts/domain/repositories/ITemplateRepository.ts +2 -2
- package/src/domains/prompts/index.ts +4 -1
- package/src/domains/prompts/infrastructure/repositories/PromptHistoryRepository.ts +3 -3
- package/src/domains/prompts/infrastructure/repositories/TemplateRepository.ts +3 -3
- package/src/domains/prompts/infrastructure/services/AIServiceProcessor.ts +10 -10
- package/src/domains/prompts/infrastructure/services/BackgroundRemovalService.ts +4 -4
- package/src/domains/prompts/infrastructure/services/ColorizationService.ts +4 -4
- package/src/domains/prompts/infrastructure/services/FaceSwapService.ts +4 -4
- package/src/domains/prompts/infrastructure/services/FuturePredictionService.ts +6 -6
- package/src/domains/prompts/infrastructure/services/ImageEnhancementService.ts +4 -4
- package/src/domains/prompts/infrastructure/services/PhotoRestorationService.ts +4 -4
- package/src/domains/prompts/infrastructure/services/PromptGenerationService.ts +3 -3
- package/src/domains/prompts/infrastructure/services/StyleTransferService.ts +4 -4
- package/src/domains/prompts/infrastructure/services/TextGenerationService.ts +4 -4
- package/src/domains/prompts/infrastructure/services/base/prompt-service.base.ts +5 -5
- package/src/domains/prompts/presentation/hooks/useAIServices.ts +6 -6
- package/src/domains/prompts/presentation/hooks/useFaceSwap.ts +4 -4
- package/src/domains/prompts/presentation/hooks/useImageEnhancement.ts +5 -5
- package/src/domains/prompts/presentation/hooks/usePhotoRestoration.ts +5 -5
- package/src/domains/prompts/presentation/hooks/usePromptGeneration.ts +5 -5
- package/src/domains/prompts/presentation/hooks/useStyleTransfer.ts +6 -6
- package/src/domains/prompts/presentation/hooks/useTemplateRepository.ts +3 -3
- package/src/domains/scenarios/README.md +179 -0
- package/src/presentation/components/shared/ModelOptionItem.tsx +123 -0
- package/src/presentation/components/shared/ModelSelector.tsx +20 -204
- package/src/presentation/components/shared/ModelSelectorModal.tsx +127 -0
- package/src/presentation/components/shared/ModelSelectorTrigger.tsx +55 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModelSelectorModal Component
|
|
3
|
+
* Single Responsibility: Render the modal with model list
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from "react";
|
|
7
|
+
import {
|
|
8
|
+
Modal,
|
|
9
|
+
Pressable,
|
|
10
|
+
View,
|
|
11
|
+
ScrollView,
|
|
12
|
+
TouchableOpacity,
|
|
13
|
+
StyleSheet,
|
|
14
|
+
} from "react-native";
|
|
15
|
+
import {
|
|
16
|
+
useAppDesignTokens,
|
|
17
|
+
AtomicText,
|
|
18
|
+
AtomicIcon,
|
|
19
|
+
useSafeAreaInsets,
|
|
20
|
+
} from "@umituz/react-native-design-system";
|
|
21
|
+
import { ModelOptionItem } from "./ModelOptionItem";
|
|
22
|
+
import type { ModelOption } from "./ModelSelector";
|
|
23
|
+
|
|
24
|
+
interface ModelSelectorModalProps {
|
|
25
|
+
readonly isOpen: boolean;
|
|
26
|
+
readonly models: ModelOption[];
|
|
27
|
+
readonly selectedModel: ModelOption | null;
|
|
28
|
+
readonly onClose: () => void;
|
|
29
|
+
readonly onSelect: (modelId: string) => void;
|
|
30
|
+
readonly selectModelLabel: string;
|
|
31
|
+
readonly creditsLabel: string;
|
|
32
|
+
readonly closeLabel: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const ModelSelectorModal: React.FC<ModelSelectorModalProps> = ({
|
|
36
|
+
isOpen,
|
|
37
|
+
models,
|
|
38
|
+
selectedModel,
|
|
39
|
+
onClose,
|
|
40
|
+
onSelect,
|
|
41
|
+
selectModelLabel,
|
|
42
|
+
creditsLabel,
|
|
43
|
+
closeLabel,
|
|
44
|
+
}) => {
|
|
45
|
+
const tokens = useAppDesignTokens();
|
|
46
|
+
const insets = useSafeAreaInsets();
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<Modal
|
|
50
|
+
visible={isOpen}
|
|
51
|
+
transparent
|
|
52
|
+
animationType="none"
|
|
53
|
+
onRequestClose={onClose}
|
|
54
|
+
>
|
|
55
|
+
<Pressable
|
|
56
|
+
style={[
|
|
57
|
+
styles.overlay,
|
|
58
|
+
{ backgroundColor: tokens.colors.modalOverlay },
|
|
59
|
+
]}
|
|
60
|
+
onPress={onClose}
|
|
61
|
+
>
|
|
62
|
+
<View
|
|
63
|
+
style={[
|
|
64
|
+
styles.dropdown,
|
|
65
|
+
{
|
|
66
|
+
backgroundColor: tokens.colors.backgroundSecondary,
|
|
67
|
+
marginTop: insets.top + 50,
|
|
68
|
+
borderRadius: tokens.borders.radius.lg,
|
|
69
|
+
},
|
|
70
|
+
]}
|
|
71
|
+
>
|
|
72
|
+
<View
|
|
73
|
+
style={[
|
|
74
|
+
styles.header,
|
|
75
|
+
{ borderBottomColor: tokens.colors.borderLight },
|
|
76
|
+
]}
|
|
77
|
+
>
|
|
78
|
+
<AtomicText type="titleSmall" color="textPrimary">
|
|
79
|
+
{selectModelLabel}
|
|
80
|
+
</AtomicText>
|
|
81
|
+
<TouchableOpacity
|
|
82
|
+
onPress={onClose}
|
|
83
|
+
accessibilityLabel={closeLabel}
|
|
84
|
+
accessibilityRole="button"
|
|
85
|
+
>
|
|
86
|
+
<AtomicIcon name="close" size="sm" color="secondary" />
|
|
87
|
+
</TouchableOpacity>
|
|
88
|
+
</View>
|
|
89
|
+
|
|
90
|
+
<ScrollView style={styles.list}>
|
|
91
|
+
{models.map((model) => (
|
|
92
|
+
<ModelOptionItem
|
|
93
|
+
key={model.id}
|
|
94
|
+
model={model}
|
|
95
|
+
isSelected={selectedModel?.id === model.id}
|
|
96
|
+
onSelect={onSelect}
|
|
97
|
+
creditsLabel={creditsLabel}
|
|
98
|
+
/>
|
|
99
|
+
))}
|
|
100
|
+
</ScrollView>
|
|
101
|
+
</View>
|
|
102
|
+
</Pressable>
|
|
103
|
+
</Modal>
|
|
104
|
+
);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const styles = StyleSheet.create({
|
|
108
|
+
overlay: {
|
|
109
|
+
flex: 1,
|
|
110
|
+
},
|
|
111
|
+
dropdown: {
|
|
112
|
+
marginHorizontal: 16,
|
|
113
|
+
maxHeight: 400,
|
|
114
|
+
overflow: "hidden",
|
|
115
|
+
},
|
|
116
|
+
header: {
|
|
117
|
+
flexDirection: "row",
|
|
118
|
+
justifyContent: "space-between",
|
|
119
|
+
alignItems: "center",
|
|
120
|
+
paddingHorizontal: 16,
|
|
121
|
+
paddingVertical: 12,
|
|
122
|
+
borderBottomWidth: 1,
|
|
123
|
+
},
|
|
124
|
+
list: {
|
|
125
|
+
maxHeight: 350,
|
|
126
|
+
},
|
|
127
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModelSelectorTrigger Component
|
|
3
|
+
* Single Responsibility: Render the trigger button for model selection
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { TouchableOpacity, StyleSheet } from "react-native";
|
|
8
|
+
import {
|
|
9
|
+
useAppDesignTokens,
|
|
10
|
+
AtomicText,
|
|
11
|
+
AtomicIcon,
|
|
12
|
+
} from "@umituz/react-native-design-system";
|
|
13
|
+
|
|
14
|
+
interface ModelSelectorTriggerProps {
|
|
15
|
+
readonly displayName: string;
|
|
16
|
+
readonly isLoading: boolean;
|
|
17
|
+
readonly onPress: () => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const ModelSelectorTrigger: React.FC<ModelSelectorTriggerProps> = ({
|
|
21
|
+
displayName,
|
|
22
|
+
isLoading,
|
|
23
|
+
onPress,
|
|
24
|
+
}) => {
|
|
25
|
+
const tokens = useAppDesignTokens();
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<TouchableOpacity
|
|
29
|
+
style={[
|
|
30
|
+
styles.trigger,
|
|
31
|
+
{
|
|
32
|
+
backgroundColor: tokens.colors.surface,
|
|
33
|
+
borderRadius: tokens.borders.radius.md,
|
|
34
|
+
},
|
|
35
|
+
]}
|
|
36
|
+
onPress={onPress}
|
|
37
|
+
disabled={isLoading}
|
|
38
|
+
>
|
|
39
|
+
<AtomicText type="labelMedium" color="textPrimary">
|
|
40
|
+
{displayName}
|
|
41
|
+
</AtomicText>
|
|
42
|
+
<AtomicIcon name="chevron-down" size="xs" color="secondary" />
|
|
43
|
+
</TouchableOpacity>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const styles = StyleSheet.create({
|
|
48
|
+
trigger: {
|
|
49
|
+
flexDirection: "row",
|
|
50
|
+
alignItems: "center",
|
|
51
|
+
paddingHorizontal: 12,
|
|
52
|
+
paddingVertical: 8,
|
|
53
|
+
gap: 4,
|
|
54
|
+
},
|
|
55
|
+
});
|