@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
|
@@ -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
|
|
13
|
-
promptPlaceholder
|
|
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
|
|
24
|
-
onPromptChange
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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
|
};
|