@wistia/ui 0.14.19 → 0.14.20

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.
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.14.19
3
+ * @license @wistia/ui v0.14.20
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -16384,12 +16384,16 @@ var getCoverProps = (viewerWidth, viewerHeight, scaledWidth, scaledHeight) => {
16384
16384
  left
16385
16385
  };
16386
16386
  };
16387
- var getFramePosition = (frameIndex, framesPerRow, width, height, scaleFactor) => {
16387
+ var getFramePosition = (frameIndex, framesPerRow, width, height, scaleFactor, frameCount, targetHeight) => {
16388
16388
  const col = frameIndex % framesPerRow;
16389
16389
  const row = Math.floor(frameIndex / framesPerRow);
16390
16390
  const imageX = -width * col * scaleFactor;
16391
16391
  const imageY = -height * row * scaleFactor;
16392
- return `${imageX}px ${imageY}px`;
16392
+ const rows = Math.ceil(frameCount / framesPerRow);
16393
+ const frameHeightInStoryboard = height / rows;
16394
+ const verticalCenterOffset = (targetHeight - frameHeightInStoryboard) / 2;
16395
+ const adjustedY = imageY - verticalCenterOffset;
16396
+ return `${imageX}px ${adjustedY}px`;
16393
16397
  };
16394
16398
  var ThumbnailStoryboardViewer = ({
16395
16399
  storyboardUrl,
@@ -16400,6 +16404,7 @@ var ThumbnailStoryboardViewer = ({
16400
16404
  frameCount,
16401
16405
  percent,
16402
16406
  targetWidth = 200,
16407
+ targetHeight,
16403
16408
  targetAspectRatio,
16404
16409
  scaleFactor = 1,
16405
16410
  framesPerRow = 10,
@@ -16408,10 +16413,11 @@ var ThumbnailStoryboardViewer = ({
16408
16413
  }) => {
16409
16414
  const originalAspectRatio = frameWidth / frameHeight;
16410
16415
  const effectiveTargetAspectRatio = targetAspectRatio ?? originalAspectRatio;
16411
- const targetHeight = targetWidth / effectiveTargetAspectRatio;
16416
+ const calculatedHeight = targetWidth / effectiveTargetAspectRatio;
16417
+ const finalHeight = targetHeight ?? calculatedHeight;
16412
16418
  const viewerDimensions = {
16413
16419
  viewerWidth: targetWidth,
16414
- viewerHeight: targetHeight
16420
+ viewerHeight: finalHeight
16415
16421
  };
16416
16422
  const { scaledHeight, scaledWidth } = getScaledDimensions(
16417
16423
  originalAspectRatio,
@@ -16431,7 +16437,9 @@ var ThumbnailStoryboardViewer = ({
16431
16437
  framesPerRow,
16432
16438
  coverProps.width,
16433
16439
  coverProps.height,
16434
- scaleFactor
16440
+ scaleFactor,
16441
+ frameCount,
16442
+ calculatedHeight
16435
16443
  );
16436
16444
  const scaleFactorFromAspectRatioFit = coverProps.height / frameHeight;
16437
16445
  const scaledStoryboardWidth = storyboardWidth * scaleFactorFromAspectRatioFit * scaleFactor;