Skip to content

Commit

Permalink
deploy: prepare deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
LeadcodeDev committed Oct 22, 2024
1 parent 4c6d6e6 commit 5810e28
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 2.2.1
- The ask component disappeared after the validation stage
- Calling `createSpace` method in all rendering cases for `ask` component
- Remove missing `print` statement in `readKey` function

# 2.2.0
- Add `select` display handler
- Fix bad FutureOr execution
Expand Down
22 changes: 8 additions & 14 deletions lib/src/application/components/ask.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ final class Ask<T> with TerminalTools implements Component<Future<T>> {
Future<T> handle() {
saveCursorPosition();

createSpace(_terminal, 1);

_defaultRendering();
_waitResponse();

Expand Down Expand Up @@ -87,6 +85,7 @@ final class Ask<T> with TerminalTools implements Component<Future<T>> {
SetStyles(Style.foreground(Color.brightBlack)),
]);

createSpace(_terminal, 1);
stdout.write(buffer.toString());
}

Expand All @@ -100,6 +99,8 @@ final class Ask<T> with TerminalTools implements Component<Future<T>> {
];

buffer.writeAnsiAll([
CursorPosition.restore,
Clear.afterCursor,
...errorSequence,
Print(_message),
if (_hasDefault) ..._baseDefaultSequence,
Expand All @@ -111,21 +112,14 @@ final class Ask<T> with TerminalTools implements Component<Future<T>> {
SetStyles(Style.foreground(Color.brightRed)),
Print(error),
SetStyles.reset,
CursorPosition.restore,
Clear.afterCursor,
]);

buffer.writeAnsiAll([
CursorPosition.restore,
Clear.afterCursor,
SetStyles(Style.foreground(Color.brightBlack)),
]);

createSpace(_terminal, 2);
stdout.write(buffer.toString());

stdout.writeAnsiAll([
const CursorPosition.moveUp(1),
const CursorPosition.moveRight(2),
SetStyles(Style.foreground(Color.brightBlack)),
]);

_waitResponse();
Expand All @@ -142,17 +136,17 @@ final class Ask<T> with TerminalTools implements Component<Future<T>> {
];

buffer.writeAnsiAll([
CursorPosition.restore,
Clear.afterCursor,
...successSequence,
Print(_message),
Print(' '),
SetStyles(Style.foreground(Color.brightBlack)),
Print(_hidden ? '******' : response),
SetStyles.reset,
AsciiControl.lineFeed,
CursorPosition.restore,
Clear.afterCursor,
]);

createSpace(_terminal, 1);
stdout.write(buffer.toString());

_completer.complete(response as T);
Expand Down
1 change: 0 additions & 1 deletion lib/src/application/utils/terminal_tools.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ mixin TerminalTools {
_ensureTerminalAttached();
terminal.enableRawMode();
final key = _readKey();
print(key.controlChar);
terminal.disableRawMode();

if (key.controlChar == ControlCharacter.ctrlC) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: commander_ui
description: Commander is a Dart library for creating user interfaces within the terminal.
version: 2.2.0
version: 2.2.1
repository: https://github.com/LeadcodeDev/commander

topics:
Expand Down

0 comments on commit 5810e28

Please sign in to comment.