@microfox/remotion 1.0.0
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/CHANGELOG.md +64 -0
- package/README.md +235 -0
- package/package.json +61 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.0.0] - 2024-01-XX
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Complete recursive composition system** with unified component architecture
|
|
13
|
+
- **Core Components**:
|
|
14
|
+
|
|
15
|
+
- `Composition` - Main composition component
|
|
16
|
+
- `SimpleComposition` - Simplified composition for quick setup
|
|
17
|
+
- `SceneFrame` and `OverlayFrame` - Frame components
|
|
18
|
+
- `GridLayout`, `VerticalLayout`, `HorizontalLayout` - Basic layouts
|
|
19
|
+
- `CircularLayout`, `OverlayLayout`, `FlexLayout` - Advanced layouts
|
|
20
|
+
- `TextAtom`, `ImageAtom`, `VideoAtom`, `AudioAtom`, `ShapeAtom` - Atom components
|
|
21
|
+
|
|
22
|
+
- **Core System**:
|
|
23
|
+
|
|
24
|
+
- `RenderableComponentData` interface for recursive component structure
|
|
25
|
+
- `RenderableContext` for boundary and timing management
|
|
26
|
+
- Component registry system for extensibility
|
|
27
|
+
- Context-driven rendering with automatic boundary calculation
|
|
28
|
+
|
|
29
|
+
- **Hooks**:
|
|
30
|
+
|
|
31
|
+
- `useRenderableContext` - Context and boundary management
|
|
32
|
+
- `useComponentRegistry` - Registry management
|
|
33
|
+
- `useBoundaryCalculation` - Boundary calculation utilities
|
|
34
|
+
|
|
35
|
+
- **Utilities**:
|
|
36
|
+
|
|
37
|
+
- `createCompositionBuilder` - Programmatic composition creation
|
|
38
|
+
- `createSimpleComposition` - Quick composition setup
|
|
39
|
+
- Context utilities for boundary and timing management
|
|
40
|
+
- Boundary calculation utilities for positioning
|
|
41
|
+
|
|
42
|
+
- **Documentation**:
|
|
43
|
+
- Comprehensive API documentation
|
|
44
|
+
- Usage examples and best practices
|
|
45
|
+
- Architecture and implementation guides
|
|
46
|
+
|
|
47
|
+
### Features
|
|
48
|
+
|
|
49
|
+
- **Recursive Component Pattern**: Every component can contain other components
|
|
50
|
+
- **Context-Driven Rendering**: Automatic boundary and timing calculation
|
|
51
|
+
- **Remotion-Native Design**: Built entirely on Remotion's core components
|
|
52
|
+
- **Extensible Registry**: Support for external package integration
|
|
53
|
+
- **Type Safety**: Full TypeScript support with comprehensive interfaces
|
|
54
|
+
|
|
55
|
+
### Architecture
|
|
56
|
+
|
|
57
|
+
- **Three Pillars**: Recursive Component Pattern, Context-Driven Rendering, Remotion-Native Design
|
|
58
|
+
- **Unified Interface**: All components follow the same recursive pattern
|
|
59
|
+
- **Performance Optimized**: Built on Remotion's efficient rendering engine
|
|
60
|
+
- **Developer Friendly**: Simple APIs with powerful capabilities
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
This is the initial release of @microfox/remotion, providing a complete foundation for building complex video compositions with Remotion using a unified, recursive component architecture.
|
package/README.md
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
# @microfox/remotion
|
|
2
|
+
|
|
3
|
+
A **recursive composition system** built on top of Remotion's core components. It provides a unified architecture where every component (frames, layouts, atoms) follows the same recursive pattern, enabling infinite nesting and flexible video composition.
|
|
4
|
+
|
|
5
|
+
## 🎯 **Core Philosophy: The Three Pillars**
|
|
6
|
+
|
|
7
|
+
### **1. Recursive Component Pattern**
|
|
8
|
+
|
|
9
|
+
Everything is a **RenderableComponent** that can contain other renderable components:
|
|
10
|
+
|
|
11
|
+
- **Frame** → Contains multiple **Layouts**
|
|
12
|
+
- **Layout** → Contains multiple **Atoms** OR **SubLayouts**
|
|
13
|
+
- **Atom** → Smallest renderable unit (text, image, video, etc.)
|
|
14
|
+
|
|
15
|
+
### **2. Context-Driven Rendering**
|
|
16
|
+
|
|
17
|
+
Each component automatically calculates its boundaries and context:
|
|
18
|
+
|
|
19
|
+
- **Spatial Boundaries**: x, y, width, height, zIndex
|
|
20
|
+
- **Temporal Boundaries**: startFrame, durationFrames, delay
|
|
21
|
+
- **Hierarchy Context**: depth, parentIds, childIds
|
|
22
|
+
- **Remotion Context**: currentFrame, fps, composition dimensions
|
|
23
|
+
|
|
24
|
+
### **3. Remotion-Native Design**
|
|
25
|
+
|
|
26
|
+
Built entirely on Remotion's core components:
|
|
27
|
+
|
|
28
|
+
- `AbsoluteFill` for positioning
|
|
29
|
+
- `Sequence` for timing
|
|
30
|
+
- `Img`, `Video`, `Audio` for media
|
|
31
|
+
- Timeline synchronization and performance optimization
|
|
32
|
+
|
|
33
|
+
## 🚀 **Installation**
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install @microfox/remotion
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 📖 **Basic Usage**
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
import { Composition, SceneFrame, GridLayout, TextAtom } from '@microfox/remotion';
|
|
43
|
+
|
|
44
|
+
const MyComposition = () => (
|
|
45
|
+
<Composition
|
|
46
|
+
components={[
|
|
47
|
+
{
|
|
48
|
+
id: 'scene-1',
|
|
49
|
+
type: 'frame',
|
|
50
|
+
data: {},
|
|
51
|
+
context: {
|
|
52
|
+
boundaries: { x: 0, y: 0, width: 1920, height: 1080, zIndex: 0 },
|
|
53
|
+
timing: { startFrame: 0, durationFrames: 30, delay: 0 },
|
|
54
|
+
hierarchy: { depth: 0, parentIds: [], childIds: [] },
|
|
55
|
+
remotion: { currentFrame: 0, fps: 30, composition: { width: 1920, height: 1080, duration: 30 } }
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
]}
|
|
59
|
+
width={1920}
|
|
60
|
+
height={1080}
|
|
61
|
+
duration={30}
|
|
62
|
+
fps={30}
|
|
63
|
+
/>
|
|
64
|
+
);
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## 🎬 **Component Types**
|
|
68
|
+
|
|
69
|
+
### **Frames (Scene Directors)**
|
|
70
|
+
|
|
71
|
+
- **SceneFrame**: Full composition frame
|
|
72
|
+
- **OverlayFrame**: Overlay on existing content
|
|
73
|
+
|
|
74
|
+
### **Layouts (Assistant Directors)**
|
|
75
|
+
|
|
76
|
+
- **GridLayout**: Grid arrangement with configurable columns/rows
|
|
77
|
+
- **VerticalLayout**: Vertical stacking with spacing
|
|
78
|
+
- **HorizontalLayout**: Horizontal arrangement with spacing
|
|
79
|
+
|
|
80
|
+
### **Atoms (Actors)**
|
|
81
|
+
|
|
82
|
+
- **TextAtom**: Text rendering with styling
|
|
83
|
+
- **ImageAtom**: Image rendering with positioning
|
|
84
|
+
- **VideoAtom**: Video rendering with controls
|
|
85
|
+
|
|
86
|
+
## 🔄 **Recursive Pattern Examples**
|
|
87
|
+
|
|
88
|
+
### **Example 1: Nested Grid Layout**
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
const nestedGridExample = {
|
|
92
|
+
id: 'scene-1',
|
|
93
|
+
type: 'frame',
|
|
94
|
+
data: {},
|
|
95
|
+
context: {
|
|
96
|
+
/* ... */
|
|
97
|
+
},
|
|
98
|
+
children: [
|
|
99
|
+
{
|
|
100
|
+
id: 'grid-1',
|
|
101
|
+
type: 'layout',
|
|
102
|
+
data: { columns: 2, rows: 2, spacing: 20 },
|
|
103
|
+
context: {
|
|
104
|
+
/* ... */
|
|
105
|
+
},
|
|
106
|
+
children: [
|
|
107
|
+
{
|
|
108
|
+
id: 'text-1',
|
|
109
|
+
type: 'atom',
|
|
110
|
+
data: { text: 'Hello World', style: { fontSize: '48px' } },
|
|
111
|
+
context: {
|
|
112
|
+
/* ... */
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: 'image-1',
|
|
117
|
+
type: 'atom',
|
|
118
|
+
data: { src: 'https://example.com/image.jpg' },
|
|
119
|
+
context: {
|
|
120
|
+
/* ... */
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
};
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## 🔧 **Advanced Features**
|
|
130
|
+
|
|
131
|
+
### **Context Propagation**
|
|
132
|
+
|
|
133
|
+
Components automatically inherit and calculate their context from parent components:
|
|
134
|
+
|
|
135
|
+
```typescript
|
|
136
|
+
const contextExample = {
|
|
137
|
+
boundaries: {
|
|
138
|
+
x: 100, // Inherited from parent
|
|
139
|
+
y: 50, // Inherited from parent
|
|
140
|
+
width: 800, // Calculated based on parent
|
|
141
|
+
height: 600, // Calculated based on parent
|
|
142
|
+
zIndex: 1, // Incremented from parent
|
|
143
|
+
},
|
|
144
|
+
timing: {
|
|
145
|
+
startFrame: 0, // Inherited from parent
|
|
146
|
+
durationFrames: 30, // Inherited from parent
|
|
147
|
+
delay: 5, // Added to parent timing
|
|
148
|
+
},
|
|
149
|
+
hierarchy: {
|
|
150
|
+
depth: 2, // Incremented from parent
|
|
151
|
+
parentIds: ['root', 'parent-1'], // Tracked automatically
|
|
152
|
+
childIds: [], // Populated automatically
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### **Registry System**
|
|
158
|
+
|
|
159
|
+
Register custom components for external package integration:
|
|
160
|
+
|
|
161
|
+
```typescript
|
|
162
|
+
import { registerComponent } from '@microfox/remotion';
|
|
163
|
+
|
|
164
|
+
// Register custom components
|
|
165
|
+
registerComponent('custom-layout', CustomLayout, 'layout');
|
|
166
|
+
registerComponent('custom-atom', CustomAtom, 'atom');
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Templates
|
|
170
|
+
|
|
171
|
+
The package includes pre-built templates for common use cases.
|
|
172
|
+
|
|
173
|
+
### RingsComposition
|
|
174
|
+
|
|
175
|
+
A composition featuring the Next.js logo animation with concentric rings and a text fade effect.
|
|
176
|
+
|
|
177
|
+
**Usage:**
|
|
178
|
+
|
|
179
|
+
```typescript
|
|
180
|
+
import React from 'react';
|
|
181
|
+
import { RingsComposition } from '@microfox/remotion';
|
|
182
|
+
|
|
183
|
+
const MyVideo = () => {
|
|
184
|
+
return (
|
|
185
|
+
<RingsComposition
|
|
186
|
+
title="My Custom Title"
|
|
187
|
+
/>
|
|
188
|
+
);
|
|
189
|
+
};
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## �� **Key Benefits**
|
|
193
|
+
|
|
194
|
+
1. **Unified Architecture** - Single pattern for all components
|
|
195
|
+
2. **Infinite Nesting** - Any component can contain any other component
|
|
196
|
+
3. **Context Awareness** - Automatic boundary and timing calculation
|
|
197
|
+
4. **Remotion Native** - Built on Remotion's core components
|
|
198
|
+
5. **Extensible** - Easy external package integration
|
|
199
|
+
6. **Performance** - Optimized rendering with Remotion's engine
|
|
200
|
+
|
|
201
|
+
## 📋 **Development**
|
|
202
|
+
|
|
203
|
+
### **Building**
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
npm run build
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### **Testing**
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
npm test
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### **Linting**
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
npm run lint
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## 🤝 **Contributing**
|
|
222
|
+
|
|
223
|
+
1. Fork the repository
|
|
224
|
+
2. Create a feature branch
|
|
225
|
+
3. Make your changes
|
|
226
|
+
4. Add tests
|
|
227
|
+
5. Submit a pull request
|
|
228
|
+
|
|
229
|
+
## 📄 **License**
|
|
230
|
+
|
|
231
|
+
MIT License - see LICENSE file for details.
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
_This package provides a powerful foundation for building complex video compositions with Remotion using a unified, recursive component architecture._
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@microfox/remotion",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A recursive composition system for Remotion with unified component architecture",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist/**",
|
|
10
|
+
"CHANGELOG.md"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsup",
|
|
14
|
+
"build:watch": "tsup --watch",
|
|
15
|
+
"clean": "rm -rf dist",
|
|
16
|
+
"lint": "eslint \"./**/*.ts*\"",
|
|
17
|
+
"prettier-check": "prettier --check \"./**/*.ts*\"",
|
|
18
|
+
"test": "vitest run",
|
|
19
|
+
"test:watch": "vitest"
|
|
20
|
+
},
|
|
21
|
+
"exports": {
|
|
22
|
+
"./package.json": "./package.json",
|
|
23
|
+
".": {
|
|
24
|
+
"import": "./dist/index.mjs",
|
|
25
|
+
"require": "./dist/index.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@remotion/google-fonts": "4.0.340",
|
|
30
|
+
"@remotion/media-utils": "^4.0.340",
|
|
31
|
+
"react": "19.1.1",
|
|
32
|
+
"remotion": "4.0.340",
|
|
33
|
+
"zod": "^3.24.3"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@eslint/js": "latest",
|
|
37
|
+
"@types/node": "^18",
|
|
38
|
+
"@types/react": "19.1.1",
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "latest",
|
|
40
|
+
"@typescript-eslint/parser": "latest",
|
|
41
|
+
"eslint": "^9.1.0",
|
|
42
|
+
"prettier": "^3.0.0",
|
|
43
|
+
"tsup": "^8",
|
|
44
|
+
"typescript": "^5.6.3",
|
|
45
|
+
"vitest": "^1.0.0"
|
|
46
|
+
},
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public"
|
|
49
|
+
},
|
|
50
|
+
"engines": {
|
|
51
|
+
"node": ">=18.0.0"
|
|
52
|
+
},
|
|
53
|
+
"keywords": [
|
|
54
|
+
"remotion",
|
|
55
|
+
"typescript",
|
|
56
|
+
"video",
|
|
57
|
+
"composition",
|
|
58
|
+
"layout",
|
|
59
|
+
"recursive"
|
|
60
|
+
]
|
|
61
|
+
}
|