@visio-io/design-system 1.8.7 → 1.8.9
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.js +76 -76
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +6734 -6694
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/VideoControlContext.d.ts +8 -54
- package/dist/types/components/VideoPlayer/icons/NofFoundCamera.d.ts +6 -0
- package/package.json +2 -1
|
@@ -1,54 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
interface
|
|
3
|
-
/**
|
|
4
|
-
* Ref to the video element. Used by VideoPlayer to expose the video element.
|
|
5
|
-
*/
|
|
2
|
+
interface VideoControlActions {
|
|
6
3
|
videoRef: React.RefObject<HTMLVideoElement | null>;
|
|
7
|
-
/**
|
|
8
|
-
* Current playback time in seconds.
|
|
9
|
-
*/
|
|
10
|
-
currentTime: number;
|
|
11
|
-
/**
|
|
12
|
-
* Update the current time (triggers seek on the video).
|
|
13
|
-
*/
|
|
14
4
|
setCurrentTime: (time: number) => void;
|
|
15
|
-
/**
|
|
16
|
-
* Whether the video is in live mode (following the live edge).
|
|
17
|
-
*/
|
|
18
|
-
isLive: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Set live mode status.
|
|
21
|
-
*/
|
|
22
5
|
setIsLive: (live: boolean) => void;
|
|
23
|
-
/**
|
|
24
|
-
* Seek the video to a specific time.
|
|
25
|
-
*/
|
|
26
6
|
seekTo: (time: number) => void;
|
|
27
|
-
/**
|
|
28
|
-
* Play the video.
|
|
29
|
-
*/
|
|
30
7
|
play: () => Promise<void>;
|
|
31
|
-
/**
|
|
32
|
-
* Pause the video.
|
|
33
|
-
*/
|
|
34
8
|
pause: () => void;
|
|
35
|
-
/**
|
|
36
|
-
* Toggle play/pause.
|
|
37
|
-
*/
|
|
38
9
|
togglePlay: () => void;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
10
|
+
}
|
|
11
|
+
interface VideoControlState {
|
|
12
|
+
currentTime: number;
|
|
13
|
+
isLive: boolean;
|
|
42
14
|
isPlaying: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Total duration of the video (for seekable content) or seekable end (for streams).
|
|
45
|
-
*/
|
|
46
15
|
duration: number;
|
|
47
|
-
/**
|
|
48
|
-
* Whether the video can be seeked.
|
|
49
|
-
*/
|
|
50
16
|
canSeek: boolean;
|
|
51
17
|
}
|
|
18
|
+
interface VideoControlContextValue extends VideoControlActions, VideoControlState {
|
|
19
|
+
}
|
|
52
20
|
export interface VideoControlProviderProps {
|
|
53
21
|
children: React.ReactNode;
|
|
54
22
|
}
|
|
@@ -74,23 +42,9 @@ export declare const VideoControlProvider: React.FC<VideoControlProviderProps>;
|
|
|
74
42
|
/**
|
|
75
43
|
* Hook to access video control context.
|
|
76
44
|
* Use this hook in components that need to control or observe video state.
|
|
45
|
+
* Returns the merged actions + state for backward compatibility.
|
|
77
46
|
*
|
|
78
47
|
* @returns VideoControlContextValue or null if not inside a VideoControlProvider
|
|
79
|
-
*
|
|
80
|
-
* @example
|
|
81
|
-
* ```tsx
|
|
82
|
-
* function CustomControl() {
|
|
83
|
-
* const videoControl = useVideoControl();
|
|
84
|
-
*
|
|
85
|
-
* if (!videoControl) return null;
|
|
86
|
-
*
|
|
87
|
-
* return (
|
|
88
|
-
* <button onClick={videoControl.togglePlay}>
|
|
89
|
-
* {videoControl.isPlaying ? 'Pause' : 'Play'}
|
|
90
|
-
* </button>
|
|
91
|
-
* );
|
|
92
|
-
* }
|
|
93
|
-
* ```
|
|
94
48
|
*/
|
|
95
49
|
export declare const useVideoControl: () => VideoControlContextValue | null;
|
|
96
50
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visio-io/design-system",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.9",
|
|
4
4
|
"description": "Visio Design System",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"@mui/icons-material": "^7.3.7",
|
|
72
|
+
"@visio-io/design-system": "file:.yalc/@visio-io/design-system",
|
|
72
73
|
"framer-motion": "^12.29.2",
|
|
73
74
|
"supercluster": "^8.0.1"
|
|
74
75
|
},
|