feat: Support for Chat Flow & Agent Support for binding a single chat flow (#765)

Co-authored-by: Yu Yang <72337138+tomasyu985@users.noreply.github.com>
Co-authored-by: zengxiaohui <csu.zengxiaohui@gmail.com>
Co-authored-by: lijunwen.gigoo <lijunwen.gigoo@bytedance.com>
Co-authored-by: lvxinyu.1117 <lvxinyu.1117@bytedance.com>
Co-authored-by: liuyunchao.0510 <liuyunchao.0510@bytedance.com>
Co-authored-by: haozhenfei <37089575+haozhenfei@users.noreply.github.com>
Co-authored-by: July <jiangxujin@bytedance.com>
Co-authored-by: tecvan-fe <fanwenjie.fe@bytedance.com>
This commit is contained in:
Zhj
2025-08-28 21:53:32 +08:00
committed by GitHub
parent bbc615a18e
commit d70101c979
503 changed files with 48036 additions and 3427 deletions

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { type PropsWithChildren } from 'react';
import { forwardRef, type PropsWithChildren } from 'react';
import classNames from 'classnames';
@@ -25,14 +25,16 @@ interface ActionBarHoverContainerProps {
style?: React.CSSProperties;
}
export const ActionBarHoverContainer: React.FC<
export const ActionBarHoverContainer = forwardRef<
HTMLDivElement,
PropsWithChildren<ActionBarHoverContainerProps>
> = ({ children, style }) => (
>(({ children, style }, ref) => (
<div
data-testid="chat-area.answer-action.hover-action-bar"
className={classNames(s.container, ['coz-stroke-primary', 'coz-bg-max'])}
style={style}
ref={ref}
>
{children}
</div>
);
));

View File

@@ -34,15 +34,27 @@ import { useTooltipTrigger } from '../../hooks/use-tooltip-trigger';
type CopyTextMessageProps = Omit<
ComponentProps<typeof IconButton>,
'icon' | 'iconSize' | 'onClick'
>;
> & {
isMustGroupLastAnswerMessage?: boolean;
isUseExternalContent?: boolean;
externalContent?: string;
};
export const CopyTextMessage: React.FC<
PropsWithChildren<CopyTextMessageProps>
> = ({ className, ...props }) => {
> = ({
className,
isMustGroupLastAnswerMessage = true,
isUseExternalContent = false,
externalContent,
...props
}) => {
const { reporter } = useChatArea();
const { message, meta } = useMessageBoxContext();
const { content } = message;
const content = isUseExternalContent
? externalContent || ''
: message.content;
const [isCopySuccessful, setIsCopySuccessful] = useState<boolean>(false);
const trigger = useTooltipTrigger('hover');
@@ -87,7 +99,7 @@ export const CopyTextMessage: React.FC<
return null;
}
if (!meta.isGroupLastAnswerMessage) {
if (!meta.isGroupLastAnswerMessage && isMustGroupLastAnswerMessage) {
return null;
}

View File

@@ -0,0 +1,13 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "./tsconfig.build.json",
"compilerOptions": {
"noEmit": true,
"declaration": false,
"declarationMap": false,
"sourceMap": false,
"outDir": null,
"tsBuildInfoFile": null
},
"exclude": ["dist", "node_modules", "__tests__"]
}

View File

@@ -9,6 +9,9 @@
},
{
"path": "./tsconfig.misc.json"
},
{
"path": "./tsconfig.dev.json"
}
],
"exclude": ["**/*"]