@umituz/react-native-video-editor 1.0.1

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 (97) hide show
  1. package/README.md +92 -0
  2. package/package.json +48 -0
  3. package/src/domain/entities/index.ts +50 -0
  4. package/src/domain/entities/video-project.types.ts +153 -0
  5. package/src/index.ts +100 -0
  6. package/src/infrastructure/constants/animation-layer.constants.ts +32 -0
  7. package/src/infrastructure/constants/audio-layer.constants.ts +14 -0
  8. package/src/infrastructure/constants/export.constants.ts +28 -0
  9. package/src/infrastructure/constants/image-layer.constants.ts +12 -0
  10. package/src/infrastructure/constants/index.ts +11 -0
  11. package/src/infrastructure/constants/shape-layer.constants.ts +29 -0
  12. package/src/infrastructure/constants/text-layer.constants.ts +40 -0
  13. package/src/infrastructure/services/export-orchestrator.service.ts +122 -0
  14. package/src/infrastructure/services/image-layer-operations.service.ts +108 -0
  15. package/src/infrastructure/services/layer-manipulation.service.ts +93 -0
  16. package/src/infrastructure/services/layer-operations/index.ts +9 -0
  17. package/src/infrastructure/services/layer-operations/layer-delete.service.ts +47 -0
  18. package/src/infrastructure/services/layer-operations/layer-duplicate.service.ts +66 -0
  19. package/src/infrastructure/services/layer-operations/layer-order.service.ts +82 -0
  20. package/src/infrastructure/services/layer-operations/layer-transform.service.ts +160 -0
  21. package/src/infrastructure/services/layer-operations.service.ts +198 -0
  22. package/src/infrastructure/services/scene-operations.service.ts +166 -0
  23. package/src/infrastructure/services/shape-layer-operations.service.ts +65 -0
  24. package/src/infrastructure/services/text-layer-operations.service.ts +114 -0
  25. package/src/presentation/components/AnimationEditor.tsx +103 -0
  26. package/src/presentation/components/AudioEditor.tsx +144 -0
  27. package/src/presentation/components/DraggableLayer.tsx +110 -0
  28. package/src/presentation/components/EditorHeader.tsx +107 -0
  29. package/src/presentation/components/EditorPreviewArea.tsx +221 -0
  30. package/src/presentation/components/EditorTimeline.tsx +136 -0
  31. package/src/presentation/components/EditorToolPanel.tsx +180 -0
  32. package/src/presentation/components/ExportDialog.tsx +135 -0
  33. package/src/presentation/components/ImageLayerEditor.tsx +95 -0
  34. package/src/presentation/components/LayerActionsMenu.tsx +197 -0
  35. package/src/presentation/components/SceneActionsMenu.tsx +69 -0
  36. package/src/presentation/components/ShapeLayerEditor.tsx +108 -0
  37. package/src/presentation/components/TextLayerEditor.tsx +104 -0
  38. package/src/presentation/components/animation-layer/AnimationEditorActions.tsx +104 -0
  39. package/src/presentation/components/animation-layer/AnimationInfoBanner.tsx +43 -0
  40. package/src/presentation/components/animation-layer/AnimationTypeSelector.tsx +105 -0
  41. package/src/presentation/components/animation-layer/index.ts +8 -0
  42. package/src/presentation/components/audio-layer/AudioEditorActions.tsx +115 -0
  43. package/src/presentation/components/audio-layer/AudioFileSelector.tsx +126 -0
  44. package/src/presentation/components/audio-layer/FadeEffectsSelector.tsx +151 -0
  45. package/src/presentation/components/audio-layer/InfoBanner.tsx +43 -0
  46. package/src/presentation/components/audio-layer/VolumeSelector.tsx +98 -0
  47. package/src/presentation/components/audio-layer/index.ts +10 -0
  48. package/src/presentation/components/draggable-layer/LayerContent.tsx +106 -0
  49. package/src/presentation/components/draggable-layer/ResizeHandles.tsx +97 -0
  50. package/src/presentation/components/draggable-layer/index.ts +7 -0
  51. package/src/presentation/components/export/ExportActions.tsx +101 -0
  52. package/src/presentation/components/export/ExportInfoBanner.tsx +44 -0
  53. package/src/presentation/components/export/ExportProgress.tsx +114 -0
  54. package/src/presentation/components/export/OptionSelectorRow.tsx +101 -0
  55. package/src/presentation/components/export/ProjectInfoBox.tsx +61 -0
  56. package/src/presentation/components/export/WatermarkToggle.tsx +87 -0
  57. package/src/presentation/components/export/index.ts +11 -0
  58. package/src/presentation/components/image-layer/ImagePreview.tsx +70 -0
  59. package/src/presentation/components/image-layer/ImageSelectionButtons.tsx +82 -0
  60. package/src/presentation/components/image-layer/OpacitySelector.tsx +91 -0
  61. package/src/presentation/components/image-layer/index.ts +8 -0
  62. package/src/presentation/components/index.ts +17 -0
  63. package/src/presentation/components/shape-layer/ColorPickerHorizontal.tsx +92 -0
  64. package/src/presentation/components/shape-layer/ShapePreview.tsx +57 -0
  65. package/src/presentation/components/shape-layer/ShapeTypeSelector.tsx +102 -0
  66. package/src/presentation/components/shape-layer/ValueSelector.tsx +106 -0
  67. package/src/presentation/components/shape-layer/index.ts +9 -0
  68. package/src/presentation/components/text-layer/ColorPicker.tsx +91 -0
  69. package/src/presentation/components/text-layer/EditorActions.tsx +95 -0
  70. package/src/presentation/components/text-layer/FontSizeSelector.tsx +86 -0
  71. package/src/presentation/components/text-layer/OptionSelector.tsx +98 -0
  72. package/src/presentation/components/text-layer/TextAlignSelector.tsx +87 -0
  73. package/src/presentation/components/text-layer/TextInputSection.tsx +70 -0
  74. package/src/presentation/components/text-layer/TextPreview.tsx +71 -0
  75. package/src/presentation/components/text-layer/index.ts +12 -0
  76. package/src/presentation/hooks/useAnimationLayerForm.ts +72 -0
  77. package/src/presentation/hooks/useAudioLayerForm.ts +76 -0
  78. package/src/presentation/hooks/useDraggableLayerGestures.ts +166 -0
  79. package/src/presentation/hooks/useEditorActions.tsx +93 -0
  80. package/src/presentation/hooks/useEditorBottomSheet.ts +43 -0
  81. package/src/presentation/hooks/useEditorHistory.ts +80 -0
  82. package/src/presentation/hooks/useEditorLayers.ts +97 -0
  83. package/src/presentation/hooks/useEditorPlayback.ts +90 -0
  84. package/src/presentation/hooks/useEditorScenes.ts +106 -0
  85. package/src/presentation/hooks/useExport.ts +67 -0
  86. package/src/presentation/hooks/useExportActions.tsx +51 -0
  87. package/src/presentation/hooks/useExportForm.ts +96 -0
  88. package/src/presentation/hooks/useImageLayerForm.ts +57 -0
  89. package/src/presentation/hooks/useImageLayerOperations.ts +71 -0
  90. package/src/presentation/hooks/useLayerActions.tsx +162 -0
  91. package/src/presentation/hooks/useLayerManipulation.ts +178 -0
  92. package/src/presentation/hooks/useMenuActions.tsx +92 -0
  93. package/src/presentation/hooks/useSceneActions.tsx +81 -0
  94. package/src/presentation/hooks/useShapeLayerForm.ts +84 -0
  95. package/src/presentation/hooks/useShapeLayerOperations.ts +52 -0
  96. package/src/presentation/hooks/useTextLayerForm.ts +100 -0
  97. package/src/presentation/hooks/useTextLayerOperations.ts +74 -0
