@kolkrabbi/kol-shell 0.73.0 → 0.75.0
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/package.json +5 -5
- package/src/CatalogPage.jsx +17 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.75.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The application shell",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"./src/*": "./src/*"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@kolkrabbi/kol-component": ">=0.
|
|
15
|
+
"@kolkrabbi/kol-component": ">=0.291.0",
|
|
16
16
|
"@kolkrabbi/kol-icons": ">=0.16.0",
|
|
17
17
|
"@kolkrabbi/kol-theme": ">=0.179.0",
|
|
18
18
|
"gsap": "^3.13.0",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"react-dom": "^18.3.0 || ^19.0.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@kolkrabbi/kol-component": "^0.
|
|
24
|
-
"@kolkrabbi/kol-framework": "^0.52.0",
|
|
23
|
+
"@kolkrabbi/kol-component": "^0.291.0",
|
|
25
24
|
"@kolkrabbi/kol-icons": "^0.41.0",
|
|
26
|
-
"@kolkrabbi/kol-
|
|
25
|
+
"@kolkrabbi/kol-framework": "^0.53.0",
|
|
26
|
+
"@kolkrabbi/kol-theme": "^0.183.0"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"src",
|
package/src/CatalogPage.jsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useRef, useState } from 'react'
|
|
2
|
-
import { ActionButton, ContentCard, ContentFilters, ContentRow, SizeOrDownload, formatSize } from '@kolkrabbi/kol-component'
|
|
2
|
+
import { ActionButton, AppItemMenuProvider, ContentCard, ContentFilters, ContentRow, SizeOrDownload, formatSize } from '@kolkrabbi/kol-component'
|
|
3
3
|
import PageShell from './PageShell.jsx'
|
|
4
4
|
import { PageHeader } from '@kolkrabbi/kol-component'
|
|
5
5
|
import WalkthroughPanel from './WalkthroughPanel.jsx'
|
|
@@ -37,7 +37,9 @@ import WalkthroughPanel from './WalkthroughPanel.jsx'
|
|
|
37
37
|
* variant's A4, so nothing existing moves. Anything `ContentFilters` takes that the page has no
|
|
38
38
|
* prop for goes through `filtersProps` — `mutuallyExclusiveFilters` was the gap.
|
|
39
39
|
*
|
|
40
|
-
* @param {'catalog'|'shelf'} preset the whole page as one word (default `catalog` = today's defaults). `
|
|
40
|
+
* @param {'catalog'|'app'|'shelf'} preset the whole page as one word (default `catalog` = today's defaults). `app` = an
|
|
41
|
+
* app's saved files: the `app` card and row (`toCard` returns `verbs` · `download` ·
|
|
42
|
+
* `menuItems` · `date` ms · `size` bytes · `media` src) and one shared menu. `shelf` = a
|
|
41
43
|
* shelf of slide decks: capped · 3 tracks on a 280 floor · `slide` card and row · stacked
|
|
42
44
|
* list · `kol-tone-secondary` on the root · the All / Recent view strip; `toCard` returns
|
|
43
45
|
* the deck's fields and handlers — `title date bytes count cover href onNavigate onDownload
|
|
@@ -62,8 +64,9 @@ import WalkthroughPanel from './WalkthroughPanel.jsx'
|
|
|
62
64
|
* @param {number} minColumn the grid track's floor in px (default 160) — a minimum, never a count
|
|
63
65
|
* @param {number} maxColumns the grid's ceiling (default 6, the ruling); a three-deck shelf passes 3 and the tracks share the width
|
|
64
66
|
* @param {string} cardVariant the grid card's variant, per page (default `catalog`); `toCard` may return `variant` per card
|
|
65
|
-
* @param {'catalog'|'file'} rowVariant the list row (default `catalog`, the 36px no-thumb row); `file` = the 48px thumb row, for a catalog whose grid shows a cover —
|
|
67
|
+
* @param {'catalog'|'file'|'app'} rowVariant the list row (default `catalog`, the 36px no-thumb row); `file` = the 48px thumb row, for a catalog whose grid shows a cover —
|
|
66
68
|
* its slots (`date` · `size` · `meta` · `selected`) come from `toCard` like everything else
|
|
69
|
+
* @param {number} listColumns the list grid's column ceiling (default 3 for a file, app or slide row, else 4); tracks never go under 240
|
|
67
70
|
* @param {'grid'|'stack'} listLayout the list's container (default `grid`, rows four across — monitor's ruling); `stack` = one row per line
|
|
68
71
|
* @param {ElementType} iconComponent icon renderer seam for ContentFilters
|
|
69
72
|
* @param {boolean} showCountOnlyWhenFiltering (default true)
|
|
@@ -96,6 +99,9 @@ function computeHiddenSet(items, expandedIdx) {
|
|
|
96
99
|
* value read off the render. An explicit prop always wins over its preset. */
|
|
97
100
|
const PRESETS = {
|
|
98
101
|
catalog: {},
|
|
102
|
+
/* an app's saved files (CatalogAppVariant, kol-fxr 2026-10-23): the `app` card and row — `toCard`
|
|
103
|
+
* returns `verbs` · `download` · `menuItems` · `date` · `size` · `media` and the page draws the rest */
|
|
104
|
+
app: { cardVariant: 'app', rowVariant: 'app' },
|
|
99
105
|
shelf: {
|
|
100
106
|
width: 'capped', maxColumns: 3, minColumn: 280,
|
|
101
107
|
cardVariant: 'slide', rowVariant: 'slide', listLayout: 'stack',
|
|
@@ -174,6 +180,10 @@ export default function CatalogPage({
|
|
|
174
180
|
line, which is what a list of files is (MediaLibrary stacks); olina's deck list
|
|
175
181
|
rendered three 300px rows side by side (user: "why is it tiny?"). */
|
|
176
182
|
listLayout = PRESETS[preset]?.listLayout ?? 'grid',
|
|
183
|
+
/* the LIST grid's column ceiling (2026-10-22 — user: *"are you passing props on number of items/columns?"*). It was
|
|
184
|
+
a hard 4 — monitor's ruling for the 36px catalog row. A file or slide row is a contained tile with a 72 thumb, so
|
|
185
|
+
it defaults to 3 (user: *"change this one to 3"*). Tracks still never go under 240. */
|
|
186
|
+
listColumns = rowVariant === 'file' || rowVariant === 'app' || rowVariant === 'slide' ? 3 : 4,
|
|
177
187
|
iconComponent,
|
|
178
188
|
showCountOnlyWhenFiltering = true,
|
|
179
189
|
filtersProps,
|
|
@@ -206,7 +216,9 @@ export default function CatalogPage({
|
|
|
206
216
|
observer.current = ro
|
|
207
217
|
}, [minColumn, maxColumns])
|
|
208
218
|
|
|
219
|
+
/* the page's ONE menu for its `app` cards and rows (AppItem.jsx) — closed, it renders nothing */
|
|
209
220
|
return (
|
|
221
|
+
<AppItemMenuProvider>
|
|
210
222
|
<PageShell width={width} className={`${PRESETS[preset]?.className ?? ''} ${className}`.trim()} style={{ overflow: 'hidden', '--kol-catalog-n': cols ?? undefined, ...style }}>
|
|
211
223
|
{header && <PageHeader level="app" {...header} />}
|
|
212
224
|
<div style={{ flex: 1, position: 'relative' }}>
|
|
@@ -246,7 +258,7 @@ export default function CatalogPage({
|
|
|
246
258
|
/* the catalog grid is a CLASS (`.kol-catalog-grid`, kol-theme ≥0.138.0) reading
|
|
247
259
|
* `--kol-catalog-n`, the count measured above and set on PageShell — the same
|
|
248
260
|
* number the filter row's first group reads */
|
|
249
|
-
<div ref={layout === 'list' ? undefined : gridRef} className={layout === 'list' ? undefined : 'kol-catalog-grid'} style={layout === 'list' ? (listLayout === 'stack' ? { display: 'flex', flexDirection: 'column', gap: 8 } : { display: 'grid', gridTemplateColumns:
|
|
261
|
+
<div ref={layout === 'list' ? undefined : gridRef} className={layout === 'list' ? undefined : 'kol-catalog-grid'} style={layout === 'list' ? (listLayout === 'stack' ? { display: 'flex', flexDirection: 'column', gap: 8 } : { display: 'grid', gridTemplateColumns: `repeat(auto-fill, minmax(min(100%, max(240px, calc((100% - ${listColumns - 1} * 8px) / ${listColumns}))), 1fr))`, gap: 8 }) : undefined}>
|
|
250
262
|
{rows.map((item, i) => {
|
|
251
263
|
if (hidden.has(i)) return null
|
|
252
264
|
const c = cards[i]
|
|
@@ -275,5 +287,6 @@ export default function CatalogPage({
|
|
|
275
287
|
{children}
|
|
276
288
|
{actions && <div style={{ display: 'flex', gap: 12, marginTop: 48, alignSelf: 'flex-start' }}>{actions}</div>}
|
|
277
289
|
</PageShell>
|
|
290
|
+
</AppItemMenuProvider>
|
|
278
291
|
)
|
|
279
292
|
}
|