@fraku/video 0.0.7 → 0.1.0

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.
Files changed (54) hide show
  1. package/dist/{ZoomVideo.d.ts → VideoPlugin.d.ts} +5 -3
  2. package/dist/{ZoomVideo.stories.d.ts → VideoPlugin.stories.d.ts} +3 -0
  3. package/dist/VideoPluginContent.d.ts +5 -0
  4. package/dist/VideoPluginProvider.d.ts +11 -0
  5. package/dist/context.d.ts +14 -41
  6. package/dist/index.cjs +845 -525
  7. package/dist/index.css +1 -1
  8. package/dist/index.d.ts +2 -2
  9. package/dist/index.js +43020 -22248
  10. package/dist/pages/MainSessionPage/ButtonsDock.d.ts +2 -0
  11. package/dist/pages/MainSessionPage/MainSessionPage.d.ts +2 -0
  12. package/dist/pages/MainSessionPage/ParticipantVideo.d.ts +8 -0
  13. package/dist/pages/MainSessionPage/Video.d.ts +2 -0
  14. package/dist/pages/MainSessionPage/index.d.ts +1 -0
  15. package/dist/pages/SetupPage/SetupPage.d.ts +2 -0
  16. package/dist/pages/SetupPage/index.d.ts +1 -0
  17. package/dist/types.d.ts +4 -11
  18. package/dist/utils.d.ts +48 -0
  19. package/package.json +6 -3
  20. package/dist/ZoomVideoPlugin.d.ts +0 -4
  21. package/dist/ZoomVideoPlugin.stories.d.ts +0 -8
  22. package/dist/ZoomVideoPluginRouter.d.ts +0 -4
  23. package/dist/ZoomVideoProvider.d.ts +0 -12
  24. package/dist/components/ButtonsDock/ButtonsDock.d.ts +0 -13
  25. package/dist/components/ButtonsDock/DockButton.d.ts +0 -30
  26. package/dist/components/ButtonsDock/MenuItemTemplate.d.ts +0 -9
  27. package/dist/components/ButtonsDock/index.d.ts +0 -1
  28. package/dist/components/MobileIconButton/MobileIconButton.d.ts +0 -9
  29. package/dist/components/MobileIconButton/index.d.ts +0 -1
  30. package/dist/components/Overlay/Overlay.d.ts +0 -13
  31. package/dist/components/Overlay/index.d.ts +0 -1
  32. package/dist/components/ParticipantsList.d.ts +0 -11
  33. package/dist/components/SettingsOverlay/SettingsContent.d.ts +0 -2
  34. package/dist/components/SettingsOverlay/SettingsMenu.d.ts +0 -2
  35. package/dist/components/SettingsOverlay/SettingsOverlay.d.ts +0 -11
  36. package/dist/components/SettingsOverlay/Tabs/AudioSettings.d.ts +0 -2
  37. package/dist/components/SettingsOverlay/Tabs/BackgroundSettings.d.ts +0 -2
  38. package/dist/components/SettingsOverlay/Tabs/DropdownItemTemplate.d.ts +0 -8
  39. package/dist/components/SettingsOverlay/Tabs/DropdownValueTemplate.d.ts +0 -8
  40. package/dist/components/SettingsOverlay/Tabs/VideoSettings.d.ts +0 -2
  41. package/dist/components/SettingsOverlay/context.d.ts +0 -13
  42. package/dist/components/SettingsOverlay/index.d.ts +0 -1
  43. package/dist/components/Video.d.ts +0 -2
  44. package/dist/constants.d.ts +0 -2
  45. package/dist/hooks/useClientMessages.d.ts +0 -5
  46. package/dist/hooks/useStartVideoOptions.d.ts +0 -10
  47. package/dist/hooks/useZoomVideoPlayer.d.ts +0 -7
  48. package/dist/lib/platforms.d.ts +0 -4
  49. package/dist/pages/AfterSession.d.ts +0 -4
  50. package/dist/pages/MainSession.d.ts +0 -2
  51. package/dist/pages/PanelistsSession.d.ts +0 -4
  52. package/dist/pages/PreSessionConfiguration.d.ts +0 -4
  53. /package/dist/{components → pages/MainSessionPage}/Chat/Chat.d.ts +0 -0
  54. /package/dist/{components → pages/MainSessionPage}/Chat/index.d.ts +0 -0
