@umituz/react-native-ai-generation-content 1.26.65 → 1.26.67

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.26.65",
3
+ "version": "1.26.67",
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",
@@ -38,6 +38,9 @@ export interface GenericWizardFlowProps {
38
38
  readonly onGenerationComplete?: (result: unknown) => void;
39
39
  readonly onGenerationError?: (error: string) => void;
40
40
  readonly onCreditsExhausted?: () => void;
41
+ /** Auth check - orchestrator will check auth BEFORE credits */
42
+ readonly isAuthenticated?: () => boolean;
43
+ readonly onAuthRequired?: () => void;
41
44
  readonly onRate?: (creationId: string, rating: number, description: string) => Promise<boolean>;
42
45
  readonly onBack?: () => void;
43
46
  readonly onTryAgain?: () => void;
@@ -58,6 +61,8 @@ export const GenericWizardFlow: React.FC<GenericWizardFlowProps> = ({
58
61
  onGenerationComplete,
59
62
  onGenerationError,
60
63
  onCreditsExhausted,
64
+ isAuthenticated,
65
+ onAuthRequired,
61
66
  onRate,
62
67
  onBack,
63
68
  onTryAgain,
@@ -125,6 +130,8 @@ export const GenericWizardFlow: React.FC<GenericWizardFlowProps> = ({
125
130
  onError: onGenerationError,
126
131
  onProgressChange: handleProgressChange,
127
132
  onCreditsExhausted,
133
+ isAuthenticated,
134
+ onAuthRequired,
128
135
  });
129
136
 
130
137
  useEffect(() => {
@@ -36,6 +36,9 @@ export interface UseWizardGenerationProps {
36
36
  readonly onError?: (error: string) => void;
37
37
  readonly onProgressChange?: (progress: number) => void;
38
38
  readonly onCreditsExhausted?: () => void;
39
+ /** Auth check - if user not authenticated, onAuthRequired will be called */
40
+ readonly isAuthenticated?: () => boolean;
41
+ readonly onAuthRequired?: () => void;
39
42
  }
40
43
 
41
44
  export interface UseWizardGenerationReturn {
@@ -60,6 +63,8 @@ export const useWizardGeneration = (
60
63
  onError,
61
64
  onProgressChange,
62
65
  onCreditsExhausted,
66
+ isAuthenticated,
67
+ onAuthRequired,
63
68
  } = props;
64
69
 
65
70
  const hasStarted = useRef(false);
@@ -97,6 +102,10 @@ export const useWizardGeneration = (
97
102
  unknown: "An error occurred",
98
103
  },
99
104
  onCreditsExhausted,
105
+ // Auth config - check auth BEFORE credits
106
+ auth: isAuthenticated && onAuthRequired
107
+ ? { isAuthenticated, onAuthRequired }
108
+ : undefined,
100
109
  onSuccess: (result) => {
101
110
  if (typeof __DEV__ !== "undefined" && __DEV__) {
102
111
  console.log("[useWizardGeneration] Success");
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * Face Preservation Prompt Builder
3
3
  * Dynamic prompt builder for AI image generation with strict face identity preservation
4
- * Supports any number of people (1, 2, 3, N)
4
+ * Supports any number of people (1, 2, 3, N) and interaction styles
5
5
  *
6
6
  * Based on best practices:
7
7
  * - Face identity lock techniques
8
8
  * - @imageN reference anchors
9
+ * - Interaction style rules (romantic, friendly, etc.)
9
10
  * - Explicit preservation and negative constraints
10
11
  */
11
12
 
@@ -13,11 +14,16 @@
13
14
  // Types
14
15
  // =============================================================================
15
16
 
17
+ /** Interaction style between people in the image */
18
+ export type InteractionStyle = "romantic" | "friendly" | "professional" | "neutral";
19
+
16
20
  export interface FacePreservationOptions {
17
21
  /** The scenario/scene description */
18
22
  scenarioPrompt: string;
19
23
  /** Number of people in the generation */
20
24
  personCount: number;
25
+ /** Interaction style between people (default: neutral) */
26
+ interactionStyle?: InteractionStyle;
21
27
  /** Optional custom preservation rules from main app */
22
28
  customRules?: string[];
23
29
  /** Optional custom forbidden actions from main app */
@@ -43,6 +49,48 @@ const FORBIDDEN_ACTIONS = [
43
49
  "Do NOT change eye color or shape",
44
50
  ] as const;
45
51
 
52
+ /** Interaction style rules - what TO DO for each style */
53
+ const INTERACTION_RULES: Record<InteractionStyle, readonly string[]> = {
54
+ romantic: [
55
+ "Close physical proximity - touching, holding hands, arms around each other",
56
+ "Warm, genuine, loving smiles showing happiness",
57
+ "Affectionate eye contact or looking at camera together happily",
58
+ "Natural romantic body language - leaning into each other",
59
+ "Intimate connection visible between the two people",
60
+ ],
61
+ friendly: [
62
+ "Casual comfortable proximity",
63
+ "Genuine friendly smiles",
64
+ "Relaxed natural poses",
65
+ "Warm friendly body language",
66
+ ],
67
+ professional: [
68
+ "Appropriate professional distance",
69
+ "Confident pleasant expressions",
70
+ "Professional posture and positioning",
71
+ ],
72
+ neutral: [],
73
+ };
74
+
75
+ /** Interaction style forbidden - what NOT to do for each style */
76
+ const INTERACTION_FORBIDDEN: Record<InteractionStyle, readonly string[]> = {
77
+ romantic: [
78
+ "Do NOT position people far apart or distant from each other",
79
+ "Do NOT use cold, serious, stern, or angry expressions",
80
+ "Do NOT create stiff, awkward, or unnatural poses",
81
+ "Do NOT have people looking away from each other coldly",
82
+ "Do NOT show disconnection or emotional distance between people",
83
+ ],
84
+ friendly: [
85
+ "Do NOT use cold or unfriendly expressions",
86
+ "Do NOT create awkward distancing",
87
+ ],
88
+ professional: [
89
+ "Do NOT use overly casual or intimate positioning",
90
+ ],
91
+ neutral: [],
92
+ };
93
+
46
94
  // =============================================================================
47
95
  // Builder Functions
48
96
  // =============================================================================