@appquality/unguess-design-system 2.12.61 → 2.12.63
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
# v2.12.62 (Mon Jan 30 2023)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- Allow external ref for Player component [#192](https://github.com/AppQuality/unguess-design-system/pull/192) ([@cannarocks](https://github.com/cannarocks))
|
|
6
|
+
- feat(player): add forward ref to allow external handling [#191](https://github.com/AppQuality/unguess-design-system/pull/191) ([@cannarocks](https://github.com/cannarocks))
|
|
7
|
+
|
|
8
|
+
#### ⚠️ Pushed to `master`
|
|
9
|
+
|
|
10
|
+
- bump version ([@cannarocks](https://github.com/cannarocks))
|
|
11
|
+
|
|
12
|
+
#### Authors: 1
|
|
13
|
+
|
|
14
|
+
- Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
1
18
|
# v2.12.61 (Fri Jan 27 2023)
|
|
2
19
|
|
|
3
20
|
#### 🐛 Bug Fix
|
package/build/index.js
CHANGED
|
@@ -4375,11 +4375,12 @@ const Video = styled__default["default"].video `
|
|
|
4375
4375
|
* Used for this:
|
|
4376
4376
|
- To display a video
|
|
4377
4377
|
*/
|
|
4378
|
-
const Player = (props) => {
|
|
4378
|
+
const Player = React.forwardRef((props, forwardRef) => {
|
|
4379
4379
|
const videoRef = React.useRef(null);
|
|
4380
4380
|
const [isLoaded, setIsLoaded] = React.useState(false);
|
|
4381
4381
|
const [isPlaying, setIsPlaying] = React.useState(false);
|
|
4382
4382
|
const [duration, setDuration] = React.useState(0);
|
|
4383
|
+
React.useImperativeHandle(forwardRef, () => videoRef.current);
|
|
4383
4384
|
const handleLoad = () => {
|
|
4384
4385
|
var _a;
|
|
4385
4386
|
setIsLoaded(true);
|
|
@@ -4424,7 +4425,7 @@ const Player = (props) => {
|
|
|
4424
4425
|
e.stopPropagation();
|
|
4425
4426
|
handlePlayPause();
|
|
4426
4427
|
} }, { children: [!isLoaded ? (jsxRuntime.jsx(VideoSpinner, {})) : (jsxRuntime.jsx(FloatingControls, { isPlaying: isPlaying })), jsxRuntime.jsx(Video, Object.assign({ ref: videoRef, onLoadedMetadata: handleLoad, preload: "auto", playsInline: true }, { children: props.children })), jsxRuntime.jsx(Controls, { videoRef: videoRef.current, duration: duration, isPlaying: isPlaying, onPlayChange: (isPlaying) => setIsPlaying(isPlaying) })] })));
|
|
4427
|
-
};
|
|
4428
|
+
});
|
|
4428
4429
|
|
|
4429
4430
|
var _path$5;
|
|
4430
4431
|
function _extends$6() { _extends$6 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$6.apply(this, arguments); }
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { PlayerArgs } from "./_types";
|
|
2
3
|
/**
|
|
3
4
|
* The Player is a styled media tag with custom controls
|
|
@@ -5,5 +6,5 @@ import { PlayerArgs } from "./_types";
|
|
|
5
6
|
* Used for this:
|
|
6
7
|
- To display a video
|
|
7
8
|
*/
|
|
8
|
-
declare const Player: (
|
|
9
|
+
declare const Player: import("react").ForwardRefExoticComponent<PlayerArgs & import("react").RefAttributes<HTMLVideoElement>>;
|
|
9
10
|
export { Player };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { ComponentMeta, Story } from "@storybook/react";
|
|
2
3
|
import { PlayerArgs } from "./_types";
|
|
3
4
|
interface PlayerStoryArgs extends PlayerArgs {
|
|
4
5
|
url: string;
|
|
5
6
|
}
|
|
6
7
|
export declare const Basic: Story<PlayerStoryArgs>;
|
|
7
|
-
declare const _default: ComponentMeta<(
|
|
8
|
+
declare const _default: ComponentMeta<import("react").ForwardRefExoticComponent<PlayerArgs & import("react").RefAttributes<HTMLVideoElement>>>;
|
|
8
9
|
export default _default;
|