@umituz/react-native-ai-generation-content 1.25.15 → 1.25.17

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.25.15",
3
+ "version": "1.25.17",
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",
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  import { useEffect, useRef, useMemo, useCallback } from "react";
8
- import * as FileSystem from "expo-file-system";
8
+ import { readFileAsBase64 } from "@umituz/react-native-design-system";
9
9
  import {
10
10
  useGenerationOrchestrator,
11
11
  type GenerationStrategy,
@@ -143,19 +143,6 @@ async function executeImageGeneration(
143
143
  }
144
144
  }
145
145
 
146
- async function convertUriToBase64(uri: string): Promise<string> {
147
- try {
148
- const base64 = await FileSystem.readAsStringAsync(uri, {
149
- encoding: FileSystem.EncodingType.Base64,
150
- });
151
- return base64;
152
- } catch (error) {
153
- if (typeof __DEV__ !== "undefined" && __DEV__) {
154
- console.error("[useWizardGeneration] Base64 conversion failed:", error);
155
- }
156
- throw new Error("Failed to convert image to base64");
157
- }
158
- }
159
146
 
160
147
  async function buildGenerationInput(
161
148
  wizardData: Record<string, unknown>,
@@ -188,11 +175,23 @@ async function buildGenerationInput(
188
175
  return null;
189
176
  }
190
177
 
178
+ // Convert images to base64 using design system utility
191
179
  const [photo1Base64, photo2Base64] = await Promise.all([
192
- convertUriToBase64(photo1.uri),
193
- convertUriToBase64(photo2.uri),
180
+ readFileAsBase64(photo1.uri),
181
+ readFileAsBase64(photo2.uri),
194
182
  ]);
195
183
 
184
+ // Validate base64 conversion results
185
+ if (!photo1Base64 || !photo2Base64) {
186
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
187
+ console.error("[useWizardGeneration] Failed to convert images to base64", {
188
+ photo1Success: !!photo1Base64,
189
+ photo2Success: !!photo2Base64,
190
+ });
191
+ }
192
+ return null;
193
+ }
194
+
196
195
  const prompt = scenario.aiPrompt || `Generate ${scenario.id} scene`;
197
196
  const outputType = scenario.outputType || "video"; // Default to video for backward compatibility
198
197