Commit Graph

181 Commits

Author SHA1 Message Date
Christian Muehlhaeuser ca333e7d79 chore: bump go-isatty dep 2022-08-15 12:26:30 +02:00
dependabot[bot] ac4a1a1faa
feat(deps): bump github.com/muesli/cancelreader from 0.2.1 to 0.2.2 (#354)
* feat(deps): bump github.com/muesli/cancelreader from 0.2.0 to 0.2.2

Bumps [github.com/muesli/cancelreader](https://github.com/muesli/cancelreader) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/muesli/cancelreader/releases)
- [Commits](https://github.com/muesli/cancelreader/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: github.com/muesli/cancelreader
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: examples

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-07-21 10:02:18 -03:00
Maas Lalani 0a0182e55a
chore: Bump bubbles to v0.13.0 (#363) 2022-07-08 10:08:24 -04:00
Maas Lalani 27e356a779
Add border to split-editors example (#362)
* doc(textarea): add border to focused textarea in split-editors example
* doc(textrea): tone down with border color in split-editors example

Co-authored-by: Christian Rocha <christian@rocha.is>
2022-07-05 14:31:32 -04:00
Maas Lalani 642d26a793
doc: Add `textarea` examples (#357)
* chore: bump bubbles@master

* doc(textarea): Add example of `chat` application with textarea

* doc(textarea): Add example of `textarea` prompting the user to tell a story

* doc(textarea): Add example of `split-editors` on how to manage multiple textareas
2022-07-01 12:20:04 -04:00
Carlos Alexandro Becker ca32c4c628
feat: update cancelreader (#353)
* feat: update cancelreader

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: go mod tidy

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: go mod tidy

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: use stable

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-06-23 09:19:36 -03:00
Max ebabec7008
feat: print unmanaged output above the application (#249)
* merge Adjective-Object/tea_log_renderer into standard renderer

* rename queuedMessages -> queuedMessageLines & break apart strings during message processing

* delete cursorDownBy

* += 1 -> ++ to make the linter happy

* add skipLines[] tracking back to standard renderer, and add rename skippedLines local to jumpedLines to clarify they are separate comments

* request repaint when a message is recieved

* Convert Println and Printf to commands

* Add package manager example demonstrating tea.Printf

* Use Unix instead of UnixMicro for Go 1.13 support in CI

* fix off by one in std renderer

* add Printf/Println to tea.go

* revert attempt at sequence compression + cursorUpBy

Co-authored-by: Maxwell Huang-Hobbs <mahuangh@microsoft.com>
Co-authored-by: Christian Rocha <christian@rocha.is>
2022-06-22 12:53:02 -04:00
bashbunni a2d0ac9d38
docs: add another progress bar example (#270)
* docs: add another progress bar example

* chore: copy edits

Co-authored-by: Christian Rocha <christian@rocha.is>
2022-06-15 11:55:47 -07:00
Maas Lalani d56d8ae854
Example: Credit Card Input Form (#338)
* feat(cc): Add Credit Card Input Form Example and `ValidatorFuncs` to ensure credit cards are valid
2022-06-13 09:39:01 -04:00
Carlos Alexandro Becker b566614c16
docs: default to vim if no EDITOR on exec example (#325)
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-06-02 15:12:31 -03:00
Christian Rocha 04d68b8e3e chore(examples): bump bubbles dependency 2022-06-01 18:47:09 -07:00
Christian Rocha 775dbfbeff
chore(exec): small API edits (#323)
* feat: add OSExec helper function for running exec.Cmds

* chore: for now, un-expose WrapExecCommand

* chore: move exec struff into its own file

* chore(exec): better name for Exec func that wraps exec.Cmd (thanks, @toby)
2022-06-01 17:12:21 -07:00
Christian Muehlhaeuser 3795c036c4
add: Exec, ReleaseTerminal and RestoreTerminal to re-use input and terminal (#237)
* add: program.ReleaseTerminal and RestoreTerminal to re-use input & terminal

* chore(examples): add altscreen toggling to exec demo

* chore: put low-level altscreen stuff alongside other screen funcs

* docs: edit GoDocs for ReleaseTerminal and RestoreTerminal

* feat(renderer): add internal Msg renderMsg to immediately repaint

* fix: repaint instantly on RestoreTerminal

* fix: restore the altscreen state when restoring the terminal

* feat: implement Cmd-based API for blocking *exec.Cmds

* feat: allow Exec to return custom messages

* feat: allow Exec to be run without a callback

* fix: separate parameters for exec.Command examples

* fix: error message would get printed over by prompt in exec example

* fix: ignore signals while child process is running

* feat: allow to execute other things besides exec.Commands (#280)

* feat: allow to execute other things besides exec.Commands.

* fix: lint issues

* fix: renames, examples

* fix: callback type should be exported

* docs(exce): tiny ExecCommand doc comment correction

* chore(exec): break out Cmd for clarity's sake in example

* fix(exec): give the terminal a moment to catch up if exiting altscreen

* docs(exec): tidy up doc comments

* chore(exec): disambiguate methods for restoring the terminal state vs input

Co-authored-by: Christian Rocha <christian@rocha.is>
Co-authored-by: Carlos A Becker <caarlos0@gmail.com>
2022-04-12 10:23:10 -04:00
Christian Muehlhaeuser 515ef02733 Move cancelreader into a separate package 2022-04-05 20:41:21 +02:00
Christian Rocha 442b8cde78 fix: use more bulletproof GetFrameSize() list examples 2022-03-17 16:33:21 -04:00
Carlos Alexandro Becker 62259b72e5
feat: update x/sys (#235)
* feat: update x/sys

current version breaks builds for windows/arm64

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>

* fix: examples go.sum

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>

* fix: tutorials go.sum

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2022-02-19 16:25:49 -03:00
dependabot[bot] c9bb51796d chore(deps): bump github.com/charmbracelet/bubbles in /examples
Bumps [github.com/charmbracelet/bubbles](https://github.com/charmbracelet/bubbles) from 0.10.2 to 0.10.3.
- [Release notes](https://github.com/charmbracelet/bubbles/releases)
- [Commits](https://github.com/charmbracelet/bubbles/compare/v0.10.2...v0.10.3)

---
updated-dependencies:
- dependency-name: github.com/charmbracelet/bubbles
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-17 07:41:26 -05:00
Christian Rocha 7241e910ec Bump containerd/console 2022-02-15 10:02:56 -05:00
Christian Muehlhaeuser 4d1d1ee021 chore: bump lipgloss and termenv 2022-02-14 23:20:51 +01:00
Christian Muehlhaeuser 74f0972e4e Simplify send-msg example 2022-02-08 18:01:35 +01:00
Christian Muehlhaeuser 7c939e8dfb Use termenv's EnvColorProfile, which respects NO_COLOR and CLICOLOR_FORCE env vars 2022-02-06 04:24:31 +01:00
Christian Muehlhaeuser 77e63ac890 Bump termenv to v0.11.0 2022-01-31 23:04:37 +01:00
dependabot[bot] 4f08c1b965 chore(deps): bump github.com/charmbracelet/glamour in /examples
Bumps [github.com/charmbracelet/glamour](https://github.com/charmbracelet/glamour) from 0.4.0 to 0.5.0.
- [Release notes](https://github.com/charmbracelet/glamour/releases)
- [Commits](https://github.com/charmbracelet/glamour/compare/v0.4.0...v0.5.0)

---
updated-dependencies:
- dependency-name: github.com/charmbracelet/glamour
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-25 08:36:50 -05:00
Carlos Alexandro Becker d79cac20cb
chore: dependabot, go mod tidy, update bubbles (#198)
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2022-01-21 12:04:54 -03:00
Christian Rocha 66cea095eb Migrate from NewModel() to New() in examples for Bubbles-related stuff 2022-01-13 13:20:18 -05:00
Christian Rocha 843b6a5249 Use model-based Tick commands in spinner examples 2022-01-13 13:05:27 -05:00
Christian Rocha ee92bed288 Cleanup header/footer rendering in pager example with Lip Gloss 2022-01-13 12:49:20 -05:00
Christian Rocha 7517c1b1bd Add a border to the Glamour example per the viewport API update 2022-01-13 12:49:20 -05:00
Christian Rocha 7514ac937a Update glamour example per viewport API update 2022-01-13 12:49:20 -05:00
Christian Rocha 1ca2b1cd40 Update pager example per viewport API update 2022-01-13 12:49:20 -05:00
Christian Rocha bdb04767ff Add stopwatch example 2022-01-13 11:53:46 -05:00
Christian Rocha 03d1aa6c08 Rename 'countdown' example to 'timer' and use timer Bubble 2022-01-13 11:53:14 -05:00
Christian Rocha 99ba63fe8a
Bump main, example, and tutorial dependencies 2022-01-13 11:41:09 -05:00
Max Brauer 4ac566c1f7 Remove unused func from send-msg example
‘randomEmoji()’ is redundant
2022-01-10 21:15:47 -05:00
Christian Rocha d266bc1616 Update result example to use StartReturningModel 2022-01-10 21:00:29 -05:00
Kyosuke Fujimoto 3a1b9fbe9f Fix list-default to use tea.WithAltScreen option 2022-01-08 14:36:37 -05:00
Kyosuke Fujimoto 14478e2a3c Fix list-default to be able to exit with ctrl+c 2022-01-08 14:36:37 -05:00
Christian Rocha ab89603d28 Remove unused filtering stuff from simple list example 2021-11-09 17:30:15 -05:00
Christian Rocha 6dc000bdbd Examples and tutorials: update dependencies and go mod tidy 2021-10-28 09:45:43 -04:00
Christian Muehlhaeuser c29912c179 Enable ANSI compressor
With this change all ANSI output will be piped through an ANSI compressor that
eliminates redundant ANSI sequences. As such the compressor can be considered
"lossless".
2021-10-28 09:45:43 -04:00
Christian Rocha 7396e37f3f Fix a performance rendering size miscalculation in the pager example 2021-09-17 16:39:02 -04:00
Christian Rocha 749e48df11 Update animated progress bar example per its current API 2021-09-07 14:16:55 -04:00
Christian Muehlhaeuser 27ba7e7aa1 Add list examples 2021-08-23 22:18:28 +02:00
Christian Rocha 1b8495ed21 Add help bubble example 2021-08-23 22:05:20 +02:00
Christian Rocha 8574b87a44 Bump containerd/console in examples 2021-08-02 10:50:04 -04:00
Christian Rocha 8f03848f54 Split progress bar example into static and animated versions 2021-07-26 12:50:53 -04:00
Christian Rocha 0886ee26b0 Msgs can now be sent to Programs with Program.Send(Msg) 2021-07-01 11:06:21 -04:00
Christian Rocha 85ab476698 Add ProgramOptions for entering the altscreen and enabling the mouse
Because they run ansyncronously, the analogous commands, when run in
a Model's Init() function, could fire after the renderer has starting
writing to output, rendering artifacts to the commandline.
2021-06-02 14:49:54 -04:00
Christian Rocha ec2fbf024b Cycle through cursor modes in textinputs example per Bubbles v0.8.0 2021-06-02 12:44:32 -04:00
Ilya Revenko 29b7de4b7c
Fix more typos in examples (#102) 2021-05-28 19:45:17 +02:00