@topthink/chat 1.1.31 → 1.1.32
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/es/index.js
CHANGED
|
@@ -748,7 +748,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{styled as
|
|
|
748
748
|
background: var(--bs-secondary-bg-subtle);
|
|
749
749
|
}
|
|
750
750
|
}
|
|
751
|
-
`,_t=R($(((r,n)=>{let{className:i,bot:o,user:s,input:a,logLevel:l,imageResolver:c,nodeIconResolver:d,placeholder:h,actions:m,onboarding:u,conversation:p,cite:b,speech:v,renderItem:x,messages:k,request:w}=r;const
|
|
751
|
+
`,_t=R($(((r,n)=>{let{className:i,bot:o,user:s,input:a,logLevel:l,imageResolver:c,nodeIconResolver:d,placeholder:h,actions:m,onboarding:u,conversation:p,cite:b,speech:v,renderItem:x,messages:k,request:w,transformMessages:N=_e}=r;const $=C((e=>{const t=[];if(u&&!1!==u.enable){const e=Ue(u.questions||[]);t.push({chunks:[{content:[u.prologue,...e.map((e=>`[${e}](#!question)`))].join("\n"),tools:[]}],loading:u.loading})}return e?t.concat(N(e.messages||[])):k?t.concat(N(k)):t}),[u]),[S,R]=M(p?.id),[A,F]=g([]);j((()=>{F($(p))}),[u]);const[I,D]=M(!1),L=E(null),[O,T]=M([]),P=C((e=>{I||(R(e?.id),F($(e)),T([]))}),[I,$]);return z(n,(()=>({reset:P})),[P]),t(de,{request:q((()=>w?"string"==typeof w?y.create({baseURL:w}):w:y),[w]),bot:o,user:s,logLevel:l,imageResolver:c,nodeIconResolver:d,conversationId:S,setConversationId:R,messages:A,setMessages:F,suggestions:O,setSuggestions:T,loading:I,setLoading:D,reset:P,children:t(Ht,{className:i,children:e(f,{children:[t(Ut,{ref:L,children:t(Tt,{placeholder:h,cite:b,actions:m,loaded:!a,speech:v,renderItem:x,scrollRef:L})}),a&&t(Ae,{...a,scrollRef:L})]})})})})),_),Ut=n.div`
|
|
752
752
|
display: flex;
|
|
753
753
|
flex-direction: column;
|
|
754
754
|
flex: 1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topthink/chat",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.32",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"prebuild": "rimraf es types",
|
|
6
6
|
"build": "rollup -c --environment NODE_ENV:production",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
},
|
|
68
68
|
"author": "yunwuxin <tzzhangyajun@qq.com> (https://github.com/yunwuxin)",
|
|
69
69
|
"license": "MIT",
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "a36b175671225f66b1f237b5ddc36ef8285e8eb6"
|
|
71
71
|
}
|
|
@@ -54,6 +54,7 @@ export interface MessageBoxProps {
|
|
|
54
54
|
Component: typeof MessageItem;
|
|
55
55
|
props: MessageItemProps;
|
|
56
56
|
}, index: number) => ReactNode;
|
|
57
|
+
transformMessages?: (messages: any[]) => Message[];
|
|
57
58
|
}
|
|
58
59
|
declare const MessageBox: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<MessageBoxProps & import("react").RefAttributes<MessageBoxType>>>;
|
|
59
60
|
export default MessageBox;
|