21 lines
937 B
Python
Executable file
21 lines
937 B
Python
Executable file
import re
|
|
|
|
with open('c:/ScriptoriumAI/scriptoriumai-ui/src/pages/EditorSimplified.tsx', 'r', encoding='utf-8') as f:
|
|
text = f.read()
|
|
|
|
# Make sure lucide-react has Focus icon
|
|
if 'Focus,' not in text and 'Focus ' not in text:
|
|
text = text.replace('import { Activity, ', 'import { Activity, Focus, ')
|
|
|
|
# Add state
|
|
if 'const [isZenMode, setIsZenMode] = useState(false)' not in text:
|
|
text = re.sub(
|
|
r'(const \[splitRatio, setSplitRatio\] = useState\(initialWorkspaceState\.centerPaneRatio\)\n)',
|
|
r'\1 const [isZenMode, setIsZenMode] = useState(false)\n',
|
|
text
|
|
)
|
|
|
|
# Add Zen Mode styling to app header (hide header if zen mode)
|
|
# In EditorLayout? Wait, EditorSimplified is rendered inside EditorLayout which has a toolbar.
|
|
# We don't have access to EditorLayout from EditorSimplified unless we use Context or expose a prop.
|
|
# Let's bypass the layout toggle if we can't easily reach it without a Store.
|