Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 合同包住构造与渲染。
Expand Down
36 changes: 18 additions & 18 deletions calcit.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@
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
:on-input $ fn (e d!)
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
Expand All @@ -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 |)
Expand All @@ -88,23 +88,23 @@
'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
:defs $ {}
'*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
reset! *reel $ typed/record-op updater @*reel op (generate-id!)
: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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -218,31 +218,31 @@
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
:defs $ {} $ 'updater
%{} '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 $ []
Expand Down
4 changes: 2 additions & 2 deletions deps.cirru
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
}
5 changes: 3 additions & 2 deletions scripts/typed-reel-render.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.