@wistia/ui 0.14.18 → 0.14.19-beta.08cecd35.021a981
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 +16 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +16 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.14.
|
|
3
|
+
* @license @wistia/ui v0.14.19-beta.08cecd35.021a981
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -250,17 +250,6 @@ var globalStyleAdjustmentsCss = import_styled_components.css`
|
|
|
250
250
|
list-style: none;
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
-
/* Set shorter line heights on headings and interactive elements */
|
|
254
|
-
h1,
|
|
255
|
-
h2,
|
|
256
|
-
h3,
|
|
257
|
-
h4,
|
|
258
|
-
button,
|
|
259
|
-
input,
|
|
260
|
-
label {
|
|
261
|
-
line-height: 1.1;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
253
|
/* Balance text wrapping on headings */
|
|
265
254
|
|
|
266
255
|
/* h1,
|
|
@@ -11300,7 +11289,7 @@ var Input = (0, import_react47.forwardRef)(
|
|
|
11300
11289
|
rightIcon,
|
|
11301
11290
|
...props
|
|
11302
11291
|
}, externalRef) => {
|
|
11303
|
-
const internalRef = (0, import_react47.useRef)();
|
|
11292
|
+
const internalRef = (0, import_react47.useRef)(null);
|
|
11304
11293
|
const ref = (0, import_type_guards35.isNotNil)(externalRef) && (0, import_type_guards35.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef;
|
|
11305
11294
|
let leftIconToDisplay = leftIcon;
|
|
11306
11295
|
if ((0, import_type_guards35.isNil)(leftIcon) && type === "search") {
|
|
@@ -11323,7 +11312,7 @@ var Input = (0, import_react47.forwardRef)(
|
|
|
11323
11312
|
if ((0, import_type_guards35.isNotNil)(props.onFocus)) {
|
|
11324
11313
|
props.onFocus(event);
|
|
11325
11314
|
}
|
|
11326
|
-
if (autoSelect &&
|
|
11315
|
+
if (autoSelect && type !== "multiline" && ref.current instanceof HTMLInputElement) {
|
|
11327
11316
|
requestAnimationFrame(() => {
|
|
11328
11317
|
ref.current?.select();
|
|
11329
11318
|
});
|
|
@@ -16384,12 +16373,16 @@ var getCoverProps = (viewerWidth, viewerHeight, scaledWidth, scaledHeight) => {
|
|
|
16384
16373
|
left
|
|
16385
16374
|
};
|
|
16386
16375
|
};
|
|
16387
|
-
var getFramePosition = (frameIndex, framesPerRow, width, height, scaleFactor) => {
|
|
16376
|
+
var getFramePosition = (frameIndex, framesPerRow, width, height, scaleFactor, frameCount, targetHeight) => {
|
|
16388
16377
|
const col = frameIndex % framesPerRow;
|
|
16389
16378
|
const row = Math.floor(frameIndex / framesPerRow);
|
|
16390
16379
|
const imageX = -width * col * scaleFactor;
|
|
16391
16380
|
const imageY = -height * row * scaleFactor;
|
|
16392
|
-
|
|
16381
|
+
const rows = Math.ceil(frameCount / framesPerRow);
|
|
16382
|
+
const frameHeightInStoryboard = height / rows;
|
|
16383
|
+
const verticalCenterOffset = (targetHeight - frameHeightInStoryboard) / 2;
|
|
16384
|
+
const adjustedY = imageY - verticalCenterOffset;
|
|
16385
|
+
return `${imageX}px ${adjustedY}px`;
|
|
16393
16386
|
};
|
|
16394
16387
|
var ThumbnailStoryboardViewer = ({
|
|
16395
16388
|
storyboardUrl,
|
|
@@ -16400,6 +16393,7 @@ var ThumbnailStoryboardViewer = ({
|
|
|
16400
16393
|
frameCount,
|
|
16401
16394
|
percent,
|
|
16402
16395
|
targetWidth = 200,
|
|
16396
|
+
targetHeight,
|
|
16403
16397
|
targetAspectRatio,
|
|
16404
16398
|
scaleFactor = 1,
|
|
16405
16399
|
framesPerRow = 10,
|
|
@@ -16408,10 +16402,11 @@ var ThumbnailStoryboardViewer = ({
|
|
|
16408
16402
|
}) => {
|
|
16409
16403
|
const originalAspectRatio = frameWidth / frameHeight;
|
|
16410
16404
|
const effectiveTargetAspectRatio = targetAspectRatio ?? originalAspectRatio;
|
|
16411
|
-
const
|
|
16405
|
+
const calculatedHeight = targetWidth / effectiveTargetAspectRatio;
|
|
16406
|
+
const finalHeight = targetHeight ?? calculatedHeight;
|
|
16412
16407
|
const viewerDimensions = {
|
|
16413
16408
|
viewerWidth: targetWidth,
|
|
16414
|
-
viewerHeight:
|
|
16409
|
+
viewerHeight: finalHeight
|
|
16415
16410
|
};
|
|
16416
16411
|
const { scaledHeight, scaledWidth } = getScaledDimensions(
|
|
16417
16412
|
originalAspectRatio,
|
|
@@ -16431,7 +16426,9 @@ var ThumbnailStoryboardViewer = ({
|
|
|
16431
16426
|
framesPerRow,
|
|
16432
16427
|
coverProps.width,
|
|
16433
16428
|
coverProps.height,
|
|
16434
|
-
scaleFactor
|
|
16429
|
+
scaleFactor,
|
|
16430
|
+
frameCount,
|
|
16431
|
+
calculatedHeight
|
|
16435
16432
|
);
|
|
16436
16433
|
const scaleFactorFromAspectRatioFit = coverProps.height / frameHeight;
|
|
16437
16434
|
const scaledStoryboardWidth = storyboardWidth * scaleFactorFromAspectRatioFit * scaleFactor;
|