openpetswithchatandmcp/website/update_editor_layout2.py
OpenPets Dev 65ac83849e Add 'website/' from commit '966aea480ffe1c340553aa878def30131d2af827'
git-subtree-dir: website
git-subtree-mainline: 8d3849caea
git-subtree-split: 966aea480f
2026-06-17 20:48:39 +00:00

13 lines
672 B
Python
Executable file

import re
with open('c:/ScriptoriumAI/scriptoriumai-ui/src/layouts/EditorLayout.tsx', 'r', encoding='utf-8') as f:
text = f.read()
# Check if backdrop already exists
if 'bg-black/50' not in text:
text = text.replace('<aside', '{isMobileMenuOpen && <div className="fixed inset-0 bg-black/50 z-40 md:hidden" onClick={() => setIsMobileMenuOpen(false)} />}\n <aside')
# Change absolute position wrapper
text = text.replace('className={col-span-12 md:col-span-2 overflow-hidden }', 'className={md:col-span-2 overflow-hidden }')
with open('c:/ScriptoriumAI/scriptoriumai-ui/src/layouts/EditorLayout.tsx', 'w', encoding='utf-8') as f:
f.write(text)