diff --git a/README.md b/README.md index c8e7199..b49f3c5 100644 --- a/README.md +++ b/README.md @@ -5,18 +5,18 @@ Text diff ### 使用者影响 -升级到 Calcit 和 `@calcit/procs` **0.38.0** 后,请重新安装依赖、编译并刷新。文本输入、Run 输出、原 Map 存档和页面 HUD 继续适用。 应用操作和 Reel 控制解码后通过 `ResolvedOp` union 区分,已有 Reel 标签和存档结构保持兼容。 +升级到 Calcit 和 `@calcit/procs` **0.40.0** 后,请重新安装依赖、编译并刷新。文本输入、Run 输出、原 Map 存档和页面 HUD 继续适用。 应用操作和 Reel 控制通过 `ResolvedOp` union 区分。Reel 面板直接接收独立控制回调,原存档结构保持兼容。 -Reel 使用 `State`。旧操作在入口解码,业务更新器接收具名操作。状态路径沿用 `CursorKey = Tag | String | Number`,已有 Map 或 Struct 存档仍在恢复时校验。恢复成功后才注册离页保存。 +Reel 使用 `State`。业务更新器接收具名操作。状态路径和顶层状态键统一使用 `CursorKey = Tag | String | Number`,已有 Map 或 Struct 存档仍在恢复时校验。恢复成功后才注册离页保存。 -正式依赖为 Respo **0.19.5**、Reel **0.10.0**、Markdown **0.8.2**、UI **0.15.2**、JS-FFI **0.2.13**,传递 Router **0.12.2**。 +正式依赖为 Respo **0.19.5**、Reel **0.11.0**、Markdown **0.8.2**、UI **0.15.2**、JS-FFI **0.2.13**,传递 Router **0.12.2**。 ### Workflow Use `calcit.cirru` and `deps.cirru`; do not restore the retired `compact.cirru` or `package.cirru`. Generated `js-out/` is not committed. -Use Node 24 and Yarn 4.18.0. Install Calcit 0.38.0 and Caps 0.1.1 separately +Use Node 24 and Yarn 4.18.0. Install Calcit 0.40.0 and Caps 0.1.1 separately (the latter follows [the official Caps installation](https://github.com/calcit-lang/caps)); Corepack/Yarn does not install Caps. Strict dependency installation and the original type/test gates are retained. Browser and production acceptance remain separate from successful compilation. diff --git a/calcit.cirru b/calcit.cirru index 0168417..de0f36b 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -14,7 +14,6 @@ :code $ quote $ defcomp comp-container (reel on-control) let store $ :store reel - states $ :states store div {} $ :style $ .merge ui/global ui/row textarea $ {} @@ -43,7 +42,7 @@ -> Unit println $ :content store if dev? - Option :some $ comp-typed-reel (>> states :reel) reel ({}) on-control + Option :some $ comp-controlled-reel reel ({}) on-control Option :none :examples $ [] :schema $ quote $ Fn (reel.typed/State text-diff.schema/Op text-diff.schema/Store) @@ -52,9 +51,9 @@ :ns $ %{} 'NsEntry (:doc |) :code $ quote $ ns text-diff.comp.container :require (respo-ui.core :as ui) - respo.core :refer $ defcomp >> <> div button textarea span input + respo.core :refer $ defcomp <> div button textarea span input respo.comp.space :refer $ space-x - reel.comp.reel :refer $ comp-typed-reel + reel.comp.reel :refer $ comp-controlled-reel respo-md.comp.md :refer $ comp-md text-diff.config :refer $ dev? 'text-diff.config $ %{} 'FileEntry @@ -204,7 +203,7 @@ :schema $ quote UnionDef 'Store $ %{} 'CodeEntry (:doc |) :code $ quote $ defstruct Store - :states $ Map Tag Dynamic + :states $ Map text-diff.schema/CursorKey Dynamic :content String :examples $ [] :schema $ quote StructDef @@ -230,7 +229,7 @@ (:states cursor data) assoc store :states $ decode-map-as update-state-tree (:states store) cursor data - Map Tag Dynamic + Map text-diff.schema/CursorKey Dynamic (:content content) (assoc store :content content) (:hydrate-storage stored) stored :examples $ [] diff --git a/deps.cirru b/deps.cirru index 45ac9bc..3fd49ac 100644 --- a/deps.cirru +++ b/deps.cirru @@ -1,5 +1,5 @@ -{} (:calcit-version |0.38.0) +{} (:calcit-version |0.40.0) :version |0.1.4 :dependencies $ {} (|Respo/reel.calcit |0.11.0) |Respo/respo-markdown.calcit |0.8.2 diff --git a/package.json b/package.json index 0b3a211..db2a6b6 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "vite": "^8.3.1" }, "dependencies": { - "@calcit/procs": "0.38.0", + "@calcit/procs": "0.40.0", "cirru-color": "^0.2.4", "copy-text-to-clipboard": "^3.2.2", "dayjs": "^1.11.20", diff --git a/scripts/upgrade.test.mjs b/scripts/upgrade.test.mjs index c1d2f9e..7852042 100644 --- a/scripts/upgrade.test.mjs +++ b/scripts/upgrade.test.mjs @@ -36,6 +36,9 @@ test('cursor updates preserve content', () => { const nested = read(read(read(keyed, tags.states), tags.editor), key); assert.equal(read(nested, tags.data), false); assert.equal(read(keyed, tags.content), 'keep'); + const root = apply(populated, tags.states, c._$L_(key), false); + const restored = decode_store(c.parse_cirru_edn(c.format_cirru_edn(c._$n_struct_$o_to_map(root)))); + assert.equal(read(read(read(restored, tags.states), key), tags.data), false); } assert.throws(() => apply(populated, tags.states, c._$L_(tags.editor, false), c._$n__$M_()), /CursorKey|declared type/); }); diff --git a/yarn.lock b/yarn.lock index f1acba0..6f2938e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,15 +12,15 @@ __metadata: languageName: node linkType: hard -"@calcit/procs@npm:0.38.0": - version: 0.38.0 - resolution: "@calcit/procs@npm:0.38.0" +"@calcit/procs@npm:0.40.0": + version: 0.40.0 + resolution: "@calcit/procs@npm:0.40.0" dependencies: "@calcit/finger-vec": "npm:0.1.1" "@calcit/ternary-tree": "npm:0.0.26" "@cirru/parser.ts": "npm:0.0.10" "@cirru/writer.ts": "npm:^0.1.9" - checksum: 10c0/8d1910cc739b1b23b5d5b549fb519053b2a578ab05f11814d28c09fbf4c18be5d3a14f52ff3b9bea4c9a3a42ab79d56a59021cd533d68ecc5e26e61da1e347ba + checksum: 10c0/4122eaa8d63fd57826d24c6c072dbd1cb6cdd2934dbfdb4fd0afc03f4aec73f07d71ccba246120c15e198134b7e92a324f1f1900b43c458b02e871354739cf84 languageName: node linkType: hard @@ -278,7 +278,7 @@ __metadata: version: 0.0.0-use.local resolution: "calcit-workflow@workspace:." dependencies: - "@calcit/procs": "npm:0.38.0" + "@calcit/procs": "npm:0.40.0" bottom-tip: "npm:^0.1.5" cirru-color: "npm:^0.2.4" copy-text-to-clipboard: "npm:^3.2.2"