@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.
Files changed (99) hide show
  1. package/README.md +11 -0
  2. package/dist/index.js +16 -28
  3. package/dist/index.js.map +1 -1
  4. package/dist/skills/editframe-brand-video-generator/README.md +155 -0
  5. package/dist/skills/editframe-brand-video-generator/SKILL.md +207 -0
  6. package/dist/skills/editframe-brand-video-generator/references/brand-examples.md +178 -0
  7. package/dist/skills/editframe-brand-video-generator/references/color-psychology.md +227 -0
  8. package/dist/skills/editframe-brand-video-generator/references/composition-patterns.md +383 -0
  9. package/dist/skills/editframe-brand-video-generator/references/editing.md +66 -0
  10. package/dist/skills/editframe-brand-video-generator/references/emotional-arcs.md +496 -0
  11. package/dist/skills/editframe-brand-video-generator/references/genre-selection.md +135 -0
  12. package/dist/skills/editframe-brand-video-generator/references/transition-styles.md +611 -0
  13. package/dist/skills/editframe-brand-video-generator/references/typography-personalities.md +326 -0
  14. package/dist/skills/editframe-brand-video-generator/references/video-archetypes.md +86 -0
  15. package/dist/skills/editframe-brand-video-generator/references/video-fundamentals.md +169 -0
  16. package/dist/skills/editframe-brand-video-generator/references/visual-metaphors.md +50 -0
  17. package/dist/skills/editframe-composition/SKILL.md +169 -0
  18. package/dist/skills/editframe-composition/references/audio.md +483 -0
  19. package/dist/skills/editframe-composition/references/captions.md +844 -0
  20. package/dist/skills/editframe-composition/references/composition-model.md +73 -0
  21. package/dist/skills/editframe-composition/references/configuration.md +403 -0
  22. package/dist/skills/editframe-composition/references/css-parts.md +105 -0
  23. package/dist/skills/editframe-composition/references/css-variables.md +640 -0
  24. package/dist/skills/editframe-composition/references/entry-points.md +810 -0
  25. package/dist/skills/editframe-composition/references/events.md +499 -0
  26. package/dist/skills/editframe-composition/references/getting-started.md +259 -0
  27. package/dist/skills/editframe-composition/references/hooks.md +234 -0
  28. package/dist/skills/editframe-composition/references/image.md +241 -0
  29. package/dist/skills/editframe-composition/references/r3f.md +580 -0
  30. package/dist/skills/editframe-composition/references/render-api.md +484 -0
  31. package/dist/skills/editframe-composition/references/render-strategies.md +119 -0
  32. package/dist/skills/editframe-composition/references/render-to-video.md +1101 -0
  33. package/dist/skills/editframe-composition/references/scripting.md +606 -0
  34. package/dist/skills/editframe-composition/references/sequencing.md +116 -0
  35. package/dist/skills/editframe-composition/references/server-rendering.md +753 -0
  36. package/dist/skills/editframe-composition/references/surface.md +329 -0
  37. package/dist/skills/editframe-composition/references/text.md +627 -0
  38. package/dist/skills/editframe-composition/references/time-model.md +99 -0
  39. package/dist/skills/editframe-composition/references/timegroup-modes.md +102 -0
  40. package/dist/skills/editframe-composition/references/timegroup.md +457 -0
  41. package/dist/skills/editframe-composition/references/timeline-root.md +398 -0
  42. package/dist/skills/editframe-composition/references/transcription.md +47 -0
  43. package/dist/skills/editframe-composition/references/transitions.md +608 -0
  44. package/dist/skills/editframe-composition/references/use-media-info.md +357 -0
  45. package/dist/skills/editframe-composition/references/video.md +506 -0
  46. package/dist/skills/editframe-composition/references/waveform.md +327 -0
  47. package/dist/skills/editframe-editor-gui/SKILL.md +152 -0
  48. package/dist/skills/editframe-editor-gui/references/active-root-temporal.md +657 -0
  49. package/dist/skills/editframe-editor-gui/references/canvas.md +947 -0
  50. package/dist/skills/editframe-editor-gui/references/controls.md +366 -0
  51. package/dist/skills/editframe-editor-gui/references/dial.md +756 -0
  52. package/dist/skills/editframe-editor-gui/references/editor-toolkit.md +587 -0
  53. package/dist/skills/editframe-editor-gui/references/filmstrip.md +460 -0
  54. package/dist/skills/editframe-editor-gui/references/fit-scale.md +772 -0
  55. package/dist/skills/editframe-editor-gui/references/focus-overlay.md +561 -0
  56. package/dist/skills/editframe-editor-gui/references/hierarchy.md +544 -0
  57. package/dist/skills/editframe-editor-gui/references/overlay-item.md +634 -0
  58. package/dist/skills/editframe-editor-gui/references/overlay-layer.md +429 -0
  59. package/dist/skills/editframe-editor-gui/references/pan-zoom.md +568 -0
  60. package/dist/skills/editframe-editor-gui/references/pause.md +397 -0
  61. package/dist/skills/editframe-editor-gui/references/play.md +370 -0
  62. package/dist/skills/editframe-editor-gui/references/preview.md +391 -0
  63. package/dist/skills/editframe-editor-gui/references/resizable-box.md +749 -0
  64. package/dist/skills/editframe-editor-gui/references/scrubber.md +588 -0
  65. package/dist/skills/editframe-editor-gui/references/thumbnail-strip.md +566 -0
  66. package/dist/skills/editframe-editor-gui/references/time-display.md +492 -0
  67. package/dist/skills/editframe-editor-gui/references/timeline-ruler.md +489 -0
  68. package/dist/skills/editframe-editor-gui/references/timeline.md +604 -0
  69. package/dist/skills/editframe-editor-gui/references/toggle-loop.md +618 -0
  70. package/dist/skills/editframe-editor-gui/references/toggle-play.md +526 -0
  71. package/dist/skills/editframe-editor-gui/references/transform-handles.md +924 -0
  72. package/dist/skills/editframe-editor-gui/references/trim-handles.md +725 -0
  73. package/dist/skills/editframe-editor-gui/references/workbench.md +453 -0
  74. package/dist/skills/editframe-motion-design/SKILL.md +101 -0
  75. package/dist/skills/editframe-motion-design/references/0-editframe.md +299 -0
  76. package/dist/skills/editframe-motion-design/references/1-intent.md +201 -0
  77. package/dist/skills/editframe-motion-design/references/2-physics-model.md +405 -0
  78. package/dist/skills/editframe-motion-design/references/3-attention.md +350 -0
  79. package/dist/skills/editframe-motion-design/references/4-process.md +418 -0
  80. package/dist/skills/editframe-vite-plugin/SKILL.md +75 -0
  81. package/dist/skills/editframe-vite-plugin/references/file-api.md +111 -0
  82. package/dist/skills/editframe-vite-plugin/references/getting-started.md +96 -0
  83. package/dist/skills/editframe-vite-plugin/references/jit-transcoding.md +91 -0
  84. package/dist/skills/editframe-vite-plugin/references/local-assets.md +75 -0
  85. package/dist/skills/editframe-vite-plugin/references/visual-testing.md +136 -0
  86. package/dist/skills/editframe-webhooks/SKILL.md +126 -0
  87. package/dist/skills/editframe-webhooks/references/events.md +382 -0
  88. package/dist/skills/editframe-webhooks/references/getting-started.md +232 -0
  89. package/dist/skills/editframe-webhooks/references/security.md +418 -0
  90. package/dist/skills/editframe-webhooks/references/testing.md +409 -0
  91. package/dist/skills/editframe-webhooks/references/troubleshooting.md +457 -0
  92. package/dist/templates/html/AGENTS.md +13 -0
  93. package/dist/templates/react/AGENTS.md +13 -0
  94. package/dist/utils.js +15 -16
  95. package/dist/utils.js.map +1 -1
  96. package/package.json +2 -2
  97. package/tsdown.config.ts +4 -0
  98. package/dist/detectAgent.js +0 -89
  99. package/dist/detectAgent.js.map +0 -1
