This change separates the viw from the main model by introducing new
interfaces `ViewModel` and `CursorModel`. The `ViewModel` interface
provides a view method that returns the string to render, while the
`CursorModel` interface provides a view method that returns the string
to render and the cursor position.
If a program does not implement a view interface, the program won't
render anything. This removes the need for the `WithoutRenderer` option.
This commit introduces a new `Frame` type that represents a single frame of
the program's output. The `Frame` type contains the frame's content and cursor
settings. The cursor settings include the cursor's position, style, blink, and
visibility.
It also removes the cursor commands from the `tea` package. The cursor
commands are now part of the `Frame` type. The cursor commands were removed
because they were not idiomatic and were not flexible enough to support
additional cursor settings.
Supersedes: https://github.com/charmbracelet/bubbletea/pull/1293
~This implements a cell-based renderer instead of the existing
line-based one. The cell-based renderer will be used when
`TEA_EXPERIMENTAL=cellbuf` is exported.~ The cell-based renderer, now
called The Ferocious Renderer, is enabled by default. To disable it set
`TEA_EXPERIMENTAL=unferocious`.
To _trace_ the output of the program, you can export
`TEA_TRACE=<filename>` and `TEA_TRACE_OUTPUT=1` and/or
`TEA_TRACE_INPUT=1` to see the I/O of the program.
Supersedes: https://github.com/charmbracelet/bubbletea/pull/1132
* fix: cellrenderer: we need to repaint after clearing the screen
* fix: cellrenderer: reset cursor when at phantom cell
wip
* feat: cellrenderer: support setting cursor position
* fix: use x and y instead of row and column for CursorPositionMsg
This means we're now 0-indexed, which is consistent with the rest of the
library.
This commit adds support for changing the cursor style. The new
`SetCursorStyle` command can be used to change the cursor style to one of
the following:
- `CursorBlock`
- `CursorUnderline`
- `CursorBar`