@shotstack/shotstack-canvas 2.1.4 → 2.1.6

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.
@@ -271,6 +271,11 @@ declare const richCaptionAssetSchema: z.ZodObject<{
271
271
  color: z.ZodDefault<z.ZodString>;
272
272
  opacity: z.ZodDefault<z.ZodNumber>;
273
273
  background: z.ZodOptional<z.ZodString>;
274
+ textDecoration: z.ZodDefault<z.ZodEnum<{
275
+ none: "none";
276
+ underline: "underline";
277
+ "line-through": "line-through";
278
+ }>>;
274
279
  }, z.core.$strip>>;
275
280
  style: z.ZodOptional<z.ZodObject<{
276
281
  wordSpacing: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>, z.ZodString]>>>;
@@ -342,36 +347,47 @@ declare const richCaptionAssetSchema: z.ZodObject<{
342
347
  }, z.core.$strict>>;
343
348
  active: z.ZodOptional<z.ZodObject<{
344
349
  font: z.ZodOptional<z.ZodObject<{
345
- color: z.ZodDefault<z.ZodString>;
350
+ color: z.ZodOptional<z.ZodString>;
346
351
  background: z.ZodOptional<z.ZodString>;
347
- opacity: z.ZodDefault<z.ZodNumber>;
352
+ opacity: z.ZodOptional<z.ZodNumber>;
353
+ textDecoration: z.ZodOptional<z.ZodEnum<{
354
+ none: "none";
355
+ underline: "underline";
356
+ "line-through": "line-through";
357
+ }>>;
348
358
  }, z.core.$strip>>;
349
- stroke: z.ZodOptional<z.ZodObject<{
359
+ stroke: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
350
360
  width: z.ZodOptional<z.ZodNumber>;
351
361
  color: z.ZodOptional<z.ZodString>;
352
362
  opacity: z.ZodOptional<z.ZodNumber>;
353
- }, z.core.$strip>>;
363
+ }, z.core.$strip>, z.ZodLiteral<"none">]>>;
364
+ shadow: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
365
+ offsetX: z.ZodOptional<z.ZodNumber>;
366
+ offsetY: z.ZodOptional<z.ZodNumber>;
367
+ blur: z.ZodOptional<z.ZodNumber>;
368
+ color: z.ZodOptional<z.ZodString>;
369
+ opacity: z.ZodOptional<z.ZodNumber>;
370
+ }, z.core.$strip>, z.ZodLiteral<"none">]>>;
354
371
  scale: z.ZodDefault<z.ZodNumber>;
355
372
  }, z.core.$strict>>;
356
373
  wordAnimation: z.ZodOptional<z.ZodObject<{
357
374
  style: z.ZodDefault<z.ZodEnum<{
358
375
  typewriter: "typewriter";
359
376
  none: "none";
377
+ pop: "pop";
360
378
  karaoke: "karaoke";
361
379
  highlight: "highlight";
362
- pop: "pop";
363
380
  fade: "fade";
364
381
  slide: "slide";
365
382
  bounce: "bounce";
366
383
  }>>;
367
- speed: z.ZodDefault<z.ZodNumber>;
368
384
  direction: z.ZodDefault<z.ZodEnum<{
369
385
  right: "right";
370
386
  left: "left";
371
387
  up: "up";
372
388
  down: "down";
373
389
  }>>;
374
- }, z.core.$strict>>;
390
+ }, z.core.$strip>>;
375
391
  pauseThreshold: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
376
392
  customFonts: z.ZodOptional<z.ZodArray<z.ZodObject<{
377
393
  src: z.ZodString;
@@ -397,6 +413,11 @@ declare const CanvasRichCaptionAssetSchema: z.ZodObject<{
397
413
  color: z.ZodDefault<z.ZodString>;
398
414
  opacity: z.ZodDefault<z.ZodNumber>;
399
415
  background: z.ZodOptional<z.ZodString>;
416
+ textDecoration: z.ZodDefault<z.ZodEnum<{
417
+ none: "none";
418
+ underline: "underline";
419
+ "line-through": "line-through";
420
+ }>>;
400
421
  }, z.core.$strip>>;
401
422
  style: z.ZodOptional<z.ZodObject<{
402
423
  wordSpacing: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>, z.ZodString]>>>;
@@ -468,36 +489,47 @@ declare const CanvasRichCaptionAssetSchema: z.ZodObject<{
468
489
  }, z.core.$strict>>;
469
490
  active: z.ZodOptional<z.ZodObject<{
470
491
  font: z.ZodOptional<z.ZodObject<{
471
- color: z.ZodDefault<z.ZodString>;
492
+ color: z.ZodOptional<z.ZodString>;
472
493
  background: z.ZodOptional<z.ZodString>;
473
- opacity: z.ZodDefault<z.ZodNumber>;
494
+ opacity: z.ZodOptional<z.ZodNumber>;
495
+ textDecoration: z.ZodOptional<z.ZodEnum<{
496
+ none: "none";
497
+ underline: "underline";
498
+ "line-through": "line-through";
499
+ }>>;
474
500
  }, z.core.$strip>>;
475
- stroke: z.ZodOptional<z.ZodObject<{
501
+ stroke: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
476
502
  width: z.ZodOptional<z.ZodNumber>;
477
503
  color: z.ZodOptional<z.ZodString>;
478
504
  opacity: z.ZodOptional<z.ZodNumber>;
479
- }, z.core.$strip>>;
505
+ }, z.core.$strip>, z.ZodLiteral<"none">]>>;
506
+ shadow: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
507
+ offsetX: z.ZodOptional<z.ZodNumber>;
508
+ offsetY: z.ZodOptional<z.ZodNumber>;
509
+ blur: z.ZodOptional<z.ZodNumber>;
510
+ color: z.ZodOptional<z.ZodString>;
511
+ opacity: z.ZodOptional<z.ZodNumber>;
512
+ }, z.core.$strip>, z.ZodLiteral<"none">]>>;
480
513
  scale: z.ZodDefault<z.ZodNumber>;
