@umituz/react-native-video-editor 1.2.5 → 1.2.6

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-video-editor",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "Professional video editor with layer-based timeline, text/image/shape/audio/animation layers, and export functionality",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -4,16 +4,15 @@
4
4
  */
5
5
 
6
6
  import React from "react";
7
- import { View, Dimensions } from "react-native";
7
+ import { View } from "react-native";
8
8
  import { AtomicText } from "@umituz/react-native-design-system/atoms";
9
9
  import { useAppDesignTokens } from "@umituz/react-native-design-system/theme";
10
+ import { useResponsive } from "@umituz/react-native-design-system/responsive";
10
11
  import { CollageCanvas } from "./collage/CollageCanvas";
11
12
  import { CollageControls } from "./collage/CollageControls";
12
13
  import { CollageLayoutSelector } from "./collage/CollageLayoutSelector";
13
14
  import type { CollageLayout } from "../../infrastructure/constants/collage.constants";
14
15
 
15
- const SCREEN_WIDTH = Dimensions.get("window").width;
16
-
17
16
  interface CollageEditorCanvasProps {
18
17
  layout: CollageLayout;
19
18
  images: (string | null)[];
@@ -40,7 +39,8 @@ export const CollageEditorCanvas: React.FC<CollageEditorCanvasProps> = ({
40
39
  canvasSize,
41
40
  }) => {
42
41
  const tokens = useAppDesignTokens();
43
- const size = canvasSize ?? SCREEN_WIDTH - tokens.spacing.md * 2;
42
+ const responsive = useResponsive();
43
+ const size = canvasSize ?? responsive.width - tokens.spacing.md * 2;
44
44
 
45
45
  return (
46
46
  <View>
@@ -5,17 +5,16 @@
5
5
  */
6
6
 
7
7
  import React, { useMemo, useCallback } from "react";
8
- import { View, TouchableOpacity, Dimensions } from "react-native";
8
+ import { View, TouchableOpacity } from "react-native";
9
9
  import { AtomicText, AtomicIcon } from "@umituz/react-native-design-system/atoms";
10
10
  import { useAppDesignTokens } from "@umituz/react-native-design-system/theme";
11
+ import { useResponsive } from "@umituz/react-native-design-system/responsive";
11
12
  import { DraggableLayer } from "./DraggableLayer";
12
13
  import type { Scene, Layer } from "../../domain/entities/video-project.types";
13
14
  import { createPreviewStyles } from "./EditorPreviewArea.styles";
14
15
  import { formatTimeDisplay, calculateProgressPercent } from "../../infrastructure/utils/time-calculations.utils";
15
16
 
16
- const { width } = Dimensions.get("window");
17
17
  const PREVIEW_ASPECT_RATIO = 16 / 9;
18
- const PREVIEW_HEIGHT = width / PREVIEW_ASPECT_RATIO;
19
18
 
20
19
  interface EditorPreviewAreaProps {
21
20
  scene: Scene;
@@ -43,8 +42,11 @@ export const EditorPreviewArea: React.FC<EditorPreviewAreaProps> = React.memo(({
43
42
  onReset,
44
43
  }) => {
45
44
  const tokens = useAppDesignTokens();
45
+ const responsive = useResponsive();
46
46
  const styles = useMemo(() => createPreviewStyles(tokens), [tokens]);
47
47
 
48
+ const previewHeight = useMemo(() => responsive.width / PREVIEW_ASPECT_RATIO, [responsive.width]);
49
+
48
50
  // Memoize canvas style
49
51
  const canvasStyle = useMemo(() => [
50
52
  styles.previewCanvas,
@@ -53,9 +55,9 @@ export const EditorPreviewArea: React.FC<EditorPreviewAreaProps> = React.memo(({
53
55
  scene.background.type === "color"
54
56
  ? scene.background.value
55
57
  : tokens.colors.surfaceSecondary,
56
- height: PREVIEW_HEIGHT,
58
+ height: previewHeight,
57
59
  },
58
- ], [styles.previewCanvas, scene.background.type, scene.background.value, tokens.colors.surfaceSecondary]);
60
+ ], [styles.previewCanvas, scene.background.type, scene.background.value, tokens.colors.surfaceSecondary, previewHeight]);
59
61
 
60
62
  // Memoize empty preview text style
61
63
  const emptyTextStyle = useMemo(() => ({