@ucap-llm/ai-ui 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ai-ui.es.js CHANGED
@@ -77900,7 +77900,7 @@ const MB = ["innerHTML"], LB = ["innerHTML"], PB = {
77900
77900
  }, null, 8, LB)) : (we(), Le("div", PB, La(r.value), 1))
77901
77901
  ], 2));
77902
77902
  }
77903
- }), pC = /* @__PURE__ */ Sr(kB, [["__scopeId", "data-v-8f20e7f4"]]);
77903
+ }), pC = /* @__PURE__ */ Sr(kB, [["__scopeId", "data-v-e0731b5b"]]);
77904
77904
  const BB = {
77905
77905
  key: 0,
77906
77906
  class: "ai-chat-record-avatar"
package/ai-ui.umd.js CHANGED
@@ -515,4 +515,4 @@ l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
515
515
  <i class="place-icon"></i>
516
516
  <span class="place-msg"></span>
517
517
  </div>
518
- </div>`),i}return(i,o)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["ai-content-parser",`ai-content-parser--${t.type}`])},[t.type==="html"?(d.openBlock(),d.createElementBlock("div",{key:0,innerHTML:r.value,class:"ai-content-parser-inner"},null,8,Z7)):t.type==="markdown"?(d.openBlock(),d.createElementBlock("div",{key:1,innerHTML:r.value,class:"ai-content-parser-inner"},null,8,j7)):(d.openBlock(),d.createElementBlock("div",J7,d.toDisplayString(r.value),1))],2))}}),[["__scopeId","data-v-8f20e7f4"]]),gB="",fB="",e8={key:0,class:"ai-chat-record-avatar"},t8={class:"ai-chat-record-wrap"},n8={class:"ai-chat-record-head"},r8={key:0,class:"ai-chat-record-time"},a8={class:"ai-chat-record-body"},i8={key:0,class:"ai-chat-record-loading-wrap"},o8={key:1,class:"ai-chat-record-content"},s8={class:"ai-chat-record-content-before"},l8={class:"ai-chat-record-content-inner"},c8={class:"ai-chat-record-content-after"},d8={key:0,class:"character-count"},u8={key:0,class:"ai-chat-record-foot"},_8={class:"foot-actions"},p8={key:0,class:"copy-tooltip-inner"},m8={key:1,class:"copy-tooltip-inner copy-tooltip-inner--error"},g8=Ke(Object.assign({name:"AiChatRecord"},{__name:"ChatRecord",props:{status:{type:String,default:"done"},loadingMessage:{type:String,default:"AI\u7EC4\u7EC7\u8BED\u8A00\u4E2D"},pos:{type:String,default:"l"},fullWidth:{type:Boolean,default:!1},avatar:{type:String,default:""},showAvatar:{type:Boolean,default:!0},content:{type:String,default:""},contentType:{type:String,default:"text"},streamOptimizeEnable:{type:Boolean,default:!0},time:{type:String},showTime:{type:Boolean,default:!0},timeFormat:{type:String,default:"yyyy/MM/dd hh:mm:ss"},showCharacterCount:{type:Boolean,default:!0},showFoot:{type:Boolean,default:!0},actions:{type:Array,default:()=>["copy","regenerate"]},copyTipType:{type:String,default:"tooltip"}},emits:["regenerate"],setup(t,{expose:e,emit:n}){const r={Loading:"loading",Generating:"generating",Done:"done"},a=t,i=n,o=d.ref(),s=d.ref(!0),l=d.ref(!1),c=d.computed(()=>NE(a.time,a.timeFormat)),u=d.computed(()=>{var p,g;if(a.status==="done"){let E=(g=(p=o.value)==null?void 0:p.querySelector(".ai-chat-record-content-inner"))==null?void 0:g.innerText;return(E==null?void 0:E.length)??0}else return 0});function _(){var E;let p=(E=o.value)==null?void 0:E.querySelector(".ai-chat-record-content-inner");if(!p)return;function g(){a.copyTipType==="message"?s.value?pl.success("\u590D\u5236\u6210\u529F"):pl.error("\u590D\u5236\u5931\u8D25"):(l.value=!0,setTimeout(()=>{l.value=!1},1e3))}AE(p).then(()=>{s.value=!0,g()}).catch(()=>{s.value=!1,g()})}return e({statusEnum:r}),(p,g)=>{const E=Or,S=Sf;return d.openBlock(),d.createElementBlock("div",{ref_key:"elRef",ref:o,class:d.normalizeClass(["ai-chat-record",{"ai-chat-record--r":t.pos==="r","ai-chat-record--full-width":t.fullWidth,"ai-chat-record--show-time":t.showTime}])},[t.showAvatar?(d.openBlock(),d.createElementBlock("div",e8,[d.renderSlot(p.$slots,"avatar",{},()=>[d.createVNode(E,{size:40,src:t.avatar},{icon:d.withCtx(()=>g[1]||(g[1]=[])),_:1},8,["src"])],!0)])):d.createCommentVNode("",!0),d.createElementVNode("div",t8,[d.createElementVNode("div",n8,[d.renderSlot(p.$slots,"head",{},()=>[t.showTime?(d.openBlock(),d.createElementBlock("div",r8,[d.renderSlot(p.$slots,"time",{time:c.value},()=>[d.createTextVNode(d.toDisplayString(c.value),1)],!0)])):d.createCommentVNode("",!0),d.renderSlot(p.$slots,"headRight",{},void 0,!0)],!0)]),d.createElementVNode("div",a8,[t.status===r.Loading?(d.openBlock(),d.createElementBlock("div",i8,[d.renderSlot(p.$slots,"loading",{},()=>[d.createVNode(F4,{theme:t.pos==="r"?"light":"",message:t.loadingMessage},null,8,["theme","message"])],!0)])):(d.openBlock(),d.createElementBlock("div",o8,[d.createElementVNode("div",s8,[d.renderSlot(p.$slots,"contentBefore",{},void 0,!0)]),d.createElementVNode("div",l8,[d.renderSlot(p.$slots,"content",{},()=>[d.createVNode(yy,{type:t.contentType,content:t.content,stream:"",streamOptimizeEnable:t.streamOptimizeEnable,streamDone:t.status===r.Done},null,8,["type","content","streamOptimizeEnable","streamDone"])],!0)]),d.createElementVNode("div",c8,[d.renderSlot(p.$slots,"contentAfter",{},void 0,!0)]),t.showCharacterCount&&t.status===r.Done?(d.openBlock(),d.createElementBlock("div",d8,[d.renderSlot(p.$slots,"characterCountBefore",{},void 0,!0),d.renderSlot(p.$slots,"characterCount",{},()=>[d.withDirectives(d.createElementVNode("span",null,"\u5171"+d.toDisplayString(u.value)+"\u4E2A\u5B57\u7B26",513),[[d.vShow,u.value]])],!0),d.renderSlot(p.$slots,"characterCountAfter",{},void 0,!0)])):d.createCommentVNode("",!0)]))]),t.showFoot?(d.openBlock(),d.createElementBlock("div",u8,[d.renderSlot(p.$slots,"foot",{},()=>[d.createElementVNode("div",_8,[d.renderSlot(p.$slots,"actionsBefore",{},void 0,!0),d.renderSlot(p.$slots,"actions",{},()=>[d.createVNode(S,{overlayClassName:"copy-tooltip",open:l.value,color:"#fff"},{title:d.withCtx(()=>[s.value?(d.openBlock(),d.createElementBlock("span",p8,[d.createVNode(d.unref(fa),{class:"copy-tooltip-icon"}),g[2]||(g[2]=d.createTextVNode(" \u590D\u5236\u6210\u529F "))])):(d.openBlock(),d.createElementBlock("span",m8,[d.createVNode(d.unref(ef),{class:"copy-tooltip-icon"}),g[3]||(g[3]=d.createTextVNode(" \u590D\u5236\u5931\u8D25 "))]))]),default:d.withCtx(()=>[t.status===r.Done&&t.actions.includes("copy")?(d.openBlock(),d.createElementBlock("button",{key:0,class:"action",onClick:_},g[4]||(g[4]=[d.createElementVNode("i",{class:"action-icon ai-icon ai-icon-copy"},null,-1),d.createTextVNode(" \u590D\u5236 ")]))):d.createCommentVNode("",!0)]),_:1},8,["open"]),t.status===r.Done&&t.actions.includes("regenerate")?(d.openBlock(),d.createElementBlock("button",{key:0,class:"action",onClick:g[0]||(g[0]=h=>i("regenerate"))},g[5]||(g[5]=[d.createElementVNode("i",{class:"action-icon ai-icon ai-icon-shuaxin"},null,-1),d.createTextVNode(" \u91CD\u65B0\u751F\u6210 ")]))):d.createCommentVNode("",!0)],!0),d.renderSlot(p.$slots,"actionsAfter",{},void 0,!0)])],!0)])):d.createCommentVNode("",!0),d.renderSlot(p.$slots,"bottom",{},void 0,!0)])],2)}}}),[["__scopeId","data-v-73a9b1f0"]]),SB="",Cy=[ky,N4,A4,x4,g8,yy],Ry=(t,e={})=>{Cy.forEach(n=>{t.component(n.name,n)})};return typeof window<"u"&&window.Vue&&Ry(window.Vue),{install:Ry,...Cy,utils:k4}});
518
+ </div>`),i}return(i,o)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["ai-content-parser",`ai-content-parser--${t.type}`])},[t.type==="html"?(d.openBlock(),d.createElementBlock("div",{key:0,innerHTML:r.value,class:"ai-content-parser-inner"},null,8,Z7)):t.type==="markdown"?(d.openBlock(),d.createElementBlock("div",{key:1,innerHTML:r.value,class:"ai-content-parser-inner"},null,8,j7)):(d.openBlock(),d.createElementBlock("div",J7,d.toDisplayString(r.value),1))],2))}}),[["__scopeId","data-v-e0731b5b"]]),gB="",fB="",e8={key:0,class:"ai-chat-record-avatar"},t8={class:"ai-chat-record-wrap"},n8={class:"ai-chat-record-head"},r8={key:0,class:"ai-chat-record-time"},a8={class:"ai-chat-record-body"},i8={key:0,class:"ai-chat-record-loading-wrap"},o8={key:1,class:"ai-chat-record-content"},s8={class:"ai-chat-record-content-before"},l8={class:"ai-chat-record-content-inner"},c8={class:"ai-chat-record-content-after"},d8={key:0,class:"character-count"},u8={key:0,class:"ai-chat-record-foot"},_8={class:"foot-actions"},p8={key:0,class:"copy-tooltip-inner"},m8={key:1,class:"copy-tooltip-inner copy-tooltip-inner--error"},g8=Ke(Object.assign({name:"AiChatRecord"},{__name:"ChatRecord",props:{status:{type:String,default:"done"},loadingMessage:{type:String,default:"AI\u7EC4\u7EC7\u8BED\u8A00\u4E2D"},pos:{type:String,default:"l"},fullWidth:{type:Boolean,default:!1},avatar:{type:String,default:""},showAvatar:{type:Boolean,default:!0},content:{type:String,default:""},contentType:{type:String,default:"text"},streamOptimizeEnable:{type:Boolean,default:!0},time:{type:String},showTime:{type:Boolean,default:!0},timeFormat:{type:String,default:"yyyy/MM/dd hh:mm:ss"},showCharacterCount:{type:Boolean,default:!0},showFoot:{type:Boolean,default:!0},actions:{type:Array,default:()=>["copy","regenerate"]},copyTipType:{type:String,default:"tooltip"}},emits:["regenerate"],setup(t,{expose:e,emit:n}){const r={Loading:"loading",Generating:"generating",Done:"done"},a=t,i=n,o=d.ref(),s=d.ref(!0),l=d.ref(!1),c=d.computed(()=>NE(a.time,a.timeFormat)),u=d.computed(()=>{var p,g;if(a.status==="done"){let E=(g=(p=o.value)==null?void 0:p.querySelector(".ai-chat-record-content-inner"))==null?void 0:g.innerText;return(E==null?void 0:E.length)??0}else return 0});function _(){var E;let p=(E=o.value)==null?void 0:E.querySelector(".ai-chat-record-content-inner");if(!p)return;function g(){a.copyTipType==="message"?s.value?pl.success("\u590D\u5236\u6210\u529F"):pl.error("\u590D\u5236\u5931\u8D25"):(l.value=!0,setTimeout(()=>{l.value=!1},1e3))}AE(p).then(()=>{s.value=!0,g()}).catch(()=>{s.value=!1,g()})}return e({statusEnum:r}),(p,g)=>{const E=Or,S=Sf;return d.openBlock(),d.createElementBlock("div",{ref_key:"elRef",ref:o,class:d.normalizeClass(["ai-chat-record",{"ai-chat-record--r":t.pos==="r","ai-chat-record--full-width":t.fullWidth,"ai-chat-record--show-time":t.showTime}])},[t.showAvatar?(d.openBlock(),d.createElementBlock("div",e8,[d.renderSlot(p.$slots,"avatar",{},()=>[d.createVNode(E,{size:40,src:t.avatar},{icon:d.withCtx(()=>g[1]||(g[1]=[])),_:1},8,["src"])],!0)])):d.createCommentVNode("",!0),d.createElementVNode("div",t8,[d.createElementVNode("div",n8,[d.renderSlot(p.$slots,"head",{},()=>[t.showTime?(d.openBlock(),d.createElementBlock("div",r8,[d.renderSlot(p.$slots,"time",{time:c.value},()=>[d.createTextVNode(d.toDisplayString(c.value),1)],!0)])):d.createCommentVNode("",!0),d.renderSlot(p.$slots,"headRight",{},void 0,!0)],!0)]),d.createElementVNode("div",a8,[t.status===r.Loading?(d.openBlock(),d.createElementBlock("div",i8,[d.renderSlot(p.$slots,"loading",{},()=>[d.createVNode(F4,{theme:t.pos==="r"?"light":"",message:t.loadingMessage},null,8,["theme","message"])],!0)])):(d.openBlock(),d.createElementBlock("div",o8,[d.createElementVNode("div",s8,[d.renderSlot(p.$slots,"contentBefore",{},void 0,!0)]),d.createElementVNode("div",l8,[d.renderSlot(p.$slots,"content",{},()=>[d.createVNode(yy,{type:t.contentType,content:t.content,stream:"",streamOptimizeEnable:t.streamOptimizeEnable,streamDone:t.status===r.Done},null,8,["type","content","streamOptimizeEnable","streamDone"])],!0)]),d.createElementVNode("div",c8,[d.renderSlot(p.$slots,"contentAfter",{},void 0,!0)]),t.showCharacterCount&&t.status===r.Done?(d.openBlock(),d.createElementBlock("div",d8,[d.renderSlot(p.$slots,"characterCountBefore",{},void 0,!0),d.renderSlot(p.$slots,"characterCount",{},()=>[d.withDirectives(d.createElementVNode("span",null,"\u5171"+d.toDisplayString(u.value)+"\u4E2A\u5B57\u7B26",513),[[d.vShow,u.value]])],!0),d.renderSlot(p.$slots,"characterCountAfter",{},void 0,!0)])):d.createCommentVNode("",!0)]))]),t.showFoot?(d.openBlock(),d.createElementBlock("div",u8,[d.renderSlot(p.$slots,"foot",{},()=>[d.createElementVNode("div",_8,[d.renderSlot(p.$slots,"actionsBefore",{},void 0,!0),d.renderSlot(p.$slots,"actions",{},()=>[d.createVNode(S,{overlayClassName:"copy-tooltip",open:l.value,color:"#fff"},{title:d.withCtx(()=>[s.value?(d.openBlock(),d.createElementBlock("span",p8,[d.createVNode(d.unref(fa),{class:"copy-tooltip-icon"}),g[2]||(g[2]=d.createTextVNode(" \u590D\u5236\u6210\u529F "))])):(d.openBlock(),d.createElementBlock("span",m8,[d.createVNode(d.unref(ef),{class:"copy-tooltip-icon"}),g[3]||(g[3]=d.createTextVNode(" \u590D\u5236\u5931\u8D25 "))]))]),default:d.withCtx(()=>[t.status===r.Done&&t.actions.includes("copy")?(d.openBlock(),d.createElementBlock("button",{key:0,class:"action",onClick:_},g[4]||(g[4]=[d.createElementVNode("i",{class:"action-icon ai-icon ai-icon-copy"},null,-1),d.createTextVNode(" \u590D\u5236 ")]))):d.createCommentVNode("",!0)]),_:1},8,["open"]),t.status===r.Done&&t.actions.includes("regenerate")?(d.openBlock(),d.createElementBlock("button",{key:0,class:"action",onClick:g[0]||(g[0]=h=>i("regenerate"))},g[5]||(g[5]=[d.createElementVNode("i",{class:"action-icon ai-icon ai-icon-shuaxin"},null,-1),d.createTextVNode(" \u91CD\u65B0\u751F\u6210 ")]))):d.createCommentVNode("",!0)],!0),d.renderSlot(p.$slots,"actionsAfter",{},void 0,!0)])],!0)])):d.createCommentVNode("",!0),d.renderSlot(p.$slots,"bottom",{},void 0,!0)])],2)}}}),[["__scopeId","data-v-73a9b1f0"]]),SB="",Cy=[ky,N4,A4,x4,g8,yy],Ry=(t,e={})=>{Cy.forEach(n=>{t.component(n.name,n)})};return typeof window<"u"&&window.Vue&&Ry(window.Vue),{install:Ry,...Cy,utils:k4}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ucap-llm/ai-ui",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "common component library for vue3",
5
5
  "main": "ai-ui.es.js",
6
6
  "publishConfig": {