ratatui/tests
Josh McKinney 728f82c084
refactor(text): replace Spans with Line (#178)
* refactor: add Line type to replace Spans

`Line` is a significantly better name over `Spans` as the plural causes
confusion and the type really is a representation of a line of text made
up of spans.

This is a backwards compatible version of the approach from
https://github.com/tui-rs-revival/ratatui/pull/175

There is a significant amount of code that uses the Spans type and
methods, so instead of just renaming it, we add a new type and replace
parameters that accepts a `Spans` with a parameter that accepts
`Into<Line>`.

Note that the examples have been intentionally left using `Spans` in
this commit to demonstrate the compiler warnings that will be emitted in
existing code.

Implementation notes:
- moves the Spans code to text::spans and publicly reexports on the text
module. This makes the test in that module only relevant to the Spans
type.
- adds a line module with a copy of the code and tests from Spans with a
single addition: `impl<'a> From<Spans<'a>> for Line<'a>`
- adds tests for `Spans` (created and checked before refactoring)
- adds the same tests for `Line`
- updates all widget methods that accept and store Spans to instead
store `Line` and accept `Into<Line>`

* refactor: move text::Masked to text::masked::Masked

Re-exports the Masked type at text::Masked

* refactor: replace Spans with Line in tests/examples/docs
2023-05-18 20:21:43 +02:00
..
backend_termion.rs feat(terminal)!: add inline viewport (#114) 2023-04-17 14:23:50 +02:00
terminal.rs chore(cargo): update project metadata (#94) 2023-03-17 17:03:49 +01:00
widgets_barchart.rs chore(cargo): update project metadata (#94) 2023-03-17 17:03:49 +01:00
widgets_block.rs feat(block): support placing the title on bottom (#36) 2023-04-13 22:24:31 +02:00
widgets_calendar.rs feat(calendar): add calendar widget (#138) 2023-04-26 23:02:35 +02:00
widgets_canvas.rs chore(cargo): update project metadata (#94) 2023-03-17 17:03:49 +01:00
widgets_chart.rs chore(cargo): update project metadata (#94) 2023-03-17 17:03:49 +01:00
widgets_gauge.rs chore(cargo): update project metadata (#94) 2023-03-17 17:03:49 +01:00
widgets_list.rs refactor(text): replace Spans with Line (#178) 2023-05-18 20:21:43 +02:00
widgets_paragraph.rs refactor(text): replace Spans with Line (#178) 2023-05-18 20:21:43 +02:00
widgets_table.rs refactor(text): replace Spans with Line (#178) 2023-05-18 20:21:43 +02:00
widgets_tabs.rs refactor(text): replace Spans with Line (#178) 2023-05-18 20:21:43 +02:00