@lobehub/chat 0.79.6 → 0.79.7

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.79.7](https://github.com/lobehub/lobe-chat/compare/v0.79.6...v0.79.7)
6
+
7
+ <sup>Released on **2023-09-27**</sup>
8
+
9
+ #### ♻ Code Refactoring
10
+
11
+ - **misc**: Use hook to check PWA env.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Code refactoring
19
+
20
+ - **misc**: Use hook to check PWA env ([b4234db](https://github.com/lobehub/lobe-chat/commit/b4234db))
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.79.6](https://github.com/lobehub/lobe-chat/compare/v0.79.5...v0.79.6)
6
31
 
7
32
  <sup>Released on **2023-09-27**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.79.6",
3
+ "version": "0.79.7",
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",
@@ -68,8 +68,8 @@
68
68
  "@emoji-mart/data": "^1",
69
69
  "@emoji-mart/react": "^1",
70
70
  "@icons-pack/react-simple-icons": "^9",
71
- "@lobehub/chat-plugin-sdk": "^1.17.7",
72
- "@lobehub/chat-plugins-gateway": "^1.5.3",
71
+ "@lobehub/chat-plugin-sdk": "latest",
72
+ "@lobehub/chat-plugins-gateway": "latest",
73
73
  "@lobehub/ui": "latest",
74
74
  "@vercel/analytics": "^1",
75
75
  "ahooks": "^3",
@@ -88,16 +88,16 @@
88
88
  "lucide-react": "latest",
89
89
  "nanoid": "^5",
90
90
  "next": "^13.5.3",
91
- "openai": "^4.10.0",
91
+ "openai": "^4",
92
92
  "polished": "^4",
93
93
  "react": "^18",
94
94
  "react-dom": "^18",
95
95
  "react-hotkeys-hook": "^4",
96
96
  "react-i18next": "^13",
97
97
  "react-intersection-observer": "^9",
98
- "react-layout-kit": "^1.7.4",
98
+ "react-layout-kit": "^1",
99
99
  "swr": "^2",
100
- "systemjs": "^6.14.2",
100
+ "systemjs": "^6",
101
101
  "ts-md5": "^1",
102
102
  "url-join": "^5",
103
103
  "use-merge-value": "^1",
@@ -118,7 +118,7 @@
118
118
  "@types/node": "^20",
119
119
  "@types/react": "^18",
120
120
  "@types/react-dom": "^18",
121
- "@types/systemjs": "^6.13.3",
121
+ "@types/systemjs": "^6",
122
122
  "@types/uuid": "^9",
123
123
  "@umijs/lint": "^4",
124
124
  "@vitest/coverage-v8": "latest",
@@ -19,7 +19,7 @@ const RootLayout = ({ children }: PropsWithChildren) => {
19
19
  const primaryColor = cookieStore.get(LOBE_THEME_PRIMARY_COLOR);
20
20
 
21
21
  return (
22
- <html lang="en">
22
+ <html lang="en-US">
23
23
  <body>
24
24
  <StyleRegistry>
25
25
  <Layout
@@ -47,7 +47,7 @@ const metadata: Metadata = {
47
47
  width: 960,
48
48
  },
49
49
  ],
50
- locale: 'en_US',
50
+ locale: 'en-US',
51
51
  siteName: title,
52
52
  title: title,
53
53
  type: 'website',
@@ -0,0 +1,15 @@
1
+ import { useEffect, useState } from 'react';
2
+
3
+ export const useIsPWA = () => {
4
+ const [isPWA, setIsPWA] = useState(false);
5
+
6
+ useEffect(() => {
7
+ const isInStandaloneMode = () =>
8
+ 'standalone' in window.navigator && window.navigator['standalone'];
9
+ if (isInStandaloneMode()) {
10
+ setIsPWA(true);
11
+ }
12
+ }, []);
13
+
14
+ return isPWA;
15
+ };
@@ -3,15 +3,15 @@ import { PropsWithChildren, memo } from 'react';
3
3
  import { Flexbox } from 'react-layout-kit';
4
4
 
5
5
  import SideBar from '@/features/SideBar';
6
-
7
- const isPwa = window.matchMedia('(display-mode: standalone)').matches;
6
+ import { useIsPWA } from '@/hooks/useIsPWA';
8
7
 
9
8
  const AppLayout = memo<PropsWithChildren>(({ children }) => {
9
+ const isPWA = useIsPWA();
10
10
  const theme = useTheme();
11
11
  return (
12
12
  <Flexbox
13
13
  horizontal
14
- style={isPwa ? { borderTop: `1px solid ${theme.colorBorder}` } : {}}
14
+ style={isPWA ? { borderTop: `1px solid ${theme.colorBorder}` } : {}}
15
15
  width={'100%'}
16
16
  >
17
17
  <SideBar />