@umituz/react-native-ai-generation-content 1.26.43 → 1.26.44
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.26.
|
|
3
|
+
"version": "1.26.44",
|
|
4
4
|
"description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -68,6 +68,13 @@ export const buildFlowStepsFromWizard = (
|
|
|
68
68
|
type: StepType.GENERATING,
|
|
69
69
|
required: true,
|
|
70
70
|
});
|
|
71
|
+
|
|
72
|
+
// Always add result preview after generating
|
|
73
|
+
steps.push({
|
|
74
|
+
id: "RESULT_PREVIEW",
|
|
75
|
+
type: StepType.RESULT_PREVIEW,
|
|
76
|
+
required: true,
|
|
77
|
+
});
|
|
71
78
|
}
|
|
72
79
|
|
|
73
80
|
return steps;
|
|
@@ -86,6 +86,7 @@ export const GenericWizardFlow: React.FC<GenericWizardFlowProps> = ({
|
|
|
86
86
|
previousStep,
|
|
87
87
|
setCustomData,
|
|
88
88
|
updateProgress,
|
|
89
|
+
setResult,
|
|
89
90
|
} = flow;
|
|
90
91
|
|
|
91
92
|
// Handle progress change - memoized to prevent infinite loops
|
|
@@ -96,6 +97,22 @@ export const GenericWizardFlow: React.FC<GenericWizardFlowProps> = ({
|
|
|
96
97
|
[updateProgress],
|
|
97
98
|
);
|
|
98
99
|
|
|
100
|
+
// Handle generation complete - saves result and advances to result preview
|
|
101
|
+
const handleGenerationComplete = useCallback(
|
|
102
|
+
(result: unknown) => {
|
|
103
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
104
|
+
console.log("[GenericWizardFlow] Generation completed, saving result and advancing to result preview");
|
|
105
|
+
}
|
|
106
|
+
// Save result in flow state
|
|
107
|
+
setResult(result);
|
|
108
|
+
// Advance to result preview step
|
|
109
|
+
nextStep();
|
|
110
|
+
// Notify parent
|
|
111
|
+
onGenerationComplete?.(result);
|
|
112
|
+
},
|
|
113
|
+
[setResult, nextStep, onGenerationComplete],
|
|
114
|
+
);
|
|
115
|
+
|
|
99
116
|
// Validate scenario - NO FALLBACK, aiPrompt is REQUIRED
|
|
100
117
|
const validatedScenario = useMemo(() => {
|
|
101
118
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
@@ -148,7 +165,7 @@ export const GenericWizardFlow: React.FC<GenericWizardFlowProps> = ({
|
|
|
148
165
|
userId,
|
|
149
166
|
isGeneratingStep: currentStep?.type === StepType.GENERATING,
|
|
150
167
|
alertMessages,
|
|
151
|
-
onSuccess:
|
|
168
|
+
onSuccess: handleGenerationComplete,
|
|
152
169
|
onError: onGenerationError,
|
|
153
170
|
onProgressChange: handleProgressChange,
|
|
154
171
|
onCreditsExhausted,
|