("edit");
+
+ const toolbarCommands: ICommand[] =
+ mode === "edit"
+ ? [
+ buildTabCommand("code", "Code", true, () => setMode("edit")),
+ buildTabCommand("preview", "Preview", false, () => setMode("preview")),
+ commands.divider,
+ ...FORMAT_COMMANDS,
+ ]
+ : [
+ buildTabCommand("code", "Code", false, () => setMode("edit")),
+ buildTabCommand("preview", "Preview", true, () => setMode("preview")),
+ ];
+
+ return (
+
+ onChange(val ?? "")}
+ preview={mode}
+ height={520}
+ minHeight={400}
+ maxHeight={900}
+ visibleDragbar={false}
+ textareaProps={{
+ placeholder: "输入 Markdown 格式的更新日志…",
+ }}
+ commands={toolbarCommands}
+ extraCommands={[]}
+ style={{
+ borderRadius: token.borderRadius,
+ fontFamily: token.fontFamily,
+ }}
+ />
+
+ );
+}
diff --git a/src/components/PublishModal.tsx b/src/components/PublishModal.tsx
index e1e6874..0b77465 100644
--- a/src/components/PublishModal.tsx
+++ b/src/components/PublishModal.tsx
@@ -25,6 +25,7 @@ import { Template } from "@/lib/utils/template";
import type { McVersionEntry } from "@/lib/utils/mcVersion";
import { computeVersionRanges } from "@/lib/utils/mcVersion";
import { getModrinthMcVersions, getCurseForgeMcVersions } from "@/services/meta";
+import { ChangelogEditor } from "./ChangelogEditor";
const { Text } = Typography;
@@ -384,21 +385,7 @@ export function PublishModal({
Changelog (Markdown)
- {/* TODO: Replace with @uiw/react-md-editor */}
-