Clivern / Goenv

🐺 Manage Your Applications Go Environment.
MIT License
34 stars 2 forks source link

fix(deps): update module github.com/charmbracelet/lipgloss to v0.13.1 #107

Closed renovate[bot] closed 4 days ago

renovate[bot] commented 4 days ago

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
github.com/charmbracelet/lipgloss v0.6.0 -> v0.13.1 age adoption passing confidence

Release Notes

charmbracelet/lipgloss (github.com/charmbracelet/lipgloss) ### [`v0.13.1`](https://redirect.github.com/charmbracelet/lipgloss/releases/tag/v0.13.1) [Compare Source](https://redirect.github.com/charmbracelet/lipgloss/compare/v0.13.0...v0.13.1) ### Table improvements, on stream [@​bashbunni](https://redirect.github.com/bashbunni) went to town in this release and fixed a bunch of bugs, mostly around table. Best of all, she did most of it [on stream](https://www.twitch.tv/bashbunni). #### Changelog ##### Table - fix(table): use table height by [@​Broderick-Westrope](https://redirect.github.com/Broderick-Westrope) in [https://github.com/charmbracelet/lipgloss/pull/358](https://redirect.github.com/charmbracelet/lipgloss/pull/358) - fix(table): unset data rows without causing nil pointer err by [@​bashbunni](https://redirect.github.com/bashbunni) in [https://github.com/charmbracelet/lipgloss/pull/372](https://redirect.github.com/charmbracelet/lipgloss/pull/372) - fix(table): shared indices for first row of data and headers (StyleFunc bug) by [@​bashbunni](https://redirect.github.com/bashbunni) in [https://github.com/charmbracelet/lipgloss/pull/377](https://redirect.github.com/charmbracelet/lipgloss/pull/377) - fix(table): do not shrink table with offset by [@​bashbunni](https://redirect.github.com/bashbunni) in [https://github.com/charmbracelet/lipgloss/pull/373](https://redirect.github.com/charmbracelet/lipgloss/pull/373) - fix(table): include margins for cell width by [@​bashbunni](https://redirect.github.com/bashbunni) in [https://github.com/charmbracelet/lipgloss/pull/401](https://redirect.github.com/charmbracelet/lipgloss/pull/401) ##### Other Stuff - fix(render): strip carriage returns from strings by [@​bashbunni](https://redirect.github.com/bashbunni) in [https://github.com/charmbracelet/lipgloss/pull/386](https://redirect.github.com/charmbracelet/lipgloss/pull/386) #### Bonus - docs(example): rainbow string by [@​caarlos0](https://redirect.github.com/caarlos0) in [https://github.com/charmbracelet/lipgloss/pull/96](https://redirect.github.com/charmbracelet/lipgloss/pull/96) #### New Contributors - [@​Broderick-Westrope](https://redirect.github.com/Broderick-Westrope) made their first contribution in [https://github.com/charmbracelet/lipgloss/pull/358](https://redirect.github.com/charmbracelet/lipgloss/pull/358) - [@​swrenn](https://redirect.github.com/swrenn) made their first contribution in [https://github.com/charmbracelet/lipgloss/pull/364](https://redirect.github.com/charmbracelet/lipgloss/pull/364) **Full Changelog**: https://github.com/charmbracelet/lipgloss/compare/v0.13.0...v0.13.1 *** The Charm logo Thoughts? Questions? We love hearing from you. Feel free to reach out on [Twitter](https://twitter.com/charmcli), [The Fediverse](https://mastodon.technology/@​charm), or on [Discord](https://charm.sh/chat). ### [`v0.13.0`](https://redirect.github.com/charmbracelet/lipgloss/releases/tag/v0.13.0) [Compare Source](https://redirect.github.com/charmbracelet/lipgloss/compare/v0.12.1...v0.13.0) ### Woodn’t you know, Lip Gloss has trees! Lip Gloss ships with a tree rendering sub-package. ```go import "github.com/charmbracelet/lipgloss/tree" ``` Define a new tree. ```go t := tree.Root("."). Child("A", "B", "C") ``` Print the tree. ```go fmt.Println(t) // . // ├── A // ├── B // └── C ``` Trees have the ability to nest. ```go t := tree.Root("."). Child("macOS"). Child( tree.New(). Root("Linux"). Child("NixOS"). Child("Arch Linux (btw)"). Child("Void Linux"), ). Child( tree.New(). Root("BSD"). Child("FreeBSD"). Child("OpenBSD"), ) ``` Print the tree. ```go fmt.Println(t) ```

