@shotstack/shotstack-canvas 2.1.5 → 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.
@@ -600,23 +600,28 @@ var richCaptionActiveSchema = import_zod2.richCaptionActiveSchema.extend({
600
600
  opacity: import_zod.z.number().min(0).max(1).optional(),
601
601
  textDecoration: import_zod.z.enum(["none", "underline", "line-through"]).optional()
602
602
  }).optional(),
603
- stroke: import_zod.z.object({
604
- width: import_zod.z.number().min(0).optional(),
605
- color: import_zod.z.string().regex(HEX6).optional(),
606
- opacity: import_zod.z.number().min(0).max(1).optional()
607
- }).optional(),
608
- shadow: import_zod.z.object({
609
- offsetX: import_zod.z.number().optional(),
610
- offsetY: import_zod.z.number().optional(),
611
- blur: import_zod.z.number().min(0).optional(),
612
- color: import_zod.z.string().regex(HEX6).optional(),
613
- opacity: import_zod.z.number().min(0).max(1).optional()
614
- }).optional(),
603
+ stroke: import_zod.z.union([
604
+ import_zod.z.object({
605
+ width: import_zod.z.number().min(0).optional(),
606
+ color: import_zod.z.string().regex(HEX6).optional(),
607
+ opacity: import_zod.z.number().min(0).max(1).optional()
608
+ }),
609
+ import_zod.z.literal("none")
610
+ ]).optional(),
611
+ shadow: import_zod.z.union([
612
+ import_zod.z.object({
613
+ offsetX: import_zod.z.number().optional(),
614
+ offsetY: import_zod.z.number().optional(),
615
+ blur: import_zod.z.number().min(0).optional(),
616
+ color: import_zod.z.string().regex(HEX6).optional(),
617
+ opacity: import_zod.z.number().min(0).max(1).optional()
618
+ }),
619
+ import_zod.z.literal("none")
620
+ ]).optional(),
615
621
  scale: import_zod.z.number().min(0.5).max(2).default(1)
616
622
  });
