Commit Graph

214 Commits

Author SHA1 Message Date
Maas Lalani 90c9124b0a
Filepicker Example (#683)
* feat: filepicker example

* fix: use new API

* docs(examples): update file selection comment in filepicker example

* chore: bump bubbles

---------

Co-authored-by: Christian Rocha <christian@rocha.is>
2023-03-06 11:54:26 -05:00
dependabot[bot] 388c67d573
feat(deps): bump golang.org/x/text from 0.3.7 to 0.3.8 (#674) 2023-02-23 16:29:25 +00:00
Ayman Bagabas c61e4fd291
chore: update deps
Fixes: CVE-2022-27664 https://github.com/advisories/GHSA-69cg-p879-7622
2023-02-21 12:43:58 -05:00
Glenn Gonda 4880cf2a09 docs: fix typos and clean up comments 2023-02-19 08:45:22 -05:00
Christian Rocha 1ad9f9c15c chore(deps): bump termenv and go-isatty
Also bump various deps in tutorials and examples
2023-02-08 10:04:56 -05:00
dependabot[bot] b30cca3906 chore(deps): bump github.com/muesli/termenv in /examples
Bumps [github.com/muesli/termenv](https://github.com/muesli/termenv) from 0.13.0 to 0.14.0.
- [Release notes](https://github.com/muesli/termenv/releases)
- [Commits](https://github.com/muesli/termenv/compare/v0.13.0...v0.14.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-08 09:36:45 -05:00
Christoffer Åström e95e1a0db5 feat: `sequence` support `BatchMsg` 2023-02-07 10:06:46 -05:00
dependabot[bot] ede4aec24e chore(deps): bump github.com/mattn/go-isatty in /examples
Bumps [github.com/mattn/go-isatty](https://github.com/mattn/go-isatty) from 0.0.16 to 0.0.17.
- [Release notes](https://github.com/mattn/go-isatty/releases)
- [Commits](https://github.com/mattn/go-isatty/compare/v0.0.16...v0.0.17)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-isatty
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-03 17:46:19 +01:00
Christian Rocha 3765727e65
docs(examples): add cellbuffer + harmonica example (#409) 2022-12-12 09:52:00 -05:00
Austin Vazquez e079831c31 Remove references to io/ioutil package
Package io/ioutil has been marked deprecated starting in Go 1.16.

Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2022-11-10 13:51:29 +01:00
dependabot[bot] 7ba62d4987 chore(deps): bump github.com/charmbracelet/glamour in /examples
Bumps [github.com/charmbracelet/glamour](https://github.com/charmbracelet/glamour) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/charmbracelet/glamour/releases)
- [Commits](https://github.com/charmbracelet/glamour/compare/v0.5.0...v0.6.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-11-10 13:50:14 +01:00
Martin Dosch 2d10416631 [codespell]: Fix typos. 2022-11-03 12:55:31 -04:00
Josh Soref 4aa9ce489b
docs: fix spelling / various typos (#526) 2022-10-11 14:40:01 +02:00
Christian Muehlhaeuser 6b77c8fc10 chore: rename StartReturningModel to Run
Added aliases for the old functions, but deprecated them.
2022-10-08 01:34:17 +02:00
Christian Muehlhaeuser 22d15efad7 chore: clean up linter errors in examples 2022-10-08 00:56:56 +02:00
Maas Lalani d20732aaea docs: add examples/gifs locally to repository 2022-10-03 15:07:28 -04:00
Maas Lalani 70576bc9e0
examples/README.md GIFs (#470)
* docs(examples): Add `examples/README.md`

Adds `examples/README.md` with GIFs of examples

* docs(examples): Individual READMEs

* docs(examples): add short description to each example
2022-10-03 12:06:18 -04:00
Matt Joiner d79ebda5cf
Fixes for examples/progress-download (#444) 2022-09-27 06:42:43 +02:00
Scott Leggett 900a842f50 fix: off-by-one error in spinner example 2022-09-27 05:53:21 +02:00
Christian Muehlhaeuser 6c449e55bf feat: use Termenv.Output to write to tty 2022-09-27 02:49:36 +02:00
Maas Lalani e5cbc04f94 docs: use styled glamour markdown within viewport 2022-09-23 16:46:56 -04:00
Christian Rocha 1a0beff868
chore: use go 1.16 (#449)
* chore: use go 1.16 and gofmt accordingly

* chore: also update examples and tuts to go 1.16
2022-09-14 19:08:36 -04:00
dependabot[bot] 8ddf2a308f chore(deps): bump github.com/charmbracelet/lipgloss in /examples
Bumps [github.com/charmbracelet/lipgloss](https://github.com/charmbracelet/lipgloss) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/charmbracelet/lipgloss/releases)
- [Commits](https://github.com/charmbracelet/lipgloss/compare/v0.5.0...v0.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-07 12:42:23 -04:00
Christian Rocha 127f76226e docs(example): set wordwrap in glamour example 2022-09-02 13:01:14 -07:00
Christian Rocha 989d49f3e6 feat: add Sequence for running commands in order. Closes #413.
This deprecates Sequentially.
2022-08-30 13:07:05 -07:00
bashbunni bb241ceb8b
docs: add debounce example (#348)
* docs: add debounce example

* refactor: reformat comments

Co-authored-by: Maas Lalani <maas@lalani.dev>

* refactor: init model before program start

Co-authored-by: Maas Lalani <maas@lalani.dev>

* feat: show tag in view

* docs(examples): improve debounce example comments

* docs(examples): remove extraneous lipgloss join

Co-authored-by: Maas Lalani <maas@lalani.dev>
Co-authored-by: Christian Rocha <christian@rocha.is>
2022-08-24 21:09:43 -07:00
bashbunni 30bb43e5ae
Composable view (#394)
* docs: creating nested models

* docs: move nested model to example

* docs: add working nested model example

* refactor: use tea.Batch in nested model example

* refactor: switch to composable view example

* refactor: tab select, add padding to boxes, only focused has border

* fix: add padding to timer to remove UI shift
2022-08-24 14:57:32 -07:00
Christian Rocha 31800cd0a7
fix(examples): remove unused type in textarea example 2022-08-19 09:29:18 -07:00
mattn 6b685056fc
fix: support multi-byte strings on Windows (#343)
* convert locale string to utf-8 on Windows

* update go.mod

* revert go fmt ./...

* fix(lint): use tabs in GoDoc example code

Co-authored-by: Christian Rocha <christian@rocha.is>
2022-08-19 09:25:22 -07:00
Maas Lalani a7f50a670c fix(split-editors): resize issue 2022-08-18 16:04:03 -04:00
Maas Lalani 8b7b7918d3 doc: Add table example 2022-08-18 15:09:02 -04:00
Sebastian Spaink 6faba760c2 docs: example interacting with tabs using lipgloss 2022-08-18 14:46:28 -04:00
Jerome Fitzgerald ae6fcd395e docs: README progress-download folder + ignore
📝 Update folder name in README to `progress-download` as
 that is what generates with `go build .`

🙈 Add the files genreated by `go build .` to root `.gitnore`
2022-08-18 12:57:30 -04:00
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