Skip to content

Commit

Permalink
Merge pull request #133 from gaelj/release
Browse files Browse the repository at this point in the history
Release 0.6.0
  • Loading branch information
gaelj authored Feb 14, 2024
2 parents 6700174 + 2a14131 commit 14c9b42
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 90 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.6.0 - 2024-02-14

### 💥 Introduce breaking changes

- Drop IFormFile upload (not supported in WASM). IBrowserFile is still available (#118)

## 0.5.1 - 2024-02-12

### ✨ Introduce new features
Expand Down
5 changes: 1 addition & 4 deletions CodeMirror6/CodeMirror6.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AssemblyName>GaelJ.BlazorCodeMirror6</AssemblyName>
<IsPackable>true</IsPackable>
<PackageId>GaelJ.BlazorCodeMirror6</PackageId>
<Version>0.5.1</Version>
<Version>0.6.0</Version>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down Expand Up @@ -42,9 +42,6 @@
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.15" Condition="'$(TargetFramework)'=='net7.0'" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.1" Condition="'$(TargetFramework)'=='net8.0'" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
</ItemGroup>
<Target Name="RemoveNodeModulesTarget">
<RemoveDir Directories="./NodeLib/node_modules" />
</Target>
Expand Down
1 change: 0 additions & 1 deletion CodeMirror6/CodeMirror6Wrapper.razor
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
TabSize="@TabSize"
Theme="@Theme"
UploadBrowserFile="@UploadBrowserFile"
UploadFile="@UploadFile"
MergeViewConfiguration="@MergeViewConfiguration"
FileNameOrExtension="@FileNameOrExtension"
HighlightWhitespace="@HighlightWhitespace"
Expand Down
4 changes: 0 additions & 4 deletions CodeMirror6/CodeMirror6Wrapper.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,6 @@ public partial class CodeMirror6Wrapper : ComponentBase
/// </summary>
[Parameter] public Func<Task<List<CodeMirrorCompletion>>>? GetMentionCompletions { get; set; }
/// <summary>
/// Upload a file to a server and return the URL to the file
/// </summary>
[Parameter] public Func<IFormFile, Task<string>>? UploadFile { get; set; }
/// <summary>
/// Upload an IBrowserFile to a server and returns the URL to the file
/// </summary>
[Parameter] public Func<IBrowserFile, Task<string>>? UploadBrowserFile { get; set; }
Expand Down
9 changes: 3 additions & 6 deletions CodeMirror6/CodeMirror6WrapperInternal.razor.JsInvokables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,10 @@ [JSInvokable] public async Task<List<CodeMirrorDiagnostic>> LintingRequestedFrom
{
if (Setup.DebugLogs) Logger.LogInformation("UploadFileFromJS: {fileName}", fileName);
using var fileStream = new MemoryStream(fileBytes);
var customFormFile = new CustomFormFile(fileStream, fileName, contentType);
var customBrowserFile = new CustomBrowserFile(fileStream, fileName, contentType, lastModified);
var fileUrl = UploadFile is not null
? await UploadFile(customFormFile)
: UploadBrowserFile is not null
? await UploadBrowserFile(customBrowserFile)
: null;
var fileUrl = UploadBrowserFile is not null
? await UploadBrowserFile(customBrowserFile)
: null;
if (!string.IsNullOrEmpty(fileUrl)) {
var imageChar = contentType.StartsWith("image/") ? "!" : string.Empty;
var imageLink = $"\n{imageChar}[{fileName}]({fileUrl})\n";
Expand Down
4 changes: 0 additions & 4 deletions CodeMirror6/CodeMirror6WrapperInternal.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ public partial class CodeMirror6WrapperInternal : ComponentBase, IAsyncDisposabl
/// </summary>
[Parameter] public Func<Task<List<CodeMirrorCompletion>>>? GetMentionCompletions { get; set; }
/// <summary>
/// Upload a file to a server and return the URL to the file
/// </summary>
[Parameter] public Func<IFormFile, Task<string>>? UploadFile { get; set; }
/// <summary>
/// Upload an IBrowserFile to a server and returns the URL to the file
/// </summary>
[Parameter] public Func<IBrowserFile, Task<string>>? UploadBrowserFile { get; set; }
Expand Down
51 changes: 0 additions & 51 deletions CodeMirror6/Models/CustomFormFile.cs

This file was deleted.

2 changes: 1 addition & 1 deletion Examples.BlazorServer/Examples.BlazorServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>0.5.1</Version>
<Version>0.6.0</Version>
</PropertyGroup>
<ItemGroup>
<SupportedPlatform Include="browser" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<Version>0.5.1</Version>
<Version>0.6.0</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Sentry.AspNetCore" Version="4.1.0" />
Expand Down
2 changes: 1 addition & 1 deletion Examples.BlazorWasm/Examples.BlazorWasm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<Version>0.5.1</Version>
<Version>0.6.0</Version>
</PropertyGroup>
<ItemGroup>
<SupportedPlatform Include="browser-wasm" />
Expand Down
8 changes: 4 additions & 4 deletions Examples.Common/Example.razor
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
Setup=@Setup
ReplaceEmojiCodes=@ReplaceEmojiCodes
GetMentionCompletions=@GetMentionCompletions
UploadFile=@UploadFile
UploadBrowserFile=@UploadBrowserFile
Editable=@(!ReadOnly)
ReadOnly=@ReadOnly
LineNumbers=@(!ReadOnly)
Expand Down Expand Up @@ -349,7 +349,7 @@
private string ButtonClass(bool enabled) => enabled
? "btn btn-sm btn-primary"
: "btn btn-sm btn-outline-secondary";
private List<string> Styles = [];
private List<string> Styles = [];

private async Task ToggleEmojis(CMCommandDispatcher commands)
{
Expand Down Expand Up @@ -385,9 +385,9 @@
return Task.FromResult(result);
}

private async Task<string> UploadFile(Microsoft.AspNetCore.Http.IFormFile file)
private async Task<string> UploadBrowserFile(IBrowserFile file)
{
var fileBytes = new byte[file.Length];
var fileBytes = new byte[file.Size];
await file.OpenReadStream().ReadAsync(fileBytes);
var base64 = Convert.ToBase64String(fileBytes);
var mimeType = file.ContentType;
Expand Down
2 changes: 1 addition & 1 deletion Examples.Common/Examples.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<Version>0.5.1</Version>
<Version>0.6.0</Version>
</PropertyGroup>
<ItemGroup>
<SupportedPlatform Include="browser" />
Expand Down
14 changes: 2 additions & 12 deletions NEW_CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
### Introduce new features
### 💥 Introduce breaking changes

- Implement foldMarkdownCodeBlocks
- Show styles at selection in example

### 🔊 Add or update logs

- Clarify log message
- Log config and setup at initialization

### 🥅 Catch errors

- Check for existence of the parent div and error out immediately if not found
- Drop IFormFile upload (not supported in WASM). IBrowserFile is still available (#118)

0 comments on commit 14c9b42

Please sign in to comment.