@umituz/react-native-ai-generation-content 1.17.55 → 1.17.56

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-ai-generation-content",
3
- "version": "1.17.55",
3
+ "version": "1.17.56",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -1,30 +1,47 @@
1
- import React from "react";
1
+ import React, { PropsWithChildren } from "react";
2
2
  import { StyleSelector } from "./selectors/StyleSelector";
3
3
  import { DurationSelector } from "./selectors/DurationSelector";
4
+ import { AspectRatioSelector } from "./selectors/AspectRatioSelector";
4
5
  import { PromptInput } from "./PromptInput";
5
6
  import { GenerateButton } from "./buttons/GenerateButton";
7
+ import { ExamplePrompts } from "./prompts/ExamplePrompts";
6
8
  import type { StyleOption } from "./selectors/types";
9
+ import type { AspectRatioOption } from "./selectors/types";
7
10
 
8
11
  export interface AIGenerationFormTranslations {
9
12
  promptTitle: string;
10
13
  promptPlaceholder: string;
11
- styleTitle: string;
12
- durationTitle: string;
14
+ styleTitle?: string;
15
+ durationTitle?: string;
16
+ aspectRatioTitle?: string;
17
+ examplePromptsTitle?: string;
13
18
  generateButton: string;
14
19
  generatingButton: string;
15
20
  }
16
21
 
17
- export interface AIGenerationFormProps {
22
+ export interface AIGenerationFormProps extends PropsWithChildren {
18
23
  prompt: string;
19
24
  onPromptChange: (text: string) => void;
20
25
 
21
- styles: StyleOption[];
22
- selectedStyle: string;
23
- onStyleSelect: (styleId: string) => void;
26
+ // Optional: Example Prompts
27
+ examplePrompts?: readonly string[];
28
+ onExamplePromptSelect?: (prompt: string) => void;
24
29
 
25
- duration: number;
26
- durationOptions: readonly number[];
27
- onDurationSelect: (duration: number) => void;
30
+ // Optional: Style Selection
31
+ styles?: StyleOption[];
32
+ selectedStyle?: string;
33
+ onStyleSelect?: (styleId: string) => void;
34
+
35
+ // Optional: Duration Selection
36
+ duration?: number;
37
+ durationOptions?: readonly number[];
38
+ onDurationSelect?: (duration: number) => void;
39
+ formatDurationLabel?: (duration: number) => string;
40
+
41
+ // Optional: Aspect Ratio Selection
42
+ aspectRatios?: AspectRatioOption[];
43
+ selectedAspectRatio?: string;
44
+ onAspectRatioSelect?: (ratio: string) => void;
28
45
 
29
46
  onGenerate: () => void;
30
47
  isGenerating: boolean;
@@ -36,6 +53,9 @@ export const AIGenerationForm: React.FC<AIGenerationFormProps> = ({
36
53
  prompt,
37
54
  onPromptChange,
38
55
 
56
+ examplePrompts,
57
+ onExamplePromptSelect,
58
+
39
59
  styles,
40
60
  selectedStyle,
41
61
  onStyleSelect,
@@ -43,11 +63,17 @@ export const AIGenerationForm: React.FC<AIGenerationFormProps> = ({
43
63
  duration,
44
64
  durationOptions,
45
65
  onDurationSelect,
66
+ formatDurationLabel,
67
+
68
+ aspectRatios,
69
+ selectedAspectRatio,
70
+ onAspectRatioSelect,
46
71
 
47
72
  onGenerate,
48
73
  isGenerating,
49
74
 
50
75
  translations,
76
+ children,
51
77
  }) => {
52
78
  return (
53
79
  <>
@@ -58,19 +84,44 @@ export const AIGenerationForm: React.FC<AIGenerationFormProps> = ({
58
84
  onChangeText={onPromptChange}
59
85
  />
60
86
 
61
- <StyleSelector
62
- styles={styles}
63
- selectedStyle={selectedStyle}
64
- onStyleSelect={onStyleSelect}
65
- title={translations.styleTitle}
66
- />
87
+ {examplePrompts && examplePrompts.length > 0 && onExamplePromptSelect && (
88
+ <ExamplePrompts
89
+ prompts={examplePrompts}
90
+ onSelectPrompt={onExamplePromptSelect}
91
+ title={translations.examplePromptsTitle}
92
+ />
93
+ )}
67
94
 
68
- <DurationSelector
69
- duration={duration}
70
- durationOptions={durationOptions}
71
- onDurationSelect={onDurationSelect}
72
- title={translations.durationTitle}
73
- />
95
+ {styles && styles.length > 0 && selectedStyle && onStyleSelect && translations.styleTitle && (
96
+ <StyleSelector
97
+ styles={styles}
98
+ selectedStyle={selectedStyle}
99
+ onStyleSelect={onStyleSelect}
100
+ title={translations.styleTitle}
101
+ />
102
+ )}
103
+
104
+ {aspectRatios && aspectRatios.length > 0 && selectedAspectRatio && onAspectRatioSelect && translations.aspectRatioTitle && (
105
+ <AspectRatioSelector
106
+ ratios={aspectRatios}
107
+ selectedRatio={selectedAspectRatio}
108
+ onRatioSelect={onAspectRatioSelect}
109
+ title={translations.aspectRatioTitle}
110
+ />
111
+ )}
112
+
113
+ {duration && durationOptions && onDurationSelect && translations.durationTitle && (
114
+ <DurationSelector
115
+ duration={duration}
116
+ durationOptions={durationOptions}
117
+ onDurationSelect={onDurationSelect}
118
+ title={translations.durationTitle}
119
+ formatLabel={formatDurationLabel}
120
+ />
121
+ )}
122
+
123
+ {/* Custom children injected here */}
124
+ {children}
74
125
 
75
126
  <GenerateButton
76
127
  onPress={onGenerate}