v2.0.0-beta.2
Pre-releaseSo Hot Right Now: Lip Gloss v2 Beta 2
This release builds on top of the last beta 1 release. It includes a new API for compositing layers and views, table enhancements, and a bunch of bug fixes. Let's get into it!
Compositing
The big news in this release is compositing. Here's what it looks like:
box := lipgloss.NewStyle().
Width(10).
Height(5).
Border(lipgloss.NormalBorder())
// Make some layers.
a := lipgloss.NewLayer(box.Render("Who wants marmalade?"))
b := lipgloss.NewLayer(box.Render("I do!"))
// Put layers in a canvas.
canvas := lipgloss.NewCanvas(
a.X(5).Y(10).Z(1),
b.X(3).Y(7)
)
// Render it all out.
lipgloss.Println(canvas.Render())
Also note that layers can also be nested (see Layer.AddLayers
).
Otherwise, that’s all there is to it!
For more info see Layer
, Canvas
, and the compositing example.
Table Enhancements
Tables are one of the most beloved Charm components, and we've been working to
make them as polished as possible. In this release several bugs were fixed,
and many other rendering enhancements were made. You can check most of the fixes
on #526.
We're also refactoring the Bubbles' table component to use the Lip Gloss' table package, and making their APIs similar, as before they were relatively different. This means that if you use Tables via Bubbles in your Bubble Tea app, you'll be able to reap the benefits soon too!
Changelog
New Features
- ad4ad6d: feat(examples): add clickable example (@aymanbagabas)
- c20d404: feat(examples): clickable: make it "pure" (@aymanbagabas)
- 2790cd0: feat(table): add
BaseStyle
to set background color for the whole table (#519) (@andreynering) - e2227d9: feat(table): add some extra getters needed on bubbles (@andreynering)
- 488eb37: feat(table): expose getters for borders (@andreynering)
- 587de15: feat(table): further enhance and fix table height handling (@andreynering)
- 4b89e65: feat(table): rework height rendering logic to fix related bugs (@andreynering)
- 6002441: feat: export
GetHeaders
,GetData
andDataToMatrix
(@andreynering) - 75c0569: feat: initial compositing implementation (@aymanbagabas)
- 2c4751e: feat: initial compositing implementation (#471) (@meowgorithm)
Bug fixes
- 9ae54a0: fix(border): fix returned border sizes when only style was set (@andreynering)
- c80afba: fix(canvas): negative coordinates calculation (@aymanbagabas)
- c201d59: fix(lint): GoDoc (@meowgorithm)
- f274d05: fix(lint): fix linting issues after golangci-lint v2 upgrade (@andreynering)
- 1427d82: fix(table): add tests + fix scenario of offset + manual table height (@andreynering)
- c0f4b07: fix(table): do not print final empty row when overflow (@andreynering)
- bc517ae: fix(table): fix headers with custom vertical padding (@andreynering)
- baa7611: fix(table): fix horizontal shrink with outline borders only (@andreynering)
- 63e53c1: fix(table): fix layout for tables with inner borders only (@andreynering)
- c6b946e: fix(table): fix panic when style func is
nil
(#508) (@andreynering) - a3d464b: fix(table): fix rendering for bordered cells (@andreynering)
- b36834a: fix(table): improve height handling for cells with vertical padding (@andreynering)
Documentation updates
- e9f399e: docs(example): add compositing example (#544) (@meowgorithm)
- fabe514: docs(examples): add compositing to layout example (@meowgorithm)
- 4781de2: docs(examples): update Bubble Tea examples to use new API (@aymanbagabas)
- 946081c: docs(table): document that headers are never wrapped (@andreynering)
Other work
- 7edbc41: ci: fix linting (@andreynering)
- c7f615e: ci: fix new lint issues after golangci-lint v2 upgrade (#510) (@andreynering)
- d102bea: ci: sync golangci-lint config (#509) (@github-actions[bot])
- 40640fe: refactor: modernize loops (@andreynering)
- 23e0f7f: refactor: v2 rename offset (#512) (@bashbunni)
How’s it going?
Feel free to reach out, ask questions, give feedback, and let us know how it's going. We’d love to know what you think.
Part of Charm.
Charm热爱开源 • Charm loves open source • نحنُ نحب المصادر المفتوحة