@umituz/react-native-ai-generation-content 1.27.7 → 1.27.8
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.27.
|
|
3
|
+
"version": "1.27.8",
|
|
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",
|
|
@@ -13,7 +13,7 @@ declare const __DEV__: boolean;
|
|
|
13
13
|
* Based on what inputs the wizard needs (photos, text)
|
|
14
14
|
* NOT based on app-specific scenario names
|
|
15
15
|
*/
|
|
16
|
-
export enum
|
|
16
|
+
export enum WizardInputType {
|
|
17
17
|
/** Two images required (any two-person/two-image scenario) */
|
|
18
18
|
DUAL_IMAGE = "dual_image",
|
|
19
19
|
/** Single image required */
|
|
@@ -24,20 +24,20 @@ export enum InputType {
|
|
|
24
24
|
DUAL_IMAGE_FACE = "dual_image_face",
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
/** @deprecated Use
|
|
28
|
-
export const FeatureType =
|
|
27
|
+
/** @deprecated Use WizardInputType instead */
|
|
28
|
+
export const FeatureType = WizardInputType;
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Generic Input Detection Patterns
|
|
32
32
|
* Only patterns that describe input/output, NOT app-specific scenarios
|
|
33
33
|
*/
|
|
34
|
-
const INPUT_PATTERNS: Record<
|
|
35
|
-
[
|
|
34
|
+
const INPUT_PATTERNS: Record<WizardInputType, RegExp[]> = {
|
|
35
|
+
[WizardInputType.DUAL_IMAGE]: [
|
|
36
36
|
// Empty - app must specify explicitly for dual image scenarios
|
|
37
37
|
// This prevents accidental matches with app-specific terms
|
|
38
38
|
],
|
|
39
39
|
|
|
40
|
-
[
|
|
40
|
+
[WizardInputType.SINGLE_IMAGE]: [
|
|
41
41
|
/^image-to-video$/i,
|
|
42
42
|
/upscale/i,
|
|
43
43
|
/restore/i,
|
|
@@ -49,13 +49,13 @@ const INPUT_PATTERNS: Record<InputType, RegExp[]> = {
|
|
|
49
49
|
/anime-selfie/i,
|
|
50
50
|
],
|
|
51
51
|
|
|
52
|
-
[
|
|
52
|
+
[WizardInputType.TEXT_INPUT]: [
|
|
53
53
|
/^text-to-video$/i,
|
|
54
54
|
/^text-to-image$/i,
|
|
55
55
|
/prompt-to/i,
|
|
56
56
|
],
|
|
57
57
|
|
|
58
|
-
[
|
|
58
|
+
[WizardInputType.DUAL_IMAGE_FACE]: [
|
|
59
59
|
/face-swap/i,
|
|
60
60
|
/swap-face/i,
|
|
61
61
|
],
|
|
@@ -66,13 +66,13 @@ const INPUT_PATTERNS: Record<InputType, RegExp[]> = {
|
|
|
66
66
|
* Only matches generic I/O patterns
|
|
67
67
|
* Returns SINGLE_IMAGE as safe default
|
|
68
68
|
*/
|
|
69
|
-
export const
|
|
69
|
+
export const detectWizardInputType = (scenarioId: string): WizardInputType => {
|
|
70
70
|
// Check patterns in priority order: TEXT_INPUT, SINGLE_IMAGE, DUAL_IMAGE_FACE
|
|
71
71
|
// DUAL_IMAGE has no patterns - must be explicitly specified
|
|
72
|
-
const checkOrder:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
const checkOrder: WizardInputType[] = [
|
|
73
|
+
WizardInputType.TEXT_INPUT,
|
|
74
|
+
WizardInputType.DUAL_IMAGE_FACE,
|
|
75
|
+
WizardInputType.SINGLE_IMAGE,
|
|
76
76
|
];
|
|
77
77
|
|
|
78
78
|
for (const type of checkOrder) {
|
|
@@ -83,7 +83,7 @@ export const detectInputType = (scenarioId: string): InputType => {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
// Safe default: SINGLE_IMAGE (most common use case)
|
|
86
|
-
return
|
|
86
|
+
return WizardInputType.SINGLE_IMAGE;
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
/**
|
|
@@ -186,11 +186,11 @@ const createDualImageFaceConfig = (scenarioId: string): WizardFeatureConfig => (
|
|
|
186
186
|
/**
|
|
187
187
|
* Config Factories Registry
|
|
188
188
|
*/
|
|
189
|
-
const CONFIG_FACTORIES: Record<
|
|
190
|
-
[
|
|
191
|
-
[
|
|
192
|
-
[
|
|
193
|
-
[
|
|
189
|
+
const CONFIG_FACTORIES: Record<WizardInputType, (id: string) => WizardFeatureConfig> = {
|
|
190
|
+
[WizardInputType.DUAL_IMAGE]: createDualImageConfig,
|
|
191
|
+
[WizardInputType.SINGLE_IMAGE]: createSingleImageConfig,
|
|
192
|
+
[WizardInputType.TEXT_INPUT]: createTextInputConfig,
|
|
193
|
+
[WizardInputType.DUAL_IMAGE_FACE]: createDualImageFaceConfig,
|
|
194
194
|
};
|
|
195
195
|
|
|
196
196
|
/**
|
|
@@ -219,7 +219,7 @@ const mergeConfigOverrides = (
|
|
|
219
219
|
*/
|
|
220
220
|
export interface WizardConfigOptions {
|
|
221
221
|
/** Explicit input type - highest priority */
|
|
222
|
-
readonly inputType?:
|
|
222
|
+
readonly inputType?: WizardInputType;
|
|
223
223
|
/** Additional steps to append */
|
|
224
224
|
readonly additionalSteps?: WizardFeatureConfig["steps"];
|
|
225
225
|
/** Custom overrides */
|
|
@@ -239,7 +239,7 @@ export interface WizardConfigOptions {
|
|
|
239
239
|
* getScenarioWizardConfig("text-to-video")
|
|
240
240
|
*
|
|
241
241
|
* // Explicit input type for app-specific scenarios
|
|
242
|
-
* getScenarioWizardConfig("ai-kiss", { inputType:
|
|
242
|
+
* getScenarioWizardConfig("ai-kiss", { inputType: WizardInputType.DUAL_IMAGE })
|
|
243
243
|
*/
|
|
244
244
|
export const getScenarioWizardConfig = (
|
|
245
245
|
scenarioId: string,
|
|
@@ -278,7 +278,7 @@ export const getScenarioWizardConfig = (
|
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
// 3. Auto-detect from scenario ID
|
|
281
|
-
const inputType =
|
|
281
|
+
const inputType = detectWizardInputType(scenarioId);
|
|
282
282
|
|
|
283
283
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
284
284
|
console.log("[WizardConfig] Auto-detected inputType", {
|
|
@@ -318,12 +318,12 @@ export const hasExplicitConfig = (scenarioId: string): boolean => {
|
|
|
318
318
|
/**
|
|
319
319
|
* Get input type for a scenario
|
|
320
320
|
*/
|
|
321
|
-
export const
|
|
322
|
-
return
|
|
321
|
+
export const getScenarioWizardInputType = (scenarioId: string): WizardInputType => {
|
|
322
|
+
return detectWizardInputType(scenarioId);
|
|
323
323
|
};
|
|
324
324
|
|
|
325
|
-
/** @deprecated Use
|
|
326
|
-
export const getScenarioFeatureType =
|
|
325
|
+
/** @deprecated Use getScenarioWizardInputType instead */
|
|
326
|
+
export const getScenarioFeatureType = getScenarioWizardInputType;
|
|
327
327
|
|
|
328
|
-
/** @deprecated Use
|
|
329
|
-
export const detectFeatureType =
|
|
328
|
+
/** @deprecated Use detectWizardInputType instead */
|
|
329
|
+
export const detectFeatureType = detectWizardInputType;
|
|
@@ -16,12 +16,12 @@ export { createStoryTemplate } from "./infrastructure/utils/scenario-utils";
|
|
|
16
16
|
|
|
17
17
|
// Wizard Configurations - App-agnostic, classifies by INPUT REQUIREMENTS
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
WizardInputType,
|
|
20
20
|
SCENARIO_WIZARD_CONFIGS,
|
|
21
|
-
|
|
21
|
+
detectWizardInputType,
|
|
22
22
|
getScenarioWizardConfig,
|
|
23
23
|
hasExplicitConfig,
|
|
24
|
-
|
|
24
|
+
getScenarioWizardInputType,
|
|
25
25
|
registerWizardConfig,
|
|
26
26
|
// Deprecated (backward compatibility)
|
|
27
27
|
FeatureType,
|