Commit Graph

32 Commits

Author SHA1 Message Date
Michael Lorant
d0be07ea6b
chore(deps): Upgrade dependencies (#279)
Upgrade dependencies to latest stable versions.

As part of this dependency upgrade, the `term` package is being updated
to include an important fix for wrapping strings containing ANSI codes.
See charmbracelet/x/issues/58 for more details.

Signed-off-by: Michael Lorant <michael.lorant@nine.com.au>
2024-04-13 13:28:30 -04:00
Ayman Bagabas
2434fdaf07
fix: combining both conditional and unconditional wrapping (#275)
* feat: switch to term/ansi for text manipulation

Use ANSI aware, wide characters support, uniseg backed term/ansi package
to calculate string widths, truncate, and wrap strings.

Related: https://github.com/muesli/reflow/pull/71
Fixes: https://github.com/charmbracelet/lipgloss/issues/258
Fixes: https://github.com/charmbracelet/lipgloss/issues/220

* fix: combining both conditional and unconditional wrapping

Uses `ansi.SmartWrap` https://github.com/charmbracelet/x/pull/57

Fixes: https://github.com/muesli/reflow/issues/43

* chore: update deps

* Update get.go
2024-03-29 15:14:02 -04:00
Ayman Bagabas
f6f93348b0
feat: switch to term/ansi for text manipulation (#268)
* feat: switch to term/ansi for text manipulation

Use ANSI aware, wide characters support, uniseg backed term/ansi package
to calculate string widths, truncate, and wrap strings.

Related: https://github.com/muesli/reflow/pull/71
Fixes: https://github.com/charmbracelet/lipgloss/issues/258
Fixes: https://github.com/charmbracelet/lipgloss/issues/220

* Update get.go
2024-03-29 15:05:18 -04:00
Ayman Bagabas
f16ea2bdcb feat(table): replace stripansi with ansi.Strip
Use term/ansi to strip out ANSI sequences
2024-03-25 09:03:15 -04:00
dependabot[bot]
652c37dd07
feat(deps): bump github.com/rivo/uniseg from 0.4.6 to 0.4.7 (#262)
Bumps [github.com/rivo/uniseg](https://github.com/rivo/uniseg) from 0.4.6 to 0.4.7.
- [Release notes](https://github.com/rivo/uniseg/releases)
- [Commits](https://github.com/rivo/uniseg/compare/v0.4.6...v0.4.7)

---
updated-dependencies:
- dependency-name: github.com/rivo/uniseg
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-02 14:48:57 -05:00
Michael Lorant
2745d8a3d8
Improve maximum width of characters in a string (#257)
The function `maxRuneWidth` was using a flawed approach by only
evaluating strings based on each rune. The `uniseg` package provides a
more accurate method based on grapheme clusters.

This change switches over to the improved implementation which should
achieve better results when determining the maximum width of all
grapheme clusters in a string.

Signed-off-by: Michael Lorant <michael.lorant@nine.com.au>
2024-02-13 10:03:24 -05:00
Michael Lorant
de4601232b
Fix truncate of table cells containing ANSI (#256) 2024-02-02 19:04:43 -05:00
Maas Lalani
f093bc1509
Make headers []string (#234)
* fix: make headers `[]string`

* downgrade Lip Gloss to 1.17
2023-10-12 00:53:13 -04:00
Maas Lalani
4476263d05
Feature: Tables (#218)
* feat: tables

* fix(table): examples

* docs(table): `any` -> `string`

* chore: go mod tidy

* docs(table): update image

* fix(table): lint

* fix: remove binary

* chore: color adjustments to pokemon example (#231)

* fix(table): support rendering empty data sets

* chore(table): simplify table's data interface

* fix(table): correct GoDoc + add doc comments to Data methods

---------

Co-authored-by: Christian Rocha <christian@rocha.is>
Co-authored-by: Christian Muehlhaeuser <muesli@gmail.com>
2023-10-10 10:27:52 -04:00
dependabot[bot]
b766f24d45
feat(deps): bump github.com/mattn/go-runewidth from 0.0.14 to 0.0.15 (#215)
Bumps [github.com/mattn/go-runewidth](https://github.com/mattn/go-runewidth) from 0.0.14 to 0.0.15.
- [Commits](https://github.com/mattn/go-runewidth/compare/v0.0.14...v0.0.15)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-runewidth
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-05 12:01:04 -04:00
Carlos Alexandro Becker
3556cdfa89
feat(deps): update termenv (#202)
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-27 12:07:45 -03:00
Christian Muehlhaeuser
c43b22e00f chore: bump termenv to v0.15.1 2023-03-09 19:54:32 +01:00
Ayman Bagabas
b3440ac41f feat(go): bump termenv to v0.15 2023-03-08 09:54:27 -08:00
Ayman Bagabas
4eea195dfa feat(go): upgrade golang to 1.17
feat(examples): upgrade golang to 1.17
2023-03-07 16:44:08 +01:00
Ayman Bagabas
31ab45f810 feat: instantiate lipgloss renderers
* Use lipgloss instances instead of a singleton global instance
* Deprecate (s Style).Render & (s Style).String
* Deprecate the Stringer interface
* Update README and godocs
* Update example
2023-02-09 11:59:54 -05:00
Carlos A Becker
f754c404f6 fix: reduce dependencies
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2023-02-09 11:59:54 -05:00
Carlos A Becker
14eeaa6ffa fix: reduce dependencies
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2023-02-03 12:14:45 +01:00
dependabot[bot]
c85c4f4456 feat(deps): bump github.com/stretchr/testify from 1.8.0 to 1.8.1
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.0...v1.8.1)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-25 03:14:22 +02:00
dependabot[bot]
ae7c84f7b1 feat(deps): bump github.com/mattn/go-runewidth from 0.0.13 to 0.0.14
Bumps [github.com/mattn/go-runewidth](https://github.com/mattn/go-runewidth) from 0.0.13 to 0.0.14.
- [Release notes](https://github.com/mattn/go-runewidth/releases)
- [Commits](https://github.com/mattn/go-runewidth/compare/v0.0.13...v0.0.14)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-runewidth
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-30 08:44:01 +02:00
dependabot[bot]
5c31e2f6ab feat(deps): bump github.com/stretchr/testify from 1.7.1 to 1.8.0
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.1 to 1.8.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.7.1...v1.8.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-30 08:37:07 +02:00
Christian Muehlhaeuser
681d473622 test: add Style tests 2022-09-30 05:14:18 +02:00
Christian Muehlhaeuser
bf2912e703 Bump termenv dependency 2022-02-04 05:13:08 +01:00
Christian Muehlhaeuser
024177a630 Bump termenv to v0.11.0 2022-01-31 22:31:00 +01:00
Christian Muehlhaeuser
7ec01f7542 Bump termenv to v0.10.0 2022-01-28 16:17:21 +01:00
Christian Rocha
4b96343a09 go mod tidy 2021-07-01 09:28:51 -04:00
Christian Rocha
093474ebdf Bump termenv to v0.9.0 2021-07-01 09:28:51 -04:00
Christian Rocha
c66ed10823
Bump go-runewidth to v0.0.13 2021-06-02 18:30:46 -04:00
Christian Rocha
8a64d5c381 Bump go-runewidth to fix some emoji mis-measuring 2021-04-29 09:59:44 -04:00
Christian Muehlhaeuser
21f16e8487
Bump termenv to v0.8.1 2021-04-03 00:19:05 +02:00
Christian Muehlhaeuser
24fb120f9e Bump termenv to v0.8.0 2021-03-18 23:58:06 +01:00
Christian Rocha
9b1445b6f5
go mod tidy 2021-03-03 19:00:51 -05:00
Christian Rocha
5c53233775
Initial commit. Add the nuts and bolts. 2021-03-01 18:29:00 -05:00