From 1e72b32d80f701a1a3b1e1b0984211e0197f3ebc Mon Sep 17 00:00:00 2001 From: tiye Date: Wed, 11 Nov 2026 02:38:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=20Markup=20=E5=88=B0=20Calci?= =?UTF-8?q?t=200.41.0=20=E5=B9=B6=E7=BA=A6=E6=9D=9F=E6=AD=A3=E6=96=87?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++--- calcit.cirru | 36 +++++++++++++++--------------- deps.cirru | 4 ++-- package.json | 4 ++-- scripts/typed-reel-render.test.mjs | 5 +++-- yarn.lock | 10 ++++----- 6 files changed, 33 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index b69c1fc..af4e389 100644 --- a/README.md +++ b/README.md @@ -6,14 +6,14 @@ Demo http://repo.respo-mvc.org/markup/ . ### Usages -本次候选 **0.0.5** 配对正式 Calcit / `@calcit/procs` **0.40.0**。 +本次候选 **0.0.6** 配对正式 Calcit / `@calcit/procs` **0.41.0**。 消费者需重新安装完整依赖图、生成 JS 并完整刷新页面。Content 输入、Run、Reel 调试工具、 存档 key 和格式保持;Demo 不新增 Markdown 解析功能。UI/Reel 跨 minor 升级可能有样式差异。 -0.0.5 尚未发布,正式 tag 出现前不要将本分支当作已发布依赖。 +0.0.6 尚未发布,正式 tag 出现前不要将本分支当作已发布依赖。 依赖使用已发布的 Respo **0.19.5**、UI **0.15.2**、Reel **0.11.0**、JS-FFI **0.2.13**, 传递 Router **0.12.2**;不再使用 Reel / Router 的旧 alpha 图。 -编辑回调派发具体 `Op`,Reel 0.11.0 面板与快捷键通过独立回调传递 `Control`。输入值由公开 `event-value` 检查为 String。 +编辑回调派发 `Op :edit-content`,将正文声明为 String,更新时保留原状态 Map 的其他字段。Reel 0.11.0 面板与快捷键通过独立回调传递 `Control`。输入值由公开 `event-value` 检查为 String。 原 Reel 的 `read-field` 已删除;此处直接读取数据,保留 Map/Struct 字段读取及缺失值语义。 两个间隔分别保持 8 / 8px,开发态子节点显式使用 Option。 根渲染和原 SSR 回归均按 Respo 的公开 managed memo frame 合同包住构造与渲染。 diff --git a/calcit.cirru b/calcit.cirru index 0dfec74..c1ebc37 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -36,7 +36,7 @@ textarea $ {} :value $ match content (:some value) value - (:none) (Option :none) + (:none) None :placeholder |Content :class-name $ str-spaced css/expand css/textarea :style $ {} $ :height |320px @@ -44,7 +44,7 @@ hint-fn $ Fn respo.schema/RespoEvent Fn app.schema/Op $ -> Unit -> Unit - d! $ schema/Op :states cursor $ assoc state :content (event-value e) + d! $ schema/Op :edit-content cursor state $ event-value e space-x 8 div {} $ :class-name css/expand @@ -59,10 +59,10 @@ (:some value) (println value) (:none) (println nil) if dev? - Option :some $ comp-typed-reel (>> states :reel) reel ({}) on-control! - Option :none + Some $ comp-typed-reel (>> states :reel) reel ({}) on-control! + , None :examples $ [] - :schema $ quote $ Fn (reel.typed/State app.schema/Op app.schema/Store) + :schema $ quote $ Fn (reel.typed/State schema/Op schema/Store) Fn reel.typed/Control $ -> Unit -> respo.schema/Component :ns $ %{} 'NsEntry (:doc |) @@ -88,7 +88,7 @@ 'site $ %{} 'CodeEntry (:doc |) :code $ quote $ def site (Site :storage-key |workflow) :examples $ [] - :schema $ quote app.config/Site + :schema $ quote Site :ns $ %{} 'NsEntry (:doc |) :code $ quote $ ns app.config 'app.main $ %{} 'FileEntry @@ -96,7 +96,7 @@ '*reel $ %{} 'CodeEntry (:doc |) :code $ quote $ defref *reel (typed/new-reel schema/store) :examples $ [] - :schema $ quote $ Ref (reel.typed/State app.schema/Op app.schema/Store) + :schema $ quote $ Ref (typed/State schema/Op schema/Store) 'dispatch! $ %{} 'CodeEntry (:doc |) :code $ quote $ defn dispatch! (op) when config/dev? $ js/console.log |Dispatch: op @@ -104,7 +104,7 @@ :timestamp $ date-now-snapshot , &unit :examples $ [] - :schema $ quote $ Fn app.schema/Op (-> Unit) (:features :js-ffi) + :schema $ quote $ Fn schema/Op (-> Unit) (:features :js-ffi) 'main! $ %{} 'CodeEntry (:doc |) :code $ quote $ defn main! () println "|Running mode:" $ if config/dev? |dev |release @@ -147,7 +147,7 @@ reset! *reel $ typed/apply-control updater @*reel control , &unit :examples $ [] - :schema $ quote $ Fn reel.typed/Control (-> Unit) + :schema $ quote $ Fn typed/Control (-> Unit) 'persist-storage! $ %{} 'CodeEntry (:doc |) :code $ quote $ defn persist-storage! () println "|Saved at" $ :iso $ date-now-snapshot @@ -194,7 +194,7 @@ :defs $ {} 'Op $ %{} 'CodeEntry (:doc |) :code $ quote $ defenum Op - :states (List respo.schema/CoordKey) (Map Dynamic Dynamic) + :edit-content (List respo.schema/CoordKey) (Map Dynamic Dynamic) String :hydrate-storage app.schema/Store :examples $ [] :schema $ quote EnumDef @@ -218,21 +218,21 @@ match result (:ok stored) match (get stored.:states :cursor) - (:none) (Option :some stored) + (:none) (Some stored) (:some cursor) match try-decode-map-as cursor $ List respo.schema/CoordKey - (:ok _) (Option :some stored) - (:err _) (Option :none) - (:err message) (Option :none) + (:ok _) (Some stored) + (:err _) None + (:err message) None :examples $ [] :schema $ quote $ Fn Dynamic - -> $ Option app.schema/Store + -> $ Option Store 'store $ %{} 'CodeEntry (:doc |) :code $ quote $ def store Store :states $ {} $ :cursor ([]) :examples $ [] - :schema $ quote app.schema/Store + :schema $ quote Store :ns $ %{} 'NsEntry (:doc |) :code $ quote $ ns app.schema 'app.updater $ %{} 'FileEntry @@ -240,9 +240,9 @@ %{} 'CodeEntry (:doc |) :code $ quote $ defn updater (store op op-id op-time) match op - (:states cursor s) + (:edit-content cursor previous content) assoc store :states $ decode-map-as - update-state-tree (:states store) cursor s + update-state-tree (:states store) cursor $ assoc previous :content content Map Dynamic Dynamic (:hydrate-storage data) data :examples $ [] diff --git a/deps.cirru b/deps.cirru index 7a5e176..4770069 100644 --- a/deps.cirru +++ b/deps.cirru @@ -1,6 +1,6 @@ -{} (:calcit-version |0.40.0) - :version |0.0.5 +{} (:calcit-version |0.41.0) + :version |0.0.6 :dependencies $ {} (|Respo/reel.calcit |0.11.0) |Respo/respo-ui.calcit |0.15.2 |Respo/respo.calcit |0.19.5 diff --git a/package.json b/package.json index 0f39ebf..c021d10 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "packageManager": "yarn@4.18.0", "dependencies": { - "@calcit/procs": "0.40.0" + "@calcit/procs": "0.41.0" }, "devDependencies": { "bottom-tip": "^0.1.5", "vite": "8.3.3" }, - "version": "0.0.5" + "version": "0.0.6" } diff --git a/scripts/typed-reel-render.test.mjs b/scripts/typed-reel-render.test.mjs index 44af14f..f74a81c 100644 --- a/scripts/typed-reel-render.test.mjs +++ b/scripts/typed-reel-render.test.mjs @@ -31,11 +31,12 @@ test('renders the typed Reel devtools with an empty history', () => { test('content edits survive Reel replay and the existing saved-state format', () => { const field = (value, key) => clt.get(value, clt.init_tags([key])[key]).extra[0]; - const t = clt.init_tags(['states', 'content']); - const edit = clt._PCT__$o__$o_(Op, t.states, clt._$L_(), clt._$n__$M_(t.content, '中文🐈')); + const t = clt.init_tags(['edit-content', 'other']); + const edit = clt._PCT__$o__$o_(Op, t['edit-content'], clt._$L_(), clt._$n__$M_(t.other, true), '中文🐈'); const reel = record_op(updater, new_reel(store), edit, 'edit', 1); const current = field(reel, 'store'); assert.equal(field(field(field(current, 'states'), 'data'), 'content'), '中文🐈'); + assert.equal(field(field(field(current, 'states'), 'data'), 'other'), true); assert.match(renderHtml(reel), /中文🐈/); const restored = clt.option_$o_unwrap(decode_store(clt.parse_cirru_edn(clt.format_cirru_edn(current)))); assert.equal(clt.format_cirru_edn(restored), clt.format_cirru_edn(current)); diff --git a/yarn.lock b/yarn.lock index 1a89008..244149d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,15 +12,15 @@ __metadata: languageName: node linkType: hard -"@calcit/procs@npm:0.40.0": - version: 0.40.0 - resolution: "@calcit/procs@npm:0.40.0" +"@calcit/procs@npm:0.41.0": + version: 0.41.0 + resolution: "@calcit/procs@npm:0.41.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/4122eaa8d63fd57826d24c6c072dbd1cb6cdd2934dbfdb4fd0afc03f4aec73f07d71ccba246120c15e198134b7e92a324f1f1900b43c458b02e871354739cf84 + checksum: 10c0/5de94b39e435363d0f80611b63914c9abd6b0afac3c77adf9b9846ac439fce319ac0780697364cabf67b2997d39495a1e72086e1496ac560c51bb57462f37628 languageName: node linkType: hard @@ -637,7 +637,7 @@ __metadata: version: 0.0.0-use.local resolution: "root-workspace-0b6124@workspace:." dependencies: - "@calcit/procs": "npm:0.40.0" + "@calcit/procs": "npm:0.41.0" bottom-tip: "npm:^0.1.5" vite: "npm:8.3.3" languageName: unknown