@umituz/react-native-ai-generation-content 1.17.135 → 1.17.137
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/image-to-video/domain/constants/animation.constants.ts +6 -6
- package/src/features/image-to-video/presentation/components/AnimationStyleSelector.tsx +1 -1
- package/src/features/image-to-video/presentation/components/ImageSelectionGrid.tsx +1 -1
- package/src/features/image-to-video/presentation/hooks/useImageToVideoForm.ts +24 -3
- package/src/features/script-generator/presentation/components/ScriptDisplay.tsx +2 -2
- package/src/index.ts +0 -2
- package/src/presentation/components/image-picker/DualImagePicker.tsx +9 -11
- package/src/presentation/components/image-picker/index.ts +0 -1
- package/src/presentation/components/image-picker/ImagePickerBox.tsx +0 -176
package/package.json
CHANGED
|
@@ -10,37 +10,37 @@ export const DEFAULT_ANIMATION_STYLES: AnimationStyle[] = [
|
|
|
10
10
|
id: "ken_burns",
|
|
11
11
|
name: "Ken Burns",
|
|
12
12
|
description: "Slow zoom and pan effect",
|
|
13
|
-
icon: "
|
|
13
|
+
icon: "expand-outline",
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
id: "zoom_in",
|
|
17
17
|
name: "Zoom In",
|
|
18
18
|
description: "Gradual zoom in effect",
|
|
19
|
-
icon: "
|
|
19
|
+
icon: "add-circle-outline",
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
id: "zoom_out",
|
|
23
23
|
name: "Zoom Out",
|
|
24
24
|
description: "Gradual zoom out effect",
|
|
25
|
-
icon: "
|
|
25
|
+
icon: "remove-circle-outline",
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
id: "slide_left",
|
|
29
29
|
name: "Slide Left",
|
|
30
30
|
description: "Pan from right to left",
|
|
31
|
-
icon: "
|
|
31
|
+
icon: "arrow-back-outline",
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
id: "slide_right",
|
|
35
35
|
name: "Slide Right",
|
|
36
36
|
description: "Pan from left to right",
|
|
37
|
-
icon: "
|
|
37
|
+
icon: "arrow-forward-outline",
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
id: "parallax",
|
|
41
41
|
name: "Parallax",
|
|
42
42
|
description: "3D depth effect",
|
|
43
|
-
icon: "
|
|
43
|
+
icon: "layers-outline",
|
|
44
44
|
},
|
|
45
45
|
];
|
|
46
46
|
|
|
@@ -89,7 +89,7 @@ export const AnimationStyleSelector: React.FC<AnimationStyleSelectorProps> = ({
|
|
|
89
89
|
</AtomicText>
|
|
90
90
|
</View>
|
|
91
91
|
{isSelected && (
|
|
92
|
-
<AtomicIcon name="
|
|
92
|
+
<AtomicIcon name="checkmark-outline" size="md" color="primary" />
|
|
93
93
|
)}
|
|
94
94
|
</View>
|
|
95
95
|
</TouchableOpacity>
|
|
@@ -61,7 +61,7 @@ export const ImageSelectionGrid: React.FC<ImageSelectionGridProps> = ({
|
|
|
61
61
|
onPress={onSelectImages}
|
|
62
62
|
activeOpacity={0.7}
|
|
63
63
|
>
|
|
64
|
-
<AtomicIcon name="
|
|
64
|
+
<AtomicIcon name="cloud-upload-outline" size="xl" color="primary" />
|
|
65
65
|
<AtomicText
|
|
66
66
|
type="bodyMedium"
|
|
67
67
|
style={[
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { useMemo, useCallback } from "react";
|
|
7
|
+
|
|
8
|
+
declare const __DEV__: boolean;
|
|
7
9
|
import { useFormState, type UseFormStateOptions } from "./useFormState";
|
|
8
10
|
import { useGeneration } from "./useGeneration";
|
|
9
11
|
import type {
|
|
@@ -60,10 +62,29 @@ export function useImageToVideoForm(
|
|
|
60
62
|
);
|
|
61
63
|
|
|
62
64
|
const handleSelectImages = useCallback(async () => {
|
|
65
|
+
if (__DEV__) {
|
|
66
|
+
console.log("[useImageToVideoForm] handleSelectImages called");
|
|
67
|
+
}
|
|
63
68
|
if (callbacks.onSelectImages) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
try {
|
|
70
|
+
const images = await callbacks.onSelectImages();
|
|
71
|
+
if (__DEV__) {
|
|
72
|
+
console.log("[useImageToVideoForm] Images selected:", images.length);
|
|
73
|
+
}
|
|
74
|
+
if (images.length > 0) {
|
|
75
|
+
actions.addImages(images);
|
|
76
|
+
if (__DEV__) {
|
|
77
|
+
console.log("[useImageToVideoForm] Images added to state");
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
} catch (error) {
|
|
81
|
+
if (__DEV__) {
|
|
82
|
+
console.error("[useImageToVideoForm] Error selecting images:", error);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
} else {
|
|
86
|
+
if (__DEV__) {
|
|
87
|
+
console.warn("[useImageToVideoForm] No onSelectImages callback provided");
|
|
67
88
|
}
|
|
68
89
|
}
|
|
69
90
|
}, [callbacks, actions]);
|
|
@@ -37,7 +37,7 @@ export const ScriptDisplay: React.FC<ScriptDisplayProps> = ({
|
|
|
37
37
|
📝 {title}
|
|
38
38
|
</AtomicText>
|
|
39
39
|
<TouchableOpacity onPress={onUseScript}>
|
|
40
|
-
<AtomicIcon name="
|
|
40
|
+
<AtomicIcon name="checkmark-outline" size="md" color="primary" />
|
|
41
41
|
</TouchableOpacity>
|
|
42
42
|
</View>
|
|
43
43
|
|
|
@@ -102,7 +102,7 @@ export const ScriptDisplay: React.FC<ScriptDisplayProps> = ({
|
|
|
102
102
|
]}
|
|
103
103
|
onPress={onUseScript}
|
|
104
104
|
>
|
|
105
|
-
<AtomicIcon name="
|
|
105
|
+
<AtomicIcon name="checkmark-outline" size="md" color="textInverse" />
|
|
106
106
|
<AtomicText
|
|
107
107
|
type="bodyLarge"
|
|
108
108
|
style={[styles.useButtonText, { color: tokens.colors.textInverse }]}
|
package/src/index.ts
CHANGED
|
@@ -305,7 +305,6 @@ export {
|
|
|
305
305
|
DEFAULT_RESULT_CONFIG,
|
|
306
306
|
PhotoStep,
|
|
307
307
|
// Image Picker
|
|
308
|
-
ImagePickerBox,
|
|
309
308
|
DualImagePicker,
|
|
310
309
|
// New Generic Sections
|
|
311
310
|
PromptInput,
|
|
@@ -361,7 +360,6 @@ export type {
|
|
|
361
360
|
ResultActionButton,
|
|
362
361
|
PhotoStepProps,
|
|
363
362
|
// Image Picker
|
|
364
|
-
ImagePickerBoxProps,
|
|
365
363
|
DualImagePickerProps,
|
|
366
364
|
PromptInputProps,
|
|
367
365
|
AIGenerationHeroProps,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import React from "react";
|
|
8
8
|
import { View, StyleSheet } from "react-native";
|
|
9
9
|
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
10
|
-
import {
|
|
10
|
+
import { PhotoUploadCard } from "../PhotoUploadCard";
|
|
11
11
|
|
|
12
12
|
export interface DualImagePickerProps {
|
|
13
13
|
readonly sourceImageUri: string | null;
|
|
@@ -17,7 +17,6 @@ export interface DualImagePickerProps {
|
|
|
17
17
|
readonly onSelectTarget: () => void;
|
|
18
18
|
readonly sourcePlaceholder: string;
|
|
19
19
|
readonly targetPlaceholder: string;
|
|
20
|
-
readonly variant?: ImagePickerBoxProps["variant"];
|
|
21
20
|
readonly layout?: "horizontal" | "vertical";
|
|
22
21
|
}
|
|
23
22
|
|
|
@@ -29,7 +28,6 @@ export const DualImagePicker: React.FC<DualImagePickerProps> = ({
|
|
|
29
28
|
onSelectTarget,
|
|
30
29
|
sourcePlaceholder,
|
|
31
30
|
targetPlaceholder,
|
|
32
|
-
variant = "portrait",
|
|
33
31
|
layout = "horizontal",
|
|
34
32
|
}) => {
|
|
35
33
|
const tokens = useAppDesignTokens();
|
|
@@ -44,22 +42,22 @@ export const DualImagePicker: React.FC<DualImagePickerProps> = ({
|
|
|
44
42
|
]}
|
|
45
43
|
>
|
|
46
44
|
<View style={isHorizontal ? styles.pickerHalf : styles.pickerFull}>
|
|
47
|
-
<
|
|
45
|
+
<PhotoUploadCard
|
|
48
46
|
imageUri={sourceImageUri}
|
|
49
|
-
|
|
47
|
+
disabled={isDisabled}
|
|
50
48
|
onPress={onSelectSource}
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
title={sourcePlaceholder}
|
|
50
|
+
config={{ aspectRatio: 1, borderRadius: 20 }}
|
|
53
51
|
/>
|
|
54
52
|
</View>
|
|
55
53
|
|
|
56
54
|
<View style={isHorizontal ? styles.pickerHalf : styles.pickerFull}>
|
|
57
|
-
<
|
|
55
|
+
<PhotoUploadCard
|
|
58
56
|
imageUri={targetImageUri}
|
|
59
|
-
|
|
57
|
+
disabled={isDisabled}
|
|
60
58
|
onPress={onSelectTarget}
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
title={targetPlaceholder}
|
|
60
|
+
config={{ aspectRatio: 1, borderRadius: 20 }}
|
|
63
61
|
/>
|
|
64
62
|
</View>
|
|
65
63
|
</View>
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ImagePickerBox Component
|
|
3
|
-
* Generic image picker box with solid color design
|
|
4
|
-
* Props-driven for 100+ apps compatibility
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React from "react";
|
|
8
|
-
import {
|
|
9
|
-
View,
|
|
10
|
-
StyleSheet,
|
|
11
|
-
TouchableOpacity,
|
|
12
|
-
Image,
|
|
13
|
-
type ViewStyle,
|
|
14
|
-
} from "react-native";
|
|
15
|
-
import {
|
|
16
|
-
AtomicText,
|
|
17
|
-
useAppDesignTokens,
|
|
18
|
-
AtomicIcon,
|
|
19
|
-
} from "@umituz/react-native-design-system";
|
|
20
|
-
|
|
21
|
-
export interface ImagePickerBoxProps {
|
|
22
|
-
readonly imageUri: string | null;
|
|
23
|
-
readonly isDisabled?: boolean;
|
|
24
|
-
readonly onPress: () => void;
|
|
25
|
-
readonly placeholderText: string;
|
|
26
|
-
readonly variant?: "portrait" | "square" | "landscape";
|
|
27
|
-
readonly size?: "sm" | "md" | "lg";
|
|
28
|
-
readonly uploadIcon?: string;
|
|
29
|
-
readonly editIcon?: string;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const VARIANT_STYLES: Record<string, ViewStyle> = {
|
|
33
|
-
portrait: { width: 200, height: 280, borderRadius: 20 },
|
|
34
|
-
square: { width: "100%", aspectRatio: 1, borderRadius: 24 },
|
|
35
|
-
landscape: { width: "100%", aspectRatio: 16 / 9, borderRadius: 16 },
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const SIZE_MULTIPLIERS = { sm: 0.7, md: 1, lg: 1.3 };
|
|
39
|
-
|
|
40
|
-
export const ImagePickerBox: React.FC<ImagePickerBoxProps> = ({
|
|
41
|
-
imageUri,
|
|
42
|
-
isDisabled = false,
|
|
43
|
-
onPress,
|
|
44
|
-
placeholderText,
|
|
45
|
-
variant = "portrait",
|
|
46
|
-
size = "md",
|
|
47
|
-
uploadIcon = "cloud-upload-outline",
|
|
48
|
-
editIcon = "image-outline",
|
|
49
|
-
}) => {
|
|
50
|
-
const tokens = useAppDesignTokens();
|
|
51
|
-
const multiplier = SIZE_MULTIPLIERS[size];
|
|
52
|
-
const baseStyle = VARIANT_STYLES[variant];
|
|
53
|
-
const iconSize = Math.round(32 * multiplier);
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<View style={styles.container}>
|
|
57
|
-
<TouchableOpacity
|
|
58
|
-
style={[
|
|
59
|
-
styles.box,
|
|
60
|
-
baseStyle,
|
|
61
|
-
{ backgroundColor: tokens.colors.backgroundSecondary },
|
|
62
|
-
]}
|
|
63
|
-
onPress={onPress}
|
|
64
|
-
disabled={isDisabled}
|
|
65
|
-
activeOpacity={0.8}
|
|
66
|
-
>
|
|
67
|
-
{imageUri ? (
|
|
68
|
-
<View style={styles.imageContainer}>
|
|
69
|
-
<Image source={{ uri: imageUri }} style={styles.image} />
|
|
70
|
-
<View
|
|
71
|
-
style={[
|
|
72
|
-
styles.imageOverlay,
|
|
73
|
-
{ backgroundColor: tokens.colors.modalOverlay },
|
|
74
|
-
]}
|
|
75
|
-
>
|
|
76
|
-
<View
|
|
77
|
-
style={[
|
|
78
|
-
styles.editBadge,
|
|
79
|
-
{ backgroundColor: tokens.colors.primary },
|
|
80
|
-
]}
|
|
81
|
-
>
|
|
82
|
-
<AtomicIcon
|
|
83
|
-
name={editIcon}
|
|
84
|
-
customSize={Math.round(16 * multiplier)}
|
|
85
|
-
customColor={tokens.colors.textInverse}
|
|
86
|
-
/>
|
|
87
|
-
</View>
|
|
88
|
-
</View>
|
|
89
|
-
</View>
|
|
90
|
-
) : (
|
|
91
|
-
<View
|
|
92
|
-
style={[
|
|
93
|
-
styles.placeholder,
|
|
94
|
-
{ backgroundColor: tokens.colors.primary },
|
|
95
|
-
]}
|
|
96
|
-
>
|
|
97
|
-
<View style={styles.placeholderContent}>
|
|
98
|
-
<View
|
|
99
|
-
style={[
|
|
100
|
-
styles.uploadIconContainer,
|
|
101
|
-
{ backgroundColor: tokens.colors.surface },
|
|
102
|
-
]}
|
|
103
|
-
>
|
|
104
|
-
<AtomicIcon
|
|
105
|
-
name={uploadIcon}
|
|
106
|
-
customSize={iconSize}
|
|
107
|
-
customColor={tokens.colors.primary}
|
|
108
|
-
/>
|
|
109
|
-
</View>
|
|
110
|
-
<AtomicText
|
|
111
|
-
type="bodyMedium"
|
|
112
|
-
style={[
|
|
113
|
-
styles.placeholderText,
|
|
114
|
-
{ color: tokens.colors.textInverse },
|
|
115
|
-
]}
|
|
116
|
-
>
|
|
117
|
-
{placeholderText}
|
|
118
|
-
</AtomicText>
|
|
119
|
-
</View>
|
|
120
|
-
</View>
|
|
121
|
-
)}
|
|
122
|
-
</TouchableOpacity>
|
|
123
|
-
</View>
|
|
124
|
-
);
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const styles = StyleSheet.create({
|
|
128
|
-
container: {
|
|
129
|
-
marginVertical: 16,
|
|
130
|
-
alignItems: "center",
|
|
131
|
-
},
|
|
132
|
-
box: {
|
|
133
|
-
overflow: "hidden",
|
|
134
|
-
},
|
|
135
|
-
imageContainer: {
|
|
136
|
-
flex: 1,
|
|
137
|
-
position: "relative",
|
|
138
|
-
},
|
|
139
|
-
image: {
|
|
140
|
-
width: "100%",
|
|
141
|
-
height: "100%",
|
|
142
|
-
},
|
|
143
|
-
imageOverlay: {
|
|
144
|
-
position: "absolute",
|
|
145
|
-
bottom: 0,
|
|
146
|
-
left: 0,
|
|
147
|
-
right: 0,
|
|
148
|
-
height: "30%",
|
|
149
|
-
justifyContent: "flex-end",
|
|
150
|
-
alignItems: "flex-end",
|
|
151
|
-
padding: 12,
|
|
152
|
-
},
|
|
153
|
-
editBadge: {
|
|
154
|
-
borderRadius: 20,
|
|
155
|
-
padding: 8,
|
|
156
|
-
},
|
|
157
|
-
placeholder: {
|
|
158
|
-
flex: 1,
|
|
159
|
-
justifyContent: "center",
|
|
160
|
-
alignItems: "center",
|
|
161
|
-
},
|
|
162
|
-
placeholderContent: {
|
|
163
|
-
alignItems: "center",
|
|
164
|
-
justifyContent: "center",
|
|
165
|
-
paddingHorizontal: 16,
|
|
166
|
-
},
|
|
167
|
-
uploadIconContainer: {
|
|
168
|
-
borderRadius: 40,
|
|
169
|
-
padding: 16,
|
|
170
|
-
marginBottom: 12,
|
|
171
|
-
},
|
|
172
|
-
placeholderText: {
|
|
173
|
-
textAlign: "center",
|
|
174
|
-
fontWeight: "600",
|
|
175
|
-
},
|
|
176
|
-
});
|