@lobehub/chat 0.96.6 → 0.96.8

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.
@@ -26,6 +26,7 @@ jobs:
26
26
  GITHUB_TOKEN: ${{ secrets.GH_TOKEN}}
27
27
  issuesOpened: |
28
28
  👀 @{{ author }}
29
+
29
30
  Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
30
31
  Please make sure you have given us as much context as possible.\
31
32
  非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。
@@ -35,7 +36,7 @@ jobs:
35
36
  GITHUB_TOKEN: ${{ secrets.GH_TOKEN}}
36
37
  issuesClosed: |
37
38
  ✅ @{{ author }}
38
- <br/>
39
+
39
40
  This issue is closed, If you have any questions, you can comment and reply.\
40
41
  此问题已经关闭。如果您有任何问题,可以留言并回复。
41
42
  - name: Auto Comment on Pull Request Opened
@@ -44,7 +45,7 @@ jobs:
44
45
  GITHUB_TOKEN: ${{ secrets.GH_TOKEN}}
45
46
  pullRequestOpened: |
46
47
  👍 @{{ author }}
47
- <br>
48
+
48
49
  Thank you for raising your pull request and contributing to our Community
49
50
  Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
50
51
  If you encounter any problems, please feel free to connect with us.\
@@ -57,7 +58,7 @@ jobs:
57
58
  token: ${{ secrets.GH_TOKEN }}
58
59
  comment: |
59
60
  ❤️ Great PR @${{ github.event.pull_request.user.login }} ❤️
60
- <br>
61
+
61
62
  The growth of project is inseparable from user feedback and contribution, thanks for your contribution!\
62
63
  项目的成长离不开用户反馈和贡献,感谢您的贡献!
63
64
  emoji: 'hooray'
