feat(mindspace): 公开页分享组件、workspace 路径与 Plaza 发布增强

- 新增 public share widget 与 workspace relative path 解析
- 增强 publications/chat-plaza 发布链路与缩略图 demo
- 补充 schema、cover 检查脚本与回归测试

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-05 23:14:41 +08:00
parent 69be1e5293
commit e2ad3bf62b
39 changed files with 2184 additions and 256 deletions
+7 -4
View File
@@ -36,6 +36,7 @@ test('injectPlazaEmbedBootstrap adds script before closing body', () => {
test('publishedPageCspForEmbed allows inline script', () => {
assert.match(publishedPageCspForEmbed(true), /script-src 'unsafe-inline'/);
assert.match(publishedPageCspForEmbed(true), /img-src 'self' data: https: http:/);
});
test('allowPlazaEmbedFrame removes legacy X-Frame-Options header', () => {
@@ -66,10 +67,12 @@ test('preparePublicationHtmlForEmbed strips CSP and injects bootstrap', () => {
assert.match(out, /\.hero\{height:auto!important;min-height:0!important/);
});
test('embed bootstrap does not cap tall publication height', () => {
test('embed bootstrap measures content blocks without document scrollHeight feedback', () => {
const html = '<!doctype html><html><body><main style="height:24000px">Tall</main></body></html>';
const out = preparePublicationHtmlForEmbed(html);
assert.doesNotMatch(out, /Math\.min\(measured,\s*16000\)/);
assert.match(out, /body\.children\.length/);
assert.match(out, /MutationObserver/);
assert.doesNotMatch(out, /root\?root\.scrollHeight/);
assert.doesNotMatch(out, /body\?body\.scrollHeight/);
assert.match(out, /isDecorative/);
assert.match(out, /bg-particles/);
assert.match(out, /blocks\(\)\.forEach\(function\(el\)\{if\(el\)ro\.observe\(el\)/);
});