@mun-ui/ui 0.0.0-stage → 0.2.1
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/LICENSE +21 -0
- package/README.md +114 -2
- package/bin/compile.mjs +38 -0
- package/bin/desktop.mjs +143 -0
- package/bin/dev-protocol.mjs +94 -0
- package/bin/formatter.mjs +109 -0
- package/bin/hot-reload.mjs +38 -0
- package/bin/mun.mjs +538 -0
- package/bin/native.mjs +133 -0
- package/bin/pnpm-workspace.mjs +58 -0
- package/bin/program-patch.mjs +104 -0
- package/bin/project.mjs +322 -0
- package/bin/watch.mjs +316 -0
- package/bin/workflow.mjs +261 -0
- package/dist/astro.d.ts +3 -0
- package/dist/astro.d.ts.map +1 -0
- package/dist/astro.js +3 -0
- package/dist/astro.js.map +1 -0
- package/dist/closures.d.ts +2 -0
- package/dist/closures.d.ts.map +1 -0
- package/dist/closures.js +2 -0
- package/dist/closures.js.map +1 -0
- package/dist/compiler/index.d.ts +2 -0
- package/dist/compiler/index.d.ts.map +1 -0
- package/dist/compiler/index.js +2 -0
- package/dist/compiler/index.js.map +1 -0
- package/dist/core.d.ts +3 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +3 -0
- package/dist/core.js.map +1 -0
- package/dist/experimental.d.ts +2 -0
- package/dist/experimental.d.ts.map +1 -0
- package/dist/experimental.js +2 -0
- package/dist/experimental.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/jsx-dev-runtime.d.ts +2 -0
- package/dist/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/jsx-dev-runtime.js +2 -0
- package/dist/jsx-dev-runtime.js.map +1 -0
- package/dist/jsx-runtime.d.ts +2 -0
- package/dist/jsx-runtime.d.ts.map +1 -0
- package/dist/jsx-runtime.js +2 -0
- package/dist/jsx-runtime.js.map +1 -0
- package/dist/legacy.d.ts +3 -0
- package/dist/legacy.d.ts.map +1 -0
- package/dist/legacy.js +3 -0
- package/dist/legacy.js.map +1 -0
- package/dist/mun.d.ts +5 -0
- package/dist/mun.d.ts.map +1 -0
- package/dist/mun.js +4 -0
- package/dist/mun.js.map +1 -0
- package/dist/progressive-blur/index.d.ts +8 -0
- package/dist/progressive-blur/index.d.ts.map +1 -0
- package/dist/progressive-blur/index.js +8 -0
- package/dist/progressive-blur/index.js.map +1 -0
- package/dist/progressive-blur/plan.d.ts +3 -0
- package/dist/progressive-blur/plan.d.ts.map +1 -0
- package/dist/progressive-blur/plan.js +3 -0
- package/dist/progressive-blur/plan.js.map +1 -0
- package/dist/react-types.d.ts +2 -0
- package/dist/react-types.d.ts.map +1 -0
- package/dist/react-types.js +2 -0
- package/dist/react-types.js.map +1 -0
- package/dist/rendering-quality.d.ts +4 -0
- package/dist/rendering-quality.d.ts.map +1 -0
- package/dist/rendering-quality.js +4 -0
- package/dist/rendering-quality.js.map +1 -0
- package/dist/state.d.ts +2 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +2 -0
- package/dist/state.js.map +1 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/vite.d.ts +2 -0
- package/dist/vite.d.ts.map +1 -0
- package/dist/vite.js +2 -0
- package/dist/vite.js.map +1 -0
- package/editors/install.mjs +102 -0
- package/editors/lsp/mun-lsp.mjs +123 -0
- package/editors/lsp/service.mjs +306 -0
- package/editors/lsp/source.mjs +58 -0
- package/editors/vscode/client.mjs +40 -0
- package/editors/vscode/dev-client.mjs +83 -0
- package/editors/vscode/discovery.mjs +46 -0
- package/editors/vscode/export.mjs +42 -0
- package/editors/vscode/extension.cjs +226 -0
- package/editors/vscode/language-configuration.json +15 -0
- package/editors/vscode/package.json +119 -0
- package/editors/vscode/protocol.mjs +29 -0
- package/editors/vscode/syntaxes/mun.tmLanguage.json +130 -0
- package/native/Cargo.lock +3581 -0
- package/native/Cargo.toml +21 -0
- package/native/README.md +21 -0
- package/native/mun-native/Cargo.toml +23 -0
- package/native/mun-native/src/accessibility.rs +738 -0
- package/native/mun-native/src/dev.rs +604 -0
- package/native/mun-native/src/host_services.rs +202 -0
- package/native/mun-native/src/lib.rs +2843 -0
- package/native/mun-native/src/main.rs +204 -0
- package/native/mun-native/src/offscreen.rs +393 -0
- package/native/mun-native/src/rect.wgsl +63 -0
- package/native/mun-native/src/text.rs +401 -0
- package/native/mun-native/tests/offscreen_rendering.rs +161 -0
- package/native/mun-native/tests/stress.rs +408 -0
- package/native/mun-native/tests/window_lifecycle.rs +183 -0
- package/native/mun-runtime/Cargo.toml +13 -0
- package/native/mun-runtime/src/accessibility.rs +193 -0
- package/native/mun-runtime/src/collection.rs +1090 -0
- package/native/mun-runtime/src/gesture.rs +1070 -0
- package/native/mun-runtime/src/input.rs +325 -0
- package/native/mun-runtime/src/ir.rs +852 -0
- package/native/mun-runtime/src/kinetics.rs +500 -0
- package/native/mun-runtime/src/layout.rs +258 -0
- package/native/mun-runtime/src/layout_cache.rs +209 -0
- package/native/mun-runtime/src/lib.rs +52 -0
- package/native/mun-runtime/src/motion.rs +1162 -0
- package/native/mun-runtime/src/retained.rs +574 -0
- package/native/mun-runtime/src/runtime.rs +7449 -0
- package/native/mun-runtime/src/scene.rs +567 -0
- package/native/mun-runtime/src/scroll.rs +521 -0
- package/native/mun-runtime/src/scroll_view.rs +220 -0
- package/native/mun-runtime/src/text_edit.rs +670 -0
- package/native/mun-runtime/src/timeline.rs +1534 -0
- package/native/mun-runtime/src/validate.rs +677 -0
- package/native/mun-runtime/tests/accessibility_semantics.rs +168 -0
- package/native/mun-runtime/tests/compiler_contract.rs +110 -0
- package/native/mun-runtime/tests/flexible_frames.rs +47 -0
- package/native/mun-runtime/tests/host_services.rs +107 -0
- package/native/mun-runtime/tests/hot_update.rs +367 -0
- package/native/mun-runtime/tests/incremental_runtime.rs +323 -0
- package/native/mun-runtime/tests/ir_validation.rs +167 -0
- package/native/mun-runtime/tests/keyed_collections.rs +251 -0
- package/native/mun-runtime/tests/minimum_window_size.rs +80 -0
- package/native/mun-runtime/tests/native_controls_style.rs +491 -0
- package/native/mun-runtime/tests/native_demo.rs +285 -0
- package/native/mun-runtime/tests/native_layout_style.rs +175 -0
- package/native/mun-runtime/tests/native_settings_pane.rs +152 -0
- package/native/mun-runtime/tests/priority_proposals.rs +69 -0
- package/native/mun-runtime/tests/scroll_view.rs +403 -0
- package/native/mun-runtime/tests/text_editing.rs +491 -0
- package/native/mun-runtime/tests/text_proposals.rs +42 -0
- package/native/mun-runtime/tests/typography.rs +63 -0
- package/package.json +213 -3
- package/schemas/README.md +19 -0
- package/schemas/semantic-ui-ir-v1.schema.json +2061 -0
- package/templates/desktop/gitignore +5 -0
- package/templates/desktop/package.json +10 -0
- package/templates/desktop/src-tauri/Cargo.toml +14 -0
- package/templates/desktop/src-tauri/build.rs +1 -0
- package/templates/desktop/src-tauri/capabilities/main.json +12 -0
- package/templates/desktop/src-tauri/icons/icon.icns +0 -0
- package/templates/desktop/src-tauri/icons/icon.ico +0 -0
- package/templates/desktop/src-tauri/icons/icon.png +0 -0
- package/templates/desktop/src-tauri/src/main.rs +2 -0
- package/templates/desktop/src-tauri/tauri.conf.json +42 -0
- package/templates/desktop/vite.config.ts +10 -0
- package/templates/native/App.mun +15 -0
- package/templates/native/gitignore +3 -0
- package/templates/native/mun.toml +8 -0
- package/templates/project/gitignore +5 -0
- package/templates/project/index.html +13 -0
- package/templates/project/package.json +24 -0
- package/templates/project/src/App.mun +13 -0
- package/templates/project/src/index.css +30 -0
- package/templates/project/src/main.ts +5 -0
- package/templates/project/tsconfig.json +20 -0
- package/templates/project/vite.config.ts +6 -0
- package/templates/vite/src/App.css +134 -0
- package/templates/vite/src/App.tsx +91 -0
- package/templates/vite/src/index.css +23 -0
- package/templates/vite/vite.config.ts +10 -0
|
@@ -0,0 +1,738 @@
|
|
|
1
|
+
use std::sync::{Arc, Mutex};
|
|
2
|
+
|
|
3
|
+
use accesskit::{
|
|
4
|
+
Action, ActionData, ActionHandler, ActionRequest, ActivationHandler, DeactivationHandler, Node,
|
|
5
|
+
NodeId, Rect, Role, ScrollUnit, TextPosition, TextSelection, Toggled, TreeId, TreeInfo,
|
|
6
|
+
TreeUpdate,
|
|
7
|
+
};
|
|
8
|
+
use accesskit_winit::Adapter;
|
|
9
|
+
use mun_runtime::accessibility::{AccessibilityAction as MunAction, AccessibleText};
|
|
10
|
+
use mun_runtime::{AccessibilityTree, ir::AccessibilityRole as MunAccessibilityRole};
|
|
11
|
+
use winit::{
|
|
12
|
+
event::WindowEvent,
|
|
13
|
+
event_loop::{ActiveEventLoop, EventLoopProxy},
|
|
14
|
+
window::Window,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
#[derive(Clone, Debug)]
|
|
18
|
+
pub enum NativeEvent {
|
|
19
|
+
AccessibilityAction(ActionRequest),
|
|
20
|
+
/// Development toolchain command (only in `--dev` launches).
|
|
21
|
+
Dev(crate::dev::DevCommand),
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
#[derive(Clone)]
|
|
25
|
+
struct AccessibilitySnapshot {
|
|
26
|
+
tree: AccessibilityTree,
|
|
27
|
+
scale_factor: f32,
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
#[derive(Clone)]
|
|
31
|
+
struct Activation {
|
|
32
|
+
snapshot: Arc<Mutex<AccessibilitySnapshot>>,
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
impl ActivationHandler for Activation {
|
|
36
|
+
fn request_initial_tree(&mut self) -> Option<TreeUpdate> {
|
|
37
|
+
let snapshot = self.snapshot.lock().expect("accessibility snapshot");
|
|
38
|
+
Some(build_update(&snapshot.tree, snapshot.scale_factor, true))
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
struct Actions {
|
|
43
|
+
proxy: EventLoopProxy<NativeEvent>,
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
impl ActionHandler for Actions {
|
|
47
|
+
fn do_action(&mut self, request: ActionRequest) {
|
|
48
|
+
let _ = self
|
|
49
|
+
.proxy
|
|
50
|
+
.send_event(NativeEvent::AccessibilityAction(request));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
struct Deactivation;
|
|
55
|
+
|
|
56
|
+
impl DeactivationHandler for Deactivation {
|
|
57
|
+
fn deactivate_accessibility(&mut self) {}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
pub struct AccessibilityHost {
|
|
61
|
+
adapter: Adapter,
|
|
62
|
+
snapshot: Arc<Mutex<AccessibilitySnapshot>>,
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
impl AccessibilityHost {
|
|
66
|
+
pub fn new(
|
|
67
|
+
event_loop: &ActiveEventLoop,
|
|
68
|
+
window: &Window,
|
|
69
|
+
tree: AccessibilityTree,
|
|
70
|
+
scale_factor: f32,
|
|
71
|
+
proxy: EventLoopProxy<NativeEvent>,
|
|
72
|
+
) -> Self {
|
|
73
|
+
let snapshot = Arc::new(Mutex::new(AccessibilitySnapshot { tree, scale_factor }));
|
|
74
|
+
let adapter = Adapter::with_direct_handlers(
|
|
75
|
+
event_loop,
|
|
76
|
+
window,
|
|
77
|
+
Activation {
|
|
78
|
+
snapshot: snapshot.clone(),
|
|
79
|
+
},
|
|
80
|
+
Actions { proxy },
|
|
81
|
+
Deactivation,
|
|
82
|
+
);
|
|
83
|
+
Self { adapter, snapshot }
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
pub fn process_event(&mut self, window: &Window, event: &WindowEvent) {
|
|
87
|
+
self.adapter.process_event(window, event);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
pub fn update(&mut self, tree: AccessibilityTree, scale_factor: f32) {
|
|
91
|
+
{
|
|
92
|
+
let mut snapshot = self.snapshot.lock().expect("accessibility snapshot");
|
|
93
|
+
snapshot.tree = tree;
|
|
94
|
+
snapshot.scale_factor = scale_factor;
|
|
95
|
+
}
|
|
96
|
+
let snapshot = self.snapshot.clone();
|
|
97
|
+
self.adapter.update_if_active(move || {
|
|
98
|
+
let snapshot = snapshot.lock().expect("accessibility snapshot");
|
|
99
|
+
build_update(&snapshot.tree, snapshot.scale_factor, false)
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/// Translate a platform request into a semantic runtime action against the
|
|
104
|
+
/// tree the platform last saw. Unknown targets and unsupported data are
|
|
105
|
+
/// ignored rather than guessed.
|
|
106
|
+
pub fn semantic_request(&self, request: &ActionRequest) -> Option<(String, MunAction)> {
|
|
107
|
+
let snapshot = self.snapshot.lock().expect("accessibility snapshot");
|
|
108
|
+
translate_request(&snapshot.tree, snapshot.scale_factor, request)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
fn translate_request(
|
|
113
|
+
tree: &AccessibilityTree,
|
|
114
|
+
scale_factor: f32,
|
|
115
|
+
request: &ActionRequest,
|
|
116
|
+
) -> Option<(String, MunAction)> {
|
|
117
|
+
let node = tree
|
|
118
|
+
.nodes
|
|
119
|
+
.iter()
|
|
120
|
+
.find(|node| node_id(&node.id) == request.target_node)?;
|
|
121
|
+
let id = node.id.clone();
|
|
122
|
+
let action = match (request.action, &request.data) {
|
|
123
|
+
(Action::Click, _) => MunAction::Activate,
|
|
124
|
+
(Action::Focus, _) => MunAction::Focus,
|
|
125
|
+
(Action::Blur, _) => MunAction::Blur,
|
|
126
|
+
(Action::ScrollIntoView, _) => MunAction::ScrollIntoView,
|
|
127
|
+
(Action::SetTextSelection, Some(ActionData::SetTextSelection(selection))) => {
|
|
128
|
+
let text = node.text.as_ref()?;
|
|
129
|
+
let runs = text_runs(text);
|
|
130
|
+
MunAction::SetTextSelection {
|
|
131
|
+
anchor: grapheme_at(text, &runs, selection.anchor)?,
|
|
132
|
+
focus: grapheme_at(text, &runs, selection.focus)?,
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
(Action::ReplaceSelectedText, Some(ActionData::Value(value))) => {
|
|
136
|
+
MunAction::ReplaceSelectedText(value.to_string())
|
|
137
|
+
}
|
|
138
|
+
(Action::SetValue, Some(ActionData::Value(value))) => {
|
|
139
|
+
MunAction::SetValue(value.to_string())
|
|
140
|
+
}
|
|
141
|
+
(
|
|
142
|
+
Action::ScrollUp | Action::ScrollDown | Action::ScrollLeft | Action::ScrollRight,
|
|
143
|
+
data,
|
|
144
|
+
) => {
|
|
145
|
+
let scroll = node.scroll?;
|
|
146
|
+
let forward = matches!(request.action, Action::ScrollDown | Action::ScrollRight);
|
|
147
|
+
let sign = if forward { 1.0 } else { -1.0 };
|
|
148
|
+
match data {
|
|
149
|
+
Some(ActionData::ScrollUnit(ScrollUnit::Item)) => MunAction::SetScrollOffset(
|
|
150
|
+
scroll.offset + sign * mun_runtime::scroll_view::SCROLL_LINE,
|
|
151
|
+
),
|
|
152
|
+
_ => MunAction::ScrollByPages(sign),
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
(Action::SetScrollOffset, Some(ActionData::SetScrollOffset(point))) => {
|
|
156
|
+
let scroll = node.scroll?;
|
|
157
|
+
let value = if scroll.horizontal { point.x } else { point.y };
|
|
158
|
+
MunAction::SetScrollOffset(value as f32 / scale_factor.max(f32::EPSILON))
|
|
159
|
+
}
|
|
160
|
+
_ => return None,
|
|
161
|
+
};
|
|
162
|
+
Some((id, action))
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/// AccessKit stores per-run character data as `u8`: runs hold at most 255
|
|
166
|
+
/// characters and a character at most 255 UTF-8 bytes. Each platform
|
|
167
|
+
/// character records the runtime grapheme it belongs to; a grapheme longer
|
|
168
|
+
/// than 255 bytes (pathological ZWJ chains) spans several platform characters.
|
|
169
|
+
struct PlatformRun {
|
|
170
|
+
text: String,
|
|
171
|
+
lengths: Vec<u8>,
|
|
172
|
+
graphemes: Vec<usize>,
|
|
173
|
+
positions: Vec<f32>,
|
|
174
|
+
widths: Vec<f32>,
|
|
175
|
+
word_starts: Vec<u8>,
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const MAX_RUN: usize = u8::MAX as usize;
|
|
179
|
+
|
|
180
|
+
fn text_runs(text: &AccessibleText) -> Vec<PlatformRun> {
|
|
181
|
+
let mut runs: Vec<PlatformRun> = Vec::new();
|
|
182
|
+
let mut byte = 0;
|
|
183
|
+
for (grapheme, &length) in text.character_lengths.iter().enumerate() {
|
|
184
|
+
let source = &text.value[byte..byte + length];
|
|
185
|
+
byte += length;
|
|
186
|
+
let mut pieces = Vec::new();
|
|
187
|
+
let mut start = 0;
|
|
188
|
+
for (index, ch) in source.char_indices() {
|
|
189
|
+
if index + ch.len_utf8() - start > MAX_RUN {
|
|
190
|
+
pieces.push(&source[start..index]);
|
|
191
|
+
start = index;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
pieces.push(&source[start..]);
|
|
195
|
+
let position = text
|
|
196
|
+
.character_positions
|
|
197
|
+
.get(grapheme)
|
|
198
|
+
.copied()
|
|
199
|
+
.unwrap_or(0.0);
|
|
200
|
+
let width = text.character_widths.get(grapheme).copied().unwrap_or(0.0);
|
|
201
|
+
let starts_word = text.word_starts.binary_search(&grapheme).is_ok();
|
|
202
|
+
for (piece_index, piece) in pieces.iter().enumerate() {
|
|
203
|
+
if runs.last().is_none_or(|run| run.lengths.len() == MAX_RUN) {
|
|
204
|
+
runs.push(PlatformRun {
|
|
205
|
+
text: String::new(),
|
|
206
|
+
lengths: Vec::new(),
|
|
207
|
+
graphemes: Vec::new(),
|
|
208
|
+
positions: Vec::new(),
|
|
209
|
+
widths: Vec::new(),
|
|
210
|
+
word_starts: Vec::new(),
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
let run = runs.last_mut().expect("run");
|
|
214
|
+
if starts_word && piece_index == 0 {
|
|
215
|
+
run.word_starts.push(run.lengths.len() as u8);
|
|
216
|
+
}
|
|
217
|
+
run.text.push_str(piece);
|
|
218
|
+
run.lengths.push(piece.len() as u8);
|
|
219
|
+
run.graphemes.push(grapheme);
|
|
220
|
+
run.positions.push(position);
|
|
221
|
+
run.widths.push(if piece_index == 0 { width } else { 0.0 });
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
if runs.is_empty() {
|
|
225
|
+
runs.push(PlatformRun {
|
|
226
|
+
text: String::new(),
|
|
227
|
+
lengths: Vec::new(),
|
|
228
|
+
graphemes: Vec::new(),
|
|
229
|
+
positions: Vec::new(),
|
|
230
|
+
widths: Vec::new(),
|
|
231
|
+
word_starts: Vec::new(),
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
runs
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
fn run_id(text: &AccessibleText, index: usize) -> NodeId {
|
|
238
|
+
node_id(&format!("{}#{index}", text.id))
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/// Platform position for a runtime grapheme index (end-of-text allowed).
|
|
242
|
+
fn text_position(text: &AccessibleText, runs: &[PlatformRun], grapheme: usize) -> TextPosition {
|
|
243
|
+
for (index, run) in runs.iter().enumerate() {
|
|
244
|
+
if let Some(character) = run.graphemes.iter().position(|item| *item == grapheme) {
|
|
245
|
+
return TextPosition {
|
|
246
|
+
node: run_id(text, index),
|
|
247
|
+
character_index: character,
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
let last = runs.len() - 1;
|
|
252
|
+
TextPosition {
|
|
253
|
+
node: run_id(text, last),
|
|
254
|
+
character_index: runs[last].lengths.len(),
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/// Runtime grapheme for a platform position; mid-grapheme pieces snap to the
|
|
259
|
+
/// grapheme start so a selection never splits a cluster.
|
|
260
|
+
fn grapheme_at(
|
|
261
|
+
text: &AccessibleText,
|
|
262
|
+
runs: &[PlatformRun],
|
|
263
|
+
position: TextPosition,
|
|
264
|
+
) -> Option<usize> {
|
|
265
|
+
let (index, run) = runs
|
|
266
|
+
.iter()
|
|
267
|
+
.enumerate()
|
|
268
|
+
.find(|(index, _)| run_id(text, *index) == position.node)?;
|
|
269
|
+
if let Some(grapheme) = run.graphemes.get(position.character_index) {
|
|
270
|
+
return Some(*grapheme);
|
|
271
|
+
}
|
|
272
|
+
// End of a run is the start of the next run's first grapheme, or the end
|
|
273
|
+
// of the text after the last run.
|
|
274
|
+
Some(
|
|
275
|
+
match runs.get(index + 1).and_then(|next| next.graphemes.first()) {
|
|
276
|
+
Some(next) => *next,
|
|
277
|
+
None => text.character_lengths.len(),
|
|
278
|
+
},
|
|
279
|
+
)
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
fn build_update(tree: &AccessibilityTree, scale_factor: f32, include_tree: bool) -> TreeUpdate {
|
|
283
|
+
let mut nodes = Vec::with_capacity(tree.nodes.len());
|
|
284
|
+
for item in &tree.nodes {
|
|
285
|
+
let id = node_id(&item.id);
|
|
286
|
+
let mut node = Node::new(role(item.role));
|
|
287
|
+
if let Some(label) = &item.label {
|
|
288
|
+
if item.role == MunAccessibilityRole::Text {
|
|
289
|
+
node.set_value(label.clone());
|
|
290
|
+
} else {
|
|
291
|
+
node.set_label(label.clone());
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
if let Some(value) = &item.value {
|
|
295
|
+
node.set_value(value.clone());
|
|
296
|
+
}
|
|
297
|
+
let scale = scale_factor as f64;
|
|
298
|
+
node.set_bounds(Rect {
|
|
299
|
+
x0: item.bounds.x as f64 * scale,
|
|
300
|
+
y0: item.bounds.y as f64 * scale,
|
|
301
|
+
x1: (item.bounds.x + item.bounds.width) as f64 * scale,
|
|
302
|
+
y1: (item.bounds.y + item.bounds.height) as f64 * scale,
|
|
303
|
+
});
|
|
304
|
+
let mut children = item
|
|
305
|
+
.children
|
|
306
|
+
.iter()
|
|
307
|
+
.map(|child| node_id(child))
|
|
308
|
+
.collect::<Vec<_>>();
|
|
309
|
+
if !item.enabled {
|
|
310
|
+
node.set_disabled();
|
|
311
|
+
}
|
|
312
|
+
if let Some(checked) = item.checked {
|
|
313
|
+
node.set_toggled(if checked {
|
|
314
|
+
Toggled::True
|
|
315
|
+
} else {
|
|
316
|
+
Toggled::False
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
let is_option = item.role == MunAccessibilityRole::RadioButton;
|
|
320
|
+
if item.action_id.is_some() && item.enabled {
|
|
321
|
+
node.add_action(Action::Click);
|
|
322
|
+
// Options take focus through their group, never individually.
|
|
323
|
+
if !is_option {
|
|
324
|
+
if item.focused {
|
|
325
|
+
node.add_action(Action::Blur);
|
|
326
|
+
} else {
|
|
327
|
+
node.add_action(Action::Focus);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
if item.id != tree.root_id {
|
|
332
|
+
node.add_action(Action::ScrollIntoView);
|
|
333
|
+
}
|
|
334
|
+
if let Some(scroll) = item.scroll {
|
|
335
|
+
let (offset, max) = (scroll.offset as f64 * scale, scroll.max as f64 * scale);
|
|
336
|
+
if scroll.horizontal {
|
|
337
|
+
node.set_scroll_x(offset);
|
|
338
|
+
node.set_scroll_x_min(0.0);
|
|
339
|
+
node.set_scroll_x_max(max);
|
|
340
|
+
node.add_action(Action::ScrollLeft);
|
|
341
|
+
node.add_action(Action::ScrollRight);
|
|
342
|
+
} else {
|
|
343
|
+
node.set_scroll_y(offset);
|
|
344
|
+
node.set_scroll_y_min(0.0);
|
|
345
|
+
node.set_scroll_y_max(max);
|
|
346
|
+
node.add_action(Action::ScrollUp);
|
|
347
|
+
node.add_action(Action::ScrollDown);
|
|
348
|
+
}
|
|
349
|
+
node.add_action(Action::SetScrollOffset);
|
|
350
|
+
}
|
|
351
|
+
if let Some(text) = &item.text {
|
|
352
|
+
let runs = text_runs(text);
|
|
353
|
+
for (index, run) in runs.iter().enumerate() {
|
|
354
|
+
let origin = run.positions.first().copied().unwrap_or(0.0);
|
|
355
|
+
let mut run_node = Node::new(Role::TextRun);
|
|
356
|
+
run_node.set_value(run.text.clone());
|
|
357
|
+
run_node.set_character_lengths(run.lengths.clone());
|
|
358
|
+
run_node.set_character_positions(
|
|
359
|
+
run.positions
|
|
360
|
+
.iter()
|
|
361
|
+
.map(|position| (position - origin) * scale_factor)
|
|
362
|
+
.collect::<Vec<_>>(),
|
|
363
|
+
);
|
|
364
|
+
run_node.set_character_widths(
|
|
365
|
+
run.widths
|
|
366
|
+
.iter()
|
|
367
|
+
.map(|width| width * scale_factor)
|
|
368
|
+
.collect::<Vec<_>>(),
|
|
369
|
+
);
|
|
370
|
+
run_node.set_word_starts(run.word_starts.clone());
|
|
371
|
+
let end = run
|
|
372
|
+
.positions
|
|
373
|
+
.iter()
|
|
374
|
+
.zip(&run.widths)
|
|
375
|
+
.map(|(position, width)| position + width)
|
|
376
|
+
.fold(origin, f32::max);
|
|
377
|
+
run_node.set_bounds(Rect {
|
|
378
|
+
x0: (text.bounds.x + origin) as f64 * scale,
|
|
379
|
+
y0: text.bounds.y as f64 * scale,
|
|
380
|
+
x1: (text.bounds.x + end) as f64 * scale,
|
|
381
|
+
y1: (text.bounds.y + text.bounds.height) as f64 * scale,
|
|
382
|
+
});
|
|
383
|
+
let id = run_id(text, index);
|
|
384
|
+
children.push(id);
|
|
385
|
+
nodes.push((id, run_node));
|
|
386
|
+
}
|
|
387
|
+
if let Some((anchor, focus)) = text.selection {
|
|
388
|
+
node.set_text_selection(TextSelection {
|
|
389
|
+
anchor: text_position(text, &runs, anchor),
|
|
390
|
+
focus: text_position(text, &runs, focus),
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
if item.enabled {
|
|
394
|
+
node.add_action(Action::SetTextSelection);
|
|
395
|
+
node.add_action(Action::ReplaceSelectedText);
|
|
396
|
+
node.add_action(Action::SetValue);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
node.set_children(children);
|
|
400
|
+
nodes.push((id, node));
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
let root = node_id(&tree.root_id);
|
|
404
|
+
let focus = tree.focus_id.as_deref().map(node_id).unwrap_or(root);
|
|
405
|
+
let tree_info = include_tree.then(|| {
|
|
406
|
+
let mut info = TreeInfo::new(root);
|
|
407
|
+
info.toolkit_name = Some("Mün".into());
|
|
408
|
+
info.toolkit_version = Some(env!("CARGO_PKG_VERSION").into());
|
|
409
|
+
info
|
|
410
|
+
});
|
|
411
|
+
TreeUpdate {
|
|
412
|
+
nodes,
|
|
413
|
+
tree: tree_info,
|
|
414
|
+
tree_id: TreeId::ROOT,
|
|
415
|
+
focus,
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
fn role(role: MunAccessibilityRole) -> Role {
|
|
420
|
+
match role {
|
|
421
|
+
MunAccessibilityRole::Window => Role::Window,
|
|
422
|
+
MunAccessibilityRole::Group => Role::Group,
|
|
423
|
+
MunAccessibilityRole::Text => Role::Label,
|
|
424
|
+
MunAccessibilityRole::Button => Role::Button,
|
|
425
|
+
MunAccessibilityRole::TextField => Role::TextInput,
|
|
426
|
+
MunAccessibilityRole::RadioGroup => Role::RadioGroup,
|
|
427
|
+
MunAccessibilityRole::RadioButton => Role::RadioButton,
|
|
428
|
+
MunAccessibilityRole::CheckBox => Role::CheckBox,
|
|
429
|
+
MunAccessibilityRole::ProgressIndicator => Role::ProgressIndicator,
|
|
430
|
+
MunAccessibilityRole::SecureTextField => Role::PasswordInput,
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
fn node_id(value: &str) -> NodeId {
|
|
435
|
+
// Stable FNV-1a IDs keep accessibility identity independent of traversal order.
|
|
436
|
+
let mut hash = 0xcbf29ce484222325u64;
|
|
437
|
+
for byte in value.as_bytes() {
|
|
438
|
+
hash ^= u64::from(*byte);
|
|
439
|
+
hash = hash.wrapping_mul(0x100000001b3);
|
|
440
|
+
}
|
|
441
|
+
if hash == 0 { NodeId(1) } else { NodeId(hash) }
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
#[cfg(test)]
|
|
445
|
+
mod tests {
|
|
446
|
+
use super::*;
|
|
447
|
+
use mun_runtime::{AccessibilityBounds, AccessibilityNode};
|
|
448
|
+
|
|
449
|
+
#[test]
|
|
450
|
+
fn text_input_name_and_committed_value_are_distinct() {
|
|
451
|
+
let mut tree = semantic_tree();
|
|
452
|
+
let field = &mut tree.nodes[1];
|
|
453
|
+
field.role = MunAccessibilityRole::TextField;
|
|
454
|
+
field.label = Some("Name".into());
|
|
455
|
+
field.value = Some("한글".into());
|
|
456
|
+
let update = build_update(&tree, 2.0, true);
|
|
457
|
+
let node = &update
|
|
458
|
+
.nodes
|
|
459
|
+
.iter()
|
|
460
|
+
.find(|(id, _)| *id == node_id("primary"))
|
|
461
|
+
.unwrap()
|
|
462
|
+
.1;
|
|
463
|
+
assert_eq!(node.role(), Role::TextInput);
|
|
464
|
+
assert_eq!(node.label(), Some("Name"));
|
|
465
|
+
assert_eq!(node.value(), Some("한글"));
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
fn semantic_tree() -> AccessibilityTree {
|
|
469
|
+
AccessibilityTree {
|
|
470
|
+
root_id: "root".into(),
|
|
471
|
+
focus_id: Some("primary".into()),
|
|
472
|
+
nodes: vec![
|
|
473
|
+
AccessibilityNode {
|
|
474
|
+
id: "root".into(),
|
|
475
|
+
role: MunAccessibilityRole::Window,
|
|
476
|
+
label: Some("Window".into()),
|
|
477
|
+
value: None,
|
|
478
|
+
enabled: true,
|
|
479
|
+
focused: false,
|
|
480
|
+
bounds: AccessibilityBounds {
|
|
481
|
+
x: 0.0,
|
|
482
|
+
y: 0.0,
|
|
483
|
+
width: 320.0,
|
|
484
|
+
height: 200.0,
|
|
485
|
+
},
|
|
486
|
+
children: vec!["primary".into(), "disabled".into(), "label".into()],
|
|
487
|
+
action_id: None,
|
|
488
|
+
checked: None,
|
|
489
|
+
text: None,
|
|
490
|
+
scroll: None,
|
|
491
|
+
},
|
|
492
|
+
AccessibilityNode {
|
|
493
|
+
id: "primary".into(),
|
|
494
|
+
role: MunAccessibilityRole::Button,
|
|
495
|
+
label: Some("Primary".into()),
|
|
496
|
+
value: None,
|
|
497
|
+
enabled: true,
|
|
498
|
+
focused: true,
|
|
499
|
+
bounds: AccessibilityBounds {
|
|
500
|
+
x: 10.0,
|
|
501
|
+
y: 20.0,
|
|
502
|
+
width: 100.0,
|
|
503
|
+
height: 40.0,
|
|
504
|
+
},
|
|
505
|
+
children: Vec::new(),
|
|
506
|
+
action_id: Some("primary".into()),
|
|
507
|
+
checked: None,
|
|
508
|
+
text: None,
|
|
509
|
+
scroll: None,
|
|
510
|
+
},
|
|
511
|
+
AccessibilityNode {
|
|
512
|
+
id: "disabled".into(),
|
|
513
|
+
role: MunAccessibilityRole::Button,
|
|
514
|
+
label: Some("Disabled".into()),
|
|
515
|
+
value: None,
|
|
516
|
+
enabled: false,
|
|
517
|
+
focused: false,
|
|
518
|
+
bounds: AccessibilityBounds {
|
|
519
|
+
x: 10.0,
|
|
520
|
+
y: 70.0,
|
|
521
|
+
width: 100.0,
|
|
522
|
+
height: 40.0,
|
|
523
|
+
},
|
|
524
|
+
children: Vec::new(),
|
|
525
|
+
action_id: Some("disabled".into()),
|
|
526
|
+
checked: None,
|
|
527
|
+
text: None,
|
|
528
|
+
scroll: None,
|
|
529
|
+
},
|
|
530
|
+
AccessibilityNode {
|
|
531
|
+
id: "label".into(),
|
|
532
|
+
role: MunAccessibilityRole::Text,
|
|
533
|
+
label: Some("Status".into()),
|
|
534
|
+
value: None,
|
|
535
|
+
enabled: true,
|
|
536
|
+
focused: false,
|
|
537
|
+
bounds: AccessibilityBounds {
|
|
538
|
+
x: 10.0,
|
|
539
|
+
y: 120.0,
|
|
540
|
+
width: 80.0,
|
|
541
|
+
height: 20.0,
|
|
542
|
+
},
|
|
543
|
+
children: Vec::new(),
|
|
544
|
+
action_id: None,
|
|
545
|
+
checked: None,
|
|
546
|
+
text: None,
|
|
547
|
+
scroll: None,
|
|
548
|
+
},
|
|
549
|
+
],
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
fn update_node<'a>(update: &'a TreeUpdate, semantic_id: &str) -> &'a Node {
|
|
554
|
+
let id = node_id(semantic_id);
|
|
555
|
+
&update
|
|
556
|
+
.nodes
|
|
557
|
+
.iter()
|
|
558
|
+
.find(|(candidate, _)| *candidate == id)
|
|
559
|
+
.expect("accessibility node")
|
|
560
|
+
.1
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
#[test]
|
|
564
|
+
fn accesskit_update_preserves_semantics_focus_and_presentation_bounds() {
|
|
565
|
+
let update = build_update(&semantic_tree(), 2.0, true);
|
|
566
|
+
|
|
567
|
+
assert_eq!(update.focus, node_id("primary"));
|
|
568
|
+
assert_eq!(
|
|
569
|
+
update.tree.as_ref().expect("initial tree").root,
|
|
570
|
+
node_id("root")
|
|
571
|
+
);
|
|
572
|
+
|
|
573
|
+
let root = update_node(&update, "root");
|
|
574
|
+
assert_eq!(root.role(), Role::Window);
|
|
575
|
+
assert_eq!(root.label(), Some("Window"));
|
|
576
|
+
assert_eq!(
|
|
577
|
+
root.children(),
|
|
578
|
+
&[node_id("primary"), node_id("disabled"), node_id("label")]
|
|
579
|
+
);
|
|
580
|
+
|
|
581
|
+
let primary = update_node(&update, "primary");
|
|
582
|
+
assert_eq!(primary.role(), Role::Button);
|
|
583
|
+
assert_eq!(primary.label(), Some("Primary"));
|
|
584
|
+
assert_eq!(
|
|
585
|
+
primary.bounds(),
|
|
586
|
+
Some(Rect {
|
|
587
|
+
x0: 20.0,
|
|
588
|
+
y0: 40.0,
|
|
589
|
+
x1: 220.0,
|
|
590
|
+
y1: 120.0,
|
|
591
|
+
})
|
|
592
|
+
);
|
|
593
|
+
assert!(primary.supports_action(Action::Click));
|
|
594
|
+
assert!(primary.supports_action(Action::Blur));
|
|
595
|
+
assert!(!primary.supports_action(Action::Focus));
|
|
596
|
+
|
|
597
|
+
let disabled = update_node(&update, "disabled");
|
|
598
|
+
assert!(disabled.is_disabled());
|
|
599
|
+
assert!(!disabled.supports_action(Action::Click));
|
|
600
|
+
assert!(!disabled.supports_action(Action::Focus));
|
|
601
|
+
|
|
602
|
+
let label = update_node(&update, "label");
|
|
603
|
+
assert_eq!(label.role(), Role::Label);
|
|
604
|
+
assert_eq!(label.value(), Some("Status"));
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
#[test]
|
|
608
|
+
fn unfocused_enabled_action_advertises_focus_not_blur() {
|
|
609
|
+
let mut tree = semantic_tree();
|
|
610
|
+
tree.focus_id = None;
|
|
611
|
+
let primary = tree
|
|
612
|
+
.nodes
|
|
613
|
+
.iter_mut()
|
|
614
|
+
.find(|node| node.id == "primary")
|
|
615
|
+
.expect("primary semantic node");
|
|
616
|
+
primary.focused = false;
|
|
617
|
+
|
|
618
|
+
let update = build_update(&tree, 1.0, false);
|
|
619
|
+
let primary = update_node(&update, "primary");
|
|
620
|
+
assert!(primary.supports_action(Action::Click));
|
|
621
|
+
assert!(primary.supports_action(Action::Focus));
|
|
622
|
+
assert!(!primary.supports_action(Action::Blur));
|
|
623
|
+
assert_eq!(update.focus, node_id("root"));
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
fn text_tree(value: &str, selection: Option<(usize, usize)>) -> AccessibilityTree {
|
|
627
|
+
use unicode_segmentation::UnicodeSegmentation;
|
|
628
|
+
let mut tree = semantic_tree();
|
|
629
|
+
let field = &mut tree.nodes[1];
|
|
630
|
+
field.role = MunAccessibilityRole::TextField;
|
|
631
|
+
let lengths: Vec<usize> = value.graphemes(true).map(str::len).collect();
|
|
632
|
+
field.text = Some(AccessibleText {
|
|
633
|
+
id: "primary:text-run".into(),
|
|
634
|
+
value: value.into(),
|
|
635
|
+
character_positions: (0..lengths.len())
|
|
636
|
+
.map(|index| index as f32 * 10.0)
|
|
637
|
+
.collect(),
|
|
638
|
+
character_widths: vec![10.0; lengths.len()],
|
|
639
|
+
word_starts: vec![0],
|
|
640
|
+
character_lengths: lengths,
|
|
641
|
+
bounds: AccessibilityBounds {
|
|
642
|
+
x: 20.0,
|
|
643
|
+
y: 30.0,
|
|
644
|
+
width: 0.0,
|
|
645
|
+
height: 20.0,
|
|
646
|
+
},
|
|
647
|
+
selection,
|
|
648
|
+
});
|
|
649
|
+
tree
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
#[test]
|
|
653
|
+
fn long_text_is_split_into_u8_runs_and_selection_round_trips_by_grapheme() {
|
|
654
|
+
// 300 graphemes, each "한" (3 bytes) or a 2-scalar combining cluster.
|
|
655
|
+
let value: String = (0..300)
|
|
656
|
+
.map(|i| if i % 2 == 0 { "한" } else { "e\u{301}" })
|
|
657
|
+
.collect();
|
|
658
|
+
let tree = text_tree(&value, Some((254, 290)));
|
|
659
|
+
let update = build_update(&tree, 2.0, false);
|
|
660
|
+
let field = update_node(&update, "primary");
|
|
661
|
+
let runs: Vec<_> = field
|
|
662
|
+
.children()
|
|
663
|
+
.iter()
|
|
664
|
+
.map(|id| {
|
|
665
|
+
&update
|
|
666
|
+
.nodes
|
|
667
|
+
.iter()
|
|
668
|
+
.find(|(candidate, _)| candidate == id)
|
|
669
|
+
.unwrap()
|
|
670
|
+
.1
|
|
671
|
+
})
|
|
672
|
+
.collect();
|
|
673
|
+
assert_eq!(runs.len(), 2);
|
|
674
|
+
assert_eq!(runs[0].character_lengths().len(), 255);
|
|
675
|
+
assert_eq!(runs[1].character_lengths().len(), 45);
|
|
676
|
+
assert_eq!(
|
|
677
|
+
runs.iter()
|
|
678
|
+
.map(|run| run.value().unwrap())
|
|
679
|
+
.collect::<String>(),
|
|
680
|
+
value
|
|
681
|
+
);
|
|
682
|
+
// Positions are run-local and scaled.
|
|
683
|
+
assert_eq!(runs[1].character_positions().unwrap()[1], 20.0);
|
|
684
|
+
let selection = field.text_selection().unwrap();
|
|
685
|
+
assert_eq!(selection.anchor.character_index, 254);
|
|
686
|
+
assert_eq!(selection.focus.node, field.children()[1]);
|
|
687
|
+
assert_eq!(selection.focus.character_index, 35);
|
|
688
|
+
|
|
689
|
+
let request = ActionRequest {
|
|
690
|
+
action: Action::SetTextSelection,
|
|
691
|
+
target_tree: TreeId::ROOT,
|
|
692
|
+
target_node: node_id("primary"),
|
|
693
|
+
data: Some(ActionData::SetTextSelection(TextSelection {
|
|
694
|
+
anchor: TextPosition {
|
|
695
|
+
node: field.children()[0],
|
|
696
|
+
character_index: 255,
|
|
697
|
+
},
|
|
698
|
+
focus: TextPosition {
|
|
699
|
+
node: field.children()[1],
|
|
700
|
+
character_index: 45,
|
|
701
|
+
},
|
|
702
|
+
})),
|
|
703
|
+
};
|
|
704
|
+
let (_, action) = translate_request(&tree, 2.0, &request).unwrap();
|
|
705
|
+
assert_eq!(
|
|
706
|
+
action,
|
|
707
|
+
MunAction::SetTextSelection {
|
|
708
|
+
anchor: 255,
|
|
709
|
+
focus: 300
|
|
710
|
+
}
|
|
711
|
+
);
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
#[test]
|
|
715
|
+
fn oversized_grapheme_spans_platform_characters_but_maps_back_to_one_cluster() {
|
|
716
|
+
// 60 ZWJ-joined emoji form one cluster of 417 UTF-8 bytes.
|
|
717
|
+
let family = ["👨"; 60].join("\u{200D}");
|
|
718
|
+
let value = format!("a{family}b");
|
|
719
|
+
let tree = text_tree(&value, Some((2, 2)));
|
|
720
|
+
let runs = text_runs(tree.nodes[1].text.as_ref().unwrap());
|
|
721
|
+
let platform: Vec<usize> = runs.iter().flat_map(|run| run.graphemes.clone()).collect();
|
|
722
|
+
assert!(platform.iter().filter(|grapheme| **grapheme == 1).count() > 1);
|
|
723
|
+
assert!(
|
|
724
|
+
runs.iter()
|
|
725
|
+
.all(|run| run.lengths.iter().all(|length| *length > 0))
|
|
726
|
+
);
|
|
727
|
+
let text = tree.nodes[1].text.as_ref().unwrap();
|
|
728
|
+
let middle = TextPosition {
|
|
729
|
+
node: run_id(text, 0),
|
|
730
|
+
character_index: 2,
|
|
731
|
+
};
|
|
732
|
+
assert_eq!(
|
|
733
|
+
grapheme_at(text, &runs, middle),
|
|
734
|
+
Some(1),
|
|
735
|
+
"snaps to cluster start"
|
|
736
|
+
);
|
|
737
|
+
}
|
|
738
|
+
}
|