feat: migrate from react-monaco-editor to @monaco-editor/react and update editor components (#5263)

* feat: migrate from react-monaco-editor to @monaco-editor/react and update editor components

* chore: add acknowledgments for contributors in update log

* feat: enhance frontend information editing component for improved performance
This commit is contained in:
Tunglies
2025-11-08 19:32:26 +08:00
committed by GitHub
parent 9d874e5c6f
commit c1a2e99f63
8 changed files with 69 additions and 48 deletions
+3 -3
View File
@@ -1,3 +1,4 @@
import MonacoEditor from "@monaco-editor/react";
import { RestartAltRounded } from "@mui/icons-material";
import {
Box,
@@ -25,7 +26,6 @@ import {
useState,
} from "react";
import { useTranslation } from "react-i18next";
import MonacoEditor from "react-monaco-editor";
import { BaseDialog, DialogRef, Switch } from "@/components/base";
import { useClash } from "@/hooks/use-clash";
@@ -568,12 +568,12 @@ export function DnsViewer({ ref }: { ref?: Ref<DialogRef> }) {
});
// YAML编辑器内容变更处理
const handleYamlChange = (value: string) => {
const handleYamlChange = (value?: string) => {
setYamlContent(value || "");
// 允许YAML编辑后立即分析和更新表单值
try {
const config = yaml.load(value) as any;
const config = yaml.load(value || "") as any;
if (config && typeof config === "object") {
setTimeout(() => {
updateValuesFromConfig(config);