@umituz/react-native-ai-generation-content 1.25.19 → 1.25.21
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.21",
|
|
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",
|
|
@@ -298,21 +298,61 @@ const mergeConfigOverrides = (
|
|
|
298
298
|
};
|
|
299
299
|
};
|
|
300
300
|
|
|
301
|
+
/**
|
|
302
|
+
* Apply configuration options to filter/modify steps
|
|
303
|
+
*/
|
|
304
|
+
const applyConfigOptions = (
|
|
305
|
+
config: WizardFeatureConfig,
|
|
306
|
+
options?: WizardConfigOptions,
|
|
307
|
+
): WizardFeatureConfig => {
|
|
308
|
+
if (!options) return config;
|
|
309
|
+
|
|
310
|
+
let steps = [...config.steps];
|
|
311
|
+
|
|
312
|
+
// Filter out style selection steps if disabled
|
|
313
|
+
if (options.disableStyleSelections) {
|
|
314
|
+
const styleStepIds = ["romantic_mood", "art_style", "artist_style"];
|
|
315
|
+
steps = steps.filter((step) => !styleStepIds.includes(step.id));
|
|
316
|
+
|
|
317
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
318
|
+
console.log("[WizardConfig] Style selections disabled", {
|
|
319
|
+
filteredStepIds: styleStepIds,
|
|
320
|
+
remainingSteps: steps.map((s) => s.id),
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
return {
|
|
326
|
+
...config,
|
|
327
|
+
steps,
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Configuration Options for Wizard Behavior
|
|
333
|
+
*/
|
|
334
|
+
export interface WizardConfigOptions {
|
|
335
|
+
readonly disableStyleSelections?: boolean; // Disable romantic mood, art style, artist style
|
|
336
|
+
}
|
|
337
|
+
|
|
301
338
|
/**
|
|
302
339
|
* Get wizard config for a scenario
|
|
303
340
|
* 1. Check for explicit config in SCENARIO_WIZARD_CONFIGS
|
|
304
341
|
* 2. Auto-detect feature type and generate config
|
|
305
342
|
* 3. Apply overrides if provided
|
|
343
|
+
* 4. Apply options to disable certain steps
|
|
306
344
|
*
|
|
307
345
|
* This means ALL scenarios work automatically!
|
|
308
346
|
*/
|
|
309
347
|
export const getScenarioWizardConfig = (
|
|
310
348
|
scenarioId: string,
|
|
349
|
+
options?: WizardConfigOptions,
|
|
311
350
|
overrides?: Partial<WizardFeatureConfig>,
|
|
312
351
|
): WizardFeatureConfig => {
|
|
313
352
|
// 1. Explicit config (highest priority)
|
|
314
353
|
if (SCENARIO_WIZARD_CONFIGS[scenarioId]) {
|
|
315
|
-
|
|
354
|
+
const config = mergeConfigOverrides(SCENARIO_WIZARD_CONFIGS[scenarioId], overrides);
|
|
355
|
+
return applyConfigOptions(config, options);
|
|
316
356
|
}
|
|
317
357
|
|
|
318
358
|
// 2. Auto-detect feature type
|
|
@@ -330,7 +370,10 @@ export const getScenarioWizardConfig = (
|
|
|
330
370
|
const config = factory(scenarioId);
|
|
331
371
|
|
|
332
372
|
// 4. Apply overrides
|
|
333
|
-
|
|
373
|
+
const configWithOverrides = mergeConfigOverrides(config, overrides);
|
|
374
|
+
|
|
375
|
+
// 5. Apply options (disable steps)
|
|
376
|
+
return applyConfigOptions(configWithOverrides, options);
|
|
334
377
|
};
|
|
335
378
|
|
|
336
379
|
/**
|
|
@@ -308,21 +308,26 @@ export const useWizardGeneration = (
|
|
|
308
308
|
const input = lastInputRef.current;
|
|
309
309
|
if (!input) return;
|
|
310
310
|
|
|
311
|
-
const videoResult = result as { videoUrl?: string };
|
|
312
|
-
const imageResult = result as { imageUrl?: string };
|
|
313
|
-
|
|
314
311
|
// Both input types have prompt field
|
|
315
312
|
const prompt = 'prompt' in input ? input.prompt : '';
|
|
316
313
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
imageUrl: imageResult.imageUrl,
|
|
314
|
+
// Build creation object with only the relevant URL field
|
|
315
|
+
const creation: any = {
|
|
320
316
|
scenarioId: scenario.id,
|
|
321
317
|
scenarioTitle: scenario.title || scenario.id,
|
|
322
318
|
prompt,
|
|
323
319
|
createdAt: Date.now(),
|
|
324
320
|
};
|
|
325
321
|
|
|
322
|
+
// Add only the relevant URL based on output type
|
|
323
|
+
if (outputType === "image") {
|
|
324
|
+
const imageResult = result as { imageUrl?: string };
|
|
325
|
+
creation.imageUrl = imageResult.imageUrl;
|
|
326
|
+
} else {
|
|
327
|
+
const videoResult = result as { videoUrl?: string };
|
|
328
|
+
creation.videoUrl = videoResult.videoUrl;
|
|
329
|
+
}
|
|
330
|
+
|
|
326
331
|
await repository.create(uid, creation);
|
|
327
332
|
|
|
328
333
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|