@thangdevalone/meeting-grid-layout-vue 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 ADDED
@@ -0,0 +1,44 @@
1
+ MIT License with Attribution Requirement
2
+
3
+ Copyright (c) 2024-2026 ThangDevAlone
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ 1. The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ 2. ATTRIBUTION REQUIREMENT: Any project using this Software must include
16
+ visible attribution to the original author in one of the following ways:
17
+
18
+ a) In the project's README or documentation file, include:
19
+ "This project uses meet-layout-grid by @thangdevalone
20
+ (https://github.com/thangdevalone/meet-layout-grid)"
21
+
22
+ b) In an "About" or "Credits" section of the application, include:
23
+ "Powered by meet-layout-grid - https://github.com/thangdevalone/meet-layout-grid"
24
+
25
+ c) In the project's package.json or equivalent dependency manifest, ensure
26
+ the package is listed with its original name and author information intact.
27
+
28
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
29
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
30
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
31
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
32
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
33
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34
+ SOFTWARE.
35
+
36
+ ---
37
+
38
+ TL;DR - Bạn được phép:
39
+ ✅ Sử dụng miễn phí cho dự án cá nhân và thương mại
40
+ ✅ Chỉnh sửa và phân phối lại
41
+ ✅ Sử dụng trong các dự án closed-source
42
+
43
+ Yêu cầu duy nhất:
44
+ 📝 Ghi nguồn/credit cho tác giả gốc trong README hoặc phần About của dự án
package/README.md ADDED
@@ -0,0 +1,175 @@
1
+ # @thangdevalone/meeting-grid-layout-vue
2
+
3
+ Vue 3 bindings for meeting-grid-layout with motion-v animations.
4
+
5
+ > For full documentation, layout modes, and API reference, see the [main README](https://github.com/thangdevalone/meeting-grid-layout#readme).
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @thangdevalone/meeting-grid-layout-vue
11
+ ```
12
+
13
+ ## Quick Start
14
+
15
+ ```vue
16
+ <script setup>
17
+ import { GridContainer, GridItem } from '@thangdevalone/meeting-grid-layout-vue'
18
+ import { ref } from 'vue'
19
+
20
+ const participants = ref([
21
+ { id: 1, name: 'You' },
22
+ { id: 2, name: 'User 1' },
23
+ ])
24
+ </script>
25
+
26
+ <template>
27
+ <GridContainer aspect-ratio="16:9" :gap="8" :count="participants.length" layout-mode="gallery">
28
+ <GridItem v-for="(participant, index) in participants" :key="participant.id" :index="index">
29
+ <VideoTile :participant="participant" />
30
+ </GridItem>
31
+ </GridContainer>
32
+ </template>
33
+ ```
34
+
35
+ ## Components
36
+
37
+ ### `<GridContainer>`
38
+
39
+ Wraps the grid and provides layout via `provide`/`inject`.
40
+
41
+ | Prop | Type | Default | Description |
42
+ | ---------------------- | ----------------------------------------- | ----------- | -------------------------------------------------------------------- |
43
+ | `aspect-ratio` | `string` | `'16:9'` | Default tile aspect ratio |
44
+ | `gap` | `number` | `8` | Gap between tiles (px) |
45
+ | `count` | `number` | required | Number of items |
46
+ | `layout-mode` | `LayoutMode` | `'gallery'` | `gallery` \| `spotlight` |
47
+ | `pinned-index` | `number` | - | Pinned participant index |
48
+ | `others-position` | `'left' \| 'right' \| 'top' \| 'bottom'` | `'right'` | Thumbnail position in pin mode |
49
+ | `spring-preset` | `SpringPreset` | `'smooth'` | Animation preset |
50
+ | `max-items-per-page` | `number` | `0` | Max items per page (0 = no pagination) |
51
+ | `current-page` | `number` | `0` | Current page |
52
+ | `max-visible` | `number` | `0` | Max visible in others area (0 = show all) |
53
+ | `current-visible-page` | `number` | `0` | Current page for visible items (when max-visible > 0) |
54
+ | `item-aspect-ratios` | `(ItemAspectRatio \| undefined)[]` | - | Per-item aspect ratios |
55
+ | `float-width` | `number` | - | Width of the auto-float PiP (2-person mode). Overrides breakpoints. |
56
+ | `float-height` | `number` | - | Height of the auto-float PiP (2-person mode). Overrides breakpoints. |
57
+ | `float-breakpoints` | `PipBreakpoint[]` | - | Responsive breakpoints for auto-float PiP (see [Responsive PiP](#responsive-pip)) |
58
+ | `tag` | `string` | `'div'` | Root HTML element tag |
59
+
60
+ ### `<GridItem>`
61
+
62
+ Single grid cell with motion-v animation.
63
+
64
+ | Prop | Type | Default | Description |
65
+ | ------------------- | ----------------- | -------- | ------------------------------------------ |
66
+ | `index` | `number` | required | Item index |
67
+ | `disable-animation` | `boolean` | `false` | Disable layout animation |
68
+ | `item-aspect-ratio` | `ItemAspectRatio` | - | Per-item aspect ratio (overrides container) |
69
+ | `tag` | `string` | `'div'` | Root HTML element tag |
70
+
71
+ Scoped slot props: `{ contentDimensions, isLastVisibleOther, hiddenCount, isFloat }`
72
+
73
+ ```vue
74
+ <GridItem v-for="(p, index) in participants" :key="p.id" :index="index">
75
+ <template #default="{ isLastVisibleOther, hiddenCount }">
76
+ <div v-if="isLastVisibleOther && hiddenCount > 0" class="more-indicator">
77
+ +{{ hiddenCount }} more
78
+ </div>
79
+ <VideoTile v-else :participant="p" />
80
+ </template>
81
+ </GridItem>
82
+ ```
83
+
84
+ ### `<FloatingGridItem>`
85
+
86
+ Draggable Picture-in-Picture overlay with corner snapping.
87
+
88
+ | Prop | Type | Default | Description |
89
+ | ------------------ | ------------------------------------------------------------- | -------------------------------- | ------------------------------------------------ |
90
+ | `width` | `number` | `120` | Floating item width (px). Overridden by `breakpoints`. |
91
+ | `height` | `number` | `160` | Floating item height (px). Overridden by `breakpoints`. |
92
+ | `breakpoints` | `PipBreakpoint[]` | - | Responsive breakpoints (see [Responsive PiP](#responsive-pip)) |
93
+ | `initial-position` | `{ x: number; y: number }` | `{ x: 16, y: 16 }` | Extra offset from anchor corner |
94
+ | `anchor` | `'top-left' \| 'top-right' \| 'bottom-left' \| 'bottom-right'` | `'bottom-right'` | Which corner to snap/anchor the item |
95
+ | `visible` | `boolean` | `true` | Whether the floating item is visible |
96
+ | `edge-padding` | `number` | `12` | Minimum padding from container edges (px) |
97
+ | `border-radius` | `number` | `12` | Border radius of the floating item (px) |
98
+ | `box-shadow` | `string` | `'0 4px 20px rgba(0,0,0,0.3)'` | CSS box-shadow of the floating item |
99
+
100
+ **Events:**
101
+
102
+ | Event | Payload | Description |
103
+ | ---------------- | ---------- | ------------------------------------------ |
104
+ | `@anchor-change` | `string` | Emitted when anchor corner changes on drag |
105
+
106
+ ### `<GridOverlay>`
107
+
108
+ Full-grid overlay for screen sharing, whiteboard, etc.
109
+
110
+ | Prop | Type | Default | Description |
111
+ | ------------------ | --------- | -------------------- | ------------------------ |
112
+ | `visible` | `boolean` | `true` | Show/hide the overlay |
113
+ | `background-color` | `string` | `'rgba(0,0,0,0.5)'` | Overlay background color |
114
+
115
+ ## Responsive PiP
116
+
117
+ PiP supports responsive breakpoints that auto-adjust size based on container width.
118
+
119
+ ```vue
120
+ <script setup>
121
+ import { FloatingGridItem, DEFAULT_FLOAT_BREAKPOINTS } from '@thangdevalone/meet-layout-grid-vue'
122
+ </script>
123
+
124
+ <template>
125
+ <!-- Standalone FloatingGridItem — auto-responsive -->
126
+ <FloatingGridItem :breakpoints="DEFAULT_FLOAT_BREAKPOINTS">
127
+ <VideoTile />
128
+ </FloatingGridItem>
129
+
130
+ <!-- Auto-float in 2-person mode — responsive PiP via GridContainer -->
131
+ <GridContainer :count="2" :float-breakpoints="DEFAULT_FLOAT_BREAKPOINTS">
132
+ <GridItem v-for="(p, i) in participants" :key="p.id" :index="i">
133
+ <VideoTile :participant="p" />
134
+ </GridItem>
135
+ </GridContainer>
136
+ </template>
137
+ ```
138
+
139
+ Resolve PiP size programmatically:
140
+
141
+ ```ts
142
+ import { resolveFloatSize, DEFAULT_FLOAT_BREAKPOINTS } from '@thangdevalone/meet-layout-grid-vue'
143
+
144
+ const size = resolveFloatSize(800, DEFAULT_FLOAT_BREAKPOINTS)
145
+ // → { width: 160, height: 215 }
146
+ ```
147
+
148
+ > See the [main README](https://github.com/thangdevalone/meet-layout-grid#responsive-pip) for full details, default breakpoint table, and custom breakpoint examples.
149
+
150
+ ## Composables
151
+
152
+ | Composable | Description |
153
+ | ---------------------------------- | ------------------------------------- |
154
+ | `useGridDimensions(ref)` | Track element size via ResizeObserver |
155
+ | `useMeetGrid(options)` | Compute grid layout programmatically |
156
+ | `useGridAnimation()` | Access animation config from context |
157
+ | `useGridItemPosition(grid, index)` | Get position and size for one item |
158
+
159
+ ## Re-exported from Core
160
+
161
+ | Export | Type | Description |
162
+ | --------------------------- | ---------- | ------------------------------------------------ |
163
+ | `createMeetGrid` | function | Create grid layout (Vanilla JS) |
164
+ | `createGrid` | function | Low-level grid computation |
165
+ | `resolveFloatSize` | function | Resolve PiP size for a given container width |
166
+ | `DEFAULT_FLOAT_BREAKPOINTS` | constant | Ready-made 5-level responsive PiP breakpoints |
167
+ | `getSpringConfig` | function | Get spring config from preset name |
168
+ | `springPresets` | object | All spring presets |
169
+ | `getAspectRatio` | function | Parse aspect ratio string |
170
+ | `PipBreakpoint` | type | Breakpoint definition type |
171
+ | `ContentDimensions` | type | Content dimensions with offset |
172
+
173
+ ## License
174
+
175
+ MIT