@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.
Files changed (44) hide show
  1. package/package.json +1 -1
  2. package/src/domains/creations/domain/types/creation-filter.ts +1 -3
  3. package/src/domains/creations/domain/value-objects/CreationsConfig.ts +12 -0
  4. package/src/domains/creations/presentation/components/FilterSheets.tsx +63 -0
  5. package/src/domains/creations/presentation/components/GalleryHeader.tsx +95 -93
  6. package/src/domains/creations/presentation/components/index.ts +1 -0
  7. package/src/domains/creations/presentation/hooks/index.ts +3 -0
  8. package/src/domains/creations/presentation/hooks/useCreationsFilter.ts +35 -48
  9. package/src/domains/creations/presentation/hooks/useGalleryFilters.ts +78 -0
  10. package/src/domains/creations/presentation/hooks/useMediaFilter.ts +54 -0
  11. package/src/domains/creations/presentation/hooks/useStatusFilter.ts +54 -0
  12. package/src/domains/creations/presentation/screens/CreationsGalleryScreen.tsx +81 -156
  13. package/src/features/image-to-video/index.ts +90 -3
  14. package/src/features/image-to-video/presentation/components/AnimationStyleSelector.tsx +135 -0
  15. package/src/features/image-to-video/presentation/components/DurationSelector.tsx +110 -0
  16. package/src/features/image-to-video/presentation/components/GenerateButton.tsx +95 -0
  17. package/src/features/image-to-video/presentation/components/HeroSection.tsx +89 -0
  18. package/src/features/image-to-video/presentation/components/ImageSelectionGrid.tsx +234 -0
  19. package/src/features/image-to-video/presentation/components/MusicMoodSelector.tsx +181 -0
  20. package/src/features/image-to-video/presentation/components/index.ts +30 -0
  21. package/src/features/image-to-video/presentation/hooks/index.ts +22 -0
  22. package/src/features/image-to-video/presentation/hooks/useFormState.ts +116 -0
  23. package/src/features/image-to-video/presentation/hooks/useGeneration.ts +85 -0
  24. package/src/features/image-to-video/presentation/hooks/useImageToVideoForm.ts +93 -0
  25. package/src/features/image-to-video/presentation/index.ts +4 -0
  26. package/src/features/text-to-video/domain/types/callback.types.ts +50 -0
  27. package/src/features/text-to-video/domain/types/component.types.ts +106 -0
  28. package/src/features/text-to-video/domain/types/config.types.ts +61 -0
  29. package/src/features/text-to-video/domain/types/index.ts +48 -4
  30. package/src/features/text-to-video/domain/types/request.types.ts +36 -0
  31. package/src/features/text-to-video/domain/types/state.types.ts +53 -0
  32. package/src/features/text-to-video/index.ts +41 -3
  33. package/src/features/text-to-video/infrastructure/services/text-to-video-executor.ts +1 -1
  34. package/src/features/text-to-video/presentation/components/FrameSelector.tsx +153 -0
  35. package/src/features/text-to-video/presentation/components/GenerationTabs.tsx +73 -0
  36. package/src/features/text-to-video/presentation/components/HeroSection.tsx +67 -0
  37. package/src/features/text-to-video/presentation/components/HintCarousel.tsx +96 -0
  38. package/src/features/text-to-video/presentation/components/OptionsPanel.tsx +123 -0
  39. package/src/features/text-to-video/presentation/components/index.ts +10 -0
  40. package/src/features/text-to-video/presentation/hooks/index.ts +11 -0
  41. package/src/features/text-to-video/presentation/hooks/useTextToVideoFeature.ts +77 -20
  42. package/src/features/text-to-video/presentation/hooks/useTextToVideoForm.ts +134 -0
  43. package/src/features/text-to-video/presentation/index.ts +6 -0
  44. package/src/features/text-to-video/domain/types/text-to-video.types.ts +0 -65
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Form State Hook for Image-to-Video
3
+ * Manages form state with actions
4
+ */
5
+
6
+ import { useState, useCallback, useMemo } from "react";
7
+ import type {
8
+ ImageToVideoFormState,
9
+ ImageToVideoFormActions,
10
+ ImageToVideoFormDefaults,
11
+ AnimationStyleId,
12
+ MusicMoodId,
13
+ VideoDuration,
14
+ } from "../../domain/types";
15
+ import {
16
+ DEFAULT_ANIMATION_STYLE_ID,
17
+ DEFAULT_MUSIC_MOOD_ID,
18
+ DEFAULT_VIDEO_DURATION,
19
+ } from "../../domain/constants";
20
+
21
+ export interface UseFormStateOptions {
22
+ defaults?: ImageToVideoFormDefaults;
23
+ }
24
+
25
+ export interface UseFormStateReturn {
26
+ state: ImageToVideoFormState;
27
+ actions: ImageToVideoFormActions;
28
+ }
29
+
30
+ function createInitialState(defaults?: ImageToVideoFormDefaults): ImageToVideoFormState {
31
+ return {
32
+ selectedImages: [],
33
+ animationStyle: defaults?.animationStyle ?? DEFAULT_ANIMATION_STYLE_ID,
34
+ duration: defaults?.duration ?? DEFAULT_VIDEO_DURATION,
35
+ musicMood: defaults?.musicMood ?? DEFAULT_MUSIC_MOOD_ID,
36
+ customAudioUri: null,
37
+ motionPrompt: "",
38
+ };
39
+ }
40
+
41
+ export function useFormState(options?: UseFormStateOptions): UseFormStateReturn {
42
+ const { defaults } = options ?? {};
43
+
44
+ const [state, setState] = useState<ImageToVideoFormState>(() =>
45
+ createInitialState(defaults)
46
+ );
47
+
48
+ const setSelectedImages = useCallback((images: string[]) => {
49
+ setState((prev) => ({ ...prev, selectedImages: images }));
50
+ }, []);
51
+
52
+ const addImages = useCallback((images: string[]) => {
53
+ setState((prev) => ({
54
+ ...prev,
55
+ selectedImages: [...prev.selectedImages, ...images],
56
+ }));
57
+ }, []);
58
+
59
+ const removeImage = useCallback((index: number) => {
60
+ setState((prev) => ({
61
+ ...prev,
62
+ selectedImages: prev.selectedImages.filter((_, i) => i !== index),
63
+ }));
64
+ }, []);
65
+
66
+ const setAnimationStyle = useCallback((style: AnimationStyleId) => {
67
+ setState((prev) => ({ ...prev, animationStyle: style }));
68
+ }, []);
69
+
70
+ const setDuration = useCallback((duration: VideoDuration) => {
71
+ setState((prev) => ({ ...prev, duration }));
72
+ }, []);
73
+
74
+ const setMusicMood = useCallback((mood: MusicMoodId) => {
75
+ setState((prev) => ({ ...prev, musicMood: mood }));
76
+ }, []);
77
+
78
+ const setCustomAudioUri = useCallback((uri: string | null) => {
79
+ setState((prev) => ({ ...prev, customAudioUri: uri }));
80
+ }, []);
81
+
82
+ const setMotionPrompt = useCallback((prompt: string) => {
83
+ setState((prev) => ({ ...prev, motionPrompt: prompt }));
84
+ }, []);
85
+
86
+ const reset = useCallback(() => {
87
+ setState(createInitialState(defaults));
88
+ }, [defaults]);
89
+
90
+ const actions = useMemo<ImageToVideoFormActions>(
91
+ () => ({
92
+ setSelectedImages,
93
+ addImages,
94
+ removeImage,
95
+ setAnimationStyle,
96
+ setDuration,
97
+ setMusicMood,
98
+ setCustomAudioUri,
99
+ setMotionPrompt,
100
+ reset,
101
+ }),
102
+ [
103
+ setSelectedImages,
104
+ addImages,
105
+ removeImage,
106
+ setAnimationStyle,
107
+ setDuration,
108
+ setMusicMood,
109
+ setCustomAudioUri,
110
+ setMotionPrompt,
111
+ reset,
112
+ ]
113
+ );
114
+
115
+ return { state, actions };
116
+ }
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Generation Hook for Image-to-Video
3
+ * Manages generation state and execution
4
+ */
5
+
6
+ import { useState, useCallback, useMemo } from "react";
7
+ import type {
8
+ ImageToVideoFormState,
9
+ ImageToVideoGenerationState,
10
+ ImageToVideoCallbacks,
11
+ } from "../../domain/types";
12
+
13
+ export interface UseGenerationOptions {
14
+ formState: ImageToVideoFormState;
15
+ callbacks: ImageToVideoCallbacks;
16
+ }
17
+
18
+ export interface UseGenerationReturn {
19
+ generationState: ImageToVideoGenerationState;
20
+ handleGenerate: () => Promise<void>;
21
+ setProgress: (progress: number) => void;
22
+ setError: (error: string | null) => void;
23
+ isReady: boolean;
24
+ }
25
+
26
+ const INITIAL_GENERATION_STATE: ImageToVideoGenerationState = {
27
+ isGenerating: false,
28
+ progress: 0,
29
+ error: null,
30
+ };
31
+
32
+ export function useGeneration(options: UseGenerationOptions): UseGenerationReturn {
33
+ const { formState, callbacks } = options;
34
+
35
+ const [generationState, setGenerationState] = useState<ImageToVideoGenerationState>(
36
+ INITIAL_GENERATION_STATE
37
+ );
38
+
39
+ const setProgress = useCallback((progress: number) => {
40
+ setGenerationState((prev) => ({ ...prev, progress }));
41
+ }, []);
42
+
43
+ const setError = useCallback((error: string | null) => {
44
+ setGenerationState((prev) => ({ ...prev, error, isGenerating: false }));
45
+ }, []);
46
+
47
+ const handleGenerate = useCallback(async () => {
48
+ if (formState.selectedImages.length === 0) {
49
+ callbacks.onError?.("No images selected");
50
+ return;
51
+ }
52
+
53
+ setGenerationState({
54
+ isGenerating: true,
55
+ progress: 0,
56
+ error: null,
57
+ });
58
+
59
+ try {
60
+ await callbacks.onGenerate(formState);
61
+ setGenerationState((prev) => ({ ...prev, isGenerating: false, progress: 100 }));
62
+ } catch (error) {
63
+ const errorMessage = error instanceof Error ? error.message : String(error);
64
+ setGenerationState({
65
+ isGenerating: false,
66
+ progress: 0,
67
+ error: errorMessage,
68
+ });
69
+ callbacks.onError?.(errorMessage);
70
+ }
71
+ }, [formState, callbacks]);
72
+
73
+ const isReady = useMemo(
74
+ () => formState.selectedImages.length > 0 && !generationState.isGenerating,
75
+ [formState.selectedImages.length, generationState.isGenerating]
76
+ );
77
+
78
+ return {
79
+ generationState,
80
+ handleGenerate,
81
+ setProgress,
82
+ setError,
83
+ isReady,
84
+ };
85
+ }
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Image-to-Video Form Hook
3
+ * Composes form state and generation for complete form management
4
+ */
5
+
6
+ import { useMemo, useCallback } from "react";
7
+ import { useFormState, type UseFormStateOptions } from "./useFormState";
8
+ import { useGeneration } from "./useGeneration";
9
+ import type {
10
+ ImageToVideoFormState,
11
+ ImageToVideoFormActions,
12
+ ImageToVideoGenerationState,
13
+ ImageToVideoCallbacks,
14
+ MusicMoodId,
15
+ } from "../../domain/types";
16
+
17
+ export interface UseImageToVideoFormOptions extends UseFormStateOptions {
18
+ callbacks: ImageToVideoCallbacks;
19
+ }
20
+
21
+ export interface UseImageToVideoFormReturn {
22
+ state: ImageToVideoFormState;
23
+ actions: ImageToVideoFormActions;
24
+ generationState: ImageToVideoGenerationState;
25
+ handleGenerate: () => Promise<void>;
26
+ handleMusicSelect: (moodId: MusicMoodId) => void;
27
+ handleSelectImages: () => Promise<void>;
28
+ isReady: boolean;
29
+ }
30
+
31
+ export function useImageToVideoForm(
32
+ options: UseImageToVideoFormOptions
33
+ ): UseImageToVideoFormReturn {
34
+ const { callbacks, defaults } = options;
35
+
36
+ const { state, actions } = useFormState({ defaults });
37
+
38
+ const { generationState, handleGenerate, isReady } = useGeneration({
39
+ formState: state,
40
+ callbacks,
41
+ });
42
+
43
+ const handleMusicSelect = useCallback(
44
+ (moodId: MusicMoodId) => {
45
+ if (moodId === "custom" && callbacks.onSelectCustomAudio) {
46
+ callbacks.onSelectCustomAudio().then((uri) => {
47
+ if (uri) {
48
+ actions.setCustomAudioUri(uri);
49
+ actions.setMusicMood("custom");
50
+ }
51
+ });
52
+ } else {
53
+ actions.setMusicMood(moodId);
54
+ if (moodId !== "custom") {
55
+ actions.setCustomAudioUri(null);
56
+ }
57
+ }
58
+ },
59
+ [callbacks, actions]
60
+ );
61
+
62
+ const handleSelectImages = useCallback(async () => {
63
+ if (callbacks.onSelectImages) {
64
+ const images = await callbacks.onSelectImages();
65
+ if (images.length > 0) {
66
+ actions.addImages(images);
67
+ }
68
+ }
69
+ }, [callbacks, actions]);
70
+
71
+ const formReturn = useMemo<UseImageToVideoFormReturn>(
72
+ () => ({
73
+ state,
74
+ actions,
75
+ generationState,
76
+ handleGenerate,
77
+ handleMusicSelect,
78
+ handleSelectImages,
79
+ isReady,
80
+ }),
81
+ [
82
+ state,
83
+ actions,
84
+ generationState,
85
+ handleGenerate,
86
+ handleMusicSelect,
87
+ handleSelectImages,
88
+ isReady,
89
+ ]
90
+ );
91
+
92
+ return formReturn;
93
+ }
@@ -1 +1,5 @@
1
+ // Hooks
1
2
  export * from "./hooks";
