@umituz/react-native-ai-generation-content 1.17.207 → 1.17.209
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 +1 -1
- package/src/domains/face-detection/index.ts +1 -0
- package/src/domains/face-detection/presentation/components/FaceDetectionToggle.tsx +114 -0
- package/src/features/meme-generator/presentation/screens/MemeGeneratorScreen.tsx +1 -1
- package/src/presentation/components/buttons/GenerateButton.tsx +2 -2
- package/src/types/globals.d.ts +73 -0
package/package.json
CHANGED
|
@@ -24,3 +24,4 @@ export { analyzeImageForFace } from "./infrastructure/analyzers/faceAnalyzer";
|
|
|
24
24
|
export { useFaceDetection } from "./presentation/hooks/useFaceDetection";
|
|
25
25
|
|
|
26
26
|
export { FaceValidationStatus } from "./presentation/components/FaceValidationStatus";
|
|
27
|
+
export { FaceDetectionToggle } from "./presentation/components/FaceDetectionToggle";
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FaceDetectionToggle Component
|
|
3
|
+
*
|
|
4
|
+
* A simple toggle switch for enabling/disabling AI face detection.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { View, StyleSheet, Switch } from "react-native";
|
|
9
|
+
import {
|
|
10
|
+
AtomicText,
|
|
11
|
+
AtomicIcon,
|
|
12
|
+
useAppDesignTokens,
|
|
13
|
+
} from "@umituz/react-native-design-system";
|
|
14
|
+
|
|
15
|
+
interface FaceDetectionToggleProps {
|
|
16
|
+
isEnabled: boolean;
|
|
17
|
+
onToggle: (value: boolean) => void;
|
|
18
|
+
label: string;
|
|
19
|
+
/** Hide the toggle temporarily - set to true to hide without removing the component */
|
|
20
|
+
hidden?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const FaceDetectionToggle: React.FC<FaceDetectionToggleProps> = ({
|
|
24
|
+
isEnabled,
|
|
25
|
+
onToggle,
|
|
26
|
+
label,
|
|
27
|
+
hidden = false,
|
|
28
|
+
}) => {
|
|
29
|
+
const tokens = useAppDesignTokens();
|
|
30
|
+
|
|
31
|
+
// Return null if hidden - component is still here but not rendered
|
|
32
|
+
if (hidden) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<View
|
|
38
|
+
style={[
|
|
39
|
+
styles.container,
|
|
40
|
+
{
|
|
41
|
+
backgroundColor: tokens.colors.surfaceSecondary,
|
|
42
|
+
borderColor: isEnabled
|
|
43
|
+
? tokens.colors.primary
|
|
44
|
+
: tokens.colors.borderLight,
|
|
45
|
+
},
|
|
46
|
+
]}
|
|
47
|
+
>
|
|
48
|
+
<View style={styles.content}>
|
|
49
|
+
<View
|
|
50
|
+
style={[
|
|
51
|
+
styles.iconContainer,
|
|
52
|
+
{
|
|
53
|
+
backgroundColor: isEnabled
|
|
54
|
+
? tokens.colors.primary + "20"
|
|
55
|
+
: tokens.colors.backgroundPrimary,
|
|
56
|
+
},
|
|
57
|
+
]}
|
|
58
|
+
>
|
|
59
|
+
<AtomicIcon
|
|
60
|
+
name="scan"
|
|
61
|
+
size={20}
|
|
62
|
+
customColor={
|
|
63
|
+
isEnabled ? tokens.colors.primary : tokens.colors.textSecondary
|
|
64
|
+
}
|
|
65
|
+
/>
|
|
66
|
+
</View>
|
|
67
|
+
<AtomicText
|
|
68
|
+
style={[styles.label, { color: tokens.colors.textPrimary }]}
|
|
69
|
+
>
|
|
70
|
+
{label}
|
|
71
|
+
</AtomicText>
|
|
72
|
+
</View>
|
|
73
|
+
<Switch
|
|
74
|
+
value={isEnabled}
|
|
75
|
+
onValueChange={onToggle}
|
|
76
|
+
trackColor={{
|
|
77
|
+
false: tokens.colors.borderLight,
|
|
78
|
+
true: tokens.colors.primary,
|
|
79
|
+
}}
|
|
80
|
+
thumbColor={tokens.colors.onPrimary}
|
|
81
|
+
ios_backgroundColor={tokens.colors.borderLight}
|
|
82
|
+
/>
|
|
83
|
+
</View>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const styles = StyleSheet.create({
|
|
88
|
+
container: {
|
|
89
|
+
flexDirection: "row",
|
|
90
|
+
alignItems: "center",
|
|
91
|
+
justifyContent: "space-between",
|
|
92
|
+
marginHorizontal: 24,
|
|
93
|
+
marginBottom: 24,
|
|
94
|
+
padding: 16,
|
|
95
|
+
borderRadius: 16,
|
|
96
|
+
borderWidth: 1,
|
|
97
|
+
},
|
|
98
|
+
content: {
|
|
99
|
+
flexDirection: "row",
|
|
100
|
+
alignItems: "center",
|
|
101
|
+
gap: 12,
|
|
102
|
+
},
|
|
103
|
+
iconContainer: {
|
|
104
|
+
width: 36,
|
|
105
|
+
height: 36,
|
|
106
|
+
borderRadius: 18,
|
|
107
|
+
justifyContent: "center",
|
|
108
|
+
alignItems: "center",
|
|
109
|
+
},
|
|
110
|
+
label: {
|
|
111
|
+
fontSize: 16,
|
|
112
|
+
fontWeight: "600",
|
|
113
|
+
},
|
|
114
|
+
});
|
|
@@ -75,7 +75,7 @@ export const MemeGeneratorScreen: React.FC<MemeGeneratorScreenProps> = ({
|
|
|
75
75
|
aspectRatio: 1,
|
|
76
76
|
width: "100%",
|
|
77
77
|
backgroundColor: tokens.colors.backgroundSecondary,
|
|
78
|
-
borderRadius: tokens.
|
|
78
|
+
borderRadius: tokens.radius.lg,
|
|
79
79
|
justifyContent: "center",
|
|
80
80
|
alignItems: "center",
|
|
81
81
|
marginBottom: tokens.spacing.xl,
|
|
@@ -82,7 +82,7 @@ export const GenerateButton: React.FC<GenerateButtonProps> = ({
|
|
|
82
82
|
backgroundColor: disabled
|
|
83
83
|
? tokens.colors.surfaceSecondary
|
|
84
84
|
: tokens.colors.primary,
|
|
85
|
-
borderRadius: tokens.
|
|
85
|
+
borderRadius: tokens.radius.lg,
|
|
86
86
|
flex: 1,
|
|
87
87
|
},
|
|
88
88
|
]}
|
|
@@ -108,7 +108,7 @@ export const GenerateButton: React.FC<GenerateButtonProps> = ({
|
|
|
108
108
|
styles.accessory,
|
|
109
109
|
{
|
|
110
110
|
backgroundColor: tokens.colors.surfaceSecondary,
|
|
111
|
-
borderRadius: tokens.
|
|
111
|
+
borderRadius: tokens.radius.lg,
|
|
112
112
|
},
|
|
113
113
|
]}
|
|
114
114
|
>
|
package/src/types/globals.d.ts
CHANGED
|
@@ -6,3 +6,76 @@ declare const console: {
|
|
|
6
6
|
info: (...args: unknown[]) => void;
|
|
7
7
|
debug: (...args: unknown[]) => void;
|
|
8
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
|
+
}
|