mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-26 21:14:24 +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
+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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user