@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.
- package/README.ja.md +106 -146
- package/README.md +103 -143
- package/bin/gwt.cjs +1 -1
- package/package.json +5 -5
- package/rustfmt.toml +0 -2
- package/scripts/check-release-flow.sh +2 -8
- package/scripts/postinstall.js +17 -7
- package/scripts/run-local-backend-tests-on-commit.sh +6 -12
- package/scripts/test-all.sh +1 -5
- package/scripts/check-e2e-coverage-threshold.mjs +0 -238
- package/scripts/run-local-e2e-coverage-on-commit.sh +0 -69
- package/scripts/run-local-e2e-on-commit.sh +0 -60
- package/scripts/verify-ci-node-toolchain.sh +0 -76
- package/scripts/voice-eval.sh +0 -48
- package/vendor/ratatui-core/src/backend/test.rs +0 -1077
- package/vendor/ratatui-core/src/backend.rs +0 -405
- package/vendor/ratatui-core/src/buffer/assert.rs +0 -71
- package/vendor/ratatui-core/src/buffer/buffer.rs +0 -1388
- package/vendor/ratatui-core/src/buffer/cell.rs +0 -377
- package/vendor/ratatui-core/src/buffer.rs +0 -9
- package/vendor/ratatui-core/src/layout/alignment.rs +0 -89
- package/vendor/ratatui-core/src/layout/constraint.rs +0 -526
- package/vendor/ratatui-core/src/layout/direction.rs +0 -63
- package/vendor/ratatui-core/src/layout/flex.rs +0 -212
- package/vendor/ratatui-core/src/layout/layout.rs +0 -2838
- package/vendor/ratatui-core/src/layout/margin.rs +0 -79
- package/vendor/ratatui-core/src/layout/offset.rs +0 -66
- package/vendor/ratatui-core/src/layout/position.rs +0 -253
- package/vendor/ratatui-core/src/layout/rect/iter.rs +0 -356
- package/vendor/ratatui-core/src/layout/rect/ops.rs +0 -136
- package/vendor/ratatui-core/src/layout/rect.rs +0 -1114
- package/vendor/ratatui-core/src/layout/size.rs +0 -147
- package/vendor/ratatui-core/src/layout.rs +0 -333
- package/vendor/ratatui-core/src/lib.rs +0 -82
- package/vendor/ratatui-core/src/style/anstyle.rs +0 -348
- package/vendor/ratatui-core/src/style/color.rs +0 -788
- package/vendor/ratatui-core/src/style/palette/material.rs +0 -608
- package/vendor/ratatui-core/src/style/palette/tailwind.rs +0 -653
- package/vendor/ratatui-core/src/style/palette.rs +0 -6
- package/vendor/ratatui-core/src/style/palette_conversion.rs +0 -82
- package/vendor/ratatui-core/src/style/stylize.rs +0 -668
- package/vendor/ratatui-core/src/style.rs +0 -1069
- package/vendor/ratatui-core/src/symbols/bar.rs +0 -51
- package/vendor/ratatui-core/src/symbols/block.rs +0 -51
- package/vendor/ratatui-core/src/symbols/border.rs +0 -709
- package/vendor/ratatui-core/src/symbols/braille.rs +0 -21
- package/vendor/ratatui-core/src/symbols/half_block.rs +0 -3
- package/vendor/ratatui-core/src/symbols/line.rs +0 -259
- package/vendor/ratatui-core/src/symbols/marker.rs +0 -82
- package/vendor/ratatui-core/src/symbols/merge.rs +0 -748
- package/vendor/ratatui-core/src/symbols/pixel.rs +0 -30
- package/vendor/ratatui-core/src/symbols/scrollbar.rs +0 -46
- package/vendor/ratatui-core/src/symbols/shade.rs +0 -5
- package/vendor/ratatui-core/src/symbols.rs +0 -15
- package/vendor/ratatui-core/src/terminal/frame.rs +0 -192
- package/vendor/ratatui-core/src/terminal/terminal.rs +0 -926
- package/vendor/ratatui-core/src/terminal/viewport.rs +0 -58
- package/vendor/ratatui-core/src/terminal.rs +0 -40
- package/vendor/ratatui-core/src/text/grapheme.rs +0 -84
- package/vendor/ratatui-core/src/text/line.rs +0 -1678
- package/vendor/ratatui-core/src/text/masked.rs +0 -149
- package/vendor/ratatui-core/src/text/span.rs +0 -904
- package/vendor/ratatui-core/src/text/text.rs +0 -1434
- package/vendor/ratatui-core/src/text.rs +0 -64
- package/vendor/ratatui-core/src/widgets/stateful_widget.rs +0 -193
- package/vendor/ratatui-core/src/widgets/widget.rs +0 -174
- package/vendor/ratatui-core/src/widgets.rs +0 -9
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
//! Conversions from colors in the `palette` crate to [`Color`].
|
|
2
|
-
|
|
3
|
-
use ::palette::LinSrgb;
|
|
4
|
-
use ::palette::bool_mask::LazySelect;
|
|
5
|
-
use ::palette::num::{Arithmetics, MulSub, PartialCmp, Powf, Real};
|
|
6
|
-
use palette::Srgb;
|
|
7
|
-
use palette::stimulus::IntoStimulus;
|
|
8
|
-
|
|
9
|
-
use crate::style::Color;
|
|
10
|
-
|
|
11
|
-
/// Convert an [`palette::Srgb`] color to a [`Color`].
|
|
12
|
-
///
|
|
13
|
-
/// # Examples
|
|
14
|
-
///
|
|
15
|
-
/// ```
|
|
16
|
-
/// use palette::Srgb;
|
|
17
|
-
/// use ratatui_core::style::Color;
|
|
18
|
-
///
|
|
19
|
-
/// let color = Color::from(Srgb::new(1.0f32, 0.0, 0.0));
|
|
20
|
-
/// assert_eq!(color, Color::Rgb(255, 0, 0));
|
|
21
|
-
/// ```
|
|
22
|
-
impl<T: IntoStimulus<u8>> From<Srgb<T>> for Color {
|
|
23
|
-
fn from(color: Srgb<T>) -> Self {
|
|
24
|
-
let (red, green, blue) = color.into_format().into_components();
|
|
25
|
-
Self::Rgb(red, green, blue)
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/// Convert a [`palette::LinSrgb`] color to a [`Color`].
|
|
30
|
-
///
|
|
31
|
-
/// Note: this conversion only works for floating point linear sRGB colors. If you have a linear
|
|
32
|
-
/// sRGB color in another format, you need to convert it to floating point first.
|
|
33
|
-
///
|
|
34
|
-
/// # Examples
|
|
35
|
-
///
|
|
36
|
-
/// ```
|
|
37
|
-
/// use palette::LinSrgb;
|
|
38
|
-
/// use ratatui_core::style::Color;
|
|
39
|
-
///
|
|
40
|
-
/// let color = Color::from(LinSrgb::new(1.0f32, 0.0, 0.0));
|
|
41
|
-
/// assert_eq!(color, Color::Rgb(255, 0, 0));
|
|
42
|
-
/// ```
|
|
43
|
-
impl<T: IntoStimulus<u8>> From<LinSrgb<T>> for Color
|
|
44
|
-
where
|
|
45
|
-
T: Real + Powf + MulSub + Arithmetics + PartialCmp + Clone,
|
|
46
|
-
T::Mask: LazySelect<T>,
|
|
47
|
-
{
|
|
48
|
-
fn from(color: LinSrgb<T>) -> Self {
|
|
49
|
-
let srgb_color = Srgb::<T>::from_linear(color);
|
|
50
|
-
Self::from(srgb_color)
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
#[cfg(test)]
|
|
55
|
-
mod tests {
|
|
56
|
-
use super::*;
|
|
57
|
-
|
|
58
|
-
#[test]
|
|
59
|
-
fn from_srgb() {
|
|
60
|
-
const RED: Color = Color::Rgb(255, 0, 0);
|
|
61
|
-
assert_eq!(Color::from(Srgb::new(255u8, 0, 0)), RED);
|
|
62
|
-
assert_eq!(Color::from(Srgb::new(65535u16, 0, 0)), RED);
|
|
63
|
-
assert_eq!(Color::from(Srgb::new(1.0f32, 0.0, 0.0)), RED);
|
|
64
|
-
|
|
65
|
-
assert_eq!(
|
|
66
|
-
Color::from(Srgb::new(0.5f32, 0.5, 0.5)),
|
|
67
|
-
Color::Rgb(128, 128, 128)
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
#[test]
|
|
72
|
-
fn from_lin_srgb() {
|
|
73
|
-
const RED: Color = Color::Rgb(255, 0, 0);
|
|
74
|
-
assert_eq!(Color::from(LinSrgb::new(1.0f32, 0.0, 0.0)), RED);
|
|
75
|
-
assert_eq!(Color::from(LinSrgb::new(1.0f64, 0.0, 0.0)), RED);
|
|
76
|
-
|
|
77
|
-
assert_eq!(
|
|
78
|
-
Color::from(LinSrgb::new(0.5f32, 0.5, 0.5)),
|
|
79
|
-
Color::Rgb(188, 188, 188)
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
}
|