@kolkrabbi/kol-shell 0.9.2 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/kol-shell",
3
- "version": "0.9.2",
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.99.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.107.0",
23
+ "@kolkrabbi/kol-component": "^0.108.0",
24
+ "@kolkrabbi/kol-framework": "^0.28.0",
24
25
  "@kolkrabbi/kol-theme": "^0.72.0",
25
- "@kolkrabbi/kol-icons": "^0.22.0",
26
- "@kolkrabbi/kol-framework": "^0.28.0"
26
+ "@kolkrabbi/kol-icons": "^0.22.0"
27
27
  },
28
28
  "files": [
29
29
  "src",
@@ -20,8 +20,11 @@ import WalkthroughPanel from './WalkthroughPanel.jsx'
20
20
  * what a click does. `toCard(item, { view, layout })` → `{ key, title, detail,
21
21
  * media, actions, onClick, href, onNavigate, expanded, expandedContent, fit }` is
22
22
  * the whole contract — `expanded` / `expandedContent` reach `ContentCard catalog`'s
23
- * 2×2 cell (ShellHomeSystemMonitorGaps, kol-monitor 2026-08-27; neighbour-hiding
24
- * stays the consumer's); `fit` (`cover` default | `natural` | `compact`) is the
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
25
28
  * card's media fit, PER CARD because one catalog mixes photographs (cover) and
26
29
  * diagrams (natural) — CatalogPageCardFit, kol-monitor: a rack preview wider
27
30
  * than the card lost its left rail to `cover`. Anything `ContentFilters` takes that the page has no
@@ -48,6 +51,20 @@ const LAYOUTS = [
48
51
  { value: 'grid', label: 'GRID' },
49
52
  ]
50
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
+
51
68
  export default function CatalogPage({
52
69
  header,
53
70
  items = [],
@@ -90,17 +107,23 @@ export default function CatalogPage({
90
107
  defaultViewMode={defaultView}
91
108
  layoutOptions={open ? undefined : layouts}
92
109
  defaultLayout={defaultLayout}
93
- renderItem={(rows, viewMode, layout) => open ? null : (
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 (
94
115
  <div style={{ display: 'grid', gridTemplateColumns: layout === 'list' ? 'repeat(4, 1fr)' : 'repeat(6, 1fr)', gap: layout === 'list' ? 8 : 24 }}>
95
116
  {rows.map((item, i) => {
96
- const c = toCard ? toCard(item, { view: viewMode, layout }) : { title: item.title ?? item.name, detail: item.detail }
117
+ if (hidden.has(i)) return null
118
+ const c = cards[i]
97
119
  const key = c.key ?? item.key ?? item.id ?? item.name ?? i
98
120
  return layout === 'list'
99
121
  ? <ContentRow key={key} variant="catalog" title={c.title} detail={c.detail} actions={c.actions} onClick={c.onClick} href={c.href} onNavigate={c.onNavigate} />
100
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} />
101
123
  })}
102
124
  </div>
103
- )}
125
+ )
126
+ }}
104
127
  {...filtersProps}
105
128
  />
106
129
  </div>