@clypra-studio/engine 1.3.0 → 1.5.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 (60) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-Y4FMAOTW.js → chunk-7ORA5BPW.js} +279 -1302
  3. package/dist/chunk-7ORA5BPW.js.map +1 -0
  4. package/dist/chunk-NG4F55V7.js +300 -0
  5. package/dist/chunk-NG4F55V7.js.map +1 -0
  6. package/dist/chunk-PU3Q4QI7.js +833 -0
  7. package/dist/chunk-PU3Q4QI7.js.map +1 -0
  8. package/dist/chunk-Q7XYDP4X.js +1898 -0
  9. package/dist/chunk-Q7XYDP4X.js.map +1 -0
  10. package/dist/{chunk-LT3HTJ3X.js → chunk-SH7HOGVX.js} +5 -829
  11. package/dist/chunk-SH7HOGVX.js.map +1 -0
  12. package/dist/index-B1lFl4p2.d.ts +122 -0
  13. package/dist/index-Cpps1DKP.d.ts +489 -0
  14. package/dist/index-DrzRbR7G.d.cts +122 -0
  15. package/dist/index-WsvrOpAy.d.cts +489 -0
  16. package/dist/index.cjs +14360 -24090
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +2187 -7852
  19. package/dist/index.d.ts +2187 -7852
  20. package/dist/index.js +11128 -18233
  21. package/dist/index.js.map +1 -1
  22. package/dist/rendering/index.cjs +3694 -0
  23. package/dist/rendering/index.cjs.map +1 -0
  24. package/dist/rendering/index.d.cts +2 -0
  25. package/dist/rendering/index.d.ts +2 -0
  26. package/dist/rendering/index.js +21 -0
  27. package/dist/textEffects/index.cjs +270 -974
  28. package/dist/textEffects/index.cjs.map +1 -1
  29. package/dist/textEffects/index.d.cts +2 -1
  30. package/dist/textEffects/index.d.ts +2 -1
  31. package/dist/textEffects/index.js +6 -4
  32. package/dist/transitions/index.cjs +18 -2199
  33. package/dist/transitions/index.cjs.map +1 -1
  34. package/dist/transitions/index.d.cts +37 -53
  35. package/dist/transitions/index.d.ts +37 -53
  36. package/dist/transitions/index.js +3 -51
  37. package/dist/{index-D6GAXDBy.d.cts → types-IYwXGYkB.d.cts} +300 -154
  38. package/dist/{index-D6GAXDBy.d.ts → types-IYwXGYkB.d.ts} +300 -154
  39. package/dist/videoEffects/index.cjs +4 -835
  40. package/dist/videoEffects/index.cjs.map +1 -1
  41. package/dist/videoEffects/index.d.cts +9 -138
  42. package/dist/videoEffects/index.d.ts +9 -138
  43. package/dist/videoEffects/index.js +1 -15
  44. package/package.json +18 -16
  45. package/dist/TransitionDefinition-CQoSb4ZB.d.cts +0 -158
  46. package/dist/TransitionDefinition-CQoSb4ZB.d.ts +0 -158
  47. package/dist/chunk-FIJBB3MH.js +0 -2990
  48. package/dist/chunk-FIJBB3MH.js.map +0 -1
  49. package/dist/chunk-LT3HTJ3X.js.map +0 -1
  50. package/dist/chunk-RYA4KGDB.js +0 -690
  51. package/dist/chunk-RYA4KGDB.js.map +0 -1
  52. package/dist/chunk-Y4FMAOTW.js.map +0 -1
  53. package/dist/index-BdQ3oRT4.d.cts +0 -139
  54. package/dist/index-BdQ3oRT4.d.ts +0 -139
  55. package/dist/v2/backends/index.cjs +0 -693
  56. package/dist/v2/backends/index.cjs.map +0 -1
  57. package/dist/v2/backends/index.d.cts +0 -3
  58. package/dist/v2/backends/index.d.ts +0 -3
  59. package/dist/v2/backends/index.js +0 -8
  60. /package/dist/{v2/backends → rendering}/index.js.map +0 -0