@@ -0,0 +1,2 @@
1
+ declare const ButtonsDock: () => import("react/jsx-runtime").JSX.Element;
2
+ export default ButtonsDock;
@@ -0,0 +1,2 @@
1
+ declare const MainSessionPage: () => import("react/jsx-runtime").JSX.Element;
2
+ export default MainSessionPage;
@@ -0,0 +1,8 @@
1
+ import { Participant } from '@zoom/videosdk';
2
+
3
+ type ParticipantVideoProps = {
4
+ participant: Participant;
5
+ className?: string;
6
+ };
7
+ declare const ParticipantVideo: ({ participant, className }: ParticipantVideoProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default ParticipantVideo;
@@ -0,0 +1,2 @@
1
+ declare const Video: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Video;
@@ -0,0 +1 @@
1
+ export { default } from './MainSessionPage';
@@ -0,0 +1,2 @@
1
+ declare const SetupPage: () => import("react/jsx-runtime").JSX.Element;
2
+ export default SetupPage;
@@ -0,0 +1 @@
1
+ export { default } from './SetupPage';
package/dist/types.d.ts CHANGED
@@ -1,20 +1,13 @@
1
1
  import { default as React } from 'react';
2
2
 
3
- export declare enum SessionStep {
4
- LocalSettingsConfiguration = 0,
5
- OnlyPanelistsSession = 1,
6
- MainSession = 2,
7
- AfterSession = 3
8
- }
9
3
  export type Credentials = {
10
4
  sessionName: string;
11
5
  signature: string;
12
6
  userName: string;
13
7
  sessionPasscode: string;
14
8
  };
15
- export type ReactSetter<T> = React.Dispatch<React.SetStateAction<T>>;
16
- export type ZoomVideoPluginProps = {
17
- credentials: Credentials | null;
18
- closeParentContainer: () => void;
19
- setIsCloseButtonVisible: ReactSetter<boolean>;
9
+ export type VideoPluginProps = {
10
+ credentials: Credentials;
11
+ className?: string;
20
12
  };
13
+ export type ReactSetter<T> = React.Dispatch<React.SetStateAction<T>>;
@@ -0,0 +1,48 @@
1
+ import { ClassValue } from 'clsx';
2
+
3
+ export declare const fetchDevices: () => Promise<{
4
+ micList: MediaDeviceInfo[];
5
+ speakerList: MediaDeviceInfo[];
6
+ cameraList: MediaDeviceInfo[];
7
+ }>;
8
+ export declare const getRequiredEnv: (key: string) => string;
9
+ export declare const getOptionalEnv: (key: string) => string;
10
+ export interface GenerateSignatureParams {
11
+ sdkKey: string;
12
+ sdkSecret: string;
13
+ sessionName: string;
14
+ role: 0 | 1;
15
+ expirationSeconds?: number;
16
+ userIdentity?: string;
17
+ sessionKey?: string;
18
+ geoRegions?: string[];
19
+ cloudRecordingOption?: 0 | 1;
20
+ cloudRecordingElection?: 0 | 1;
21
+ telemetryTrackingId?: string;
22
+ videoWebRtcMode?: 0 | 1;
23
+ audioWebRtcMode?: 0 | 1;
24
+ }
25
+ /**
26
+ * Generate a Zoom Video SDK signature (JWT)
27
+ *
28
+ * @param params - Parameters for generating the signature
29
+ * @returns JWT signature string
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const signature = generateSignature({
34
+ * sdkKey: 'your-sdk-key',
35
+ * sdkSecret: 'your-sdk-secret',
36
+ * sessionName: 'test-session',
37
+ * role: 1,
38
+ * userIdentity: 'user123'
39
+ * })
40
+ * ```
41
+ */
42
+ export declare const generateSignature: (params: GenerateSignatureParams) => string;
43
+ /**
44
+ * Utility function that combines clsx and tailwind-merge
45
+ * - clsx handles conditional classes and complex logic
46
+ * - twMerge resolves Tailwind CSS class conflicts
47
+ */
48
+ export declare function cn(...inputs: ClassValue[]): string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fraku/video",
3
3
  "private": false,
4
- "version": "0.0.7",
4
+ "version": "0.1.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -41,14 +41,17 @@
41
41
  "@zoom/videosdk": "^2.2.12",
42
42
  "classnames": "^2.5.1",
43
43
  "clsx": "^2.1.1",
44
+ "jsrsasign": "^11.1.0",
44
45
  "primeicons": "^7.0.0",
45
46
  "primereact": "^10.9.6",
46
47
  "react-use": "^17.6.0",
47
- "styled-components": "^5.3.11"
48
+ "styled-components": "^5.3.11",
49
+ "tailwind-merge": "^3.4.0"
48
50
  },
49
51
  "devDependencies": {
50
52
  "@storybook/react-vite": "^9.1.13",
51
53
  "@tailwindcss/container-queries": "^0.1.1",
54
+ "@types/jsrsasign": "^10.5.15",
52
55
  "@types/node": "^24.8.1",
53
56
  "@types/react": "^18.2.43",
54
57
  "@types/react-dom": "^18.2.17",
@@ -79,4 +82,4 @@
79
82
  "author": "",
80
83
  "license": "MIT",
81
84
  "description": "A React TypeScript component library"
82
- }
85
+ }
@@ -1,4 +0,0 @@
1
- import { ZoomVideoPluginProps } from './types';
2
-
3
- declare const ZoomVideoPlugin: ({ credentials, closeParentContainer, setIsCloseButtonVisible }: ZoomVideoPluginProps) => import("react/jsx-runtime").JSX.Element | null;
4
- export default ZoomVideoPlugin;
@@ -1,8 +0,0 @@
1
- declare const _default: {
2
- title: string;
3
- };
4
- export default _default;
5
- export declare const Default: {
6
- (): import("react/jsx-runtime").JSX.Element;
7
- storyName: string;
8
- };
@@ -1,4 +0,0 @@
1
- import { ZoomVideoPluginProps } from './types';
2
-
3
- declare const ZoomVideoPluginRouter: ({ credentials, setIsCloseButtonVisible }: ZoomVideoPluginProps) => import("react/jsx-runtime").JSX.Element;
4
- export default ZoomVideoPluginRouter;
@@ -1,12 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { ChatMessage } from '@zoom/videosdk';
3
- import { Credentials } from './types';
4
-
5
- type ZoomVideoProviderProps = {
6
- credentials: Credentials;
7
- children: ReactNode;
8
- messages?: ChatMessage[];
9
- closeParentContainer: () => void;
10
- };
11
- export declare const ZoomVideoProvider: ({ credentials, children, messages: mockMessages, closeParentContainer }: ZoomVideoProviderProps) => import("react/jsx-runtime").JSX.Element;
12
- export {};
@@ -1,13 +0,0 @@
1
- import { SessionStep } from '../../types';
2
-
3
- type ButtonsDockProps = {
4
- exit: () => void;
5
- setIsCamOn: () => void;
6
- setIsMicOn: () => void;
7
- sessionStep: SessionStep;
8
- setActiveMicrophone: (deviceId: string) => void;
9
- setActiveCamera: (deviceId: string) => void;
10
- setActiveAudioOutput: (deviceId: string) => void;
11
- };
12
- declare const ButtonsDock: ({ sessionStep, exit, setIsMicOn, setIsCamOn, setActiveMicrophone, setActiveCamera, setActiveAudioOutput }: ButtonsDockProps) => import("react/jsx-runtime").JSX.Element;
13
- export default ButtonsDock;
@@ -1,30 +0,0 @@
1
- import { default as React } from 'react';
2
-
3
- type DockButtonProps = {
4
- className?: string;
5
- mainIcon: string;
6
- mainLabel?: string;
7
- mainTitle?: string;
8
- onMainClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
9
- showSecondary?: boolean;
10
- secondaryIcon?: string;
11
- secondaryTitle?: string;
12
- onSecondaryClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
13
- };
14
- /**
15
- * Renders a customizable dock button component with optional main and secondary actions.
16
- *
17
- * @param className - Additional CSS class names to apply to the container.
18
- * @param mainIcon - The CSS class for the main icon to display.
19
- * @param mainLabel - Optional label text for the main button.
20
- * @param mainTitle - The title attribute for the main button (for accessibility/tooltips).
21
- * @param onMainClick - Click handler for the main button action.
22
- * @param showSecondary - Flag to indicate if the secondary button should be displayed.
23
- * @param secondaryIcon - Optional CSS class for the secondary icon to display.
24
- * @param secondaryTitle - The title attribute for the secondary button (for accessibility/tooltips).
25
- * @param onSecondaryClick - Optional click handler for the secondary button action.
26
- *
27
- * @returns A dock button component with main and optional secondary actions.
28
- */
29
- declare const DockButton: ({ className, mainIcon, mainLabel, mainTitle, onMainClick, secondaryIcon, secondaryTitle, onSecondaryClick, showSecondary }: DockButtonProps) => import("react/jsx-runtime").JSX.Element;
30
- export default DockButton;
@@ -1,9 +0,0 @@
1
- import { MenuItem, MenuItemOptions } from 'primereact/menuitem';
2
-
3
- type Props = {
4
- item: MenuItem;
5
- options: MenuItemOptions;
6
- activeItem: string | undefined;
7
- };
8
- declare const MenuItemTemplate: ({ item, options, activeItem }: Props) => import("react/jsx-runtime").JSX.Element;
9
- export default MenuItemTemplate;
@@ -1 +0,0 @@
1
- export { default } from './ButtonsDock';
@@ -1,9 +0,0 @@
1
- type MobileIconButtonProps = {
2
- className?: string;
3
- icon: string;
4
- onClick: () => void;
5
- title?: string;
6
- id?: string;
7
- };
8
- declare const MobileIconButton: ({ className, icon, onClick, title, id }: MobileIconButtonProps) => import("react/jsx-runtime").JSX.Element;
9
- export default MobileIconButton;
@@ -1 +0,0 @@
1
- export { default } from './MobileIconButton';
@@ -1,13 +0,0 @@
1
- import { Breakpoint } from '../../hooks/useDeviceSize';
2
-
3
- type OverlayProps = {
4
- breakpoint: Breakpoint;
5
- children: React.ReactNode;
6
- className?: string;
7
- header?: string | React.ReactNode;
8
- onHide: () => void;
9
- width?: string | number;
10
- visible: boolean;
11
- };
12
- declare const Overlay: ({ breakpoint, children, onHide, className, visible, width, header }: OverlayProps) => import("react/jsx-runtime").JSX.Element;
13
- export default Overlay;
@@ -1 +0,0 @@
1
- export { default } from './Overlay';
@@ -1,11 +0,0 @@
1
- import { Participant, VideoClient } from '@zoom/videosdk';
2
- import { ReactSetter } from '../types';
3
-
4
- type Props = {
5
- participants: Participant[];
6
- setIsCamOn: ReactSetter<boolean>;
7
- setIsMicOn: ReactSetter<boolean>;
8
- zmClient: typeof VideoClient;
9
- };
10
- declare const ParticipantsList: ({ zmClient, setIsCamOn, setIsMicOn, participants }: Props) => import("react/jsx-runtime").JSX.Element;
11
- export default ParticipantsList;
@@ -1,2 +0,0 @@
1
- declare const SettingsContent: () => import("react/jsx-runtime").JSX.Element | null;
2
- export default SettingsContent;
@@ -1,2 +0,0 @@
1
- declare const SettingsMenu: () => import("react/jsx-runtime").JSX.Element;
2
- export default SettingsMenu;
@@ -1,11 +0,0 @@
1
- import { Breakpoint } from '../../hooks/useDeviceSize';
2
- import { SettingsTab } from './context';
3
-
4
- type Props = {
5
- breakpoint: Breakpoint;
6
- visible: boolean;
7
- onHide: () => void;
8
- defaultTab?: SettingsTab;
9
- };
10
- declare const SettingsOverlay: ({ visible, onHide, breakpoint, defaultTab }: Props) => import("react/jsx-runtime").JSX.Element;
11
- export default SettingsOverlay;
@@ -1,2 +0,0 @@
1
- declare const AudioSettings: () => import("react/jsx-runtime").JSX.Element;
2
- export default AudioSettings;
@@ -1,2 +0,0 @@
1
- declare const BackgroundSettings: () => import("react/jsx-runtime").JSX.Element;
2
- export default BackgroundSettings;
@@ -1,8 +0,0 @@
1
- declare const DropdownItemTemplate: ({ option, isActive }: {
2
- option: {
3
- label: string;
4
- value: string;
5
- };
6
- isActive: boolean;
7
- }) => import("react/jsx-runtime").JSX.Element;
8
- export default DropdownItemTemplate;
@@ -1,8 +0,0 @@
1
- declare const DropdownValueTemplate: ({ option, icon }: {
2
- option: {
3
- label: string;
4
- value: string;
5
- };
6
- icon: string;
7
- }) => import("react/jsx-runtime").JSX.Element;
8
- export default DropdownValueTemplate;
@@ -1,2 +0,0 @@
1
- declare const VideoSettings: () => import("react/jsx-runtime").JSX.Element;
2
- export default VideoSettings;
@@ -1,13 +0,0 @@
1
- import { ReactSetter } from '../../types';
2
-
3
- export declare enum SettingsTab {
4
- Audio = "Audio",
5
- Video = "Video",
6
- Background = "Background"
7
- }
8
- export type SettingsOverlayContextProps = {
9
- selectedSettingsTab: SettingsTab;
10
- setSelectedSettingsTab: ReactSetter<SettingsTab>;
11
- };
12
- export declare const settingsOverlayContext: import('react').Context<SettingsOverlayContextProps>;
13
- export declare const useSettingsOverlayContext: () => SettingsOverlayContextProps;
@@ -1 +0,0 @@
1
- export { default } from './SettingsOverlay';
@@ -1,2 +0,0 @@
1
- declare const Video: import('react').ForwardRefExoticComponent<import('react').RefAttributes<HTMLVideoElement>>;
2
- export default Video;
@@ -1,2 +0,0 @@
1
- export declare const VIDEO_PLACEHOLDER = "<div class=\"video-placeholder flex items-center justify-center bg-neutral-20 w-full h-full aspect-video text-white\"><i class=\"fa-regular fa-video-slash fa-lg\"/></div>";
2
- export declare const SETTINGS_OVERLAY_WIDTH = 680;
@@ -1,5 +0,0 @@
1
- /**
2
- * Hook that subscribes to Zoom Video SDK events and updates the context state accordingly.
3
- * This hook should be called from within a ZoomVideoProvider.
4
- */
5
- export declare const useClientMessages: () => void;
@@ -1,10 +0,0 @@
1
- import { Stream } from '@zoom/videosdk';
2
-
3
- export declare const useStartVideoOptions: ({ mediaStream }: {
4
- mediaStream: typeof Stream | null;
5
- }) => {
6
- hd: boolean;
7
- fullHd: boolean;
8
- ptz: boolean | undefined;
9
- originalRatio: boolean;
10
- };
@@ -1,7 +0,0 @@
1
- import { RefObject } from 'react';
2
-
3
- type UseZoomVideoPlayerProps = {
4
- fullRef: RefObject<HTMLVideoElement | null>;
5
- };
6
- export declare const useZoomVideoPlayer: ({ fullRef }: UseZoomVideoPlayerProps) => void;
7
- export {};
@@ -1,4 +0,0 @@
1
- export declare const isIPad: () => boolean;
2
- export declare const isIOSMobile: () => boolean;
3
- export declare const isAndroidBrowser: () => boolean;
4
- export declare const isAndroidOrIOSBrowser: () => boolean;
@@ -1,4 +0,0 @@
1
- declare const AfterSession: ({ restartSession }: {
2
- restartSession: () => void;
3
- }) => import("react/jsx-runtime").JSX.Element;
4
- export default AfterSession;
@@ -1,2 +0,0 @@
1
- declare const MainSession: () => import("react/jsx-runtime").JSX.Element;
2
- export default MainSession;
@@ -1,4 +0,0 @@
1
- declare const PanelistsSession: ({ initMainSession }: {
2
- initMainSession: () => void;
3
- }) => import("react/jsx-runtime").JSX.Element;
4
- export default PanelistsSession;
@@ -1,4 +0,0 @@
1
- declare const PreSessionConfiguration: ({ joinSession }: {
2
- joinSession: () => Promise<void>;
3
- }) => import("react/jsx-runtime").JSX.Element;
4
- export default PreSessionConfiguration;