3
+
4
+ // Components
5
+ export * from "./components";
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Text-to-Video Callback Types
3
+ * Single Responsibility: Define callback function signatures
4
+ */
5
+
6
+ import type { TextToVideoResult } from "./request.types";
7
+
8
+ export interface ModerationResult {
9
+ isAllowed: boolean;
10
+ warnings: string[];
11
+ }
12
+
13
+ export interface ProjectData {
14
+ videoUrl: string;
15
+ thumbnailUrl?: string;
16
+ prompt: string;
17
+ aspectRatio: string;
18
+ duration: number;
19
+ style: string;
20
+ }
21
+
22
+ export interface TextToVideoCallbacks {
23
+ onCreditCheck?: (cost: number) => boolean;
24
+ onAuthCheck?: () => boolean;
25
+ onModeration?: (prompt: string) => Promise<ModerationResult>;
26
+ onProjectCreate?: (data: ProjectData) => Promise<void>;
27
+ onGenerate?: (result: TextToVideoResult) => void;
28
+ onError?: (error: string) => void;
29
+ onProgress?: (progress: number) => void;
30
+ onPromptChange?: (prompt: string) => void;
31
+ onStyleChange?: (style: string) => void;
32
+ onTabChange?: (tab: string) => void;
33
+ onShowPaywall?: (cost: number) => void;
34
+ onShowModerationWarning?: (
35
+ warnings: string[],
36
+ onCancel: () => void,
37
+ onProceed: () => void,
38
+ ) => void;
39
+ onNavigateToProjects?: () => void;
40
+ onNavigateToEditor?: (videoUrl: string) => void;
41
+ }
42
+
43
+ export interface TextToVideoTranslations {
44
+ promptPlaceholder: string;
45
+ generateButtonText: string;
46
+ processingText: string;
47
+ successText: string;
48
+ missingPromptTitle: string;
49
+ missingPromptMessage: string;
50
+ }
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Text-to-Video Component Prop Types
3
+ * Single Responsibility: Define component prop interfaces
4
+ */
5
+
6
+ import type { ViewStyle } from "react-native";
7
+ import type { FrameData } from "./state.types";
8
+ import type { TabConfig, StyleOption, AspectRatioOption, DurationOption } from "./config.types";
9
+
10
+ export interface GenerationTabsProps {
11
+ tabs: TabConfig[];
12
+ activeTab: string;
13
+ onTabChange: (tabId: string) => void;
14
+ getLabel: (key: string) => string;
15
+ style?: ViewStyle;
16
+ }
17
+
18
+ export interface FrameSelectorProps {
19
+ frames: FrameData[];
20
+ onFrameChange: (index: number) => void;
21
+ onFrameDelete: (index: number) => void;
22
+ startLabel: string;
23
+ endLabel: string;
24
+ changeLabel: string;
25
+ deleteLabel: string;
26
+ style?: ViewStyle;
27
+ }
28
+
29
+ export interface OptionsPanelProps {
30
+ soundEnabled: boolean;
31
+ onSoundToggle: (value: boolean) => void;
32
+ professionalMode: boolean;
33
+ onProfessionalModeToggle: (value: boolean) => void;
34
+ duration: number;
35
+ soundLabel: string;
36
+ soundBadge?: string;
37
+ professionalLabel: string;
38
+ style?: ViewStyle;
39
+ }
40
+
41
+ export interface HeroSectionProps {
42
+ title: string;
43
+ subtitle: string;
44
+ icon?: string;
45
+ style?: ViewStyle;
46
+ }
47
+
48
+ export interface HintCarouselProps {
49
+ hints: HintItem[];
50
+ onHintSelect: (hint: HintItem) => void;
51
+ onRefresh?: () => void;
52
+ style?: ViewStyle;
53
+ }
54
+
55
+ export interface HintItem {
56
+ id: string;
57
+ imageUrl: string;
58
+ prompt?: string;
59
+ }
60
+
61
+ export interface StyleSelectorProps {
62
+ styles: StyleOption[];
63
+ selectedStyle: string;
64
+ onStyleSelect: (styleId: string) => void;
65
+ getLabel: (key: string) => string;
66
+ title: string;
67
+ style?: ViewStyle;
68
+ }
69
+
70
+ export interface AspectRatioSelectorProps {
71
+ ratios: AspectRatioOption[];
72
+ selectedRatio: string;
73
+ onRatioSelect: (ratioId: string) => void;
74
+ getLabel: (key: string) => string;
75
+ style?: ViewStyle;
76
+ }
77
+
78
+ export interface DurationSelectorProps {
79
+ durations: DurationOption[];
80
+ selectedDuration: number;
81
+ onDurationSelect: (duration: number) => void;
82
+ getLabel: (key: string) => string;
83
+ style?: ViewStyle;
84
+ }
85
+
86
+ export interface GenerateButtonProps {
87
+ isGenerating: boolean;
88
+ isDisabled: boolean;
89
+ onPress: () => void;
90
+ credits?: number;
91
+ label: string;
92
+ generatingLabel: string;
93
+ style?: ViewStyle;
94
+ }
95
+
96
+ export interface ExamplePromptsProps {
97
+ prompts: ExamplePrompt[];
98
+ onPromptSelect: (prompt: string) => void;
99
+ style?: ViewStyle;
100
+ }
101
+
102
+ export interface ExamplePrompt {
103
+ id: string;
104
+ text: string;
105
+ emoji?: string;
106
+ }
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Text-to-Video Configuration Types
3
+ * Single Responsibility: Define configuration interfaces for flexibility
4
+ */
5
+
6
+ export interface TabConfig {
7
+ id: string;
8
+ labelKey: string;
9
+ }
10
+
11
+ export interface VideoStyleOption {
12
+ id: string;
13
+ nameKey: string;
14
+ descriptionKey?: string;
15
+ thumbnail?: string;
16
+ }
17
+
18
+ export interface AspectRatioOption {
19
+ id: string;
20
+ value: string;
21
+ labelKey: string;
22
+ icon?: string;
23
+ }
24
+
25
+ export interface VideoDurationOption {
26
+ value: number;
27
+ labelKey: string;
28
+ }
29
+
30
+ export interface OptionToggleConfig {
31
+ id: string;
32
+ labelKey: string;
33
+ badgeKey?: string;
34
+ defaultValue?: boolean;
35
+ }
36
+
37
+ export interface TextToVideoConfig {
38
+ model: string;
39
+ creditCost: number;
40
+ maxPromptLength?: number;
41
+ enableFrames?: boolean;
42
+ enableHints?: boolean;
43
+ enableSound?: boolean;
44
+ enableProfessionalMode?: boolean;
45
+ tabs?: TabConfig[];
46
+ styles?: StyleOption[];
47
+ aspectRatios?: AspectRatioOption[];
48
+ durations?: DurationOption[];
49
+ options?: OptionToggleConfig[];
50
+ }
51
+
52
+ export interface HeroConfig {
53
+ titleKey: string;
54
+ subtitleKey: string;
55
+ icon?: string;
56
+ }
57
+
58
+ export interface ProgressConfig {
59
+ titleKey: string;
60
+ hintKey: string;
61
+ }
@@ -1,10 +1,54 @@
1
+ /**
2
+ * Text-to-Video Domain Types
3
+ * Single Responsibility: Export all domain types
4
+ */
5
+
1
6
  export type {
2
7
  TextToVideoOptions,
3
8
  TextToVideoRequest,
4
9
  TextToVideoResult,
5
- TextToVideoFeatureState,
6
- TextToVideoTranslations,
7
10
  TextToVideoInputBuilder,
8
11
  TextToVideoResultExtractor,
9
- TextToVideoFeatureConfig,
10
- } from "./text-to-video.types";
12
+ } from "./request.types";
13
+
14
+ export type {
15
+ TextToVideoFeatureState,
16
+ TextToVideoFormState,
17
+ TextToVideoGenerationState,
18
+ FrameData,
19
+ } from "./state.types";
20
+
21
+ export { INITIAL_FORM_STATE, INITIAL_GENERATION_STATE } from "./state.types";
22
+
23
+ export type {
24
+ TabConfig,
25
+ StyleOption,
26
+ AspectRatioOption,
27
+ DurationOption,
28
+ OptionToggleConfig,
29
+ TextToVideoConfig,
30
+ HeroConfig,
31
+ ProgressConfig,
32
+ } from "./config.types";
33
+
34
+ export type {
35
+ ModerationResult,
36
+ ProjectData,
37
+ TextToVideoCallbacks,
38
+ TextToVideoTranslations,
39
+ } from "./callback.types";
40
+
41
+ export type {
42
+ GenerationTabsProps,
43
+ FrameSelectorProps,
44
+ OptionsPanelProps,
45
+ HeroSectionProps,
46
+ HintCarouselProps,
47
+ HintItem,
48
+ StyleSelectorProps,
49
+ AspectRatioSelectorProps,
50
+ DurationSelectorProps,
51
+ GenerateButtonProps,
52
+ ExamplePromptsProps,
53
+ ExamplePrompt,
54
+ } from "./component.types";
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Text-to-Video Request/Response Types
3
+ * Single Responsibility: Define API request and response structures
4
+ */
5
+
6
+ export interface TextToVideoOptions {
7
+ duration?: number;
8
+ fps?: number;
9
+ guidanceScale?: number;
10
+ aspectRatio?: "16:9" | "9:16" | "1:1";
11
+ style?: string;
12
+ negativePrompt?: string;
13
+ }
14
+
15
+ export interface TextToVideoRequest {
16
+ prompt: string;
17
+ userId: string;
18
+ options?: TextToVideoOptions;
19
+ }
20
+
21
+ export interface TextToVideoResult {
22
+ success: boolean;
23
+ videoUrl?: string;
24
+ thumbnailUrl?: string;
25
+ error?: string;
26
+ requestId?: string;
27
+ }
28
+
29
+ export type TextToVideoInputBuilder = (
30
+ prompt: string,
31
+ options?: TextToVideoOptions,
32
+ ) => Record<string, unknown>;
33
+
34
+ export type TextToVideoResultExtractor = (
35
+ result: unknown,
36
+ ) => { videoUrl?: string; thumbnailUrl?: string } | undefined;
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Text-to-Video Feature State Types
3
+ * Single Responsibility: Define internal state structures
4
+ */
5
+
6
+ export interface TextToVideoFeatureState {
7
+ prompt: string;
8
+ videoUrl: string | null;
9
+ thumbnailUrl: string | null;
10
+ isProcessing: boolean;
11
+ progress: number;
12
+ error: string | null;
13
+ }
14
+
15
+ export interface TextToVideoFormState {
16
+ prompt: string;
17
+ style: string;
18
+ aspectRatio: string;
19
+ duration: number;
20
+ activeTab: string;
21
+ soundEnabled: boolean;
22
+ professionalMode: boolean;
23
+ }
24
+
25
+ export interface TextToVideoGenerationState {
26
+ isGenerating: boolean;
27
+ progress: number;
28
+ contentWarnings: string[];
29
+ error: string | null;
30
+ }
31
+
32
+ export interface FrameData {
33
+ id: string;
34
+ url: string;
35
+ order: number;
36
+ }
37
+
38
+ export const INITIAL_FORM_STATE: TextToVideoFormState = {
39
+ prompt: "",
40
+ style: "realistic",
41
+ aspectRatio: "16:9",
42
+ duration: 4,
43
+ activeTab: "text-to-video",
44
+ soundEnabled: false,
45
+ professionalMode: false,
46
+ };
47
+
48
+ export const INITIAL_GENERATION_STATE: TextToVideoGenerationState = {
49
+ isGenerating: false,
50
+ progress: 0,
51
+ contentWarnings: [],
52
+ error: null,
53
+ };