@thangdevalone/meet-layout-grid-core 1.0.6 → 1.0.7

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.
Files changed (2) hide show
  1. package/README.md +24 -28
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @thangdevalone/meet-layout-grid-core
2
2
 
3
- Core grid calculation logic for meet-layout-grid library. Zero dependencies, framework-agnostic.
3
+ Grid calculation logic for meet-layout-grid. No dependencies, works with any framework.
4
4
 
5
5
  ## Installation
6
6
 
@@ -13,7 +13,7 @@ npm install @thangdevalone/meet-layout-grid-core
13
13
  ```typescript
14
14
  import { createMeetGrid, createGrid } from '@thangdevalone/meet-layout-grid-core'
15
15
 
16
- // Basic grid
16
+ // Simple grid
17
17
  const grid = createGrid({
18
18
  dimensions: { width: 800, height: 600 },
19
19
  count: 6,
@@ -24,7 +24,6 @@ const grid = createGrid({
24
24
  console.log(`Item size: ${grid.width}x${grid.height}`)
25
25
  console.log(`Grid: ${grid.cols} cols, ${grid.rows} rows`)
26
26
 
27
- // Position each item
28
27
  for (let i = 0; i < 6; i++) {
29
28
  const { top, left } = grid.getPosition(i)
30
29
  console.log(`Item ${i}: top=${top}, left=${left}`)
@@ -40,7 +39,6 @@ const meetGrid = createMeetGrid({
40
39
  speakerIndex: 0,
41
40
  })
42
41
 
43
- // Items may have different sizes in speaker mode
44
42
  for (let i = 0; i < 6; i++) {
45
43
  const { width, height } = meetGrid.getItemDimensions(i)
46
44
  const isMain = meetGrid.isMainItem(i)
@@ -52,43 +50,41 @@ for (let i = 0; i < 6; i++) {
52
50
 
53
51
  ### `createGrid(options)`
54
52
 
55
- Creates a basic responsive grid.
53
+ Basic responsive grid.
56
54
 
57
55
  **Options:**
58
- - `dimensions: { width, height }` - Container dimensions
59
- - `count: number` - Number of items
60
- - `aspectRatio: string` - Aspect ratio (e.g., "16:9")
61
- - `gap: number` - Gap between items in pixels
56
+ - `dimensions: { width, height }` Container size
57
+ - `count: number` Number of items
58
+ - `aspectRatio: string` e.g. `"16:9"`
59
+ - `gap: number` Gap between items (px)
62
60
 
63
61
  **Returns:**
64
- - `width: number` - Item width
65
- - `height: number` - Item height
66
- - `rows: number` - Number of rows
67
- - `cols: number` - Number of columns
68
- - `getPosition(index): { top, left }` - Position getter
62
+ - `width`, `height` Item size
63
+ - `rows`, `cols` Grid shape
64
+ - `getPosition(index): { top, left }`
69
65
 
70
66
  ### `createMeetGrid(options)`
71
67
 
72
- Creates a meet-style grid with layout modes.
68
+ Meet-style grid with layout modes.
73
69
 
74
- **Additional Options:**
70
+ **Extra options:**
75
71
  - `layoutMode: 'gallery' | 'speaker' | 'spotlight' | 'sidebar'`
76
- - `pinnedIndex?: number` - Index of pinned item
77
- - `speakerIndex?: number` - Index of active speaker
72
+ - `pinnedIndex?: number`
73
+ - `speakerIndex?: number`
78
74
  - `sidebarPosition?: 'left' | 'right' | 'bottom'`
79
- - `sidebarRatio?: number` - Sidebar width ratio (0-1)
75
+ - `sidebarRatio?: number` 01
80
76
 
81
- **Additional Returns:**
82
- - `layoutMode: LayoutMode` - Current layout mode
83
- - `getItemDimensions(index): { width, height }` - Per-item dimensions
84
- - `isMainItem(index): boolean` - Check if item is featured
77
+ **Extra returns:**
78
+ - `layoutMode`
79
+ - `getItemDimensions(index): { width, height }`
80
+ - `isMainItem(index): boolean`
85
81
 
86
- ## Layout Modes
82
+ ## Layout modes
87
83
 
88
- - **Gallery** - Equal-sized tiles in a responsive grid
89
- - **Speaker** - Active speaker takes larger space (65% height)
90
- - **Spotlight** - Single participant in focus, others hidden
91
- - **Sidebar** - Main view with thumbnail strip
84
+ - **gallery** Same-size tiles in a grid
85
+ - **speaker** One large tile (~65% height), rest below
86
+ - **spotlight** One participant only
87
+ - **sidebar** Main area + thumbnail strip
92
88
 
93
89
  ## License
94
90
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thangdevalone/meet-layout-grid-core",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Core grid calculation logic for meet-layout-grid",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",