@umituz/react-native-ai-generation-content 1.17.215 → 1.17.217
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 +7 -4
- package/src/domain/interfaces/app-services.interface.ts +19 -0
- package/src/domains/creations/presentation/components/CreationDetail/DetailVideo.tsx +4 -4
- package/src/domains/creations/presentation/screens/CreationDetailScreen.tsx +1 -1
- package/src/features/couple-future/presentation/hooks/useCoupleFutureGeneration.ts +2 -1
- package/src/features/meme-generator/presentation/components/MemeGeneratorFeature.tsx +21 -7
- package/src/index.ts +1 -0
- package/src/presentation/components/result/GenerationResultContent.tsx +3 -3
- package/src/types/globals.d.ts +0 -81
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-ai-generation-content",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.217",
|
|
4
4
|
"description": "Provider-agnostic AI generation orchestration for React Native",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"src"
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
|
-
"typecheck": "tsc --noEmit",
|
|
19
|
+
"typecheck": "tsc --noEmit --skipLibCheck",
|
|
20
20
|
"lint": "eslint src --ext .ts,.tsx --max-warnings 0",
|
|
21
21
|
"lint:fix": "eslint src --ext .ts,.tsx --fix"
|
|
22
22
|
},
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@react-navigation/native": ">=6.0.0",
|
|
52
52
|
"@tanstack/react-query": ">=5.0.0",
|
|
53
|
+
"@umituz/react-native-video-editor": ">=1.0.0",
|
|
53
54
|
"expo-linear-gradient": ">=15.0.0",
|
|
54
55
|
"firebase": ">=10.0.0",
|
|
55
56
|
"react": ">=18.0.0",
|
|
56
57
|
"react-native": ">=0.74.0",
|
|
57
|
-
"react-native-safe-area-context": ">=4.0.0"
|
|
58
|
-
"@umituz/react-native-video-editor": ">=1.0.0"
|
|
58
|
+
"react-native-safe-area-context": ">=4.0.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@expo/vector-icons": "^15.0.3",
|
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
"@umituz/react-native-timezone": "latest",
|
|
82
82
|
"@umituz/react-native-uuid": "latest",
|
|
83
83
|
"eslint": "^9.0.0",
|
|
84
|
+
"expo-apple-authentication": "^8.0.8",
|
|
84
85
|
"expo-application": "^7.0.8",
|
|
85
86
|
"expo-clipboard": "^8.0.8",
|
|
86
87
|
"expo-crypto": "^15.0.8",
|
|
@@ -90,6 +91,7 @@
|
|
|
90
91
|
"expo-image": "^3.0.11",
|
|
91
92
|
"expo-linear-gradient": "~15.0.7",
|
|
92
93
|
"expo-localization": "^17.0.8",
|
|
94
|
+
"expo-network": "^8.0.8",
|
|
93
95
|
"expo-sharing": "^14.0.8",
|
|
94
96
|
"expo-video": "^3.0.15",
|
|
95
97
|
"firebase": "^12.6.0",
|
|
@@ -100,6 +102,7 @@
|
|
|
100
102
|
"react-native-gesture-handler": "^2.30.0",
|
|
101
103
|
"react-native-reanimated": "^4.2.1",
|
|
102
104
|
"react-native-safe-area-context": "^5.6.2",
|
|
105
|
+
"react-native-svg": "^15.15.1",
|
|
103
106
|
"rn-emoji-keyboard": "^1.7.0",
|
|
104
107
|
"typescript": "^5.9.0",
|
|
105
108
|
"zustand": "^5.0.2"
|
|
@@ -104,6 +104,24 @@ export interface IAnalyticsService {
|
|
|
104
104
|
track: (event: string, data: Record<string, unknown>) => void;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
/**
|
|
108
|
+
* Feature utils interface (optional)
|
|
109
|
+
* Provides utility functions for AI features
|
|
110
|
+
*/
|
|
111
|
+
export interface IFeatureUtils {
|
|
112
|
+
/**
|
|
113
|
+
* Select image from gallery
|
|
114
|
+
* @returns Image URI or null if cancelled
|
|
115
|
+
*/
|
|
116
|
+
selectImage: () => Promise<string | null>;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Save video to device library
|
|
120
|
+
* @param uri - Video URI to save
|
|
121
|
+
*/
|
|
122
|
+
saveVideo: (uri: string) => Promise<void>;
|
|
123
|
+
}
|
|
124
|
+
|
|
107
125
|
/**
|
|
108
126
|
* Combined app services interface
|
|
109
127
|
* Apps implement this to provide all required services
|
|
@@ -114,6 +132,7 @@ export interface IAppServices {
|
|
|
114
132
|
readonly paywall: IPaywallService;
|
|
115
133
|
readonly auth: IAuthService;
|
|
116
134
|
readonly analytics?: IAnalyticsService;
|
|
135
|
+
readonly featureUtils?: IFeatureUtils;
|
|
117
136
|
}
|
|
118
137
|
|
|
119
138
|
/**
|
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
* Video player with thumbnail and play controls for creation detail view
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import React, { useMemo
|
|
7
|
-
import { View
|
|
6
|
+
import React, { useMemo } from "react";
|
|
7
|
+
import { View } from "react-native";
|
|
8
8
|
import { VideoView, useVideoPlayer } from "expo-video";
|
|
9
9
|
import { useResponsive } from "@umituz/react-native-design-system";
|
|
10
10
|
|
|
11
11
|
interface DetailVideoProps {
|
|
12
12
|
readonly videoUrl: string;
|
|
13
|
-
readonly
|
|
13
|
+
readonly _thumbnailUrl?: string;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export const DetailVideo: React.FC<DetailVideoProps> = ({
|
|
17
17
|
videoUrl,
|
|
18
|
-
|
|
18
|
+
_thumbnailUrl,
|
|
19
19
|
}) => {
|
|
20
20
|
const { width, horizontalPadding, spacingMultiplier } = useResponsive();
|
|
21
21
|
const videoWidth = width - (horizontalPadding * 2);
|
|
@@ -89,7 +89,7 @@ export const CreationDetailScreen: React.FC<CreationDetailScreenProps> = ({
|
|
|
89
89
|
showsVerticalScrollIndicator={false}
|
|
90
90
|
>
|
|
91
91
|
{isVideo ? (
|
|
92
|
-
<DetailVideo videoUrl={videoUrl}
|
|
92
|
+
<DetailVideo videoUrl={videoUrl} _thumbnailUrl={thumbnailUrl} />
|
|
93
93
|
) : (
|
|
94
94
|
<DetailImage uri={creation.uri} onPress={handleImagePress} />
|
|
95
95
|
)}
|
|
@@ -4,11 +4,12 @@ import { executeCoupleFuture } from "../../infrastructure/executor";
|
|
|
4
4
|
import type { CoupleFutureInput } from "../../domain/types";
|
|
5
5
|
import type { PhotoGenerationConfig, PhotoGenerationError } from "../../../../presentation/hooks/photo-generation.types";
|
|
6
6
|
import { createCreationsRepository } from "../../../../domains/creations/infrastructure/adapters";
|
|
7
|
+
import type { Creation } from "../../../../domains/creations/domain/entities/Creation";
|
|
7
8
|
|
|
8
9
|
export interface UseCoupleFutureGenerationConfig<TInput extends CoupleFutureInput, TResult> {
|
|
9
10
|
userId: string | undefined;
|
|
10
11
|
processResult: (imageUrl: string, input: TInput) => Promise<TResult> | TResult;
|
|
11
|
-
buildCreation?: (result: TResult, input: TInput) =>
|
|
12
|
+
buildCreation?: (result: TResult, input: TInput) => Creation | null;
|
|
12
13
|
deductCredits?: () => Promise<void>;
|
|
13
14
|
onSuccess?: (result: TResult) => void;
|
|
14
15
|
onError?: (error: string) => void;
|
|
@@ -17,10 +17,20 @@ import { GenerationResultContent } from "../../../../presentation/components/res
|
|
|
17
17
|
|
|
18
18
|
// Constants (Using default provided styles if config doesn't override)
|
|
19
19
|
import { DEFAULT_IMAGE_STYLES } from "../../../text-to-image/domain/constants/styles.constants";
|
|
20
|
+
import type { TextToImageFeatureConfig } from "../../../text-to-image/domain/types";
|
|
20
21
|
|
|
21
22
|
export interface MemeGeneratorFeatureProps {
|
|
22
|
-
config:
|
|
23
|
-
|
|
23
|
+
config: TextToImageFeatureConfig & {
|
|
24
|
+
styles?: Array<{
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
emoji?: string;
|
|
28
|
+
icon?: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
}>;
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
};
|
|
33
|
+
translations: Record<string, string>;
|
|
24
34
|
onSaveImage: (url: string) => Promise<void>;
|
|
25
35
|
onBeforeProcess?: () => Promise<boolean>;
|
|
26
36
|
}
|
|
@@ -36,10 +46,16 @@ export const MemeGeneratorFeature: React.FC<MemeGeneratorFeatureProps> = ({
|
|
|
36
46
|
const userId = authService.getUserId() || "anonymous";
|
|
37
47
|
|
|
38
48
|
// Config can override styles, or use defaults
|
|
39
|
-
const stylesList = config.styles || DEFAULT_IMAGE_STYLES
|
|
49
|
+
const stylesList = config.styles || DEFAULT_IMAGE_STYLES;
|
|
40
50
|
|
|
41
51
|
// Transform styles for GridSelector
|
|
42
|
-
const styleOptions = useMemo(() => stylesList.map((s:
|
|
52
|
+
const styleOptions = useMemo(() => stylesList.map((s: {
|
|
53
|
+
id: string;
|
|
54
|
+
name: string;
|
|
55
|
+
emoji?: string;
|
|
56
|
+
icon?: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
}) => ({
|
|
43
59
|
value: s.id,
|
|
44
60
|
label: s.name,
|
|
45
61
|
emoji: s.emoji || s.icon, // Handle different formats
|
|
@@ -48,10 +64,8 @@ export const MemeGeneratorFeature: React.FC<MemeGeneratorFeatureProps> = ({
|
|
|
48
64
|
|
|
49
65
|
const { state, setPrompt, generate, reset, isReady } = useTextToImageFeature({
|
|
50
66
|
config: {
|
|
67
|
+
...config,
|
|
51
68
|
model: config.model || "fal-ai/nano-banana-edit",
|
|
52
|
-
buildInput: config.buildInput,
|
|
53
|
-
extractResult: config.extractResult,
|
|
54
|
-
...config
|
|
55
69
|
},
|
|
56
70
|
userId,
|
|
57
71
|
});
|
package/src/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ export type {
|
|
|
10
10
|
SubscribeOptions, RunOptions, ImageFeatureType, VideoFeatureType, ImageFeatureInputData,
|
|
11
11
|
VideoFeatureInputData, ProviderCapabilities, ProviderProgressInfo, INetworkService,
|
|
12
12
|
ICreditService, IPaywallService, IAuthService, IAnalyticsService, IAppServices, PartialAppServices,
|
|
13
|
+
IFeatureUtils,
|
|
13
14
|
} from "./domain/interfaces";
|
|
14
15
|
|
|
15
16
|
export { AIErrorType } from "./domain/entities";
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { useMemo } from "react";
|
|
8
8
|
import {
|
|
9
|
+
View,
|
|
9
10
|
ScrollView,
|
|
10
11
|
StyleSheet,
|
|
11
12
|
Dimensions,
|
|
@@ -14,7 +15,6 @@ import {
|
|
|
14
15
|
type DimensionValue,
|
|
15
16
|
} from "react-native";
|
|
16
17
|
import {
|
|
17
|
-
Animated,
|
|
18
18
|
useAppDesignTokens,
|
|
19
19
|
} from "@umituz/react-native-design-system";
|
|
20
20
|
import { ResultHeader } from "./ResultHeader";
|
|
@@ -93,7 +93,7 @@ export const GenerationResultContent: React.FC<
|
|
|
93
93
|
}, [tokens, cfg, width]);
|
|
94
94
|
|
|
95
95
|
return (
|
|
96
|
-
<
|
|
96
|
+
<View style={[styles.container, modalStyle]}>
|
|
97
97
|
<ScrollView
|
|
98
98
|
style={styles.scrollView}
|
|
99
99
|
contentContainerStyle={styles.scrollContent}
|
|
@@ -123,6 +123,6 @@ export const GenerationResultContent: React.FC<
|
|
|
123
123
|
config={cfg.actions}
|
|
124
124
|
/>
|
|
125
125
|
</ScrollView>
|
|
126
|
-
</
|
|
126
|
+
</View>
|
|
127
127
|
);
|
|
128
128
|
};
|
package/src/types/globals.d.ts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
declare const __DEV__: boolean;
|
|
2
|
-
declare const console: {
|
|
3
|
-
log: (...args: unknown[]) => void;
|
|
4
|
-
error: (...args: unknown[]) => void;
|
|
5
|
-
warn: (...args: unknown[]) => void;
|
|
6
|
-
info: (...args: unknown[]) => void;
|
|
7
|
-
debug: (...args: unknown[]) => void;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
// React Native + React 19 compatibility fix
|
|
11
|
-
// https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/67742
|
|
12
|
-
declare module 'react-native' {
|
|
13
|
-
import type {
|
|
14
|
-
ComponentType,
|
|
15
|
-
ReactElement,
|
|
16
|
-
JSXElementConstructor,
|
|
17
|
-
ReactNode,
|
|
18
|
-
} from 'react';
|
|
19
|
-
|
|
20
|
-
export interface ViewProps {
|
|
21
|
-
children?: ReactNode;
|
|
22
|
-
style?: any;
|
|
23
|
-
testID?: string;
|
|
24
|
-
accessible?: boolean;
|
|
25
|
-
accessibilityLabel?: string;
|
|
26
|
-
accessibilityHint?: string;
|
|
27
|
-
accessibilityRole?: string;
|
|
28
|
-
accessibilityState?: any;
|
|
29
|
-
onLayout?: (event: any) => void;
|
|
30
|
-
pointerEvents?: 'box-none' | 'box-only' | 'auto' | 'none';
|
|
31
|
-
hitSlop?: any;
|
|
32
|
-
removeClippedSubviews?: boolean;
|
|
33
|
-
collapsable?: boolean;
|
|
34
|
-
needsOffscreenAlphaCompositing?: boolean;
|
|
35
|
-
renderToHardwareTextureAndroid?: boolean;
|
|
36
|
-
shouldRasterizeIOS?: boolean;
|
|
37
|
-
onAccessibilityTap?: () => void;
|
|
38
|
-
onMagicTap?: () => void;
|
|
39
|
-
[key: string]: any;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface TextProps {
|
|
43
|
-
children?: ReactNode;
|
|
44
|
-
style?: any;
|
|
45
|
-
testID?: string;
|
|
46
|
-
numberOfLines?: number;
|
|
47
|
-
ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip';
|
|
48
|
-
allowFontScaling?: boolean;
|
|
49
|
-
adjustsFontSizeToFit?: boolean;
|
|
50
|
-
minimumFontScale?: number;
|
|
51
|
-
maxFontSizeMultiplier?: number;
|
|
52
|
-
selectable?: boolean;
|
|
53
|
-
selectionColor?: string;
|
|
54
|
-
accessibilityLabel?: string;
|
|
55
|
-
[key: string]: any;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export const View: ComponentType<ViewProps>;
|
|
59
|
-
export const Text: ComponentType<TextProps>;
|
|
60
|
-
export const Image: ComponentType<any>;
|
|
61
|
-
export const ScrollView: ComponentType<any>;
|
|
62
|
-
export const FlatList: ComponentType<any>;
|
|
63
|
-
export const SectionList: ComponentType<any>;
|
|
64
|
-
export const TextInput: ComponentType<any>;
|
|
65
|
-
export const TouchableOpacity: ComponentType<any>;
|
|
66
|
-
export const TouchableHighlight: ComponentType<any>;
|
|
67
|
-
export const TouchableWithoutFeedback: ComponentType<any>;
|
|
68
|
-
export const Pressable: ComponentType<any>;
|
|
69
|
-
export const ActivityIndicator: ComponentType<any>;
|
|
70
|
-
export const Modal: ComponentType<any>;
|
|
71
|
-
export const SafeAreaView: ComponentType<any>;
|
|
72
|
-
export const KeyboardAvoidingView: ComponentType<any>;
|
|
73
|
-
export const StatusBar: ComponentType<any>;
|
|
74
|
-
export const Animated: {
|
|
75
|
-
View: ComponentType<any>;
|
|
76
|
-
Text: ComponentType<any>;
|
|
77
|
-
Image: ComponentType<any>;
|
|
78
|
-
ScrollView: ComponentType<any>;
|
|
79
|
-
[key: string]: any;
|
|
80
|
-
};
|
|
81
|
-
}
|