@umituz/react-native-ai-generation-content 1.90.12 → 1.90.13

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.90.12",
3
+ "version": "1.90.13",
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",
@@ -125,7 +125,6 @@ export function CreationImagePreview({
125
125
  source={{ uri }}
126
126
  style={styles.image}
127
127
  contentFit="cover"
128
- transition={0}
129
128
  cachePolicy="disk"
130
129
  onError={handleImageError}
131
130
  onLoadEnd={handleLoadEnd}
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import { useEffect } from 'react';
7
- import type { Creation } from '../../../../domain/entities/Creation';
7
+ import type { Creation } from '../../../domain/entities/Creation';
8
8
 
9
9
  export interface UseProcessingJobsPollerConfig {
10
10
  userId: string | null;
@@ -46,7 +46,6 @@ export function CreationsGalleryScreen({
46
46
  useProcessingJobsPoller({
47
47
  userId,
48
48
  creations: creations ?? [],
49
- repository,
50
49
  enabled: !!userId && (creations?.length ?? 0) > 0,
51
50
  });
52
51
 
@@ -29,8 +29,8 @@ export async function prepareCoupleGeneration(
29
29
  // 1. GET PHOTO URIs - Couple mode kontrolü
30
30
  const photoUris =
31
31
  isCoupleMode && partner2PhotoUri
32
- ? [partner1PhotoUri, partner2PhotoUri]
33
- : [partner1PhotoUri];
32
+ ? [partner1PhotoUri || "", partner2PhotoUri]
33
+ : [partner1PhotoUri || ""];
34
34
 
35
35
  logBuilderStep(prefix, "STEP 1: PHOTO URIs", {
36
36
  photoUrisCount: photoUris.length,
@@ -39,7 +39,7 @@ export function buildCoupleGenerationResult(
39
39
  });
40
40
 
41
41
  const { target, imageUrls } = resolveCoupleInput(
42
- partner1PhotoUri,
42
+ partner1PhotoUri || "",
43
43
  partner2PhotoUri,
44
44
  isCoupleMode,
45
45
  { model: "p-image-edit", providerId: "pruna" }, // Single target
@@ -44,8 +44,8 @@ export async function buildScenarioGenerationInput(
44
44
  // 1. GET PHOTO URIs
45
45
  const photoUris =
46
46
  isCoupleMode && partner2PhotoUri
47
- ? [partner1PhotoUri, partner2PhotoUri]
48
- : [partner1PhotoUri];
47
+ ? [partner1PhotoUri || "", partner2PhotoUri]
48
+ : [partner1PhotoUri || ""];
49
49
 
50
50
  logBuilderStep("[ScenarioBuilder]", "STEP 1: PHOTO URIs", {
51
51
  photoUrisCount: photoUris.length,
@@ -80,7 +80,7 @@ export async function buildScenarioGenerationInput(
80
80
  logBuilderStep("[ScenarioBuilder]", "STEP 4: RESOLVE COUPLE INPUT");
81
81
 
82
82
  const { target, imageUrls } = resolveCoupleInput(
83
- partner1PhotoUri,
83
+ partner1PhotoUri || "",
84
84
  partner2PhotoUri,
85
85
  isCoupleMode,
86
86
  { model: "p-image-edit", providerId: "pruna" }, // Single target
@@ -81,7 +81,7 @@ export function useAIGeneration(
81
81
  // Use orchestrator for lifecycle management
82
82
  const orchestrator = useGenerationOrchestrator(strategy, {
83
83
  userId,
84
- alertMessages: alertMessages || DEFAULT_ALERT_MESSAGES,
84
+ alertMessages: (alertMessages || DEFAULT_ALERT_MESSAGES) as typeof DEFAULT_ALERT_MESSAGES,
85
85
  onSuccess: async (result) => onSuccess?.(result),
86
86
  onError: onError ? async (error) => onError(error.message) : undefined,
87
87
  });
@@ -59,13 +59,13 @@ export async function buildVideoInput(
59
59
  const prompt = (wizardData.prompt as string | undefined) || scenario.prompt || "";
60
60
  const input: WizardVideoInput = {
61
61
  prompt,
62
- sourceImageBase64: wizardData.sourceImageBase64 as string | undefined,
63
- targetImageBase64: wizardData.targetImageBase64 as string | undefined,
64
- duration: wizardData.duration as number | undefined,
65
- aspectRatio: wizardData.aspectRatio as string | undefined,
66
- resolution: wizardData.resolution as string | undefined,
67
- audioUrl: wizardData.audioUrl as string | undefined,
68
- qualityMode: wizardData.qualityMode as "draft" | "normal" | undefined,
62
+ sourceImageBase64: typeof wizardData.sourceImageBase64 === 'string' ? wizardData.sourceImageBase64 : undefined,
63
+ targetImageBase64: typeof wizardData.targetImageBase64 === 'string' ? wizardData.targetImageBase64 : undefined,
64
+ duration: typeof wizardData.duration === 'number' ? wizardData.duration : undefined,
65
+ aspectRatio: typeof wizardData.aspectRatio === 'string' ? wizardData.aspectRatio : undefined,
66
+ resolution: typeof wizardData.resolution === 'string' ? wizardData.resolution : undefined,
67
+ audioUrl: typeof wizardData.audioUrl === 'string' ? wizardData.audioUrl : undefined,
68
+ qualityMode: wizardData.qualityMode === "draft" || wizardData.qualityMode === "normal" ? wizardData.qualityMode : undefined,
69
69
  };
70
70
 
71
71
  return input;
@@ -76,7 +76,7 @@ export function usePhotoBlockingGeneration(
76
76
  );
77
77
 
78
78
  const { generate, isGenerating } = useGenerationOrchestrator(strategy, {
79
- userId,
79
+ userId: userId || null,
80
80
  alertMessages,
81
81
  onSuccess: handleSuccess,
82
82
  onError: handleError,
@@ -58,6 +58,7 @@ export function useGeneration(options: UseGenerationOptions): UseGenerationRetur
58
58
  setProgress,
59
59
  setError,
60
60
  } = useImageToVideoGenerationInternal({
61
+ ...formState,
61
62
  onError: callbacks.onError,
62
63
  });
63
64
 
@@ -70,7 +70,7 @@ export function useGeneration(options: UseGenerationOptions): UseGenerationRetur
70
70
 
71
71
  // Use orchestrator
72
72
  const { generate, isGenerating, error } = useGenerationOrchestrator(strategy, {
73
- userId: userId ?? undefined,
73
+ userId: userId ?? null,
74
74
  alertMessages: DEFAULT_ALERT_MESSAGES,
75
75
  onSuccess: async (result) => {
76
76
  const imageUrls = result as string[];
@@ -101,8 +101,8 @@ export function useTextToVideoFeature(props: UseTextToVideoFeatureProps): UseTex
101
101
  return {
102
102
  success: true,
103
103
  requestId,
104
- videoUrl: (result as TextToVideoResult)?.videoUrl || null,
105
- thumbnailUrl: (result as TextToVideoResult)?.thumbnailUrl || null,
104
+ videoUrl: (result as TextToVideoResult)?.videoUrl || undefined,
105
+ thumbnailUrl: (result as TextToVideoResult)?.thumbnailUrl || undefined,
106
106
  };
107
107
  } catch (error) {
108
108
  const message = error instanceof Error ? error.message : "Generation failed";
@@ -62,7 +62,7 @@ export {
62
62
  export type {
63
63
  ValidationResult,
64
64
  StringValidationOptions,
65
- NumericValidationOptions,
65
+ NumberValidationOptions,
66
66
  } from "../infrastructure/validation/input-validator";
67
67
 
68
68
  // Orchestration
@@ -13,6 +13,10 @@ import { validateString, validateURL, validateBase64, type ValidationResult, typ
13
13
  * Validates prompt/input text for AI generation
14
14
  */
15
15
  export function validateAIPrompt(input: unknown): ValidationResult {
16
+ if (typeof input !== "string") {
17
+ return { isValid: false, errors: { type: "Prompt must be a string" } };
18
+ }
19
+
16
20
  const options: StringValidationOptions = {
17
21
  minLength: MIN_PROMPT_LENGTH,
18
22
  maxLength: MAX_PROMPT_LENGTH,
@@ -69,7 +69,7 @@ export const useDualImageGeneration = (
69
69
 
70
70
  // Use orchestrator for credit/error handling
71
71
  const orchestrator = useGenerationOrchestrator(strategy, {
72
- userId,
72
+ userId: userId || null,
73
73
  alertMessages,
74
74
  onSuccess: async (result) => onSuccess?.(result as string),
75
75
  onError: async (error) => onError?.(error.message),
@@ -86,7 +86,7 @@ export const useImageGeneration = <TInput extends ImageGenerationInput, TResult>
86
86
  const handleError = useCallback((error: { message: string }) => onError?.(error.message), [onError]);
87
87
 
88
88
  return useGenerationOrchestrator(strategy, {
89
- userId,
89
+ userId: userId || null,
90
90
  alertMessages,
91
91
  onSuccess: onSuccess ? async (result) => onSuccess(result as TResult) : undefined,
92
92
  onError: async (error) => handleError(error),
@@ -101,7 +101,7 @@ export const useVideoGeneration = <TResult>(
101
101
  );
102
102
 
103
103
  return useGenerationOrchestrator(strategy, {
104
- userId,
104
+ userId: userId || null,
105
105
  alertMessages,
106
106
  onSuccess: onSuccess ? async (result) => onSuccess(result as TResult) : undefined,
107
107
  onError: async (error) => handleError(error),