617
- var richCaptionWordAnimationSchema = import_zod2.richCaptionWordAnimationSchema.extend({
623
+ var richCaptionWordAnimationSchema = import_zod.z.object({
618
624
  style: import_zod.z.enum(["karaoke", "highlight", "pop", "fade", "slide", "bounce", "typewriter", "none"]).default("highlight"),
619
- speed: import_zod.z.number().min(0.5).max(2).default(1),
620
625
  direction: import_zod.z.enum(["left", "right", "up", "down"]).default("up")
621
626
  });
622
627
  var richCaptionAssetSchema = import_zod.z.object({
@@ -3045,12 +3050,8 @@ function calculateWordProgress(ctx) {
3045
3050
  function isWordActive(ctx) {
3046
3051
  return ctx.currentTime >= ctx.wordStart && ctx.currentTime < ctx.wordEnd;
3047
3052
  }
3048
- function calculateKaraokeState(ctx, speed) {
3053
+ function calculateKaraokeState(ctx) {
3049
3054
  const isActive = isWordActive(ctx);
3050
- const wordDuration = ctx.wordEnd - ctx.wordStart;
3051
- const adjustedDuration = wordDuration / speed;
3052
- const adjustedEnd = ctx.wordStart + adjustedDuration;
3053
- const adjustedCtx = { ...ctx, wordEnd: adjustedEnd };
3054
3055
  if (ctx.currentTime < ctx.wordStart) {
3055
3056
  return {
3056
3057
  fillProgress: 0,
@@ -3058,7 +3059,7 @@ function calculateKaraokeState(ctx, speed) {
3058
3059
  opacity: 1
3059
3060
  };
3060
3061
  }
3061
- if (ctx.currentTime >= adjustedEnd) {
3062
+ if (ctx.currentTime >= ctx.wordEnd) {
3062
3063
  return {
3063
3064
  fillProgress: 1,
3064
3065
  isActive: false,
@@ -3066,7 +3067,7 @@ function calculateKaraokeState(ctx, speed) {
3066
3067
  };
3067
3068
  }
3068
3069
  return {
3069
- fillProgress: calculateWordProgress(adjustedCtx),
3070
+ fillProgress: calculateWordProgress(ctx),
3070
3071
  isActive,
3071
3072
  opacity: 1
3072
3073
  };
@@ -3079,7 +3080,7 @@ function calculateHighlightState(ctx) {
3079
3080
  opacity: 1
3080
3081
  };
3081
3082
  }
3082
- function calculatePopState(ctx, activeScale, speed) {
3083
+ function calculatePopState(ctx, activeScale) {
3083
3084
  if (ctx.currentTime < ctx.wordStart) {
3084
3085
  return {
3085
3086
  scale: 0.5,
@@ -3088,9 +3089,7 @@ function calculatePopState(ctx, activeScale, speed) {
3088
3089
  fillProgress: 0
3089
3090
  };
3090
3091
  }
3091
- const adjustedDuration = ctx.animationDuration / speed;
3092
- const adjustedCtx = { ...ctx, animationDuration: adjustedDuration };
3093
- const progress = calculateAnimationProgress(adjustedCtx);
3092
+ const progress = calculateAnimationProgress(ctx);
3094
3093
  const easedProgress = easeOutBack(progress);
3095
3094
  const startScale = 0.5;
3096
3095
  const isActive = isWordActive(ctx);
@@ -3103,7 +3102,7 @@ function calculatePopState(ctx, activeScale, speed) {
3103
3102
  fillProgress: isActive ? 1 : 0
3104
3103
  };
3105
3104
  }
3106
- function calculateFadeState(ctx, speed) {
3105
+ function calculateFadeState(ctx) {
3107
3106
  if (ctx.currentTime < ctx.wordStart) {
3108
3107
  return {
3109
3108
  opacity: 0,
@@ -3111,9 +3110,7 @@ function calculateFadeState(ctx, speed) {
3111
3110
  fillProgress: 0
3112
3111
  };
3113
3112
  }
3114
- const adjustedDuration = ctx.animationDuration / speed;
3115
- const adjustedCtx = { ...ctx, animationDuration: adjustedDuration };
3116
- const progress = calculateAnimationProgress(adjustedCtx);
3113
+ const progress = calculateAnimationProgress(ctx);
3117
3114
  const easedProgress = easeInOutQuad(progress);
3118
3115
  const isActive = isWordActive(ctx);
3119
3116
  return {
@@ -3122,7 +3119,7 @@ function calculateFadeState(ctx, speed) {
3122
3119
  fillProgress: isActive ? 1 : 0
3123
3120
  };
3124
3121
  }
3125
- function calculateSlideState(ctx, direction, speed, fontSize) {
3122
+ function calculateSlideState(ctx, direction, fontSize) {
3126
3123
  const slideDistance = fontSize * 1.5;
3127
3124
  if (ctx.currentTime < ctx.wordStart) {
3128
3125
  const offset2 = getDirectionOffset(direction, slideDistance);
@@ -3134,9 +3131,7 @@ function calculateSlideState(ctx, direction, speed, fontSize) {
3134
3131
  fillProgress: 0
3135
3132
  };
3136
3133
  }
3137
- const adjustedDuration = ctx.animationDuration / speed;
3138
- const adjustedCtx = { ...ctx, animationDuration: adjustedDuration };
3139
- const progress = calculateAnimationProgress(adjustedCtx);
3134
+ const progress = calculateAnimationProgress(ctx);
3140
3135
  const easedProgress = easeOutCirc(progress);
3141
3136
  const offset = getDirectionOffset(direction, slideDistance);
3142
3137
  const translateX = offset.x * (1 - easedProgress);
@@ -3162,7 +3157,7 @@ function getDirectionOffset(direction, distance) {
3162
3157
  return { x: 0, y: -distance };
3163
3158
  }
3164
3159
  }
3165
- function calculateBounceState(ctx, speed, fontSize) {
3160
+ function calculateBounceState(ctx, fontSize) {
3166
3161
  const bounceDistance = fontSize * 0.8;
3167
3162
  if (ctx.currentTime < ctx.wordStart) {
3168
3163
  return {
@@ -3172,9 +3167,7 @@ function calculateBounceState(ctx, speed, fontSize) {
3172
3167
  fillProgress: 0
3173
3168
  };
3174
3169
  }
3175
- const adjustedDuration = ctx.animationDuration / speed;
3176
- const adjustedCtx = { ...ctx, animationDuration: adjustedDuration };
3177
- const progress = calculateAnimationProgress(adjustedCtx);
3170
+ const progress = calculateAnimationProgress(ctx);
3178
3171
  const easedProgress = easeOutBounce(progress);
3179
3172
  const isActive = isWordActive(ctx);
3180
3173
  return {
@@ -3184,11 +3177,7 @@ function calculateBounceState(ctx, speed, fontSize) {
3184
3177
  fillProgress: isActive ? 1 : 0
3185
3178
  };
3186
3179
  }
3187
- function calculateTypewriterState(ctx, charCount, speed) {
3188
- const wordDuration = ctx.wordEnd - ctx.wordStart;
3189
- const adjustedDuration = wordDuration / speed;
3190
- const adjustedEnd = ctx.wordStart + adjustedDuration;
3191
- const adjustedCtx = { ...ctx, wordEnd: adjustedEnd };
3180
+ function calculateTypewriterState(ctx, charCount) {
3192
3181
  if (ctx.currentTime < ctx.wordStart) {
3193
3182
  return {
3194
3183
  visibleCharacters: 0,
@@ -3197,7 +3186,7 @@ function calculateTypewriterState(ctx, charCount, speed) {
3197
3186
  fillProgress: 0
3198
3187
  };
3199
3188
  }
3200
- if (ctx.currentTime >= adjustedEnd) {
3189
+ if (ctx.currentTime >= ctx.wordEnd) {
3201
3190
  return {
3202
3191
  visibleCharacters: charCount,
3203
3192
  opacity: 1,
@@ -3205,7 +3194,7 @@ function calculateTypewriterState(ctx, charCount, speed) {
3205
3194
  fillProgress: 0
3206
3195
  };
3207
3196
  }
3208
- const progress = calculateWordProgress(adjustedCtx);
3197
+ const progress = calculateWordProgress(ctx);
3209
3198
  const visibleCharacters = Math.ceil(progress * charCount);
3210
3199
  const isActive = isWordActive(ctx);
3211
3200
  return {
@@ -3223,7 +3212,6 @@ function calculateNoneState(_ctx) {
3223
3212
  };
3224
3213
  }
3225
3214
  function calculateWordAnimationState(wordStart, wordEnd, currentTime, config, activeScale = 1, charCount = 0, fontSize = 48, isRTL = false) {
3226
- const safeSpeed = config.speed > 0 ? config.speed : 1;
3227
3215
  const ctx = {
3228
3216
  wordStart,
3229
3217
  wordEnd,
@@ -3234,27 +3222,27 @@ function calculateWordAnimationState(wordStart, wordEnd, currentTime, config, ac
3234
3222
  let partialState;
3235
3223
  switch (config.style) {
3236
3224
  case "karaoke":
3237
- partialState = calculateKaraokeState(ctx, safeSpeed);
3225
+ partialState = calculateKaraokeState(ctx);
3238
3226
  break;
3239
3227
  case "highlight":
3240
3228
  partialState = calculateHighlightState(ctx);
3241
3229
  break;
3242
3230
  case "pop":
3243
- partialState = calculatePopState(ctx, activeScale, safeSpeed);
3231
+ partialState = calculatePopState(ctx, activeScale);
3244
3232
  break;
3245
3233
  case "fade":
3246
- partialState = calculateFadeState(ctx, safeSpeed);
3234
+ partialState = calculateFadeState(ctx);
3247
3235
  break;
3248
3236
  case "slide": {
3249
3237
  const slideDir = mirrorAnimationDirection(config.direction, isRTL);
3250
- partialState = calculateSlideState(ctx, slideDir, config.speed, fontSize);
3238
+ partialState = calculateSlideState(ctx, slideDir, fontSize);
3251
3239
  break;
3252
3240
  }
3253
3241
  case "bounce":
3254
- partialState = calculateBounceState(ctx, safeSpeed, fontSize);
3242
+ partialState = calculateBounceState(ctx, fontSize);
3255
3243
  break;
3256
3244
  case "typewriter":
3257
- partialState = calculateTypewriterState(ctx, charCount, safeSpeed);
3245
+ partialState = calculateTypewriterState(ctx, charCount);
3258
3246
  break;
3259
3247
  case "none":
3260
3248
  default:
@@ -3287,7 +3275,6 @@ function calculateAnimationStatesForGroup(words, currentTime, config, activeScal
3287
3275
  function getDefaultAnimationConfig() {
3288
3276
  return {
3289
3277
  style: "highlight",
3290
- speed: 1,
3291
3278
  direction: "up"
3292
3279
  };
3293
3280
  }
@@ -3328,18 +3315,17 @@ function extractFontConfig(asset) {
3328
3315
  function extractStrokeConfig(asset, isActive) {
3329
3316
  const baseStroke = asset.stroke;
3330
3317
  const activeStroke = asset.active?.stroke;
3331
- if (!baseStroke && !activeStroke) {
3332
- return void 0;
3333
- }
3334
3318
  if (isActive) {
3335
- if (!activeStroke) {
3319
+ if (activeStroke === "none") {
3336
3320
  return void 0;
3337
3321
  }
3338
- return {
3339
- width: activeStroke.width ?? baseStroke?.width ?? 0,
3340
- color: activeStroke.color ?? baseStroke?.color ?? "#000000",
3341
- opacity: activeStroke.opacity ?? baseStroke?.opacity ?? 1
3342
- };
3322
+ if (activeStroke && typeof activeStroke === "object") {
3323
+ return {
3324
+ width: activeStroke.width ?? baseStroke?.width ?? 0,
3325
+ color: activeStroke.color ?? baseStroke?.color ?? "#000000",
3326
+ opacity: activeStroke.opacity ?? baseStroke?.opacity ?? 1
3327
+ };
3328
+ }
3343
3329
  }
3344
3330
  if (baseStroke) {
3345
3331
  return {
@@ -3353,20 +3339,19 @@ function extractStrokeConfig(asset, isActive) {
3353
3339
  function extractShadowConfig(asset, isActive) {
3354
3340
  const baseShadow = asset.shadow;
3355
3341
  const activeShadow = asset.active?.shadow;
3356
- if (!baseShadow && !activeShadow) {
3357
- return void 0;
3358
- }
3359
3342
  if (isActive) {
3360
- if (!activeShadow) {
3343
+ if (activeShadow === "none") {
3361
3344
  return void 0;
3362
3345
  }
3363
- return {
3364
- offsetX: activeShadow.offsetX ?? baseShadow?.offsetX ?? 0,
3365
- offsetY: activeShadow.offsetY ?? baseShadow?.offsetY ?? 0,
3366
- blur: activeShadow.blur ?? baseShadow?.blur ?? 0,
3367
- color: activeShadow.color ?? baseShadow?.color ?? "#000000",
3368
- opacity: activeShadow.opacity ?? baseShadow?.opacity ?? 0.5
3369
- };
3346
+ if (activeShadow && typeof activeShadow === "object") {
3347
+ return {
3348
+ offsetX: activeShadow.offsetX ?? baseShadow?.offsetX ?? 0,
3349
+ offsetY: activeShadow.offsetY ?? baseShadow?.offsetY ?? 0,
3350
+ blur: activeShadow.blur ?? baseShadow?.blur ?? 0,
3351
+ color: activeShadow.color ?? baseShadow?.color ?? "#000000",
3352
+ opacity: activeShadow.opacity ?? baseShadow?.opacity ?? 0.5
3353
+ };
3354
+ }
3370
3355
  }
3371
3356
  if (baseShadow) {
3372
3357
  return {
@@ -3382,7 +3367,12 @@ function extractShadowConfig(asset, isActive) {
3382
3367
  function extractBackgroundConfig(asset, isActive, fontSize) {
3383
3368
  const fontBackground = asset.font?.background;
3384
3369
  const activeBackground = asset.active?.font?.background;
3385
- const bgColor = isActive && activeBackground ? activeBackground : fontBackground;
3370
+ let bgColor;
3371
+ if (isActive) {
3372
+ bgColor = activeBackground ?? fontBackground;
3373
+ } else {
3374
+ bgColor = fontBackground;
3375
+ }
3386
3376
  if (!bgColor) {
3387
3377
  return void 0;
3388
3378
  }
@@ -3450,7 +3440,6 @@ function extractAnimationConfig(asset) {
3450
3440
  }
3451
3441
  return {
3452
3442
  style: wordAnim.style ?? "highlight",
3453
- speed: wordAnim.speed ?? 1,
3454
3443
  direction: wordAnim.direction ?? "up"
3455
3444
  };
3456
3445
  }
@@ -5870,7 +5859,7 @@ function findActiveWordIndex(store, groupWordIndices, timeMs) {
5870
5859
  }
5871
5860
  return -1;
5872
5861
  }
5873
- function getAnimationPhase(store, groupWordIndices, timeMs, animationStyle, speed) {
5862
+ function getAnimationPhase(store, groupWordIndices, timeMs, animationStyle) {
5874
5863
  if (groupWordIndices.length === 0) {
5875
5864
  return "idle";
5876
5865
  }
@@ -5887,7 +5876,7 @@ function getAnimationPhase(store, groupWordIndices, timeMs, animationStyle, spee
5887
5876
  return "after";
5888
5877
  }
5889
5878
  if (TRANSITION_ANIMATION_STYLES.has(animationStyle)) {
5890
- const transitionDurationMs = (ANIMATION_DURATION_MS[animationStyle] ?? 200) / speed;
5879
+ const transitionDurationMs = ANIMATION_DURATION_MS[animationStyle] ?? 200;
5891
5880
  for (const idx of groupWordIndices) {
5892
5881
  const wordStart = store.startTimes[idx];
5893
5882
  if (timeMs >= wordStart && timeMs < wordStart + transitionDurationMs) {
@@ -5909,7 +5898,7 @@ function getAnimationPhase(store, groupWordIndices, timeMs, animationStyle, spee
5909
5898
  }
5910
5899
  return "before";
5911
5900
  }
5912
- function computeStateSignature(layout, timeMs, animationStyle, speed) {
5901
+ function computeStateSignature(layout, timeMs, animationStyle) {
5913
5902
  const groupIndex = findGroupIndexAtTime(layout.groups, timeMs);
5914
5903
  if (groupIndex === -1) {
5915
5904
  return { groupIndex: -1, activeWordIndex: -1, animationPhase: "idle" };
@@ -5920,21 +5909,20 @@ function computeStateSignature(layout, timeMs, animationStyle, speed) {
5920
5909
  layout.store,
5921
5910
  group.wordIndices,
5922
5911
  timeMs,
5923
- animationStyle,
5924
- speed
5912
+ animationStyle
5925
5913
  );
5926
5914
  return { groupIndex, activeWordIndex, animationPhase };
5927
5915
  }
5928
5916
  function signaturesMatch(a, b) {
5929
5917
  return a.groupIndex === b.groupIndex && a.activeWordIndex === b.activeWordIndex && a.animationPhase === b.animationPhase;
5930
5918
  }
5931
- function createFrameSchedule(layout, durationMs, fps, animationStyle = "highlight", speed = 1) {
5919
+ function createFrameSchedule(layout, durationMs, fps, animationStyle = "highlight") {
5932
5920
  const totalFrames = Math.max(2, Math.round(durationMs / 1e3 * fps) + 1);
5933
5921
  const renderFrames = [];
5934
5922
  let previousSignature = null;
5935
5923
  for (let frame = 0; frame < totalFrames; frame++) {
5936
5924
  const timeMs = frame / (totalFrames - 1) * durationMs;
5937
- const signature = computeStateSignature(layout, timeMs, animationStyle, speed);
5925
+ const signature = computeStateSignature(layout, timeMs, animationStyle);
5938
5926
  const isAnimating = signature.animationPhase === "animating";
5939
5927
  if (isAnimating || previousSignature === null || !signaturesMatch(signature, previousSignature)) {
5940
5928
  renderFrames.push({
@@ -6336,14 +6324,12 @@ var RichCaptionRenderer = class {
6336
6324
  throw new Error("No asset loaded. Call loadAsset() first.");
6337
6325
  }
6338
6326
  const animationStyle = this.extractAnimationStyle();
6339
- const animationSpeed = this.extractAnimationSpeed();
6340
6327
  const durationMs = duration * 1e3;
6341
6328
  const schedule = createFrameSchedule(
6342
6329
  this.currentLayout,
6343
6330
  durationMs,
6344
6331
  this.fps,
6345
- animationStyle,
6346
- animationSpeed
6332
+ animationStyle
6347
6333
  );
6348
6334
  const bgColor = options?.bgColor;
6349
6335
  const hasAlpha = !bgColor;
@@ -6504,13 +6490,11 @@ var RichCaptionRenderer = class {
6504
6490
  throw new Error("No asset loaded. Call loadAsset() first.");
6505
6491
  }
6506
6492
  const animationStyle = this.extractAnimationStyle();
6507
- const animationSpeed = this.extractAnimationSpeed();
6508
6493
  return createFrameSchedule(
6509
6494
  this.currentLayout,
6510
6495
  duration * 1e3,
6511
6496
  this.fps,
6512
- animationStyle,
6513
- animationSpeed
6497
+ animationStyle
6514
6498
  );
6515
6499
  }
6516
6500
  getStats() {
@@ -6548,10 +6532,6 @@ var RichCaptionRenderer = class {
6548
6532
  const wordAnim = this.currentAsset?.wordAnimation;
6549
6533
  return wordAnim?.style ?? "highlight";
6550
6534
  }
6551
- extractAnimationSpeed() {
6552
- const wordAnim = this.currentAsset?.wordAnimation;
6553
- return wordAnim?.speed ?? 1;
6554
- }
6555
6535
  logProgress(pct, framesProcessed, totalFrames, uniqueProcessed, uniqueTotal, fps, eta) {
6556
6536
  if (typeof process !== "undefined" && process.stderr) {
6557
6537
  process.stderr.write(
@@ -356,39 +356,38 @@ declare const richCaptionAssetSchema: z.ZodObject<{
356
356
  "line-through": "line-through";
357
357
  }>>;
358
358
  }, z.core.$strip>>;
359
- stroke: z.ZodOptional<z.ZodObject<{
359
+ stroke: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
360
360
  width: z.ZodOptional<z.ZodNumber>;
361
361
  color: z.ZodOptional<z.ZodString>;
362
362
  opacity: z.ZodOptional<z.ZodNumber>;
363
- }, z.core.$strip>>;
364
- shadow: z.ZodOptional<z.ZodObject<{
363
+ }, z.core.$strip>, z.ZodLiteral<"none">]>>;
364
+ shadow: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
365
365
  offsetX: z.ZodOptional<z.ZodNumber>;
366
366
  offsetY: z.ZodOptional<z.ZodNumber>;
367
367
  blur: z.ZodOptional<z.ZodNumber>;
368
368
  color: z.ZodOptional<z.ZodString>;
369
369
  opacity: z.ZodOptional<z.ZodNumber>;
370
- }, z.core.$strip>>;
370
+ }, z.core.$strip>, z.ZodLiteral<"none">]>>;
371
371
  scale: z.ZodDefault<z.ZodNumber>;
372
372
  }, z.core.$strict>>;
373
373
  wordAnimation: z.ZodOptional<z.ZodObject<{
374
374
  style: z.ZodDefault<z.ZodEnum<{
375
375
  typewriter: "typewriter";
376
376
  none: "none";
377
+ pop: "pop";
377
378
  karaoke: "karaoke";
378
379
  highlight: "highlight";
379
- pop: "pop";
380
380
  fade: "fade";
381
381
  slide: "slide";
382
382
  bounce: "bounce";
383
383
  }>>;
384
- speed: z.ZodDefault<z.ZodNumber>;
385
384
  direction: z.ZodDefault<z.ZodEnum<{
386
385
  right: "right";
387
386
  left: "left";
388
387
  up: "up";
389
388
  down: "down";
390
389
  }>>;
391
- }, z.core.$strict>>;
390
+ }, z.core.$strip>>;
392
391
  pauseThreshold: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
393
392
  customFonts: z.ZodOptional<z.ZodArray<z.ZodObject<{
394
393
  src: z.ZodString;
@@ -499,39 +498,38 @@ declare const CanvasRichCaptionAssetSchema: z.ZodObject<{
499
498
  "line-through": "line-through";
500
499
  }>>;
501
500
  }, z.core.$strip>>;
502
- stroke: z.ZodOptional<z.ZodObject<{
501
+ stroke: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
503
502
  width: z.ZodOptional<z.ZodNumber>;
504
503
  color: z.ZodOptional<z.ZodString>;
505
504
  opacity: z.ZodOptional<z.ZodNumber>;
506
- }, z.core.$strip>>;
507
- shadow: z.ZodOptional<z.ZodObject<{
505
+ }, z.core.$strip>, z.ZodLiteral<"none">]>>;
506
+ shadow: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
508
507
  offsetX: z.ZodOptional<z.ZodNumber>;
509
508
  offsetY: z.ZodOptional<z.ZodNumber>;
510
509
  blur: z.ZodOptional<z.ZodNumber>;
511
510
  color: z.ZodOptional<z.ZodString>;
512
511
  opacity: z.ZodOptional<z.ZodNumber>;
513
- }, z.core.$strip>>;
512
+ }, z.core.$strip>, z.ZodLiteral<"none">]>>;
514
513
  scale: z.ZodDefault<z.ZodNumber>;
515
514
  }, z.core.$strict>>;
516
515
  wordAnimation: z.ZodOptional<z.ZodObject<{
517
516
  style: z.ZodDefault<z.ZodEnum<{
518
517
  typewriter: "typewriter";
519
518
  none: "none";
519
+ pop: "pop";
520
520
  karaoke: "karaoke";
521
521
  highlight: "highlight";
522
- pop: "pop";
523
522
  fade: "fade";
524
523
  slide: "slide";
525
524
  bounce: "bounce";
526
525
  }>>;
527
- speed: z.ZodDefault<z.ZodNumber>;
528
526
  direction: z.ZodDefault<z.ZodEnum<{
529
527
  right: "right";
530
528
  left: "left";
531
529
  up: "up";
532
530
  down: "down";
533
531
  }>>;
534
- }, z.core.$strict>>;
532
+ }, z.core.$strip>>;
535
533
  pauseThreshold: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
536
534
  customFonts: z.ZodOptional<z.ZodArray<z.ZodObject<{
537
535
  src: z.ZodString;
@@ -745,7 +743,6 @@ type AnimationStyle = "karaoke" | "highlight" | "pop" | "fade" | "slide" | "boun
745
743
  type AnimationDirection = "left" | "right" | "up" | "down";
746
744
  interface WordAnimationConfig {
747
745
  style: AnimationStyle;
748
- speed: number;
749
746
  direction: AnimationDirection;
750
747
  }
751
748
  interface WordAnimationState {
@@ -1183,7 +1180,7 @@ interface FrameSchedule {
1183
1180
  uniqueFrameCount: number;
1184
1181
  skipRatio: number;
1185
1182
  }
1186
- declare function createFrameSchedule(layout: CaptionLayout, durationMs: number, fps: number, animationStyle?: AnimationStyle, speed?: number): FrameSchedule;
1183
+ declare function createFrameSchedule(layout: CaptionLayout, durationMs: number, fps: number, animationStyle?: AnimationStyle): FrameSchedule;
1187
1184
 
1188
1185
  interface RichCaptionRendererOptions {
1189
1186
  width: number;
@@ -1252,7 +1249,6 @@ declare class RichCaptionRenderer {
1252
1249
  private mapVerticalAlign;
1253
1250
  private mapHorizontalAlign;
1254
1251
  private extractAnimationStyle;
1255
- private extractAnimationSpeed;
1256
1252
  private logProgress;
1257
1253
  private logCompletion;
1258
1254
  private checkMemoryUsage;
@@ -356,39 +356,38 @@ declare const richCaptionAssetSchema: z.ZodObject<{
356
356
  "line-through": "line-through";
357
357
  }>>;
358
358
  }, z.core.$strip>>;
359
- stroke: z.ZodOptional<z.ZodObject<{
359
+ stroke: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
360
360
  width: z.ZodOptional<z.ZodNumber>;
361
361
  color: z.ZodOptional<z.ZodString>;
362
362
  opacity: z.ZodOptional<z.ZodNumber>;
363
- }, z.core.$strip>>;
364
- shadow: z.ZodOptional<z.ZodObject<{
363
+ }, z.core.$strip>, z.ZodLiteral<"none">]>>;
364
+ shadow: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
365
365
  offsetX: z.ZodOptional<z.ZodNumber>;
366
366
  offsetY: z.ZodOptional<z.ZodNumber>;
367
367
  blur: z.ZodOptional<z.ZodNumber>;
368
368
  color: z.ZodOptional<z.ZodString>;
369
369
  opacity: z.ZodOptional<z.ZodNumber>;
370
- }, z.core.$strip>>;
370
+ }, z.core.$strip>, z.ZodLiteral<"none">]>>;
371
371
  scale: z.ZodDefault<z.ZodNumber>;
372
372
  }, z.core.$strict>>;
373
373
  wordAnimation: z.ZodOptional<z.ZodObject<{
374
374
  style: z.ZodDefault<z.ZodEnum<{
375
375
  typewriter: "typewriter";
376
376
  none: "none";
377
+ pop: "pop";
377
378
  karaoke: "karaoke";
378
379
  highlight: "highlight";
379
- pop: "pop";
380
380
  fade: "fade";
381
381
  slide: "slide";
382
382
  bounce: "bounce";
383
383
  }>>;
384
- speed: z.ZodDefault<z.ZodNumber>;
385
384
  direction: z.ZodDefault<z.ZodEnum<{
386
385
  right: "right";
387
386
  left: "left";
388
387
  up: "up";
389
388
  down: "down";
390
389
  }>>;
391
- }, z.core.$strict>>;
390
+ }, z.core.$strip>>;
392
391
  pauseThreshold: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
393
392
  customFonts: z.ZodOptional<z.ZodArray<z.ZodObject<{
394
393
  src: z.ZodString;
@@ -499,39 +498,38 @@ declare const CanvasRichCaptionAssetSchema: z.ZodObject<{
499
498
  "line-through": "line-through";
500
499
  }>>;
501
500
  }, z.core.$strip>>;
502
- stroke: z.ZodOptional<z.ZodObject<{
501
+ stroke: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
503
502
  width: z.ZodOptional<z.ZodNumber>;
504
503
  color: z.ZodOptional<z.ZodString>;
505
504
  opacity: z.ZodOptional<z.ZodNumber>;
506
- }, z.core.$strip>>;
507
- shadow: z.ZodOptional<z.ZodObject<{
505
+ }, z.core.$strip>, z.ZodLiteral<"none">]>>;
506
+ shadow: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
508
507
  offsetX: z.ZodOptional<z.ZodNumber>;
509
508
  offsetY: z.ZodOptional<z.ZodNumber>;
510
509
  blur: z.ZodOptional<z.ZodNumber>;
511
510
  color: z.ZodOptional<z.ZodString>;
512
511
  opacity: z.ZodOptional<z.ZodNumber>;
513
- }, z.core.$strip>>;
512
+ }, z.core.$strip>, z.ZodLiteral<"none">]>>;
514
513
  scale: z.ZodDefault<z.ZodNumber>;
515
514
  }, z.core.$strict>>;
516
515
  wordAnimation: z.ZodOptional<z.ZodObject<{
517
516
  style: z.ZodDefault<z.ZodEnum<{
518
517
  typewriter: "typewriter";
519
518
  none: "none";
519
+ pop: "pop";
520
520
  karaoke: "karaoke";
521
521
  highlight: "highlight";
522
- pop: "pop";
523
522
  fade: "fade";
524
523
  slide: "slide";
525
524
  bounce: "bounce";
526
525
  }>>;
527
- speed: z.ZodDefault<z.ZodNumber>;
528
526
  direction: z.ZodDefault<z.ZodEnum<{
529
527
  right: "right";
530
528
  left: "left";
531
529
  up: "up";
532
530
  down: "down";
533
531
  }>>;
534
- }, z.core.$strict>>;
532
+ }, z.core.$strip>>;
535
533
  pauseThreshold: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
536
534
  customFonts: z.ZodOptional<z.ZodArray<z.ZodObject<{
537
535
  src: z.ZodString;
@@ -745,7 +743,6 @@ type AnimationStyle = "karaoke" | "highlight" | "pop" | "fade" | "slide" | "boun
745
743
  type AnimationDirection = "left" | "right" | "up" | "down";
746
744
  interface WordAnimationConfig {
747
745
  style: AnimationStyle;
748
- speed: number;
749
746
  direction: AnimationDirection;
750
747
  }
751
748
  interface WordAnimationState {
@@ -1183,7 +1180,7 @@ interface FrameSchedule {
1183
1180
  uniqueFrameCount: number;
1184
1181
  skipRatio: number;
1185
1182
  }
1186
- declare function createFrameSchedule(layout: CaptionLayout, durationMs: number, fps: number, animationStyle?: AnimationStyle, speed?: number): FrameSchedule;
1183
+ declare function createFrameSchedule(layout: CaptionLayout, durationMs: number, fps: number, animationStyle?: AnimationStyle): FrameSchedule;
1187
1184
 
1188
1185
  interface RichCaptionRendererOptions {
1189
1186
  width: number;
@@ -1252,7 +1249,6 @@ declare class RichCaptionRenderer {
1252
1249
  private mapVerticalAlign;
1253
1250
  private mapHorizontalAlign;
1254
1251
  private extractAnimationStyle;
1255
- private extractAnimationSpeed;
1256
1252
  private logProgress;
1257
1253
  private logCompletion;
1258
1254
  private checkMemoryUsage;