@wistia/ui 0.18.1 → 0.18.2-beta.547ab1c7.fdb1aa5
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 +27 -18
- 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 +27 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4118,6 +4118,7 @@ declare const gradients: {
|
|
|
4118
4118
|
};
|
|
4119
4119
|
type GradientNameType = keyof typeof gradients;
|
|
4120
4120
|
|
|
4121
|
+
type AspectRatioType = 'square' | 'wide';
|
|
4121
4122
|
type Storyboard = {
|
|
4122
4123
|
__typename?: string;
|
|
4123
4124
|
aspectRatio: number;
|
|
@@ -4160,6 +4161,11 @@ type ThumbnailProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'> & {
|
|
|
4160
4161
|
* Example: '180px'
|
|
4161
4162
|
*/
|
|
4162
4163
|
height?: string;
|
|
4164
|
+
/**
|
|
4165
|
+
* The aspect ratio of the thumbnail container.
|
|
4166
|
+
* 'wide' maps to 16:9 ratio, 'square' maps to 1:1 ratio.
|
|
4167
|
+
*/
|
|
4168
|
+
aspectRatio?: AspectRatioType;
|
|
4163
4169
|
};
|
|
4164
4170
|
/**
|
|
4165
4171
|
* A `Thumbnail` is a small, reduced-size version of an image or video used as a preview or representative image.
|
|
@@ -4195,6 +4201,11 @@ declare const Thumbnail: react.ForwardRefExoticComponent<Omit<Omit<react.Detaile
|
|
|
4195
4201
|
* Example: '180px'
|
|
4196
4202
|
*/
|
|
4197
4203
|
height?: string;
|
|
4204
|
+
/**
|
|
4205
|
+
* The aspect ratio of the thumbnail container.
|
|
4206
|
+
* 'wide' maps to 16:9 ratio, 'square' maps to 1:1 ratio.
|
|
4207
|
+
*/
|
|
4208
|
+
aspectRatio?: AspectRatioType;
|
|
4198
4209
|
} & react.RefAttributes<HTMLDivElement>>;
|
|
4199
4210
|
|
|
4200
4211
|
type ThumbnailCollageProps = {
|
package/dist/index.d.ts
CHANGED
|
@@ -4118,6 +4118,7 @@ declare const gradients: {
|
|
|
4118
4118
|
};
|
|
4119
4119
|
type GradientNameType = keyof typeof gradients;
|
|
4120
4120
|
|
|
4121
|
+
type AspectRatioType = 'square' | 'wide';
|
|
4121
4122
|
type Storyboard = {
|
|
4122
4123
|
__typename?: string;
|
|
4123
4124
|
aspectRatio: number;
|
|
@@ -4160,6 +4161,11 @@ type ThumbnailProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'> & {
|
|
|
4160
4161
|
* Example: '180px'
|
|
4161
4162
|
*/
|
|
4162
4163
|
height?: string;
|
|
4164
|
+
/**
|
|
4165
|
+
* The aspect ratio of the thumbnail container.
|
|
4166
|
+
* 'wide' maps to 16:9 ratio, 'square' maps to 1:1 ratio.
|
|
4167
|
+
*/
|
|
4168
|
+
aspectRatio?: AspectRatioType;
|
|
4163
4169
|
};
|
|
4164
4170
|
/**
|
|
4165
4171
|
* A `Thumbnail` is a small, reduced-size version of an image or video used as a preview or representative image.
|
|
@@ -4195,6 +4201,11 @@ declare const Thumbnail: react.ForwardRefExoticComponent<Omit<Omit<react.Detaile
|
|
|
4195
4201
|
* Example: '180px'
|
|
4196
4202
|
*/
|
|
4197
4203
|
height?: string;
|
|
4204
|
+
/**
|
|
4205
|
+
* The aspect ratio of the thumbnail container.
|
|
4206
|
+
* 'wide' maps to 16:9 ratio, 'square' maps to 1:1 ratio.
|
|
4207
|
+
*/
|
|
4208
|
+
aspectRatio?: AspectRatioType;
|
|
4198
4209
|
} & react.RefAttributes<HTMLDivElement>>;
|
|
4199
4210
|
|
|
4200
4211
|
type ThumbnailCollageProps = {
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.18.
|
|
3
|
+
* @license @wistia/ui v0.18.2-beta.547ab1c7.fdb1aa5
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -6690,13 +6690,13 @@ var SpeedIcon = (props) => /* @__PURE__ */ jsx168(
|
|
|
6690
6690
|
|
|
6691
6691
|
// src/components/Icon/icons/SpinnerIcon.tsx
|
|
6692
6692
|
import { jsx as jsx169, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
6693
|
-
var SpinnerIcon = (props) => /* @__PURE__ */
|
|
6693
|
+
var SpinnerIcon = (props) => /* @__PURE__ */ jsx169(
|
|
6694
6694
|
"svg",
|
|
6695
6695
|
{
|
|
6696
6696
|
...props,
|
|
6697
6697
|
viewBox: "0 0 24 24",
|
|
6698
6698
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6699
|
-
children: [
|
|
6699
|
+
children: /* @__PURE__ */ jsxs7("g", { children: [
|
|
6700
6700
|
/* @__PURE__ */ jsx169(
|
|
6701
6701
|
"path",
|
|
6702
6702
|
{
|
|
@@ -6714,10 +6714,10 @@ var SpinnerIcon = (props) => /* @__PURE__ */ jsxs7(
|
|
|
6714
6714
|
keyTimes: "0;1",
|
|
6715
6715
|
repeatCount: "indefinite",
|
|
6716
6716
|
type: "rotate",
|
|
6717
|
-
values: "0
|
|
6717
|
+
values: "0 12 12;360 12 12"
|
|
6718
6718
|
}
|
|
6719
6719
|
)
|
|
6720
|
-
]
|
|
6720
|
+
] })
|
|
6721
6721
|
}
|
|
6722
6722
|
);
|
|
6723
6723
|
|
|
@@ -17891,6 +17891,14 @@ var ThumbnailStoryboardViewer = ({
|
|
|
17891
17891
|
|
|
17892
17892
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
17893
17893
|
import { jsx as jsx325, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
17894
|
+
var WIDE_ASPECT_RATIO = 16 / 9;
|
|
17895
|
+
var SQUARE_ASPECT_RATIO = 1;
|
|
17896
|
+
var getAspectRatioValue = (aspectRatio) => {
|
|
17897
|
+
if (aspectRatio === "square") {
|
|
17898
|
+
return SQUARE_ASPECT_RATIO;
|
|
17899
|
+
}
|
|
17900
|
+
return WIDE_ASPECT_RATIO;
|
|
17901
|
+
};
|
|
17894
17902
|
var WideThumbnailImage = styled106.img`
|
|
17895
17903
|
height: 100%;
|
|
17896
17904
|
object-fit: cover;
|
|
@@ -17929,7 +17937,7 @@ var StyledThumbnail = styled106.div`
|
|
|
17929
17937
|
)};
|
|
17930
17938
|
background-position: center center;
|
|
17931
17939
|
background-size: cover;
|
|
17932
|
-
aspect-ratio:
|
|
17940
|
+
aspect-ratio: ${({ $aspectRatio }) => getAspectRatioValue($aspectRatio)};
|
|
17933
17941
|
display: flex;
|
|
17934
17942
|
overflow: hidden;
|
|
17935
17943
|
position: relative;
|
|
@@ -17938,7 +17946,12 @@ var StyledThumbnail = styled106.div`
|
|
|
17938
17946
|
|
|
17939
17947
|
&,
|
|
17940
17948
|
img {
|
|
17941
|
-
border-radius:
|
|
17949
|
+
border-radius: ${({ $aspectRatio }) => {
|
|
17950
|
+
if ($aspectRatio === "square") {
|
|
17951
|
+
return "8%";
|
|
17952
|
+
}
|
|
17953
|
+
return `calc(8% * (9 / 16)) / 8%`;
|
|
17954
|
+
}};
|
|
17942
17955
|
}
|
|
17943
17956
|
`;
|
|
17944
17957
|
var StoryboardRenderer = ({
|
|
@@ -17946,17 +17959,10 @@ var StoryboardRenderer = ({
|
|
|
17946
17959
|
width,
|
|
17947
17960
|
percent,
|
|
17948
17961
|
cursorPosition,
|
|
17949
|
-
isStoryboardReady
|
|
17962
|
+
isStoryboardReady,
|
|
17963
|
+
aspectRatio
|
|
17950
17964
|
}) => {
|
|
17951
|
-
const {
|
|
17952
|
-
url,
|
|
17953
|
-
width: sbWidth,
|
|
17954
|
-
height: sbHeight,
|
|
17955
|
-
frameHeight,
|
|
17956
|
-
frameWidth,
|
|
17957
|
-
frameCount,
|
|
17958
|
-
aspectRatio
|
|
17959
|
-
} = storyboard;
|
|
17965
|
+
const { url, width: sbWidth, height: sbHeight, frameHeight, frameWidth, frameCount } = storyboard;
|
|
17960
17966
|
const targetWidth = isString4(width) ? parseInt(width, 10) : Number(width);
|
|
17961
17967
|
const effectiveCursorPosition = isStoryboardReady ? cursorPosition : null;
|
|
17962
17968
|
return /* @__PURE__ */ jsx325(
|
|
@@ -17970,7 +17976,7 @@ var StoryboardRenderer = ({
|
|
|
17970
17976
|
storyboardHeight: sbHeight,
|
|
17971
17977
|
storyboardUrl: url,
|
|
17972
17978
|
storyboardWidth: sbWidth,
|
|
17973
|
-
targetAspectRatio: aspectRatio,
|
|
17979
|
+
targetAspectRatio: getAspectRatioValue(aspectRatio),
|
|
17974
17980
|
targetWidth
|
|
17975
17981
|
}
|
|
17976
17982
|
);
|
|
@@ -17993,6 +17999,7 @@ var Thumbnail = forwardRef37(
|
|
|
17993
17999
|
children,
|
|
17994
18000
|
storyboard,
|
|
17995
18001
|
height,
|
|
18002
|
+
aspectRatio = "wide",
|
|
17996
18003
|
...props
|
|
17997
18004
|
}, ref) => {
|
|
17998
18005
|
const [percent, setPercent] = useState26(0);
|
|
@@ -18044,6 +18051,7 @@ var Thumbnail = forwardRef37(
|
|
|
18044
18051
|
thumbnailContent = /* @__PURE__ */ jsx325(
|
|
18045
18052
|
StoryboardRenderer,
|
|
18046
18053
|
{
|
|
18054
|
+
aspectRatio,
|
|
18047
18055
|
cursorPosition,
|
|
18048
18056
|
isStoryboardReady,
|
|
18049
18057
|
percent,
|
|
@@ -18067,6 +18075,7 @@ var Thumbnail = forwardRef37(
|
|
|
18067
18075
|
{
|
|
18068
18076
|
ref,
|
|
18069
18077
|
...props,
|
|
18078
|
+
$aspectRatio: aspectRatio,
|
|
18070
18079
|
$backgroundUrl: backgroundUrl,
|
|
18071
18080
|
$gradientBackground: gradientBackground,
|
|
18072
18081
|
$isScrubbable: isScrubbable,
|