markstream-react 0.0.56-beta.4 → 0.1.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -20
- package/dist/Tooltip-Bs7FyYvs.js +189 -0
- package/dist/codeBlockExtraProps-C_3No_qp.js +8 -0
- package/dist/{index-BQgUvQrW.js → index-uI922Np4.js} +46 -44
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.js +1 -1
- package/dist/index.px.css +1 -1
- package/dist/index.tailwind.css +1 -1
- package/dist/markstream-react.css +1 -1
- package/dist/next.d.ts +67 -126
- package/dist/next.js +1 -1
- package/dist/server.d.ts +66 -122
- package/dist/server.js +1 -1
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.js +1 -1
- package/dist/types/components/CodeBlockNode/PreCodeNode.d.ts +1 -1
- package/dist/types/components/CodeBlockNode/codeTypography.d.ts +4 -3
- package/dist/types/components/CodeBlockNode/streamDiffs.d.ts +2 -0
- package/dist/types/components/NodeRenderer/preloadStreamDiffs.d.ts +1 -0
- package/dist/types/index.d.ts +1 -3
- package/dist/types/next.d.ts +0 -5
- package/dist/types/server-renderer/index.d.ts +0 -2
- package/dist/types/server.d.ts +0 -2
- package/dist/types/types/component-props.d.ts +53 -66
- package/dist/types/types.d.ts +13 -24
- package/dist/types/utils/languageIcon.d.ts +1 -1
- package/package.json +20 -30
- package/dist/Tooltip-DygdyBfV.js +0 -205
- package/dist/codeBlockExtraProps-B08PlQGP.js +0 -8
- package/dist/types/components/CodeBlockNode/monaco.d.ts +0 -1
- package/dist/types/components/CodeBlockNode/monacoThemeRegistry.d.ts +0 -7
- package/dist/types/components/CodeBlockNode/monacoThemeScheduler.d.ts +0 -4
- package/dist/types/components/MarkdownCodeBlockNode/MarkdownCodeBlockNode.d.ts +0 -34
- package/dist/types/components/NodeRenderer/preloadMonaco.d.ts +0 -1
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{jsx as e,Fragment as t,jsxs as n}from"react/jsx-runtime";import a,{useMemo as r}from"react";import{normalizeCustomHtmlTagName as l,hasCustomHtmlComponents as o,tokenizeHtml as s,BLOCKED_HTML_TAGS as i,isHtmlTagHardBlocked as c,isHtmlTagBlocked as h,sanitizeHtmlAttrs as u,isCustomHtmlComponentTag as d,convertHtmlAttrsToProps as m,getHtmlTagFromContent as p}from"stream-markdown-parser";const v=/* @__PURE__ */new Set(["table","code_block","html_block","blockquote","list","list_item","definition_list","footnote","footnote_reference","footnote_anchor","admonition","thematic_break","math_block","thinking","vmr_container"]);function f(e){if(Array.isArray(e)&&0!==e.length)return e.reduce((e,[t,n])=>t?(e["for"===t?"htmlFor":"class"===t?"className":t]=null==n||n,e):e,{})}function g(t,n,a,r){if(!Array.isArray(t)||0===t.length)return null;const l=[];for(let o=0;o<t.length;o++){const s=t[o];if(s){if("label_open"===s.type){const i=[];for(o++;o<t.length;){const e=t[o];if("label_close"===(null==e?void 0:e.type))break;e&&i.push(e),o++}const c=`${a}-label-${o}`;l.push(
|
|
2
|
-
/* @__PURE__ */e("label",{...f(s.attrs),children:g(i,n,`${c}-child`,r)},c));continue}"label_close"!==s.type&&l.push(r(s,`${a}-${o}`,n))}}return l}function w(n,a,r,l){/* @__PURE__ */
|
|
3
|
-
return e(t,{children:g(n,a,`${r}-inline`,l)})}const x=!1;function k(){return x}const y="__global__",b="__MARKSTREAM_REACT_CUSTOM_COMPONENTS_STORE__",N=(()=>{const e=globalThis;if(e[b])return e[b];const t={scopedComponents:{},revision:0,listeners:/* @__PURE__ */new Set};return e[b]=t,t})();function C(){N.revision++;for(const e of Array.from(N.listeners))try{e()}catch{}}function M(e){return N.listeners.add(e),()=>{N.listeners.delete(e)}}function $(){return N.revision}function _(e,t){"string"==typeof e?N.scopedComponents[e]={...t||{}}:N.scopedComponents[y]={...e},C()}function H(e){const t=N.scopedComponents[y]||{};if(!e)return t;const n=N.scopedComponents[e]||{};return t&&0!==Object.keys(t).length?n&&0!==Object.keys(n).length?{...t,...n}:t:n}function z(e){if(e===y)throw new Error("removeCustomComponents: cannot delete global mapping; call clearGlobalCustomComponents instead.");delete N.scopedComponents[e],C()}function B(){delete N.scopedComponents[y],C()}function A(e){return null==e?void 0:e.markstreamDisplay}function j(e,t){return e.markstreamDisplay=t,e}function S(e){return e}function V(e){return e}function L(e){if(!e)return{};const t={};for(const[n,a]of Object.entries(e)){const e=l(n);e&&(t[e]=a)}return t}function O(e,t,n){if(k())for(const a of Object.keys(e))t[a]&&!n.has(a)&&(n.add(a),console.warn(`[markstream-react] "${a}" was provided in both streamingComponents and htmlComponents. The streamingComponents entry will be used for parser-backed rendering.`))}const q='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M30 14v-2h-2V8h-2v4h-2V8h-2v4h-2v2h2v2h-2v2h2v4h2v-4h2v4h2v-4h2v-2h-2v-2Zm-4 2h-2v-2h2Zm-12.437 6A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>',T='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>';let E=null,F=null,P=null;const Z=/* @__PURE__ */new Set;function K(e){E=null!=e?e:null}const I={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",d2lang:"d2",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"},W={"":T,plain:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>',text:T,javascript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ffca28" d="M2 2v12h12V2zm6 6h1v4a1.003 1.003 0 0 1-1 1H7a1.003 1.003 0 0 1-1-1v-1h1v1h1zm3 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>',typescript:'<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 16 16"><path fill="#0288d1" d="M2 2v12h12V2zm4 6h3v1H8v4H7V9H6zm5 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>',jsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00bcd4" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#00bcd4" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#00bcd4" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#00bcd4" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>',tsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#0288d1" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#0288d1" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#0288d1" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>',html:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#e65100" d="m4 4 2 22 10 2 10-2 2-22Zm19.72 7H11.28l.29 3h11.86l-.802 9.335L15.99 25l-6.635-1.646L8.93 19h3.02l.19 2 3.86.77 3.84-.77.29-4H8.84L8 8h16Z"/></svg>',css:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#7e57c2" d="M20 18h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 20 22h2v2h2v-2c0-.388-.562-.851-1.254-1.034C20.356 20.34 20 18.84 20 18m-3.254 2.966C14.356 20.34 14 18.84 14 18h-2v-2h-2v8h2v-2h4v2h2v-2c0-.388-.562-.851-1.254-1.034"/><path fill="#7e57c2" d="M24 4H4v20a4 4 0 0 0 4 4h16.16A3.84 3.84 0 0 0 28 24.16V8a4 4 0 0 0-4-4m2 14h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 26 22v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2Z"/></svg>',scss:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ec407a" d="M27.837 5.673a4.33 4.33 0 0 0-2.293-2.701c-2.362-1.261-6.11-1.298-9.548-.092a26.3 26.3 0 0 0-8.76 4.966c-2.752 2.542-3.438 4.925-3.189 6.194.523 2.668 3.274 4.539 5.485 6.042.418.284.822.559 1.175.816-1.429.76-4.261 2.444-5.088 4.248a3.88 3.88 0 0 0-.118 3.332A2.37 2.37 0 0 0 6.869 29.8a5.6 5.6 0 0 0 1.49.2 6.35 6.35 0 0 0 5.19-2.856 6.74 6.74 0 0 0 .864-5.382 7.3 7.3 0 0 1 2.044-.03 3.92 3.92 0 0 1 2.816 1.311 1.82 1.82 0 0 1 .423 1.262 1.55 1.55 0 0 1-.772 1.05c-.234.14-.586.355-.504.803.036.194.198.633.894.512a2.93 2.93 0 0 0 2.145-2.651 4 4 0 0 0-1.197-2.904 5.94 5.94 0 0 0-4.396-1.626 10.6 10.6 0 0 0-2.672.304 20 20 0 0 0-2.203-1.846c-1.712-1.3-3.33-2.529-3.235-4.26.125-2.263 2.468-4.532 6.964-6.744 4.016-1.976 7.254-2.037 8.944-1.438a2 2 0 0 1 1.204.883 2.77 2.77 0 0 1-.36 2.47 9.71 9.71 0 0 1-7.425 4.304 3.86 3.86 0 0 1-3.238-.757c-.278-.302-.593-.645-1.074-.383q-.565.31-.225 1.189a3.9 3.9 0 0 0 2.407 1.92 11.7 11.7 0 0 0 7.128-.671c3.527-1.35 6.681-5.202 5.756-8.787M11.895 24.475a4 4 0 0 1-.192.468 4.5 4.5 0 0 1-.753 1.081 2.83 2.83 0 0 1-2.533 1.107c-.056-.032-.078-.146-.085-.193a3.28 3.28 0 0 1 1.076-2.284 11.3 11.3 0 0 1 2.644-1.933 3.85 3.85 0 0 1-.157 1.754"/></svg>',json:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="#f9a825" d="M560-160v-80h120q17 0 28.5-11.5T720-280v-80q0-38 22-69t58-44v-14q-36-13-58-44t-22-69v-80q0-17-11.5-28.5T680-720H560v-80h120q50 0 85 35t35 85v80q0 17 11.5 28.5T840-560h40v160h-40q-17 0-28.5 11.5T800-360v80q0 50-35 85t-85 35zm-280 0q-50 0-85-35t-35-85v-80q0-17-11.5-28.5T120-400H80v-160h40q17 0 28.5-11.5T160-600v-80q0-50 35-85t85-35h120v80H280q-17 0-28.5 11.5T240-680v80q0 38-22 69t-58 44v14q36 13 58 44t22 69v80q0 17 11.5 28.5T280-240h120v80z"/></svg>',python:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#0288d1" d="M9.86 2A2.86 2.86 0 0 0 7 4.86v1.68h4.29c.39 0 .71.57.71.96H4.86A2.86 2.86 0 0 0 2 10.36v3.781a2.86 2.86 0 0 0 2.86 2.86h1.18v-2.68a2.85 2.85 0 0 1 2.85-2.86h5.25c1.58 0 2.86-1.271 2.86-2.851V4.86A2.86 2.86 0 0 0 14.14 2zm-.72 1.61c.4 0 .72.12.72.71s-.32.891-.72.891c-.39 0-.71-.3-.71-.89s.32-.711.71-.711"/><path fill="#fdd835" d="M17.959 7v2.68a2.85 2.85 0 0 1-2.85 2.859H9.86A2.85 2.85 0 0 0 7 15.389v3.75a2.86 2.86 0 0 0 2.86 2.86h4.28A2.86 2.86 0 0 0 17 19.14v-1.68h-4.291c-.39 0-.709-.57-.709-.96h7.14A2.86 2.86 0 0 0 22 13.64V9.86A2.86 2.86 0 0 0 19.14 7zM8.32 11.513l-.004.004.038-.004zm6.54 7.276c.39 0 .71.3.71.89a.71.71 0 0 1-.71.71c-.4 0-.72-.12-.72-.71s.32-.89.72-.89"/></svg>',ruby:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#f44336" d="M18.041 3.177c2.24.382 2.879 1.919 2.843 3.527V6.67l-1.013 13.266-13.132.897h.008c-1.093-.044-3.518-.151-3.634-3.545l1.217-2.222 2.462 5.74 2.097-6.77-.045.009.018-.018 6.85 2.186L13.945 9.3l6.53-.409-5.144-4.212 2.71-1.51v.009M3.113 17.252v.017zM6.916 6.874c2.63-2.622 6.033-4.168 7.34-2.844 1.297 1.306-.072 4.523-2.702 7.135-2.666 2.613-6.015 4.248-7.322 2.933-1.306-1.324.036-4.612 2.675-7.224z"/></svg>',go:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00acc1" d="M2 12h4v2H2zm-2 4h6v2H0zm4 4h2v2H4zm16.954-5H14v3h3.239a4.42 4.42 0 0 1-3.531 2 2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 15.292 13a2.73 2.73 0 0 1 1.749.584l2.962-1.185A5.6 5.6 0 0 0 15.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 6.4 6.4 0 0 0 .003-1.5"/><path fill="#00acc1" d="M26.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 5.614 5.614 0 0 0-5.659-6.5m2.681 6.137A4.515 4.515 0 0 1 24.708 20a2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 26.292 13a2.65 2.65 0 0 1 2.053.858 2.86 2.86 0 0 1 .628 2.28Z"/></svg>',java:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#f44336" d="M4 26h24v2H4zM28 4H7a1 1 0 0 0-1 1v13a4 4 0 0 0 4 4h10a4 4 0 0 0 4-4v-4h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m0 8h-4V6h4Z"/></svg>',kotlin:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><defs><linearGradient id="a" x1="1.725" x2="22.185" y1="22.67" y2="1.982" gradientTransform="translate(1.306 1.129)scale(.89324)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7c4dff"/><stop offset=".5" stop-color="#d500f9"/><stop offset="1" stop-color="#ef5350"/></linearGradient></defs><path fill="url(#a)" d="M2.975 2.976v18.048h18.05v-.03l-4.478-4.511-4.48-4.515 4.48-4.515 4.443-4.477z"/></svg>',c:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M19.563 22A5.57 5.57 0 0 1 14 16.437v-2.873A5.57 5.57 0 0 1 19.563 8H24V2h-4.437A11.563 11.563 0 0 0 8 13.563v2.873A11.564 11.564 0 0 0 19.563 28H24v-6Z"/></svg>',cpp:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M28 14v-4h-2v4h-6v-4h-2v4h-4v2h4v4h2v-4h6v4h2v-4h4v-2z"/><path fill="#0288d1" d="M13.563 22A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>',cs:q,csharp:q,php:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#1e88e5" d="M12 18.08c-6.63 0-12-2.72-12-6.08s5.37-6.08 12-6.08S24 8.64 24 12s-5.37 6.08-12 6.08m-5.19-7.95c.54 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.58 1.09q-.42.33-1.29.33h-.87l.53-2.76zm-3.5 5.55h1.44l.34-1.75h1.23c.54 0 .98-.06 1.33-.17.35-.12.67-.31.96-.58.24-.22.43-.46.58-.73.15-.26.26-.56.31-.88.16-.78.05-1.39-.33-1.82-.39-.44-.99-.65-1.82-.65H4.59zm7.25-8.33-1.28 6.58h1.42l.74-3.77h1.14c.36 0 .6.06.71.18s.13.34.07.66l-.57 2.93h1.45l.59-3.07c.13-.62.03-1.07-.27-1.36-.3-.27-.85-.4-1.65-.4h-1.27L12 7.35zM18 10.13c.55 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.57 1.09-.29.22-.72.33-1.3.33h-.85l.5-2.76zm-3.5 5.55h1.44l.34-1.75h1.22c.55 0 1-.06 1.35-.17.35-.12.65-.31.95-.58.24-.22.44-.46.58-.73.15-.26.26-.56.32-.88.15-.78.04-1.39-.34-1.82-.36-.44-.99-.65-1.82-.65h-2.75z"/></svg>',shell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>',powershell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#03a9f4" d="M29.07 6H7.677A1.535 1.535 0 0 0 6.24 7.113l-4.2 17.774A.852.852 0 0 0 2.93 26h21.393a1.535 1.535 0 0 0 1.436-1.113L29.96 7.112A.852.852 0 0 0 29.07 6M8.626 23.797a1.4 1.4 0 0 1-1.814-.31l-.007-.009a1.075 1.075 0 0 1 .315-1.599l9.6-6.061-6.102-5.852-.01-.01a1.068 1.068 0 0 1 .084-1.625l.037-.03a1.38 1.38 0 0 1 1.8.07l7.233 6.957a1.1 1.1 0 0 1 .236.739 1.08 1.08 0 0 1-.412.79c-.074.04-.146.119-10.951 6.935ZM24 22.94A1.135 1.135 0 0 1 22.803 24h-5.634a1.061 1.061 0 1 1 .001-2.112h5.633A1.134 1.134 0 0 1 24 22.938Z"/></svg>',sql:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ffca28" d="M16 24c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-8c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-12C10.477 4 6 4.895 6 6v4c0 1.1 4.475 2 10 2s10-.9 10-2V6c0-1.105-4.477-2-10-2"/></svg>',yaml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#ff5252" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12c0 1.1-.9 2-2 2H6c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2m12 16v-2H9v2zm-4-4v-2H6v2z"/></svg>',markdown:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>',xml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#8bc34a" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.11.89-2 2-2m.12 13.5 3.74 3.74 1.42-1.41-2.33-2.33 2.33-2.33-1.42-1.41zm11.16 0-3.74-3.74-1.42 1.41 2.33 2.33-2.33 2.33 1.42 1.41z"/></svg>',rust:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ff7043" d="m30 12-4-2V6h-4l-2-4-4 2-4-2-2 4H6v4l-4 2 2 4-2 4 4 2v4h4l2 4 4-2 4 2 2-4h4v-4l4-2-2-4ZM6 16a9.9 9.9 0 0 1 .842-4H10v8H6.842A9.9 9.9 0 0 1 6 16m10 10a9.98 9.98 0 0 1-7.978-4H16v-2h-2v-2h4c.819.819.297 2.308 1.179 3.37a1.89 1.89 0 0 0 1.46.63h3.34A9.98 9.98 0 0 1 16 26m-2-12v-2h4a1 1 0 0 1 0 2Zm11.158 6H24a2.006 2.006 0 0 1-2-2 2 2 0 0 0-2-2 3 3 0 0 0 3-3q0-.08-.004-.161A3.115 3.115 0 0 0 19.83 10H8.022a9.986 9.986 0 0 1 17.136 10"/></svg>',vue:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#41b883" d="M1.791 3.851 12 21.471 22.209 3.936V3.85H18.24l-6.18 10.616L5.906 3.851z"/><path fill="#35495e" d="m5.907 3.851 6.152 10.617L18.24 3.851h-3.723L12.084 8.03 9.66 3.85z"/></svg>',mermaid:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>'};function D(e){var t;const n=function(e){if(!e)return"";const t=e.trim();if(!t)return"";const[n]=t.split(/\s+/),[a]=n.split(":");return a.toLowerCase()}(e);return null!=(t=I[n])?t:n}function G(e){const t=D(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}async function U(){return F||(P||(P=import("./languageIconExtended-DRR7G3nV.js").then(e=>(F=e.EXTENDED_LANGUAGE_ICON_MAP,function(){for(const e of Z)try{e()}catch{}}(),F)).catch(()=>null)),P)}async function R(){await U()}function J(e){return Z.add(e),()=>{Z.delete(e)}}function X(e){if(E){const t=E(e);if(null!=t&&""!==t)return t}const t=D(e),n=W[t];if(n)return n;return(null==F?void 0:F[t])||(U(),'<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>')}const Q={javascript:"JavaScript",typescript:"TypeScript",jsx:"JSX",tsx:"TSX",shell:"Shell",plain:"Text",text:"Text",markdown:"Markdown",json:"JSON",python:"Python",cpp:"C++",csharp:"C#",vue:"Vue",html:"HTML",css:"CSS",svg:"SVG",mermaid:"Mermaid",d2:"D2"},Y=12;function ee(e){return"number"==typeof e&&Number.isFinite(e)&&e>0?e:void 0}function te(e,t){var n,a,r;const l=null!=(a=null!=(n=ee(null==e?void 0:e.fontSize))?n:ee(t))?a:12,o=null!=(r=ee(null==e?void 0:e.lineHeight))?r:12===l?18:Math.max(12,Math.round(1.5*l));return{fontFamily:"string"==typeof(null==e?void 0:e.fontFamily)&&e.fontFamily.trim()?e.fontFamily.trim():'"SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono", "Courier New", monospace',fontSize:l,lineHeight:o}}function ne(e){var t;return String(null!=(t=String(null!=e?e:"").split(/\s+/g)[0])?t:"").split(":")[0].toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}function ae(e){const t=String(null!=e?e:"");return t?t.split(/\r\n|\n|\r/):[]}function re(e){return e.startsWith("-")&&!e.startsWith("---")}function le(e){return e.startsWith("+")&&!e.startsWith("+++")}function oe(e,t){return n=e[t],!(0===String(null!=n?n:"").trim().length)||t<e.length-1;var n}function se(e,t,n,a,r={}){const l=0===String(null!=e?e:"").trim().length;return{code:e,empty:l,kind:l&&"hunk"!==t&&!r.preserveBlankKind?"context":t,key:n,number:a}}function ie(e,t){const n=ae(e),a=ae(t),r=function(e,t){const n=e.length,a=t.length;if((n+1)*(a+1)>15e5)return null;const r=a+1,l=new Uint16Array((n+1)*(a+1));for(let c=n-1;c>=0;c--)for(let n=a-1;n>=0;n--){const a=c*r+n;e[c]===t[n]?l[a]=l[(c+1)*r+n+1]+1:l[a]=Math.max(l[(c+1)*r+n],l[c*r+n+1])}const o=[];let s=0,i=0;for(;s<n&&i<a;)e[s]===t[i]?(o.push({originalIndex:s,modifiedIndex:i}),s++,i++):l[(s+1)*r+i]>=l[s*r+i+1]?s++:i++;return o}(n,a);if(r){const e=[];let t=0,l=0;for(const o of r){for(;t<o.originalIndex;)e.push(se(n[t],"removed",`inline-removed-source-${t}`,"",{preserveBlankKind:oe(n,t)})),t++;for(;l<o.modifiedIndex;)e.push(se(a[l],"added",`inline-added-source-${l}`,l+1,{preserveBlankKind:oe(a,l)})),l++;e.push(se(a[o.modifiedIndex],"context",`inline-context-source-${o.originalIndex}-${o.modifiedIndex}`,o.modifiedIndex+1)),t=o.originalIndex+1,l=o.modifiedIndex+1}for(;t<n.length;)e.push(se(n[t],"removed",`inline-removed-source-${t}`,"",{preserveBlankKind:oe(n,t)})),t++;for(;l<a.length;)e.push(se(a[l],"added",`inline-added-source-${l}`,l+1,{preserveBlankKind:oe(a,l)})),l++;return e}const l=[];let o=0,s=n.length-1,i=a.length-1;for(;o<=s&&o<=i&&n[o]===a[o];)l.push(se(a[o],"context",`inline-prefix-${o}`,o+1)),o++;const c=[];for(;s>=o&&i>=o&&n[s]===a[i];)c.unshift(se(a[i],"context",`inline-suffix-${i}`,i+1)),s--,i--;for(let h=o;h<=s;h++)l.push(se(n[h],"removed",`inline-removed-source-${h}`,"",{preserveBlankKind:oe(n,h)}));for(let h=o;h<=i;h++)l.push(se(a[h],"added",`inline-added-source-${h}`,h+1,{preserveBlankKind:oe(a,h)}));return l.concat(c)}function ce(e,t=!1,n=ne(null==e?void 0:e.language)){const a=(r=null==e?void 0:e.code,String(null!=r?r:"").split(/\r\n|\n|\r/));var r;if(!function(e,t,n){const a=e.some(e=>re(e)),r=e.some(e=>le(e));return a&&r||function(e,t){var n,a,r;if("diff"===t)return!0;const l=null!=(r=null==(a=String(null!=(n=null==e?void 0:e.raw)?n:"").split(/\r?\n/,1)[0])?void 0:a.trim())?r:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(l)}(t,n)&&(a||r)}(a,e,n)&&function(e){return null!=(null==e?void 0:e.originalCode)||null!=(null==e?void 0:e.updatedCode)}(e)){if(t)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:ie(null==e?void 0:e.originalCode,null==e?void 0:e.updatedCode)}];const n=ae(null==e?void 0:e.originalCode),a=ae(null==e?void 0:e.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:n.map((e,t)=>se(e,a[t]===e?"context":"removed",`original-${t}`,t+1,{preserveBlankKind:oe(n,t)}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:a.map((e,t)=>se(e,n[t]===e?"context":"added",`modified-${t}`,t+1,{preserveBlankKind:oe(a,t)}))}]}if(t){const e=function(e){let t=1;return e.map((e,n)=>e.startsWith("@@")?se(e,"hunk",`inline-hunk-${n}`,""):re(e)?se(e.slice(1),"removed",`inline-removed-${n}`,"",{preserveBlankKind:!0}):le(e)?se(e.slice(1),"added",`inline-added-${n}`,t++,{preserveBlankKind:!0}):se(e.startsWith(" ")?e.slice(1):e,"context",`inline-context-${n}`,t++))}(a);return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:e}]}const l=[],o=[];let s=1,i=1;for(const[c,h]of a.entries())if(h.startsWith("@@"))l.push(se(h,"hunk",`original-hunk-${c}`,"")),o.push(se(h,"hunk",`modified-hunk-${c}`,""));else if(re(h))l.push(se(h.slice(1),"removed",`original-removed-${c}`,s++,{preserveBlankKind:!0}));else if(le(h))o.push(se(h.slice(1),"added",`modified-added-${c}`,i++,{preserveBlankKind:!0}));else{const e=h.startsWith(" ")?h.slice(1):h;l.push(se(e,"context",`original-context-${c}`,s++)),o.push(se(e,"context",`modified-context-${c}`,i++))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:l},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:o}]}function he({node:a,className:l,diffInline:o,showLineNumbers:s,style:i,monacoOptions:c}){const h=r(()=>ne(null==a?void 0:a.language),[a]),u=`language-${h}`,d=h?`Code block: ${h}`:"Code block",m=!0===s&&!0===(null==a?void 0:a.diff),p=r(()=>m?ce(a,!0===o,h):[],[o,m,a,h]),v=r(()=>function(e){var t,n;if(!0===(null==e?void 0:e.diff))return String(null!=(t=null==e?void 0:e.code)?t:"");const a=String(null!=(n=null==e?void 0:e.code)?n:"");return!0===(null==e?void 0:e.loading)?a:a.replace(/\r\n$|\n$|\r$/,"")}(a),[a]),f=r(()=>function(e){let t=1;for(let n=0;n<e.length;n++)"\n"===e[n]?t++:"\r"===e[n]&&(t++,"\n"===e[n+1]&&n++);return t}(v),[v]),g=r(()=>{let e="";for(let t=1;t<=f;t++)e+=`${e?"\n":""}${t}`;return e},[f]),w=r(()=>{if(!0===s&&!m)return{"--markstream-pre-line-number-width":`${Math.max(4,String(f).length)}ch`,"--markstream-code-padding-left":"calc(var(--markstream-pre-line-number-padding-left, 2ch) + var(--markstream-pre-line-number-width, 2ch) + var(--markstream-pre-line-number-padding-right, 1ch) + var(--markstream-pre-line-number-separator-width, 2px) + var(--markstream-pre-line-number-gap-to-code, 1ch))"}},[m,s,f]),x=r(()=>{var e;const t=!0===(null==l?void 0:l.split(/\s+/).includes("code-fallback-plain")),n=t?te(c):{fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',fontSize:16,lineHeight:28},a=t?function(e,t=8){var n,a;const r=null==e?void 0:e.padding;if(!r||"object"!=typeof r)return{top:t,bottom:t};const l=r;return{top:null!=(n=ee(l.top))?n:0,bottom:null!=(a=ee(l.bottom))?a:0}}(c,m?0:8):{top:0,bottom:0};return{"--markstream-pre-line-number-top":`${a.top}px`,fontFamily:n.fontFamily,fontSize:`${n.fontSize}px`,lineHeight:`${n.lineHeight}px`,paddingBottom:`${a.bottom}px`,paddingTop:`${a.top}px`,tabSize:t?null!=(e=ee(null==c?void 0:c.tabSize))?e:4:2,...i,...w}},[l,m,w,c,i]);/* @__PURE__ */
|
|
4
|
-
return e("pre",{className:[u,l,s?"markstream-pre--line-numbers":"",m?"markstream-pre--diff-preview":"",m&&o?"markstream-pre--diff-inline":""].filter(Boolean).join(" "),style:x,"aria-busy":!0===(null==a?void 0:a.loading),"aria-label":d,"data-language":h,"data-markstream-line-numbers":s?"1":void 0,"data-markstream-pre":"1",tabIndex:0,children:m?/* @__PURE__ */e("code",{translate:"no",className:"markstream-pre__diff-code",children:p.map(t=>/* @__PURE__ */e("span",{className:["markstream-pre__diff-pane",t.className].join(" "),children:t.lines.map(t=>/* @__PURE__ */n("span",{className:["markstream-pre__diff-line",`markstream-pre__diff-line--${t.kind}`,t.empty?"markstream-pre__diff-line--empty":""].filter(Boolean).join(" "),children:[
|
|
5
|
-
/* @__PURE__ */e("span",{className:"markstream-pre__diff-rail","aria-hidden":"true"}),
|
|
6
|
-
/* @__PURE__ */e("span",{className:"markstream-pre__diff-number","aria-hidden":"true",children:t.number}),
|
|
7
|
-
/* @__PURE__ */e("span",{className:"markstream-pre__diff-content",children:/* @__PURE__ */e("span",{className:"markstream-pre__diff-content-inner",children:t.code})})]},t.key))},t.key))}):/* @__PURE__ */n(t,{children:[s&&/* @__PURE__ */e("span",{className:"markstream-pre__line-numbers","aria-hidden":"true",children:/* @__PURE__ */e("span",{className:"markstream-pre__line-numbers-text",children:g})}),
|
|
8
|
-
/* @__PURE__ */e("code",{translate:"no",className:"markstream-pre__code",children:v})]})})}function ue(e){return e.startsWith("--")?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function de(e){const t={...e};if(Object.prototype.hasOwnProperty.call(t,"class")&&(t.className=t.class,delete t.class),Object.prototype.hasOwnProperty.call(t,"for")&&(t.htmlFor=t.for,delete t.for),"string"==typeof t.style){const e=function(e){const t=e.trim();if(!t)return;const n={};for(const a of t.split(";")){const e=a.trim();if(!e)continue;const t=e.indexOf(":");if(-1===t)continue;const r=ue(e.slice(0,t).trim()),l=e.slice(t+1).trim();r&&(n[r]=l)}return Object.keys(n).length?n:void 0}(t.style);e?t.style=e:delete t.style}return t}const me=s,pe=u;function ve(e,t){return d(e,t)}function fe(e,t){return o(e,t)}function ge(e,t,n=!1){const a=Object.entries(null!=t?t:{}),r=a.length>0?a.map(([e,t])=>""===t?` ${e}`:` ${e}="${t}"`).join(""):"";return n?`<${e}${r} />`:`<${e}${r}>`}function we(e,t){Array.isArray(t)?e.push(...t):null!=t&&e.push(t)}function xe(e,t){var n,a;return(null==(n=t.nodeComponents)?void 0:n[e])||(null==(a=t.nodeComponents)?void 0:a[e.toLowerCase()])}function ke(e){if(null==e||"boolean"==typeof e)return"";if("string"==typeof e||"number"==typeof e)return String(e);if(Array.isArray(e))return e.map(ke).join("");if(!a.isValidElement(e))return"";const t=e;if("string"!=typeof t.type)return ke(t.props.children);const n=Object.entries(t.props).filter(([e,t])=>"children"!==e&&"key"!==e&&"ref"!==e&&null!=t&&"boolean"!=typeof t).map(([e,t])=>` ${"className"===e?"class":e}="${String(t)}"`).join("");return`<${t.type}${n}>${ke(t.props.children)}</${t.type}>`}function ye(e){return Object.entries(e).map(([e,t])=>[e,""===t?null:t])}function be(e){var t,n;const a=e.sourceNode,r=!0!==(null==(t=e.ctx)?void 0:t.final)&&(!1===(null==(n=e.ctx)?void 0:n.final)||Boolean(null==a?void 0:a.loading));return{loading:r,autoClosed:r||Boolean(null==a?void 0:a.autoClosed)}}function Ne(e,t,n){return function(e,t){var n,a;return Boolean((null==(n=t.propComponents)?void 0:n[e])||(null==(a=t.propComponents)?void 0:a[e.toLowerCase()]))}(e,n)?m(t):t}function Ce(e,t,n,r,o,s,i,c=be(o)){const h=l(e),u=null!=s?s:function(e){return e.map(ke).join("")}(n),d={type:h,tag:h,attrs:ye(t),content:u,raw:null!=i?i:`${ge(e,t)}${u}</${e}>`,loading:c.loading,autoClosed:c.autoClosed};if(o.ctx&&o.renderNode)return o.renderNode(d,r,o.ctx);const m=xe(e,o);return m?a.createElement(m,{key:r,node:d}):null}function Me(e,t,n="safe",r={}){var l,o,s;if(!e)return[];if("escape"===n)return[e];try{const u=me(e);let d=0;const m=null!=(l=r.keyPrefix)?l:"ms-html",p=[],v=[];for(const e of u){if("text"===e.type){if(p.length>0&&p[p.length-1].hardBlocked)continue;(p.length>0?p[p.length-1].children:v).push(null!=(o=e.content)?o:""),p.length>0&&p[p.length-1].sourceParts.push(null!=(s=e.content)?s:"");continue}if("self_closing"===e.type){const l=e.attrs||{},o=ge(e.tagName,l,!0),s=ve(e.tagName,t),u=Boolean(xe(e.tagName,r));if(i.has(e.tagName.toLowerCase())||!s&&!u&&c(e.tagName,n))continue;if(!s&&!u&&h(e.tagName,n)){(p.length>0?p[p.length-1].children:v).push(o),p.length>0&&p[p.length-1].sourceParts.push(o);continue}const f=pe(l,n,e.tagName),g=f.key,w=null!=g&&""!==g?g:`${m}-${d++}`,x=s?t[e.tagName]||t[e.tagName.toLowerCase()]:void 0,k=p.length>0?p[p.length-1].children:v;if(u)k.push(Ce(e.tagName,l,[],w,r,"",o,{loading:!1,autoClosed:!1}));else if(x){const t=Ne(e.tagName,f,r);k.push(a.createElement(x,{...t,key:w}))}else k.push(a.createElement(e.tagName,{...de(f),key:w,suppressHydrationWarning:!0}));p.length>0&&p[p.length-1].sourceParts.push(o);continue}if("tag_open"===e.type){const a=p.length>0&&p[p.length-1].hardBlocked,l=ve(e.tagName,t),o=Boolean(xe(e.tagName,r));p.push({tagName:e.tagName,children:[],attrs:e.attrs,sourceParts:[],customComponent:l||o,hardBlocked:a||i.has(e.tagName.toLowerCase())||!l&&!o&&c(e.tagName,n),softBlocked:!a&&!l&&!o&&h(e.tagName,n)});continue}const l=e.tagName.toLowerCase();let u=-1;for(let e=p.length-1;e>=0;e--)if(p[e].tagName.toLowerCase()===l){u=e;break}if(-1!==u)for(;p.length>u;){const e=p.pop();if(!e)continue;const o=e.sourceParts.join(""),s=`${ge(e.tagName,e.attrs)}${o}</${e.tagName}>`;let i;if(e.hardBlocked)i=null;else if(e.softBlocked)i=[ge(e.tagName,e.attrs),...e.children,`</${e.tagName}>`];else{const c=pe(e.attrs||{},n,e.tagName),h=c.key,u=null!=h&&""!==h?h:`${m}-${d++}`,p=e.customComponent?t[e.tagName]||t[e.tagName.toLowerCase()]:void 0;if(Boolean(xe(e.tagName,r))){const t=e.tagName.toLowerCase()===l?{loading:!1,autoClosed:!1}:be(r);i=Ce(e.tagName,e.attrs||{},e.children,u,r,o,s,t)}else i=p?a.createElement(p,{...Ne(e.tagName,c,r),key:u},...e.children):a.createElement(e.tagName,{...de(c),key:u,suppressHydrationWarning:!0},...e.children)}p.length>0?we(p[p.length-1].children,i):we(v,i),p.length>0&&!e.hardBlocked&&p[p.length-1].sourceParts.push(s)}}for(;p.length>0;){const e=p.pop();if(!e||e.hardBlocked)continue;const l=e.sourceParts.join(""),o=`${ge(e.tagName,e.attrs)}${l}`;if(e.softBlocked){we(v,[ge(e.tagName,e.attrs),...e.children,`</${e.tagName}>`]),p.length>0&&p[p.length-1].sourceParts.push(o);continue}const s=pe(e.attrs||{},n,e.tagName),i=s.key,c=null!=i&&""!==i?i:`${m}-${d++}`,h=e.customComponent?t[e.tagName]||t[e.tagName.toLowerCase()]:void 0;let u;u=Boolean(xe(e.tagName,r))?Ce(e.tagName,e.attrs||{},e.children,c,r,l,o,be(r)):h?a.createElement(h,{...Ne(e.tagName,s,r),key:c},...e.children):a.createElement(e.tagName,{...de(s),key:c,suppressHydrationWarning:!0},...e.children),v.push(u),p.length>0&&p[p.length-1].sourceParts.push(o)}return v}catch{return null}}function $e(e){const t="number"==typeof e?e:Number.parseFloat(String(null!=e?e:""));return Number.isFinite(t)&&t>0?t:null}function _e(e){const t=e.split(/\r?\n/).filter(e=>/^\s*-\s+/.test(e)).length;return t>=3?500:t>0?280+60*t:360}function He(e,t=360,n=500){return null==n?Math.max(t,e):Math.min(Math.max(t,e),n)}function ze(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}function Be(e){const t="number"==typeof e?e:Number.parseFloat(String(null!=e?e:""));return Number.isFinite(t)&&t>0?t:null}function Ae(e){const t=e.split(/\r?\n/).map(e=>e.trim()).filter(e=>e&&!e.startsWith("%%")),n=Math.max(1,t.length),a=function(e){var t;for(const n of e.split(/\r?\n/)){const e=n.trim();if(!e||e.startsWith("%%"))continue;const a=e.match(/^([A-Z][\w-]*)\b/i);return(null==(t=null==a?void 0:a[1])?void 0:t.toLowerCase())||""}return""}(e);return"gantt"===a?220+28*n:"sequencediagram"===a?180+26*n:"classdiagram"===a||"statediagram"===a||"erdiagram"===a?180+24*n:"flowchart"===a||"graph"===a?170+28*n:200+22*n}function je(e,t=360,n=500){return null==n?Math.max(t,e):Math.min(Math.max(t,e),n)}function Se(e,t,n){var a,r;const o=l(e.type),s=(null!=n?n:[]).map(e=>l(e)).filter(Boolean),i="html_inline"===o||"html_block"===o;if(!i&&!s.includes(o))return null;const c=i?l(e.tag)||p(e.content):l(e.tag)||o;if(!c)return null;const h=s.includes(c),u=null!=(r=null!=(a=t[c])?a:t[o])?r:null,d=h||i?u:null;return{tag:c,isWhitelisted:h,component:d,display:A(d)}}function Ve(e,t,n){var a;return"block"===(null==(a=Se(e,t,n))?void 0:a.display)}const Le=/* @__PURE__ */new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function Oe(e,t={}){var n;const a={},r=new Set(null!=(n=t.omit)?n:[]);if(!e||"object"!=typeof e)return a;const l=Object.getOwnPropertyDescriptors(e);for(const[o,s]of Object.entries(l))Le.has(o)||r.has(o)||s.enumerable&&"value"in s&&(a[o]=s.value);return a}export{ee as A,v as B,z as C,w as D,g as E,te as F,Se as G,G as H,pe as I,_ as J,K,M as L,J as M,f as N,me as O,he as P,O as Q,j as R,je as a,B as b,He as c,Y as d,V as e,S as f,_e as g,Ae as h,Oe as i,A as j,$ as k,H as l,X as m,fe as n,ve as o,k as p,Ve as q,Q as r,L as s,de as t,ze as u,D as v,Me as w,Be as x,$e as y,R as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getUseMonaco(): Promise<any>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
type MonacoTheme = any;
|
|
2
|
-
type SetThemeFn = (theme: MonacoTheme, force?: boolean) => Promise<void> | void;
|
|
3
|
-
export declare function subscribeMonacoThemeApplied(listener: () => void): () => void;
|
|
4
|
-
export declare function registerMonacoThemeSetter(setTheme: SetThemeFn | null | undefined): void;
|
|
5
|
-
export declare function setDesiredMonacoTheme(theme: MonacoTheme | null | undefined): void;
|
|
6
|
-
export declare function getDesiredMonacoTheme(): MonacoTheme | null;
|
|
7
|
-
export {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ShikiCodeBlockProps } from '../../types/component-props';
|
|
2
|
-
import { default as React } from 'react';
|
|
3
|
-
export interface MarkdownCodeBlockNodeProps extends ShikiCodeBlockProps {
|
|
4
|
-
node: {
|
|
5
|
-
type: 'code_block';
|
|
6
|
-
language: string;
|
|
7
|
-
code: string;
|
|
8
|
-
raw: string;
|
|
9
|
-
diff?: boolean;
|
|
10
|
-
originalCode?: string;
|
|
11
|
-
updatedCode?: string;
|
|
12
|
-
};
|
|
13
|
-
loading?: boolean;
|
|
14
|
-
stream?: boolean;
|
|
15
|
-
darkTheme?: string;
|
|
16
|
-
lightTheme?: string;
|
|
17
|
-
isDark?: boolean;
|
|
18
|
-
isShowPreview?: boolean;
|
|
19
|
-
enableFontSizeControl?: boolean;
|
|
20
|
-
minWidth?: string | number;
|
|
21
|
-
maxWidth?: string | number;
|
|
22
|
-
showPreviewButton?: boolean;
|
|
23
|
-
showCollapseButton?: boolean;
|
|
24
|
-
showFontSizeButtons?: boolean;
|
|
25
|
-
showTooltips?: boolean;
|
|
26
|
-
onCopy?: (code: string) => void;
|
|
27
|
-
onPreviewCode?: (payload: {
|
|
28
|
-
type: string;
|
|
29
|
-
content: string;
|
|
30
|
-
title: string;
|
|
31
|
-
}) => void;
|
|
32
|
-
}
|
|
33
|
-
export declare function MarkdownCodeBlockNode(rawProps: MarkdownCodeBlockNodeProps): React.JSX.Element;
|
|
34
|
-
export default MarkdownCodeBlockNode;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function preload(mod: any): Promise<void>;
|