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/);
});