新增: Rust Op reducer + 逆操作计算(B2)

- op.rs: 纯函数 apply_op(deck,op) → new_deck,覆盖全部 11 种 Op 类型
- invert_op(deck,op) → 逆 Op,支持完整的 undo 链路
- 所有 reducer 不 mutate 输入,返回新 deck
- 8 个单元测试: add_slide/del_slide/set_theme/update_element/del_element/
  move_slide/undo_update/undo_add_slide/replace_deck_undo
- ElementStyle 加 rename_all=camelCase 匹配 JS 协议
- 32 个测试全部通过(B1:23 + B2:9)
This commit is contained in:
2026-07-12 22:33:41 +08:00
parent 1430e9e061
commit 664ca9c65c
4 changed files with 561 additions and 1 deletions

View File

@@ -157,6 +157,7 @@ pub struct RichLine {
#[derive(Debug, Clone, Default, Serialize, Deserialize, TS)]
#[ts(export, export_to = "../bindings/types.ts")]
#[serde(rename_all = "camelCase")]
pub struct ElementStyle {
pub font_size: Option<f64>,
pub color: Option<String>,