@umituz/react-native-ai-generation-content 1.37.16 → 1.37.19

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.16",
3
+ "version": "1.37.19",
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",
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Category Groups
3
+ * Pre-defined category groups for easy filtering
4
+ */
5
+
6
+ import { ScenarioCategory } from "./scenario-category.enum";
7
+
8
+ /**
9
+ * Single person categories - scenarios that work with one person
10
+ */
11
+ export const SINGLE_PERSON_CATEGORIES: readonly ScenarioCategory[] = [
12
+ ScenarioCategory.FANTASY,
13
+ ScenarioCategory.ADVENTURE,
14
+ ScenarioCategory.SPORTS,
15
+ ScenarioCategory.ARTISTIC,
16
+ ScenarioCategory.CINEMATIC,
17
+ ScenarioCategory.CREATIVE,
18
+ ScenarioCategory.FASHION,
19
+ ScenarioCategory.HOBBIES,
20
+ ScenarioCategory.EXTREME,
21
+ ScenarioCategory.GAMING,
22
+ ScenarioCategory.CAREER,
23
+ ScenarioCategory.EDUCATION,
24
+ ScenarioCategory.LIFESTYLE,
25
+ ScenarioCategory.LUXURY,
26
+ ScenarioCategory.CULINARY,
27
+ ScenarioCategory.SEASONAL,
28
+ ScenarioCategory.ANIMALS,
29
+ ScenarioCategory.CELEBRATIONS,
30
+ ScenarioCategory.WELLNESS,
31
+ ScenarioCategory.BUCKET_LIST,
32
+ ScenarioCategory.SOCIAL_MEDIA,
33
+ ScenarioCategory.MYTHOLOGY,
34
+ ScenarioCategory.FUTURE_TECH,
35
+ ScenarioCategory.ACTION_STEALTH,
36
+ ScenarioCategory.ECOLOGY,
37
+ ScenarioCategory.NOSTALGIA,
38
+ ScenarioCategory.MYSTICAL,
39
+ ScenarioCategory.SUPERHEROES,
40
+ ScenarioCategory.VILLAINOUS,
41
+ ScenarioCategory.ELITE,
42
+ ScenarioCategory.GOTHIC,
43
+ ScenarioCategory.DAILY_ESSENCE,
44
+ ScenarioCategory.MOVIE_LEGENDS,
45
+ ScenarioCategory.ICONIC_MOMENTS,
46
+ ScenarioCategory.FOLKLORE,
47
+ ScenarioCategory.MUSIC,
48
+ ScenarioCategory.STEAMPUNK,
49
+ ScenarioCategory.PERFORMANCE,
50
+ ScenarioCategory.FESTIVAL,
51
+ ScenarioCategory.HISTORICAL,
52
+ ScenarioCategory.CULTURAL,
53
+ ScenarioCategory.SCI_FI,
54
+ ScenarioCategory.TRAVEL,
55
+ ScenarioCategory.VINTAGE_SUMMER,
56
+ ScenarioCategory.DARK_ACADEMIA,
57
+ ScenarioCategory.RETRO_ARCADE,
58
+ ScenarioCategory.COZY_PLUSH,
59
+ ScenarioCategory.PIRATE_ERA,
60
+ ScenarioCategory.SAMURAI,
61
+ ScenarioCategory.SURREAL_DREAMS,
62
+ ScenarioCategory.MAGICAL_REALISM,
63
+ ScenarioCategory.VINTAGE_CIRCUS,
64
+ ScenarioCategory.ELEMENTAL,
65
+ ScenarioCategory.SPEED_DEMONS,
66
+ ScenarioCategory.UNDERWATER,
67
+ ScenarioCategory.ARABIAN_NIGHTS,
68
+ ScenarioCategory.PREHISTORIC,
69
+ ScenarioCategory.POST_APOCALYPTIC,
70
+ ];
71
+
72
+ /**
73
+ * Couple categories - scenarios designed for two people
74
+ */
75
+ export const COUPLE_CATEGORIES: readonly ScenarioCategory[] = [
76
+ ScenarioCategory.INTIMATE,
77
+ ScenarioCategory.WEDDING,
78
+ ScenarioCategory.AFFECTION,
79
+ ScenarioCategory.ROMANTIC_KISSES,
80
+ ScenarioCategory.SULTRY,
81
+ ScenarioCategory.STOLEN_MOMENTS,
82
+ ScenarioCategory.CONNECTION,
83
+ ScenarioCategory.FAMILY,
84
+ ScenarioCategory.TIME_TRAVEL,
85
+ ScenarioCategory.HOME_LIFE,
86
+ ScenarioCategory.ART_STUDIO,
87
+ ScenarioCategory.URBAN_NIGHTS,
88
+ ScenarioCategory.CASINO,
89
+ ];
90
+
91
+ /**
92
+ * All categories
93
+ */
94
+ export const ALL_CATEGORIES: readonly ScenarioCategory[] = [
95
+ ...SINGLE_PERSON_CATEGORIES,
96
+ ...COUPLE_CATEGORIES,
97
+ ];
@@ -11,12 +11,18 @@ export type { Scenario } from "./domain/Scenario";
11
11
  // Scenario Data
