@umituz/react-native-ai-generation-content 1.17.133 → 1.17.135

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.133",
3
+ "version": "1.17.135",
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 }]}
@@ -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 }]}
@@ -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({