@editframe/create 0.44.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/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 +1 -1
- package/tsdown.config.ts +4 -0
- package/dist/detectAgent.js +0 -89
- package/dist/detectAgent.js.map +0 -1
|
@@ -0,0 +1,604 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Timeline Element
|
|
3
|
+
description: Complete timeline editor with zoomable tracks, multi-level hierarchy, scrubber, and synchronized playback controls.
|
|
4
|
+
type: reference
|
|
5
|
+
nav:
|
|
6
|
+
parent: "Timeline"
|
|
7
|
+
priority: 10
|
|
8
|
+
api:
|
|
9
|
+
attributes:
|
|
10
|
+
- name: target
|
|
11
|
+
type: string
|
|
12
|
+
description: ID of target element (temporal or canvas) to edit
|
|
13
|
+
- name: control-target
|
|
14
|
+
type: string
|
|
15
|
+
description: ID of temporal element to control playback
|
|
16
|
+
- name: pixels-per-ms
|
|
17
|
+
type: number
|
|
18
|
+
default: 0.04
|
|
19
|
+
description: Zoom level (pixels per millisecond)
|
|
20
|
+
- name: min-zoom
|
|
21
|
+
type: number
|
|
22
|
+
default: 0.1
|
|
23
|
+
description: Minimum zoom level
|
|
24
|
+
- name: max-zoom
|
|
25
|
+
type: number
|
|
26
|
+
default: 10
|
|
27
|
+
description: Maximum zoom level
|
|
28
|
+
- name: enable-trim
|
|
29
|
+
type: boolean
|
|
30
|
+
default: false
|
|
31
|
+
description: Enable trim handles on tracks
|
|
32
|
+
- name: show-controls
|
|
33
|
+
type: boolean
|
|
34
|
+
default: true
|
|
35
|
+
description: Show header with playback and zoom controls
|
|
36
|
+
- name: show-ruler
|
|
37
|
+
type: boolean
|
|
38
|
+
default: true
|
|
39
|
+
description: Show time ruler with frame markers
|
|
40
|
+
- name: show-hierarchy
|
|
41
|
+
type: boolean
|
|
42
|
+
default: true
|
|
43
|
+
description: Show hierarchy panel with element labels
|
|
44
|
+
- name: show-playhead
|
|
45
|
+
type: boolean
|
|
46
|
+
default: true
|
|
47
|
+
description: Show playhead indicator
|
|
48
|
+
- name: show-playback-controls
|
|
49
|
+
type: boolean
|
|
50
|
+
default: true
|
|
51
|
+
description: Show play/pause/loop buttons
|
|
52
|
+
- name: show-zoom-controls
|
|
53
|
+
type: boolean
|
|
54
|
+
default: true
|
|
55
|
+
description: Show zoom in/out buttons
|
|
56
|
+
- name: show-time-display
|
|
57
|
+
type: boolean
|
|
58
|
+
default: true
|
|
59
|
+
description: Show current time / duration
|
|
60
|
+
- name: hide
|
|
61
|
+
type: string
|
|
62
|
+
description: Comma-separated selectors for elements to hide
|
|
63
|
+
- name: show
|
|
64
|
+
type: string
|
|
65
|
+
description: Comma-separated selectors for elements to show
|
|
66
|
+
react:
|
|
67
|
+
generate: true
|
|
68
|
+
componentName: Timeline
|
|
69
|
+
importPath: "@editframe/react"
|
|
70
|
+
propMapping:
|
|
71
|
+
control-target: controlTarget
|
|
72
|
+
pixels-per-ms: pixelsPerMs
|
|
73
|
+
min-zoom: minZoom
|
|
74
|
+
max-zoom: maxZoom
|
|
75
|
+
enable-trim: enableTrim
|
|
76
|
+
show-controls: showControls
|
|
77
|
+
show-ruler: showRuler
|
|
78
|
+
show-hierarchy: showHierarchy
|
|
79
|
+
show-playhead: showPlayhead
|
|
80
|
+
show-playback-controls: showPlaybackControls
|
|
81
|
+
show-zoom-controls: showZoomControls
|
|
82
|
+
show-time-display: showTimeDisplay
|
|
83
|
+
additionalProps:
|
|
84
|
+
- name: className
|
|
85
|
+
type: string
|
|
86
|
+
description: CSS classes for styling
|
|
87
|
+
nav:
|
|
88
|
+
parent: "Tools"
|
|
89
|
+
priority: 43
|
|
90
|
+
related: ["filmstrip", "timeline-ruler", "workbench"]
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
<!-- html-only -->
|
|
94
|
+
# ef-timeline
|
|
95
|
+
<!-- /html-only -->
|
|
96
|
+
<!-- react-only -->
|
|
97
|
+
# Timeline
|
|
98
|
+
<!-- /react-only -->
|
|
99
|
+
|
|
100
|
+
Full-featured timeline editor with tracks, hierarchy view, playback controls, and zoom. Shows the temporal structure of compositions with interactive editing capabilities.
|
|
101
|
+
|
|
102
|
+
<!-- react-only -->
|
|
103
|
+
## Import
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
import { Timeline } from "@editframe/react";
|
|
107
|
+
```
|
|
108
|
+
<!-- /react-only -->
|
|
109
|
+
|
|
110
|
+
## Basic Usage
|
|
111
|
+
|
|
112
|
+
<!-- html-only -->
|
|
113
|
+
Complete timeline editor for a composition.
|
|
114
|
+
|
|
115
|
+
```html live
|
|
116
|
+
<ef-timegroup mode="contain" class="w-[720px] h-[480px] bg-black" id="timeline-demo">
|
|
117
|
+
<ef-video src="https://assets.editframe.com/bars-n-tone.mp4" class="size-full object-contain"></ef-video>
|
|
118
|
+
<ef-text class="absolute top-4 left-4 text-white text-3xl font-bold">Timeline Demo</ef-text>
|
|
119
|
+
<ef-text class="absolute bottom-4 left-4 text-white text-lg">Subtitle text</ef-text>
|
|
120
|
+
</ef-timegroup>
|
|
121
|
+
<div class="mt-4 h-[400px] bg-gray-900 rounded-lg overflow-hidden">
|
|
122
|
+
<ef-timeline target="timeline-demo"></ef-timeline>
|
|
123
|
+
</div>
|
|
124
|
+
```
|
|
125
|
+
<!-- /html-only -->
|
|
126
|
+
<!-- react-only -->
|
|
127
|
+
```tsx
|
|
128
|
+
import { Timeline, Timegroup, Video, Text } from "@editframe/react";
|
|
129
|
+
|
|
130
|
+
<div className="h-96">
|
|
131
|
+
<Timeline className="w-full h-full" />
|
|
132
|
+
|
|
133
|
+
<Timegroup mode="sequence" className="w-[1920px] h-[1080px]" id="composition">
|
|
134
|
+
<Video src="/video1.mp4" />
|
|
135
|
+
<Text>Hello World</Text>
|
|
136
|
+
<Video src="/video2.mp4" />
|
|
137
|
+
</Timegroup>
|
|
138
|
+
</div>
|
|
139
|
+
```
|
|
140
|
+
<!-- /react-only -->
|
|
141
|
+
|
|
142
|
+
<!-- react-only -->
|
|
143
|
+
## With Target
|
|
144
|
+
|
|
145
|
+
Target a specific timeline:
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
<Timeline
|
|
149
|
+
target="main-composition"
|
|
150
|
+
className="w-full h-96"
|
|
151
|
+
/>
|
|
152
|
+
|
|
153
|
+
<Timegroup id="main-composition" mode="sequence" className="w-[1920px] h-[1080px]">
|
|
154
|
+
<Video src="/video.mp4" />
|
|
155
|
+
</Timegroup>
|
|
156
|
+
```
|
|
157
|
+
<!-- /react-only -->
|
|
158
|
+
|
|
159
|
+
<!-- html-only -->
|
|
160
|
+
## Sequence Timeline
|
|
161
|
+
|
|
162
|
+
Timeline automatically adapts to sequential compositions.
|
|
163
|
+
|
|
164
|
+
```html live
|
|
165
|
+
<ef-timegroup mode="sequence" class="w-[720px] h-[480px] bg-black" id="seq-timeline">
|
|
166
|
+
<ef-timegroup class="flex items-center justify-center">
|
|
167
|
+
<ef-video src="https://assets.editframe.com/bars-n-tone.mp4" sourcein="0s" sourceout="2s" class="absolute inset-0 size-full object-contain"></ef-video>
|
|
168
|
+
<h1 class="text-white text-4xl bg-blue-600 p-4 rounded relative">First</h1>
|
|
169
|
+
</ef-timegroup>
|
|
170
|
+
<ef-timegroup class="flex items-center justify-center">
|
|
171
|
+
<ef-video src="https://assets.editframe.com/bars-n-tone.mp4" sourcein="5s" sourceout="7s" class="absolute inset-0 size-full object-contain"></ef-video>
|
|
172
|
+
<h1 class="text-white text-4xl bg-purple-600 p-4 rounded relative">Second</h1>
|
|
173
|
+
</ef-timegroup>
|
|
174
|
+
</ef-timegroup>
|
|
175
|
+
<div class="mt-4 h-[350px] bg-gray-900 rounded-lg overflow-hidden">
|
|
176
|
+
<ef-timeline target="seq-timeline"></ef-timeline>
|
|
177
|
+
</div>
|
|
178
|
+
```
|
|
179
|
+
<!-- /html-only -->
|
|
180
|
+
|
|
181
|
+
## Minimal Timeline
|
|
182
|
+
|
|
183
|
+
<!-- html-only -->
|
|
184
|
+
Hide controls for a compact timeline view.
|
|
185
|
+
|
|
186
|
+
```html live
|
|
187
|
+
<ef-timegroup mode="contain" class="w-[720px] h-[480px] bg-black" id="minimal-demo">
|
|
188
|
+
<ef-video src="https://assets.editframe.com/bars-n-tone.mp4" class="size-full object-contain"></ef-video>
|
|
189
|
+
<ef-text class="absolute bottom-4 left-4 text-white text-2xl">Compact View</ef-text>
|
|
190
|
+
</ef-timegroup>
|
|
191
|
+
<div class="mt-4 h-[250px] bg-gray-900 rounded-lg overflow-hidden">
|
|
192
|
+
<ef-timeline
|
|
193
|
+
target="minimal-demo"
|
|
194
|
+
show-controls="false"
|
|
195
|
+
show-ruler="false"
|
|
196
|
+
></ef-timeline>
|
|
197
|
+
</div>
|
|
198
|
+
<div class="mt-2 flex gap-2">
|
|
199
|
+
<ef-controls target="minimal-demo">
|
|
200
|
+
<ef-toggle-play class="px-3 py-1 bg-blue-600 text-white rounded"></ef-toggle-play>
|
|
201
|
+
</ef-controls>
|
|
202
|
+
</div>
|
|
203
|
+
```
|
|
204
|
+
<!-- /html-only -->
|
|
205
|
+
<!-- react-only -->
|
|
206
|
+
Hide optional UI elements:
|
|
207
|
+
|
|
208
|
+
```tsx
|
|
209
|
+
<Timeline
|
|
210
|
+
showControls={false}
|
|
211
|
+
showHierarchy={false}
|
|
212
|
+
className="w-full h-64"
|
|
213
|
+
/>
|
|
214
|
+
```
|
|
215
|
+
<!-- /react-only -->
|
|
216
|
+
|
|
217
|
+
<!-- html-only -->
|
|
218
|
+
## Timeline with Zoom Controls
|
|
219
|
+
|
|
220
|
+
Built-in zoom controls for detailed editing.
|
|
221
|
+
|
|
222
|
+
```html live
|
|
223
|
+
<ef-timegroup mode="contain" class="w-[720px] h-[480px] bg-black" id="zoom-timeline">
|
|
224
|
+
<ef-video src="https://assets.editframe.com/bars-n-tone.mp4" sourcein="0s" sourceout="5s" class="size-full object-contain"></ef-video>
|
|
225
|
+
<ef-text class="absolute top-4 left-4 text-white text-2xl">Zoomable Timeline</ef-text>
|
|
226
|
+
</ef-timegroup>
|
|
227
|
+
<div class="mt-4 h-[350px] bg-gray-900 rounded-lg overflow-hidden">
|
|
228
|
+
<ef-timeline target="zoom-timeline" min-zoom="0.5" max-zoom="5"></ef-timeline>
|
|
229
|
+
</div>
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Filtering Timeline Tracks
|
|
233
|
+
|
|
234
|
+
Control which elements appear in the timeline.
|
|
235
|
+
|
|
236
|
+
```html live
|
|
237
|
+
<ef-timegroup mode="contain" class="w-[720px] h-[480px] bg-black" id="filter-timeline">
|
|
238
|
+
<ef-video src="https://assets.editframe.com/bars-n-tone.mp4" class="size-full object-contain"></ef-video>
|
|
239
|
+
<ef-text class="absolute top-4 left-4 text-white text-2xl">Main Title</ef-text>
|
|
240
|
+
<ef-text class="absolute bottom-4 left-4 text-white text-sm helper">Helper</ef-text>
|
|
241
|
+
<ef-text class="absolute bottom-4 right-4 text-white text-xs watermark">© 2024</ef-text>
|
|
242
|
+
</ef-timegroup>
|
|
243
|
+
<div class="mt-4 h-[300px] bg-gray-900 rounded-lg overflow-hidden">
|
|
244
|
+
<ef-timeline target="filter-timeline" hide=".helper, .watermark"></ef-timeline>
|
|
245
|
+
</div>
|
|
246
|
+
```
|
|
247
|
+
<!-- /html-only -->
|
|
248
|
+
|
|
249
|
+
<!-- react-only -->
|
|
250
|
+
## Custom Configuration
|
|
251
|
+
|
|
252
|
+
Configure timeline features:
|
|
253
|
+
|
|
254
|
+
```tsx
|
|
255
|
+
<Timeline
|
|
256
|
+
pixelsPerMs={0.08}
|
|
257
|
+
minZoom={0.5}
|
|
258
|
+
maxZoom={5}
|
|
259
|
+
enableTrim
|
|
260
|
+
showControls
|
|
261
|
+
showRuler
|
|
262
|
+
showHierarchy
|
|
263
|
+
showPlayhead
|
|
264
|
+
className="w-full h-96 bg-gray-900"
|
|
265
|
+
/>
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
## Hide Specific Elements
|
|
269
|
+
|
|
270
|
+
Filter what appears in the timeline:
|
|
271
|
+
|
|
272
|
+
```tsx
|
|
273
|
+
{/* Hide waveforms */}
|
|
274
|
+
<Timeline
|
|
275
|
+
hide="ef-waveform"
|
|
276
|
+
className="w-full h-96"
|
|
277
|
+
/>
|
|
278
|
+
|
|
279
|
+
{/* Show only videos and images */}
|
|
280
|
+
<Timeline
|
|
281
|
+
show="ef-video,ef-image"
|
|
282
|
+
className="w-full h-96"
|
|
283
|
+
/>
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
## Trimming Mode
|
|
287
|
+
|
|
288
|
+
Enable trim handles for editing:
|
|
289
|
+
|
|
290
|
+
```tsx
|
|
291
|
+
import { Timeline, Timegroup, Video } from "@editframe/react";
|
|
292
|
+
|
|
293
|
+
<Timeline
|
|
294
|
+
enableTrim
|
|
295
|
+
className="w-full h-96"
|
|
296
|
+
/>
|
|
297
|
+
|
|
298
|
+
<Timegroup mode="sequence" className="w-[1920px] h-[1080px]">
|
|
299
|
+
<Video src="/video.mp4" trimStart="2s" trimEnd="3s" />
|
|
300
|
+
</Timegroup>
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
## Compact Timeline
|
|
304
|
+
|
|
305
|
+
Hide non-essential UI:
|
|
306
|
+
|
|
307
|
+
```tsx
|
|
308
|
+
<Timeline
|
|
309
|
+
showPlaybackControls={false}
|
|
310
|
+
showZoomControls={false}
|
|
311
|
+
showTimeDisplay={false}
|
|
312
|
+
className="w-full h-64"
|
|
313
|
+
/>
|
|
314
|
+
```
|
|
315
|
+
<!-- /react-only -->
|
|
316
|
+
|
|
317
|
+
## Timeline Features
|
|
318
|
+
|
|
319
|
+
**Playback control** — Play/pause/loop buttons with keyboard shortcuts (Space for play/pause).
|
|
320
|
+
|
|
321
|
+
**Time navigation** — Click ruler or tracks to seek, drag playhead for scrubbing.
|
|
322
|
+
|
|
323
|
+
**Zoom control** — Zoom buttons and Cmd/Ctrl+Wheel for zooming toward cursor.
|
|
324
|
+
|
|
325
|
+
**Frame snapping** — At high zoom, snaps to frame boundaries for precision editing.
|
|
326
|
+
|
|
327
|
+
**Auto-scroll** — Playhead auto-scrolls during playback to stay visible.
|
|
328
|
+
|
|
329
|
+
**Keyboard navigation** — Arrow keys move by frame, Shift+Arrow moves by second.
|
|
330
|
+
|
|
331
|
+
**Hierarchy view** — Shows composition structure with nested elements.
|
|
332
|
+
|
|
333
|
+
**Track visualization** — Visual tracks for video, audio, text, images, and timegroups.
|
|
334
|
+
|
|
335
|
+
<!-- html-only -->
|
|
336
|
+
**Selection integration** — Syncs with `ef-canvas` for selecting and highlighting elements.
|
|
337
|
+
<!-- /html-only -->
|
|
338
|
+
|
|
339
|
+
**State persistence** — Remembers zoom and scroll position per composition.
|
|
340
|
+
|
|
341
|
+
<!-- html-only -->
|
|
342
|
+
## Timeline with Canvas
|
|
343
|
+
|
|
344
|
+
Timeline automatically integrates with canvas for selection and highlighting.
|
|
345
|
+
|
|
346
|
+
```html live
|
|
347
|
+
<ef-canvas class="w-[720px] h-[480px] bg-black" id="canvas-timeline">
|
|
348
|
+
<ef-timegroup mode="contain" class="size-full">
|
|
349
|
+
<ef-video src="https://assets.editframe.com/bars-n-tone.mp4" class="size-full object-contain" id="canvas-video"></ef-video>
|
|
350
|
+
<ef-text class="absolute top-4 left-4 text-white text-3xl font-bold" id="canvas-title">
|
|
351
|
+
Editable
|
|
352
|
+
</ef-text>
|
|
353
|
+
</ef-timegroup>
|
|
354
|
+
</ef-canvas>
|
|
355
|
+
<div class="mt-4 h-[350px] bg-gray-900 rounded-lg overflow-hidden">
|
|
356
|
+
<ef-timeline target="canvas-timeline"></ef-timeline>
|
|
357
|
+
</div>
|
|
358
|
+
<div class="mt-2 text-white text-sm">
|
|
359
|
+
Click elements in canvas or timeline to select. Hover tracks to highlight elements.
|
|
360
|
+
</div>
|
|
361
|
+
```
|
|
362
|
+
<!-- /html-only -->
|
|
363
|
+
|
|
364
|
+
<!-- react-only -->
|
|
365
|
+
## Full Editor
|
|
366
|
+
|
|
367
|
+
Complete editor with all features:
|
|
368
|
+
|
|
369
|
+
```tsx
|
|
370
|
+
import { useState } from "react";
|
|
371
|
+
import { Timeline, Preview, Timegroup, Video, Text } from "@editframe/react";
|
|
372
|
+
|
|
373
|
+
export const VideoEditor = () => {
|
|
374
|
+
return (
|
|
375
|
+
<div className="h-screen flex flex-col bg-gray-900">
|
|
376
|
+
{/* Preview */}
|
|
377
|
+
<div className="flex-1 p-6">
|
|
378
|
+
<Preview className="w-full h-full bg-black rounded-lg shadow-2xl" />
|
|
379
|
+
</div>
|
|
380
|
+
|
|
381
|
+
{/* Timeline */}
|
|
382
|
+
<div className="h-80 border-t border-gray-700">
|
|
383
|
+
<Timeline
|
|
384
|
+
enableTrim
|
|
385
|
+
pixelsPerMs={0.06}
|
|
386
|
+
className="w-full h-full"
|
|
387
|
+
/>
|
|
388
|
+
</div>
|
|
389
|
+
|
|
390
|
+
{/* Composition */}
|
|
391
|
+
<Timegroup mode="sequence" className="w-[1920px] h-[1080px]">
|
|
392
|
+
<Video src="/intro.mp4" />
|
|
393
|
+
<Timegroup mode="contain" duration="5s" className="absolute w-full h-full">
|
|
394
|
+
<Video src="/background.mp4" className="size-full" />
|
|
395
|
+
<Text className="absolute top-20 left-20 text-6xl text-white">
|
|
396
|
+
My Video
|
|
397
|
+
</Text>
|
|
398
|
+
</Timegroup>
|
|
399
|
+
<Video src="/outro.mp4" />
|
|
400
|
+
</Timegroup>
|
|
401
|
+
</div>
|
|
402
|
+
);
|
|
403
|
+
};
|
|
404
|
+
```
|
|
405
|
+
<!-- /react-only -->
|
|
406
|
+
|
|
407
|
+
## Zoom Levels
|
|
408
|
+
|
|
409
|
+
Timeline zoom affects level of detail:
|
|
410
|
+
|
|
411
|
+
- **1x (default)** — Standard view, balanced detail
|
|
412
|
+
- **0.1x to 0.5x** — Zoomed out, see entire long compositions
|
|
413
|
+
- **2x to 5x** — Zoomed in, frame markers appear for precision
|
|
414
|
+
- **5x to 10x** — Maximum zoom for frame-accurate editing
|
|
415
|
+
|
|
416
|
+
Frame markers become visible when there's enough space (typically above 2x zoom).
|
|
417
|
+
|
|
418
|
+
## Keyboard Shortcuts
|
|
419
|
+
|
|
420
|
+
When timeline has focus:
|
|
421
|
+
|
|
422
|
+
- **Space** — Play/pause
|
|
423
|
+
- **Arrow Left/Right** — Move by one frame
|
|
424
|
+
- **Shift + Arrow Left/Right** — Move by one second
|
|
425
|
+
- **Cmd/Ctrl + Wheel** — Zoom toward cursor
|
|
426
|
+
|
|
427
|
+
<!-- react-only -->
|
|
428
|
+
```tsx
|
|
429
|
+
<div>
|
|
430
|
+
<div className="mb-4 text-sm space-y-1">
|
|
431
|
+
<p><kbd>←</kbd> / <kbd>→</kbd> - Move by one frame</p>
|
|
432
|
+
<p><kbd>Shift</kbd> + <kbd>←</kbd> / <kbd>→</kbd> - Move by one second</p>
|
|
433
|
+
<p><kbd>Cmd/Ctrl</kbd> + <kbd>Wheel</kbd> - Zoom at cursor position</p>
|
|
434
|
+
</div>
|
|
435
|
+
|
|
436
|
+
<Timeline className="w-full h-96" />
|
|
437
|
+
</div>
|
|
438
|
+
```
|
|
439
|
+
<!-- /react-only -->
|
|
440
|
+
|
|
441
|
+
## CSS Custom Properties
|
|
442
|
+
|
|
443
|
+
Customize timeline appearance:
|
|
444
|
+
|
|
445
|
+
```css
|
|
446
|
+
ef-timeline {
|
|
447
|
+
--ef-color-bg: #0f172a;
|
|
448
|
+
--ef-color-border: #334155;
|
|
449
|
+
--ef-color-playhead: #3b82f6;
|
|
450
|
+
--ef-color-primary: #3b82f6;
|
|
451
|
+
--ef-hierarchy-width: 200px;
|
|
452
|
+
--ef-row-height: 24px;
|
|
453
|
+
--ef-track-height: 24px;
|
|
454
|
+
}
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
## Configuration Patterns
|
|
458
|
+
|
|
459
|
+
<!-- html-only -->
|
|
460
|
+
**Simple playback** — Just timeline with controls:
|
|
461
|
+
```html
|
|
462
|
+
<ef-timeline target="composition" show-hierarchy="false"></ef-timeline>
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
**Editing mode** — Full features with trim handles:
|
|
466
|
+
```html
|
|
467
|
+
<ef-timeline target="composition" enable-trim></ef-timeline>
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
**Reference view** — Static timeline without controls:
|
|
471
|
+
```html
|
|
472
|
+
<ef-timeline
|
|
473
|
+
target="composition"
|
|
474
|
+
show-controls="false"
|
|
475
|
+
show-playhead="false"
|
|
476
|
+
></ef-timeline>
|
|
477
|
+
```
|
|
478
|
+
<!-- /html-only -->
|
|
479
|
+
<!-- react-only -->
|
|
480
|
+
**Simple playback** — Just timeline with controls:
|
|
481
|
+
```tsx
|
|
482
|
+
<Timeline target="composition" showHierarchy={false} />
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
**Editing mode** — Full features with trim handles:
|
|
486
|
+
```tsx
|
|
487
|
+
<Timeline target="composition" enableTrim />
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
**Reference view** — Static timeline without controls:
|
|
491
|
+
```tsx
|
|
492
|
+
<Timeline
|
|
493
|
+
target="composition"
|
|
494
|
+
showControls={false}
|
|
495
|
+
showPlayhead={false}
|
|
496
|
+
/>
|
|
497
|
+
```
|
|
498
|
+
<!-- /react-only -->
|
|
499
|
+
|
|
500
|
+
<!-- react-only -->
|
|
501
|
+
## With React State
|
|
502
|
+
|
|
503
|
+
Integrate with React state:
|
|
504
|
+
|
|
505
|
+
```tsx
|
|
506
|
+
import { useState } from "react";
|
|
507
|
+
import { Timeline } from "@editframe/react";
|
|
508
|
+
|
|
509
|
+
export const StatefulTimeline = () => {
|
|
510
|
+
const [zoom, setZoom] = useState(0.04);
|
|
511
|
+
const [showHierarchy, setShowHierarchy] = useState(true);
|
|
512
|
+
const [enableTrim, setEnableTrim] = useState(false);
|
|
513
|
+
|
|
514
|
+
return (
|
|
515
|
+
<div>
|
|
516
|
+
<div className="flex gap-4 mb-4 p-4 bg-gray-800">
|
|
517
|
+
<label>
|
|
518
|
+
<input
|
|
519
|
+
type="checkbox"
|
|
520
|
+
checked={showHierarchy}
|
|
521
|
+
onChange={(e) => setShowHierarchy(e.target.checked)}
|
|
522
|
+
/>
|
|
523
|
+
Show Hierarchy
|
|
524
|
+
</label>
|
|
525
|
+
|
|
526
|
+
<label>
|
|
527
|
+
<input
|
|
528
|
+
type="checkbox"
|
|
529
|
+
checked={enableTrim}
|
|
530
|
+
onChange={(e) => setEnableTrim(e.target.checked)}
|
|
531
|
+
/>
|
|
532
|
+
Enable Trim
|
|
533
|
+
</label>
|
|
534
|
+
|
|
535
|
+
<div className="flex items-center gap-2">
|
|
536
|
+
<span className="text-sm">Zoom:</span>
|
|
537
|
+
<input
|
|
538
|
+
type="range"
|
|
539
|
+
min="0.01"
|
|
540
|
+
max="0.2"
|
|
541
|
+
step="0.01"
|
|
542
|
+
value={zoom}
|
|
543
|
+
onChange={(e) => setZoom(parseFloat(e.target.value))}
|
|
544
|
+
className="w-32"
|
|
545
|
+
/>
|
|
546
|
+
<span className="text-sm">{Math.round(zoom * 1000)}%</span>
|
|
547
|
+
</div>
|
|
548
|
+
</div>
|
|
549
|
+
|
|
550
|
+
<Timeline
|
|
551
|
+
pixelsPerMs={zoom}
|
|
552
|
+
showHierarchy={showHierarchy}
|
|
553
|
+
enableTrim={enableTrim}
|
|
554
|
+
className="w-full h-96"
|
|
555
|
+
/>
|
|
556
|
+
</div>
|
|
557
|
+
);
|
|
558
|
+
};
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
## Multi-Track Layout
|
|
562
|
+
|
|
563
|
+
Timeline automatically shows all temporal elements:
|
|
564
|
+
|
|
565
|
+
```tsx
|
|
566
|
+
<Timeline className="w-full h-96" />
|
|
567
|
+
|
|
568
|
+
<Timegroup mode="contain" className="w-[1920px] h-[1080px]">
|
|
569
|
+
{/* All elements appear as tracks */}
|
|
570
|
+
<Video src="/video1.mp4" className="absolute top-0 left-0 w-1/2 h-full" />
|
|
571
|
+
<Video src="/video2.mp4" className="absolute top-0 right-0 w-1/2 h-full" />
|
|
572
|
+
<Audio src="/music.mp3" volume={0.5} />
|
|
573
|
+
<Text className="absolute bottom-20 left-20 text-4xl">Caption</Text>
|
|
574
|
+
</Timegroup>
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
## Gestural Zoom
|
|
578
|
+
|
|
579
|
+
Timeline supports mouse/trackpad zoom:
|
|
580
|
+
|
|
581
|
+
```tsx
|
|
582
|
+
<div className="p-4 bg-gray-800 text-sm mb-2">
|
|
583
|
+
Hold <kbd>Cmd/Ctrl</kbd> and scroll to zoom at cursor position
|
|
584
|
+
</div>
|
|
585
|
+
|
|
586
|
+
<Timeline className="w-full h-96" />
|
|
587
|
+
```
|
|
588
|
+
<!-- /react-only -->
|
|
589
|
+
|
|
590
|
+
## Notes
|
|
591
|
+
|
|
592
|
+
- Timeline provides a complete editing interface with controls
|
|
593
|
+
<!-- html-only -->
|
|
594
|
+
- Use `ef-filmstrip` for a simpler view without controls
|
|
595
|
+
<!-- /html-only -->
|
|
596
|
+
<!-- react-only -->
|
|
597
|
+
- Use `Filmstrip` for a simpler view without controls
|
|
598
|
+
<!-- /react-only -->
|
|
599
|
+
- Automatically syncs with playback state
|
|
600
|
+
- Supports frame-by-frame navigation with arrow keys
|
|
601
|
+
- Gestural zoom with Cmd/Ctrl + wheel
|
|
602
|
+
- Hierarchy panel shows element names and nesting
|
|
603
|
+
- Enable trim mode to edit clip in/out points
|
|
604
|
+
- Timeline state persists in localStorage per composition
|