@akiojin/gwt 9.0.4 → 9.2.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.
Files changed (67) hide show
  1. package/README.ja.md +106 -146
  2. package/README.md +103 -143
  3. package/bin/gwt.cjs +1 -1
  4. package/package.json +5 -5
  5. package/rustfmt.toml +0 -2
  6. package/scripts/check-release-flow.sh +2 -8
  7. package/scripts/postinstall.js +17 -7
  8. package/scripts/run-local-backend-tests-on-commit.sh +6 -12
  9. package/scripts/test-all.sh +1 -5
  10. package/scripts/check-e2e-coverage-threshold.mjs +0 -238
  11. package/scripts/run-local-e2e-coverage-on-commit.sh +0 -69
  12. package/scripts/run-local-e2e-on-commit.sh +0 -60
  13. package/scripts/verify-ci-node-toolchain.sh +0 -76
  14. package/scripts/voice-eval.sh +0 -48
  15. package/vendor/ratatui-core/src/backend/test.rs +0 -1077
  16. package/vendor/ratatui-core/src/backend.rs +0 -405
  17. package/vendor/ratatui-core/src/buffer/assert.rs +0 -71
  18. package/vendor/ratatui-core/src/buffer/buffer.rs +0 -1388
  19. package/vendor/ratatui-core/src/buffer/cell.rs +0 -377
  20. package/vendor/ratatui-core/src/buffer.rs +0 -9
  21. package/vendor/ratatui-core/src/layout/alignment.rs +0 -89
  22. package/vendor/ratatui-core/src/layout/constraint.rs +0 -526
  23. package/vendor/ratatui-core/src/layout/direction.rs +0 -63
  24. package/vendor/ratatui-core/src/layout/flex.rs +0 -212
  25. package/vendor/ratatui-core/src/layout/layout.rs +0 -2838
  26. package/vendor/ratatui-core/src/layout/margin.rs +0 -79
  27. package/vendor/ratatui-core/src/layout/offset.rs +0 -66
  28. package/vendor/ratatui-core/src/layout/position.rs +0 -253
  29. package/vendor/ratatui-core/src/layout/rect/iter.rs +0 -356
  30. package/vendor/ratatui-core/src/layout/rect/ops.rs +0 -136
  31. package/vendor/ratatui-core/src/layout/rect.rs +0 -1114
  32. package/vendor/ratatui-core/src/layout/size.rs +0 -147
  33. package/vendor/ratatui-core/src/layout.rs +0 -333
  34. package/vendor/ratatui-core/src/lib.rs +0 -82
  35. package/vendor/ratatui-core/src/style/anstyle.rs +0 -348
  36. package/vendor/ratatui-core/src/style/color.rs +0 -788
  37. package/vendor/ratatui-core/src/style/palette/material.rs +0 -608
  38. package/vendor/ratatui-core/src/style/palette/tailwind.rs +0 -653
  39. package/vendor/ratatui-core/src/style/palette.rs +0 -6
  40. package/vendor/ratatui-core/src/style/palette_conversion.rs +0 -82
  41. package/vendor/ratatui-core/src/style/stylize.rs +0 -668
  42. package/vendor/ratatui-core/src/style.rs +0 -1069
  43. package/vendor/ratatui-core/src/symbols/bar.rs +0 -51
  44. package/vendor/ratatui-core/src/symbols/block.rs +0 -51
  45. package/vendor/ratatui-core/src/symbols/border.rs +0 -709
  46. package/vendor/ratatui-core/src/symbols/braille.rs +0 -21
  47. package/vendor/ratatui-core/src/symbols/half_block.rs +0 -3
  48. package/vendor/ratatui-core/src/symbols/line.rs +0 -259
  49. package/vendor/ratatui-core/src/symbols/marker.rs +0 -82
  50. package/vendor/ratatui-core/src/symbols/merge.rs +0 -748
  51. package/vendor/ratatui-core/src/symbols/pixel.rs +0 -30
  52. package/vendor/ratatui-core/src/symbols/scrollbar.rs +0 -46
  53. package/vendor/ratatui-core/src/symbols/shade.rs +0 -5
  54. package/vendor/ratatui-core/src/symbols.rs +0 -15
  55. package/vendor/ratatui-core/src/terminal/frame.rs +0 -192
  56. package/vendor/ratatui-core/src/terminal/terminal.rs +0 -926
  57. package/vendor/ratatui-core/src/terminal/viewport.rs +0 -58
  58. package/vendor/ratatui-core/src/terminal.rs +0 -40
  59. package/vendor/ratatui-core/src/text/grapheme.rs +0 -84
  60. package/vendor/ratatui-core/src/text/line.rs +0 -1678
  61. package/vendor/ratatui-core/src/text/masked.rs +0 -149
  62. package/vendor/ratatui-core/src/text/span.rs +0 -904
  63. package/vendor/ratatui-core/src/text/text.rs +0 -1434
  64. package/vendor/ratatui-core/src/text.rs +0 -64
  65. package/vendor/ratatui-core/src/widgets/stateful_widget.rs +0 -193
  66. package/vendor/ratatui-core/src/widgets/widget.rs +0 -174
  67. package/vendor/ratatui-core/src/widgets.rs +0 -9
