fix(deps): update module github.com/charmbracelet/lipgloss to v2#164
Open
renovate[bot] wants to merge 1 commit intomainfrom
Open
fix(deps): update module github.com/charmbracelet/lipgloss to v2#164renovate[bot] wants to merge 1 commit intomainfrom
renovate[bot] wants to merge 1 commit intomainfrom
Conversation
Contributor
Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v0.6.0→v2.0.0Release Notes
charmbracelet/lipgloss (github.com/charmbracelet/lipgloss)
v2.0.0Compare Source
Do you think you can handle Lip Gloss v2?
We’re really excited for you to try Lip Gloss v2! Read on for new features and a guide to upgrading.
If you (or your LLM) just want the technical details, take a look at Upgrade Guide.
What’s new?
The big changes are that Styles are now deterministic (λipgloss!) and you can be much more intentional with your inputs and outputs. Why does this matter?
Playing nicely with others
v2 gives you precise control over I/O. One of the issues we saw with the Lip Gloss and Bubble Tea v1s is that they could fight over the same inputs and outputs, producing lock-ups. The v2s now operate in lockstep.
Querying the right inputs and outputs
In v1, Lip Gloss defaulted to looking at
stdinandstdoutwhen downsampling colors and querying for the background color. This was not always necessarily what you wanted. For example, if your application was writing tostderrwhile redirectingstdoutto a file, the program would erroneously think output was not a TTY and strip colors. Lip Gloss v2 gives you control over this.Going beyond localhost
Did you know TUIs and CLIs can be served over the network? For example, Wish allows you to serve Bubble Tea and Lip Gloss over SSH. In these cases, you need to work with the input and output of the connected clients as opposed to
stdinandstdout, which belong to the server. Lip Gloss v2 gives you flexibility around this in a more natural way.🧋 Using Lip Gloss with Bubble Tea?
Make sure you get all the latest v2s as they’ve been designed to work together.
# Collect the whole set. go get charm.land/bubbletea/v2 go get charm.land/bubbles/v2 go get charm.land/lipgloss/v2🐇 Quick upgrade
If you don't have time for changes and just want to upgrade to Lip Gloss v2 as fast as possible? Here’s a quick guide:
Use the
compatpackageThe
compatpackage provides adaptive colors, complete colors, and complete adaptive colors:compatworks by looking atstdinandstdouton a global basis. Want to change the inputs and outputs? Knock yourself out:Use the new Lip Gloss writer
If you’re using Bubble Tea with Lip Gloss you can skip this step. If you're using Lip Gloss in a standalone fashion, however, you'll want to use
lipgloss.Println(andlipgloss.Printfand so on) when printing your output:Why? Because
lipgloss.Printlnwill automatically downsample colors based on the environment.That’s it!
Yep, you’re done. All this said, we encourage you to read on to get the full benefit of v2.
👀 What’s changing?
Only a couple main things that are changing in Lip Gloss v2:
🪄 Downsampling colors with a writer
One of the best things about Lip Gloss is that it can automatically downsample colors to the best available profile, stripping colors (and ANSI) entirely when output is not a TTY.
If you're using Lip Gloss with Bubble Tea there's nothing to do here: downsampling is built into Bubble Tea v2. If you're not using Bubble Tea you now need to use a writer to downsample colors. Lip Gloss writers are a drop-in replacement for the usual functions found in the
fmtpackage:🌛 Background color detection and adaptive colors
Rendering different colors depending on whether the terminal has a light or dark background is an awesome power. Lip Gloss v2 gives you more control over this progress. This especially matters when input and output are not
stdinandstdout.If that doesn’t matter to you and you're only working with
stdoutyou skip this viacompatabove, though we encourage you to explore this new functionality.With Bubble Tea
In Bubble Tea, request the background color, listen for a
BackgroundColorMsgin your update, and respond accordingly.Standalone
If you're not using Bubble Tea you simply can perform the query manually:
🥕 Other stuff
Colors are now
color.Colorlipgloss.Color()now produces an idiomaticcolor.Color, whereas before colors were typelipgloss.TerminalColor. Generally speaking, this is more of an implementation detail, but it’s worth noting the structural differences.Changelog
New!
Fixed
Docs
Other stuff
🌈 Feedback
That's a wrap! Feel free to reach out, ask questions, and let us know how it's going. We'd love to know what you think.
Part of Charm.
Charm热爱开源 • Charm loves open source • نحنُ نحب المصادر المفتوحة
v1.1.0Compare Source
Tables, Improved
In this release, the inimitable @andreynering and @bashbunni majorly overhauled on the table sizing and content wrapping algorithms. Tables will now be much smarter on deciding the ideal width of each column, and contents now wraps by default inside cells.
New Border Styles
Also, we added two new border styles that you can use to generate tables in Markdown and ASCII styles.
Markdown Tables
To render tables correctly for Markdown you'll want to use
lipgloss.MarkdownBorderand disable the top and bottom borders.ASCII Tables
To render an ASCII-style table use
lipgloss.ASCIIBorder.Thanks everyone
Special thanks to @aymanbagabas, @bashbunni, @andreynering, and @caarlos0 for or all the work on this release!
Changelog
New Features
7862f52: feat(table): improve sizing and behavior: wrap by default, overflow optionally (@andreynering)1f1209e: feat(table): use cellbuf to preserve styles for wrapped content (@bashbunni)c454a0a: feat(tables): add markdown and ascii border style for tables (#480) (@andreynering)bafb8fd: feat(tree): hide children (#460) (@bashbunni)9942166: feat: style ranges (#458) (@caarlos0)Bug fixes
9500f10: fix(table): ensure we're passing the right row index tostyleFunc(@andreynering)7b191c5: fix(test): make table wrapping tests use golden files (@bashbunni)9b8304f: fix: border size getters when implicit borders are present (#411) (@meowgorithm)022e967: fix: range test (@caarlos0)Other work
ecc1bd0: fix: comment on min func in utils (@derezzolution)5cd2074: style(table): improve naming of the resizer functions (@andreynering)9cfb7dd: test(table): check truncation logic for overflow and nowrap (@bashbunni)2aa2eb0: test(table): test wrapping cell styles (@bashbunni)ca67d0f: chore(lint): apply De Morgans law to the if statement (@aymanbagabas)0fbb070: chore(lint): fix lint ignore comments (@andreynering)Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.
v1.0.0Compare Source
At last: v1.0.0
This is an honorary release indicating that Lip Gloss is now stable. Thank you, open source community, for all your love, support, contributions, and great style.
Stay tuned for a v2 alpha!
v0.13.1Compare Source
Table improvements, on stream
@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.
Changelog
Table
Other Stuff
Bonus
New Contributors
Full Changelog: charmbracelet/lipgloss@v0.13.0...v0.13.1
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.
v0.13.0Compare Source
Woodn’t you know, Lip Gloss has trees!
Lip Gloss ships with a tree rendering sub-package.
Define a new tree.
Print the tree.
Trees have the ability to nest.
Print the tree.
Trees can be customized via their enumeration function as well as using
lipgloss.Styles.Print the tree.
The predefined enumerators for trees are
DefaultEnumeratorandRoundedEnumerator.If you need, you can also build trees incrementally:
There’s more where that came from
See all the tree examples.
Changelog
New Features
0618c73: feat(test): add test forJoinHorizontal(#346) (@aditipatelpro)feb42a9: feat: move tree to root (#342) (@caarlos0)Bug fixes
8a0e640: fix: remove unnecessary if (@aymanbagabas)Documentation updates
bc0de5c: docs(README): make tree example match output (@bashbunni)bb3e339: docs(README): match tree example alignment with list examples (@bashbunni)185fde3: docs(README): update tree images (@bashbunni)ed7f56e: docs: fixCompleteColorexample (#345) (@bashbunni)cf0a7c6: docs: fix tree screenshot (@caarlos0)Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.
v0.12.1Compare Source
Border width calcs: back to normal
This release fixes a regression with regard to border calculations introduced in Lip Gloss v0.11.1.
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.
v0.12.0Compare Source
Lists, Check ✓
This release adds a new sub-package for rendering trees and lists.
Define a new list.
Print the list.
Lists have the ability to nest.
Print the list.
Lists can be customized via their enumeration function as well as using
lipgloss.Styles.Print the list.
In addition to the predefined enumerators (
Arabic,Alphabet,Roman,Bullet,Tree),you may also define your own custom enumerator:
Print the list:
If you need, you can also build lists incrementally:
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.
v0.11.1Compare Source
A lil’ truncation fix
This release is a small patch release to fix text truncation in table cells. For details see: #324.
Other stuff
Full Changelog: charmbracelet/lipgloss@v0.11.0...v0.11.1
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.
v0.11.0Compare Source
Immutable Styles and Raw Speed, Baby
So! The big news in this release is:
Stylemethods will now always return new stylesStyleand ANSI operations under the hood are fasterThere are also a handful of great lil' bug fixes. Read on for more.
Immutable Styles
Every
Stylemethod 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 forCopy()!Okay, but why are styles easier to work with now? Consider this:
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 removeStyle.Copy()calls. If you need to just copy a style without any changes to it you can simplyb := a.Faster ANSI
Sometimes watch companies brag about their "in-house" watch movement. Well, now we're bragging about our in-house-amazing
x/ansilibrary by our own @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!
Changed
Fixed
New Contributors
Full Changelog: charmbracelet/lipgloss@v0.10.0...v0.11.0
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.
v0.10.0Compare Source
String Transforms 💄
Lip Gloss
v0.10.0features a brand newTransformfunction for Styles to alter strings at render time. As well as some bug fixes, like ANSI-aware table cell truncation. 🧹Simply define a
Transformfunction asfunc (string) stringand apply it to any style:Or, if you prefer:
What's Changed?
Style.Transformfor altering strings at render time by @meowgorithm in #232New Contributors
Full Changelog: charmbracelet/lipgloss@v0.9.1...v0.10.0
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.
v0.9.1Compare Source
This bugfix release changes the Table
HeadersAPI to accept[]stringfor consistency withRow/Rowsand downgrades Lip Gloss to Go versionv1.17.What's Changed
[]any→[]stringby @maaslalani in #234v1.17by @maaslalani in #234Full Changelog: charmbracelet/lipgloss@v0.9.0...v0.9.1
v0.9.0Compare Source
My, how the tables have turned
Now you can draw
Tables with Lip Gloss! 💅View the source code.
Let's get started
Define some rows of data.
Use the table package to style and render the table.
Print the table.
For more on tables see the examples.
Additional Borders
Lip Gloss'
Bordernow supports additional middle border separators.v0.8.0Compare Source
Predictable Tabs
At last: tabs that render the way you want ’em to. With the new
Style.TabWidth()method, you can determine exactly how a\twill 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.
You can disable the feature with
Style.TabWidth(NoTabConversion)(orStyle.TabWidth(-1), if you're the pedantic type).Bug Fixes
This release also includes a bunch of bug fixes. This includes:
Full Changelog: charmbracelet/lipgloss@v0.7.1...v0.8.0
v0.7.1Compare Source
This bugfix release fixes a problem introduced in v0.7.0 where applications could freeze or hang on start-up.
What's Changed
Full Changelog: charmbracelet/lipgloss@v0.7.0...v0.7.1
v0.7.0Compare Source
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:
For a full example on using a custom renderer over SSH with Wish see the SSH example.
New API Stuff
type Renderer structNewRenderer(io.Writer)DefaultRenderer()SetDefaultRenderer(*lipgloss.Renderer)style.Renderer(*lipgloss.Renderer) StyleWhat's Changed
New
Fixed
New Contributors
Full Changelog: charmbracelet/lipgloss@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.