Skip to content

Commit

Permalink
Merge pull request #170 from gaelj/release
Browse files Browse the repository at this point in the history
Release 0.8.3
  • Loading branch information
gaelj authored Apr 8, 2024
2 parents 454ea8e + 1af87d1 commit e826e6d
Show file tree
Hide file tree
Showing 22 changed files with 713 additions and 590 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## 0.8.3 - 2024-04-08

### ✨ Introduce new features

- Add IndentWithTab to Setup for accessibility
- Allow optional setting of base path for links and images
- Fold diagram codeblocks instead of hiding them

### ⬆️ Upgrade dependencies

- Update dependencies

### 🎨 Improve structure / format of the code

- Ignore spaces when searching mentions

### 🐛 Fix a bug

- Completions: search info field & make all field searches case invariant
- Fix usage of cached completions list

## 0.8.2 - 2024-03-04

### ✨ Introduce new features
Expand Down
4 changes: 2 additions & 2 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.8.2</Version>
<Version>0.8.3</Version>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down Expand Up @@ -40,7 +40,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.27" Condition="'$(TargetFramework)'=='net6.0'" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.16" Condition="'$(TargetFramework)'=='net7.0'" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.2" Condition="'$(TargetFramework)'=='net8.0'" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.3" Condition="'$(TargetFramework)'=='net8.0'" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.Github" Version="8.0.0">
Expand Down
1 change: 1 addition & 0 deletions CodeMirror6/CodeMirror6Wrapper.razor
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
PreviewImages="@PreviewImages"
ScrollPastEnd="@ScrollPastEnd"
ShowMarkdownControlCharactersAroundCursor="@ShowMarkdownControlCharactersAroundCursor"
BasePathForLinks="@BasePathForLinks"
/>
</ChildContent>
<ErrorContent Context="c">
Expand Down
5 changes: 5 additions & 0 deletions CodeMirror6/CodeMirror6Wrapper.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ public partial class CodeMirror6Wrapper : ComponentBase
/// </summary>
[Parameter] public bool ScrollPastEnd { get; init; } = true;
/// <summary>
/// If a Markdown document contains relative links, this property can be used to specify the base path for the links, if different from the current page.
/// </summary>
/// <value></value>
[Parameter] public string? BasePathForLinks { get; set; }
/// <summary>
/// Whether to show the markdown control characters around the cursor
/// </summary>
[Parameter] public bool ShowMarkdownControlCharactersAroundCursor { get; init; } = true;
Expand Down
12 changes: 11 additions & 1 deletion CodeMirror6/CodeMirror6WrapperInternal.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ public partial class CodeMirror6WrapperInternal : ComponentBase, IAsyncDisposabl
/// </summary>
[Parameter] public bool ShowMarkdownControlCharactersAroundCursor { get; init; } = true;
/// <summary>
/// If a Markdown document contains relative links, this property can be used to specify the base path for the links, if different from the current page.
/// </summary>
/// <value></value>
[Parameter] public string? BasePathForLinks { get; set; }
/// <summary>
/// Additional attributes to be applied to the container element
/// </summary>
[Parameter(CaptureUnmatchedValues = true)] public Dictionary<string, object>? AdditionalAttributes { get; set; }
Expand Down Expand Up @@ -298,7 +303,8 @@ protected override async Task OnInitializedAsync()
ScrollPastEnd,
HighlightActiveLine,
ShowMarkdownControlCharactersAroundCursor,
EmbedUploadsAsDataUrls
EmbedUploadsAsDataUrls,
BasePathForLinks
);
try {
if (IsWASM)
Expand Down Expand Up @@ -468,6 +474,10 @@ protected override async Task OnParametersSetAsync()
Config.ShowMarkdownControlCharactersAroundCursor = ShowMarkdownControlCharactersAroundCursor;
updated = true;
}
if (Config.BasePathForLinks != BasePathForLinks) {
Config.BasePathForLinks = BasePathForLinks;
updated = true;
}
if (LifeCycleCancellationTokenSource.IsCancellationRequested) return;
if (updated)
await CmJsInterop.PropertySetters.SetConfiguration();
Expand Down
10 changes: 9 additions & 1 deletion CodeMirror6/Models/CodeMirrorConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ namespace GaelJ.BlazorCodeMirror6.Models;
/// <param name="highlightActiveLine"></param>
/// <param name="showMarkdownControlCharactersAroundCursor"></param>
/// <param name="embedUploadsAsDataUrls"></param>
/// <param name="basePathForLinks"></param>
public class CodeMirrorConfiguration(
string? doc,
string? placeholder,
Expand Down Expand Up @@ -66,7 +67,8 @@ public class CodeMirrorConfiguration(
bool scrollPastEnd,
bool highlightActiveLine,
bool showMarkdownControlCharactersAroundCursor,
bool embedUploadsAsDataUrls)
bool embedUploadsAsDataUrls,
string? basePathForLinks)
{
/// <summary>
/// The text to display in the editor
Expand Down Expand Up @@ -217,4 +219,10 @@ public class CodeMirrorConfiguration(
/// When uploading a file, instead of using the callback, encode the file contents as base64 and include it as a data URL in the document
/// </summary>
[JsonPropertyName("embedUploadsAsDataUrls")] public bool EmbedUploadsAsDataUrls { get; internal set; } = embedUploadsAsDataUrls;

/// <summary>
/// If a Markdown document contains relative links, this property can be used to specify the base path for the links, if different from the current page.
/// </summary>
/// <value></value>
[JsonPropertyName("basePathForLinks")] public string? BasePathForLinks { get; set; } = basePathForLinks;
}
5 changes: 5 additions & 0 deletions CodeMirror6/Models/CodeMirrorSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,9 @@ public CodeMirrorSetup()
/// Whether to focus on the editor when it is created
/// </summary>
[JsonPropertyName("focusOnCreation")] public bool FocusOnCreation { get; init; }

/// <summary>
/// Whether the tab key should be handled by the editor (to indent the current line), or be used to move focus to the next element (accessible mode)
/// </summary>
[JsonPropertyName("indentWithTab")] public bool IndentWithTab { get; init; } = true;
}
Loading

0 comments on commit e826e6d

Please sign in to comment.