Improve MindSpace visual editor UX and default RMB billing.

Add color-coded edit highlights with an in-preview legend, strip CSP meta
for srcdoc editing, and simplify fullscreen preview to immersive visual edit
only. Default billing to CNY token rates unless H5_USE_BACKEND_COST=1.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
John
2026-06-15 23:47:23 -07:00
parent 8d2f55771c
commit 79457230c1
11 changed files with 339 additions and 225 deletions
+11
View File
@@ -26,3 +26,14 @@ test('buildEditablePreviewDocument provides blank fallback', () => {
const result = buildEditablePreviewDocument('');
assert.match(result, /空白页面/);
});
test('buildEditablePreviewDocument strips CSP meta so editor script can run', () => {
const html = `<!DOCTYPE html><html><head>
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'none'">
</head><body><h1>探索世界</h1></body></html>`;
const result = buildEditablePreviewDocument(html);
assert.doesNotMatch(result, /Content-Security-Policy/);
assert.match(result, /mindspace-visual-editor-script/);
assert.match(result, /<h1>探索世界<\/h1>/);
});