@umituz/react-native-ai-generation-content 1.89.72 → 1.89.73

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.89.72",
3
+ "version": "1.89.73",
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",
@@ -54,8 +54,9 @@ export const AudioPickerScreen: React.FC<AudioPickerScreenProps> = ({
54
54
  setError(null);
55
55
 
56
56
  // Lazy load expo-document-picker only when needed
57
- // @ts-ignore - Optional peer dependency
58
- const DocumentPicker = await import("expo-document-picker");
57
+ // Use require() to avoid Metro bundler parsing the package
58
+ // @ts-expect-error - Optional peer dependency
59
+ const DocumentPicker = require("expo-document-picker");
59
60
  const result = await DocumentPicker.getDocumentAsync({
60
61
  type: mimeTypes as string[],
61
62
  copyToCacheDirectory: true,
@@ -1,25 +1,32 @@
1
1
  import React from "react";
2
- import { ActivityIndicator, View } from "react-native";
2
+ import { View } from "react-native";
3
3
  import { AtomicText } from "@umituz/react-native-design-system/atoms";
4
4
 
5
5
  interface VideoResultPlayerProps {
6
6
  uri: string;
7
+ VideoPlayerComponent?: React.ComponentType<{ uri: string }>;
7
8
  }
8
9
 
9
- export const VideoResultPlayer: React.FC<VideoResultPlayerProps> = ({ uri }) => {
10
- const [VideoPlayer, setVideoPlayer] = React.useState<any>(null);
11
-
12
- React.useEffect(() => {
13
- // Lazy load video player only when needed
14
- // @ts-ignore - Optional peer dependency
15
- import("@umituz/react-native-video-editor").then((module) => {
16
- setVideoPlayer(() => module.VideoPlayer);
17
- }).catch(() => {
18
- // Video player not available, will show fallback
19
- });
20
- }, []);
21
-
22
- if (!VideoPlayer) {
10
+ /**
11
+ * Video Result Player Component
12
+ *
13
+ * This component displays video content. It accepts an optional VideoPlayerComponent prop
14
+ * that should be passed in from the consumer application if video support is desired.
15
+ *
16
+ * If no VideoPlayerComponent is provided, it shows a fallback UI.
17
+ *
18
+ * @example With video player
19
+ * import { VideoPlayer } from '@umituz/react-native-video-editor';
20
+ * <VideoResultPlayer uri={videoUri} VideoPlayerComponent={VideoPlayer} />
21
+ *
22
+ * @example Without video player (fallback)
23
+ * <VideoResultPlayer uri={videoUri} />
24
+ */
25
+ export const VideoResultPlayer: React.FC<VideoResultPlayerProps> = ({
26
+ uri,
27
+ VideoPlayerComponent,
28
+ }) => {
29
+ if (!VideoPlayerComponent) {
23
30
  return (
24
31
  <View style={{ width: "100%", aspectRatio: 2 / 3, borderRadius: 16, backgroundColor: "#000", justifyContent: "center", alignItems: "center" }}>
25
32
  <AtomicText style={{ color: "#fff" }}>Video not available</AtomicText>
@@ -27,14 +34,5 @@ export const VideoResultPlayer: React.FC<VideoResultPlayerProps> = ({ uri }) =>
27
34
  );
28
35
  }
29
36
 
30
- return (
31
- <VideoPlayer
32
- source={uri}
33
- loop
34
- autoPlay
35
- showControls
36
- contentFit="cover"
37
- style={{ width: "100%", aspectRatio: 2 / 3, borderRadius: 16 }}
38
- />
39
- );
37
+ return <VideoPlayerComponent uri={uri} />;
40
38
  };