@umituz/react-native-ai-generation-content 1.17.90 → 1.17.92

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.90",
3
+ "version": "1.17.92",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -1,10 +1,12 @@
1
- import React from "react";
1
+ import React, { useEffect } from "react";
2
2
  import { TouchableOpacity, StyleSheet } from "react-native";
3
3
  import {
4
4
  AtomicText,
5
5
  AtomicIcon,
6
6
  useAppDesignTokens,
7
7
  } from "@umituz/react-native-design-system";
8
+
9
+ declare const __DEV__: boolean;
8
10
  import { StyleSelector } from "./selectors/StyleSelector";
9
11
  import { DurationSelector } from "./selectors/DurationSelector";
10
12
  import { AspectRatioSelector } from "./selectors/AspectRatioSelector";
@@ -42,8 +44,18 @@ export const AIGenerationForm: React.FC<AIGenerationFormProps> = ({
42
44
  translations,
43
45
  children,
44
46
  }) => {
47
+ // Log immediately on every render
48
+ if (__DEV__) console.log("[AIGenerationForm] RENDERING NOW - hideGenerateButton:", hideGenerateButton);
49
+
45
50
  const tokens = useAppDesignTokens();
46
51
  const isAdvancedVisible = showAdvanced !== undefined ? showAdvanced : true;
52
+ const buttonIsDisabled = onPromptChange ? !prompt?.trim() : false;
53
+
54
+ useEffect(() => {
55
+ if (__DEV__) {
56
+ console.log("[AIGenerationForm] MOUNTED/UPDATED - prompt:", prompt, "isGenerating:", isGenerating, "buttonIsDisabled:", buttonIsDisabled, "hideGenerateButton:", hideGenerateButton);
57
+ }
58
+ }, [prompt, isGenerating, buttonIsDisabled, hideGenerateButton]);
47
59
 
48
60
  return (
49
61
  <>
@@ -128,7 +140,7 @@ export const AIGenerationForm: React.FC<AIGenerationFormProps> = ({
128
140
  <GenerateButton
129
141
  onPress={onGenerate}
130
142
  isProcessing={isGenerating}
131
- isDisabled={onPromptChange ? !prompt?.trim() : false}
143
+ isDisabled={buttonIsDisabled}
132
144
  text={translations.generateButton}
133
145
  processingText={translations.generatingButton}
134
146
  icon={generateButtonProps?.icon || "sparkles-outline"}
@@ -4,7 +4,7 @@
4
4
  * Props-driven for 100+ apps compatibility
5
5
  */
6
6
 
7
- import React from "react";
7
+ import React, { useEffect } from "react";
8
8
  import { View, StyleSheet, TouchableOpacity, type ViewStyle } from "react-native";
9
9
  import {
10
10
  AtomicText,
@@ -42,13 +42,22 @@ export const GenerateButton: React.FC<GenerateButtonProps> = ({
42
42
  onAccessoryRightPress,
43
43
  style,
44
44
  }) => {
45
+ // Log immediately on every render
46
+ if (__DEV__) console.log("[GenerateButton] RENDERING NOW");
47
+
45
48
  const tokens = useAppDesignTokens();
46
49
  const disabled = isDisabled || isProcessing;
47
50
  const displayText = isProcessing && processingText ? processingText : text;
48
51
  const finalDisplayText = costLabel ? `${displayText} (${costLabel})` : displayText;
49
52
 
53
+ useEffect(() => {
54
+ if (__DEV__) {
55
+ console.log("[GenerateButton] MOUNTED/UPDATED - isDisabled:", isDisabled, "isProcessing:", isProcessing, "disabled:", disabled, "text:", text);
56
+ }
57
+ }, [isDisabled, isProcessing, disabled, text]);
58
+
50
59
  const handlePress = () => {
51
- if (__DEV__) console.log("[GenerateButton] onPress called, disabled:", disabled, "isDisabled:", isDisabled, "isProcessing:", isProcessing);
60
+ if (__DEV__) console.log("[GenerateButton] PRESSED - disabled:", disabled, "isDisabled:", isDisabled, "isProcessing:", isProcessing);
52
61
  if (!disabled) {
53
62
  onPress();
54
63
  }