@@ -0,0 +1,833 @@
1
+ // src/transitions/TransitionRenderer.ts
2
+ var TransitionRenderer = class {
3
+ /**
4
+ * Render a transition between two frames
5
+ *
6
+ * @param ctx - Canvas 2D context
7
+ * @param fromFrame - Canvas or image of the outgoing frame
8
+ * @param toFrame - Canvas or image of the incoming frame
9
+ * @param renderer - Transition type
10
+ * @param params - Transition parameters
11
+ * @param progress - Transition progress (0-1)
12
+ */
13
+ static render(ctx, fromFrame, toFrame, renderer, params, progress) {
14
+ const method = this.getRenderer(renderer);
15
+ if (method) {
16
+ const easedProgress = this.applyEasing(progress, params.easing || "ease-in-out");
17
+ method.call(this, ctx, fromFrame, toFrame, params, easedProgress);
18
+ } else {
19
+ console.warn(`Unknown transition renderer: ${renderer}`);
20
+ this.renderFade(ctx, fromFrame, toFrame, params, progress);
21
+ }
22
+ }
23
+ /**
24
+ * Get the renderer function for a transition type
25
+ */
26
+ static getRenderer(type) {
27
+ const renderers = {
28
+ // Basic
29
+ fade: this.renderFade,
30
+ dissolve: this.renderDissolve,
31
+ cut: this.renderCut,
32
+ canvas: this.renderFade,
33
+ // Legacy fallback for clypra app
34
+ // Zoom
35
+ zoom_in: this.renderZoomIn,
36
+ zoom_out: this.renderZoomOut,
37
+ zoom_blur: this.renderZoomBlur,
38
+ // Slide
39
+ slide_left: this.renderSlideLeft,
40
+ slide_right: this.renderSlideRight,
41
+ slide_up: this.renderSlideUp,
42
+ slide_down: this.renderSlideDown,
43
+ // Wipe
44
+ wipe_left: this.renderWipeLeft,
45
+ wipe_right: this.renderWipeRight,
46
+ wipe_up: this.renderWipeUp,
47
+ wipe_down: this.renderWipeDown,
48
+ wipe_clockwise: this.renderWipeClockwise,
49
+ wipe_center: this.renderWipeCenter,
50
+ // Shape
51
+ circle_expand: this.renderCircleExpand,
52
+ circle_collapse: this.renderCircleCollapse,
53
+ diamond_expand: this.renderDiamondExpand,
54
+ rectangle_expand: this.renderRectangleExpand,
55
+ // Blur
56
+ blur_fade: this.renderBlurFade,
57
+ directional_blur: this.renderDirectionalBlur,
58
+ // Creative
59
+ glitch: this.renderGlitch,
60
+ rgb_split: this.renderRGBSplit,
61
+ chromatic: this.renderChromatic,
62
+ film_burn: this.renderFilmBurn,
63
+ light_leak: this.renderLightLeak,
64
+ whip_pan: this.renderWhipPan
65
+ };
66
+ return renderers[type] || null;
67
+ }
68
+ // ============================================================================
69
+ // BASIC TRANSITIONS
70
+ // ============================================================================
71
+ static renderFade(ctx, from, to, params, progress) {
72
+ const width = ctx.canvas.width;
73
+ const height = ctx.canvas.height;
74
+ ctx.globalAlpha = 1 - progress;
75
+ ctx.drawImage(from, 0, 0, width, height);
76
+ ctx.globalAlpha = progress;
77
+ ctx.drawImage(to, 0, 0, width, height);
78
+ ctx.globalAlpha = 1;
79
+ }
80
+ static renderDissolve(ctx, from, to, params, progress) {
81
+ this.renderFade(ctx, from, to, params, progress);
82
+ }
83
+ static renderCut(ctx, from, to, params, progress) {
84
+ const width = ctx.canvas.width;
85
+ const height = ctx.canvas.height;
86
+ if (progress < 0.5) {
87
+ ctx.drawImage(from, 0, 0, width, height);
88
+ } else {
89
+ ctx.drawImage(to, 0, 0, width, height);
90
+ }
91
+ }
92
+ // ============================================================================
93
+ // ZOOM TRANSITIONS
94
+ // ============================================================================
95
+ static renderZoomIn(ctx, from, to, params, progress) {
96
+ const width = ctx.canvas.width;
97
+ const height = ctx.canvas.height;
98
+ const scale = params.scale || 1.3;
99
+ const fromScale = 1 + progress * (scale - 1);
100
+ ctx.save();
101
+ ctx.translate(width / 2, height / 2);
102
+ ctx.scale(fromScale, fromScale);
103
+ ctx.globalAlpha = 1 - progress;
104
+ ctx.drawImage(from, -width / 2, -height / 2, width, height);
105
+ ctx.restore();
106
+ ctx.globalAlpha = progress;
107
+ ctx.drawImage(to, 0, 0, width, height);
108
+ ctx.globalAlpha = 1;
109
+ }
110
+ static renderZoomOut(ctx, from, to, params, progress) {
111
+ const width = ctx.canvas.width;
112
+ const height = ctx.canvas.height;
113
+ const scale = params.scale || 0.7;
114
+ const fromScale = 1 - progress * (1 - scale);
115
+ ctx.save();
116
+ ctx.translate(width / 2, height / 2);
117
+ ctx.scale(fromScale, fromScale);
118
+ ctx.globalAlpha = 1 - progress;
119
+ ctx.drawImage(from, -width / 2, -height / 2, width, height);
120
+ ctx.restore();
121
+ ctx.globalAlpha = progress;
122
+ ctx.drawImage(to, 0, 0, width, height);
123
+ ctx.globalAlpha = 1;
124
+ }
125
+ static renderZoomBlur(ctx, from, to, params, progress) {
126
+ const blurAmount = (params.blurAmount || 10) * (1 - Math.abs(progress - 0.5) * 2);
127
+ ctx.filter = `blur(${blurAmount}px)`;
128
+ this.renderZoomIn(ctx, from, to, params, progress);
129
+ ctx.filter = "none";
130
+ }
131
+ // ============================================================================
132
+ // SLIDE TRANSITIONS
133
+ // ============================================================================
134
+ static renderSlideLeft(ctx, from, to, params, progress) {
135
+ const width = ctx.canvas.width;
136
+ const height = ctx.canvas.height;
137
+ ctx.drawImage(from, -width * progress, 0, width, height);
138
+ ctx.drawImage(to, width * (1 - progress), 0, width, height);
139
+ }
140
+ static renderSlideRight(ctx, from, to, params, progress) {
141
+ const width = ctx.canvas.width;
142
+ const height = ctx.canvas.height;
143
+ ctx.drawImage(from, width * progress, 0, width, height);
144
+ ctx.drawImage(to, -width * (1 - progress), 0, width, height);
145
+ }
146
+ static renderSlideUp(ctx, from, to, params, progress) {
147
+ const width = ctx.canvas.width;
148
+ const height = ctx.canvas.height;
149
+ ctx.drawImage(from, 0, -height * progress, width, height);
150
+ ctx.drawImage(to, 0, height * (1 - progress), width, height);
151
+ }
152
+ static renderSlideDown(ctx, from, to, params, progress) {
153
+ const width = ctx.canvas.width;
154
+ const height = ctx.canvas.height;
155
+ ctx.drawImage(from, 0, height * progress, width, height);
156
+ ctx.drawImage(to, 0, -height * (1 - progress), width, height);
157
+ }
158
+ // ============================================================================
159
+ // WIPE TRANSITIONS
160
+ // ============================================================================
161
+ static renderWipeLeft(ctx, from, to, params, progress) {
162
+ const width = ctx.canvas.width;
163
+ const height = ctx.canvas.height;
164
+ const wipeX = width * progress;
165
+ ctx.drawImage(from, 0, 0, width, height);
166
+ ctx.save();
167
+ ctx.beginPath();
168
+ ctx.rect(0, 0, wipeX, height);
169
+ ctx.clip();
170
+ ctx.drawImage(to, 0, 0, width, height);
171
+ ctx.restore();
172
+ }
173
+ static renderWipeRight(ctx, from, to, params, progress) {
174
+ const width = ctx.canvas.width;
175
+ const height = ctx.canvas.height;
176
+ const wipeX = width * (1 - progress);
177
+ ctx.drawImage(from, 0, 0, width, height);
178
+ ctx.save();
179
+ ctx.beginPath();
180
+ ctx.rect(wipeX, 0, width - wipeX, height);
181
+ ctx.clip();
182
+ ctx.drawImage(to, 0, 0, width, height);
183
+ ctx.restore();
184
+ }
185
+ static renderWipeUp(ctx, from, to, params, progress) {
186
+ const width = ctx.canvas.width;
187
+ const height = ctx.canvas.height;
188
+ const wipeY = height * progress;
189
+ ctx.drawImage(from, 0, 0, width, height);
190
+ ctx.save();
191
+ ctx.beginPath();
192
+ ctx.rect(0, 0, width, wipeY);
193
+ ctx.clip();
194
+ ctx.drawImage(to, 0, 0, width, height);
195
+ ctx.restore();
196
+ }
197
+ static renderWipeDown(ctx, from, to, params, progress) {
198
+ const width = ctx.canvas.width;
199
+ const height = ctx.canvas.height;
200
+ const wipeY = height * (1 - progress);
201
+ ctx.drawImage(from, 0, 0, width, height);
202
+ ctx.save();
203
+ ctx.beginPath();
204
+ ctx.rect(0, wipeY, width, height - wipeY);
205
+ ctx.clip();
206
+ ctx.drawImage(to, 0, 0, width, height);
207
+ ctx.restore();
208
+ }
209
+ static renderWipeClockwise(ctx, from, to, params, progress) {
210
+ const width = ctx.canvas.width;
211
+ const height = ctx.canvas.height;
212
+ const centerX = width / 2;
213
+ const centerY = height / 2;
214
+ const angle = progress * Math.PI * 2;
215
+ ctx.drawImage(from, 0, 0, width, height);
216
+ ctx.save();
217
+ ctx.beginPath();
218
+ ctx.moveTo(centerX, centerY);
219
+ ctx.arc(centerX, centerY, Math.max(width, height), -Math.PI / 2, angle - Math.PI / 2);
220
+ ctx.closePath();
221
+ ctx.clip();
222
+ ctx.drawImage(to, 0, 0, width, height);
223
+ ctx.restore();
224
+ }
225
+ static renderWipeCenter(ctx, from, to, params, progress) {
226
+ const width = ctx.canvas.width;
227
+ const height = ctx.canvas.height;
228
+ const centerX = width / 2;
229
+ const centerY = height / 2;
230
+ const radius = Math.max(width, height) * progress;
231
+ ctx.drawImage(from, 0, 0, width, height);
232
+ ctx.save();
233
+ ctx.beginPath();
234
+ ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);
235
+ ctx.clip();
236
+ ctx.drawImage(to, 0, 0, width, height);
237
+ ctx.restore();
238
+ }
239
+ // ============================================================================
240
+ // SHAPE TRANSITIONS
241
+ // ============================================================================
242
+ static renderCircleExpand(ctx, from, to, params, progress) {
243
+ this.renderWipeCenter(ctx, from, to, params, progress);
244
+ }
245
+ static renderCircleCollapse(ctx, from, to, params, progress) {
246
+ this.renderWipeCenter(ctx, to, from, params, 1 - progress);
247
+ }
248
+ static renderDiamondExpand(ctx, from, to, params, progress) {
249
+ const width = ctx.canvas.width;
250
+ const height = ctx.canvas.height;
251
+ const centerX = width / 2;
252
+ const centerY = height / 2;
253
+ const size = Math.max(width, height) * progress;
254
+ ctx.drawImage(from, 0, 0, width, height);
255
+ ctx.save();
256
+ ctx.beginPath();
257
+ ctx.moveTo(centerX, centerY - size);
258
+ ctx.lineTo(centerX + size, centerY);
259
+ ctx.lineTo(centerX, centerY + size);
260
+ ctx.lineTo(centerX - size, centerY);
261
+ ctx.closePath();
262
+ ctx.clip();
263
+ ctx.drawImage(to, 0, 0, width, height);
264
+ ctx.restore();
265
+ }
266
+ static renderRectangleExpand(ctx, from, to, params, progress) {
267
+ const width = ctx.canvas.width;
268
+ const height = ctx.canvas.height;
269
+ const rectWidth = width * progress;
270
+ const rectHeight = height * progress;
271
+ const x = (width - rectWidth) / 2;
272
+ const y = (height - rectHeight) / 2;
273
+ ctx.drawImage(from, 0, 0, width, height);
274
+ ctx.save();
275
+ ctx.beginPath();
276
+ ctx.rect(x, y, rectWidth, rectHeight);
277
+ ctx.clip();
278
+ ctx.drawImage(to, 0, 0, width, height);
279
+ ctx.restore();
280
+ }
281
+ // ============================================================================
282
+ // BLUR TRANSITIONS
283
+ // ============================================================================
284
+ static renderBlurFade(ctx, from, to, params, progress) {
285
+ const blurAmount = (params.blurAmount || 10) * (1 - Math.abs(progress - 0.5) * 2);
286
+ ctx.filter = `blur(${blurAmount}px)`;
287
+ this.renderFade(ctx, from, to, params, progress);
288
+ ctx.filter = "none";
289
+ }
290
+ static renderDirectionalBlur(ctx, from, to, params, progress) {
291
+ this.renderBlurFade(ctx, from, to, params, progress);
292
+ }
293
+ // ============================================================================
294
+ // CREATIVE TRANSITIONS
295
+ // ============================================================================
296
+ static renderGlitch(ctx, from, to, params, progress) {
297
+ this.renderFade(ctx, from, to, params, progress);
298
+ const width = ctx.canvas.width;
299
+ const height = ctx.canvas.height;
300
+ const glitchIntensity = Math.sin(progress * Math.PI) * 20;
301
+ for (let i = 0; i < 5; i++) {
302
+ const y = Math.random() * height;
303
+ const sliceHeight = Math.random() * 20;
304
+ const offset = (Math.random() - 0.5) * glitchIntensity;
305
+ const imageData = ctx.getImageData(0, y, width, sliceHeight);
306
+ ctx.putImageData(imageData, offset, y);
307
+ }
308
+ }
309
+ static renderRGBSplit(ctx, from, to, params, progress) {
310
+ const offset = Math.sin(progress * Math.PI) * 10;
311
+ ctx.globalCompositeOperation = "screen";
312
+ ctx.globalAlpha = 0.5;
313
+ ctx.drawImage(from, offset, 0, ctx.canvas.width, ctx.canvas.height);
314
+ ctx.drawImage(to, -offset, 0, ctx.canvas.width, ctx.canvas.height);
315
+ ctx.globalAlpha = 1;
316
+ ctx.globalCompositeOperation = "source-over";
317
+ }
318
+ static renderChromatic(ctx, from, to, params, progress) {
319
+ this.renderRGBSplit(ctx, from, to, params, progress);
320
+ }
321
+ static renderFilmBurn(ctx, from, to, params, progress) {
322
+ this.renderFade(ctx, from, to, params, progress);
323
+ const intensity = Math.sin(progress * Math.PI);
324
+ ctx.fillStyle = `rgba(255, 200, 100, ${intensity * 0.5})`;
325
+ ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
326
+ }
327
+ static renderLightLeak(ctx, from, to, params, progress) {
328
+ this.renderFade(ctx, from, to, params, progress);
329
+ const gradient = ctx.createLinearGradient(0, 0, ctx.canvas.width, ctx.canvas.height);
330
+ const intensity = Math.sin(progress * Math.PI);
331
+ gradient.addColorStop(0, `rgba(255, 200, 100, ${intensity * 0.4})`);
332
+ gradient.addColorStop(1, "rgba(255, 200, 100, 0)");
333
+ ctx.globalCompositeOperation = "screen";
334
+ ctx.fillStyle = gradient;
335
+ ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
336
+ ctx.globalCompositeOperation = "source-over";
337
+ }
338
+ static renderWhipPan(ctx, from, to, params, progress) {
339
+ const blurAmount = Math.sin(progress * Math.PI) * 20;
340
+ ctx.filter = `blur(${blurAmount}px)`;
341
+ if (progress < 0.5) {
342
+ const offset = progress * ctx.canvas.width * 2;
343
+ ctx.drawImage(from, -offset, 0, ctx.canvas.width, ctx.canvas.height);
344
+ } else {
345
+ const offset = (1 - progress) * ctx.canvas.width * 2;
346
+ ctx.drawImage(to, offset, 0, ctx.canvas.width, ctx.canvas.height);
347
+ }
348
+ ctx.filter = "none";
349
+ }
350
+ // ============================================================================
351
+ // EASING FUNCTIONS
352
+ // ============================================================================
353
+ static applyEasing(t, easing = "linear") {
354
+ switch (easing) {
355
+ case "linear":
356
+ return t;
357
+ case "ease":
358
+ case "ease-in-out":
359
+ return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
360
+ case "ease-in":
361
+ return t * t;
362
+ case "ease-out":
363
+ return t * (2 - t);
364
+ case "ease-in-quad":
365
+ return t * t;
366
+ case "ease-out-quad":
367
+ return t * (2 - t);
368
+ case "ease-in-out-quad":
369
+ return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
370
+ case "ease-in-cubic":
371
+ return t * t * t;
372
+ case "ease-out-cubic":
373
+ return --t * t * t + 1;
374
+ case "ease-in-out-cubic":
375
+ return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
376
+ case "ease-in-quart":
377
+ return t * t * t * t;
378
+ case "ease-out-quart":
379
+ return 1 - --t * t * t * t;
380
+ case "ease-in-out-quart":
381
+ return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;
382
+ case "spring":
383
+ return 1 - Math.cos(t * Math.PI * 2.5) * (1 - t);
384
+ case "bounce":
385
+ if (t < 1 / 2.75) {
386
+ return 7.5625 * t * t;
387
+ } else if (t < 2 / 2.75) {
388
+ return 7.5625 * (t -= 1.5 / 2.75) * t + 0.75;
389
+ } else if (t < 2.5 / 2.75) {
390
+ return 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375;
391
+ } else {
392
+ return 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375;
393
+ }
394
+ default:
395
+ return t;
396
+ }
397
+ }
398
+ };
399
+
400
+ // src/transitions/presets.ts
401
+ var TRANSITION_CATEGORIES = ["fade", "slide", "wipe", "zoom", "dissolve", "creative"];
402
+ var PRESETS_RAW = [
403
+ // ========== FADE ==========
404
+ {
405
+ id: "simple-fade",
406
+ name: "Simple Fade",
407
+ category: "fade",
408
+ description: "Classic crossfade - smooth opacity transition",
409
+ tags: ["basic", "smooth", "classic"],
410
+ defaultDuration: 1,
411
+ renderer: "fade",
412
+ params: {}
413
+ },
414
+ {
415
+ id: "fade-to-black",
416
+ name: "Fade to Black",
417
+ category: "fade",
418
+ description: "Fade out to black, then fade in from black",
419
+ tags: ["dramatic", "black", "film"],
420
+ defaultDuration: 1.5,
421
+ renderer: "fade",
422
+ params: {
423
+ color: "#000000"
424
+ }
425
+ },
426
+ {
427
+ id: "fade-to-white",
428
+ name: "Fade to White",
429
+ category: "fade",
430
+ description: "Bright flash transition through white",
431
+ tags: ["bright", "flash", "clean"],
432
+ defaultDuration: 1,
433
+ renderer: "fade",
434
+ params: {
435
+ color: "#FFFFFF"
436
+ }
437
+ },
438
+ {
439
+ id: "dissolve",
440
+ name: "Dissolve",
441
+ category: "dissolve",
442
+ description: "Smooth crossfade dissolution",
443
+ tags: ["smooth", "classic", "blend"],
444
+ defaultDuration: 1,
445
+ renderer: "dissolve",
446
+ params: {}
447
+ },
448
+ // ========== SLIDE ==========
449
+ {
450
+ id: "slide-left",
451
+ name: "Slide Left",
452
+ category: "slide",
453
+ description: "New clip slides in from right to left",
454
+ tags: ["directional", "smooth", "horizontal"],
455
+ defaultDuration: 0.8,
456
+ renderer: "slide_left",
457
+ params: {}
458
+ },
459
+ {
460
+ id: "slide-right",
461
+ name: "Slide Right",
462
+ category: "slide",
463
+ description: "New clip slides in from left to right",
464
+ tags: ["directional", "smooth", "horizontal"],
465
+ defaultDuration: 0.8,
466
+ renderer: "slide_right",
467
+ params: {}
468
+ },
469
+ {
470
+ id: "slide-up",
471
+ name: "Slide Up",
472
+ category: "slide",
473
+ description: "New clip slides in from bottom to top",
474
+ tags: ["directional", "smooth", "vertical"],
475
+ defaultDuration: 0.8,
476
+ renderer: "slide_up",
477
+ params: {}
478
+ },
479
+ {
480
+ id: "slide-down",
481
+ name: "Slide Down",
482
+ category: "slide",
483
+ description: "New clip slides in from top to bottom",
484
+ tags: ["directional", "smooth", "vertical"],
485
+ defaultDuration: 0.8,
486
+ renderer: "slide_down",
487
+ params: {}
488
+ },
489
+ // ========== WIPE ==========
490
+ {
491
+ id: "wipe-left",
492
+ name: "Wipe Left",
493
+ category: "wipe",
494
+ description: "Clean horizontal wipe from left",
495
+ tags: ["directional", "clean", "horizontal"],
496
+ defaultDuration: 0.9,
497
+ renderer: "wipe_left",
498
+ params: {}
499
+ },
500
+ {
501
+ id: "wipe-right",
502
+ name: "Wipe Right",
503
+ category: "wipe",
504
+ description: "Clean horizontal wipe from right",
505
+ tags: ["directional", "clean", "horizontal"],
506
+ defaultDuration: 0.9,
507
+ renderer: "wipe_right",
508
+ params: {}
509
+ },
510
+ {
511
+ id: "wipe-up",
512
+ name: "Wipe Up",
513
+ category: "wipe",
514
+ description: "Clean vertical wipe from bottom",
515
+ tags: ["directional", "clean", "vertical"],
516
+ defaultDuration: 0.9,
517
+ renderer: "wipe_up",
518
+ params: {}
519
+ },
520
+ {
521
+ id: "wipe-down",
522
+ name: "Wipe Down",
523
+ category: "wipe",
524
+ description: "Clean vertical wipe from top",
525
+ tags: ["directional", "clean", "vertical"],
526
+ defaultDuration: 0.9,
527
+ renderer: "wipe_down",
528
+ params: {}
529
+ },
530
+ {
531
+ id: "wipe-clockwise",
532
+ name: "Clock Wipe",
533
+ category: "wipe",
534
+ description: "Rotating clock hand wipe effect",
535
+ tags: ["radial", "rotating", "clock"],
536
+ defaultDuration: 1.2,
537
+ renderer: "wipe_clockwise",
538
+ params: {}
539
+ },
540
+ {
541
+ id: "wipe-center",
542
+ name: "Circle Wipe",
543
+ category: "wipe",
544
+ description: "Circular reveal from center outward",
545
+ tags: ["radial", "reveal", "circular"],
546
+ defaultDuration: 1,
547
+ renderer: "wipe_center",
548
+ params: {}
549
+ },
550
+ // ========== ZOOM ==========
551
+ {
552
+ id: "zoom-in",
553
+ name: "Zoom In",
554
+ category: "zoom",
555
+ description: "Outgoing clip zooms in while new clip fades in",
556
+ tags: ["scale", "dramatic", "zoom"],
557
+ defaultDuration: 1,
558
+ renderer: "zoom_in",
559
+ params: {
560
+ scale: 1.3
561
+ }
562
+ },
563
+ {
564
+ id: "zoom-out",
565
+ name: "Zoom Out",
566
+ category: "zoom",
567
+ description: "Outgoing clip zooms out while new clip fades in",
568
+ tags: ["scale", "reveal", "zoom"],
569
+ defaultDuration: 1,
570
+ renderer: "zoom_out",
571
+ params: {
572
+ scale: 0.7
573
+ }
574
+ },
575
+ {
576
+ id: "zoom-blur",
577
+ name: "Zoom with Blur",
578
+ category: "zoom",
579
+ description: "Fast zoom with motion blur for energy",
580
+ tags: ["fast", "blur", "energy"],
581
+ defaultDuration: 0.6,
582
+ renderer: "zoom_blur",
583
+ params: {
584
+ scale: 1.3,
585
+ blurAmount: 12
586
+ }
587
+ },
588
+ // ========== SHAPE ==========
589
+ {
590
+ id: "circle-expand",
591
+ name: "Circle Expand",
592
+ category: "wipe",
593
+ description: "New clip expands from center in a circle",
594
+ tags: ["radial", "expand", "circle"],
595
+ defaultDuration: 1,
596
+ renderer: "circle_expand",
597
+ params: {}
598
+ },
599
+ {
600
+ id: "circle-collapse",
601
+ name: "Circle Collapse",
602
+ category: "wipe",
603
+ description: "Old clip collapses to center in a circle",
604
+ tags: ["radial", "collapse", "circle"],
605
+ defaultDuration: 1,
606
+ renderer: "circle_collapse",
607
+ params: {}
608
+ },
609
+ {
610
+ id: "diamond-expand",
611
+ name: "Diamond Expand",
612
+ category: "wipe",
613
+ description: "New clip expands from center in a diamond shape",
614
+ tags: ["geometric", "expand", "diamond"],
615
+ defaultDuration: 1,
616
+ renderer: "diamond_expand",
617
+ params: {}
618
+ },
619
+ {
620
+ id: "rectangle-expand",
621
+ name: "Rectangle Expand",
622
+ category: "wipe",
623
+ description: "New clip expands from center in a rectangle",
624
+ tags: ["geometric", "expand", "rectangle"],
625
+ defaultDuration: 1,
626
+ renderer: "rectangle_expand",
627
+ params: {}
628
+ },
629
+ // ========== BLUR ==========
630
+ {
631
+ id: "blur-fade",
632
+ name: "Blur Fade",
633
+ category: "creative",
634
+ description: "Dreamy fade with motion blur effect",
635
+ tags: ["blur", "dreamy", "soft"],
636
+ defaultDuration: 1.2,
637
+ renderer: "blur_fade",
638
+ params: {
639
+ blurAmount: 15
640
+ }
641
+ },
642
+ {
643
+ id: "directional-blur",
644
+ name: "Directional Blur",
645
+ category: "creative",
646
+ description: "Fade with directional motion blur",
647
+ tags: ["blur", "motion", "directional"],
648
+ defaultDuration: 1,
649
+ renderer: "directional_blur",
650
+ params: {
651
+ blurAmount: 12
652
+ }
653
+ },
654
+ // ========== CREATIVE ==========
655
+ {
656
+ id: "glitch",
657
+ name: "Glitch",
658
+ category: "creative",
659
+ description: "Digital glitch transition with artifacts",
660
+ tags: ["glitch", "digital", "distortion"],
661
+ defaultDuration: 0.8,
662
+ renderer: "glitch",
663
+ params: {}
664
+ },
665
+ {
666
+ id: "rgb-split",
667
+ name: "RGB Split",
668
+ category: "creative",
669
+ description: "Chromatic aberration RGB channel split",
670
+ tags: ["chromatic", "rgb", "split"],
671
+ defaultDuration: 0.7,
672
+ renderer: "rgb_split",
673
+ params: {}
674
+ },
675
+ {
676
+ id: "chromatic",
677
+ name: "Chromatic",
678
+ category: "creative",
679
+ description: "Chromatic aberration effect",
680
+ tags: ["chromatic", "aberration", "color"],
681
+ defaultDuration: 0.8,
682
+ renderer: "chromatic",
683
+ params: {}
684
+ },
685
+ {
686
+ id: "film-burn",
687
+ name: "Film Burn",
688
+ category: "creative",
689
+ description: "Vintage film burn effect",
690
+ tags: ["film", "burn", "vintage"],
691
+ defaultDuration: 1.2,
692
+ renderer: "film_burn",
693
+ params: {}
694
+ },
695
+ {
696
+ id: "light-leak",
697
+ name: "Light Leak",
698
+ category: "creative",
699
+ description: "Light leak overlay transition",
700
+ tags: ["light", "leak", "vintage"],
701
+ defaultDuration: 1,
702
+ renderer: "light_leak",
703
+ params: {}
704
+ },
705
+ {
706
+ id: "whip-pan",
707
+ name: "Whip Pan",
708
+ category: "creative",
709
+ description: "Fast whip pan with motion blur",
710
+ tags: ["whip", "fast", "blur"],
711
+ defaultDuration: 0.5,
712
+ renderer: "whip_pan",
713
+ params: {}
714
+ },
715
+ // ========== BASIC (for compatibility) ==========
716
+ {
717
+ id: "cut",
718
+ name: "Cut",
719
+ category: "fade",
720
+ description: "Instant cut (no transition)",
721
+ tags: ["instant", "cut", "basic"],
722
+ defaultDuration: 0,
723
+ renderer: "cut",
724
+ params: {}
725
+ }
726
+ ];
727
+ var TRANSITION_PRESETS = PRESETS_RAW.map((p) => ({
728
+ ...p,
729
+ defaultDurationMs: Math.round(p.defaultDuration * 1e3)
730
+ }));
731
+
732
+ // src/transitions/helpers.ts
733
+ function getTransitionCategories() {
734
+ return [...TRANSITION_CATEGORIES];
735
+ }
736
+ function getTransitionsByCategory(category) {
737
+ return TRANSITION_PRESETS.filter((preset) => preset.category === category);
738
+ }
739
+ function searchTransitions(query) {
740
+ if (!query || query.trim() === "") {
741
+ return TRANSITION_PRESETS;
742
+ }
743
+ const lowerQuery = query.toLowerCase().trim();
744
+ return TRANSITION_PRESETS.filter((preset) => {
745
+ if (preset.name.toLowerCase().includes(lowerQuery)) {
746
+ return true;
747
+ }
748
+ if (preset.description.toLowerCase().includes(lowerQuery)) {
749
+ return true;
750
+ }
751
+ if (preset.tags.some((tag) => tag.toLowerCase().includes(lowerQuery))) {
752
+ return true;
753
+ }
754
+ if (preset.renderer.toLowerCase().includes(lowerQuery)) {
755
+ return true;
756
+ }
757
+ return false;
758
+ });
759
+ }
760
+ function getTransitionById(id) {
761
+ return TRANSITION_PRESETS.find((preset) => preset.id === id);
762
+ }
763
+ function getTransitionByRenderer(renderer) {
764
+ return TRANSITION_PRESETS.find((preset) => preset.renderer === renderer);
765
+ }
766
+ function getAllTransitions() {
767
+ return [...TRANSITION_PRESETS];
768
+ }
769
+ function getTransitionCountByCategory() {
770
+ const counts = {};
771
+ for (const category of TRANSITION_CATEGORIES) {
772
+ counts[category] = getTransitionsByCategory(category).length;
773
+ }
774
+ return counts;
775
+ }
776
+ function getAllTransitionTags() {
777
+ const tagsSet = /* @__PURE__ */ new Set();
778
+ for (const preset of TRANSITION_PRESETS) {
779
+ for (const tag of preset.tags) {
780
+ tagsSet.add(tag);
781
+ }
782
+ }
783
+ return Array.from(tagsSet).sort();
784
+ }
785
+ function getTransitionsByTags(tags) {
786
+ if (tags.length === 0) {
787
+ return TRANSITION_PRESETS;
788
+ }
789
+ const lowerTags = tags.map((tag) => tag.toLowerCase());
790
+ return TRANSITION_PRESETS.filter((preset) => {
791
+ const presetTags = preset.tags.map((tag) => tag.toLowerCase());
792
+ return lowerTags.every((tag) => presetTags.includes(tag));
793
+ });
794
+ }
795
+ function getRecommendedDuration(presetId) {
796
+ const preset = getTransitionById(presetId);
797
+ return preset?.defaultDuration ?? 1;
798
+ }
799
+
800
+ // src/transitions/index.ts
801
+ var ALL_TRANSITIONS = TRANSITION_PRESETS.map((preset) => ({
802
+ id: preset.id,
803
+ name: preset.name,
804
+ category: preset.category,
805
+ description: preset.description,
806
+ tags: preset.tags,
807
+ defaultDurationMs: preset.defaultDurationMs,
808
+ renderer: preset.renderer,
809
+ params: Object.entries(preset.params).map(([key, value]) => ({
810
+ key,
811
+ label: key.replace(/[-_]/g, " ").replace(/\b\w/g, (letter) => letter.toUpperCase()),
812
+ type: typeof value === "number" ? "range" : typeof value === "boolean" ? "toggle" : "text",
813
+ value
814
+ }))
815
+ }));
816
+
817
+ export {
818
+ TransitionRenderer,
819
+ TRANSITION_CATEGORIES,
820
+ TRANSITION_PRESETS,
821
+ getTransitionCategories,
822
+ getTransitionsByCategory,
823
+ searchTransitions,
824
+ getTransitionById,
825
+ getTransitionByRenderer,
826
+ getAllTransitions,
827
+ getTransitionCountByCategory,
828
+ getAllTransitionTags,
829
+ getTransitionsByTags,
830
+ getRecommendedDuration,
831
+ ALL_TRANSITIONS
832
+ };
833
+ //# sourceMappingURL=chunk-PU3Q4QI7.js.map