481
514
  }, z.core.$strict>>;
482
515
  wordAnimation: z.ZodOptional<z.ZodObject<{
483
516
  style: z.ZodDefault<z.ZodEnum<{
484
517
  typewriter: "typewriter";
485
518
  none: "none";
519
+ pop: "pop";
486
520
  karaoke: "karaoke";
487
521
  highlight: "highlight";
488
- pop: "pop";
489
522
  fade: "fade";
490
523
  slide: "slide";
491
524
  bounce: "bounce";
492
525
  }>>;
493
- speed: z.ZodDefault<z.ZodNumber>;
494
526
  direction: z.ZodDefault<z.ZodEnum<{
495
527
  right: "right";
496
528
  left: "left";
497
529
  up: "up";
498
530
  down: "down";
499
531
  }>>;
500
- }, z.core.$strict>>;
532
+ }, z.core.$strip>>;
501
533
  pauseThreshold: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
502
534
  customFonts: z.ZodOptional<z.ZodArray<z.ZodObject<{
503
535
  src: z.ZodString;
@@ -603,6 +635,8 @@ declare function reorderWordsForLine(wordTexts: string[], paragraphDirection: Pa
603
635
  declare function getVisibleText(text: string, visibleCharacters: number, isRTL: boolean): string;
604
636
  declare function mirrorAnimationDirection(direction: "left" | "right" | "up" | "down", isRTL: boolean): "left" | "right" | "up" | "down";
605
637
 
638
+ declare const ASCENT_RATIO = 0.8;
639
+ declare const DESCENT_RATIO = 0.2;
606
640
  interface WordTiming {
607
641
  text: string;
608
642
  start: number;
@@ -709,7 +743,6 @@ type AnimationStyle = "karaoke" | "highlight" | "pop" | "fade" | "slide" | "boun
709
743
  type AnimationDirection = "left" | "right" | "up" | "down";
710
744
  interface WordAnimationConfig {
711
745
  style: AnimationStyle;
712
- speed: number;
713
746
  direction: AnimationDirection;
714
747
  }
715
748
  interface WordAnimationState {
@@ -940,6 +973,7 @@ type DrawOp = {
940
973
  borderRadius: number;
941
974
  padding: number;
942
975
  };
976
+ textDecoration?: "underline" | "line-through";
943
977
  } | {
944
978
  op: "DrawCaptionBackground";
945
979
  x: number;
@@ -1059,8 +1093,6 @@ declare function renderSvgAssetToPng(asset: CanvasSvgAsset, options?: {
1059
1093
  background?: string;
1060
1094
  }): Promise<ResvgRenderResult>;
1061
1095
 
1062
- declare const ASCENT_RATIO = 0.8;
1063
- declare const DESCENT_RATIO = 0.2;
1064
1096
  declare const WORD_BG_OPACITY = 1;
1065
1097
  declare const WORD_BG_BORDER_RADIUS = 4;
1066
1098
  declare const WORD_BG_PADDING_RATIO = 0.12;
@@ -1128,7 +1160,7 @@ interface FrameSchedule {
1128
1160
  uniqueFrameCount: number;
1129
1161
  skipRatio: number;
1130
1162
  }
1131
- declare function createFrameSchedule(layout: CaptionLayout, durationMs: number, fps: number, animationStyle?: AnimationStyle, speed?: number): FrameSchedule;
1163
+ declare function createFrameSchedule(layout: CaptionLayout, durationMs: number, fps: number, animationStyle?: AnimationStyle): FrameSchedule;
1132
1164
 
1133
1165
  interface RichCaptionRendererOptions {
1134
1166
  width: number;