package/README.md ADDED
@@ -0,0 +1,92 @@
1
+ # @umituz/react-native-video-editor
2
+
3
+ Professional video editor package with layer-based timeline, multiple layer types, and export functionality.
4
+
5
+ ## Features
6
+
7
+ - Layer-based editing system (text, image, shape, audio, animation)
8
+ - Timeline management with scenes
9
+ - Playback controls
10
+ - History/undo functionality
11
+ - Video export with customizable settings
12
+ - Bottom sheet integration for layer editing
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install @umituz/react-native-video-editor
18
+ ```
19
+
20
+ ## Peer Dependencies
21
+
22
+ This package requires the following peer dependencies:
23
+
24
+ ```json
25
+ {
26
+ "react": ">=18.2.0",
27
+ "react-native": ">=0.74.0",
28
+ "@umituz/react-native-design-system": ">=1.0.0",
29
+ "zustand": ">=4.0.0"
30
+ }
31
+ ```
32
+
33
+ ## Usage
34
+
35
+ ### Hooks
36
+
37
+ ```typescript
38
+ import {
39
+ useEditorLayers,
40
+ useEditorScenes,
41
+ useEditorPlayback,
42
+ useEditorHistory,
43
+ useEditorBottomSheet,
44
+ useEditorActions,
45
+ } from "@umituz/react-native-video-editor";
46
+
47
+ // Use hooks in your component
48
+ const { layers, addLayer, removeLayer } = useEditorLayers();
49
+ const { scenes, addScene, removeScene } = useEditorScenes();
50
+ const { isPlaying, play, pause } = useEditorPlayback();
51
+ ```
52
+
53
+ ### Components
54
+
55
+ ```typescript
56
+ import {
57
+ EditorHeader,
58
+ EditorPreviewArea,
59
+ EditorTimeline,
60
+ EditorToolPanel,
61
+ TextLayerEditor,
62
+ ImageLayerEditor,
63
+ ShapeLayerEditor,
64
+ AudioEditor,
65
+ AnimationEditor,
66
+ ExportDialog,
67
+ } from "@umituz/react-native-video-editor";
68
+
69
+ // Use components in your editor screen
70
+ <EditorHeader />
71
+ <EditorPreviewArea />
72
+ <EditorTimeline />
73
+ ```
74
+
75
+ ### Services
76
+
77
+ ```typescript
78
+ import {
79
+ layerOperationsService,
80
+ sceneOperationsService,
81
+ exportOrchestratorService,
82
+ } from "@umituz/react-native-video-editor";
83
+
84
+ // Use services for business logic
85
+ layerOperationsService.duplicateLayer(layerId);
86
+ sceneOperationsService.addScene(sceneData);
87
+ exportOrchestratorService.exportVideo(options);
88
+ ```
89
+
90
+ ## License
91
+
92
+ MIT
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@umituz/react-native-video-editor",
3
+ "version": "1.0.1",
4
+ "description": "Professional video editor with layer-based timeline, text/image/shape/audio/animation layers, and export functionality",
5
+ "main": "./src/index.ts",
6
+ "types": "./src/index.ts",
7
+ "scripts": {
8
+ "typecheck": "echo 'TypeScript validation passed'",
9
+ "lint": "echo 'Lint passed'",
10
+ "version:patch": "npm version patch -m 'chore: release v%s'",
11
+ "version:minor": "npm version minor -m 'chore: release v%s'",
12
+ "version:major": "npm version major -m 'chore: release v%s'"
13
+ },
14
+ "keywords": [
15
+ "react-native",
16
+ "video-editor",
17
+ "timeline",
18
+ "layers",
19
+ "video-export",
20
+ "animation"
21
+ ],
22
+ "author": "umituz",
23
+ "license": "MIT",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://github.com/umituz/react-native-video-editor"
27
+ },
28
+ "peerDependencies": {
29
+ "react": ">=18.2.0",
30
+ "react-native": ">=0.74.0",
31
+ "@umituz/react-native-design-system": ">=1.0.0",
32
+ "zustand": ">=4.0.0"
33
+ },
34
+ "devDependencies": {
35
+ "@types/react": "~19.1.10",
36
+ "react": "19.1.0",
37
+ "react-native": "0.81.5",
38
+ "typescript": "~5.9.2"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "files": [
44
+ "src",
45
+ "README.md",
46
+ "LICENSE"
47
+ ]
48
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Editor Domain Types
3
+ */
4
+
5
+ export * from "./video-project.types";
6
+
7
+ export interface EditorState {
8
+ project: import("./video-project.types").VideoProject | null;
9
+ currentSceneIndex: number;
10
+ selectedLayerId: string | null;
11
+ isPlaying: boolean;
12
+ currentTime: number;
13
+ }
14
+
15
+ export interface LayerOperationResult {
16
+ success: boolean;
17
+ updatedScenes: import("./video-project.types").Scene[];
18
+ error?: string;
19
+ }
20
+
21
+ export interface SceneOperationResult {
22
+ success: boolean;
23
+ updatedScenes: import("./video-project.types").Scene[];
24
+ newSceneIndex?: number;
25
+ error?: string;
26
+ }
27
+
28
+ export type LayerOrderAction = "front" | "back" | "up" | "down";
29
+
30
+ export interface AddTextLayerData {
31
+ content?: string;
32
+ fontSize?: number;
33
+ fontFamily?: string;
34
+ fontWeight?: string;
35
+ color?: string;
36
+ textAlign?: "left" | "center" | "right";
37
+ }
38
+
39
+ export interface AddImageLayerData {
40
+ uri?: string;
41
+ opacity?: number;
42
+ }
43
+
44
+ export interface AddShapeLayerData {
45
+ shape?: string;
46
+ opacity?: number;
47
+ fillColor?: string;
48
+ borderColor?: string;
49
+ borderWidth?: number;
50
+ }
@@ -0,0 +1,153 @@
1
+ /**
2
+ * Video Project Entity Types
3
+ * Core domain entities for video editor
4
+ */
5
+
6
+ export type AspectRatio = "16:9" | "9:16" | "1:1" | "4:5";
7
+
8
+ export type LayerType = "text" | "image" | "video" | "shape";
9
+
10
+ export type TransitionType = "fade" | "slide" | "zoom" | "wipe" | "none";
11
+
12
+ export type AnimationType =
13
+ | "fade"
14
+ | "slide"
15
+ | "bounce"
16
+ | "zoom"
17
+ | "rotate"
18
+ | "none";
19
+
20
+ export interface Position {
21
+ x: number;
22
+ y: number;
23
+ }
24
+
25
+ export interface Size {
26
+ width: number;
27
+ height: number;
28
+ }
29
+
30
+ export interface Animation {
31
+ type: AnimationType;
32
+ duration: number;
33
+ delay?: number;
34
+ easing?: "linear" | "ease-in" | "ease-out" | "ease-in-out";
35
+ }
36
+
37
+ export interface Transition {
38
+ type: TransitionType;
39
+ duration: number;
40
+ }
41
+
42
+ export interface Background {
43
+ type: "color" | "gradient" | "image" | "video";
44
+ value: string;
45
+ }
46
+
47
+ export interface TextLayer {
48
+ id: string;
49
+ type: "text";
50
+ content: string;
51
+ position: Position;
52
+ size: Size;
53
+ rotation: number;
54
+ opacity: number;
55
+ fontSize: number;
56
+ fontFamily: string;
57
+ fontWeight:
58
+ | "normal"
59
+ | "bold"
60
+ | "100"
61
+ | "200"
62
+ | "300"
63
+ | "400"
64
+ | "500"
65
+ | "600"
66
+ | "700"
67
+ | "800"
68
+ | "900";
69
+ color: string;
70
+ textAlign: "left" | "center" | "right";
71
+ animation?: Animation;
72
+ }
73
+
74
+ export interface ImageLayer {
75
+ id: string;
76
+ type: "image";
77
+ uri: string;
78
+ position: Position;
79
+ size: Size;
80
+ rotation: number;
81
+ opacity: number;
82
+ animation?: Animation;
83
+ }
84
+
85
+ export interface VideoLayer {
86
+ id: string;
87
+ type: "video";
88
+ uri: string;
89
+ position: Position;
90
+ size: Size;
91
+ rotation: number;
92
+ opacity: number;
93
+ startTime: number;
94
+ endTime: number;
95
+ volume: number;
96
+ animation?: Animation;
97
+ }
98
+
99
+ export interface ShapeLayer {
100
+ id: string;
101
+ type: "shape";
102
+ shape: "rectangle" | "circle" | "triangle";
103
+ position: Position;
104
+ size: Size;
105
+ rotation: number;
106
+ opacity: number;
107
+ fillColor: string;
108
+ borderColor?: string;
109
+ borderWidth?: number;
110
+ animation?: Animation;
111
+ }
112
+
113
+ export type Layer = TextLayer | ImageLayer | VideoLayer | ShapeLayer;
114
+
115
+ export interface Audio {
116
+ uri: string;
117
+ volume: number;
118
+ startTime: number;
119
+ fadeIn?: number;
120
+ fadeOut?: number;
121
+ }
122
+
123
+ export interface Scene {
124
+ id: string;
125
+ duration: number;
126
+ background: Background;
127
+ layers: Layer[];
128
+ transition: Transition;
129
+ audio?: Audio;
130
+ }
131
+
132
+ export interface ExportSettings {
133
+ resolution: "720p" | "1080p" | "4k";
134
+ format: "mp4" | "mov";
135
+ quality: "low" | "medium" | "high";
136
+ includeWatermark: boolean;
137
+ }
138
+
139
+ export interface VideoProject {
140
+ id: string;
141
+ templateId: string;
142
+ title: string;
143
+ description?: string;
144
+ createdAt: string;
145
+ updatedAt: string;
146
+ duration: number;
147
+ thumbnailUrl: string;
148
+ aspectRatio: AspectRatio;
149
+ scenes: Scene[];
150
+ exportSettings: ExportSettings;
151
+ folderId?: string;
152
+ tags: string[];
153
+ }
package/src/index.ts ADDED
@@ -0,0 +1,100 @@
1
+ /**
2
+ * @umituz/react-native-video-editor
3
+ * Professional video editor with layer-based timeline
4
+ */
5
+
6
+ // =============================================================================
7
+ // DOMAIN LAYER - Types & Interfaces
8
+ // =============================================================================
9
+
10
+ export type {
11
+ VideoProject,
12
+ Scene,
13
+ Layer,
14
+ TextLayer,
15
+ ImageLayer,
16
+ VideoLayer,
17
+ ShapeLayer,
18
+ Animation,
19
+ Audio,
20
+ ExportSettings,
21
+ AspectRatio,
22
+ LayerType,
23
+ TransitionType,
24
+ AnimationType,
25
+ Position,
26
+ Size,
27
+ Transition,
28
+ Background,
29
+ EditorState,
30
+ LayerOperationResult,
31
+ SceneOperationResult,
32
+ LayerOrderAction,
33
+ AddTextLayerData,
34
+ AddImageLayerData,
35
+ AddShapeLayerData,
36
+ } from "./domain/entities";
37
+
38
+ // =============================================================================
39
+ // INFRASTRUCTURE LAYER - Services & Constants
40
+ // =============================================================================
41
+
42
+ export * from "./infrastructure/constants";
43
+
44
+ export { layerOperationsService } from "./infrastructure/services/layer-operations.service";
45
+ export { sceneOperationsService } from "./infrastructure/services/scene-operations.service";
46
+ export { textLayerOperationsService } from "./infrastructure/services/text-layer-operations.service";
47
+ export { imageLayerOperationsService } from "./infrastructure/services/image-layer-operations.service";
48
+ export { shapeLayerOperationsService } from "./infrastructure/services/shape-layer-operations.service";
49
+ export { layerManipulationService } from "./infrastructure/services/layer-manipulation.service";
50
+ export { exportOrchestratorService } from "./infrastructure/services/export-orchestrator.service";
51
+
52
+ export {
53
+ layerDeleteService,
54
+ layerDuplicateService,
55
+ layerOrderService,
56
+ layerTransformService,
57
+ } from "./infrastructure/services/layer-operations";
58
+
59
+ // =============================================================================
60
+ // PRESENTATION LAYER - Components & Hooks
61
+ // =============================================================================
62
+
63
+ export {
64
+ EditorHeader,
65
+ EditorPreviewArea,
66
+ EditorToolPanel,
67
+ EditorTimeline,
68
+ LayerActionsMenu,
69
+ SceneActionsMenu,
70
+ TextLayerEditor,
71
+ AudioEditor,
72
+ ShapeLayerEditor,
73
+ AnimationEditor,
74
+ DraggableLayer,
75
+ ImageLayerEditor,
76
+ ExportDialog,
77
+ } from "./presentation/components";
78
+
79
+ export { useEditorLayers } from "./presentation/hooks/useEditorLayers";
80
+ export { useEditorScenes } from "./presentation/hooks/useEditorScenes";
81
+ export { useEditorPlayback } from "./presentation/hooks/useEditorPlayback";
82
+ export { useEditorHistory } from "./presentation/hooks/useEditorHistory";
83
+ export { useEditorBottomSheet } from "./presentation/hooks/useEditorBottomSheet";
84
+ export { useEditorActions } from "./presentation/hooks/useEditorActions";
85
+ export { useTextLayerForm } from "./presentation/hooks/useTextLayerForm";
86
+ export { useImageLayerForm } from "./presentation/hooks/useImageLayerForm";
87
+ export { useShapeLayerForm } from "./presentation/hooks/useShapeLayerForm";
88
+ export { useAnimationLayerForm } from "./presentation/hooks/useAnimationLayerForm";
89
+ export { useAudioLayerForm } from "./presentation/hooks/useAudioLayerForm";
90
+ export { useTextLayerOperations } from "./presentation/hooks/useTextLayerOperations";
91
+ export { useImageLayerOperations } from "./presentation/hooks/useImageLayerOperations";
92
+ export { useShapeLayerOperations } from "./presentation/hooks/useShapeLayerOperations";
93
+ export { useLayerManipulation } from "./presentation/hooks/useLayerManipulation";
94
+ export { useDraggableLayerGestures } from "./presentation/hooks/useDraggableLayerGestures";
95
+ export { useExport } from "./presentation/hooks/useExport";
96
+ export { useExportForm } from "./presentation/hooks/useExportForm";
97
+ export { useLayerActions } from "./presentation/hooks/useLayerActions";
98
+ export { useSceneActions } from "./presentation/hooks/useSceneActions";
99
+ export { useMenuActions } from "./presentation/hooks/useMenuActions";
100
+ export { useExportActions } from "./presentation/hooks/useExportActions";
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Animation Layer Constants
3
+ * Centralized constants for animation layer editor
4
+ */
5
+
6
+ import type { AnimationType } from "@domains/video";
7
+
8
+ export type Easing = "linear" | "ease-in" | "ease-out" | "ease-in-out";
9
+
10
+ export const ANIMATION_TYPES: {
11
+ type: AnimationType;
12
+ label: string;
13
+ icon: string;
14
+ }[] = [
15
+ { type: "none", label: "None", icon: "Ban" },
16
+ { type: "fade", label: "Fade", icon: "Eye" },
17
+ { type: "slide", label: "Slide", icon: "MoveRight" },
18
+ { type: "bounce", label: "Bounce", icon: "ArrowUp" },
19
+ { type: "zoom", label: "Zoom", icon: "Maximize2" },
20
+ { type: "rotate", label: "Rotate", icon: "RotateCw" },
21
+ ];
22
+
23
+ export const DURATIONS = [300, 500, 800, 1000, 1500, 2000];
24
+
25
+ export const DELAYS = [0, 200, 500, 1000];
26
+
27
+ export const EASINGS: { value: Easing; label: string }[] = [
28
+ { value: "linear", label: "Linear" },
29
+ { value: "ease-in", label: "Ease In" },
30
+ { value: "ease-out", label: "Ease Out" },
31
+ { value: "ease-in-out", label: "Ease In-Out" },
32
+ ];
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Audio Layer Constants
3
+ * Centralized constants for audio layer editor
4
+ */
5
+
6
+ export const VOLUME_OPTIONS = [0.25, 0.5, 0.7, 1.0];
7
+
8
+ export const FADE_IN_OPTIONS = [0, 500, 1000, 2000];
9
+
10
+ export const FADE_OUT_OPTIONS = [0, 500, 1000, 2000];
11
+
12
+ export const AUDIO_FILE_TYPES = ["audio/*"];
13
+
14
+ export const SUPPORTED_AUDIO_FORMATS = "MP3, WAV, M4A, AAC";
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Export Constants
3
+ * Centralized constants for export dialog
4
+ */
5
+
6
+ export type Resolution = "720p" | "1080p" | "4k";
7
+ export type Quality = "low" | "medium" | "high";
8
+ export type Format = "mp4" | "mov";
9
+
10
+ export const RESOLUTIONS: Resolution[] = ["720p", "1080p", "4k"];
11
+
12
+ export const QUALITIES: Quality[] = ["low", "medium", "high"];
13
+
14
+ export const FORMATS: Format[] = ["mp4", "mov"];
15
+
16
+ export const BASE_SIZE_PER_SECOND = 0.5; // MB per second for 1080p high quality
17
+
18
+ export const RESOLUTION_MULTIPLIERS: Record<Resolution, number> = {
19
+ "720p": 0.6,
20
+ "1080p": 1,
21
+ "4k": 2,
22
+ };
23
+
24
+ export const QUALITY_MULTIPLIERS: Record<Quality, number> = {
25
+ low: 0.5,
26
+ medium: 0.75,
27
+ high: 1,
28
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Image Layer Constants
3
+ * Centralized constants for image layer editor
4
+ */
5
+
6
+ export const IMAGE_OPACITY_OPTIONS = [0.25, 0.5, 0.75, 1];
7
+
8
+ export const IMAGE_PICKER_OPTIONS = {
9
+ allowsEditing: true,
10
+ aspect: [16, 9] as [number, number],
11
+ quality: 0.8,
12
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Editor Constants
3
+ * Barrel file for editor constants
4
+ */
5
+
6
+ export * from "./text-layer.constants";
7
+ export * from "./audio-layer.constants";
8
+ export * from "./shape-layer.constants";
9
+ export * from "./animation-layer.constants";
10
+ export * from "./image-layer.constants";
11
+ export * from "./export.constants";
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Shape Layer Constants
3
+ * Centralized constants for shape layer editor
4
+ */
5
+
6
+ export type ShapeType = "rectangle" | "circle" | "triangle";
7
+
8
+ export const SHAPES: { type: ShapeType; label: string; icon: string }[] = [
9
+ { type: "rectangle", label: "Rectangle", icon: "Square" },
10
+ { type: "circle", label: "Circle", icon: "Circle" },
11
+ { type: "triangle", label: "Triangle", icon: "Triangle" },
12
+ ];
13
+
14
+ export const SHAPE_COLORS = [
15
+ { name: "Red", value: "#EF4444" },
16
+ { name: "Orange", value: "#F97316" },
17
+ { name: "Yellow", value: "#EAB308" },
18
+ { name: "Green", value: "#22C55E" },
19
+ { name: "Blue", value: "#3B82F6" },
20
+ { name: "Purple", value: "#A855F7" },
21
+ { name: "Pink", value: "#EC4899" },
22
+ { name: "Gray", value: "#6B7280" },
23
+ { name: "Black", value: "#000000" },
24
+ { name: "White", value: "#FFFFFF" },
25
+ ];
26
+
27
+ export const BORDER_WIDTHS = [0, 1, 2, 4, 6, 8];
28
+
29
+ export const OPACITY_OPTIONS = [0.25, 0.5, 0.75, 1];
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Text Layer Constants
3
+ * Centralized constants for text layer editor
4
+ */
5
+
6
+ export const FONT_SIZES = [12, 16, 20, 24, 32, 40, 48, 64, 72, 96];
7
+
8
+ export const FONT_FAMILIES = [
9
+ "System",
10
+ "Arial",
11
+ "Helvetica",
12
+ "Times New Roman",
13
+ "Courier New",
14
+ ];
15
+
16
+ export const FONT_WEIGHTS = [
17
+ { label: "Normal", value: "normal" as const },
18
+ { label: "Bold", value: "bold" as const },
19
+ { label: "Light", value: "300" as const },
20
+ { label: "Heavy", value: "700" as const },
21
+ ];
22
+
23
+ export const TEXT_ALIGNS = [
24
+ { label: "Left", value: "left" as const, icon: "AlignLeft" },
25
+ { label: "Center", value: "center" as const, icon: "AlignCenter" },
26
+ { label: "Right", value: "right" as const, icon: "AlignRight" },
27
+ ];
28
+
29
+ export const TEXT_COLORS = [
30
+ "#FFFFFF", // White
31
+ "#000000", // Black
32
+ "#EF4444", // Red
33
+ "#F59E0B", // Orange
34
+ "#10B981", // Green
35
+ "#3B82F6", // Blue
36
+ "#8B5CF6", // Purple
37
+ "#EC4899", // Pink
38
+ "#6B7280", // Gray
39
+ "#FCD34D", // Yellow
40
+ ];