Skip to content

Commit

Permalink
v4.2.0 - Preview-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando Cerqueira committed Oct 20, 2023
1 parent e1c4c61 commit 186e4d5
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 40 deletions.
21 changes: 21 additions & 0 deletions Licenses/LICENSE-EastAsianWidthDotNet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Atsushi Nakamura

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions PromptPlus.sln
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AlternateScreenSamples", "S
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Licenses", "Licenses", "{ADBB4294-4DC0-43FC-A57A-4C2F9BDB68A8}"
ProjectSection(SolutionItems) = preProject
Licenses\LICENSE-EastAsianWidthDotNet.md = Licenses\LICENSE-EastAsianWidthDotNet.md
Licenses\LICENSE-FIGlet.md = Licenses\LICENSE-FIGlet.md
Licenses\LICENSE-SpectreConsole.md = Licenses\LICENSE-SpectreConsole.md
Licenses\LICENSE-xmldoc2md.md = Licenses\LICENSE-xmldoc2md.md
Expand Down
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@
- Optimize resource usage in rendering (less cultural dependency)
- Improvement :
- Reinforce the validation of invalid or optional parameters in all controls
- Improvement :
- Remove code copy (MIT license) from other project and applied package (for lower maintenance)
- Documentation:
- Examples of snapshot controls updated to reflect layout changes and reduced image size (faster page loading)
- Reviewed credit references and licenses
- Renamed command:
- 'DescriptionWithInputType' to 'ShowTipInputType'.
- Now extra-line to tip InputType
Expand Down Expand Up @@ -544,20 +549,22 @@ See the [Contributing guide](CONTRIBUTING.md) for developer documentation.

PromptPlus **<u>includes code(Copy)</u>** from other software released under the **MIT license**:

