@umituz/react-native-ai-generation-content 1.17.86 → 1.17.88

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.
Files changed (37) hide show
  1. package/package.json +2 -2
  2. package/src/domains/creations/index.ts +6 -3
  3. package/src/domains/creations/presentation/components/CreationBadges.tsx +3 -3
  4. package/src/domains/creations/presentation/components/CreationDetail/DetailStory.tsx +5 -8
  5. package/src/domains/creations/presentation/components/CreationThumbnail.tsx +1 -1
  6. package/src/domains/creations/presentation/components/index.ts +0 -3
  7. package/src/domains/creations/presentation/screens/CreationDetailScreen.tsx +5 -4
  8. package/src/domains/creations/presentation/screens/CreationsGalleryScreen.tsx +2 -11
  9. package/src/domains/creations/presentation/utils/filterUtils.ts +18 -1
  10. package/src/domains/flashcard-generation/FlashcardGenerationService.ts +85 -311
  11. package/src/domains/flashcard-generation/builders/flashcard-prompt.builder.ts +55 -0
  12. package/src/domains/flashcard-generation/parsers/flashcard-response.parser.ts +68 -0
  13. package/src/domains/flashcard-generation/types/flashcard.types.ts +56 -0
  14. package/src/domains/flashcard-generation/validators/flashcard.validator.ts +67 -0
  15. package/src/features/image-to-video/presentation/components/MusicMoodSelector.tsx +3 -3
  16. package/src/features/replace-background/presentation/components/ResultDisplay.tsx +1 -2
  17. package/src/features/script-generator/presentation/components/ScriptDisplay.tsx +3 -4
  18. package/src/features/text-to-image/domain/constants/index.ts +3 -3
  19. package/src/features/text-to-image/domain/constants/options.constants.ts +12 -25
  20. package/src/features/text-to-image/index.ts +12 -4
  21. package/src/features/text-to-image/presentation/hooks/index.ts +8 -0
  22. package/src/features/text-to-image/presentation/hooks/useTextToImageCallbacksBuilder.ts +200 -0
  23. package/src/features/text-to-video/presentation/components/HeroSection.tsx +2 -8
  24. package/src/features/text-to-video/presentation/components/OptionsPanel.tsx +3 -5
  25. package/src/presentation/components/AIGenerationForm.tsx +0 -1
  26. package/src/presentation/components/AIGenerationHero.tsx +27 -24
  27. package/src/presentation/components/GenerationProgressContent.tsx +4 -2
  28. package/src/presentation/components/PhotoUploadCard/PhotoUploadCard.tsx +12 -26
  29. package/src/presentation/components/StylePresetsGrid.tsx +5 -3
  30. package/src/presentation/components/buttons/GenerateButton.tsx +39 -102
  31. package/src/presentation/components/headers/FeatureHeader.tsx +15 -9
  32. package/src/presentation/components/image-picker/DualImagePicker.tsx +0 -6
  33. package/src/presentation/components/image-picker/ImagePickerBox.tsx +27 -16
  34. package/src/presentation/components/modals/SettingsSheet.tsx +4 -2
  35. package/src/presentation/components/result/ResultImageCard.tsx +12 -35
  36. package/src/presentation/components/result/ResultStoryCard.tsx +10 -16
  37. package/src/domains/creations/presentation/components/CreationsProvider.tsx +0 -56
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * ImagePickerBox Component
3
- * Generic image picker box with gradient design
3
+ * Generic image picker box with solid color design
4
4
  * Props-driven for 100+ apps compatibility
5
5
  */
6
6
 
@@ -17,14 +17,12 @@ import {
17
17
  useAppDesignTokens,
18
18
  AtomicIcon,
19
19
  } from "@umituz/react-native-design-system";
20
- import { LinearGradient } from "expo-linear-gradient";
21
20
 
