@topthink/chat 1.0.29 → 1.0.30

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.
Files changed (2) hide show
  1. package/es/index.js +1 -1
  2. package/package.json +2 -2
package/es/index.js CHANGED
@@ -563,7 +563,7 @@ import*as e from"react";import{useCallback as t,useState as r,useImperativeHandl
563
563
  box-shadow: 0.125rem 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
564
564
  `,Te=f.div`
565
565
  margin: 0 1rem 1rem;
566
- `;function _e(e){let{className:n,bot:o,user:i,input:s,logLevel:l,imageResolver:c,placeholder:d,actions:p,...u}=e;const[f,b]=h((()=>P(u.messages||[]))),[x,v]=r(!1),k=a(!s),y=a(null),w=t((()=>{const e=y.current;e&&requestAnimationFrame((()=>{e.scrollTo({top:e.scrollHeight})}))}),[]),{ref:z,height:M}=O();return m((()=>{!x&&k.current||(x&&(k.current=!0),w())}),[M,x,k]),j(te,{bot:o,user:i,logLevel:l,imageResolver:c,children:j(Oe,{className:n,children:N(g,{children:[j(Be,{ref:y,children:N(Le,{ref:z,children:[0===f.length&&d,f.map(((e,t)=>j(ke,{actions:p,message:e,updater:t=>{b((r=>{const n=r.findIndex((t=>t.id===e.id));-1!==n&&t(r[n])}))}},t)))]})}),s&&j(Ce,{onMessages:b,scrollRef:y,onLoading:v,...s})]})})})}const Be=f.div`
566
+ `;function _e(e){let{className:n,bot:o,user:i,input:s,logLevel:l,imageResolver:c,placeholder:d,actions:p,...u}=e;const[f,b]=h((()=>P(u.messages||[]))),[x,v]=r(!1),k=a(!s),y=a(null),w=t((()=>{const e=y.current;e&&requestAnimationFrame((()=>{e.scrollTo({top:e.scrollHeight})}))}),[]),{ref:z,height:M}=O();return m((()=>{!x&&k.current||(x&&(k.current=!0),w())}),[M,x,k]),j(te,{bot:o,user:i,logLevel:l,imageResolver:c,children:j(Oe,{className:n,children:N(g,{children:[j(Be,{ref:y,children:N(Le,{ref:z,children:[0===f.length&&d,f.slice(-30).map(((e,t)=>j(ke,{actions:p,message:e,updater:t=>{b((r=>{const n=r.findIndex((t=>t.id===e.id));-1!==n&&t(r[n])}))}},t)))]})}),s&&j(Ce,{onMessages:b,scrollRef:y,onLoading:v,...s})]})})})}const Be=f.div`
567
567
  display: flex;
568
568
  flex-direction: column;
569
569
  flex: 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topthink/chat",
3
- "version": "1.0.29",
3
+ "version": "1.0.30",
4
4
  "scripts": {
5
5
  "prebuild": "rimraf es types",
6
6
  "build": "rollup -c --environment NODE_ENV:production",
@@ -65,5 +65,5 @@
65
65
  },
66
66
  "author": "yunwuxin <tzzhangyajun@qq.com> (https://github.com/yunwuxin)",
67
67
  "license": "MIT",
68
- "gitHead": "59f06048f71cec0738171d3c9be1ea802c51a2a6"
68
+ "gitHead": "afc5154914b1f3a021798d6e947cc0e3050bde26"
69
69
  }