Commit Graph

349 Commits

Author SHA1 Message Date
Christian Rocha
48e3f85baf Update keybindings after calling InsertItem on the list model
Specifically, if the list was emtpy prior to inserting an item the
up/down keybindings would be hidden and disabled.
2022-01-11 12:08:33 -05:00
Christian Stewart
5f256bf34f fix(list): update keybindings when setting items
Bug: when calling SetItems when items was previously empty, the keybindings for
up/down do not appear.

Fix: call updateKeybindings in SetItems.

Signed-off-by: Christian Stewart <christian@paral.in>
2022-01-11 11:58:01 -05:00
Christian Stewart
eef9098f37 fix(list): check items slice len
Signed-off-by: Christian Stewart <christian@paral.in>
2022-01-11 11:58:01 -05:00
Christian Rocha
b35f96cd2d Deprecate NewModel() constructors; use New() instead 2022-01-11 11:26:13 -05:00
Christian Rocha
9401ebbb83 Viewport New() is now optional to ease the upgrade process 2022-01-10 21:21:04 -05:00
Christian Rocha
add13c8028 Add a lipgloss style to the viewport for borders, margins, and padding 2022-01-10 21:21:04 -05:00
Christian Rocha
4aed4e0a88 Viewport now has customizable keybindings 2022-01-10 21:21:04 -05:00
Christian Rocha
9c70b6a216
Bump bubbletea dep 2022-01-10 15:01:52 -05:00
Christian Rocha
9d74635ea3
Update footer image in README 2022-01-10 14:57:12 -05:00
Christian Rocha
e01ee1d17e Expose IDs on spinners and spinner tick messages 2022-01-10 14:52:35 -05:00
Christian Rocha
e83c113d06 Add spinner.Model.Tick method, deprecate spinner.Tick method. 2022-01-10 14:52:35 -05:00
Christian Rocha
94b84b6120 Make spinners ignore tick messsages send by other spinners 2022-01-10 14:52:35 -05:00
Christian Rocha
f09987549a
Various timer improvements (#83)
* Add IDs to timers
* Add IDs to timer-related messages
* Ignore messages from other timers
* Add `Timeout` property to `TickMsg`
* Add `Start()`, `Stop()`, and `Toggle()` commands to timer
* Add `Timedout()` method to timer model
* Add `Running()` method to timer model
2022-01-10 13:55:54 -05:00
Christian Rocha
7b20f4fe24 Expose stopwatch StartStopMsg and ResetMsg and bind them to IDs 2022-01-10 13:37:34 -05:00
Christian Rocha
86e0c53e88 Add support for multiple stopwatches
In short, stopwatches will now ignore messages sent by other
stopwatches.
2022-01-10 13:37:34 -05:00
Christian Rocha
8d3cfdf380 key.Matches now accepts multiple binding arguments 2022-01-10 12:32:37 -05:00
Anirvan Chatterjee
0f500d5e59 Fixed typo in README ("complimented" → "complemented") 2021-12-09 09:58:11 +01:00
Christian Rocha
0ac5ecdf81 Fix bug where performance rendering could render one line too many 2021-09-17 16:25:25 -04:00
Christian Rocha
8c03905dbe Fix bug where viewport wouldn't render final lines
This previously went unnoticed because we all seemed to have newlines at
the end of our viewport input.

This update introduces the Model.SetYOffset method.
2021-09-17 16:25:25 -04:00
Carlos Alexandro Becker
a7ea1bddbf
feat: stopwatch (#68)
* feat: stopwatch

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2021-09-09 15:21:26 -04:00
Carlos Alexandro Becker
7941c49504
feat: simple timer component (#67)
* feat: simple timer component

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2021-09-09 15:17:33 -04:00
Christian Rocha
da9248f877 Update progress bar description and example links 2021-09-07 14:31:40 -04:00
Christian Rocha
b691d7f07e Progress bars now statisfy the tea.Model interface 2021-09-07 13:57:46 -04:00
Christian Rocha
8ad268837a Add image and example link for Help bubble 2021-09-07 13:16:26 -04:00
Christian Rocha
0f290114f5 Add mritd/bubbles to "additional bubbles" in the README 2021-09-02 16:39:17 -04:00
Christian Rocha
500d7989e1 Fix keybinding examples 2021-09-01 11:33:41 -04:00
Christian Muehlhaeuser
d987ef84f2
Fix list description in README 2021-08-23 23:30:54 +02:00
Christian Muehlhaeuser
cb52746b97
Fix typos 2021-08-23 23:15:21 +02:00
Christian Muehlhaeuser
985ffcb319 Bump bubbletea, lipgloss, reflow, termenv deps 2021-08-23 21:45:01 +02:00
Christian Muehlhaeuser
4e18245481 Add list bubble 2021-08-23 21:34:13 +02:00
Christian Rocha
0be588365e Add simple helper package for making user-definable keymappings and help bubble 2021-08-23 17:00:29 +02:00
Christian Rocha
4c32a64d65 Add info about promptkit to README 2021-08-02 12:23:25 -04:00
Christian Rocha
e723cfd15e Add WithSpringOptions to customize spring in NewModel 2021-07-26 12:41:37 -04:00
Christian Rocha
90d8eaffeb Update progress bar with public harmonica release 2021-07-26 12:41:37 -04:00
Christian Rocha
202d5a9f9d Progress's NewModel no longer returns an error for better usability
To that end, bad hex colors also default to black. This is also how we
handle bad hex notation in Lip Gloss.
2021-07-26 12:41:37 -04:00
Christian Rocha
446433d680 Use Lip Gloss to style percentage in progress bubble 2021-07-26 12:41:37 -04:00
Christian Rocha
2cd3b16343 Use Harmonica to animate progress bar 2021-07-26 12:41:37 -04:00
Christian Rocha
5ae3b7b822 Update go-runewidth to v0.0.13 2021-07-26 12:41:37 -04:00
Christian Rocha
20ead8fb7d Progress can now animate itself 2021-07-26 12:41:37 -04:00
Christian Muehlhaeuser
09a4cf419d Update linter config 2021-07-12 03:10:31 +02:00
Christian Rocha
d06aa4aa48 Ensure that textinputs can only receive their own blink messages 2021-06-02 10:49:43 -04:00
Christian Rocha
10962af2f2 Textinput's focus method now returns a command to initiate cursor blink 2021-06-02 10:49:43 -04:00
Christian Rocha
5082ae6f31 Add API for blink, static and hidden cursor modes to textinput
Closes #53.
2021-06-02 10:49:43 -04:00
Christian Rocha
4365990396 Fix typo in a spinner comment 2021-06-02 10:49:43 -04:00
Christian Rocha
1405b09ec8 Update footer in README for consistency with newer Charm repos 2021-06-02 10:49:43 -04:00
Christian Muehlhaeuser
f53c742d6c Fix goreportcard badge 2021-05-18 20:56:27 +02:00
Christian Rocha
9449cc7e41 Don't allow word-based deletion when input is masked in textinput
alt+d and ctrl+w will now delete all the way to the beginning and end,
respectively, if EchoMode is not EchoNormal.
2021-04-26 12:03:57 -04:00
Christian Rocha
58a177394e Don't allow word-to-word movement when input is masked in textinput
When EchoMode is not set to EchoNormal, alt+left/alt+b and
alt+right/alt+b jumps to the beginning and the end, respectively, so as
not to reveal word breaks in the masked text.
2021-04-26 12:03:57 -04:00
Christian Rocha
f016c31d83 Add method for returning cursor position in textinput
Previously, Cursor was a member on the model that did absolutely
nothing.
2021-04-26 12:03:57 -04:00
Christian Rocha
74436326b9 Public cursor movement functions no longer return values in textinput
Previously, textinput.SetCursor, textinput.CursotStart, and
textinput.CursorEnd returned bools used interally for managing cursor
blinking. Those methods have been replaced with private counterparts.
2021-04-26 12:03:57 -04:00