@lobehub/chat 0.63.0 → 0.63.1

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.63.1](https://github.com/lobehub/lobe-chat/compare/v0.63.0...v0.63.1)
6
+
7
+ <sup>Released on **2023-08-27**</sup>
8
+
9
+ #### ♻ Code Refactoring
10
+
11
+ - **misc**: Refactor the selectors import.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Code refactoring
19
+
20
+ - **misc**: Refactor the selectors import, closes [#120](https://github.com/lobehub/lobe-chat/issues/120) ([6646502](https://github.com/lobehub/lobe-chat/commit/6646502))
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.63.0](https://github.com/lobehub/lobe-chat/compare/v0.62.1...v0.63.0)
6
31
 
7
32
  <sup>Released on **2023-08-27**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.63.0",
3
+ "version": "0.63.1",
4
4
  "description": "Lobe Chat is an open-source chatbot client using LangChain, Typescript and Next.js",
5
5
  "keywords": [
6
6
  "chatbot",
@@ -1,5 +1,6 @@
1
1
  import { settingsSelectors, useGlobalStore } from '@/store/global';
2
- import { sessionSelectors, useSessionStore } from '@/store/session';
2
+ import { useSessionStore } from '@/store/session';
3
+ import { sessionSelectors } from '@/store/session/selectors';
3
4
  import { createConfigFile, exportConfigFile } from '@/utils/config';
4
5
 
5
6
  const getSessions = () => sessionSelectors.exportSessions(useSessionStore.getState());
@@ -6,7 +6,8 @@ import { memo, useMemo } from 'react';
6
6
  import { useTranslation } from 'react-i18next';
7
7
 
8
8
  import { exportSingleAgent, exportSingleSession } from '@/helpers/export';
9
- import { sessionSelectors, useSessionStore } from '@/store/session';
9
+ import { useSessionStore } from '@/store/session';
10
+ import { sessionSelectors } from '@/store/session/selectors';
10
11
 
11
12
  const useStyles = createStyles(({ css }) => ({
12
13
  modalRoot: css`
@@ -7,7 +7,8 @@ import { Flexbox } from 'react-layout-kit';
7
7
  import { shallow } from 'zustand/shallow';
8
8
 
9
9
  import { settingsSelectors, useGlobalStore } from '@/store/global';
10
- import { agentSelectors, sessionSelectors, useSessionStore } from '@/store/session';
10
+ import { useSessionStore } from '@/store/session';
11
+ import { agentSelectors, sessionSelectors } from '@/store/session/selectors';
11
12
 
12
13
  import Actions from './Actions';
13
14
 
@@ -2,7 +2,8 @@ import isEqual from 'fast-deep-equal';
2
2
  import Link from 'next/link';
3
3
  import { memo } from 'react';
4
4
 
5
- import { sessionSelectors, useSessionHydrated, useSessionStore } from '@/store/session';
5
+ import { useSessionHydrated, useSessionStore } from '@/store/session';
6
+ import { sessionSelectors } from '@/store/session/selectors';
6
7
 
7
8
  import AddButton from './AddButton';
8
9
  import SessionItem from './Item';
@@ -3,7 +3,8 @@ import Head from 'next/head';
3
3
  import { memo } from 'react';
4
4
  import { Flexbox } from 'react-layout-kit';
5
5
 
6
- import { agentSelectors, useSessionStore } from '@/store/session';
6
+ import { useSessionStore } from '@/store/session';
7
+ import { agentSelectors } from '@/store/session/selectors';
7
8
  import { genSiteHeadTitle } from '@/utils/genSiteHeadTitle';
8
9
 
9
10
  import Conversation from '../features/Conversation';
@@ -8,7 +8,8 @@ import { Flexbox } from 'react-layout-kit';
8
8
  import SafeSpacing from '@/components/SafeSpacing';
9
9
  import { HEADER_HEIGHT } from '@/const/layoutTokens';
10
10
  import { AgentConfig, AgentMeta, AgentPlugin, AgentPrompt } from '@/features/AgentSetting';
11
- import { agentSelectors, useSessionStore } from '@/store/session';
11
+ import { useSessionStore } from '@/store/session';
12
+ import { agentSelectors } from '@/store/session/selectors';
12
13
  import { genSiteHeadTitle } from '@/utils/genSiteHeadTitle';
13
14
 
14
15
  import ChatLayout from '../layout';
@@ -4,7 +4,8 @@ import { createStyles } from 'antd-style';
4
4
  import { ReactNode } from 'react';
5
5
  import { Flexbox } from 'react-layout-kit';
6
6
 
7
- import { agentSelectors, useSessionStore } from '@/store/session';
7
+ import { useSessionStore } from '@/store/session';
8
+ import { agentSelectors } from '@/store/session/selectors';
8
9
  import { ChatMessage } from '@/types/chatMessage';
9
10
 
10
11
  const useStyles = createStyles(({ css }) => ({
@@ -4,12 +4,8 @@ import { memo, useCallback } from 'react';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { Flexbox } from 'react-layout-kit';
6
6
 
7
- import {
8
- agentSelectors,
9
- chatSelectors,
10
- useSessionChatInit,
11
- useSessionStore,
12
- } from '@/store/session';
7
+ import { useSessionChatInit, useSessionStore } from '@/store/session';
8
+ import { agentSelectors, chatSelectors } from '@/store/session/selectors';
13
9
  import { ChatMessage } from '@/types/chatMessage';
14
10
  import { isFunctionMessage } from '@/utils/message';
15
11
 
@@ -5,7 +5,8 @@ import { memo } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import { Flexbox } from 'react-layout-kit';
7
7
 
8
- import { agentSelectors, useSessionStore } from '@/store/session';
8
+ import { useSessionStore } from '@/store/session';
9
+ import { agentSelectors } from '@/store/session/selectors';
9
10
  import { LanguageModel } from '@/types/llm';
10
11
 
11
12
  const InputActions = memo(() => {
@@ -4,7 +4,8 @@ import { memo, useMemo } from 'react';
4
4
  import { useTranslation } from 'react-i18next';
5
5
 
6
6
  import { ModelTokens } from '@/const/modelTokens';
7
- import { agentSelectors, chatSelectors, useSessionStore } from '@/store/session';
7
+ import { useSessionStore } from '@/store/session';
8
+ import { agentSelectors, chatSelectors } from '@/store/session/selectors';
8
9
 
9
10
  const Token = memo<{ input: string }>(({ input }) => {
10
11
  const { t } = useTranslation('common');
@@ -6,7 +6,8 @@ import { useTranslation } from 'react-i18next';
6
6
 
7
7
  import { INBOX_SESSION_ID } from '@/const/session';
8
8
  import { useGlobalStore } from '@/store/global';
9
- import { agentSelectors, useSessionStore } from '@/store/session';
9
+ import { useSessionStore } from '@/store/session';
10
+ import { agentSelectors } from '@/store/session/selectors';
10
11
 
11
12
  const MobileHeader = memo<{ settings?: boolean }>(({ settings = true }) => {
12
13
  const { t } = useTranslation('common');
@@ -9,7 +9,8 @@ import { Flexbox } from 'react-layout-kit';
9
9
 
10
10
  import { INBOX_SESSION_ID } from '@/const/session';
11
11
  import { useGlobalStore } from '@/store/global';
12
- import { agentSelectors, useSessionChatInit, useSessionStore } from '@/store/session';
12
+ import { useSessionChatInit, useSessionStore } from '@/store/session';
13
+ import { agentSelectors } from '@/store/session/selectors';
13
14
 
14
15
  import PluginTag from './PluginTag';
15
16
  import ShareButton from './ShareButton';
@@ -7,7 +7,8 @@ import { useTranslation } from 'react-i18next';
7
7
  import { Flexbox } from 'react-layout-kit';
8
8
 
9
9
  import Header from '@/pages/chat/features/Sidebar/Header';
10
- import { agentSelectors, useSessionChatInit, useSessionStore } from '@/store/session';
10
+ import { useSessionChatInit, useSessionStore } from '@/store/session';
11
+ import { agentSelectors } from '@/store/session/selectors';
11
12
 
12
13
  const useStyles = createStyles(({ css, token }) => ({
13
14
  prompt: css`
@@ -5,7 +5,8 @@ import { Flexbox } from 'react-layout-kit';
5
5
 
6
6
  import Empty from '@/components/Empty';
7
7
  import { useGlobalStore } from '@/store/global';
8
- import { topicSelectors, useSessionChatInit, useSessionStore } from '@/store/session';
8
+ import { useSessionChatInit, useSessionStore } from '@/store/session';
9
+ import { topicSelectors } from '@/store/session/selectors';
9
10
 
10
11
  import SkeletonList from './SkeletonList';
11
12
  import TopicItem from './TopicItem';
@@ -1,6 +1,7 @@
1
1
  import { memo } from 'react';
2
2
 
3
- import { sessionSelectors, useSessionHydrated, useSessionStore } from '@/store/session';
3
+ import { useSessionHydrated, useSessionStore } from '@/store/session';
4
+ import { sessionSelectors } from '@/store/session/selectors';
4
5
 
5
6
  import Chat from './chat/index.page';
6
7
  import Loading from './index/Loading';
@@ -1,4 +1,3 @@
1
1
  export * from './hooks';
2
- export * from './selectors';
3
2
  export type { SessionStore } from './store';
4
3
  export { useSessionStore } from './store';