@umituz/react-native-ai-generation-content 1.17.134 → 1.17.136

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.17.134",
3
+ "version": "1.17.136",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -3,8 +3,9 @@
3
3
  * Video player with thumbnail and play controls for creation detail view
4
4
  */
5
5
 
6
- import React from "react";
7
- import { View, StyleSheet, useWindowDimensions } from "react-native";
6
+ import React, { useMemo } from "react";
7
+ import { View } from "react-native";
8
+ import { useResponsive } from "@umituz/react-native-design-system";
8
9
  import { VideoPlayer } from "@umituz/react-native-video-editor";
9
10
 
10
11
  interface DetailVideoProps {
@@ -12,17 +13,20 @@ interface DetailVideoProps {
12
13
  readonly thumbnailUrl?: string;
13
14
  }
14
15
 
15
- const HORIZONTAL_PADDING = 16;
16
-
17
16
  export const DetailVideo: React.FC<DetailVideoProps> = ({
18
17
  videoUrl,
19
18
  thumbnailUrl,
20
19
  }) => {
21
- const { width } = useWindowDimensions();
22
- const videoWidth = width - (HORIZONTAL_PADDING * 2);
20
+ const { width, horizontalPadding, spacingMultiplier } = useResponsive();
21
+ const videoWidth = width - (horizontalPadding * 2);
22
+
23
+ const containerStyle = useMemo(() => ({
24
+ paddingHorizontal: horizontalPadding,
25
+ marginVertical: 16 * spacingMultiplier,
26
+ }), [horizontalPadding, spacingMultiplier]);
23
27
 
24
28
  return (
25
- <View style={styles.container}>
29
+ <View style={containerStyle}>
26
30
  <VideoPlayer
27
31
  source={videoUrl}
28
32
  thumbnailUrl={thumbnailUrl}
@@ -34,10 +38,3 @@ export const DetailVideo: React.FC<DetailVideoProps> = ({
34
38
  </View>
35
39
  );
36
40
  };
37
-
38
- const styles = StyleSheet.create({
39
- container: {
40
- paddingHorizontal: HORIZONTAL_PADDING,
41
- marginVertical: 16,
42
- },
43
- });
@@ -5,8 +5,8 @@
5
5
  */
6
6
 
7
7
  import React, { useCallback } from "react";
8
- import { View, ScrollView, StyleSheet, Dimensions } from "react-native";
9
- import { useAppDesignTokens } from "@umituz/react-native-design-system";
8
+ import { View, ScrollView, StyleSheet } from "react-native";
9
+ import { useAppDesignTokens, useResponsive } from "@umituz/react-native-design-system";
10
10
  import { DualImagePicker } from "../../../../presentation/components/image-picker/DualImagePicker";
11
11
  import { AIGenerationForm } from "../../../../presentation/components/AIGenerationForm";
12
12
  import { AIGenerationResult } from "../../../../presentation/components/display/AIGenerationResult";
@@ -46,6 +46,8 @@ export const AIHugFeature: React.FC<AIHugFeatureProps> = ({
46
46
  renderProcessingModal,
47
47
  }) => {
48
48
  const tokens = useAppDesignTokens();
49
+ const { width: screenWidth, horizontalPadding } = useResponsive();
50
+ const videoSize = screenWidth - horizontalPadding * 2;
49
51
 
50
52
  const feature = useAIHugFeature({
51
53
  config,
@@ -71,9 +73,6 @@ export const AIHugFeature: React.FC<AIHugFeatureProps> = ({
71
73
  }, [feature]);
72
74
 
73
75
  if (feature.processedVideoUrl) {
74
- const screenWidth = Dimensions.get("window").width;
75
- const videoSize = screenWidth - 48;
76
-
77
76
  return (
78
77
  <ScrollView
79
78
  style={[styles.container, { backgroundColor: tokens.colors.backgroundPrimary }]}
@@ -5,8 +5,8 @@
5
5
  */
6
6
 
7
7
  import React, { useCallback } from "react";
8
- import { View, ScrollView, StyleSheet, Dimensions } from "react-native";
9
- import { useAppDesignTokens } from "@umituz/react-native-design-system";
8
+ import { View, ScrollView, StyleSheet } from "react-native";
9
+ import { useAppDesignTokens, useResponsive } from "@umituz/react-native-design-system";
10
10
  import { DualImagePicker } from "../../../../presentation/components/image-picker/DualImagePicker";
11
11
  import { AIGenerationForm } from "../../../../presentation/components/AIGenerationForm";
12
12
  import { AIGenerationResult } from "../../../../presentation/components/display/AIGenerationResult";
@@ -40,6 +40,8 @@ export const AIKissFeature: React.FC<AIKissFeatureProps> = ({
40
40
  renderProcessingModal,
41
41
  }) => {
42
42
  const tokens = useAppDesignTokens();
43
+ const { width: screenWidth, horizontalPadding } = useResponsive();
44
+ const videoSize = screenWidth - horizontalPadding * 2;
43
45
 
44
46
  const feature = useAIKissFeature({
45
47
  config,
@@ -65,9 +67,6 @@ export const AIKissFeature: React.FC<AIKissFeatureProps> = ({
65
67
  }, [feature]);
66
68
 
67
69
  if (feature.processedVideoUrl) {
68
- const screenWidth = Dimensions.get("window").width;
69
- const videoSize = screenWidth - 48;
70
-
71
70
  return (
72
71
  <ScrollView
73
72
  style={[styles.container, { backgroundColor: tokens.colors.backgroundPrimary }]}
@@ -5,8 +5,8 @@
5
5
  */
6
6
 
7
7
  import React, { useCallback, useMemo } from "react";
8
- import { ScrollView, StyleSheet, Image, Dimensions } from "react-native";
9
- import { useAppDesignTokens } from "@umituz/react-native-design-system";
8
+ import { ScrollView, StyleSheet, Image } from "react-native";
9
+ import { useAppDesignTokens, useResponsive } from "@umituz/react-native-design-system";
10
10
  import { PhotoUploadCard } from "../../../../presentation/components/PhotoUploadCard";
11
11
  import { AIGenerationForm } from "../../../../presentation/components/AIGenerationForm";
12
12
  import { AIGenerationResult } from "../../../../presentation/components/display/AIGenerationResult";
@@ -35,6 +35,8 @@ export const AnimeSelfieFeature: React.FC<AnimeSelfieFeatureProps> = ({
35
35
  renderProcessingModal,
36
36
  }) => {
37
37
  const tokens = useAppDesignTokens();
38
+ const { width: screenWidth, horizontalPadding } = useResponsive();
39
+ const imageSize = screenWidth - horizontalPadding * 2;
38
40
 
39
41
  const feature = useAnimeSelfieFeature({
40
42
  config,
@@ -65,9 +67,6 @@ export const AnimeSelfieFeature: React.FC<AnimeSelfieFeatureProps> = ({
65
67
  }, [feature]);
66
68
 
67
69
  if (feature.processedUrl) {
68
- const screenWidth = Dimensions.get("window").width;
69
- const imageSize = screenWidth - 48;
70
-
71
70
  return (
72
71
  <ScrollView
73
72
  style={[styles.container, { backgroundColor: tokens.colors.backgroundPrimary }]}
@@ -5,8 +5,8 @@
5
5
  */
6
6
 
7
7
  import React, { useCallback } from "react";
8
- import { View, ScrollView, StyleSheet, Image, Dimensions } from "react-native";
9
- import { useAppDesignTokens } from "@umituz/react-native-design-system";
8
+ import { View, ScrollView, StyleSheet, Image } from "react-native";
9
+ import { useAppDesignTokens, useResponsive } from "@umituz/react-native-design-system";
10
10
  import { DualImagePicker } from "../../../../presentation/components/image-picker/DualImagePicker";
11
11
  import { AIGenerationForm } from "../../../../presentation/components/AIGenerationForm";
12
12
  import { AIGenerationResult } from "../../../../presentation/components/display/AIGenerationResult";
@@ -37,6 +37,8 @@ export const FaceSwapFeature: React.FC<FaceSwapFeatureProps> = ({
37
37
  renderProcessingModal,
38
38
  }) => {
39
39
  const tokens = useAppDesignTokens();
40
+ const { width: screenWidth, horizontalPadding } = useResponsive();
41
+ const imageSize = screenWidth - horizontalPadding * 2;
40
42
 
41
43
  const feature = useFaceSwapFeature({
42
44
  config,
@@ -62,9 +64,6 @@ export const FaceSwapFeature: React.FC<FaceSwapFeatureProps> = ({
62
64
  }, [feature]);
63
65
 
64
66
  if (feature.processedUrl) {
65
- const screenWidth = Dimensions.get("window").width;
66
- const imageSize = screenWidth - 48;
67
-
68
67
  return (
69
68
  <ScrollView
70
69
  style={[styles.container, { backgroundColor: tokens.colors.backgroundPrimary }]}
@@ -5,8 +5,8 @@
5
5
  */
6
6
 
7
7
  import React, { useCallback, useMemo } from "react";
8
- import { ScrollView, StyleSheet, Image, Dimensions } from "react-native";
9
- import { useAppDesignTokens } from "@umituz/react-native-design-system";
8
+ import { ScrollView, StyleSheet, Image } from "react-native";
9
+ import { useAppDesignTokens, useResponsive } from "@umituz/react-native-design-system";
10
10
  import { PhotoUploadCard } from "../../../../presentation/components/PhotoUploadCard";
11
11
  import { AIGenerationForm } from "../../../../presentation/components/AIGenerationForm";
12
12
  import { AIGenerationResult } from "../../../../presentation/components/display/AIGenerationResult";
@@ -35,6 +35,8 @@ export const HDTouchUpFeature: React.FC<HDTouchUpFeatureProps> = ({
35
35
  renderProcessingModal,
36
36
  }) => {
37
37
  const tokens = useAppDesignTokens();
38
+ const { width: screenWidth, horizontalPadding } = useResponsive();
39
+ const imageSize = screenWidth - horizontalPadding * 2;
38
40
 
39
41
  const feature = useHDTouchUpFeature({
40
42
  config,
@@ -65,9 +67,6 @@ export const HDTouchUpFeature: React.FC<HDTouchUpFeatureProps> = ({
65
67
  }, [feature]);
66
68
 
67
69
  if (feature.processedUrl) {
68
- const screenWidth = Dimensions.get("window").width;
69
- const imageSize = screenWidth - 48;
70
-
71
70
  return (
72
71
  <ScrollView
73
72
  style={[styles.container, { backgroundColor: tokens.colors.backgroundPrimary }]}
@@ -10,37 +10,37 @@ export const DEFAULT_ANIMATION_STYLES: AnimationStyle[] = [
10
10
  id: "ken_burns",
11
11
  name: "Ken Burns",
12
12
  description: "Slow zoom and pan effect",
13
- icon: "Maximize2",
13
+ icon: "expand-outline",
14
14
  },
15
15
  {
16
16
  id: "zoom_in",
17
17
  name: "Zoom In",
18
18
  description: "Gradual zoom in effect",
19
- icon: "ZoomIn",
19
+ icon: "add-circle-outline",
20
20
  },
21
21
  {
22
22
  id: "zoom_out",
23
23
  name: "Zoom Out",
24
24
  description: "Gradual zoom out effect",
25
- icon: "ZoomOut",
25
+ icon: "remove-circle-outline",
26
26
  },
27
27
  {
28
28
  id: "slide_left",
29
29
  name: "Slide Left",
30
30
  description: "Pan from right to left",
31
- icon: "ArrowLeft",
31
+ icon: "arrow-back-outline",
32
32
  },
33
33
  {
34
34
  id: "slide_right",
35
35
  name: "Slide Right",
36
36
  description: "Pan from left to right",
37
- icon: "ArrowRight",
37
+ icon: "arrow-forward-outline",
38
38
  },
39
39
  {
40
40
  id: "parallax",
41
41
  name: "Parallax",
42
42
  description: "3D depth effect",
43
- icon: "Layers",
43
+ icon: "layers-outline",
44
44
  },
45
45
  ];
46
46
 
@@ -89,7 +89,7 @@ export const AnimationStyleSelector: React.FC<AnimationStyleSelectorProps> = ({
89
89
  </AtomicText>
90
90
  </View>
91
91
  {isSelected && (
92
- <AtomicIcon name="Check" size="md" color="primary" />
92
+ <AtomicIcon name="checkmark-outline" size="md" color="primary" />
93
93
  )}
94
94
  </View>
95
95
  </TouchableOpacity>
@@ -61,7 +61,7 @@ export const ImageSelectionGrid: React.FC<ImageSelectionGridProps> = ({
61
61
  onPress={onSelectImages}
62
62
  activeOpacity={0.7}
63
63
  >
64
- <AtomicIcon name="Upload" size="xl" color="primary" />
64
+ <AtomicIcon name="cloud-upload-outline" size="xl" color="primary" />
65
65
  <AtomicText
66
66
  type="bodyMedium"
67
67
  style={[
@@ -4,6 +4,8 @@
4
4
  */
5
5
 
6
6
  import { useMemo, useCallback } from "react";
7
+
8
+ declare const __DEV__: boolean;
7
9
  import { useFormState, type UseFormStateOptions } from "./useFormState";
8
10
  import { useGeneration } from "./useGeneration";
9
11
  import type {
@@ -60,10 +62,29 @@ export function useImageToVideoForm(
60
62
  );
61
63
 
62
64
  const handleSelectImages = useCallback(async () => {
65
+ if (__DEV__) {
66
+ console.log("[useImageToVideoForm] handleSelectImages called");
67
+ }
63
68
  if (callbacks.onSelectImages) {
64
- const images = await callbacks.onSelectImages();
65
- if (images.length > 0) {
66
- actions.addImages(images);
69
+ try {
70
+ const images = await callbacks.onSelectImages();
71
+ if (__DEV__) {
72
+ console.log("[useImageToVideoForm] Images selected:", images.length);
73
+ }
74
+ if (images.length > 0) {
75
+ actions.addImages(images);
76
+ if (__DEV__) {
77
+ console.log("[useImageToVideoForm] Images added to state");
78
+ }
79
+ }
80
+ } catch (error) {
81
+ if (__DEV__) {
82
+ console.error("[useImageToVideoForm] Error selecting images:", error);
83
+ }
84
+ }
85
+ } else {
86
+ if (__DEV__) {
87
+ console.warn("[useImageToVideoForm] No onSelectImages callback provided");
67
88
  }
68
89
  }
69
90
  }, [callbacks, actions]);
@@ -5,8 +5,8 @@
5
5
  */
6
6
 
7
7
  import React, { useCallback, useMemo } from "react";
8
- import { ScrollView, StyleSheet, Image, Dimensions } from "react-native";
9
- import { useAppDesignTokens } from "@umituz/react-native-design-system";
8
+ import { ScrollView, StyleSheet, Image } from "react-native";
9
+ import { useAppDesignTokens, useResponsive } from "@umituz/react-native-design-system";
10
10
  import { PhotoUploadCard } from "../../../../presentation/components/PhotoUploadCard";
11
11
  import { AIGenerationForm } from "../../../../presentation/components/AIGenerationForm";
12
12
  import { AIGenerationResult } from "../../../../presentation/components/display/AIGenerationResult";
@@ -35,6 +35,8 @@ export const RemoveBackgroundFeature: React.FC<RemoveBackgroundFeatureProps> = (
35
35
  renderProcessingModal,
36
36
  }) => {
37
37
  const tokens = useAppDesignTokens();
38
+ const { width: screenWidth, horizontalPadding } = useResponsive();
39
+ const imageSize = screenWidth - horizontalPadding * 2;
38
40
 
39
41
  const feature = useRemoveBackgroundFeature({
40
42
  config,
@@ -65,9 +67,6 @@ export const RemoveBackgroundFeature: React.FC<RemoveBackgroundFeatureProps> = (
65
67
  }, [feature]);
66
68
 
67
69
  if (feature.processedUrl) {
68
- const screenWidth = Dimensions.get("window").width;
69
- const imageSize = screenWidth - 48;
70
-
71
70
  return (
72
71
  <ScrollView
73
72
  style={[styles.container, { backgroundColor: tokens.colors.backgroundPrimary }]}
@@ -5,9 +5,10 @@
5
5
  */
6
6
 
7
7
  import React, { useCallback, useMemo } from "react";
8
- import { View, ScrollView, StyleSheet, Image, Dimensions, TextInput } from "react-native";
8
+ import { View, ScrollView, StyleSheet, Image, TextInput } from "react-native";
9
9
  import {
10
10
  useAppDesignTokens,
11
+ useResponsive,
11
12
  AtomicText,
12
13
  } from "@umituz/react-native-design-system";
13
14
  import { PhotoUploadCard } from "../../../../presentation/components/PhotoUploadCard";
@@ -38,6 +39,9 @@ export const RemoveObjectFeature: React.FC<RemoveObjectFeatureProps> = ({
38
39
  renderProcessingModal,
39
40
  }) => {
40
41
  const tokens = useAppDesignTokens();
42
+ const { width: screenWidth, horizontalPadding } = useResponsive();
43
+ const imageSize = screenWidth - horizontalPadding * 2;
44
+
41
45
  const feature = useRemoveObjectFeature({
42
46
  config,
43
47
  onSelectImage,
@@ -67,9 +71,6 @@ export const RemoveObjectFeature: React.FC<RemoveObjectFeatureProps> = ({
67
71
  }, [feature]);
68
72
 
69
73
  if (feature.processedUrl) {
70
- const screenWidth = Dimensions.get("window").width;
71
- const imageSize = screenWidth - 48;
72
-
73
74
  return (
74
75
  <ScrollView
75
76
  style={[styles.container, { backgroundColor: tokens.colors.backgroundPrimary }]}
@@ -5,21 +5,14 @@
5
5
 
6
6
  import * as React from "react";
7
7
  import { memo, useState, useRef, useMemo } from "react";
8
- import {
9
- View,
10
- StyleSheet,
11
- Image,
12
- PanResponder,
13
- Dimensions,
14
- } from "react-native";
8
+ import { View, StyleSheet, Image, PanResponder } from "react-native";
15
9
  import {
16
10
  AtomicText,
17
11
  useAppDesignTokens,
12
+ useResponsive,
18
13
  } from "@umituz/react-native-design-system";
19
14
  import type { ComparisonSliderProps } from "../../domain/entities";
20
15
 
21
- const { width: SCREEN_WIDTH } = Dimensions.get("window");
22
-
23
16
  export const ComparisonSlider: React.FC<ComparisonSliderProps> = memo(
24
17
  function ComparisonSlider({
25
18
  originalUri,
@@ -28,8 +21,9 @@ export const ComparisonSlider: React.FC<ComparisonSliderProps> = memo(
28
21
  afterLabel,
29
22
  }) {
30
23
  const tokens = useAppDesignTokens();
24
+ const { width: screenWidth, horizontalPadding } = useResponsive();
31
25
  const [sliderPosition, setSliderPosition] = useState(50);
32
- const containerWidth = useRef(SCREEN_WIDTH - 32);
26
+ const containerWidth = useRef(screenWidth - horizontalPadding * 2);
33
27
 
34
28
  const panResponder = useRef(
35
29
  PanResponder.create({
@@ -5,9 +5,10 @@
5
5
  */
6
6
 
7
7
  import React, { useCallback, useMemo } from "react";
8
- import { View, ScrollView, StyleSheet, Image, Dimensions } from "react-native";
8
+ import { View, ScrollView, StyleSheet, Image } from "react-native";
9
9
  import {
10
10
  useAppDesignTokens,
11
+ useResponsive,
11
12
  AtomicInput,
12
13
  } from "@umituz/react-native-design-system";
13
14
  import { PhotoUploadCard } from "../../../../presentation/components/PhotoUploadCard";
@@ -38,6 +39,8 @@ export const ReplaceBackgroundFeature: React.FC<ReplaceBackgroundFeatureProps> =
38
39
  renderProcessingModal,
39
40
  }) => {
40
41
  const tokens = useAppDesignTokens();
42
+ const { width: screenWidth, horizontalPadding } = useResponsive();
43
+ const imageSize = screenWidth - horizontalPadding * 2;
41
44
 
42
45
  const feature = useReplaceBackgroundFeature({
43
46
  config,
@@ -68,9 +71,6 @@ export const ReplaceBackgroundFeature: React.FC<ReplaceBackgroundFeatureProps> =
68
71
  }, [feature]);
69
72
 
70
73
  if (feature.processedUrl) {
71
- const screenWidth = Dimensions.get("window").width;
72
- const imageSize = screenWidth - 48;
73
-
74
74
  return (
75
75
  <ScrollView
76
76
  style={[styles.container, { backgroundColor: tokens.colors.backgroundPrimary }]}
@@ -37,7 +37,7 @@ export const ScriptDisplay: React.FC<ScriptDisplayProps> = ({
37
37
  📝 {title}
38
38
  </AtomicText>
39
39
  <TouchableOpacity onPress={onUseScript}>
40
- <AtomicIcon name="Check" size="md" color="primary" />
40
+ <AtomicIcon name="checkmark-outline" size="md" color="primary" />
41
41
  </TouchableOpacity>
42
42
  </View>
43
43
 
@@ -102,7 +102,7 @@ export const ScriptDisplay: React.FC<ScriptDisplayProps> = ({
102
102
  ]}
103
103
  onPress={onUseScript}
104
104
  >
105
- <AtomicIcon name="Check" size="md" color="textInverse" />
105
+ <AtomicIcon name="checkmark-outline" size="md" color="textInverse" />
106
106
  <AtomicText
107
107
  type="bodyLarge"
108
108
  style={[styles.useButtonText, { color: tokens.colors.textInverse }]}
@@ -5,20 +5,13 @@
5
5
 
6
6
  import * as React from "react";
7
7
  import { memo, useState, useRef, useMemo } from "react";
8
- import {
9
- View,
10
- StyleSheet,
11
- Image,
12
- PanResponder,
13
- Dimensions,
14
- } from "react-native";
8
+ import { View, StyleSheet, Image, PanResponder } from "react-native";
15
9
  import {
16
10
  AtomicText,
17
11
  useAppDesignTokens,
12
+ useResponsive,
18
13
  } from "@umituz/react-native-design-system";
19
14
 
20
- const { width: SCREEN_WIDTH } = Dimensions.get("window");
21
-
22
15
  export interface ComparisonSliderProps {
23
16
  originalUri: string;
24
17
  processedUri: string;
@@ -34,8 +27,9 @@ export const ComparisonSlider: React.FC<ComparisonSliderProps> = memo(
34
27
  afterLabel = "After",
35
28
  }) {
36
29
  const tokens = useAppDesignTokens();
30
+ const { width: screenWidth, horizontalPadding } = useResponsive();
37
31
  const [sliderPosition, setSliderPosition] = useState(50);
38
- const containerWidth = useRef(SCREEN_WIDTH - 48);
32
+ const containerWidth = useRef(screenWidth - horizontalPadding * 2);
39
33
 
40
34
  const panResponder = useRef(
41
35
  PanResponder.create({