const fs = require('fs') const base = 'C:/Users/ASUS/Documents/deepseek-harness/default-workspace/desktop-pet/src/renderer/src/' function patch(file, pairs) { const p = base + file let c = fs.readFileSync(p, 'utf8') for (const [from, to] of pairs) { if (!c.includes(from)) { console.log('MISS in', file, '::', from.slice(0, 70).replace(/\n/g, '\\n')) continue } c = c.replace(from, to) } fs.writeFileSync(p, c, 'utf8') } patch('editor/Editor.tsx', [ [ `import { CATEGORY_COLORS, ELEMENT_CATEGORY_LABEL, DEFAULT_PERIODIC_STYLE, elementName, MAX_LEVEL, type PeriodicStyle } from '../../../shared/elements'`, `import { CATEGORY_COLORS, ELEMENT_CATEGORY_LABEL, DEFAULT_PERIODIC_STYLE, ELEMENT_GRID_POS, ELEMENTS, elementName, MAX_LEVEL, periodicCellColor, PERIODIC_PRESETS, type PeriodicStyle } from '../../../shared/elements'` ], // 选中值计算 [ `