listpage-next 0.0.275 → 0.0.277
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/dist/features/ChatClient/ui/ChatInput/index.js +10 -1
- package/dist/features/ChatClient/ui/Markdown/components/CodeComponent.js +12 -4
- package/dist/features/ChatClient/ui/Markdown/styles/CodeComponent.styles.d.ts +1 -0
- package/dist/features/ChatClient/ui/Markdown/styles/CodeComponent.styles.js +10 -1
- package/package.json +1 -1
|
@@ -18,6 +18,15 @@ const ChatInput = (props)=>{
|
|
|
18
18
|
setInputValue('');
|
|
19
19
|
ref.current?.commands.clearContent();
|
|
20
20
|
};
|
|
21
|
+
const handleEditorKeyDown = (_view, e)=>{
|
|
22
|
+
if (interceptKeyDown(e)) return true;
|
|
23
|
+
if ('Enter' === e.key && !e.shiftKey) {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
if (!loading && inputValue) handleClickSend();
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
return false;
|
|
29
|
+
};
|
|
21
30
|
const handleKeyDown = (e)=>{
|
|
22
31
|
if (interceptKeyDown(e)) return;
|
|
23
32
|
if ('Enter' === e.key && !e.shiftKey) {
|
|
@@ -37,7 +46,7 @@ const ChatInput = (props)=>{
|
|
|
37
46
|
placeholder: placeholder,
|
|
38
47
|
editorRef: ref,
|
|
39
48
|
onChange: (content)=>setInputValue(content),
|
|
40
|
-
|
|
49
|
+
handleKeyDown: handleEditorKeyDown
|
|
41
50
|
})
|
|
42
51
|
}),
|
|
43
52
|
/*#__PURE__*/ jsxs(ChatInputBottom, {
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Container, ContentArea, Dot, DotsContainer, Header, Pre, SnippetLabel, SnippetLabelContainer } from "../styles/CodeComponent.styles.js";
|
|
3
|
-
const Code = (props)
|
|
2
|
+
import { Container, ContentArea, Dot, DotsContainer, Header, InlineCode, Pre, SnippetLabel, SnippetLabelContainer } from "../styles/CodeComponent.styles.js";
|
|
3
|
+
const Code = (props)=>{
|
|
4
|
+
const { block, className, children, ...rest } = props;
|
|
5
|
+
if (!block) return /*#__PURE__*/ jsx(InlineCode, {
|
|
6
|
+
className: className,
|
|
7
|
+
...rest,
|
|
8
|
+
children: children
|
|
9
|
+
});
|
|
10
|
+
return /*#__PURE__*/ jsxs(Container, {
|
|
4
11
|
children: [
|
|
5
12
|
/*#__PURE__*/ jsxs(Header, {
|
|
6
13
|
children: [
|
|
@@ -23,16 +30,17 @@ const Code = (props)=>/*#__PURE__*/ jsxs(Container, {
|
|
|
23
30
|
/*#__PURE__*/ jsx(SnippetLabelContainer, {
|
|
24
31
|
className: "snippet-label",
|
|
25
32
|
children: /*#__PURE__*/ jsx(SnippetLabel, {
|
|
26
|
-
children: "
|
|
33
|
+
children: "代码"
|
|
27
34
|
})
|
|
28
35
|
})
|
|
29
36
|
]
|
|
30
37
|
}),
|
|
31
38
|
/*#__PURE__*/ jsx(ContentArea, {
|
|
32
39
|
children: /*#__PURE__*/ jsx(Pre, {
|
|
33
|
-
children:
|
|
40
|
+
children: children
|
|
34
41
|
})
|
|
35
42
|
})
|
|
36
43
|
]
|
|
37
44
|
});
|
|
45
|
+
};
|
|
38
46
|
export { Code };
|
|
@@ -9,3 +9,4 @@ export declare const SnippetLabelContainer: import("styled-components/dist/types
|
|
|
9
9
|
export declare const SnippetLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
10
10
|
export declare const ContentArea: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
11
11
|
export declare const Pre: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLPreElement>, HTMLPreElement>, never>> & string;
|
|
12
|
+
export declare const InlineCode: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
|
|
@@ -74,4 +74,13 @@ const Pre = styled_components.pre`
|
|
|
74
74
|
font-weight: 500;
|
|
75
75
|
margin: 0;
|
|
76
76
|
`;
|
|
77
|
-
|
|
77
|
+
const InlineCode = styled_components.code`
|
|
78
|
+
padding: 0.2em 0.4em;
|
|
79
|
+
margin: 0;
|
|
80
|
+
font-size: 85%;
|
|
81
|
+
background-color: rgba(175, 184, 193, 0.2);
|
|
82
|
+
border-radius: 6px;
|
|
83
|
+
font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
|
|
84
|
+
color: #24292f;
|
|
85
|
+
`;
|
|
86
|
+
export { Container, ContentArea, Dot, DotsContainer, Header, InlineCode, Pre, SnippetLabel, SnippetLabelContainer };
|