fix(presentation): 修复 presentation 模块类型错误和语法问题
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

- 创建 types.ts 定义完整的类型系统
- 重写 DocumentRenderer.tsx 修复语法错误
- 重写 QuizRenderer.tsx 修复语法错误
- 重写 PresentationContainer.tsx 添加类型守卫
- 重写 TypeSwitcher.tsx 修复类型引用
- 更新 index.ts 移除不存在的 ChartRenderer 导出

审计结果:
- 类型检查: 通过
- 单元测试: 222 passed
- 构建: 成功
This commit is contained in:
iven
2026-03-26 17:19:28 +08:00
parent d0c6319fc1
commit b7f3d94950
71 changed files with 15896 additions and 1133 deletions

View File

@@ -62,6 +62,21 @@ impl ExecutionContext {
Self::new(inputs_map)
}
/// Create from parent context data (for parallel execution)
pub fn from_parent(
inputs: HashMap<String, Value>,
steps_output: HashMap<String, Value>,
variables: HashMap<String, Value>,
) -> Self {
Self {
inputs,
steps_output,
variables,
loop_context: None,
expr_regex: Regex::new(r"\$\{([^}]+)\}").unwrap(),
}
}
/// Get an input value
pub fn get_input(&self, name: &str) -> Option<&Value> {
self.inputs.get(name)
@@ -264,6 +279,16 @@ impl ExecutionContext {
&self.steps_output
}
/// Get all inputs
pub fn inputs(&self) -> &HashMap<String, Value> {
&self.inputs
}
/// Get all variables
pub fn all_vars(&self) -> &HashMap<String, Value> {
&self.variables
}
/// Extract final outputs from the context
pub fn extract_outputs(&self, output_defs: &HashMap<String, String>) -> Result<HashMap<String, Value>, StateError> {
let mut outputs = HashMap::new();