Skip to content

ClipLazor v3.0.2

Latest
Compare
Choose a tag to compare
@p6laris p6laris released this 27 Nov 01:33
· 4 commits to master since this release

Version 3.0.2

Enhancements

  1. Improved Clipboard API Fallback

    • If the Clipboard API does not support copying text, the library now falls back to using document.execCommand. This ensures broader compatibility across browsers and environments.
  2. New Feature: ClipboardTextAction Component

    • Introduced a new ClipboardTextAction component for easily copying text content from a targeted HTML element or a text. This streamlines text-copying operations.

Example Usage of ClipboardTextAction

<input id="nameInput" />
<ClipboardTextAction TargetId="nameInput" Action="ClipboardAction.Cut" OnAction="HandleAction"/>
@* OR *@
<ClipboardTextAction Text="Hello World!">Say hi to the clipboard</ClipboardTextAction>


@code {
private void HandleAction(OnTextActionEventArgs e){
    string message = string.Empty;

    if (e.IsSuccess)
    {
        var action = e.Action is ClipboardAction.Copy ? "copied" : "cut";
        message = $"Text: {e.Text} has been {action} successfully.";
    }
    else
        message = $"Could not {e.Action.ToString()} to the clipboard.";

 }
}

Issue Fix: TypeScript Output JavaScript File

Fixed an issue where the TypeScript-generated JavaScript file was not included in the output directory. The TypeScript output configuration has been corrected, ensuring the file is now properly generated and available in the wwwroot folder. #4