Add MindSpace visual page editor and Plaza local Tunnel deployment.
In-preview HTML editing with undo/redo sync replaces Agent patch auto-save; Plaza runs on local Mac via Cloudflare Tunnel with embed height and CSP fixes. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import {
|
||||
MINDSPACE_PAGE_CONTENT_MESSAGE,
|
||||
buildEditablePreviewDocument,
|
||||
} from './src/utils/mindspaceVisualEditor.ts';
|
||||
|
||||
test('buildEditablePreviewDocument injects visual editor into body', () => {
|
||||
const html = '<!doctype html><html><head></head><body><p>Hi</p></body></html>';
|
||||
const result = buildEditablePreviewDocument(html);
|
||||
|
||||
assert.match(result, /mindspace-visual-editor-style/);
|
||||
assert.match(result, /mindspace-visual-editor-script/);
|
||||
assert.match(result, /data-mindspace-editing/);
|
||||
assert.match(result, /<p>Hi<\/p>/);
|
||||
assert.match(result, new RegExp(MINDSPACE_PAGE_CONTENT_MESSAGE.replace(':', '\\:')));
|
||||
});
|
||||
|
||||
test('buildEditablePreviewDocument wraps fragment html', () => {
|
||||
const result = buildEditablePreviewDocument('<section>块</section>');
|
||||
assert.match(result, /<section>块<\/section>/);
|
||||
assert.match(result, /<\/body>/);
|
||||
});
|
||||
|
||||
test('buildEditablePreviewDocument provides blank fallback', () => {
|
||||
const result = buildEditablePreviewDocument('');
|
||||
assert.match(result, /空白页面/);
|
||||
});
|
||||
Reference in New Issue
Block a user