@umituz/react-native-ai-generation-content 1.20.12 → 1.20.13
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/ai-hug/presentation/components/AIHugFeature.tsx +2 -14
- package/src/features/ai-kiss/presentation/components/AIKissFeature.tsx +2 -17
- package/src/features/anime-selfie/presentation/components/AnimeSelfieFeature.tsx +2 -19
- package/src/features/anime-selfie/presentation/hooks/useAnimeSelfieFeature.ts +1 -1
- package/src/features/face-swap/presentation/components/FaceSwapFeature.tsx +2 -18
- package/src/features/hd-touch-up/presentation/components/HDTouchUpFeature.tsx +2 -18
- package/src/features/image-to-image/presentation/hooks/useDualImageFeature.ts +1 -1
- package/src/features/image-to-image/presentation/hooks/useImageWithPromptFeature.ts +1 -1
- package/src/features/image-to-image/presentation/hooks/useSingleImageFeature.ts +2 -5
- package/src/features/photo-restoration/presentation/components/PhotoRestoreFeature.tsx +2 -18
- package/src/features/remove-background/presentation/components/RemoveBackgroundFeature.tsx +2 -14
- package/src/features/remove-object/presentation/components/RemoveObjectFeature.tsx +5 -26
- package/src/features/remove-object/presentation/hooks/useRemoveObjectFeature.ts +1 -1
- package/src/features/replace-background/presentation/components/ReplaceBackgroundFeature.tsx +2 -18
- package/src/features/shared/dual-image-video/presentation/hooks/useDualImageVideoFeature.ts +1 -1
- package/src/features/text-to-video/presentation/hooks/useTextToVideoFeature.ts +1 -1
- package/src/features/upscaling/presentation/components/UpscaleFeature.tsx +2 -18
- package/src/features/wizard/presentation/components/AIGenerationWizard.tsx +2 -6
- package/src/index.ts +10 -11
- package/src/presentation/components/AIGenerationForm.tsx +0 -16
- package/src/presentation/components/index.ts +0 -6
- package/src/presentation/layouts/DualImageFeatureLayout.tsx +65 -56
- package/src/presentation/layouts/DualImageVideoFeatureLayout.tsx +65 -56
- package/src/presentation/layouts/SingleImageFeatureLayout.tsx +63 -54
- package/src/presentation/layouts/SingleImageWithPromptFeatureLayout.tsx +65 -56
- package/src/presentation/layouts/index.ts +0 -7
- package/src/presentation/layouts/types/index.ts +1 -5
- package/src/presentation/layouts/types/layout-props.ts +13 -21
- package/src/presentation/layouts/types/result-props.ts +0 -8
- package/src/presentation/components/GenerationProgressModal.tsx +0 -134
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-ai-generation-content",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.13",
|
|
4
4
|
"description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AIHugFeature Component
|
|
3
|
-
* Self-contained AI hug video feature UI component
|
|
4
|
-
* Uses centralized DualImageVideoFeatureLayout for consistent UX
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
1
|
import React, { useMemo } from "react";
|
|
8
2
|
import { View, StyleSheet } from "react-native";
|
|
9
3
|
import { DualImagePicker } from "../../../../presentation/components/image-picker/DualImagePicker";
|
|
10
4
|
import { DualImageVideoFeatureLayout } from "../../../../presentation/layouts";
|
|
11
|
-
import type {
|
|
5
|
+
import type { DualImageInputRenderProps } from "../../../../presentation/layouts";
|
|
12
6
|
import { useAIHugFeature } from "../hooks";
|
|
13
|
-
import type {
|
|
14
|
-
AIHugTranslations,
|
|
15
|
-
AIHugFeatureConfig,
|
|
16
|
-
} from "../../domain/types";
|
|
7
|
+
import type { AIHugTranslations, AIHugFeatureConfig } from "../../domain/types";
|
|
17
8
|
|
|
18
9
|
export interface AIHugFeatureProps {
|
|
19
10
|
config: AIHugFeatureConfig;
|
|
@@ -27,7 +18,6 @@ export interface AIHugFeatureProps {
|
|
|
27
18
|
onSelectTargetImage: () => Promise<string | null>;
|
|
28
19
|
onSaveVideo: (videoUrl: string) => Promise<void>;
|
|
29
20
|
onBeforeProcess?: () => Promise<boolean>;
|
|
30
|
-
renderProcessingModal?: (props: ProcessingModalRenderProps) => React.ReactNode;
|
|
31
21
|
}
|
|
32
22
|
|
|
33
23
|
export const AIHugFeature: React.FC<AIHugFeatureProps> = ({
|
|
@@ -37,7 +27,6 @@ export const AIHugFeature: React.FC<AIHugFeatureProps> = ({
|
|
|
37
27
|
onSelectTargetImage,
|
|
38
28
|
onSaveVideo,
|
|
39
29
|
onBeforeProcess,
|
|
40
|
-
renderProcessingModal,
|
|
41
30
|
}) => {
|
|
42
31
|
const feature = useAIHugFeature({
|
|
43
32
|
config,
|
|
@@ -62,7 +51,6 @@ export const AIHugFeature: React.FC<AIHugFeatureProps> = ({
|
|
|
62
51
|
feature={feature}
|
|
63
52
|
translations={translations}
|
|
64
53
|
modalTranslations={modalTranslations}
|
|
65
|
-
renderProcessingModal={renderProcessingModal}
|
|
66
54
|
renderInput={({ sourceImageUri, targetImageUri, onSelectSource, onSelectTarget, isDisabled }: DualImageInputRenderProps) => (
|
|
67
55
|
<View style={styles.pickerContainer}>
|
|
68
56
|
<DualImagePicker
|
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AIKissFeature Component
|
|
3
|
-
* Self-contained AI kiss video feature UI component
|
|
4
|
-
* Uses centralized DualImageVideoFeatureLayout for consistent UX
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
1
|
import React, { useMemo } from "react";
|
|
8
2
|
import { View, StyleSheet } from "react-native";
|
|
9
3
|
import { DualImagePicker } from "../../../../presentation/components/image-picker/DualImagePicker";
|
|
10
4
|
import { DualImageVideoFeatureLayout } from "../../../../presentation/layouts";
|
|
11
|
-
import type {
|
|
12
|
-
ProcessingModalRenderProps,
|
|
13
|
-
DualImageInputRenderProps,
|
|
14
|
-
} from "../../../../presentation/layouts";
|
|
5
|
+
import type { DualImageInputRenderProps } from "../../../../presentation/layouts";
|
|
15
6
|
import { useAIKissFeature } from "../hooks";
|
|
16
|
-
import type {
|
|
17
|
-
AIKissTranslations,
|
|
18
|
-
AIKissFeatureConfig,
|
|
19
|
-
} from "../../domain/types";
|
|
7
|
+
import type { AIKissTranslations, AIKissFeatureConfig } from "../../domain/types";
|
|
20
8
|
|
|
21
9
|
export interface AIKissFeatureProps {
|
|
22
10
|
config: AIKissFeatureConfig;
|
|
@@ -30,7 +18,6 @@ export interface AIKissFeatureProps {
|
|
|
30
18
|
onSelectTargetImage: () => Promise<string | null>;
|
|
31
19
|
onSaveVideo: (videoUrl: string) => Promise<void>;
|
|
32
20
|
onBeforeProcess?: () => Promise<boolean>;
|
|
33
|
-
renderProcessingModal?: (props: ProcessingModalRenderProps) => React.ReactNode;
|
|
34
21
|
}
|
|
35
22
|
|
|
36
23
|
export const AIKissFeature: React.FC<AIKissFeatureProps> = ({
|
|
@@ -40,7 +27,6 @@ export const AIKissFeature: React.FC<AIKissFeatureProps> = ({
|
|
|
40
27
|
onSelectTargetImage,
|
|
41
28
|
onSaveVideo,
|
|
42
29
|
onBeforeProcess,
|
|
43
|
-
renderProcessingModal,
|
|
44
30
|
}) => {
|
|
45
31
|
const feature = useAIKissFeature({
|
|
46
32
|
config,
|
|
@@ -65,7 +51,6 @@ export const AIKissFeature: React.FC<AIKissFeatureProps> = ({
|
|
|
65
51
|
feature={feature}
|
|
66
52
|
translations={translations}
|
|
67
53
|
modalTranslations={modalTranslations}
|
|
68
|
-
renderProcessingModal={renderProcessingModal}
|
|
69
54
|
renderInput={({ sourceImageUri, targetImageUri, onSelectSource, onSelectTarget, isDisabled }: DualImageInputRenderProps) => (
|
|
70
55
|
<View style={styles.pickerContainer}>
|
|
71
56
|
<DualImagePicker
|
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AnimeSelfieFeature Component
|
|
3
|
-
* Self-contained anime selfie feature UI component
|
|
4
|
-
* Uses centralized SingleImageFeatureLayout for consistent UX
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
1
|
import React, { useMemo } from "react";
|
|
8
2
|
import { Image, StyleSheet } from "react-native";
|
|
9
3
|
import { PhotoUploadCard } from "../../../../presentation/components/PhotoUploadCard";
|
|
10
4
|
import { SingleImageFeatureLayout } from "../../../../presentation/layouts";
|
|
11
|
-
import type {
|
|
12
|
-
ProcessingModalRenderProps,
|
|
13
|
-
SingleImageInputRenderProps,
|
|
14
|
-
ResultRenderProps,
|
|
15
|
-
} from "../../../../presentation/layouts";
|
|
5
|
+
import type { SingleImageInputRenderProps, ResultRenderProps } from "../../../../presentation/layouts";
|
|
16
6
|
import { useAnimeSelfieFeature } from "../hooks";
|
|
17
|
-
import type {
|
|
18
|
-
AnimeSelfieTranslations,
|
|
19
|
-
AnimeSelfieFeatureConfig,
|
|
20
|
-
} from "../../domain/types";
|
|
7
|
+
import type { AnimeSelfieTranslations, AnimeSelfieFeatureConfig } from "../../domain/types";
|
|
21
8
|
|
|
22
9
|
export interface AnimeSelfieFeatureProps {
|
|
23
10
|
config: AnimeSelfieFeatureConfig;
|
|
@@ -29,9 +16,7 @@ export interface AnimeSelfieFeatureProps {
|
|
|
29
16
|
};
|
|
30
17
|
onSelectImage: () => Promise<string | null>;
|
|
31
18
|
onSaveImage: (imageUrl: string) => Promise<void>;
|
|
32
|
-
/** Called before processing starts. Return false to cancel. */
|
|
33
19
|
onBeforeProcess?: () => Promise<boolean>;
|
|
34
|
-
renderProcessingModal?: (props: ProcessingModalRenderProps) => React.ReactNode;
|
|
35
20
|
}
|
|
36
21
|
|
|
37
22
|
export const AnimeSelfieFeature: React.FC<AnimeSelfieFeatureProps> = ({
|
|
@@ -40,7 +25,6 @@ export const AnimeSelfieFeature: React.FC<AnimeSelfieFeatureProps> = ({
|
|
|
40
25
|
onSelectImage,
|
|
41
26
|
onSaveImage,
|
|
42
27
|
onBeforeProcess,
|
|
43
|
-
renderProcessingModal,
|
|
44
28
|
}) => {
|
|
45
29
|
const feature = useAnimeSelfieFeature({
|
|
46
30
|
config,
|
|
@@ -64,7 +48,6 @@ export const AnimeSelfieFeature: React.FC<AnimeSelfieFeatureProps> = ({
|
|
|
64
48
|
feature={feature}
|
|
65
49
|
translations={translations}
|
|
66
50
|
modalTranslations={modalTranslations}
|
|
67
|
-
renderProcessingModal={renderProcessingModal}
|
|
68
51
|
renderInput={({ imageUri, onSelect, isDisabled, isProcessing }: SingleImageInputRenderProps) => (
|
|
69
52
|
<PhotoUploadCard
|
|
70
53
|
imageUri={imageUri}
|
|
@@ -29,7 +29,7 @@ export interface UseAnimeSelfieFeatureOptions {
|
|
|
29
29
|
onCreditsExhausted?: () => void;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export
|
|
32
|
+
export type UseAnimeSelfieFeatureReturn = BaseSingleImageHookReturn;
|
|
33
33
|
|
|
34
34
|
export function useAnimeSelfieFeature(
|
|
35
35
|
props: UseAnimeSelfieFeatureProps,
|
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* FaceSwapFeature Component
|
|
3
|
-
* Self-contained face swap feature UI component
|
|
4
|
-
* Uses centralized DualImageFeatureLayout for consistent UX
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
1
|
import React, { useMemo } from "react";
|
|
8
2
|
import { View, Image, StyleSheet } from "react-native";
|
|
9
3
|
import { DualImagePicker } from "../../../../presentation/components/image-picker/DualImagePicker";
|
|
10
4
|
import { DualImageFeatureLayout } from "../../../../presentation/layouts";
|
|
11
|
-
import type {
|
|
12
|
-
ProcessingModalRenderProps,
|
|
13
|
-
DualImageInputRenderProps,
|
|
14
|
-
ResultRenderProps,
|
|
15
|
-
} from "../../../../presentation/layouts";
|
|
5
|
+
import type { DualImageInputRenderProps, ResultRenderProps } from "../../../../presentation/layouts";
|
|
16
6
|
import { useFaceSwapFeature } from "../hooks";
|
|
17
|
-
import type {
|
|
18
|
-
FaceSwapTranslations,
|
|
19
|
-
FaceSwapFeatureConfig,
|
|
20
|
-
} from "../../domain/types";
|
|
7
|
+
import type { FaceSwapTranslations, FaceSwapFeatureConfig } from "../../domain/types";
|
|
21
8
|
|
|
22
9
|
export interface FaceSwapFeatureProps {
|
|
23
10
|
config: FaceSwapFeatureConfig;
|
|
@@ -31,7 +18,6 @@ export interface FaceSwapFeatureProps {
|
|
|
31
18
|
onSelectTargetImage: () => Promise<string | null>;
|
|
32
19
|
onSaveImage: (imageUrl: string) => Promise<void>;
|
|
33
20
|
onBeforeProcess?: () => Promise<boolean>;
|
|
34
|
-
renderProcessingModal?: (props: ProcessingModalRenderProps) => React.ReactNode;
|
|
35
21
|
}
|
|
36
22
|
|
|
37
23
|
export const FaceSwapFeature: React.FC<FaceSwapFeatureProps> = ({
|
|
@@ -41,7 +27,6 @@ export const FaceSwapFeature: React.FC<FaceSwapFeatureProps> = ({
|
|
|
41
27
|
onSelectTargetImage,
|
|
42
28
|
onSaveImage,
|
|
43
29
|
onBeforeProcess,
|
|
44
|
-
renderProcessingModal,
|
|
45
30
|
}) => {
|
|
46
31
|
const feature = useFaceSwapFeature({
|
|
47
32
|
config,
|
|
@@ -66,7 +51,6 @@ export const FaceSwapFeature: React.FC<FaceSwapFeatureProps> = ({
|
|
|
66
51
|
feature={feature}
|
|
67
52
|
translations={translations}
|
|
68
53
|
modalTranslations={modalTranslations}
|
|
69
|
-
renderProcessingModal={renderProcessingModal}
|
|
70
54
|
renderInput={({ sourceImageUri, targetImageUri, onSelectSource, onSelectTarget, isDisabled }: DualImageInputRenderProps) => (
|
|
71
55
|
<View style={styles.pickerContainer}>
|
|
72
56
|
<DualImagePicker
|
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HDTouchUpFeature Component
|
|
3
|
-
* Self-contained HD touch up feature UI component
|
|
4
|
-
* Uses centralized SingleImageFeatureLayout for consistent UX
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
1
|
import React, { useMemo } from "react";
|
|
8
2
|
import { Image, StyleSheet } from "react-native";
|
|
9
3
|
import { PhotoUploadCard } from "../../../../presentation/components/PhotoUploadCard";
|
|
10
4
|
import { SingleImageFeatureLayout } from "../../../../presentation/layouts";
|
|
11
|
-
import type {
|
|
12
|
-
ProcessingModalRenderProps,
|
|
13
|
-
SingleImageInputRenderProps,
|
|
14
|
-
ResultRenderProps,
|
|
15
|
-
} from "../../../../presentation/layouts";
|
|
5
|
+
import type { SingleImageInputRenderProps, ResultRenderProps } from "../../../../presentation/layouts";
|
|
16
6
|
import { useHDTouchUpFeature } from "../hooks";
|
|
17
|
-
import type {
|
|
18
|
-
HDTouchUpTranslations,
|
|
19
|
-
HDTouchUpFeatureConfig,
|
|
20
|
-
} from "../../domain/types";
|
|
7
|
+
import type { HDTouchUpTranslations, HDTouchUpFeatureConfig } from "../../domain/types";
|
|
21
8
|
|
|
22
9
|
export interface HDTouchUpFeatureProps {
|
|
23
10
|
config: HDTouchUpFeatureConfig;
|
|
@@ -30,7 +17,6 @@ export interface HDTouchUpFeatureProps {
|
|
|
30
17
|
onSelectImage: () => Promise<string | null>;
|
|
31
18
|
onSaveImage: (imageUrl: string) => Promise<void>;
|
|
32
19
|
onBeforeProcess?: () => Promise<boolean>;
|
|
33
|
-
renderProcessingModal?: (props: ProcessingModalRenderProps) => React.ReactNode;
|
|
34
20
|
}
|
|
35
21
|
|
|
36
22
|
export const HDTouchUpFeature: React.FC<HDTouchUpFeatureProps> = ({
|
|
@@ -39,7 +25,6 @@ export const HDTouchUpFeature: React.FC<HDTouchUpFeatureProps> = ({
|
|
|
39
25
|
onSelectImage,
|
|
40
26
|
onSaveImage,
|
|
41
27
|
onBeforeProcess,
|
|
42
|
-
renderProcessingModal,
|
|
43
28
|
}) => {
|
|
44
29
|
const feature = useHDTouchUpFeature({
|
|
45
30
|
config,
|
|
@@ -63,7 +48,6 @@ export const HDTouchUpFeature: React.FC<HDTouchUpFeatureProps> = ({
|
|
|
63
48
|
feature={feature}
|
|
64
49
|
translations={translations}
|
|
65
50
|
modalTranslations={modalTranslations}
|
|
66
|
-
renderProcessingModal={renderProcessingModal}
|
|
67
51
|
renderInput={({ imageUri, onSelect, isDisabled, isProcessing }: SingleImageInputRenderProps) => (
|
|
68
52
|
<PhotoUploadCard
|
|
69
53
|
imageUri={imageUri}
|
|
@@ -163,7 +163,7 @@ export function useDualImageFeature<
|
|
|
163
163
|
: { sourceImageBase64: sourceBase64, targetImageBase64: targetBase64 };
|
|
164
164
|
|
|
165
165
|
await orchestrator.generate(input);
|
|
166
|
-
} catch
|
|
166
|
+
} catch {
|
|
167
167
|
// Error already handled by orchestrator
|
|
168
168
|
}
|
|
169
169
|
}, [sourceImageUri, targetImageUri, config, options, onBeforeProcess, orchestrator]);
|
|
@@ -182,7 +182,7 @@ export function useImageWithPromptFeature<
|
|
|
182
182
|
: { imageBase64, prompt };
|
|
183
183
|
|
|
184
184
|
await orchestrator.generate(input);
|
|
185
|
-
} catch
|
|
185
|
+
} catch {
|
|
186
186
|
// Error already handled by orchestrator
|
|
187
187
|
}
|
|
188
188
|
}, [imageUri, prompt, config, options, onBeforeProcess, orchestrator]);
|
|
@@ -42,10 +42,7 @@ interface SingleImageInput {
|
|
|
42
42
|
options?: Record<string, unknown>;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
export function useSingleImageFeature<
|
|
46
|
-
TConfig = SingleImageConfig,
|
|
47
|
-
TResult = BaseImageResult,
|
|
48
|
-
>(
|
|
45
|
+
export function useSingleImageFeature<TConfig = SingleImageConfig>(
|
|
49
46
|
props: BaseSingleImageHookProps<TConfig>,
|
|
50
47
|
options?: SingleImageFeatureOptions<TConfig>,
|
|
51
48
|
): BaseSingleImageHookReturn {
|
|
@@ -131,7 +128,7 @@ export function useSingleImageFeature<
|
|
|
131
128
|
: { imageBase64 };
|
|
132
129
|
|
|
133
130
|
await orchestrator.generate(input);
|
|
134
|
-
} catch
|
|
131
|
+
} catch {
|
|
135
132
|
// Error already handled by orchestrator
|
|
136
133
|
}
|
|
137
134
|
}, [imageUri, config, rawConfig, options, onBeforeProcess, orchestrator]);
|
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PhotoRestoreFeature Component
|
|
3
|
-
* Self-contained photo restore feature UI component
|
|
4
|
-
* Uses centralized SingleImageFeatureLayout for consistent UX
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
1
|
import React, { useMemo } from "react";
|
|
8
2
|
import { PhotoUploadCard } from "../../../../presentation/components/PhotoUploadCard";
|
|
9
3
|
import { SingleImageFeatureLayout } from "../../../../presentation/layouts";
|
|
10
|
-
import type {
|
|
11
|
-
ProcessingModalRenderProps,
|
|
12
|
-
SingleImageInputRenderProps,
|
|
13
|
-
CustomResultRenderProps,
|
|
14
|
-
} from "../../../../presentation/layouts";
|
|
4
|
+
import type { SingleImageInputRenderProps, CustomResultRenderProps } from "../../../../presentation/layouts";
|
|
15
5
|
import { PhotoRestoreResultView } from "./PhotoRestoreResultView";
|
|
16
6
|
import { usePhotoRestoreFeature } from "../hooks";
|
|
17
|
-
import type {
|
|
18
|
-
PhotoRestoreTranslations,
|
|
19
|
-
PhotoRestoreFeatureConfig,
|
|
20
|
-
} from "../../domain/types";
|
|
7
|
+
import type { PhotoRestoreTranslations, PhotoRestoreFeatureConfig } from "../../domain/types";
|
|
21
8
|
|
|
22
9
|
export interface PhotoRestoreFeatureProps {
|
|
23
10
|
config: PhotoRestoreFeatureConfig;
|
|
@@ -30,7 +17,6 @@ export interface PhotoRestoreFeatureProps {
|
|
|
30
17
|
onSelectImage: () => Promise<string | null>;
|
|
31
18
|
onSaveImage: (imageUrl: string) => Promise<void>;
|
|
32
19
|
onBeforeProcess?: () => Promise<boolean>;
|
|
33
|
-
renderProcessingModal?: (props: ProcessingModalRenderProps) => React.ReactNode;
|
|
34
20
|
}
|
|
35
21
|
|
|
36
22
|
export const PhotoRestoreFeature: React.FC<PhotoRestoreFeatureProps> = ({
|
|
@@ -39,7 +25,6 @@ export const PhotoRestoreFeature: React.FC<PhotoRestoreFeatureProps> = ({
|
|
|
39
25
|
onSelectImage,
|
|
40
26
|
onSaveImage,
|
|
41
27
|
onBeforeProcess,
|
|
42
|
-
renderProcessingModal,
|
|
43
28
|
}) => {
|
|
44
29
|
const feature = usePhotoRestoreFeature({
|
|
45
30
|
config,
|
|
@@ -63,7 +48,6 @@ export const PhotoRestoreFeature: React.FC<PhotoRestoreFeatureProps> = ({
|
|
|
63
48
|
feature={feature}
|
|
64
49
|
translations={translations}
|
|
65
50
|
modalTranslations={modalTranslations}
|
|
66
|
-
renderProcessingModal={renderProcessingModal}
|
|
67
51
|
renderInput={({ imageUri, onSelect, isDisabled, isProcessing }: SingleImageInputRenderProps) => (
|
|
68
52
|
<PhotoUploadCard
|
|
69
53
|
imageUri={imageUri}
|
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* RemoveBackgroundFeature Component
|
|
3
|
-
* Self-contained remove background feature UI component
|
|
4
|
-
* Uses centralized SingleImageFeatureLayout for consistent UX
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
1
|
import React, { useMemo } from "react";
|
|
8
2
|
import { Image, StyleSheet } from "react-native";
|
|
9
3
|
import { PhotoUploadCard } from "../../../../presentation/components/PhotoUploadCard";
|
|
10
4
|
import { SingleImageFeatureLayout } from "../../../../presentation/layouts";
|
|
11
|
-
import type {
|
|
5
|
+
import type { SingleImageInputRenderProps, ResultRenderProps } from "../../../../presentation/layouts";
|
|
12
6
|
import { useRemoveBackgroundFeature } from "../hooks";
|
|
13
|
-
import type {
|
|
14
|
-
RemoveBackgroundTranslations,
|
|
15
|
-
RemoveBackgroundFeatureConfig,
|
|
16
|
-
} from "../../domain/types";
|
|
7
|
+
import type { RemoveBackgroundTranslations, RemoveBackgroundFeatureConfig } from "../../domain/types";
|
|
17
8
|
|
|
18
9
|
export interface RemoveBackgroundFeatureProps {
|
|
19
10
|
config: RemoveBackgroundFeatureConfig;
|
|
@@ -26,7 +17,6 @@ export interface RemoveBackgroundFeatureProps {
|
|
|
26
17
|
onSelectImage: () => Promise<string | null>;
|
|
27
18
|
onSaveImage: (imageUrl: string) => Promise<void>;
|
|
28
19
|
onBeforeProcess?: () => Promise<boolean>;
|
|
29
|
-
renderProcessingModal?: (props: ProcessingModalRenderProps) => React.ReactNode;
|
|
30
20
|
}
|
|
31
21
|
|
|
32
22
|
export const RemoveBackgroundFeature: React.FC<RemoveBackgroundFeatureProps> = ({
|
|
@@ -35,7 +25,6 @@ export const RemoveBackgroundFeature: React.FC<RemoveBackgroundFeatureProps> = (
|
|
|
35
25
|
onSelectImage,
|
|
36
26
|
onSaveImage,
|
|
37
27
|
onBeforeProcess,
|
|
38
|
-
renderProcessingModal,
|
|
39
28
|
}) => {
|
|
40
29
|
const feature = useRemoveBackgroundFeature({
|
|
41
30
|
config,
|
|
@@ -59,7 +48,6 @@ export const RemoveBackgroundFeature: React.FC<RemoveBackgroundFeatureProps> = (
|
|
|
59
48
|
feature={feature}
|
|
60
49
|
translations={translations}
|
|
61
50
|
modalTranslations={modalTranslations}
|
|
62
|
-
renderProcessingModal={renderProcessingModal}
|
|
63
51
|
renderInput={({ imageUri, onSelect, isDisabled, isProcessing }: SingleImageInputRenderProps) => (
|
|
64
52
|
<PhotoUploadCard
|
|
65
53
|
imageUri={imageUri}
|
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* RemoveObjectFeature Component
|
|
3
|
-
* Self-contained remove object feature UI component
|
|
4
|
-
* Uses centralized SingleImageWithPromptFeatureLayout for consistent UX
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
1
|
import React, { useMemo } from "react";
|
|
8
2
|
import { View, Image, StyleSheet, TextInput } from "react-native";
|
|
9
|
-
import {
|
|
10
|
-
useAppDesignTokens,
|
|
11
|
-
AtomicText,
|
|
12
|
-
} from "@umituz/react-native-design-system";
|
|
3
|
+
import { useAppDesignTokens, AtomicText } from "@umituz/react-native-design-system";
|
|
13
4
|
import { PhotoUploadCard } from "../../../../presentation/components/PhotoUploadCard";
|
|
14
5
|
import { SingleImageWithPromptFeatureLayout } from "../../../../presentation/layouts";
|
|
15
|
-
import type {
|
|
6
|
+
import type { SingleImageWithPromptInputRenderProps, ResultRenderProps } from "../../../../presentation/layouts";
|
|
16
7
|
import { useRemoveObjectFeature } from "../hooks";
|
|
17
|
-
import type {
|
|
18
|
-
RemoveObjectTranslations,
|
|
19
|
-
RemoveObjectFeatureConfig,
|
|
20
|
-
} from "../../domain/types";
|
|
8
|
+
import type { RemoveObjectTranslations, RemoveObjectFeatureConfig } from "../../domain/types";
|
|
21
9
|
|
|
22
10
|
export interface RemoveObjectFeatureProps {
|
|
23
11
|
config: RemoveObjectFeatureConfig;
|
|
@@ -30,7 +18,6 @@ export interface RemoveObjectFeatureProps {
|
|
|
30
18
|
onSelectImage: () => Promise<string | null>;
|
|
31
19
|
onSaveImage: (imageUrl: string) => Promise<void>;
|
|
32
20
|
onBeforeProcess?: () => Promise<boolean>;
|
|
33
|
-
renderProcessingModal?: (props: ProcessingModalRenderProps) => React.ReactNode;
|
|
34
21
|
}
|
|
35
22
|
|
|
36
23
|
export const RemoveObjectFeature: React.FC<RemoveObjectFeatureProps> = ({
|
|
@@ -39,7 +26,6 @@ export const RemoveObjectFeature: React.FC<RemoveObjectFeatureProps> = ({
|
|
|
39
26
|
onSelectImage,
|
|
40
27
|
onSaveImage,
|
|
41
28
|
onBeforeProcess,
|
|
42
|
-
renderProcessingModal,
|
|
43
29
|
}) => {
|
|
44
30
|
const tokens = useAppDesignTokens();
|
|
45
31
|
|
|
@@ -65,7 +51,6 @@ export const RemoveObjectFeature: React.FC<RemoveObjectFeatureProps> = ({
|
|
|
65
51
|
feature={feature}
|
|
66
52
|
translations={translations}
|
|
67
53
|
modalTranslations={modalTranslations}
|
|
68
|
-
renderProcessingModal={renderProcessingModal}
|
|
69
54
|
renderInput={({ imageUri, onSelect, isDisabled, isProcessing, prompt, onPromptChange }: SingleImageWithPromptInputRenderProps) => (
|
|
70
55
|
<>
|
|
71
56
|
<PhotoUploadCard
|
|
@@ -88,10 +73,7 @@ export const RemoveObjectFeature: React.FC<RemoveObjectFeatureProps> = ({
|
|
|
88
73
|
/>
|
|
89
74
|
|
|
90
75
|
<View style={styles.promptContainer}>
|
|
91
|
-
<AtomicText
|
|
92
|
-
type="labelMedium"
|
|
93
|
-
style={[styles.promptLabel, { color: tokens.colors.textPrimary }]}
|
|
94
|
-
>
|
|
76
|
+
<AtomicText type="labelMedium" style={[styles.promptLabel, { color: tokens.colors.textPrimary }]}>
|
|
95
77
|
{translations.maskTitle}
|
|
96
78
|
</AtomicText>
|
|
97
79
|
<TextInput
|
|
@@ -111,10 +93,7 @@ export const RemoveObjectFeature: React.FC<RemoveObjectFeatureProps> = ({
|
|
|
111
93
|
numberOfLines={3}
|
|
112
94
|
editable={!isProcessing}
|
|
113
95
|
/>
|
|
114
|
-
<AtomicText
|
|
115
|
-
type="bodySmall"
|
|
116
|
-
style={[styles.promptHint, { color: tokens.colors.textTertiary }]}
|
|
117
|
-
>
|
|
96
|
+
<AtomicText type="bodySmall" style={[styles.promptHint, { color: tokens.colors.textTertiary }]}>
|
|
118
97
|
{translations.maskSubtitle}
|
|
119
98
|
</AtomicText>
|
|
120
99
|
</View>
|
|
@@ -177,7 +177,7 @@ export function useRemoveObjectFeature(
|
|
|
177
177
|
maskBase64,
|
|
178
178
|
prompt: prompt || undefined,
|
|
179
179
|
});
|
|
180
|
-
} catch
|
|
180
|
+
} catch {
|
|
181
181
|
// Error already handled by orchestrator
|
|
182
182
|
}
|
|
183
183
|
}, [imageUri, maskUri, prompt, config, onBeforeProcess, orchestrator]);
|
package/src/features/replace-background/presentation/components/ReplaceBackgroundFeature.tsx
CHANGED
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ReplaceBackgroundFeature Component
|
|
3
|
-
* Self-contained background replacement feature UI component
|
|
4
|
-
* Uses centralized SingleImageWithPromptFeatureLayout for consistent UX
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
1
|
import React, { useMemo } from "react";
|
|
8
2
|
import { View, Image, StyleSheet } from "react-native";
|
|
9
3
|
import { AtomicInput } from "@umituz/react-native-design-system";
|
|
10
4
|
import { PhotoUploadCard } from "../../../../presentation/components/PhotoUploadCard";
|
|
11
5
|
import { SingleImageWithPromptFeatureLayout } from "../../../../presentation/layouts";
|
|
12
|
-
import type {
|
|
13
|
-
ProcessingModalRenderProps,
|
|
14
|
-
SingleImageWithPromptInputRenderProps,
|
|
15
|
-
ResultRenderProps,
|
|
16
|
-
} from "../../../../presentation/layouts";
|
|
6
|
+
import type { SingleImageWithPromptInputRenderProps, ResultRenderProps } from "../../../../presentation/layouts";
|
|
17
7
|
import { useReplaceBackgroundFeature } from "../hooks";
|
|
18
|
-
import type {
|
|
19
|
-
ReplaceBackgroundTranslations,
|
|
20
|
-
ReplaceBackgroundFeatureConfig,
|
|
21
|
-
} from "../../domain/types";
|
|
8
|
+
import type { ReplaceBackgroundTranslations, ReplaceBackgroundFeatureConfig } from "../../domain/types";
|
|
22
9
|
|
|
23
10
|
export interface ReplaceBackgroundFeatureProps {
|
|
24
11
|
config: ReplaceBackgroundFeatureConfig;
|
|
@@ -31,7 +18,6 @@ export interface ReplaceBackgroundFeatureProps {
|
|
|
31
18
|
onSelectImage: () => Promise<string | null>;
|
|
32
19
|
onSaveImage: (imageUrl: string) => Promise<void>;
|
|
33
20
|
onBeforeProcess?: () => Promise<boolean>;
|
|
34
|
-
renderProcessingModal?: (props: ProcessingModalRenderProps) => React.ReactNode;
|
|
35
21
|
}
|
|
36
22
|
|
|
37
23
|
export const ReplaceBackgroundFeature: React.FC<ReplaceBackgroundFeatureProps> = ({
|
|
@@ -40,7 +26,6 @@ export const ReplaceBackgroundFeature: React.FC<ReplaceBackgroundFeatureProps> =
|
|
|
40
26
|
onSelectImage,
|
|
41
27
|
onSaveImage,
|
|
42
28
|
onBeforeProcess,
|
|
43
|
-
renderProcessingModal,
|
|
44
29
|
}) => {
|
|
45
30
|
const feature = useReplaceBackgroundFeature({
|
|
46
31
|
config,
|
|
@@ -64,7 +49,6 @@ export const ReplaceBackgroundFeature: React.FC<ReplaceBackgroundFeatureProps> =
|
|
|
64
49
|
feature={feature}
|
|
65
50
|
translations={translations}
|
|
66
51
|
modalTranslations={modalTranslations}
|
|
67
|
-
renderProcessingModal={renderProcessingModal}
|
|
68
52
|
renderInput={({ imageUri, onSelect, isDisabled, isProcessing, prompt, onPromptChange }: SingleImageWithPromptInputRenderProps) => (
|
|
69
53
|
<>
|
|
70
54
|
<PhotoUploadCard
|
|
@@ -144,7 +144,7 @@ export function useDualImageVideoFeature(
|
|
|
144
144
|
]);
|
|
145
145
|
|
|
146
146
|
await orchestrator.generate({ sourceImageBase64, targetImageBase64 });
|
|
147
|
-
} catch
|
|
147
|
+
} catch {
|
|
148
148
|
// Error already handled by orchestrator
|
|
149
149
|
}
|
|
150
150
|
}, [sourceImageUri, targetImageUri, featureType, config, onBeforeProcess, orchestrator]);
|
|
@@ -118,7 +118,7 @@ export function useTextToVideoFeature(props: UseTextToVideoFeatureProps): UseTex
|
|
|
118
118
|
return result;
|
|
119
119
|
},
|
|
120
120
|
getCreditCost: () => config.creditCost,
|
|
121
|
-
save: async (result,
|
|
121
|
+
save: async (result, _uid) => {
|
|
122
122
|
if (result.success && result.videoUrl) {
|
|
123
123
|
await callbacks.onCreationSave?.({
|
|
124
124
|
creationId: generateCreationId(),
|
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* UpscaleFeature Component
|
|
3
|
-
* Self-contained upscale feature UI component
|
|
4
|
-
* Uses centralized SingleImageFeatureLayout for consistent UX
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
1
|
import React, { useMemo } from "react";
|
|
8
2
|
import { PhotoUploadCard } from "../../../../presentation/components/PhotoUploadCard";
|
|
9
3
|
import { SingleImageFeatureLayout } from "../../../../presentation/layouts";
|
|
10
|
-
import type {
|
|
11
|
-
ProcessingModalRenderProps,
|
|
12
|
-
SingleImageInputRenderProps,
|
|
13
|
-
CustomResultRenderProps,
|
|
14
|
-
} from "../../../../presentation/layouts";
|
|
4
|
+
import type { SingleImageInputRenderProps, CustomResultRenderProps } from "../../../../presentation/layouts";
|
|
15
5
|
import { UpscaleResultView } from "./UpscaleResultView";
|
|
16
6
|
import { useUpscaleFeature } from "../hooks";
|
|
17
|
-
import type {
|
|
18
|
-
UpscaleTranslations,
|
|
19
|
-
UpscaleFeatureConfig,
|
|
20
|
-
} from "../../domain/types";
|
|
7
|
+
import type { UpscaleTranslations, UpscaleFeatureConfig } from "../../domain/types";
|
|
21
8
|
|
|
22
9
|
export interface UpscaleFeatureProps {
|
|
23
10
|
config: UpscaleFeatureConfig;
|
|
@@ -30,7 +17,6 @@ export interface UpscaleFeatureProps {
|
|
|
30
17
|
onSelectImage: () => Promise<string | null>;
|
|
31
18
|
onSaveImage: (imageUrl: string) => Promise<void>;
|
|
32
19
|
onBeforeProcess?: () => Promise<boolean>;
|
|
33
|
-
renderProcessingModal?: (props: ProcessingModalRenderProps) => React.ReactNode;
|
|
34
20
|
}
|
|
35
21
|
|
|
36
22
|
export const UpscaleFeature: React.FC<UpscaleFeatureProps> = ({
|
|
@@ -39,7 +25,6 @@ export const UpscaleFeature: React.FC<UpscaleFeatureProps> = ({
|
|
|
39
25
|
onSelectImage,
|
|
40
26
|
onSaveImage,
|
|
41
27
|
onBeforeProcess,
|
|
42
|
-
renderProcessingModal,
|
|
43
28
|
}) => {
|
|
44
29
|
const feature = useUpscaleFeature({
|
|
45
30
|
config,
|
|
@@ -64,7 +49,6 @@ export const UpscaleFeature: React.FC<UpscaleFeatureProps> = ({
|
|
|
64
49
|
translations={translations}
|
|
65
50
|
modalTranslations={modalTranslations}
|
|
66
51
|
description={translations.description}
|
|
67
|
-
renderProcessingModal={renderProcessingModal}
|
|
68
52
|
renderInput={({ imageUri, onSelect, isDisabled, isProcessing }: SingleImageInputRenderProps) => (
|
|
69
53
|
<PhotoUploadCard
|
|
70
54
|
imageUri={imageUri}
|
|
@@ -5,15 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
import React, { useMemo, useCallback, useEffect, useRef } from "react";
|
|
7
7
|
import { View, StyleSheet } from "react-native";
|
|
8
|
-
import type {
|
|
9
|
-
AIGenerationWizardProps,
|
|
10
|
-
WizardStepProps,
|
|
11
|
-
WizardStep,
|
|
12
|
-
} from "../../domain/types";
|
|
8
|
+
import type { AIGenerationWizardProps, WizardStepProps } from "../../domain/types";
|
|
13
9
|
import { createWizardStore, type WizardStoreType } from "../store/useWizardStore";
|
|
14
10
|
|
|
15
11
|
export const AIGenerationWizard: React.FC<AIGenerationWizardProps> = ({
|
|
16
|
-
userId,
|
|
12
|
+
userId: _userId,
|
|
17
13
|
isAuthenticated = false,
|
|
18
14
|
hasCredits = true,
|
|
19
15
|
config,
|