@kolkrabbi/kol-shell 0.9.1 → 0.10.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 +34 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "KOL application shell — fixed 48px NavRail + AppShell layout root, PageShell/PageHeader scaffolds, ContentFilters catalog organism, GridCard, SettingsScaffold, WalkthroughPanel, ShortcutsOverlay. App chrome (kol-framework owns site chrome). Nav items, content, shortcuts and settings are consumer-injected. Sits above @kolkrabbi/kol-{theme,component,framework}.",
|
|
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.108.0",
|
|
16
16
|
"@kolkrabbi/kol-framework": ">=0.20.0",
|
|
17
17
|
"@kolkrabbi/kol-icons": ">=0.16.0",
|
|
18
18
|
"@kolkrabbi/kol-theme": ">=0.68.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.
|
|
23
|
+
"@kolkrabbi/kol-component": "^0.108.0",
|
|
24
24
|
"@kolkrabbi/kol-framework": "^0.28.0",
|
|
25
|
-
"@kolkrabbi/kol-
|
|
26
|
-
"@kolkrabbi/kol-
|
|
25
|
+
"@kolkrabbi/kol-theme": "^0.72.0",
|
|
26
|
+
"@kolkrabbi/kol-icons": "^0.22.0"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"src",
|
package/src/CatalogPage.jsx
CHANGED
|
@@ -18,10 +18,16 @@ import WalkthroughPanel from './WalkthroughPanel.jsx'
|
|
|
18
18
|
*
|
|
19
19
|
* Semantics are the consumer's: what RECENT / SAVED mean, what an item is,
|
|
20
20
|
* what a click does. `toCard(item, { view, layout })` → `{ key, title, detail,
|
|
21
|
-
* media, actions, onClick, href, onNavigate, expanded, expandedContent }` is
|
|
22
|
-
* whole contract — `expanded` / `expandedContent` reach `ContentCard catalog`'s
|
|
23
|
-
* 2×2 cell (ShellHomeSystemMonitorGaps, kol-monitor 2026-08-27
|
|
24
|
-
*
|
|
21
|
+
* media, actions, onClick, href, onNavigate, expanded, expandedContent, fit }` is
|
|
22
|
+
* the whole contract — `expanded` / `expandedContent` reach `ContentCard catalog`'s
|
|
23
|
+
* 2×2 cell (ShellHomeSystemMonitorGaps, kol-monitor 2026-08-27) — and the page
|
|
24
|
+
* HIDES the cell's three neighbours itself (CatalogPageMonitorParity: the
|
|
25
|
+
* consumer never sees the filtered row order, so it cannot; monitor's
|
|
26
|
+
* `computeHiddenSet` for the 6-column grid, verbatim — the grid stays still
|
|
27
|
+
* instead of reflowing around the expanded card); `fit` (`cover` default | `natural` | `compact`) is the
|
|
28
|
+
* card's media fit, PER CARD because one catalog mixes photographs (cover) and
|
|
29
|
+
* diagrams (natural) — CatalogPageCardFit, kol-monitor: a rack preview wider
|
|
30
|
+
* than the card lost its left rail to `cover`. Anything `ContentFilters` takes that the page has no
|
|
25
31
|
* prop for goes through `filtersProps` — `mutuallyExclusiveFilters` was the gap.
|
|
26
32
|
*
|
|
27
33
|
* @param {Object} header PageHeader props — `{ title, subtitle, size, voice, eyebrow }`
|
|
@@ -45,6 +51,20 @@ const LAYOUTS = [
|
|
|
45
51
|
{ value: 'grid', label: 'GRID' },
|
|
46
52
|
]
|
|
47
53
|
|
|
54
|
+
/* The 2×2 expanded card's three neighbours — the cell to the right, the two
|
|
55
|
+
* beneath — skipped so the grid stays still (monitor's computeHiddenSet, verbatim). */
|
|
56
|
+
function computeHiddenSet(items, expandedIdx) {
|
|
57
|
+
if (expandedIdx < 0) return new Set()
|
|
58
|
+
const hiddenSet = new Set()
|
|
59
|
+
const blockCol = Math.floor((expandedIdx % 6) / 2)
|
|
60
|
+
const blockRow = Math.floor(Math.floor(expandedIdx / 6) / 2)
|
|
61
|
+
const base = blockRow * 12 + blockCol * 2
|
|
62
|
+
;[base, base + 1, base + 6, base + 7].forEach(i => {
|
|
63
|
+
if (i !== expandedIdx && i < items.length) hiddenSet.add(i)
|
|
64
|
+
})
|
|
65
|
+
return hiddenSet
|
|
66
|
+
}
|
|
67
|
+
|
|
48
68
|
export default function CatalogPage({
|
|
49
69
|
header,
|
|
50
70
|
items = [],
|
|
@@ -87,17 +107,23 @@ export default function CatalogPage({
|
|
|
87
107
|
defaultViewMode={defaultView}
|
|
88
108
|
layoutOptions={open ? undefined : layouts}
|
|
89
109
|
defaultLayout={defaultLayout}
|
|
90
|
-
renderItem={(rows, viewMode, layout) =>
|
|
110
|
+
renderItem={(rows, viewMode, layout) => {
|
|
111
|
+
if (open) return null
|
|
112
|
+
const cards = rows.map((item) => toCard ? toCard(item, { view: viewMode, layout }) : { title: item.title ?? item.name, detail: item.detail })
|
|
113
|
+
const hidden = layout === 'list' ? new Set() : computeHiddenSet(rows, cards.findIndex((c) => c.expanded))
|
|
114
|
+
return (
|
|
91
115
|
<div style={{ display: 'grid', gridTemplateColumns: layout === 'list' ? 'repeat(4, 1fr)' : 'repeat(6, 1fr)', gap: layout === 'list' ? 8 : 24 }}>
|
|
92
116
|
{rows.map((item, i) => {
|
|
93
|
-
|
|
117
|
+
if (hidden.has(i)) return null
|
|
118
|
+
const c = cards[i]
|
|
94
119
|
const key = c.key ?? item.key ?? item.id ?? item.name ?? i
|
|
95
120
|
return layout === 'list'
|
|
96
121
|
? <ContentRow key={key} variant="catalog" title={c.title} detail={c.detail} actions={c.actions} onClick={c.onClick} href={c.href} onNavigate={c.onNavigate} />
|
|
97
|
-
: <ContentCard key={key} variant="catalog" fit=
|
|
122
|
+
: <ContentCard key={key} variant="catalog" fit={c.fit ?? 'cover'} title={c.title} detail={c.detail} media={c.media} actions={c.actions} onClick={c.onClick} href={c.href} onNavigate={c.onNavigate} expanded={c.expanded} expandedContent={c.expandedContent} />
|
|
98
123
|
})}
|
|
99
124
|
</div>
|
|
100
|
-
|
|
125
|
+
)
|
|
126
|
+
}}
|
|
101
127
|
{...filtersProps}
|
|
102
128
|
/>
|
|
103
129
|
</div>
|