markstream-react 2.0.4 → 2.0.5

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.
@@ -10,7 +10,7 @@ return t("span",{className:"checkbox-node",children:/* @__PURE__ */t("input",{ty
10
10
  /* @__PURE__ */t("span",{className:"html-preview-frame__dot"}),
11
11
  /* @__PURE__ */t("span",{className:"html-preview-frame__label",children:n.title||`HTML ${r("common.preview")}`})]}),
12
12
  /* @__PURE__ */t("button",{type:"button",className:"html-preview-frame__close"+(n.isDark?" html-preview-frame__close--dark":""),onClick:()=>{var e;return null==(e=n.onClose)?void 0:e.call(n)},children:"×"})]}),
13
- /* @__PURE__ */t("iframe",{className:"html-preview-frame__iframe",sandbox:l,referrerPolicy:"no-referrer",src:"about:blank",srcDoc:i,title:n.title||"Preview"})]})}),document.body)}let Ye=!1,Ze=null,Ge=!1,Je=null;async function Qe(){if(Je)return Je;if(Ze)return Ze;if(Ge)return null;Je=(async()=>{try{const e=function(e){var t,n,r;const o="function"==typeof(null==e?void 0:e.createCodeBlockRuntime)||"function"==typeof(null==e?void 0:e.useMonaco)?e:null==e?void 0:e.default,i=null!=(t=null==o?void 0:o.createCodeBlockRuntime)?t:null==o?void 0:o.useMonaco;return"function"!=typeof i?null:{createCodeBlockRuntime:e=>i.call(o,e),detectLanguage:null==(n=null==o?void 0:o.detectLanguage)?void 0:n.bind(o),preloadStreamDiffs:null==(r=null==o?void 0:o.preloadStreamDiffs)?void 0:r.bind(o)}}(await import("stream-diffs/markstream"));if(e)return await async function(e){Ye||(Ye=!0,(null==e?void 0:e.preloadStreamDiffs)&&await e.preloadStreamDiffs())}(e),Ze=e,Ze}catch{}return Ge=!0,null})();try{return await Je}finally{Je=null}}const et="undefined"!=typeof window?u:s,tt={isShowPreview:!0,loading:!0,stream:!0,enableFontSizeControl:!0,showHeader:!0,showCopyButton:!0,showExpandButton:!0,showPreviewButton:!0,showCollapseButton:!0,showFontSizeButtons:!0};async function nt(e,t){var n;if(t)try{if(!(await t()))return!1}catch{return!1}if("undefined"==typeof window||"function"!=typeof window.requestAnimationFrame)return!1;const r=()=>new Promise(e=>window.requestAnimationFrame(()=>e()));for(let o=0;o<30;o++){await r();const t=null!=(n=e.querySelector([".stream-diffs-shell","[data-stream-diffs-state]"].join(",")))?n:e.firstElementChild;if(!t)continue;const o=t.getBoundingClientRect();if(o.width>0&&o.height>0)return await r(),!0}return!1}function rt(e,t){const n={...t||{}};for(const i of["theme","themes","themeType","language","languages","stream","disableFileHeader","onThemeChange","renderCustomHeader","renderHeaderMetadata","renderHeaderPrefix"])delete n[i];if(!e)return{overflow:"wrap",...n};const r=n.parseDiffOptions&&"object"==typeof n.parseDiffOptions?n.parseDiffOptions:{},o={overflow:"wrap",diffStyle:"split",expandUnchanged:!1,collapsedContextThreshold:5,hunkSeparators:"line-info",parseDiffOptions:{context:2}};return{...o,...n,parseDiffOptions:{...o.parseDiffOptions,...r}}}function ot(e){const t=String(null!=e?e:"").match(/\d+(?:\.\d+)?/g);if(!t||t.length<3)return null;const[n,r,o]=t.slice(0,3).map(Number);return.2126*n+.7152*r+.0722*o}function it(e){var t,n;const r=String(null!=e?e:"").trim().toLowerCase();if(!r||"transparent"===r)return!0;const o=r.match(/^#([0-9a-f]{8})$/);if(o)return 0===Number.parseInt(o[1].slice(6),16);const i=r.match(/^#([0-9a-f]{4})$/);if(i)return 0===Number.parseInt(i[1][3]+i[1][3],16);const l=null==(n=null==(t=r.match(/^(?:rgba?|hsla?)\(([^)]+)\)/))?void 0:t[1])?void 0:n.split(/[\s,/]+/).filter(Boolean);return 4===(null==l?void 0:l.length)&&0===Number(l[3])}function lt(r){var l,a;const u={...tt,...r},{node:m,isDark:h,loading:f,stream:p,isShowPreview:g,enableFontSizeControl:v,darkTheme:y,lightTheme:w,codeBlockOptions:x,themes:k,minWidth:b,maxWidth:C,showHeader:N,showCopyButton:M,showExpandButton:B,showPreviewButton:S,showCollapseButton:T,showFontSizeButtons:L,showLineNumbers:E,showTooltips:D}=u,$=c(null),j=c(null),z=c(null),K=c(null),V=c(null),q=c(null),X=c(null),U=c(0),Y=c(null),Z=c(null),G=Ee(),J=c(null),Q=c(null),ee=c(x),te=c(null),ne=c([]),re=c(null),oe=c(!1),ie=c(void 0),[le,ae]=i(!1),[ce,se]=i(()=>"undefined"==typeof window),[de,ue]=i(!1),[me,he]=i(!1),[fe,pe]=i(!1),[ge,ve]=i(()=>m.language||"plaintext"),[ye,we]=i(()=>P(m.language)),[xe,ke]=i(!1),[be,Ce]=i(!1),[Ne,Me]=i(!1),[Be,Se]=i(!1),[Te,Le]=i(0),{t:De}=Re();s(()=>{oe.current=be},[be]);const $e=o(()=>rt(Boolean(m.diff),x),[x,m.diff]),[Pe,Ae]=i(()=>{var e;const t=Number(null==(e=rt(Boolean(m.diff),x))?void 0:e.fontSize);return Number.isFinite(t)&&t>0?t:A}),[Fe,Ie]=i(Pe),_e=o(()=>!1!==D,[D]),He="boolean"==typeof E?E:!0!==$e.disableLineNumbers,We=c(He),Oe=Number(null==(l=ee.current)?void 0:l.fontSize),je=Number(null==x?void 0:x.fontSize),ze=ee.current!==x&&Number.isFinite(Oe)&&Oe>0&&(!Number.isFinite(je)||je<=0),qe=d(()=>{var e;const t=null!=(e=$e.maxHeight)?e:500;return"number"==typeof t&&Number.isFinite(t)?t:500},[$e.maxHeight]);et(()=>{const e=Number($e.fontSize),t=Number.isFinite(e)&&e>0?e:A;Ae(t),Ie(t)},[$e.fontSize]);const Xe=d(e=>{var t,n,r;if(le)return;const o=$.current,i=z.current;if(!o||!i)return;const l="diff"===q.current?null==(t=i.getDiffEditorView)?void 0:t.call(i):null==(n=i.getEditorView)?void 0:n.call(i);if(!l)return;const a=qe(),c="diff"===q.current,s=c?"important":"";e?(o.style.minHeight="0px",o.style.setProperty("max-height","none",s),o.style.overflow="visible"):(o.style.minHeight="0px",o.style.setProperty("max-height",`${Math.ceil(a)}px`,s),o.style.overflow=c?"hidden":"auto");try{const t=Number((()=>{if("function"==typeof l.getContentHeight)return l.getContentHeight();if(c&&"function"==typeof l.getModifiedEditor){const e=l.getModifiedEditor();if(e&&"function"==typeof e.getContentHeight)return e.getContentHeight()}})());if(Number.isFinite(t)&&t>0){const n=e?t:Math.min(t,a);o.style.setProperty("height",`${Math.ceil(Math.max(1,n))}px`,s)}null==(r=l.layout)||r.call(l)}catch{}},[qe,le]),Ye=d(e=>{if(Xe(e),"undefined"==typeof window||"function"!=typeof window.requestAnimationFrame)return;const t=window.requestAnimationFrame(()=>{Xe(e),window.requestAnimationFrame(()=>Xe(e))});return window.setTimeout(()=>Xe(e),180),()=>window.cancelAnimationFrame(t)},[Xe]),Ze=d(()=>{var e,t;for(const n of ne.current)try{"function"==typeof n?n():null==(e=null==n?void 0:n.dispose)||e.call(n)}catch{}ne.current=[],null==(t=re.current)||t.disconnect(),re.current=null},[]),Ge=d(()=>{var e,t,n;Ze();const r=z.current,o=$.current;if(!r||!o||"diff"!==q.current)return;const i=()=>Ye(oe.current),l=(e,t)=>{try{const n=null==e?void 0:e[t];if("function"!=typeof n)return;const r=n.call(e,i);r&&ne.current.push(r)}catch{}},a=null==(e=r.getDiffEditorView)?void 0:e.call(r),c=null==(t=null==a?void 0:a.getOriginalEditor)?void 0:t.call(a),s=null==(n=null==a?void 0:a.getModifiedEditor)?void 0:n.call(a);if(l(a,"onDidUpdateDiff"),l(c,"onDidContentSizeChange"),l(s,"onDidContentSizeChange"),l(c,"onDidLayoutChange"),l(s,"onDidLayoutChange"),"undefined"!=typeof window&&"function"==typeof window.MutationObserver){const e=new window.MutationObserver(e=>{e.some(e=>"childList"===e.type||"attributes"===e.type&&e.target!==o)&&i()});e.observe(o,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}),re.current=e}},[Ze,Ye]);s(()=>R(()=>{Le(e=>e+1)}),[]),s(()=>{we(P(m.language))},[m.language]);const Je=c(m);Je.current=m;const lt=d(()=>{var e;U.current+=1;try{null==(e=K.current)||e.call(K)}catch{}Ze(),V.current=null,q.current=null,X.current=null,pe(!1),he(!1)},[Ze]),at=o(()=>{var e,t;return h?null!=(e=null!=y?y:null==k?void 0:k[0])?e:"vitesse-dark":null!=(t=null!=w?w:null==k?void 0:k[1])?t:"vitesse-light"},[y,h,w,k]),ct=d(()=>at,[at]),st=o(()=>ct(),[ct]),dt=o(()=>function(e,t){var n;const r=null!=(n=function(e){return"string"==typeof e?e:null}(e))?n:"",o=r.toLowerCase();return o?["dark","night","moon","black","dracula","mocha","frappe","macchiato","palenight","ocean","poimandres","monokai","laserwave","tokyo","slack-dark","rose-pine","github-dark","material-theme","one-dark","catppuccin-mocha","catppuccin-frappe","catppuccin-macchiato"].some(e=>o.includes(e))&&!["light","latte","dawn","lotus"].some(e=>o.includes(e)):t}(st,Boolean(h)),[h,st]),ut=o(()=>m.diff?h?"dark":"light":dt?"dark":"light",[h,m.diff,dt]),mt=o(()=>m.diff?"dark"===ut:dt,[ut,m.diff,dt]),ht=o(()=>{var e;const t=$e,n=F($e,ze?A:Fe),r=function(e){const t="number"==typeof e&&Number.isFinite(e)&&e>=0?e:0;return{top:t,bottom:t}}(null==t?void 0:t.padding),o=m.diff?0:8,i="number"==typeof(null==t?void 0:t.padding)&&Number.isFinite(t.padding)&&t.padding>=0,l=null!=(e=I(null==t?void 0:t.tabSize))?e:4;return{...n,paddingBottom:i?r.bottom:o,paddingTop:i?r.top:o,tabSize:l}},[ze,Fe,m.diff,$e]),ft=o(()=>!!m.diff&&"unified"===$e.diffStyle,[m.diff,$e]),pt=o(()=>{var e,t,n;const r=String(m.diff?null!=(t=null!=(e=m.updatedCode)?e:m.code)?t:"":null!=(n=m.code)?n:"");if(!r)return 1;const o=f?r:r.replace(/\r\n$|\n$|\r$/,"");return Math.max(1,o.split(/\r\n|\r|\n/).length)},[f,m.code,m.diff,m.updatedCode]),gt=o(()=>Math.ceil(pt*ht.lineHeight+ht.paddingTop+ht.paddingBottom),[pt,ht]),vt=o(()=>{const e={"--markstream-code-padding-left":"62px","--markstream-pre-diff-line-height":`${ht.lineHeight}px`,"--markstream-pre-line-number-top":`${ht.paddingTop}px`,"--markstream-pre-line-number-width":"36px","--markstream-pre-line-number-gap":"0px",fontSize:`${ht.fontSize}px`,lineHeight:`${ht.lineHeight}px`,maxHeight:`${qe()}px`,overflow:"auto",paddingBottom:`${ht.paddingBottom}px`,paddingTop:`${ht.paddingTop}px`,tabSize:ht.tabSize,whiteSpace:"scroll"===$e.overflow?"pre":"pre-wrap"};return ht.fontFamily&&(e.fontFamily=ht.fontFamily),e},[qe,ht,$e.overflow]),yt=d(()=>{var e,t,n,r,o;const i=$.current,l=j.current;if(!i||!l)return;if(l.style.removeProperty("--vscode-editor-foreground"),l.style.removeProperty("--vscode-editor-background"),l.style.removeProperty("--vscode-editor-selectionBackground"),i.style.setProperty("--diffs-tab-size",String(ht.tabSize)),"number"==typeof $e.padding&&Number.isFinite($e.padding)&&$e.padding>=0?i.style.setProperty("--diffs-gap-block",`${ht.paddingTop}px`):i.style.removeProperty("--diffs-gap-block"),m.diff)return i.style.removeProperty("--vscode-editor-foreground"),i.style.removeProperty("--vscode-editor-background"),void i.style.removeProperty("--vscode-editor-selectionBackground");const a=i;try{const c="undefined"!=typeof window&&window.getComputedStyle?window.getComputedStyle(a):null,s=String(null!=(e=null==c?void 0:c.getPropertyValue("--vscode-editor-foreground"))?e:"").trim()||String(null!=(t=null==c?void 0:c.color)?t:"").trim(),d=String(null!=(n=null==c?void 0:c.getPropertyValue("--vscode-editor-background"))?n:"").trim(),u=String(null!=(r=null==c?void 0:c.backgroundColor)?r:"").trim(),h=it(d)?it(u)?"":u:d,f=String(null!=(o=null==c?void 0:c.getPropertyValue("--vscode-editor-selectionBackground"))?o:"").trim();if(function(e,t,n,r){if(!n)return!1;const o=ot(e),i=ot(t);return r?null!=o&&o>170||null!=i&&i<110:null!=o&&o<85||null!=i&&i>190}(h,s,"plaintext"===_(String(m.language||ye||ge||"plaintext")),l.classList.contains("is-dark")))return i.style.removeProperty("--vscode-editor-foreground"),i.style.removeProperty("--vscode-editor-background"),void i.style.removeProperty("--vscode-editor-selectionBackground");s?i.style.setProperty("--vscode-editor-foreground",s):i.style.removeProperty("--vscode-editor-foreground"),h?i.style.setProperty("--vscode-editor-background",h):i.style.removeProperty("--vscode-editor-background"),f?i.style.setProperty("--vscode-editor-selectionBackground",f):i.style.removeProperty("--vscode-editor-selectionBackground")}catch{}},[ye,ge,m.diff,m.language,ht,$e]),wt=d(()=>{const e=$e.maxHeight,t={...$e||{},...null==e?{}:{MAX_HEIGHT:e},themes:k?[...k]:void 0,stream:!1,disableFileHeader:!0,disableLineNumbers:!He,fontSize:ht.fontSize,lineHeight:ht.lineHeight,...ht.fontFamily?{fontFamily:ht.fontFamily}:{},theme:st,themeType:h?"dark":"light",onThemeChange(){yt()}};delete t.maxHeight,delete t.padding,delete t.tabSize;const n="string"==typeof t.unsafeCSS?t.unsafeCSS:"";return t.unsafeCSS=["[data-file], [data-diff] { --diffs-min-number-column-width-default: 2ch !important; }",n].filter(Boolean).join("\n"),t},[He,h,ht,st,$e,yt,k]),xt=d(()=>{const e=wt(),t=J.current;if(!t)return J.current=e,e;for(const n of Object.keys(t))n in e||delete t[n];return Object.assign(t,e),t},[wt]),kt=d(e=>{const t=e(xt());return z.current=t,K.current="function"==typeof t.safeClean?()=>t.safeClean():"function"==typeof t.cleanupEditor?()=>t.cleanupEditor():null,t},[xt]),bt=o(()=>{var e;return JSON.stringify({diffStyle:$e.diffStyle,expandUnchanged:$e.expandUnchanged,collapsedContextThreshold:$e.collapsedContextThreshold,hunkSeparators:$e.hunkSeparators,lineDiffType:$e.lineDiffType,maxLineDiffLength:$e.maxLineDiffLength,expansionLineCount:$e.expansionLineCount,context:null==(e=$e.parseDiffOptions)?void 0:e.context})},[$e]);s(()=>{xt()},[$e,xt]),s(()=>()=>{var e,t,n;U.current+=1,null==(e=K.current)||e.call(K),Ze(),K.current=null,V.current=null,q.current=null,X.current=null,z.current=null,Q.current=null,Y.current=null,null==(n=null==(t=Z.current)?void 0:t.destroy)||n.call(t),Z.current=null},[Ze]),s(()=>{var e,t;if("undefined"==typeof window)return;if(ce)return;const n=j.current;if(!n)return;null==(t=null==(e=Z.current)?void 0:e.destroy)||t.call(e);const r=G(n,{rootMargin:"400px"});return Z.current=r,r.isVisible()&&se(!0),r.whenVisible.then(()=>se(!0)),()=>{r.destroy(),Z.current===r&&(Z.current=null)}},[G,ce]),s(()=>{let e=!0;return"undefined"==typeof window?()=>{e=!1}:z.current?(xt(),()=>{e=!1}):((async()=>{try{const t=await Qe();if(!e)return;if(!t)return void ae(!0);const n=t.createCodeBlockRuntime,r=t.detectLanguage;if("function"==typeof r&&(Y.current=r),"function"!=typeof n)return void ae(!0);Q.current=n,kt(n),ue(!0)}catch{e&&ae(!0)}})(),()=>{e=!1})},[kt,xt]),s(()=>{var e;if(!m.language&&!ye&&Y.current)try{const t=Y.current(String(null!=(e=m.code)?e:""));t&&ve(t)}catch{}},[ye,m.code,m.language]);const Ct=o(()=>String(m.language||ye||ge||"plaintext"),[ye,ge,m.language]),Nt=o(()=>P(Ct),[Ct]),Mt=o(()=>_(Nt),[Nt]),Bt=o(()=>"plaintext"===Mt,[Mt]),St=o(()=>H(Nt),[Nt,Te]),Tt=o(()=>!!g&&("html"===Nt||"svg"===Nt),[Nt,g]),Lt=o(()=>{const e=Nt;return e?W[e]||e.charAt(0).toUpperCase()+e.slice(1):W[""]||"Plain Text"},[Nt]),Et=o(()=>{var e;return function(e,t,n){const r=function(e){const t=function(e){var t,n;const r=null!=(n=null==(t=String(null!=e?e:"").split(/\r?\n/,1)[0])?void 0:t.trim())?n:"";if(r.length<3)return"";const o=r[0];if("`"!==o&&"~"!==o||r[1]!==o||r[2]!==o)return"";let i=3;for(;r[i]===o;)i+=1;return r.slice(i).trim()}(e);if(!t)return"";const n=t.split(/\s+/).filter(Boolean);if(!n.length)return"";const r="diff"===n[0]?n.slice(1):n;for(const o of r){const e=o.includes(":")?o.slice(o.indexOf(":")+1):o;if(e&&/[./\\-]/.test(e))return e}return""}(e);return{title:r||t,caption:r?n?`Diff / ${t}`:t:""}}(String(null!=(e=m.raw)?e:""),Lt,Boolean(m.diff))},[Lt,m.diff,m.raw]),Dt=Et.title,$t=Et.caption,Pt=o(()=>{var e,t,n;return m.diff?null!=(t=null!=(e=m.updatedCode)?e:m.code)?t:"":null!=(n=m.code)?n:""},[m.code,m.diff,m.updatedCode]),At=o(()=>{const e=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},t={},n=e(b),r=e(C);return n&&(t.minWidth=n),r&&(t.maxWidth=r),m.diff?(t.color="var(--markstream-diff-shell-fg)",t.borderColor="var(--markstream-diff-shell-border)"):(t.color="var(--vscode-editor-foreground, var(--markstream-code-fallback-fg, var(--code-fg)))",t.backgroundColor="var(--vscode-editor-background, var(--markstream-code-fallback-bg, var(--code-bg)))",t.borderColor="var(--markstream-code-border-color, var(--code-border))"),t},[C,b,m.diff]),Rt=o(()=>{var e,t,n,r;return m.code.length>0||(null!=(t=null==(e=m.originalCode)?void 0:e.length)?t:0)>0||(null!=(r=null==(n=m.updatedCode)?void 0:n.length)?r:0)>0},[m.code,m.originalCode,m.updatedCode]),Ft=!1===p&&f||!1!==p&&f&&!Rt;s(()=>{if(le)return;if(!de)return;if(!me||!ce)return;const e=z.current;xt();const t=()=>{var t;m.diff&&(null==(t=null==e?void 0:e.refreshDiffPresentation)||t.call(e)),yt(),Ne||null==("undefined"!=typeof window&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame(()=>Ye(be)):null)&&Ye(be)};(null==e?void 0:e.setTheme)&&st?Promise.resolve(e.setTheme(st)).then(t).catch(()=>{}):t()},[Ne,me,ut,be,de,m.diff,st,Ye,yt,xt,le,ce]);const It=d(async()=>{var e,t;if(le)return null;if(!ce)return null;if(Ne)return null;if(Ft)return null;const n=z.current,r=$.current;if(!n||!r||!n.createEditor)return null;xt();const o=Je.current,i=o.diff?"diff":"single",l=X.current,a="diff"===i?Boolean(null==(e=n.getDiffEditorView)?void 0:e.call(n)):Boolean(null==(t=n.getEditorView)?void 0:t.call(n));if(q.current===i&&l===r&&a)return null;if(V.current)return V.current;U.current+=1;const c=U.current;he(!0);const s=(async()=>{var e,t,i,l,a,s;try{null==(e=K.current)||e.call(K),q.current=null,X.current=null,pe(!1);const d=Mt;if(o.diff?"function"==typeof n.createDiffEditor?(q.current="diff",await n.createDiffEditor(r,String(null!=(t=o.originalCode)?t:""),String(null!=(i=o.updatedCode)?i:""),d)):(q.current="single",await n.createEditor(r,String(null!=(a=null!=(l=o.updatedCode)?l:o.code)?a:""),d)):(q.current="single",await n.createEditor(r,String(null!=(s=o.code)?s:""),d)),X.current=r,U.current!==c)return;Ge(),yt(),be||Ne||Ye(!1);const u=await Promise.race([nt(r,n.whenVisualReady),new Promise(e=>{window.setTimeout(()=>e(!0),1500)})]);if(U.current!==c)return;if(!u)return;Xe(be),pe(!0)}catch{U.current===c&&(ie.current=Mt,ae(!0))}})().finally(()=>{V.current===s&&(V.current=null)});return V.current=s,s},[Xe,Ge,Ne,be,Mt,Ye,Ft,yt,xt,le,ce]);s(()=>{xt();const e=ee.current!==x;ee.current=x;const t=We.current!==He;We.current=He;const n=te.current;if(te.current=bt,le)return;if(!de)return;let r=!1;if(e||t){const e=Q.current;if(e){lt(),z.current=null,K.current=null;try{kt(e),r=!0}catch{return void ae(!0)}}}const o=Boolean(m.diff&&n!==bt);if(!r&&!o)return;if(!ce||!me&&!r)return;if(Ne||Ft)return;let i=!1;return(async()=>{if(r||lt(),!i)try{await It()}catch{}})(),()=>{i=!0}},[Ne,x,me,He,It,kt,de,bt,m.diff,lt,Ft,xt,le,ce]),s(()=>{if(le){const e=ie.current;if(void 0===e||e===Mt)return;return ie.current=void 0,lt(),void ae(!1)}de&&ce&&(Ne||Ft?lt():It())},[Ne,It,Mt,de,lt,Ft,le,ce]),s(()=>{var e;if(le)return;if(!de)return;if(!ce)return;if(Ne)return;if(Ft)return;const t=z.current;if(!t)return;const n=String(null!=(e=m.code)?e:"");(async()=>{var e,r;let o=ye;if(!o&&Y.current)try{o=P(Y.current(n)),o&&we(o)}catch{}const i=_(o||Nt);if(t.createEditor&&$.current){try{await Promise.resolve(It())}catch{}const e=V.current;if(e)try{await e}catch{}}try{m.diff&&t.updateDiff?await Promise.resolve(t.updateDiff(String(null!=(e=m.originalCode)?e:""),String(null!=(r=m.updatedCode)?r:""),i)):t.updateCode&&await Promise.resolve(t.updateCode(n,i))}catch{}const l=$.current;"true"!==(null==l?void 0:l.getAttribute("data-markstream-enhanced"))&&await nt(l,t.whenVisualReady)&&(Xe(be),pe(!0)),Ye(be)})()},[Xe,Nt,ye,Ne,me,It,be,de,m.code,m.diff,m.originalCode,m.updatedCode,Ye,Ft,le,ce]),s(()=>{if(le)return;if(!de)return;if(!ce)return;if(Ne)return;if(Ft)return;if(!be&&f)return;const e="undefined"!=typeof window&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame(()=>Ye(be)):null;return null==e&&Ye(be),()=>{null!=e&&"undefined"!=typeof window&&"function"==typeof window.cancelAnimationFrame&&window.cancelAnimationFrame(e)}},[Ne,be,f,de,Ye,Ft,le,ce]),s(()=>{var e,t,n;if(!v)return;if(le)return;const r=z.current;if(r){try{const o="diff"===q.current?null==(e=r.getDiffEditorView)?void 0:e.call(r):null==(t=r.getEditorView)?void 0:t.call(r);null==(n=null==o?void 0:o.updateOptions)||n.call(o,{fontSize:Fe})}catch{}Ye(be)}},[v,be,Fe,m.diff,Ye,le]),s(()=>{_e||Ve(!0)},[_e]);const _t=d((e,t)=>{if(!_e)return;const n=e.currentTarget;n&&!n.disabled&&("clientX"in e&&(e.clientX,e.clientY),Ke(n,t,"top",!1,0,mt))},[mt,_e]),Ht=d(()=>{_e&&Ve()},[_e]),Wt=d(async()=>{var e;try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&await navigator.clipboard.writeText(String(Pt)),ke(!0),null==(e=u.onCopy)||e.call(u,String(Pt)),setTimeout(()=>ke(!1),1e3)}catch{}},[u,Pt]),Ot=d(()=>{if(!Tt)return;const e="html"===Nt?"text/html":"image/svg+xml",t="html"===Nt?De("artifacts.htmlPreviewTitle")||"HTML Preview":De("artifacts.svgPreviewTitle")||"SVG Preview";"function"!=typeof u.onPreviewCode?"html"===Nt&&Se(e=>!e):u.onPreviewCode({node:m,artifactType:e,artifactTitle:t,id:`temp-${Nt}-${Date.now()}`})},[Nt,Tt,m,u,De]);/* @__PURE__ */
13
+ /* @__PURE__ */t("iframe",{className:"html-preview-frame__iframe",sandbox:l,referrerPolicy:"no-referrer",src:"about:blank",srcDoc:i,title:n.title||"Preview"})]})}),document.body)}let Ye=!1,Ze=null,Ge=!1,Je=null;async function Qe(){if(Je)return Je;if(Ze)return Ze;if(Ge)return null;Je=(async()=>{try{const e=function(e){var t,n,r;const o="function"==typeof(null==e?void 0:e.createCodeBlockRuntime)||"function"==typeof(null==e?void 0:e.useMonaco)?e:null==e?void 0:e.default,i=null!=(t=null==o?void 0:o.createCodeBlockRuntime)?t:null==o?void 0:o.useMonaco;return"function"!=typeof i?null:{createCodeBlockRuntime:e=>i.call(o,e),detectLanguage:null==(n=null==o?void 0:o.detectLanguage)?void 0:n.bind(o),preloadStreamDiffs:null==(r=null==o?void 0:o.preloadStreamDiffs)?void 0:r.bind(o)}}(await import("stream-diffs/markstream"));if(e)return await async function(e){Ye||(Ye=!0,(null==e?void 0:e.preloadStreamDiffs)&&await e.preloadStreamDiffs())}(e),Ze=e,Ze}catch{}return Ge=!0,null})();try{return await Je}finally{Je=null}}const et="undefined"!=typeof window?u:s,tt={isShowPreview:!0,loading:!0,stream:!0,enableFontSizeControl:!0,showHeader:!0,showCopyButton:!0,showExpandButton:!0,showPreviewButton:!0,showCollapseButton:!0,showFontSizeButtons:!0};async function nt(e,t){var n;if(t)try{if(!(await t()))return!1}catch{return!1}if("undefined"==typeof window||"function"!=typeof window.requestAnimationFrame)return!1;const r=()=>new Promise(e=>window.requestAnimationFrame(()=>e()));for(let o=0;o<30;o++){await r();const t=null!=(n=e.querySelector([".stream-diffs-shell","[data-stream-diffs-state]"].join(",")))?n:e.firstElementChild;if(!t)continue;const o=t.getBoundingClientRect();if(o.width>0&&o.height>0)return await r(),!0}return!1}function rt(e,t){const n={...t||{}};for(const i of["theme","themes","themeType","language","languages","stream","disableFileHeader","onThemeChange","renderCustomHeader","renderHeaderMetadata","renderHeaderPrefix"])delete n[i];if(!e)return{overflow:"wrap",...n};const r=n.parseDiffOptions&&"object"==typeof n.parseDiffOptions?n.parseDiffOptions:{},o={overflow:"wrap",diffStyle:"split",expandUnchanged:!1,collapsedContextThreshold:5,hunkSeparators:"line-info",parseDiffOptions:{context:2}};return{...o,...n,parseDiffOptions:{...o.parseDiffOptions,...r}}}function ot(e){const t=String(null!=e?e:"").match(/\d+(?:\.\d+)?/g);if(!t||t.length<3)return null;const[n,r,o]=t.slice(0,3).map(Number);return.2126*n+.7152*r+.0722*o}function it(e){var t,n;const r=String(null!=e?e:"").trim().toLowerCase();if(!r||"transparent"===r)return!0;const o=r.match(/^#([0-9a-f]{8})$/);if(o)return 0===Number.parseInt(o[1].slice(6),16);const i=r.match(/^#([0-9a-f]{4})$/);if(i)return 0===Number.parseInt(i[1][3]+i[1][3],16);const l=null==(n=null==(t=r.match(/^(?:rgba?|hsla?)\(([^)]+)\)/))?void 0:t[1])?void 0:n.split(/[\s,/]+/).filter(Boolean);return 4===(null==l?void 0:l.length)&&0===Number(l[3])}function lt(r){var l,a;const u={...tt,...r},{node:m,isDark:h,loading:f,stream:p,isShowPreview:g,enableFontSizeControl:v,darkTheme:y,lightTheme:w,codeBlockOptions:x,themes:k,minWidth:b,maxWidth:C,showHeader:N,showCopyButton:M,showExpandButton:B,showPreviewButton:S,showCollapseButton:T,showFontSizeButtons:L,showLineNumbers:E,showTooltips:D}=u,$=c(null),j=c(null),z=c(null),K=c(null),V=c(null),q=c(null),X=c(null),U=c(0),Y=c(null),Z=c(null),G=Ee(),J=c(null),Q=c(null),ee=c(x),te=c(null),ne=c([]),re=c(null),oe=c(!1),ie=c(void 0),[le,ae]=i(!1),[ce,se]=i(()=>"undefined"==typeof window),[de,ue]=i(!1),[me,he]=i(!1),[fe,pe]=i(!1),[ge,ve]=i(()=>m.language||"plaintext"),[ye,we]=i(()=>P(m.language)),[xe,ke]=i(!1),[be,Ce]=i(!1),[Ne,Me]=i(!1),[Be,Se]=i(!1),[Te,Le]=i(0),{t:De}=Re();s(()=>{oe.current=be},[be]);const $e=o(()=>rt(Boolean(m.diff),x),[x,m.diff]),[Pe,Ae]=i(()=>{var e;const t=Number(null==(e=rt(Boolean(m.diff),x))?void 0:e.fontSize);return Number.isFinite(t)&&t>0?t:A}),[Fe,Ie]=i(Pe),_e=o(()=>!1!==D,[D]),He="boolean"==typeof E?E:!0!==$e.disableLineNumbers,We=c(He),Oe=Number(null==(l=ee.current)?void 0:l.fontSize),je=Number(null==x?void 0:x.fontSize),ze=ee.current!==x&&Number.isFinite(Oe)&&Oe>0&&(!Number.isFinite(je)||je<=0),qe=d(()=>{var e;const t=null!=(e=$e.maxHeight)?e:500;return"number"==typeof t&&Number.isFinite(t)?t:500},[$e.maxHeight]);et(()=>{const e=Number($e.fontSize),t=Number.isFinite(e)&&e>0?e:A;Ae(t),Ie(t)},[$e.fontSize]);const Xe=d(e=>{var t,n,r;if(le)return;const o=$.current,i=z.current;if(!o||!i)return;const l="diff"===q.current?null==(t=i.getDiffEditorView)?void 0:t.call(i):null==(n=i.getEditorView)?void 0:n.call(i);if(!l)return;const a=qe(),c="diff"===q.current,s=c?"important":"";e?(o.style.minHeight="0px",o.style.setProperty("max-height","none",s),o.style.overflow="visible"):(o.style.minHeight="0px",o.style.setProperty("max-height",`${Math.ceil(a)}px`,s),o.style.overflow=c?"hidden":"auto");try{const t=Number((()=>{if("function"==typeof l.getContentHeight)return l.getContentHeight();if(c&&"function"==typeof l.getModifiedEditor){const e=l.getModifiedEditor();if(e&&"function"==typeof e.getContentHeight)return e.getContentHeight()}})());if(Number.isFinite(t)&&t>0){const n=e?t:Math.min(t,a);o.style.setProperty("height",`${Math.ceil(Math.max(1,n))}px`,s)}null==(r=l.layout)||r.call(l)}catch{}},[qe,le]),Ye=d(e=>{if(Xe(e),"undefined"==typeof window||"function"!=typeof window.requestAnimationFrame)return;const t=window.requestAnimationFrame(()=>{Xe(e),window.requestAnimationFrame(()=>Xe(e))});return window.setTimeout(()=>Xe(e),180),()=>window.cancelAnimationFrame(t)},[Xe]),Ze=d(()=>{var e,t;for(const n of ne.current)try{"function"==typeof n?n():null==(e=null==n?void 0:n.dispose)||e.call(n)}catch{}ne.current=[],null==(t=re.current)||t.disconnect(),re.current=null},[]),Ge=d(()=>{var e,t,n;Ze();const r=z.current,o=$.current;if(!r||!o||"diff"!==q.current)return;const i=()=>Ye(oe.current),l=(e,t)=>{try{const n=null==e?void 0:e[t];if("function"!=typeof n)return;const r=n.call(e,i);r&&ne.current.push(r)}catch{}},a=null==(e=r.getDiffEditorView)?void 0:e.call(r),c=null==(t=null==a?void 0:a.getOriginalEditor)?void 0:t.call(a),s=null==(n=null==a?void 0:a.getModifiedEditor)?void 0:n.call(a);if(l(a,"onDidUpdateDiff"),l(c,"onDidContentSizeChange"),l(s,"onDidContentSizeChange"),l(c,"onDidLayoutChange"),l(s,"onDidLayoutChange"),"undefined"!=typeof window&&"function"==typeof window.MutationObserver){const e=new window.MutationObserver(e=>{e.some(e=>"childList"===e.type||"attributes"===e.type&&e.target!==o)&&i()});e.observe(o,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}),re.current=e}},[Ze,Ye]);s(()=>R(()=>{Le(e=>e+1)}),[]),s(()=>{we(P(m.language))},[m.language]);const Je=c(m);Je.current=m;const lt=d(()=>{var e;U.current+=1;try{null==(e=K.current)||e.call(K)}catch{}Ze(),V.current=null,q.current=null,X.current=null,pe(!1),he(!1)},[Ze]),at=o(()=>{var e,t;return h?null!=(e=null!=y?y:null==k?void 0:k[0])?e:"vitesse-dark":null!=(t=null!=w?w:null==k?void 0:k[1])?t:"vitesse-light"},[y,h,w,k]),ct=d(()=>at,[at]),st=o(()=>ct(),[ct]),dt=o(()=>function(e,t){var n;const r=null!=(n=function(e){return"string"==typeof e?e:null}(e))?n:"",o=r.toLowerCase();return o?["dark","night","moon","black","dracula","mocha","frappe","macchiato","palenight","ocean","poimandres","monokai","laserwave","tokyo","slack-dark","rose-pine","github-dark","material-theme","one-dark","catppuccin-mocha","catppuccin-frappe","catppuccin-macchiato"].some(e=>o.includes(e))&&!["light","latte","dawn","lotus"].some(e=>o.includes(e)):t}(st,Boolean(h)),[h,st]),ut=o(()=>m.diff?h?"dark":"light":dt?"dark":"light",[h,m.diff,dt]),mt=o(()=>m.diff?"dark"===ut:dt,[ut,m.diff,dt]),ht=o(()=>{var e;const t=$e,n=F($e,ze?A:Fe),r=function(e){const t="number"==typeof e&&Number.isFinite(e)&&e>=0?e:0;return{top:t,bottom:t}}(null==t?void 0:t.padding),o=m.diff?0:8,i="number"==typeof(null==t?void 0:t.padding)&&Number.isFinite(t.padding)&&t.padding>=0,l=null!=(e=I(null==t?void 0:t.tabSize))?e:4;return{...n,paddingBottom:i?r.bottom:o,paddingTop:i?r.top:o,tabSize:l}},[ze,Fe,m.diff,$e]),ft=o(()=>!!m.diff&&"unified"===$e.diffStyle,[m.diff,$e]),pt=o(()=>{var e,t,n;const r=String(m.diff?null!=(t=null!=(e=m.updatedCode)?e:m.code)?t:"":null!=(n=m.code)?n:"");if(!r)return 1;const o=f?r:r.replace(/\r\n$|\n$|\r$/,"");return Math.max(1,o.split(/\r\n|\r|\n/).length)},[f,m.code,m.diff,m.updatedCode]),gt=o(()=>Math.ceil(pt*ht.lineHeight+ht.paddingTop+ht.paddingBottom),[pt,ht]),vt=o(()=>{const e={"--markstream-code-padding-left":"62px","--markstream-pre-diff-line-height":`${ht.lineHeight}px`,"--markstream-pre-line-number-top":`${ht.paddingTop}px`,"--markstream-pre-line-number-width":"36px","--markstream-pre-line-number-gap":"0px",fontSize:`${ht.fontSize}px`,lineHeight:`${ht.lineHeight}px`,maxHeight:`${qe()}px`,overflow:"auto",paddingBottom:`${ht.paddingBottom}px`,paddingTop:`${ht.paddingTop}px`,tabSize:ht.tabSize,whiteSpace:"scroll"===$e.overflow?"pre":"pre-wrap"};return ht.fontFamily&&(e.fontFamily=ht.fontFamily),e},[qe,ht,$e.overflow]),yt=d(()=>{var e,t,n,r,o;const i=$.current,l=j.current;if(!i||!l)return;if(l.style.removeProperty("--vscode-editor-foreground"),l.style.removeProperty("--vscode-editor-background"),l.style.removeProperty("--vscode-editor-selectionBackground"),i.style.setProperty("--diffs-tab-size",String(ht.tabSize)),"number"==typeof $e.padding&&Number.isFinite($e.padding)&&$e.padding>=0?i.style.setProperty("--diffs-gap-block",`${ht.paddingTop}px`):i.style.removeProperty("--diffs-gap-block"),m.diff)return i.style.removeProperty("--vscode-editor-foreground"),i.style.removeProperty("--vscode-editor-background"),void i.style.removeProperty("--vscode-editor-selectionBackground");const a=i;try{const c="undefined"!=typeof window&&window.getComputedStyle?window.getComputedStyle(a):null,s=String(null!=(e=null==c?void 0:c.getPropertyValue("--vscode-editor-foreground"))?e:"").trim()||String(null!=(t=null==c?void 0:c.color)?t:"").trim(),d=String(null!=(n=null==c?void 0:c.getPropertyValue("--vscode-editor-background"))?n:"").trim(),u=String(null!=(r=null==c?void 0:c.backgroundColor)?r:"").trim(),h=it(d)?it(u)?"":u:d,f=String(null!=(o=null==c?void 0:c.getPropertyValue("--vscode-editor-selectionBackground"))?o:"").trim();if(function(e,t,n,r){if(!n)return!1;const o=ot(e),i=ot(t);return r?null!=o&&o>170||null!=i&&i<110:null!=o&&o<85||null!=i&&i>190}(h,s,"plaintext"===_(String(m.language||ye||ge||"plaintext")),l.classList.contains("is-dark")))return i.style.removeProperty("--vscode-editor-foreground"),i.style.removeProperty("--vscode-editor-background"),void i.style.removeProperty("--vscode-editor-selectionBackground");s?i.style.setProperty("--vscode-editor-foreground",s):i.style.removeProperty("--vscode-editor-foreground"),h?i.style.setProperty("--vscode-editor-background",h):i.style.removeProperty("--vscode-editor-background"),f?i.style.setProperty("--vscode-editor-selectionBackground",f):i.style.removeProperty("--vscode-editor-selectionBackground")}catch{}},[ye,ge,m.diff,m.language,ht,$e]),wt=d(()=>{const e=$e.maxHeight,t={...$e||{},...null==e?{}:{MAX_HEIGHT:e},themes:k?[...k]:void 0,stream:!1,disableFileHeader:!0,disableLineNumbers:!He,fontSize:ht.fontSize,lineHeight:ht.lineHeight,...ht.fontFamily?{fontFamily:ht.fontFamily}:{},theme:st,themeType:h?"dark":"light",onThemeChange(){yt()}};delete t.maxHeight,delete t.padding,delete t.tabSize;const n="string"==typeof t.unsafeCSS?t.unsafeCSS:"";return t.unsafeCSS=["[data-file], [data-diff] { --diffs-min-number-column-width-default: 2ch !important; }",n].filter(Boolean).join("\n"),t},[He,h,ht,st,$e,yt,k]),xt=d(()=>{const e=wt(),t=J.current;if(!t)return J.current=e,e;for(const n of Object.keys(t))n in e||delete t[n];return Object.assign(t,e),t},[wt]),kt=d(e=>{const t=e(xt());return z.current=t,K.current="function"==typeof t.safeClean?()=>t.safeClean():"function"==typeof t.cleanupEditor?()=>t.cleanupEditor():null,t},[xt]),bt=o(()=>{var e;return JSON.stringify({diffStyle:$e.diffStyle,expandUnchanged:$e.expandUnchanged,collapsedContextThreshold:$e.collapsedContextThreshold,hunkSeparators:$e.hunkSeparators,lineDiffType:$e.lineDiffType,maxLineDiffLength:$e.maxLineDiffLength,expansionLineCount:$e.expansionLineCount,context:null==(e=$e.parseDiffOptions)?void 0:e.context})},[$e]);s(()=>{xt()},[$e,xt]),s(()=>()=>{var e,t,n;U.current+=1,null==(e=K.current)||e.call(K),Ze(),K.current=null,V.current=null,q.current=null,X.current=null,z.current=null,Q.current=null,Y.current=null,null==(n=null==(t=Z.current)?void 0:t.destroy)||n.call(t),Z.current=null},[Ze]),s(()=>{var e,t;if("undefined"==typeof window)return;if(ce)return;const n=j.current;if(!n)return;null==(t=null==(e=Z.current)?void 0:e.destroy)||t.call(e);const r=G(n,{rootMargin:"400px"});return Z.current=r,r.isVisible()&&se(!0),r.whenVisible.then(()=>se(!0)),()=>{r.destroy(),Z.current===r&&(Z.current=null)}},[G,ce]),s(()=>{let e=!0;return"undefined"==typeof window?()=>{e=!1}:z.current?(xt(),()=>{e=!1}):((async()=>{try{const t=await Qe();if(!e)return;if(!t)return void ae(!0);const n=t.createCodeBlockRuntime,r=t.detectLanguage;if("function"==typeof r&&(Y.current=r),"function"!=typeof n)return void ae(!0);Q.current=n,kt(n),ue(!0)}catch{e&&ae(!0)}})(),()=>{e=!1})},[kt,xt]),s(()=>{var e;if(!m.language&&!ye&&Y.current)try{const t=Y.current(String(null!=(e=m.code)?e:""));t&&ve(t)}catch{}},[ye,m.code,m.language]);const Ct=o(()=>String(m.language||ye||ge||"plaintext"),[ye,ge,m.language]),Nt=o(()=>P(Ct),[Ct]),Mt=o(()=>_(Nt),[Nt]),Bt=o(()=>"plaintext"===Mt,[Mt]),St=o(()=>H(Nt),[Nt,Te]),Tt=o(()=>!!g&&("html"===Nt||"svg"===Nt),[Nt,g]),Lt=o(()=>{const e=Nt;return e?W[e]||e.charAt(0).toUpperCase()+e.slice(1):W[""]||"Plain Text"},[Nt]),Et=o(()=>{var e;return function(e,t,n){const r=function(e){const t=function(e){var t,n;const r=null!=(n=null==(t=String(null!=e?e:"").split(/\r?\n/,1)[0])?void 0:t.trim())?n:"";if(r.length<3)return"";const o=r[0];if("`"!==o&&"~"!==o||r[1]!==o||r[2]!==o)return"";let i=3;for(;r[i]===o;)i+=1;return r.slice(i).trim()}(e);if(!t)return"";const n=t.split(/\s+/).filter(Boolean);if(!n.length)return"";const r="diff"===n[0]?n.slice(1):n;for(const o of r){const e=o.includes(":")?o.slice(o.indexOf(":")+1):o;if(e&&/[./\\-]/.test(e))return e}return""}(e);return{title:r||t,caption:r?n?`Diff / ${t}`:t:""}}(String(null!=(e=m.raw)?e:""),Lt,Boolean(m.diff))},[Lt,m.diff,m.raw]),Dt=Et.title,$t=Et.caption,Pt=o(()=>{var e,t,n;return m.diff?null!=(t=null!=(e=m.updatedCode)?e:m.code)?t:"":null!=(n=m.code)?n:""},[m.code,m.diff,m.updatedCode]),At=o(()=>{const e=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},t={},n=e(b),r=e(C);return n&&(t.minWidth=n),r&&(t.maxWidth=r),m.diff?(t.color="var(--markstream-diff-shell-fg)",t.borderColor="var(--markstream-diff-shell-border)"):(t.color="var(--vscode-editor-foreground, var(--markstream-code-fallback-fg, var(--code-fg)))",t.backgroundColor="var(--vscode-editor-background, var(--markstream-code-fallback-bg, var(--code-bg)))",t.borderColor="var(--markstream-code-border-color, var(--code-border))"),t},[C,b,m.diff]),Rt=o(()=>{var e,t,n,r;return m.code.length>0||(null!=(t=null==(e=m.originalCode)?void 0:e.length)?t:0)>0||(null!=(r=null==(n=m.updatedCode)?void 0:n.length)?r:0)>0},[m.code,m.originalCode,m.updatedCode]),Ft=!1===p&&f||!1!==p&&f&&!Rt;s(()=>{if(le)return;if(!de)return;if(!me||!ce)return;const e=z.current;xt();const t=()=>{var t;m.diff&&(null==(t=null==e?void 0:e.refreshDiffPresentation)||t.call(e)),yt(),Ne||null==("undefined"!=typeof window&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame(()=>Ye(be)):null)&&Ye(be)};(null==e?void 0:e.setTheme)&&st?Promise.resolve(e.setTheme(st)).then(t).catch(()=>{}):t()},[Ne,me,ut,be,de,m.diff,st,Ye,yt,xt,le,ce]);const It=d(async()=>{var e,t;if(le)return null;if(!ce)return null;if(Ne)return null;if(Ft)return null;const n=z.current,r=$.current;if(!n||!r||!n.createEditor)return null;xt();const o=Je.current,i=o.diff?"diff":"single",l=X.current,a="diff"===i?Boolean(null==(e=n.getDiffEditorView)?void 0:e.call(n)):Boolean(null==(t=n.getEditorView)?void 0:t.call(n));if(q.current===i&&l===r&&a)return null;if(V.current)return V.current;U.current+=1;const c=U.current;he(!0);const s=(async()=>{var e,t,i,l,a,s;try{null==(e=K.current)||e.call(K),q.current=null,X.current=null,pe(!1);const d=Mt;if(o.diff?"function"==typeof n.createDiffEditor?(q.current="diff",await n.createDiffEditor(r,String(null!=(t=o.originalCode)?t:""),String(null!=(i=o.updatedCode)?i:""),d)):(q.current="single",await n.createEditor(r,String(null!=(a=null!=(l=o.updatedCode)?l:o.code)?a:""),d)):(q.current="single",await n.createEditor(r,String(null!=(s=o.code)?s:""),d)),X.current=r,U.current!==c)return;Ge(),yt(),be||Ne||Ye(!1);const u=await Promise.race([nt(r,n.whenVisualReady),new Promise(e=>{window.setTimeout(()=>e(!0),1500)})]);if(U.current!==c)return;if(!u)return;Xe(be),pe(!0)}catch{U.current===c&&(ie.current=Mt,ae(!0))}})().finally(()=>{V.current===s&&(V.current=null)});return V.current=s,s},[Xe,Ge,Ne,be,Mt,Ye,Ft,yt,xt,le,ce]);s(()=>{xt();const e=ee.current!==x;ee.current=x;const t=We.current!==He;We.current=He;const n=te.current;if(te.current=bt,le)return;if(!de)return;let r=!1;if(e||t){const e=Q.current;if(e){lt(),z.current=null,K.current=null;try{kt(e),r=!0}catch{return void ae(!0)}}}const o=Boolean(m.diff&&n!==bt);if(!r&&!o)return;if(!ce||!me&&!r)return;if(Ne||Ft)return;let i=!1;return(async()=>{if(r||lt(),!i)try{await It()}catch{}})(),()=>{i=!0}},[Ne,x,me,He,It,kt,de,bt,m.diff,lt,Ft,xt,le,ce]),s(()=>{if(le){const e=ie.current;if(void 0===e||e===Mt)return;return ie.current=void 0,lt(),void ae(!1)}de&&ce&&(Ne||Ft?lt():It())},[Ne,It,Mt,de,lt,Ft,le,ce]),s(()=>{var e;if(le)return;if(!de)return;if(!ce)return;if(Ne)return;if(Ft)return;const t=z.current;if(!t)return;const n=String(null!=(e=m.code)?e:"");(async()=>{var e,r;let o=ye;if(!o&&Y.current)try{o=P(Y.current(n)),o&&we(o)}catch{}const i=_(o||Nt);if(t.createEditor&&$.current){try{await Promise.resolve(It())}catch{}const e=V.current;if(e)try{await e}catch{}}try{m.diff&&t.updateDiff?await Promise.resolve(t.updateDiff(String(null!=(e=m.originalCode)?e:""),String(null!=(r=m.updatedCode)?r:""),i)):t.updateCode&&await Promise.resolve(t.updateCode(n,i))}catch{}const l=$.current;l&&"true"!==l.getAttribute("data-markstream-enhanced")&&await nt(l,t.whenVisualReady)&&(Xe(be),pe(!0)),Ye(be)})()},[Xe,Nt,ye,Ne,me,It,be,de,m.code,m.diff,m.originalCode,m.updatedCode,Ye,Ft,le,ce]),s(()=>{if(le)return;if(!de)return;if(!ce)return;if(Ne)return;if(Ft)return;if(!be&&f)return;const e="undefined"!=typeof window&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame(()=>Ye(be)):null;return null==e&&Ye(be),()=>{null!=e&&"undefined"!=typeof window&&"function"==typeof window.cancelAnimationFrame&&window.cancelAnimationFrame(e)}},[Ne,be,f,de,Ye,Ft,le,ce]),s(()=>{var e,t,n;if(!v)return;if(le)return;const r=z.current;if(r){try{const o="diff"===q.current?null==(e=r.getDiffEditorView)?void 0:e.call(r):null==(t=r.getEditorView)?void 0:t.call(r);null==(n=null==o?void 0:o.updateOptions)||n.call(o,{fontSize:Fe})}catch{}Ye(be)}},[v,be,Fe,m.diff,Ye,le]),s(()=>{_e||Ve(!0)},[_e]);const _t=d((e,t)=>{if(!_e)return;const n=e.currentTarget;n&&!n.disabled&&("clientX"in e&&(e.clientX,e.clientY),Ke(n,t,"top",!1,0,mt))},[mt,_e]),Ht=d(()=>{_e&&Ve()},[_e]),Wt=d(async()=>{var e;try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&await navigator.clipboard.writeText(String(Pt)),ke(!0),null==(e=u.onCopy)||e.call(u,String(Pt)),setTimeout(()=>ke(!1),1e3)}catch{}},[u,Pt]),Ot=d(()=>{if(!Tt)return;const e="html"===Nt?"text/html":"image/svg+xml",t="html"===Nt?De("artifacts.htmlPreviewTitle")||"HTML Preview":De("artifacts.svgPreviewTitle")||"SVG Preview";"function"!=typeof u.onPreviewCode?"html"===Nt&&Se(e=>!e):u.onPreviewCode({node:m,artifactType:e,artifactTitle:t,id:`temp-${Nt}-${Date.now()}`})},[Nt,Tt,m,u,De]);/* @__PURE__ */
14
14
  return e("div",{ref:j,className:["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",mt?"border-gray-700/30":"border-gray-200",f?"is-rendering":"",mt?"is-dark":"",m.diff?"is-diff":"",Bt?"is-plain-text":""].join(" "),style:At,children:[N&&/* @__PURE__ */e("div",{className:"code-block-header",children:[
15
15
  /* @__PURE__ */e("div",{className:"code-header-main",children:[
16
16
  /* @__PURE__ */t("span",{className:"icon-slot h-4 w-4 flex-shrink-0",dangerouslySetInnerHTML:{__html:St}}),
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{A as e,B as a,C as s,a as o,D as r,b as t,E as n,c as d,F as i,d as l,e as m,f as N,H as c,g as k,h as u,i as g,j as p,k as C,I as f,l as h,m as I,n as B,L as D,o as T,p as M,M as L,q as W,r as b,s as K,N as R,P as S,a as X,R as E,S as x,t as H,u as P,v as F,T as O,w as v,x as y,y as _,V as j,W as w,z as A,G as q,J as G,K as U,N as Y,O as z,Q as J,U as Q,Y as V,Z,_ as $,$ as ee,a0 as ae,a1 as se,a2 as oe,a3 as re,a4 as te,a5 as ne,a6 as de,a7 as ie,a8 as le,a9 as me,aa as Ne,ab as ce,ac as ke,ad as ue,ae as ge,af as pe}from"./Tooltip-CthNVTER.js";import{P as Ce,b as fe,e as he,f as Ie,j as Be,l as De,m as Te,q as Me,u as Le,y as We,A as be,G as Ke,I as Re,J as Se,L as Xe,Q as Ee}from"./codeBlockExtraProps-C_3No_qp.js";export{e as AdmonitionNode,a as BlockquoteNode,s as CheckboxNode,o as CodeBlockNode,r as D2BlockNode,t as DefinitionListNode,n as EmojiNode,d as EmphasisNode,i as FallbackComponent,l as FootnoteAnchorNode,m as FootnoteNode,N as FootnoteReferenceNode,c as HardBreakNode,k as HeadingNode,u as HighlightNode,g as HtmlBlockNode,p as HtmlInlineNode,C as HtmlPreviewFrame,f as ImageNode,h as InfographicBlockNode,I as InlineCodeNode,B as InsertNode,D as LinkNode,T as ListItemNode,M as ListNode,L as MERMAID_WORKER_BUSY_CODE,W as MathBlockNode,b as MathInlineNode,K as MermaidBlockNode,R as NodeRenderer,S as ParagraphNode,Ce as PreCodeNode,X as ReactCodeBlockNode,E as ReferenceNode,x as StrikethroughNode,H as StrongNode,P as SubscriptNode,F as SuperscriptNode,O as TableNode,v as TextNode,y as ThematicBreakNode,_ as Tooltip,j as VmrContainerNode,w as WORKER_BUSY_CODE,A as canParseOffthread,fe as clearGlobalCustomComponents,q as clearKaTeXCache,G as clearKaTeXWorker,U as clearMermaidWorker,Y as default,he as defineHtmlComponents,Ie as defineStreamingComponents,z as disableD2,J as enableD2,Q as findPrefixOffthread,Be as getCustomComponentDisplay,De as getCustomNodeComponents,V as getKaTeXBackpressureDefaults,Te as getLanguageIcon,Z as getMermaidWorkerLoad,$ as isD2Enabled,Me as languageMap,Le as normalizeLanguageIdentifier,We as preloadExtendedLanguageIcons,be as removeCustomComponents,ee as renderKaTeXInWorker,ae as renderKaTeXWithBackpressure,se as renderNode,Ke as resolveLanguageId,Re as setCustomComponents,oe as setD2Loader,re as setDefaultI18nMap,te as setKaTeXBackpressureDefaults,ne as setKaTeXCache,de as setKaTeXConcurrencyLimit,ie as setKaTeXWorker,le as setKaTeXWorkerDebug,Se as setLanguageIconResolver,me as setMermaidWorker,Ne as setMermaidWorkerClientDebug,ce as setMermaidWorkerMaxConcurrency,Xe as subscribeLanguageIconsRevision,ke as terminateWorker,ue as useSafeI18n,ge as useSmoothMarkdownStream,pe as waitForKaTeXWorkerSlot,Ee as withMarkstreamComponentDisplay};
1
+ import{A as e,B as a,C as s,a as o,D as r,b as t,E as n,c as d,F as i,d as l,e as m,f as N,H as c,g as k,h as u,i as g,j as p,k as C,I as f,l as h,m as I,n as B,L as D,o as T,p as M,M as L,q as W,r as b,s as K,N as R,P as S,a as X,R as E,S as x,t as H,u as P,v as F,T as O,w as v,x as y,y as _,V as j,W as w,z as A,G as q,J as G,K as U,N as Y,O as z,Q as J,U as Q,Y as V,Z,_ as $,$ as ee,a0 as ae,a1 as se,a2 as oe,a3 as re,a4 as te,a5 as ne,a6 as de,a7 as ie,a8 as le,a9 as me,aa as Ne,ab as ce,ac as ke,ad as ue,ae as ge,af as pe}from"./Tooltip-slY8fSKv.js";import{P as Ce,b as fe,e as he,f as Ie,j as Be,l as De,m as Te,q as Me,u as Le,y as We,A as be,G as Ke,I as Re,J as Se,L as Xe,Q as Ee}from"./codeBlockExtraProps-C_3No_qp.js";export{e as AdmonitionNode,a as BlockquoteNode,s as CheckboxNode,o as CodeBlockNode,r as D2BlockNode,t as DefinitionListNode,n as EmojiNode,d as EmphasisNode,i as FallbackComponent,l as FootnoteAnchorNode,m as FootnoteNode,N as FootnoteReferenceNode,c as HardBreakNode,k as HeadingNode,u as HighlightNode,g as HtmlBlockNode,p as HtmlInlineNode,C as HtmlPreviewFrame,f as ImageNode,h as InfographicBlockNode,I as InlineCodeNode,B as InsertNode,D as LinkNode,T as ListItemNode,M as ListNode,L as MERMAID_WORKER_BUSY_CODE,W as MathBlockNode,b as MathInlineNode,K as MermaidBlockNode,R as NodeRenderer,S as ParagraphNode,Ce as PreCodeNode,X as ReactCodeBlockNode,E as ReferenceNode,x as StrikethroughNode,H as StrongNode,P as SubscriptNode,F as SuperscriptNode,O as TableNode,v as TextNode,y as ThematicBreakNode,_ as Tooltip,j as VmrContainerNode,w as WORKER_BUSY_CODE,A as canParseOffthread,fe as clearGlobalCustomComponents,q as clearKaTeXCache,G as clearKaTeXWorker,U as clearMermaidWorker,Y as default,he as defineHtmlComponents,Ie as defineStreamingComponents,z as disableD2,J as enableD2,Q as findPrefixOffthread,Be as getCustomComponentDisplay,De as getCustomNodeComponents,V as getKaTeXBackpressureDefaults,Te as getLanguageIcon,Z as getMermaidWorkerLoad,$ as isD2Enabled,Me as languageMap,Le as normalizeLanguageIdentifier,We as preloadExtendedLanguageIcons,be as removeCustomComponents,ee as renderKaTeXInWorker,ae as renderKaTeXWithBackpressure,se as renderNode,Ke as resolveLanguageId,Re as setCustomComponents,oe as setD2Loader,re as setDefaultI18nMap,te as setKaTeXBackpressureDefaults,ne as setKaTeXCache,de as setKaTeXConcurrencyLimit,ie as setKaTeXWorker,le as setKaTeXWorkerDebug,Se as setLanguageIconResolver,me as setMermaidWorker,Ne as setMermaidWorkerClientDebug,ce as setMermaidWorkerMaxConcurrency,Xe as subscribeLanguageIconsRevision,ke as terminateWorker,ue as useSafeI18n,ge as useSmoothMarkdownStream,pe as waitForKaTeXWorkerSlot,Ee as withMarkstreamComponentDisplay};
package/dist/next.js CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import a,{useState as s,useEffect as e}from"react";import{A as r,B as o,C as t,a as n,D as i,b as m,E as l,c as d,F as c,d as u,e as p,f,H as g,g as C,h as k,i as T,j as E,k as D,I as K,l as M,m as W,n as I,L as _,o as L,p as R,q as X,r as b,s as x,N as B,P as S,R as y,S as h,t as A,u as N,v as j,T as v,w as P,x as O,y as w,V as F}from"./Tooltip-CthNVTER.js";import{M as H,W as Y,z as q,G,J as U,K as V,O as z,Q as J,U as $,X as Q,Y as Z,Z as aa,_ as sa,$ as ea,a0 as ra,a1 as oa,a2 as ta,a3 as na,a4 as ia,a5 as ma,a6 as la,a7 as da,a8 as ca,a9 as ua,aa as pa,ab as fa,ac as ga,ad as Ca,af as ka}from"./Tooltip-CthNVTER.js";import{P as Ta}from"./codeBlockExtraProps-C_3No_qp.js";import{b as Ea,e as Da,f as Ka,l as Ma,m as Wa,q as Ia,u as _a,y as La,A as Ra,G as Xa,I as ba,J as xa,L as Ba}from"./codeBlockExtraProps-C_3No_qp.js";import{A as Sa,B as ya,C as ha,a as Aa,D as Na,b as ja,E as va,c as Pa,F as Oa,d as wa,e as Fa,f as Ha,H as Ya,g as qa,h as Ga,i as Ua,j as Va,k as za,I as Ja,l as $a,m as Qa,n as Za,L as as,o as ss,p as es,M as rs,q as os,r as ts,N as ns,P as is,s as ms,R as ls,S as ds,t as cs,u as us,v as ps,T as fs,w as gs,x as Cs,y as ks,V as Ts}from"./index-uI922Np4.js";function Es(r,o){function t(t){const[n,i]=s(!1);return e(()=>{i(!0)},[]),n?a.createElement(r,t):function(a){const s="__MARKSTREAM_REACT_DISABLE_SYNC_KATEX__",e=globalThis,r=e[s];e[s]=!0;try{return o(a)}finally{void 0===r?delete e[s]:e[s]=r}}(t)}return t.displayName=`MarkstreamNextEntry(${r.displayName||r.name||"Component"})`,t}const Ds=Es(r,Sa),Ks=Es(o,ya),Ms=Es(t,ha),Ws=Es(n,Aa),Is=Ws,_s=Es(D,za),Ls=Es(i,Na),Rs=Es(m,ja),Xs=Es(l,va),bs=Es(d,Pa),xs=Es(u,wa),Bs=Es(p,Fa),Ss=Es(f,Ha),ys=Es(g,Ya),hs=Es(C,qa),As=Es(k,Ga),Ns=Es(T,Ua),js=Es(E,Va),vs=Es(K,Ja),Ps=Es(M,$a),Os=Es(W,Qa),ws=Es(I,Za),Fs=Es(_,as),Hs=Es(L,ss),Ys=Es(R,es),qs=Es(X,rs),Gs=Es(b,os),Us=Es(x,ts),Vs=Es(B,ns),zs=Es(c,Oa),Js=Es(S,is),$s=Es(Ta,ms),Qs=Es(y,ls),Zs=Es(h,ds),ae=Es(A,cs),se=Es(N,us),ee=Es(j,ps),re=Es(v,fs),oe=Es(P,gs),te=Es(O,Cs),ne=Es(w,ks),ie=Es(F,Ts);export{Ds as AdmonitionNode,Ks as BlockquoteNode,Ms as CheckboxNode,Ws as CodeBlockNode,Ls as D2BlockNode,Rs as DefinitionListNode,Xs as EmojiNode,bs as EmphasisNode,zs as FallbackComponent,xs as FootnoteAnchorNode,Bs as FootnoteNode,Ss as FootnoteReferenceNode,ys as HardBreakNode,hs as HeadingNode,As as HighlightNode,Ns as HtmlBlockNode,js as HtmlInlineNode,_s as HtmlPreviewFrame,vs as ImageNode,Ps as InfographicBlockNode,Os as InlineCodeNode,ws as InsertNode,Fs as LinkNode,Hs as ListItemNode,Ys as ListNode,H as MERMAID_WORKER_BUSY_CODE,qs as MathBlockNode,Gs as MathInlineNode,Us as MermaidBlockNode,Vs as NodeRenderer,Js as ParagraphNode,$s as PreCodeNode,Is as ReactCodeBlockNode,Qs as ReferenceNode,Zs as StrikethroughNode,ae as StrongNode,se as SubscriptNode,ee as SuperscriptNode,re as TableNode,oe as TextNode,te as ThematicBreakNode,ne as Tooltip,ie as VmrContainerNode,Y as WORKER_BUSY_CODE,q as canParseOffthread,Ea as clearGlobalCustomComponents,G as clearKaTeXCache,U as clearKaTeXWorker,V as clearMermaidWorker,Vs as default,Da as defineHtmlComponents,Ka as defineStreamingComponents,z as disableD2,J as enableD2,$ as findPrefixOffthread,Ma as getCustomNodeComponents,Q as getD2,Z as getKaTeXBackpressureDefaults,Wa as getLanguageIcon,aa as getMermaidWorkerLoad,sa as isD2Enabled,Ia as languageMap,_a as normalizeLanguageIdentifier,La as preloadExtendedLanguageIcons,Ra as removeCustomComponents,ea as renderKaTeXInWorker,ra as renderKaTeXWithBackpressure,oa as renderNode,Xa as resolveLanguageId,ba as setCustomComponents,ta as setD2Loader,na as setDefaultI18nMap,ia as setKaTeXBackpressureDefaults,ma as setKaTeXCache,la as setKaTeXConcurrencyLimit,da as setKaTeXWorker,ca as setKaTeXWorkerDebug,xa as setLanguageIconResolver,ua as setMermaidWorker,pa as setMermaidWorkerClientDebug,fa as setMermaidWorkerMaxConcurrency,Ba as subscribeLanguageIconsRevision,ga as terminateWorker,Ca as useSafeI18n,ka as waitForKaTeXWorkerSlot};
2
+ import a,{useState as s,useEffect as e}from"react";import{A as r,B as o,C as t,a as n,D as i,b as m,E as l,c as d,F as c,d as u,e as p,f,H as g,g as C,h as k,i as T,j as E,k as D,I as K,l as M,m as W,n as I,L as _,o as L,p as R,q as X,r as b,s as x,N as B,P as S,R as y,S as h,t as A,u as N,v as j,T as v,w as P,x as O,y as w,V as F}from"./Tooltip-slY8fSKv.js";import{M as H,W as Y,z as q,G,J as U,K as V,O as z,Q as J,U as $,X as Q,Y as Z,Z as aa,_ as sa,$ as ea,a0 as ra,a1 as oa,a2 as ta,a3 as na,a4 as ia,a5 as ma,a6 as la,a7 as da,a8 as ca,a9 as ua,aa as pa,ab as fa,ac as ga,ad as Ca,af as ka}from"./Tooltip-slY8fSKv.js";import{P as Ta}from"./codeBlockExtraProps-C_3No_qp.js";import{b as Ea,e as Da,f as Ka,l as Ma,m as Wa,q as Ia,u as _a,y as La,A as Ra,G as Xa,I as ba,J as xa,L as Ba}from"./codeBlockExtraProps-C_3No_qp.js";import{A as Sa,B as ya,C as ha,a as Aa,D as Na,b as ja,E as va,c as Pa,F as Oa,d as wa,e as Fa,f as Ha,H as Ya,g as qa,h as Ga,i as Ua,j as Va,k as za,I as Ja,l as $a,m as Qa,n as Za,L as as,o as ss,p as es,M as rs,q as os,r as ts,N as ns,P as is,s as ms,R as ls,S as ds,t as cs,u as us,v as ps,T as fs,w as gs,x as Cs,y as ks,V as Ts}from"./index-uI922Np4.js";function Es(r,o){function t(t){const[n,i]=s(!1);return e(()=>{i(!0)},[]),n?a.createElement(r,t):function(a){const s="__MARKSTREAM_REACT_DISABLE_SYNC_KATEX__",e=globalThis,r=e[s];e[s]=!0;try{return o(a)}finally{void 0===r?delete e[s]:e[s]=r}}(t)}return t.displayName=`MarkstreamNextEntry(${r.displayName||r.name||"Component"})`,t}const Ds=Es(r,Sa),Ks=Es(o,ya),Ms=Es(t,ha),Ws=Es(n,Aa),Is=Ws,_s=Es(D,za),Ls=Es(i,Na),Rs=Es(m,ja),Xs=Es(l,va),bs=Es(d,Pa),xs=Es(u,wa),Bs=Es(p,Fa),Ss=Es(f,Ha),ys=Es(g,Ya),hs=Es(C,qa),As=Es(k,Ga),Ns=Es(T,Ua),js=Es(E,Va),vs=Es(K,Ja),Ps=Es(M,$a),Os=Es(W,Qa),ws=Es(I,Za),Fs=Es(_,as),Hs=Es(L,ss),Ys=Es(R,es),qs=Es(X,rs),Gs=Es(b,os),Us=Es(x,ts),Vs=Es(B,ns),zs=Es(c,Oa),Js=Es(S,is),$s=Es(Ta,ms),Qs=Es(y,ls),Zs=Es(h,ds),ae=Es(A,cs),se=Es(N,us),ee=Es(j,ps),re=Es(v,fs),oe=Es(P,gs),te=Es(O,Cs),ne=Es(w,ks),ie=Es(F,Ts);export{Ds as AdmonitionNode,Ks as BlockquoteNode,Ms as CheckboxNode,Ws as CodeBlockNode,Ls as D2BlockNode,Rs as DefinitionListNode,Xs as EmojiNode,bs as EmphasisNode,zs as FallbackComponent,xs as FootnoteAnchorNode,Bs as FootnoteNode,Ss as FootnoteReferenceNode,ys as HardBreakNode,hs as HeadingNode,As as HighlightNode,Ns as HtmlBlockNode,js as HtmlInlineNode,_s as HtmlPreviewFrame,vs as ImageNode,Ps as InfographicBlockNode,Os as InlineCodeNode,ws as InsertNode,Fs as LinkNode,Hs as ListItemNode,Ys as ListNode,H as MERMAID_WORKER_BUSY_CODE,qs as MathBlockNode,Gs as MathInlineNode,Us as MermaidBlockNode,Vs as NodeRenderer,Js as ParagraphNode,$s as PreCodeNode,Is as ReactCodeBlockNode,Qs as ReferenceNode,Zs as StrikethroughNode,ae as StrongNode,se as SubscriptNode,ee as SuperscriptNode,re as TableNode,oe as TextNode,te as ThematicBreakNode,ne as Tooltip,ie as VmrContainerNode,Y as WORKER_BUSY_CODE,q as canParseOffthread,Ea as clearGlobalCustomComponents,G as clearKaTeXCache,U as clearKaTeXWorker,V as clearMermaidWorker,Vs as default,Da as defineHtmlComponents,Ka as defineStreamingComponents,z as disableD2,J as enableD2,$ as findPrefixOffthread,Ma as getCustomNodeComponents,Q as getD2,Z as getKaTeXBackpressureDefaults,Wa as getLanguageIcon,aa as getMermaidWorkerLoad,sa as isD2Enabled,Ia as languageMap,_a as normalizeLanguageIdentifier,La as preloadExtendedLanguageIcons,Ra as removeCustomComponents,ea as renderKaTeXInWorker,ra as renderKaTeXWithBackpressure,oa as renderNode,Xa as resolveLanguageId,ba as setCustomComponents,ta as setD2Loader,na as setDefaultI18nMap,ia as setKaTeXBackpressureDefaults,ma as setKaTeXCache,la as setKaTeXConcurrencyLimit,da as setKaTeXWorker,ca as setKaTeXWorkerDebug,xa as setLanguageIconResolver,ua as setMermaidWorker,pa as setMermaidWorkerClientDebug,fa as setMermaidWorkerMaxConcurrency,Ba as subscribeLanguageIconsRevision,ga as terminateWorker,Ca as useSafeI18n,ka as waitForKaTeXWorkerSlot};
package/dist/tailwind.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const safeList = `use client react stream-markdown-parser string cannot delete global call clearGlobalCustomComponents blockquote-node auto checkbox-node checkbox checkbox-input footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border,#eaecef)] pt-2 flex-1 dl definition-list indexKey mb-4 dt definition-term font-semibold ctx renderNode ?? definition dd definition-desc ml-4 emoji-node dependency is not install it to enable note is-dark data-index-key headerId admonition-header admonition-icon admonition-title admonition-toggle aria-expanded aria-controls collapsed admonition-content aria-labelledby hard-break emphasis-node smooth footnote-anchor hover:underline cursor-pointer ↩︎ clsx heading-node object mark highlight-node footnote-reference handleScroll footnote-link html-block-node safe escape html-block html-block-node__placeholder html-block-node__placeholder-bar w-4/5 w-2/3 setHostEl shouldRender useDynamic reactNodes markstream-core plaintext data-ssr-fallback aria-busy normalizedLanguage block data-language no html_block node.type html_inline boolean none mermaid infographic d2 language d2lang scroll pre-wrap configuredShowLineNumbers typeof disableLineNumbers whitespace-pre-wrap text-node-center text image paragraph-node renderNodeProp paragraph child.type classAttr node.cite children list-item pl-1.5 my-2 value void list-node my-5 pl-[calc(13/8*1em)] list-decimal list-disc max-lg:my-[calc(4/3*1em)] max-lg:pl-[calc(14/9*1em)] list right text-right center text-center text-left table-node-wrapper table-node--loading border-[var(--table-border,#cbd5e1)] border-b p-[calc(4/7*1em)] rowIdx bodyRows.length table-node__loading status polite table-node__spinner sr-only href isOpen strong-node emphasis strikethrough-node strikethrough highlight insert-node insert subscript-node subscript superscript-node superscript thematic-break-node inline-code inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full number ease-in-out infinite node.title link-loading inline-flex items-baseline gap-1.5 cssVars link-text-wrapper relative leading-[normal] link-text link-loading-indicator link-node aria-label noopener noreferrer image-node__img is-loaded eager lazy async code-block-node code-block mermaid-block-node d2-block-node infographic-block-node math-block overflow-x-auto min-h-[40px] node.content $$ math-inline-wrapper math-inline reference-node bg-[hsl(var(--muted))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))] data-reference-id customComponents html-inline vmr-container unknown-node text-gray-500 italic node code_block text_special heading list_item definition_list footnote footnote_reference footnote_anchor admonition hardbreak inline_code checkbox_input emoji thematic_break math_inline math_block reference vmr_container label_open label_close server-renderer markdown-renderer dark data-custom-id node-slot data-node-index data-node-type node-content name xlink:href markstream-d2-root-svg window.requestAnimationFrame instance.render instance missing render returned empty top d2-block my-4 rounded-lg border overflow-hidden shadow-sm border-gray-700/30 bg-gray-900 text-gray-100 border-gray-200 bg-white text-gray-900 d2-block-header justify-between items-center px-4 py-2.5 border-gray-400/5 gap-x-2 font-medium gap-x-1 p-0.5 bg-gray-700 bg-gray-100 mode-btn px-2 py-1 !showSource is-active showSource d2-action-btn p-2 transition-colors hover:bg-[var(--vscode-editor-selectionBackground)] copying w-3 h-3 currentColor round aria-pressed m9 bodyRef d2-block-body bodyStyle !hasPreview d2-source py-4 d2-code d2-error mt-2 d2-render d2-svg pb-3 next next.type window.requestIdleCallback [data-node-index] node-spacer virtualized fade-node typewriter-node node-placeholder typewriterCursorRef typewriter-cursor [data-node-type="code_block"] [data-node-type="admonition"] [data-node-type="table"] [data-node-type="math_block"] [data-node-type="html_block"] [data-node-type="image"] performance [markstream-react][perf] [data-stream-diffs-state] theme themes themeType languages stream disableFileHeader onThemeChange renderCustomHeader renderHeaderMetadata renderHeaderPrefix wrap split line-info night moon black dracula mocha frappe macchiato palenight ocean poimandres monokai laserwave tokyo slack-dark rose-pine github-dark material-theme one-dark catppuccin-mocha catppuccin-frappe catppuccin-macchiato light latte dawn lotus transparent marker diff important max-height visible hidden height onDidUpdateDiff onDidContentSizeChange onDidLayoutChange window.MutationObserver childList record.type attributes class vitesse-dark vitesse-light unified node.code fontSize lineHeight maxHeight paddingBottom paddingTop tabSize resolvedRuntimeOptions.overflow nextOptions.unsafeCSS [data-file] [data-diff] helpers.cleanupEditor canonicalLanguage single window.cancelAnimationFrame clientX navigator.clipboard navigator.clipboard.writeText code-block-container is-rendering is-diff is-plain-text code-block-header code-header-main icon-slot h-4 w-4 flex-shrink-0 code-header-copy min-w-0 code-header-title truncate code-header-caption code-header-actions code-action-btn action-icon copied m14 evenodd code-block-body--collapsed code-block-body--expanded code-fallback-plain m-0 code-editor-layer code-height-placeholder editorReady aria-hidden code-editor-fallback-surface code-loading-placeholder loading-skeleton skeleton-line short react-dom window.matchMedia fixed markstream-react ms-tooltip z-[9999] inline-block text-base py-2 px-3 shadow-md whitespace-nowrap pointer-events-none tooltip-element text-white border-gray-700 tooltip valueAttr primary fallback failed image-node__placeholder image-node__spinner image-node__placeholder-text image… placeholder image-node__error load containerClass in out zoom library error message rendered text-red-500 p-4">Failed instanceof error.message keydown transform ease fullscreen touches text-gray-400 hover:bg-gray-700 hover:text-gray-200 text-gray-600 hover:bg-gray-200 hover:text-gray-700 source hasRenderError hasPreview preview pending bg-gray-800 bg-gray-50 px-2.5 bg-gray-600 text-gray-200 text-gray-700 m16 isCollapsed opacity-50 cursor-not-allowed m7 text-gray-300 baseCode absolute top-2 right-2 z-10 gap-2 backdrop-blur infographic-preview min-h-[360px] transition-all duration-100 inset-0 overflow-auto p-4 cursor-grab isDragging containerRef w-full justify-center min-h-full z-50 bg-black/70 closeModal dialog h-full max-h-full shadow-lg top-6 right-6 !isDragging cursor-grabbing pointermove pointerup pointercancel my-8 table-node colgroup table-node__resize-handle text-node-stream-delta text-node-stream-delta--a text-node-stream-delta--b event.key hr-node thematic-break text-node loose strict viewBox gantt open-modal [data-mermaid-wrapper] mermaid-action-btn toggle-mode common.zoomIn common.zoomOut common.resetZoom transition-[height] duration-150 ease-out data-mermaid-wrapper mermaid-loading mermaid-spinner diagram… mermaid-block-header space-x-2 space-x-1 common.preview common.source common.export mermaid-error hasRenderedOnce mermaid-block modeContainerRef mermaid-modal-overlay mermaid-modal-panel mermaid-modal-header mermaid-modal-title mermaid-modal-close mermaid-modal-body modalContentRef mermaid-modal-content available default abort timed [mermaidWorkerClient] messageerror cleared worker inject via busy canParse findPrefix [markstream-react] htmlPreviewSandbox contains both allow-scripts and this only fully trusted content served an isolated en utf-8 viewport content="width=device-width initial-scale=1 html-preview-frame__backdrop--dark html-preview-frame--dark html-preview-frame__header html-preview-frame__title html-preview-frame__dot html-preview-frame__label html-preview-frame__close--dark html-preview-frame__iframe no-referrer about:blank tag_open token.type self_closing child key ref className ms-html tag_close parse dynamic template html-inline-node html-inline-node--loading thinking htmlFor javascript typescript go python ruby shell powershell plain cpp csharp objectivec objectivecpp yaml markdown rust kotlin java cs php sql zsh objective-c objective-cpp document npm development process [katexWorkerClient] init cache-hit timeout waiting slot hunk !options.preserveBlankKind context removed added markstream-pre__diff-pane--inline original markstream-pre__diff-pane--original modified markstream-pre__diff-pane--modified ui-monospace monospace fontFamily markstream-pre--line-numbers markstream-pre--diff-preview markstream-pre--diff-inline showLineNumbers markstream-pre__diff-code line.empty markstream-pre__diff-line--empty markstream-pre__diff-rail markstream-pre__diff-number markstream-pre__diff-content markstream-pre__diff-content-inner markstream-pre__line-numbers markstream-pre__line-numbers-text markstream-pre__code prototype constructor sequencediagram classdiagram kind statediagram erdiagram flowchart graph katex normalizedType role aria-describedby value?.useMonaco stream-diffs/markstream mathRef math-inline--hidden math-inline__loading math-inline__spinner rendering math-rendering globalThis.requestAnimationFrame globalThis.cancelAnimationFrame °C module did expected`;
1
+ const safeList = `use client react stream-markdown-parser string cannot delete global call clearGlobalCustomComponents checkbox-node checkbox checkbox-input blockquote-node auto dl definition-list indexKey mb-4 dt definition-term font-semibold ctx renderNode ?? definition dd definition-desc ml-4 mark highlight-node hard-break emoji-node html-block-node safe escape html-block html-block-node__placeholder html-block-node__placeholder-bar w-4/5 w-2/3 setHostEl shouldRender useDynamic reactNodes list-item pl-1.5 my-2 valueAttr children smooth footnote-reference handleScroll footnote-link cursor-pointer footnote-anchor text-sm hover:underline ↩︎ note is-dark data-index-key headerId admonition-header admonition-icon admonition-title admonition-toggle aria-expanded aria-controls collapsed admonition-content aria-labelledby emphasis-node clsx inline-code inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full text-node-stream-delta text-node-stream-delta--a text-node-stream-delta--b footnote-node flex leading-relaxed border-t border-[var(--footnote-border,#eaecef)] pt-2 flex-1 primary fallback failed is-loaded lazy eager async image image-node__placeholder image-node__spinner image-node__placeholder-text image… placeholder image-node__error currentColor to load unknown-node text-gray-500 italic node text paragraph-node paragraph child.type html_inline html_block reference-node bg-[hsl(var(--muted))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))] event.key strikethrough-node superscript-node href name xlink:href typeof markstream-d2-root-svg number window.requestAnimationFrame is not instance.render instance missing object render returned empty top d2-block my-4 rounded-lg border overflow-hidden shadow-sm border-gray-700/30 bg-gray-900 text-gray-100 border-gray-200 bg-white text-gray-900 d2-block-header justify-between items-center px-4 py-2.5 border-b border-gray-400/5 gap-x-2 font-medium gap-x-1 p-0.5 bg-gray-700 bg-gray-100 mode-btn px-2 py-1 !showSource is-active showSource d2-action-btn p-2 transition-colors hover:bg-[var(--vscode-editor-selectionBackground)] copying w-3 h-3 none round aria-pressed m9 bodyRef d2-block-body bodyStyle !hasPreview d2-source py-4 d2-code d2-error mt-2 d2-render d2-svg pb-3 dependency install it enable react-dom w-4 h-4 flex-shrink-0 library error message rendered text-red-500 p-4">Failed instanceof error.message hidden keydown transform ease center fullscreen touches text-gray-400 hover:bg-gray-700 hover:text-gray-200 text-gray-600 hover:bg-gray-200 hover:text-gray-700 source hasRenderError hasPreview preview pending is-rendering bg-gray-800 bg-gray-50 truncate px-2.5 bg-gray-600 text-gray-200 text-gray-700 m16 isCollapsed opacity-50 cursor-not-allowed m7 m14 whitespace-pre-wrap text-gray-300 baseCode relative absolute top-2 right-2 z-10 gap-2 backdrop-blur infographic-preview min-h-[360px] transition-all duration-100 block inset-0 overflow-auto p-4 text-left cursor-grab isDragging containerRef w-full text-center justify-center min-h-full markstream-react fixed z-50 bg-black/70 closeModal dialog h-full max-h-full shadow-lg top-6 right-6 !isDragging cursor-grabbing heading-node hr-node thematic-break markstream-core subscript-node containerClass vmr-container right text-right pointermove pointerup pointercancel table-node-wrapper my-8 table-node table-node--loading aria-busy colgroup border-[var(--table-border,#cbd5e1)] p-[calc(4/7*1em)] table-node__resize-handle aria-label table-node__loading status polite table-node__spinner sr-only text-node text-node-center boolean dark window.matchMedia ms-tooltip z-[9999] inline-block text-base py-2 px-3 shadow-md whitespace-nowrap pointer-events-none tooltip-element text-white border-gray-700 tooltip node.type mermaid infographic d2 language d2lang scroll pre-wrap configuredShowLineNumbers disableLineNumbers code_block text_special node.content heading list list_item definition_list footnote footnote_reference footnote_anchor admonition hardbreak inline_code emphasis strikethrough highlight insert subscript superscript checkbox_input emoji thematic_break math_inline math_block reference vmr_container label_open label_close javascript typescript go python ruby shell powershell plain cpp csharp objectivec objectivecpp yaml markdown rust kotlin java cs php sql plaintext zsh objective-c objective-cpp ease-in-out infinite node.title link-loading inline-flex items-baseline gap-1.5 link-text-wrapper leading-[normal] link-text link-loading-indicator link-node noopener noreferrer in out zoom [mermaidWorkerClient] messageerror cleared worker inject via busy timed canParse findPrefix insert-node strong-node list-node my-5 pl-[calc(13/8*1em)] list-decimal list-disc max-lg:my-[calc(4/3*1em)] max-lg:pl-[calc(14/9*1em)] tag_open token.type self_closing child key ref value className class ms-html tag_close parse html-inline dynamic template html-inline-node html-inline-node--loading [data-stream-diffs-state] theme themes themeType languages stream disableFileHeader onThemeChange renderCustomHeader renderHeaderMetadata renderHeaderPrefix wrap split line-info night moon black dracula mocha frappe macchiato palenight ocean poimandres monokai laserwave tokyo slack-dark rose-pine github-dark material-theme one-dark catppuccin-mocha catppuccin-frappe catppuccin-macchiato light latte dawn lotus transparent marker diff important max-height visible height onDidUpdateDiff onDidContentSizeChange onDidLayoutChange window.MutationObserver childList record.type attributes vitesse-dark vitesse-light unified node.code fontSize lineHeight maxHeight paddingBottom paddingTop tabSize resolvedRuntimeOptions.overflow nextOptions.unsafeCSS [data-file] [data-diff] helpers.cleanupEditor canonicalLanguage single window.cancelAnimationFrame clientX navigator.clipboard navigator.clipboard.writeText code-block-container is-diff is-plain-text code-block-header code-header-main icon-slot code-header-copy min-w-0 code-header-title code-header-caption code-header-actions code-action-btn action-icon copied evenodd code-block-body--collapsed code-block-body--expanded code-fallback-plain m-0 code-editor-layer code-height-placeholder editorReady void aria-hidden code-editor-fallback-surface code-loading-placeholder loading-skeleton skeleton-line short next next.type window.requestIdleCallback [data-node-index] node-spacer virtualized data-custom-id node-slot data-node-index data-node-type fade-node typewriter-node node-placeholder typewriterCursorRef typewriter-cursor [data-node-type="code_block"] [data-node-type="admonition"] [data-node-type="table"] [data-node-type="math_block"] [data-node-type="html_block"] [data-node-type="image"] performance [markstream-react][perf] markdown-renderer [markstream-react] htmlPreviewSandbox contains both allow-scripts and this only fully trusted content served an isolated en utf-8 viewport content="width=device-width initial-scale=1 html-preview-frame__backdrop--dark html-preview-frame--dark html-preview-frame__header html-preview-frame__title html-preview-frame__dot html-preview-frame__label html-preview-frame__close--dark html-preview-frame__iframe no-referrer about:blank loose strict viewBox gantt open-modal [data-mermaid-wrapper] mermaid-action-btn toggle-mode common.zoomIn common.zoomOut common.resetZoom transition-[height] duration-150 ease-out data-mermaid-wrapper mermaid-loading mermaid-spinner diagram… mermaid-block-header space-x-2 space-x-1 common.preview common.source common.export mermaid-error hasRenderedOnce mermaid-block modeContainerRef mermaid-modal-overlay mermaid-modal-panel mermaid-modal-header mermaid-modal-title mermaid-modal-close mermaid-modal-body modalContentRef mermaid-modal-content available default abort [katexWorkerClient] init cache-hit timeout waiting slot data-ssr-fallback normalizedLanguage data-language no renderNodeProp classAttr node.cite rowIdx bodyRows.length isOpen thematic-break-node cssVars image-node__img code-block-node code-block mermaid-block-node d2-block-node infographic-block-node math-block overflow-x-auto min-h-[40px] $$ math-inline-wrapper math-inline data-reference-id customComponents server-renderer node-content thinking htmlFor npm development process document normalizedType hunk !options.preserveBlankKind context removed added markstream-pre__diff-pane--inline original markstream-pre__diff-pane--original modified markstream-pre__diff-pane--modified ui-monospace monospace fontFamily markstream-pre--line-numbers markstream-pre--diff-preview markstream-pre--diff-inline showLineNumbers markstream-pre__diff-code line.empty markstream-pre__diff-line--empty markstream-pre__diff-rail markstream-pre__diff-number markstream-pre__diff-content markstream-pre__diff-content-inner markstream-pre__line-numbers markstream-pre__line-numbers-text markstream-pre__code mathRef math-inline--hidden math-inline__loading math-inline__spinner prototype constructor sequencediagram classdiagram kind statediagram erdiagram flowchart graph role aria-describedby rendering math-rendering value?.useMonaco stream-diffs/markstream globalThis.requestAnimationFrame globalThis.cancelAnimationFrame °C katex module did expected`;
2
2
  module.exports = safeList;
3
3
  module.exports.safeList = safeList;
4
4
  module.exports.default = safeList;
package/dist/tailwind.js CHANGED
@@ -1,2 +1,2 @@
1
- export const safeList = `use client react stream-markdown-parser string cannot delete global call clearGlobalCustomComponents blockquote-node auto checkbox-node checkbox checkbox-input footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border,#eaecef)] pt-2 flex-1 dl definition-list indexKey mb-4 dt definition-term font-semibold ctx renderNode ?? definition dd definition-desc ml-4 emoji-node dependency is not install it to enable note is-dark data-index-key headerId admonition-header admonition-icon admonition-title admonition-toggle aria-expanded aria-controls collapsed admonition-content aria-labelledby hard-break emphasis-node smooth footnote-anchor hover:underline cursor-pointer ↩︎ clsx heading-node object mark highlight-node footnote-reference handleScroll footnote-link html-block-node safe escape html-block html-block-node__placeholder html-block-node__placeholder-bar w-4/5 w-2/3 setHostEl shouldRender useDynamic reactNodes markstream-core plaintext data-ssr-fallback aria-busy normalizedLanguage block data-language no html_block node.type html_inline boolean none mermaid infographic d2 language d2lang scroll pre-wrap configuredShowLineNumbers typeof disableLineNumbers whitespace-pre-wrap text-node-center text image paragraph-node renderNodeProp paragraph child.type classAttr node.cite children list-item pl-1.5 my-2 value void list-node my-5 pl-[calc(13/8*1em)] list-decimal list-disc max-lg:my-[calc(4/3*1em)] max-lg:pl-[calc(14/9*1em)] list right text-right center text-center text-left table-node-wrapper table-node--loading border-[var(--table-border,#cbd5e1)] border-b p-[calc(4/7*1em)] rowIdx bodyRows.length table-node__loading status polite table-node__spinner sr-only href isOpen strong-node emphasis strikethrough-node strikethrough highlight insert-node insert subscript-node subscript superscript-node superscript thematic-break-node inline-code inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full number ease-in-out infinite node.title link-loading inline-flex items-baseline gap-1.5 cssVars link-text-wrapper relative leading-[normal] link-text link-loading-indicator link-node aria-label noopener noreferrer image-node__img is-loaded eager lazy async code-block-node code-block mermaid-block-node d2-block-node infographic-block-node math-block overflow-x-auto min-h-[40px] node.content $$ math-inline-wrapper math-inline reference-node bg-[hsl(var(--muted))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))] data-reference-id customComponents html-inline vmr-container unknown-node text-gray-500 italic node code_block text_special heading list_item definition_list footnote footnote_reference footnote_anchor admonition hardbreak inline_code checkbox_input emoji thematic_break math_inline math_block reference vmr_container label_open label_close server-renderer markdown-renderer dark data-custom-id node-slot data-node-index data-node-type node-content name xlink:href markstream-d2-root-svg window.requestAnimationFrame instance.render instance missing render returned empty top d2-block my-4 rounded-lg border overflow-hidden shadow-sm border-gray-700/30 bg-gray-900 text-gray-100 border-gray-200 bg-white text-gray-900 d2-block-header justify-between items-center px-4 py-2.5 border-gray-400/5 gap-x-2 font-medium gap-x-1 p-0.5 bg-gray-700 bg-gray-100 mode-btn px-2 py-1 !showSource is-active showSource d2-action-btn p-2 transition-colors hover:bg-[var(--vscode-editor-selectionBackground)] copying w-3 h-3 currentColor round aria-pressed m9 bodyRef d2-block-body bodyStyle !hasPreview d2-source py-4 d2-code d2-error mt-2 d2-render d2-svg pb-3 next next.type window.requestIdleCallback [data-node-index] node-spacer virtualized fade-node typewriter-node node-placeholder typewriterCursorRef typewriter-cursor [data-node-type="code_block"] [data-node-type="admonition"] [data-node-type="table"] [data-node-type="math_block"] [data-node-type="html_block"] [data-node-type="image"] performance [markstream-react][perf] [data-stream-diffs-state] theme themes themeType languages stream disableFileHeader onThemeChange renderCustomHeader renderHeaderMetadata renderHeaderPrefix wrap split line-info night moon black dracula mocha frappe macchiato palenight ocean poimandres monokai laserwave tokyo slack-dark rose-pine github-dark material-theme one-dark catppuccin-mocha catppuccin-frappe catppuccin-macchiato light latte dawn lotus transparent marker diff important max-height visible hidden height onDidUpdateDiff onDidContentSizeChange onDidLayoutChange window.MutationObserver childList record.type attributes class vitesse-dark vitesse-light unified node.code fontSize lineHeight maxHeight paddingBottom paddingTop tabSize resolvedRuntimeOptions.overflow nextOptions.unsafeCSS [data-file] [data-diff] helpers.cleanupEditor canonicalLanguage single window.cancelAnimationFrame clientX navigator.clipboard navigator.clipboard.writeText code-block-container is-rendering is-diff is-plain-text code-block-header code-header-main icon-slot h-4 w-4 flex-shrink-0 code-header-copy min-w-0 code-header-title truncate code-header-caption code-header-actions code-action-btn action-icon copied m14 evenodd code-block-body--collapsed code-block-body--expanded code-fallback-plain m-0 code-editor-layer code-height-placeholder editorReady aria-hidden code-editor-fallback-surface code-loading-placeholder loading-skeleton skeleton-line short react-dom window.matchMedia fixed markstream-react ms-tooltip z-[9999] inline-block text-base py-2 px-3 shadow-md whitespace-nowrap pointer-events-none tooltip-element text-white border-gray-700 tooltip valueAttr primary fallback failed image-node__placeholder image-node__spinner image-node__placeholder-text image… placeholder image-node__error load containerClass in out zoom library error message rendered text-red-500 p-4">Failed instanceof error.message keydown transform ease fullscreen touches text-gray-400 hover:bg-gray-700 hover:text-gray-200 text-gray-600 hover:bg-gray-200 hover:text-gray-700 source hasRenderError hasPreview preview pending bg-gray-800 bg-gray-50 px-2.5 bg-gray-600 text-gray-200 text-gray-700 m16 isCollapsed opacity-50 cursor-not-allowed m7 text-gray-300 baseCode absolute top-2 right-2 z-10 gap-2 backdrop-blur infographic-preview min-h-[360px] transition-all duration-100 inset-0 overflow-auto p-4 cursor-grab isDragging containerRef w-full justify-center min-h-full z-50 bg-black/70 closeModal dialog h-full max-h-full shadow-lg top-6 right-6 !isDragging cursor-grabbing pointermove pointerup pointercancel my-8 table-node colgroup table-node__resize-handle text-node-stream-delta text-node-stream-delta--a text-node-stream-delta--b event.key hr-node thematic-break text-node loose strict viewBox gantt open-modal [data-mermaid-wrapper] mermaid-action-btn toggle-mode common.zoomIn common.zoomOut common.resetZoom transition-[height] duration-150 ease-out data-mermaid-wrapper mermaid-loading mermaid-spinner diagram… mermaid-block-header space-x-2 space-x-1 common.preview common.source common.export mermaid-error hasRenderedOnce mermaid-block modeContainerRef mermaid-modal-overlay mermaid-modal-panel mermaid-modal-header mermaid-modal-title mermaid-modal-close mermaid-modal-body modalContentRef mermaid-modal-content available default abort timed [mermaidWorkerClient] messageerror cleared worker inject via busy canParse findPrefix [markstream-react] htmlPreviewSandbox contains both allow-scripts and this only fully trusted content served an isolated en utf-8 viewport content="width=device-width initial-scale=1 html-preview-frame__backdrop--dark html-preview-frame--dark html-preview-frame__header html-preview-frame__title html-preview-frame__dot html-preview-frame__label html-preview-frame__close--dark html-preview-frame__iframe no-referrer about:blank tag_open token.type self_closing child key ref className ms-html tag_close parse dynamic template html-inline-node html-inline-node--loading thinking htmlFor javascript typescript go python ruby shell powershell plain cpp csharp objectivec objectivecpp yaml markdown rust kotlin java cs php sql zsh objective-c objective-cpp document npm development process [katexWorkerClient] init cache-hit timeout waiting slot hunk !options.preserveBlankKind context removed added markstream-pre__diff-pane--inline original markstream-pre__diff-pane--original modified markstream-pre__diff-pane--modified ui-monospace monospace fontFamily markstream-pre--line-numbers markstream-pre--diff-preview markstream-pre--diff-inline showLineNumbers markstream-pre__diff-code line.empty markstream-pre__diff-line--empty markstream-pre__diff-rail markstream-pre__diff-number markstream-pre__diff-content markstream-pre__diff-content-inner markstream-pre__line-numbers markstream-pre__line-numbers-text markstream-pre__code prototype constructor sequencediagram classdiagram kind statediagram erdiagram flowchart graph katex normalizedType role aria-describedby value?.useMonaco stream-diffs/markstream mathRef math-inline--hidden math-inline__loading math-inline__spinner rendering math-rendering globalThis.requestAnimationFrame globalThis.cancelAnimationFrame °C module did expected`;
1
+ export const safeList = `use client react stream-markdown-parser string cannot delete global call clearGlobalCustomComponents checkbox-node checkbox checkbox-input blockquote-node auto dl definition-list indexKey mb-4 dt definition-term font-semibold ctx renderNode ?? definition dd definition-desc ml-4 mark highlight-node hard-break emoji-node html-block-node safe escape html-block html-block-node__placeholder html-block-node__placeholder-bar w-4/5 w-2/3 setHostEl shouldRender useDynamic reactNodes list-item pl-1.5 my-2 valueAttr children smooth footnote-reference handleScroll footnote-link cursor-pointer footnote-anchor text-sm hover:underline ↩︎ note is-dark data-index-key headerId admonition-header admonition-icon admonition-title admonition-toggle aria-expanded aria-controls collapsed admonition-content aria-labelledby emphasis-node clsx inline-code inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full text-node-stream-delta text-node-stream-delta--a text-node-stream-delta--b footnote-node flex leading-relaxed border-t border-[var(--footnote-border,#eaecef)] pt-2 flex-1 primary fallback failed is-loaded lazy eager async image image-node__placeholder image-node__spinner image-node__placeholder-text image… placeholder image-node__error currentColor to load unknown-node text-gray-500 italic node text paragraph-node paragraph child.type html_inline html_block reference-node bg-[hsl(var(--muted))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))] event.key strikethrough-node superscript-node href name xlink:href typeof markstream-d2-root-svg number window.requestAnimationFrame is not instance.render instance missing object render returned empty top d2-block my-4 rounded-lg border overflow-hidden shadow-sm border-gray-700/30 bg-gray-900 text-gray-100 border-gray-200 bg-white text-gray-900 d2-block-header justify-between items-center px-4 py-2.5 border-b border-gray-400/5 gap-x-2 font-medium gap-x-1 p-0.5 bg-gray-700 bg-gray-100 mode-btn px-2 py-1 !showSource is-active showSource d2-action-btn p-2 transition-colors hover:bg-[var(--vscode-editor-selectionBackground)] copying w-3 h-3 none round aria-pressed m9 bodyRef d2-block-body bodyStyle !hasPreview d2-source py-4 d2-code d2-error mt-2 d2-render d2-svg pb-3 dependency install it enable react-dom w-4 h-4 flex-shrink-0 library error message rendered text-red-500 p-4">Failed instanceof error.message hidden keydown transform ease center fullscreen touches text-gray-400 hover:bg-gray-700 hover:text-gray-200 text-gray-600 hover:bg-gray-200 hover:text-gray-700 source hasRenderError hasPreview preview pending is-rendering bg-gray-800 bg-gray-50 truncate px-2.5 bg-gray-600 text-gray-200 text-gray-700 m16 isCollapsed opacity-50 cursor-not-allowed m7 m14 whitespace-pre-wrap text-gray-300 baseCode relative absolute top-2 right-2 z-10 gap-2 backdrop-blur infographic-preview min-h-[360px] transition-all duration-100 block inset-0 overflow-auto p-4 text-left cursor-grab isDragging containerRef w-full text-center justify-center min-h-full markstream-react fixed z-50 bg-black/70 closeModal dialog h-full max-h-full shadow-lg top-6 right-6 !isDragging cursor-grabbing heading-node hr-node thematic-break markstream-core subscript-node containerClass vmr-container right text-right pointermove pointerup pointercancel table-node-wrapper my-8 table-node table-node--loading aria-busy colgroup border-[var(--table-border,#cbd5e1)] p-[calc(4/7*1em)] table-node__resize-handle aria-label table-node__loading status polite table-node__spinner sr-only text-node text-node-center boolean dark window.matchMedia ms-tooltip z-[9999] inline-block text-base py-2 px-3 shadow-md whitespace-nowrap pointer-events-none tooltip-element text-white border-gray-700 tooltip node.type mermaid infographic d2 language d2lang scroll pre-wrap configuredShowLineNumbers disableLineNumbers code_block text_special node.content heading list list_item definition_list footnote footnote_reference footnote_anchor admonition hardbreak inline_code emphasis strikethrough highlight insert subscript superscript checkbox_input emoji thematic_break math_inline math_block reference vmr_container label_open label_close javascript typescript go python ruby shell powershell plain cpp csharp objectivec objectivecpp yaml markdown rust kotlin java cs php sql plaintext zsh objective-c objective-cpp ease-in-out infinite node.title link-loading inline-flex items-baseline gap-1.5 link-text-wrapper leading-[normal] link-text link-loading-indicator link-node noopener noreferrer in out zoom [mermaidWorkerClient] messageerror cleared worker inject via busy timed canParse findPrefix insert-node strong-node list-node my-5 pl-[calc(13/8*1em)] list-decimal list-disc max-lg:my-[calc(4/3*1em)] max-lg:pl-[calc(14/9*1em)] tag_open token.type self_closing child key ref value className class ms-html tag_close parse html-inline dynamic template html-inline-node html-inline-node--loading [data-stream-diffs-state] theme themes themeType languages stream disableFileHeader onThemeChange renderCustomHeader renderHeaderMetadata renderHeaderPrefix wrap split line-info night moon black dracula mocha frappe macchiato palenight ocean poimandres monokai laserwave tokyo slack-dark rose-pine github-dark material-theme one-dark catppuccin-mocha catppuccin-frappe catppuccin-macchiato light latte dawn lotus transparent marker diff important max-height visible height onDidUpdateDiff onDidContentSizeChange onDidLayoutChange window.MutationObserver childList record.type attributes vitesse-dark vitesse-light unified node.code fontSize lineHeight maxHeight paddingBottom paddingTop tabSize resolvedRuntimeOptions.overflow nextOptions.unsafeCSS [data-file] [data-diff] helpers.cleanupEditor canonicalLanguage single window.cancelAnimationFrame clientX navigator.clipboard navigator.clipboard.writeText code-block-container is-diff is-plain-text code-block-header code-header-main icon-slot code-header-copy min-w-0 code-header-title code-header-caption code-header-actions code-action-btn action-icon copied evenodd code-block-body--collapsed code-block-body--expanded code-fallback-plain m-0 code-editor-layer code-height-placeholder editorReady void aria-hidden code-editor-fallback-surface code-loading-placeholder loading-skeleton skeleton-line short next next.type window.requestIdleCallback [data-node-index] node-spacer virtualized data-custom-id node-slot data-node-index data-node-type fade-node typewriter-node node-placeholder typewriterCursorRef typewriter-cursor [data-node-type="code_block"] [data-node-type="admonition"] [data-node-type="table"] [data-node-type="math_block"] [data-node-type="html_block"] [data-node-type="image"] performance [markstream-react][perf] markdown-renderer [markstream-react] htmlPreviewSandbox contains both allow-scripts and this only fully trusted content served an isolated en utf-8 viewport content="width=device-width initial-scale=1 html-preview-frame__backdrop--dark html-preview-frame--dark html-preview-frame__header html-preview-frame__title html-preview-frame__dot html-preview-frame__label html-preview-frame__close--dark html-preview-frame__iframe no-referrer about:blank loose strict viewBox gantt open-modal [data-mermaid-wrapper] mermaid-action-btn toggle-mode common.zoomIn common.zoomOut common.resetZoom transition-[height] duration-150 ease-out data-mermaid-wrapper mermaid-loading mermaid-spinner diagram… mermaid-block-header space-x-2 space-x-1 common.preview common.source common.export mermaid-error hasRenderedOnce mermaid-block modeContainerRef mermaid-modal-overlay mermaid-modal-panel mermaid-modal-header mermaid-modal-title mermaid-modal-close mermaid-modal-body modalContentRef mermaid-modal-content available default abort [katexWorkerClient] init cache-hit timeout waiting slot data-ssr-fallback normalizedLanguage data-language no renderNodeProp classAttr node.cite rowIdx bodyRows.length isOpen thematic-break-node cssVars image-node__img code-block-node code-block mermaid-block-node d2-block-node infographic-block-node math-block overflow-x-auto min-h-[40px] $$ math-inline-wrapper math-inline data-reference-id customComponents server-renderer node-content thinking htmlFor npm development process document normalizedType hunk !options.preserveBlankKind context removed added markstream-pre__diff-pane--inline original markstream-pre__diff-pane--original modified markstream-pre__diff-pane--modified ui-monospace monospace fontFamily markstream-pre--line-numbers markstream-pre--diff-preview markstream-pre--diff-inline showLineNumbers markstream-pre__diff-code line.empty markstream-pre__diff-line--empty markstream-pre__diff-rail markstream-pre__diff-number markstream-pre__diff-content markstream-pre__diff-content-inner markstream-pre__line-numbers markstream-pre__line-numbers-text markstream-pre__code mathRef math-inline--hidden math-inline__loading math-inline__spinner prototype constructor sequencediagram classdiagram kind statediagram erdiagram flowchart graph role aria-describedby rendering math-rendering value?.useMonaco stream-diffs/markstream globalThis.requestAnimationFrame globalThis.cancelAnimationFrame °C katex module did expected`;
2
2
  export default safeList;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "markstream-react",
3
3
  "type": "module",
4
- "version": "2.0.4",
4
+ "version": "2.0.5",
5
5
  "description": "React/Next.js streaming Markdown renderer for AI chat, LLM token streams, SSE/WebSocket output, incomplete Markdown, long documents, Mermaid, KaTeX, stream-diffs powered code blocks, and custom React components.",
6
6
  "author": "Simon He",
7
7
  "license": "MIT",
@@ -108,8 +108,8 @@
108
108
  "dependencies": {
109
109
  "@floating-ui/dom": "^1.8.0",
110
110
  "clsx": "^2.1.1",
111
- "markstream-core": "2.0.4",
112
- "stream-markdown-parser": "1.2.11"
111
+ "stream-markdown-parser": "1.2.12",
112
+ "markstream-core": "2.0.5"
113
113
  },
114
114
  "devDependencies": {
115
115
  "@types/react": "^18.3.31",