mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-18 09:57:59 +00:00
Temporarily added MudBlazor.Markdown to the solution
This is necessary due to issue https://github.com/MyNihongo/MudBlazor.Markdown/issues/247 I created a PR as well: https://github.com/MyNihongo/MudBlazor.Markdown/pull/246
This commit is contained in:
57 files changed
+11216
-1
No files matched your search
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
(function(){"use strict";var __webpack_modules__={351:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)},s=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},a=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))},l=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.AssistiveMmlHandler=e.AssistiveMmlMathDocumentMixin=e.AssistiveMmlMathItemMixin=e.LimitedMmlVisitor=void 0;var c=r(4474),u=r(9259),p=r(7233),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.getAttributes=function(e){return t.prototype.getAttributes.call(this,e).replace(/ ?id=".*?"/,"")},e}(u.SerializedMmlVisitor);function f(t){return function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.assistiveMml=function(t,e){if(void 0===e&&(e=!1),!(this.state()>=c.STATE.ASSISTIVEMML)){if(!this.isEscaped&&(t.options.enableAssistiveMml||e)){var r=t.adaptor,n=t.toMML(this.root).replace(/\n */g,"").replace(/<!--.*?-->/g,""),o=r.firstChild(r.body(r.parse(n,"text/html"))),i=r.node("mjx-assistive-mml",{unselectable:"on",display:this.display?"block":"inline"},[o]);r.setAttribute(r.firstChild(this.typesetRoot),"aria-hidden","true"),r.setStyle(this.typesetRoot,"position","relative"),r.append(this.typesetRoot,i)}this.state(c.STATE.ASSISTIVEMML)}},e}(t)}function d(t){var e;return e=function(t){function e(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=t.apply(this,a([],s(e),!1))||this,o=n.constructor,i=o.ProcessBits;return i.has("assistive-mml")||i.allocate("assistive-mml"),n.visitor=new h(n.mmlFactory),n.options.MathItem=f(n.options.MathItem),"addStyles"in n&&n.addStyles(o.assistiveStyles),n}return o(e,t),e.prototype.toMML=function(t){return this.visitor.visitTree(t)},e.prototype.assistiveMml=function(){var t,e;if(!this.processed.isSet("assistive-mml")){try{for(var r=l(this.math),n=r.next();!n.done;n=r.next()){n.value.assistiveMml(this)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}this.processed.set("assistive-mml")}return this},e.prototype.state=function(e,r){return void 0===r&&(r=!1),t.prototype.state.call(this,e,r),e<c.STATE.ASSISTIVEMML&&this.processed.clear("assistive-mml"),this},e}(t),e.OPTIONS=i(i({},t.OPTIONS),{enableAssistiveMml:!0,renderActions:(0,p.expandable)(i(i({},t.OPTIONS.renderActions),{assistiveMml:[c.STATE.ASSISTIVEMML]}))}),e.assistiveStyles={"mjx-assistive-mml":{position:"absolute !important",top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)",padding:"1px 0px 0px 0px !important",border:"0px !important",display:"block !important",width:"auto !important",overflow:"hidden !important","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"},'mjx-assistive-mml[display="block"]':{width:"100% !important"}},e}e.LimitedMmlVisitor=h,(0,c.newState)("ASSISTIVEMML",153),e.AssistiveMmlMathItemMixin=f,e.AssistiveMmlMathDocumentMixin=d,e.AssistiveMmlHandler=function(t){return t.documentClass=d(t.documentClass),t}},5282:function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=new Map;e.default=r},5445:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.definePropertyLine truncated
|
||||
@@ -0,0 +1,110 @@
|
||||
/* Code */
|
||||
.mud-markdown-body code:not(.hljs) {
|
||||
background: var(--mud-palette-overlay-dark);
|
||||
color: var(--mud-palette-text-primary) !important;
|
||||
padding: 2.5px 7.5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
/* This component is public, so apply styling in all places, not only within mud-markdown-body */
|
||||
pre code.hljs {
|
||||
display: block !important;
|
||||
overflow-x: auto;
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
.mud-markdown-body .snippet-clipboard-content {
|
||||
position: relative !important;
|
||||
}
|
||||
|
||||
.mud-markdown-body .snippet-clipboard-content:hover > .snippet-clipboard-copy-icon {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.mud-markdown-body .snippet-clipboard-content .snippet-clipboard-copy-icon {
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
/* Quote */
|
||||
.mud-markdown-body blockquote {
|
||||
border-left: .25em solid var(--mud-palette-text-disabled);
|
||||
color: var(--mud-palette-text-secondary);
|
||||
background-color: var(--mud-palette-drawer-background);
|
||||
padding: 0.25em 1em;
|
||||
margin: 0.5em 0 1.25em;
|
||||
}
|
||||
|
||||
.mud-markdown-body blockquote p {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
/* Table */
|
||||
.mud-markdown-body table {
|
||||
margin: 1.25em 0;
|
||||
}
|
||||
|
||||
/* Link */
|
||||
.mud-markdown-body .mud-link:hover {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
|
||||
/* List */
|
||||
.mud-markdown-body ul {
|
||||
list-style-type: disc;
|
||||
}
|
||||
|
||||
.mud-markdown-body ul, .mud-markdown-body ol {
|
||||
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;
|
||||
}
|
||||
|
||||
/* Headers */
|
||||
.mud-markdown-body h1, .mud-markdown-body h2 {
|
||||
border-bottom: 1px solid var(--mud-palette-text-disabled);
|
||||
padding-bottom: 0.125em;
|
||||
margin-bottom: 0.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: 0.25em;
|
||||
word-wrap: break-word;
|
||||
margin-bottom: 0.3em !important;
|
||||
}
|
||||
|
||||
.mud-markdown-body .mud-divider {
|
||||
margin: 0.5em 0;
|
||||
height: 0.25em;
|
||||
}
|
||||
|
||||
/* Paragraphs */
|
||||
.mud-markdown-body p {
|
||||
margin-bottom: 1.25em !important;
|
||||
}
|
||||
|
||||
.mud-markdown-body li p, .mud-markdown-body .mud-expand-panel p {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
/* Images */
|
||||
.mud-markdown-body img {
|
||||
max-width: 100%;
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
import hljs from "highlight.js";
|
||||
|
||||
const codeStylesDir = "code-styles";
|
||||
const codeStylesSegment = `/MudBlazor.Markdown/${codeStylesDir}/`;
|
||||
|
||||
window.highlightCodeElement = function (element) {
|
||||
hljs.highlightElement(element);
|
||||
}
|
||||
|
||||
window.setHighlightStylesheet = function (stylesheetPath) {
|
||||
let isFound = false;
|
||||
const stylesheets = document.querySelectorAll("link[rel='stylesheet']");
|
||||
|
||||
for (let i = 0; i < stylesheets.length; i++) {
|
||||
const href = stylesheets[i].getAttribute("href");
|
||||
|
||||
if (!href) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const index = href.indexOf(codeStylesSegment);
|
||||
|
||||
if (index !== -1) {
|
||||
if (!isFound) {
|
||||
isFound = true;
|
||||
const newHref = href.substring(0, index + codeStylesSegment.length) + stylesheetPath;
|
||||
stylesheets[i].setAttribute("href", newHref);
|
||||
} else {
|
||||
stylesheets[i].remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isFound) {
|
||||
const link = document.createElement("link");
|
||||
link.rel = "stylesheet";
|
||||
link.href = `_content/MudBlazor.Markdown/${codeStylesDir}/${stylesheetPath}`;
|
||||
|
||||
document.head.appendChild(link);
|
||||
}
|
||||
}
|
||||
|
||||
window.scrollToElementId = function (elementId) {
|
||||
const element = document.getElementById(elementId);
|
||||
if (element) {
|
||||
const elementIdHref = `#${elementId}`;
|
||||
if (!window.location.pathname.endsWith(elementIdHref)) {
|
||||
history.replaceState(null, "", window.location.pathname + elementIdHref);
|
||||
}
|
||||
|
||||
element.scrollIntoView({
|
||||
behavior: "smooth",
|
||||
block: "start",
|
||||
inline: "nearest"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
window.appendMathJaxScript = function (scriptId) {
|
||||
if (document.getElementById(scriptId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const script = document.createElement("script");
|
||||
script.id = scriptId;
|
||||
script.type = "text/javascript";
|
||||
script.src = "_content/MudBlazor.Markdown/MudBlazor.Markdown.MathJax.min.js";
|
||||
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
|
||||
window.refreshMathJaxScript = function () {
|
||||
try {
|
||||
MathJax.typeset();
|
||||
} catch (e) {
|
||||
// swallow since in some cases MathJax might not be initialized
|
||||
}
|
||||
}
|
||||
|
||||
window.copyTextToClipboard = async function (text) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user