@fraku/video 0.1.33 → 0.1.34

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.
@@ -0,0 +1,7 @@
1
+ export type DockItem = {
2
+ component: JSX.Element;
3
+ mobileComponent?: JSX.Element;
4
+ group: number;
5
+ key: string;
6
+ show: boolean;
7
+ };
@@ -0,0 +1,9 @@
1
+ import { Menu } from 'primereact/menu';
2
+ import { DockItem } from './types';
3
+
4
+ export declare const useButtonsDockController: () => {
5
+ dockItems: DockItem[];
6
+ audioMenuOptionsRef: import('react').RefObject<Menu>;
7
+ videoMenuOptionsRef: import('react').RefObject<Menu>;
8
+ micMenuOptionsRef: import('react').RefObject<Menu>;
9
+ };
@@ -0,0 +1,35 @@
1
+ import { DockItem } from './types';
2
+ import { MenuItem, MenuItemOptions } from 'primereact/menuitem';
3
+
4
+ /**
5
+ * Custom hook to manage the overflow behavior of dock items in a button dock.
6
+ *
7
+ * Observes the width of the buttons group container of the dock and determines which items can
8
+ * be displayed and which should be moved to an overflow menu, based on available space.
9
+ *
10
+ * @param dockItems - Array of `DockItem` objects representing the items to be displayed in the dock.
11
+ *
12
+ * @returns An object containing:
13
+ * - `dockRef`: Ref to the dock container element.
14
+ * - `visibleItems`: Array of dock items that are currently visible in the dock.
15
+ * - `overflowMenuItems`: Array of menu items to be displayed in the overflow menu.
16
+ *
17
+ * @remarks
18
+ * - Only dock items with `group === 2` and `show === true` are considered for display.
19
+ * - The hook automatically updates the visible and overflow items when the dock container is resized.
20
+ *
21
+ * @example
22
+ * const { dockRef, visibleItems, overflowMenuItems } = useDockOverflow({ dockItems });
23
+ */
24
+ export declare const useDockOverflow: ({ dockItems }: {
25
+ dockItems: DockItem[];
26
+ }) => {
27
+ dockRef: import('react').RefObject<HTMLDivElement>;
28
+ visibleItems: DockItem[];
29
+ overflowMenuItems: {
30
+ id: string;
31
+ label: any;
32
+ command: () => void;
33
+ template: (menuActionItem: MenuItem, options: MenuItemOptions) => import("react/jsx-runtime").JSX.Element;
34
+ }[];
35
+ };
@@ -0,0 +1,7 @@
1
+ import { Participant } from '@zoom/videosdk';
2
+
3
+ type Props = {
4
+ users: Participant[];
5
+ };
6
+ declare const ParticipantsList: ({ users }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default ParticipantsList;
@@ -0,0 +1,26 @@
1
+ import { RefObject } from 'react';
2
+ import { Participant } from '@zoom/videosdk';
3
+ import { Menu } from 'primereact/menu';
4
+
5
+ type UserListViewProps = {
6
+ can: {
7
+ changeUserRole: boolean;
8
+ toggleUserAudio: boolean;
9
+ toggleUserVideo: boolean;
10
+ };
11
+ columnHeader: string;
12
+ currentUserId: number;
13
+ filteredUsers: Participant[];
14
+ filter: string;
15
+ handleMakeHost: () => Promise<void>;
16
+ handleMakeManager: () => Promise<void>;
17
+ handleRevokeManager: () => Promise<void>;
18
+ handleToggleParticipantMic: (p: Participant) => Promise<void>;
19
+ isManager: boolean;
20
+ loading: boolean;
21
+ setFilter: ReactSetter<string>;
22
+ setSelectedUser: ReactSetter<Participant | null>;
23
+ userMenuRef: RefObject<Menu>;
24
+ };
25
+ declare const UserListView: ({ can, columnHeader, currentUserId, filteredUsers, filter, handleMakeHost, handleMakeManager, handleRevokeManager, handleToggleParticipantMic, isManager, loading, setFilter, setSelectedUser, userMenuRef }: UserListViewProps) => import("react/jsx-runtime").JSX.Element;
26
+ export default UserListView;
@@ -0,0 +1 @@
1
+ export { default } from './ParticipantsList';
@@ -0,0 +1,23 @@
1
+ import { Participant } from '@zoom/videosdk';
2
+ import { Menu } from 'primereact/menu';
3
+
4
+ declare const useUserListController: (users: Participant[]) => {
5
+ can: {
6
+ changeUserRole: boolean;
7
+ toggleUserAudio: boolean;
8
+ toggleUserVideo: boolean;
9
+ };
10
+ currentUserId: number;
11
+ filteredUsers: Participant[];
12
+ filter: string;
13
+ handleMakeHost: () => Promise<void>;
14
+ handleMakeManager: () => Promise<void>;
15
+ handleRevokeManager: () => Promise<void>;
16
+ handleToggleParticipantMic: (p: Participant) => Promise<void>;
17
+ isManager: boolean;
18
+ loading: boolean;
19
+ setFilter: import('react').Dispatch<import('react').SetStateAction<string>>;
20
+ setSelectedUser: import('react').Dispatch<import('react').SetStateAction<Participant | null>>;
21
+ userMenuRef: import('react').RefObject<Menu>;
22
+ };
23
+ export default useUserListController;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fraku/video",
3
3
  "private": false,
4
- "version": "0.1.33",
4
+ "version": "0.1.34",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -72,6 +72,7 @@
72
72
  "@typescript-eslint/eslint-plugin": "^6.14.0",
73
73
  "@typescript-eslint/parser": "^6.14.0",
74
74
  "@vitejs/plugin-react": "^4.3.4",
75
+ "@vitest/coverage-v8": "^4.0.16",
75
76
  "@vitest/ui": "^4.0.16",
76
77
  "autoprefixer": "^10.4.22",
77
78
  "baseline-browser-mapping": "^2.9.13",