@prenta/admin 2.11.1 → 2.11.2
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/CHANGELOG.md +6 -0
- package/dist/__tests__/views/media-grid.test.d.ts +2 -0
- package/dist/__tests__/views/media-grid.test.d.ts.map +1 -0
- package/dist/__tests__/views/media-grid.test.js +20 -0
- package/dist/__tests__/views/media-grid.test.js.map +1 -0
- package/dist/prenta-admin.css +1 -1
- package/dist/views/MediaBrowser.d.ts +3 -0
- package/dist/views/MediaBrowser.d.ts.map +1 -1
- package/dist/views/MediaBrowser.js +31 -33
- package/dist/views/MediaBrowser.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/views/media-grid.test.ts +22 -0
- package/src/views/MediaBrowser.tsx +38 -31
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @actuate-media/cms-admin
|
|
2
2
|
|
|
3
|
+
## 2.11.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ac5b74b: Media library grid: cards no longer overlap and crop each other. The grid now uses the kit's layout (cards at least 220px wide with a fixed 118px thumbnail and a 14px gap), so each card matches the virtualised row height, and the column count comes from the grid's measured width instead of the window width.
|
|
8
|
+
|
|
3
9
|
## 2.11.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-grid.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/views/media-grid.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { MEDIA_GRID_ROW_HEIGHT, mediaGridColumns } from '../../views/MediaBrowser.js';
|
|
3
|
+
describe('media grid layout', () => {
|
|
4
|
+
it('fits auto-fill minmax(220px, 1fr) columns with a 14px gap', () => {
|
|
5
|
+
expect(mediaGridColumns(219)).toBe(1);
|
|
6
|
+
expect(mediaGridColumns(220)).toBe(1);
|
|
7
|
+
expect(mediaGridColumns(454)).toBe(2);
|
|
8
|
+
expect(mediaGridColumns(453)).toBe(1);
|
|
9
|
+
expect(mediaGridColumns(1170)).toBe(5);
|
|
10
|
+
});
|
|
11
|
+
it('falls back to four columns before the grid is measured', () => {
|
|
12
|
+
expect(mediaGridColumns(0)).toBe(4);
|
|
13
|
+
});
|
|
14
|
+
// Rows are virtualised at this stride; cards taller than it overlap the next
|
|
15
|
+
// row (the cropped-tile bug), so the stride is the fixed card height + gap.
|
|
16
|
+
it('uses the fixed card height plus the gap as the row stride', () => {
|
|
17
|
+
expect(MEDIA_GRID_ROW_HEIGHT).toBe(172 + 14);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=media-grid.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-grid.test.js","sourceRoot":"","sources":["../../../src/__tests__/views/media-grid.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAErF,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,2DAA2D,EAAE,GAAG,EAAE;QACnE,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACrC,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACrC,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACrC,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACrC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACxC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wDAAwD,EAAE,GAAG,EAAE;QAChE,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;IAEF,6EAA6E;IAC7E,4EAA4E;IAC5E,EAAE,CAAC,2DAA2D,EAAE,GAAG,EAAE;QACnE,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAA;IAC9C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|