@umituz/react-native-ai-generation-content 1.19.4 → 1.19.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.19.4",
3
+ "version": "1.19.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",
@@ -99,30 +99,63 @@ export const useCoupleFutureFlow = <TStep, TScenarioId, TResult>(
99
99
  alertMessages,
100
100
  });
101
101
 
102
+ const {
103
+ step,
104
+ isProcessing,
105
+ partnerA,
106
+ partnerB,
107
+ partnerAName,
108
+ partnerBName,
109
+ scenarioConfig,
110
+ customPrompt,
111
+ visualStyle,
112
+ selection,
113
+ selectedFeature,
114
+ selectedScenarioId,
115
+ selectedScenarioData,
116
+ } = state;
117
+
102
118
  useEffect(() => {
103
- if (state.step !== config.steps.GENERATING) {
119
+ if (step !== config.steps.GENERATING) {
104
120
  hasStarted.current = false;
105
121
  return;
106
122
  }
107
- if (!state.isProcessing || hasStarted.current) return;
123
+ if (!isProcessing || hasStarted.current) return;
108
124
  hasStarted.current = true;
109
125
 
110
126
  const input = buildGenerationInputFromConfig({
111
- partnerA: state.partnerA as never,
112
- partnerB: state.partnerB as never,
113
- partnerAName: state.partnerAName,
114
- partnerBName: state.partnerBName,
115
- scenario: state.scenarioConfig as never,
116
- customPrompt: state.customPrompt || undefined,
117
- visualStyle: state.visualStyle || "",
127
+ partnerA: partnerA as never,
128
+ partnerB: partnerB as never,
129
+ partnerAName,
130
+ partnerBName,
131
+ scenario: scenarioConfig as never,
132
+ customPrompt: customPrompt || undefined,
133
+ visualStyle: visualStyle || "",
118
134
  defaultPartnerAName: generationConfig.defaultPartnerAName,
119
135
  defaultPartnerBName: generationConfig.defaultPartnerBName,
120
- coupleFeatureSelection: state.selection as never,
136
+ coupleFeatureSelection: selection as never,
121
137
  visualStyles: generationConfig.visualStyleModifiers,
122
138
  customScenarioId: config.customScenarioId as string,
123
139
  });
124
140
  if (input) generate(input);
125
- }, [state, config, generationConfig, generate]);
141
+ }, [
142
+ step,
143
+ isProcessing,
144
+ partnerA,
145
+ partnerB,
146
+ partnerAName,
147
+ partnerBName,
148
+ scenarioConfig,
149
+ customPrompt,
150
+ visualStyle,
151
+ selection,
152
+ config.steps.GENERATING,
153
+ config.customScenarioId,
154
+ generationConfig.defaultPartnerAName,
155
+ generationConfig.defaultPartnerBName,
156
+ generationConfig.visualStyleModifiers,
157
+ generate,
158
+ ]);
126
159
 
127
160
  const handleScenarioSelect = useCallback(
128
161
  (id: string) => {
@@ -138,17 +171,26 @@ export const useCoupleFutureFlow = <TStep, TScenarioId, TResult>(
138
171
  );
139
172
 
140
173
  const handleScenarioPreviewContinue = useCallback(() => {
141
- if (state.selectedFeature) {
174
+ if (selectedFeature) {
142
175
  actions.setStep(config.steps.COUPLE_FEATURE_SELECTOR);
143
176
  } else if (
144
- state.selectedScenarioId === config.customScenarioId ||
145
- state.selectedScenarioData?.requiresPhoto === false
177
+ selectedScenarioId === config.customScenarioId ||
178
+ selectedScenarioData?.requiresPhoto === false
146
179
  ) {
147
180
  actions.setStep(config.steps.TEXT_INPUT);
148
181
  } else {
149
182
  actions.setStep(config.steps.PARTNER_A);
150
183
  }
151
- }, [actions, config, state]);
184
+ }, [
185
+ actions,
186
+ config.steps.COUPLE_FEATURE_SELECTOR,
187
+ config.steps.TEXT_INPUT,
188
+ config.steps.PARTNER_A,
189
+ config.customScenarioId,
190
+ selectedFeature,
191
+ selectedScenarioId,
192
+ selectedScenarioData,
193
+ ]);
152
194
 
153
195
  const handlePartnerAContinue = useCallback(
154
196
  (image: UploadedImage, name: string) => {
@@ -161,11 +203,17 @@ export const useCoupleFutureFlow = <TStep, TScenarioId, TResult>(
161
203
 
162
204
  const handlePartnerABack = useCallback(() => {
163
205
  actions.setStep(
164
- state.selectedScenarioId === config.customScenarioId
206
+ selectedScenarioId === config.customScenarioId
165
207
  ? config.steps.TEXT_INPUT
166
208
  : config.steps.SCENARIO_PREVIEW,
167
209
  );
168
- }, [actions, config, state.selectedScenarioId]);
210
+ }, [
211
+ actions,
212
+ config.customScenarioId,
213
+ config.steps.TEXT_INPUT,
214
+ config.steps.SCENARIO_PREVIEW,
215
+ selectedScenarioId,
216
+ ]);
169
217
 
170
218
  const handlePartnerBContinue = useCallback(
171
219
  (image: UploadedImage, name: string) => {
@@ -187,13 +235,13 @@ export const useCoupleFutureFlow = <TStep, TScenarioId, TResult>(
187
235
  (prompt: string, style: string) => {
188
236
  actions.setCustomPrompt(prompt);
189
237
  actions.setVisualStyle(style);
190
- if (state.selectedScenarioId === config.customScenarioId) {
238
+ if (selectedScenarioId === config.customScenarioId) {
191
239
  actions.setStep(config.steps.PARTNER_A);
192
240
  } else {
193
241
  actions.startGeneration();
194
242
  }
195
243
  },
196
- [actions, config, state.selectedScenarioId],
244
+ [actions, config.customScenarioId, config.steps.PARTNER_A, selectedScenarioId],
197
245
  );
198
246
 
199
247
  const handleMagicPromptBack = useCallback(