@umituz/react-native-ai-generation-content 1.25.0 → 1.25.3
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.25.
|
|
3
|
+
"version": "1.25.3",
|
|
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",
|
|
@@ -25,11 +25,11 @@ import { buildFlowStepsFromWizard } from "../../infrastructure/builders/dynamic-
|
|
|
25
25
|
export interface GenericWizardFlowProps {
|
|
26
26
|
readonly featureConfig: WizardFeatureConfig;
|
|
27
27
|
readonly onStepChange?: (stepId: string, stepType: StepType | string) => void;
|
|
28
|
-
readonly onGenerationStart?: (data: Record<string, unknown
|
|
28
|
+
readonly onGenerationStart?: (data: Record<string, unknown>, proceedToGenerating: () => void) => void;
|
|
29
29
|
readonly onBack?: () => void;
|
|
30
30
|
readonly t: (key: string) => string;
|
|
31
31
|
readonly translations?: Record<string, string>;
|
|
32
|
-
readonly renderPreview?: () => React.ReactElement | null;
|
|
32
|
+
readonly renderPreview?: (onContinue: () => void) => React.ReactElement | null;
|
|
33
33
|
readonly renderGenerating?: (progress: number) => React.ReactElement | null;
|
|
34
34
|
readonly renderResult?: (result: unknown) => React.ReactElement | null;
|
|
35
35
|
}
|
|
@@ -104,12 +104,21 @@ export const GenericWizardFlow: React.FC<GenericWizardFlowProps> = ({
|
|
|
104
104
|
// Check if this is the last step before generating
|
|
105
105
|
if (flow.currentStepIndex === flowSteps.length - 2) {
|
|
106
106
|
// Next step is GENERATING
|
|
107
|
+
// Notify parent and provide callback to proceed to generating
|
|
108
|
+
// Parent will call proceedToGenerating() after feature gate passes
|
|
107
109
|
if (onGenerationStart) {
|
|
108
|
-
onGenerationStart(flow.customData)
|
|
110
|
+
onGenerationStart(flow.customData, () => {
|
|
111
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
112
|
+
console.log("[GenericWizardFlow] Proceeding to GENERATING step");
|
|
113
|
+
}
|
|
114
|
+
flow.nextStep();
|
|
115
|
+
});
|
|
109
116
|
}
|
|
117
|
+
// DON'T call flow.nextStep() here - parent will call it via proceedToGenerating callback
|
|
118
|
+
return;
|
|
110
119
|
}
|
|
111
120
|
|
|
112
|
-
// Move to next step
|
|
121
|
+
// Move to next step (for all non-generation steps)
|
|
113
122
|
flow.nextStep();
|
|
114
123
|
},
|
|
115
124
|
[flow, flowSteps.length, onGenerationStart],
|
|
@@ -144,7 +153,8 @@ export const GenericWizardFlow: React.FC<GenericWizardFlowProps> = ({
|
|
|
144
153
|
// Special steps with custom renderers
|
|
145
154
|
switch (step.type) {
|
|
146
155
|
case StepType.SCENARIO_PREVIEW:
|
|
147
|
-
|
|
156
|
+
// Preview continues to next step automatically
|
|
157
|
+
return renderPreview?.(flow.nextStep) || null;
|
|
148
158
|
|
|
149
159
|
case StepType.GENERATING:
|
|
150
160
|
return renderGenerating?.(flow.generationProgress) || null;
|