@@ -0,0 +1,587 @@
1
+ ---
2
+ title: Building Custom Editors
3
+ description: Compose Preview, Controls, Filmstrip, Workbench, and Hierarchy components to build fully custom video editor interfaces.
4
+ type: how-to
5
+ nav:
6
+ parent: "Getting Started"
7
+ priority: 1
8
+ react:
9
+ generate: true
10
+ componentName: Building Custom Editors
11
+ importPath: "@editframe/react"
12
+ nav:
13
+ parent: "Guides / Editor UI"
14
+ priority: 50
15
+ related: ["preview", "controls", "filmstrip", "workbench", "hierarchy"]
16
+ ---
17
+
18
+ <!-- html-only -->
19
+ # Building Custom Editors
20
+ <!-- /html-only -->
21
+ <!-- react-only -->
22
+ # Building Custom Editors in React
23
+ <!-- /react-only -->
24
+
25
+ Build video editor interfaces by composing GUI elements. Start with a minimal editor and progressively add features.
26
+
27
+ <!-- react-only -->
28
+ ## Import
29
+
30
+ ```tsx
31
+ import {
32
+ Timegroup, Video, Text, Audio,
33
+ Preview, Controls, TogglePlay, Scrubber,
34
+ TimeDisplay, ToggleLoop, Filmstrip, Hierarchy,
35
+ Workbench, PanZoom, FitScale
36
+ } from "@editframe/react";
37
+ ```
38
+ <!-- /react-only -->
39
+
40
+ ## Minimal Editor (Preview + Controls)
41
+
42
+ The simplest functional editor needs only preview and controls:
43
+
44
+ <!-- html-only -->
45
+ ```html live
46
+ <div class="h-screen flex flex-col bg-gray-900">
47
+ <!-- Preview Area -->
48
+ <div class="flex-1 flex items-center justify-center p-8">
49
+ <ef-preview class="w-full max-w-[1280px] aspect-video bg-black rounded-lg shadow-2xl">
50
+ <ef-timegroup id="minimal-comp" mode="sequence" class="w-[1920px] h-[1080px]">
51
+ <ef-timegroup mode="fixed" duration="3s" class="flex items-center justify-center bg-gradient-to-br from-blue-600 to-purple-600">
52
+ <ef-text duration="3s" class="text-white text-6xl font-bold">Scene 1</ef-text>
53
+ </ef-timegroup>
54
+ <ef-timegroup mode="fixed" duration="3s" class="flex items-center justify-center bg-gradient-to-br from-green-600 to-teal-600">
55
+ <ef-text duration="3s" class="text-white text-6xl font-bold">Scene 2</ef-text>
56
+ </ef-timegroup>
57
+ </ef-timegroup>
58
+ </ef-preview>
59
+ </div>
60
+
61
+ <!-- Controls Bar -->
62
+ <div class="bg-gray-800 border-t border-gray-700 p-4">
63
+ <ef-controls target="minimal-comp" class="flex items-center gap-4 max-w-4xl mx-auto">
64
+ <ef-toggle-play>
65
+ <button slot="play" class="w-10 h-10 flex items-center justify-center text-white hover:text-blue-400 transition">▶</button>
66
+ <button slot="pause" class="w-10 h-10 flex items-center justify-center text-white hover:text-blue-400 transition">⏸</button>
67
+ </ef-toggle-play>
68
+ <ef-time-display class="text-white text-sm font-mono min-w-[120px]"></ef-time-display>
69
+ <ef-scrubber class="flex-1"></ef-scrubber>
70
+ <ef-toggle-loop>
71
+ <button slot="off" class="w-10 h-10 flex items-center justify-center text-gray-400 hover:text-white transition">↻</button>
72
+ <button slot="on" class="w-10 h-10 flex items-center justify-center text-green-400 hover:text-white transition">↻</button>
73
+ </ef-toggle-loop>
74
+ </ef-controls>
75
+ </div>
76
+ </div>
77
+ ```
78
+ <!-- /html-only -->
79
+ <!-- react-only -->
80
+ ```tsx
81
+ const MinimalEditor = () => (
82
+ <div className="h-screen flex flex-col bg-gray-900">
83
+ <div className="flex-1 flex items-center justify-center p-8">
84
+ <Preview className="w-full max-w-[1280px] aspect-video bg-black rounded-lg shadow-2xl">
85
+ <Timegroup id="comp" mode="sequence" className="w-[1920px] h-[1080px]">
86
+ <Timegroup mode="fixed" duration="3s" className="flex items-center justify-center bg-gradient-to-br from-blue-600 to-purple-600">
87
+ <Text duration="3s" className="text-white text-6xl font-bold">Scene 1</Text>
88
+ </Timegroup>
89
+ <Timegroup mode="fixed" duration="3s" className="flex items-center justify-center bg-gradient-to-br from-green-600 to-teal-600">
90
+ <Text duration="3s" className="text-white text-6xl font-bold">Scene 2</Text>
91
+ </Timegroup>
92
+ </Timegroup>
93
+ </Preview>
94
+ </div>
95
+
96
+ <div className="bg-gray-800 border-t border-gray-700 p-4">
97
+ <Controls target="comp" className="flex items-center gap-4 max-w-4xl mx-auto">
98
+ <TogglePlay
99
+ play={<button className="w-10 h-10 text-white hover:text-blue-400">▶</button>}
100
+ pause={<button className="w-10 h-10 text-white hover:text-blue-400">⏸</button>}
101
+ />
102
+ <TimeDisplay className="text-white text-sm font-mono min-w-[120px]" />
103
+ <Scrubber className="flex-1" />
104
+ <ToggleLoop
105
+ off={<button className="text-gray-400 hover:text-white">↻</button>}
106
+ on={<button className="text-green-400 hover:text-white">↻</button>}
107
+ />
108
+ </Controls>
109
+ </div>
110
+ </div>
111
+ );
112
+ ```
113
+ <!-- /react-only -->
114
+
115
+ ## Adding Timeline (Preview + Controls + Filmstrip)
116
+
117
+ <!-- html-only -->
118
+ Add visual timeline feedback with `ef-filmstrip`:
119
+
120
+ ```html live
121
+ <div class="h-screen flex flex-col bg-gray-900">
122
+ <!-- Preview Area -->
123
+ <div class="flex-1 flex items-center justify-center p-4">
124
+ <ef-preview class="w-full max-w-[1280px] aspect-video bg-black rounded-lg shadow-2xl">
125
+ <ef-timegroup id="timeline-comp" mode="sequence" class="w-[1920px] h-[1080px]">
126
+ <ef-timegroup mode="fixed" duration="2s" class="flex items-center justify-center bg-blue-600">
127
+ <ef-text duration="2s" class="text-white text-5xl font-bold">Intro</ef-text>
128
+ </ef-timegroup>
129
+ <ef-timegroup mode="fixed" duration="4s" class="relative">
130
+ <ef-video src="https://assets.editframe.com/bars-n-tone.mp4" sourcein="0s" sourceout="4s" class="absolute inset-0 size-full object-cover"></ef-video>
131
+ <ef-text duration="4s" class="absolute bottom-8 left-8 text-white text-4xl font-bold bg-black/50 px-4 py-2 rounded">Main Content</ef-text>
132
+ </ef-timegroup>
133
+ <ef-timegroup mode="fixed" duration="2s" class="flex items-center justify-center bg-purple-600">
134
+ <ef-text duration="2s" class="text-white text-5xl font-bold">Outro</ef-text>
135
+ </ef-timegroup>
136
+ </ef-timegroup>
137
+ </ef-preview>
138
+ </div>
139
+
140
+ <!-- Controls Bar -->
141
+ <div class="bg-gray-800 border-t border-gray-700 px-4 py-2">
142
+ <ef-controls target="timeline-comp" class="flex items-center gap-3 max-w-4xl mx-auto">
143
+ <ef-toggle-play>
144
+ <button slot="play" class="w-8 h-8 text-white">▶</button>
145
+ <button slot="pause" class="w-8 h-8 text-white">⏸</button>
146
+ </ef-toggle-play>
147
+ <ef-time-display class="text-white text-sm font-mono"></ef-time-display>
148
+ <ef-scrubber class="flex-1 h-2"></ef-scrubber>
149
+ <ef-toggle-loop>
150
+ <button slot="off" class="text-gray-400">↻</button>
151
+ <button slot="on" class="text-green-400">↻</button>
152
+ </ef-toggle-loop>
153
+ </ef-controls>
154
+ </div>
155
+
156
+ <!-- Timeline Panel -->
157
+ <div class="h-64 bg-gray-900 border-t border-gray-800">
158
+ <ef-filmstrip target="timeline-comp" pixels-per-ms="0.1"></ef-filmstrip>
159
+ </div>
160
+ </div>
161
+ ```
162
+ <!-- /html-only -->
163
+ <!-- react-only -->
164
+ Add visual timeline feedback with `Filmstrip`:
165
+
166
+ ```tsx
167
+ const TimelineEditor = () => (
168
+ <div className="h-screen flex flex-col bg-gray-900">
169
+ <div className="flex-1 flex items-center justify-center p-4">
170
+ <Preview className="w-full max-w-[1280px] aspect-video bg-black rounded-lg shadow-2xl">
171
+ <Timegroup id="timeline-comp" mode="sequence" className="w-[1920px] h-[1080px]">
172
+ <Timegroup mode="fixed" duration="2s" className="flex items-center justify-center bg-blue-600">
173
+ <Text duration="2s" className="text-white text-5xl font-bold">Intro</Text>
174
+ </Timegroup>
175
+ <Timegroup mode="fixed" duration="4s" className="relative">
176
+ <Video src="/assets/main.mp4" sourceIn="0s" sourceOut="4s" className="absolute inset-0 size-full object-cover" />
177
+ <Text duration="4s" className="absolute bottom-8 left-8 text-white text-4xl font-bold bg-black/50 px-4 py-2 rounded">Main Content</Text>
178
+ </Timegroup>
179
+ </Timegroup>
180
+ </Preview>
181
+ </div>
182
+
183
+ <div className="bg-gray-800 border-t border-gray-700 px-4 py-2">
184
+ <Controls target="timeline-comp" className="flex items-center gap-3 max-w-4xl mx-auto">
185
+ <TogglePlay play={<button className="text-white">▶</button>} pause={<button className="text-white">⏸</button>} />
186
+ <TimeDisplay className="text-white text-sm font-mono" />
187
+ <Scrubber className="flex-1 h-2" />
188
+ </Controls>
189
+ </div>
190
+
191
+ <div className="h-64 bg-gray-900 border-t border-gray-800">
192
+ <Filmstrip target="timeline-comp" pixelsPerMs={0.1} />
193
+ </div>
194
+ </div>
195
+ );
196
+ ```
197
+ <!-- /react-only -->
198
+
199
+ ## Adding Layers (Preview + Controls + Filmstrip + Hierarchy)
200
+
201
+ <!-- html-only -->
202
+ Add layer management with `ef-hierarchy`:
203
+
204
+ ```html live
205
+ <div class="h-screen flex bg-gray-900">
206
+ <!-- Left Sidebar: Layers -->
207
+ <div class="w-64 bg-gray-800 border-r border-gray-700 flex flex-col">
208
+ <div class="px-4 py-3 border-b border-gray-700">
209
+ <h3 class="text-white font-semibold">Layers</h3>
210
+ </div>
211
+ <div class="flex-1 overflow-auto">
212
+ <ef-hierarchy target="layers-comp" class="w-full"></ef-hierarchy>
213
+ </div>
214
+ </div>
215
+
216
+ <!-- Main Content -->
217
+ <div class="flex-1 flex flex-col">
218
+ <!-- Preview Area -->
219
+ <div class="flex-1 flex items-center justify-center p-4">
220
+ <ef-preview class="w-full max-w-[1280px] aspect-video bg-black rounded-lg">
221
+ <ef-timegroup id="layers-comp" mode="contain" class="w-[1920px] h-[1080px] bg-black">
222
+ <ef-video src="https://assets.editframe.com/bars-n-tone.mp4" class="absolute inset-0 size-full object-cover"></ef-video>
223
+ <ef-text duration="8s" class="absolute top-8 left-8 text-white text-5xl font-bold">Title Text</ef-text>
224
+ <ef-text duration="8s" class="absolute bottom-8 right-8 text-white text-sm">© 2024</ef-text>
225
+ </ef-timegroup>
226
+ </ef-preview>
227
+ </div>
228
+
229
+ <!-- Controls -->
230
+ <div class="bg-gray-800 border-t border-gray-700 px-4 py-2">
231
+ <ef-controls target="layers-comp" class="flex items-center gap-3 max-w-4xl mx-auto">
232
+ <ef-toggle-play>
233
+ <button slot="play" class="w-8 h-8 text-white">▶</button>
234
+ <button slot="pause" class="w-8 h-8 text-white">⏸</button>
235
+ </ef-toggle-play>
236
+ <ef-time-display class="text-white text-sm font-mono"></ef-time-display>
237
+ <ef-scrubber class="flex-1 h-2"></ef-scrubber>
238
+ </ef-controls>
239
+ </div>
240
+
241
+ <!-- Timeline -->
242
+ <div class="h-48 bg-gray-900 border-t border-gray-800">
243
+ <ef-filmstrip target="layers-comp"></ef-filmstrip>
244
+ </div>
245
+ </div>
246
+ </div>
247
+ ```
248
+ <!-- /html-only -->
249
+ <!-- react-only -->
250
+ Add layer management with `Hierarchy`:
251
+
252
+ ```tsx
253
+ const LayeredEditor = () => (
254
+ <div className="h-screen flex bg-gray-900">
255
+ <div className="w-64 bg-gray-800 border-r border-gray-700 flex flex-col">
256
+ <div className="px-4 py-3 border-b border-gray-700">
257
+ <h3 className="text-white font-semibold">Layers</h3>
258
+ </div>
259
+ <div className="flex-1 overflow-auto">
260
+ <Hierarchy target="layers-comp" className="w-full" />
261
+ </div>
262
+ </div>
263
+
264
+ <div className="flex-1 flex flex-col">
265
+ <div className="flex-1 flex items-center justify-center p-4">
266
+ <Preview className="w-full max-w-[1280px] aspect-video bg-black rounded-lg">
267
+ <Timegroup id="layers-comp" mode="contain" className="w-[1920px] h-[1080px] bg-black">
268
+ <Video src="/assets/video.mp4" className="absolute inset-0 size-full object-cover" />
269
+ <Text duration="8s" className="absolute top-8 left-8 text-white text-5xl font-bold">Title Text</Text>
270
+ </Timegroup>
271
+ </Preview>
272
+ </div>
273
+
274
+ <div className="bg-gray-800 border-t border-gray-700 px-4 py-2">
275
+ <Controls target="layers-comp" className="flex items-center gap-3 max-w-4xl mx-auto">
276
+ <TogglePlay play={<button className="text-white">▶</button>} pause={<button className="text-white">⏸</button>} />
277
+ <TimeDisplay className="text-white text-sm font-mono" />
278
+ <Scrubber className="flex-1 h-2" />
279
+ </Controls>
280
+ </div>
281
+
282
+ <div className="h-48 bg-gray-900 border-t border-gray-800">
283
+ <Filmstrip target="layers-comp" />
284
+ </div>
285
+ </div>
286
+ </div>
287
+ );
288
+ ```
289
+ <!-- /react-only -->
290
+
291
+ ## Full-Featured Editor (Using Workbench)
292
+
293
+ <!-- html-only -->
294
+ For a complete editor with all features, use `ef-workbench`:
295
+
296
+ ```html live
297
+ <ef-workbench class="w-full h-screen">
298
+ <ef-pan-zoom slot="canvas">
299
+ <ef-fit-scale>
300
+ <ef-timegroup mode="sequence" class="w-[1920px] h-[1080px]">
301
+ <ef-timegroup mode="fixed" duration="3s" class="relative">
302
+ <ef-video src="https://assets.editframe.com/bars-n-tone.mp4" sourcein="0s" sourceout="3s" class="absolute inset-0 size-full object-cover"></ef-video>
303
+ <div class="absolute inset-0 flex items-center justify-center">
304
+ <ef-text duration="3s" class="text-white text-6xl font-bold bg-black/50 px-8 py-4 rounded-xl">Opening</ef-text>
305
+ </div>
306
+ </ef-timegroup>
307
+ <ef-timegroup mode="fixed" duration="4s" class="relative">
308
+ <ef-video src="https://assets.editframe.com/bars-n-tone.mp4" sourcein="5s" sourceout="9s" class="absolute inset-0 size-full object-cover"></ef-video>
309
+ <ef-text duration="4s" class="absolute top-12 left-12 text-white text-4xl font-bold">Main Content</ef-text>
310
+ <ef-text duration="4s" class="absolute bottom-12 left-12 text-white text-xl">Subtitle text here</ef-text>
311
+ </ef-timegroup>
312
+ <ef-timegroup mode="fixed" duration="2s" class="flex items-center justify-center bg-gradient-to-br from-purple-900 to-blue-900">
313
+ <ef-text duration="2s" class="text-white text-6xl font-bold">Thanks!</ef-text>
314
+ </ef-timegroup>
315
+ </ef-timegroup>
316
+ </ef-fit-scale>
317
+ </ef-pan-zoom>
318
+
319
+ <ef-hierarchy slot="hierarchy"></ef-hierarchy>
320
+
321
+ <div slot="timeline" class="h-full flex flex-col">
322
+ <ef-controls class="flex items-center gap-2 p-2 border-b border-gray-700 bg-gray-800">
323
+ <ef-toggle-play>
324
+ <button slot="play" class="px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition">Play</button>
325
+ <button slot="pause" class="px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 transition">Pause</button>
326
+ </ef-toggle-play>
327
+ <ef-time-display class="text-sm text-gray-300 font-mono"></ef-time-display>
328
+ <ef-scrubber class="flex-1 mx-4"></ef-scrubber>
329
+ <ef-toggle-loop>
330
+ <button slot="off" class="px-3 py-2 text-gray-400 hover:text-white transition">Loop Off</button>
331
+ <button slot="on" class="px-3 py-2 text-green-400 hover:text-white transition">Loop On</button>
332
+ </ef-toggle-loop>
333
+ </ef-controls>
334
+ <ef-filmstrip class="flex-1" pixels-per-ms="0.08"></ef-filmstrip>
335
+ </div>
336
+ </ef-workbench>
337
+ ```
338
+ <!-- /html-only -->
339
+ <!-- react-only -->
340
+ For a complete editor with all features, use `Workbench`:
341
+
342
+ ```tsx
343
+ const FullEditor = () => (
344
+ <Workbench className="w-full h-screen">
345
+ <PanZoom slot="canvas">
346
+ <FitScale>
347
+ <Timegroup mode="sequence" className="w-[1920px] h-[1080px]">
348
+ <Timegroup mode="fixed" duration="3s" className="relative">
349
+ <Video src="/assets/intro.mp4" sourceIn="0s" sourceOut="3s" className="absolute inset-0 size-full object-cover" />
350
+ <div className="absolute inset-0 flex items-center justify-center">
351
+ <Text duration="3s" className="text-white text-6xl font-bold bg-black/50 px-8 py-4 rounded-xl">Opening</Text>
352
+ </div>
353
+ </Timegroup>
354
+ <Timegroup mode="fixed" duration="4s" className="relative">
355
+ <Video src="/assets/main.mp4" sourceIn="5s" sourceOut="9s" className="absolute inset-0 size-full object-cover" />
356
+ <Text duration="4s" className="absolute top-12 left-12 text-white text-4xl font-bold">Main Content</Text>
357
+ </Timegroup>
358
+ <Timegroup mode="fixed" duration="2s" className="flex items-center justify-center bg-gradient-to-br from-purple-900 to-blue-900">
359
+ <Text duration="2s" className="text-white text-6xl font-bold">Thanks!</Text>
360
+ </Timegroup>
361
+ </Timegroup>
362
+ </FitScale>
363
+ </PanZoom>
364
+
365
+ <Hierarchy slot="hierarchy" />
366
+
367
+ <div slot="timeline" className="h-full flex flex-col">
368
+ <Controls className="flex items-center gap-2 p-2 border-b border-gray-700 bg-gray-800">
369
+ <TogglePlay
370
+ play={<button className="px-4 py-2 bg-blue-600 text-white rounded">Play</button>}
371
+ pause={<button className="px-4 py-2 bg-gray-600 text-white rounded">Pause</button>}
372
+ />
373
+ <TimeDisplay className="text-sm text-gray-300 font-mono" />
374
+ <Scrubber className="flex-1 mx-4" />
375
+ <ToggleLoop
376
+ off={<button className="text-gray-400">Loop Off</button>}
377
+ on={<button className="text-green-400">Loop On</button>}
378
+ />
379
+ </Controls>
380
+ <Filmstrip className="flex-1" pixelsPerMs={0.08} />
381
+ </div>
382
+ </Workbench>
383
+ );
384
+ ```
385
+ <!-- /react-only -->
386
+
387
+ <!-- html-only -->
388
+ ## Custom Styling with CSS Parts
389
+
390
+ Style internal elements using `::part()` selectors:
391
+
392
+ ```html live
393
+ <style>
394
+ .custom-scrubber::part(scrubber) {
395
+ background: rgba(255, 255, 255, 0.1);
396
+ height: 6px;
397
+ border-radius: 3px;
398
+ }
399
+
400
+ .custom-scrubber::part(progress) {
401
+ background: linear-gradient(90deg, #3b82f6, #8b5cf6);
402
+ border-radius: 3px;
403
+ }
404
+
405
+ .custom-scrubber::part(handle) {
406
+ width: 16px;
407
+ height: 16px;
408
+ background: white;
409
+ border: 2px solid #3b82f6;
410
+ border-radius: 50%;
411
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
412
+ }
413
+
414
+ .custom-time::part(time) {
415
+ font-family: 'Monaco', monospace;
416
+ font-size: 14px;
417
+ color: #60a5fa;
418
+ letter-spacing: 0.5px;
419
+ }
420
+ </style>
421
+
422
+ <div class="bg-gray-900 p-8 rounded-lg">
423
+ <ef-preview class="w-full max-w-[960px] aspect-video bg-black rounded-lg mx-auto mb-4">
424
+ <ef-timegroup id="styled-comp" mode="contain" class="w-[1920px] h-[1080px] bg-gradient-to-br from-indigo-600 to-purple-700">
425
+ <ef-text duration="5s" class="flex items-center justify-center size-full text-white text-7xl font-bold">
426
+ Custom Styled
427
+ </ef-text>
428
+ </ef-timegroup>
429
+ </ef-preview>
430
+
431
+ <ef-controls target="styled-comp" class="flex items-center gap-4 max-w-2xl mx-auto bg-gray-800 p-4 rounded-lg">
432
+ <ef-toggle-play>
433
+ <button slot="play" class="w-12 h-12 bg-blue-600 rounded-full text-white text-xl hover:bg-blue-700 transition">▶</button>
434
+ <button slot="pause" class="w-12 h-12 bg-gray-600 rounded-full text-white text-xl hover:bg-gray-700 transition">⏸</button>
435
+ </ef-toggle-play>
436
+ <ef-time-display class="custom-time"></ef-time-display>
437
+ <ef-scrubber class="custom-scrubber flex-1"></ef-scrubber>
438
+ </ef-controls>
439
+ </div>
440
+ ```
441
+
442
+ ## Split-Panel Layout
443
+
444
+ Separate preview from composition with side-by-side layout:
445
+
446
+ ```html live
447
+ <div class="h-screen flex flex-col bg-gray-900">
448
+ <div class="flex-1 grid grid-cols-2 gap-4 p-4">
449
+ <!-- Left: Preview -->
450
+ <div class="flex flex-col">
451
+ <h2 class="text-white text-xl mb-2 font-semibold">Preview</h2>
452
+ <ef-preview class="flex-1 bg-black rounded-lg">
453
+ <ef-timegroup id="split-target" mode="sequence" class="w-[1920px] h-[1080px]">
454
+ <ef-timegroup mode="fixed" duration="3s" class="flex items-center justify-center bg-blue-600">
455
+ <ef-text duration="3s" class="text-white text-5xl font-bold">First</ef-text>
456
+ </ef-timegroup>
457
+ <ef-timegroup mode="fixed" duration="3s" class="flex items-center justify-center bg-green-600">
458
+ <ef-text duration="3s" class="text-white text-5xl font-bold">Second</ef-text>
459
+ </ef-timegroup>
460
+ </ef-timegroup>
461
+ </ef-preview>
462
+ </div>
463
+
464
+ <!-- Right: Composition -->
465
+ <div class="flex flex-col">
466
+ <h2 class="text-white text-xl mb-2 font-semibold">Composition Structure</h2>
467
+ <div class="flex-1 bg-gray-800 rounded-lg overflow-auto">
468
+ <ef-hierarchy target="split-target"></ef-hierarchy>
469
+ </div>
470
+ </div>
471
+ </div>
472
+
473
+ <!-- Bottom: Controls + Timeline -->
474
+ <div class="border-t border-gray-800">
475
+ <div class="bg-gray-800 px-4 py-2">
476
+ <ef-controls target="split-target" class="flex items-center gap-3 max-w-4xl mx-auto">
477
+ <ef-toggle-play>
478
+ <button slot="play" class="w-8 h-8 text-white">▶</button>
479
+ <button slot="pause" class="w-8 h-8 text-white">⏸</button>
480
+ </ef-toggle-play>
481
+ <ef-time-display class="text-white text-sm font-mono"></ef-time-display>
482
+ <ef-scrubber class="flex-1 h-2"></ef-scrubber>
483
+ </ef-controls>
484
+ </div>
485
+ <div class="h-48 bg-gray-900">
486
+ <ef-filmstrip target="split-target"></ef-filmstrip>
487
+ </div>
488
+ </div>
489
+ </div>
490
+ ```
491
+ <!-- /html-only -->
492
+
493
+ ## Design Patterns
494
+
495
+ ### Context Bridging
496
+
497
+ <!-- html-only -->
498
+ Controls work through DOM ancestry by default. Use `ef-controls` to bridge contexts when targets are not ancestors:
499
+
500
+ ```html
501
+ <!-- Composition -->
502
+ <ef-timegroup id="my-video" mode="contain">
503
+ <!-- content -->
504
+ </ef-timegroup>
505
+
506
+ <!-- Non-adjacent controls -->
507
+ <ef-controls target="my-video">
508
+ <ef-toggle-play></ef-toggle-play>
509
+ <ef-scrubber></ef-scrubber>
510
+ </ef-controls>
511
+ ```
512
+ <!-- /html-only -->
513
+ <!-- react-only -->
514
+ Controls work through DOM ancestry by default. Use the `target` prop to bridge contexts when controls are not ancestors:
515
+
516
+ ```tsx
517
+ {/* Composition */}
518
+ <Timegroup id="my-video" mode="contain">
519
+ {/* content */}
520
+ </Timegroup>
521
+
522
+ {/* Non-adjacent controls */}
523
+ <Controls target="my-video">
524
+ <TogglePlay play={<button>▶</button>} pause={<button>⏸</button>} />
525
+ <Scrubber />
526
+ </Controls>
527
+ ```
528
+ <!-- /react-only -->
529
+
530
+ ### Progressive Enhancement
531
+
532
+ Build editors incrementally:
533
+ 1. Start with Preview + Controls for basic playback
534
+ 2. Add Filmstrip for visual timeline
535
+ 3. Add Hierarchy for layer management
536
+ 4. Add Workbench for complete editor UI
537
+
538
+ <!-- html-only -->
539
+ ### Responsive Layouts
540
+
541
+ Use CSS Grid and Flexbox for responsive editor layouts:
542
+
543
+ ```html
544
+ <div class="h-screen grid grid-rows-[1fr_auto_200px]">
545
+ <ef-preview><!-- preview --></ef-preview>
546
+ <ef-controls><!-- controls --></ef-controls>
547
+ <ef-filmstrip><!-- timeline --></ef-filmstrip>
548
+ </div>
549
+ ```
550
+
551
+ ### Theming
552
+
553
+ Use CSS custom properties for consistent theming:
554
+
555
+ ```css
556
+ :root {
557
+ --ef-color-bg: #111827;
558
+ --ef-color-border: #374151;
559
+ --ef-color-text: #f9fafb;
560
+ --ef-color-primary: #3b82f6;
561
+ }
562
+ ```
563
+ <!-- /html-only -->
564
+ <!-- react-only -->
565
+ ### Responsive Layouts
566
+
567
+ Use CSS Grid and Flexbox for responsive editor layouts:
568
+
569
+ ```tsx
570
+ <div className="h-screen grid grid-rows-[1fr_auto_200px]">
571
+ <Preview>{/* preview */}</Preview>
572
+ <Controls>{/* controls */}</Controls>
573
+ <Filmstrip />
574
+ </div>
575
+ ```
576
+ <!-- /react-only -->
577
+
578
+ ## Summary
579
+
580
+ - **Minimal**: Preview + Controls for basic playback
581
+ - **Timeline**: Add Filmstrip for visual timeline
582
+ - **Layers**: Add Hierarchy for layer management
583
+ - **Complete**: Use Workbench for full-featured editor
584
+ - **Custom**: Compose elements for custom layouts
585
+ <!-- html-only -->
586
+ - **Styling**: Use CSS parts for deep customization
587
+ <!-- /html-only -->