@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,418 @@
1
+ ---
2
+ title: Process
3
+ description: "Four-phase animation iteration process: establish motion intent, rough timing, refine easing, and polish with detail."
4
+ type: explanation
5
+ order: 4
6
+ ---
7
+
8
+ # Systematic Iteration
9
+
10
+ ## Core Concept
11
+
12
+ **Broad Strokes → Easing → Secondary → Polish**
13
+
14
+ Don't perfect details before structure is right. Iterate in phases, each building on the previous.
15
+
16
+ ## The Four Phases
17
+
18
+ ```
19
+ Phase 1: Broad Strokes (40% of time)
20
+
21
+ Phase 2: Easing (20% of time)
22
+
23
+ Phase 3: Secondary Motion (25% of time)
24
+
25
+ Phase 4: Polish (15% of time)
26
+ ```
27
+
28
+ ---
29
+
30
+ ## Phase 1: Broad Strokes (40%)
31
+
32
+ **Goal: Get the sequence and rhythm right**
33
+
34
+ ### Do
35
+ - Basic opacity and position only
36
+ - Round timing (200, 300, 500ms)
37
+ - Simple stagger (50, 100, 200ms)
38
+ - Linear easing (ignore curves for now)
39
+ - Test attention flow
40
+
41
+ ### Don't
42
+ - Custom easing curves
43
+ - Squash & stretch
44
+ - Color transitions
45
+ - Particle effects
46
+ - Precise timing
47
+
48
+ ### Success Criteria
49
+ - ✅ Sequence makes sense
50
+ - ✅ Attention flows correctly
51
+ - ✅ Nothing overlaps wrong
52
+ - ✅ Overall rhythm feels approximately right
53
+
54
+ ### Example
55
+ ```
56
+ // Phase 1: Basic structure only
57
+ Title card entrance:
58
+ 0ms: opacity: 0, translateY: 40px
59
+ 300ms: opacity: 1, translateY: 0
60
+ easing: linear // ← ignore easing for now
61
+
62
+ At 30fps: 9 frames
63
+ Simple stagger for multiple elements: +100ms each
64
+ ```
65
+
66
+ **If broad strokes feel wrong, stop.** Don't proceed to Phase 2. Fix the sequence first.
67
+
68
+ ---
69
+
70
+ ## Phase 2: Easing (20%)
71
+
72
+ **Goal: Make motion feel natural**
73
+
74
+ ### Do
75
+ - Replace linear with appropriate easing
76
+ - Fine-tune timing (±50ms adjustments)
77
+ - Test at 0.5× and 2× speed
78
+ - Round to nearest 10ms when settled
79
+
80
+ ### Easing Selection
81
+ - **Entrance:** ease-out (decelerating to rest)
82
+ - **Exit:** ease-in (accelerating away)
83
+ - **Within-screen:** ease-in-out (smooth start and stop)
84
+ - **Never:** linear (except spinners/mechanical)
85
+
86
+ ### Success Criteria
87
+ - ✅ Motion feels natural, not robotic
88
+ - ✅ No jarring speed changes
89
+ - ✅ Comfortable to watch repeatedly
90
+ - ✅ Material choice is evident
91
+
92
+ ### Example
93
+ ```
94
+ // Phase 2: Add proper easing
95
+ Title card entrance:
96
+ 0ms: opacity: 0, translateY: 40px
97
+ 330ms: opacity: 1, translateY: 0 // ← adjusted from 300ms
98
+ easing: ease-out // ← cubic-bezier(0, 0, 0.2, 1)
99
+
100
+ At 30fps: 10 frames (frame-aligned)
101
+ Stagger refined: +80ms each (was +100ms)
102
+ ```
103
+
104
+ ---
105
+
106
+ ## Phase 3: Secondary Motion (25%)
107
+
108
+ **Goal: Add life and personality**
109
+
110
+ ### Do
111
+ - Squash & stretch (material-appropriate)
112
+ - Anticipation & follow-through
113
+ - Scale overshoots (102-105%)
114
+ - Background dimming during focus
115
+ - Subtle rotation during motion
116
+
117
+ ### Material-Based Deformation
118
+
119
+ **Playful (rubber) - for fun brands:**
120
+ ```
121
+ Logo bounce entrance:
122
+ 0ms: scale: 0.8
123
+ 245ms: scale: 1.08 (70% through animation)
124
+ 350ms: scale: 1
125
+
126
+ At 30fps: ~10 frames
127
+ Material: Rubber (energetic overshoot)
128
+ ```
129
+
130
+ **Professional (glass) - for corporate:**
131
+ ```
132
+ Title card entrance:
133
+ 0ms: translateY: 40px, scale: 1
134
+ 210ms: translateY: 0, scale: 1.02 (70% through)
135
+ 300ms: translateY: 0, scale: 1
136
+
137
+ At 30fps: 9 frames
138
+ Material: Glass (subtle overshoot)
139
+ ```
140
+
141
+ ### Success Criteria
142
+ - ✅ Motion has personality
143
+ - ✅ Elements feel like they have weight
144
+ - ✅ Natural physics evident
145
+ - ✅ Not overdone (still serves message)
146
+
147
+ ---
148
+
149
+ ## Phase 4: Polish (15%)
150
+
151
+ **Goal: Handle edge cases and optimize**
152
+
153
+ ### Do
154
+ - Micro-adjustments (±10ms)
155
+ - Edge case testing (long text, missing images)
156
+ - Performance optimization (will-change)
157
+ - Accessibility (prefers-reduced-motion)
158
+ - Cross-browser testing
159
+
160
+ ### Edge Cases to Test
161
+ - Very long text (does it read in time?)
162
+ - Very short text (does timing still work?)
163
+ - Different aspect ratios (16:9, 9:16, 1:1)
164
+ - Different resolutions (SD, HD, 4K)
165
+ - Export format compatibility (H.264, ProRes, WebM)
166
+ - Audio sync (if applicable)
167
+ - Color space (sRGB, Rec.709, Rec.2020)
168
+
169
+ ### Performance
170
+ - Pre-render heavy effects (particles, blur, 3D)
171
+ - Use appropriate motion blur (180° shutter for natural look)
172
+ - Optimize layer count in compositions
173
+ - Ensure smooth playback at target framerate (24/30/60fps)
174
+ - Check export file size vs quality tradeoff
175
+ - Test on target viewing platform (mobile, TV, cinema)
176
+
177
+ ### Accessibility
178
+
179
+ For video content intended for diverse audiences:
180
+
181
+ ```
182
+ Standard version:
183
+ - Full motion with bounces, particles, effects
184
+ - Fast-paced stagger patterns
185
+
186
+ Accessible version (when required):
187
+ - Simpler animations (cuts or dissolves)
188
+ - Longer durations (easier to follow)
189
+ - Reduced flash/strobe effects
190
+ - Lower contrast for motion elements
191
+ - Maintain core message clarity
192
+ ```
193
+
194
+ **Accessibility guidelines:**
195
+ - No flashing faster than 3Hz (seizure risk)
196
+ - Sufficient contrast for legibility
197
+ - Longer read times for critical text
198
+ - Alternative static versions available
199
+ - Captions/subtitles always available
200
+
201
+ ### Success Criteria
202
+ - ✅ Works across all target browsers
203
+ - ✅ Performs at 60fps
204
+ - ✅ Handles edge cases gracefully
205
+ - ✅ Accessible (reduced motion support)
206
+ - ✅ Mobile and desktop optimized
207
+
208
+ ---
209
+
210
+ ## Knowing When to Stop
211
+
212
+ ### Animation is Done When
213
+ 1. ✅ Serves the message clearly
214
+ 2. ✅ Guides attention intentionally
215
+ 3. ✅ Feels natural and polished
216
+ 4. ✅ Performs smoothly (60fps)
217
+ 5. ✅ Survives 10+ repeated views
218
+ 6. ✅ Works on target devices
219
+ 7. ✅ Handles edge cases
220
+ 8. ✅ Passes accessibility checks
221
+
222
+ ### Animation is Not Done If
223
+ - ❌ Tweaking timing by 5ms increments (over-polishing)
224
+ - ❌ Adding motion for motion's sake
225
+ - ❌ Can't explain why specific values chosen
226
+ - ❌ Haven't tested on real devices
227
+ - ❌ Feedback says it's distracting
228
+
229
+ ### The 10-View Test
230
+
231
+ Watch the animation 10 times in a row:
232
+ - **Views 1-3:** Notice everything
233
+ - **Views 4-6:** Start to see flaws
234
+ - **Views 7-10:** Boring vs still pleasant?
235
+
236
+ **If annoying by view 7, simplify or remove.**
237
+
238
+ ---
239
+
240
+ ## Common Iteration Mistakes
241
+
242
+ ### Mistake 1: Polishing Too Early
243
+
244
+ ```javascript
245
+ // Bad: Perfect easing before sequence is right
246
+ element.animate([...], {
247
+ duration: 347, // overly precise
248
+ easing: 'cubic-bezier(0.43, 0.01, 0.22, 0.99)' // custom curve
249
+ });
250
+ ```
251
+
252
+ **Sequence is still wrong!** Broad strokes first, always.
253
+
254
+ ### Mistake 2: Not Testing Edge Cases
255
+
256
+ Only testing:
257
+ - Fast computer ✗
258
+ - Fast internet ✗
259
+ - Perfect data ✗
260
+ - Ideal device ✗
261
+
262
+ **Test worst cases:**
263
+ - Slow device
264
+ - Slow network
265
+ - Missing images
266
+ - Very long text
267
+ - Rapid interaction
268
+
269
+ ### Mistake 3: Ignoring Feedback Patterns
270
+
271
+ Multiple people say "too fast" → it's too fast.
272
+
273
+ Don't defend your choice. Listen to patterns.
274
+
275
+ ### Mistake 4: Over-Engineering
276
+
277
+ ```
278
+ // Too complex for a simple title entrance
279
+ Title card with:
280
+ - 3D rotation on 3 axes
281
+ - Color shift through 5 hues
282
+ - Particle system
283
+ - Light bloom effect
284
+ - Depth of field animation
285
+ All in 600ms
286
+
287
+ Viewer gets: overwhelming blur, misses the title text
288
+ ```
289
+
290
+ **Simpler is better.** Only add properties that serve the message. Title should be readable above all.
291
+
292
+ ---
293
+
294
+ ## Add vs Remove Decision
295
+
296
+ ### Remove If
297
+ - ❌ Distracts from message
298
+ - ❌ Slows user progress
299
+ - ❌ Boring on 3rd+ view
300
+ - ❌ Performance issues
301
+ - ❌ Breaks on some devices
302
+ - ❌ Violates "one focus at a time"
303
+
304
+ ### Add If
305
+ - ✅ Guides attention better
306
+ - ✅ Communicates state clearly
307
+ - ✅ Adds personality without distraction
308
+ - ✅ Makes interaction feel responsive
309
+ - ✅ Shows relationships between elements
310
+
311
+ **Default: Subtract when in doubt.**
312
+
313
+ ---
314
+
315
+ ## Testing at Different Speeds
316
+
317
+ Good animation works at multiple speeds:
318
+
319
+ ```javascript
320
+ // Test at various playback rates
321
+ const speeds = [0.5, 1, 1.5, 2];
322
+
323
+ speeds.forEach(speed => {
324
+ element.animate([...keyframes], {
325
+ duration: baseDuration / speed,
326
+ easing: easing
327
+ });
328
+ });
329
+ ```
330
+
331
+ **Quality test:**
332
+ - **0.5×:** Still feels intentional?
333
+ - **1×:** Perfect?
334
+ - **2×:** Doesn't break logic?
335
+
336
+ If it breaks at any speed, timing relationships are wrong.
337
+
338
+ ---
339
+
340
+ ## Getting Feedback at Right Stage
341
+
342
+ ### After Phase 1 (Broad Strokes):
343
+ **Ask:** "Does the sequence make sense?"
344
+
345
+ Don't ask about easing or polish yet. Just sequence.
346
+
347
+ ### After Phase 2 (Easing):
348
+ **Ask:** "Does the motion feel natural?"
349
+
350
+ Now curves matter. But don't ask about details yet.
351
+
352
+ ### After Phase 3 (Secondary):
353
+ **Ask:** "Does it have personality?"
354
+
355
+ Deformation and weight should be evident.
356
+
357
+ ### After Phase 4 (Polish):
358
+ **Ask:** "Are there any issues or edge cases?"
359
+
360
+ Now details matter.
361
+
362
+ **Don't ask for polish feedback when sequence is wrong!**
363
+
364
+ ---
365
+
366
+ ## Workflow Checklist
367
+
368
+ ```
369
+ □ Phase 1: Broad Strokes (40%)
370
+ □ Basic motion working
371
+ □ Sequence is right
372
+ □ Linear easing OK
373
+ □ Round timing values
374
+
375
+ □ Phase 2: Easing (20%)
376
+ □ Natural movement
377
+ □ Correct curves applied
378
+ □ Fine-tuned timing (±50ms)
379
+ □ Material choice evident
380
+
381
+ □ Phase 3: Secondary Motion (25%)
382
+ □ Squash & stretch added
383
+ □ Anticipation on actions
384
+ □ Follow-through on heavy elements
385
+ □ Supporting animations
386
+
387
+ □ Phase 4: Polish (15%)
388
+ □ Edge cases tested
389
+ □ Performance optimized
390
+ □ Accessibility implemented
391
+ □ Cross-browser verified
392
+ □ 10-view test passed
393
+
394
+ □ Done
395
+ □ Serves message clearly
396
+ □ Guides attention
397
+ □ Performs at 60fps
398
+ □ Works on all targets
399
+ ```
400
+
401
+ ---
402
+
403
+ ## Time Investment Guide
404
+
405
+ For a typical UI animation project:
406
+
407
+ **Total time: 8 hours**
408
+ - Broad strokes: 3.2 hours (40%)
409
+ - Easing: 1.6 hours (20%)
410
+ - Secondary: 2 hours (25%)
411
+ - Polish: 1.2 hours (15%)
412
+
413
+ **If you find yourself:**
414
+ - Spending 50% on polish → too early, go back to broad strokes
415
+ - Spending 10% on broad strokes → rushing, will require rework
416
+ - Skipping phases → recipe for weak foundation
417
+
418
+ Respect the phase distribution. It's optimized for quality with minimum rework.
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: editframe-vite-plugin
3
+ description: Vite integration for Editframe development with local video transcoding, asset serving, file API endpoints, and visual regression testing.
4
+ status: draft
5
+ license: PROPRIETARY
6
+ metadata:
7
+ package: "@editframe/vite-plugin"
8
+ version: "0.37.3-beta"
9
+ type: vite-plugin
10
+ references:
11
+ - getting-started.md
12
+ ---
13
+
14
+ # Vite Plugin
15
+
16
+ ## When do you need this?
17
+
18
+ You need the Vite plugin when your composition references **local video files**. Without it, the browser can't play raw video files — they must be transcoded to streamable ISOBMFF format first.
19
+
20
+ **Already included** in all project templates (`npm create @editframe`). You only need to install it manually when adding Editframe to an existing Vite project.
21
+
22
+ | Scenario | Need this? |
23
+ |----------|-----------|
24
+ | Compositions with local `.mp4`/`.mov` files | Yes — JIT transcoding |
25
+ | Compositions with remote URLs only | No |
26
+ | Adding Editframe to existing Vite project | Yes — install manually |
27
+ | Visual regression tests with Vitest | Yes — use vitest entry point |
28
+
29
+ ## The Dev Loop with This Plugin
30
+
31
+ ```
32
+ npm run dev
33
+
34
+ Vite starts + plugin registers middleware
35
+
36
+ Composition loads video src="/src/assets/clip.mp4"
37
+
38
+ Plugin transcodes on first request → cached in cacheRoot/
39
+
40
+ Subsequent loads → served from cache (fast)
41
+ ```
42
+
43
+ The `@editframe/vite-plugin` adds local development capabilities to your Vite project. It handles on-demand video transcoding, local asset serving, and visual regression testing so you can develop Editframe compositions without cloud API dependencies.
44
+
45
+ ## Installation
46
+
47
+ ```bash
48
+ npm install @editframe/vite-plugin
49
+ ```
50
+
51
+ ## Configuration
52
+
53
+ ```typescript
54
+ // vite.config.ts
55
+ import { defineConfig } from "vite";
56
+ import { vitePluginEditframe } from "@editframe/vite-plugin";
57
+
58
+ export default defineConfig({
59
+ plugins: [
60
+ vitePluginEditframe({
61
+ root: "./src", // Base directory for resolving file paths
62
+ cacheRoot: "./cache", // Directory for cached transcoded assets
63
+ }),
64
+ ],
65
+ });
66
+ ```
67
+
68
+ ## Reference
69
+
70
+ - [references/getting-started.md](references/getting-started.md) — Installation and configuration options
71
+ - [references/jit-transcoding.md](references/jit-transcoding.md) — How on-demand video transcoding works
72
+ - [references/local-assets.md](references/local-assets.md) — Local image and caption serving
73
+ - [references/file-api.md](references/file-api.md) — File API endpoints
74
+ - [references/visual-testing.md](references/visual-testing.md) — Visual regression testing with Vitest
75
+ ```
@@ -0,0 +1,111 @@
1
+ ---
2
+ title: Local File API
3
+ description: Local development endpoints for file upload and ISOBMFF video processing, mirroring the Editframe cloud files API.
4
+ type: reference
5
+ nav:
6
+ parent: "Features"
7
+ priority: 40
8
+ api:
9
+ endpoints:
10
+ - path: /api/v1/files/local/index
11
+ method: GET
12
+ description: Returns the track fragment index for a local file
13
+ - path: /api/v1/files/local/md5
14
+ method: GET
15
+ description: Returns the MD5 hash of a local file
16
+ - path: /api/v1/files/local/track
17
+ method: GET
18
+ description: Returns a transcoded track for a local file
19
+ - path: /api/v1/isobmff_files/local/index
20
+ method: GET
21
+ description: Returns the track fragment index for a local ISOBMFF file
22
+ - path: /api/v1/isobmff_files/local/md5
23
+ method: GET
24
+ description: Returns the MD5 hash of a local ISOBMFF file
25
+ - path: /api/v1/isobmff_files/local/track
26
+ method: GET
27
+ description: Returns a transcoded track for a local ISOBMFF file
28
+ ---
29
+
30
+ # Local File API
31
+
32
+ The plugin provides local equivalents of the production file and ISOBMFF file APIs. These endpoints handle fragment index generation, MD5 hashing, and track extraction for local media files so that the elements runtime can process local assets without a cloud backend.
33
+
34
+ ## Endpoints
35
+
36
+ The `/api/v1/files/local/*` and `/api/v1/isobmff_files/local/*` routes are interchangeable -- both accept the same parameters and produce the same results.
37
+
38
+ ### Fragment Index
39
+
40
+ Returns track metadata (codec, duration, timescale, segment byte offsets) for all tracks in a media file:
41
+
42
+ ```
43
+ GET /api/v1/files/local/index?src=assets/clip.mp4
44
+ GET /api/v1/isobmff_files/local/index?src=assets/clip.mp4
45
+ ```
46
+
47
+ The response is the cached fragment index JSON produced by `generateTrackFragmentIndex`. Each track entry includes:
48
+
49
+ - `type` -- `"video"` or `"audio"`
50
+ - `codec` -- e.g. `"avc1.640029"` or `"mp4a.40.2"`
51
+ - `duration` and `timescale` -- total duration in track timescale units
52
+ - `initSegment` -- byte offset and size of the initialization segment
53
+ - `segments` -- array of `{ offset, size, duration }` for each media segment
54
+
55
+ ### MD5 Hash
56
+
57
+ Returns the MD5 hash of a local file, used for cache invalidation and asset identity:
58
+
59
+ ```
60
+ GET /api/v1/files/local/md5?src=assets/clip.mp4
61
+ ```
62
+
63
+ Response:
64
+
65
+ ```json
66
+ { "md5": "a1b2c3d4e5f6..." }
67
+ ```
68
+
69
+ ### Track Extraction
70
+
71
+ Extracts and serves a specific track from a media file:
72
+
73
+ ```
74
+ GET /api/v1/files/local/track?src=assets/clip.mp4&trackId=1
75
+ GET /api/v1/files/local/track?src=assets/clip.mp4&trackId=1&segmentId=0
76
+ GET /api/v1/files/local/track?src=assets/clip.mp4&trackId=-1
77
+ ```
78
+
79
+ Parameters:
80
+
81
+ - `src` (required) -- path to the source file, resolved relative to `root`
82
+ - `trackId` (required) -- track to extract. `1` for video, `2` for audio, `-1` for the low-resolution scrub track
83
+ - `segmentId` (optional) -- specific segment within the track
84
+
85
+ Track ID `-1` is a special case that calls `generateScrubTrack` instead of `generateTrack`, producing a 320px-wide low-bitrate version for timeline scrubbing.
86
+
87
+ ## Legacy Endpoints
88
+
89
+ These routes predate the REST API and are still supported:
90
+
91
+ | Legacy Route | Equivalent |
92
+ |---|---|
93
+ | `HEAD /@ef-asset/{path}` | `/api/v1/files/local/md5?src={path}` |
94
+ | `/@ef-track-fragment-index/{path}` | `/api/v1/files/local/index?src={path}` |
95
+ | `/@ef-track/{path}?trackId=N` | `/api/v1/files/local/track?src={path}&trackId=N` |
96
+ | `/@ef-scrub-track/{path}` | `/api/v1/files/local/track?src={path}&trackId=-1` |
97
+
98
+ The `@ef-asset` HEAD request returns the MD5 in the `ETag` header and stores an in-memory MD5-to-filepath mapping for subsequent requests.
99
+
100
+ ## Error Handling
101
+
102
+ - Missing `src` returns `400` with `{ error: "src parameter is required" }`
103
+ - Missing `trackId` on the track endpoint returns `400`
104
+ - File not found (`ENOENT`) returns `404`
105
+ - Other errors return `500` with the error message
106
+
107
+ ## Debug Logging
108
+
109
+ ```bash
110
+ DEBUG=ef:vite-plugin:isobmff npm run dev
111
+ ```
@@ -0,0 +1,96 @@
1
+ ---
2
+ title: Getting Started
3
+ description: Install and configure the Editframe Vite plugin to enable local asset serving, JIT transcoding, and visual testing.
4
+ type: reference
5
+ nav:
6
+ parent: vite-plugin
7
+ priority: 1
8
+ api:
9
+ functions:
10
+ - name: vitePluginEditframe
11
+ signature: vitePluginEditframe(options)
12
+ description: Creates the Editframe Vite plugin instance
13
+ returns: Plugin
14
+ ---
15
+
16
+ # Getting Started
17
+
18
+ The Editframe Vite plugin integrates video transcoding, asset management, and visual testing into your Vite development workflow.
19
+
20
+ ## Installation
21
+
22
+ ```bash
23
+ npm install @editframe/vite-plugin
24
+ ```
25
+
26
+ ## Configuration
27
+
28
+ Add the plugin to your `vite.config.ts`:
29
+
30
+ ```typescript
31
+ import { defineConfig } from "vite";
32
+ import { vitePluginEditframe } from "@editframe/vite-plugin";
33
+
34
+ export default defineConfig({
35
+ plugins: [
36
+ vitePluginEditframe({
37
+ root: "./src",
38
+ cacheRoot: "./cache",
39
+ }),
40
+ ],
41
+ });
42
+ ```
43
+
44
+ ## Configuration Options
45
+
46
+ ### root
47
+
48
+ The base directory for resolving relative file paths. When the plugin receives a request for a local file, it resolves the path relative to this directory.
49
+
50
+ ```typescript
51
+ vitePluginEditframe({
52
+ root: "./src",
53
+ cacheRoot: "./cache",
54
+ })
55
+ ```
56
+
57
+ ### cacheRoot
58
+
59
+ Directory where transcoded video assets are cached. On first request for a video, the plugin transcodes it and stores the result here for fast subsequent loads.
60
+
61
+ ```typescript
62
+ vitePluginEditframe({
63
+ root: "./src",
64
+ cacheRoot: "./cache",
65
+ })
66
+ ```
67
+
68
+ ## Vitest Configuration
69
+
70
+ For visual testing with Vitest browser mode, use the vitest-specific entry point:
71
+
72
+ ```typescript
73
+ // vitest.config.ts
74
+ import { defineConfig } from "vitest/config";
75
+
76
+ export default defineConfig(async () => {
77
+ const { vitePluginEditframe } = await import(
78
+ "@editframe/vite-plugin/src/index.vitest.js"
79
+ );
80
+
81
+ return {
82
+ plugins: [
83
+ vitePluginEditframe({
84
+ root: "./test-assets",
85
+ cacheRoot: "./test-assets",
86
+ }),
87
+ ],
88
+ test: {
89
+ browser: {
90
+ enabled: true,
91
+ provider: "playwright",
92
+ },
93
+ },
94
+ };
95
+ });
96
+ ```