@wistia/ui 0.18.1 → 0.18.2
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 +23 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.mjs +23 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.18.
|
|
3
|
+
* @license @wistia/ui v0.18.2
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -18027,6 +18027,14 @@ var ThumbnailStoryboardViewer = ({
|
|
|
18027
18027
|
|
|
18028
18028
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
18029
18029
|
var import_jsx_runtime327 = require("react/jsx-runtime");
|
|
18030
|
+
var WIDE_ASPECT_RATIO = 16 / 9;
|
|
18031
|
+
var SQUARE_ASPECT_RATIO = 1;
|
|
18032
|
+
var getAspectRatioValue = (aspectRatio) => {
|
|
18033
|
+
if (aspectRatio === "square") {
|
|
18034
|
+
return SQUARE_ASPECT_RATIO;
|
|
18035
|
+
}
|
|
18036
|
+
return WIDE_ASPECT_RATIO;
|
|
18037
|
+
};
|
|
18030
18038
|
var WideThumbnailImage = import_styled_components126.styled.img`
|
|
18031
18039
|
height: 100%;
|
|
18032
18040
|
object-fit: cover;
|
|
@@ -18065,7 +18073,7 @@ var StyledThumbnail = import_styled_components126.styled.div`
|
|
|
18065
18073
|
)};
|
|
18066
18074
|
background-position: center center;
|
|
18067
18075
|
background-size: cover;
|
|
18068
|
-
aspect-ratio:
|
|
18076
|
+
aspect-ratio: ${({ $aspectRatio }) => getAspectRatioValue($aspectRatio)};
|
|
18069
18077
|
display: flex;
|
|
18070
18078
|
overflow: hidden;
|
|
18071
18079
|
position: relative;
|
|
@@ -18074,7 +18082,12 @@ var StyledThumbnail = import_styled_components126.styled.div`
|
|
|
18074
18082
|
|
|
18075
18083
|
&,
|
|
18076
18084
|
img {
|
|
18077
|
-
border-radius:
|
|
18085
|
+
border-radius: ${({ $aspectRatio }) => {
|
|
18086
|
+
if ($aspectRatio === "square") {
|
|
18087
|
+
return "8%";
|
|
18088
|
+
}
|
|
18089
|
+
return `calc(8% * (9 / 16)) / 8%`;
|
|
18090
|
+
}};
|
|
18078
18091
|
}
|
|
18079
18092
|
`;
|
|
18080
18093
|
var StoryboardRenderer = ({
|
|
@@ -18082,17 +18095,10 @@ var StoryboardRenderer = ({
|
|
|
18082
18095
|
width,
|
|
18083
18096
|
percent,
|
|
18084
18097
|
cursorPosition,
|
|
18085
|
-
isStoryboardReady
|
|
18098
|
+
isStoryboardReady,
|
|
18099
|
+
aspectRatio
|
|
18086
18100
|
}) => {
|
|
18087
|
-
const {
|
|
18088
|
-
url,
|
|
18089
|
-
width: sbWidth,
|
|
18090
|
-
height: sbHeight,
|
|
18091
|
-
frameHeight,
|
|
18092
|
-
frameWidth,
|
|
18093
|
-
frameCount,
|
|
18094
|
-
aspectRatio
|
|
18095
|
-
} = storyboard;
|
|
18101
|
+
const { url, width: sbWidth, height: sbHeight, frameHeight, frameWidth, frameCount } = storyboard;
|
|
18096
18102
|
const targetWidth = (0, import_type_guards74.isString)(width) ? parseInt(width, 10) : Number(width);
|
|
18097
18103
|
const effectiveCursorPosition = isStoryboardReady ? cursorPosition : null;
|
|
18098
18104
|
return /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
@@ -18106,7 +18112,7 @@ var StoryboardRenderer = ({
|
|
|
18106
18112
|
storyboardHeight: sbHeight,
|
|
18107
18113
|
storyboardUrl: url,
|
|
18108
18114
|
storyboardWidth: sbWidth,
|
|
18109
|
-
targetAspectRatio: aspectRatio,
|
|
18115
|
+
targetAspectRatio: getAspectRatioValue(aspectRatio),
|
|
18110
18116
|
targetWidth
|
|
18111
18117
|
}
|
|
18112
18118
|
);
|
|
@@ -18129,6 +18135,7 @@ var Thumbnail = (0, import_react100.forwardRef)(
|
|
|
18129
18135
|
children,
|
|
18130
18136
|
storyboard,
|
|
18131
18137
|
height,
|
|
18138
|
+
aspectRatio = "wide",
|
|
18132
18139
|
...props
|
|
18133
18140
|
}, ref) => {
|
|
18134
18141
|
const [percent, setPercent] = (0, import_react100.useState)(0);
|
|
@@ -18180,6 +18187,7 @@ var Thumbnail = (0, import_react100.forwardRef)(
|
|
|
18180
18187
|
thumbnailContent = /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
18181
18188
|
StoryboardRenderer,
|
|
18182
18189
|
{
|
|
18190
|
+
aspectRatio,
|
|
18183
18191
|
cursorPosition,
|
|
18184
18192
|
isStoryboardReady,
|
|
18185
18193
|
percent,
|
|
@@ -18203,6 +18211,7 @@ var Thumbnail = (0, import_react100.forwardRef)(
|
|
|
18203
18211
|
{
|
|
18204
18212
|
ref,
|
|
18205
18213
|
...props,
|
|
18214
|
+
$aspectRatio: aspectRatio,
|
|
18206
18215
|
$backgroundUrl: backgroundUrl,
|
|
18207
18216
|
$gradientBackground: gradientBackground,
|
|
18208
18217
|
$isScrubbable: isScrubbable,
|