on main help sign in
chore: update vendors
commit0a5339a4b94a3b3bacecba34cbd5b05e5932ad4b authorAyman Bagabas <ayman.bagabas@gmail.com> dateWed 16 Jul 2025, 10:31 (1 year ago) parent2419090
3 files changed+49−20
vendor/github.com/charmbracelet/bubbletea/v2/tea.go−2 vendor/github.com/charmbracelet/lipgloss/v2/canvas.go+45−14 vendor/modules.txt+4−4
vendor/github.com/charmbracelet/bubbletea/v2/tea.go−2
@@ -320,12 +320,10 @@ type Program struct {
320320
321321 // where to read inputs from, this will usually be os.Stdin.
322322 input io.Reader
323− mu sync.Mutex
324323 // ttyInput is null if input is not a TTY.
325324 ttyInput term.File
326325 previousTtyInputState *term.State
327326 inputReader *uv.TerminalReader
328− traceInput bool // true if input should be traced
329327 readLoopDone chan struct{}
330328 mouseMode bool // indicates whether we should enable mouse on Windows
331329
vendor/github.com/charmbracelet/lipgloss/v2/canvas.go+45−14
@@ -1,6 +1,7 @@
11package lipgloss
22
33import (
4+ "fmt"
45 "image"
56 "sort"
67
@@ -94,17 +95,14 @@ type Layer struct {
9495 zIndex int
9596 children []*Layer
9697 id string
97− content string
98+ content uv.Drawable
9899}
99100
100101// NewLayer creates a new Layer with the given content. It calculates the size
101102// based on the widest line and the number of lines in the content.
102−func NewLayer(content string) (l *Layer) {
103+func NewLayer(content any) (l *Layer) {
103104 l = new(Layer)
104− l.content = content
105− height := Height(content)
106− width := Width(content)
107− l.rect = image.Rect(0, 0, width, height)
105+ l.SetContent(content)
108106 return l
109107}
110108
@@ -216,23 +214,56 @@ func (l *Layer) AddLayers(layers ...*Layer) *Layer {
216214}
217215
218216// SetContent sets the content of the Layer.
219−func (l *Layer) SetContent(content string) *Layer {
220− l.content = content
217+func (l *Layer) SetContent(content any) *Layer {
218+ var drawable uv.Drawable
219+ var rect image.Rectangle
220+ switch c := content.(type) {
221+ case uv.Drawable:
222+ drawable = c
223+ switch c := c.(type) {
224+ case interface{ Bounds() image.Rectangle }:
225+ rect.Max.X = c.Bounds().Dx()
226+ rect.Max.Y = c.Bounds().Dy()
227+ case interface {
228+ Width() int
229+ Height() int
230+ }:
231+ rect.Max.X = c.Width()
232+ rect.Max.Y = c.Height()
233+ }
234+ case fmt.Stringer:
235+ s := c.String()
236+ drawable = uv.NewStyledString(s)
237+ rect = image.Rect(0, 0, Width(s), Height(s))
238+ case string:
239+ drawable = uv.NewStyledString(c)
240+ rect = image.Rect(0, 0, Width(c), Height(c))
241+ default:
242+ s := fmt.Sprint(content)
243+ drawable = uv.NewStyledString(s)
244+ rect = image.Rect(0, 0, Width(s), Height(s))
245+ }
246+ l.content = drawable
247+ l.rect = rect
221248 return l
222249}
223250
224251// Content returns the content of the Layer.
225−func (l *Layer) Content() string {
252+func (l *Layer) Content() any {
226253 return l.content
227254}
228255
229256// Draw draws the Layer onto the given screen buffer.
230−func (l *Layer) Draw(scr uv.Screen, _ image.Rectangle) {
231− ss := uv.NewStyledString(l.content)
232− ss.Draw(scr, l.Bounds())
257+func (l *Layer) Draw(scr uv.Screen, area image.Rectangle) {
258+ if l.content == nil {
259+ return
260+ }
261+ l.content.Draw(scr, area.Intersect(l.Bounds()))
233262 for _, child := range l.children {
234− ss := uv.NewStyledString(child.content)
235− ss.Draw(scr, child.Bounds())
263+ if child.content == nil {
264+ continue
265+ }
266+ child.content.Draw(scr, area.Intersect(child.Bounds()))
236267 }
237268}
238269
vendor/modules.txt+4−4
@@ -253,7 +253,7 @@ github.com/charmbracelet/bubbles/v2/spinner
253253github.com/charmbracelet/bubbles/v2/textarea
254254github.com/charmbracelet/bubbles/v2/textinput
255255github.com/charmbracelet/bubbles/v2/viewport
256−# github.com/charmbracelet/bubbletea/v2 v2.0.0-beta.1 => github.com/charmbracelet/bubbletea-internal/v2 v2.0.0-20250710185017-3c0ffd25e595
256+# github.com/charmbracelet/bubbletea/v2 v2.0.0-beta.1 => github.com/charmbracelet/bubbletea-internal/v2 v2.0.0-20250716142813-5d1379f56ba2
257257## explicit; go 1.24.0
258258github.com/charmbracelet/bubbletea/v2
259259# github.com/charmbracelet/colorprofile v0.3.1
@@ -268,7 +268,7 @@ github.com/charmbracelet/glamour/v2
268268github.com/charmbracelet/glamour/v2/ansi
269269github.com/charmbracelet/glamour/v2/internal/autolink
270270github.com/charmbracelet/glamour/v2/styles
271−# github.com/charmbracelet/lipgloss/v2 v2.0.0-beta.3 => github.com/charmbracelet/lipgloss-internal/v2 v2.0.0-20250710185058-03664cb9cecb
271+# github.com/charmbracelet/lipgloss/v2 v2.0.0-beta.3 => github.com/charmbracelet/lipgloss-internal/v2 v2.0.0-20250716143013-48f34cb75679
272272## explicit; go 1.24.2
273273github.com/charmbracelet/lipgloss/v2
274274github.com/charmbracelet/lipgloss/v2/table
@@ -837,5 +837,5 @@ mvdan.cc/sh/v3/fileutil
837837mvdan.cc/sh/v3/interp
838838mvdan.cc/sh/v3/pattern
839839mvdan.cc/sh/v3/syntax
840−# github.com/charmbracelet/bubbletea/v2 => github.com/charmbracelet/bubbletea-internal/v2 v2.0.0-20250710185017-3c0ffd25e595
841−# github.com/charmbracelet/lipgloss/v2 => github.com/charmbracelet/lipgloss-internal/v2 v2.0.0-20250710185058-03664cb9cecb
840+# github.com/charmbracelet/bubbletea/v2 => github.com/charmbracelet/bubbletea-internal/v2 v2.0.0-20250716142813-5d1379f56ba2
841+# github.com/charmbracelet/lipgloss/v2 => github.com/charmbracelet/lipgloss-internal/v2 v2.0.0-20250716143013-48f34cb75679