223 lines
6.4 KiB
Rust
223 lines
6.4 KiB
Rust
mod choices;
|
|
mod formats;
|
|
mod numbers;
|
|
mod pickers;
|
|
mod rich;
|
|
mod text;
|
|
mod values;
|
|
|
|
use gpui::{AnyElement, App, IntoElement, ParentElement, Window, div};
|
|
|
|
use super::Page;
|
|
use crate::script::Step;
|
|
|
|
pub const PAGE: Page = Page {
|
|
number: 6,
|
|
slug: "forms",
|
|
title: "Forms",
|
|
summary: "Text, choices, dates, colors, files: every way to say what you mean.",
|
|
render,
|
|
script: SCRIPT,
|
|
};
|
|
|
|
const SCRIPT: &[Step] = &[
|
|
Step::Rest,
|
|
Step::Click("input-name"),
|
|
Step::Key("secondary-a"),
|
|
Step::Type("Ada Lovelace"),
|
|
Step::Key("shift-left"),
|
|
Step::Key("shift-left"),
|
|
Step::Key("shift-left"),
|
|
Step::Wait(300),
|
|
Step::Shot("typed"),
|
|
Step::Click("textarea"),
|
|
Step::Key("secondary-a"),
|
|
Step::Type("First line of notes"),
|
|
Step::Key("enter"),
|
|
Step::Type("Second line, longer, so the words wrap when they reach the edge of the box"),
|
|
Step::Wait(300),
|
|
Step::Shot("textarea"),
|
|
Step::Click("password"),
|
|
Step::Key("secondary-a"),
|
|
Step::Type("hunter2"),
|
|
Step::Wait(200),
|
|
Step::Shot("password"),
|
|
Step::Click("search"),
|
|
Step::Wait(300),
|
|
Step::Shot("search-history"),
|
|
Step::Click("number"),
|
|
Step::Key("up"),
|
|
Step::Key("up"),
|
|
Step::Wait(300),
|
|
Step::Shot("number"),
|
|
Step::DownAt("scrub", 12.0, 14.0),
|
|
Step::DragTo("scrub", 72.0, 14.0),
|
|
Step::UpAt("scrub", 72.0, 14.0),
|
|
Step::Wait(300),
|
|
Step::Shot("scrubbed"),
|
|
Step::Click("email"),
|
|
Step::Key("secondary-a"),
|
|
Step::Type("ada@example"),
|
|
Step::Click("phone"),
|
|
Step::Key("secondary-a"),
|
|
Step::Type("4155550132"),
|
|
Step::Click("masked"),
|
|
Step::Key("secondary-a"),
|
|
Step::Type("ab1234"),
|
|
Step::Wait(300),
|
|
Step::Shot("formats"),
|
|
Step::Click("pin"),
|
|
Step::Key("secondary-a"),
|
|
Step::Type("4821"),
|
|
Step::Wait(300),
|
|
Step::Shot("pin"),
|
|
Step::Click("inline"),
|
|
Step::Key("secondary-a"),
|
|
Step::Type("Q3 planning"),
|
|
Step::Key("enter"),
|
|
Step::Wait(300),
|
|
Step::Shot("inline"),
|
|
Step::Click("mention"),
|
|
Step::Key("secondary-a"),
|
|
Step::Type("Ask @gr"),
|
|
Step::Wait(300),
|
|
Step::Shot("mention"),
|
|
Step::Key("enter"),
|
|
Step::Type("about #rel"),
|
|
Step::Key("down"),
|
|
Step::Key("enter"),
|
|
Step::Wait(300),
|
|
Step::Shot("mentioned"),
|
|
Step::Click("tags"),
|
|
Step::Type("motion,design"),
|
|
Step::Key("enter"),
|
|
Step::Wait(300),
|
|
Step::Shot("tags"),
|
|
Step::Click("regex"),
|
|
Step::Key("secondary-a"),
|
|
Step::Type("^(ab+"),
|
|
Step::Wait(300),
|
|
Step::Shot("regex"),
|
|
Step::Click("expression"),
|
|
Step::Key("secondary-a"),
|
|
Step::Type("price * qty + max(2, 4)"),
|
|
Step::Wait(300),
|
|
Step::Shot("expression"),
|
|
Step::Click("hotkey"),
|
|
Step::Key("cmd-shift-k"),
|
|
Step::Wait(300),
|
|
Step::Shot("hotkey"),
|
|
Step::DownAt("path", 380.0, 16.0),
|
|
Step::UpAt("path", 380.0, 16.0),
|
|
Step::Wait(1200),
|
|
Step::CancelPanel,
|
|
Step::Wait(600),
|
|
Step::DownAt("checks", 40.0, 66.0),
|
|
Step::UpAt("checks", 40.0, 66.0),
|
|
Step::Wait(300),
|
|
Step::Shot("checks"),
|
|
Step::DownAt("radios", 30.0, 66.0),
|
|
Step::UpAt("radios", 30.0, 66.0),
|
|
Step::Wait(400),
|
|
Step::Shot("radios"),
|
|
Step::DownAt("cards", 480.0, 30.0),
|
|
Step::UpAt("cards", 480.0, 30.0),
|
|
Step::Wait(400),
|
|
Step::Shot("cards"),
|
|
Step::DownAt("switches", 16.0, 39.0),
|
|
Step::UpAt("switches", 16.0, 39.0),
|
|
Step::Wait(600),
|
|
Step::Shot("switches"),
|
|
Step::Click("select"),
|
|
Step::Wait(300),
|
|
Step::Key("down"),
|
|
Step::Wait(200),
|
|
Step::Shot("select-open"),
|
|
Step::Key("enter"),
|
|
Step::Wait(300),
|
|
Step::Click("combobox"),
|
|
Step::Key("secondary-a"),
|
|
Step::Type("lis"),
|
|
Step::Wait(300),
|
|
Step::Shot("combobox"),
|
|
Step::Key("enter"),
|
|
Step::Wait(200),
|
|
Step::Click("multi"),
|
|
Step::Wait(300),
|
|
Step::Key("down"),
|
|
Step::Key("enter"),
|
|
Step::Wait(300),
|
|
Step::Shot("multi"),
|
|
Step::Key("escape"),
|
|
Step::Click("cascader"),
|
|
Step::Wait(300),
|
|
Step::Key("down"),
|
|
Step::Key("right"),
|
|
Step::Wait(300),
|
|
Step::Shot("cascader"),
|
|
Step::Key("escape"),
|
|
Step::DownAt("transfer", 60.0, 45.0),
|
|
Step::UpAt("transfer", 60.0, 45.0),
|
|
Step::Wait(200),
|
|
Step::DownAt("transfer", 280.0, 134.0),
|
|
Step::UpAt("transfer", 280.0, 134.0),
|
|
Step::Wait(300),
|
|
Step::Shot("transfer"),
|
|
Step::DownAt("chips", 120.0, 14.0),
|
|
Step::UpAt("chips", 120.0, 14.0),
|
|
Step::DownAt("rating", 79.0, 13.0),
|
|
Step::UpAt("rating", 79.0, 13.0),
|
|
Step::Wait(300),
|
|
Step::Shot("chips-rating"),
|
|
Step::DownAt("slider", 130.0, 8.0),
|
|
Step::DragTo("slider", 220.0, 8.0),
|
|
Step::UpAt("slider", 220.0, 8.0),
|
|
Step::Wait(200),
|
|
Step::DownAt("knob", 24.0, 24.0),
|
|
Step::DragTo("knob", 24.0, -36.0),
|
|
Step::UpAt("knob", 24.0, -36.0),
|
|
Step::DownAt("stepper", 76.0, 16.0),
|
|
Step::UpAt("stepper", 76.0, 16.0),
|
|
Step::Wait(300),
|
|
Step::Shot("values"),
|
|
Step::Rest,
|
|
];
|
|
|
|
fn render(window: &mut Window, cx: &mut App) -> AnyElement {
|
|
div()
|
|
.child(text::input(window, cx))
|
|
.child(text::text_area(window, cx))
|
|
.child(text::password(window, cx))
|
|
.child(text::search(window, cx))
|
|
.child(numbers::number_input(window, cx))
|
|
.child(numbers::scrub(window, cx))
|
|
.child(numbers::money(window, cx))
|
|
.child(formats::email_url(window, cx))
|
|
.child(formats::phone_masked(window, cx))
|
|
.child(formats::pin(window, cx))
|
|
.child(formats::inline_edit(window, cx))
|
|
.child(text::group(window, cx))
|
|
.child(rich::mention(window, cx))
|
|
.child(rich::tags(window, cx))
|
|
.child(rich::rows(cx))
|
|
.child(rich::path(window, cx))
|
|
.child(rich::regex(window, cx))
|
|
.child(rich::expression(window, cx))
|
|
.child(rich::hotkey(window, cx))
|
|
.child(choices::checkboxes(window, cx))
|
|
.child(choices::radios(window, cx))
|
|
.child(choices::cards(window, cx))
|
|
.child(choices::switches(window, cx))
|
|
.child(pickers::select(window, cx))
|
|
.child(pickers::list_box(window, cx))
|
|
.child(pickers::combobox(window, cx))
|
|
.child(pickers::multi_select(window, cx))
|
|
.child(pickers::cascader(window, cx))
|
|
.child(pickers::transfer(window, cx))
|
|
.child(values::chips(window, cx))
|
|
.child(values::rating(window, cx))
|
|
.child(values::sliders(window, cx))
|
|
.child(values::dials(window, cx))
|
|
.into_any_element()
|
|
}
|