@@ -1,58 +0,0 @@
1
- use core::fmt;
2
-
3
- use crate::layout::Rect;
4
-
5
- /// Represents the viewport of the terminal. The viewport is the area of the terminal that is
6
- /// currently visible to the user. It can be either fullscreen, inline or fixed.
7
- ///
8
- /// When the viewport is fullscreen, the whole terminal is used to draw the application.
9
- ///
10
- /// When the viewport is inline, it is drawn inline with the rest of the terminal. The height of
11
- /// the viewport is fixed, but the width is the same as the terminal width.
12
- ///
13
- /// When the viewport is fixed, it is drawn in a fixed area of the terminal. The area is specified
14
- /// by a [`Rect`].
15
- ///
16
- /// See [`Terminal::with_options`] for more information.
17
- ///
18
- /// [`Terminal::with_options`]: crate::terminal::Terminal::with_options
19
- #[derive(Debug, Default, Clone, Eq, PartialEq, Hash)]
20
- pub enum Viewport {
21
- /// The viewport is fullscreen
22
- #[default]
23
- Fullscreen,
24
- /// The viewport is inline with the rest of the terminal.
25
- ///
26
- /// The viewport's height is fixed and specified in number of lines. The width is the same as
27
- /// the terminal's width. The viewport is drawn below the cursor position.
28
- Inline(u16),
29
- /// The viewport is drawn in a fixed area of the terminal. The area is specified by a [`Rect`].
30
- Fixed(Rect),
31
- }
32
-
33
- impl fmt::Display for Viewport {
34
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
35
- match self {
36
- Self::Fullscreen => write!(f, "Fullscreen"),
37
- Self::Inline(height) => write!(f, "Inline({height})"),
38
- Self::Fixed(area) => write!(f, "Fixed({area})"),
39
- }
40
- }
41
- }
42
-
43
- #[cfg(test)]
44
- mod tests {
45
- use alloc::string::ToString;
46
-
47
- use super::*;
48
-
49
- #[test]
50
- fn viewport_to_string() {
51
- assert_eq!(Viewport::Fullscreen.to_string(), "Fullscreen");
52
- assert_eq!(Viewport::Inline(5).to_string(), "Inline(5)");
53
- assert_eq!(
54
- Viewport::Fixed(Rect::new(0, 0, 5, 5)).to_string(),
55
- "Fixed(5x5+0+0)"
56
- );
57
- }
58
- }
@@ -1,40 +0,0 @@
1
- #![deny(missing_docs)]
2
- //! Provides the [`Terminal`], [`Frame`] and related types.
3
- //!
4
- //! The [`Terminal`] is the main interface of this library. It is responsible for drawing and
5
- //! maintaining the state of the different widgets that compose your application.
6
- //!
7
- //! The [`Frame`] is a consistent view into the terminal state for rendering. It is obtained via
8
- //! the closure argument of [`Terminal::draw`]. It is used to render widgets to the terminal and
9
- //! control the cursor position.
10
- //!
11
- //! # Example
12
- //!
13
- //! ```rust,ignore
14
- //! use std::io::stdout;
15
- //!
16
- //! use ratatui::{backend::CrosstermBackend, widgets::Paragraph, Terminal};
17
- //!
18
- //! let backend = CrosstermBackend::new(stdout());
19
- //! let mut terminal = Terminal::new(backend)?;
20
- //! terminal.draw(|frame| {
21
- //! let area = frame.area();
22
- //! frame.render_widget(Paragraph::new("Hello world!"), area);
23
- //! })?;
24
- //! # std::io::Result::Ok(())
25
- //! ```
26
- //!
27
- //! [Crossterm]: https://crates.io/crates/crossterm
28
- //! [Termion]: https://crates.io/crates/termion
29
- //! [Termwiz]: https://crates.io/crates/termwiz
30
- //! [`backend`]: crate::backend
31
- //! [`Backend`]: crate::backend::Backend
32
- //! [`Buffer`]: crate::buffer::Buffer
33
-
34
- mod frame;
35
- mod terminal;
36
- mod viewport;
37
-
38
- pub use frame::{CompletedFrame, Frame};
39
- pub use terminal::{Options as TerminalOptions, Terminal};
40
- pub use viewport::Viewport;
@@ -1,84 +0,0 @@
1
- use crate::style::{Style, Styled};
2
-
3
- const NBSP: &str = "\u{00a0}";
4
- const ZWSP: &str = "\u{200b}";
5
-
6
- /// A grapheme associated to a style.
7
- /// Note that, although `StyledGrapheme` is the smallest divisible unit of text,
8
- /// it actually is not a member of the text type hierarchy (`Text` -> `Line` -> `Span`).
9
- /// It is a separate type used mostly for rendering purposes. A `Span` consists of components that
10
- /// can be split into `StyledGrapheme`s, but it does not contain a collection of `StyledGrapheme`s.
11
- #[derive(Debug, Default, Clone, Eq, PartialEq, Hash)]
12
- pub struct StyledGrapheme<'a> {
13
- pub symbol: &'a str,
14
- pub style: Style,
15
- }
16
-
17
- impl<'a> StyledGrapheme<'a> {
18
- /// Creates a new `StyledGrapheme` with the given symbol and style.
19
- ///
20
- /// `style` accepts any type that is convertible to [`Style`] (e.g. [`Style`], [`Color`], or
21
- /// your own type that implements [`Into<Style>`]).
22
- ///
23
- /// [`Color`]: crate::style::Color
24
- pub fn new<S: Into<Style>>(symbol: &'a str, style: S) -> Self {
25
- Self {
26
- symbol,
27
- style: style.into(),
28
- }
29
- }
30
-
31
- pub fn is_whitespace(&self) -> bool {
32
- let symbol = self.symbol;
33
- symbol == ZWSP || symbol.chars().all(char::is_whitespace) && symbol != NBSP
34
- }
35
- }
36
-
37
- impl Styled for StyledGrapheme<'_> {
38
- type Item = Self;
39
-
40
- fn style(&self) -> Style {
41
- self.style
42
- }
43
-
44
- fn set_style<S: Into<Style>>(mut self, style: S) -> Self::Item {
45
- self.style = style.into();
46
- self
47
- }
48
- }
49
-
50
- #[cfg(test)]
51
- mod tests {
52
- use super::*;
53
- use crate::style::Stylize;
54
-
55
- #[test]
56
- fn new() {
57
- let style = Style::new().yellow();
58
- let sg = StyledGrapheme::new("a", style);
59
- assert_eq!(sg.symbol, "a");
60
- assert_eq!(sg.style, style);
61
- }
62
-
63
- #[test]
64
- fn style() {
65
- let style = Style::new().yellow();
66
- let sg = StyledGrapheme::new("a", style);
67
- assert_eq!(sg.style(), style);
68
- }
69
-
70
- #[test]
71
- fn set_style() {
72
- let style = Style::new().yellow().on_red();
73
- let style2 = Style::new().green();
74
- let sg = StyledGrapheme::new("a", style).set_style(style2);
75
- assert_eq!(sg.style, style2);
76
- }
77
-
78
- #[test]
79
- fn stylize() {
80
- let style = Style::new().yellow().on_red();
81
- let sg = StyledGrapheme::new("a", style).green();
82
- assert_eq!(sg.style, Style::new().green().on_red());
83
- }
84
- }