@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,4 +1,5 @@
1
1
  declare const SCENE_VERSION: 1;
2
+ declare const SCENE_SCHEMA_VERSION: 2;
2
3
  /** Default canvas width in pixels. */
3
4
  declare const DEFAULT_CANVAS_WIDTH: 800;
4
5
  /** Default canvas height in pixels. */
@@ -9,12 +10,8 @@ declare const DEFAULT_FONT_SIZE: 80;
9
10
  declare const DEFAULT_FPS: 30;
10
11
  /** Default timeline duration in seconds for new scenes. */
11
12
  declare const DEFAULT_DURATION: 2;
12
- type EffectLayerType = "panel" | "glow" | "shadow" | "extrusion" | "duplicateStack" | "stroke" | "fill" | "mask" | "filter" | "customEngine";
13
+ type EffectLayerType = "panel" | "glow" | "shadow" | "extrusion" | "duplicateStack" | "stroke" | "fill" | "mask" | "filter";
13
14
  type LayerTarget = "text" | "panel" | "scene" | "previous";
14
- type CustomEngineId = "ink";
15
- declare const CUSTOM_ENGINE_IDS: CustomEngineId[];
16
- declare const LEGACY_RENDERER_MAP: Record<string, CustomEngineId>;
17
- declare const ENGINE_ID_TO_LEGACY: Record<CustomEngineId, string>;
18
15
  interface CanvasBackgroundConfig {
19
16
  type: "solid" | "gradient" | "shader" | "media";
20
17
  color?: string;
@@ -87,14 +84,23 @@ interface Timeline {
87
84
  }
88
85
  interface SceneDocument {
89
86
  version: typeof SCENE_VERSION;
87
+ /** Canonical wire/schema version. `version` is retained for legacy callers. */
88
+ schemaVersion?: typeof SCENE_SCHEMA_VERSION;
90
89
  effectName: string;
91
90
  canvas: SceneCanvas;
92
91
  text: SceneText;
93
92
  effectLayers: EffectLayer[];
94
- customEngineId: CustomEngineId | null;
95
- engineParams?: Record<string, unknown>;
96
93
  compositor: CompositorSettings;
97
94
  timeline: Timeline;
95
+ /** Immutable catalog identity when this scene is published. */
96
+ revision?: {
97
+ assetId: string;
98
+ revisionId: string;
99
+ schemaVersion: number;
100
+ contentHash: string;
101
+ rendererVersion: string;
102
+ createdAt: string;
103
+ };
98
104
  /** Legacy flat config cache for gradual UI migration */
99
105
  legacyConfig?: TextEffectConfig;
100
106
  /** Deep Research extension snippet (not executed until sandboxed) */
@@ -107,7 +113,6 @@ interface StyleRecipe {
107
113
  layers: EffectLayer[];
108
114
  exposed: string[];
109
115
  tags: string[];
110
- customEngineId?: CustomEngineId | null;
111
116
  scene?: SceneDocument;
112
117
  }
113
118
  declare function createEmptyScene(overrides?: Partial<SceneDocument>): SceneDocument;
@@ -135,6 +140,10 @@ interface TextEffectConfig {
135
140
  fontSize: number;
136
141
  letterSpacing: number;
137
142
  lineHeight: number;
143
+ fireFlameHeight?: number;
144
+ iceIcicleHeight?: number;
145
+ iceSnowHeight?: number;
146
+ auraReach?: number;
138
147
  fillType: "solid" | "linear" | "radial" | "pattern" | "none";
139
148
  fillColor: string;
140
149
  fillGradientAngle: number;
@@ -202,14 +211,6 @@ interface TextEffectConfig {
202
211
  autoFitText?: boolean;
203
212
  /** Wrap long lines to composition safe width */
204
213
  wrapText?: boolean;
205
- inkColor?: string;
206
- bristleDensity?: number;
207
- bristleSkipRate?: number;
208
- dripRate?: number;
209
- dripMaxLength?: number;
210
- grainDensity?: number;
211
- skewX?: number;
212
- customRenderer?: string;
213
214
  }
214
215
  interface Preset {
215
216
  id: string;
@@ -225,6 +226,15 @@ interface EffectIndexItem {
225
226
  id: string;
226
227
  name: string;
227
228
  category: string;
229
+ schemaVersion?: number;
230
+ revisionId?: string;
231
+ contentHash?: string;
232
+ rendererVersion?: string;
233
+ revision?: {
234
+ revisionId?: string;
235
+ contentHash?: string;
236
+ rendererVersion?: string;
237
+ };
228
238
  description?: string;
229
239
  tags?: string[];
230
240
  isPremium?: boolean;
@@ -235,6 +245,7 @@ interface EffectIndexItem {
235
245
  durationMs?: number;
236
246
  }
237
247
  interface EffectFill {
248
+ enabled?: boolean;
238
249
  type: "solid" | "linear" | "radial" | "pattern" | "none";
239
250
  color?: string;
240
251
  gradient?: {
@@ -249,6 +260,7 @@ interface EffectFill {
249
260
  charFillColors?: string[];
250
261
  }
251
262
  interface EffectStroke {
263
+ enabled?: boolean;
252
264
  color: string;
253
265
  width: number;
254
266
  position?: "outside" | "center" | "inside";
@@ -261,6 +273,7 @@ interface EffectStroke {
261
273
  fadeRange?: [number, number];
262
274
  }
263
275
  interface EffectShadow {
276
+ enabled?: boolean;
264
277
  type?: "drop" | "inner";
265
278
  color: string;
266
279
  blur: number;
@@ -273,6 +286,7 @@ interface EffectShadow {
273
286
  opacity?: number;
274
287
  }
275
288
  interface EffectBevel {
289
+ enabled?: boolean;
276
290
  depth: number;
277
291
  highlight?: string;
278
292
  highlightColor?: string;
@@ -290,6 +304,7 @@ interface EffectBevel {
290
304
  focalLength?: number;
291
305
  }
292
306
  interface EffectGlow {
307
+ enabled?: boolean;
293
308
  color: string;
294
309
  blur: number;
295
310
  opacity: number;
@@ -298,6 +313,7 @@ interface EffectGlow {
298
313
  spread?: number;
299
314
  }
300
315
  interface EffectPanel {
316
+ enabled?: boolean;
301
317
  color: string;
302
318
  opacity: number;
303
319
  radius: number;
@@ -308,11 +324,13 @@ interface EffectPanel {
308
324
  paddingX?: number;
309
325
  paddingY?: number;
310
326
  stroke?: {
327
+ enabled?: boolean;
311
328
  color: string;
312
329
  width: number;
313
330
  } | null;
314
331
  }
315
332
  interface EffectStack {
333
+ enabled?: boolean;
316
334
  count: number;
317
335
  offsetX: number;
318
336
  offsetY: number;
@@ -323,6 +341,20 @@ interface EffectStack {
323
341
  color4?: string;
324
342
  }
325
343
  interface EffectFullDefinition extends EffectIndexItem {
344
+ schemaVersion?: number;
345
+ revisionId?: string;
346
+ contentHash?: string;
347
+ rendererVersion?: string;
348
+ revision?: {
349
+ assetId: string;
350
+ revisionId: string;
351
+ schemaVersion: number;
352
+ contentHash: string;
353
+ rendererVersion: string;
354
+ createdAt: string;
355
+ };
356
+ /** Canonical scene snapshot published alongside legacy fields. */
357
+ scene?: SceneDocument;
326
358
  version?: string;
327
359
  description: string;
328
360
  tags: string[];
@@ -413,13 +445,26 @@ interface EvaluatedTextLayer {
413
445
  };
414
446
  readonly styleId?: string;
415
447
  }
416
- type TemplateCategory = "lower-third" | "title-card" | "caption" | "callout" | "social" | "countdown";
417
- type AnimationPreset = "fade" | "slide-up" | "slide-down" | "slide-left" | "slide-right" | "scale-in" | "scale-out" | "blur-in" | "blur-out" | "typewriter" | "none";
418
- type TemplateEasingFunction = "linear" | "ease-in-out" | "ease-in" | "ease-out" | "ease";
448
+ type TemplateCategory = "lower-third" | "title-card" | "caption" | "callout" | "social" | "countdown" | "kinetic-type" | "cta" | "credits";
449
+ type AnimationPreset = "fade" | "slide-up" | "slide-down" | "slide-left" | "slide-right" | "scale-in" | "scale-out" | "blur-in" | "blur-out" | "typewriter" | "3d-flip" | "scale-pop" | "track-in" | "wave" | "glitch" | "none";
450
+ type TemplateEasingFunction = "linear" | "ease-in-out" | "ease-in" | "ease-out" | "ease" | "cubic-bezier" | "spring" | "bounce";
451
+ interface BezierControlPoints {
452
+ x1: number;
453
+ y1: number;
454
+ x2: number;
455
+ y2: number;
456
+ }
457
+ interface SpringParams {
458
+ damping?: number;
459
+ stiffness?: number;
460
+ mass?: number;
461
+ }
419
462
  interface TemplateKeyframe<T> {
420
463
  time: number;
421
464
  value: T;
422
465
  easing?: TemplateEasingFunction;
466
+ bezier?: BezierControlPoints;
467
+ spring?: SpringParams;
423
468
  }
424
469
  type AnimatableValue<T> = T | {
425
470
  keyframes: TemplateKeyframe<T>[];
@@ -431,6 +476,79 @@ interface LayerAnimation {
431
476
  outDuration: number;
432
477
  hold: "full" | number;
433
478
  }
479
+ interface TextStyleSpan {
480
+ start: number;
481
+ end: number;
482
+ fontFamily?: string;
483
+ fontSize?: number;
484
+ fontWeight?: number;
485
+ fontStyle?: "normal" | "italic";
486
+ color?: string;
487
+ gradient?: {
488
+ angle: number;
489
+ stops: Array<{
490
+ color: string;
491
+ offset: number;
492
+ }>;
493
+ };
494
+ letterSpacing?: number;
495
+ baselineShift?: number;
496
+ opacity?: number;
497
+ }
498
+ type SplitMode = "character" | "word" | "line";
499
+ type StaggerDirection = "start-to-end" | "end-to-start" | "center-out" | "edges-in" | "random";
500
+ interface TextSplitTransform {
501
+ x?: number;
502
+ y?: number;
503
+ z?: number;
504
+ scale?: number;
505
+ scaleX?: number;
506
+ scaleY?: number;
507
+ rotation?: number;
508
+ rotateX?: number;
509
+ rotateY?: number;
510
+ opacity?: number;
511
+ blur?: number;
512
+ letterSpacingOffset?: number;
513
+ }
514
+ interface TextSplitAnimator {
515
+ splitBy: SplitMode;
516
+ direction: StaggerDirection;
517
+ delayPerUnit: number;
518
+ overlap: number;
519
+ randomSeed?: number;
520
+ initialTransform: TextSplitTransform;
521
+ easing?: TemplateEasingFunction;
522
+ bezier?: BezierControlPoints;
523
+ durationPerUnit?: number;
524
+ }
525
+ type SpatialAnchorPoint = "top-left" | "top-center" | "top-right" | "middle-left" | "center" | "middle-right" | "bottom-left" | "bottom-center" | "bottom-right";
526
+ interface ResponsiveAnchorConfig {
527
+ anchorPoint: SpatialAnchorPoint;
528
+ offsetPercentageX?: number;
529
+ offsetPercentageY?: number;
530
+ pixelOffsetX?: number;
531
+ pixelOffsetY?: number;
532
+ maxWidthPercentage?: number;
533
+ }
534
+ type TemplateVariableType = "string" | "number" | "color" | "boolean" | "timecode" | "counter" | "image" | "dataset-row";
535
+ interface TemplateVariableDefinition {
536
+ key: string;
537
+ label: string;
538
+ type: TemplateVariableType;
539
+ defaultValue: any;
540
+ description?: string;
541
+ category?: "content" | "style" | "timing";
542
+ constraints?: {
543
+ min?: number;
544
+ max?: number;
545
+ options?: Array<{
546
+ label: string;
547
+ value: any;
548
+ }>;
549
+ format?: string;
550
+ };
551
+ }
434
552
  interface TemplateTextLayer {
435
553
  kind: "text";
436
554
  id: string;
@@ -439,6 +557,8 @@ interface TemplateTextLayer {
439
557
  fontSize: AnimatableValue<number>;
440
558
  fontWeight: AnimatableValue<number>;
441
559
  color: AnimatableValue<string>;
560
+ letterSpacing?: AnimatableValue<number>;
561
+ lineHeight?: AnimatableValue<number>;
442
562
  align: "left" | "center" | "right";
443
563
  x: AnimatableValue<number>;
444
564
  y: AnimatableValue<number>;
@@ -462,8 +582,29 @@ interface TemplateTextLayer {
462
582
  backgroundBorderWidth?: AnimatableValue<number>;
463
583
  animation: LayerAnimation;
464
584
  role?: "primary" | "secondary" | "accent" | "none";
585
+ styleRef?: {
586
+ effectId: string;
587
+ revisionId: string;
588
+ contentHash: string;
589
+ snapshot?: SceneDocument;
590
+ parameterOverrides?: Record<string, unknown>;
591
+ };
465
592
  overflow?: "wrap" | "shrink" | "expand-panel" | "clip";
466
593
  verticalAlign?: "top" | "middle" | "bottom";
594
+ /** Explicit layer visibility. Defaults to true. */
595
+ visible?: boolean;
596
+ /** Studio-only UI state; ignored by render/export. */
597
+ _paddingLinked?: boolean;
598
+ /** Per-character and span-level formatting */
599
+ spans?: TextStyleSpan[];
600
+ perCharFillEnabled?: boolean;
601
+ charFillColors?: string[];
602
+ /** Kinetic text splitting animator */
603
+ splitAnimator?: TextSplitAnimator;
604
+ /** Responsive layout anchor across aspect ratios */
605
+ anchor?: ResponsiveAnchorConfig;
606
+ /** Group / Parent identifier for inherited transforms */
607
+ parentId?: string;
467
608
  }
468
609
  interface TemplateShapeLayer {
469
610
  kind: "shape";
@@ -479,7 +620,11 @@ interface TemplateShapeLayer {
479
620
  width: AnimatableValue<number>;
480
621
  height: AnimatableValue<number>;
481
622
  opacity?: AnimatableValue<number>;
623
+ /** Explicit layer visibility. Defaults to true. */
624
+ visible?: boolean;
482
625
  animation: LayerAnimation;
626
+ anchor?: ResponsiveAnchorConfig;
627
+ parentId?: string;
483
628
  }
484
629
  interface TemplateImageLayer {
485
630
  kind: "image";
@@ -490,163 +635,164 @@ interface TemplateImageLayer {
490
635
  width: AnimatableValue<number>;
491
636
  height: AnimatableValue<number>;
492
637
  opacity?: AnimatableValue<number>;
638
+ /** Explicit layer visibility. Defaults to true. */
639
+ visible?: boolean;
493
640
  animation: LayerAnimation;
641
+ anchor?: ResponsiveAnchorConfig;
642
+ parentId?: string;
643
+ }
644
+ interface TemplateFlexLayout {
645
+ type: "flex" | "absolute";
646
+ direction: "row" | "column";
647
+ gap: AnimatableValue<number>;
648
+ alignItems: "start" | "center" | "end" | "stretch";
649
+ justifyContent: "start" | "center" | "end" | "space-between" | "space-around";
650
+ paddingTop?: AnimatableValue<number>;
651
+ paddingRight?: AnimatableValue<number>;
652
+ paddingBottom?: AnimatableValue<number>;
653
+ paddingLeft?: AnimatableValue<number>;
494
654
  }
495
- interface TemplateImageLayer {
496
- kind: "image";
655
+ interface TemplateContainerLayer {
656
+ kind: "container";
497
657
  id: string;
498
- url: string;
658
+ name?: string;
659
+ layout: TemplateFlexLayout;
499
660
  x: AnimatableValue<number>;
500
661
  y: AnimatableValue<number>;
501
- width: AnimatableValue<number>;
502
- height: AnimatableValue<number>;
662
+ width: AnimatableValue<number | "auto">;
663
+ height: AnimatableValue<number | "auto">;
664
+ backgroundColor?: AnimatableValue<string>;
665
+ backgroundOpacity?: AnimatableValue<number>;
666
+ backgroundRadius?: AnimatableValue<number>;
667
+ backgroundBorderColor?: AnimatableValue<string>;
668
+ backgroundBorderWidth?: AnimatableValue<number>;
503
669
  opacity?: AnimatableValue<number>;
670
+ /** Explicit layer visibility. Defaults to true. */
671
+ visible?: boolean;
504
672
  animation: LayerAnimation;
673
+ anchor?: ResponsiveAnchorConfig;
674
+ parentId?: string;
505
675
  }
506
- type TemplateLayer = TemplateTextLayer | TemplateShapeLayer | TemplateImageLayer;
676
+ type TemplateLayer = TemplateTextLayer | TemplateShapeLayer | TemplateImageLayer | TemplateContainerLayer;
507
677
  interface TextTemplate {
508
678
  id: string;
679
+ schemaVersion?: number;
509
680
  label: string;
510
681
  category: TemplateCategory;
511
682
  duration: number;
683
+ fps?: number;
512
684
  canvasWidth: number;
513
685
  canvasHeight: number;
686
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:5";
514
687
  thumbnail?: string;
515
688
  preview?: string;
516
689
  layers: TemplateLayer[];
690
+ variables?: Record<string, TemplateVariableDefinition>;
691
+ dependencies?: Array<{
692
+ effectId: string;
693
+ revisionId: string;
694
+ contentHash: string;
695
+ snapshot?: SceneDocument;
696
+ }>;
517
697
  published?: boolean;
698
+ description?: string;
699
+ tags?: string[];
518
700
  creatorName?: string;
519
701
  creatorLink?: string;
520
702
  }
521
-
522
- declare function renderTextEffectCore(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, cfg: TextEffectConfig): void;
523
- declare class TextEffectRenderer {
524
- static draw(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, cfg: TextEffectConfig, _time?: number): void;
525
- }
526
-
527
- /** Style recipes (layer graphs): see `builtInRecipes` in src/engine/recipes.ts */
528
- declare const defaultConfig: TextEffectConfig;
529
- declare const builtInPresets: Preset[];
530
-
531
- /**
532
- * Font Loader for Lottie-web
533
- *
534
- * This module ensures that font variant names (like "Poppins-Italic") work correctly
535
- * with lottie-web by dynamically creating @font-face rules that map variant names
536
- * to the actual loaded fonts with proper styling.
537
- */
538
- interface FontVariant {
539
- variantName: string;
540
- baseFontFamily: string;
541
- weight: number;
542
- style: "normal" | "italic";
543
- }
544
- /**
545
- * Injects @font-face rules dynamically to create font variant aliases
546
- * This ensures lottie-web can find fonts by their variant names
547
- */
548
- declare function injectFontVariantRules(): void;
549
- /**
550
- * Waits for base fonts to load, then injects variant rules
551
- */
552
- declare function initializeFontSystem(): Promise<void>;
553
- /**
554
- * Checks if a font variant is available for rendering.
555
- * Uses document.fonts.check() which is the correct API for font availability —
556
- * unlike measureText() which silently falls back to the system font and always
557
- * returns a non-zero width regardless of whether the named font loaded.
558
- */
559
- declare function checkFontVariant(variantName: string): boolean;
560
- /**
561
- * Font descriptor for loading.
562
- */
563
- interface FontDescriptor {
564
- family: string;
565
- weight?: string | number;
566
- style?: "normal" | "italic";
567
- }
568
- /**
569
- * Font loading result.
570
- */
571
- interface FontLoadResult {
572
- font: FontDescriptor;
573
- loaded: boolean;
574
- error?: string;
575
- loadTimeMs: number;
576
- }
577
- declare class FontLoader {
578
- private state;
579
- ensureFont(descriptor: FontDescriptor): Promise<FontLoadResult>;
580
- ensureFonts(descriptors: FontDescriptor[]): Promise<FontLoadResult[]>;
581
- waitForFontsReady(): Promise<void>;
582
- isLoaded(descriptor: FontDescriptor): boolean;
583
- getStats(): {
584
- loaded: number;
585
- loading: number;
586
- failed: number;
703
+ /** GPU/GLSL color grading uniform parameters. Keys map to shader uniforms. */
704
+ interface GradingParams {
705
+ exposure?: number;
706
+ brightness?: number;
707
+ contrast?: number;
708
+ saturation?: number;
709
+ temperature?: number;
710
+ tint?: number;
711
+ sepia?: number;
712
+ grayscale?: number;
713
+ hueRotate?: number;
714
+ vignette?: number;
715
+ invert?: number;
716
+ lift?: number;
717
+ highlights?: number;
718
+ shadows?: number;
719
+ whites?: number;
720
+ blacks?: number;
721
+ vibrance?: {
722
+ amount?: number;
723
+ protectedHue?: string;
724
+ [key: string]: number | string | boolean | undefined;
587
725
  };
588
- clear(): void;
589
- private loadFont;
590
- private getFontKey;
591
- private normalizeFontWeight;
592
- }
593
- declare function getFontLoader(): FontLoader;
594
- declare function resetFontLoader(): void;
595
- declare function ensureFontsLoaded(descriptors: FontDescriptor[]): Promise<FontLoadResult[]>;
596
-
597
- declare function resolveCustomEngineId(cfg: TextEffectConfig): CustomEngineId | null;
598
- /** Lossless migration from flat TextEffectConfig to SceneDocument */
599
- declare function textEffectConfigToScene(cfg: TextEffectConfig): SceneDocument;
600
- /** Flatten SceneDocument back to TextEffectConfig for legacy controls and renderer */
601
- declare function sceneToConfig(doc: SceneDocument): TextEffectConfig;
602
- declare function syncCompositorFromScene(doc: SceneDocument): CompositorFromScene;
603
- interface CompositorFromScene {
604
- blur: number;
605
- bloom: number;
606
- bloomThreshold: number;
607
- }
608
- /** Apply engine params from scene onto config without require() */
609
- declare function mergeSceneIntoConfig(doc: SceneDocument, base: TextEffectConfig): TextEffectConfig;
610
- declare function resolveFontFamilyName(fontFamily: string): string;
611
- declare function _buildConfig(effect: TextEffectDefinition, text: string, fontSize: number, canvasWidth: number, canvasHeight: number, time?: number, clipStartTime?: number, clipDuration?: number): TextEffectConfig & {
612
- width: number;
613
- height: number;
614
- };
615
- declare function layerToTextEffectConfig(layer: EvaluatedTextLayer): TextEffectConfig & {
616
- width: number;
617
- height: number;
618
- };
619
-
620
- declare class WebGLCompositor {
621
- private gl;
622
- private program;
623
- private vao;
624
- private texture;
625
- readonly isSupported: boolean;
626
- constructor();
627
- private initProgram;
628
- private compileShader;
629
- renderToContext(targetCtx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, source: HTMLCanvasElement | OffscreenCanvas, settings: CompositorSettings): void;
630
- dispose(): void;
726
+ grain?: {
727
+ amount?: number;
728
+ intensity?: number;
729
+ size?: number;
730
+ roughness?: number;
731
+ [key: string]: number | string | boolean | undefined;
732
+ };
733
+ crossProcess?: {
734
+ amount?: number;
735
+ style?: string;
736
+ [key: string]: number | string | boolean | undefined;
737
+ };
738
+ channelMix?: {
739
+ r: number;
740
+ g: number;
741
+ b: number;
742
+ [key: string]: number | string | boolean;
743
+ };
744
+ duotone?: {
745
+ darkColor: string;
746
+ lightColor: string;
747
+ [key: string]: number | string | boolean;
748
+ };
749
+ splitTone?: {
750
+ shadowColor: string;
751
+ shadowStrength: number;
752
+ highlightColor: string;
753
+ highlightStrength: number;
754
+ balance: number;
755
+ [key: string]: number | string | boolean;
756
+ };
757
+ halation?: {
758
+ color: string;
759
+ threshold: number;
760
+ intensity: number;
761
+ [key: string]: number | string | boolean;
762
+ };
763
+ [key: string]: number | boolean | string | Record<string, number | string | boolean | undefined> | undefined;
764
+ }
765
+ /** Per-clip color adjustment values applied in the ColorAdjustmentsEffect. */
766
+ interface ColorAdjustments {
767
+ exposure?: number;
768
+ brightness?: number;
769
+ contrast?: number;
770
+ saturation?: number;
771
+ temperature?: number;
772
+ tint?: number;
773
+ highlights?: number;
774
+ shadows?: number;
775
+ whites?: number;
776
+ blacks?: number;
777
+ hueRotate?: number;
778
+ hue?: number;
779
+ blur?: number;
780
+ invert?: boolean | number;
781
+ vibrance?: {
782
+ amount?: number;
783
+ protectedHue?: string;
784
+ };
785
+ grain?: {
786
+ amount?: number;
787
+ intensity?: number;
788
+ size?: number;
789
+ roughness?: number;
790
+ };
791
+ crossProcess?: {
792
+ amount?: number;
793
+ style?: string;
794
+ };
795
+ [key: string]: number | boolean | string | Record<string, unknown> | undefined;
631
796
  }
632
797
 
633
- interface EvaluateOptions {
634
- compositor?: WebGLCompositor | null;
635
- skipPostFx?: boolean;
636
- }
637
- /**
638
- * Dispose the shared module-level compositor and release GPU resources.
639
- * Call on hot-module-reload or application teardown to prevent WebGL context leaks.
640
- */
641
- declare function disposeSharedCompositor(): void;
642
- /**
643
- * Single source of truth for rendering a scene at time t.
644
- */
645
- declare function evaluateScene(doc: SceneDocument, time: number, ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, options?: EvaluateOptions): void;
646
- declare function evaluateConfig(cfg: TextEffectConfig, time: number, ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, options?: EvaluateOptions): void;
647
- declare function advanceSceneTime(doc: SceneDocument, steps: number): number;
648
- declare function getSceneTime(doc: SceneDocument): number;
649
- declare function setSceneTime(doc: SceneDocument, time: number): void;
650
- declare function resetSceneTime(doc: SceneDocument): void;
651
-
652
- export { TextEffectRenderer as $, type AnimTrack as A, type EffectShadow as B, CUSTOM_ENGINE_IDS as C, DEFAULT_CANVAS_HEIGHT as D, type EffectLayer as E, type EffectStack as F, type GlowLayer as G, type EffectStroke as H, type EvaluateOptions as I, type EvaluatedTextLayer as J, type Keyframe as K, type FontDescriptor as L, type FontLoadResult as M, FontLoader as N, type FontVariant as O, type Preset as P, LEGACY_RENDERER_MAP as Q, type LayerAnimation as R, type SceneDocument as S, type TextEffectConfig as T, type LayerTarget as U, SCENE_VERSION as V, type SceneCanvas as W, type SceneText as X, type TemplateImageLayer as Y, type TemplateShapeLayer as Z, type TemplateTextLayer as _, type StyleRecipe as a, type Timeline as a0, WebGLCompositor as a1, _buildConfig as a2, advanceSceneTime as a3, builtInPresets as a4, checkFontVariant as a5, createEmptyScene as a6, defaultConfig as a7, disposeSharedCompositor as a8, ensureFontsLoaded as a9, evaluateConfig as aa, evaluateScene as ab, getFontLoader as ac, getSceneTime as ad, initializeFontSystem as ae, injectFontVariantRules as af, layerToTextEffectConfig as ag, mergeSceneIntoConfig as ah, newLayerId as ai, renderTextEffectCore as aj, resetFontLoader as ak, resetSceneTime as al, resolveCustomEngineId as am, resolveFontFamilyName as an, sceneToConfig as ao, setSceneTime as ap, syncCompositorFromScene as aq, textEffectConfigToScene as ar, type TextEffectDefinition as b, type GradientStop as c, type TextTemplate as d, type TemplateLayer as e, type TemplateCategory as f, type AnimatableValue as g, type TemplateEasingFunction as h, type TemplateKeyframe as i, type AnimationPreset as j, type CanvasBackgroundConfig as k, type CompositorFromScene as l, type CompositorSettings as m, type CustomEngineId as n, DEFAULT_CANVAS_WIDTH as o, DEFAULT_DURATION as p, DEFAULT_FONT_SIZE as q, DEFAULT_FPS as r, ENGINE_ID_TO_LEGACY as s, type EffectBevel as t, type EffectFill as u, type EffectFullDefinition as v, type EffectGlow as w, type EffectIndexItem as x, type EffectLayerType as y, type EffectPanel as z };
798
+ export { type TemplateFlexLayout as $, type AnimTrack as A, type BezierControlPoints as B, type CanvasBackgroundConfig as C, DEFAULT_CANVAS_HEIGHT as D, type EffectLayer as E, type EffectLayerType as F, type GlowLayer as G, type EffectPanel as H, type EffectShadow as I, type EffectStack as J, type Keyframe as K, type LayerAnimation as L, type EffectStroke as M, type EvaluatedTextLayer as N, type GradingParams as O, type Preset as P, type LayerTarget as Q, type ResponsiveAnchorConfig as R, type SceneDocument as S, type TextTemplate as T, SCENE_SCHEMA_VERSION as U, SCENE_VERSION as V, type SceneCanvas as W, type SceneText as X, type SpatialAnchorPoint as Y, type StaggerDirection as Z, type TemplateContainerLayer as _, type TemplateLayer as a, type TemplateImageLayer as a0, type TemplateShapeLayer as a1, type TemplateTextLayer as a2, type TemplateVariableType as a3, type TextSplitTransform as a4, type Timeline as a5, createEmptyScene as a6, newLayerId as a7, type TemplateKeyframe as b, type TextStyleSpan as c, type TextSplitAnimator as d, type TemplateVariableDefinition as e, type TextEffectConfig as f, type StyleRecipe as g, type TextEffectDefinition as h, type GradientStop as i, type AnimatableValue as j, type TemplateEasingFunction as k, type SpringParams as l, type TemplateCategory as m, type SplitMode as n, type AnimationPreset as o, type ColorAdjustments as p, type CompositorSettings as q, DEFAULT_CANVAS_WIDTH as r, DEFAULT_DURATION as s, DEFAULT_FONT_SIZE as t, DEFAULT_FPS as u, type EffectBevel as v, type EffectFill as w, type EffectFullDefinition as x, type EffectGlow as y, type EffectIndexItem as z };