Skip to content

Releases: Im-Beast/deno_tui

Deno TUI 0.5 – RC

05 Jan 13:52
9021b1c
Compare
Choose a tag to compare
Deno TUI 0.5 – RC Pre-release
Pre-release

Changelog

  • Added missing JSDocs
  • createTui now accepts reader and writer in options argument
  • Added:
    • Debug mode which disables rendering to terminal
      • Can be toggled using setDebugMode function
    • New events
      • update which fires before tui/component is drawn
      • createComponent and removeComponent which fire to tui, parent and component itself when its created/removed.
  • LabelComponent now takes value property which contains text and align properties
  • Frames are now not inherited from styler property, instead they can be assigned using frame property in components that supported framing
  • FrameComponent now supports rounded corners via rounded property
  • Moved refreshRate from property of Tui to argument of loopDrawing function
  • Mostly replaced usage of Dynamic properties in favor of getters and setters
  • Created components now preserve getters and setters applied to options/extension
  • Fix NO_COLOR support crashing in edge cases

Changes needed to make previous code work with this version

  • Tui now takes reader and writer as properties in option
- const tui = createTui(Deno.stdin, Deno.stdout, {
+ const tui = createTui({
+ reader: Deno.stdin,
+ writer: Deno.stdout,
  styler: tuiStyler,
});
  • previous draw function has been renamed to loopDrawing
+ loopDrawing(tui);
- draw(tui);
  • Replace dynamic component/tui properties with getters
const component = createComponent({
...,
- rectangle() {
+ get rectangle() {
    ...
 },
});
  • Using getStaticValue is now redundant in most of cases
-  const rectangle = getStaticValue(component.rectangle);
+  const rectangle = component.rectangle;
  • Remove frame property from styler and apply frame property to components that support it
const styler = compileStyler<TuiStyler>({
    foreground: "black",
    background: "lightCyan",
  },
-  frame: {
-    foreground: "white",
-    background: "black",
-  },
});

+ const frameStyler = compileStyler<TuiStyler>({
+   foreground: "white",
+   background: "black",
+ });

+ const frame = {
+  enabled: true,
+  styler: frameStyler,
+ };

const componentThatNeedsFrame = createComponent(..., {
  ...,
+  frame,
);
  • Replace menuItem and menuList with button and combobox respectively.
- createMenuList(menu, {
-   label: "File",
+ createCombobox(menu, {
+   label: {
+    text: "File",
+  },
  items: ["Open", "Save", "Close"],
+  expandItemsWidth: true,
});

- const help = createMenuItem(menu, {
-   label: "Help",
+ const help = createButton(menu, {
+   label: {
+     text: "Help",
+   },
});
  • textAlign and text properties have been moved to label property in components and value property in LabelComponent
createButton(..., {
  ...,
-  label:
-    `Some text`,
+  label: {
+    text:
+      `Some text.`,
+  },
});

createLabel(..., {
  ...,
-  text: "Some text",
-  textAlign: {
-    vertical: "top",
-    horizontal: "left",
+  value: {
+    text: "Some text",
+    align: {
+      vertical: "top",
+      horizontal: "left",
+    },
+  },
});

Deno TUI 0.4

19 Dec 15:15
04f653a
Compare
Choose a tag to compare
Deno TUI 0.4 Pre-release
Pre-release

Changelog

  • Fixed typings for AnyStyler, creating styler using compileStyler whilst using other object as a base now works as expected
  • unload event is now dispatched on SIGINT signal
  • Mouse handler should now respect only left mouse click for focusing and activating components
  • Canvas CPU usage should now be lower
  • Improved TextboxComponent multiline controls
  • Tests
    • Tests no longer share imports
    • emptyChanges rendering test has been removed as it's impractical
    • External actions (modules used to execute outside of test) has been moved to tests/actions directory
  • Most of the documentation should be done.

All changes should be backwards compatible with 0.3

Deno TUI 0.3

12 Dec 11:44
Compare
Choose a tag to compare
Deno TUI 0.3 Pre-release
Pre-release

Changelog

  • Fixed combobox z-fighting.
  • Move drawing FPS counter from tui.ts to example.ts
  • Added NO_COLORS support
  • Removed unused functions
  • Removed draw and stopDrawing from TuiInstance
    • Added new exported draw function which draws TuiInstance
    • Draw function doesn't get called automatically anymore
  • Greatly improved keyboard controls
  • Added mouse controls
    • key_reader.ts now supports MousePresses
  • Moved given functionality to more proper locations
    • handleKeypresses: keyboard.ts -> key_reader.ts
  • Improve exiting script whilst rendering
  • Added tests for modules in src/.
  • Fixed EventEmitter not working as expected

Changes needed to make previous code work with this version

- tui.draw();
+ draw(tui);

Deno TUI 0.2.1

28 Nov 19:54
01c6016
Compare
Choose a tag to compare
Deno TUI 0.2.1 Pre-release
Pre-release

Changelog

  • Added license headers
  • Added basic JSDoc for important things

Deno TUI 0.2.0

27 Nov 16:20
6a56518
Compare
Choose a tag to compare
Deno TUI 0.2.0 Pre-release
Pre-release

Changelog

  • Box component now supports frame in styler
    • Because of this change code of button and textbox have been cleaned a little
  • Added menuList component
  • Improved textBox component
    • Added support for multiline
    • value property now takes string[] instead of string
  • Supposedly fixed issue that caused child to not inherit parents styler
  • New demo has been created
  • Normalized naming scheme
    • Components that accepted text property for automatically creating label for them now use label
  • Fixed bug which caused textbox cursor to reveal hidden text
  • Canvas should have lower CPU usage (probably still can be improved)
  • Rendering framerate should be now more stable
  • TuiInstance.restartDrawing got removed
  • compileStyler now respects bg colors.

Changes needed to make previous code work with this version

  • Replace text properties for label
  • Whenever you use value property of textbox be sure to join it with newlines textbox.value.join("\n").

Deno TUI 0.1.0

24 Nov 21:53
Compare
Choose a tag to compare
Deno TUI 0.1.0 Pre-release
Pre-release

Changelog

  • Massive rendering overhaul
    • New canvas and colors API
      • When smartRender in canvas is set only changed parts of the screen are redrawn
        • H u g e performance gain
      • Instead of using crayon.js TUI uses new colors module which precompiles styles
    • Drawing full-width characters is now supported
    • frame_buffer.ts module has been removed and replaced fully with canvas.ts
  • Reactivity improvements
    • styler property in TuiInstance and TuiComponent's can now be dynamic
      • Remember to use it only when reference to the object changes
  • Fixed broken key reader (missing setRaw line)
  • From this point on API changes shouldn't be that radical

Changes needed to make previous code work with this version

- const mainStyler: TuiStyler = {
- foreground: "white",
- ...
- };
- const componentStyler: TuiStyler = {
-  ...mainStyler,
-  background: "blue",
- };
+ const mainStyler = compileStyler<TuiStyler>({
+ foreground: "white",
+ ...
+ });
# You could potentially use compileStyler here too.
+ const componentStyler: TuiStyler = {
+ ...mainstyler,
+ background: keyword("bgBlue"),
+ });

Deno TUI 0.0.5

19 Nov 16:25
Compare
Choose a tag to compare
Deno TUI 0.0.5 Pre-release
Pre-release
  • Further reactivity improvements
    • Dynamic generic type, used for creating dynamic types
    • getStaticValue function used to get static value from dynamic type
    • menuItem components are now dynamic
  • Frame now has easy way to add label
  • New way to create components
    • New ExtendedTuiComponent generic type
      • Used to create types for components that are expected to have properties other than regular TuiComponent type
  • This provides better type checking and doesn't create unnecesarily more components

Example of creating new component – brief showcase, not full code

+ export type CheckboxComponent = ExtendedTuiComponent<
+  "checkbox",
+  {
+    value: boolean;
+  },
+  "valueChange",
+  boolean
+ >;
+
+ const checkbox: CheckboxComponent = createComponent("checkbox", CreateComponentOptions, {
+   value: false,
+ });
- export interface CheckboxComponent
-   extends TuiComponent<"valueChange", boolean> {
-   value: boolean;
-  }
-
- const checkbox: CheckboxComponent = {
-  ...createComponent("checkbox", CreateComponentOptions),
-  value: false
- }

Deno TUI 0.0.4

11 Nov 21:44
Compare
Choose a tag to compare
Deno TUI 0.0.4 Pre-release
Pre-release
  • New Deno.addSignalListener API
  • Code unification (using for...of)
  • Got rid of some useless typings
  • You're now able to use functions that return string in text property of labels to make them dynamic

Deno TUI 0.0.3

28 Oct 10:12
Compare
Choose a tag to compare
Deno TUI 0.0.3 Pre-release
Pre-release
  • Fixed some styling and rendering issues
  • Added menu and menuItem components

Deno TUI 0.0.2

26 Oct 14:56
Compare
Choose a tag to compare
Deno TUI 0.0.2 Pre-release
Pre-release
  • Major code refactor