feat(creator-studio): 图片宽度四档与作者行
- 通过 editor.BlockEdit 过滤器给 core/image 增加「半屏 / 中等 / 通栏 / 全宽」 四档宽度,选中图片时出现在区块工具条;宽度写入 className 并序列化到 post_content,前台样式即可生效,无需自定义区块或额外元数据 - 前台样式:半屏靠左 50%,中等 72%,通栏跟随正文行宽,全宽突破行宽但受容器 内边距约束;移动端半屏与全宽回退为整行,避免横向滚动 - 新增作者行(头像 + 昵称 + 身份说明),数据由 CreatorRest::author_payload() 从服务端给出,前端不自行拼装;无昵称时整行不渲染,头像缺失时回退首字占位 - 作者行放在摘要之后、正文之前 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
79909f449e
commit
f5e9420266
11 files changed
+680
-39
No files matched your search
@@ -19,8 +19,10 @@ import { __ } from '@wordpress/i18n';
|
||||
import { apiPost } from './services/api';
|
||||
import { installApiFetchNonce } from './services/api-fetch';
|
||||
import { installMediaUploadBridge } from './services/media';
|
||||
import { installImageWidthPresets } from './extensions/image-width';
|
||||
import { PublishDrawer } from './panels/publish-drawer';
|
||||
import { CoverStrip } from './components/cover-strip';
|
||||
import { AuthorRow } from './components/author-row';
|
||||
import { InsertPanel, type InsertItem } from './panels/insert-panel';
|
||||
import { buildInsertGroups } from './utils/insert-items';
|
||||
import { SaveState, type SaveStateValue } from './components/save-state';
|
||||
@@ -420,6 +422,8 @@ function Studio(): JSX.Element {
|
||||
/>
|
||||
</label>
|
||||
|
||||
<AuthorRow author={bootstrap.author || {}} />
|
||||
|
||||
<div className="jio-creator__editor">
|
||||
<BlockEditorProvider
|
||||
value={blocks}
|
||||
@@ -497,6 +501,7 @@ function mount() {
|
||||
}
|
||||
installApiFetchNonce(nonce);
|
||||
installMediaUploadBridge(bootstrap, nonce);
|
||||
installImageWidthPresets();
|
||||
target.classList.add('is-ready');
|
||||
createRoot(target).render(<Studio />);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user