@umituz/react-native-ai-generation-content 1.20.34 → 1.20.36
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.20.
|
|
3
|
+
"version": "1.20.36",
|
|
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",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useVideoPlayer, VideoView } from "expo-video";
|
|
3
|
+
|
|
4
|
+
interface VideoResultPlayerProps {
|
|
5
|
+
uri: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const VideoResultPlayer: React.FC<VideoResultPlayerProps> = ({ uri }) => {
|
|
9
|
+
const player = useVideoPlayer(uri, (player) => {
|
|
10
|
+
player.loop = true;
|
|
11
|
+
player.play();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<VideoView
|
|
16
|
+
style={{ width: "100%", aspectRatio: 2 / 3, borderRadius: 16 }}
|
|
17
|
+
player={player}
|
|
18
|
+
contentFit="cover"
|
|
19
|
+
nativeControls
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
@@ -17,23 +17,7 @@ import { AIGenerationResult } from "../display/AIGenerationResult";
|
|
|
17
17
|
import { AIGenerateStep } from "../../hooks/generation/useAIGenerateState";
|
|
18
18
|
import { useAIGenerateWizardFlow } from "./useAIGenerateWizardFlow";
|
|
19
19
|
import { AIGenerateWizardFlowProps } from "./AIGenerateWizardFlow.types";
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
const VideoResultPlayer = ({ uri }: { uri: string }) => {
|
|
23
|
-
const player = useVideoPlayer(uri, player => {
|
|
24
|
-
player.loop = true;
|
|
25
|
-
player.play();
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<VideoView
|
|
30
|
-
style={{ width: "100%", aspectRatio: 2 / 3, borderRadius: 16 }}
|
|
31
|
-
player={player}
|
|
32
|
-
contentFit="cover"
|
|
33
|
-
nativeControls
|
|
34
|
-
/>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
20
|
+
import { VideoResultPlayer } from "../display/VideoResultPlayer";
|
|
37
21
|
|
|
38
22
|
export const AIGenerateWizardFlow: React.FC<AIGenerateWizardFlowProps> = ({
|
|
39
23
|
featureType,
|
|
@@ -44,6 +28,7 @@ export const AIGenerateWizardFlow: React.FC<AIGenerateWizardFlowProps> = ({
|
|
|
44
28
|
onGenerate,
|
|
45
29
|
onBack: onBackProp,
|
|
46
30
|
onSave,
|
|
31
|
+
onShare,
|
|
47
32
|
t,
|
|
48
33
|
}) => {
|
|
49
34
|
const tokens = useAppDesignTokens();
|
|
@@ -130,6 +115,14 @@ export const AIGenerateWizardFlow: React.FC<AIGenerateWizardFlowProps> = ({
|
|
|
130
115
|
onPress: () => setCurrentStep(AIGenerateStep.CONFIG),
|
|
131
116
|
icon: "refresh",
|
|
132
117
|
}}
|
|
118
|
+
extraActions={[
|
|
119
|
+
{
|
|
120
|
+
label: translations.shareButton,
|
|
121
|
+
onPress: () => result && onShare?.(result),
|
|
122
|
+
icon: "share-variant",
|
|
123
|
+
variant: "outline",
|
|
124
|
+
},
|
|
125
|
+
]}
|
|
133
126
|
>
|
|
134
127
|
{isVideo && result ? (
|
|
135
128
|
<VideoResultPlayer uri={result} />
|
|
@@ -27,6 +27,7 @@ export interface AIGenerateWizardTranslations {
|
|
|
27
27
|
readonly processingHint: string;
|
|
28
28
|
readonly successTitle: string;
|
|
29
29
|
readonly saveButton: string;
|
|
30
|
+
readonly shareButton: string;
|
|
30
31
|
readonly tryAgainButton: string;
|
|
31
32
|
readonly fileTooLarge: string;
|
|
32
33
|
readonly maxFileSize: string;
|
|
@@ -45,6 +46,7 @@ export interface AIGenerateWizardFlowProps {
|
|
|
45
46
|
images: { uri: string }[];
|
|
46
47
|
}) => Promise<string | null | void>;
|
|
47
48
|
readonly onBack?: () => void;
|
|
48
|
-
readonly onSave?: (uri: string) => void
|
|
49
|
+
readonly onSave?: (uri: string) => Promise<void>;
|
|
50
|
+
readonly onShare?: (uri: string) => Promise<void>;
|
|
49
51
|
readonly t: (key: string) => string;
|
|
50
52
|
}
|