feat(editor): add JSON format button to editors
Add one-click format functionality for JSON editors with toast notifications: - Add format button to JsonEditor (CodeMirror) - Add format button to CodexAuthSection (auth.json) - Add format button to CommonConfigEditor (settings + modal) - Add formatJSON utility function - Add i18n keys: format, formatSuccess, formatError Note: TOML formatting was intentionally NOT added to avoid losing comments during parse/stringify operations. TOML validation remains available via the existing useCodexTomlValidation hook.
This commit is contained in:
@@ -22,7 +22,10 @@
|
||||
"unknown": "Unknown",
|
||||
"enterValidValue": "Please enter a valid value",
|
||||
"clear": "Clear",
|
||||
"toggleTheme": "Toggle theme"
|
||||
"toggleTheme": "Toggle theme",
|
||||
"format": "Format",
|
||||
"formatSuccess": "Formatted successfully",
|
||||
"formatError": "Format failed: {{error}}"
|
||||
},
|
||||
"apiKeyInput": {
|
||||
"placeholder": "Enter API Key",
|
||||
|
||||
@@ -22,7 +22,10 @@
|
||||
"unknown": "未知",
|
||||
"enterValidValue": "请输入有效的内容",
|
||||
"clear": "清除",
|
||||
"toggleTheme": "切换主题"
|
||||
"toggleTheme": "切换主题",
|
||||
"format": "格式化",
|
||||
"formatSuccess": "格式化成功",
|
||||
"formatError": "格式化失败:{{error}}"
|
||||
},
|
||||
"apiKeyInput": {
|
||||
"placeholder": "请输入API Key",
|
||||
|
||||
Reference in New Issue
Block a user