@thangdevalone/meeting-grid-layout-core 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,68 @@
1
+ # @thangdevalone/meeting-grid-layout-core
2
+
3
+ Framework-agnostic grid calculation engine for meeting-grid-layout. Zero dependencies.
4
+
5
+ > For full documentation, examples, 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-core
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```typescript
16
+ import { createMeetGrid } from '@thangdevalone/meeting-grid-layout-core'
17
+
18
+ const grid = createMeetGrid({
19
+ dimensions: { width: 800, height: 600 },
20
+ count: 6,
21
+ aspectRatio: '16:9',
22
+ gap: 8,
23
+ layoutMode: 'gallery',
24
+ pinnedIndex: 0,
25
+ othersPosition: 'bottom',
26
+ })
27
+
28
+ for (let i = 0; i < 6; i++) {
29
+ const { top, left } = grid.getPosition(i)
30
+ const { width, height } = grid.getItemDimensions(i)
31
+ const isMain = grid.isMainItem(i)
32
+ console.log(`Item ${i}: ${width}x${height} at (${left}, ${top}), main: ${isMain}`)
33
+ }
34
+ ```
35
+
36
+ ## Exports
37
+
38
+ ### Functions
39
+
40
+ | Function | Description |
41
+ | ------------------------------- | -------------------------------------------- |
42
+ | `createMeetGrid(options)` | Full meet-style grid with layout modes |
43
+ | `createGrid(options)` | Basic responsive grid (no layout modes) |
44
+ | `getAspectRatio(ratio)` | Parse aspect ratio string to numeric value |
45
+ | `getGridItemDimensions(…)` | Get dimensions for a specific grid item |
46
+ | `createGridItemPositioner(…)` | Create a reusable position calculator |
47
+ | `getSpringConfig(preset)` | Get spring animation config from preset name |
48
+ | `calculateContentDimensions(…)` | Calculate content size within a cell |
49
+
50
+ ### Types
51
+
52
+ | Type | Description |
53
+ | ------------------- | ------------------------------------------ |
54
+ | `MeetGridOptions` | Options for `createMeetGrid` |
55
+ | `MeetGridResult` | Return type of `createMeetGrid` |
56
+ | `GridOptions` | Options for `createGrid` |
57
+ | `GridResult` | Return type of `createGrid` |
58
+ | `GridDimensions` | `{ width, height }` |
59
+ | `Position` | `{ top, left }` |
60
+ | `LayoutMode` | `'gallery' \| 'spotlight'` |
61
+ | `ItemAspectRatio` | `string \| 'auto'` |
62
+ | `ContentDimensions` | `{ width, height, offsetTop, offsetLeft }` |
63
+ | `PaginationInfo` | Pagination state details |
64
+ | `SpringPreset` | Animation preset names |
65
+
66
+ ## License
67
+
68
+ MIT