1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
//! Composite keyboard patterns: one Tab stop, arrows inside it
//! (`docs/adr/0007-composite-keyboard-patterns.md`).
//!
//! A tab list, a radio group, a menu and a picker list are *composites*: on
//! every platform they are one Tab stop, and the arrow keys move an inner
//! selection. kui derives that shape rather than taking it as a
//! declaration — a container role whose items are focusable is one, and a
//! `group` of buttons is not — for the reason that already made
//! `pos_in_set` derived: a declared flag is a second source of truth that
//! can disagree with what is on screen.
//!
//! Everything here is a function of the frame's tree. The two consumers are
//! [`crate::access`] (which numbers the items "3 of 7" and reports the
//! container's orientation) and [`crate::runtime`] (which collapses the Tab
//! ring and moves focus inside it). They share [`items`] so that the set a
//! reader is told about and the set the arrows walk cannot drift apart.
use crate;
use crateDir;
use crateTree;
/// The four container / item pairs, and nothing else. `group`, a row of
/// links and a bar of icon buttons stay ordinary Tab rings.
pub const PAIRS: = ;
/// The item role a container role holds, or None for a role that is not a
/// composite container.
pub
/// Whether motion past either end comes round to the other (decision 8).
///
/// A `radioGroup`, `tabList` and `menu` are a choice among *n*, so past the
/// end is the next choice. A `list` clamps, and the reason is specific to
/// lists rather than a taste: **a list can be windowed.** With 4,000 rows
/// and 40 in the tree, the last item is not the last row, so wrapping from
/// the first to "the last" would land on row 40 and claim it was row 4,000.
pub
/// Whether moving focus onto an item also emits its activation payload
/// (decision 11). `radio` and `tab` *define* selection as following focus —
/// arrows check a radio, and a tab bar's automatic activation is what every
/// platform does — while a menu that ran whatever you passed over would be
/// unusable, and manual activation is the norm for a list.
pub
/// The items of the container at `i`: its descendants carrying `item`, in
/// tree order. One walk, so that "3 of 7" and the order the arrows take are
/// the same seven in the same order — two functions that agreed only by
/// inspection would eventually announce a lie.
///
/// It skips whole subtrees three ways, each matching what the access tree
/// does with them: a `role="none"` subtree is decoration, a nested
/// composite of the same kind owns its own items, and a presentational
/// node's descendants are read as part of it (which covers an item nested
/// in an item). Fills `out` rather than returning, so the ring walk pays
/// one allocation per frame instead of one per composite.
pub
/// Whether the container at `i` is a composite: at least one of its items
/// is focusable (decision 1). The `list` half of decision 2 falls out of
/// this without a prop of its own — a navigation list is rows *containing*
/// links, so the focusable node is the link and the rows are not items in
/// the ring's sense, while a picker's rows say `focusable` themselves.
pub
/// The innermost composite container the node at `i` is an item of: the
/// nearest ancestor whose role pairs with `i`'s own. None when `i` is not
/// an item, or its container holds no focusable item.
pub
/// A composite container's orientation, from its own `dir` (decision 7).
pub
/// Which wrap line the item at `i` sits on, within the container at
/// `container`. The layout writes `line` on a wrapping container's own
/// children, so an item nested deeper takes the line of the ancestor that
/// is one — which is the only shape a wrapped composite has.
pub