feat(lesson-preparation): add AI evaluation, analytics, attachments, calendar, comments, review, substitutes, formative, and version diff
- Add actions-ai-evaluation, actions-analytics, actions-attachments, actions-calendar, actions-comments, actions-formative, actions-questions, actions-review, actions-substitutes - Add corresponding data-access layers for each new action module - Add calendar-view, curriculum-map-view, version-diff-viewer components - Add editor-slice, selection-slice, version-slice hooks for state management - Add document-diff and scope-check lib utilities - Add default-question-service and external-questions-bridge services
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import type { ReactElement } from "react";
|
||||
import type {
|
||||
BlockData,
|
||||
@@ -47,10 +49,9 @@ export interface BlockRegistryEntry {
|
||||
isRichText?: boolean;
|
||||
}
|
||||
|
||||
const RICH_TEXT_TYPES: BlockType[] = ["rich_text", "consolidation"];
|
||||
|
||||
/**
|
||||
* Block 注册表元数据(用于查询 isRichText 等属性)。
|
||||
* Block 注册表元数据(单一数据源,P0-9 修复)。
|
||||
* isRichText 属性是判断富文本 block 的唯一权威来源。
|
||||
* 组件渲染由 BlockRenderer 统一处理,避免在 render 中动态获取组件引用。
|
||||
*/
|
||||
export const BLOCK_REGISTRY: Record<BlockType, BlockRegistryEntry> = {
|
||||
@@ -68,8 +69,13 @@ export const BLOCK_REGISTRY: Record<BlockType, BlockRegistryEntry> = {
|
||||
reflection: {},
|
||||
};
|
||||
|
||||
/**
|
||||
* 判断某 BlockType 是否为富文本类。
|
||||
* P0-9 修复:统一以 BLOCK_REGISTRY.isRichText 为唯一数据源,
|
||||
* 删除 constants.ts 中的 RICH_TEXT_BLOCK_TYPES 和此处的 RICH_TEXT_TYPES 冗余定义。
|
||||
*/
|
||||
export function isRichTextBlock(type: BlockType): boolean {
|
||||
return RICH_TEXT_TYPES.includes(type);
|
||||
return BLOCK_REGISTRY[type]?.isRichText === true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user