Tree Example (simple)

Trees can be customized via their enumeration function as well as using `lipgloss.Style`s. ```go enumeratorStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("63")).MarginRight(1) rootStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("35")) itemStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("212")) t := tree. Root("⁜ Makeup"). Child( "Glossier", "Fenty Beauty", tree.New().Child( "Gloss Bomb Universal Lip Luminizer", "Hot Cheeks Velour Blushlighter", ), "Nyx", "Mac", "Milk", ). Enumerator(tree.RoundedEnumerator). EnumeratorStyle(enumeratorStyle). RootStyle(rootStyle). ItemStyle(itemStyle) ``` Print the tree.

Tree Example (makeup)

The predefined enumerators for trees are `DefaultEnumerator` and `RoundedEnumerator`. If you need, you can also build trees incrementally: ```go t := tree.New() for i := 0; i < repeat; i++ { t.Child("Lip Gloss") } ``` #### There’s more where that came from See [all the tree examples](https://redirect.github.com/charmbracelet/lipgloss/tree/master/examples/tree). *** #### Changelog ##### New Features - [`0618c73`](https://redirect.github.com/charmbracelet/lipgloss/commit/0618c73743d90bb724af8f5a75e4c17bced1ff87): feat(test): add test for `JoinHorizontal` ([#​346](https://redirect.github.com/charmbracelet/lipgloss/issues/346)) ([@​aditipatelpro](https://redirect.github.com/aditipatelpro)) - [`feb42a9`](https://redirect.github.com/charmbracelet/lipgloss/commit/feb42a9be4a0577fd10b8e9ba80541ca759fb60c): feat: move tree to root ([#​342](https://redirect.github.com/charmbracelet/lipgloss/issues/342)) ([@​caarlos0](https://redirect.github.com/caarlos0)) ##### Bug fixes - [`8a0e640`](https://redirect.github.com/charmbracelet/lipgloss/commit/8a0e6405b71da72f705fbdb6a98eba0095ddbabe): fix: remove unnecessary if ([@​aymanbagabas](https://redirect.github.com/aymanbagabas)) ##### Documentation updates - [`bc0de5c`](https://redirect.github.com/charmbracelet/lipgloss/commit/bc0de5ca26463c5d6f6f8abcb28a5d3090019fd8): docs(README): make tree example match output ([@​bashbunni](https://redirect.github.com/bashbunni)) - [`bb3e339`](https://redirect.github.com/charmbracelet/lipgloss/commit/bb3e3398bb98de0faf2966331c4686b360f7eab4): docs(README): match tree example alignment with list examples ([@​bashbunni](https://redirect.github.com/bashbunni)) - [`185fde3`](https://redirect.github.com/charmbracelet/lipgloss/commit/185fde35318b966319d590e960e3382233f72c6f): docs(README): update tree images ([@​bashbunni](https://redirect.github.com/bashbunni)) - [`ed7f56e`](https://redirect.github.com/charmbracelet/lipgloss/commit/ed7f56e2a7e910c5a63983683c2d7e387d09d024): docs: fix `CompleteColor` example ([#​345](https://redirect.github.com/charmbracelet/lipgloss/issues/345)) ([@​bashbunni](https://redirect.github.com/bashbunni)) - [`cf0a7c6`](https://redirect.github.com/charmbracelet/lipgloss/commit/cf0a7c615f558ed2a522babdcf6288f46667a5bb): docs: fix tree screenshot ([@​caarlos0](https://redirect.github.com/caarlos0)) *** The Charm logo Thoughts? Questions? We love hearing from you. Feel free to reach out on [Twitter](https://twitter.com/charmcli), [The Fediverse](https://mastodon.technology/@​charm), or on [Discord](https://charm.sh/chat). ### [`v0.12.1`](https://redirect.github.com/charmbracelet/lipgloss/releases/tag/v0.12.1) [Compare Source](https://redirect.github.com/charmbracelet/lipgloss/compare/v0.12.0...v0.12.1) This release fixes a regression with regard to border calculations introduced in Lip Gloss v0.11.1. *** The Charm logo Thoughts? Questions? We love hearing from you. Feel free to reach out on [Twitter](https://twitter.com/charmcli), [The Fediverse](https://mastodon.technology/@​charm), or on [Discord](https://charm.sh/chat). ### [`v0.12.0`](https://redirect.github.com/charmbracelet/lipgloss/releases/tag/v0.12.0) [Compare Source](https://redirect.github.com/charmbracelet/lipgloss/compare/v0.11.1...v0.12.0) ### Lists, Check ✓ This release adds a new sub-package for rendering trees and lists. ```go import "github.com/charmbracelet/lipgloss/list" ``` Define a new list. ```go l := list.New("A", "B", "C") ``` Print the list. ```go fmt.Println(l) // • A // • B // • C ``` Lists have the ability to nest. ```go l := list.New( "A", list.New("Artichoke"), "B", list.New("Baking Flour", "Bananas", "Barley", "Bean Sprouts"), "C", list.New("Cashew Apple", "Cashews", "Coconut Milk", "Curry Paste", "Currywurst"), "D", list.New("Dill", "Dragonfruit", "Dried Shrimp"), "E", list.New("Eggs"), "F", list.New("Fish Cake", "Furikake"), "J", list.New("Jicama"), "K", list.New("Kohlrabi"), "L", list.New("Leeks", "Lentils", "Licorice Root"), ) ``` Print the list. ```go fmt.Println(l) ```

