@gpustack/core-ui 1.0.22 → 1.0.23

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,5 +1,5 @@
1
- (function(){let e=/\x1b\[(\d*);?(\d*)?([A-DJKHfm])/g,t=e=>e.startsWith(`(…)`)?e.slice(3):e,n=new class{cursorRow=0;cursorCol=0;screen=[[``]];rawDataRows=0;uid=0;isProcessing=!1;taskQueue=[];page=1;progress=0;percent=0;isComplete=!1;chunked=!0;reminder=``;lines=[];isDownloading=!1;pageSize=500;colorMap={30:`black`,31:`red`,32:`green`,33:`yellow`,34:`blue`,35:`magenta`,36:`cyan`,37:`white`};constructor(){this.reset()}reset(){this.cursorRow=0,this.cursorCol=0,this.screen=[[``]],this.rawDataRows=0,this.uid+=1,this.lines=[],this.reminder=``,this.page=1}setPage(e){this.page=e??1}setPercent(e){this.percent=e??0}setProgress(e){this.progress=e??0}setIsCompelete(e){this.isComplete=e}setChunked(e){this.chunked=e??!0}setIsDownloading(e){this.isDownloading=e}setId(){return this.uid+=1,this.uid}handleText(e){for(let t=0;t<e.length;t++){let n=e[t];if(n===`\r`){if(e[t+1]===`
1
+ (function(){let e=/\x1b\[(\d*);?(\d*)?([A-DJKHfm])/g,t=e=>e.startsWith(`(…)`)?e.slice(3):e,n=new class{cursorRow=0;cursorCol=0;screen=[[``]];rawDataRows=0;uid=0;isProcessing=!1;taskQueue=[];page=1;progress=0;percent=0;isComplete=!1;chunked=!0;reminder=``;lines=[];isDownloading=!1;pageSize=500;resetFlag=!1;colorMap={30:`black`,31:`red`,32:`green`,33:`yellow`,34:`blue`,35:`magenta`,36:`cyan`,37:`white`};constructor(){this.reset()}reset(){this.cursorRow=0,this.cursorCol=0,this.screen=[[``]],this.rawDataRows=0,this.uid+=1,this.lines=[],this.reminder=``,this.page=1,this.resetFlag=!0}setPage(e){this.page=e??1}setPercent(e){this.percent=e??0}setProgress(e){this.progress=e??0}setIsCompelete(e){this.isComplete=e}setChunked(e){this.chunked=e??!0}setIsDownloading(e){this.isDownloading=e}setId(){return this.uid+=1,this.uid}handleText(e){for(let t=0;t<e.length;t++){let n=e[t];if(n===`\r`){if(e[t+1]===`
2
2
  `)continue;this.cursorCol=0}else if(n===`
3
3
  `)this.rawDataRows++,this.cursorRow++,this.cursorCol=0,this.screen[this.cursorRow]||(this.screen[this.cursorRow]=[``]);else{let e=this.screen[this.cursorRow]||(this.screen[this.cursorRow]=[``]);e[this.cursorCol]=n||``,this.cursorCol++}}}handleAnsiSequence(e,t){let n=parseInt(e[1]||`1`,10),r=parseInt(e[2]||`1`,10);switch(e[3]){case`A`:this.cursorRow=Math.max(0,this.cursorRow-n);break;case`B`:this.cursorRow+=n;break;case`C`:this.cursorCol+=n;break;case`D`:this.cursorCol=Math.max(0,this.cursorCol-n);break;case`H`:this.cursorRow=Math.max(0,n-1),this.cursorCol=Math.max(0,r-1);break;case`J`:n===2&&this.reset();break;case`m`:break}for(;this.screen.length<=this.cursorRow&&!t;)this.screen.push([``]);for(;this.screen[this.cursorRow].length<=this.cursorCol&&!t;)this.screen[this.cursorRow].push(``)}processInput(n){let r,i=0;for(;(r=e.exec(n))!==null;){let t=n.slice(i,r.index);this.handleText(t),i=e.lastIndex,this.handleAnsiSequence(r,i===n.length-1)}let a=n.slice(i);return this.handleText(a),{data:this.screen.map((e,n)=>t(e.join(``))),lines:this.rawDataRows,remainder:``}}getScreenText(){return this.screen.map(e=>t(e.join(``))).join(`
4
- `)}processInputByLine(e){let t=e?.split(/\r?\n/)||[],n=t.pop()||``;return this.rawDataRows+=t.length,t.forEach(e=>{this.lines.push(e)}),{data:this.lines,lines:this.rawDataRows,remainder:n}}getAllLines(){return this.lines.join(`
5
- `)}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.taskQueue.length>0;){let e=``;if(e=this.isDownloading?this.taskQueue.shift()||``:this.reminder+this.taskQueue.shift(),e)try{let t=this.isDownloading?this.processInput(e):this.processInputByLine(e);this.isDownloading||(this.reminder=t.remainder),this.chunked?self.postMessage({result:t.data,lines:t.lines}):this.isComplete||self.postMessage({result:``,percent:this.percent,isComplete:!1})}catch(e){console.error(`Error processing input:`,e)}await new Promise(e=>{setTimeout(e,0)})}this.isProcessing=!1,this.taskQueue.length>0?this.processQueue():this.isComplete&&!this.chunked&&(self.postMessage({result:this.getAllLines(),percent:this.percent,isComplete:!0}),this.reset())}}enqueueData(e){this.taskQueue.push(e),this.isProcessing||this.processQueue()}};self.onmessage=function(e){let{inputStr:t,reset:r,page:i,isComplete:a=!1,chunked:o=!0,percent:s=0,isDownloading:c=!1}=e.data;n.setIsDownloading(c),n.setPage(i),n.setIsCompelete(a),n.setChunked(o),n.setPercent(s),r&&n.reset(),n.enqueueData(t)},self.onerror=function(e){console.error(`parse logs error===`,e)}})();
4
+ `)}processInputByLine(e){let t=e?.split(/\r?\n/)||[],n=t.pop()||``;return this.rawDataRows+=t.length,this.chunked||t.forEach(e=>{this.lines.push(e)}),{data:t,lines:this.rawDataRows,remainder:n}}getAllLines(){return this.lines.join(`
5
+ `)}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.taskQueue.length>0;){let e=``;if(e=this.isDownloading?this.taskQueue.shift()||``:this.reminder+this.taskQueue.shift(),e)try{let t=this.isDownloading?this.processInput(e):this.processInputByLine(e);this.isDownloading||(this.reminder=t.remainder),this.chunked?(self.postMessage({result:t.data,lines:t.lines,append:!this.isDownloading,reset:this.resetFlag}),this.resetFlag=!1):this.isComplete||self.postMessage({result:``,percent:this.percent,isComplete:!1})}catch(e){console.error(`Error processing input:`,e)}await new Promise(e=>{setTimeout(e,0)})}this.isProcessing=!1,this.taskQueue.length>0?this.processQueue():this.isComplete&&!this.chunked&&(self.postMessage({result:this.getAllLines(),percent:this.percent,isComplete:!0}),this.reset())}}enqueueData(e){this.taskQueue.push(e),this.isProcessing||this.processQueue()}};self.onmessage=function(e){let{inputStr:t,reset:r,page:i,isComplete:a=!1,chunked:o=!0,percent:s=0,isDownloading:c=!1}=e.data;n.setIsDownloading(c),n.setPage(i),n.setIsCompelete(a),n.setChunked(o),n.setPercent(s),r&&n.reset(),n.enqueueData(t)},self.onerror=function(e){console.error(`parse logs error===`,e)}})();
@@ -227,7 +227,10 @@ var O = { wrapper: "index-module__wrapper___AP3Au" }, k = ({ children: e, maxHei
227
227
  } catch {
228
228
  a = !1;
229
229
  } finally {
230
- document.body.removeChild(t), n && (n.removeAllRanges(), r && n.addRange(r)), i?.focus?.();
230
+ document.body.removeChild(t);
231
+ try {
232
+ n && (n.removeAllRanges(), r && n.addRange(r)), i?.focus?.();
233
+ } catch {}
231
234
  }
232
235
  return a;
233
236
  }, k = async () => {
@@ -19026,7 +19029,10 @@ var mr = x.div`
19026
19029
  children: [/* @__PURE__ */ f("span", { children: t }), /* @__PURE__ */ f(N, {
19027
19030
  text: e || "",
19028
19031
  size: "small",
19029
- style: { color: "#abb2bf" }
19032
+ style: {
19033
+ color: "#abb2bf",
19034
+ backgroundColor: n === "dark" ? "transparent" : "#fff"
19035
+ }
19030
19036
  })]
19031
19037
  }) : null, _r = (e) => {
19032
19038
  let { code: t = "", copyValue: n, lang: r, autodetect: i = !0, ignoreIllegals: a = !0, copyable: o = !0, height: s = "auto", style: c, xScrollable: u = !1 } = e || {}, d = l(() => {