@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
@@ -1,20 +1,15 @@
1
1
  // src/engine/schema.ts
2
2
  var SCENE_VERSION = 1;
3
+ var SCENE_SCHEMA_VERSION = 2;
3
4
  var DEFAULT_CANVAS_WIDTH = 800;
4
5
  var DEFAULT_CANVAS_HEIGHT = 200;
5
6
  var DEFAULT_FONT_SIZE = 80;
6
7
  var DEFAULT_FPS = 30;
7
8
  var DEFAULT_DURATION = 2;
8
- var CUSTOM_ENGINE_IDS = ["ink"];
9
- var LEGACY_RENDERER_MAP = {
10
- InkBrushEngine: "ink"
11
- };
12
- var ENGINE_ID_TO_LEGACY = {
13
- ink: "InkBrushEngine"
14
- };
15
9
  function createEmptyScene(overrides) {
16
10
  return {
17
11
  version: SCENE_VERSION,
12
+ schemaVersion: SCENE_SCHEMA_VERSION,
18
13
  effectName: "My Effect",
19
14
  canvas: { width: DEFAULT_CANVAS_WIDTH, height: DEFAULT_CANVAS_HEIGHT, background: "transparent" },
20
15
  text: {
@@ -29,7 +24,6 @@ function createEmptyScene(overrides) {
29
24
  textPosY: "middle"
30
25
  },
31
26
  effectLayers: [],
32
- customEngineId: null,
33
27
  compositor: { blur: 0, bloom: 0, bloomThreshold: 0.6 },
34
28
  timeline: { duration: DEFAULT_DURATION, fps: DEFAULT_FPS, loop: true, tracks: [] },
35
29
  ...overrides
@@ -271,7 +265,7 @@ function drawPerCharText(ctx, opts) {
271
265
  ctx.restore();
272
266
  }
273
267
  function shouldUsePerCharFill(cfg) {
274
- return !!cfg.perCharFillEnabled && cfg.fillType === "solid" && !cfg.customRenderer && (cfg.charFillColors?.length ?? 0) > 0;
268
+ return !!cfg.perCharFillEnabled && cfg.fillType === "solid" && (cfg.charFillColors?.length ?? 0) > 0;
275
269
  }
276
270
 
277
271
  // src/platform.ts
@@ -279,14 +273,21 @@ var _ctxFilter = null;
279
273
  var _roundRect = null;
280
274
  var _letterSpacing = null;
281
275
  var _offscreenCanvas = null;
282
- var _webgl2 = null;
283
276
  function probe2d() {
284
- if (typeof document === "undefined") return null;
285
- try {
286
- return document.createElement("canvas").getContext("2d");
287
- } catch {
288
- return null;
277
+ if (typeof OffscreenCanvas !== "undefined") {
278
+ try {
279
+ return new OffscreenCanvas(1, 1).getContext("2d");
280
+ } catch {
281
+ }
289
282
  }
283
+ if (typeof document !== "undefined") {
284
+ try {
285
+ return document.createElement("canvas").getContext("2d");
286
+ } catch {
287
+ return null;
288
+ }
289
+ }
290
+ return null;
290
291
  }
291
292
  function supportsCtxFilter() {
292
293
  if (_ctxFilter !== null) return _ctxFilter;
@@ -329,22 +330,6 @@ function supportsOffscreenCanvas() {
329
330
  _offscreenCanvas = typeof globalThis !== "undefined" && typeof globalThis.OffscreenCanvas === "function";
330
331
  return _offscreenCanvas;
331
332
  }
332
- function supportsWebGL2() {
333
- if (_webgl2 !== null) return _webgl2;
334
- if (typeof document === "undefined") {
335
- _webgl2 = false;
336
- return false;
337
- }
338
- try {
339
- const canvas = document.createElement("canvas");
340
- canvas.width = 1;
341
- canvas.height = 1;
342
- _webgl2 = !!canvas.getContext("webgl2");
343
- } catch {
344
- _webgl2 = false;
345
- }
346
- return _webgl2;
347
- }
348
333
  function createCanvas(width, height) {
349
334
  if (supportsOffscreenCanvas()) {
350
335
  return new OffscreenCanvas(width, height);
@@ -366,7 +351,7 @@ function createCanvas(width, height) {
366
351
  }
367
352
  }
368
353
  function releaseCanvas(canvas) {
369
- if (canvas instanceof OffscreenCanvas) return;
354
+ if (typeof OffscreenCanvas !== "undefined" && canvas instanceof OffscreenCanvas) return;
370
355
  canvas.width = 0;
371
356
  canvas.height = 0;
372
357
  }
@@ -375,7 +360,6 @@ function _resetPlatformCache() {
375
360
  _roundRect = null;
376
361
  _letterSpacing = null;
377
362
  _offscreenCanvas = null;
378
- _webgl2 = null;
379
363
  }
380
364
  var CanvasDevice = class {
381
365
  static canvases = [];
@@ -418,363 +402,6 @@ var CanvasDevice = class {
418
402
  }
419
403
  };
420
404
 
421
- // src/engine/procedural/utils.ts
422
- function getCanvas2DContext(canvas) {
423
- return canvas.getContext("2d");
424
- }
425
- function seededRandom(seed) {
426
- let s = seed;
427
- return function() {
428
- s = s * 16807 % 2147483647;
429
- return (s - 1) / 2147483646;
430
- };
431
- }
432
- function textSeed(text) {
433
- return text.split("").reduce((acc, c) => acc + c.charCodeAt(0), 0) * 9301 % 49297;
434
- }
435
- function hexToRgb(hex) {
436
- const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
437
- const fullHex = hex.replace(shorthandRegex, (m, r, g, b) => r + r + g + g + b + b);
438
- const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(fullHex);
439
- return result ? {
440
- r: parseInt(result[1], 16),
441
- g: parseInt(result[2], 16),
442
- b: parseInt(result[3], 16)
443
- } : { r: 255, g: 255, b: 255 };
444
- }
445
-
446
- // src/engine/procedural/InkBrushEngine.ts
447
- var InkBrushEngine = class {
448
- cfg;
449
- bristleLines = [];
450
- grainDots = [];
451
- drips = [];
452
- constructor(config) {
453
- const defaults = {
454
- text: "INK",
455
- effectName: "InkBrush",
456
- fontFamily: "Bebas Neue",
457
- fontWeight: 900,
458
- fontStyle: "italic",
459
- fontSize: 96,
460
- letterSpacing: 2,
461
- lineHeight: 1.1,
462
- wrapText: true,
463
- autoFitText: false,
464
- perCharFillEnabled: false,
465
- charFillColors: [],
466
- fillType: "solid",
467
- fillColor: "#FFFFFF",
468
- fillGradientAngle: 90,
469
- fillGradientStops: [],
470
- patternType: "chalk",
471
- strokeEnabled: false,
472
- strokeColor: "#000000",
473
- strokeWidth: 0,
474
- strokePosition: "outside",
475
- strokeOpacity: 100,
476
- strokeLineJoin: "round",
477
- strokeBlur: 0,
478
- strokeType: "single",
479
- strokeColorSecondary: "#FFFFFF",
480
- strokeWidthSecondary: 4,
481
- strokeFadeRange: 0,
482
- glowLayers: [],
483
- shadowEnabled: false,
484
- shadowColor: "#000000",
485
- shadowBlur: 10,
486
- shadowOffsetX: 5,
487
- shadowOffsetY: 5,
488
- shadowOpacity: 80,
489
- shadowType: "drop",
490
- bevelEnabled: false,
491
- bevelDepth: 5,
492
- bevelHighlight: "#FFFFFF",
493
- bevelShadow: "#000000",
494
- bevelDirection: "bottom-right",
495
- bevelCoreColor: "#000000",
496
- bevelEdgeColor: "#2A2A38",
497
- bevelEdgeWidth: 0,
498
- bevelBlur: 0,
499
- bevelBlurColor: "#000000",
500
- bevelPerspectiveEnabled: false,
501
- bevelVanishingPointX: 40,
502
- bevelVanishingPointY: 80,
503
- bevelFocalLength: 400,
504
- stackEnabled: false,
505
- stackCount: 3,
506
- stackOffsetX: 10,
507
- stackOffsetY: -10,
508
- stackOpacityDecay: 20,
509
- stackColor1: "#FF7C00",
510
- stackColor2: "#00FFDD",
511
- stackColor3: "#FF00AA",
512
- stackColor4: "#AA00FF",
513
- panelEnabled: false,
514
- panelColor: "#1E1E26",
515
- panelOpacity: 80,
516
- panelRadius: 12,
517
- panelPaddingX: 40,
518
- panelPaddingY: 20,
519
- panelStrokeEnabled: false,
520
- panelStrokeColor: "#2A2A38",
521
- panelStrokeWidth: 2,
522
- canvasWidth: DEFAULT_CANVAS_WIDTH,
523
- canvasHeight: DEFAULT_CANVAS_HEIGHT,
524
- textPosX: "center",
525
- textPosY: "middle",
526
- inkColor: "#FFFFFF",
527
- bristleDensity: 0.8,
528
- bristleSkipRate: 0.2,
529
- dripRate: 0.3,
530
- dripMaxLength: 40,
531
- grainDensity: 0.15,
532
- skewX: -0.2,
533
- customRenderer: "InkBrushEngine"
534
- };
535
- this.cfg = {
536
- ...defaults,
537
- ...config
538
- };
539
- this.precomputeData();
540
- }
541
- precomputeData() {
542
- const { text, fontFamily, fontWeight, fontStyle, fontSize, letterSpacing, lineHeight, canvasWidth, canvasHeight, textPosX, textPosY, bristleDensity, bristleSkipRate, dripRate, dripMaxLength, grainDensity, skewX } = this.cfg;
543
- const width = canvasWidth;
544
- const height = canvasHeight;
545
- const rand = seededRandom(textSeed(text));
546
- let canvas = createCanvas(width, height);
547
- canvas.width = width;
548
- canvas.height = height;
549
- const ctx = getCanvas2DContext(canvas);
550
- if (!ctx) return;
551
- const lines = text.split("\n");
552
- const numLines = lines.length;
553
- const textBlockHeight = fontSize + (numLines - 1) * fontSize * lineHeight;
554
- let startX = width / 2;
555
- let align = "center";
556
- if (textPosX === "left") {
557
- startX = 50;
558
- align = "left";
559
- } else if (textPosX === "right") {
560
- startX = width - 50;
561
- align = "right";
562
- }
563
- ctx.textAlign = align;
564
- ctx.textBaseline = "alphabetic";
565
- const fontStr = `${fontStyle} ${fontWeight} ${fontSize}px "${fontFamily}"`;
566
- ctx.font = fontStr;
567
- if (letterSpacing !== 0) {
568
- ctx.letterSpacing = `${letterSpacing}px`;
569
- }
570
- let startY = (height - textBlockHeight) / 2 + fontSize * 0.85;
571
- if (textPosY === "top") {
572
- startY = 40 + fontSize * 0.85;
573
- } else if (textPosY === "bottom") {
574
- startY = height - 40 - textBlockHeight + fontSize * 0.85;
575
- }
576
- ctx.save();
577
- if (skewX !== 0) {
578
- ctx.transform(1, 0, skewX, 1, 0, 0);
579
- }
580
- ctx.fillStyle = "#FFFFFF";
581
- lines.forEach((line, index) => {
582
- const py = startY + index * fontSize * lineHeight;
583
- ctx.fillText(line, startX, py);
584
- });
585
- ctx.restore();
586
- const imgData = ctx.getImageData(0, 0, width, height);
587
- const pixels = imgData.data;
588
- let minY = height;
589
- let maxY = 0;
590
- for (let y = 0; y < height; y++) {
591
- for (let x = 0; x < width; x++) {
592
- const idx = (y * width + x) * 4;
593
- if (pixels[idx + 3] > 128) {
594
- if (y < minY) minY = y;
595
- if (y > maxY) maxY = y;
596
- }
597
- }
598
- }
599
- if (minY >= maxY) return;
600
- const step = Math.max(1, Math.min(3, 1 / bristleDensity));
601
- for (let y = minY; y <= maxY; y += step) {
602
- const segments = [];
603
- let inSegment = false;
604
- let xStart = 0;
605
- const targetY = Math.floor(y);
606
- for (let x = 0; x < width; x++) {
607
- const idx = (targetY * width + x) * 4;
608
- const isInside = pixels[idx + 3] > 128;
609
- if (isInside && !inSegment) {
610
- inSegment = true;
611
- xStart = x;
612
- } else if (!isInside && inSegment) {
613
- inSegment = false;
614
- segments.push({ xStart, xEnd: x - 1 });
615
- }
616
- }
617
- if (inSegment) {
618
- segments.push({ xStart, xEnd: width - 1 });
619
- }
620
- for (const seg of segments) {
621
- if (rand() < bristleSkipRate) continue;
622
- const segW = seg.xEnd - seg.xStart;
623
- const startLimit = seg.xStart + rand() * Math.min(15, segW * 0.2);
624
- const endLimit = seg.xEnd - rand() * Math.min(15, segW * 0.2);
625
- if (startLimit >= endLimit) continue;
626
- const opacity = 0.4 + rand() * 0.6;
627
- const lw = 0.5 + rand() * 1.5;
628
- const hasGap = rand() < 0.1;
629
- if (hasGap) {
630
- const gapPct = 0.3 + rand() * 0.4;
631
- const gapLen = 5 + rand() * 15;
632
- const midX = startLimit + (endLimit - startLimit) * gapPct;
633
- const p1Start = startLimit;
634
- const p1End = Math.max(startLimit, midX - gapLen / 2);
635
- const p2Start = Math.min(endLimit, midX + gapLen / 2);
636
- const p2End = endLimit;
637
- if (p1End > p1Start) {
638
- this.bristleLines.push({ y: targetY, x0: p1Start, x1: p1End, opacity, lineWidth: lw });
639
- }
640
- if (p2End > p2Start) {
641
- this.bristleLines.push({ y: targetY, x0: p2Start, x1: p2End, opacity, lineWidth: lw });
642
- }
643
- } else {
644
- this.bristleLines.push({ y: targetY, x0: startLimit, x1: endLimit, opacity, lineWidth: lw });
645
- }
646
- }
647
- }
648
- for (let y = minY; y <= maxY; y++) {
649
- for (let x = 0; x < width; x++) {
650
- const idx = (y * width + x) * 4;
651
- if (pixels[idx + 3] > 128) {
652
- if (rand() < grainDensity) {
653
- this.grainDots.push({
654
- x,
655
- y,
656
- opacity: 0.2 + rand() * 0.3
657
- });
658
- }
659
- }
660
- }
661
- }
662
- const bottomRowForCol = new Array(width).fill(-1);
663
- for (let x = 0; x < width; x++) {
664
- for (let y = height - 1; y >= 0; y--) {
665
- const idx = (y * width + x) * 4;
666
- if (pixels[idx + 3] > 128) {
667
- bottomRowForCol[x] = y;
668
- break;
669
- }
670
- }
671
- }
672
- for (let x = 0; x < width; x++) {
673
- const sY = bottomRowForCol[x];
674
- if (sY === -1) continue;
675
- if (rand() < dripRate) {
676
- const length = 8 + rand() * (dripMaxLength - 8);
677
- const startWidth = 1 + rand() * 1;
678
- const endWidth = rand() < 0.5 ? startWidth : 0.5;
679
- const startOpacity = 0.6 + rand() * 0.3;
680
- const hasBlob = rand() < 0.6;
681
- const blobRadius = 1.5 + rand() * 1.5;
682
- this.drips.push({
683
- x,
684
- startY: sY,
685
- length,
686
- startWidth,
687
- endWidth,
688
- startOpacity,
689
- hasBlob,
690
- blobRadius
691
- });
692
- }
693
- }
694
- }
695
- advanceSteps(steps) {
696
- }
697
- drawFrame(ctx) {
698
- const { text, fontFamily, fontWeight, fontStyle, fontSize, letterSpacing, lineHeight, canvasWidth, canvasHeight, textPosX, textPosY, skewX, inkColor } = this.cfg;
699
- const width = canvasWidth;
700
- const height = canvasHeight;
701
- ctx.clearRect(0, 0, width, height);
702
- ctx.imageSmoothingEnabled = true;
703
- const lines = text.split("\n");
704
- const numLines = lines.length;
705
- const textBlockHeight = fontSize + (numLines - 1) * fontSize * lineHeight;
706
- let startX = width / 2;
707
- let align = "center";
708
- if (textPosX === "left") {
709
- startX = 50;
710
- align = "left";
711
- } else if (textPosX === "right") {
712
- startX = width - 50;
713
- align = "right";
714
- }
715
- ctx.textAlign = align;
716
- ctx.textBaseline = "alphabetic";
717
- const fontStr = `${fontStyle} ${fontWeight} ${fontSize}px "${fontFamily}"`;
718
- ctx.font = fontStr;
719
- if (letterSpacing !== 0) {
720
- ctx.letterSpacing = `${letterSpacing}px`;
721
- }
722
- let startY = (height - textBlockHeight) / 2 + fontSize * 0.85;
723
- if (textPosY === "top") {
724
- startY = 40 + fontSize * 0.85;
725
- } else if (textPosY === "bottom") {
726
- startY = height - 40 - textBlockHeight + fontSize * 0.85;
727
- }
728
- ctx.save();
729
- if (skewX !== 0) {
730
- ctx.transform(1, 0, skewX, 1, 0, 0);
731
- }
732
- ctx.fillStyle = inkColor;
733
- lines.forEach((line, index) => {
734
- const py = startY + index * fontSize * lineHeight;
735
- ctx.fillText(line, startX, py);
736
- });
737
- ctx.restore();
738
- ctx.save();
739
- ctx.globalCompositeOperation = "source-in";
740
- ctx.strokeStyle = inkColor;
741
- this.bristleLines.forEach((line) => {
742
- ctx.globalAlpha = line.opacity;
743
- ctx.lineWidth = line.lineWidth;
744
- ctx.beginPath();
745
- ctx.moveTo(line.x0, line.y);
746
- ctx.lineTo(line.x1, line.y);
747
- ctx.stroke();
748
- });
749
- ctx.fillStyle = inkColor;
750
- this.grainDots.forEach((dot) => {
751
- ctx.globalAlpha = dot.opacity;
752
- ctx.fillRect(dot.x, dot.y, 1, 1);
753
- });
754
- ctx.restore();
755
- const inkRgb = hexToRgb(inkColor);
756
- ctx.save();
757
- this.drips.forEach((drip) => {
758
- const grad = ctx.createLinearGradient(drip.x, drip.startY, drip.x, drip.startY + drip.length);
759
- grad.addColorStop(0, `rgba(${inkRgb.r}, ${inkRgb.g}, ${inkRgb.b}, ${drip.startOpacity})`);
760
- grad.addColorStop(1, `rgba(${inkRgb.r}, ${inkRgb.g}, ${inkRgb.b}, 0)`);
761
- ctx.strokeStyle = grad;
762
- ctx.lineWidth = drip.startWidth;
763
- ctx.beginPath();
764
- ctx.moveTo(drip.x, drip.startY);
765
- ctx.lineTo(drip.x, drip.startY + drip.length);
766
- ctx.stroke();
767
- if (drip.hasBlob) {
768
- ctx.fillStyle = `rgba(${inkRgb.r}, ${inkRgb.g}, ${inkRgb.b}, ${drip.startOpacity * 0.5})`;
769
- ctx.beginPath();
770
- ctx.arc(drip.x, drip.startY + drip.length, drip.blobRadius, 0, Math.PI * 2);
771
- ctx.fill();
772
- }
773
- });
774
- ctx.restore();
775
- }
776
- };
777
-
778
405
  // src/canvas-utils.ts
779
406
  function drawRoundedRect(ctx, x, y, w, h, r) {
780
407
  const radius = Math.max(0, Math.min(r, Math.min(w, h) / 2));
@@ -804,8 +431,20 @@ function restoreLetterSpacing(ctx, saved) {
804
431
  ctx.letterSpacing = saved;
805
432
  }
806
433
 
434
+ // src/engine/procedural/utils.ts
435
+ function hexToRgb(hex) {
436
+ const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
437
+ const fullHex = hex.replace(shorthandRegex, (m, r, g, b) => r + r + g + g + b + b);
438
+ const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(fullHex);
439
+ return result ? {
440
+ r: parseInt(result[1], 16),
441
+ g: parseInt(result[2], 16),
442
+ b: parseInt(result[3], 16)
443
+ } : { r: 255, g: 255, b: 255 };
444
+ }
445
+
807
446
  // src/renderer.ts
808
- function getCanvas2DContext2(canvas) {
447
+ function getCanvas2DContext(canvas) {
809
448
  return canvas.getContext("2d");
810
449
  }
811
450
  function ctxSupportsFilter(ctx) {
@@ -820,11 +459,6 @@ function ctxSupportsFilter(ctx) {
820
459
  }
821
460
  }
822
461
  function renderTextEffectCore(ctx, cfg) {
823
- if (cfg.customRenderer === "InkBrushEngine") {
824
- const engine = new InkBrushEngine(cfg);
825
- engine.drawFrame(ctx);
826
- return;
827
- }
828
462
  const { text, fontFamily, fontWeight, fontStyle, fontSize, letterSpacing, lineHeight, fillType, fillColor, fillGradientAngle, fillGradientStops, patternType, strokeEnabled, strokeColor, strokeWidth, strokePosition, strokeOpacity, strokeLineJoin, strokeBlur, strokeType, strokeColorSecondary, strokeWidthSecondary, strokeFadeRange, glowLayers, shadowEnabled, shadowColor, shadowBlur, shadowOffsetX, shadowOffsetY, shadowOpacity, shadowType, bevelEnabled, bevelDepth, bevelHighlight, bevelShadow, bevelDirection, bevelCoreColor, bevelEdgeColor, bevelEdgeWidth, bevelBlur, bevelBlurColor, bevelPerspectiveEnabled, bevelVanishingPointX, bevelVanishingPointY, bevelFocalLength, stackEnabled, stackCount, stackOffsetX, stackOffsetY, stackOpacityDecay, stackColor1, stackColor2, stackColor3, stackColor4, panelEnabled, panelColor, panelOpacity, panelRadius, panelPaddingX, panelPaddingY, panelStrokeEnabled, panelStrokeColor, panelStrokeWidth, canvasWidth, canvasHeight, textPosX, textPosY } = cfg;
829
463
  ctx.imageSmoothingEnabled = true;
830
464
  ctx.lineJoin = strokeLineJoin;
@@ -1010,6 +644,68 @@ function renderTextEffectCore(ctx, cfg) {
1010
644
  }
1011
645
  ctx.restore();
1012
646
  };
647
+ const renderGlowLayer = (layer2) => {
648
+ let glowCanvas = null;
649
+ try {
650
+ glowCanvas = createCanvas(Math.max(1, Math.ceil(cWidth)), Math.max(1, Math.ceil(cHeight)));
651
+ const glowCtx = getCanvas2DContext(glowCanvas);
652
+ if (!glowCtx) return false;
653
+ glowCtx.clearRect(0, 0, cWidth, cHeight);
654
+ glowCtx.save();
655
+ glowCtx.font = fontStr;
656
+ glowCtx.textAlign = align;
657
+ glowCtx.textBaseline = "alphabetic";
658
+ if (letterSpacing !== 0) glowCtx.letterSpacing = `${letterSpacing}px`;
659
+ glowCtx.globalAlpha = Math.max(0, Math.min(100, layer2.opacity)) / 100;
660
+ glowCtx.fillStyle = layer2.color;
661
+ glowCtx.strokeStyle = layer2.color;
662
+ const spread = Math.max(0, layer2.spread ?? 0);
663
+ if (spread > 0) {
664
+ glowCtx.lineWidth = spread * 2;
665
+ glowCtx.lineJoin = strokeLineJoin;
666
+ }
667
+ const drawSource = () => {
668
+ lines.forEach((line, index) => {
669
+ const py = startY + index * lineAdvance;
670
+ if (spread > 0) glowCtx.strokeText(line, startX, py);
671
+ glowCtx.fillText(line, startX, py);
672
+ });
673
+ };
674
+ const useFilter = ctxSupportsFilter(glowCtx);
675
+ if (useFilter) {
676
+ glowCtx.filter = `blur(${Math.max(0, layer2.blur)}px)`;
677
+ drawSource();
678
+ glowCtx.filter = "none";
679
+ } else {
680
+ glowCtx.shadowColor = layer2.color;
681
+ glowCtx.shadowBlur = Math.max(0, layer2.blur);
682
+ glowCtx.shadowOffsetX = 0;
683
+ glowCtx.shadowOffsetY = 0;
684
+ drawSource();
685
+ glowCtx.shadowColor = "transparent";
686
+ glowCtx.shadowBlur = 0;
687
+ }
688
+ glowCtx.globalCompositeOperation = "destination-out";
689
+ glowCtx.globalAlpha = 1;
690
+ drawSource();
691
+ glowCtx.restore();
692
+ ctx.save();
693
+ if (layer2.type === "inner") {
694
+ ctx.globalCompositeOperation = "source-atop";
695
+ }
696
+ ctx.globalAlpha = 1;
697
+ const passes = Math.max(1, Math.min(20, layer2.strength ?? 1));
698
+ for (let pass = 0; pass < passes; pass += 1) {
699
+ ctx.drawImage(glowCanvas, 0, 0);
700
+ }
701
+ ctx.restore();
702
+ return true;
703
+ } catch {
704
+ return false;
705
+ } finally {
706
+ if (glowCanvas) releaseCanvas(glowCanvas);
707
+ }
708
+ };
1013
709
  if (panelEnabled) {
1014
710
  ctx.save();
1015
711
  ctx.globalAlpha = panelOpacity / 100;
@@ -1059,9 +755,11 @@ function renderTextEffectCore(ctx, cfg) {
1059
755
  }
1060
756
  glowLayers.forEach((layer2) => {
1061
757
  if (layer2.enabled && layer2.type === "outer" && layer2.opacity > 0) {
1062
- const renderCount = Math.max(1, Math.min(20, layer2.strength ?? 1));
1063
- for (let i = 0; i < renderCount; i++) {
1064
- renderWithShadowTrick("fill", layer2.color, layer2.blur, 0, 0, layer2.opacity, "#000", layer2.spread ?? 0);
758
+ if (!renderGlowLayer(layer2)) {
759
+ const renderCount = Math.max(1, Math.min(20, layer2.strength ?? 1));
760
+ for (let i = 0; i < renderCount; i += 1) {
761
+ renderWithShadowTrick("fill", layer2.color, layer2.blur, 0, 0, layer2.opacity, "#000", layer2.spread ?? 0);
762
+ }
1065
763
  }
1066
764
  }
1067
765
  });
@@ -1419,7 +1117,7 @@ function renderTextEffectCore(ctx, cfg) {
1419
1117
  patCanvas.width = 120;
1420
1118
  patCanvas.height = 120;
1421
1119
  }
1422
- const patCtx = getCanvas2DContext2(patCanvas);
1120
+ const patCtx = getCanvas2DContext(patCanvas);
1423
1121
  const seedRandom = (initSeed) => {
1424
1122
  let currentSeed = initSeed;
1425
1123
  return () => {
@@ -1833,7 +1531,7 @@ function renderTextEffectCore(ctx, cfg) {
1833
1531
  const tCanvas = createCanvas(cWidth, cHeight);
1834
1532
  tCanvas.width = cWidth;
1835
1533
  tCanvas.height = cHeight;
1836
- const tCtx = getCanvas2DContext2(tCanvas);
1534
+ const tCtx = getCanvas2DContext(tCanvas);
1837
1535
  if (tCtx) {
1838
1536
  tCtx.font = fontStr;
1839
1537
  tCtx.textAlign = align;
@@ -1962,7 +1660,7 @@ function renderTextEffectCore(ctx, cfg) {
1962
1660
  const tintCanvas = createCanvas(cWidth, cHeight);
1963
1661
  tintCanvas.width = cWidth;
1964
1662
  tintCanvas.height = cHeight;
1965
- const tintCtx = getCanvas2DContext2(tintCanvas);
1663
+ const tintCtx = getCanvas2DContext(tintCanvas);
1966
1664
  if (tintCtx) {
1967
1665
  tintCtx.drawImage(tCanvas, 0, 0);
1968
1666
  tintCtx.globalCompositeOperation = "source-in";
@@ -1989,10 +1687,12 @@ function renderTextEffectCore(ctx, cfg) {
1989
1687
  glowLayers.forEach((layer2) => {
1990
1688
  if (layer2.enabled && layer2.type === "inner" && layer2.opacity > 0) {
1991
1689
  ctx.save();
1992
- ctx.globalCompositeOperation = "source-atop";
1993
- const renderCount = Math.max(1, Math.min(20, layer2.strength ?? 1));
1994
- for (let i = 0; i < renderCount; i++) {
1995
- renderWithShadowTrick("fill", layer2.color, layer2.blur, 0, 0, layer2.opacity, "#000000", layer2.spread ?? 0);
1690
+ if (!renderGlowLayer(layer2)) {
1691
+ ctx.globalCompositeOperation = "source-atop";
1692
+ const renderCount = Math.max(1, Math.min(20, layer2.strength ?? 1));
1693
+ for (let i = 0; i < renderCount; i += 1) {
1694
+ renderWithShadowTrick("fill", layer2.color, layer2.blur, 0, 0, layer2.opacity, "#000000", layer2.spread ?? 0);
1695
+ }
1996
1696
  }
1997
1697
  ctx.restore();
1998
1698
  }
@@ -2095,245 +1795,27 @@ var defaultConfig = {
2095
1795
  textPosX: "center",
2096
1796
  textPosY: "middle",
2097
1797
  wrapText: true,
2098
- autoFitText: false,
2099
- // Ink Brush custom properties
2100
- inkColor: "#FFFFFF",
2101
- bristleDensity: 0.8,
2102
- bristleSkipRate: 0.2,
2103
- dripRate: 0.3,
2104
- dripMaxLength: 40,
2105
- grainDensity: 0.15,
2106
- skewX: -0.2
1798
+ autoFitText: false
2107
1799
  };
2108
- var builtInPresets = [
2109
- {
2110
- id: "premium-sticker",
2111
- name: "STICKER",
2112
- category: "Classic",
2113
- config: {
2114
- ...defaultConfig,
2115
- text: "TEXT",
2116
- effectName: "StickerEffect",
2117
- fontFamily: "Arial Rounded MT Bold",
2118
- fontWeight: 900,
2119
- fontStyle: "normal",
2120
- fontSize: 88,
2121
- letterSpacing: 2,
2122
- lineHeight: 1.2,
2123
- fillType: "linear",
2124
- fillGradientAngle: 90,
2125
- fillGradientStops: [
2126
- { color: "#FFCE00", offset: 0 },
2127
- { color: "#E05300", offset: 100 }
2128
- ],
2129
- strokeEnabled: true,
2130
- strokeColor: "#FFFFFF",
2131
- strokeWidth: 15,
2132
- strokePosition: "outside",
2133
- strokeType: "single",
2134
- strokeLineJoin: "round",
2135
- strokeOpacity: 100,
2136
- bevelEnabled: true,
2137
- bevelDepth: 8,
2138
- bevelDirection: "bottom-right",
2139
- bevelHighlight: "#FFCE00",
2140
- bevelCoreColor: "#4E1901",
2141
- bevelShadow: "#1D0A00",
2142
- shadowEnabled: true,
2143
- shadowColor: "#000000",
2144
- shadowBlur: 14,
2145
- shadowOffsetX: 6,
2146
- shadowOffsetY: 8,
2147
- shadowOpacity: 65,
2148
- shadowType: "drop"
2149
- }
2150
- },
2151
- {
2152
- id: "premium-holo",
2153
- name: "HOLOGRAPHIC",
2154
- category: "Classic",
2155
- config: {
2156
- ...defaultConfig,
2157
- text: "TEXT",
2158
- effectName: "HolographicEffect",
2159
- fontFamily: "Impact",
2160
- fontWeight: 900,
2161
- fontStyle: "normal",
2162
- fontSize: 100,
2163
- letterSpacing: 2,
2164
- lineHeight: 1.2,
2165
- fillType: "linear",
2166
- fillGradientAngle: 125,
2167
- fillGradientStops: [
2168
- { color: "#6FE3FF", offset: 0 },
2169
- { color: "#D196FF", offset: 25 },
2170
- { color: "#FF9CEE", offset: 50 },
2171
- { color: "#FFE49E", offset: 75 },
2172
- { color: "#D4FFF1", offset: 100 }
2173
- ],
2174
- strokeEnabled: true,
2175
- strokeColor: "#FFFFFF",
2176
- strokeWidth: 2,
2177
- strokePosition: "outside",
2178
- strokeType: "single",
2179
- strokeOpacity: 100,
2180
- glowLayers: [{ enabled: true, color: "#D196FF", blur: 15, opacity: 50, type: "outer" }],
2181
- bevelEnabled: true,
2182
- bevelDepth: 4,
2183
- bevelDirection: "bottom-right",
2184
- bevelHighlight: "#FFFFFF",
2185
- bevelCoreColor: "#2A3540",
2186
- bevelShadow: "#0E151D",
2187
- shadowEnabled: true,
2188
- shadowColor: "#000000",
2189
- shadowBlur: 20,
2190
- shadowOffsetX: 6,
2191
- shadowOffsetY: 10,
2192
- shadowOpacity: 90,
2193
- shadowType: "drop"
2194
- }
2195
- },
2196
- {
2197
- id: "classic-ink",
2198
- name: "Classic Ink",
2199
- category: "Classic",
2200
- config: {
2201
- ...defaultConfig,
2202
- text: "Classic Ink",
2203
- effectName: "ClassicInk",
2204
- fontFamily: "Playfair Display",
2205
- fontWeight: 700,
2206
- fontStyle: "normal",
2207
- fontSize: 85,
2208
- letterSpacing: 1,
2209
- lineHeight: 1.2,
2210
- fillType: "linear",
2211
- fillGradientAngle: 90,
2212
- fillGradientStops: [
2213
- { color: "#FDFBF7", offset: 0 },
2214
- { color: "#EAE5D9", offset: 100 }
2215
- ],
2216
- strokeEnabled: true,
2217
- strokeColor: "#1E1E26",
2218
- strokeWidth: 2,
2219
- strokePosition: "outside",
2220
- strokeOpacity: 100,
2221
- strokeLineJoin: "round",
2222
- shadowEnabled: true,
2223
- shadowColor: "#3D2B1F",
2224
- shadowBlur: 14,
2225
- shadowOffsetX: 6,
2226
- shadowOffsetY: 6,
2227
- shadowOpacity: 90,
2228
- shadowType: "drop"
2229
- }
2230
- },
2231
- {
2232
- id: "neon-crimson",
2233
- name: "Neon Crimson",
2234
- category: "Neon",
2235
- config: {
2236
- ...defaultConfig,
2237
- text: "NEON",
2238
- effectName: "NeonCrimson",
2239
- fontFamily: "Bebas Neue",
2240
- fontWeight: 700,
2241
- fontStyle: "normal",
2242
- fontSize: 100,
2243
- letterSpacing: 6,
2244
- lineHeight: 1.2,
2245
- fillType: "none",
2246
- strokeEnabled: true,
2247
- strokeColor: "#FFFFFF",
2248
- strokeWidth: 3,
2249
- strokePosition: "center",
2250
- strokeOpacity: 100,
2251
- strokeLineJoin: "round",
2252
- glowLayers: [
2253
- { enabled: true, color: "#FF003C", blur: 12, opacity: 100, type: "outer" },
2254
- { enabled: true, color: "#FF003C", blur: 35, opacity: 80, type: "outer" },
2255
- { enabled: true, color: "#FF003C", blur: 80, opacity: 60, type: "outer" }
2256
- ],
2257
- shadowEnabled: false
2258
- }
2259
- },
2260
- {
2261
- id: "cyberpunk-yellow",
2262
- name: "Cyberpunk Yellow",
2263
- category: "Neon",
2264
- config: {
2265
- ...defaultConfig,
2266
- text: "CYBER",
2267
- effectName: "CyberpunkYellow",
2268
- fontFamily: "Anton",
2269
- fontWeight: 900,
2270
- fontStyle: "normal",
2271
- fontSize: 90,
2272
- letterSpacing: 2,
2273
- lineHeight: 1.2,
2274
- fillType: "solid",
2275
- fillColor: "#FFE600",
2276
- strokeEnabled: true,
2277
- strokeColor: "#000000",
2278
- strokeWidth: 6,
2279
- strokePosition: "outside",
2280
- strokeOpacity: 100,
2281
- strokeLineJoin: "round",
2282
- shadowEnabled: true,
2283
- shadowColor: "#FFE600",
2284
- shadowBlur: 15,
2285
- shadowOffsetX: 4,
2286
- shadowOffsetY: 4,
2287
- shadowOpacity: 95,
2288
- shadowType: "drop"
2289
- }
2290
- },
2291
- {
2292
- id: "retro-comic",
2293
- name: "Retro Comic",
2294
- category: "Experimental",
2295
- config: {
2296
- ...defaultConfig,
2297
- text: "BOOM!",
2298
- effectName: "RetroComic",
2299
- fontFamily: "Arial Black",
2300
- fontWeight: 900,
2301
- fontStyle: "normal",
2302
- fontSize: 85,
2303
- letterSpacing: 3,
2304
- lineHeight: 1.1,
2305
- fillType: "solid",
2306
- fillColor: "#000000",
2307
- strokeEnabled: true,
2308
- strokeColor: "#FFFFFF",
2309
- strokeWidth: 6,
2310
- strokePosition: "outside",
2311
- strokeOpacity: 100,
2312
- strokeLineJoin: "round",
2313
- glowLayers: [
2314
- { enabled: true, color: "#000000", blur: 0, opacity: 100, type: "outer", strength: 1, spread: 3 },
2315
- { enabled: false, color: "#FF007C", blur: 40, opacity: 60, type: "outer" },
2316
- { enabled: false, color: "#00F0FF", blur: 60, opacity: 40, type: "outer" }
2317
- ],
2318
- // panelEnabled: true,
2319
- // panelColor: "#FFE100",
2320
- // panelOpacity: 100,
2321
- // panelRadius: 10,
2322
- // panelPaddingX: 55,
2323
- // panelPaddingY: 35,
2324
- // panelStrokeEnabled: true,
2325
- // panelStrokeColor: "#000000",
2326
- // panelStrokeWidth: 4,
2327
- shadowEnabled: true,
2328
- shadowColor: "#000000",
2329
- shadowBlur: 0,
2330
- shadowOffsetX: 8,
2331
- shadowOffsetY: 8,
2332
- shadowOpacity: 100,
2333
- shadowType: "drop"
2334
- }
2335
- }
2336
- ];
1800
+ function createBlankTextEffectConfig() {
1801
+ return {
1802
+ ...defaultConfig,
1803
+ text: "MY TEXT",
1804
+ effectName: "Custom Effect",
1805
+ strokeEnabled: false,
1806
+ shadowEnabled: false,
1807
+ bevelEnabled: false,
1808
+ stackEnabled: false,
1809
+ panelEnabled: false,
1810
+ panelStrokeEnabled: false,
1811
+ perCharFillEnabled: false,
1812
+ glowLayers: defaultConfig.glowLayers.map((layer2) => ({
1813
+ ...layer2,
1814
+ enabled: false
1815
+ }))
1816
+ };
1817
+ }
1818
+ var builtInPresets = [];
2337
1819
 
2338
1820
  // src/engine/timelineDefaults.ts
2339
1821
  function ensureDefaultTimeline(doc) {
@@ -2395,7 +1877,7 @@ function cloneSceneWithNewIds(doc) {
2395
1877
  // src/engine/migrate.ts
2396
1878
  function layer(type, name, params, extra) {
2397
1879
  return {
2398
- id: newLayerId(),
1880
+ id: extra?.id ?? newLayerId(),
2399
1881
  type,
2400
1882
  name,
2401
1883
  enabled: true,
@@ -2406,72 +1888,61 @@ function layer(type, name, params, extra) {
2406
1888
  ...extra
2407
1889
  };
2408
1890
  }
2409
- function resolveCustomEngineId(cfg) {
2410
- if (!cfg.customRenderer) return null;
2411
- return LEGACY_RENDERER_MAP[cfg.customRenderer] ?? null;
1891
+ var REMOVED_INK_FIELDS = [
1892
+ "customRenderer",
1893
+ "inkColor",
1894
+ "bristleDensity",
1895
+ "bristleSkipRate",
1896
+ "dripRate",
1897
+ "dripMaxLength",
1898
+ "grainDensity",
1899
+ "skewX"
1900
+ ];
1901
+ function stripRemovedRendererFields(value) {
1902
+ const out = { ...value };
1903
+ for (const key of REMOVED_INK_FIELDS) delete out[key];
1904
+ return out;
2412
1905
  }
2413
1906
  function textEffectConfigToScene(cfg) {
2414
- const engineId = resolveCustomEngineId(cfg);
1907
+ const safeConfig = stripRemovedRendererFields(cfg);
2415
1908
  const layers = [];
2416
- if (engineId) {
2417
- layers.push(
2418
- layer(
2419
- "customEngine",
2420
- "Custom Engine",
2421
- { engineId },
2422
- {
2423
- enabled: true,
2424
- target: "scene"
2425
- }
2426
- )
2427
- );
2428
- layers.push(
2429
- layer(
2430
- "customEngine",
2431
- "Engine Params",
2432
- { ...collectEngineParams(cfg, engineId) },
2433
- {
2434
- enabled: true,
2435
- target: "text"
2436
- }
2437
- )
2438
- );
2439
- }
2440
1909
  layers.push(
2441
1910
  layer(
2442
1911
  "panel",
2443
1912
  "Background Panel",
2444
1913
  {
2445
- panelEnabled: cfg.panelEnabled,
2446
- panelColor: cfg.panelColor,
2447
- panelOpacity: cfg.panelOpacity,
2448
- panelRadius: cfg.panelRadius,
2449
- panelPaddingX: cfg.panelPaddingX,
2450
- panelPaddingY: cfg.panelPaddingY,
2451
- panelStrokeEnabled: cfg.panelStrokeEnabled,
2452
- panelStrokeColor: cfg.panelStrokeColor,
2453
- panelStrokeWidth: cfg.panelStrokeWidth
1914
+ enabled: safeConfig.panelEnabled,
1915
+ panelEnabled: safeConfig.panelEnabled,
1916
+ panelColor: safeConfig.panelColor,
1917
+ panelOpacity: safeConfig.panelOpacity,
1918
+ panelRadius: safeConfig.panelRadius,
1919
+ panelPaddingX: safeConfig.panelPaddingX,
1920
+ panelPaddingY: safeConfig.panelPaddingY,
1921
+ panelStrokeEnabled: safeConfig.panelStrokeEnabled,
1922
+ panelStrokeColor: safeConfig.panelStrokeColor,
1923
+ panelStrokeWidth: safeConfig.panelStrokeWidth
2454
1924
  },
2455
- { enabled: cfg.panelEnabled }
1925
+ { enabled: safeConfig.panelEnabled, id: "panel" }
2456
1926
  )
2457
1927
  );
2458
- (cfg.glowLayers || []).forEach((g, i) => {
2459
- layers.push(layer("glow", `Glow ${i + 1}`, { ...g }, { enabled: g.enabled, opacity: (g.opacity ?? 100) / 100 }));
1928
+ (safeConfig.glowLayers || []).forEach((g, i) => {
1929
+ layers.push(layer("glow", `Glow ${i + 1}`, { ...g, enabled: g.enabled }, { id: `glow-${i + 1}`, enabled: g.enabled, opacity: (g.opacity ?? 100) / 100 }));
2460
1930
  });
2461
1931
  layers.push(
2462
1932
  layer(
2463
1933
  "shadow",
2464
1934
  "Shadow",
2465
1935
  {
2466
- shadowEnabled: cfg.shadowEnabled,
2467
- shadowColor: cfg.shadowColor,
2468
- shadowBlur: cfg.shadowBlur,
2469
- shadowOffsetX: cfg.shadowOffsetX,
2470
- shadowOffsetY: cfg.shadowOffsetY,
2471
- shadowOpacity: cfg.shadowOpacity,
2472
- shadowType: cfg.shadowType
1936
+ enabled: safeConfig.shadowEnabled,
1937
+ shadowEnabled: safeConfig.shadowEnabled,
1938
+ shadowColor: safeConfig.shadowColor,
1939
+ shadowBlur: safeConfig.shadowBlur,
1940
+ shadowOffsetX: safeConfig.shadowOffsetX,
1941
+ shadowOffsetY: safeConfig.shadowOffsetY,
1942
+ shadowOpacity: safeConfig.shadowOpacity,
1943
+ shadowType: safeConfig.shadowType
2473
1944
  },
2474
- { enabled: cfg.shadowEnabled }
1945
+ { enabled: safeConfig.shadowEnabled, id: "shadow" }
2475
1946
  )
2476
1947
  );
2477
1948
  layers.push(
@@ -2479,22 +1950,23 @@ function textEffectConfigToScene(cfg) {
2479
1950
  "extrusion",
2480
1951
  "Bevel / Extrusion",
2481
1952
  {
2482
- bevelEnabled: cfg.bevelEnabled,
2483
- bevelDepth: cfg.bevelDepth,
2484
- bevelHighlight: cfg.bevelHighlight,
2485
- bevelShadow: cfg.bevelShadow,
2486
- bevelDirection: cfg.bevelDirection,
2487
- bevelCoreColor: cfg.bevelCoreColor,
2488
- bevelEdgeColor: cfg.bevelEdgeColor,
2489
- bevelEdgeWidth: cfg.bevelEdgeWidth,
2490
- bevelBlur: cfg.bevelBlur,
2491
- bevelBlurColor: cfg.bevelBlurColor,
2492
- bevelPerspectiveEnabled: cfg.bevelPerspectiveEnabled,
2493
- bevelVanishingPointX: cfg.bevelVanishingPointX,
2494
- bevelVanishingPointY: cfg.bevelVanishingPointY,
2495
- bevelFocalLength: cfg.bevelFocalLength
1953
+ enabled: safeConfig.bevelEnabled,
1954
+ bevelEnabled: safeConfig.bevelEnabled,
1955
+ bevelDepth: safeConfig.bevelDepth,
1956
+ bevelHighlight: safeConfig.bevelHighlight,
1957
+ bevelShadow: safeConfig.bevelShadow,
1958
+ bevelDirection: safeConfig.bevelDirection,
1959
+ bevelCoreColor: safeConfig.bevelCoreColor,
1960
+ bevelEdgeColor: safeConfig.bevelEdgeColor,
1961
+ bevelEdgeWidth: safeConfig.bevelEdgeWidth,
1962
+ bevelBlur: safeConfig.bevelBlur,
1963
+ bevelBlurColor: safeConfig.bevelBlurColor,
1964
+ bevelPerspectiveEnabled: safeConfig.bevelPerspectiveEnabled,
1965
+ bevelVanishingPointX: safeConfig.bevelVanishingPointX,
1966
+ bevelVanishingPointY: safeConfig.bevelVanishingPointY,
1967
+ bevelFocalLength: safeConfig.bevelFocalLength
2496
1968
  },
2497
- { enabled: cfg.bevelEnabled }
1969
+ { enabled: safeConfig.bevelEnabled, id: "extrusion" }
2498
1970
  )
2499
1971
  );
2500
1972
  layers.push(
@@ -2502,17 +1974,18 @@ function textEffectConfigToScene(cfg) {
2502
1974
  "duplicateStack",
2503
1975
  "Stack Extrusion",
2504
1976
  {
2505
- stackEnabled: cfg.stackEnabled,
2506
- stackCount: cfg.stackCount,
2507
- stackOffsetX: cfg.stackOffsetX,
2508
- stackOffsetY: cfg.stackOffsetY,
2509
- stackOpacityDecay: cfg.stackOpacityDecay,
2510
- stackColor1: cfg.stackColor1,
2511
- stackColor2: cfg.stackColor2,
2512
- stackColor3: cfg.stackColor3,
2513
- stackColor4: cfg.stackColor4
1977
+ enabled: !!safeConfig.stackEnabled,
1978
+ stackEnabled: safeConfig.stackEnabled,
1979
+ stackCount: safeConfig.stackCount,
1980
+ stackOffsetX: safeConfig.stackOffsetX,
1981
+ stackOffsetY: safeConfig.stackOffsetY,
1982
+ stackOpacityDecay: safeConfig.stackOpacityDecay,
1983
+ stackColor1: safeConfig.stackColor1,
1984
+ stackColor2: safeConfig.stackColor2,
1985
+ stackColor3: safeConfig.stackColor3,
1986
+ stackColor4: safeConfig.stackColor4
2514
1987
  },
2515
- { enabled: !!cfg.stackEnabled }
1988
+ { enabled: !!safeConfig.stackEnabled, id: "duplicate-stack" }
2516
1989
  )
2517
1990
  );
2518
1991
  layers.push(
@@ -2520,19 +1993,20 @@ function textEffectConfigToScene(cfg) {
2520
1993
  "stroke",
2521
1994
  "Stroke",
2522
1995
  {
2523
- strokeEnabled: cfg.strokeEnabled,
2524
- strokeColor: cfg.strokeColor,
2525
- strokeWidth: cfg.strokeWidth,
2526
- strokePosition: cfg.strokePosition,
2527
- strokeOpacity: cfg.strokeOpacity,
2528
- strokeLineJoin: cfg.strokeLineJoin,
2529
- strokeBlur: cfg.strokeBlur,
2530
- strokeType: cfg.strokeType,
2531
- strokeColorSecondary: cfg.strokeColorSecondary,
2532
- strokeWidthSecondary: cfg.strokeWidthSecondary,
2533
- strokeFadeRange: cfg.strokeFadeRange
1996
+ enabled: safeConfig.strokeEnabled,
1997
+ strokeEnabled: safeConfig.strokeEnabled,
1998
+ strokeColor: safeConfig.strokeColor,
1999
+ strokeWidth: safeConfig.strokeWidth,
2000
+ strokePosition: safeConfig.strokePosition,
2001
+ strokeOpacity: safeConfig.strokeOpacity,
2002
+ strokeLineJoin: safeConfig.strokeLineJoin,
2003
+ strokeBlur: safeConfig.strokeBlur,
2004
+ strokeType: safeConfig.strokeType,
2005
+ strokeColorSecondary: safeConfig.strokeColorSecondary,
2006
+ strokeWidthSecondary: safeConfig.strokeWidthSecondary,
2007
+ strokeFadeRange: safeConfig.strokeFadeRange
2534
2008
  },
2535
- { enabled: cfg.strokeEnabled }
2009
+ { enabled: safeConfig.strokeEnabled, id: "stroke" }
2536
2010
  )
2537
2011
  );
2538
2012
  layers.push(
@@ -2540,73 +2014,57 @@ function textEffectConfigToScene(cfg) {
2540
2014
  "fill",
2541
2015
  "Fill",
2542
2016
  {
2543
- fillType: cfg.fillType,
2544
- fillColor: cfg.fillColor,
2545
- fillGradientAngle: cfg.fillGradientAngle,
2546
- fillGradientStops: cfg.fillGradientStops,
2547
- patternType: cfg.patternType,
2548
- perCharFillEnabled: cfg.perCharFillEnabled,
2549
- charFillColors: cfg.charFillColors
2017
+ enabled: safeConfig.fillType !== "none",
2018
+ fillType: safeConfig.fillType,
2019
+ fillColor: safeConfig.fillColor,
2020
+ fillGradientAngle: safeConfig.fillGradientAngle,
2021
+ fillGradientStops: safeConfig.fillGradientStops,
2022
+ patternType: safeConfig.patternType,
2023
+ perCharFillEnabled: safeConfig.perCharFillEnabled,
2024
+ charFillColors: safeConfig.charFillColors
2550
2025
  },
2551
- { enabled: cfg.fillType !== "none" }
2026
+ { enabled: safeConfig.fillType !== "none", id: "fill" }
2552
2027
  )
2553
2028
  );
2554
- layers.push(layer("mask", "Text Alpha Mask", { maskType: "alphaText", revealProgress: 1 }, { enabled: false }));
2555
- layers.push(layer("filter", "Compositor FX", { blur: 0, bloom: 0 }, { enabled: false, target: "previous" }));
2029
+ layers.push(layer("mask", "Text Alpha Mask", { maskType: "alphaText", revealProgress: 1 }, { enabled: false, id: "mask" }));
2030
+ layers.push(layer("filter", "Compositor FX", { blur: 0, bloom: 0 }, { enabled: false, target: "previous", id: "compositor" }));
2556
2031
  const doc = {
2557
2032
  version: 1,
2558
- effectName: cfg.effectName,
2033
+ schemaVersion: 2,
2034
+ effectName: safeConfig.effectName,
2559
2035
  canvas: {
2560
- width: cfg.canvasWidth,
2561
- height: cfg.canvasHeight,
2036
+ width: safeConfig.canvasWidth,
2037
+ height: safeConfig.canvasHeight,
2562
2038
  background: "transparent"
2563
2039
  },
2564
2040
  text: {
2565
- content: cfg.text,
2566
- fontFamily: cfg.fontFamily,
2567
- fontWeight: cfg.fontWeight,
2568
- fontStyle: cfg.fontStyle,
2569
- fontSize: cfg.fontSize,
2570
- letterSpacing: cfg.letterSpacing,
2571
- lineHeight: cfg.lineHeight,
2572
- textPosX: cfg.textPosX,
2573
- textPosY: cfg.textPosY,
2574
- wrapText: cfg.wrapText !== false,
2575
- autoFitText: !!cfg.autoFitText,
2576
- perCharFillEnabled: cfg.perCharFillEnabled,
2577
- charFillColors: cfg.charFillColors
2041
+ content: safeConfig.text,
2042
+ fontFamily: safeConfig.fontFamily,
2043
+ fontWeight: safeConfig.fontWeight,
2044
+ fontStyle: safeConfig.fontStyle,
2045
+ fontSize: safeConfig.fontSize,
2046
+ letterSpacing: safeConfig.letterSpacing,
2047
+ lineHeight: safeConfig.lineHeight,
2048
+ textPosX: safeConfig.textPosX,
2049
+ textPosY: safeConfig.textPosY,
2050
+ wrapText: safeConfig.wrapText !== false,
2051
+ autoFitText: !!safeConfig.autoFitText,
2052
+ perCharFillEnabled: safeConfig.perCharFillEnabled,
2053
+ charFillColors: safeConfig.charFillColors
2578
2054
  },
2579
2055
  effectLayers: layers,
2580
- customEngineId: engineId,
2581
- engineParams: engineId ? collectEngineParams(cfg, engineId) : void 0,
2582
2056
  compositor: { blur: 0, bloom: 0, bloomThreshold: 0.6 },
2583
2057
  timeline: { duration: 2, fps: 30, loop: true, tracks: [] },
2584
- legacyConfig: { ...cfg }
2058
+ legacyConfig: { ...safeConfig }
2585
2059
  };
2586
2060
  return ensureDefaultTimeline(doc);
2587
2061
  }
2588
- function collectEngineParams(cfg, id) {
2589
- switch (id) {
2590
- case "ink":
2591
- return {
2592
- inkColor: cfg.inkColor,
2593
- bristleDensity: cfg.bristleDensity,
2594
- bristleSkipRate: cfg.bristleSkipRate,
2595
- dripRate: cfg.dripRate,
2596
- dripMaxLength: cfg.dripMaxLength,
2597
- grainDensity: cfg.grainDensity,
2598
- skewX: cfg.skewX
2599
- };
2600
- default:
2601
- return {};
2602
- }
2603
- }
2604
2062
  function getLayerParams(doc, type, index = 0) {
2605
2063
  const found = doc.effectLayers.filter((l) => l.type === type);
2606
2064
  return found[index]?.params;
2607
2065
  }
2608
2066
  function sceneToConfig(doc) {
2609
- const base = doc.legacyConfig ? { ...doc.legacyConfig } : {
2067
+ const base = doc.legacyConfig ? stripRemovedRendererFields(doc.legacyConfig) : {
2610
2068
  ...createDefaultFromScene(doc)
2611
2069
  };
2612
2070
  base.effectName = doc.effectName;
@@ -2623,11 +2081,15 @@ function sceneToConfig(doc) {
2623
2081
  base.autoFitText = !!doc.text.autoFitText;
2624
2082
  base.canvasWidth = doc.canvas.width;
2625
2083
  base.canvasHeight = doc.canvas.height;
2084
+ const withoutLayerEnabled = (params) => {
2085
+ const { enabled: _enabled, ...visualParams } = params;
2086
+ return visualParams;
2087
+ };
2626
2088
  const panel = getLayerParams(doc, "panel");
2627
2089
  if (panel) {
2628
2090
  Object.assign(base, {
2629
- panelEnabled: panel.panelEnabled,
2630
- panelColor: panel.panelColor,
2091
+ panelEnabled: !!doc.effectLayers.find((l) => l.type === "panel")?.enabled && panel.enabled !== false && panel.panelEnabled !== false,
2092
+ ...withoutLayerEnabled(panel),
2631
2093
  panelOpacity: panel.panelOpacity,
2632
2094
  panelRadius: panel.panelRadius,
2633
2095
  panelPaddingX: panel.panelPaddingX,
@@ -2641,7 +2103,7 @@ function sceneToConfig(doc) {
2641
2103
  base.glowLayers = glows.map((l) => {
2642
2104
  const p = l.params;
2643
2105
  return {
2644
- enabled: l.enabled && (p.enabled ?? true),
2106
+ enabled: l.enabled && (p.enabled ?? true) && (l.opacity ?? 1) > 0,
2645
2107
  color: p.color ?? "#7C6FFF",
2646
2108
  blur: p.blur ?? 20,
2647
2109
  opacity: Math.round((p.opacity ?? 80) * (l.opacity ?? 1)),
@@ -2660,23 +2122,17 @@ function sceneToConfig(doc) {
2660
2122
  });
2661
2123
  }
2662
2124
  const shadow = getLayerParams(doc, "shadow");
2663
- if (shadow) Object.assign(base, shadow);
2125
+ if (shadow) Object.assign(base, { ...withoutLayerEnabled(shadow), shadowEnabled: !!doc.effectLayers.find((l) => l.type === "shadow")?.enabled && shadow.enabled !== false && shadow.shadowEnabled !== false });
2664
2126
  const extrusion = getLayerParams(doc, "extrusion");
2665
- if (extrusion) Object.assign(base, extrusion);
2127
+ if (extrusion) Object.assign(base, { ...withoutLayerEnabled(extrusion), bevelEnabled: !!doc.effectLayers.find((l) => l.type === "extrusion")?.enabled && extrusion.enabled !== false && extrusion.bevelEnabled !== false });
2666
2128
  const stack = getLayerParams(doc, "duplicateStack");
2667
- if (stack) Object.assign(base, stack);
2129
+ if (stack) Object.assign(base, { ...withoutLayerEnabled(stack), stackEnabled: !!doc.effectLayers.find((l) => l.type === "duplicateStack")?.enabled && stack.enabled !== false && stack.stackEnabled !== false });
2668
2130
  const stroke = getLayerParams(doc, "stroke");
2669
- if (stroke) Object.assign(base, stroke);
2131
+ if (stroke) Object.assign(base, { ...withoutLayerEnabled(stroke), strokeEnabled: !!doc.effectLayers.find((l) => l.type === "stroke")?.enabled && stroke.enabled !== false && stroke.strokeEnabled !== false });
2670
2132
  const fill = getLayerParams(doc, "fill");
2671
- if (fill) Object.assign(base, fill);
2133
+ if (fill) Object.assign(base, withoutLayerEnabled(fill));
2672
2134
  base.perCharFillEnabled = doc.text.perCharFillEnabled ?? fill?.perCharFillEnabled;
2673
2135
  base.charFillColors = doc.text.charFillColors ?? fill?.charFillColors;
2674
- if (doc.customEngineId) {
2675
- base.customRenderer = ENGINE_ID_TO_LEGACY[doc.customEngineId];
2676
- Object.assign(base, doc.engineParams || {});
2677
- } else {
2678
- base.customRenderer = void 0;
2679
- }
2680
2136
  base.glowLayers = base.glowLayers.slice(0, 6);
2681
2137
  const filterLayers = doc.effectLayers.filter((l) => l.type === "filter" && l.enabled);
2682
2138
  const filter = filterLayers[filterLayers.length - 1]?.params;
@@ -2759,7 +2215,7 @@ function _buildConfig(effect, text, fontSize, canvasWidth, canvasHeight, time, c
2759
2215
  if (effect.animation) {
2760
2216
  config.animation = effect.animation;
2761
2217
  }
2762
- if (fill) {
2218
+ if (fill && fill.enabled !== false) {
2763
2219
  if (fill.type !== void 0) config.fillType = fill.type;
2764
2220
  if (fill.color !== void 0) config.fillColor = fill.color;
2765
2221
  if (fill.gradient?.angle !== void 0) config.fillGradientAngle = fill.gradient.angle;
@@ -2770,7 +2226,7 @@ function _buildConfig(effect, text, fontSize, canvasWidth, canvasHeight, time, c
2770
2226
  } else {
2771
2227
  config.fillType = "none";
2772
2228
  }
2773
- config.strokeEnabled = !!stroke;
2229
+ config.strokeEnabled = !!stroke && stroke.enabled !== false;
2774
2230
  if (stroke) {
2775
2231
  if (stroke.color !== void 0) config.strokeColor = stroke.color;
2776
2232
  if (stroke.width !== void 0) config.strokeWidth = stroke.width * ratio;
@@ -2783,7 +2239,7 @@ function _buildConfig(effect, text, fontSize, canvasWidth, canvasHeight, time, c
2783
2239
  if (stroke.widthSecondary !== void 0) config.strokeWidthSecondary = stroke.widthSecondary * ratio;
2784
2240
  if (stroke.fadeRange !== void 0) config.strokeFadeRange = stroke.fadeRange;
2785
2241
  }
2786
- config.shadowEnabled = !!shadow;
2242
+ config.shadowEnabled = !!shadow && shadow.enabled !== false;
2787
2243
  if (shadow) {
2788
2244
  if (shadow.color !== void 0) config.shadowColor = shadow.color;
2789
2245
  if (shadow.blur !== void 0) config.shadowBlur = shadow.blur * ratio;
@@ -2794,7 +2250,7 @@ function _buildConfig(effect, text, fontSize, canvasWidth, canvasHeight, time, c
2794
2250
  if (shadow.opacity !== void 0) config.shadowOpacity = shadow.opacity;
2795
2251
  if (shadow.type !== void 0) config.shadowType = shadow.type;
2796
2252
  }
2797
- config.bevelEnabled = !!bevel;
2253
+ config.bevelEnabled = !!bevel && bevel.enabled !== false;
2798
2254
  if (bevel) {
2799
2255
  if (bevel.depth !== void 0) config.bevelDepth = Math.round(bevel.depth * ratio);
2800
2256
  if (bevel.highlight !== void 0) config.bevelHighlight = bevel.highlight;
@@ -2813,17 +2269,19 @@ function _buildConfig(effect, text, fontSize, canvasWidth, canvasHeight, time, c
2813
2269
  if (bevel.focalLength !== void 0) config.bevelFocalLength = bevel.focalLength;
2814
2270
  }
2815
2271
  if (effect.stack) {
2816
- config.stackEnabled = !!effect.stack.count;
2272
+ config.stackEnabled = effect.stack.enabled !== false && !!effect.stack.count;
2817
2273
  if (effect.stack.count !== void 0) config.stackCount = effect.stack.count;
2818
2274
  if (effect.stack.offsetX !== void 0) config.stackOffsetX = effect.stack.offsetX * ratio;
2819
2275
  if (effect.stack.offsetY !== void 0) config.stackOffsetY = effect.stack.offsetY * ratio;
2820
- if (effect.stack.opacityDecay !== void 0) config.stackOpacityDecay = effect.stack.opacityDecay;
2276
+ if (effect.stack.opacityDecay !== void 0) {
2277
+ config.stackOpacityDecay = effect.stack.opacityDecay <= 1 ? effect.stack.opacityDecay * 100 : effect.stack.opacityDecay;
2278
+ }
2821
2279
  if (effect.stack.color1 !== void 0) config.stackColor1 = effect.stack.color1;
2822
2280
  if (effect.stack.color2 !== void 0) config.stackColor2 = effect.stack.color2;
2823
2281
  if (effect.stack.color3 !== void 0) config.stackColor3 = effect.stack.color3;
2824
2282
  if (effect.stack.color4 !== void 0) config.stackColor4 = effect.stack.color4;
2825
2283
  }
2826
- config.panelEnabled = !!panel;
2284
+ config.panelEnabled = !!panel && panel.enabled !== false;
2827
2285
  if (panel) {
2828
2286
  if (panel.color !== void 0) config.panelColor = panel.color;
2829
2287
  if (panel.opacity !== void 0) config.panelOpacity = panel.opacity;
@@ -2832,16 +2290,17 @@ function _buildConfig(effect, text, fontSize, canvasWidth, canvasHeight, time, c
2832
2290
  else if (panel.paddingX !== void 0) config.panelPaddingX = panel.paddingX * ratio;
2833
2291
  if (panel.padding?.y !== void 0) config.panelPaddingY = panel.padding.y * ratio;
2834
2292
  else if (panel.paddingY !== void 0) config.panelPaddingY = panel.paddingY * ratio;
2835
- if (panel.stroke !== void 0) {
2836
- config.panelStrokeEnabled = !!panel.stroke;
2293
+ if (panel.stroke) {
2294
+ config.panelStrokeEnabled = panel.stroke.enabled !== false;
2837
2295
  if (panel.stroke.color !== void 0) config.panelStrokeColor = panel.stroke.color;
2838
2296
  if (panel.stroke.width !== void 0) config.panelStrokeWidth = panel.stroke.width * ratio;
2839
2297
  }
2840
2298
  }
2841
- if (effect.glows) {
2842
- config.glowLayers = effect.glows.map((g) => {
2299
+ if (effect.glows || effect.glow) {
2300
+ const sourceGlows = effect.glows ?? [effect.glow];
2301
+ config.glowLayers = sourceGlows.map((g) => {
2843
2302
  const mappedGlow = {
2844
- enabled: true,
2303
+ enabled: g.enabled !== false,
2845
2304
  color: g.color,
2846
2305
  blur: typeof g.blur === "number" ? g.blur * ratio : g.blur ?? 0,
2847
2306
  opacity: g.opacity,
@@ -2852,15 +2311,6 @@ function _buildConfig(effect, text, fontSize, canvasWidth, canvasHeight, time, c
2852
2311
  return mappedGlow;
2853
2312
  });
2854
2313
  }
2855
- const rawEffect = effect;
2856
- if (rawEffect.customRenderer !== void 0) config.customRenderer = rawEffect.customRenderer;
2857
- if (rawEffect.inkColor !== void 0) config.inkColor = rawEffect.inkColor;
2858
- if (rawEffect.bristleDensity !== void 0) config.bristleDensity = rawEffect.bristleDensity;
2859
- if (rawEffect.bristleSkipRate !== void 0) config.bristleSkipRate = rawEffect.bristleSkipRate;
2860
- if (rawEffect.dripRate !== void 0) config.dripRate = rawEffect.dripRate;
2861
- if (rawEffect.dripMaxLength !== void 0) config.dripMaxLength = rawEffect.dripMaxLength;
2862
- if (rawEffect.grainDensity !== void 0) config.grainDensity = rawEffect.grainDensity;
2863
- if (rawEffect.skewX !== void 0) config.skewX = rawEffect.skewX;
2864
2314
  const standardKeys = /* @__PURE__ */ new Set([
2865
2315
  "id",
2866
2316
  "name",
@@ -2953,15 +2403,7 @@ function _buildConfig(effect, text, fontSize, canvasWidth, canvasHeight, time, c
2953
2403
  "textPosX",
2954
2404
  "textPosY",
2955
2405
  "autoFitText",
2956
- "wrapText",
2957
- "customRenderer",
2958
- "inkColor",
2959
- "bristleDensity",
2960
- "bristleSkipRate",
2961
- "dripRate",
2962
- "dripMaxLength",
2963
- "grainDensity",
2964
- "skewX"
2406
+ "wrapText"
2965
2407
  ]);
2966
2408
  for (const key of Object.keys(effect)) {
2967
2409
  if (!standardKeys.has(key)) {
@@ -3012,292 +2454,6 @@ function layerToTextEffectConfig(layer2) {
3012
2454
  return config;
3013
2455
  }
3014
2456
 
3015
- // src/fontLoader.ts
3016
- var FONT_VARIANTS = [
3017
- // Poppins variants
3018
- { variantName: "Poppins-Regular", baseFontFamily: "Poppins", weight: 400, style: "normal" },
3019
- { variantName: "Poppins-Bold", baseFontFamily: "Poppins", weight: 700, style: "normal" },
3020
- { variantName: "Poppins-Italic", baseFontFamily: "Poppins", weight: 400, style: "italic" },
3021
- { variantName: "Poppins-BoldItalic", baseFontFamily: "Poppins", weight: 700, style: "italic" },
3022
- // Montserrat variants
3023
- { variantName: "Montserrat-Regular", baseFontFamily: "Montserrat", weight: 400, style: "normal" },
3024
- { variantName: "Montserrat-Bold", baseFontFamily: "Montserrat", weight: 700, style: "normal" },
3025
- { variantName: "Montserrat-ExtraBold", baseFontFamily: "Montserrat", weight: 800, style: "normal" },
3026
- { variantName: "Montserrat-Black", baseFontFamily: "Montserrat", weight: 900, style: "normal" },
3027
- { variantName: "Montserrat-Italic", baseFontFamily: "Montserrat", weight: 400, style: "italic" },
3028
- { variantName: "Montserrat-BoldItalic", baseFontFamily: "Montserrat", weight: 700, style: "italic" },
3029
- { variantName: "Montserrat-ExtraBoldItalic", baseFontFamily: "Montserrat", weight: 800, style: "italic" },
3030
- { variantName: "Montserrat-BlackItalic", baseFontFamily: "Montserrat", weight: 900, style: "italic" },
3031
- // Arial variants (System Fonts)
3032
- { variantName: "Arial", baseFontFamily: "Arial", weight: 400, style: "normal" },
3033
- { variantName: "Arial-Bold", baseFontFamily: "Arial", weight: 700, style: "normal" },
3034
- { variantName: "Arial-Italic", baseFontFamily: "Arial", weight: 400, style: "italic" },
3035
- { variantName: "Arial-BoldItalic", baseFontFamily: "Arial", weight: 700, style: "italic" }
3036
- ];
3037
- function injectFontVariantRules() {
3038
- if (document.getElementById("lottie-font-variants")) {
3039
- return;
3040
- }
3041
- const style = document.createElement("style");
3042
- style.id = "lottie-font-variants";
3043
- let css = "/* Dynamically injected font variants for lottie-web */\n";
3044
- FONT_VARIANTS.forEach((variant) => {
3045
- const resolvedFamily = resolveFontFamilyName(variant.baseFontFamily);
3046
- css += `
3047
- @font-face {
3048
- font-family: "${variant.variantName}";
3049
- src: local("${resolvedFamily}"), local("${variant.baseFontFamily}");
3050
- font-weight: ${variant.weight};
3051
- font-style: ${variant.style};
3052
- font-display: swap;
3053
- }
3054
- `;
3055
- });
3056
- style.textContent = css;
3057
- document.head.appendChild(style);
3058
- console.log("\u2705 Font variant rules injected for lottie-web");
3059
- }
3060
- async function initializeFontSystem() {
3061
- try {
3062
- const preloaderId = "font-system-preloader";
3063
- if (!document.getElementById(preloaderId) && document.body) {
3064
- const preloader = document.createElement("div");
3065
- preloader.id = preloaderId;
3066
- preloader.style.position = "absolute";
3067
- preloader.style.width = "0";
3068
- preloader.style.height = "0";
3069
- preloader.style.overflow = "hidden";
3070
- preloader.style.visibility = "hidden";
3071
- preloader.style.opacity = "0";
3072
- preloader.style.pointerEvents = "none";
3073
- preloader.style.zIndex = "-9999";
3074
- const preloadItems = [
3075
- { family: "Poppins", weight: 400, style: "normal" },
3076
- { family: "Poppins", weight: 700, style: "normal" },
3077
- { family: "Poppins", weight: 400, style: "italic" },
3078
- { family: "Poppins", weight: 700, style: "italic" },
3079
- { family: "Montserrat", weight: 400, style: "normal" },
3080
- { family: "Montserrat", weight: 700, style: "normal" },
3081
- { family: "Montserrat", weight: 800, style: "normal" },
3082
- { family: "Montserrat", weight: 900, style: "normal" },
3083
- { family: "Montserrat", weight: 400, style: "italic" },
3084
- { family: "Montserrat", weight: 700, style: "italic" },
3085
- { family: "Montserrat", weight: 800, style: "italic" },
3086
- { family: "Montserrat", weight: 900, style: "italic" }
3087
- ];
3088
- preloadItems.forEach((item) => {
3089
- const span = document.createElement("span");
3090
- span.style.fontFamily = `'${item.family}'`;
3091
- span.style.fontWeight = String(item.weight);
3092
- span.style.fontStyle = item.style;
3093
- span.innerText = "preload";
3094
- preloader.appendChild(span);
3095
- });
3096
- document.body.appendChild(preloader);
3097
- }
3098
- await document.fonts.load("400 16px Poppins");
3099
- await document.fonts.load("700 16px Poppins");
3100
- await document.fonts.load("italic 400 16px Poppins");
3101
- await document.fonts.load("italic 700 16px Poppins");
3102
- await document.fonts.load("400 16px Montserrat");
3103
- await document.fonts.load("700 16px Montserrat");
3104
- await document.fonts.load("800 16px Montserrat");
3105
- await document.fonts.load("900 16px Montserrat");
3106
- await document.fonts.load("italic 400 16px Montserrat");
3107
- await document.fonts.load("italic 700 16px Montserrat");
3108
- await document.fonts.load("italic 800 16px Montserrat");
3109
- await document.fonts.load("italic 900 16px Montserrat");
3110
- injectFontVariantRules();
3111
- console.log("\u2705 Font system initialized (Poppins + Montserrat)");
3112
- } catch (error) {
3113
- console.warn("\u26A0\uFE0F Font loading warning:", error);
3114
- injectFontVariantRules();
3115
- }
3116
- }
3117
- function checkFontVariant(variantName) {
3118
- if (typeof document === "undefined" || !document.fonts) return false;
3119
- return document.fonts.check(`16px "${variantName}"`);
3120
- }
3121
- var FontLoader = class {
3122
- state = {
3123
- loading: /* @__PURE__ */ new Set(),
3124
- loaded: /* @__PURE__ */ new Set(),
3125
- failed: /* @__PURE__ */ new Map(),
3126
- promises: /* @__PURE__ */ new Map()
3127
- };
3128
- async ensureFont(descriptor) {
3129
- const resolvedFamily = resolveFontFamilyName(descriptor.family);
3130
- const resolvedDescriptor = { ...descriptor, family: resolvedFamily };
3131
- const key = this.getFontKey(resolvedDescriptor);
3132
- if (this.state.loaded.has(key)) {
3133
- return {
3134
- font: descriptor,
3135
- loaded: true,
3136
- loadTimeMs: 0
3137
- };
3138
- }
3139
- if (this.state.failed.has(key)) {
3140
- return {
3141
- font: descriptor,
3142
- loaded: false,
3143
- error: this.state.failed.get(key),
3144
- loadTimeMs: 0
3145
- };
3146
- }
3147
- if (this.state.promises.has(key)) {
3148
- return this.state.promises.get(key);
3149
- }
3150
- const promise = this.loadFont(resolvedDescriptor).then((res) => ({
3151
- ...res,
3152
- font: descriptor
3153
- }));
3154
- this.state.promises.set(key, promise);
3155
- return promise;
3156
- }
3157
- async ensureFonts(descriptors) {
3158
- return Promise.all(descriptors.map((desc) => this.ensureFont(desc)));
3159
- }
3160
- async waitForFontsReady() {
3161
- if (typeof document === "undefined" || !document.fonts) {
3162
- return;
3163
- }
3164
- await document.fonts.ready;
3165
- }
3166
- isLoaded(descriptor) {
3167
- const key = this.getFontKey(descriptor);
3168
- return this.state.loaded.has(key);
3169
- }
3170
- getStats() {
3171
- return {
3172
- loaded: this.state.loaded.size,
3173
- loading: this.state.loading.size,
3174
- failed: this.state.failed.size
3175
- };
3176
- }
3177
- clear() {
3178
- this.state.loading.clear();
3179
- this.state.loaded.clear();
3180
- this.state.failed.clear();
3181
- this.state.promises.clear();
3182
- }
3183
- async loadFont(descriptor) {
3184
- const key = this.getFontKey(descriptor);
3185
- const startTime = performance.now();
3186
- this.state.loading.add(key);
3187
- const SYSTEM_FONTS = /* @__PURE__ */ new Set([
3188
- "arial",
3189
- "georgia",
3190
- "times new roman",
3191
- "courier new",
3192
- "arial rounded mt bold",
3193
- "impact",
3194
- "helvetica",
3195
- "sans-serif",
3196
- "serif",
3197
- "monospace"
3198
- ]);
3199
- const isGoogleFont = (family) => {
3200
- return !SYSTEM_FONTS.has(family.toLowerCase());
3201
- };
3202
- const injectGoogleFontLink = (family) => {
3203
- if (typeof document === "undefined") return;
3204
- const fontId = `gfont-${family.replace(/\s+/g, "-").toLowerCase()}`;
3205
- if (document.getElementById(fontId)) return;
3206
- const link = document.createElement("link");
3207
- link.id = fontId;
3208
- link.rel = "stylesheet";
3209
- link.href = `https://fonts.googleapis.com/css2?family=${family.replace(/\s+/g, "+")}:wght@400;500;600;700;800;900&display=swap`;
3210
- document.head.appendChild(link);
3211
- console.log(`[FontLoader] Dynamically injected Google Fonts stylesheet for: ${family}`);
3212
- };
3213
- try {
3214
- if (typeof document === "undefined" || !document.fonts) {
3215
- throw new Error("Font API not available");
3216
- }
3217
- const weight = this.normalizeFontWeight(descriptor.weight);
3218
- const style = descriptor.style || "normal";
3219
- const fontFace = `${style} ${weight} 16px "${descriptor.family}"`;
3220
- if (isGoogleFont(descriptor.family)) {
3221
- injectGoogleFontLink(descriptor.family);
3222
- }
3223
- if (document.fonts.check(fontFace)) {
3224
- this.state.loaded.add(key);
3225
- this.state.loading.delete(key);
3226
- this.state.promises.delete(key);
3227
- return {
3228
- font: descriptor,
3229
- loaded: true,
3230
- loadTimeMs: performance.now() - startTime
3231
- };
3232
- }
3233
- await document.fonts.load(fontFace);
3234
- if (!document.fonts.check(fontFace)) {
3235
- const fallbackFontFace = `${style} 400 16px "${descriptor.family}"`;
3236
- if (weight !== 400 && document.fonts.check(fallbackFontFace)) {
3237
- console.log(`[FontLoader] Strict check failed for "${fontFace}", but weight 400 is loaded. Accepting fallback.`);
3238
- } else {
3239
- throw new Error(`Font "${descriptor.family}" failed to load`);
3240
- }
3241
- }
3242
- this.state.loaded.add(key);
3243
- this.state.loading.delete(key);
3244
- this.state.promises.delete(key);
3245
- return {
3246
- font: descriptor,
3247
- loaded: true,
3248
- loadTimeMs: performance.now() - startTime
3249
- };
3250
- } catch (error) {
3251
- const errorMessage = error instanceof Error ? error.message : "Unknown error";
3252
- this.state.failed.set(key, errorMessage);
3253
- this.state.loading.delete(key);
3254
- this.state.promises.delete(key);
3255
- return {
3256
- font: descriptor,
3257
- loaded: false,
3258
- error: errorMessage,
3259
- loadTimeMs: performance.now() - startTime
3260
- };
3261
- }
3262
- }
3263
- getFontKey(descriptor) {
3264
- const weight = this.normalizeFontWeight(descriptor.weight);
3265
- const style = descriptor.style || "normal";
3266
- return `${descriptor.family}|${weight}|${style}`;
3267
- }
3268
- normalizeFontWeight(weight) {
3269
- if (typeof weight === "number") {
3270
- return weight;
3271
- }
3272
- if (!weight) return 400;
3273
- const asNum = parseInt(weight, 10);
3274
- if (!isNaN(asNum) && asNum >= 100 && asNum <= 900) {
3275
- return asNum;
3276
- }
3277
- const weightMap = {
3278
- normal: 400,
3279
- bold: 700,
3280
- lighter: 300,
3281
- bolder: 700
3282
- };
3283
- return weightMap[weight] ?? 400;
3284
- }
3285
- };
3286
- var globalFontLoader = null;
3287
- function getFontLoader() {
3288
- if (!globalFontLoader) {
3289
- globalFontLoader = new FontLoader();
3290
- }
3291
- return globalFontLoader;
3292
- }
3293
- function resetFontLoader() {
3294
- globalFontLoader = null;
3295
- }
3296
- async function ensureFontsLoaded(descriptors) {
3297
- const loader = getFontLoader();
3298
- return loader.ensureFonts(descriptors);
3299
- }
3300
-
3301
2457
  // src/engine/animation.ts
3302
2458
  function ease(t, kind = "linear") {
3303
2459
  switch (kind) {
@@ -3383,170 +2539,6 @@ function createPulseOpacityTrack(layerId) {
3383
2539
  };
3384
2540
  }
3385
2541
 
3386
- // src/compositor/index.ts
3387
- var VERTEX_SRC = `#version 300 es
3388
- in vec2 a_pos;
3389
- in vec2 a_uv;
3390
- out vec2 v_uv;
3391
- void main() {
3392
- v_uv = a_uv;
3393
- gl_Position = vec4(a_pos, 0.0, 1.0);
3394
- }
3395
- `;
3396
- var FRAGMENT_SRC = `#version 300 es
3397
- precision highp float;
3398
- in vec2 v_uv;
3399
- uniform sampler2D u_tex;
3400
- uniform vec2 u_texel;
3401
- uniform float u_blur;
3402
- uniform float u_bloom;
3403
- uniform float u_bloomThreshold;
3404
- out vec4 outColor;
3405
-
3406
- void main() {
3407
- vec4 c = texture(u_tex, v_uv);
3408
- if (u_blur < 0.5 && u_bloom < 0.01) {
3409
- outColor = c;
3410
- return;
3411
- }
3412
- vec4 sum = c;
3413
- float w = 0.0;
3414
- if (u_blur >= 0.5) {
3415
- sum = vec4(0.0);
3416
- w = 0.0;
3417
- for (int x = -2; x <= 2; x++) {
3418
- for (int y = -2; y <= 2; y++) {
3419
- vec2 off = vec2(float(x), float(y)) * u_texel * u_blur;
3420
- vec4 s = texture(u_tex, v_uv + off);
3421
- float weight = 1.0 / (1.0 + float(x*x + y*y));
3422
- sum += s * weight;
3423
- w += weight;
3424
- }
3425
- }
3426
- sum /= w;
3427
- }
3428
- vec3 bloom = vec3(0.0);
3429
- if (u_bloom > 0.01) {
3430
- float lum = dot(sum.rgb, vec3(0.299, 0.587, 0.114));
3431
- if (lum > u_bloomThreshold) {
3432
- bloom = sum.rgb * u_bloom * (lum - u_bloomThreshold);
3433
- }
3434
- }
3435
- outColor = vec4(clamp(sum.rgb + bloom, 0.0, 1.0), c.a);
3436
- }
3437
- `;
3438
- var WebGLCompositor = class {
3439
- gl = null;
3440
- program = null;
3441
- vao = null;
3442
- texture = null;
3443
- isSupported;
3444
- constructor() {
3445
- if (typeof document === "undefined") {
3446
- this.isSupported = false;
3447
- return;
3448
- }
3449
- const canvas = document.createElement("canvas");
3450
- canvas.width = 2;
3451
- canvas.height = 2;
3452
- const gl = canvas.getContext("webgl2", { premultipliedAlpha: true, alpha: true });
3453
- if (!gl) {
3454
- this.isSupported = false;
3455
- return;
3456
- }
3457
- this.gl = gl;
3458
- this.isSupported = this.initProgram(gl);
3459
- }
3460
- initProgram(gl) {
3461
- const vs = this.compileShader(gl, gl.VERTEX_SHADER, VERTEX_SRC);
3462
- const fs = this.compileShader(gl, gl.FRAGMENT_SHADER, FRAGMENT_SRC);
3463
- if (!vs || !fs) return false;
3464
- const program = gl.createProgram();
3465
- if (!program) return false;
3466
- gl.attachShader(program, vs);
3467
- gl.attachShader(program, fs);
3468
- gl.linkProgram(program);
3469
- if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
3470
- console.warn("Compositor program link failed", gl.getProgramInfoLog(program));
3471
- return false;
3472
- }
3473
- this.program = program;
3474
- const positions = new Float32Array([-1, -1, 0, 1, 1, -1, 1, 1, -1, 1, 0, 0, 1, 1, 1, 0]);
3475
- const vao = gl.createVertexArray();
3476
- const vbo = gl.createBuffer();
3477
- gl.bindVertexArray(vao);
3478
- gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
3479
- gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);
3480
- const locPos = gl.getAttribLocation(program, "a_pos");
3481
- const locUv = gl.getAttribLocation(program, "a_uv");
3482
- gl.enableVertexAttribArray(locPos);
3483
- gl.vertexAttribPointer(locPos, 2, gl.FLOAT, false, 16, 0);
3484
- gl.enableVertexAttribArray(locUv);
3485
- gl.vertexAttribPointer(locUv, 2, gl.FLOAT, false, 16, 8);
3486
- gl.bindVertexArray(null);
3487
- this.vao = vao;
3488
- this.texture = gl.createTexture();
3489
- return true;
3490
- }
3491
- compileShader(gl, type, source) {
3492
- const shader = gl.createShader(type);
3493
- if (!shader) return null;
3494
- gl.shaderSource(shader, source);
3495
- gl.compileShader(shader);
3496
- if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
3497
- console.warn(gl.getShaderInfoLog(shader));
3498
- return null;
3499
- }
3500
- return shader;
3501
- }
3502
- renderToContext(targetCtx, source, settings) {
3503
- const gl = this.gl;
3504
- const program = this.program;
3505
- if (!gl || !program || !this.isSupported) {
3506
- targetCtx.clearRect(0, 0, source.width, source.height);
3507
- targetCtx.drawImage(source, 0, 0);
3508
- return;
3509
- }
3510
- const w = source.width;
3511
- const h = source.height;
3512
- const canvas = gl.canvas;
3513
- if (canvas.width !== w || canvas.height !== h) {
3514
- canvas.width = w;
3515
- canvas.height = h;
3516
- }
3517
- gl.viewport(0, 0, w, h);
3518
- gl.clearColor(0, 0, 0, 0);
3519
- gl.clear(gl.COLOR_BUFFER_BIT);
3520
- gl.useProgram(program);
3521
- gl.activeTexture(gl.TEXTURE0);
3522
- gl.bindTexture(gl.TEXTURE_2D, this.texture);
3523
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
3524
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
3525
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
3526
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
3527
- gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
3528
- gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, source);
3529
- gl.uniform1i(gl.getUniformLocation(program, "u_tex"), 0);
3530
- gl.uniform2f(gl.getUniformLocation(program, "u_texel"), 1 / w, 1 / h);
3531
- gl.uniform1f(gl.getUniformLocation(program, "u_blur"), settings.blur ?? 0);
3532
- gl.uniform1f(gl.getUniformLocation(program, "u_bloom"), settings.bloom ?? 0);
3533
- gl.uniform1f(gl.getUniformLocation(program, "u_bloomThreshold"), settings.bloomThreshold ?? 0.6);
3534
- gl.bindVertexArray(this.vao);
3535
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
3536
- gl.bindVertexArray(null);
3537
- targetCtx.clearRect(0, 0, w, h);
3538
- targetCtx.drawImage(canvas, 0, 0);
3539
- }
3540
- dispose() {
3541
- const gl = this.gl;
3542
- if (!gl) return;
3543
- if (this.texture) gl.deleteTexture(this.texture);
3544
- if (this.program) gl.deleteProgram(this.program);
3545
- if (this.vao) gl.deleteVertexArray(this.vao);
3546
- this.gl = null;
3547
- }
3548
- };
3549
-
3550
2542
  // src/engine/mask.ts
3551
2543
  function applyMaskReveal(ctx, doc, width, height) {
3552
2544
  const maskLayer = doc.effectLayers.find((l) => l.type === "mask" && l.enabled);
@@ -3574,18 +2566,6 @@ function applyMaskReveal(ctx, doc, width, height) {
3574
2566
  }
3575
2567
 
3576
2568
  // src/engine/evaluate.ts
3577
- var sharedCompositor = null;
3578
- function getCompositor() {
3579
- if (typeof document === "undefined") return null;
3580
- if (!sharedCompositor) {
3581
- sharedCompositor = new WebGLCompositor();
3582
- }
3583
- return sharedCompositor;
3584
- }
3585
- function disposeSharedCompositor() {
3586
- sharedCompositor?.dispose();
3587
- sharedCompositor = null;
3588
- }
3589
2569
  function evaluateScene(doc, time, ctx, options = {}) {
3590
2570
  const animated = applyTimelineAtTime(doc, time);
3591
2571
  const cfg = sceneToConfig(animated);
@@ -3612,11 +2592,21 @@ function evaluateScene(doc, time, ctx, options = {}) {
3612
2592
  tctx.clearRect(0, 0, w, h);
3613
2593
  renderTextEffectCore(tctx, cfg);
3614
2594
  applyMaskReveal(tctx, animated, w, h);
3615
- const compositor = options.compositor ?? getCompositor();
3616
- if (compositor?.isSupported) {
3617
- compositor.renderToContext(ctx, temp, comp);
2595
+ ctx.clearRect(0, 0, w, h);
2596
+ if (supportsCtxFilter()) {
2597
+ ctx.save();
2598
+ const blur = Math.max(0, comp.blur);
2599
+ const bloom = Math.max(0, comp.bloom);
2600
+ if (blur > 0) ctx.filter = `blur(${blur}px)`;
2601
+ ctx.drawImage(temp, 0, 0);
2602
+ if (bloom > 0) {
2603
+ ctx.globalCompositeOperation = "screen";
2604
+ ctx.globalAlpha = Math.min(0.8, bloom * 0.25);
2605
+ ctx.filter = `blur(${Math.max(1, bloom * 4)}px)`;
2606
+ ctx.drawImage(temp, 0, 0);
2607
+ }
2608
+ ctx.restore();
3618
2609
  } else {
3619
- ctx.clearRect(0, 0, w, h);
3620
2610
  ctx.drawImage(temp, 0, 0);
3621
2611
  }
3622
2612
  CanvasDevice.release(temp);
@@ -3654,14 +2644,12 @@ function resetSceneTime(doc) {
3654
2644
 
3655
2645
  export {
3656
2646
  SCENE_VERSION,
2647
+ SCENE_SCHEMA_VERSION,
3657
2648
  DEFAULT_CANVAS_WIDTH,
3658
2649
  DEFAULT_CANVAS_HEIGHT,
3659
2650
  DEFAULT_FONT_SIZE,
3660
2651
  DEFAULT_FPS,
3661
2652
  DEFAULT_DURATION,
3662
- CUSTOM_ENGINE_IDS,
3663
- LEGACY_RENDERER_MAP,
3664
- ENGINE_ID_TO_LEGACY,
3665
2653
  createEmptyScene,
3666
2654
  newLayerId,
3667
2655
  COMPOSITION_PRESETS,
@@ -3681,22 +2669,20 @@ export {
3681
2669
  supportsRoundRect,
3682
2670
  supportsLetterSpacing,
3683
2671
  supportsOffscreenCanvas,
3684
- supportsWebGL2,
3685
2672
  createCanvas,
3686
2673
  releaseCanvas,
3687
2674
  _resetPlatformCache,
3688
2675
  CanvasDevice,
3689
- InkBrushEngine,
3690
2676
  drawRoundedRect,
3691
2677
  applyLetterSpacing,
3692
2678
  restoreLetterSpacing,
3693
2679
  renderTextEffectCore,
3694
2680
  TextEffectRenderer,
3695
2681
  defaultConfig,
2682
+ createBlankTextEffectConfig,
3696
2683
  builtInPresets,
3697
2684
  ensureDefaultTimeline,
3698
2685
  cloneSceneWithNewIds,
3699
- resolveCustomEngineId,
3700
2686
  textEffectConfigToScene,
3701
2687
  sceneToConfig,
3702
2688
  syncCompositorFromScene,
@@ -3704,21 +2690,12 @@ export {
3704
2690
  resolveFontFamilyName,
3705
2691
  _buildConfig,
3706
2692
  layerToTextEffectConfig,
3707
- injectFontVariantRules,
3708
- initializeFontSystem,
3709
- checkFontVariant,
3710
- FontLoader,
3711
- getFontLoader,
3712
- resetFontLoader,
3713
- ensureFontsLoaded,
3714
2693
  ease,
3715
2694
  resolveAnimatedScalar,
3716
2695
  applyTimelineAtTime,
3717
2696
  createDefaultRevealTrack,
3718
2697
  createPulseOpacityTrack,
3719
- WebGLCompositor,
3720
2698
  applyMaskReveal,
3721
- disposeSharedCompositor,
3722
2699
  evaluateScene,
3723
2700
  evaluateConfig,
3724
2701
  advanceSceneTime,
@@ -3726,4 +2703,4 @@ export {
3726
2703
  setSceneTime,
3727
2704
  resetSceneTime
3728
2705
  };
3729
- //# sourceMappingURL=chunk-Y4FMAOTW.js.map
2706
+ //# sourceMappingURL=chunk-7ORA5BPW.js.map