@umituz/react-native-ai-generation-content 1.90.20 → 1.90.22

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.90.20",
3
+ "version": "1.90.22",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -1,7 +1,8 @@
1
1
  import React, { PropsWithChildren } from "react";
2
- import { View, StyleSheet, Dimensions, type ViewStyle } from "react-native";
2
+ import { View, StyleSheet, type ViewStyle } from "react-native";
3
3
  import { AtomicText, AtomicButton } from "@umituz/react-native-design-system/atoms";
4
4
  import { useAppDesignTokens } from "@umituz/react-native-design-system/theme";
5
+ import { useResponsive } from "@umituz/react-native-design-system/responsive";
5
6
 
6
7
  export interface AIGenerationResultAction {
7
8
  label: string;
@@ -45,8 +46,8 @@ export const AIGenerationResult: React.FC<AIGenerationResultProps> = ({
45
46
  children,
46
47
  }) => {
47
48
  const tokens = useAppDesignTokens();
48
- const screenWidth = Dimensions.get("window").width;
49
- const contentSize = screenWidth - 48;
49
+ const responsive = useResponsive();
50
+ const contentSize = responsive.width - 48;
50
51
 
51
52
  const displaySuccessText = successText || translations?.successText;
52
53
 
@@ -9,12 +9,12 @@ import {
9
9
  View,
10
10
  ScrollView,
11
11
  StyleSheet,
12
- Dimensions,
13
12
  type ViewStyle,
14
13
  type StyleProp,
15
14
  type DimensionValue,
16
15
  } from "react-native";
17
16
  import { useAppDesignTokens } from "@umituz/react-native-design-system/theme";
17
+ import { useResponsive } from "@umituz/react-native-design-system/responsive";
18
18
  import { ResultHeader } from "./ResultHeader";
19
19
  import { ResultImageCard } from "./ResultImageCard";
20
20
  import { ResultStoryCard } from "./ResultStoryCard";
@@ -22,8 +22,6 @@ import { ResultActions } from "./ResultActions";
22
22
  import type { ResultConfig } from "../../types/result-config.types";
23
23
  import { DEFAULT_RESULT_CONFIG } from "../../types/result-config.types";
24
24
 
25
- const { width } = Dimensions.get("window");
26
-
27
25
  export interface GenerationResultData {
28
26
  imageUrl: string;
29
27
  story?: string;
@@ -63,10 +61,11 @@ export const GenerationResultContent: React.FC<
63
61
  config = DEFAULT_RESULT_CONFIG,
64
62
  }) => {
65
63
  const tokens = useAppDesignTokens();
64
+ const responsive = useResponsive();
66
65
  const cfg = { ...DEFAULT_RESULT_CONFIG, ...config };
67
66
 
68
67
  const styles = useMemo(() => {
69
- const containerWidth = cfg.layout?.maxWidth ?? width - 40;
68
+ const containerWidth = cfg.layout?.maxWidth ?? responsive.width - 40;
70
69
  const maxHeight: DimensionValue = (cfg.layout?.maxHeight ??
71
70
  "90%") as DimensionValue;
72
71
 
@@ -88,7 +87,7 @@ export const GenerationResultContent: React.FC<
88
87
  paddingHorizontal: cfg.layout?.contentPadding?.horizontal ?? 0,
89
88
  },
90
89
  });
91
- }, [tokens, cfg, width]);
90
+ }, [tokens, cfg, responsive.width]);
92
91
 
93
92
  return (
94
93
  <View style={[styles.container, modalStyle]}>