feat(frontend): add posting compose component suite
新增了发帖相关的完整组件模块:包括顶部导航栏ComposeHeader、正文编辑区ComposeDocument,以及发布设置栏ComposeContextBar,同时添加了vite依赖缓存配置文件。
This commit is contained in:
@@ -774,14 +774,36 @@ const ArticleEditor = forwardRef<ArticleEditorHandle, Props>(function ArticleEdi
|
||||
<div className="article-editor-body">
|
||||
{mode === 'rich' ? (
|
||||
<div className="article-editor-pane article-editor-pane--rich">
|
||||
<div className="article-editor-scroll">
|
||||
<div
|
||||
className="article-editor-scroll"
|
||||
onPointerDown={e => {
|
||||
// 点击编辑器外空白区域时,聚焦并将光标置于文末
|
||||
if (editor && (e.target === e.currentTarget || (e.target as HTMLElement).classList.contains('article-editor-content'))) {
|
||||
e.preventDefault();
|
||||
editor.chain().focus('end').run();
|
||||
}
|
||||
}}
|
||||
>
|
||||
<EditorContent editor={editor} className="article-editor-content" />
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div className="article-editor-markdown">
|
||||
<div className="article-editor-pane article-editor-pane--source">
|
||||
<div className="article-editor-scroll">
|
||||
<div
|
||||
className="article-editor-scroll"
|
||||
onPointerDown={e => {
|
||||
if (e.target === e.currentTarget) {
|
||||
e.preventDefault();
|
||||
const ta = markdownRef.current;
|
||||
if (ta) {
|
||||
ta.focus();
|
||||
const len = ta.value.length;
|
||||
ta.setSelectionRange(len, len);
|
||||
}
|
||||
}
|
||||
}}
|
||||
>
|
||||
<textarea
|
||||
ref={markdownRef}
|
||||
className="article-editor-markdown-input"
|
||||
|
||||
Reference in New Issue
Block a user