@umituz/react-native-ai-generation-content 1.84.0 → 1.84.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.84.0",
3
+ "version": "1.84.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",
@@ -34,7 +34,8 @@ export {
34
34
  extractAudioUrl, extractImageUrls, cleanBase64, addBase64Prefix, preparePhoto, preparePhotos,
35
35
  isValidBase64, getBase64Size, getBase64SizeMB, prepareImage, createDevCallbacks, createFeatureUtils,
36
36
  showVideoGenerationSuccess, handleGenerationError, showContentModerationWarning,
37
- mapJobStatusToGenerationStatus,
37
+ mapJobStatusToGenerationStatus, intensityToStrength,
38
+ resolveCoupleInput, prependContext,
38
39
  } from "../infrastructure/utils";
39
40
  export type {
40
41
  IntervalOptions, StatusCheckResult, ResultValidation, ValidateResultOptions,
@@ -0,0 +1,39 @@
1
+ import type { GenerationTarget } from "../../presentation/hooks/generation/useImageGenerationExecutor";
2
+
3
+ interface CoupleInputResult {
4
+ readonly target: GenerationTarget;
5
+ readonly imageUrls: string[];
6
+ }
7
+
8
+ /**
9
+ * Resolves generation target and image URLs based on couple/single mode.
10
+ * Eliminates non-null assertions by narrowing partner2PhotoUri internally.
11
+ */
12
+ export function resolveCoupleInput(
13
+ partner1PhotoUri: string,
14
+ partner2PhotoUri: string | null,
15
+ isCoupleMode: boolean,
16
+ singleTarget: GenerationTarget,
17
+ coupleTarget: GenerationTarget,
18
+ ): CoupleInputResult {
19
+ if (isCoupleMode && partner2PhotoUri) {
20
+ return {
21
+ target: coupleTarget,
22
+ imageUrls: [partner1PhotoUri, partner2PhotoUri],
23
+ };
24
+ }
25
+ return {
26
+ target: singleTarget,
27
+ imageUrls: [partner1PhotoUri],
28
+ };
29
+ }
30
+
31
+ /**
32
+ * Prepends optional context (e.g. appearance analysis) to a base prompt.
33
+ */
34
+ export function prependContext(
35
+ basePrompt: string,
36
+ context: string | undefined | null,
37
+ ): string {
38
+ return context ? `${context}\n\n${basePrompt}` : basePrompt;
39
+ }
@@ -20,3 +20,5 @@ export * from "./provider-validator.util";
20
20
  export * from "./base64.util";
21
21
  export * from "./video-result-extractor.util";
22
22
  export * from "./id-generator.util";
23
+ export * from "./intensity.util";
24
+ export * from "./couple-input.util";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Maps a 0-100 intensity slider value to AI model strength parameter.
3
+ * Range: 0→0.30, 50→0.61, 100→0.92
4
+ */
5
+ export const intensityToStrength = (intensity: number): number =>
6
+ 0.3 + (intensity / 100) * 0.62;