|
3 | 3 | ## Constructors |
4 | 4 |
|
5 | 5 | ```ts |
6 | | -Box(input: BoxProps, children: Node[]): Node |
7 | | -Column(input: Omit<BoxProps, "direction">, children: Node[]): Node |
8 | | -Row(input: Omit<BoxProps, "direction">, children: Node[]): Node |
| 6 | +Box(input: BoxProps & BoxEventProps, children: Node[]): Node |
| 7 | +Column(input: Omit<BoxProps, "direction"> & BoxEventProps, children: Node[]): Node |
| 8 | +Row(input: Omit<BoxProps, "direction"> & BoxEventProps, children: Node[]): Node |
9 | 9 | Text(input: TextProps): Node |
10 | 10 | Input(input: InputProps): Node |
11 | 11 | Button(input: ButtonProps, children?: Node[]): Node |
@@ -36,6 +36,11 @@ Button(input: ButtonProps, children?: Node[]): Node |
36 | 36 | - optional: `direction` (`"row" | "column" | "rowReverse" | "columnReverse"`) |
37 | 37 | - optional: all `StyleProps` |
38 | 38 |
|
| 39 | +- `BoxEventProps` |
| 40 | + - optional: `onWheel(event)` for vertical wheel/trackpad handling |
| 41 | + - `event`: `{ x, y, deltaY, raw }` |
| 42 | + - return `true` to consume and stop bubbling; return `false`/`void` to bubble to parent container |
| 43 | + |
39 | 44 | ## Shared style fields (`StyleProps`) |
40 | 45 |
|
41 | 46 | - `border`: `{ color: number; style: "square" | "rounded" }` |
@@ -67,6 +72,19 @@ Button(input: ButtonProps, children?: Node[]): Node |
67 | 72 | - `overflow`, scrolling, and other non-exported props are not part of the public API. |
68 | 73 | - Prefer `Row` / `Column` for common cases; use `Box` when you need explicit `direction`, including reverse directions. |
69 | 74 |
|
| 75 | +## Wheel Routing |
| 76 | + |
| 77 | +- wheel routing targets the deepest container with `onWheel` under the cursor |
| 78 | +- events bubble up through parent containers until one handler returns `true` |
| 79 | +- horizontal wheel is deferred; current surface exposes vertical `deltaY` only |
| 80 | + |
| 81 | +## Virtual List Notes |
| 82 | + |
| 83 | +- `createVirtualListController(...)` uses row-based virtualization with stable slot nodes |
| 84 | +- avoid large overscan in normal-flow containers; it can increase container height and create layout feedback loops |
| 85 | +- runtime guard now disables overscan automatically when it detects repeated viewport-growth feedback |
| 86 | +- for high overscan, prefer a clipped/fixed-height viewport container so slot count does not affect layout height |
| 87 | + |
70 | 88 | ## Colors |
71 | 89 |
|
72 | 90 | Use `COLORS` from the library. |
|
0 commit comments