@umituz/react-native-ai-generation-content 1.12.21 → 1.12.23
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 +33 -15
- package/src/domains/content-moderation/infrastructure/services/content-moderation.service.ts +4 -32
- package/src/domains/content-moderation/infrastructure/services/moderators/base.moderator.ts +1 -1
- package/src/domains/face-detection/infrastructure/validators/faceValidator.ts +1 -1
- package/src/domains/face-detection/presentation/components/FaceValidationStatus.tsx +3 -3
- package/src/domains/feature-background/presentation/components/BackgroundFeature.tsx +5 -4
- package/src/domains/feature-background/presentation/components/ComparisonSlider.tsx +45 -51
- package/src/domains/feature-background/presentation/components/ErrorDisplay.tsx +5 -3
- package/src/domains/feature-background/presentation/components/ModeSelector.tsx +2 -2
- package/src/domains/feature-background/presentation/hooks/useBackgroundFeature.ts +3 -2
- package/src/domains/prompts/domain/entities/FuturePredictionConfig.ts +2 -1
- package/src/domains/prompts/domain/entities/GeneratedPrompt.ts +0 -1
- package/src/domains/prompts/domain/repositories/IAIPromptServices.ts +6 -12
- package/src/domains/prompts/infrastructure/repositories/PromptHistoryRepository.ts +42 -42
- package/src/domains/prompts/infrastructure/repositories/TemplateRepository.ts +42 -42
- package/src/domains/prompts/infrastructure/services/BackgroundRemovalService.ts +7 -7
- package/src/domains/prompts/infrastructure/services/ColorizationService.ts +7 -7
- package/src/domains/prompts/infrastructure/services/FaceSwapService.ts +19 -20
- package/src/domains/prompts/infrastructure/services/FuturePredictionService.ts +11 -31
- package/src/domains/prompts/infrastructure/services/ImageEnhancementService.ts +7 -7
- package/src/domains/prompts/infrastructure/services/PhotoRestorationService.ts +7 -7
- package/src/domains/prompts/infrastructure/services/PromptGenerationService.ts +13 -13
- package/src/domains/prompts/infrastructure/services/StyleTransferService.ts +8 -8
- package/src/domains/prompts/infrastructure/services/TextGenerationService.ts +7 -7
- package/src/domains/prompts/presentation/hooks/useAIServices.ts +30 -28
- package/src/domains/prompts/presentation/hooks/useFaceSwap.ts +1 -2
- package/src/domains/prompts/presentation/hooks/usePromptGeneration.ts +4 -5
- package/src/domains/prompts/presentation/hooks/useStyleTransfer.ts +1 -1
- package/src/domains/prompts/presentation/hooks/useTemplateRepository.ts +3 -3
- package/src/domains/prompts/presentation/theme/utils.ts +1 -1
- package/src/index.ts +0 -5
- package/src/infrastructure/utils/status-checker.util.ts +4 -4
- package/src/infrastructure/wrappers/synchronous-generation.wrapper.ts +3 -3
- package/src/presentation/components/result/GenerationResultContent.tsx +21 -22
- package/src/presentation/components/result/ResultActions.tsx +51 -52
- package/src/presentation/components/result/ResultHeader.tsx +24 -25
- package/src/presentation/components/result/ResultImageCard.tsx +19 -20
- package/src/presentation/components/result/ResultStoryCard.tsx +23 -24
- package/src/presentation/hooks/photo-generation.types.ts +4 -4
- package/src/presentation/hooks/usePhotoGeneration.ts +18 -13
- package/src/domains/creations/application/services/CreationsService.ts +0 -72
- package/src/domains/creations/domain/entities/Creation.ts +0 -54
- package/src/domains/creations/domain/entities/index.ts +0 -6
- package/src/domains/creations/domain/repositories/ICreationsRepository.ts +0 -25
- package/src/domains/creations/domain/repositories/index.ts +0 -5
- package/src/domains/creations/domain/services/ICreationsStorageService.ts +0 -13
- package/src/domains/creations/domain/value-objects/CreationsConfig.ts +0 -77
- package/src/domains/creations/domain/value-objects/index.ts +0 -12
- package/src/domains/creations/index.ts +0 -84
- package/src/domains/creations/infrastructure/adapters/createRepository.ts +0 -54
- package/src/domains/creations/infrastructure/adapters/index.ts +0 -5
- package/src/domains/creations/infrastructure/repositories/CreationsRepository.ts +0 -263
- package/src/domains/creations/infrastructure/repositories/index.ts +0 -8
- package/src/domains/creations/infrastructure/services/CreationsStorageService.ts +0 -48
- package/src/domains/creations/presentation/components/CreationCard.tsx +0 -196
- package/src/domains/creations/presentation/components/CreationDetail/DetailActions.tsx +0 -76
- package/src/domains/creations/presentation/components/CreationDetail/DetailHeader.tsx +0 -81
- package/src/domains/creations/presentation/components/CreationDetail/DetailImage.tsx +0 -41
- package/src/domains/creations/presentation/components/CreationDetail/DetailStory.tsx +0 -67
- package/src/domains/creations/presentation/components/CreationDetail/index.ts +0 -4
- package/src/domains/creations/presentation/components/CreationImageViewer.tsx +0 -101
- package/src/domains/creations/presentation/components/CreationThumbnail.tsx +0 -63
- package/src/domains/creations/presentation/components/CreationsGalleryEmptyState.tsx +0 -77
- package/src/domains/creations/presentation/components/CreationsGrid.tsx +0 -87
- package/src/domains/creations/presentation/components/CreationsHomeCard.tsx +0 -176
- package/src/domains/creations/presentation/components/EmptyState.tsx +0 -75
- package/src/domains/creations/presentation/components/FilterBottomSheet.tsx +0 -157
- package/src/domains/creations/presentation/components/FilterChips.tsx +0 -105
- package/src/domains/creations/presentation/components/GalleryHeader.tsx +0 -157
- package/src/domains/creations/presentation/components/index.ts +0 -20
- package/src/domains/creations/presentation/hooks/index.ts +0 -9
- package/src/domains/creations/presentation/hooks/useCreations.ts +0 -33
- package/src/domains/creations/presentation/hooks/useCreationsFilter.ts +0 -90
- package/src/domains/creations/presentation/hooks/useDeleteCreation.ts +0 -51
- package/src/domains/creations/presentation/hooks/useDeleteMultipleCreations.ts +0 -57
- package/src/domains/creations/presentation/hooks/useToggleFavorite.ts +0 -59
- package/src/domains/creations/presentation/screens/CreationDetailScreen.tsx +0 -71
- package/src/domains/creations/presentation/screens/CreationsGalleryScreen.tsx +0 -264
- package/src/domains/creations/presentation/screens/index.ts +0 -5
- package/src/domains/creations/presentation/utils/filterUtils.ts +0 -52
- package/src/domains/creations/types.d.ts +0 -107
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-ai-generation-content",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.23",
|
|
4
4
|
"description": "Provider-agnostic AI generation orchestration for React Native",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@react-navigation/native": ">=6.0.0",
|
|
42
42
|
"@tanstack/react-query": ">=5.0.0",
|
|
43
|
-
"@umituz/react-native-animation": "
|
|
44
|
-
"@umituz/react-native-design-system": "
|
|
45
|
-
"@umituz/react-native-firebase": "
|
|
46
|
-
"@umituz/react-native-image": "
|
|
47
|
-
"@umituz/react-native-offline": "
|
|
48
|
-
"@umituz/react-native-uuid": "
|
|
43
|
+
"@umituz/react-native-animation": "*",
|
|
44
|
+
"@umituz/react-native-design-system": "*",
|
|
45
|
+
"@umituz/react-native-firebase": "*",
|
|
46
|
+
"@umituz/react-native-image": "*",
|
|
47
|
+
"@umituz/react-native-offline": "*",
|
|
48
|
+
"@umituz/react-native-uuid": "*",
|
|
49
49
|
"expo-linear-gradient": ">=15.0.0",
|
|
50
50
|
"firebase": ">=10.0.0",
|
|
51
51
|
"react": ">=18.0.0",
|
|
@@ -53,29 +53,47 @@
|
|
|
53
53
|
"react-native-safe-area-context": ">=4.0.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@
|
|
56
|
+
"@expo/vector-icons": "^15.0.3",
|
|
57
|
+
"@gorhom/bottom-sheet": "^5.2.8",
|
|
58
|
+
"@react-native-async-storage/async-storage": "^2.2.0",
|
|
59
|
+
"@react-native-community/datetimepicker": "^8.5.1",
|
|
60
|
+
"@react-navigation/bottom-tabs": "^7.9.0",
|
|
57
61
|
"@react-navigation/native": "^6.1.18",
|
|
62
|
+
"@react-navigation/stack": "^7.6.13",
|
|
58
63
|
"@tanstack/react-query": "^5.0.0",
|
|
59
64
|
"@types/react": "~19.1.10",
|
|
60
65
|
"@types/react-native": "^0.73.0",
|
|
61
66
|
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
62
67
|
"@typescript-eslint/parser": "^7.0.0",
|
|
63
|
-
"@umituz/react-native-animation": "
|
|
64
|
-
"@umituz/react-native-design-system": "
|
|
65
|
-
"@umituz/react-native-firebase": "
|
|
66
|
-
"@umituz/react-native-
|
|
67
|
-
"@umituz/react-native-
|
|
68
|
-
"@umituz/react-native-
|
|
68
|
+
"@umituz/react-native-animation": "*",
|
|
69
|
+
"@umituz/react-native-design-system": "^2.3.31",
|
|
70
|
+
"@umituz/react-native-firebase": "*",
|
|
71
|
+
"@umituz/react-native-haptics": "^1.0.2",
|
|
72
|
+
"@umituz/react-native-image": "*",
|
|
73
|
+
"@umituz/react-native-offline": "*",
|
|
74
|
+
"@umituz/react-native-uuid": "*",
|
|
69
75
|
"eslint": "^8.57.0",
|
|
76
|
+
"expo-application": "^7.0.8",
|
|
77
|
+
"expo-clipboard": "^8.0.8",
|
|
78
|
+
"expo-crypto": "^15.0.8",
|
|
79
|
+
"expo-device": "^8.0.10",
|
|
80
|
+
"expo-file-system": "^19.0.21",
|
|
81
|
+
"expo-haptics": "^15.0.8",
|
|
82
|
+
"expo-image": "^3.0.11",
|
|
70
83
|
"expo-linear-gradient": "~15.0.7",
|
|
84
|
+
"expo-localization": "^17.0.8",
|
|
85
|
+
"expo-sharing": "^14.0.8",
|
|
71
86
|
"firebase": "^11.1.0",
|
|
72
87
|
"react": "19.1.0",
|
|
73
88
|
"react-native": "0.81.5",
|
|
89
|
+
"react-native-gesture-handler": "^2.30.0",
|
|
90
|
+
"react-native-reanimated": "^4.2.1",
|
|
74
91
|
"react-native-safe-area-context": "^5.6.2",
|
|
92
|
+
"rn-emoji-keyboard": "^1.7.0",
|
|
75
93
|
"typescript": "^5.3.0",
|
|
76
94
|
"zustand": "^5.0.2"
|
|
77
95
|
},
|
|
78
96
|
"publishConfig": {
|
|
79
97
|
"access": "public"
|
|
80
98
|
}
|
|
81
|
-
}
|
|
99
|
+
}
|
package/src/domains/content-moderation/infrastructure/services/content-moderation.service.ts
CHANGED
|
@@ -18,7 +18,6 @@ import { videoModerator } from "./moderators/video.moderator";
|
|
|
18
18
|
import { voiceModerator } from "./moderators/voice.moderator";
|
|
19
19
|
import { rulesRegistry } from "../rules/rules-registry";
|
|
20
20
|
|
|
21
|
-
declare const __DEV__: boolean;
|
|
22
21
|
|
|
23
22
|
interface ServiceConfig {
|
|
24
23
|
suggestionMessages?: SuggestionMessages;
|
|
@@ -28,15 +27,6 @@ interface ServiceConfig {
|
|
|
28
27
|
|
|
29
28
|
class ContentModerationService {
|
|
30
29
|
configure(config: ServiceConfig): void {
|
|
31
|
-
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
32
|
-
// eslint-disable-next-line no-console
|
|
33
|
-
console.log("[ContentModeration] Configure:", {
|
|
34
|
-
hasSuggestionMessages: !!config.suggestionMessages,
|
|
35
|
-
hasValidationLimits: !!config.validationLimits,
|
|
36
|
-
customRulesCount: config.customRules?.length ?? 0,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
30
|
if (config.suggestionMessages) {
|
|
41
31
|
textModerator.setSuggestionMessages(config.suggestionMessages);
|
|
42
32
|
voiceModerator.setSuggestionMessages(config.suggestionMessages);
|
|
@@ -59,15 +49,7 @@ class ContentModerationService {
|
|
|
59
49
|
}
|
|
60
50
|
}
|
|
61
51
|
|
|
62
|
-
|
|
63
|
-
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
64
|
-
// eslint-disable-next-line no-console
|
|
65
|
-
console.log("[ContentModeration] Moderate started:", {
|
|
66
|
-
contentType: context.contentType,
|
|
67
|
-
contentLength: context.content?.length ?? 0,
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
|
|
52
|
+
moderate(context: ModerationContext): Promise<ModerationResult> {
|
|
71
53
|
const result = this.moderateByType(context.contentType, context.content);
|
|
72
54
|
const moderationResult: ModerationResult = {
|
|
73
55
|
isAllowed: result.isAllowed,
|
|
@@ -76,25 +58,15 @@ class ContentModerationService {
|
|
|
76
58
|
suggestedAction: this.determineAction(result.violations),
|
|
77
59
|
};
|
|
78
60
|
|
|
79
|
-
|
|
80
|
-
// eslint-disable-next-line no-console
|
|
81
|
-
console.log("[ContentModeration] Moderate completed:", {
|
|
82
|
-
contentType: context.contentType,
|
|
83
|
-
isAllowed: moderationResult.isAllowed,
|
|
84
|
-
violationsCount: moderationResult.violations?.length ?? 0,
|
|
85
|
-
suggestedAction: moderationResult.suggestedAction,
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return moderationResult;
|
|
61
|
+
return Promise.resolve(moderationResult);
|
|
90
62
|
}
|
|
91
63
|
|
|
92
|
-
|
|
64
|
+
isContentAllowed(
|
|
93
65
|
content: string,
|
|
94
66
|
contentType: ContentType
|
|
95
67
|
): Promise<boolean> {
|
|
96
68
|
const result = this.moderateByType(contentType, content);
|
|
97
|
-
return result.isAllowed;
|
|
69
|
+
return Promise.resolve(result.isAllowed);
|
|
98
70
|
}
|
|
99
71
|
|
|
100
72
|
moderateSync(
|
|
@@ -36,7 +36,7 @@ export abstract class BaseModerator {
|
|
|
36
36
|
|
|
37
37
|
protected getSuggestion(type: ViolationType): string {
|
|
38
38
|
if (this.customSuggestions?.[type]) {
|
|
39
|
-
return this.customSuggestions[type]
|
|
39
|
+
return this.customSuggestions[type];
|
|
40
40
|
}
|
|
41
41
|
return DEFAULT_SUGGESTIONS[type] || DEFAULT_SUGGESTIONS.default;
|
|
42
42
|
}
|
|
@@ -25,7 +25,7 @@ export const parseDetectionResponse = (
|
|
|
25
25
|
return createFailedResult("Invalid response format");
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
const parsed = JSON.parse(jsonMatch[0])
|
|
28
|
+
const parsed = JSON.parse(jsonMatch[0]) as Record<string, unknown>;
|
|
29
29
|
|
|
30
30
|
return {
|
|
31
31
|
hasFace: Boolean(parsed.hasFace),
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Translations provided by main app via props.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import React from "react";
|
|
8
|
+
import * as React from "react";
|
|
9
9
|
import { View, StyleSheet, ActivityIndicator } from "react-native";
|
|
10
10
|
import {
|
|
11
11
|
AtomicText,
|
|
@@ -59,7 +59,7 @@ export const FaceValidationStatus: React.FC<FaceValidationStatusProps> = ({
|
|
|
59
59
|
<AtomicIcon
|
|
60
60
|
name="alert-circle"
|
|
61
61
|
size="sm"
|
|
62
|
-
|
|
62
|
+
color="error"
|
|
63
63
|
/>
|
|
64
64
|
<AtomicText style={[styles.text, { color: tokens.colors.error }]}>
|
|
65
65
|
{labels.error}
|
|
@@ -88,7 +88,7 @@ export const FaceValidationStatus: React.FC<FaceValidationStatusProps> = ({
|
|
|
88
88
|
<AtomicIcon
|
|
89
89
|
name={valid ? "checkmark-circle" : "close-circle"}
|
|
90
90
|
size="sm"
|
|
91
|
-
|
|
91
|
+
color={valid ? "success" : "error"}
|
|
92
92
|
/>
|
|
93
93
|
<AtomicText
|
|
94
94
|
style={[
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* @description Main feature component composing all sub-components
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { useCallback, useState } from "react";
|
|
7
8
|
import { ScrollView, StyleSheet } from "react-native";
|
|
8
9
|
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
9
10
|
import type {
|
|
@@ -96,7 +97,7 @@ export const BackgroundFeature: React.FC<BackgroundFeatureProps> = ({
|
|
|
96
97
|
<ImagePicker
|
|
97
98
|
imageUri={feature.imageUri}
|
|
98
99
|
isProcessing={feature.isProcessing}
|
|
99
|
-
onSelectImage={feature.selectImage}
|
|
100
|
+
onSelectImage={() => { void feature.selectImage(); }}
|
|
100
101
|
placeholderText={placeholderText}
|
|
101
102
|
/>
|
|
102
103
|
|
|
@@ -115,7 +116,7 @@ export const BackgroundFeature: React.FC<BackgroundFeatureProps> = ({
|
|
|
115
116
|
<ResultDisplay
|
|
116
117
|
imageUrl={feature.processedUrl}
|
|
117
118
|
isProcessing={feature.isProcessing}
|
|
118
|
-
onSave={handleSave}
|
|
119
|
+
onSave={() => { void handleSave(); }}
|
|
119
120
|
onReset={handleReset}
|
|
120
121
|
saveButtonText={saveButtonText}
|
|
121
122
|
resetButtonText={resetButtonText}
|
|
@@ -124,7 +125,7 @@ export const BackgroundFeature: React.FC<BackgroundFeatureProps> = ({
|
|
|
124
125
|
<GenerateButton
|
|
125
126
|
isDisabled={isDisabled}
|
|
126
127
|
isProcessing={feature.isProcessing}
|
|
127
|
-
onPress={handleProcess}
|
|
128
|
+
onPress={() => { void handleProcess(); }}
|
|
128
129
|
buttonText={generateButtonText}
|
|
129
130
|
/>
|
|
130
131
|
</ScrollView>
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* @description Before/After comparison slider for images
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { memo, useState, useRef, useMemo } from "react";
|
|
7
8
|
import {
|
|
8
9
|
View,
|
|
9
10
|
StyleSheet,
|
|
@@ -42,9 +43,45 @@ export const ComparisonSlider: React.FC<ComparisonSliderProps> = memo(
|
|
|
42
43
|
})
|
|
43
44
|
).current;
|
|
44
45
|
|
|
46
|
+
const themedStyles = useMemo(() => StyleSheet.create({
|
|
47
|
+
container: {
|
|
48
|
+
width: "100%",
|
|
49
|
+
aspectRatio: 1,
|
|
50
|
+
borderRadius: 20,
|
|
51
|
+
overflow: "hidden",
|
|
52
|
+
},
|
|
53
|
+
originalContainer: {
|
|
54
|
+
position: "absolute",
|
|
55
|
+
top: 0,
|
|
56
|
+
left: 0,
|
|
57
|
+
bottom: 0,
|
|
58
|
+
overflow: "hidden",
|
|
59
|
+
borderRightWidth: 2,
|
|
60
|
+
borderRightColor: tokens.colors.surface,
|
|
61
|
+
},
|
|
62
|
+
sliderHandle: {
|
|
63
|
+
position: "absolute",
|
|
64
|
+
top: "50%",
|
|
65
|
+
left: -20,
|
|
66
|
+
width: 40,
|
|
67
|
+
height: 40,
|
|
68
|
+
borderRadius: 20,
|
|
69
|
+
justifyContent: "center",
|
|
70
|
+
alignItems: "center",
|
|
71
|
+
marginTop: -20,
|
|
72
|
+
backgroundColor: tokens.colors.backgroundPrimary,
|
|
73
|
+
},
|
|
74
|
+
labelLeft: {
|
|
75
|
+
backgroundColor: tokens.colors.surface,
|
|
76
|
+
},
|
|
77
|
+
labelRight: {
|
|
78
|
+
backgroundColor: tokens.colors.primary,
|
|
79
|
+
}
|
|
80
|
+
}), [tokens]);
|
|
81
|
+
|
|
45
82
|
return (
|
|
46
83
|
<View
|
|
47
|
-
style={
|
|
84
|
+
style={themedStyles.container}
|
|
48
85
|
onLayout={(e) => {
|
|
49
86
|
containerWidth.current = e.nativeEvent.layout.width;
|
|
50
87
|
}}
|
|
@@ -57,7 +94,7 @@ export const ComparisonSlider: React.FC<ComparisonSliderProps> = memo(
|
|
|
57
94
|
/>
|
|
58
95
|
|
|
59
96
|
<View
|
|
60
|
-
style={[
|
|
97
|
+
style={[themedStyles.originalContainer, { width: `${sliderPosition}%` }]}
|
|
61
98
|
>
|
|
62
99
|
<Image
|
|
63
100
|
source={{ uri: originalUri }}
|
|
@@ -70,12 +107,7 @@ export const ComparisonSlider: React.FC<ComparisonSliderProps> = memo(
|
|
|
70
107
|
style={[styles.sliderLine, { left: `${sliderPosition}%` }]}
|
|
71
108
|
{...panResponder.panHandlers}
|
|
72
109
|
>
|
|
73
|
-
<View
|
|
74
|
-
style={[
|
|
75
|
-
styles.sliderHandle,
|
|
76
|
-
{ backgroundColor: tokens.colors.backgroundPrimary },
|
|
77
|
-
]}
|
|
78
|
-
>
|
|
110
|
+
<View style={themedStyles.sliderHandle}>
|
|
79
111
|
<View style={styles.handleBars}>
|
|
80
112
|
<View
|
|
81
113
|
style={[
|
|
@@ -94,16 +126,10 @@ export const ComparisonSlider: React.FC<ComparisonSliderProps> = memo(
|
|
|
94
126
|
</View>
|
|
95
127
|
|
|
96
128
|
{beforeLabel && (
|
|
97
|
-
<View
|
|
98
|
-
style={[
|
|
99
|
-
styles.label,
|
|
100
|
-
styles.labelLeft,
|
|
101
|
-
{ backgroundColor: tokens.colors.surface },
|
|
102
|
-
]}
|
|
103
|
-
>
|
|
129
|
+
<View style={[styles.label, styles.labelLeft, themedStyles.labelLeft]}>
|
|
104
130
|
<AtomicText
|
|
105
131
|
type="bodySmall"
|
|
106
|
-
|
|
132
|
+
color="textPrimary"
|
|
107
133
|
>
|
|
108
134
|
{beforeLabel}
|
|
109
135
|
</AtomicText>
|
|
@@ -111,16 +137,10 @@ export const ComparisonSlider: React.FC<ComparisonSliderProps> = memo(
|
|
|
111
137
|
)}
|
|
112
138
|
|
|
113
139
|
{afterLabel && (
|
|
114
|
-
<View
|
|
115
|
-
style={[
|
|
116
|
-
styles.label,
|
|
117
|
-
styles.labelRight,
|
|
118
|
-
{ backgroundColor: tokens.colors.primary },
|
|
119
|
-
]}
|
|
120
|
-
>
|
|
140
|
+
<View style={[styles.label, styles.labelRight, themedStyles.labelRight]}>
|
|
121
141
|
<AtomicText
|
|
122
142
|
type="bodySmall"
|
|
123
|
-
|
|
143
|
+
color="backgroundPrimary"
|
|
124
144
|
>
|
|
125
145
|
{afterLabel}
|
|
126
146
|
</AtomicText>
|
|
@@ -133,12 +153,6 @@ export const ComparisonSlider: React.FC<ComparisonSliderProps> = memo(
|
|
|
133
153
|
);
|
|
134
154
|
|
|
135
155
|
const styles = StyleSheet.create({
|
|
136
|
-
container: {
|
|
137
|
-
width: "100%",
|
|
138
|
-
aspectRatio: 1,
|
|
139
|
-
borderRadius: 20,
|
|
140
|
-
overflow: "hidden",
|
|
141
|
-
},
|
|
142
156
|
imageContainer: {
|
|
143
157
|
flex: 1,
|
|
144
158
|
position: "relative",
|
|
@@ -147,15 +161,6 @@ const styles = StyleSheet.create({
|
|
|
147
161
|
width: "100%",
|
|
148
162
|
height: "100%",
|
|
149
163
|
},
|
|
150
|
-
originalContainer: {
|
|
151
|
-
position: "absolute",
|
|
152
|
-
top: 0,
|
|
153
|
-
left: 0,
|
|
154
|
-
bottom: 0,
|
|
155
|
-
overflow: "hidden",
|
|
156
|
-
borderRightWidth: 2,
|
|
157
|
-
borderRightColor: "#FFFFFF",
|
|
158
|
-
},
|
|
159
164
|
sliderLine: {
|
|
160
165
|
position: "absolute",
|
|
161
166
|
top: 0,
|
|
@@ -163,17 +168,6 @@ const styles = StyleSheet.create({
|
|
|
163
168
|
width: 2,
|
|
164
169
|
marginLeft: -1,
|
|
165
170
|
},
|
|
166
|
-
sliderHandle: {
|
|
167
|
-
position: "absolute",
|
|
168
|
-
top: "50%",
|
|
169
|
-
left: -20,
|
|
170
|
-
width: 40,
|
|
171
|
-
height: 40,
|
|
172
|
-
borderRadius: 20,
|
|
173
|
-
justifyContent: "center",
|
|
174
|
-
alignItems: "center",
|
|
175
|
-
marginTop: -20,
|
|
176
|
-
},
|
|
177
171
|
handleBars: {
|
|
178
172
|
flexDirection: "row",
|
|
179
173
|
gap: 4,
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* @description Displays error messages
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { memo } from "react";
|
|
7
8
|
import { View, StyleSheet } from "react-native";
|
|
8
9
|
import {
|
|
9
10
|
AtomicText,
|
|
@@ -29,12 +30,13 @@ export const ErrorDisplay: React.FC<ErrorDisplayProps> = memo(
|
|
|
29
30
|
>
|
|
30
31
|
<AtomicIcon
|
|
31
32
|
name="alert-circle"
|
|
32
|
-
size=
|
|
33
|
+
size="sm"
|
|
33
34
|
color="error"
|
|
34
35
|
/>
|
|
35
36
|
<AtomicText
|
|
36
37
|
type="bodyMedium"
|
|
37
|
-
|
|
38
|
+
color="error"
|
|
39
|
+
style={styles.errorText}
|
|
38
40
|
>
|
|
39
41
|
{error}
|
|
40
42
|
</AtomicText>
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* @description Horizontal scrollable mode selection toolbar
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { memo } from "react";
|
|
7
8
|
import { View, StyleSheet, ScrollView, TouchableOpacity } from "react-native";
|
|
8
9
|
import {
|
|
9
|
-
AtomicText,
|
|
10
10
|
AtomicIcon,
|
|
11
11
|
useAppDesignTokens,
|
|
12
12
|
} from "@umituz/react-native-design-system";
|
|
@@ -85,10 +85,11 @@ export function useBackgroundFeature(
|
|
|
85
85
|
[imageUri, prompt, mode, config]
|
|
86
86
|
);
|
|
87
87
|
|
|
88
|
-
const save = useCallback(
|
|
88
|
+
const save = useCallback((): Promise<void> => {
|
|
89
89
|
if (!processedUrl) {
|
|
90
|
-
return;
|
|
90
|
+
return Promise.resolve();
|
|
91
91
|
}
|
|
92
|
+
return Promise.resolve();
|
|
92
93
|
}, [processedUrl]);
|
|
93
94
|
|
|
94
95
|
const reset = useCallback((): void => {
|
|
@@ -10,7 +10,8 @@ export interface FuturePredictionSettings {
|
|
|
10
10
|
readonly outputType: FuturePredictionOutputType;
|
|
11
11
|
readonly personCount: 1 | 2;
|
|
12
12
|
readonly includeDate: boolean;
|
|
13
|
-
readonly language: string;
|
|
13
|
+
readonly language: string; // Language code (e.g. 'en', 'tr')
|
|
14
|
+
readonly languageName?: string; // Full language name provided by app (e.g. 'Turkish', 'English')
|
|
14
15
|
readonly tone?: string; // e.g. 'romantic', 'professional', 'funny', 'dramatic'
|
|
15
16
|
readonly subjectRole?: string; // e.g. 'couple', 'best friends', 'business partners', 'parents'
|
|
16
17
|
readonly year?: number; // Optional specific year for prediction
|
|
@@ -1,30 +1,24 @@
|
|
|
1
1
|
import type { AIPromptTemplate } from '../entities/AIPromptTemplate';
|
|
2
2
|
import type { AIPromptResult } from '../entities/types';
|
|
3
|
-
import type { FaceSwapConfig
|
|
3
|
+
import type { FaceSwapConfig } from '../entities/FaceSwapConfig';
|
|
4
4
|
import type {
|
|
5
|
-
PhotoRestorationConfig
|
|
6
|
-
PhotoRestorationResult
|
|
5
|
+
PhotoRestorationConfig
|
|
7
6
|
} from '../entities/PhotoRestorationConfig';
|
|
8
7
|
import type {
|
|
9
8
|
ImageEnhancementConfig,
|
|
10
|
-
ImageEnhancementResult,
|
|
11
9
|
EnhancementAdjustments
|
|
12
10
|
} from '../entities/ImageEnhancementConfig';
|
|
13
11
|
import type {
|
|
14
|
-
StyleTransferConfig
|
|
15
|
-
StyleTransferResult
|
|
12
|
+
StyleTransferConfig
|
|
16
13
|
} from '../entities/StyleTransferConfig';
|
|
17
14
|
import type {
|
|
18
|
-
BackgroundRemovalConfig
|
|
19
|
-
BackgroundRemovalResult
|
|
15
|
+
BackgroundRemovalConfig
|
|
20
16
|
} from '../entities/BackgroundRemovalConfig';
|
|
21
17
|
import type {
|
|
22
|
-
TextGenerationConfig
|
|
23
|
-
TextGenerationResult
|
|
18
|
+
TextGenerationConfig
|
|
24
19
|
} from '../entities/TextGenerationConfig';
|
|
25
20
|
import type {
|
|
26
|
-
ColorizationConfig
|
|
27
|
-
ColorizationResult
|
|
21
|
+
ColorizationConfig
|
|
28
22
|
} from '../entities/ColorizationConfig';
|
|
29
23
|
import type {
|
|
30
24
|
FuturePredictionConfig,
|
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
import type { IPromptHistoryRepository } from '../../domain/repositories/IPromptHistoryRepository';
|
|
2
2
|
import type { GeneratedPrompt } from '../../domain/entities/GeneratedPrompt';
|
|
3
|
-
import type { AIPromptResult
|
|
3
|
+
import type { AIPromptResult } from '../../domain/entities/types';
|
|
4
4
|
|
|
5
5
|
export class PromptHistoryRepository implements IPromptHistoryRepository {
|
|
6
6
|
private storage: GeneratedPrompt[] = [];
|
|
7
7
|
private readonly maxStorageSize = 100;
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
save(prompt: GeneratedPrompt): Promise<AIPromptResult<void>> {
|
|
10
10
|
try {
|
|
11
11
|
this.storage.push(prompt);
|
|
12
12
|
this.trimStorage();
|
|
13
|
-
return { success: true, data: undefined };
|
|
14
|
-
} catch
|
|
15
|
-
return {
|
|
16
|
-
success: false,
|
|
17
|
-
error: 'STORAGE_ERROR',
|
|
18
|
-
message: 'Failed to save prompt to history'
|
|
19
|
-
};
|
|
13
|
+
return Promise.resolve({ success: true, data: undefined });
|
|
14
|
+
} catch {
|
|
15
|
+
return Promise.resolve({
|
|
16
|
+
success: false,
|
|
17
|
+
error: 'STORAGE_ERROR',
|
|
18
|
+
message: 'Failed to save prompt to history'
|
|
19
|
+
});
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
findRecent(limit: number = 50): Promise<AIPromptResult<GeneratedPrompt[]>> {
|
|
24
24
|
try {
|
|
25
25
|
const prompts = this.storage.slice(-limit);
|
|
26
|
-
return { success: true, data: prompts };
|
|
27
|
-
} catch
|
|
28
|
-
return {
|
|
29
|
-
success: false,
|
|
30
|
-
error: 'STORAGE_ERROR',
|
|
31
|
-
message: 'Failed to retrieve recent prompts'
|
|
32
|
-
};
|
|
26
|
+
return Promise.resolve({ success: true, data: prompts });
|
|
27
|
+
} catch {
|
|
28
|
+
return Promise.resolve({
|
|
29
|
+
success: false,
|
|
30
|
+
error: 'STORAGE_ERROR',
|
|
31
|
+
message: 'Failed to retrieve recent prompts'
|
|
32
|
+
});
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
templateId: string,
|
|
36
|
+
findByTemplateId(
|
|
37
|
+
templateId: string,
|
|
38
38
|
limit: number = 20
|
|
39
39
|
): Promise<AIPromptResult<GeneratedPrompt[]>> {
|
|
40
40
|
try {
|
|
41
41
|
const prompts = this.storage
|
|
42
42
|
.filter(prompt => prompt.templateId === templateId)
|
|
43
43
|
.slice(-limit);
|
|
44
|
-
return { success: true, data: prompts };
|
|
45
|
-
} catch
|
|
46
|
-
return {
|
|
47
|
-
success: false,
|
|
48
|
-
error: 'STORAGE_ERROR',
|
|
49
|
-
message: 'Failed to retrieve prompts by template ID'
|
|
50
|
-
};
|
|
44
|
+
return Promise.resolve({ success: true, data: prompts });
|
|
45
|
+
} catch {
|
|
46
|
+
return Promise.resolve({
|
|
47
|
+
success: false,
|
|
48
|
+
error: 'STORAGE_ERROR',
|
|
49
|
+
message: 'Failed to retrieve prompts by template ID'
|
|
50
|
+
});
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
delete(id: string): Promise<AIPromptResult<void>> {
|
|
55
55
|
try {
|
|
56
56
|
this.storage = this.storage.filter(prompt => prompt.id !== id);
|
|
57
|
-
return { success: true, data: undefined };
|
|
58
|
-
} catch
|
|
59
|
-
return {
|
|
60
|
-
success: false,
|
|
61
|
-
error: 'STORAGE_ERROR',
|
|
62
|
-
message: 'Failed to delete prompt'
|
|
63
|
-
};
|
|
57
|
+
return Promise.resolve({ success: true, data: undefined });
|
|
58
|
+
} catch {
|
|
59
|
+
return Promise.resolve({
|
|
60
|
+
success: false,
|
|
61
|
+
error: 'STORAGE_ERROR',
|
|
62
|
+
message: 'Failed to delete prompt'
|
|
63
|
+
});
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
clear(): Promise<AIPromptResult<void>> {
|
|
68
68
|
try {
|
|
69
69
|
this.storage = [];
|
|
70
|
-
return { success: true, data: undefined };
|
|
71
|
-
} catch
|
|
72
|
-
return {
|
|
73
|
-
success: false,
|
|
74
|
-
error: 'STORAGE_ERROR',
|
|
75
|
-
message: 'Failed to clear prompt history'
|
|
76
|
-
};
|
|
70
|
+
return Promise.resolve({ success: true, data: undefined });
|
|
71
|
+
} catch {
|
|
72
|
+
return Promise.resolve({
|
|
73
|
+
success: false,
|
|
74
|
+
error: 'STORAGE_ERROR',
|
|
75
|
+
message: 'Failed to clear prompt history'
|
|
76
|
+
});
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|