image

Lists can be customized via their enumeration function as well as using `lipgloss.Style`s. ```go enumeratorStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("99")).MarginRight(1) itemStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("212")).MarginRight(1) l := list.New( "Glossier", "Claire’s Boutique", "Nyx", "Mac", "Milk", ). Enumerator(list.Roman). EnumeratorStyle(enumeratorStyle). ItemStyle(itemStyle) ``` Print the list.

List example

In addition to the predefined enumerators (`Arabic`, `Alphabet`, `Roman`, `Bullet`, `Tree`), you may also define your own custom enumerator: ```go l := list.New("Duck", "Duck", "Duck", "Duck", "Goose", "Duck", "Duck") func DuckDuckGooseEnumerator(l list.Items, i int) string { if l.At(i).Value() == "Goose" { return "Honk →" } return "" } l = l.Enumerator(DuckDuckGooseEnumerator) ``` Print the list:

image

If you need, you can also build lists incrementally: ```go l := list.New() for i := 0; i < repeat; i++ { l.Item("Lip Gloss") } ``` *** The Charm logo Thoughts? Questions? We love hearing from you. Feel free to reach out on [Twitter](https://twitter.com/charmcli), [The Fediverse](https://mastodon.technology/@​charm), or on [Discord](https://charm.sh/chat). ### [`v0.11.1`](https://redirect.github.com/charmbracelet/lipgloss/releases/tag/v0.11.1) [Compare Source](https://redirect.github.com/charmbracelet/lipgloss/compare/v0.11.0...v0.11.1) This release is a small patch release to fix text truncation in table cells. For details see: [https://github.com/charmbracelet/lipgloss/issues/324](https://redirect.github.com/charmbracelet/lipgloss/issues/324). #### Other stuff - chore: remove deprecated Copy() calls by [@​meowgorithm](https://redirect.github.com/meowgorithm) in [https://github.com/charmbracelet/lipgloss/pull/306](https://redirect.github.com/charmbracelet/lipgloss/pull/306) - feat: deprecate Style.ColorWhitespace by [@​meowgorithm](https://redirect.github.com/meowgorithm) in [https://github.com/charmbracelet/lipgloss/pull/311](https://redirect.github.com/charmbracelet/lipgloss/pull/311) - feat: deprecate Style.ColorWhitespace by [@​meowgorithm](https://redirect.github.com/meowgorithm) in [https://github.com/charmbracelet/lipgloss/pull/314](https://redirect.github.com/charmbracelet/lipgloss/pull/314) - fix: Deprecate UnsetBorderTopBackgroundColor in favor of UnsetBorderTopBackground by [@​nervo](https://redirect.github.com/nervo) in [https://github.com/charmbracelet/lipgloss/pull/315](https://redirect.github.com/charmbracelet/lipgloss/pull/315) **Full Changelog**: https://github.com/charmbracelet/lipgloss/compare/v0.11.0...v0.11.1 *** The Charm logo Thoughts? Questions? We love hearing from you. Feel free to reach out on [Twitter](https://twitter.com/charmcli), [The Fediverse](https://mastodon.technology/@​charm), or [Discord](https://charm.sh/discord). ### [`v0.11.0`](https://redirect.github.com/charmbracelet/lipgloss/releases/tag/v0.11.0) [Compare Source](https://redirect.github.com/charmbracelet/lipgloss/compare/v0.10.0...v0.11.0) ### Immutable Styles and Raw Speed, Baby So! The big news in this release is: - `Style` methods will now *always* return new styles - `Style` and ANSI operations under the hood are faster There are also a handful of great lil' bug fixes. Read on for more. #### Immutable Styles Every `Style` method now returns a completely new style with its own underlying data structure no matter what. This means working with Styles is a lot easier. No more need for `Copy()`! ```go // Before s := lipgloss.NewStyle().Bold(true) newStyle := s.Copy() // After s := lipgloss.NewStyle().Bold(true) newStyle := s // this is a true copy ``` Okay, but why are styles easier to work with now? Consider this: ```go // Before baseStyle := lipgloss.NewStyle().Background(lipgloss.Color("59")) styleAtRuntime := baseStyle.Copy().Width(m.Width) // After baseStyle := lipgloss.NewStyle().Padding(1, 2) styleAtRuntime := baseStyle.Width(m.Width) ``` It might seem small, but eliminating the risk of mutations in persistent styles in an enormous usability improvement. ##### How to upgrade There's nothing to do, however `Style.Copy()` is now deprecated and only returns itself, so you can just remove `Style.Copy()` calls. If you need to *just* copy a style without any changes to it you can simply `b := a`. #### Faster ANSI Sometimes watch companies brag about their "in-house" watch movement. Well, now we're bragging about our in-house-amazing [`x/ansi`](https://redirect.github.com/charmbracelet/x/tree/main/ansi) library by our own [@​aymanbagabas](https://redirect.github.com/aymanbagabas). It's a fine-tuned, low-level way to manage ANSI sequencing and, because we're pretty nerdy, we’re *super* excited about it. *** #### What's Changed ##### New! - always return copies of styles by [@​aymanbagabas](https://redirect.github.com/aymanbagabas) in [https://github.com/charmbracelet/lipgloss/pull/276](https://redirect.github.com/charmbracelet/lipgloss/pull/276) ##### Changed - switch to term/ansi for text manipulation by [@​aymanbagabas](https://redirect.github.com/aymanbagabas) in [https://github.com/charmbracelet/lipgloss/pull/268](https://redirect.github.com/charmbracelet/lipgloss/pull/268) - replace stripansi with ansi.Strip in table by [@​aymanbagabas](https://redirect.github.com/aymanbagabas) in [https://github.com/charmbracelet/lipgloss/pull/271](https://redirect.github.com/charmbracelet/lipgloss/pull/271) - test for different GOOS & GOARCH by [@​aymanbagabas](https://redirect.github.com/aymanbagabas) in [https://github.com/charmbracelet/lipgloss/pull/292](https://redirect.github.com/charmbracelet/lipgloss/pull/292) ##### Fixed - fix combining both conditional and unconditional wrapping by [@​aymanbagabas](https://redirect.github.com/aymanbagabas) in [https://github.com/charmbracelet/lipgloss/pull/275](https://redirect.github.com/charmbracelet/lipgloss/pull/275) - fix UnderlineSpaces and StrikethroughSpaces by [@​Taz03](https://redirect.github.com/Taz03) in [https://github.com/charmbracelet/lipgloss/pull/299](https://redirect.github.com/charmbracelet/lipgloss/pull/299) - always render horizontal border edges when enabled by [@​UnseenBook](https://redirect.github.com/UnseenBook) in [https://github.com/charmbracelet/lipgloss/pull/211](https://redirect.github.com/charmbracelet/lipgloss/pull/211) - fix possible nil panic by [@​maaslalani](https://redirect.github.com/maaslalani) in [https://github.com/charmbracelet/lipgloss/pull/245](https://redirect.github.com/charmbracelet/lipgloss/pull/245) - fix transform operating on ANSI sequences by [@​meowgorithm](https://redirect.github.com/meowgorithm) in [https://github.com/charmbracelet/lipgloss/pull/274](https://redirect.github.com/charmbracelet/lipgloss/pull/274) - change propkeys from int to int64 by [@​hugoleodev](https://redirect.github.com/hugoleodev) in [https://github.com/charmbracelet/lipgloss/pull/291](https://redirect.github.com/charmbracelet/lipgloss/pull/291) #### New Contributors - [@​benwaffle](https://redirect.github.com/benwaffle) made their first contribution in [https://github.com/charmbracelet/lipgloss/pull/247](https://redirect.github.com/charmbracelet/lipgloss/pull/247) - [@​UnseenBook](https://redirect.github.com/UnseenBook) made their first contribution in [https://github.com/charmbracelet/lipgloss/pull/211](https://redirect.github.com/charmbracelet/lipgloss/pull/211) - [@​hugoleodev](https://redirect.github.com/hugoleodev) made their first contribution in [https://github.com/charmbracelet/lipgloss/pull/291](https://redirect.github.com/charmbracelet/lipgloss/pull/291) - [@​Taz03](https://redirect.github.com/Taz03) made their first contribution in [https://github.com/charmbracelet/lipgloss/pull/299](https://redirect.github.com/charmbracelet/lipgloss/pull/299) **Full Changelog**: https://github.com/charmbracelet/lipgloss/compare/v0.10.0...v0.11.0 *** The Charm logo Thoughts? Questions? We love hearing from you. Feel free to reach out on [Twitter](https://twitter.com/charmcli), [The Fediverse](https://mastodon.technology/@​charm), or [Discord](https://charm.sh/discord). ### [`v0.10.0`](https://redirect.github.com/charmbracelet/lipgloss/releases/tag/v0.10.0) [Compare Source](https://redirect.github.com/charmbracelet/lipgloss/compare/v0.9.1...v0.10.0) ### String Transforms 💄 Lip Gloss `v0.10.0` features a brand new `Transform` function for Styles to alter strings at render time. As well as some bug fixes, like ANSI-aware table cell truncation. 🧹 Simply define a `Transform` function as `func (string) string` and apply it to any style: ```go // Example: s := NewStyle().Transform(strings.ToUpper) fmt.Println(s.Render("raow!") // "RAOW!" ``` Or, if you prefer: ```go // Example: reverse := func(s string) string { n := 0 rune := make([]rune, len(s)) for _, r := range s { rune[n] = r n++ } rune = rune[0:n] for i := 0; i < n/2; i++ { rune[i], rune[n-1-i] = rune[n-1-i], rune[i] } return string(rune) } s := NewStyle().Transform(reverse) fmt.Println(s.Render("The quick brown 狐 jumped over the lazy 犬") // "犬 yzal eht revo depmuj 狐 nworb kciuq ehT", ``` #### What's Changed? - Corrected border shorthand functions explanation by [@​ReidMason](https://redirect.github.com/ReidMason) in [https://github.com/charmbracelet/lipgloss/pull/237](https://redirect.github.com/charmbracelet/lipgloss/pull/237) - Align help by [@​schmurfy](https://redirect.github.com/schmurfy) in [https://github.com/charmbracelet/lipgloss/pull/239](https://redirect.github.com/charmbracelet/lipgloss/pull/239) - `Style.Transform` for altering strings at render time by [@​meowgorithm](https://redirect.github.com/meowgorithm) in [https://github.com/charmbracelet/lipgloss/pull/232](https://redirect.github.com/charmbracelet/lipgloss/pull/232) - Adding right padding to empty string by [@​mikelorant](https://redirect.github.com/mikelorant) in [https://github.com/charmbracelet/lipgloss/pull/253](https://redirect.github.com/charmbracelet/lipgloss/pull/253) - Refactor padding functions by [@​mikelorant](https://redirect.github.com/mikelorant) in [https://github.com/charmbracelet/lipgloss/pull/254](https://redirect.github.com/charmbracelet/lipgloss/pull/254) - Fix truncate of table cells containing ANSI by [@​mikelorant](https://redirect.github.com/mikelorant) in [https://github.com/charmbracelet/lipgloss/pull/256](https://redirect.github.com/charmbracelet/lipgloss/pull/256) - Improve maximum width of characters in a string by [@​mikelorant](https://redirect.github.com/mikelorant) in [https://github.com/charmbracelet/lipgloss/pull/257](https://redirect.github.com/charmbracelet/lipgloss/pull/257) #### New Contributors - [@​ReidMason](https://redirect.github.com/ReidMason) made their first contribution in [https://github.com/charmbracelet/lipgloss/pull/237](https://redirect.github.com/charmbracelet/lipgloss/pull/237) - [@​schmurfy](https://redirect.github.com/schmurfy) made their first contribution in [https://github.com/charmbracelet/lipgloss/pull/239](https://redirect.github.com/charmbracelet/lipgloss/pull/239) - [@​mikelorant](https://redirect.github.com/mikelorant) made their first contribution in [https://github.com/charmbracelet/lipgloss/pull/253](https://redirect.github.com/charmbracelet/lipgloss/pull/253) **Full Changelog**: https://github.com/charmbracelet/lipgloss/compare/v0.9.1...v0.10.0 *** The Charm logo Thoughts? Questions? We love hearing from you. Feel free to reach out on [Twitter](https://twitter.com/charmcli), [The Fediverse](https://mastodon.technology/@​charm), or [Discord](https://charm.sh/discord). ### [`v0.9.1`](https://redirect.github.com/charmbracelet/lipgloss/releases/tag/v0.9.1) [Compare Source](https://redirect.github.com/charmbracelet/lipgloss/compare/v0.9.0...v0.9.1) This bugfix release changes the Table `Headers` API to accept `[]string` for consistency with `Row` / `Rows` and downgrades Lip Gloss to Go version `v1.17`. #### What's Changed - Table Headers type from `[]any` → `[]string` by [@​maaslalani](https://redirect.github.com/maaslalani) in [https://github.com/charmbracelet/lipgloss/pull/234](https://redirect.github.com/charmbracelet/lipgloss/pull/234) - Downgrade Lip Gloss to `v1.17` by [@​maaslalani](https://redirect.github.com/maaslalani) in [https://github.com/charmbracelet/lipgloss/pull/234](https://redirect.github.com/charmbracelet/lipgloss/pull/234) **Full Changelog**: https://github.com/charmbracelet/lipgloss/compare/v0.9.0...v0.9.1 ### [`v0.9.0`](https://redirect.github.com/charmbracelet/lipgloss/releases/tag/v0.9.0) [Compare Source](https://redirect.github.com/charmbracelet/lipgloss/compare/v0.8.0...v0.9.0) ### My, how the tables have turned Now you can draw `Table`s with Lip Gloss! 💅 image View [the source code](https://redirect.github.com/charmbracelet/lipgloss/tree/master/examples/table/pokemon/main.go). #### Let's get started ```go import "github.com/charmbracelet/lipgloss/table" ``` Define some rows of data. ```go rows := [][]string{ {"Chinese", "您好", "你好"}, {"Japanese", "こんにちは", "やあ"}, {"Arabic", "أهلين", "أهلا"}, {"Russian", "Здравствуйте", "Привет"}, {"Spanish", "Hola", "¿Qué tal?"}, } ``` Use the table package to style and render the table. ```go t := table.New(). Border(lipgloss.NormalBorder()). BorderStyle(lipgloss.NewStyle().Foreground(lipgloss.Color("99"))). StyleFunc(func(row, col int) lipgloss.Style { switch { case row == 0: return HeaderStyle case row%2 == 0: return EvenRowStyle default: return OddRowStyle } }). Headers("LANGUAGE", "FORMAL", "INFORMAL"). Rows(rows...) // You can also add tables row-by-row t.Row("English", "You look absolutely fabulous.", "How's it going?") ``` Print the table. ```go fmt.Println(t) ``` Table example For more on tables see [the examples](https://redirect.github.com/charmbracelet/lipgloss/tree/master/examples/table). #### Additional Borders Lip Gloss' `Border` now supports additional middle border separators. ```go type Border struct { // ... MiddleLeft string MiddleRight string Middle string MiddleTop string MiddleBottom string } ``` ### [`v0.8.0`](https://redirect.github.com/charmbracelet/lipgloss/releases/tag/v0.8.0) [Compare Source](https://redirect.github.com/charmbracelet/lipgloss/compare/v0.7.1...v0.8.0) ### Predictable Tabs At last: tabs that render the way you want ’em to. With the new [`Style.TabWidth()`](https://pkg.go.dev/github.com/charmbracelet/lipgloss@v0.8.0#Style.TabWidth) method, you can determine exactly how a `\t` will render. Before this release, Lip Gloss used to mis-measure a tab (i.e. a `\t`) at 0 cells wide when they actually render at different widths in different terminals (usually 8 cells, sometimes 4 cells). For these reasons, tabs are almost never what you want when designing layouts for TUIs. With this release, a tab will get converted to 4 spaces by default—so this is a behavioral change—but you can customize the behavior as well as disable it entirely. ```go s := lipgloss.NewStyle() // 4 spaces per tab, the default s = s.TabWidth(2) // 2 spaces per tab s = s.TabWidth(0) // remove tabs s = s.TabWidth(-1) // don't convert tabs to spaces s = s.TabWidth(NoTabConversion) // alias of the above ``` You can disable the feature with `Style.TabWidth(NoTabConversion)` (or `Style.TabWidth(-1)`, if you're the pedantic type). ### Bug Fixes This release also includes a bunch of bug fixes. This includes: - fix: border size calculation by [@​mieubrisse](https://redirect.github.com/mieubrisse) in [https://github.com/charmbracelet/lipgloss/pull/197](https://redirect.github.com/charmbracelet/lipgloss/pull/197) - fix: renderer race condition by [@​aymanbagabas](https://redirect.github.com/aymanbagabas) in [https://github.com/charmbracelet/lipgloss/pull/210](https://redirect.github.com/charmbracelet/lipgloss/pull/210) - fix: cache color profile and background by [@​aymanbagabas](https://redirect.github.com/aymanbagabas) in [https://github.com/charmbracelet/lipgloss/pull/212](https://redirect.github.com/charmbracelet/lipgloss/pull/212) *** **Full Changelog**: https://github.com/charmbracelet/lipgloss/compare/v0.7.1...v0.8.0 ### [`v0.7.1`](https://redirect.github.com/charmbracelet/lipgloss/releases/tag/v0.7.1) [Compare Source](https://redirect.github.com/charmbracelet/lipgloss/compare/v0.7.0...v0.7.1) This bugfix release fixes a problem introduced in v0.7.0 where applications could freeze or hang on start-up. #### What's Changed - fix(renderer): use termenv default renderer by [@​aymanbagabas](https://redirect.github.com/aymanbagabas) in [https://github.com/charmbracelet/lipgloss/pull/179](https://redirect.github.com/charmbracelet/lipgloss/pull/179) - chore: bump termenv to v0.15.1 by [@​muesli](https://redirect.github.com/muesli) in [https://github.com/charmbracelet/lipgloss/pull/180](https://redirect.github.com/charmbracelet/lipgloss/pull/180) **Full Changelog**: https://github.com/charmbracelet/lipgloss/compare/v0.7.0...v0.7.1 ### [`v0.7.0`](https://redirect.github.com/charmbracelet/lipgloss/releases/tag/v0.7.0) [Compare Source](https://redirect.github.com/charmbracelet/lipgloss/compare/v0.6.0...v0.7.0) ### Custom Renderers We're pleased to introduce custom renders for Lip Gloss! Custom renderers allow you to render to a specific outputs, which is particularly important when you want to detect the color profile and dark background status for multiple different outputs at runtime, such as in a server-client situation. Here's what it looks like: ```go func myLittleHandler(sess ssh.Session) { // Create a renderer for the client. renderer := lipgloss.NewRenderer(sess) // Create a new style on the renderer. style := renderer.NewStyle().Background(lipgloss.AdaptiveColor{Light: "63", Dark: "228"}) // Render. The color profile and dark background state will be correctly detected. io.WriteString(sess, style.Render("Heyyyyyyy")) } ``` For a full example on using a custom renderer over SSH with [Wish](https://redirect.github.com/charmbracelet/wish) see the [SSH example](https://redirect.github.com/charmbracelet/lipgloss/blob/master/examples/ssh). #### New API Stuff - `type Renderer struct` - `NewRenderer(io.Writer)` - `DefaultRenderer()` - `SetDefaultRenderer(*lipgloss.Renderer)` - `style.Renderer(*lipgloss.Renderer) Style` #### What's Changed ##### New - lipgloss renderer by [@​aymanbagabas](https://redirect.github.com/aymanbagabas) in [https://github.com/charmbracelet/lipgloss/pull/140](https://redirect.github.com/charmbracelet/lipgloss/pull/140) and [https://github.com/charmbracelet/lipgloss/pull/174](https://redirect.github.com/charmbracelet/lipgloss/pull/174) - add BlockBorder, OuterHalfBlockBorder, and InnerHalfBlockBorder border styles by [@​VictorBersy](https://redirect.github.com/VictorBersy) in [https://github.com/charmbracelet/lipgloss/pull/120](https://redirect.github.com/charmbracelet/lipgloss/pull/120) ##### Fixed - RGBA implementations for non-hex color values by [@​muesli](https://redirect.github.com/muesli) in [https://github.com/charmbracelet/lipgloss/pull/126](https://redirect.github.com/charmbracelet/lipgloss/pull/126) - unify get border size function names by [@​nerg4l](https://redirect.github.com/nerg4l) in [https://github.com/charmbracelet/lipgloss/pull/148](https://redirect.github.com/charmbracelet/lipgloss/pull/148) - reduce dependencies by [@​caarlos0](https://redirect.github.com/caarlos0) in [https://github.com/charmbracelet/lipgloss/pull/146](https://redirect.github.com/charmbracelet/lipgloss/pull/146) - don't concurrently change output profiles by [@​muesli](https://redirect.github.com/muesli) in [https://github.com/charmbracelet/lipgloss/pull/172](https://redirect.github.com/charmbracelet/lipgloss/pull/172) #### New Contributors - [@​dependabot](https://redirect.github.com/dependabot) made their first contribution in [https://github.com/charmbracelet/lipgloss/pull/133](https://redirect.github.com/charmbracelet/lipgloss/pull/133) - [@​winder](https://redirect.github.com/winder) made their first contribution in [https://github.com/charmbracelet/lipgloss/pull/147](https://redirect.github.com/charmbracelet/lipgloss/pull/147) - [@​VictorBersy](https://redirect.github.com/VictorBersy) made their first contribution in [https://github.com/charmbracelet/lipgloss/pull/120](https://redirect.github.com/charmbracelet/lipgloss/pull/120) - [@​nervo](https://redirect.github.com/nervo) made their first contribution in [https://github.com/charmbracelet/lipgloss/pull/156](https://redirect.github.com/charmbracelet/lipgloss/pull/156) - [@​caarlos0](https://redirect.github.com/caarlos0) made their first contribution in [https://github.com/charmbracelet/lipgloss/pull/146](https://redirect.github.com/charmbracelet/lipgloss/pull/146) - [@​Isti115](https://redirect.github.com/Isti115) made their first contribution in [https://github.com/charmbracelet/lipgloss/pull/170](https://redirect.github.com/charmbracelet/lipgloss/pull/170) - [@​nerg4l](https://redirect.github.com/nerg4l) made their first contribution in [https://github.com/charmbracelet/lipgloss/pull/148](https://redirect.github.com/charmbracelet/lipgloss/pull/148) **Full Changelog**: https://github.com/charmbracelet/lipgloss/compare/v0.6.0...v0.7.0

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.



This PR was generated by Mend Renovate. View the repository job log.

renovate[bot] commented 4 days ago

ℹ Artifact update notice

File name: go.mod

In order to perform the update(s) described in the table above, Renovate ran the go get command, which resulted in the following additional change(s):

Details:

Package Change
github.com/charmbracelet/x/ansi v0.1.4 -> v0.3.2
github.com/mattn/go-isatty v0.0.18 -> v0.0.20
renovate[bot] commented 4 days ago

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update (v0.13.1). You will get a PR once a newer version is released. To ignore this dependency forever, add it to the ignoreDeps array of your Renovate config.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.