@umituz/react-native-ai-generation-content 1.37.24 → 1.37.26
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.37.
|
|
3
|
+
"version": "1.37.26",
|
|
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",
|
|
@@ -43,18 +43,9 @@ export const GalleryHeader: React.FC<GalleryHeaderProps> = ({
|
|
|
43
43
|
<View>
|
|
44
44
|
<View style={styles.titleRow}>
|
|
45
45
|
<AtomicText style={styles.title}>{title}</AtomicText>
|
|
46
|
-
{pendingCount > 0 && (
|
|
47
|
-
<View style={[styles.pendingBadge, { backgroundColor: tokens.colors.primary }]}>
|
|
48
|
-
<AtomicIcon name="sync-outline" size="xs" color="onPrimary" />
|
|
49
|
-
<AtomicText style={[styles.pendingBadgeText, { color: tokens.colors.onPrimary }]}>
|
|
50
|
-
{pendingCount}
|
|
51
|
-
</AtomicText>
|
|
52
|
-
</View>
|
|
53
|
-
)}
|
|
54
46
|
</View>
|
|
55
47
|
<AtomicText style={styles.subtitle}>
|
|
56
48
|
{count} {countLabel}
|
|
57
|
-
{pendingCount > 0 && pendingLabel ? ` · ${pendingCount} ${pendingLabel}` : ""}
|
|
58
49
|
</AtomicText>
|
|
59
50
|
</View>
|
|
60
51
|
{showFilter && filterButtons.length > 0 && (
|
|
@@ -29,6 +29,7 @@ export type {
|
|
|
29
29
|
export function useImageToVideoFeature(props: UseImageToVideoFeatureProps): UseImageToVideoFeatureReturn {
|
|
30
30
|
const { config, callbacks, userId } = props;
|
|
31
31
|
const [state, setState] = useState(INITIAL_STATE);
|
|
32
|
+
const currentCreationIdRef = useMemo(() => ({ value: "" }), []);
|
|
32
33
|
|
|
33
34
|
const strategy: GenerationStrategy<VideoGenerationInput, ImageToVideoResult> = useMemo(
|
|
34
35
|
() => ({
|
|
@@ -37,6 +38,7 @@ export function useImageToVideoFeature(props: UseImageToVideoFeatureProps): UseI
|
|
|
37
38
|
console.log("[ImageToVideo] Executing generation, creationId:", input.creationId);
|
|
38
39
|
}
|
|
39
40
|
|
|
41
|
+
currentCreationIdRef.value = input.creationId;
|
|
40
42
|
config.onProcessingStart?.();
|
|
41
43
|
|
|
42
44
|
callbacks?.onGenerationStart?.({
|
|
@@ -75,9 +77,9 @@ export function useImageToVideoFeature(props: UseImageToVideoFeatureProps): UseI
|
|
|
75
77
|
},
|
|
76
78
|
getCreditCost: () => config.creditCost ?? 0,
|
|
77
79
|
save: async (result) => {
|
|
78
|
-
if (result.success && result.videoUrl && state.imageUri) {
|
|
80
|
+
if (result.success && result.videoUrl && state.imageUri && currentCreationIdRef.value) {
|
|
79
81
|
await callbacks?.onCreationSave?.({
|
|
80
|
-
creationId:
|
|
82
|
+
creationId: currentCreationIdRef.value,
|
|
81
83
|
type: "image-to-video",
|
|
82
84
|
videoUrl: result.videoUrl,
|
|
83
85
|
thumbnailUrl: result.thumbnailUrl,
|
|
@@ -86,7 +88,7 @@ export function useImageToVideoFeature(props: UseImageToVideoFeatureProps): UseI
|
|
|
86
88
|
}
|
|
87
89
|
},
|
|
88
90
|
}),
|
|
89
|
-
[config, callbacks, userId, state.imageUri],
|
|
91
|
+
[config, callbacks, userId, state.imageUri, currentCreationIdRef],
|
|
90
92
|
);
|
|
91
93
|
|
|
92
94
|
const orchestrator = useGenerationOrchestrator(strategy, {
|
|
@@ -74,6 +74,8 @@ export function useTextToVideoFeature(props: UseTextToVideoFeatureProps): UseTex
|
|
|
74
74
|
const { config, callbacks, userId, buildInput, extractResult } = props;
|
|
75
75
|
const [state, setState] = useState<TextToVideoFeatureState>(INITIAL_STATE);
|
|
76
76
|
|
|
77
|
+
const currentCreationIdRef = useMemo(() => ({ value: "" }), []);
|
|
78
|
+
|
|
77
79
|
const strategy: GenerationStrategy<VideoGenerationInput, TextToVideoResult> = useMemo(
|
|
78
80
|
() => ({
|
|
79
81
|
execute: async (input) => {
|
|
@@ -81,6 +83,8 @@ export function useTextToVideoFeature(props: UseTextToVideoFeatureProps): UseTex
|
|
|
81
83
|
console.log("[TextToVideo] Executing generation:", input.prompt.slice(0, 100));
|
|
82
84
|
}
|
|
83
85
|
|
|
86
|
+
currentCreationIdRef.value = input.creationId;
|
|
87
|
+
|
|
84
88
|
callbacks.onGenerationStart?.({
|
|
85
89
|
creationId: input.creationId,
|
|
86
90
|
type: "text-to-video",
|
|
@@ -111,9 +115,9 @@ export function useTextToVideoFeature(props: UseTextToVideoFeatureProps): UseTex
|
|
|
111
115
|
},
|
|
112
116
|
getCreditCost: () => config.creditCost,
|
|
113
117
|
save: async (result) => {
|
|
114
|
-
if (result.success && result.videoUrl) {
|
|
118
|
+
if (result.success && result.videoUrl && currentCreationIdRef.value) {
|
|
115
119
|
await callbacks.onCreationSave?.({
|
|
116
|
-
creationId:
|
|
120
|
+
creationId: currentCreationIdRef.value,
|
|
117
121
|
type: "text-to-video",
|
|
118
122
|
videoUrl: result.videoUrl,
|
|
119
123
|
thumbnailUrl: result.thumbnailUrl,
|
|
@@ -122,7 +126,7 @@ export function useTextToVideoFeature(props: UseTextToVideoFeatureProps): UseTex
|
|
|
122
126
|
}
|
|
123
127
|
},
|
|
124
128
|
}),
|
|
125
|
-
[config, callbacks, buildInput, extractResult, userId, state.prompt],
|
|
129
|
+
[config, callbacks, buildInput, extractResult, userId, state.prompt, currentCreationIdRef],
|
|
126
130
|
);
|
|
127
131
|
|
|
128
132
|
const orchestrator = useGenerationOrchestrator(strategy, {
|