@umituz/react-native-ai-generation-content 1.22.4 → 1.22.6

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.22.4",
3
+ "version": "1.22.6",
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",
@@ -82,6 +82,7 @@ export interface CoupleFutureWizardTranslations {
82
82
  /** Wizard data providers */
83
83
  export interface CoupleFutureWizardData {
84
84
  readonly scenarios: readonly WizardScenarioData[];
85
+ readonly selectedScenario?: WizardScenarioData;
85
86
  readonly visualStyles?: readonly WizardVisualStyleOption[];
86
87
  readonly surprisePrompts?: readonly string[];
87
88
  }
@@ -90,6 +91,7 @@ export interface CoupleFutureWizardData {
90
91
  export interface CoupleFutureWizardCallbacks extends FlowCallbacks {
91
92
  readonly onScenarioSelect?: (scenario: WizardScenarioData) => void;
92
93
  readonly onPartnerUpload?: (partnerId: "A" | "B", image: FlowUploadedImageData) => void;
94
+ readonly onBackToScenarioSelection?: () => void;
93
95
  readonly requireFeature?: (callback: () => void) => boolean;
94
96
  }
95
97
 
@@ -60,13 +60,9 @@ export const CoupleFutureWizard: React.FC<CoupleFutureWizardProps> = ({
60
60
  );
61
61
 
62
62
  const handleScenarioPreviewContinue = useCallback(() => {
63
- const checkFeature = callbacks?.requireFeature;
64
- if (checkFeature) {
65
- checkFeature(() => flow.nextStep());
66
- } else {
67
- flow.nextStep();
68
- }
69
- }, [flow, callbacks]);
63
+ // No auth check needed here - just proceed to photo upload
64
+ flow.nextStep();
65
+ }, [flow]);
70
66
 
71
67
  const handlePartnerAContinue = useCallback(
72
68
  (image: { uri: string; base64: string; mimeType: string }, name?: string) => {
@@ -83,8 +79,18 @@ export const CoupleFutureWizard: React.FC<CoupleFutureWizardProps> = ({
83
79
  flow.setPartnerImage("B", image);
84
80
  if (name) flow.setPartnerName("B", name);
85
81
  callbacks?.onPartnerUpload?.("B", image);
86
- flow.startGeneration();
87
- callbacks?.onGenerationStart?.();
82
+
83
+ // Check auth/credits BEFORE starting generation (this consumes a credit)
84
+ const checkFeature = callbacks?.requireFeature;
85
+ if (checkFeature) {
86
+ checkFeature(() => {
87
+ flow.startGeneration();
88
+ callbacks?.onGenerationStart?.();
89
+ });
90
+ } else {
91
+ flow.startGeneration();
92
+ callbacks?.onGenerationStart?.();
93
+ }
88
94
  },
89
95
  [flow, callbacks],
90
96
  );