@umituz/react-native-ai-generation-content 1.37.15 → 1.37.16
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.37.
|
|
3
|
+
"version": "1.37.16",
|
|
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",
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { Scenario, ScenarioOutputType } from "../domain/Scenario";
|
|
7
|
+
import { WizardInputType } from "../configs/wizard-input.types";
|
|
8
|
+
import { detectWizardInputType } from "../configs/wizard-input-detector";
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* Configuration for creating app-specific scenarios
|
|
@@ -17,6 +19,8 @@ export interface AppScenarioConfig {
|
|
|
17
19
|
readonly excludeIds?: readonly string[];
|
|
18
20
|
/** Optional filter to include only certain category IDs */
|
|
19
21
|
readonly includeCategories?: readonly string[];
|
|
22
|
+
/** Optional filter to exclude wizard input types (uses pattern detection) */
|
|
23
|
+
readonly excludeWizardInputTypes?: readonly WizardInputType[];
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
/**
|
|
@@ -24,25 +28,24 @@ export interface AppScenarioConfig {
|
|
|
24
28
|
* Apps use this to set their desired outputType and model
|
|
25
29
|
*
|
|
26
30
|
* @example
|
|
27
|
-
* // Video generation app
|
|
31
|
+
* // Video generation app - exclude dual image scenarios
|
|
28
32
|
* const scenarios = createScenariosForApp(SCENARIOS, {
|
|
29
33
|
* outputType: "video",
|
|
30
|
-
* model: "fal-ai/veo3/image-to-video"
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* // Image generation app
|
|
35
|
-
* const scenarios = createScenariosForApp(SCENARIOS, {
|
|
36
|
-
* outputType: "image",
|
|
37
|
-
* model: "fal-ai/nano-banana/edit",
|
|
38
|
-
* excludeIds: ["custom"]
|
|
34
|
+
* model: "fal-ai/veo3/image-to-video",
|
|
35
|
+
* excludeWizardInputTypes: [WizardInputType.DUAL_IMAGE]
|
|
39
36
|
* });
|
|
40
37
|
*/
|
|
41
38
|
export const createScenariosForApp = (
|
|
42
39
|
scenarios: readonly Scenario[],
|
|
43
40
|
config: AppScenarioConfig,
|
|
44
41
|
): Scenario[] => {
|
|
45
|
-
const {
|
|
42
|
+
const {
|
|
43
|
+
outputType,
|
|
44
|
+
model,
|
|
45
|
+
excludeIds,
|
|
46
|
+
includeCategories,
|
|
47
|
+
excludeWizardInputTypes,
|
|
48
|
+
} = config;
|
|
46
49
|
|
|
47
50
|
return scenarios
|
|
48
51
|
.filter((scenario) => {
|
|
@@ -59,6 +62,13 @@ export const createScenariosForApp = (
|
|
|
59
62
|
) {
|
|
60
63
|
return false;
|
|
61
64
|
}
|
|
65
|
+
// Filter by wizard input types using pattern detection
|
|
66
|
+
if (excludeWizardInputTypes && excludeWizardInputTypes.length > 0) {
|
|
67
|
+
const detectedType = detectWizardInputType(scenario.id);
|
|
68
|
+
if (excludeWizardInputTypes.includes(detectedType)) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
62
72
|
return true;
|
|
63
73
|
})
|
|
64
74
|
.map((scenario) => ({
|
|
@@ -70,7 +80,6 @@ export const createScenariosForApp = (
|
|
|
70
80
|
|
|
71
81
|
/**
|
|
72
82
|
* Filters scenarios by output type (if they have one set)
|
|
73
|
-
* Useful for apps that have mixed scenarios with different output types
|
|
74
83
|
*
|
|
75
84
|
* @example
|
|
76
85
|
* const videoScenarios = filterScenariosByOutputType(scenarios, "video");
|
|
@@ -91,12 +100,26 @@ export const filterScenariosByCategory = (
|
|
|
91
100
|
category: string,
|
|
92
101
|
): Scenario[] => scenarios.filter((s) => s.category === category);
|
|
93
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Filters scenarios by wizard input type using pattern detection
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* const singleImageScenarios = filterScenariosByWizardInputType(
|
|
108
|
+
* scenarios,
|
|
109
|
+
* [WizardInputType.SINGLE_IMAGE]
|
|
110
|
+
* );
|
|
111
|
+
*/
|
|
112
|
+
export const filterScenariosByWizardInputType = (
|
|
113
|
+
scenarios: readonly Scenario[],
|
|
114
|
+
inputTypes: readonly WizardInputType[],
|
|
115
|
+
): Scenario[] =>
|
|
116
|
+
scenarios.filter((s) => inputTypes.includes(detectWizardInputType(s.id)));
|
|
117
|
+
|
|
94
118
|
/**
|
|
95
119
|
* Gets unique categories from scenarios
|
|
96
120
|
*
|
|
97
121
|
* @example
|
|
98
122
|
* const categories = getScenarioCategories(scenarios);
|
|
99
|
-
* // ["wedding", "fantasy", "adventure", ...]
|
|
100
123
|
*/
|
|
101
124
|
export const getScenarioCategories = (
|
|
102
125
|
scenarios: readonly Scenario[],
|