feat(creator-studio): icon toolbar with block tools, drop author strip

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Opus 5 committed 2026-11-06 22:30:08 +08:00
1 parent 7bdf7cf018
commit 7c33482be7
19 files changed
+600 -241

No files matched your search

@@ -150,7 +150,7 @@ test('fixed top toolbar has TinyMCE formatting, media, and extension actions', (
assert.match(appSource, /undoManager\.undo\(\)/);
assert.match(appSource, /undoManager\.redo\(\)/);
assert.match(appSource, /editor\.formatter\.toggle\(value \|\| 'h2'\)/);
assert.match(editorToolbar, /value=\{formatValue\}/);
assert.match(editorToolbar, /value=\{formatValue === 'blockquote' \? 'p' : formatValue\}/);
assert.match(editorToolbar, /canUndo/);
assert.match(editorToolbar, /canRedo/);
assert.match(editorToolbar, /onCommand\('Bold'\)/);
@@ -158,6 +158,19 @@ test('fixed top toolbar has TinyMCE formatting, media, and extension actions', (
assert.match(editorToolbar, /onOpenMedia\('image'\)/);
assert.match(editorToolbar, /onOpenMedia\('video'\)/);
assert.match(editorToolbar, /onClick=\{onOpenLink\}/);
// 引用不再是标题下拉的一部分,而是独立按钮。
assert.match(editorToolbar, /onCommand\('format', 'blockquote'\)/);
assert.doesNotMatch(editorToolbar, /<option value="blockquote"/);
// 新增的块级按钮。
for (const kind of ['list', 'toc', 'divider', 'code', 'footnote', 'math', 'table']) {
assert.ok(editorToolbar.includes(`onInsertBlock('${kind}')`), `missing block button: ${kind}`);
}
assert.match(appSource, /onInsertBlock=\{insertBlock\}/);
assert.match(read('assets/creator-studio/src/utils/block-markup.ts'), /jio-toc-placeholder/);
assert.match(read('assets/creator-studio/src/utils/block-markup.ts'), /jio-math/);
// 工具栏按钮统一为「图标在上、文字在下」。
assert.match(editorToolbar, /jio-creator__tool-label/);
assert.match(read('assets/creator-studio/src/styles/studio.scss'), /\.jio-creator__tool-btn\s*\{[\s\S]*?flex-direction:\s*column/);
assert.match(appSource, /保存草稿/);
assert.match(appSource, /<SaveState value=\{saveState\}/);
assert.match(appSource, /draftRef\.current\.postId/);
@@ -237,7 +250,15 @@ test('scheduled publishing is validated and applied server side', () => {
assert.match(rest, /'canSchedule'\s*=>\s*\$cap\('new_post_audit_no'\)/);
});
test('Chinese character count strips markup and counts visible text', () => {
assert.match(appSource, /Array\.from\(plainText\(draft\.content\)\)\.length/);
assert.match(appSource, /container\.textContent/);
test('the writing card has no author strip above the title', () => {
assert.doesNotMatch(appSource, /AuthorRow/);
assert.doesNotMatch(appSource, /原创内容/);
assert.doesNotMatch(read('assets/creator-studio/src/styles/studio.scss'), /jio-creator__author/);
});
test('the writing surface has no character or reading-time footer', () => {
assert.doesNotMatch(appSource, /jio-creator__footer/);
assert.doesNotMatch(appSource, /分钟阅读/);
assert.doesNotMatch(appSource, /charCount/);
assert.doesNotMatch(read('assets/creator-studio/src/styles/studio.scss'), /\.jio-creator__footer/);
});
@@ -708,7 +708,7 @@ test('single articles enqueue only content and settings driven assets', () => {
assert.match(singleBlock, new RegExp(`singular_assets\\['${requirement}'\\]`));
}
assert.match(runtime, /\$requirements\['has_toc'\] = \$is_article && \$article_nav_enabled/);
assert.match(runtime, /\$requirements\['has_toc'\] = \$is_article && \(\$article_nav_enabled \|\| \$has_inline_toc\)/);
assert.match(runtime, /data-jio-video/);
assert.match(runtime, /post_password_required\(\$post_id\)/);
assert.match(runtime, /comment_settings\['close_comments'\]/);
@@ -43,7 +43,10 @@ test('TOC script enqueue follows article visibility settings and per-post overri
assert.match(scripts, /\$article_nav_enabled = !array_key_exists\('article_nav', \$settings\) \|\| !empty\(\$settings\['article_nav'\]\)/);
assert.match(scripts, /get_post_meta\(\$post_id, DomainModel::POST_META_KEY, true\)/);
assert.match(scripts, /empty\(\$extension_meta\['no_article-navs'\]\)/);
assert.match(scripts, /\$requirements\['has_toc'\] = \$is_article && \$article_nav_enabled/);
// 正文里插入目录块时也要加载脚本,因此条件是「设置开启」或「正文含占位」。
assert.match(scripts, /\$has_inline_toc = class_exists\(/);
assert.match(scripts, /ContentBlocks::has_toc_placeholder\(\$content\)/);
assert.match(scripts, /\$requirements\['has_toc'\] = \$is_article && \(\$article_nav_enabled \|\| \$has_inline_toc\)/);
assert.doesNotMatch(scripts, /preg_match_all\('\/<h\[1-4\]/);
assert.match(scripts, /\$singular_assets\['has_toc'\][\s\S]*?'jio-section-navs'/);