@thangdevalone/meeting-grid-layout-react 1.4.1
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/LICENSE +44 -0
- package/README.md +158 -0
- package/dist/index.cjs +531 -0
- package/dist/index.d.cts +238 -0
- package/dist/index.d.mts +238 -0
- package/dist/index.d.ts +238 -0
- package/dist/index.mjs +511 -0
- package/package.json +63 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default, { RefObject, HTMLAttributes, ReactNode, CSSProperties } from 'react';
|
|
3
|
+
import { GridDimensions, MeetGridOptions, MeetGridResult, SpringPreset, LayoutMode, ItemAspectRatio, ContentDimensions } from '@thangdevalone/meeting-grid-layout-core';
|
|
4
|
+
export { ContentDimensions, GridDimensions, GridOptions, ItemAspectRatio, LayoutMode, MeetGridOptions, MeetGridResult, PaginationInfo, Position, SpringPreset, createGrid, createGridItemPositioner, createMeetGrid, getAspectRatio, getGridItemDimensions, getSpringConfig, springPresets } from '@thangdevalone/meeting-grid-layout-core';
|
|
5
|
+
import { HTMLMotionProps, Transition } from 'motion/react';
|
|
6
|
+
|
|
7
|
+
interface GridContextValue {
|
|
8
|
+
dimensions: GridDimensions;
|
|
9
|
+
grid: MeetGridResult | null;
|
|
10
|
+
springPreset: SpringPreset;
|
|
11
|
+
}
|
|
12
|
+
declare const GridContext: React.Context<GridContextValue | null>;
|
|
13
|
+
/**
|
|
14
|
+
* Hook to access the grid context
|
|
15
|
+
*/
|
|
16
|
+
declare function useGridContext(): GridContextValue;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A React hook to calculate dimensions of an element using ResizeObserver.
|
|
20
|
+
* @param ref An element ref
|
|
21
|
+
* @returns Dimensions of the element
|
|
22
|
+
*/
|
|
23
|
+
declare function useGridDimensions(ref: RefObject<HTMLElement | null>): GridDimensions;
|
|
24
|
+
/**
|
|
25
|
+
* React hook for creating a meet-style responsive grid.
|
|
26
|
+
* @param options Grid options including dimensions, count, aspectRatio, gap, and layoutMode
|
|
27
|
+
* @returns Grid result with width, height, and position getter
|
|
28
|
+
*/
|
|
29
|
+
declare function useMeetGrid(options: MeetGridOptions): MeetGridResult;
|
|
30
|
+
/**
|
|
31
|
+
* Hook to get animation configuration for Motion
|
|
32
|
+
*/
|
|
33
|
+
declare function useGridAnimation(preset?: SpringPreset): {
|
|
34
|
+
stiffness: 400;
|
|
35
|
+
damping: 30;
|
|
36
|
+
type: "spring";
|
|
37
|
+
} | {
|
|
38
|
+
stiffness: 300;
|
|
39
|
+
damping: 30;
|
|
40
|
+
type: "spring";
|
|
41
|
+
} | {
|
|
42
|
+
stiffness: 200;
|
|
43
|
+
damping: 25;
|
|
44
|
+
type: "spring";
|
|
45
|
+
} | {
|
|
46
|
+
stiffness: 400;
|
|
47
|
+
damping: 15;
|
|
48
|
+
type: "spring";
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
interface GridContainerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
52
|
+
/** Children to render inside the grid */
|
|
53
|
+
children: ReactNode;
|
|
54
|
+
/** Aspect ratio in format "width:height" (e.g., "16:9") */
|
|
55
|
+
aspectRatio?: string;
|
|
56
|
+
/** Gap between items in pixels */
|
|
57
|
+
gap?: number;
|
|
58
|
+
/** Number of items (if not using GridItem children) */
|
|
59
|
+
count?: number;
|
|
60
|
+
/** Layout mode */
|
|
61
|
+
layoutMode?: LayoutMode;
|
|
62
|
+
/** Index of pinned/focused item (main participant for pin/spotlight modes) */
|
|
63
|
+
pinnedIndex?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Position of "others" thumbnails when a participant is pinned.
|
|
66
|
+
* In portrait containers, this is forced to 'bottom'.
|
|
67
|
+
* @default 'right'
|
|
68
|
+
*/
|
|
69
|
+
othersPosition?: 'left' | 'right' | 'top' | 'bottom';
|
|
70
|
+
/** Spring animation preset */
|
|
71
|
+
springPreset?: SpringPreset;
|
|
72
|
+
/** Custom container style */
|
|
73
|
+
style?: CSSProperties;
|
|
74
|
+
/** Additional class name */
|
|
75
|
+
className?: string;
|
|
76
|
+
/** Maximum items per page for pagination (0 = no pagination) */
|
|
77
|
+
maxItemsPerPage?: number;
|
|
78
|
+
/** Current page index (0-based) for pagination */
|
|
79
|
+
currentPage?: number;
|
|
80
|
+
/** Maximum visible items (0 = show all). In gallery mode without pin: limits all items. With pin: limits "others". */
|
|
81
|
+
maxVisible?: number;
|
|
82
|
+
/** Current page for visible items (0-based), used when maxVisible > 0 */
|
|
83
|
+
currentVisiblePage?: number;
|
|
84
|
+
/**
|
|
85
|
+
* Per-item aspect ratio configurations.
|
|
86
|
+
* Use different ratios for mobile (9:16), desktop (16:9).
|
|
87
|
+
* @example ['16:9', '9:16', undefined]
|
|
88
|
+
*/
|
|
89
|
+
itemAspectRatios?: (ItemAspectRatio | undefined)[];
|
|
90
|
+
/** Custom width for the floating PiP item in 2-person mode */
|
|
91
|
+
floatWidth?: number;
|
|
92
|
+
/** Custom height for the floating PiP item in 2-person mode */
|
|
93
|
+
floatHeight?: number;
|
|
94
|
+
/**
|
|
95
|
+
* Responsive breakpoints for the floating PiP in 2-person mode.
|
|
96
|
+
* When provided, PiP size auto-adjusts based on container width.
|
|
97
|
+
* Use `DEFAULT_FLOAT_BREAKPOINTS` for a ready-made 5-level responsive config.
|
|
98
|
+
* @example
|
|
99
|
+
* floatBreakpoints={DEFAULT_FLOAT_BREAKPOINTS}
|
|
100
|
+
* floatBreakpoints={[
|
|
101
|
+
* { minWidth: 0, width: 80, height: 110 },
|
|
102
|
+
* { minWidth: 600, width: 150, height: 200 },
|
|
103
|
+
* ]}
|
|
104
|
+
*/
|
|
105
|
+
floatBreakpoints?: PipBreakpoint[];
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Container component for the meet grid.
|
|
109
|
+
* Provides grid context to child GridItem components.
|
|
110
|
+
*/
|
|
111
|
+
declare const GridContainer: React__default.ForwardRefExoticComponent<GridContainerProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
112
|
+
interface GridItemProps extends Omit<HTMLMotionProps<'div'>, 'animate' | 'initial' | 'transition' | 'children'> {
|
|
113
|
+
/** Index of this item in the grid */
|
|
114
|
+
index: number;
|
|
115
|
+
/**
|
|
116
|
+
* Children to render inside the item.
|
|
117
|
+
* Can be a ReactNode or a render function that receives contentDimensions and visibility info.
|
|
118
|
+
* @example
|
|
119
|
+
* // Simple usage
|
|
120
|
+
* <GridItem index={0}><Video /></GridItem>
|
|
121
|
+
*
|
|
122
|
+
* // With contentDimensions for flexible aspect ratios
|
|
123
|
+
* <GridItem index={0}>
|
|
124
|
+
* {({ contentDimensions }) => (
|
|
125
|
+
* <Video style={{
|
|
126
|
+
* width: contentDimensions.width,
|
|
127
|
+
* height: contentDimensions.height,
|
|
128
|
+
* marginTop: contentDimensions.offsetTop,
|
|
129
|
+
* marginLeft: contentDimensions.offsetLeft
|
|
130
|
+
* }} />
|
|
131
|
+
* )}
|
|
132
|
+
* </GridItem>
|
|
133
|
+
*
|
|
134
|
+
* // With hidden count for '+X more' indicator
|
|
135
|
+
* <GridItem index={index}>
|
|
136
|
+
* {({ isLastVisibleOther, hiddenCount }) => (
|
|
137
|
+
* <div>
|
|
138
|
+
* {isLastVisibleOther && hiddenCount > 0 && (
|
|
139
|
+
* <span className="more-indicator">+{hiddenCount}</span>
|
|
140
|
+
* )}
|
|
141
|
+
* </div>
|
|
142
|
+
* )}
|
|
143
|
+
* </GridItem>
|
|
144
|
+
*/
|
|
145
|
+
children: ReactNode | ((props: {
|
|
146
|
+
contentDimensions: ContentDimensions;
|
|
147
|
+
/** True if this is the last visible item in the "others" section */
|
|
148
|
+
isLastVisibleOther: boolean;
|
|
149
|
+
/** Number of hidden items (for '+X more' indicator) */
|
|
150
|
+
hiddenCount: number;
|
|
151
|
+
/** True if this item is rendered as a floating PiP */
|
|
152
|
+
isFloat: boolean;
|
|
153
|
+
}) => ReactNode);
|
|
154
|
+
/** Optional item-specific aspect ratio (overrides itemAspectRatios from container) */
|
|
155
|
+
itemAspectRatio?: ItemAspectRatio;
|
|
156
|
+
/** Custom transition override */
|
|
157
|
+
transition?: Transition;
|
|
158
|
+
/** Whether to disable animations */
|
|
159
|
+
disableAnimation?: boolean;
|
|
160
|
+
/** Additional class name */
|
|
161
|
+
className?: string;
|
|
162
|
+
/** Custom style (merged with animated styles) */
|
|
163
|
+
style?: CSSProperties;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Grid item component with Motion animations.
|
|
167
|
+
* Automatically positions itself based on index in the grid.
|
|
168
|
+
* When the grid marks this item as float (2-person mode), renders as a draggable PiP.
|
|
169
|
+
*/
|
|
170
|
+
declare const GridItem: React__default.ForwardRefExoticComponent<Omit<GridItemProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
171
|
+
interface FloatingGridItemProps extends Omit<HTMLMotionProps<'div'>, 'animate' | 'initial' | 'children'> {
|
|
172
|
+
/** Children to render inside the floating item */
|
|
173
|
+
children: ReactNode;
|
|
174
|
+
/** Width of the floating item (px). Overridden by `breakpoints` when provided. */
|
|
175
|
+
width?: number;
|
|
176
|
+
/** Height of the floating item (px). Overridden by `breakpoints` when provided. */
|
|
177
|
+
height?: number;
|
|
178
|
+
/**
|
|
179
|
+
* Responsive breakpoints for PiP sizing.
|
|
180
|
+
* When provided, width/height auto-adjust based on container width.
|
|
181
|
+
* Overrides the fixed `width`/`height` props.
|
|
182
|
+
* Use `DEFAULT_FLOAT_BREAKPOINTS` for a ready-made 5-level responsive config.
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* // Use default responsive breakpoints
|
|
186
|
+
* breakpoints={DEFAULT_FLOAT_BREAKPOINTS}
|
|
187
|
+
*
|
|
188
|
+
* // Custom breakpoints
|
|
189
|
+
* breakpoints={[
|
|
190
|
+
* { minWidth: 0, width: 80, height: 110 },
|
|
191
|
+
* { minWidth: 600, width: 150, height: 200 },
|
|
192
|
+
* { minWidth: 1200, width: 250, height: 330 },
|
|
193
|
+
* ]}
|
|
194
|
+
*/
|
|
195
|
+
breakpoints?: PipBreakpoint[];
|
|
196
|
+
/** Initial position (x, y from container edges) */
|
|
197
|
+
initialPosition?: {
|
|
198
|
+
x: number;
|
|
199
|
+
y: number;
|
|
200
|
+
};
|
|
201
|
+
/** Which corner to anchor: 'top-left', 'top-right', 'bottom-left', 'bottom-right' */
|
|
202
|
+
anchor?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
203
|
+
/** Whether the item is visible */
|
|
204
|
+
visible?: boolean;
|
|
205
|
+
/** Padding from container edges */
|
|
206
|
+
edgePadding?: number;
|
|
207
|
+
/** Callback when anchor changes after snap */
|
|
208
|
+
onAnchorChange?: (anchor: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right') => void;
|
|
209
|
+
/** Custom transition */
|
|
210
|
+
transition?: Transition;
|
|
211
|
+
/** Border radius */
|
|
212
|
+
borderRadius?: number;
|
|
213
|
+
/** Box shadow */
|
|
214
|
+
boxShadow?: string;
|
|
215
|
+
/** Additional class name */
|
|
216
|
+
className?: string;
|
|
217
|
+
/** Custom style */
|
|
218
|
+
style?: CSSProperties;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Floating Grid Item component that can be dragged around the screen.
|
|
222
|
+
* Snaps to the nearest corner when released (like iOS/Android PiP).
|
|
223
|
+
* Perfect for Picture-in-Picture style floating video in zoom mode.
|
|
224
|
+
*/
|
|
225
|
+
declare const FloatingGridItem: React__default.ForwardRefExoticComponent<Omit<FloatingGridItemProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
226
|
+
interface GridOverlayProps extends HTMLAttributes<HTMLDivElement> {
|
|
227
|
+
/** Whether to show the overlay */
|
|
228
|
+
visible?: boolean;
|
|
229
|
+
/** Overlay background color */
|
|
230
|
+
backgroundColor?: string;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Overlay component for grid items (e.g., for muted indicator, name label)
|
|
234
|
+
*/
|
|
235
|
+
declare const GridOverlay: React__default.ForwardRefExoticComponent<GridOverlayProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
236
|
+
|
|
237
|
+
export { FloatingGridItem, GridContainer, GridContext, GridItem, GridOverlay, useGridAnimation, useGridContext, useGridDimensions, useMeetGrid };
|
|
238
|
+
export type { FloatingGridItemProps, GridContainerProps, GridItemProps, GridOverlayProps };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default, { RefObject, HTMLAttributes, ReactNode, CSSProperties } from 'react';
|
|
3
|
+
import { GridDimensions, MeetGridOptions, MeetGridResult, SpringPreset, LayoutMode, ItemAspectRatio, ContentDimensions } from '@thangdevalone/meeting-grid-layout-core';
|
|
4
|
+
export { ContentDimensions, GridDimensions, GridOptions, ItemAspectRatio, LayoutMode, MeetGridOptions, MeetGridResult, PaginationInfo, Position, SpringPreset, createGrid, createGridItemPositioner, createMeetGrid, getAspectRatio, getGridItemDimensions, getSpringConfig, springPresets } from '@thangdevalone/meeting-grid-layout-core';
|
|
5
|
+
import { HTMLMotionProps, Transition } from 'motion/react';
|
|
6
|
+
|
|
7
|
+
interface GridContextValue {
|
|
8
|
+
dimensions: GridDimensions;
|
|
9
|
+
grid: MeetGridResult | null;
|
|
10
|
+
springPreset: SpringPreset;
|
|
11
|
+
}
|
|
12
|
+
declare const GridContext: React.Context<GridContextValue | null>;
|
|
13
|
+
/**
|
|
14
|
+
* Hook to access the grid context
|
|
15
|
+
*/
|
|
16
|
+
declare function useGridContext(): GridContextValue;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A React hook to calculate dimensions of an element using ResizeObserver.
|
|
20
|
+
* @param ref An element ref
|
|
21
|
+
* @returns Dimensions of the element
|
|
22
|
+
*/
|
|
23
|
+
declare function useGridDimensions(ref: RefObject<HTMLElement | null>): GridDimensions;
|
|
24
|
+
/**
|
|
25
|
+
* React hook for creating a meet-style responsive grid.
|
|
26
|
+
* @param options Grid options including dimensions, count, aspectRatio, gap, and layoutMode
|
|
27
|
+
* @returns Grid result with width, height, and position getter
|
|
28
|
+
*/
|
|
29
|
+
declare function useMeetGrid(options: MeetGridOptions): MeetGridResult;
|
|
30
|
+
/**
|
|
31
|
+
* Hook to get animation configuration for Motion
|
|
32
|
+
*/
|
|
33
|
+
declare function useGridAnimation(preset?: SpringPreset): {
|
|
34
|
+
stiffness: 400;
|
|
35
|
+
damping: 30;
|
|
36
|
+
type: "spring";
|
|
37
|
+
} | {
|
|
38
|
+
stiffness: 300;
|
|
39
|
+
damping: 30;
|
|
40
|
+
type: "spring";
|
|
41
|
+
} | {
|
|
42
|
+
stiffness: 200;
|
|
43
|
+
damping: 25;
|
|
44
|
+
type: "spring";
|
|
45
|
+
} | {
|
|
46
|
+
stiffness: 400;
|
|
47
|
+
damping: 15;
|
|
48
|
+
type: "spring";
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
interface GridContainerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
52
|
+
/** Children to render inside the grid */
|
|
53
|
+
children: ReactNode;
|
|
54
|
+
/** Aspect ratio in format "width:height" (e.g., "16:9") */
|
|
55
|
+
aspectRatio?: string;
|
|
56
|
+
/** Gap between items in pixels */
|
|
57
|
+
gap?: number;
|
|
58
|
+
/** Number of items (if not using GridItem children) */
|
|
59
|
+
count?: number;
|
|
60
|
+
/** Layout mode */
|
|
61
|
+
layoutMode?: LayoutMode;
|
|
62
|
+
/** Index of pinned/focused item (main participant for pin/spotlight modes) */
|
|
63
|
+
pinnedIndex?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Position of "others" thumbnails when a participant is pinned.
|
|
66
|
+
* In portrait containers, this is forced to 'bottom'.
|
|
67
|
+
* @default 'right'
|
|
68
|
+
*/
|
|
69
|
+
othersPosition?: 'left' | 'right' | 'top' | 'bottom';
|
|
70
|
+
/** Spring animation preset */
|
|
71
|
+
springPreset?: SpringPreset;
|
|
72
|
+
/** Custom container style */
|
|
73
|
+
style?: CSSProperties;
|
|
74
|
+
/** Additional class name */
|
|
75
|
+
className?: string;
|
|
76
|
+
/** Maximum items per page for pagination (0 = no pagination) */
|
|
77
|
+
maxItemsPerPage?: number;
|
|
78
|
+
/** Current page index (0-based) for pagination */
|
|
79
|
+
currentPage?: number;
|
|
80
|
+
/** Maximum visible items (0 = show all). In gallery mode without pin: limits all items. With pin: limits "others". */
|
|
81
|
+
maxVisible?: number;
|
|
82
|
+
/** Current page for visible items (0-based), used when maxVisible > 0 */
|
|
83
|
+
currentVisiblePage?: number;
|
|
84
|
+
/**
|
|
85
|
+
* Per-item aspect ratio configurations.
|
|
86
|
+
* Use different ratios for mobile (9:16), desktop (16:9).
|
|
87
|
+
* @example ['16:9', '9:16', undefined]
|
|
88
|
+
*/
|
|
89
|
+
itemAspectRatios?: (ItemAspectRatio | undefined)[];
|
|
90
|
+
/** Custom width for the floating PiP item in 2-person mode */
|
|
91
|
+
floatWidth?: number;
|
|
92
|
+
/** Custom height for the floating PiP item in 2-person mode */
|
|
93
|
+
floatHeight?: number;
|
|
94
|
+
/**
|
|
95
|
+
* Responsive breakpoints for the floating PiP in 2-person mode.
|
|
96
|
+
* When provided, PiP size auto-adjusts based on container width.
|
|
97
|
+
* Use `DEFAULT_FLOAT_BREAKPOINTS` for a ready-made 5-level responsive config.
|
|
98
|
+
* @example
|
|
99
|
+
* floatBreakpoints={DEFAULT_FLOAT_BREAKPOINTS}
|
|
100
|
+
* floatBreakpoints={[
|
|
101
|
+
* { minWidth: 0, width: 80, height: 110 },
|
|
102
|
+
* { minWidth: 600, width: 150, height: 200 },
|
|
103
|
+
* ]}
|
|
104
|
+
*/
|
|
105
|
+
floatBreakpoints?: PipBreakpoint[];
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Container component for the meet grid.
|
|
109
|
+
* Provides grid context to child GridItem components.
|
|
110
|
+
*/
|
|
111
|
+
declare const GridContainer: React__default.ForwardRefExoticComponent<GridContainerProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
112
|
+
interface GridItemProps extends Omit<HTMLMotionProps<'div'>, 'animate' | 'initial' | 'transition' | 'children'> {
|
|
113
|
+
/** Index of this item in the grid */
|
|
114
|
+
index: number;
|
|
115
|
+
/**
|
|
116
|
+
* Children to render inside the item.
|
|
117
|
+
* Can be a ReactNode or a render function that receives contentDimensions and visibility info.
|
|
118
|
+
* @example
|
|
119
|
+
* // Simple usage
|
|
120
|
+
* <GridItem index={0}><Video /></GridItem>
|
|
121
|
+
*
|
|
122
|
+
* // With contentDimensions for flexible aspect ratios
|
|
123
|
+
* <GridItem index={0}>
|
|
124
|
+
* {({ contentDimensions }) => (
|
|
125
|
+
* <Video style={{
|
|
126
|
+
* width: contentDimensions.width,
|
|
127
|
+
* height: contentDimensions.height,
|
|
128
|
+
* marginTop: contentDimensions.offsetTop,
|
|
129
|
+
* marginLeft: contentDimensions.offsetLeft
|
|
130
|
+
* }} />
|
|
131
|
+
* )}
|
|
132
|
+
* </GridItem>
|
|
133
|
+
*
|
|
134
|
+
* // With hidden count for '+X more' indicator
|
|
135
|
+
* <GridItem index={index}>
|
|
136
|
+
* {({ isLastVisibleOther, hiddenCount }) => (
|
|
137
|
+
* <div>
|
|
138
|
+
* {isLastVisibleOther && hiddenCount > 0 && (
|
|
139
|
+
* <span className="more-indicator">+{hiddenCount}</span>
|
|
140
|
+
* )}
|
|
141
|
+
* </div>
|
|
142
|
+
* )}
|
|
143
|
+
* </GridItem>
|
|
144
|
+
*/
|
|
145
|
+
children: ReactNode | ((props: {
|
|
146
|
+
contentDimensions: ContentDimensions;
|
|
147
|
+
/** True if this is the last visible item in the "others" section */
|
|
148
|
+
isLastVisibleOther: boolean;
|
|
149
|
+
/** Number of hidden items (for '+X more' indicator) */
|
|
150
|
+
hiddenCount: number;
|
|
151
|
+
/** True if this item is rendered as a floating PiP */
|
|
152
|
+
isFloat: boolean;
|
|
153
|
+
}) => ReactNode);
|
|
154
|
+
/** Optional item-specific aspect ratio (overrides itemAspectRatios from container) */
|
|
155
|
+
itemAspectRatio?: ItemAspectRatio;
|
|
156
|
+
/** Custom transition override */
|
|
157
|
+
transition?: Transition;
|
|
158
|
+
/** Whether to disable animations */
|
|
159
|
+
disableAnimation?: boolean;
|
|
160
|
+
/** Additional class name */
|
|
161
|
+
className?: string;
|
|
162
|
+
/** Custom style (merged with animated styles) */
|
|
163
|
+
style?: CSSProperties;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Grid item component with Motion animations.
|
|
167
|
+
* Automatically positions itself based on index in the grid.
|
|
168
|
+
* When the grid marks this item as float (2-person mode), renders as a draggable PiP.
|
|
169
|
+
*/
|
|
170
|
+
declare const GridItem: React__default.ForwardRefExoticComponent<Omit<GridItemProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
171
|
+
interface FloatingGridItemProps extends Omit<HTMLMotionProps<'div'>, 'animate' | 'initial' | 'children'> {
|
|
172
|
+
/** Children to render inside the floating item */
|
|
173
|
+
children: ReactNode;
|
|
174
|
+
/** Width of the floating item (px). Overridden by `breakpoints` when provided. */
|
|
175
|
+
width?: number;
|
|
176
|
+
/** Height of the floating item (px). Overridden by `breakpoints` when provided. */
|
|
177
|
+
height?: number;
|
|
178
|
+
/**
|
|
179
|
+
* Responsive breakpoints for PiP sizing.
|
|
180
|
+
* When provided, width/height auto-adjust based on container width.
|
|
181
|
+
* Overrides the fixed `width`/`height` props.
|
|
182
|
+
* Use `DEFAULT_FLOAT_BREAKPOINTS` for a ready-made 5-level responsive config.
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* // Use default responsive breakpoints
|
|
186
|
+
* breakpoints={DEFAULT_FLOAT_BREAKPOINTS}
|
|
187
|
+
*
|
|
188
|
+
* // Custom breakpoints
|
|
189
|
+
* breakpoints={[
|
|
190
|
+
* { minWidth: 0, width: 80, height: 110 },
|
|
191
|
+
* { minWidth: 600, width: 150, height: 200 },
|
|
192
|
+
* { minWidth: 1200, width: 250, height: 330 },
|
|
193
|
+
* ]}
|
|
194
|
+
*/
|
|
195
|
+
breakpoints?: PipBreakpoint[];
|
|
196
|
+
/** Initial position (x, y from container edges) */
|
|
197
|
+
initialPosition?: {
|
|
198
|
+
x: number;
|
|
199
|
+
y: number;
|
|
200
|
+
};
|
|
201
|
+
/** Which corner to anchor: 'top-left', 'top-right', 'bottom-left', 'bottom-right' */
|
|
202
|
+
anchor?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
203
|
+
/** Whether the item is visible */
|
|
204
|
+
visible?: boolean;
|
|
205
|
+
/** Padding from container edges */
|
|
206
|
+
edgePadding?: number;
|
|
207
|
+
/** Callback when anchor changes after snap */
|
|
208
|
+
onAnchorChange?: (anchor: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right') => void;
|
|
209
|
+
/** Custom transition */
|
|
210
|
+
transition?: Transition;
|
|
211
|
+
/** Border radius */
|
|
212
|
+
borderRadius?: number;
|
|
213
|
+
/** Box shadow */
|
|
214
|
+
boxShadow?: string;
|
|
215
|
+
/** Additional class name */
|
|
216
|
+
className?: string;
|
|
217
|
+
/** Custom style */
|
|
218
|
+
style?: CSSProperties;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Floating Grid Item component that can be dragged around the screen.
|
|
222
|
+
* Snaps to the nearest corner when released (like iOS/Android PiP).
|
|
223
|
+
* Perfect for Picture-in-Picture style floating video in zoom mode.
|
|
224
|
+
*/
|
|
225
|
+
declare const FloatingGridItem: React__default.ForwardRefExoticComponent<Omit<FloatingGridItemProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
226
|
+
interface GridOverlayProps extends HTMLAttributes<HTMLDivElement> {
|
|
227
|
+
/** Whether to show the overlay */
|
|
228
|
+
visible?: boolean;
|
|
229
|
+
/** Overlay background color */
|
|
230
|
+
backgroundColor?: string;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Overlay component for grid items (e.g., for muted indicator, name label)
|
|
234
|
+
*/
|
|
235
|
+
declare const GridOverlay: React__default.ForwardRefExoticComponent<GridOverlayProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
236
|
+
|
|
237
|
+
export { FloatingGridItem, GridContainer, GridContext, GridItem, GridOverlay, useGridAnimation, useGridContext, useGridDimensions, useMeetGrid };
|
|
238
|
+
export type { FloatingGridItemProps, GridContainerProps, GridItemProps, GridOverlayProps };
|