@lobehub/chat 0.90.2 → 0.90.3

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/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.90.3](https://github.com/lobehub/lobe-chat/compare/v0.90.2...v0.90.3)
6
+
7
+ <sup>Released on **2023-10-17**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix ActionBar props and regenerate btn with error message.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix ActionBar props and regenerate btn with error message, closes [#337](https://github.com/lobehub/lobe-chat/issues/337) ([246e8fd](https://github.com/lobehub/lobe-chat/commit/246e8fd))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ### [Version 0.90.2](https://github.com/lobehub/lobe-chat/compare/v0.90.1...v0.90.2)
6
31
 
7
32
  <sup>Released on **2023-10-17**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.90.2",
3
+ "version": "0.90.3",
4
4
  "description": "An open-source, extensible (Function Calling), high-performance chatbot framework. It supports one-click free deployment of your private ChatGPT/LLM web application",
5
5
  "keywords": [
6
6
  "chatbot",
@@ -13,12 +13,11 @@ import { Flexbox } from 'react-layout-kit';
13
13
 
14
14
  import { useSessionStore } from '@/store/session';
15
15
  import { agentSelectors } from '@/store/session/slices/agentConfig';
16
- import { currentFunctionCallProps } from '@/store/session/slices/chat/selectors/chat';
16
+ import { chatSelectors } from '@/store/session/slices/chat/selectors';
17
17
  import { isFunctionMessage } from '@/utils/message';
18
18
 
19
19
  import FunctionCall from '../Plugins/FunctionCall';
20
20
  import { DefautMessage } from './Default';
21
- import { SystemActionsBar } from './System';
22
21
 
23
22
  const useStyles = createStyles(({ css }) => ({
24
23
  container: css`
@@ -34,7 +33,7 @@ const useStyles = createStyles(({ css }) => ({
34
33
 
35
34
  export const AssistantMessage: RenderMessage = memo(
36
35
  ({ id, plugin, function_call, content, ...props }) => {
37
- const genFunctionCallProps = useSessionStore(currentFunctionCallProps);
36
+ const genFunctionCallProps = useSessionStore(chatSelectors.currentFunctionCallProps);
38
37
 
39
38
  if (!isFunctionMessage(content)) return <DefautMessage content={content} id={id} {...props} />;
40
39
 
@@ -65,16 +64,15 @@ export const AssistantMessageExtra: RenderMessageExtra = memo(({ extra, function
65
64
  );
66
65
  });
67
66
 
68
- export const AssistantActionsBar: RenderAction = memo(({ text, error, id, ...props }) => {
67
+ export const AssistantActionsBar: RenderAction = memo(({ text, error, id, onActionClick }) => {
69
68
  const { regenerate, edit, copy, divider, del } = useChatListActionsBar(text);
70
69
  if (id === 'default') return;
71
- if (error) return <SystemActionsBar id={id} text={text} {...props} />;
72
70
  return (
73
71
  <ActionIconGroup
74
- dropdownMenu={[edit, copy, regenerate, divider, del]}
75
- items={[regenerate, copy]}
72
+ dropdownMenu={error ? [regenerate, divider, del] : [edit, copy, regenerate, divider, del]}
73
+ items={[regenerate]}
74
+ onActionClick={onActionClick}
76
75
  type="ghost"
77
- {...props}
78
76
  />
79
77
  );
80
78
  });
@@ -3,14 +3,14 @@ import { memo } from 'react';
3
3
  import { Flexbox } from 'react-layout-kit';
4
4
 
5
5
  import { useSessionStore } from '@/store/session';
6
- import { currentFunctionCallProps } from '@/store/session/slices/chat/selectors/chat';
6
+ import { chatSelectors } from '@/store/session/selectors';
7
7
 
8
8
  import FunctionCall from '../Plugins/FunctionCall';
9
9
  import PluginMessage from '../Plugins/PluginMessage';
10
10
 
11
11
  export const FunctionMessage: RenderMessage = memo(
12
12
  ({ id, content, plugin, function_call, ...props }) => {
13
- const genFunctionCallProps = useSessionStore(currentFunctionCallProps);
13
+ const genFunctionCallProps = useSessionStore(chatSelectors.currentFunctionCallProps);
14
14
  const fcProps = genFunctionCallProps({ content, function_call, id, plugin });
15
15
 
16
16
  return (
@@ -29,14 +29,14 @@ export const FunctionMessage: RenderMessage = memo(
29
29
  },
30
30
  );
31
31
 
32
- export const FunctionActionsBar: RenderAction = memo(({ text, ...props }) => {
32
+ export const FunctionActionsBar: RenderAction = memo(({ text, onActionClick }) => {
33
33
  const { regenerate, divider, del } = useChatListActionsBar(text);
34
34
  return (
35
35
  <ActionIconGroup
36
36
  dropdownMenu={[regenerate, divider, del]}
37
37
  items={[regenerate]}
38
+ onActionClick={onActionClick}
38
39
  type="ghost"
39
- {...props}
40
40
  />
41
41
  );
42
42
  });
@@ -1,7 +1,9 @@
1
1
  import { ActionIconGroup, RenderAction, useChatListActionsBar } from '@lobehub/ui';
2
2
  import { memo } from 'react';
3
3
 
4
- export const SystemActionsBar: RenderAction = memo(({ text, ...props }) => {
4
+ export const SystemActionsBar: RenderAction = memo(({ text, onActionClick }) => {
5
5
  const { del } = useChatListActionsBar(text);
6
- return <ActionIconGroup dropdownMenu={[del]} items={[]} type="ghost" {...props} />;
6
+ return (
7
+ <ActionIconGroup dropdownMenu={[del]} items={[]} onActionClick={onActionClick} type="ghost" />
8
+ );
7
9
  });
@@ -1,14 +1,14 @@
1
1
  import { ActionIconGroup, RenderAction, useChatListActionsBar } from '@lobehub/ui';
2
2
  import { memo } from 'react';
3
3
 
4
- export const UserActionsBar: RenderAction = memo(({ text, ...props }) => {
4
+ export const UserActionsBar: RenderAction = memo(({ text, onActionClick }) => {
5
5
  const { regenerate, edit, copy, divider, del } = useChatListActionsBar(text);
6
6
  return (
7
7
  <ActionIconGroup
8
8
  dropdownMenu={[edit, copy, regenerate, divider, del]}
9
9
  items={[regenerate, edit]}
10
+ onActionClick={onActionClick}
10
11
  type="ghost"
11
- {...props}
12
12
  />
13
13
  );
14
14
  });
@@ -3,6 +3,7 @@ import {
3
3
  currentChats,
4
4
  currentChatsWithGuideMessage,
5
5
  currentChatsWithHistoryConfig,
6
+ currentFunctionCallProps,
6
7
  getChatsById,
7
8
  } from './chat';
8
9
  import { currentTopics, getTopicMessages } from './topic';
@@ -12,6 +13,7 @@ export const chatSelectors = {
12
13
  currentChats,
13
14
  currentChatsWithGuideMessage,
14
15
  currentChatsWithHistoryConfig,
16
+ currentFunctionCallProps,
15
17
  getChatsById,
16
18
  };
17
19