22
21
  export interface ImagePickerBoxProps {
23
22
  readonly imageUri: string | null;
24
23
  readonly isDisabled?: boolean;
25
24
  readonly onPress: () => void;
26
25
  readonly placeholderText: string;
27
- readonly gradientColors?: readonly [string, string, ...string[]];
28
26
  readonly variant?: "portrait" | "square" | "landscape";
29
27
  readonly size?: "sm" | "md" | "lg";
30
28
  readonly uploadIcon?: string;
@@ -44,7 +42,6 @@ export const ImagePickerBox: React.FC<ImagePickerBoxProps> = ({
44
42
  isDisabled = false,
45
43
  onPress,
46
44
  placeholderText,
47
- gradientColors = ["#667eea", "#764ba2"],
48
45
  variant = "portrait",
49
46
  size = "md",
50
47
  uploadIcon = "cloud-upload-outline",
@@ -70,42 +67,57 @@ export const ImagePickerBox: React.FC<ImagePickerBoxProps> = ({
70
67
  {imageUri ? (
71
68
  <View style={styles.imageContainer}>
72
69
  <Image source={{ uri: imageUri }} style={styles.image} />
73
- <LinearGradient
74
- colors={["transparent", "rgba(0,0,0,0.3)"]}
75
- style={styles.imageOverlay}
70
+ <View
71
+ style={[
72
+ styles.imageOverlay,
73
+ { backgroundColor: tokens.colors.modalOverlay },
74
+ ]}
76
75
  >
77
76
  <View
78
77
  style={[
79
78
  styles.editBadge,
80
- { backgroundColor: `${gradientColors[1]}E6` },
79
+ { backgroundColor: tokens.colors.primary },
81
80
  ]}
82
81
  >
83
82
  <AtomicIcon
84
83
  name={editIcon}
85
84
  customSize={Math.round(16 * multiplier)}
86
- customColor="#FFFFFF"
85
+ customColor={tokens.colors.textInverse}
87
86
  />
88
87
  </View>
89
- </LinearGradient>
88
+ </View>
90
89
  </View>
91
90
  ) : (
92
- <LinearGradient colors={gradientColors} style={styles.placeholder}>
91
+ <View
92
+ style={[
93
+ styles.placeholder,
94
+ { backgroundColor: tokens.colors.primary },
95
+ ]}
96
+ >
93
97
  <View style={styles.placeholderContent}>
94
- <View style={styles.uploadIconContainer}>
98
+ <View
99
+ style={[
100
+ styles.uploadIconContainer,
101
+ { backgroundColor: tokens.colors.surface },
102
+ ]}
103
+ >
95
104
  <AtomicIcon
96
105
  name={uploadIcon}
97
106
  customSize={iconSize}
98
- customColor="#FFFFFF"
107
+ customColor={tokens.colors.primary}
99
108
  />
100
109
  </View>
101
110
  <AtomicText
102
111
  type="bodyMedium"
103
- style={[styles.placeholderText, { color: "#FFFFFF" }]}
112
+ style={[
113
+ styles.placeholderText,
114
+ { color: tokens.colors.textInverse },
115
+ ]}
104
116
  >
105
117
  {placeholderText}
106
118
  </AtomicText>
107
119
  </View>
108
- </LinearGradient>
120
+ </View>
109
121
  )}
110
122
  </TouchableOpacity>
111
123
  </View>
@@ -153,7 +165,6 @@ const styles = StyleSheet.create({
153
165
  paddingHorizontal: 16,
154
166
  },
155
167
  uploadIconContainer: {
156
- backgroundColor: "rgba(255,255,255,0.2)",
157
168
  borderRadius: 40,
158
169
  padding: 16,
159
170
  marginBottom: 12,
@@ -53,7 +53,10 @@ export const SettingsSheet: React.FC<SettingsSheetProps> = ({
53
53
  animationType="slide"
54
54
  onRequestClose={onClose}
55
55
  >
56
- <Pressable style={styles.backdrop} onPress={handleBackdropPress}>
56
+ <Pressable
57
+ style={[styles.backdrop, { backgroundColor: tokens.colors.modalOverlay }]}
58
+ onPress={handleBackdropPress}
59
+ >
57
60
  <Pressable
58
61
  style={[
59
62
  styles.sheet,
@@ -102,7 +105,6 @@ export const SettingsSheet: React.FC<SettingsSheetProps> = ({
102
105
  const styles = StyleSheet.create({
103
106
  backdrop: {
104
107
  flex: 1,
105
- backgroundColor: "rgba(0, 0, 0, 0.5)",
106
108
  justifyContent: "flex-end",
107
109
  },
108
110
  sheet: {
@@ -11,7 +11,6 @@ import {
11
11
  AtomicIcon,
12
12
  useAppDesignTokens,
13
13
  } from "@umituz/react-native-design-system";
14
- import { LinearGradient } from "expo-linear-gradient";
15
14
  import type { ResultImageConfig } from "../../types/result-config.types";
16
15
  import { DEFAULT_RESULT_CONFIG } from "../../types/result-config.types";
17
16
 
@@ -45,12 +44,12 @@ export const ResultImageCard: React.FC<ResultImageCardProps> = ({
45
44
 
46
45
  const badgeBackground = useMemo(() => {
47
46
  if (cfg.badgeStyle === "light") {
48
- return "rgba(255, 255, 255, 0.9)";
47
+ return tokens.colors.surface;
49
48
  } else if (cfg.badgeStyle === "dark") {
50
- return "rgba(0, 0, 0, 0.6)";
49
+ return tokens.colors.modalOverlay;
51
50
  }
52
- return null;
53
- }, [cfg.badgeStyle]);
51
+ return tokens.colors.primary;
52
+ }, [cfg.badgeStyle, tokens]);
54
53
 
55
54
  const styles = useMemo(
56
55
  () =>
@@ -76,24 +75,17 @@ export const ResultImageCard: React.FC<ResultImageCardProps> = ({
76
75
  gap: 4,
77
76
  paddingHorizontal: 10,
78
77
  paddingVertical: 5,
79
- backgroundColor: badgeBackground ?? undefined,
78
+ backgroundColor: badgeBackground,
80
79
  borderRadius: 12,
81
80
  overflow: "hidden",
82
81
  },
83
- gradientBadge: {
84
- flexDirection: "row",
85
- alignItems: "center",
86
- gap: 4,
87
- paddingHorizontal: 10,
88
- paddingVertical: 5,
89
- },
90
82
  badgeText: {
91
83
  fontSize: 10,
92
84
  fontWeight: "700",
93
85
  color:
94
86
  cfg.badgeStyle === "light"
95
87
  ? tokens.colors.textPrimary
96
- : "#FFFFFF",
88
+ : tokens.colors.textInverse,
97
89
  letterSpacing: 0.5,
98
90
  },
99
91
  }),
@@ -104,35 +96,20 @@ export const ResultImageCard: React.FC<ResultImageCardProps> = ({
104
96
  if (!cfg.showBadge) return null;
105
97
 
106
98
  const iconColor =
107
- cfg.badgeStyle === "light" ? tokens.colors.primary : "#FFFFFF";
99
+ cfg.badgeStyle === "light"
100
+ ? tokens.colors.primary
101
+ : tokens.colors.textInverse;
108
102
 
109
- const badgeContent = (
110
- <>
103
+ return (
104
+ <View style={styles.badge}>
111
105
  <AtomicIcon
112
106
  name={cfg.badgeIcon ?? "sparkles"}
113
107
  size="xs"
114
108
  customColor={iconColor}
115
109
  />
116
110
  <AtomicText style={styles.badgeText}>{badgeText}</AtomicText>
117
- </>
111
+ </View>
118
112
  );
119
-
120
- if (cfg.badgeStyle === "gradient") {
121
- return (
122
- <View style={styles.badge}>
123
- <LinearGradient
124
- colors={[tokens.colors.primary, tokens.colors.secondary]}
125
- start={{ x: 0, y: 0 }}
126
- end={{ x: 1, y: 0 }}
127
- style={styles.gradientBadge}
128
- >
129
- {badgeContent}
130
- </LinearGradient>
131
- </View>
132
- );
133
- }
134
-
135
- return <View style={styles.badge}>{badgeContent}</View>;
136
113
  };
137
114
 
138
115
  return (
@@ -10,7 +10,6 @@ import {
10
10
  AtomicText,
11
11
  useAppDesignTokens,
12
12
  } from "@umituz/react-native-design-system";
13
- import { LinearGradient } from "expo-linear-gradient";
14
13
  import type { ResultStoryConfig } from "../../types/result-config.types";
15
14
  import { DEFAULT_RESULT_CONFIG } from "../../types/result-config.types";
16
15
 
@@ -37,16 +36,24 @@ export const ResultStoryCard: React.FC<ResultStoryCardProps> = ({
37
36
  ...base,
38
37
  borderWidth: 1,
39
38
  borderColor: tokens.colors.primaryContainer,
40
- backgroundColor: "transparent",
39
+ backgroundColor: tokens.colors.surface,
41
40
  };
42
41
  } else if (cfg.borderStyle === "filled") {
43
42
  return {
44
43
  ...base,
45
44
  backgroundColor: tokens.colors.primaryContainer,
46
45
  };
46
+ } else if (cfg.borderStyle === "gradient") {
47
+ return {
48
+ ...base,
49
+ backgroundColor: tokens.colors.primaryContainer,
50
+ };
47
51
  }
48
52
 
49
- return base;
53
+ return {
54
+ ...base,
55
+ backgroundColor: tokens.colors.surface,
56
+ };
50
57
  }, [cfg.borderStyle, cfg.spacing, tokens]);
51
58
 
52
59
  const styles = useMemo(
@@ -102,19 +109,6 @@ export const ResultStoryCard: React.FC<ResultStoryCardProps> = ({
102
109
  </>
103
110
  );
104
111
 
105
- if (cfg.borderStyle === "gradient") {
106
- return (
107
- <View style={styles.outer}>
108
- <LinearGradient
109
- colors={[tokens.colors.primaryContainer, tokens.colors.surface]}
110
- style={styles.container}
111
- >
112
- {renderContent()}
113
- </LinearGradient>
114
- </View>
115
- );
116
- }
117
-
118
112
  return (
119
113
  <View style={styles.outer}>
120
114
  <View style={styles.container}>{renderContent()}</View>
@@ -1,56 +0,0 @@
1
- /**
2
- * Creations Provider
3
- * Context provider for creations configuration and localization
4
- */
5
-
6
- import React, { createContext, useContext, useMemo, type ReactNode } from "react";
7
- import type { CreationsConfig, CreationType } from "../../domain/value-objects/CreationsConfig";
8
- import { getTranslatedTypes } from "../utils/filterUtils";
9
-
10
- interface CreationsContextValue {
11
- config: CreationsConfig;
12
- t: (key: string) => string;
13
- translatedTypes: readonly CreationType[];
14
- getLocalizedTitle: (typeId: string) => string;
15
- }
16
-
17
- const CreationsContext = createContext<CreationsContextValue | null>(null);
18
-
19
- interface CreationsProviderProps {
20
- config: CreationsConfig;
21
- t: (key: string) => string;
22
- children: ReactNode;
23
- }
24
-
25
- export function CreationsProvider({ config, t, children }: CreationsProviderProps) {
26
- const translatedTypes = useMemo(() => getTranslatedTypes(config, t), [config, t]);
27
-
28
- const getLocalizedTitle = (typeId: string): string => {
29
- const typeConfig = translatedTypes.find((type) => type.id === typeId);
30
- return typeConfig?.labelKey || typeId;
31
- };
32
-
33
- const value = useMemo<CreationsContextValue>(
34
- () => ({
35
- config,
36
- t,
37
- translatedTypes,
38
- getLocalizedTitle,
39
- }),
40
- [config, t, translatedTypes]
41
- );
42
-
43
- return (
44
- <CreationsContext.Provider value={value}>
45
- {children}
46
- </CreationsContext.Provider>
47
- );
48
- }
49
-
50
- export function useCreationsProvider(): CreationsContextValue {
51
- const context = useContext(CreationsContext);
52
- if (!context) {
53
- throw new Error("useCreationsProvider must be used within a CreationsProvider");
54
- }
55
- return context;
56
- }