@wistia/ui 0.14.41-beta.adfca4a2.a003a17 → 0.14.41-beta.b8671e7e.ecb695f
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 +32 -49
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +30 -47
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.14.41-beta.
|
|
3
|
+
* @license @wistia/ui v0.14.41-beta.b8671e7e.ecb695f
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -7706,7 +7706,7 @@ Icon.displayName = "Icon_UI";
|
|
|
7706
7706
|
// src/components/Link/Link.tsx
|
|
7707
7707
|
var import_react22 = require("react");
|
|
7708
7708
|
var import_styled_components21 = __toESM(require("styled-components"));
|
|
7709
|
-
var
|
|
7709
|
+
var import_react_router = require("react-router");
|
|
7710
7710
|
var import_type_guards14 = require("@wistia/type-guards");
|
|
7711
7711
|
var import_jsx_runtime197 = require("react/jsx-runtime");
|
|
7712
7712
|
var generateHref = (href, type, disabled) => {
|
|
@@ -7761,7 +7761,7 @@ var Link = (0, import_react22.forwardRef)(
|
|
|
7761
7761
|
role,
|
|
7762
7762
|
...props
|
|
7763
7763
|
}, ref) => {
|
|
7764
|
-
const inRouterContext = (0,
|
|
7764
|
+
const inRouterContext = (0, import_react_router.useInRouterContext)();
|
|
7765
7765
|
const to = generateHref(props.href, type, disabled);
|
|
7766
7766
|
const shouldUseReactRouterLink = inRouterContext && type !== "external" && !to?.startsWith("http");
|
|
7767
7767
|
const handleClick = async (event) => {
|
|
@@ -7813,7 +7813,7 @@ var Link = (0, import_react22.forwardRef)(
|
|
|
7813
7813
|
const routerSpecificProps = shouldUseReactRouterLink ? {
|
|
7814
7814
|
// TODO: Using 'any' here due to styled-components typing limitations with RouterLink
|
|
7815
7815
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
|
|
7816
|
-
as:
|
|
7816
|
+
as: import_react_router.Link,
|
|
7817
7817
|
to: to ?? ""
|
|
7818
7818
|
} : {
|
|
7819
7819
|
as: "a",
|
|
@@ -17804,42 +17804,6 @@ var StyledThumbnail = import_styled_components126.default.div`
|
|
|
17804
17804
|
border-radius: calc(8% * (9 / 16)) / 8%;
|
|
17805
17805
|
}
|
|
17806
17806
|
`;
|
|
17807
|
-
var StoryboardRenderer = ({
|
|
17808
|
-
storyboard,
|
|
17809
|
-
height,
|
|
17810
|
-
width,
|
|
17811
|
-
percent,
|
|
17812
|
-
cursorPosition,
|
|
17813
|
-
isStoryboardReady
|
|
17814
|
-
}) => {
|
|
17815
|
-
if (!storyboard || (0, import_type_guards73.isUndefined)(height) || (0, import_type_guards73.isEmptyString)(height)) return null;
|
|
17816
|
-
const {
|
|
17817
|
-
url,
|
|
17818
|
-
width: sbWidth,
|
|
17819
|
-
height: sbHeight,
|
|
17820
|
-
frameHeight,
|
|
17821
|
-
frameWidth,
|
|
17822
|
-
frameCount,
|
|
17823
|
-
aspectRatio
|
|
17824
|
-
} = storyboard;
|
|
17825
|
-
const targetWidth = (0, import_type_guards73.isString)(width) ? parseInt(width, 10) : Number(width);
|
|
17826
|
-
const effectiveCursorPosition = isStoryboardReady ? cursorPosition : null;
|
|
17827
|
-
return /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
17828
|
-
ThumbnailStoryboardViewer,
|
|
17829
|
-
{
|
|
17830
|
-
cursorPosition: effectiveCursorPosition,
|
|
17831
|
-
frameCount,
|
|
17832
|
-
frameHeight,
|
|
17833
|
-
frameWidth,
|
|
17834
|
-
percent,
|
|
17835
|
-
storyboardHeight: sbHeight,
|
|
17836
|
-
storyboardUrl: url,
|
|
17837
|
-
storyboardWidth: sbWidth,
|
|
17838
|
-
targetAspectRatio: aspectRatio,
|
|
17839
|
-
targetWidth
|
|
17840
|
-
}
|
|
17841
|
-
);
|
|
17842
|
-
};
|
|
17843
17807
|
var getRelativeMousePosition = (elem, mouseEvent) => {
|
|
17844
17808
|
const rect = elem.getBoundingClientRect();
|
|
17845
17809
|
const relativeLeft = mouseEvent.clientX - rect.left;
|
|
@@ -17901,19 +17865,38 @@ var Thumbnail = (0, import_react100.forwardRef)(
|
|
|
17901
17865
|
const shouldRenderStoryboard = (0, import_react100.useMemo)(() => {
|
|
17902
17866
|
return Boolean(isScrubbable && isMouseOver && isStoryboardReady);
|
|
17903
17867
|
}, [isScrubbable, isMouseOver, isStoryboardReady]);
|
|
17904
|
-
|
|
17905
|
-
|
|
17906
|
-
|
|
17907
|
-
|
|
17868
|
+
const renderStoryboard = (0, import_react100.useCallback)(() => {
|
|
17869
|
+
if (!storyboard || (0, import_type_guards73.isUndefined)(height) || (0, import_type_guards73.isEmptyString)(height)) return null;
|
|
17870
|
+
const {
|
|
17871
|
+
url,
|
|
17872
|
+
width: sbWidth,
|
|
17873
|
+
height: sbHeight,
|
|
17874
|
+
frameHeight,
|
|
17875
|
+
frameWidth,
|
|
17876
|
+
frameCount,
|
|
17877
|
+
aspectRatio
|
|
17878
|
+
} = storyboard;
|
|
17879
|
+
const targetWidth = (0, import_type_guards73.isString)(width) ? parseInt(width, 10) : Number(width);
|
|
17880
|
+
const effectiveCursorPosition = isStoryboardReady ? cursorPosition : null;
|
|
17881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
17882
|
+
ThumbnailStoryboardViewer,
|
|
17908
17883
|
{
|
|
17909
|
-
cursorPosition,
|
|
17910
|
-
|
|
17911
|
-
|
|
17884
|
+
cursorPosition: effectiveCursorPosition,
|
|
17885
|
+
frameCount,
|
|
17886
|
+
frameHeight,
|
|
17887
|
+
frameWidth,
|
|
17912
17888
|
percent,
|
|
17913
|
-
|
|
17914
|
-
|
|
17889
|
+
storyboardHeight: sbHeight,
|
|
17890
|
+
storyboardUrl: url,
|
|
17891
|
+
storyboardWidth: sbWidth,
|
|
17892
|
+
targetAspectRatio: aspectRatio,
|
|
17893
|
+
targetWidth
|
|
17915
17894
|
}
|
|
17916
17895
|
);
|
|
17896
|
+
}, [storyboard, percent, width, height, cursorPosition, isStoryboardReady]);
|
|
17897
|
+
let thumbnailContent = null;
|
|
17898
|
+
if (shouldRenderStoryboard) {
|
|
17899
|
+
thumbnailContent = renderStoryboard();
|
|
17917
17900
|
} else if ((0, import_type_guards73.isNotNil)(thumbnailUrl)) {
|
|
17918
17901
|
thumbnailContent = /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
17919
17902
|
ThumbnailImage,
|