12
12
  export { SCENARIOS } from "./infrastructure/ScenariosData";
13
13
 
14
+ // Category Groups - Pre-defined category groups for filtering
15
+ export {
16
+ SINGLE_PERSON_CATEGORIES,
17
+ COUPLE_CATEGORIES,
18
+ ALL_CATEGORIES,
19
+ } from "./domain/category-groups";
20
+
14
21
  // Scenario Helpers - For app-level configuration
15
22
  export {
16
23
  createScenariosForApp,
17
24
  filterScenariosByOutputType,
18
25
  filterScenariosByCategory,
19
- filterScenariosByWizardInputType,
20
26
  getScenarioCategories,
21
27
  findScenarioById,
22
28
  } from "./infrastructure/scenario-helpers";
@@ -4,8 +4,6 @@
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";
9
7
 
10
8
  /**
11
9
  * Configuration for creating app-specific scenarios
@@ -15,61 +13,26 @@ export interface AppScenarioConfig {
15
13
  readonly outputType: ScenarioOutputType;
16
14
  /** Optional AI model to assign to all scenarios */
17
15
  readonly model?: string;
18
- /** Optional filter to exclude certain scenarios by ID */
19
- readonly excludeIds?: readonly string[];
20
- /** Optional filter to include only certain category IDs */
21
- readonly includeCategories?: readonly string[];
22
- /** Optional filter to exclude wizard input types (uses pattern detection) */
23
- readonly excludeWizardInputTypes?: readonly WizardInputType[];
16
+ /** Categories to include (whitelist) */
17
+ readonly categories: readonly string[];
24
18
  }
25
19
 
26
20
  /**
27
21
  * Creates app-configured scenarios from package scenarios
28
- * Apps use this to set their desired outputType and model
29
- *
30
- * @example
31
- * // Video generation app - exclude dual image scenarios
32
- * const scenarios = createScenariosForApp(SCENARIOS, {
33
- * outputType: "video",
34
- * model: "fal-ai/veo3/image-to-video",
35
- * excludeWizardInputTypes: [WizardInputType.DUAL_IMAGE]
36
- * });
22
+ * Uses whitelist approach - only includes specified categories
37
23
  */
38
24
  export const createScenariosForApp = (
39
25
  scenarios: readonly Scenario[],
40
26
  config: AppScenarioConfig,
41
27
  ): Scenario[] => {
42
- const {
43
- outputType,
44
- model,
45
- excludeIds,
46
- includeCategories,
47
- excludeWizardInputTypes,
48
- } = config;
28
+ const { outputType, model, categories } = config;
49
29
 
50
30
  return scenarios
51
31
  .filter((scenario) => {
52
- // Filter by excluded IDs
53
- if (excludeIds?.includes(scenario.id)) {
32
+ if (!scenario.category) {
54
33
  return false;
55
34
  }
56
- // Filter by included categories
57
- if (
58
- includeCategories &&
59
- includeCategories.length > 0 &&
60
- scenario.category &&
61
- !includeCategories.includes(scenario.category)
62
- ) {
63
- return false;
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
- }
72
- return true;
35
+ return categories.includes(scenario.category);
73
36
  })
74
37
  .map((scenario) => ({
75
38
  ...scenario,
@@ -79,10 +42,7 @@ export const createScenariosForApp = (
79
42
  };
80
43
 
81
44
  /**
82
- * Filters scenarios by output type (if they have one set)
83
- *
84
- * @example
85
- * const videoScenarios = filterScenariosByOutputType(scenarios, "video");
45
+ * Filters scenarios by output type
86
46
  */
87
47
  export const filterScenariosByOutputType = (
88
48
  scenarios: readonly Scenario[],
@@ -91,35 +51,14 @@ export const filterScenariosByOutputType = (
91
51
 
92
52
  /**
93
53
  * Filters scenarios by category
94
- *
95
- * @example
96
- * const weddingScenarios = filterScenariosByCategory(scenarios, "wedding");
97
54
  */
98
55
  export const filterScenariosByCategory = (
99
56
  scenarios: readonly Scenario[],
100
57
  category: string,
101
58
  ): Scenario[] => scenarios.filter((s) => s.category === category);
102
59
 
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
-
118
60
  /**
119
61
  * Gets unique categories from scenarios
120
- *
121
- * @example
122
- * const categories = getScenarioCategories(scenarios);
123
62
  */
124
63
  export const getScenarioCategories = (
125
64
  scenarios: readonly Scenario[],
@@ -135,9 +74,6 @@ export const getScenarioCategories = (
135
74
 
136
75
  /**
137
76
  * Finds a scenario by ID
138
- *
139
- * @example
140
- * const scenario = findScenarioById(scenarios, "beach_wedding");
141
77
  */
142
78
  export const findScenarioById = (
143
79
  scenarios: readonly Scenario[],