@editframe/create 0.43.0 → 0.45.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/README.md +11 -0
- package/dist/index.js +16 -28
- package/dist/index.js.map +1 -1
- package/dist/skills/editframe-brand-video-generator/README.md +155 -0
- package/dist/skills/editframe-brand-video-generator/SKILL.md +207 -0
- package/dist/skills/editframe-brand-video-generator/references/brand-examples.md +178 -0
- package/dist/skills/editframe-brand-video-generator/references/color-psychology.md +227 -0
- package/dist/skills/editframe-brand-video-generator/references/composition-patterns.md +383 -0
- package/dist/skills/editframe-brand-video-generator/references/editing.md +66 -0
- package/dist/skills/editframe-brand-video-generator/references/emotional-arcs.md +496 -0
- package/dist/skills/editframe-brand-video-generator/references/genre-selection.md +135 -0
- package/dist/skills/editframe-brand-video-generator/references/transition-styles.md +611 -0
- package/dist/skills/editframe-brand-video-generator/references/typography-personalities.md +326 -0
- package/dist/skills/editframe-brand-video-generator/references/video-archetypes.md +86 -0
- package/dist/skills/editframe-brand-video-generator/references/video-fundamentals.md +169 -0
- package/dist/skills/editframe-brand-video-generator/references/visual-metaphors.md +50 -0
- package/dist/skills/editframe-composition/SKILL.md +169 -0
- package/dist/skills/editframe-composition/references/audio.md +483 -0
- package/dist/skills/editframe-composition/references/captions.md +844 -0
- package/dist/skills/editframe-composition/references/composition-model.md +73 -0
- package/dist/skills/editframe-composition/references/configuration.md +403 -0
- package/dist/skills/editframe-composition/references/css-parts.md +105 -0
- package/dist/skills/editframe-composition/references/css-variables.md +640 -0
- package/dist/skills/editframe-composition/references/entry-points.md +810 -0
- package/dist/skills/editframe-composition/references/events.md +499 -0
- package/dist/skills/editframe-composition/references/getting-started.md +259 -0
- package/dist/skills/editframe-composition/references/hooks.md +234 -0
- package/dist/skills/editframe-composition/references/image.md +241 -0
- package/dist/skills/editframe-composition/references/r3f.md +580 -0
- package/dist/skills/editframe-composition/references/render-api.md +484 -0
- package/dist/skills/editframe-composition/references/render-strategies.md +119 -0
- package/dist/skills/editframe-composition/references/render-to-video.md +1101 -0
- package/dist/skills/editframe-composition/references/scripting.md +606 -0
- package/dist/skills/editframe-composition/references/sequencing.md +116 -0
- package/dist/skills/editframe-composition/references/server-rendering.md +753 -0
- package/dist/skills/editframe-composition/references/surface.md +329 -0
- package/dist/skills/editframe-composition/references/text.md +627 -0
- package/dist/skills/editframe-composition/references/time-model.md +99 -0
- package/dist/skills/editframe-composition/references/timegroup-modes.md +102 -0
- package/dist/skills/editframe-composition/references/timegroup.md +457 -0
- package/dist/skills/editframe-composition/references/timeline-root.md +398 -0
- package/dist/skills/editframe-composition/references/transcription.md +47 -0
- package/dist/skills/editframe-composition/references/transitions.md +608 -0
- package/dist/skills/editframe-composition/references/use-media-info.md +357 -0
- package/dist/skills/editframe-composition/references/video.md +506 -0
- package/dist/skills/editframe-composition/references/waveform.md +327 -0
- package/dist/skills/editframe-editor-gui/SKILL.md +152 -0
- package/dist/skills/editframe-editor-gui/references/active-root-temporal.md +657 -0
- package/dist/skills/editframe-editor-gui/references/canvas.md +947 -0
- package/dist/skills/editframe-editor-gui/references/controls.md +366 -0
- package/dist/skills/editframe-editor-gui/references/dial.md +756 -0
- package/dist/skills/editframe-editor-gui/references/editor-toolkit.md +587 -0
- package/dist/skills/editframe-editor-gui/references/filmstrip.md +460 -0
- package/dist/skills/editframe-editor-gui/references/fit-scale.md +772 -0
- package/dist/skills/editframe-editor-gui/references/focus-overlay.md +561 -0
- package/dist/skills/editframe-editor-gui/references/hierarchy.md +544 -0
- package/dist/skills/editframe-editor-gui/references/overlay-item.md +634 -0
- package/dist/skills/editframe-editor-gui/references/overlay-layer.md +429 -0
- package/dist/skills/editframe-editor-gui/references/pan-zoom.md +568 -0
- package/dist/skills/editframe-editor-gui/references/pause.md +397 -0
- package/dist/skills/editframe-editor-gui/references/play.md +370 -0
- package/dist/skills/editframe-editor-gui/references/preview.md +391 -0
- package/dist/skills/editframe-editor-gui/references/resizable-box.md +749 -0
- package/dist/skills/editframe-editor-gui/references/scrubber.md +588 -0
- package/dist/skills/editframe-editor-gui/references/thumbnail-strip.md +566 -0
- package/dist/skills/editframe-editor-gui/references/time-display.md +492 -0
- package/dist/skills/editframe-editor-gui/references/timeline-ruler.md +489 -0
- package/dist/skills/editframe-editor-gui/references/timeline.md +604 -0
- package/dist/skills/editframe-editor-gui/references/toggle-loop.md +618 -0
- package/dist/skills/editframe-editor-gui/references/toggle-play.md +526 -0
- package/dist/skills/editframe-editor-gui/references/transform-handles.md +924 -0
- package/dist/skills/editframe-editor-gui/references/trim-handles.md +725 -0
- package/dist/skills/editframe-editor-gui/references/workbench.md +453 -0
- package/dist/skills/editframe-motion-design/SKILL.md +101 -0
- package/dist/skills/editframe-motion-design/references/0-editframe.md +299 -0
- package/dist/skills/editframe-motion-design/references/1-intent.md +201 -0
- package/dist/skills/editframe-motion-design/references/2-physics-model.md +405 -0
- package/dist/skills/editframe-motion-design/references/3-attention.md +350 -0
- package/dist/skills/editframe-motion-design/references/4-process.md +418 -0
- package/dist/skills/editframe-vite-plugin/SKILL.md +75 -0
- package/dist/skills/editframe-vite-plugin/references/file-api.md +111 -0
- package/dist/skills/editframe-vite-plugin/references/getting-started.md +96 -0
- package/dist/skills/editframe-vite-plugin/references/jit-transcoding.md +91 -0
- package/dist/skills/editframe-vite-plugin/references/local-assets.md +75 -0
- package/dist/skills/editframe-vite-plugin/references/visual-testing.md +136 -0
- package/dist/skills/editframe-webhooks/SKILL.md +126 -0
- package/dist/skills/editframe-webhooks/references/events.md +382 -0
- package/dist/skills/editframe-webhooks/references/getting-started.md +232 -0
- package/dist/skills/editframe-webhooks/references/security.md +418 -0
- package/dist/skills/editframe-webhooks/references/testing.md +409 -0
- package/dist/skills/editframe-webhooks/references/troubleshooting.md +457 -0
- package/dist/templates/html/AGENTS.md +13 -0
- package/dist/templates/react/AGENTS.md +13 -0
- package/dist/utils.js +15 -16
- package/dist/utils.js.map +1 -1
- package/package.json +2 -2
- package/tsdown.config.ts +4 -0
- package/dist/detectAgent.js +0 -89
- package/dist/detectAgent.js.map +0 -1
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Preview Element
|
|
3
|
+
description: Composition preview container with automatic focus tracking, zoom-to-fit behavior, and overlay layer integration.
|
|
4
|
+
type: reference
|
|
5
|
+
nav:
|
|
6
|
+
parent: "Preview & Canvas"
|
|
7
|
+
priority: 10
|
|
8
|
+
api:
|
|
9
|
+
attributes:
|
|
10
|
+
- name: target
|
|
11
|
+
type: string
|
|
12
|
+
description: ID of timegroup to preview (inherited from EFTargetable)
|
|
13
|
+
react:
|
|
14
|
+
generate: true
|
|
15
|
+
componentName: Preview
|
|
16
|
+
importPath: "@editframe/react"
|
|
17
|
+
additionalProps:
|
|
18
|
+
- name: className
|
|
19
|
+
type: string
|
|
20
|
+
description: CSS classes for styling
|
|
21
|
+
nav:
|
|
22
|
+
parent: "Tools"
|
|
23
|
+
priority: 40
|
|
24
|
+
related: ["controls", "workbench"]
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
<!-- html-only -->
|
|
28
|
+
# ef-preview
|
|
29
|
+
<!-- /html-only -->
|
|
30
|
+
<!-- react-only -->
|
|
31
|
+
# Preview
|
|
32
|
+
<!-- /react-only -->
|
|
33
|
+
|
|
34
|
+
<!-- html-only -->
|
|
35
|
+
Preview container with automatic focus tracking for interactive composition editing.
|
|
36
|
+
<!-- /html-only -->
|
|
37
|
+
<!-- react-only -->
|
|
38
|
+
Video preview player component for viewing compositions.
|
|
39
|
+
<!-- /react-only -->
|
|
40
|
+
|
|
41
|
+
<!-- react-only -->
|
|
42
|
+
## Import
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import { Preview } from "@editframe/react";
|
|
46
|
+
```
|
|
47
|
+
<!-- /react-only -->
|
|
48
|
+
|
|
49
|
+
## Basic Usage
|
|
50
|
+
|
|
51
|
+
<!-- html-only -->
|
|
52
|
+
Wrap a composition to enable preview mode:
|
|
53
|
+
|
|
54
|
+
```html live
|
|
55
|
+
<ef-preview class="w-[720px] h-[480px] bg-gray-100 border border-gray-300 rounded">
|
|
56
|
+
<ef-timegroup mode="contain" class="size-full bg-black">
|
|
57
|
+
<ef-video src="https://assets.editframe.com/bars-n-tone.mp4" class="size-full object-contain"></ef-video>
|
|
58
|
+
</ef-timegroup>
|
|
59
|
+
</ef-preview>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The preview element provides a viewing area with a crosshair cursor by default.
|
|
63
|
+
<!-- /html-only -->
|
|
64
|
+
<!-- react-only -->
|
|
65
|
+
```tsx
|
|
66
|
+
import { Configuration, Preview, Timegroup, Video } from "@editframe/react";
|
|
67
|
+
|
|
68
|
+
export const App = () => {
|
|
69
|
+
return (
|
|
70
|
+
<Configuration mediaEngine="local">
|
|
71
|
+
<div className="flex">
|
|
72
|
+
{/* Preview player */}
|
|
73
|
+
<div className="flex-1">
|
|
74
|
+
<Preview className="w-full h-[600px]" />
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
{/* Composition */}
|
|
78
|
+
<Timegroup mode="sequence" className="w-[1920px] h-[1080px]">
|
|
79
|
+
<Video src="/assets/video.mp4" />
|
|
80
|
+
</Timegroup>
|
|
81
|
+
</div>
|
|
82
|
+
</Configuration>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
```
|
|
86
|
+
<!-- /react-only -->
|
|
87
|
+
|
|
88
|
+
## With Controls
|
|
89
|
+
|
|
90
|
+
<!-- html-only -->
|
|
91
|
+
## Focus Tracking
|
|
92
|
+
|
|
93
|
+
`ef-preview` tracks which temporal element (timegroup, video, audio, etc.) is currently under the cursor:
|
|
94
|
+
|
|
95
|
+
```html live
|
|
96
|
+
<div>
|
|
97
|
+
<ef-preview id="focus-demo" class="w-[720px] h-[480px] bg-gray-100 border border-gray-300 rounded">
|
|
98
|
+
<ef-timegroup mode="contain" class="size-full bg-black">
|
|
99
|
+
<ef-video src="https://assets.editframe.com/bars-n-tone.mp4" class="size-full object-contain"></ef-video>
|
|
100
|
+
<div class="absolute top-4 left-4 bg-white/90 backdrop-blur px-3 py-2 rounded">
|
|
101
|
+
<p class="text-sm font-semibold">Hover over elements</p>
|
|
102
|
+
<p id="focus-output" class="text-xs text-gray-600 mt-1">Focused: None</p>
|
|
103
|
+
</div>
|
|
104
|
+
</ef-timegroup>
|
|
105
|
+
</ef-preview>
|
|
106
|
+
<script>
|
|
107
|
+
const preview = document.getElementById('focus-demo');
|
|
108
|
+
const output = document.getElementById('focus-output');
|
|
109
|
+
|
|
110
|
+
// Listen for focus changes via custom event
|
|
111
|
+
preview.addEventListener('pointerover', (e) => {
|
|
112
|
+
if (e.target !== preview) {
|
|
113
|
+
output.textContent = `Focused: ${e.target.tagName.toLowerCase()}`;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
preview.addEventListener('pointerout', () => {
|
|
117
|
+
output.textContent = 'Focused: None';
|
|
118
|
+
});
|
|
119
|
+
</script>
|
|
120
|
+
</div>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Context Provision
|
|
124
|
+
|
|
125
|
+
`ef-preview` provides the currently focused element via Lit context. This enables other components to react to focus changes:
|
|
126
|
+
|
|
127
|
+
```typescript
|
|
128
|
+
import { consume } from '@lit/context';
|
|
129
|
+
import { focusedElementContext } from '@editframe/elements';
|
|
130
|
+
|
|
131
|
+
@consume({ context: focusedElementContext })
|
|
132
|
+
focusedElement?: HTMLElement;
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
For example, a selection overlay can highlight the focused element, or a properties panel can show details about the focused element.
|
|
136
|
+
|
|
137
|
+
## Target Binding
|
|
138
|
+
|
|
139
|
+
Use the `target` attribute to bind the preview to a specific timegroup:
|
|
140
|
+
|
|
141
|
+
```html live
|
|
142
|
+
<div>
|
|
143
|
+
<ef-timegroup id="preview-target" mode="contain" class="w-[720px] h-[480px] bg-black">
|
|
144
|
+
<ef-video src="https://assets.editframe.com/bars-n-tone.mp4" class="size-full object-contain"></ef-video>
|
|
145
|
+
<div class="absolute top-4 left-4 bg-blue-500 text-white px-3 py-2 rounded">
|
|
146
|
+
<p class="text-sm font-semibold">Target Composition</p>
|
|
147
|
+
</div>
|
|
148
|
+
</ef-timegroup>
|
|
149
|
+
|
|
150
|
+
<ef-preview target="preview-target" class="w-[360px] h-[240px] mt-4 bg-gray-100 border border-gray-300 rounded">
|
|
151
|
+
<!-- Preview mirrors the target timegroup above -->
|
|
152
|
+
</ef-preview>
|
|
153
|
+
</div>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
This allows the preview to display a timegroup defined elsewhere in the DOM.
|
|
157
|
+
|
|
158
|
+
## Focus Detection Behavior
|
|
159
|
+
|
|
160
|
+
Focus is determined by finding the closest temporal element in the DOM tree:
|
|
161
|
+
|
|
162
|
+
1. User hovers over an element
|
|
163
|
+
2. Preview searches up the DOM tree from the hovered element
|
|
164
|
+
3. First temporal ancestor is marked as focused (timegroup, video, audio, image, etc.)
|
|
165
|
+
4. Non-temporal elements (like `<div>`) are skipped
|
|
166
|
+
|
|
167
|
+
This means hovering over text inside a video element will focus the video, not the text.
|
|
168
|
+
|
|
169
|
+
## Focus Overlay Integration
|
|
170
|
+
|
|
171
|
+
Combine with `ef-focus-overlay` to visually highlight the focused element:
|
|
172
|
+
|
|
173
|
+
```html live
|
|
174
|
+
<ef-preview class="w-[720px] h-[480px] bg-gray-100 border border-gray-300 rounded relative">
|
|
175
|
+
<ef-timegroup mode="contain" class="size-full bg-black">
|
|
176
|
+
<ef-video src="https://assets.editframe.com/bars-n-tone.mp4" class="size-full object-contain"></ef-video>
|
|
177
|
+
<div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-white/10 backdrop-blur border-2 border-white/50 px-6 py-4 rounded-lg">
|
|
178
|
+
<p class="text-white text-lg font-semibold">Hover to focus</p>
|
|
179
|
+
</div>
|
|
180
|
+
</ef-timegroup>
|
|
181
|
+
<!-- Focus overlay would go here in a real editor -->
|
|
182
|
+
</ef-preview>
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Building an Editor
|
|
186
|
+
|
|
187
|
+
Use `ef-preview` as the foundation for a composition editor:
|
|
188
|
+
|
|
189
|
+
```html live
|
|
190
|
+
<div class="bg-gray-900 p-4 rounded-lg">
|
|
191
|
+
<div class="flex gap-4">
|
|
192
|
+
<!-- Preview area -->
|
|
193
|
+
<ef-preview class="flex-1 bg-gray-800 border border-gray-700 rounded">
|
|
194
|
+
<ef-timegroup mode="sequence" class="w-[720px] h-[480px] bg-black">
|
|
195
|
+
<ef-timegroup mode="fixed" duration="3s" class="absolute size-full flex items-center justify-center">
|
|
196
|
+
<div class="text-white text-4xl font-bold">Scene 1</div>
|
|
197
|
+
</ef-timegroup>
|
|
198
|
+
<ef-timegroup mode="fixed" duration="3s" class="absolute size-full flex items-center justify-center">
|
|
199
|
+
<div class="text-white text-4xl font-bold">Scene 2</div>
|
|
200
|
+
</ef-timegroup>
|
|
201
|
+
</ef-timegroup>
|
|
202
|
+
</ef-preview>
|
|
203
|
+
|
|
204
|
+
<!-- Properties panel -->
|
|
205
|
+
<div class="w-64 bg-gray-800 border border-gray-700 rounded p-4">
|
|
206
|
+
<h3 class="text-white font-semibold mb-2">Properties</h3>
|
|
207
|
+
<p class="text-gray-400 text-sm">Hover elements to inspect</p>
|
|
208
|
+
</div>
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## Styling
|
|
214
|
+
|
|
215
|
+
The preview element has these default styles:
|
|
216
|
+
- `display: block` - Block-level container
|
|
217
|
+
- `position: relative` - For positioning overlays
|
|
218
|
+
- `cursor: crosshair` - Visual feedback for interactive mode
|
|
219
|
+
|
|
220
|
+
Override with classes:
|
|
221
|
+
|
|
222
|
+
```html
|
|
223
|
+
<ef-preview class="w-full h-screen cursor-default">
|
|
224
|
+
<!-- Content -->
|
|
225
|
+
</ef-preview>
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## Events
|
|
229
|
+
|
|
230
|
+
Focus tracking uses standard pointer events internally:
|
|
231
|
+
- `pointerover` - Element gains focus
|
|
232
|
+
- `pointerout` - Element loses focus
|
|
233
|
+
|
|
234
|
+
Listen to these events on the preview element to react to focus changes:
|
|
235
|
+
|
|
236
|
+
```javascript
|
|
237
|
+
const preview = document.querySelector('ef-preview');
|
|
238
|
+
|
|
239
|
+
preview.addEventListener('pointerover', (e) => {
|
|
240
|
+
if (e.target !== preview) {
|
|
241
|
+
console.log('Focused:', e.target);
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
preview.addEventListener('pointerout', (e) => {
|
|
246
|
+
console.log('Lost focus');
|
|
247
|
+
});
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## Focus Clearing
|
|
251
|
+
|
|
252
|
+
Focus is cleared when:
|
|
253
|
+
- Moving outside the preview entirely
|
|
254
|
+
- Moving to the preview element itself (not a child)
|
|
255
|
+
- Moving to an element that's not within a temporal
|
|
256
|
+
|
|
257
|
+
This ensures focus only highlights meaningful composition elements.
|
|
258
|
+
|
|
259
|
+
## Use Cases
|
|
260
|
+
|
|
261
|
+
**Video Editor:** Display composition with interactive element selection
|
|
262
|
+
```html
|
|
263
|
+
<ef-preview>
|
|
264
|
+
<ef-timegroup mode="contain">
|
|
265
|
+
<ef-video src="video.mp4"></ef-video>
|
|
266
|
+
</ef-timegroup>
|
|
267
|
+
</ef-preview>
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
**Properties Inspector:** Show details about focused elements
|
|
271
|
+
```html
|
|
272
|
+
<ef-preview id="editor">
|
|
273
|
+
<ef-timegroup><!-- composition --></ef-timegroup>
|
|
274
|
+
</ef-preview>
|
|
275
|
+
<div id="properties-panel"><!-- shows focused element props --></div>
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
**Selection System:** Highlight and select elements for editing
|
|
279
|
+
```html
|
|
280
|
+
<ef-preview>
|
|
281
|
+
<ef-timegroup>
|
|
282
|
+
<ef-video id="clip1"></ef-video>
|
|
283
|
+
<ef-text id="title"></ef-text>
|
|
284
|
+
</ef-timegroup>
|
|
285
|
+
</ef-preview>
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
## Nested Previews
|
|
289
|
+
|
|
290
|
+
Previews can be nested — each maintains its own focus state:
|
|
291
|
+
|
|
292
|
+
```html
|
|
293
|
+
<ef-preview class="outer">
|
|
294
|
+
<ef-timegroup>
|
|
295
|
+
<ef-preview class="inner">
|
|
296
|
+
<ef-timegroup><!-- nested composition --></ef-timegroup>
|
|
297
|
+
</ef-preview>
|
|
298
|
+
</ef-timegroup>
|
|
299
|
+
</ef-preview>
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
The inner preview tracks focus independently of the outer preview.
|
|
303
|
+
<!-- /html-only -->
|
|
304
|
+
|
|
305
|
+
<!-- react-only -->
|
|
306
|
+
```tsx
|
|
307
|
+
import { Preview, Controls } from "@editframe/react";
|
|
308
|
+
|
|
309
|
+
<div className="flex flex-col">
|
|
310
|
+
<Preview className="w-full h-[600px] bg-black" />
|
|
311
|
+
<Controls className="w-full" />
|
|
312
|
+
</div>
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
## Styled Preview
|
|
316
|
+
|
|
317
|
+
```tsx
|
|
318
|
+
<Preview className="w-[1280px] h-[720px] bg-gray-900 border border-gray-700 rounded-lg shadow-xl" />
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
## Split View
|
|
322
|
+
|
|
323
|
+
```tsx
|
|
324
|
+
import { Preview, Timegroup, Video, Text } from "@editframe/react";
|
|
325
|
+
|
|
326
|
+
export const SplitView = () => {
|
|
327
|
+
return (
|
|
328
|
+
<div className="grid grid-cols-2 gap-4 p-4">
|
|
329
|
+
{/* Left: Preview */}
|
|
330
|
+
<div>
|
|
331
|
+
<h2 className="text-xl mb-2">Preview</h2>
|
|
332
|
+
<Preview className="w-full aspect-video bg-black rounded" />
|
|
333
|
+
</div>
|
|
334
|
+
|
|
335
|
+
{/* Right: Composition */}
|
|
336
|
+
<div>
|
|
337
|
+
<h2 className="text-xl mb-2">Composition</h2>
|
|
338
|
+
<Timegroup mode="sequence" className="w-[1920px] h-[1080px]">
|
|
339
|
+
<Timegroup mode="fixed" duration="5s" className="absolute w-full h-full">
|
|
340
|
+
<Video src="/assets/video.mp4" className="size-full" />
|
|
341
|
+
<Text duration="5s" className="text-white text-4xl">
|
|
342
|
+
Title
|
|
343
|
+
</Text>
|
|
344
|
+
</Timegroup>
|
|
345
|
+
</Timegroup>
|
|
346
|
+
</div>
|
|
347
|
+
</div>
|
|
348
|
+
);
|
|
349
|
+
};
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
## Full Editor Layout
|
|
353
|
+
|
|
354
|
+
```tsx
|
|
355
|
+
import { Preview, Controls, Workbench } from "@editframe/react";
|
|
356
|
+
|
|
357
|
+
export const Editor = () => {
|
|
358
|
+
return (
|
|
359
|
+
<div className="h-screen flex flex-col bg-gray-900">
|
|
360
|
+
{/* Top: Preview */}
|
|
361
|
+
<div className="flex-1 p-4 flex items-center justify-center">
|
|
362
|
+
<Preview className="max-w-[1280px] max-h-[720px] w-full bg-black rounded shadow-2xl" />
|
|
363
|
+
</div>
|
|
364
|
+
|
|
365
|
+
{/* Middle: Controls */}
|
|
366
|
+
<div className="px-4 py-2">
|
|
367
|
+
<Controls className="w-full" />
|
|
368
|
+
</div>
|
|
369
|
+
|
|
370
|
+
{/* Bottom: Timeline */}
|
|
371
|
+
<div className="h-64 border-t border-gray-700">
|
|
372
|
+
<Workbench />
|
|
373
|
+
</div>
|
|
374
|
+
</div>
|
|
375
|
+
);
|
|
376
|
+
};
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
## Responsive Preview
|
|
380
|
+
|
|
381
|
+
```tsx
|
|
382
|
+
<Preview className="w-full aspect-video max-w-[1920px] mx-auto bg-black" />
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
## Notes
|
|
386
|
+
|
|
387
|
+
- Preview automatically connects to the timeline
|
|
388
|
+
- Shows real-time playback of your composition
|
|
389
|
+
- Scales to fit the container while maintaining aspect ratio
|
|
390
|
+
- Use with `Controls` component for playback buttons
|
|
391
|
+
<!-- /react-only -->
|