@umituz/react-native-ai-generation-content 1.37.17 → 1.37.20

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.17",
3
+ "version": "1.37.20",
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",
@@ -72,13 +72,14 @@ export function createCreationPersistence(config: CreationPersistenceConfig = {}
72
72
  creationId: string,
73
73
  data: CompletedCreationData,
74
74
  ): Promise<void> => {
75
+ const output: { imageUrl?: string; videoUrl?: string } = {};
76
+ if (data.imageUrl) output.imageUrl = data.imageUrl;
77
+ if (data.videoUrl) output.videoUrl = data.videoUrl;
78
+
75
79
  await repository.update(userId, creationId, {
76
80
  uri: data.uri,
77
81
  status: "completed" as const,
78
- output: {
79
- imageUrl: data.imageUrl,
80
- videoUrl: data.videoUrl,
81
- },
82
+ output,
82
83
  });
83
84
 
84
85
  if (typeof __DEV__ !== "undefined" && __DEV__) {
@@ -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,49 +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
22
+ * Uses whitelist approach - only includes specified categories
28
23
  */
29
24
  export const createScenariosForApp = (
30
25
  scenarios: readonly Scenario[],
31
26
  config: AppScenarioConfig,
32
27
  ): Scenario[] => {
33
- const {
34
- outputType,
35
- model,
36
- excludeIds,
37
- includeCategories,
38
- excludeWizardInputTypes,
39
- } = config;
28
+ const { outputType, model, categories } = config;
40
29
 
41
30
  return scenarios
42
31
  .filter((scenario) => {
43
- if (excludeIds?.includes(scenario.id)) {
32
+ if (!scenario.category) {
44
33
  return false;
45
34
  }
46
- if (
47
- includeCategories &&
48
- includeCategories.length > 0 &&
49
- scenario.category &&
50
- !includeCategories.includes(scenario.category)
51
- ) {
52
- return false;
53
- }
54
- if (excludeWizardInputTypes && excludeWizardInputTypes.length > 0) {
55
- const detectedType = detectWizardInputType(scenario.id);
56
- if (excludeWizardInputTypes.includes(detectedType)) {
57
- return false;
58
- }
59
- }
60
- return true;
35
+ return categories.includes(scenario.category);
61
36
  })
62
37
  .map((scenario) => ({
63
38
  ...scenario,
@@ -82,15 +57,6 @@ export const filterScenariosByCategory = (
82
57
  category: string,
83
58
  ): Scenario[] => scenarios.filter((s) => s.category === category);
84
59
 
85
- /**
86
- * Filters scenarios by wizard input type using pattern detection
87
- */
88
- export const filterScenariosByWizardInputType = (
89
- scenarios: readonly Scenario[],
90
- inputTypes: readonly WizardInputType[],
91
- ): Scenario[] =>
92
- scenarios.filter((s) => inputTypes.includes(detectWizardInputType(s.id)));
93
-
94
60
  /**
95
61
  * Gets unique categories from scenarios
96
62
  */