- [Spectre.Console](https://spectreconsole.net/), Copyright (c) 2020 Patrik Svensson, Phil Scott, Nils Andresen.
- [FIGlet](https://github.com/auriou/FIGlet), Copyright (c) 2014 Philippe AURIOU
- [Spectre.Console](https://spectreconsole.net/), Copyright (c) 2020 Patrik Svensson, Phil Scott, Nils Andresen. See [LICENSE](Licenses/LICENSE-SpectreConsole.md).
- [FIGlet](https://github.com/auriou/FIGlet), Copyright (c) 2014 Philippe AURIOU. See [LICENSE](Licenses/LICENSE-FIGlet.md).
**EastAsian width generated by package**

- [EastAsianWidthDotNet](https://github.com/nuitsjp/EastAsianWidthDotNet), Copyright (c) 2020 Atsushi Nakamura. See [LICENSE](Licenses/LICENSE-EastAsianWidthDotNet.md).
**API documentation generated by**

- [xmldoc2md](https://github.com/FRACerqueira/xmldoc2md), Copyright (c) 2022 Charles de Vandière.
- [xmldoc2md](https://github.com/FRACerqueira/xmldoc2md), Copyright (c) 2022 Charles de Vandière. See [LICENSE](Licenses/LICENSE-xmldoc2md.md).
## License
[**Top**](#table-of-contents)

Copyright 2021 @ Fernando Cerqueira

PromptPlus is licensed under the MIT license. For more information see [LICENSE](https://github.com/FRACerqueira/PromptPlus/blob/master/LICENSE).
PromptPlus is licensed under the MIT license. See [LICENSE](https://github.com/FRACerqueira/PromptPlus/blob/master/LICENSE).
* For Spectre.Console licensing information, see [LICENSE-SpectreConsole](Licenses/LICENSE-SpectreConsole.md).
* For FIGlet licensing information, see [LICENSE-FIGlet](Licenses/LICENSE-FIGlet.md).
* For xmldoc2md licensing information, see [LICENSE-xmldoc2md](Licenses/LICENSE-xmldoc2md.md).
8 changes: 4 additions & 4 deletions Src/Controls/StringStyle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// The maintenance and evolution is maintained by the PromptPlus project under MIT license
// ***************************************************************************************

using PPlus.Controls.Objects;
using EastAsianWidthDotNet;
using System;

namespace PPlus.Controls
Expand Down Expand Up @@ -32,7 +32,7 @@ public StringStyle(string text)
{
Text = text.NormalizeNewLines();
Style = Style.Default;
Width = (text??string.Empty).Length;
Width = (text??string.Empty).GetWidth();
}

/// <summary>
Expand All @@ -54,7 +54,7 @@ public StringStyle(string text, Style style)
{
Text = text.NormalizeNewLines();
Style = style;
Width = (text ?? string.Empty).Length;
Width = (text ?? string.Empty).GetWidth();
SkipMarkup = false;
ClearRestOfLine = true;
}
Expand All @@ -64,7 +64,7 @@ internal StringStyle(string text, Style style, bool skipmarkupparse, bool clearr
{
Text = text.NormalizeNewLines();
Style = style;
Width = (text ?? string.Empty).Length;
Width = (text ?? string.Empty).GetWidth();
SkipMarkup = skipmarkupparse;
ClearRestOfLine = clearrestofline;
}
Expand Down
9 changes: 5 additions & 4 deletions Src/Drivers/ConsoleDriveMemory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System;
using System.Collections.Generic;
using PPlus.Controls.Objects;
using EastAsianWidthDotNet;

namespace PPlus.Drivers
{
Expand Down Expand Up @@ -303,10 +304,10 @@ private void EnsureCursorPosition(Segment[] segments)
var itemaux = item;
do
{
max = _profile.BufferWidth - CursorLeft - itemaux.Length;
max = _profile.BufferWidth - CursorLeft - itemaux.GetWidth();
if (max >= 0)
{
SetCursorPosition(CursorLeft + itemaux.Length, CursorTop);
SetCursorPosition(CursorLeft + itemaux.GetWidth(), CursorTop);
itemaux = string.Empty;
}
else
Expand All @@ -316,7 +317,7 @@ private void EnsureCursorPosition(Segment[] segments)
itemaux = itemaux[..(max * -1)];
}
}
while (itemaux.Length != 0);
while (itemaux.GetWidth() != 0);
if (pos < lines.Length)
{
SetCursorPosition(CursorLeft, CursorTop + 1);
Expand Down Expand Up @@ -350,7 +351,7 @@ private int CountLines(Segment[] segments, int left, int width, int padleft)
{
if (part != null)
{
pos += part.Length;
pos += part.GetWidth();
switch (overflow)
{
case Overflow.None:
Expand Down
3 changes: 2 additions & 1 deletion Src/Drivers/ConsoleDriveWindows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// The maintenance and evolution is maintained by the PromptPlus project under MIT license
// ***************************************************************************************

using EastAsianWidthDotNet;
using PPlus.Controls.Objects;
using PPlus.Drivers.Ansi;
using System;
Expand Down Expand Up @@ -329,7 +330,7 @@ private int CountLines(Segment[] segments, int left, int width, int padleft)
}
if (part != null)
{
pos += part.Length;
pos += part.GetWidth();
switch (overflow)
{
case Overflow.None:
Expand Down
27 changes: 20 additions & 7 deletions Src/NugetREADME.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ PromptPlus **Supports 4/8/24-bit colors** in the terminal with auto-detection of
- Optimize resource usage in rendering (less cultural dependency)
- Improvement :
- Reinforce the validation of invalid or optional parameters in all controls
- Improvement :
- Remove code copy (MIT license) from other project and applied package (for lower maintenance)
- Documentation:
- Examples of snapshot controls updated to reflect layout changes and reduced image size (faster page loading)
- Reviewed credit references and licenses
- Renamed command:
- 'DescriptionWithInputType' to 'ShowTipInputType'.
- Now extra-line to tip InputType
Expand Down Expand Up @@ -121,17 +126,25 @@ var kp = PromptPlus
- macOS
- Terminal.app

## **License**
## Credits

Copyright 2021 @ Fernando Cerqueira
PromptPlus **<u>includes code(Copy)</u>** from other software released under the **MIT license**:

- [Spectre.Console](https://spectreconsole.net/), Copyright (c) 2020 Patrik Svensson, Phil Scott, Nils Andresen. See [LICENSE](Licenses/LICENSE-SpectreConsole.md).

- [FIGlet](https://github.com/auriou/FIGlet), Copyright (c) 2014 Philippe AURIOU. See [LICENSE](Licenses/LICENSE-FIGlet.md).

This project is licensed under the [MIT License](https://github.com/FRACerqueira/PromptPlus/blob/master/LICENSE)
**EastAsian width generated by package**

- [EastAsianWidthDotNet](https://github.com/nuitsjp/EastAsianWidthDotNet), Copyright (c) 2020 Atsushi Nakamura. See [LICENSE](Licenses/LICENSE-EastAsianWidthDotNet.md).

## **Credits**
**API documentation generated by**

- [xmldoc2md](https://github.com/FRACerqueira/xmldoc2md), Copyright (c) 2022 Charles de Vandière. See [LICENSE](Licenses/LICENSE-xmldoc2md.md).

## License

Copyright 2021 @ Fernando Cerqueira

PromptPlus **<u>includes code(copy)</u>** from other software released under the **MIT license**:
PromptPlus is licensed under the MIT license. See [LICENSE](https://github.com/FRACerqueira/PromptPlus/blob/master/LICENSE).

- [Spectre.Console](https://spectreconsole.net/), Copyright (c) 2020 Patrik Svensson, Phil Scott, Nils Andresen.
- [FIGlet](https://github.com/auriou/FIGlet), Copyright (c) 2014 Philippe AURIOU
1 change: 1 addition & 0 deletions Src/PromptPlus.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="EastAsianWidthDotNet" Version="1.0.1" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.IO" Version="4.3.0" />
<PackageReference Include="System.Text.Json" Version="7.0.3" />
Expand Down
22 changes: 15 additions & 7 deletions Src/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ PromptPlus was developed in C# with target frameworks:
- Optimize resource usage in rendering (less cultural dependency)
- Improvement :
- Reinforce the validation of invalid or optional parameters in all controls
- Improvement :
- Remove code copy (MIT license) from other project and applied package (for lower maintenance)
- Documentation:
- Examples of snapshot controls updated to reflect layout changes and reduced image size (faster page loading)
- Reviewed credit references and licenses
- Renamed command:
- 'DescriptionWithInputType' to 'ShowTipInputType'.
- Now extra-line to tip InputType
Expand Down Expand Up @@ -141,13 +146,6 @@ var kp = PromptPlus
- macOS
- Terminal.app

**License**
-----------

Copyright 2021 @ Fernando Cerqueira
PromptPlus project is licensed under the the MIT license.
https://github.com/FRACerqueira/PromptPlus/blob/master/LICENSE

**Credits**
-----------

Expand All @@ -156,3 +154,13 @@ PromptPlus includes code(copy) from other software released under the MIT licens
Spectre.Console(https://spectreconsole.net/), Copyright (c) 2020 Patrik Svensson, Phil Scott, Nils Andresen.
FIGlet(https://github.com/auriou/FIGlet), Copyright (c) 2014 Philippe AURIOU

**EastAsian width generated by package**

[EastAsianWidthDotNet](https://github.com/nuitsjp/EastAsianWidthDotNet), Copyright (c) 2020 Atsushi Nakamura.

**License**
-----------

Copyright 2021 @ Fernando Cerqueira
PromptPlus project is licensed under the the MIT license.
https://github.com/FRACerqueira/PromptPlus/blob/master/LICENSE
32 changes: 22 additions & 10 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
- [Validators](#validators)
- [Global Settings](globalsettings.md)
- [Supported Platforms](#supported-platforms)
- [License](#license)
- [Credits](#credits)
- [License](#license)
- [API Reference](./apis/apis.md)

## What's new in V4.2.0
Expand Down Expand Up @@ -73,6 +73,11 @@
- Optimize resource usage in rendering (less cultural dependency)
- Improvement :
- Reinforce the validation of invalid or optional parameters in all controls
- Improvement :
- Remove code copy (MIT license) from other project and applied package (for lower maintenance)
- Documentation:
- Examples of snapshot controls updated to reflect layout changes and reduced image size (faster page loading)
- Reviewed credit references and licenses
- Renamed command:
- 'DescriptionWithInputType' to 'ShowTipInputType'.
- Now extra-line to tip InputType
Expand Down Expand Up @@ -443,21 +448,28 @@ PromptPlus.EnabledAbortKey = false;
- macOS
- Terminal.app

## License

## Credits
[**Top**](#table-of-contents)

Copyright 2021 @ Fernando Cerqueira
PromptPlus **<u>includes code(Copy)</u>** from other software released under the **MIT license**:

PromptPlus is licensed under the MIT license. For more information see [LICENSE](https://github.com/FRACerqueira/PromptPlus/blob/master/LICENSE).
- [Spectre.Console](https://spectreconsole.net/), Copyright (c) 2020 Patrik Svensson, Phil Scott, Nils Andresen. See [LICENSE](Licenses/LICENSE-SpectreConsole.md).

## Credits
[**Top**](#table-of-contents)
- [FIGlet](https://github.com/auriou/FIGlet), Copyright (c) 2014 Philippe AURIOU. See [LICENSE](Licenses/LICENSE-FIGlet.md).

PromptPlus **<u>includes code(copy)</u>** from other software released under the **MIT license**:
**EastAsian width generated by package**

- [Spectre.Console](https://spectreconsole.net/), Copyright (c) 2020 Patrik Svensson, Phil Scott, Nils Andresen.
- [FIGlet](https://github.com/auriou/FIGlet), Copyright (c) 2014 Philippe AURIOU
- [EastAsianWidthDotNet](https://github.com/nuitsjp/EastAsianWidthDotNet), Copyright (c) 2020 Atsushi Nakamura. See [LICENSE](Licenses/LICENSE-EastAsianWidthDotNet.md).

**API documentation generated by**

- [xmldoc2md](https://github.com/FRACerqueira/xmldoc2md), Copyright (c) 2022 Charles de Vandière.
- [xmldoc2md](https://github.com/FRACerqueira/xmldoc2md), Copyright (c) 2022 Charles de Vandière. See [LICENSE](Licenses/LICENSE-xmldoc2md.md).

## License
[**Top**](#table-of-contents)

Copyright 2021 @ Fernando Cerqueira

PromptPlus is licensed under the MIT license. See [LICENSE](https://github.com/FRACerqueira/PromptPlus/blob/master/LICENSE).

0 comments on commit 186e4d5

Please sign in to comment.