@umituz/react-native-ai-generation-content 1.17.57 → 1.17.59

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.57",
3
+ "version": "1.17.59",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -9,8 +9,8 @@ import type { StyleOption } from "./selectors/types";
9
9
  import type { AspectRatioOption } from "./selectors/types";
10
10
 
11
11
  export interface AIGenerationFormTranslations {
12
- promptTitle: string;
13
- promptPlaceholder: string;
12
+ promptTitle?: string;
13
+ promptPlaceholder?: string;
14
14
  styleTitle?: string;
15
15
  durationTitle?: string;
16
16
  aspectRatioTitle?: string;
@@ -20,8 +20,8 @@ export interface AIGenerationFormTranslations {
20
20
  }
21
21
 
22
22
  export interface AIGenerationFormProps extends PropsWithChildren {
23
- prompt: string;
24
- onPromptChange: (text: string) => void;
23
+ prompt?: string;
24
+ onPromptChange?: (text: string) => void;
25
25
 
26
26
  // Optional: Example Prompts
27
27
  examplePrompts?: readonly string[];
@@ -45,6 +45,7 @@ export interface AIGenerationFormProps extends PropsWithChildren {
45
45
 
46
46
  onGenerate: () => void;
47
47
  isGenerating: boolean;
48
+ hideGenerateButton?: boolean;
48
49
 
49
50
  // Custom Generate Button Props
50
51
  generateButtonProps?: {
@@ -79,6 +80,7 @@ export const AIGenerationForm: React.FC<AIGenerationFormProps> = ({
79
80
 
80
81
  onGenerate,
81
82
  isGenerating,
83
+ hideGenerateButton,
82
84
 
83
85
  generateButtonProps,
84
86
 
@@ -87,12 +89,14 @@ export const AIGenerationForm: React.FC<AIGenerationFormProps> = ({
87
89
  }) => {
88
90
  return (
89
91
  <>
90
- <PromptInput
91
- title={translations.promptTitle}
92
- placeholder={translations.promptPlaceholder}
93
- value={prompt}
94
- onChangeText={onPromptChange}
95
- />
92
+ {onPromptChange && translations.promptTitle && (
93
+ <PromptInput
94
+ title={translations.promptTitle}
95
+ placeholder={translations.promptPlaceholder}
96
+ value={prompt || ""}
97
+ onChangeText={onPromptChange}
98
+ />
99
+ )}
96
100
 
97
101
  {examplePrompts && examplePrompts.length > 0 && onExamplePromptSelect && (
98
102
  <ExamplePrompts
@@ -133,18 +137,20 @@ export const AIGenerationForm: React.FC<AIGenerationFormProps> = ({
133
137
  {/* Custom children injected here */}
134
138
  {children}
135
139
 
136
- <GenerateButton
137
- onPress={onGenerate}
138
- isProcessing={isGenerating}
139
- isDisabled={!prompt.trim()}
140
- text={translations.generateButton}
141
- processingText={translations.generatingButton}
142
- variant="solid"
143
- icon={generateButtonProps?.icon || "sparkles-outline"}
144
- costLabel={generateButtonProps?.costLabel}
145
- accessoryRight={generateButtonProps?.accessoryRight}
146
- onAccessoryRightPress={generateButtonProps?.onAccessoryRightPress}
147
- />
140
+ {!hideGenerateButton && (
141
+ <GenerateButton
142
+ onPress={onGenerate}
143
+ isProcessing={isGenerating}
144
+ isDisabled={onPromptChange ? !prompt?.trim() : false}
145
+ text={translations.generateButton}
146
+ processingText={translations.generatingButton}
147
+ variant="solid"
148
+ icon={generateButtonProps?.icon || "sparkles-outline"}
149
+ costLabel={generateButtonProps?.costLabel}
150
+ accessoryRight={generateButtonProps?.accessoryRight}
151
+ onAccessoryRightPress={generateButtonProps?.onAccessoryRightPress}
152
+ />
153
+ )}
148
154
  </>
149
155
  );
150
156
  };