@kolkrabbi/kol-shell 0.123.0 → 0.125.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 +6 -6
- package/src/FloatLayout.jsx +3 -3
- package/src/PropertyRail.jsx +49 -49
- 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.125.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The application shell",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,19 +12,19 @@
|
|
|
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.221.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.367.0",
|
|
25
25
|
"@kolkrabbi/kol-icons": "^0.70.1",
|
|
26
|
-
"@kolkrabbi/kol-
|
|
27
|
-
"@kolkrabbi/kol-
|
|
26
|
+
"@kolkrabbi/kol-theme": "^0.221.0",
|
|
27
|
+
"@kolkrabbi/kol-framework": "^0.74.1"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"src",
|
package/src/FloatLayout.jsx
CHANGED
|
@@ -10,9 +10,9 @@ import RailDisplayControls from './RailDisplayControls.jsx'
|
|
|
10
10
|
/**
|
|
11
11
|
* FloatLayout — The float workspace frame (plan-2026-11-04-float-views W1.1 — kol-float--style 9:15449 "Adaptive
|
|
12
12
|
* workspace", its rules 9:15179). Assembled from the float chrome, nothing drawn here: the nav Rail (`NavRail
|
|
13
|
-
* variant="float"`) in three states — `expanded`
|
|
13
|
+
* variant="float"`) in three states — `expanded` 264, `collapsed` 72 (a section's rows open beside a slot on hover,
|
|
14
14
|
* RailFlyout), `hidden` 0 (RailTrigger and the breadcrumb take the corner) — the 64 TopControlsBar, the content slot,
|
|
15
|
-
* ONE inspector slot (PropertyRail,
|
|
15
|
+
* ONE inspector slot (PropertyRail, 264 on the sheet radius), and a `bottom` Rail under both. 24 round the page and between the Rails, 40 under the bar.
|
|
16
16
|
*
|
|
17
17
|
* Visibility controls space, selection controls content: a hidden Rail is never removed — Panels ▾ (PanelsRestore)
|
|
18
18
|
* shows in the bar exactly while one is hidden and brings it back as it was (the nav at its last width). Below `md` the
|
|
@@ -93,7 +93,7 @@ export default function FloatLayout({
|
|
|
93
93
|
setFly(item.sub?.length ? { item, el } : null)
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
/* the rail keys (useRailKeys): `\`
|
|
96
|
+
/* the rail keys (useRailKeys): `\` 264 ↔ 72, `⇧\` hide ↔ show at its last width (`lastShown`) */
|
|
97
97
|
useRailKeys(railKeys, {
|
|
98
98
|
onCollapse: () => { if (railNow !== 'hidden') { setFly(null); setRail(railNow === 'expanded' ? 'collapsed' : 'expanded') } },
|
|
99
99
|
onHide: () => setRail(railNow === 'hidden' ? lastShown.current : 'hidden'),
|
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
|
-
* PropertyRail — The float inspector (float-everything W5 rows 65 · 66, 2026-11-04): a
|
|
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,
|
|
@@ -34,15 +36,14 @@ import { IconLoader } from '@kolkrabbi/kol-icons'
|
|
|
34
36
|
* @param {Function} onExpand the ↗ in the header — the tool's expanded form (the settings dialog); unset, none
|
|
35
37
|
* @param {ReactNode} footer the Rail's foot (a status line, the tool's action), after the sections
|
|
36
38
|
* @param {'solid'|'glass-dark'|'glass-light'} surface what the sheet is made of (default `solid`)
|
|
37
|
-
* @param {boolean} wide the wide module (`--kol-float-module-w-wide`,
|
|
38
|
-
* unset, the inspector (`--kol-float-module-w`,
|
|
39
|
+
* @param {boolean} wide the wide module (`--kol-float-module-w-wide`, 360): a tool Rail whose rows carry two controls;
|
|
40
|
+
* unset, the inspector (`--kol-float-module-w`, 264) — the two module widths of the float spec
|
|
39
41
|
* @param {number|string} width an explicit width (a phone's `100%`); unset, the module width
|
|
40
42
|
* @param {boolean} foldable the fold ⌃ in the header: the Rail folds to its header pill and opens again — every float
|
|
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/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'
|