@umituz/react-native-ai-generation-content 1.72.17 → 1.72.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.72.
|
|
3
|
+
"version": "1.72.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",
|
package/src/domains/generation/wizard/infrastructure/strategies/video-generation.executor.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import type { WizardVideoInput } from "./video-generation.types";
|
|
8
8
|
import { GENERATION_TIMEOUT_MS, BASE64_IMAGE_PREFIX } from "./wizard-strategy.constants";
|
|
9
|
+
import { createGenerationError, GenerationErrorType } from "../../../../../infrastructure/utils/error-factory";
|
|
9
10
|
|
|
10
11
|
declare const __DEV__: boolean;
|
|
11
12
|
|
|
@@ -23,7 +24,8 @@ interface SubmissionResult {
|
|
|
23
24
|
error?: string;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
function formatBase64(base64: string): string {
|
|
27
|
+
function formatBase64(base64: string | undefined): string | undefined {
|
|
28
|
+
if (!base64) return undefined;
|
|
27
29
|
return base64.startsWith("data:") ? base64 : `${BASE64_IMAGE_PREFIX}${base64}`;
|
|
28
30
|
}
|
|
29
31
|
|
|
@@ -40,7 +42,11 @@ export async function executeVideoGeneration(
|
|
|
40
42
|
|
|
41
43
|
const provider = providerRegistry.getActiveProvider();
|
|
42
44
|
if (!provider?.isInitialized()) {
|
|
43
|
-
|
|
45
|
+
const error = createGenerationError(
|
|
46
|
+
GenerationErrorType.VALIDATION,
|
|
47
|
+
"AI provider is not initialized. Please check your configuration."
|
|
48
|
+
);
|
|
49
|
+
return { success: false, error: error.message };
|
|
44
50
|
}
|
|
45
51
|
|
|
46
52
|
try {
|
|
@@ -60,7 +66,8 @@ export async function executeVideoGeneration(
|
|
|
60
66
|
};
|
|
61
67
|
|
|
62
68
|
// Add image for image-to-video (Sora 2, etc.)
|
|
63
|
-
if
|
|
69
|
+
// Only add if sourceImage is defined and not empty
|
|
70
|
+
if (sourceImage && sourceImage.length > 0) {
|
|
64
71
|
modelInput.image_url = sourceImage;
|
|
65
72
|
}
|
|
66
73
|
|
|
@@ -114,7 +121,11 @@ export async function submitVideoGenerationToQueue(
|
|
|
114
121
|
|
|
115
122
|
const provider = providerRegistry.getActiveProvider();
|
|
116
123
|
if (!provider?.isInitialized()) {
|
|
117
|
-
|
|
124
|
+
const error = createGenerationError(
|
|
125
|
+
GenerationErrorType.VALIDATION,
|
|
126
|
+
"AI provider is not initialized. Please check your configuration."
|
|
127
|
+
);
|
|
128
|
+
return { success: false, error: error.message };
|
|
118
129
|
}
|
|
119
130
|
|
|
120
131
|
try {
|
|
@@ -125,7 +136,8 @@ export async function submitVideoGenerationToQueue(
|
|
|
125
136
|
};
|
|
126
137
|
|
|
127
138
|
// Add image for image-to-video
|
|
128
|
-
if
|
|
139
|
+
// Only add if sourceImage is defined and not empty
|
|
140
|
+
if (sourceImage && sourceImage.length > 0) {
|
|
129
141
|
modelInput.image_url = sourceImage;
|
|
130
142
|
}
|
|
131
143
|
|
|
@@ -144,6 +156,22 @@ export async function submitVideoGenerationToQueue(
|
|
|
144
156
|
|
|
145
157
|
return { success: true, requestId: submission.requestId, model };
|
|
146
158
|
} catch (error) {
|
|
147
|
-
|
|
159
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
160
|
+
console.error("[VideoExecutor] Queue submission error:", error);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
let errorMessage = "Failed to submit video generation to queue. Please try again.";
|
|
164
|
+
|
|
165
|
+
if (error instanceof Error) {
|
|
166
|
+
const message = error.message.toLowerCase();
|
|
167
|
+
|
|
168
|
+
if (message.includes("network") || message.includes("connection")) {
|
|
169
|
+
errorMessage = "Network error. Please check your internet connection and try again.";
|
|
170
|
+
} else {
|
|
171
|
+
errorMessage = `Queue submission failed: ${error.message}`;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return { success: false, error: errorMessage };
|
|
148
176
|
}
|
|
149
177
|
}
|
package/src/domains/generation/wizard/presentation/components/step-renderers/renderTextInputStep.tsx
CHANGED
|
@@ -48,7 +48,7 @@ export function renderTextInputStep({
|
|
|
48
48
|
continueButton: t("common.continue"),
|
|
49
49
|
backButton: t("common.back"),
|
|
50
50
|
examplesTitle: t("textInput.examplesTitle"),
|
|
51
|
-
contentNotAllowed:
|
|
51
|
+
contentNotAllowed: t("common.error"),
|
|
52
52
|
contentNotAllowedMessage: alertMessages?.policyViolation || "This type of content is not supported. Please try a different prompt.",
|
|
53
53
|
}}
|
|
54
54
|
config={{
|