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