package/CHANGELOG.md CHANGED
@@ -2,6 +2,57 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.96.8](https://github.com/lobehub/lobe-chat/compare/v0.96.7...v0.96.8)
6
+
7
+ <sup>Released on **2023-10-31**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix a bug that weather plugin is not work correctly, template remove sharp deps.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix a bug that weather plugin is not work correctly ([dbb65ff](https://github.com/lobehub/lobe-chat/commit/dbb65ff))
21
+ - **misc**: Template remove sharp deps ([380723d](https://github.com/lobehub/lobe-chat/commit/380723d))
22
+
23
+ </details>
24
+
25
+ <div align="right">
26
+
27
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
28
+
29
+ </div>
30
+
31
+ ### [Version 0.96.7](https://github.com/lobehub/lobe-chat/compare/v0.96.6...v0.96.7)
32
+
33
+ <sup>Released on **2023-10-31**</sup>
34
+
35
+ #### 🐛 Bug Fixes
36
+
37
+ - **misc**: Fix a bug when click inbox not switch back to chat page.
38
+
39
+ <br/>
40
+
41
+ <details>
42
+ <summary><kbd>Improvements and Fixes</kbd></summary>
43
+
44
+ #### What's fixed
45
+
46
+ - **misc**: Fix a bug when click inbox not switch back to chat page ([31f6d29](https://github.com/lobehub/lobe-chat/commit/31f6d29))
47
+
48
+ </details>
49
+
50
+ <div align="right">
51
+
52
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
53
+
54
+ </div>
55
+
5
56
  ### [Version 0.96.6](https://github.com/lobehub/lobe-chat/compare/v0.96.5...v0.96.6)
6
57
 
7
58
  <sup>Released on **2023-10-30**</sup>
@@ -0,0 +1,128 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ ## Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or
31
+ advances of any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ .
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series
86
+ of actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or
93
+ permanent ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within
113
+ the community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.0, available at
119
+ https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120
+
121
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct
122
+ enforcement ladder](https://github.com/mozilla/diversity).
123
+
124
+ [homepage]: https://www.contributor-covenant.org
125
+
126
+ For answers to common questions about this code of conduct, see the FAQ at
127
+ https://www.contributor-covenant.org/faq. Translations are available at
128
+ https://www.contributor-covenant.org/translations.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.96.6",
3
+ "version": "0.96.8",
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",
@@ -154,7 +154,6 @@
154
154
  "prettier": "^3",
155
155
  "remark-cli": "^11",
156
156
  "semantic-release": "^21",
157
- "sharp": "^0.32.6",
158
157
  "stylelint": "^15",
159
158
  "ts-node": "^10",
160
159
  "typescript": "^5",
@@ -3,7 +3,8 @@ import { Skeleton } from 'antd';
3
3
  import { memo, useRef, useState } from 'react';
4
4
 
5
5
  import { useOnPluginReadyForInteraction } from '../../utils/iframeOnReady';
6
- import { sendMessageToPlugin } from '../../utils/postMessage';
6
+ import { useOnPluginFetchMessage } from '../../utils/listenToPlugin';
7
+ import { sendMessageContentToPlugin } from '../../utils/postMessage';
7
8
 
8
9
  interface IFrameRenderProps extends PluginRenderProps {
9
10
  height?: number;
@@ -20,7 +21,15 @@ const IFrameRender = memo<IFrameRenderProps>(({ url, width = 800, height = 300,
20
21
  const iframeWin = iframeRef.current?.contentWindow;
21
22
 
22
23
  if (iframeWin) {
23
- sendMessageToPlugin(iframeWin, props);
24
+ sendMessageContentToPlugin(iframeWin, props);
25
+ }
26
+ }, [props]);
27
+
28
+ // when get iframe fetch message ,send message content
29
+ useOnPluginFetchMessage(() => {
30
+ const iframeWin = iframeRef.current?.contentWindow;
31
+ if (iframeWin) {
32
+ sendMessageContentToPlugin(iframeWin, props);
24
33
  }
25
34
  }, [props]);
26
35
 
@@ -16,7 +16,7 @@ import {
16
16
  useOnPluginFillContent,
17
17
  } from '../utils/listenToPlugin';
18
18
  import {
19
- sendMessageToPlugin,
19
+ sendMessageContentToPlugin,
20
20
  sendPayloadToPlugin,
21
21
  sendPluginSettingsToPlugin,
22
22
  sendPluginStateToPlugin,
@@ -58,7 +58,7 @@ const IFrameRender = memo<IFrameRenderProps>(({ url, id, payload, width = 600, h
58
58
  props.content = message.content || '';
59
59
  }
60
60
 
61
- sendMessageToPlugin(iframeWin, props);
61
+ sendMessageContentToPlugin(iframeWin, props);
62
62
  }
63
63
  }, []);
64
64
 
@@ -1,6 +1,6 @@
1
1
  import { PluginChannel } from '@lobehub/chat-plugin-sdk/client';
2
2
 
3
- export const sendMessageToPlugin = (window: Window, props: any) => {
3
+ export const sendMessageContentToPlugin = (window: Window, props: any) => {
4
4
  window.postMessage({ props, type: PluginChannel.renderPlugin }, '*');
5
5
  };
6
6
 
@@ -13,11 +13,7 @@ import ListItem from '../ListItem';
13
13
  const Inbox = memo(() => {
14
14
  const { t } = useTranslation('chat');
15
15
  const { mobile } = useResponsive();
16
- const [activeId, activeSession, switchSession] = useSessionStore((s) => [
17
- s.activeId,
18
- s.activeSession,
19
- s.switchSession,
20
- ]);
16
+ const [activeId, switchSession] = useSessionStore((s) => [s.activeId, s.switchSession]);
21
17
 
22
18
  return (
23
19
  <Link
@@ -25,8 +21,7 @@ const Inbox = memo(() => {
25
21
  href={SESSION_CHAT_URL(INBOX_SESSION_ID, mobile)}
26
22
  onClick={(e) => {
27
23
  e.preventDefault();
28
- if (mobile) switchSession(INBOX_SESSION_ID);
29
- else activeSession(INBOX_SESSION_ID);
24
+ switchSession(INBOX_SESSION_ID);
30
25
  }}
31
26
  >
32
27
  <ListItem
@@ -163,9 +163,6 @@ export const createSessionSlice: StateCreator<
163
163
  },
164
164
  switchSession: (sessionId = INBOX_SESSION_ID) => {
165
165
  const { isMobile, router } = get();
166
- // mobile also should switch session due to chat mobile route is different
167
- // fix https://github.com/lobehub/lobe-chat/issues/163
168
- if (!isMobile && get().activeId === sessionId) return;
169
166
 
170
167
  get().activeSession(sessionId);
171
168