@kolkrabbi/kol-shell 0.102.1 → 0.104.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 +4 -4
- package/src/AppFloatNav.jsx +32 -2
- package/src/CanvasReadouts.jsx +15 -11
- package/src/FloatLayout.jsx +22 -10
- package/src/GlobalActions.jsx +1 -1
- package/src/PropertyRail.jsx +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.104.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The application shell",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"react-dom": "^18.3.0 || ^19.0.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@kolkrabbi/kol-component": "^0.
|
|
25
|
-
"@kolkrabbi/kol-icons": "^0.64.0",
|
|
24
|
+
"@kolkrabbi/kol-component": "^0.338.1",
|
|
26
25
|
"@kolkrabbi/kol-framework": "^0.69.0",
|
|
27
|
-
"@kolkrabbi/kol-theme": "^0.211.1"
|
|
26
|
+
"@kolkrabbi/kol-theme": "^0.211.1",
|
|
27
|
+
"@kolkrabbi/kol-icons": "^0.64.0"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"src",
|
package/src/AppFloatNav.jsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from 'react'
|
|
2
|
-
import { TabsRow, TABBAR_H, TABBAR_PILL_H, TABBAR_PILL_INSET, tabbarPillWidth, tabbarPillSlot, floatSurfaceClass, usePopover, PopoverPanel } from '@kolkrabbi/kol-component'
|
|
2
|
+
import { Button, TabsRow, Tooltip, TABBAR_H, TABBAR_PILL_H, TABBAR_PILL_INSET, tabbarPillWidth, tabbarPillSlot, floatSurfaceClass, usePopover, PopoverPanel, useMediaQuery } from '@kolkrabbi/kol-component'
|
|
3
3
|
import MoreRows, { FloatMenu } from './MoreSheet.jsx'
|
|
4
4
|
import Timecode from './Timecode.jsx'
|
|
5
5
|
|
|
@@ -290,8 +290,14 @@ function FloatNav({ items = [], currentPath = '/', onNavigate, actions = [], sha
|
|
|
290
290
|
* @param {Object|string} timecode THE TIMECODE (float-everything W5 rows 69 · 70, 2026-11-04): `{ current, total? }` (or the
|
|
291
291
|
* current alone) drawn by `Timecode` INSIDE the pill, after the slots — TabsRow's `trailing`
|
|
292
292
|
* (kol-component ≥0.335.0); the slots stay where a pill without it puts them. Unset, no readout
|
|
293
|
+
* @param {boolean} inline THE DESKTOP CAPSULE (plan-2026-11-04-float-operational W1.2; kol-float--style 9:8791): at ≥ md
|
|
294
|
+
* the transport is a 48 capsule IN FLOW where the consumer places it — 6 in, the float
|
|
295
|
+
* Buttons (ghost, icon-only, 36) 4 apart, the lit slot fg-16, each named by the float Tooltip,
|
|
296
|
+
* the Timecode 12 in after them (374 wide with a timecode); a `sheetFor` slot opens its rows
|
|
297
|
+
* 12 above the slot. Below md it is the phone pill as before. Default false — the pill everywhere
|
|
298
|
+
* @param {string} className the inline capsule's (ignored by the pill)
|
|
293
299
|
*/
|
|
294
|
-
function Transport({ items = [], sheetFor = {}, placement = 'bottom', foldable = false, folded, onFoldChange, menuBorder = false, surface = 'solid', labels = false, foldSide = 'right', foldTone, timecode }) {
|
|
300
|
+
function Transport({ items = [], sheetFor = {}, placement = 'bottom', foldable = false, folded, onFoldChange, menuBorder = false, surface = 'solid', labels = false, foldSide = 'right', foldTone, timecode, inline = false, className = '' }) {
|
|
295
301
|
const [sheet, setSheet] = useState(null)
|
|
296
302
|
useEffect(() => {
|
|
297
303
|
if (!sheet) return undefined
|
|
@@ -320,6 +326,30 @@ function Transport({ items = [], sheetFor = {}, placement = 'bottom', foldable =
|
|
|
320
326
|
width: 'max-content', minWidth: 160,
|
|
321
327
|
}
|
|
322
328
|
const tc = timecode == null ? null : typeof timecode === 'string' ? { current: timecode } : timecode
|
|
329
|
+
const phone = useMediaQuery('(max-width: 767px)')
|
|
330
|
+
|
|
331
|
+
if (inline && !phone) {
|
|
332
|
+
/* the desktop capsule — ToolRail's slots laid in a row; the sheet sits over its slot (6 in + 40 a slot + 18 its centre) */
|
|
333
|
+
const capsuleSheet = { position: 'absolute', left: 6 + at * 40 + 18, right: 'auto', transform: 'translateX(-50%)', [top ? 'top' : 'bottom']: 'calc(100% + 12px)', width: 'max-content', minWidth: 160 }
|
|
334
|
+
return (
|
|
335
|
+
<div role="toolbar" aria-label="Transport" className={`kol-transport-capsule kol-float-chrome relative inline-flex items-center gap-1 p-1.5 rounded-full ${floatSurfaceClass(surface)} ${className}`.trim()}>
|
|
336
|
+
{sheet && <button type="button" aria-label="Close" className="kol-phone-nav-scrim" onClick={() => setSheet(null)} />}
|
|
337
|
+
{sheet && (
|
|
338
|
+
<div className={`kol-phone-nav-more kol-more-sheet kol-more-sheet-float ${floatSurfaceClass(surface, true)}${menuBorder ? ' kol-more-sheet-bordered' : ''}`} role="menu" aria-label={items[at]?.label} style={capsuleSheet}>
|
|
339
|
+
<FloatMenu onLeaf={() => setSheet(null)}>
|
|
340
|
+
<MoreRows variant="float" actions={sheetFor[sheet]} onPick={() => setSheet(null)} />
|
|
341
|
+
</FloatMenu>
|
|
342
|
+
</div>
|
|
343
|
+
)}
|
|
344
|
+
{tabs.map((t) => (
|
|
345
|
+
<Tooltip key={t.value} variant="float" placement={top ? 'bottom' : 'top'} offset={12} label={t.label}>
|
|
346
|
+
<Button variant="float" tone="ghost" iconOnly={t.icon} aria-label={t.label} pressed={t.selected} onClick={() => press(t.value)} />
|
|
347
|
+
</Tooltip>
|
|
348
|
+
))}
|
|
349
|
+
{tc && <Timecode {...tc} className="px-3" />}
|
|
350
|
+
</div>
|
|
351
|
+
)
|
|
352
|
+
}
|
|
323
353
|
|
|
324
354
|
return (
|
|
325
355
|
<>
|
package/src/CanvasReadouts.jsx
CHANGED
|
@@ -67,26 +67,30 @@ export function CanvasHint({ icon = 'pointer', hint, className = '' }) {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
|
-
* SelectionMeasure — The selection's frame on the canvas (float-everything W5 row 76, 2026-11-04):
|
|
71
|
-
*
|
|
72
|
-
* `--kol-float-list-r` round). The exploration's `Selection measurement` (kol-float--style
|
|
70
|
+
* SelectionMeasure — The selection's frame on the canvas (float-everything W5 row 76, 2026-11-04): a 1px outline on
|
|
71
|
+
* oq-64 hugging `children` and its handles, the object's label above (`kol-float-label`) and the size cap under it
|
|
72
|
+
* (`kol-float-ruler` on the `--kol-float-list-r` round). The exploration's `Selection measurement` (kol-float--style
|
|
73
|
+
* 9:8594: outline + eight 6 handles centred on it); since 0.104.0 the outline is drawn (float-figma-review W3.5).
|
|
73
74
|
*
|
|
74
|
-
* @param {number|string} width · {number|string} height the cap's numbers ("754 × 771")
|
|
75
|
-
*
|
|
75
|
+
* @param {number|string} width · {number|string} height the cap's numbers ("754 × 771") — the measure: eight 6 handles
|
|
76
|
+
* (corners + edge middles). Both unset, no cap — the selected row: four 4 corner handles
|
|
77
|
+
* (the selected brief, kol-float--style 9:14340)
|
|
76
78
|
* @param {string} label the object's name, above the frame
|
|
77
79
|
* @param {ReactNode} children the selected thing
|
|
78
80
|
* @param {string} className
|
|
79
81
|
*/
|
|
80
82
|
export function SelectionMeasure({ width, height, label, children, className = '' }) {
|
|
81
|
-
const
|
|
83
|
+
const measure = width != null || height != null
|
|
84
|
+
/* a handle is centred on the outline: 6 (the measure) or 4 (the selected row), corners first, then the edge middles */
|
|
85
|
+
const handle = `absolute ${measure ? 'size-1.5 -m-[3px]' : 'size-1 -m-0.5'} bg-[var(--kol-surface-on-primary)]`
|
|
86
|
+
const spots = measure
|
|
87
|
+
? ['top-0 left-0', 'top-0 left-full', 'top-full left-0', 'top-full left-full', 'top-0 left-1/2', 'top-full left-1/2', 'top-1/2 left-0', 'top-1/2 left-full']
|
|
88
|
+
: ['top-0 left-0', 'top-0 left-full', 'top-full left-0', 'top-full left-full']
|
|
82
89
|
return (
|
|
83
90
|
<div className={`kol-selection-measure relative inline-block ${className}`.trim()}>
|
|
84
91
|
{children}
|
|
85
|
-
<div aria-hidden="true" className="pointer-events-none absolute inset-0">
|
|
86
|
-
<span className={`${handle}
|
|
87
|
-
<span className={`${handle} -top-1 -right-1`} />
|
|
88
|
-
<span className={`${handle} -bottom-1 -left-1`} />
|
|
89
|
-
<span className={`${handle} -bottom-1 -right-1`} />
|
|
92
|
+
<div aria-hidden="true" className="pointer-events-none absolute inset-0 shadow-[0_0_0_1px_var(--kol-oq-64)]">
|
|
93
|
+
{spots.map((at) => <span key={at} className={`${handle} ${at}`} />)}
|
|
90
94
|
</div>
|
|
91
95
|
{label && <span className="kol-float-label text-oq-64 absolute left-0 bottom-full mb-2 whitespace-nowrap">{label}</span>}
|
|
92
96
|
{(width != null || height != null) && <span className="kol-float-ruler text-emphasis absolute left-1/2 top-full mt-2 -translate-x-1/2 whitespace-nowrap px-2 py-1 rounded-[var(--kol-float-list-r)] bg-oq-08">{width} × {height}</span>}
|
package/src/FloatLayout.jsx
CHANGED
|
@@ -5,14 +5,14 @@ import RailTrigger from './RailTrigger.jsx'
|
|
|
5
5
|
import RailFlyout from './RailFlyout.jsx'
|
|
6
6
|
import RailDisplayControls from './RailDisplayControls.jsx'
|
|
7
7
|
|
|
8
|
-
/* taxonomy-ok: module — the float page frame: NavRail float · RailTrigger · RailFlyout · TopControlsBar · PanelsRestore · the inspector slot */
|
|
8
|
+
/* taxonomy-ok: module — the float page frame: NavRail float · RailTrigger · RailFlyout · TopControlsBar · PanelsRestore · the inspector slot · the bottom Rail slot */
|
|
9
9
|
|
|
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
13
|
* variant="float"`) in three states — `expanded` 280, `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
|
-
*
|
|
15
|
+
* ONE inspector slot (PropertyRail, 272 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
|
|
@@ -26,7 +26,13 @@ import RailDisplayControls from './RailDisplayControls.jsx'
|
|
|
26
26
|
* @param {ReactNode} [railFooter] the expanded Rail's foot (default RailDisplayControls: theme · Collapse · Hide)
|
|
27
27
|
* @param {string|string[]} [breadcrumb] the words beside RailTrigger while the nav is hidden
|
|
28
28
|
* @param {Object} [bar] TopControlsBar's props (`document` · `tabs` · `tab` · `onTab` · `onSearch` · `action` · `start` · `center` · `end`); `panels` is the frame's
|
|
29
|
+
* @param {ReactNode} [eyebrow] a line in the 40 under the bar (float-operational W4.2, 9:14340's WORKSPACE / TASKS): 25 under
|
|
30
|
+
* the bar, taking no height, so the content still starts 40 down. Below `md` it sits in flow
|
|
31
|
+
* under the bar
|
|
29
32
|
* @param {ReactNode|Function} [inspector] the one inspector — a node, or `({ hide }) => node` (hand `hide` to PropertyRail's `onCollapse`)
|
|
33
|
+
* @param {ReactNode} [bottom] the bottom Rail (float-operational W1.1, 9:14340's Task index dock + filter capsule): runs under
|
|
34
|
+
* the content AND the inspector, 24 below them, at its own height — the content row takes
|
|
35
|
+
* what is left. Below `md` it scrolls with the content, after the inspector
|
|
30
36
|
* @param {string} [inspectorLabel] its name in Panels ▾ (default "Inspector")
|
|
31
37
|
* @param {boolean} [inspectorHidden] controlled; `defaultInspectorHidden` uncontrolled · {Function} [onInspectorHiddenChange]
|
|
32
38
|
* @param {'solid'|'glass-dark'|'glass-light'} [surface] what the floats are made of (default `solid`)
|
|
@@ -36,7 +42,7 @@ import RailDisplayControls from './RailDisplayControls.jsx'
|
|
|
36
42
|
export default function FloatLayout({
|
|
37
43
|
nav = [], currentPath = '', onNavigate, title, icon, onSwitch, onSearch,
|
|
38
44
|
rail, defaultRail = 'expanded', onRailChange, defaultExpanded, railFooter, breadcrumb,
|
|
39
|
-
bar = {}, inspector, inspectorLabel = 'Inspector', inspectorHidden, defaultInspectorHidden = false, onInspectorHiddenChange,
|
|
45
|
+
bar = {}, eyebrow, inspector, bottom, inspectorLabel = 'Inspector', inspectorHidden, defaultInspectorHidden = false, onInspectorHiddenChange,
|
|
40
46
|
surface = 'solid', children, className = '',
|
|
41
47
|
}) {
|
|
42
48
|
const [ownRail, setOwnRail] = useState(defaultRail)
|
|
@@ -86,14 +92,20 @@ export default function FloatLayout({
|
|
|
86
92
|
</span>
|
|
87
93
|
)}
|
|
88
94
|
<div className="flex min-w-0 flex-1 flex-col gap-10 max-md:gap-6">
|
|
89
|
-
<div className="
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
95
|
+
<div className="relative min-w-0 shrink-0">
|
|
96
|
+
<div className="flex min-w-0 items-center gap-4">
|
|
97
|
+
{shown === 'hidden' && <RailTrigger items={nav} currentPath={currentPath} onNavigate={onNavigate} title={title} breadcrumb={phone ? undefined : breadcrumb} surface={surface} className="shrink-0" />}
|
|
98
|
+
<TopControlsBar {...bar} panels={restore.length ? { items: restore } : undefined} surface={surface}
|
|
99
|
+
className={`min-w-0 flex-1 max-md:overflow-x-auto max-md:[scrollbar-width:none] ${bar.className ?? ''}`.trim()} />
|
|
100
|
+
</div>
|
|
101
|
+
{eyebrow && <div className="kol-float-layout-eyebrow absolute inset-x-0 top-full pt-[25px] max-md:static max-md:pt-6">{eyebrow}</div>}
|
|
93
102
|
</div>
|
|
94
|
-
<div className="flex min-h-0 flex-1 gap-6 max-md:
|
|
95
|
-
<div className="
|
|
96
|
-
|
|
103
|
+
<div className="flex min-h-0 flex-1 flex-col gap-6 max-md:overflow-y-auto">
|
|
104
|
+
<div className="flex min-h-0 flex-1 gap-6 max-md:flex-none max-md:flex-col">
|
|
105
|
+
<div className="kol-float-layout-content min-w-0 flex-1 overflow-y-auto max-md:flex-none max-md:overflow-visible">{children}</div>
|
|
106
|
+
{body && !hidden && <aside aria-label={inspectorLabel} className="max-h-full shrink-0 self-start overflow-y-auto [scrollbar-width:none] max-md:max-h-none max-md:self-stretch">{body}</aside>}
|
|
107
|
+
</div>
|
|
108
|
+
{bottom && <div className="kol-float-layout-bottom min-w-0 shrink-0">{bottom}</div>}
|
|
97
109
|
</div>
|
|
98
110
|
</div>
|
|
99
111
|
</div>
|
package/src/GlobalActions.jsx
CHANGED
|
@@ -19,7 +19,7 @@ export default function GlobalActions({ onUndo, onRedo, actionLabel = 'Export',
|
|
|
19
19
|
return (
|
|
20
20
|
<div className={`kol-global-actions kol-float-chrome inline-flex items-center gap-3 ${className}`.trim()}>
|
|
21
21
|
{onUndo && <Button variant="float" tone="ghost" size="sm" iconOnly="undo" aria-label="Undo" onClick={onUndo} />}
|
|
22
|
-
{onRedo && <Button variant="float" tone="ghost" size="sm" iconOnly="
|
|
22
|
+
{onRedo && <Button variant="float" tone="ghost" size="sm" iconOnly="redo" aria-label="Redo" onClick={onRedo} />}
|
|
23
23
|
{onAction && <Button variant="float" tone="inverted" size="md" onClick={onAction}>{actionLabel}</Button>}
|
|
24
24
|
{account?.src || account?.initial ? (
|
|
25
25
|
<button type="button" aria-label={account.label ?? 'Account'} onClick={onAccount} className="inline-flex rounded-full bg-transparent border-0 p-0 cursor-pointer">
|
package/src/PropertyRail.jsx
CHANGED
|
@@ -13,7 +13,8 @@ import { Icon } from '@kolkrabbi/kol-icons'
|
|
|
13
13
|
*
|
|
14
14
|
* @param {string} title the header (Properties)
|
|
15
15
|
* @param {Function} onCollapse the ⇥'s press; unset, no ⇥
|
|
16
|
-
* @param {Array} tabs TabsRow tabs `[{ value, label }]
|
|
16
|
+
* @param {Array} tabs TabsRow tabs `[{ value, label }]` at the inspector size (xs, 26 — float-operational W1.3);
|
|
17
|
+
* `tab` the current value, the lit chip (`aria-selected`) · `onTab` `(value) => void`
|
|
17
18
|
* @param {Object} selected `{ icon, name, visible?, onVisible? }` — the object line; unset, none
|
|
18
19
|
* @param {Array} sections `[{ id?, label, onAdd?, meta?, rows }]` — a row is one of:
|
|
19
20
|
* `{ type: 'fields', fields: [{ id, prefix?, unit?, value, onChange }] }` (two-up, Input float, `prefix` the X · Y · W · H letter) ·
|
|
@@ -32,7 +33,7 @@ export default function PropertyRail({ title, onCollapse, tabs, tab, onTab, sele
|
|
|
32
33
|
<span className="kol-float-panel text-emphasis">{title}</span>
|
|
33
34
|
{onCollapse && <Button variant="float" tone="ghost" size="sm" iconOnly="skip-end" aria-label="Collapse" onClick={onCollapse} />}
|
|
34
35
|
</div>
|
|
35
|
-
{tabs?.length > 0 && <TabsRow variant="float" tabs={tabs} value={tab} onChange={onTab} />}
|
|
36
|
+
{tabs?.length > 0 && <TabsRow variant="float" size="xs" tabs={tabs} value={tab} onChange={onTab} ariaLabel={`${title} tabs`} />}
|
|
36
37
|
{selected && (
|
|
37
38
|
<div className="flex items-center gap-2">
|
|
38
39
|
{selected.icon && <Icon name={selected.icon} size={18} className="text-oq-64" />}
|