@umituz/react-native-ai-generation-content 1.57.0 → 1.57.2

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.57.0",
3
+ "version": "1.57.2",
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,7 +72,7 @@ export async function buildVideoInput(
72
72
 
73
73
  export function createVideoStrategy(options: CreateVideoStrategyOptions): WizardStrategy {
74
74
  const { scenario, creditCost } = options;
75
- const videoFeatureType = getVideoFeatureType(scenario.id);
75
+ const videoFeatureType = getVideoFeatureType(scenario);
76
76
 
77
77
  return {
78
78
  execute: async (input: unknown) => {
@@ -4,25 +4,40 @@
4
4
  */
5
5
 
6
6
  import type { VideoFeatureType } from "../../../../../domain/interfaces";
7
+ import type { WizardScenarioData } from "../../presentation/hooks/wizard-generation.types";
7
8
  import { VIDEO_FEATURE_PATTERNS } from "./wizard-strategy.constants";
8
9
 
9
10
  declare const __DEV__: boolean;
10
11
 
11
12
  /**
12
- * Determines the video feature type based on scenario ID
13
+ * Determines the video feature type from scenario
14
+ * Priority: featureType (app-controlled) > pattern matching > default
13
15
  */
14
- export function getVideoFeatureType(scenarioId: string): VideoFeatureType {
15
- const id = scenarioId.toLowerCase();
16
+ export function getVideoFeatureType(scenario: WizardScenarioData): VideoFeatureType {
17
+ const { id, featureType } = scenario;
16
18
 
17
- for (const [pattern, featureType] of Object.entries(VIDEO_FEATURE_PATTERNS)) {
18
- if (id.includes(pattern)) {
19
- return featureType;
19
+ // Primary: Use featureType from main app (package-driven design)
20
+ if (featureType) {
21
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
22
+ console.log("[VideoUtils] Using featureType from app", { id, featureType });
20
23
  }
24
+ return featureType;
21
25
  }
22
26
 
23
- // Default to image-to-video for content scenarios
27
+ // Fallback: Pattern matching for legacy scenarios
28
+ const lowerId = id.toLowerCase();
29
+ for (const [pattern, type] of Object.entries(VIDEO_FEATURE_PATTERNS)) {
30
+ if (lowerId.includes(pattern)) {
31
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
32
+ console.log("[VideoUtils] Pattern match", { id, pattern, type });
33
+ }
34
+ return type;
35
+ }
36
+ }
37
+
38
+ // Default: text-to-video
24
39
  if (typeof __DEV__ !== "undefined" && __DEV__) {
25
- console.log("[VideoUtils] Defaulting to image-to-video", { scenarioId });
40
+ console.log("[VideoUtils] Default to text-to-video", { id });
26
41
  }
27
- return "image-to-video";
42
+ return "text-to-video";
28
43
  }
@@ -19,6 +19,8 @@ export interface WizardScenarioData {
19
19
  readonly model?: string;
20
20
  readonly title?: string;
21
21
  readonly description?: string;
22
+ /** Video feature type - set by main app to control generation mode */
23
+ readonly featureType?: "text-to-video" | "image-to-video" | "ai-kiss" | "ai-hug";
22
24
  [key: string]: unknown;
23
25
  }
24
26
 
@@ -15,3 +15,7 @@ export {
15
15
  hasExplicitConfig,
16
16
  getScenarioWizardInputType,
17
17
  } from "./wizard-config-resolver";
18
+
19
+ // Pre-built Wizard Configs
20
+ export { TEXT_TO_VIDEO_WIZARD_CONFIG } from "../../generation/wizard/configs/text-to-video.config";
21
+ export { TEXT_TO_IMAGE_WIZARD_CONFIG } from "../../generation/wizard/configs/text-to-image.config";