Version 3.0.2
Enhancements
-
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.
- If the Clipboard API does not support copying text, the library now falls back to using
-
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.
- Introduced a new
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