Code editor: CodeMirror 6 replaces Monaco
Node source (Python) and the JSON dialog share one CodeMirror editor with find and replace, autocomplete, folding, indent guides, comment toggle and a JSON lint, themed from the CSS tokens so light and dark follow the .dark class without a second palette. Programmatic value changes no longer fire onChange, blur ignores focus moving into the find bar, readOnly keeps selection and copy. The editor chunk is 470 kB (157 kB gzipped) against 2.7 MB (704 kB) for Monaco, which also pulled in a 1.2 MB JSON mode, two workers and a font. At 4x CPU on slow 4G a node panel is ready in 5.7 s instead of 10.8 s, the JSON dialog in 1.5 s instead of 6.7 s. Typing without a key delay keeps every character. monaco-editor, @monaco-editor/react and the dompurify override are removed. Specs: typed code reaches the node source, a JSON setting saves only text that parses. Docs name Tab and Ctrl-M. Claude-Session: https://claude.ai/code/session_01SSi5AvZ7pFmySK8zy3NPMh
This commit is contained in:
@@ -31,7 +31,7 @@ def content_security_policy(index_html: str) -> str:
|
||||
|
||||
The hash is taken from the file being served, so editing the theme script
|
||||
in ``index.html`` cannot leave a stale one behind.
|
||||
style-src 'unsafe-inline': Monaco, Radix's scroll lock and the toasts insert
|
||||
style-src 'unsafe-inline': CodeMirror, Radix's scroll lock and the toasts insert
|
||||
<style> elements at runtime, which no hash can name. img/frame-src take any
|
||||
http(s): a camera stream or website widget points wherever its dashboard
|
||||
says.
|
||||
|
||||
Reference in New Issue
Block a user