@kolkrabbi/kol-shell 0.124.0 → 0.126.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/PropertyRail.jsx +46 -46
- package/src/RailFlyout.jsx +12 -7
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.126.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The application shell",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,18 +12,18 @@
|
|
|
12
12
|
"./src/*": "./src/*"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@kolkrabbi/kol-component": ">=0.
|
|
15
|
+
"@kolkrabbi/kol-component": ">=0.367.0",
|
|
16
16
|
"@kolkrabbi/kol-framework": ">=0.55.0",
|
|
17
17
|
"@kolkrabbi/kol-icons": ">=0.69.0",
|
|
18
|
-
"@kolkrabbi/kol-theme": ">=0.
|
|
18
|
+
"@kolkrabbi/kol-theme": ">=0.222.0",
|
|
19
19
|
"gsap": "^3.13.0",
|
|
20
20
|
"react": "^18.3.0 || ^19.0.0",
|
|
21
21
|
"react-dom": "^18.3.0 || ^19.0.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@kolkrabbi/kol-component": "^0.
|
|
24
|
+
"@kolkrabbi/kol-component": "^0.369.0",
|
|
25
25
|
"@kolkrabbi/kol-icons": "^0.70.1",
|
|
26
|
-
"@kolkrabbi/kol-theme": "^0.
|
|
26
|
+
"@kolkrabbi/kol-theme": "^0.222.0",
|
|
27
27
|
"@kolkrabbi/kol-framework": "^0.74.1"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
package/src/PropertyRail.jsx
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { Button, Input, Dropdown, FloatModule, LabeledControl, Slider, ToggleSwitch, TabsRow } from '@kolkrabbi/kol-component'
|
|
1
|
+
import { Button, Input, Dropdown, FloatModule, LabeledControl, LabeledControlSection, LayerRow, Slider, ToggleSwitch, TabsRow } from '@kolkrabbi/kol-component'
|
|
2
2
|
import { IconLoader } from '@kolkrabbi/kol-icons'
|
|
3
3
|
|
|
4
|
-
/* taxonomy-ok: organism — kol-component's FloatModule holding kol-component fields (Input · Dropdown · Slider · ToggleSwitch · TabsRow) */
|
|
4
|
+
/* taxonomy-ok: organism — kol-component's FloatModule holding LayerRow, LabeledControlSection and kol-component fields (Input · Dropdown · Slider · ToggleSwitch · TabsRow) */
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* PropertyRail — The float inspector (float-everything W5 rows 65 · 66, 2026-11-04): a 264 sheet (`--kol-float-menu-r`,
|
|
8
8
|
* 16 in, 18 between) holding its header (the title in `kol-float-panel` and the collapse ⇥), chip tabs (TabsRow float),
|
|
9
|
-
* the selected object's line (glyph
|
|
10
|
-
*
|
|
9
|
+
* the selected object's line (kol-component's `LayerRow variant="head"`: glyph, name and eye, W8.1) and sections — each a
|
|
10
|
+
* float `LabeledControlSection` (W10.1: the `kol-float-label` head with an optional + or meta over its rows) of rows that
|
|
11
|
+
* kol-component draws: `fields` two-up Inputs float, `select` a Dropdown, `slider` a Slider float with its
|
|
11
12
|
* readout, `switch` a ToggleSwitch float, or `render`. Every labelled row is `LabeledControl variant="float"`. Nothing is forked: the sheet is the only new chrome. The
|
|
12
13
|
* exploration's `Floating properties inspector` (kol-float--style 9:9273); the section hairlines stay out (no-borders law).
|
|
13
14
|
* Since 0.123.0 the sheet, header, fold and folded pill are kol-component's `FloatModule` (plan-2026-11-12-float-system
|
|
@@ -25,8 +26,9 @@ import { IconLoader } from '@kolkrabbi/kol-icons'
|
|
|
25
26
|
* `{ type: 'switch', id?, label, icon?, on, onChange }` (ToggleSwitch float) ·
|
|
26
27
|
* `{ id?, render }` — anything else
|
|
27
28
|
* `{ type: 'labeled', id?, label, render }` — the tool Rail's row (generator Rails, plan-2026-11-05-float-editor
|
|
28
|
-
* W7.6): LabeledControl float `
|
|
29
|
-
* `{ type: 'subhead', id?, label, meta? }` — a group's caps head inside a section (LIGHTS / POINT EDITOR)
|
|
29
|
+
* W7.6): LabeledControl float `horizontal` — the label in the `--kol-float-label-w` column, the control in the rest ·
|
|
30
|
+
* `{ type: 'subhead', id?, label, meta? }` — a group's caps head inside a section (LIGHTS / POINT EDITOR): it and the rows
|
|
31
|
+
* under it are a float LabeledControlSection of their own ·
|
|
30
32
|
* a section may also be `collapsible` (`open` · `onToggle(open)`): its head is the chevron and the
|
|
31
33
|
* title in `kol-float-panel`, `meta` at the far end, its rows shown while open
|
|
32
34
|
* @param {'regular'|'compact'} density `compact` — the tool Rail's rhythm (his generator frames 32:16215): 8 between rows,
|
|
@@ -41,8 +43,7 @@ import { IconLoader } from '@kolkrabbi/kol-icons'
|
|
|
41
43
|
* panel is a module (the user, 2026-11-12: *"EVERYTHING IS FLOAT everything is MODULES"*)
|
|
42
44
|
* @param {boolean} folded controlled; `defaultFolded` uncontrolled · `onFold(folded)` on every press. Folded, only the
|
|
43
45
|
* header shows, on the same sheet
|
|
44
|
-
* @param {ReactNode} children the body slot, after the sections — a panel that is not rows (ReadingContents'
|
|
45
|
-
* Labs' params)
|
|
46
|
+
* @param {ReactNode} children the body slot, after the sections — a panel that is not rows (ReadingContents, Labs' params)
|
|
46
47
|
* @param {string} className
|
|
47
48
|
*/
|
|
48
49
|
export default function PropertyRail({ title, onCollapse, onExpand, density = 'regular', tabs, tab, onTab, selected, sections = [], footer, surface = 'solid', wide = false, width, foldable = false, folded, defaultFolded = false, onFold, children, className = '' }) {
|
|
@@ -54,59 +55,58 @@ export default function PropertyRail({ title, onCollapse, onExpand, density = 'r
|
|
|
54
55
|
return (
|
|
55
56
|
<FloatModule title={title} actions={actions} foldable={foldable} folded={folded} defaultFolded={defaultFolded} onFold={onFold}
|
|
56
57
|
compact={compact} wide={wide} width={width} surface={surface} className={`kol-property-rail ${className}`.trim()}
|
|
57
|
-
footer={footer && <div className=
|
|
58
|
+
footer={footer && compact ? <div className="pt-4">{footer}</div> : footer}>
|
|
58
59
|
{tabs?.length > 0 && <TabsRow variant="float" size="xs" tabs={tabs} value={tab} onChange={onTab} ariaLabel={`${title} tabs`} />}
|
|
59
60
|
{selected && (
|
|
60
|
-
<
|
|
61
|
-
{selected.
|
|
62
|
-
<span className="kol-float-panel text-emphasis flex-1 min-w-0 truncate">{selected.name}</span>
|
|
63
|
-
{selected.onVisible && (
|
|
64
|
-
<Button variant="float" tone="ghost" size="sm" iconOnly={selected.visible === false ? 'eye-off' : 'eye-on'} aria-label={selected.visible === false ? 'Show' : 'Hide'} aria-pressed={selected.visible !== false} onClick={() => selected.onVisible(selected.visible === false)} />
|
|
65
|
-
)}
|
|
66
|
-
</div>
|
|
61
|
+
<LayerRow variant="head" icon={selected.icon} name={selected.name} visible={selected.visible !== false}
|
|
62
|
+
onToggleVisible={selected.onVisible && (() => selected.onVisible(selected.visible === false))} />
|
|
67
63
|
)}
|
|
68
|
-
{sections.map((s, i) =>
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
</
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
64
|
+
{sections.map((s, i) => {
|
|
65
|
+
const add = s.onAdd && <Button variant="float" tone="ghost" size="sm" iconOnly="plus" aria-label={`Add to ${s.label}`} onClick={s.onAdd} />
|
|
66
|
+
const meta = s.meta && <span className="kol-float-timecode text-emphasis">{s.meta}</span>
|
|
67
|
+
const label = s.collapsible ? (
|
|
68
|
+
<button type="button" aria-expanded={!!s.open} onClick={() => s.onToggle?.(!s.open)}
|
|
69
|
+
className="flex flex-1 items-center gap-1.5 text-left focus-visible:outline-none focus-visible:shadow-[var(--kol-float-focus)] rounded-sm">
|
|
70
|
+
<IconLoader name="chevron-down" size="var(--kol-float-chev-sm)" className={`text-oq-64 transition-transform ${s.open ? '' : '-rotate-90'}`} />
|
|
71
|
+
<span className="kol-float-panel text-emphasis flex-1 min-w-0">{s.label}</span>
|
|
72
|
+
{s.meta && <span className="kol-float-timecode text-oq-64">{s.meta}</span>}
|
|
73
|
+
</button>
|
|
74
|
+
) : s.label
|
|
75
|
+
return (
|
|
76
|
+
<LabeledControlSection key={s.id ?? s.label ?? i} variant="float" data-section={s.id ?? s.label} label={label} end={!s.collapsible && (add || meta) && <>{add}{meta}</>}
|
|
77
|
+
gap={compact ? 2 : 'module'} rowGap={compact ? 2 : 'module'} className={compact && i > 0 ? 'pt-4' : ''}>
|
|
78
|
+
{(!s.collapsible || s.open) && groups(s.rows ?? []).map((g, j) => (g.head
|
|
79
|
+
? <LabeledControlSection key={g.head.id ?? `g${j}`} variant="float" label={g.head.label} end={g.head.meta && <span className="kol-float-label text-fg-emphasis">{g.head.meta}</span>}
|
|
80
|
+
gap={compact ? 2 : 'module'} rowGap={compact ? 2 : 'module'} className={compact ? 'pt-3' : 'pt-1'}>
|
|
81
|
+
{g.rows.map((r, k) => <Row key={r.id ?? k} row={r} />)}
|
|
82
|
+
</LabeledControlSection>
|
|
83
|
+
: g.rows.map((r, k) => <Row key={r.id ?? k} row={r} />)))}
|
|
84
|
+
</LabeledControlSection>
|
|
85
|
+
)
|
|
86
|
+
})}
|
|
87
87
|
{children}
|
|
88
88
|
</FloatModule>
|
|
89
89
|
)
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
/* a section's rows in groups: the rows before the first `subhead`, then each subhead with the rows under it — a subhead is
|
|
93
|
+
* a float LabeledControlSection of its own (W10.1), never a loose head row */
|
|
94
|
+
function groups(rows) {
|
|
95
|
+
const out = [{ rows: [] }]
|
|
96
|
+
for (const r of rows) r.type === 'subhead' ? out.push({ head: r, rows: [] }) : out[out.length - 1].rows.push(r)
|
|
97
|
+
return out[0].rows.length ? out : out.slice(1)
|
|
98
|
+
}
|
|
99
|
+
|
|
92
100
|
/* every row with a label is LabeledControl float (plan-2026-11-12-float-system W2.1): the label column and gap are the
|
|
93
101
|
* spec's tokens, the control bare in its cell */
|
|
94
|
-
function Row({ row: r
|
|
102
|
+
function Row({ row: r }) {
|
|
95
103
|
if (r.type === 'labeled') {
|
|
96
104
|
return (
|
|
97
|
-
<LabeledControl variant="float"
|
|
105
|
+
<LabeledControl variant="float" horizontal label={r.label} className="w-full">
|
|
98
106
|
<div className="flex w-full min-w-0 items-center gap-1.5" data-control={r.label}>{r.render()}</div>
|
|
99
107
|
</LabeledControl>
|
|
100
108
|
)
|
|
101
109
|
}
|
|
102
|
-
if (r.type === 'subhead') {
|
|
103
|
-
return (
|
|
104
|
-
<div className={`flex items-center justify-between ${compact ? 'pt-3' : 'pt-1'}`}>
|
|
105
|
-
<span className="kol-float-label text-oq-64">{r.label}</span>
|
|
106
|
-
{r.meta && <span className="kol-float-label text-fg-emphasis">{r.meta}</span>}
|
|
107
|
-
</div>
|
|
108
|
-
)
|
|
109
|
-
}
|
|
110
110
|
if (r.render) return r.render()
|
|
111
111
|
if (r.type === 'fields') {
|
|
112
112
|
return (
|
|
@@ -132,7 +132,7 @@ function Row({ row: r, compact }) {
|
|
|
132
132
|
if (r.type === 'switch') {
|
|
133
133
|
const label = r.icon ? <span className="inline-flex items-center gap-1.5"><IconLoader name={r.icon} size={16} className="text-oq-96" />{r.label}</span> : r.label
|
|
134
134
|
return (
|
|
135
|
-
<LabeledControl variant="float"
|
|
135
|
+
<LabeledControl variant="float" horizontal label={label}>
|
|
136
136
|
<div className="flex w-full justify-end"><ToggleSwitch variant="float" checked={!!r.on} onChange={r.onChange} aria-label={r.label} /></div>
|
|
137
137
|
</LabeledControl>
|
|
138
138
|
)
|
package/src/RailFlyout.jsx
CHANGED
|
@@ -7,7 +7,7 @@ import { IconLoader } from '@kolkrabbi/kol-icons'
|
|
|
7
7
|
* RailFlyout — A section's children beside the rail (float-everything W9 row 130, 2026-11-04): the hover card a 72
|
|
8
8
|
* rail opens for a row that holds pages — the section's glyph and name (`kol-float-body`), then its rows 34 tall on
|
|
9
9
|
* the `--kol-float-list-r` round (a 16 glyph, the label in `kol-float-hint`, a count in `kol-float-ruler` at the end),
|
|
10
|
-
* the current one
|
|
10
|
+
* the current one marked by its dot, never a fill (W11.1, 2026-11-12). With `anchor` it hangs right of that element (the popover); without, it is the card alone.
|
|
11
11
|
* The exploration's `Dashboard rail flyout` (kol-float--style 9:14981).
|
|
12
12
|
*
|
|
13
13
|
* @param {string} icon · {string} title the section
|
|
@@ -31,12 +31,17 @@ export default function RailFlyout({ icon, title, items = [], active, onPick, an
|
|
|
31
31
|
{icon && <IconLoader name={icon} size={18} className="text-oq-96" />}
|
|
32
32
|
<span className="kol-float-body text-emphasis">{title}</span>
|
|
33
33
|
</div>
|
|
34
|
-
{items.map((i) =>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
{i.
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
{items.map((i) => {
|
|
35
|
+
const current = i.path != null && i.path === active
|
|
36
|
+
return (
|
|
37
|
+
<Button key={i.path ?? i.label} variant="nav" size="lg" iconLeft={i.icon} iconSize={16} aria-current={current ? 'page' : undefined} className="kol-btn-float w-full justify-start" onClick={() => onPick?.(i)}>
|
|
38
|
+
<span className="flex-1 text-left">{i.label}</span>
|
|
39
|
+
{i.count != null && <span className="kol-float-ruler text-oq-64">{i.count}</span>}
|
|
40
|
+
{/* the current row's mark is its dot, never a fill (W11.1) — MenuRow's `ascii-dot`, drawn the same way */}
|
|
41
|
+
{current && <IconLoader name="ascii-dot" size={24} style={{ margin: -5 }} className="text-oq-88" />}
|
|
42
|
+
</Button>
|
|
43
|
+
)
|
|
44
|
+
})}
|
|
40
45
|
</div>
|
|
41
46
|
)
|
|
42
47
|
if (!anchor) return card
|
package/src/index.js
CHANGED
|
@@ -22,7 +22,7 @@ export { default as Timecode } from './Timecode.jsx'
|
|
|
22
22
|
// workspace's chrome on the float tokens, every boxed part on its `surface`. Composed from kol-component's float controls.
|
|
23
23
|
export { default as ToolRail } from './ToolRail.jsx'
|
|
24
24
|
export { default as PropertyRail } from './PropertyRail.jsx'
|
|
25
|
-
export { FloatModule } from '@kolkrabbi/kol-component' // the float Rail shell
|
|
25
|
+
export { FloatModule, FloatModuleHeader } from '@kolkrabbi/kol-component' // the float Rail shell and its header live in kol-component (NavRail float draws on it)
|
|
26
26
|
export { default as DocumentCapsule } from './DocumentCapsule.jsx'
|
|
27
27
|
export { default as GlobalActions } from './GlobalActions.jsx'
|
|
28
28
|
export { ZoomReadout, SceneBreadcrumb, CanvasHint, SelectionMeasure } from './CanvasReadouts.jsx'
|