@molin.ai/shop-ai 0.9.10 → 0.9.11

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.
@@ -1925,7 +1925,7 @@ var Vp=Object.create;var Fs=Object.defineProperty;var Np=Object.getOwnPropertyDe
1925
1925
  <slot>
1926
1926
  <div class="h-5 w-full"></div>
1927
1927
  </slot>
1928
- `}setValue(r){let n=a(this,Y,Ir);if(!n){console.warn("input element not found, cannot set value");return}n.value=r,m(this,Y,Cs).call(this),this.dispatchEvent(new Dt.ChangeEvent({delta:null,full:r}))}focus(){a(this,Y,Ir)?.focus()}};Nn=new WeakMap,Y=new WeakSet,Ir=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},bp=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},xp=function(r){S1(r)&&(r.preventDefault(),!this.streaming&&!this.disabled&&!this.loading&&a(this,Y,bp)?.click())},kp=function(r){r.preventDefault();let n=new Date;if(n.getTime()-a(this,Nn).getTime()<500)return;if(g(this,Nn,n),this.streaming){this.dispatchEvent(new Dt.CancelEvent);return}let s=a(this,Y,Ir);if(!s)throw new Error("Expected input element to be present");let o=s.value.trim();(o||this.enableImageUpload&&this.images.length>0)&&this.dispatchEvent(new Dt.SubmitEvent(o))&&(s.value="",this.focus()),m(this,Y,Cs).call(this)},Cp=function(r){this.dispatchEvent(new Dt.ChangeEvent({delta:r.data,full:r.target instanceof HTMLTextAreaElement?r.target.value:""})),m(this,Y,Cs).call(this)},Cs=function(){let r=a(this,Y,Ir);if(!r)return;let{maxHeight:n,initialHeight:i,paddingY:s}=Aa;r.style.height=`${i}px`;let o=r.scrollHeight,u=s*2,l=Math.min(o-u,n);r.style.height=`${l}px`,this.requestUpdate()},w(Dt,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},loading:{type:Boolean},placeholder:{type:String},color:{type:String},enableImageUpload:{type:Boolean},onImageUploadClick:{type:Function},images:{type:Array},onImageDelete:{type:Function}});var Ge=Dt,Ma;Ge.ChangeEvent=(Ma=class extends CustomEvent{constructor(e,r={}){super(Ge.ChangeEvent.type,{detail:e,...r})}},w(Ma,"type","mw:change"),Ma);var Ia;Ge.SubmitEvent=(Ia=class extends CustomEvent{constructor(e,r={}){super(Ge.SubmitEvent.type,{detail:e,...r,cancelable:!0})}},w(Ia,"type","mw:submit"),Ia);var Ta;Ge.CancelEvent=(Ta=class extends CustomEvent{constructor(e={}){super(Ge.CancelEvent.type,{...e})}},w(Ta,"type","mw:cancel"),Ta);function S1(t){return(t.code==="Enter"||t.code==="NumpadEnter")&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey}customElements.get("mw-chat-input")||customElements.define("mw-chat-input",Ge);var Or,Sp,Ep,Tr=class Tr extends A(E){constructor(){super();d(this,Or);w(this,"render",()=>f`
1928
+ `}setValue(r){let n=a(this,Y,Ir);if(!n){console.warn("input element not found, cannot set value");return}n.value=r,m(this,Y,Cs).call(this),this.dispatchEvent(new Dt.ChangeEvent({delta:null,full:r}))}focus(){a(this,Y,Ir)?.focus()}};Nn=new WeakMap,Y=new WeakSet,Ir=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},bp=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},xp=function(r){S1(r)&&(r.preventDefault(),!this.streaming&&!this.disabled&&!this.loading&&a(this,Y,bp)?.click())},kp=function(r){r.preventDefault();let n=new Date;if(n.getTime()-a(this,Nn).getTime()<500)return;if(g(this,Nn,n),this.streaming){this.dispatchEvent(new Dt.CancelEvent);return}let s=a(this,Y,Ir);if(!s)throw new Error("Expected input element to be present");let o=s.value.trim();(o||this.enableImageUpload&&this.images.length>0)&&this.dispatchEvent(new Dt.SubmitEvent(o))&&(s.value=""),m(this,Y,Cs).call(this),window.requestAnimationFrame(()=>{this.focus()})},Cp=function(r){this.dispatchEvent(new Dt.ChangeEvent({delta:r.data,full:r.target instanceof HTMLTextAreaElement?r.target.value:""})),m(this,Y,Cs).call(this)},Cs=function(){let r=a(this,Y,Ir);if(!r)return;let{maxHeight:n,initialHeight:i,paddingY:s}=Aa;r.style.height=`${i}px`;let o=r.scrollHeight,u=s*2,l=Math.min(o-u,n);r.style.height=`${l}px`,this.requestUpdate()},w(Dt,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},loading:{type:Boolean},placeholder:{type:String},color:{type:String},enableImageUpload:{type:Boolean},onImageUploadClick:{type:Function},images:{type:Array},onImageDelete:{type:Function}});var Ge=Dt,Ma;Ge.ChangeEvent=(Ma=class extends CustomEvent{constructor(e,r={}){super(Ge.ChangeEvent.type,{detail:e,...r})}},w(Ma,"type","mw:change"),Ma);var Ia;Ge.SubmitEvent=(Ia=class extends CustomEvent{constructor(e,r={}){super(Ge.SubmitEvent.type,{detail:e,...r,cancelable:!0})}},w(Ia,"type","mw:submit"),Ia);var Ta;Ge.CancelEvent=(Ta=class extends CustomEvent{constructor(e={}){super(Ge.CancelEvent.type,{...e})}},w(Ta,"type","mw:cancel"),Ta);function S1(t){return(t.code==="Enter"||t.code==="NumpadEnter")&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey}customElements.get("mw-chat-input")||customElements.define("mw-chat-input",Ge);var Or,Sp,Ep,Tr=class Tr extends A(E){constructor(){super();d(this,Or);w(this,"render",()=>f`
1929
1929
  <div class="popup-desktop group relative w-[300px] cursor-pointer rounded-[17px] shadow-2xl select-none">
1930
1930
  <mw-spinning-border .color="${this.color}" .border="${"transparent"}" .radius="${"17px"}">
1931
1931
  <!-- wrapper -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molin.ai/shop-ai",
3
- "version": "0.9.10",
3
+ "version": "0.9.11",
4
4
  "description": "Molin Shop AI",
5
5
  "keywords": [
6
6
  "molin",