feat(business): implement block-based content editing and rich text rendering
Introduce a new `BlockEditor` component and upgrade the post/message rendering system to support rich text segments (images, @mentions, votes, and post references). - Implement `BlockEditor` for long-form post creation with image embedding support. - Upgrade `PostContentRenderer` and `SegmentRenderer` to handle complex segment types including inline images and block elements. - Refactor `PostCard` to use segment-based content and image signatures for optimized memoization. - Centralize segment partitioning logic in `segmentUtils.ts` to ensure consistent rendering across chat and post modules. - Update `PostRepository` and `Post` entity to support the new `segments` data structure.
This commit is contained in:
@@ -1125,11 +1125,12 @@ export const PostDetailScreen: React.FC = () => {
|
||||
lineHeight: isDesktop ? 32 : isTablet ? 30 : 28
|
||||
}
|
||||
]}
|
||||
onImagePress={(url) => handleImagePress([{ uri: url }], 0)}
|
||||
/>
|
||||
</View>
|
||||
|
||||
{/* 图片 - 详情页显示所有图片,不限制数量 */}
|
||||
{postImages.length > 0 && (
|
||||
{/* 仅当 segments 中不含 image 时才渲染独立的图片区域 */}
|
||||
{!post.segments?.some(s => s.type === 'image') && postImages.length > 0 && (
|
||||
<ImageGrid
|
||||
images={postImages}
|
||||
mode="auto"
|
||||
|
||||
Reference in New Issue
Block a user