@thangdevalone/meet-layout-grid-vue 1.0.0 → 1.0.3
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 +126 -126
- package/dist/index.cjs +46 -17
- package/dist/index.d.cts +51 -7
- package/dist/index.d.mts +51 -7
- package/dist/index.d.ts +281 -237
- package/dist/index.mjs +36 -7
- package/package.json +61 -60
package/dist/index.d.ts
CHANGED
|
@@ -1,237 +1,281 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { GridDimensions, MeetGridOptions, MeetGridResult, SpringPreset, LayoutMode } from '@thangdevalone/meet-layout-grid-core';
|
|
3
|
-
export { GridDimensions, GridOptions, LayoutMode, MeetGridOptions, MeetGridResult, Position, SpringPreset, createGrid, createGridItemPositioner, createMeetGrid, getAspectRatio, getGridItemDimensions, getSpringConfig, springPresets } from '@thangdevalone/meet-layout-grid-core';
|
|
4
|
-
import * as vue from 'vue';
|
|
5
|
-
import { Ref, ComputedRef, InjectionKey, PropType } from 'vue';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Vue composable to track element dimensions using ResizeObserver.
|
|
9
|
-
* @param elementRef A ref to the target element
|
|
10
|
-
* @returns Reactive dimensions object
|
|
11
|
-
*/
|
|
12
|
-
declare function useGridDimensions(elementRef: Ref<HTMLElement | null | undefined>): ComputedRef<GridDimensions>;
|
|
13
|
-
/**
|
|
14
|
-
* Vue composable for creating a meet-style responsive grid.
|
|
15
|
-
* @param options Reactive or static grid options
|
|
16
|
-
* @returns Reactive grid result
|
|
17
|
-
*/
|
|
18
|
-
declare function useMeetGrid(options: Ref<MeetGridOptions> | ComputedRef<MeetGridOptions> | (() => MeetGridOptions)): ComputedRef<MeetGridResult>;
|
|
19
|
-
/**
|
|
20
|
-
* Composable to get animation configuration for Motion
|
|
21
|
-
*/
|
|
22
|
-
declare function useGridAnimation(preset?: SpringPreset): ComputedRef<{
|
|
23
|
-
stiffness: 400;
|
|
24
|
-
damping: 30;
|
|
25
|
-
type: "spring";
|
|
26
|
-
} | {
|
|
27
|
-
stiffness: 300;
|
|
28
|
-
damping: 30;
|
|
29
|
-
type: "spring";
|
|
30
|
-
} | {
|
|
31
|
-
stiffness: 200;
|
|
32
|
-
damping: 25;
|
|
33
|
-
type: "spring";
|
|
34
|
-
} | {
|
|
35
|
-
stiffness: 400;
|
|
36
|
-
damping: 15;
|
|
37
|
-
type: "spring";
|
|
38
|
-
}>;
|
|
39
|
-
/**
|
|
40
|
-
* Composable to get position for a specific grid item index
|
|
41
|
-
*/
|
|
42
|
-
declare function useGridItemPosition(grid: ComputedRef<MeetGridResult>, index: Ref<number> | ComputedRef<number> | number): {
|
|
43
|
-
position: ComputedRef<
|
|
44
|
-
dimensions: ComputedRef<GridDimensions>;
|
|
45
|
-
isMain: ComputedRef<boolean>;
|
|
46
|
-
isHidden: ComputedRef<boolean>;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
interface GridContextValue {
|
|
50
|
-
grid: ComputedRef<MeetGridResult>;
|
|
51
|
-
springPreset: SpringPreset;
|
|
52
|
-
}
|
|
53
|
-
declare const GridContextKey: InjectionKey<GridContextValue>;
|
|
54
|
-
declare const GridContainer: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
55
|
-
/** Aspect ratio in format "width:height" */
|
|
56
|
-
aspectRatio: {
|
|
57
|
-
type: StringConstructor;
|
|
58
|
-
default: string;
|
|
59
|
-
};
|
|
60
|
-
/** Gap between items in pixels */
|
|
61
|
-
gap: {
|
|
62
|
-
type: NumberConstructor;
|
|
63
|
-
default: number;
|
|
64
|
-
};
|
|
65
|
-
/** Number of items */
|
|
66
|
-
count: {
|
|
67
|
-
type: NumberConstructor;
|
|
68
|
-
required: true;
|
|
69
|
-
};
|
|
70
|
-
/** Layout mode */
|
|
71
|
-
layoutMode: {
|
|
72
|
-
type: PropType<LayoutMode>;
|
|
73
|
-
default: string;
|
|
74
|
-
};
|
|
75
|
-
/** Index of pinned item */
|
|
76
|
-
pinnedIndex: {
|
|
77
|
-
type: NumberConstructor;
|
|
78
|
-
default: undefined;
|
|
79
|
-
};
|
|
80
|
-
/** Index of active speaker */
|
|
81
|
-
speakerIndex: {
|
|
82
|
-
type: NumberConstructor;
|
|
83
|
-
default: undefined;
|
|
84
|
-
};
|
|
85
|
-
/** Sidebar position */
|
|
86
|
-
sidebarPosition: {
|
|
87
|
-
type: PropType<"left" | "right" | "bottom">;
|
|
88
|
-
default: string;
|
|
89
|
-
};
|
|
90
|
-
/** Sidebar ratio (0-1) */
|
|
91
|
-
sidebarRatio: {
|
|
92
|
-
type: NumberConstructor;
|
|
93
|
-
default: number;
|
|
94
|
-
};
|
|
95
|
-
/** Spring animation preset */
|
|
96
|
-
springPreset: {
|
|
97
|
-
type: PropType<SpringPreset>;
|
|
98
|
-
default: string;
|
|
99
|
-
};
|
|
100
|
-
/**
|
|
101
|
-
|
|
102
|
-
type:
|
|
103
|
-
default:
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
|
|
130
|
-
type:
|
|
131
|
-
default:
|
|
132
|
-
};
|
|
133
|
-
/**
|
|
134
|
-
|
|
135
|
-
type: NumberConstructor;
|
|
136
|
-
default:
|
|
137
|
-
};
|
|
138
|
-
/**
|
|
139
|
-
|
|
140
|
-
type:
|
|
141
|
-
|
|
142
|
-
};
|
|
143
|
-
/**
|
|
144
|
-
|
|
145
|
-
type:
|
|
146
|
-
default:
|
|
147
|
-
};
|
|
148
|
-
/**
|
|
149
|
-
|
|
150
|
-
type:
|
|
151
|
-
default:
|
|
152
|
-
};
|
|
153
|
-
/**
|
|
154
|
-
|
|
155
|
-
type:
|
|
156
|
-
default:
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
|
|
190
|
-
type: NumberConstructor;
|
|
191
|
-
|
|
192
|
-
};
|
|
193
|
-
/**
|
|
194
|
-
|
|
195
|
-
type:
|
|
196
|
-
default:
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
1
|
+
import * as _thangdevalone_meet_layout_grid_core from '@thangdevalone/meet-layout-grid-core';
|
|
2
|
+
import { GridDimensions, MeetGridOptions, MeetGridResult, SpringPreset, LayoutMode } from '@thangdevalone/meet-layout-grid-core';
|
|
3
|
+
export { GridDimensions, GridOptions, LayoutMode, MeetGridOptions, MeetGridResult, Position, SpringPreset, createGrid, createGridItemPositioner, createMeetGrid, getAspectRatio, getGridItemDimensions, getSpringConfig, springPresets } from '@thangdevalone/meet-layout-grid-core';
|
|
4
|
+
import * as vue from 'vue';
|
|
5
|
+
import { Ref, ComputedRef, InjectionKey, PropType } from 'vue';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Vue composable to track element dimensions using ResizeObserver.
|
|
9
|
+
* @param elementRef A ref to the target element
|
|
10
|
+
* @returns Reactive dimensions object
|
|
11
|
+
*/
|
|
12
|
+
declare function useGridDimensions(elementRef: Ref<HTMLElement | null | undefined>): ComputedRef<GridDimensions>;
|
|
13
|
+
/**
|
|
14
|
+
* Vue composable for creating a meet-style responsive grid.
|
|
15
|
+
* @param options Reactive or static grid options
|
|
16
|
+
* @returns Reactive grid result
|
|
17
|
+
*/
|
|
18
|
+
declare function useMeetGrid(options: Ref<MeetGridOptions> | ComputedRef<MeetGridOptions> | (() => MeetGridOptions)): ComputedRef<MeetGridResult>;
|
|
19
|
+
/**
|
|
20
|
+
* Composable to get animation configuration for Motion
|
|
21
|
+
*/
|
|
22
|
+
declare function useGridAnimation(preset?: SpringPreset): ComputedRef<{
|
|
23
|
+
stiffness: 400;
|
|
24
|
+
damping: 30;
|
|
25
|
+
type: "spring";
|
|
26
|
+
} | {
|
|
27
|
+
stiffness: 300;
|
|
28
|
+
damping: 30;
|
|
29
|
+
type: "spring";
|
|
30
|
+
} | {
|
|
31
|
+
stiffness: 200;
|
|
32
|
+
damping: 25;
|
|
33
|
+
type: "spring";
|
|
34
|
+
} | {
|
|
35
|
+
stiffness: 400;
|
|
36
|
+
damping: 15;
|
|
37
|
+
type: "spring";
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Composable to get position for a specific grid item index
|
|
41
|
+
*/
|
|
42
|
+
declare function useGridItemPosition(grid: ComputedRef<MeetGridResult>, index: Ref<number> | ComputedRef<number> | number): {
|
|
43
|
+
position: ComputedRef<_thangdevalone_meet_layout_grid_core.Position>;
|
|
44
|
+
dimensions: ComputedRef<GridDimensions>;
|
|
45
|
+
isMain: ComputedRef<boolean>;
|
|
46
|
+
isHidden: ComputedRef<boolean>;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
interface GridContextValue {
|
|
50
|
+
grid: ComputedRef<MeetGridResult>;
|
|
51
|
+
springPreset: SpringPreset;
|
|
52
|
+
}
|
|
53
|
+
declare const GridContextKey: InjectionKey<GridContextValue>;
|
|
54
|
+
declare const GridContainer: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
55
|
+
/** Aspect ratio in format "width:height" */
|
|
56
|
+
aspectRatio: {
|
|
57
|
+
type: StringConstructor;
|
|
58
|
+
default: string;
|
|
59
|
+
};
|
|
60
|
+
/** Gap between items in pixels */
|
|
61
|
+
gap: {
|
|
62
|
+
type: NumberConstructor;
|
|
63
|
+
default: number;
|
|
64
|
+
};
|
|
65
|
+
/** Number of items */
|
|
66
|
+
count: {
|
|
67
|
+
type: NumberConstructor;
|
|
68
|
+
required: true;
|
|
69
|
+
};
|
|
70
|
+
/** Layout mode */
|
|
71
|
+
layoutMode: {
|
|
72
|
+
type: PropType<LayoutMode>;
|
|
73
|
+
default: string;
|
|
74
|
+
};
|
|
75
|
+
/** Index of pinned item */
|
|
76
|
+
pinnedIndex: {
|
|
77
|
+
type: NumberConstructor;
|
|
78
|
+
default: undefined;
|
|
79
|
+
};
|
|
80
|
+
/** Index of active speaker */
|
|
81
|
+
speakerIndex: {
|
|
82
|
+
type: NumberConstructor;
|
|
83
|
+
default: undefined;
|
|
84
|
+
};
|
|
85
|
+
/** Sidebar position */
|
|
86
|
+
sidebarPosition: {
|
|
87
|
+
type: PropType<"left" | "right" | "top" | "bottom">;
|
|
88
|
+
default: string;
|
|
89
|
+
};
|
|
90
|
+
/** Sidebar ratio (0-1) */
|
|
91
|
+
sidebarRatio: {
|
|
92
|
+
type: NumberConstructor;
|
|
93
|
+
default: number;
|
|
94
|
+
};
|
|
95
|
+
/** Spring animation preset */
|
|
96
|
+
springPreset: {
|
|
97
|
+
type: PropType<SpringPreset>;
|
|
98
|
+
default: string;
|
|
99
|
+
};
|
|
100
|
+
/** Maximum items per page for pagination (0 = no pagination) */
|
|
101
|
+
maxItemsPerPage: {
|
|
102
|
+
type: NumberConstructor;
|
|
103
|
+
default: number;
|
|
104
|
+
};
|
|
105
|
+
/** Current page index (0-based) for pagination */
|
|
106
|
+
currentPage: {
|
|
107
|
+
type: NumberConstructor;
|
|
108
|
+
default: number;
|
|
109
|
+
};
|
|
110
|
+
/** Maximum visible "others" in speaker/sidebar modes (0 = show all) */
|
|
111
|
+
maxVisibleOthers: {
|
|
112
|
+
type: NumberConstructor;
|
|
113
|
+
default: number;
|
|
114
|
+
};
|
|
115
|
+
/** Current page for "others" in speaker/sidebar modes (0-based) */
|
|
116
|
+
currentOthersPage: {
|
|
117
|
+
type: NumberConstructor;
|
|
118
|
+
default: number;
|
|
119
|
+
};
|
|
120
|
+
/** HTML tag to render */
|
|
121
|
+
tag: {
|
|
122
|
+
type: StringConstructor;
|
|
123
|
+
default: string;
|
|
124
|
+
};
|
|
125
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
126
|
+
[key: string]: any;
|
|
127
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
128
|
+
/** Aspect ratio in format "width:height" */
|
|
129
|
+
aspectRatio: {
|
|
130
|
+
type: StringConstructor;
|
|
131
|
+
default: string;
|
|
132
|
+
};
|
|
133
|
+
/** Gap between items in pixels */
|
|
134
|
+
gap: {
|
|
135
|
+
type: NumberConstructor;
|
|
136
|
+
default: number;
|
|
137
|
+
};
|
|
138
|
+
/** Number of items */
|
|
139
|
+
count: {
|
|
140
|
+
type: NumberConstructor;
|
|
141
|
+
required: true;
|
|
142
|
+
};
|
|
143
|
+
/** Layout mode */
|
|
144
|
+
layoutMode: {
|
|
145
|
+
type: PropType<LayoutMode>;
|
|
146
|
+
default: string;
|
|
147
|
+
};
|
|
148
|
+
/** Index of pinned item */
|
|
149
|
+
pinnedIndex: {
|
|
150
|
+
type: NumberConstructor;
|
|
151
|
+
default: undefined;
|
|
152
|
+
};
|
|
153
|
+
/** Index of active speaker */
|
|
154
|
+
speakerIndex: {
|
|
155
|
+
type: NumberConstructor;
|
|
156
|
+
default: undefined;
|
|
157
|
+
};
|
|
158
|
+
/** Sidebar position */
|
|
159
|
+
sidebarPosition: {
|
|
160
|
+
type: PropType<"left" | "right" | "top" | "bottom">;
|
|
161
|
+
default: string;
|
|
162
|
+
};
|
|
163
|
+
/** Sidebar ratio (0-1) */
|
|
164
|
+
sidebarRatio: {
|
|
165
|
+
type: NumberConstructor;
|
|
166
|
+
default: number;
|
|
167
|
+
};
|
|
168
|
+
/** Spring animation preset */
|
|
169
|
+
springPreset: {
|
|
170
|
+
type: PropType<SpringPreset>;
|
|
171
|
+
default: string;
|
|
172
|
+
};
|
|
173
|
+
/** Maximum items per page for pagination (0 = no pagination) */
|
|
174
|
+
maxItemsPerPage: {
|
|
175
|
+
type: NumberConstructor;
|
|
176
|
+
default: number;
|
|
177
|
+
};
|
|
178
|
+
/** Current page index (0-based) for pagination */
|
|
179
|
+
currentPage: {
|
|
180
|
+
type: NumberConstructor;
|
|
181
|
+
default: number;
|
|
182
|
+
};
|
|
183
|
+
/** Maximum visible "others" in speaker/sidebar modes (0 = show all) */
|
|
184
|
+
maxVisibleOthers: {
|
|
185
|
+
type: NumberConstructor;
|
|
186
|
+
default: number;
|
|
187
|
+
};
|
|
188
|
+
/** Current page for "others" in speaker/sidebar modes (0-based) */
|
|
189
|
+
currentOthersPage: {
|
|
190
|
+
type: NumberConstructor;
|
|
191
|
+
default: number;
|
|
192
|
+
};
|
|
193
|
+
/** HTML tag to render */
|
|
194
|
+
tag: {
|
|
195
|
+
type: StringConstructor;
|
|
196
|
+
default: string;
|
|
197
|
+
};
|
|
198
|
+
}>> & Readonly<{}>, {
|
|
199
|
+
aspectRatio: string;
|
|
200
|
+
gap: number;
|
|
201
|
+
layoutMode: LayoutMode;
|
|
202
|
+
pinnedIndex: number;
|
|
203
|
+
speakerIndex: number;
|
|
204
|
+
sidebarPosition: "left" | "right" | "top" | "bottom";
|
|
205
|
+
sidebarRatio: number;
|
|
206
|
+
springPreset: "snappy" | "smooth" | "gentle" | "bouncy";
|
|
207
|
+
maxItemsPerPage: number;
|
|
208
|
+
currentPage: number;
|
|
209
|
+
maxVisibleOthers: number;
|
|
210
|
+
currentOthersPage: number;
|
|
211
|
+
tag: string;
|
|
212
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
213
|
+
declare const GridItem: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
214
|
+
/** Index of this item in the grid */
|
|
215
|
+
index: {
|
|
216
|
+
type: NumberConstructor;
|
|
217
|
+
required: true;
|
|
218
|
+
};
|
|
219
|
+
/** Whether to disable animations */
|
|
220
|
+
disableAnimation: {
|
|
221
|
+
type: BooleanConstructor;
|
|
222
|
+
default: boolean;
|
|
223
|
+
};
|
|
224
|
+
/** HTML tag to render */
|
|
225
|
+
tag: {
|
|
226
|
+
type: StringConstructor;
|
|
227
|
+
default: string;
|
|
228
|
+
};
|
|
229
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
230
|
+
[key: string]: any;
|
|
231
|
+
}> | null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
232
|
+
/** Index of this item in the grid */
|
|
233
|
+
index: {
|
|
234
|
+
type: NumberConstructor;
|
|
235
|
+
required: true;
|
|
236
|
+
};
|
|
237
|
+
/** Whether to disable animations */
|
|
238
|
+
disableAnimation: {
|
|
239
|
+
type: BooleanConstructor;
|
|
240
|
+
default: boolean;
|
|
241
|
+
};
|
|
242
|
+
/** HTML tag to render */
|
|
243
|
+
tag: {
|
|
244
|
+
type: StringConstructor;
|
|
245
|
+
default: string;
|
|
246
|
+
};
|
|
247
|
+
}>> & Readonly<{}>, {
|
|
248
|
+
tag: string;
|
|
249
|
+
disableAnimation: boolean;
|
|
250
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
251
|
+
declare const GridOverlay: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
252
|
+
/** Whether to show the overlay */
|
|
253
|
+
visible: {
|
|
254
|
+
type: BooleanConstructor;
|
|
255
|
+
default: boolean;
|
|
256
|
+
};
|
|
257
|
+
/** Background color */
|
|
258
|
+
backgroundColor: {
|
|
259
|
+
type: StringConstructor;
|
|
260
|
+
default: string;
|
|
261
|
+
};
|
|
262
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
263
|
+
[key: string]: any;
|
|
264
|
+
}> | null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
265
|
+
/** Whether to show the overlay */
|
|
266
|
+
visible: {
|
|
267
|
+
type: BooleanConstructor;
|
|
268
|
+
default: boolean;
|
|
269
|
+
};
|
|
270
|
+
/** Background color */
|
|
271
|
+
backgroundColor: {
|
|
272
|
+
type: StringConstructor;
|
|
273
|
+
default: string;
|
|
274
|
+
};
|
|
275
|
+
}>> & Readonly<{}>, {
|
|
276
|
+
backgroundColor: string;
|
|
277
|
+
visible: boolean;
|
|
278
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
279
|
+
|
|
280
|
+
export { GridContainer, GridContextKey, GridItem, GridOverlay, useGridAnimation, useGridDimensions, useGridItemPosition, useMeetGrid };
|
|
281
|
+
export type { GridContextValue };
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ref, onMounted, computed, defineComponent, provide, h, inject } from 'vue';
|
|
2
2
|
import { useResizeObserver } from '@vueuse/core';
|
|
3
|
-
import { createMeetGrid, getSpringConfig } from '@meet-layout-grid
|
|
4
|
-
export { createGrid, createGridItemPositioner, createMeetGrid, getAspectRatio, getGridItemDimensions, getSpringConfig, springPresets } from '@meet-layout-grid
|
|
5
|
-
import {
|
|
3
|
+
import { createMeetGrid, getSpringConfig } from '@thangdevalone/meet-layout-grid-core';
|
|
4
|
+
export { createGrid, createGridItemPositioner, createMeetGrid, getAspectRatio, getGridItemDimensions, getSpringConfig, springPresets } from '@thangdevalone/meet-layout-grid-core';
|
|
5
|
+
import { motion } from 'motion-v';
|
|
6
6
|
|
|
7
7
|
function useGridDimensions(elementRef) {
|
|
8
8
|
const width = ref(0);
|
|
@@ -100,6 +100,26 @@ const GridContainer = defineComponent({
|
|
|
100
100
|
type: String,
|
|
101
101
|
default: "smooth"
|
|
102
102
|
},
|
|
103
|
+
/** Maximum items per page for pagination (0 = no pagination) */
|
|
104
|
+
maxItemsPerPage: {
|
|
105
|
+
type: Number,
|
|
106
|
+
default: 0
|
|
107
|
+
},
|
|
108
|
+
/** Current page index (0-based) for pagination */
|
|
109
|
+
currentPage: {
|
|
110
|
+
type: Number,
|
|
111
|
+
default: 0
|
|
112
|
+
},
|
|
113
|
+
/** Maximum visible "others" in speaker/sidebar modes (0 = show all) */
|
|
114
|
+
maxVisibleOthers: {
|
|
115
|
+
type: Number,
|
|
116
|
+
default: 0
|
|
117
|
+
},
|
|
118
|
+
/** Current page for "others" in speaker/sidebar modes (0-based) */
|
|
119
|
+
currentOthersPage: {
|
|
120
|
+
type: Number,
|
|
121
|
+
default: 0
|
|
122
|
+
},
|
|
103
123
|
/** HTML tag to render */
|
|
104
124
|
tag: {
|
|
105
125
|
type: String,
|
|
@@ -118,7 +138,11 @@ const GridContainer = defineComponent({
|
|
|
118
138
|
pinnedIndex: props.pinnedIndex,
|
|
119
139
|
speakerIndex: props.speakerIndex,
|
|
120
140
|
sidebarPosition: props.sidebarPosition,
|
|
121
|
-
sidebarRatio: props.sidebarRatio
|
|
141
|
+
sidebarRatio: props.sidebarRatio,
|
|
142
|
+
maxItemsPerPage: props.maxItemsPerPage,
|
|
143
|
+
currentPage: props.currentPage,
|
|
144
|
+
maxVisibleOthers: props.maxVisibleOthers,
|
|
145
|
+
currentOthersPage: props.currentOthersPage
|
|
122
146
|
}));
|
|
123
147
|
const grid = useMeetGrid(gridOptions);
|
|
124
148
|
provide(GridContextKey, {
|
|
@@ -169,8 +193,13 @@ const GridItem = defineComponent({
|
|
|
169
193
|
const position = computed(() => grid.value.getPosition(props.index));
|
|
170
194
|
const dimensions = computed(() => grid.value.getItemDimensions(props.index));
|
|
171
195
|
const isMain = computed(() => grid.value.isMainItem(props.index));
|
|
196
|
+
const isVisible = computed(() => grid.value.isItemVisible(props.index));
|
|
172
197
|
const isHidden = computed(() => {
|
|
173
|
-
|
|
198
|
+
if (grid.value.layoutMode === "spotlight" && !isMain.value)
|
|
199
|
+
return true;
|
|
200
|
+
if (!isVisible.value)
|
|
201
|
+
return true;
|
|
202
|
+
return false;
|
|
174
203
|
});
|
|
175
204
|
const springConfig = getSpringConfig(springPreset);
|
|
176
205
|
return () => {
|
|
@@ -202,9 +231,9 @@ const GridItem = defineComponent({
|
|
|
202
231
|
);
|
|
203
232
|
}
|
|
204
233
|
return h(
|
|
205
|
-
|
|
234
|
+
motion.div,
|
|
206
235
|
{
|
|
207
|
-
|
|
236
|
+
as: props.tag,
|
|
208
237
|
animate: animateProps,
|
|
209
238
|
transition: {
|
|
210
239
|
type: springConfig.type,
|