@kolkrabbi/kol-shell 0.52.0 → 0.55.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 +3 -3
- package/src/ShortcutsOverlay.jsx +27 -36
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.55.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",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"react-dom": "^18.3.0 || ^19.0.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@kolkrabbi/kol-component": "^0.
|
|
24
|
-
"@kolkrabbi/kol-icons": "^0.26.0",
|
|
23
|
+
"@kolkrabbi/kol-component": "^0.201.0",
|
|
25
24
|
"@kolkrabbi/kol-framework": "^0.44.0",
|
|
25
|
+
"@kolkrabbi/kol-icons": "^0.26.0",
|
|
26
26
|
"@kolkrabbi/kol-theme": "^0.142.0"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
package/src/ShortcutsOverlay.jsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect } from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { SettingsSections } from '@kolkrabbi/kol-component'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* ShortcutsOverlay — the keyboard-shortcut sheet: blurred scrim, centred
|
|
@@ -22,16 +22,18 @@ import { LabeledControlSection, SettingsRow } from '@kolkrabbi/kol-component'
|
|
|
22
22
|
* have lost the grouping. That consumer kept a 99-line local overlay instead,
|
|
23
23
|
* which is the duplication this component exists to end.
|
|
24
24
|
*
|
|
25
|
-
* ONE
|
|
26
|
-
* settings sidebar
|
|
27
|
-
* This sheet and `SettingsShortcuts` render the SAME keymap
|
|
28
|
-
* had drifted into two anatomies
|
|
29
|
-
* `text-fg-32` heading and hand-rolled `<span>` pairs here, against
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* a change to the row lands in
|
|
34
|
-
*
|
|
25
|
+
* ONE COMPONENT WITH THE SETTINGS PAGE AND THE DRAWER (user, 2026-09-03:
|
|
26
|
+
* *"align it more to the settings sidebar"* → *"lets normalise a component
|
|
27
|
+
* they can grab"*). This sheet and `SettingsShortcuts` render the SAME keymap
|
|
28
|
+
* array and had drifted into two anatomies — a bespoke two-column grid with a
|
|
29
|
+
* plain `text-fg-32` heading and hand-rolled `<span>` pairs here, against
|
|
30
|
+
* eyebrow sections over `SettingsRow`s there, down to the combo being `fg-96`
|
|
31
|
+
* in one and `fg-32` in the other. Both go through `SettingsSections` now, the
|
|
32
|
+
* same call the settings page and the settings drawer use, so a shortcut reads
|
|
33
|
+
* identically wherever it is shown and a change to the row lands in all of
|
|
34
|
+
* them. The FRAME stays each one's own: a scrim and a centred sheet here, a
|
|
35
|
+
* six-column grid on the page, a right-anchored drawer over the thing you are
|
|
36
|
+
* looking at.
|
|
35
37
|
*
|
|
36
38
|
* `keys` is a DISPLAY STRING and is never bound — this component shows a
|
|
37
39
|
* keymap, it does not own one. Formatting a combo (⌘⇧Z) is the consumer's,
|
|
@@ -43,16 +45,15 @@ import { LabeledControlSection, SettingsRow } from '@kolkrabbi/kol-component'
|
|
|
43
45
|
|
|
44
46
|
const isSectioned = (list) => Array.isArray(list?.[0]?.items)
|
|
45
47
|
|
|
46
|
-
/*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
48
|
+
/* A shortcut as a settings ROW: the label on the left, the combo as the row's
|
|
49
|
+
* value. `labelWidth="auto"` makes the label yield and the combo hug — a combo
|
|
50
|
+
* is one token by nature and must not wrap. */
|
|
51
|
+
const toRow = ({ label, combo, keys }) => ({
|
|
52
|
+
label,
|
|
53
|
+
align: 'fill',
|
|
54
|
+
labelWidth: 'auto',
|
|
55
|
+
value: <span className="text-fg-32 kol-helper-12 whitespace-nowrap">{combo ?? keys}</span>,
|
|
56
|
+
})
|
|
56
57
|
|
|
57
58
|
export default function ShortcutsOverlay({ shortcuts = [], onClose }) {
|
|
58
59
|
useEffect(() => {
|
|
@@ -85,21 +86,11 @@ export default function ShortcutsOverlay({ shortcuts = [], onClose }) {
|
|
|
85
86
|
style={{ padding: 24, borderRadius: 4 }}
|
|
86
87
|
onClick={(e) => e.stopPropagation()}
|
|
87
88
|
>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
))}
|
|
94
|
-
</LabeledControlSection>
|
|
95
|
-
))
|
|
96
|
-
: (
|
|
97
|
-
<LabeledControlSection rowGap={1}>
|
|
98
|
-
{shortcuts.map(({ label, combo, keys }) => (
|
|
99
|
-
<Row key={label} label={label} combo={combo} keys={keys} />
|
|
100
|
-
))}
|
|
101
|
-
</LabeledControlSection>
|
|
102
|
-
)}
|
|
89
|
+
<SettingsSections
|
|
90
|
+
sections={sectioned
|
|
91
|
+
? shortcuts.map(({ section, items = [] }) => ({ label: section, rowGap: 1, rows: items.map(toRow) }))
|
|
92
|
+
: [{ rowGap: 1, rows: shortcuts.map(toRow) }]}
|
|
93
|
+
/>
|
|
103
94
|
</div>
|
|
104
95
|
</div>
|
|
105
96
|
)
|