@fraku/video 0.1.76 → 0.1.78

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.
@@ -1,3 +1,13 @@
1
+ /**
2
+ * Thrown by sendActionSafely after the user has already been notified via toast.
3
+ * DialogsProvider button handlers check for this class to suppress their own
4
+ * generic fallback "action-error" toast, preventing duplicate notifications.
5
+ */
6
+ export declare class AlreadyHandledError extends Error {
7
+ name: string;
8
+ readonly cause: unknown;
9
+ constructor(cause?: unknown);
10
+ }
1
11
  type SafeFunction = {
2
12
  <TResult>(fn: () => Promise<TResult>): Promise<TResult>;
3
13
  <TResult>(fn: () => TResult): TResult;
@@ -0,0 +1 @@
1
+ export {};
@@ -16,7 +16,7 @@ export type CommandChannelContext = {
16
16
  setParticipationVideoRevoked: (value: boolean) => void;
17
17
  setPendingParticipationInvite: (value: ParticipationPermission | null) => void;
18
18
  };
19
- type CommandChannelActionHandler = (action: CommandChannelAction, context: CommandChannelContext) => void;
19
+ type CommandChannelActionHandler = (action: CommandChannelAction, context: CommandChannelContext) => void | Promise<void>;
20
20
  type CommandChannelActionHandlers = {
21
21
  [K in CommandChannelAction['type']]?: CommandChannelActionHandler;
22
22
  };
@@ -27,6 +27,8 @@ export type VideoPluginProviderProps = {
27
27
  onInitVotingSession?: () => Promise<void>;
28
28
  onCloseVotingSession?: () => Promise<void>;
29
29
  onRestartVotingSession?: () => Promise<void>;
30
+ onJoin?: () => void;
31
+ onExit?: () => void;
30
32
  };
31
33
  declare const VideoPluginProvider: import('react').ForwardRefExoticComponent<VideoPluginProviderProps & import('react').RefAttributes<VideoPluginProviderHandle>>;
32
34
  export default VideoPluginProvider;
@@ -21,6 +21,8 @@ export type VideoPluginContextType = {
21
21
  initVotingSession: () => Promise<void>;
22
22
  closeVotingSession: () => Promise<void>;
23
23
  restartSession: () => Promise<void>;
24
+ onJoin?: () => void;
25
+ onExit?: () => void;
24
26
  };
25
27
  export declare const VideoPluginContext: import('react').Context<VideoPluginContextType>;
26
28
  export declare const useVideoPluginContext: () => VideoPluginContextType;
@@ -5,5 +5,7 @@ export type LocalVideoTrack = {
5
5
  stop: () => Promise<void>;
6
6
  switch: (cameraId: string) => Promise<void>;
7
7
  updateVirtualBackground: (imageUrl: string) => Promise<void>;
8
+ /** Stop the current track and create a fresh one for the next session. */
9
+ reset: () => Promise<void>;
8
10
  };
9
11
  export declare const useLocalVideo: () => LocalVideoTrack;
@@ -8,5 +8,6 @@ export declare const useVideoDevices: () => {
8
8
  activeCameraId: string;
9
9
  setActiveCameraId: import('react').Dispatch<import('react').SetStateAction<string>>;
10
10
  handleDeviceChange: () => void;
11
+ refreshDevices: () => void;
11
12
  isMobile: boolean;
12
13
  };
@@ -16,6 +16,10 @@ export type VideoPluginProps = {
16
16
  onInitSession?: () => Promise<void>;
17
17
  onCloseSession?: () => Promise<void>;
18
18
  onRestartSession?: () => Promise<void>;
19
+ /** Called after the current user has successfully joined the session. */
20
+ onJoin?: () => void;
21
+ /** Called after the current user has successfully left the session. */
22
+ onExit?: () => void;
19
23
  videoSessionStatus?: SessionStatus;
20
24
  credentials: Credentials;
21
25
  language?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fraku/video",
3
3
  "private": false,
4
- "version": "0.1.76",
4
+ "version": "0.1.78",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -52,12 +52,12 @@
52
52
  "classnames": "^2.5.1",
53
53
  "clsx": "^2.1.1",
54
54
  "i18n": "^0.15.3",
55
- "i18next": "^25.10.5",
55
+ "i18next": "^26.0.1",
56
56
  "i18next-browser-languagedetector": "^8.2.1",
57
57
  "jsrsasign": "^11.1.1",
58
58
  "primeicons": "^7.0.0",
59
59
  "primereact": "^10.9.6",
60
- "react-i18next": "^16.6.2",
60
+ "react-i18next": "^17.0.1",
61
61
  "react-use": "^17.6.0",
62
62
  "styled-components": "^5.3.11",
63
63
  "tailwind-merge": "^3.5.0",
@@ -65,7 +65,7 @@
65
65
  },
66
66
  "devDependencies": {
67
67
  "@playwright/test": "^1.58.2",
68
- "@storybook/react-vite": "^10.3.2",
68
+ "@storybook/react-vite": "^10.3.3",
69
69
  "@storybook/test-runner": "^0.24.3",
70
70
  "@tailwindcss/container-queries": "^0.1.1",
71
71
  "@testing-library/jest-dom": "^6.9.1",
@@ -78,10 +78,10 @@
78
78
  "@typescript-eslint/eslint-plugin": "^6.14.0",
79
79
  "@typescript-eslint/parser": "^6.14.0",
80
80
  "@vitejs/plugin-react": "^4.3.4",
81
- "@vitest/coverage-v8": "^4.1.0",
82
- "@vitest/ui": "^4.1.0",
81
+ "@vitest/coverage-v8": "^4.1.2",
82
+ "@vitest/ui": "^4.1.2",
83
83
  "autoprefixer": "^10.4.27",
84
- "baseline-browser-mapping": "^2.10.10",
84
+ "baseline-browser-mapping": "^2.10.12",
85
85
  "eslint": "^8.55.0",
86
86
  "eslint-plugin-react": "^7.37.5",
87
87
  "eslint-plugin-react-hooks": "^4.6.0",
@@ -92,13 +92,13 @@
92
92
  "postcss": "^8.5.8",
93
93
  "react": "^18.2.0",
94
94
  "react-dom": "^18.2.0",
95
- "storybook": "^10.3.2",
95
+ "storybook": "^10.3.3",
96
96
  "tailwindcss": "^3.4.17",
97
97
  "typescript": "^5.2.2",
98
98
  "vite": "^6.0.7",
99
99
  "vite-plugin-dts": "^3.6.4",
100
100
  "vite-plugin-static-copy": "^3.4.0",
101
- "vitest": "^4.1.0"
101
+ "vitest": "^4.1.2"
102
102
  },
103
103
  "keywords": [
104
104
  "react",