mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-26 13:36:46 +00:00
Upgraded MudBlazor, ReverseMarkdown, and System.CommandLine (#1236)
This commit is contained in:
1 parent
506c06fbfc
commit
9ebfce3855
21 files changed
+506
-96
No files matched your search
@@ -6,9 +6,10 @@ namespace AIStudio.Chat;
|
||||
/// nothing but a formula, see LatexFormula.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// MudMarkdown shows a formula as it is, and MathJax typesets only what the chat hands it as a
|
||||
/// formula block. A formula therefore has to leave the Markdown around it. Inside a code block, $$ is
|
||||
/// code, not a formula, and a formula block the model never closed leaves the whole text as Markdown.
|
||||
/// MudMarkdown typesets a formula within a line, between single $, by itself, but shows a formula block
|
||||
/// as it is, and MathJax typesets only what the chat hands it as a formula block. A formula block
|
||||
/// therefore has to leave the Markdown around it. Inside a code block, $$ is code, not a formula, and a
|
||||
/// formula block the model never closed leaves the whole text as Markdown.
|
||||
/// </remarks>
|
||||
internal static class MarkdownRenderPlanner
|
||||
{
|
||||
|
||||
@@ -51,11 +51,11 @@ public sealed class ExportableMarkdown : HighlightedMarkdown
|
||||
#region Overrides of HighlightedMarkdown
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void RenderCodeBlock(in RenderTreeBuilder builder, ref int elementIndex, in Markdig.Syntax.CodeBlock code, in string? info)
|
||||
protected override void RenderCodeBlock(in RenderTreeBuilder builder, ref int elementIndex, in Markdig.Syntax.CodeBlock code, in string? info, Typo typo)
|
||||
{
|
||||
if (this.CodeBlockActions is null || FileAt(this.Files, this.ValueStart + code.Span.Start) is not { } file)
|
||||
{
|
||||
base.RenderCodeBlock(builder, ref elementIndex, code, info);
|
||||
base.RenderCodeBlock(builder, ref elementIndex, code, info, typo);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public sealed class ExportableMarkdown : HighlightedMarkdown
|
||||
//
|
||||
builder.OpenElement(0, "div");
|
||||
builder.AddAttribute(1, "class", "code-block-with-actions");
|
||||
base.RenderCodeBlock(builder, ref elementIndex, code, info);
|
||||
base.RenderCodeBlock(builder, ref elementIndex, code, info, typo);
|
||||
|
||||
builder.OpenElement(2, "div");
|
||||
builder.AddAttribute(3, "class", "code-block-actions");
|
||||
|
||||
@@ -11,8 +11,9 @@ namespace AIStudio.Components;
|
||||
/// same classes, the same colors of the theme, and the same copy button.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Its parameters are strings only. Blazor then renders it again only when the code or the language
|
||||
/// change, so while an answer streams in, only the block which grows is highlighted again.
|
||||
/// Its parameters are strings and an enum only. Blazor then renders it again only when the code, the
|
||||
/// language, or the typography change, so while an answer streams in, only the block which grows is
|
||||
/// highlighted again.
|
||||
/// </remarks>
|
||||
public sealed class HighlightedCodeBlock : ComponentBase
|
||||
{
|
||||
@@ -28,6 +29,12 @@ public sealed class HighlightedCodeBlock : ComponentBase
|
||||
[Parameter]
|
||||
public string Language { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The typography of the block: that of the body text, which MudMarkdown gives the code blocks it renders itself.
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public Typo Typo { get; set; }
|
||||
|
||||
#region Overrides of ComponentBase
|
||||
|
||||
protected override void BuildRenderTree(RenderTreeBuilder builder)
|
||||
@@ -39,12 +46,9 @@ public sealed class HighlightedCodeBlock : ComponentBase
|
||||
builder.AddComponentParameter(3, nameof(CodeBlockCopyButton.Text), this.Code);
|
||||
builder.CloseComponent();
|
||||
|
||||
//
|
||||
// MudMarkdown leaves the typography of its code blocks at the default value, and so do we:
|
||||
//
|
||||
builder.OpenComponent<MudText>(4);
|
||||
builder.AddComponentParameter(5, nameof(MudText.HtmlTag), "pre");
|
||||
builder.AddComponentParameter(6, nameof(MudText.Typo), default(Typo));
|
||||
builder.AddComponentParameter(6, nameof(MudText.Typo), this.Typo);
|
||||
builder.AddComponentParameter(7, nameof(MudText.ChildContent), (RenderFragment)this.RenderCode);
|
||||
builder.CloseComponent();
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public class HighlightedMarkdown : MudMarkdown
|
||||
#region Overrides of MudMarkdown
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void RenderCodeBlock(in RenderTreeBuilder builder, ref int elementIndex, in Markdig.Syntax.CodeBlock code, in string? info)
|
||||
protected override void RenderCodeBlock(in RenderTreeBuilder builder, ref int elementIndex, in Markdig.Syntax.CodeBlock code, in string? info, Typo typo)
|
||||
{
|
||||
var text = TextOf(code);
|
||||
var language = CodeLanguageDetector.FenceLanguageOf(info, text);
|
||||
@@ -37,7 +37,7 @@ public class HighlightedMarkdown : MudMarkdown
|
||||
// The copy button of the library confirms in the language of the app, as ours does:
|
||||
//
|
||||
this.Styling.CodeBlock.CopyButtonText = CodeBlockCopyButton.ConfirmationText;
|
||||
base.RenderCodeBlock(builder, ref elementIndex, code, language);
|
||||
base.RenderCodeBlock(builder, ref elementIndex, code, language, typo);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ public class HighlightedMarkdown : MudMarkdown
|
||||
builder.OpenComponent<HighlightedCodeBlock>(0);
|
||||
builder.AddComponentParameter(1, nameof(HighlightedCodeBlock.Code), text);
|
||||
builder.AddComponentParameter(2, nameof(HighlightedCodeBlock.Language), language);
|
||||
builder.AddComponentParameter(3, nameof(HighlightedCodeBlock.Typo), typo);
|
||||
builder.CloseComponent();
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AngouriMath" Version="2.8.0" />
|
||||
<PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="9.2.0" />
|
||||
<PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="9.14.0" />
|
||||
<PackageReference Include="DocumentFormat.OpenXml" Version="3.5.1" />
|
||||
<PackageReference Include="HtmlAgilityPack" Version="1.12.4" />
|
||||
<PackageReference Include="MailKit" Version="5.0.0" />
|
||||
@@ -113,9 +113,9 @@
|
||||
WebRootFiles finds neither the changelogs nor the ERI specifications in any build.
|
||||
-->
|
||||
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="10.0.15" />
|
||||
<PackageReference Include="MudBlazor" Version="9.12.0" />
|
||||
<PackageReference Include="MudBlazor.Markdown" Version="9.10.0" />
|
||||
<PackageReference Include="ReverseMarkdown" Version="5.0.0" />
|
||||
<PackageReference Include="MudBlazor" Version="9.14.0" />
|
||||
<PackageReference Include="MudBlazor.Markdown" Version="9.12.0" />
|
||||
<PackageReference Include="ReverseMarkdown" Version="6.3.0" />
|
||||
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="3.0.5" />
|
||||
<PackageReference Include="LuaCSharp" Version="0.5.8" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Frozen;
|
||||
using System.Net;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Net.Sockets;
|
||||
using AIStudio.Tools.Web;
|
||||
using AngleSharp.Dom;
|
||||
using HtmlAgilityPack;
|
||||
using ReverseMarkdown;
|
||||
|
||||
@@ -15,39 +16,39 @@ public sealed class HTMLParser
|
||||
private const int DEFAULT_MAX_RESPONSE_BYTES = 5 * 1024 * 1024;
|
||||
|
||||
/// <summary>
|
||||
/// The fixed configuration every HTML to Markdown conversion runs with.
|
||||
/// The elements which ReverseMarkdown reads as inline elements around their content, such as a link.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This one is shared, because it is only ever read: a configuration holds no counters and no
|
||||
/// collections which get written to. The converters reading it are not shared, see the pool
|
||||
/// below.
|
||||
/// </remarks>
|
||||
private static readonly Config MARKDOWN_CONFIG = new()
|
||||
{
|
||||
UnknownTags = Config.UnknownTagsOption.Bypass,
|
||||
RemoveComments = true,
|
||||
SmartHrefHandling = true,
|
||||
};
|
||||
private static readonly FrozenSet<string> INLINE_ELEMENTS = new[] { "a", "abbr", "b", "cite", "del", "em", "i", "s", "span", "strike", "strong", "sub", "sup" }.ToFrozenSet(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
/// <summary>
|
||||
/// The converters not currently in use, kept so that the reflection in their constructor does
|
||||
/// not run for every page.
|
||||
/// The elements which ReverseMarkdown reads as blocks of their own, or as containers of blocks. Tables and pre are
|
||||
/// left out: their content keeps its own structure inside an inline element as well.
|
||||
/// </summary>
|
||||
private static readonly FrozenSet<string> BLOCK_ELEMENTS = new[]
|
||||
{
|
||||
"article", "aside", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "footer", "h1", "h2", "h3", "h4", "h5", "h6",
|
||||
"header", "hr", "li", "main", "nav", "ol", "p", "section", "ul",
|
||||
}.ToFrozenSet(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
/// <summary>
|
||||
/// The one converter every HTML to Markdown conversion runs through.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// One converter per conversion rather than one for all of them: a converter tracks the
|
||||
/// ancestors of the node it is at in state of its own, updates that state at every single node,
|
||||
/// and does so without any synchronization. A web search converts up to four pages at the same
|
||||
/// time, which let those conversions tear each other's ancestor lists apart — sometimes loudly,
|
||||
/// as an index outside the bounds of an array, and sometimes quietly, as a list indented by the
|
||||
/// depth another page happened to be at.<br/><br/>
|
||||
/// Which converter gets which page does not matter, so the pool needs no key: that ancestor
|
||||
/// state is entered and left in pairs around every node, which leaves it empty once a
|
||||
/// conversion returns. Nothing of a page outlives its own conversion. A key would, in fact, do
|
||||
/// harm — two conversions of the same page at the same time would share one converter again.
|
||||
/// <br/><br/>
|
||||
/// The pool holds no more converters than are ever converting at once, which is a handful.
|
||||
/// Since version 6, ReverseMarkdown keeps the state of a conversion inside that conversion and
|
||||
/// documents its converter as safe for concurrent use. A web search converts up to four pages at
|
||||
/// the same time, and HTMLParserConcurrencyTests checks that they stay apart. Up to version 5, a
|
||||
/// converter tracked the ancestors of the node it was at in state of its own, and conversions
|
||||
/// sharing one tore each other's lists apart, which is why there used to be a pool of them.<br/><br/>
|
||||
/// Built from a configuration alone, the converter takes its built-in readers and needs no
|
||||
/// reflection, so a trimmed build keeps everything it uses, see MarkdownChecks of the trim smoke test.
|
||||
/// </remarks>
|
||||
private static readonly ConcurrentBag<Converter> CONVERTER_POOL = [];
|
||||
private static readonly Converter CONVERTER = new(new Config
|
||||
{
|
||||
Tags = { Unknown = Config.UnknownTagsOption.Bypass },
|
||||
Formatting = { RemoveComments = true },
|
||||
Links = { SmartHref = true },
|
||||
Preprocess = { { "Unwrap the blocks inside inline elements", UnwrapBlocksInsideInlineElements } },
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
/// Loads a web page.
|
||||
@@ -269,21 +270,75 @@ public sealed class HTMLParser
|
||||
/// </summary>
|
||||
/// <param name="html">The HTML content to parse.</param>
|
||||
/// <returns>The converted Markdown content.</returns>
|
||||
public static string ParseToMarkdown(string html) => CONVERTER.Convert(html);
|
||||
|
||||
/// <summary>
|
||||
/// Replaces every block inside an inline element by its content, with a space before and after it.
|
||||
/// </summary>
|
||||
/// <param name="root">The document element of the HTML, as ReverseMarkdown parsed it.</param>
|
||||
/// <remarks>
|
||||
/// The converter returns to the pool only after it converted without throwing, and that is
|
||||
/// deliberately not done in a finally block: a conversion which throws leaves the ancestors it
|
||||
/// entered behind, because the library does not unwind them itself. Such a converter would
|
||||
/// count those ancestors into every page it is handed afterwards, so it is left to the garbage
|
||||
/// collector rather than passed on.
|
||||
/// Compatibility shim, see documentation/compatibility-shims/2026-11-reversemarkdown-blocks-in-inline-elements.md;
|
||||
/// remove it once ReverseMarkdown separates such blocks itself, see
|
||||
/// https://github.com/mysticmind/reversemarkdown-net/issues/440.<br/><br/>
|
||||
/// Many pages wrap a whole teaser in a link: a heading, a line of metadata, and a summary, each a block of its own.
|
||||
/// A link holds no blocks in Markdown, so ReverseMarkdown 6 writes their texts one after another into the text of
|
||||
/// the link, without anything in between, e.g., "Java77.721 Abrufeheise security". Spaces next to such blocks alone
|
||||
/// were not enough: a first attempt which only added them still left most teasers on the start page of a news site
|
||||
/// glued together. Hence, each block gives way to its content, which the library then reads as part of the inline
|
||||
/// element, spaces included. The result is what the library makes of such a block anyway, only with the words
|
||||
/// apart. Where whitespace is there already, nothing is added, and inside pre the text stays exactly as it is.<br/><br/>
|
||||
/// The blocks are taken from the outside in, so an inner block sees the neighbors it got when its outer block gave
|
||||
/// way. Every conversion parses a document of its own, so this step changes nothing which another thread could see.
|
||||
/// </remarks>
|
||||
public static string ParseToMarkdown(string html)
|
||||
private static void UnwrapBlocksInsideInlineElements(IElement root)
|
||||
{
|
||||
if (!CONVERTER_POOL.TryTake(out var converter))
|
||||
converter = new Converter(MARKDOWN_CONFIG);
|
||||
var blocks = root.QuerySelectorAll("*").Where(IsBlockInsideInlineElement).ToList();
|
||||
foreach (var block in blocks)
|
||||
{
|
||||
if (block.Parent is not { } parent)
|
||||
continue;
|
||||
|
||||
var markdown = converter.Convert(html);
|
||||
if (NeedsSeparator(block.PreviousSibling, atItsEnd: true))
|
||||
parent.InsertBefore(block.Owner!.CreateTextNode(" "), block);
|
||||
|
||||
CONVERTER_POOL.Add(converter);
|
||||
return markdown;
|
||||
if (NeedsSeparator(block.NextSibling, atItsEnd: false))
|
||||
parent.InsertBefore(block.Owner!.CreateTextNode(" "), block.NextSibling);
|
||||
|
||||
foreach (var child in block.ChildNodes.ToArray())
|
||||
parent.InsertBefore(child, block);
|
||||
|
||||
block.Remove();
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsBlockInsideInlineElement(IElement element)
|
||||
{
|
||||
if (!BLOCK_ELEMENTS.Contains(element.LocalName))
|
||||
return false;
|
||||
|
||||
var insideInlineElement = false;
|
||||
for (var ancestor = element.ParentElement; ancestor is not null; ancestor = ancestor.ParentElement)
|
||||
{
|
||||
if (ancestor.LocalName.Equals("pre", StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
if (INLINE_ELEMENTS.Contains(ancestor.LocalName))
|
||||
insideInlineElement = true;
|
||||
}
|
||||
|
||||
return insideInlineElement;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether the node next to a block runs into the block without whitespace in between.
|
||||
/// </summary>
|
||||
/// <param name="neighbor">The node right before or after the block, if any.</param>
|
||||
/// <param name="atItsEnd">True when the neighbor comes before the block, so its last character touches the block.</param>
|
||||
private static bool NeedsSeparator(INode? neighbor, bool atItsEnd) => neighbor switch
|
||||
{
|
||||
null => false,
|
||||
IText { Data.Length: 0 } => false,
|
||||
IText text => !char.IsWhiteSpace(atItsEnd ? text.Data[^1] : text.Data[0]),
|
||||
_ => true,
|
||||
};
|
||||
}
|
||||
@@ -16,11 +16,11 @@
|
||||
},
|
||||
"CodeBeam.MudBlazor.Extensions": {
|
||||
"type": "Direct",
|
||||
"requested": "[9.2.0, )",
|
||||
"resolved": "9.2.0",
|
||||
"contentHash": "oA6TtFHh8uSA9Rk06aC9Bv9mvDiCfz5jI2QVYY2oogt5dZr2sHLHFdx3Z2shvn1i0gsTC35OjruKJJpWXPBcHA==",
|
||||
"requested": "[9.14.0, )",
|
||||
"resolved": "9.14.0",
|
||||
"contentHash": "Xe95ljYZI6NQZejyUIoGn0nl7Fo9kSZRPjGWHPVTUS+pZ0/RBdUq3dmXXfO82VjQ3eCJLqIJwcBrnzCQxjAHUA==",
|
||||
"dependencies": {
|
||||
"MudBlazor": "9.0.0"
|
||||
"MudBlazor": "9.14.0"
|
||||
}
|
||||
},
|
||||
"DocumentFormat.OpenXml": {
|
||||
@@ -98,27 +98,27 @@
|
||||
},
|
||||
"MudBlazor": {
|
||||
"type": "Direct",
|
||||
"requested": "[9.12.0, )",
|
||||
"resolved": "9.12.0",
|
||||
"contentHash": "T6PQUCJe60UTSy3u1F8R2nuC06Cox6WEhon5GA2/AZNVI1WstlPSJZdGPyp6pHFpWdjPpla65piLpyJsbW+1rA=="
|
||||
"requested": "[9.14.0, )",
|
||||
"resolved": "9.14.0",
|
||||
"contentHash": "VmMM/u4upqpc0lJoXmo30Zj1d/Zq3BjdS11+q/eB/+p20pV1WXbLS0C17WbV4xqLM1i9Kpco6emt6M4s2R/BUA=="
|
||||
},
|
||||
"MudBlazor.Markdown": {
|
||||
"type": "Direct",
|
||||
"requested": "[9.10.0, )",
|
||||
"resolved": "9.10.0",
|
||||
"contentHash": "/uO8FrwS7NANxw6tI5F1fnHTD9r1g/1Xn5SBF2s2jdr6oS4CCnIGC8HSip6qNR/mzZaEx0Ioc0s7abYcMM50Wg==",
|
||||
"requested": "[9.12.0, )",
|
||||
"resolved": "9.12.0",
|
||||
"contentHash": "oQH8sU4zFK6M4zBO0WemK0L5ZbV7oDhX4kmyPg6w91molrl+F3rjzfYYJie0tvQB8PfxijD/B1T2855z+2d/xQ==",
|
||||
"dependencies": {
|
||||
"Markdig": "1.4.0",
|
||||
"MudBlazor": "9.10.0"
|
||||
"Markdig": "1.5.1",
|
||||
"MudBlazor": "9.12.0"
|
||||
}
|
||||
},
|
||||
"ReverseMarkdown": {
|
||||
"type": "Direct",
|
||||
"requested": "[5.0.0, )",
|
||||
"resolved": "5.0.0",
|
||||
"contentHash": "Zw7ODMO/P8b4ua9qFdsmZPkPmYGCcSfwhKo8+81PCS0e6P21c9sOlYwVJ3MCEWZAGW+CXJBdF3FKtXKWZWzFTg==",
|
||||
"requested": "[6.3.0, )",
|
||||
"resolved": "6.3.0",
|
||||
"contentHash": "h2GwfOpLAkONJa3ARH4VnhrJro7XcqTmI1z0d6LzXVto8Qm/8cmUO3cBm7nkN48rQfSPi2NpEPBKuPzSZr1LMg==",
|
||||
"dependencies": {
|
||||
"HtmlAgilityPack": "1.12.4"
|
||||
"AngleSharp": "1.5.2"
|
||||
}
|
||||
},
|
||||
"SQLitePCLRaw.bundle_e_sqlite3": {
|
||||
@@ -131,6 +131,11 @@
|
||||
"SQLitePCLRaw.config.e_sqlite3": "3.0.5"
|
||||
}
|
||||
},
|
||||
"AngleSharp": {
|
||||
"type": "Transitive",
|
||||
"resolved": "1.5.2",
|
||||
"contentHash": "LVZ7rrr6GHbhERhTgVDarVygl1e6KwE96pronA90LBOMacDhxR4lB+xYLjn/vlnUu+xbOB2RM9fuCPEx5bdyWA=="
|
||||
},
|
||||
"Antlr4.Runtime.Standard": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.13.1",
|
||||
@@ -166,8 +171,8 @@
|
||||
},
|
||||
"Markdig": {
|
||||
"type": "Transitive",
|
||||
"resolved": "1.4.0",
|
||||
"contentHash": "lLhaiI/mNDTNzgLqnmknhf4LjgTqOAyjx5+GNz0X3AxYMxUhmFppF2WVMdER+SDqwhE5wUF1pzs/cuLwFxs7xA=="
|
||||
"resolved": "1.5.1",
|
||||
"contentHash": "NtHwU5t5yKr6Gnylhs8/hlR0mOAftTFQURDz2ID8bkunxps1neOzKw0dYKKlwNuwiYIGLHjJTXK91f809Ko1ww=="
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore": {
|
||||
"type": "Transitive",
|
||||
|
||||
@@ -355,7 +355,7 @@ window.localShortcut = {
|
||||
}
|
||||
|
||||
// What floats above the page without ever being a drop target. Two of these take part in hit testing as
|
||||
// MudBlazor 9.12 stands: an open .mud-popover -- a closed one already declines pointer events through
|
||||
// MudBlazor 9.14 stands: an open .mud-popover -- a closed one already declines pointer events through
|
||||
// .mud-popover:not(.mud-popover-open) -- and .mud-snackbar, which asks for them explicitly with
|
||||
// pointer-events: auto even though its container declines them, and snackbars appear constantly in this
|
||||
// app. Without this list, a drag would be answered by whatever happens to float on screen rather than by
|
||||
@@ -368,7 +368,7 @@ const skippedDropOverlays = '.mud-popover, .mud-tooltip, .mud-snackbar, #mud-sna
|
||||
|
||||
// The drop zones of the app, addressed by the cursor position of a native drag and drop event.
|
||||
//
|
||||
// The arbitration between overlapping zones is left to the browser, and it can be: MudBlazor 9.12 gives
|
||||
// The arbitration between overlapping zones is left to the browser, and it can be: MudBlazor 9.14 gives
|
||||
// neither .mud-dialog-container nor .mud-overlay a pointer-events: none. Both fill the viewport while a
|
||||
// dialog is open, so a point beside the dialog box hits the container, and nothing there is a drop zone. A
|
||||
// drop, therefore, cannot reach through an open dialog into the page behind it -- the very thing the app
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
- Fixed the Mathematics prototype getting stuck for a long time when it checked a result with a very large factorial or power. Meanwhile, no other calculation could run.
|
||||
- Upgraded several libraries to improve security.
|
||||
- Upgraded Tauri to v2.12.7.
|
||||
- Upgraded MudBlazor to v9.14.0.
|
||||
- Upgraded PDFium to v158.0.8125.0 and Qdrant Edge to v0.9.0.
|
||||
- Upgraded to Rust v1.100.0.
|
||||
- Upgraded to .NET v10.0.15.
|
||||
+1
-1
@@ -1 +1 @@
|
||||
.hljs{color:var(--mud-markdown-codehightlight-text);background:var(--mud-markdown-codehightlight-background)}.hljs-subst{color:var(--mud-markdown-codehightlight-text)}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-name,.hljs-template-tag,.hljs-template-variable,.hljs-variable.language_{color:var(--mud-markdown-codehightlight-keyword)}.hljs-type{color:var(--mud-markdown-codehightlight-type)}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:var(--mud-markdown-codehightlight-function)}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-symbol,.hljs-variable{color:var(--mud-markdown-codehightlight-number)}.hljs-string{color:var(--mud-markdown-codehightlight-string)}.hljs-code,.hljs-comment,.hljs-formula{color:var(--mud-markdown-codehightlight-comment)}.hljs-meta{color:var(--mud-markdown-codehightlight-meta)}.mud-markdown-body code:not(.hljs){background:var(--mud-palette-action-disabled-background);color:var(--mud-palette-text-primary)!important;padding:2.5px 7.5px;border-radius:5px}pre code.hljs{display:block!important;overflow-x:auto;padding:1em;width:100%}.mud-markdown-body .mud-markdown-code-highlight,.mud-markdown-body .mud-markdown-code-highlight-sticky{border:1px solid var(--mud-palette-lines-default);border-radius:var(--mud-default-borderradius)}.mud-markdown-body .mud-markdown-code-highlight{position:relative!important}.mud-markdown-body .mud-markdown-code-highlight:hover>.mud-markdown-code-highlight-copybtn{display:block!important}.mud-markdown-code-highlight-copybtn{position:absolute;display:none;top:0;right:0}.mud-markdown-body .mud-markdown-code-highlight-sticky{position:relative;display:flex;flex-direction:column}.mud-markdown-body .mud-markdown-code-highlight-sticky .mud-markdown-code-highlight-copybtn-sticky{position:sticky;align-self:flex-end;z-index:calc(var(--mud-zindex-appbar) - 2);top:calc(var(--mud-appbar-height) + 16px);margin-bottom:-3.5rem}.mud-markdown-body blockquote{border-left:.25em solid var(--mud-palette-text-disabled);color:var(--mud-palette-text-secondary);background-color:var(--mud-palette-table-hover);padding:.25em 1em;margin:.5em 0 1.25em}.mud-markdown-body blockquote p{margin-bottom:0!important}.mud-markdown-body .mud-table{margin:0 0 1.25em 0}.mud-markdown-body table p{margin-bottom:0!important}.mud-markdown-body .mud-link:hover{cursor:pointer!important}.mud-markdown-body ul{list-style-type:disc}.mud-markdown-body ol,.mud-markdown-body ul{padding-left:2em;margin-bottom:1.25em!important}.mud-markdown-body ul ul{list-style-type:circle;margin-bottom:0!important}.mud-markdown-body ul ul ul{list-style-type:square;margin-bottom:0!important}.mud-markdown-body li{display:list-item!important;text-align:-webkit-match-parent}.mud-markdown-body h1,.mud-markdown-body h2{border-bottom:1px solid var(--mud-palette-text-disabled);padding-bottom:.125em;margin-bottom:.4em}.mud-markdown-body h1,.mud-markdown-body h2,.mud-markdown-body h3,.mud-markdown-body h4,.mud-markdown-body h5,.mud-markdown-body h6{scroll-margin-top:5rem;margin-top:.25em;word-wrap:break-word;margin-bottom:.3em!important}.mud-markdown-body .mud-divider{margin:.5em 0;height:.25em}.mud-markdown-body p{margin-bottom:1.25em!important}.mud-markdown-body .mud-expand-panel p,.mud-markdown-body li p{margin-bottom:0!important}.mud-markdown-body p .mud-markdown-error{white-space:pre}.mud-markdown-body img{max-width:100%}.mud-markdown-toc{position:relative}.mud-markdown-toc-drawer{position:sticky;overflow:visible;z-index:calc(var(--mud-zindex-appbar) - 2);top:calc(var(--mud-appbar-height) + 16px);float:right}.mud-markdown-toc-drawer-content{width:0;overflow:hidden;opacity:0;visibility:collapse;transition:opacity .3s ease,visibility .3s ease}.mud-markdown-toc-drawer-content.open{width:var(--mud-drawer-width-right);opacity:1;visibility:visible}.mud-markdown-toc-content{margin-right:0;transition:margin-left .3s ease}.mud-markdown-toc-content.open{margin-right:calc(var(--mud-drawer-width-right) + 16px)}.mud-markdown-toc-btn-toggle{position:absolute;right:0;z-index:calc(var(--mud-zindex-appbar) - 1)}.mud-markdown-toc-nav-menu .mud-nav-link{padding:4px 16px!important}.mud-markdown-toc-nav-menu .mud-nav-link-h2 .mud-nav-link-text{margin-left:20px!important}.mud-markdown-toc-nav-menu .mud-nav-link-h3 .mud-nav-link-text{margin-left:28px!important}.mud-markdown-toc-nav-menu .mud-nav-item{border-left:4px solid var(--mud-palette-text-disabled)}.mud-markdown-toc-nav-menu .mud-nav-item.active{border-left-color:var(--mud-palette-primary)!important;color:var(--mud-palette-primary)!important}.mud-markdown-body .mud-expand-panel-header{padding:16px 12px!important}.mud-markdown-body .mud-expand-panel-content{padding:0 12px 16px 12px!important}
|
||||
.hljs{color:var(--mud-markdown-codehightlight-text);background:var(--mud-markdown-codehightlight-background)}.hljs-subst{color:var(--mud-markdown-codehightlight-text)}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-name,.hljs-template-tag,.hljs-template-variable,.hljs-variable.language_{color:var(--mud-markdown-codehightlight-keyword)}.hljs-type{color:var(--mud-markdown-codehightlight-type)}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:var(--mud-markdown-codehightlight-function)}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-symbol,.hljs-variable{color:var(--mud-markdown-codehightlight-number)}.hljs-string{color:var(--mud-markdown-codehightlight-string)}.hljs-code,.hljs-comment,.hljs-formula{color:var(--mud-markdown-codehightlight-comment)}.hljs-meta{color:var(--mud-markdown-codehightlight-meta)}.mud-markdown-body code:not(.hljs){background:var(--mud-palette-action-disabled-background);color:var(--mud-palette-text-primary)!important;padding:2.5px 7.5px;border-radius:5px}pre code.hljs{display:block!important;overflow-x:auto;padding:1em;width:100%}.mud-markdown-body .mud-markdown-code-highlight,.mud-markdown-body .mud-markdown-code-highlight-sticky{border:1px solid var(--mud-palette-lines-default);border-radius:var(--mud-default-borderradius)}.mud-markdown-body .mud-markdown-code-highlight{position:relative!important}.mud-markdown-body .mud-markdown-code-highlight:hover>.mud-markdown-code-highlight-copybtn{display:block!important}.mud-markdown-code-highlight-copybtn{position:absolute;display:none;top:0;right:0}.mud-markdown-body .mud-markdown-code-highlight-sticky{position:relative;display:flex;flex-direction:column}.mud-markdown-body .mud-markdown-code-highlight-sticky .mud-markdown-code-highlight-copybtn-sticky{position:sticky;align-self:flex-end;z-index:calc(var(--mud-zindex-appbar) - 2);top:calc(var(--mud-appbar-height) + 16px);margin-bottom:-3.5rem}.mud-markdown-body blockquote{border-left:.25em solid var(--mud-palette-text-disabled);color:var(--mud-palette-text-secondary);background-color:var(--mud-palette-table-hover);padding:.25em 1em;margin:.5em 0 1.25em}.mud-markdown-body blockquote p{margin-bottom:0!important}.mud-math{font-family:"Latin Modern Math","STIX Two Math","Cambria Math","Times New Roman",serif;font-size:113.1%;font-style:normal;line-height:normal;white-space:nowrap}.mud-math-block{display:block;text-align:center;margin:.7em 0;padding:.3em 2px;overflow-x:auto;overflow-y:hidden}.mud-math-italic,.mud-math-mi{font-style:italic}.mud-math-op{margin:0 .278em}.mud-math-punct{margin-right:.2em}.mud-math-fn{margin-right:.15em}.mud-math-text{white-space:pre}.mud-math-error{color:red}.mud-math-space{display:inline-block}.mud-math-bold{font-weight:700}.mud-math-bold-italic{font-weight:700;font-style:italic}.mud-math-sans-serif{font-family:sans-serif}.mud-math-monospace{font-family:monospace}.mud-math-scripts{display:inline-flex;align-items:center}.mud-math-sub,.mud-math-subsup,.mud-math-sup{font-size:.7em;margin-left:.05em}.mud-math-sup{align-self:flex-start;margin-top:-.2em}.mud-math-sub{align-self:flex-end;margin-bottom:-.4em}.mud-math-subsup{display:inline-flex;flex-direction:column}.mud-math-subsup>.mud-math-sub,.mud-math-subsup>.mud-math-sup{font-size:1em;margin:0}.mud-math-limits{display:inline-flex;flex-direction:column;align-items:center;vertical-align:middle;margin:0 .15em}.mud-math-over,.mud-math-under{font-size:.7em}.mud-math-largeop{font-size:1.4em;line-height:1}.mud-math-block .mud-math-largeop{font-size:1.8em}.mud-math-frac{display:inline-flex;flex-direction:column;align-items:center;vertical-align:middle;margin:0 .1em}.mud-math:not(.mud-math-block) .mud-math-frac{font-size:.85em}.mud-math-den,.mud-math-num{padding:0 .15em;text-align:center}.mud-math-num{border-bottom:.06em solid currentColor}.mud-math-binom>.mud-math-num{border-bottom:none}.mud-math-sqrt{display:inline-flex;align-items:stretch}.mud-math-index{font-size:.6em;margin-right:-.4em;align-self:flex-start}.mud-math-surd{display:flex;align-items:flex-end;font-size:1.1em}.mud-math-radicand{border-top:.06em solid currentColor;padding:.1em .1em 0 .05em}.mud-math-fenced{display:inline-flex;align-items:center}.mud-math-fence{line-height:1}.mud-math-fenced:has(.mud-math-frac,.mud-math-limits)>.mud-math-fence{font-size:1.8em;font-weight:lighter}.mud-math-accent{position:relative;display:inline-block}.mud-math-accent-mark{position:absolute;top:-.45em;left:0;right:0;text-align:center;font-style:normal;line-height:1}.mud-math-index .mud-math-op,.mud-math-over .mud-math-op,.mud-math-sub .mud-math-op,.mud-math-subsup .mud-math-op,.mud-math-sup .mud-math-op,.mud-math-under .mud-math-op{margin:0 .1em}.mud-math-overline{border-top:.06em solid currentColor;padding-top:.05em}.mud-math-underline{border-bottom:.06em solid currentColor}.mud-math-brace{line-height:.8}.mud-markdown-body .mud-table{margin:0 0 1Line truncated
|
||||
+125
-1
@@ -1 +1,125 @@
|
||||
(()=>{function e(e){if(!e)return;const t=`#${e}`;if(window.location.hash!==t){const e=new URL(window.location.href);e.hash=t,history.replaceState(null,"",e)}}window.appendMathJaxScript=function(e){if(document.getElementById(e))return;const t=document.createElement("script");t.id=e,t.type="text/javascript",t.src="_content/MudBlazor.Markdown/MudBlazor.Markdown.MathJax.min.js",document.head.appendChild(t)},window.refreshMathJaxScript=function(){try{MathJax.typeset()}catch(e){}},window.MudBlazorMarkdown={scrollToElementId:function(t,n){const o=document.getElementById(t);o&&(e(t),n&&n.invokeMethodAsync("OnActiveElementChangedAsync",t),MudBlazorMarkdown.tableOfContents.scrollLock++,o.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}),setTimeout((()=>{MudBlazorMarkdown.tableOfContents.scrollLock--,MudBlazorMarkdown.tableOfContents.scrollLock<0&&(MudBlazorMarkdown.tableOfContents.scrollLock=0)}),1e3))},copyTextToClipboard:async function(e){try{return await navigator.clipboard.writeText(e),!0}catch(e){return!1}},tableOfContents:{scrollLock:0,handleRefs:{},activeElementIds:{},startScrollSpy:function(t,n){if(!t)return;const o=document.getElementById(t);if(!o)return;const r=o.querySelectorAll(".mud-markdown-toc-heading");if(!r.length)return;const c=document.querySelector(".mud-appbar"),l=c?.getBoundingClientRect().height??0,a=()=>{if(MudBlazorMarkdown.tableOfContents.scrollLock>0)return;let o,c=-Number.MAX_VALUE;for(const e of r){const t=e.getBoundingClientRect().top-l;t>0||t<c||(c=t,o=e.id)}o||(o=r[0]?.id),o!==this.activeElementIds[t]&&(this.activeElementIds[t]=o,e(o),n.invokeMethodAsync("OnActiveElementChangedAsync",o))};this.handleRefs[t]=a,document.addEventListener("scroll",a,!0),document.addEventListener("resize",a,!0),a()},stopScrollSpy:function(e){if(!e)return;const t=this.handleRefs[e];t&&(document.removeEventListener("scroll",t,!0),window.removeEventListener("resize",t,!0),delete this.handleRefs[e],delete this.activeElementIds[e])}}}})();
|
||||
// MudBlazor.Markdown
|
||||
window.MudBlazorMarkdown = {
|
||||
scrollToElementId: function (elementId, dotNetReference) {
|
||||
const element = document.getElementById(elementId);
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
trySetUrlHash(elementId);
|
||||
if (dotNetReference) {
|
||||
dotNetReference.invokeMethodAsync("OnActiveElementChangedAsync", elementId);
|
||||
}
|
||||
|
||||
MudBlazorMarkdown.tableOfContents.scrollLock++;
|
||||
|
||||
element.scrollIntoView({
|
||||
behavior: "smooth",
|
||||
block: "start",
|
||||
inline: "nearest"
|
||||
});
|
||||
|
||||
// Not the best approach, but will do for now
|
||||
setTimeout(() => {
|
||||
MudBlazorMarkdown.tableOfContents.scrollLock--;
|
||||
if (MudBlazorMarkdown.tableOfContents.scrollLock < 0) {
|
||||
MudBlazorMarkdown.tableOfContents.scrollLock = 0;
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
copyTextToClipboard: async function (text) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
tableOfContents: {
|
||||
scrollLock: 0,
|
||||
handleRefs: {},
|
||||
activeElementIds: {},
|
||||
startScrollSpy: function (elementId, dotNetReference) {
|
||||
if (!elementId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const element = document.getElementById(elementId);
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
const headingElements = element.querySelectorAll('.mud-markdown-toc-heading');
|
||||
if (!headingElements.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
const appBar = document.querySelector(".mud-appbar");
|
||||
const pageTop = appBar?.getBoundingClientRect().height ?? 0;
|
||||
|
||||
const handler = () => {
|
||||
if (MudBlazorMarkdown.tableOfContents.scrollLock > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
let maxVisibility = -Number.MAX_VALUE, maxVisibilityElementId = undefined;
|
||||
for (const headingElement of headingElements) {
|
||||
const rect = headingElement.getBoundingClientRect();
|
||||
const relativeVisibility = rect.top - pageTop;
|
||||
|
||||
if (relativeVisibility > 0 || relativeVisibility < maxVisibility) {
|
||||
continue;
|
||||
}
|
||||
|
||||
maxVisibility = relativeVisibility;
|
||||
maxVisibilityElementId = headingElement.id;
|
||||
}
|
||||
|
||||
if (!maxVisibilityElementId) {
|
||||
maxVisibilityElementId = headingElements[0]?.id;
|
||||
}
|
||||
|
||||
const currentActiveElementId = this.activeElementIds[elementId];
|
||||
if (maxVisibilityElementId !== currentActiveElementId) {
|
||||
this.activeElementIds[elementId] = maxVisibilityElementId;
|
||||
trySetUrlHash(maxVisibilityElementId);
|
||||
dotNetReference.invokeMethodAsync("OnActiveElementChangedAsync", maxVisibilityElementId);
|
||||
}
|
||||
};
|
||||
|
||||
this.handleRefs[elementId] = handler;
|
||||
document.addEventListener('scroll', handler, true);
|
||||
document.addEventListener('resize', handler, true);
|
||||
handler();
|
||||
},
|
||||
stopScrollSpy: function (identifier) {
|
||||
if (!identifier) {
|
||||
return;
|
||||
}
|
||||
|
||||
const handler = this.handleRefs[identifier];
|
||||
if (!handler) {
|
||||
return;
|
||||
}
|
||||
|
||||
document.removeEventListener('scroll', handler, true);
|
||||
window.removeEventListener('resize', handler, true);
|
||||
delete this.handleRefs[identifier];
|
||||
delete this.activeElementIds[identifier];
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
function trySetUrlHash(elementId) {
|
||||
if (!elementId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const activeElementIdHref = `#${elementId}`;
|
||||
|
||||
if (window.location.hash !== activeElementIdHref) {
|
||||
const url = new URL(window.location.href);
|
||||
url.hash = activeElementIdHref;
|
||||
history.replaceState(null, "", url);
|
||||
}
|
||||
}
|
||||
@@ -2,4 +2,4 @@
|
||||
* MudBlazor (https://mudblazor.com/)
|
||||
* Copyright (c) 2021 MudBlazor
|
||||
* Licensed under MIT (https://github.com/MudBlazor/MudBlazor/blob/master/LICENSE)
|
||||
*/.mud-primary{background-color:var(--mud-palette-primary) !important}.mud-primary-text{color:var(--mud-palette-primary) !important;--mud-ripple-color: var(--mud-palette-primary) !important}.mud-primary-hover{background-color:var(--mud-palette-primary-hover) !important}@media(hover: hover)and (pointer: fine){.hover\:mud-primary-hover:hover{background-color:var(--mud-palette-primary-hover) !important}}.hover\:mud-primary-hover:focus-visible,.hover\:mud-primary-hover:active{background-color:var(--mud-palette-primary-hover) !important}.mud-border-primary{border-color:var(--mud-palette-primary) !important}.mud-theme-primary{color:var(--mud-palette-primary-text) !important;background-color:var(--mud-palette-primary) !important}.mud-secondary{background-color:var(--mud-palette-secondary) !important}.mud-secondary-text{color:var(--mud-palette-secondary) !important;--mud-ripple-color: var(--mud-palette-secondary) !important}.mud-secondary-hover{background-color:var(--mud-palette-secondary-hover) !important}@media(hover: hover)and (pointer: fine){.hover\:mud-secondary-hover:hover{background-color:var(--mud-palette-secondary-hover) !important}}.hover\:mud-secondary-hover:focus-visible,.hover\:mud-secondary-hover:active{background-color:var(--mud-palette-secondary-hover) !important}.mud-border-secondary{border-color:var(--mud-palette-secondary) !important}.mud-theme-secondary{color:var(--mud-palette-secondary-text) !important;background-color:var(--mud-palette-secondary) !important}.mud-tertiary{background-color:var(--mud-palette-tertiary) !important}.mud-tertiary-text{color:var(--mud-palette-tertiary) !important;--mud-ripple-color: var(--mud-palette-tertiary) !important}.mud-tertiary-hover{background-color:var(--mud-palette-tertiary-hover) !important}@media(hover: hover)and (pointer: fine){.hover\:mud-tertiary-hover:hover{background-color:var(--mud-palette-tertiary-hover) !important}}.hover\:mud-tertiary-hover:focus-visible,.hover\:mud-tertiary-hover:active{background-color:var(--mud-palette-tertiary-hover) !important}.mud-border-tertiary{border-color:var(--mud-palette-tertiary) !important}.mud-theme-tertiary{color:var(--mud-palette-tertiary-text) !important;background-color:var(--mud-palette-tertiary) !important}.mud-info{background-color:var(--mud-palette-info) !important}.mud-info-text{color:var(--mud-palette-info) !important;--mud-ripple-color: var(--mud-palette-info) !important}.mud-info-hover{background-color:var(--mud-palette-info-hover) !important}@media(hover: hover)and (pointer: fine){.hover\:mud-info-hover:hover{background-color:var(--mud-palette-info-hover) !important}}.hover\:mud-info-hover:focus-visible,.hover\:mud-info-hover:active{background-color:var(--mud-palette-info-hover) !important}.mud-border-info{border-color:var(--mud-palette-info) !important}.mud-theme-info{color:var(--mud-palette-info-text) !important;background-color:var(--mud-palette-info) !important}.mud-success{background-color:var(--mud-palette-success) !important}.mud-success-text{color:var(--mud-palette-success) !important;--mud-ripple-color: var(--mud-palette-success) !important}.mud-success-hover{background-color:var(--mud-palette-success-hover) !important}@media(hover: hover)and (pointer: fine){.hover\:mud-success-hover:hover{background-color:var(--mud-palette-success-hover) !important}}.hover\:mud-success-hover:focus-visible,.hover\:mud-success-hover:active{background-color:var(--mud-palette-success-hover) !important}.mud-border-success{border-color:var(--mud-palette-success) !important}.mud-theme-success{color:var(--mud-palette-success-text) !important;background-color:var(--mud-palette-success) !important}.mud-warning{background-color:var(--mud-palette-warning) !important}.mud-warning-text{color:var(--mud-palette-warning) !important;--mud-ripple-color: var(--mud-palette-warning) !important}.mud-warning-hover{background-color:var(--mud-palette-warning-hover) !important}@media(hover: hover)and (pointer: fine){.hover\:mud-warning-hover:hover{background-color:var(--mud-palette-warning-hover) !important}}.hover\:mud-warning-hover:focus-visible,.hover\:mud-warning-hover:active{background-color:var(--mud-palette-warning-hover) !important}.mud-border-warning{border-color:var(--mud-palette-warning) !important}.mud-theme-warning{color:var(--mud-palette-warning-text) !important;background-color:var(--mud-palette-warning) !important}.mud-error{background-color:var(--mud-palette-error) !important}.mud-error-text{color:var(--mud-palette-error) !important;--mud-ripple-color: var(--mud-palette-error) !important}.mud-error-hover{background-color:var(--mud-palette-error-hover) !important}@media(hover: hover)and (pointer: fine){.hover\:mud-error-hover:hover{background-color:var(--mud-palette-error-hover) !important}}.hover\:mud-error-hover:focus-visible,.hover\:mud-error-hover:active{background-color:var(--mud-palette-error-hover) !important}.mud-border-error{border-color:var(--mud-palette-error) !important}.mud-theme-error{color:var(--mud-paleLine truncated
|
||||
*/.mud-primary{background-color:var(--mud-palette-primary) !important}.mud-primary-text{color:var(--mud-palette-primary) !important;--mud-ripple-color: var(--mud-palette-primary) !important}.mud-primary-hover{background-color:var(--mud-palette-primary-hover) !important}@media(hover: hover)and (pointer: fine){.hover\:mud-primary-hover:hover{background-color:var(--mud-palette-primary-hover) !important}}.hover\:mud-primary-hover:focus-visible,.hover\:mud-primary-hover:active{background-color:var(--mud-palette-primary-hover) !important}.mud-border-primary{border-color:var(--mud-palette-primary) !important}.mud-theme-primary{color:var(--mud-palette-primary-text) !important;background-color:var(--mud-palette-primary) !important}.mud-secondary{background-color:var(--mud-palette-secondary) !important}.mud-secondary-text{color:var(--mud-palette-secondary) !important;--mud-ripple-color: var(--mud-palette-secondary) !important}.mud-secondary-hover{background-color:var(--mud-palette-secondary-hover) !important}@media(hover: hover)and (pointer: fine){.hover\:mud-secondary-hover:hover{background-color:var(--mud-palette-secondary-hover) !important}}.hover\:mud-secondary-hover:focus-visible,.hover\:mud-secondary-hover:active{background-color:var(--mud-palette-secondary-hover) !important}.mud-border-secondary{border-color:var(--mud-palette-secondary) !important}.mud-theme-secondary{color:var(--mud-palette-secondary-text) !important;background-color:var(--mud-palette-secondary) !important}.mud-tertiary{background-color:var(--mud-palette-tertiary) !important}.mud-tertiary-text{color:var(--mud-palette-tertiary) !important;--mud-ripple-color: var(--mud-palette-tertiary) !important}.mud-tertiary-hover{background-color:var(--mud-palette-tertiary-hover) !important}@media(hover: hover)and (pointer: fine){.hover\:mud-tertiary-hover:hover{background-color:var(--mud-palette-tertiary-hover) !important}}.hover\:mud-tertiary-hover:focus-visible,.hover\:mud-tertiary-hover:active{background-color:var(--mud-palette-tertiary-hover) !important}.mud-border-tertiary{border-color:var(--mud-palette-tertiary) !important}.mud-theme-tertiary{color:var(--mud-palette-tertiary-text) !important;background-color:var(--mud-palette-tertiary) !important}.mud-info{background-color:var(--mud-palette-info) !important}.mud-info-text{color:var(--mud-palette-info) !important;--mud-ripple-color: var(--mud-palette-info) !important}.mud-info-hover{background-color:var(--mud-palette-info-hover) !important}@media(hover: hover)and (pointer: fine){.hover\:mud-info-hover:hover{background-color:var(--mud-palette-info-hover) !important}}.hover\:mud-info-hover:focus-visible,.hover\:mud-info-hover:active{background-color:var(--mud-palette-info-hover) !important}.mud-border-info{border-color:var(--mud-palette-info) !important}.mud-theme-info{color:var(--mud-palette-info-text) !important;background-color:var(--mud-palette-info) !important}.mud-success{background-color:var(--mud-palette-success) !important}.mud-success-text{color:var(--mud-palette-success) !important;--mud-ripple-color: var(--mud-palette-success) !important}.mud-success-hover{background-color:var(--mud-palette-success-hover) !important}@media(hover: hover)and (pointer: fine){.hover\:mud-success-hover:hover{background-color:var(--mud-palette-success-hover) !important}}.hover\:mud-success-hover:focus-visible,.hover\:mud-success-hover:active{background-color:var(--mud-palette-success-hover) !important}.mud-border-success{border-color:var(--mud-palette-success) !important}.mud-theme-success{color:var(--mud-palette-success-text) !important;background-color:var(--mud-palette-success) !important}.mud-warning{background-color:var(--mud-palette-warning) !important}.mud-warning-text{color:var(--mud-palette-warning) !important;--mud-ripple-color: var(--mud-palette-warning) !important}.mud-warning-hover{background-color:var(--mud-palette-warning-hover) !important}@media(hover: hover)and (pointer: fine){.hover\:mud-warning-hover:hover{background-color:var(--mud-palette-warning-hover) !important}}.hover\:mud-warning-hover:focus-visible,.hover\:mud-warning-hover:active{background-color:var(--mud-palette-warning-hover) !important}.mud-border-warning{border-color:var(--mud-palette-warning) !important}.mud-theme-warning{color:var(--mud-palette-warning-text) !important;background-color:var(--mud-palette-warning) !important}.mud-error{background-color:var(--mud-palette-error) !important}.mud-error-text{color:var(--mud-palette-error) !important;--mud-ripple-color: var(--mud-palette-error) !important}.mud-error-hover{background-color:var(--mud-palette-error-hover) !important}@media(hover: hover)and (pointer: fine){.hover\:mud-error-hover:hover{background-color:var(--mud-palette-error-hover) !important}}.hover\:mud-error-hover:focus-visible,.hover\:mud-error-hover:active{background-color:var(--mud-palette-error-hover) !important}.mud-border-error{border-color:var(--mud-palette-error) !important}.mud-theme-error{color:var(--mud-paleLine truncated
|
||||
@@ -2,7 +2,7 @@
|
||||
* MudBlazor (https://mudblazor.com/)
|
||||
* Copyright (c) 2021 MudBlazor
|
||||
* Licensed under MIT (https://github.com/MudBlazor/MudBlazor/blob/master/LICENSE)
|
||||
*/window.mudDragAndDrop={initDropZone:(e)=>{let t=document.getElementById(e);t.addEventListener("dragover",(o)=>o.preventDefault()),t.addEventListener("dragstart",(o)=>o.dataTransfer.setData("",o.target.id))},makeDropZonesNotRelative:()=>{let e=Array.from(document.getElementsByClassName("mud-drop-item")).filter((o)=>o.getAttribute("index")=="-1");for(let o of e)o.style.position="static";let t=document.getElementsByClassName("mud-drop-zone");for(let o of t)o.style.position="unset"},getDropZoneIdentifierOnPosition:(e,t)=>{let n=document.elementsFromPoint(e,t).find((i)=>i.classList.contains("mud-drop-zone"));if(n)return n.getAttribute("identifier")||"";return""},getDropIndexOnPosition:(e,t,o)=>{let i=document.elementsFromPoint(e,t).find((r)=>r.classList.contains("mud-drop-item")&&r.id!=o);if(i)return i.getAttribute("index")||"";return""},makeDropZonesRelative:()=>{let e=document.getElementsByClassName("mud-drop-zone");for(let o of e)o.style.position="relative";let t=Array.from(document.getElementsByClassName("mud-drop-item")).filter((o)=>o.getAttribute("index")=="-1");for(let o of t)o.style.position="relative"},moveItemByDifference:(e,t,o)=>{let n=document.getElementById(e),i=(Number.parseFloat(n.getAttribute("data-x"))||0)+t,r=(Number.parseFloat(n.getAttribute("data-y"))||0)+o;n.style.webkitTransform=n.style.transform="translate3d("+i+"px, "+r+"px, 10px)",n.setAttribute("data-x",i),n.setAttribute("data-y",r)},resetItem:(e)=>{let t=document.getElementById(e);if(t)t.style.webkitTransform=t.style.transform="",t.setAttribute("data-x",0),t.setAttribute("data-y",0)}};class X{constructor(){this.listenerId=0,this.eventListeners={}}_supportsTextSelection(e){if(!e)return!1;let t=e.tagName?.toUpperCase();if(t==="TEXTAREA")return!0;if(t!=="INPUT")return typeof e.setSelectionRange==="function"||!!e.createTextRange||typeof e.selectionStart==="number";let o=(e.type||"text").toLowerCase();return o==="text"||o==="search"||o==="tel"||o==="url"||o==="password"}focus(e){if(e)e.focus()}blur(e){if(e)e.blur()}focusFirst(e,t=0,o=0){if(e){let n=window.getTabbableElements(e);if(n.length<=o)e.focus();else n[t].focus()}}focusLast(e,t=0,o=0){if(e){let n=window.getTabbableElements(e);if(n.length<=o)e.focus();else n[n.length-t-1].focus()}}saveFocus(e){if(e)e.mudblazor_savedFocus=document.activeElement}restoreFocus(e){if(e){let t=e.mudblazor_savedFocus;if(delete e.mudblazor_savedFocus,t)t.focus()}}selectRange(e,t,o){if(e){if(this._supportsTextSelection(e)){if(e.createTextRange){let n=e.createTextRange();n.collapse(!0),n.moveStart("character",t),n.moveEnd("character",o),n.select()}else if(e.setSelectionRange)e.setSelectionRange(t,o);else if(e.selectionStart)e.selectionStart=t,e.selectionEnd=o}e.focus()}}select(e){if(e)e.select()}getBoundingClientRect(e){if(!e)return;let t=JSON.parse(JSON.stringify(e.getBoundingClientRect()));return t.scrollY=window.scrollY||document.documentElement.scrollTop,t.scrollX=window.scrollX||document.documentElement.scrollLeft,t.windowHeight=window.innerHeight,t.windowWidth=window.innerWidth,t}changeCss(e,t){if(e)e.className=t}removeEventListener(e,t,o){e.removeEventListener(t,this.eventListeners[o]),delete this.eventListeners[o]}addDefaultPreventingHandler(e,t){let o=function(n){if(!n.defaultPrevented)n.preventDefault()};return e.addEventListener(t,o,{passive:!1}),this.eventListeners[++this.listenerId]=o,this.listenerId}removeDefaultPreventingHandler(e,t,o){this.removeEventListener(e,t,o)}addDefaultPreventingHandlers(e,t){let o=[];for(let n of t){let i=this.addDefaultPreventingHandler(e,n);o.push(i)}return o}removeDefaultPreventingHandlers(e,t,o){for(let n=0;n<t.length;++n){let i=t[n],r=o[n];this.removeDefaultPreventingHandler(e,i,r)}}addOnBlurEvent(e,t){if(!e)return;e._mudBlurHandler=function(o){let n=o.relatedTarget;window.setTimeout(()=>{if(!e||!document.contains(e)){window.mudElementRef.removeOnBlurEvent(e);return}let i=document.activeElement,r=n&&document.contains(n)?n:i;if(!!r&&r!==e&&r!==document.body&&r!==document.documentElement)return;if(t)t.invokeMethodAsync("CallOnBlurredAsync").catch((l)=>{console.warn("Error invoking CallOnBlurredAsync, possibly disposed:",l),window.mudElementRef.removeOnBlurEvent(e)});else console.error("No dotNetReference found for blur fallback")},0)},e.addEventListener("blur",e._mudBlurHandler)}removeOnBlurEvent(e){if(!e)return;if(e._mudBlurHandler)e.removeEventListener("blur",e._mudBlurHandler),delete e._mudBlurHandler}}window.mudElementRef=new X;class j{constructor(){this._prompts=new Map,this._handleBeforeUnload=this._handleBeforeUnload.bind(this)}enable(e,t){let o=this._prompts.size>0;if(this._prompts.set(e,t),!o)window.addEventListener("beforeunload",this._handleBeforeUnload)}disable(e){if(!this._prompts.has(e))this._throwPromptNotFound(e);if(this._prompts.delete(e),this._prompts.size===0)window.removeEventListener("beforeunload",this._handleBeforeUnload)}setText(e,t){if(!this._prompts.has(e))this._throwPromptNotFound(e);this._prompts.set(e,t)}handleBeforeNavigation(e){if(!Line truncated
|
||||
*/class j{#n=new WeakMap;#e=null;#t=null;#o=null;#s=!1;attach(e,t){if(!e||this.#n.has(e))return;if(!this.#s){document.addEventListener("pointerdown",(i)=>{if(i.pointerType==="mouse")return;if(!i.isPrimary&&this.#e&&!this.#e.scrub)this.#i();if(this.#t&&!this.#t.chart.contains(i.target))this.#r()},{capture:!0});let o=(i)=>this.#c(i.pointerId);document.addEventListener("pointerup",o,{capture:!0}),document.addEventListener("pointercancel",o,{capture:!0}),this.#s=!0}let n={pointerdown:(o)=>this.#a(e,t,o),pointermove:(o)=>this.#u(e,t,o),touchmove:(o)=>{if(this.#e?.chart===e&&this.#e.scrub&&o.cancelable)o.preventDefault()},click:(o)=>{if(this.#o!==e)return;this.#o=null;let i=Se(e,o.clientX,o.clientY,t);if(i)Pe(i),this.#t={chart:e,target:i}},longPress:(o)=>{if(this.#e?.chart===e&&this.#e.scrub)o.preventDefault()}};e.addEventListener("pointerdown",n.pointerdown),e.addEventListener("pointermove",n.pointermove),e.addEventListener("touchmove",n.touchmove,{passive:!1}),e.addEventListener("click",n.click),e.addEventListener("contextmenu",n.longPress),e.addEventListener("selectstart",n.longPress),this.#n.set(e,n)}detach(e){let t=e?this.#n.get(e):void 0;if(!e||!t)return;if(e.removeEventListener("pointerdown",t.pointerdown),e.removeEventListener("pointermove",t.pointermove),e.removeEventListener("touchmove",t.touchmove),e.removeEventListener("click",t.click),e.removeEventListener("contextmenu",t.longPress),e.removeEventListener("selectstart",t.longPress),this.#n.delete(e),this.#e?.chart===e)this.#i();if(this.#t?.chart===e)this.#r();if(this.#o===e)this.#o=null}#a(e,t,n){if(this.#o=null,n.pointerType==="mouse"||!n.isPrimary)return;if(this.#e)this.#i();let o={chart:e,pointerId:n.pointerId,x:n.clientX,y:n.clientY,scrub:null,hovered:null,hold:setTimeout(()=>{if(this.#e===o&&o.scrub===null&&e.isConnected)this.#l(o),this.#d(o,o.x,o.y,t)},300)};this.#e=o}#u(e,t,n){let o=this.#e;if(o?.chart!==e||o.pointerId!==n.pointerId)return;if(o.scrub===null){let i=Math.abs(n.clientX-o.x),r=Math.abs(n.clientY-o.y);if(Math.hypot(i,r)<8)return;if(r<i*2)this.#l(o);else if(o.scrub=!1,clearTimeout(o.hold),this.#t?.chart===e)this.#r()}if(o.scrub)this.#d(o,n.clientX,n.clientY,t)}#l(e){if(e.scrub=!0,clearTimeout(e.hold),this.#t?.chart===e.chart)e.hovered=this.#t.target,this.#t=null}#d(e,t,n,o){let i=Se(e.chart,t,n,o);if(i&&i!==e.hovered)Pe(i),e.hovered=i}#c(e){let t=this.#e;if(t?.pointerId!==e)return;if(clearTimeout(t.hold),this.#e=null,t.scrub)fe(t.hovered);else if(t.scrub===null)this.#o=t.chart}#i(){clearTimeout(this.#e?.hold),fe(this.#e?.hovered??null),this.#e=null}#r(){fe(this.#t?.target??null),this.#t=null}}function Pe(e){e.dispatchEvent(new MouseEvent("mouseover",{bubbles:!0}))}function fe(e){e?.dispatchEvent(new MouseEvent("mouseout",{bubbles:!0}))}function Se(e,t,n,o){let i=null,r=1/0,s=1/0;for(let l of e.querySelectorAll(".mud-chart-hover-point")){let d=l.getBoundingClientRect(),a=Math.abs(d.left+d.width/2-t),p=Math.abs(d.top+d.height/2-n);if(o?a<r-0.5||a<=r+0.5&&p<s:Math.hypot(a,p)<Math.hypot(r,s))i=l,r=a,s=p}return i}class W{initDropZone(e){let t=document.getElementById(e);t.addEventListener("dragover",(n)=>n.preventDefault()),t.addEventListener("dragstart",(n)=>n.dataTransfer.setData("",n.target.id))}makeDropZonesNotRelative(){let e=Array.from(document.getElementsByClassName("mud-drop-item")).filter((n)=>n.getAttribute("index")=="-1");for(let n of e)n.style.position="static";let t=document.getElementsByClassName("mud-drop-zone");for(let n of t)n.style.position="unset"}getDropZoneIdentifierOnPosition(e,t){let o=document.elementsFromPoint(e,t).find((i)=>i.classList.contains("mud-drop-zone"));if(o)return o.getAttribute("identifier")||"";return""}getDropIndexOnPosition(e,t,n){let i=document.elementsFromPoint(e,t).find((r)=>r.classList.contains("mud-drop-item")&&r.id!=n);if(i)return i.getAttribute("index")||"";return""}makeDropZonesRelative(){let e=document.getElementsByClassName("mud-drop-zone");for(let n of e)n.style.position="relative";let t=Array.from(document.getElementsByClassName("mud-drop-item")).filter((n)=>n.getAttribute("index")=="-1");for(let n of t)n.style.position="relative"}moveItemByDifference(e,t,n){let o=document.getElementById(e),i=(Number.parseFloat(o.getAttribute("data-x")??"")||0)+t,r=(Number.parseFloat(o.getAttribute("data-y")??"")||0)+n;o.style.webkitTransform=o.style.transform="translate3d("+i+"px, "+r+"px, 10px)",o.setAttribute("data-x",String(i)),o.setAttribute("data-y",String(r))}resetItem(e){let t=document.getElementById(e);if(t)t.style.webkitTransform=t.style.transform="",t.setAttribute("data-x","0"),t.setAttribute("data-y","0")}}var We=new Set(["button","checkbox","radio","range","color","file","submit","reset","image"]),Je=new Set(["Control","Alt","AltGraph","Meta","Shift","OS"]),ge="unknown",He=new WeakMap,ve=null;function Ye(){document.addEventListener("keydown",(e)=>{if(e.metaKey||e.altKey||e.ctrlKey||Je.has(e.key))return;ge="keyboard"},!0),document.addEventListener("pointerdown",()=>{ge="pointer"},!0),documenLine truncated
|
||||
|
||||
//# debugId=39804C7932FD99C964756E2164756E21
|
||||
//# debugId=72B246039E99631764756E2164756E21
|
||||
//# sourceMappingURL=MudBlazor.min.js.map
|
||||
Reference in new issue
Block a user