Commit Graph

342 Commits

Author SHA1 Message Date
Ayman Bagabas
1d7f25cf54
fix: colorize style when writer profile matches 2024-07-16 14:50:01 -04:00
Ayman Bagabas
b0e450a987
Merge branch 'master' into writer 2024-07-16 14:47:30 -04:00
Ayman Bagabas
e78ed63763
refactor: remove unused and move to adaptive subpackage 2024-07-16 13:55:31 -04:00
Christian Rocha
87dd58def7
chore: fix little typo in comment in go.mod 2024-07-12 12:18:25 -04:00
Ayman Bagabas
670898dc36
chore: retract v0.11.1 2024-07-12 12:15:50 -04:00
Ayman Bagabas
1b3672b319
chore: upgrade x/ansi to v0.1.4
Fixes: https://github.com/charmbracelet/lipgloss/discussions/332
2024-07-12 12:13:19 -04:00
Maas Lalani
6348d5941f
docs: list documentation (#331) 2024-07-11 17:32:15 -04:00
Maas Lalani
2a6767080f
Drop Tree (#330)
* fix: move tree to internal

* feat: tree indenter on lists

* fix: sublist example

* fix: remove tree
2024-07-11 17:23:29 -04:00
Ayman Bagabas
95644230eb
feat(ci): use goreleaser for releases (#301)
* feat(ci): use goreleaser for releases

This will publish and announce releases on tag push.

* chore: remove announce
2024-07-10 10:07:35 -04:00
Ayman Bagabas
e6edbaca76
chore: bump x/ansi to v0.1.3
Fixes: https://github.com/charmbracelet/lipgloss/issues/324
2024-07-10 09:58:42 -04:00
Ayman Bagabas
29cf61c9fd
wip 2024-07-10 09:56:32 -04:00
Ayman Bagabas
e706b58a89
feat: implement adaptive sub-package for adaptive colors 2024-06-21 18:22:26 -04:00
Ayman Bagabas
d210adb2b0
feat: use pure styles 2024-06-21 18:22:01 -04:00
Christian Rocha
5a82e41aea chore: update CODEOWNERS 2024-06-18 16:16:32 -04:00
Ayman Bagabas
c1d03fb049
feat: implement stringwriter 2024-06-14 15:44:14 -04:00
Ayman Bagabas
db791fae70
feat: lipgloss writer
Instead of using fmt.Printf to write out rendered styles, we supply our
own writer and implementation that parses the rendered ansi and degrades
colors as needed.
2024-06-14 15:41:35 -04:00
Florian Rey
33b3263db7 fix: Deprecate UnsetBorderTopBackgroundColor in favor of UnsetBorderTopBackground 2024-06-08 13:42:55 -04:00
Ayman Bagabas
a724723338
Merge branch 'master' into beta 2024-06-05 11:12:53 -04:00
Christian Rocha
bbd02ab316
chore(ci): also build examples (#310)
* chore(ci): also build examples
* fix(examples): fix tree styles example
* fix: ssh examples dependencies
* chore: use creack/pty
* chore(examples): update deps
* chore(examples): bump examples (and ci) to 1.19 so a slog dep will build

---------

Co-authored-by: Ayman Bagabas <ayman.bagabas@gmail.com>
2024-06-04 15:26:11 -04:00
Christian Rocha
7838b4e195 feat: deprecate Style.ColorWhitespace
You can get the exact same effect with margins and padding.
2024-05-31 13:28:32 -04:00
Christian Rocha
e54d9dd05a fix(tree): examples 2024-05-31 12:54:58 -04:00
Maas Lalani
878d31f064
fix: sublist example, minor edits 2024-05-31 11:45:23 -04:00
Maas Lalani
6e07abb123
refactor: use lipgloss copy for example (#308) 2024-05-30 18:37:17 -04:00
Christian Rocha
70c908de3e
chore: remove deprecated Copy() calls (#306)
Co-authored-by: Maas Lalani <maas@lalani.dev>
2024-05-30 17:57:06 -04:00
Maas Lalani
1afeca0d80
Tree API Changes (#307)
* refactor: clean tree_test.go

* refactor: remove subtests

* refactor: rename `Data` to `Items` for `Lists` and `Children` for `Trees`

* chore: support only NodeData

* fix: enumerations -> enumerators for consistency

* fix: item -> children

* fix: use l for List, rather than n

* fix: move list Enumerator definition to enumerator.go

* fix: list enumerator comments

* docs: add package documentation

* fix: examples

* feat: split enumerator and indenters

* docs: add comments

* refactor: package comment

* docs: use more tree terminology

* docs: refactor indentor comments

* fix: lint
2024-05-30 17:11:28 -04:00
Ayman Bagabas
972c013da1
fix: check color nil 2024-05-28 13:28:26 -04:00
Ayman Bagabas
9f57d00c5c
fix: export DefaultOutput 2024-05-24 11:21:21 -04:00
Carlos Alexandro Becker
d21c576fdf
feat: trees and lists (#264)
* feat: implement list renderer

* feat: data model for list

* feat: add Offset, Height, Indent

* feat: tree renderer

* fix: list example

* test: last tree node is a subtree

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: tree

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: lint

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* docs: example

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* test: inc cov

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: multiline items

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* feat: one approach to sublists

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: tree improvements

* wip

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* wip

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* wip

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* wip

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: prevent having to pass renderer to all trees

* test: force linux line endings

* fix: windows

* fix: lint issues

* fix: ignore lint issue failing forever

* fix: renames

* fix: renderer

* ci: fix coveralls hopefully

* wip

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: style

* docs: update

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: renderer

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* test: cover with tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* feat: more list enumerators

* fix: drop renderer api

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* feat: improve api

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: prealloc

* fix: clean up

* fix: list setup

* fix: improve sublist tests

* fix: improve sublists

* refactor: simplify

* docs: more examples, readme updates

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* docs: readme

* fix: set item style

* fix(tree): do not use golden files

* test: do not use golden files

* refactor: remove unused code

* feat: hide nodes

* feat: filter

* fix: allow fmt.Stringer

* test: table within a tree

* docs: update

* fix: rename atter to data

* test: test public api only

* docs: sublist with table example

* docs: update example

* fix: lint issues

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* docs: update examples

* docs: update

* feat: offset

* feat: offsetstart && offsetend

* fix: remove last from enumerator

* refactor: make tree more explicit

* `New()` now take no args
* added a new `Root(string)` method
* added a new `Items(...any)` method

* refactor: improve list

* docs: fix examples

* test: ensure embed lists in trees

* docs: sublist example with list as tree node

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* refactor: first pass at examples cleanup

* refactor: first pass at examples cleanup

* fix: support multi-line prefixes

* test: more glow-style lists within trees

* docs: simplify examples

* fix: improve handling of different types

* chore: go mod tidy

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: code review suggestions

Co-authored-by: Ayman Bagabas <ayman.bagabas@gmail.com>
Co-authored-by: bashbunni <15822994+bashbunni@users.noreply.github.com>

* fix: apply code review suggestion

* feat(tree): rounded enumerator (#280)

* chore(examples): go mod tidy

* feat(tree): add rounded corner enumerator

* test: rounded enumerator test

* docs: readme updates

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* docs: readme updates

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* chore: fmt

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* docs: godoc

* docs: godoc

* fix: bash's issue

* fix: bad example

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* docs: improve godoc for trees and lists (#296)

* docs(godoc): add overview

* docs(godoc): include examples in godoc

* docs(godoc): fix roman numerals example

* docs(godoc): fix tree examples

* docs(godoc): attempt to fix list Enumerator examples

* docs: added some examples to godoc

* fix(list): New(items...) with sublist

* docs: update examples

* chore(tree): improve var names in rounded example

* fix: use padding instead of margin to better styles

* fix: lint

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Maas Lalani <maas@lalani.dev>
Co-authored-by: Ayman Bagabas <ayman.bagabas@gmail.com>
Co-authored-by: bashbunni <15822994+bashbunni@users.noreply.github.com>
Co-authored-by: Christian Rocha <christian@rocha.is>
2024-05-24 12:02:18 -03:00
Tanish Azad
5cd858cbff
fix: respect UnderlineSpaces and StrikethroughSpaces (#299)
* fixed boolean logic related to spaces styling

* cleanup

* added tests

* fixed tests
2024-05-22 12:13:55 -04:00
Ayman Bagabas
c91ab3ea94
chore(ci): enable gofumpt 2024-05-22 11:45:37 -04:00
Ayman Bagabas
1969fb54fe
refactor: remove defaults package and use sync.Once 2024-05-15 16:15:29 -04:00
Ayman Bagabas
e4ce38c62d
Merge branch 'master' into proposal-v2-exp 2024-05-15 15:01:56 -04:00
Ayman Bagabas
83fa9be7fe
chore: use x/ansi instead of exp/term 2024-05-15 14:59:47 -04:00
Ayman Bagabas
88ecbb3984
fix: remove log 2024-05-14 13:23:55 -04:00
Ayman Bagabas
9a1d854f90
fix: return color 2024-05-14 13:21:33 -04:00
Ayman Bagabas
4de43222e2
feat: conform to color.Color and add RGBColor and color consts 2024-05-14 12:35:50 -04:00
Ayman Bagabas
d059cfa7d6
fix: DetectColorProfile takes a writer 2024-05-13 16:55:13 -04:00
dependabot[bot]
ce5323ee41
chore(deps): bump golangci/golangci-lint-action from 5 to 6 (#290)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 5 to 6.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v5...v6)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13 11:09:26 -03:00
Ayman Bagabas
a6dc2ab509
chore: update x/term 2024-05-10 16:38:06 -04:00
Ayman Bagabas
ac39caa8c9
feat!: purify lipgloss Style 2024-05-10 13:26:57 -04:00
Ayman Bagabas
61f326cff0
Merge branch 'master' into use-ansi-style 2024-05-09 15:20:57 -04:00
Ayman Bagabas
e3596ae70d chore(ci): test for different GOOS & GOARCH 2024-05-09 13:23:31 -04:00
Hugo Leonardo Costa e Silva
2fe044adcb fix: Change the propkeys from int to int64
When I create binaries for each OS using goreleaser, the propKeys
generates an int overflow since the iota duplicates for each propKey

This commit changes the int type to works well with binaries generated
for arm and i386 archs.
2024-05-09 12:20:39 -04:00
Christian Rocha
3ee5dcab73 chore(docs): doc updates with regard to style.Copy() deprecation 2024-05-06 16:27:54 -04:00
Ayman Bagabas
517b1a163e
fix: remove unused type 2024-05-06 09:16:14 -04:00
Ayman Bagabas
d2795c783a
refactor: replace props map with struct fields (#276)
Use an int to store property existence and style struct fields to store
the actual values for each non-bool property.

Fixes: https://github.com/charmbracelet/lipgloss/pull/139
Fixes: https://github.com/charmbracelet/lipgloss/pull/141
2024-05-02 13:36:30 -04:00
Christian Rocha
c986440c2a
chore(lint): remove deprecated ifshort linting option 2024-05-01 15:59:54 -04:00
Christian Rocha
e35d216358
chore(lint): end comments with periods 2024-05-01 15:59:30 -04:00
Christian Rocha
9f111af5aa
chore(lint): add nolint directives 2024-05-01 15:59:11 -04:00
Ayman Bagabas
2b58c4b607
Merge branch 'master' into who-needs-copy 2024-05-01 15:04:00 -04:00