@umituz/react-native-ai-generation-content 1.17.21 → 1.17.22
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/domains/creations/domain/types/creation-filter.ts +1 -3
- package/src/domains/creations/domain/value-objects/CreationsConfig.ts +12 -0
- package/src/domains/creations/presentation/components/FilterSheets.tsx +63 -0
- package/src/domains/creations/presentation/components/GalleryHeader.tsx +95 -93
- package/src/domains/creations/presentation/components/index.ts +1 -0
- package/src/domains/creations/presentation/hooks/index.ts +3 -0
- package/src/domains/creations/presentation/hooks/useCreationsFilter.ts +35 -48
- package/src/domains/creations/presentation/hooks/useGalleryFilters.ts +78 -0
- package/src/domains/creations/presentation/hooks/useMediaFilter.ts +54 -0
- package/src/domains/creations/presentation/hooks/useStatusFilter.ts +54 -0
- package/src/domains/creations/presentation/screens/CreationsGalleryScreen.tsx +81 -156
- package/src/features/image-to-video/index.ts +90 -3
- package/src/features/image-to-video/presentation/components/AnimationStyleSelector.tsx +135 -0
- package/src/features/image-to-video/presentation/components/DurationSelector.tsx +110 -0
- package/src/features/image-to-video/presentation/components/GenerateButton.tsx +95 -0
- package/src/features/image-to-video/presentation/components/HeroSection.tsx +89 -0
- package/src/features/image-to-video/presentation/components/ImageSelectionGrid.tsx +234 -0
- package/src/features/image-to-video/presentation/components/MusicMoodSelector.tsx +181 -0
- package/src/features/image-to-video/presentation/components/index.ts +30 -0
- package/src/features/image-to-video/presentation/hooks/index.ts +22 -0
- package/src/features/image-to-video/presentation/hooks/useFormState.ts +116 -0
- package/src/features/image-to-video/presentation/hooks/useGeneration.ts +85 -0
- package/src/features/image-to-video/presentation/hooks/useImageToVideoForm.ts +93 -0
- package/src/features/image-to-video/presentation/index.ts +4 -0
- package/src/features/text-to-video/domain/types/callback.types.ts +50 -0
- package/src/features/text-to-video/domain/types/component.types.ts +106 -0
- package/src/features/text-to-video/domain/types/config.types.ts +61 -0
- package/src/features/text-to-video/domain/types/index.ts +48 -4
- package/src/features/text-to-video/domain/types/request.types.ts +36 -0
- package/src/features/text-to-video/domain/types/state.types.ts +53 -0
- package/src/features/text-to-video/index.ts +41 -3
- package/src/features/text-to-video/infrastructure/services/text-to-video-executor.ts +1 -1
- package/src/features/text-to-video/presentation/components/FrameSelector.tsx +153 -0
- package/src/features/text-to-video/presentation/components/GenerationTabs.tsx +73 -0
- package/src/features/text-to-video/presentation/components/HeroSection.tsx +67 -0
- package/src/features/text-to-video/presentation/components/HintCarousel.tsx +96 -0
- package/src/features/text-to-video/presentation/components/OptionsPanel.tsx +123 -0
- package/src/features/text-to-video/presentation/components/index.ts +10 -0
- package/src/features/text-to-video/presentation/hooks/index.ts +11 -0
- package/src/features/text-to-video/presentation/hooks/useTextToVideoFeature.ts +77 -20
- package/src/features/text-to-video/presentation/hooks/useTextToVideoForm.ts +134 -0
- package/src/features/text-to-video/presentation/index.ts +6 -0
- package/src/features/text-to-video/domain/types/text-to-video.types.ts +0 -65
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Text-to-Video Feature
|
|
3
|
-
* Provider-agnostic text-to-video generation
|
|
3
|
+
* Provider-agnostic text-to-video generation for 100+ apps
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Domain Types
|
|
@@ -9,19 +9,57 @@ export type {
|
|
|
9
9
|
TextToVideoRequest,
|
|
10
10
|
TextToVideoResult,
|
|
11
11
|
TextToVideoFeatureState,
|
|
12
|
+
TextToVideoFormState,
|
|
13
|
+
TextToVideoGenerationState,
|
|
12
14
|
TextToVideoTranslations,
|
|
13
15
|
TextToVideoInputBuilder,
|
|
14
16
|
TextToVideoResultExtractor,
|
|
15
|
-
|
|
17
|
+
TextToVideoConfig,
|
|
18
|
+
TextToVideoCallbacks,
|
|
19
|
+
TabConfig,
|
|
20
|
+
StyleOption,
|
|
21
|
+
AspectRatioOption,
|
|
22
|
+
DurationOption,
|
|
23
|
+
OptionToggleConfig,
|
|
24
|
+
HeroConfig,
|
|
25
|
+
ProgressConfig,
|
|
26
|
+
FrameData,
|
|
27
|
+
ModerationResult,
|
|
28
|
+
ProjectData,
|
|
29
|
+
GenerationTabsProps,
|
|
30
|
+
FrameSelectorProps,
|
|
31
|
+
OptionsPanelProps,
|
|
32
|
+
HeroSectionProps,
|
|
33
|
+
HintCarouselProps,
|
|
34
|
+
HintItem,
|
|
35
|
+
ExamplePromptsProps,
|
|
36
|
+
ExamplePrompt,
|
|
16
37
|
} from "./domain";
|
|
17
38
|
|
|
39
|
+
export { INITIAL_FORM_STATE, INITIAL_GENERATION_STATE } from "./domain";
|
|
40
|
+
|
|
18
41
|
// Infrastructure Services
|
|
19
42
|
export { executeTextToVideo, hasTextToVideoSupport } from "./infrastructure";
|
|
20
43
|
export type { ExecuteTextToVideoOptions } from "./infrastructure";
|
|
21
44
|
|
|
22
45
|
// Presentation Hooks
|
|
23
|
-
export {
|
|
46
|
+
export {
|
|
47
|
+
useTextToVideoFeature,
|
|
48
|
+
useTextToVideoForm,
|
|
49
|
+
} from "./presentation";
|
|
50
|
+
|
|
24
51
|
export type {
|
|
25
52
|
UseTextToVideoFeatureProps,
|
|
26
53
|
UseTextToVideoFeatureReturn,
|
|
54
|
+
UseTextToVideoFormProps,
|
|
55
|
+
UseTextToVideoFormReturn,
|
|
56
|
+
} from "./presentation";
|
|
57
|
+
|
|
58
|
+
// Presentation Components
|
|
59
|
+
export {
|
|
60
|
+
GenerationTabs,
|
|
61
|
+
FrameSelector,
|
|
62
|
+
OptionsPanel,
|
|
63
|
+
HeroSection,
|
|
64
|
+
HintCarousel,
|
|
27
65
|
} from "./presentation";
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FrameSelector Component
|
|
3
|
+
* Single Responsibility: Display and manage start/end frames
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { View, StyleSheet, TouchableOpacity, Image } from "react-native";
|
|
8
|
+
import {
|
|
9
|
+
AtomicText,
|
|
10
|
+
AtomicIcon,
|
|
11
|
+
useAppDesignTokens,
|
|
12
|
+
} from "@umituz/react-native-design-system";
|
|
13
|
+
import type { FrameSelectorProps } from "../../domain/types";
|
|
14
|
+
|
|
15
|
+
export const FrameSelector: React.FC<FrameSelectorProps> = ({
|
|
16
|
+
frames,
|
|
17
|
+
onFrameChange,
|
|
18
|
+
onFrameDelete,
|
|
19
|
+
startLabel,
|
|
20
|
+
endLabel,
|
|
21
|
+
changeLabel,
|
|
22
|
+
deleteLabel,
|
|
23
|
+
style,
|
|
24
|
+
}) => {
|
|
25
|
+
const tokens = useAppDesignTokens();
|
|
26
|
+
|
|
27
|
+
const startFrame = frames.find((f) => f.order === 0);
|
|
28
|
+
const endFrame = frames.find((f) => f.order === 1);
|
|
29
|
+
|
|
30
|
+
const renderFrameContent = (frame: typeof startFrame) =>
|
|
31
|
+
frame ? (
|
|
32
|
+
<Image
|
|
33
|
+
source={{ uri: frame.url }}
|
|
34
|
+
style={styles.image}
|
|
35
|
+
resizeMode="cover"
|
|
36
|
+
/>
|
|
37
|
+
) : (
|
|
38
|
+
<View style={styles.placeholder}>
|
|
39
|
+
<AtomicIcon name="image-outline" size="xl" color="secondary" />
|
|
40
|
+
</View>
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
const renderActions = (index: number) => (
|
|
44
|
+
<View style={[styles.actions, { gap: tokens.spacing.md }]}>
|
|
45
|
+
<TouchableOpacity
|
|
46
|
+
style={[styles.actionButton, { gap: tokens.spacing.xs }]}
|
|
47
|
+
onPress={() => onFrameChange(index)}
|
|
48
|
+
>
|
|
49
|
+
<AtomicIcon name="pencil-outline" size="xs" color="primary" />
|
|
50
|
+
<AtomicText type="labelSmall" color="primary">
|
|
51
|
+
{changeLabel}
|
|
52
|
+
</AtomicText>
|
|
53
|
+
</TouchableOpacity>
|
|
54
|
+
<TouchableOpacity
|
|
55
|
+
style={[styles.actionButton, { gap: tokens.spacing.xs }]}
|
|
56
|
+
onPress={() => onFrameDelete(index)}
|
|
57
|
+
>
|
|
58
|
+
<AtomicIcon name="trash-outline" size="xs" color="primary" />
|
|
59
|
+
<AtomicText type="labelSmall" color="primary">
|
|
60
|
+
{deleteLabel}
|
|
61
|
+
</AtomicText>
|
|
62
|
+
</TouchableOpacity>
|
|
63
|
+
</View>
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<View style={[styles.container, { gap: tokens.spacing.md }, style]}>
|
|
68
|
+
<View style={[styles.frameContainer, { gap: tokens.spacing.sm }]}>
|
|
69
|
+
<AtomicText type="labelMedium" color="textSecondary">
|
|
70
|
+
{startLabel}
|
|
71
|
+
</AtomicText>
|
|
72
|
+
<View
|
|
73
|
+
style={[
|
|
74
|
+
styles.imageWrapper,
|
|
75
|
+
{ backgroundColor: tokens.colors.surface },
|
|
76
|
+
]}
|
|
77
|
+
>
|
|
78
|
+
{renderFrameContent(startFrame)}
|
|
79
|
+
</View>
|
|
80
|
+
{renderActions(0)}
|
|
81
|
+
</View>
|
|
82
|
+
|
|
83
|
+
<View style={styles.separatorContainer}>
|
|
84
|
+
<View
|
|
85
|
+
style={[styles.separator, { backgroundColor: tokens.colors.surface }]}
|
|
86
|
+
>
|
|
87
|
+
<AtomicIcon name="arrow-forward-outline" size="sm" color="primary" />
|
|
88
|
+
</View>
|
|
89
|
+
</View>
|
|
90
|
+
|
|
91
|
+
<View style={[styles.frameContainer, { gap: tokens.spacing.sm }]}>
|
|
92
|
+
<AtomicText type="labelMedium" color="textSecondary">
|
|
93
|
+
{endLabel}
|
|
94
|
+
</AtomicText>
|
|
95
|
+
<View
|
|
96
|
+
style={[
|
|
97
|
+
styles.imageWrapper,
|
|
98
|
+
{ backgroundColor: tokens.colors.surface },
|
|
99
|
+
]}
|
|
100
|
+
>
|
|
101
|
+
{renderFrameContent(endFrame)}
|
|
102
|
+
</View>
|
|
103
|
+
{renderActions(1)}
|
|
104
|
+
</View>
|
|
105
|
+
</View>
|
|
106
|
+
);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const styles = StyleSheet.create({
|
|
110
|
+
container: {
|
|
111
|
+
flexDirection: "row",
|
|
112
|
+
alignItems: "flex-start",
|
|
113
|
+
justifyContent: "space-between",
|
|
114
|
+
marginBottom: 24,
|
|
115
|
+
},
|
|
116
|
+
frameContainer: {
|
|
117
|
+
flex: 1,
|
|
118
|
+
},
|
|
119
|
+
imageWrapper: {
|
|
120
|
+
width: "100%",
|
|
121
|
+
aspectRatio: 9 / 16,
|
|
122
|
+
overflow: "hidden",
|
|
123
|
+
alignItems: "center",
|
|
124
|
+
justifyContent: "center",
|
|
125
|
+
},
|
|
126
|
+
image: {
|
|
127
|
+
width: "100%",
|
|
128
|
+
height: "100%",
|
|
129
|
+
},
|
|
130
|
+
placeholder: {
|
|
131
|
+
alignItems: "center",
|
|
132
|
+
justifyContent: "center",
|
|
133
|
+
},
|
|
134
|
+
actions: {
|
|
135
|
+
flexDirection: "row",
|
|
136
|
+
justifyContent: "center",
|
|
137
|
+
},
|
|
138
|
+
actionButton: {
|
|
139
|
+
flexDirection: "row",
|
|
140
|
+
alignItems: "center",
|
|
141
|
+
},
|
|
142
|
+
separatorContainer: {
|
|
143
|
+
justifyContent: "center",
|
|
144
|
+
alignItems: "center",
|
|
145
|
+
paddingTop: 80,
|
|
146
|
+
},
|
|
147
|
+
separator: {
|
|
148
|
+
width: 32,
|
|
149
|
+
height: 32,
|
|
150
|
+
alignItems: "center",
|
|
151
|
+
justifyContent: "center",
|
|
152
|
+
},
|
|
153
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GenerationTabs Component
|
|
3
|
+
* Single Responsibility: Tab navigation for generation modes
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { View, TouchableOpacity, StyleSheet } from "react-native";
|
|
8
|
+
import {
|
|
9
|
+
AtomicText,
|
|
10
|
+
useAppDesignTokens,
|
|
11
|
+
} from "@umituz/react-native-design-system";
|
|
12
|
+
import type { GenerationTabsProps } from "../../domain/types";
|
|
13
|
+
|
|
14
|
+
export const GenerationTabs: React.FC<GenerationTabsProps> = ({
|
|
15
|
+
tabs,
|
|
16
|
+
activeTab,
|
|
17
|
+
onTabChange,
|
|
18
|
+
getLabel,
|
|
19
|
+
style,
|
|
20
|
+
}) => {
|
|
21
|
+
const tokens = useAppDesignTokens();
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<View
|
|
25
|
+
style={[
|
|
26
|
+
styles.container,
|
|
27
|
+
{ backgroundColor: tokens.colors.background },
|
|
28
|
+
style,
|
|
29
|
+
]}
|
|
30
|
+
>
|
|
31
|
+
{tabs.map((tab) => {
|
|
32
|
+
const isActive = activeTab === tab.id;
|
|
33
|
+
return (
|
|
34
|
+
<TouchableOpacity
|
|
35
|
+
key={tab.id}
|
|
36
|
+
style={[
|
|
37
|
+
styles.tab,
|
|
38
|
+
isActive && { backgroundColor: tokens.colors.secondary },
|
|
39
|
+
]}
|
|
40
|
+
onPress={() => onTabChange(tab.id)}
|
|
41
|
+
>
|
|
42
|
+
<AtomicText
|
|
43
|
+
type="labelMedium"
|
|
44
|
+
color={isActive ? "textInverse" : "textSecondary"}
|
|
45
|
+
style={styles.text}
|
|
46
|
+
>
|
|
47
|
+
{getLabel(tab.labelKey)}
|
|
48
|
+
</AtomicText>
|
|
49
|
+
</TouchableOpacity>
|
|
50
|
+
);
|
|
51
|
+
})}
|
|
52
|
+
</View>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const styles = StyleSheet.create({
|
|
57
|
+
container: {
|
|
58
|
+
flexDirection: "row",
|
|
59
|
+
padding: 4,
|
|
60
|
+
borderRadius: 8,
|
|
61
|
+
marginBottom: 16,
|
|
62
|
+
},
|
|
63
|
+
tab: {
|
|
64
|
+
flex: 1,
|
|
65
|
+
paddingVertical: 8,
|
|
66
|
+
alignItems: "center",
|
|
67
|
+
justifyContent: "center",
|
|
68
|
+
borderRadius: 6,
|
|
69
|
+
},
|
|
70
|
+
text: {
|
|
71
|
+
fontWeight: "600",
|
|
72
|
+
},
|
|
73
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HeroSection Component
|
|
3
|
+
* Single Responsibility: Display hero banner for text-to-video feature
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { View, StyleSheet } from "react-native";
|
|
8
|
+
import { LinearGradient } from "expo-linear-gradient";
|
|
9
|
+
import {
|
|
10
|
+
AtomicText,
|
|
11
|
+
AtomicIcon,
|
|
12
|
+
useAppDesignTokens,
|
|
13
|
+
} from "@umituz/react-native-design-system";
|
|
14
|
+
import type { HeroSectionProps } from "../../domain/types";
|
|
15
|
+
|
|
16
|
+
export const HeroSection: React.FC<HeroSectionProps> = ({
|
|
17
|
+
title,
|
|
18
|
+
subtitle,
|
|
19
|
+
icon,
|
|
20
|
+
style,
|
|
21
|
+
}) => {
|
|
22
|
+
const tokens = useAppDesignTokens();
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<LinearGradient
|
|
26
|
+
colors={[tokens.colors.secondary, tokens.colors.primary]}
|
|
27
|
+
start={{ x: 0, y: 0 }}
|
|
28
|
+
end={{ x: 1, y: 1 }}
|
|
29
|
+
style={[styles.container, style]}
|
|
30
|
+
>
|
|
31
|
+
<View style={styles.iconContainer}>
|
|
32
|
+
<AtomicIcon
|
|
33
|
+
name={icon || "sparkles-outline"}
|
|
34
|
+
size="xl"
|
|
35
|
+
color="textInverse"
|
|
36
|
+
/>
|
|
37
|
+
</View>
|
|
38
|
+
<AtomicText type="headlineSmall" color="textInverse" style={styles.title}>
|
|
39
|
+
{title}
|
|
40
|
+
</AtomicText>
|
|
41
|
+
<AtomicText type="bodyMedium" color="textInverse" style={styles.subtitle}>
|
|
42
|
+
{subtitle}
|
|
43
|
+
</AtomicText>
|
|
44
|
+
</LinearGradient>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const styles = StyleSheet.create({
|
|
49
|
+
container: {
|
|
50
|
+
borderRadius: 16,
|
|
51
|
+
padding: 24,
|
|
52
|
+
alignItems: "center",
|
|
53
|
+
marginBottom: 24,
|
|
54
|
+
},
|
|
55
|
+
iconContainer: {
|
|
56
|
+
marginBottom: 12,
|
|
57
|
+
},
|
|
58
|
+
title: {
|
|
59
|
+
fontWeight: "700",
|
|
60
|
+
textAlign: "center",
|
|
61
|
+
marginBottom: 8,
|
|
62
|
+
},
|
|
63
|
+
subtitle: {
|
|
64
|
+
textAlign: "center",
|
|
65
|
+
opacity: 0.9,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HintCarousel Component
|
|
3
|
+
* Single Responsibility: Display scrollable hint images for inspiration
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from "react";
|
|
7
|
+
import {
|
|
8
|
+
View,
|
|
9
|
+
ScrollView,
|
|
10
|
+
TouchableOpacity,
|
|
11
|
+
Image,
|
|
12
|
+
StyleSheet,
|
|
13
|
+
} from "react-native";
|
|
14
|
+
import {
|
|
15
|
+
AtomicIcon,
|
|
16
|
+
useAppDesignTokens,
|
|
17
|
+
} from "@umituz/react-native-design-system";
|
|
18
|
+
import type { HintCarouselProps } from "../../domain/types";
|
|
19
|
+
|
|
20
|
+
export const HintCarousel: React.FC<HintCarouselProps> = ({
|
|
21
|
+
hints,
|
|
22
|
+
onHintSelect,
|
|
23
|
+
onRefresh,
|
|
24
|
+
style,
|
|
25
|
+
}) => {
|
|
26
|
+
const tokens = useAppDesignTokens();
|
|
27
|
+
|
|
28
|
+
if (hints.length === 0) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<View style={[styles.container, style]}>
|
|
34
|
+
<ScrollView
|
|
35
|
+
horizontal
|
|
36
|
+
showsHorizontalScrollIndicator={false}
|
|
37
|
+
contentContainerStyle={styles.scrollContent}
|
|
38
|
+
>
|
|
39
|
+
{hints.map((hint) => (
|
|
40
|
+
<TouchableOpacity
|
|
41
|
+
key={hint.id}
|
|
42
|
+
style={[
|
|
43
|
+
styles.hintItem,
|
|
44
|
+
{ backgroundColor: tokens.colors.surface },
|
|
45
|
+
]}
|
|
46
|
+
onPress={() => onHintSelect(hint)}
|
|
47
|
+
>
|
|
48
|
+
<Image
|
|
49
|
+
source={{ uri: hint.imageUrl }}
|
|
50
|
+
style={styles.hintImage}
|
|
51
|
+
resizeMode="cover"
|
|
52
|
+
/>
|
|
53
|
+
</TouchableOpacity>
|
|
54
|
+
))}
|
|
55
|
+
{onRefresh && (
|
|
56
|
+
<TouchableOpacity
|
|
57
|
+
style={[
|
|
58
|
+
styles.refreshButton,
|
|
59
|
+
{ backgroundColor: tokens.colors.surface },
|
|
60
|
+
]}
|
|
61
|
+
onPress={onRefresh}
|
|
62
|
+
>
|
|
63
|
+
<AtomicIcon name="refresh-outline" size="md" color="primary" />
|
|
64
|
+
</TouchableOpacity>
|
|
65
|
+
)}
|
|
66
|
+
</ScrollView>
|
|
67
|
+
</View>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const styles = StyleSheet.create({
|
|
72
|
+
container: {
|
|
73
|
+
marginBottom: 24,
|
|
74
|
+
},
|
|
75
|
+
scrollContent: {
|
|
76
|
+
paddingHorizontal: 4,
|
|
77
|
+
gap: 12,
|
|
78
|
+
},
|
|
79
|
+
hintItem: {
|
|
80
|
+
width: 80,
|
|
81
|
+
height: 80,
|
|
82
|
+
borderRadius: 12,
|
|
83
|
+
overflow: "hidden",
|
|
84
|
+
},
|
|
85
|
+
hintImage: {
|
|
86
|
+
width: "100%",
|
|
87
|
+
height: "100%",
|
|
88
|
+
},
|
|
89
|
+
refreshButton: {
|
|
90
|
+
width: 80,
|
|
91
|
+
height: 80,
|
|
92
|
+
borderRadius: 12,
|
|
93
|
+
alignItems: "center",
|
|
94
|
+
justifyContent: "center",
|
|
95
|
+
},
|
|
96
|
+
});
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OptionsPanel Component
|
|
3
|
+
* Single Responsibility: Display toggleable options for video generation
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { View, StyleSheet, Switch, TouchableOpacity } from "react-native";
|
|
8
|
+
import {
|
|
9
|
+
AtomicText,
|
|
10
|
+
useAppDesignTokens,
|
|
11
|
+
} from "@umituz/react-native-design-system";
|
|
12
|
+
import type { OptionsPanelProps } from "../../domain/types";
|
|
13
|
+
|
|
14
|
+
export const OptionsPanel: React.FC<OptionsPanelProps> = ({
|
|
15
|
+
soundEnabled,
|
|
16
|
+
onSoundToggle,
|
|
17
|
+
professionalMode,
|
|
18
|
+
onProfessionalModeToggle,
|
|
19
|
+
duration,
|
|
20
|
+
soundLabel,
|
|
21
|
+
soundBadge,
|
|
22
|
+
professionalLabel,
|
|
23
|
+
style,
|
|
24
|
+
}) => {
|
|
25
|
+
const tokens = useAppDesignTokens();
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<View style={[styles.container, style]}>
|
|
29
|
+
<View style={styles.row}>
|
|
30
|
+
<View style={styles.labelContainer}>
|
|
31
|
+
<AtomicText type="labelMedium" style={styles.label}>
|
|
32
|
+
{soundLabel}
|
|
33
|
+
</AtomicText>
|
|
34
|
+
{soundBadge && (
|
|
35
|
+
<View
|
|
36
|
+
style={[styles.badge, { backgroundColor: tokens.colors.success }]}
|
|
37
|
+
>
|
|
38
|
+
<AtomicText type="labelSmall" style={styles.badgeText}>
|
|
39
|
+
{soundBadge}
|
|
40
|
+
</AtomicText>
|
|
41
|
+
</View>
|
|
42
|
+
)}
|
|
43
|
+
</View>
|
|
44
|
+
<Switch
|
|
45
|
+
value={soundEnabled}
|
|
46
|
+
onValueChange={onSoundToggle}
|
|
47
|
+
trackColor={{
|
|
48
|
+
false: tokens.colors.surface,
|
|
49
|
+
true: tokens.colors.success,
|
|
50
|
+
}}
|
|
51
|
+
/>
|
|
52
|
+
</View>
|
|
53
|
+
|
|
54
|
+
<View style={styles.controlsRow}>
|
|
55
|
+
<TouchableOpacity
|
|
56
|
+
style={[
|
|
57
|
+
styles.controlButton,
|
|
58
|
+
professionalMode && { backgroundColor: tokens.colors.surface },
|
|
59
|
+
]}
|
|
60
|
+
onPress={() => onProfessionalModeToggle(!professionalMode)}
|
|
61
|
+
>
|
|
62
|
+
<AtomicText
|
|
63
|
+
type="labelMedium"
|
|
64
|
+
color={professionalMode ? "textPrimary" : "textSecondary"}
|
|
65
|
+
>
|
|
66
|
+
{professionalLabel}
|
|
67
|
+
</AtomicText>
|
|
68
|
+
</TouchableOpacity>
|
|
69
|
+
|
|
70
|
+
<TouchableOpacity style={[styles.controlButton, styles.durationButton]}>
|
|
71
|
+
<AtomicText type="labelMedium" color="textSecondary">
|
|
72
|
+
{duration}s
|
|
73
|
+
</AtomicText>
|
|
74
|
+
</TouchableOpacity>
|
|
75
|
+
</View>
|
|
76
|
+
</View>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const styles = StyleSheet.create({
|
|
81
|
+
container: {
|
|
82
|
+
marginBottom: 24,
|
|
83
|
+
gap: 16,
|
|
84
|
+
},
|
|
85
|
+
row: {
|
|
86
|
+
flexDirection: "row",
|
|
87
|
+
alignItems: "center",
|
|
88
|
+
justifyContent: "space-between",
|
|
89
|
+
},
|
|
90
|
+
labelContainer: {
|
|
91
|
+
flexDirection: "row",
|
|
92
|
+
alignItems: "center",
|
|
93
|
+
gap: 8,
|
|
94
|
+
},
|
|
95
|
+
label: {
|
|
96
|
+
fontWeight: "600",
|
|
97
|
+
},
|
|
98
|
+
badge: {
|
|
99
|
+
paddingHorizontal: 8,
|
|
100
|
+
paddingVertical: 2,
|
|
101
|
+
borderRadius: 4,
|
|
102
|
+
},
|
|
103
|
+
badgeText: {
|
|
104
|
+
color: "#000",
|
|
105
|
+
fontWeight: "bold",
|
|
106
|
+
fontSize: 10,
|
|
107
|
+
},
|
|
108
|
+
controlsRow: {
|
|
109
|
+
flexDirection: "row",
|
|
110
|
+
gap: 12,
|
|
111
|
+
},
|
|
112
|
+
controlButton: {
|
|
113
|
+
paddingHorizontal: 16,
|
|
114
|
+
paddingVertical: 10,
|
|
115
|
+
borderRadius: 8,
|
|
116
|
+
backgroundColor: "rgba(255, 255, 255, 0.05)",
|
|
117
|
+
alignItems: "center",
|
|
118
|
+
justifyContent: "center",
|
|
119
|
+
},
|
|
120
|
+
durationButton: {
|
|
121
|
+
minWidth: 60,
|
|
122
|
+
},
|
|
123
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text-to-Video Presentation Components
|
|
3
|
+
* Single Responsibility: Export all components
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export { GenerationTabs } from "./GenerationTabs";
|
|
7
|
+
export { FrameSelector } from "./FrameSelector";
|
|
8
|
+
export { OptionsPanel } from "./OptionsPanel";
|
|
9
|
+
export { HeroSection } from "./HeroSection";
|
|
10
|
+
export { HintCarousel } from "./HintCarousel";
|
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text-to-Video Presentation Hooks
|
|
3
|
+
* Single Responsibility: Export all hooks
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
export { useTextToVideoFeature } from "./useTextToVideoFeature";
|
|
2
7
|
export type {
|
|
3
8
|
UseTextToVideoFeatureProps,
|
|
4
9
|
UseTextToVideoFeatureReturn,
|
|
5
10
|
} from "./useTextToVideoFeature";
|
|
11
|
+
|
|
12
|
+
export { useTextToVideoForm } from "./useTextToVideoForm";
|
|
13
|
+
export type {
|
|
14
|
+
UseTextToVideoFormProps,
|
|
15
|
+
UseTextToVideoFormReturn,
|
|
16
|
+
} from "./useTextToVideoForm";
|