@umituz/react-native-ai-generation-content 1.17.56 → 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.56",
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[];
@@ -46,6 +46,14 @@ export interface AIGenerationFormProps extends PropsWithChildren {
46
46
  onGenerate: () => void;
47
47
  isGenerating: boolean;
48
48
 
49
+ // Custom Generate Button Props
50
+ generateButtonProps?: {
51
+ costLabel?: string;
52
+ accessoryRight?: React.ReactNode;
53
+ onAccessoryRightPress?: () => void;
54
+ icon?: string;
55
+ };
56
+
49
57
  translations: AIGenerationFormTranslations;
50
58
  }
51
59
 
@@ -72,17 +80,21 @@ export const AIGenerationForm: React.FC<AIGenerationFormProps> = ({
72
80
  onGenerate,
73
81
  isGenerating,
74
82
 
83
+ generateButtonProps,
84
+
75
85
  translations,
76
86
  children,
77
87
  }) => {
78
88
  return (
79
89
  <>
80
- <PromptInput
81
- title={translations.promptTitle}
82
- placeholder={translations.promptPlaceholder}
83
- value={prompt}
84
- onChangeText={onPromptChange}
85
- />
90
+ {onPromptChange && translations.promptTitle && (
91
+ <PromptInput
92
+ title={translations.promptTitle}
93
+ placeholder={translations.promptPlaceholder}
94
+ value={prompt || ""}
95
+ onChangeText={onPromptChange}
96
+ />
97
+ )}
86
98
 
87
99
  {examplePrompts && examplePrompts.length > 0 && onExamplePromptSelect && (
88
100
  <ExamplePrompts
@@ -126,11 +138,14 @@ export const AIGenerationForm: React.FC<AIGenerationFormProps> = ({
126
138
  <GenerateButton
127
139
  onPress={onGenerate}
128
140
  isProcessing={isGenerating}
129
- isDisabled={!prompt.trim()}
141
+ isDisabled={onPromptChange ? !prompt?.trim() : false}
130
142
  text={translations.generateButton}
131
143
  processingText={translations.generatingButton}
132
144
  variant="solid"
133
- icon="sparkles-outline"
145
+ icon={generateButtonProps?.icon || "sparkles-outline"}
146
+ costLabel={generateButtonProps?.costLabel}
147
+ accessoryRight={generateButtonProps?.accessoryRight}
148
+ onAccessoryRightPress={generateButtonProps?.onAccessoryRightPress}
134
149
  />
135
150
  </>
136
151
  );