@yeaft/webchat-agent 1.0.192 → 1.0.193
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.0.
|
|
1
|
+
{"version":"1.0.193"}
|
|
@@ -624,7 +624,7 @@ The agent will restart after upgrading.`,"chat.agent.alreadyLatest":"Agent is al
|
|
|
624
624
|
:title="$t ? $t('yeaft.vp.speaker.stop') : 'Stop'"
|
|
625
625
|
><svg viewBox="0 0 24 24" width="14" height="14"><rect x="6" y="6" width="12" height="12" rx="2" fill="currentColor"/></svg></button>
|
|
626
626
|
</div>
|
|
627
|
-
`,setup(e){let t=Bt(),s=Vue.computed(()=>t.isVpTypingInCurrentConv(e.vpId)),n=Vue.computed(()=>{if(!e.timestamp)return"";try{return new Date(e.timestamp).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}catch{return""}}),i=Vue.computed(()=>{if(!e.timestamp)return"";try{return new Date(e.timestamp).toLocaleString()}catch{return""}});return{isTyping:s,timestampText:n,timestampFullText:i}}}});function xc(e,t){let s=t?.status||"pending",n=!!e&&e.isStreaming!==!0,r=s==="in_progress"&&n?"stopped":s;return{...t,rawStatus:s,displayStatus:r,displayText:r==="in_progress"?t?.activeForm||t?.content||"":t?.content||""}}var Tc=N(()=>{});function zr(e,t){return`${String(e||"mermaid-diagram").replace(/[^a-z0-9_-]+/gi,"-").replace(/^-+|-+$/g,"")||"mermaid-diagram"}.${t}`}function gg(e){if(typeof document>"u")return String(e||"").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'");let t=document.createElement("textarea");return t.innerHTML=String(e||""),t.value}function mg(e,t){return e!=="mermaid"?"":` data-mermaid-source="${encodeURIComponent(gg(t))}"`}function hg(e){let t=e?.dataset?.mermaidSource;if(!t)return"";try{return decodeURIComponent(t)}catch{return""}}function Ec(e,t){let s=document.createElement("a");s.href=e,s.download=t,document.body.appendChild(s),s.click(),s.remove()}function _c(e,t){let s=URL.createObjectURL(e);Ec(s,t),setTimeout(()=>URL.revokeObjectURL(s),0)}function vg(e){let t=o=>{let a=Number.parseFloat(String(o||"").replace("px",""));return Number.isFinite(a)&&a>0?a:null},s=t(e.getAttribute("width")),n=t(e.getAttribute("height"));if(s&&n)return{width:s,height:n};let i=e.getAttribute("viewBox");if(i){let o=i.trim().split(/\s+/).map(Number.parseFloat);if(o.length===4&&o.every(a=>Number.isFinite(a))&&o[2]>0&&o[3]>0)return{width:o[2],height:o[3]}}let r=e.getBoundingClientRect?.();return r?.width&&r?.height?{width:r.width,height:r.height}:{width:1200,height:800}}function Rc(e,t){return typeof getComputedStyle>"u"||typeof document>"u"?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}function yg(e,t,s){e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("width",String(t)),e.setAttribute("height",String(s)),e.getAttribute("viewBox")||e.setAttribute("viewBox",`0 0 ${t} ${s}`)}async function bg(e,t,s,n){if(!window.htmlToImage)return!1;let i=zr("mermaid-diagram",t==="jpg"?"jpg":"png"),r={backgroundColor:Rc("--bg-main","white"),height:n,pixelRatio:Math.max(1,Math.min(3,window.devicePixelRatio||1)),width:s},o=t==="jpg"?await window.htmlToImage.toJpeg(e,{...r,quality:.92}):await window.htmlToImage.toPng(e,r);return Ec(o,i),!0}async function Dc(e,t){let s=e.querySelector("svg");if(!s)throw new Error("No Mermaid SVG found");let{width:n,height:i}=vg(s);try{if(await bg(s,t,n,i))return}catch{}let r=s.cloneNode(!0);yg(r,n,i);let o=new XMLSerializer().serializeToString(r),a=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(a);try{let c=new Image,d=new Promise((h,A)=>{c.onload=h,c.onerror=()=>A(new Error("Failed to load Mermaid SVG for export"))});c.src=l,await d;let u=Math.max(1,Math.min(3,window.devicePixelRatio||1)),f=document.createElement("canvas");f.width=Math.ceil(n*u),f.height=Math.ceil(i*u);let p=f.getContext("2d");if(!p)throw new Error("Canvas is not available");p.scale(u,u),t==="jpg"&&(p.fillStyle=Rc("--bg-main","white"),p.fillRect(0,0,n,i)),p.drawImage(c,0,0,n,i);let y=t==="jpg"?"image/jpeg":"image/png",m=await new Promise((h,A)=>{f.toBlob(x=>x?h(x):A(new Error("Failed to export Mermaid image")),y,.92)});_c(m,zr("mermaid-diagram",t==="jpg"?"jpg":"png"))}finally{URL.revokeObjectURL(l)}}function wg(e){let t=`\`\`\`mermaid
|
|
627
|
+
`,setup(e){let t=Bt(),s=Vue.computed(()=>t.isVpTypingInCurrentConv(e.vpId)),n=Vue.computed(()=>{if(!e.timestamp)return"";try{return new Date(e.timestamp).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}catch{return""}}),i=Vue.computed(()=>{if(!e.timestamp)return"";try{return new Date(e.timestamp).toLocaleString()}catch{return""}});return{isTyping:s,timestampText:n,timestampFullText:i}}}});function xc(e,t){let s=t?.status||"pending",n=!!e&&e.isStreaming!==!0,r=s==="in_progress"&&n?"stopped":s;return{...t,rawStatus:s,displayStatus:r,displayText:r==="in_progress"?t?.activeForm||t?.content||"":t?.content||""}}var Tc=N(()=>{});function zr(e,t){return`${String(e||"mermaid-diagram").replace(/[^a-z0-9_-]+/gi,"-").replace(/^-+|-+$/g,"")||"mermaid-diagram"}.${t}`}function gg(e){if(typeof document>"u")return String(e||"").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'");let t=document.createElement("textarea");return t.innerHTML=String(e||""),t.value}function mg(e,t){return e!=="mermaid"?"":` data-mermaid-source="${encodeURIComponent(gg(t))}"`}function hg(e){let t=e?.dataset?.mermaidSource;if(!t)return"";try{return decodeURIComponent(t)}catch{return""}}function Ec(e,t){let s=document.createElement("a");s.href=e,s.download=t,document.body.appendChild(s),s.click(),s.remove()}function _c(e,t){let s=URL.createObjectURL(e);Ec(s,t),setTimeout(()=>URL.revokeObjectURL(s),0)}function vg(e){let t=o=>{let a=Number.parseFloat(String(o||"").replace("px",""));return Number.isFinite(a)&&a>0?a:null},s=t(e.getAttribute("width")),n=t(e.getAttribute("height"));if(s&&n)return{width:s,height:n};let i=e.getAttribute("viewBox");if(i){let o=i.trim().split(/\s+/).map(Number.parseFloat);if(o.length===4&&o.every(a=>Number.isFinite(a))&&o[2]>0&&o[3]>0)return{width:o[2],height:o[3]}}let r=e.getBoundingClientRect?.();return r?.width&&r?.height?{width:r.width,height:r.height}:{width:1200,height:800}}function Rc(e,t){return typeof getComputedStyle>"u"||typeof document>"u"?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}function yg(e,t,s){e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("width",String(t)),e.setAttribute("height",String(s)),e.getAttribute("viewBox")||e.setAttribute("viewBox",`0 0 ${t} ${s}`)}async function bg(e,t,s,n){if(!window.htmlToImage)return!1;let i=zr("mermaid-diagram",t==="jpg"?"jpg":"png"),r={backgroundColor:Rc("--bg-main","white"),height:n,pixelRatio:Math.max(1,Math.min(3,window.devicePixelRatio||1)),style:{margin:"0"},width:s},o=t==="jpg"?await window.htmlToImage.toJpeg(e,{...r,quality:.92}):await window.htmlToImage.toPng(e,r);return Ec(o,i),!0}async function Dc(e,t){let s=e.querySelector("svg");if(!s)throw new Error("No Mermaid SVG found");let{width:n,height:i}=vg(s);try{if(await bg(s,t,n,i))return}catch{}let r=s.cloneNode(!0);yg(r,n,i);let o=new XMLSerializer().serializeToString(r),a=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(a);try{let c=new Image,d=new Promise((h,A)=>{c.onload=h,c.onerror=()=>A(new Error("Failed to load Mermaid SVG for export"))});c.src=l,await d;let u=Math.max(1,Math.min(3,window.devicePixelRatio||1)),f=document.createElement("canvas");f.width=Math.ceil(n*u),f.height=Math.ceil(i*u);let p=f.getContext("2d");if(!p)throw new Error("Canvas is not available");p.scale(u,u),t==="jpg"&&(p.fillStyle=Rc("--bg-main","white"),p.fillRect(0,0,n,i)),p.drawImage(c,0,0,n,i);let y=t==="jpg"?"image/jpeg":"image/png",m=await new Promise((h,A)=>{f.toBlob(x=>x?h(x):A(new Error("Failed to export Mermaid image")),y,.92)});_c(m,zr("mermaid-diagram",t==="jpg"?"jpg":"png"))}finally{URL.revokeObjectURL(l)}}function wg(e){let t=`\`\`\`mermaid
|
|
628
628
|
${String(e||"").trim()}
|
|
629
629
|
\`\`\`
|
|
630
630
|
`;_c(new Blob([t],{type:"text/markdown;charset=utf-8"}),zr("mermaid-diagram","md"))}function kg(e,t){let s=document.createElement("div");s.className="mermaid-export-controls",s.setAttribute("aria-label",Ae("mermaid.export"));let n=[{label:Ae("mermaid.exportMd"),action:()=>wg(t)},{label:Ae("mermaid.exportPng"),action:()=>Dc(e,"png")},{label:Ae("mermaid.exportJpg"),action:()=>Dc(e,"jpg")}];for(let i of n){let r=document.createElement("button");r.type="button",r.className="mermaid-export-btn",r.textContent=i.label,r.title=i.label,r.addEventListener("click",async o=>{o.preventDefault(),o.stopPropagation();try{await i.action()}catch{}}),s.appendChild(r)}return s}function Sg(){Mc||typeof marked>"u"||(marked.setOptions({highlight:(e,t)=>{if(typeof hljs<"u"&&t&&hljs.getLanguage(t))try{return hljs.highlight(e,{language:t}).value}catch{}return e},breaks:!0,gfm:!0}),Mc=!0)}function Cg(e){return e.replace(/<pre><code([^>]*)>([\s\S]*?)<\/code><\/pre>/g,(t,s,n)=>{let i=s.match(/class="language-(\w+)"/),r=i?i[1]:"",o=mg(r,n);return`<div class="code-block-wrapper">
|
|
Binary file
|
package/package.json
CHANGED