mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00
fix welcome text rerender & add copyright (#2525)
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
import { useState, useRef, useTransition, useEffect, useMemo } from 'react';
|
import { useState, useRef, useTransition, useEffect, useMemo } from 'react';
|
||||||
import { LexicalComposer } from '@lexical/react/LexicalComposer';
|
import { LexicalComposer } from '@lexical/react/LexicalComposer';
|
||||||
import { PlainTextPlugin } from '@lexical/react/LexicalPlainTextPlugin';
|
import { PlainTextPlugin } from '@lexical/react/LexicalPlainTextPlugin';
|
||||||
|
@@ -1,3 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
import { useState, useRef, useTransition } from 'react';
|
import { useState, useRef, useTransition } from 'react';
|
||||||
import { LexicalComposer } from '@lexical/react/LexicalComposer';
|
import { LexicalComposer } from '@lexical/react/LexicalComposer';
|
||||||
import { PlainTextPlugin } from '@lexical/react/LexicalPlainTextPlugin';
|
import { PlainTextPlugin } from '@lexical/react/LexicalPlainTextPlugin';
|
||||||
|
@@ -1,3 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
import type { DecoratorNode, Klass, LexicalEditor, LexicalNode } from 'lexical';
|
import type { DecoratorNode, Klass, LexicalEditor, LexicalNode } from 'lexical';
|
||||||
import type { EntityMatch } from '@lexical/text';
|
import type { EntityMatch } from '@lexical/text';
|
||||||
import { $createTextNode, $getRoot, $isTextNode, TextNode } from 'lexical';
|
import { $createTextNode, $getRoot, $isTextNode, TextNode } from 'lexical';
|
||||||
|
@@ -89,22 +89,19 @@ const NodeUserGuide = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
|
|||||||
export default React.memo(NodeUserGuide);
|
export default React.memo(NodeUserGuide);
|
||||||
|
|
||||||
function WelcomeText({ chatConfig: { welcomeText }, setAppDetail }: ComponentProps) {
|
function WelcomeText({ chatConfig: { welcomeText }, setAppDetail }: ComponentProps) {
|
||||||
const [, startTst] = useTransition();
|
|
||||||
return (
|
return (
|
||||||
<Box className="nodrag">
|
<Box className="nodrag">
|
||||||
<WelcomeTextConfig
|
<WelcomeTextConfig
|
||||||
resize={'both'}
|
resize={'both'}
|
||||||
value={welcomeText}
|
value={welcomeText}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
startTst(() => {
|
setAppDetail((state) => ({
|
||||||
setAppDetail((state) => ({
|
...state,
|
||||||
...state,
|
chatConfig: {
|
||||||
chatConfig: {
|
...state.chatConfig,
|
||||||
...state.chatConfig,
|
welcomeText: e.target.value
|
||||||
welcomeText: e.target.value
|
}
|
||||||
}
|
}));
|
||||||
}));
|
|
||||||
});
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
|
Reference in New Issue
Block a user