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

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.58",
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[];
@@ -87,12 +87,14 @@ export const AIGenerationForm: React.FC<AIGenerationFormProps> = ({
87
87
  }) => {
88
88
  return (
89
89
  <>
90
- <PromptInput
91
- title={translations.promptTitle}
92
- placeholder={translations.promptPlaceholder}
93
- value={prompt}
94
- onChangeText={onPromptChange}
95
- />
90
+ {onPromptChange && translations.promptTitle && (
91
+ <PromptInput
92
+ title={translations.promptTitle}
93
+ placeholder={translations.promptPlaceholder}
94
+ value={prompt || ""}
95
+ onChangeText={onPromptChange}
96
+ />
97
+ )}
96
98
 
97
99
  {examplePrompts && examplePrompts.length > 0 && onExamplePromptSelect && (
98
100
  <ExamplePrompts
@@ -136,7 +138,7 @@ export const AIGenerationForm: React.FC<AIGenerationFormProps> = ({
136
138
  <GenerateButton
137
139
  onPress={onGenerate}
138
140
  isProcessing={isGenerating}
139
- isDisabled={!prompt.trim()}
141
+ isDisabled={onPromptChange ? !prompt?.trim() : false}
140
142
  text={translations.generateButton}
141
143
  processingText={translations.generatingButton}
142
144
  variant="solid"