Releases: bczsalba/pytermgui
v7.7.3: Maybe Windows input will work now
v7.7.2: The smallest update
This is mostly to bump documentation versions, as there are a few important clarifications in there.
Additions
- Stop allowing selection of closed Collapsible's items (337e780)
- Clarify some documentation
🚀
v7.7.1: Minor fixes pt.2
Really small update this time, mostly dealing with long-standing issues. Haven't had the time to work on any programming for a minute (a multiple-month spanning minute, at that), so apologies for it taking so long.
Additions
- Add support for wide characters
Bugfixes
- Fix
inline
widget referring tohover
mouse mode
🚀
v7.7.0: Minor fixes
v7.6.0: Fix 'er up!
Minor release to allow building our documentation.
Changelog
Bugfixes
- (temporarily) Fix hyperlinks breaking SVG exports
Removals
-
Remove (undocumented) shortening behaviour from
Button
(#124)Normally this would be considered an API breaking change, but since it was never documented (and didn't even work properly in most scenarios) it's only a minor-level change.
v7.5.0: Windows mouse support!
The standout feature from this update is finally getting windows mouse support working, courtesy of @Tired-Fox!
Changelog
Additions
- Add support for Windows' mouse events (@Tired-Fox, #122)
- Add support for feeding input into
getch
Refactor
- Allow immediately halting
WindowManager
programatically by not blocking ongetch
calls
Bugfixes
- Fix mouse event handlers not getting cleaned up properly
v7.4.0: Long overdue!
Lots and lots of things have happened since my previous time writing a release like this. It will all make sense soon (you can check my PyPi for a sneak peak!), but for the time being there's some changes to document.
Changelog
Additions
-
Add meta tokens for saving & restoring styles (bcf0a2e)
This adds the new meta tokens
#stash
,#pop
and their clearing-variants#stash/
and#/pop
, which allow you to save a snapshot of the currently applied styles and restore it at a later point within the same markup.It can be super useful for when you want to insert special styles for a single word.
[bold 141]This is an example with a [#stash/ @black grey]code-snippet [#/pop] in the middle.
-
Add support for alt/ctrl+backspace to remove whole words (@i404788, #109)
-
Add support for word move actions (Ctrl/Alt+/) & Home/End move (@i404788, #109)
Bugfixes
- Fix multiline Label widget to incorrectly display message with hyperlink (@leonard-IMBERT, #108)
- Fix input errors when alert is open (@qoft, #115)
Miscellaneous
v7.3.0: Document this!
The primary focus for this release is the new documentation, but there is a lot of minor changes that slipped through in the meantime. The new documentation is great; it has much more in-depth content on most parts of the library, it looks amazing and it's a lot less of a hassle to maintain! It also has build-time screenshot generation using this very module, so all the SVGs will always remain up to date.
Changelog
Additions
- Add support for
SHIFT+
scroll events (74722db) - Add shade number indicators to
Palette.print
(06f2ec7) - Add
inline
widget runner (ba19d36)
Bugfixes
- Fix incorrect macro caching behaviour (321f1f9)
- Fix various issues and misbehaviours with SVG exports
- Fix incorrect placement of
InputField
cursor (7281c57)
Refactors
-
New
MkDocs
based documentationWhile the previous documentation was alright, it missed a lot of things.
MkDocs
makes it a bit easier to create step-by-step style documentation pages, which was exactly what we needed. We also made use of Termage to make it a lot more dynamic. -
Change
terminal.py
->term.py
andserializer.py
->serialization.py
to avoid naming conflicts (e38603e) -
Improve pseudo token behaviour by parsing it as a new token type (f19b897)
-
Start generating semantic colors (success, warning, error) by blending with the primary (2daee90)
Removals
-
Remove
is_bindable
widget attribute (866cd09)This was only used as an arbitrary limitation, one that was not needed in the library.
Showcase
v7.2.0: Palettes and #auto!
This version brings the long-awaited (at least by myself) color palette system!
Before that, the new #auto
TIM pseudo-tag deserves a mention. It makes the parser look at the currently applied background color, and it is replaced with a color that properly contrasts it while parsing! This way, [alias #auto]Text
, will always be legible, regardless of the meaning of alias
. It is also automatically used by all widget styles (whenever there is no foreground specified), so you can just define a style as @surface+1
, and PTG will make sure it looks nice and readable!
Anyways, the palette. Here is the gist of it:
- The new module
palettes
provides aPalette
class - This class can generate mashing colors from just one primary color input, with multiple possible strategies
- The whole module now has a default palette that can be accessed using
ptg.palette
and in markup
TIM gains the following sets of new aliases:
primary
secondary
tertiary
accent
surface
surface2
surface3
surface4
success
warning
error
Each color has 7 shades, and each shade a foreground and background variant. The base color (i.e. with no shade modifications) use the name as written above, and every other alias is defined as {name}{+/-}{shade_amount}
, like primary-3
for the darkest shade of primary, and
surface+2for the second-brightest surface shade. Each alias comes complete with a background variant bound to
@{alias}`, such as @secondary+2
.
It's easier to show than tell, so here is the new default palette, as exported by ptg --palette --export-svg <filename>
:
Changelog
Additions
- Add various color manipulation utilities
- Add
#auto
TIM pseudo-tag that always gives properly contrasted foreground text - Add
palettes
module for framework-wide color generation & configuration - Add
Synchronized Output
support - Add
FancyReprWidget
- Add
ptg --palette
flag
Bugfixes
- Fix markup aliases getting literalized during
parsing.eval_alias
&MarkupLanguage.alias
- Fix background colors creating vertical seams in SVG exports
- Fix colors getting localized pre-maturely
Refactors
- Make all the
ptg
program & all builting widgets use the global palette - Prefix all ANSI colors with
ansi-
Showcase
Here is my home-grown project launcher, lens
, using the new default color palette (and an upcoming new button widget, but that's for the next release notes):
...and now, using it's custom-defined palette, using the primary color #58A46F
:
Here is ptg
in the new default color palette:
...and now with a bunch of randomly generated ones:
v7.1.0: Better InputField cursor!
This minor release mostly aims to fix up some issues caused in previous releases, as well as tighten up InputField
cursor behaviour.
Note that the release size of the project became enormous since the move to pyproject.toml
for building. This should be resolved by the next update.
Changelog
Additions
- Re-introduce
InputField
prompt attribute (#90)
Bugfixes
- Fix
ptg --version
(#89) - Start wrapping
InputField
cursor when it goes outside of the given width (634c1b5) - Fix incorrect
KeyboardButton
label generation (#88)
Showcase
Here is a sneak-peak of the upcoming update to the file-definition system, which will add things like selector-based targeting, native markup support and more!