@akiojin/gwt 6.30.2 → 9.0.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/.cargo/config.toml +2 -0
- package/.claude-plugin/marketplace.json +18 -0
- package/.coderabbit.yaml +8 -0
- package/.codex/skills/gwt-fix-issue/scripts/inspect_issue.py +833 -0
- package/.dockerignore +63 -0
- package/.gitattributes +27 -0
- package/.husky/commit-msg +2 -0
- package/.husky/pre-commit +9 -0
- package/.husky/pre-push +12 -0
- package/.markdownlint.json +18 -0
- package/.markdownlintignore +2 -0
- package/Dockerfile +58 -0
- package/README.ja.md +161 -484
- package/README.md +164 -444
- package/cliff.toml +56 -0
- package/clippy.toml +2 -0
- package/cmake/ci-disable-native.cmake +16 -0
- package/codecov.yml +16 -0
- package/commitlint.config.cjs +107 -0
- package/deny.toml +35 -0
- package/docker-compose.yml +59 -0
- package/messages/errors.toml +52 -0
- package/package.json +12 -22
- package/rustfmt.toml +8 -0
- package/scripts/check-e2e-coverage-threshold.mjs +238 -0
- package/scripts/entrypoint.sh +36 -25
- package/scripts/install-linux-deps.sh +46 -0
- package/scripts/postinstall.js +79 -227
- package/scripts/release_issue_refs.py +317 -0
- package/scripts/run-local-backend-tests-on-commit.sh +15 -0
- package/scripts/run-local-e2e-coverage-on-commit.sh +69 -0
- package/scripts/run-local-e2e-on-commit.sh +60 -0
- package/scripts/test-all.sh +13 -0
- package/scripts/test_release_issue_refs.py +257 -0
- package/scripts/validate-skill-frontmatter.sh +108 -0
- package/scripts/verify-ci-node-toolchain.sh +76 -0
- package/scripts/verify-husky-hooks.sh +6 -0
- package/scripts/voice-eval.sh +48 -0
- package/tests/voice_eval/README.md +53 -0
- package/tests/voice_eval/manifest.template.json +55 -0
- package/tests/voice_eval/samples/.gitkeep +1 -0
- package/tests/voice_eval/script-ja.txt +10 -0
- package/vendor/ratatui-core/src/backend/test.rs +1077 -0
- package/vendor/ratatui-core/src/backend.rs +405 -0
- package/vendor/ratatui-core/src/buffer/assert.rs +71 -0
- package/vendor/ratatui-core/src/buffer/buffer.rs +1388 -0
- package/vendor/ratatui-core/src/buffer/cell.rs +377 -0
- package/vendor/ratatui-core/src/buffer.rs +9 -0
- package/vendor/ratatui-core/src/layout/alignment.rs +89 -0
- package/vendor/ratatui-core/src/layout/constraint.rs +526 -0
- package/vendor/ratatui-core/src/layout/direction.rs +63 -0
- package/vendor/ratatui-core/src/layout/flex.rs +212 -0
- package/vendor/ratatui-core/src/layout/layout.rs +2838 -0
- package/vendor/ratatui-core/src/layout/margin.rs +79 -0
- package/vendor/ratatui-core/src/layout/offset.rs +66 -0
- package/vendor/ratatui-core/src/layout/position.rs +253 -0
- package/vendor/ratatui-core/src/layout/rect/iter.rs +356 -0
- package/vendor/ratatui-core/src/layout/rect/ops.rs +136 -0
- package/vendor/ratatui-core/src/layout/rect.rs +1114 -0
- package/vendor/ratatui-core/src/layout/size.rs +147 -0
- package/vendor/ratatui-core/src/layout.rs +333 -0
- package/vendor/ratatui-core/src/lib.rs +82 -0
- package/vendor/ratatui-core/src/style/anstyle.rs +348 -0
- package/vendor/ratatui-core/src/style/color.rs +788 -0
- package/vendor/ratatui-core/src/style/palette/material.rs +608 -0
- package/vendor/ratatui-core/src/style/palette/tailwind.rs +653 -0
- package/vendor/ratatui-core/src/style/palette.rs +6 -0
- package/vendor/ratatui-core/src/style/palette_conversion.rs +82 -0
- package/vendor/ratatui-core/src/style/stylize.rs +668 -0
- package/vendor/ratatui-core/src/style.rs +1069 -0
- package/vendor/ratatui-core/src/symbols/bar.rs +51 -0
- package/vendor/ratatui-core/src/symbols/block.rs +51 -0
- package/vendor/ratatui-core/src/symbols/border.rs +709 -0
- package/vendor/ratatui-core/src/symbols/braille.rs +21 -0
- package/vendor/ratatui-core/src/symbols/half_block.rs +3 -0
- package/vendor/ratatui-core/src/symbols/line.rs +259 -0
- package/vendor/ratatui-core/src/symbols/marker.rs +82 -0
- package/vendor/ratatui-core/src/symbols/merge.rs +748 -0
- package/vendor/ratatui-core/src/symbols/pixel.rs +30 -0
- package/vendor/ratatui-core/src/symbols/scrollbar.rs +46 -0
- package/vendor/ratatui-core/src/symbols/shade.rs +5 -0
- package/vendor/ratatui-core/src/symbols.rs +15 -0
- package/vendor/ratatui-core/src/terminal/frame.rs +192 -0
- package/vendor/ratatui-core/src/terminal/terminal.rs +926 -0
- package/vendor/ratatui-core/src/terminal/viewport.rs +58 -0
- package/vendor/ratatui-core/src/terminal.rs +40 -0
- package/vendor/ratatui-core/src/text/grapheme.rs +84 -0
- package/vendor/ratatui-core/src/text/line.rs +1678 -0
- package/vendor/ratatui-core/src/text/masked.rs +149 -0
- package/vendor/ratatui-core/src/text/span.rs +904 -0
- package/vendor/ratatui-core/src/text/text.rs +1434 -0
- package/vendor/ratatui-core/src/text.rs +64 -0
- package/vendor/ratatui-core/src/widgets/stateful_widget.rs +193 -0
- package/vendor/ratatui-core/src/widgets/widget.rs +174 -0
- package/vendor/ratatui-core/src/widgets.rs +9 -0
- package/bin/gwt.js +0 -131
- package/scripts/postinstall.test.js +0 -71
- package/scripts/release-download.js +0 -66
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
}
|