Skip to content

Commit ff11f2f

Browse files
authored
升级 Screen Notes 到 Calcit 0.44 (#7)
* 升级 Calcit 至 0.44.0 * 收紧笔记类型并修复浏览器启动
1 parent 546c9ec commit ff11f2f

7 files changed

Lines changed: 27 additions & 25 deletions

File tree

‎.gitattributes‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11

2-
calcit.cirru -diff linguist-generated
32
yarn.lock -diff linguist-generated

‎.github/workflows/upload.yaml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
node-version: 22
1818
- uses: calcit-lang/setup-calcit@v1.5.1
1919
with:
20-
version: "0.43.0"
20+
version: "0.44.0"
2121
tools: calcit,caps
2222
- name: Install dependencies
2323
run: |
@@ -35,6 +35,7 @@ jobs:
3535
- name: Build
3636
run: yarn build
3737
- name: Deploy to server
38+
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
3839
id: deploy
3940
uses: Pendect/action-rsyncer@v1.1.0
4041
env:
@@ -46,4 +47,5 @@ jobs:
4647
src: 'dist/*'
4748
dest: 'rsync-user@tiye.me:/web-assets/repo/${{ github.repository }}'
4849
- name: Display status from deploy
50+
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
4951
run: echo "${{ steps.deploy.outputs.status }}"

‎calcit.cirru‎

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,15 @@
2121
{} $ :background-color |#f0f0f0
2222
list->
2323
{} $ :style $ {} (:width |100%) (:height |100%)
24-
map-indexed notes $ fn (idx raw)
25-
let
26-
note $ decode-map-as raw Note
27-
[] (:id note) (comp-note note)
24+
map-indexed notes $ fn (idx note)
25+
[] (:id note) (comp-note note)
2826
button $ {} (:inner-text "|+ Note") (:style ui/button)
2927
:style $ {} (:position :absolute) (:left 16) (:bottom 16)
3028
:on-click $ fn (e d!)
3129
d! $ schema/Action :add-note 40 $ + 40
3230
* 24 $ count notes
3331
:examples $ []
34-
:schema $ quote $ Fn (List Dynamic) (-> respo.schema/Component)
32+
:schema $ quote $ Fn (List Note) (-> respo.schema/Component)
3533
'comp-note $ %{} 'CodeEntry (:doc |)
3634
:code $ quote $ defcomp comp-note (note)
3735
div
@@ -58,21 +56,19 @@
5856
'*notes $ %{} 'CodeEntry (:doc |)
5957
:code $ quote $ defref *notes ([])
6058
:examples $ []
61-
:schema $ quote $ Ref (List Dynamic)
59+
:schema $ quote $ Ref (List Note)
6260
'dispatch! $ %{} 'CodeEntry (:doc |)
6361
:code $ quote $ defn dispatch! (action)
6462
match action
6563
(:add-note x y)
66-
reset! *notes $ conj @*notes $ {}
67-
:id $ str |note- $ count @*notes
68-
:x x
69-
:y y
70-
:text |
64+
reset! *notes $ conj @*notes $ Note :id
65+
str |note- $ count @*notes
66+
, :x x :y y :text |
7167
(:update-note id text)
7268
reset! *notes $ map-indexed @*notes $ fn (idx raw)
7369
if
74-
= id $ .unwrap-or (get raw :id) |
75-
assoc raw :text text
70+
= id $ :id raw
71+
&struct:assoc raw :text text
7672
, raw
7773
, &unit
7874
:examples $ []
@@ -108,7 +104,7 @@
108104
:require
109105
respo.core :refer $ render-with!
110106
respo.ffi.browser :refer $ query-selector
111-
app.comp.container :refer $ comp-container
107+
app.comp.container :refer $ comp-container Note
112108
app.schema :as schema
113109
|./calcit.build-errors :default build-errors
114110
'app.schema $ %{} 'FileEntry

‎deps.cirru‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{} (:calcit-version |0.43.0)
1+
{} (:calcit-version |0.44.0)
22
:version |0.0.1
3-
:dependencies $ {} (|Respo/respo.calcit |0.19.10)
4-
|Respo/respo-ui.calcit |0.15.4
3+
:dependencies $ {} (|Respo/respo.calcit |0.19.12)
4+
|Respo/respo-ui.calcit |0.15.6

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"vite": "^7.0.0"
1919
},
2020
"dependencies": {
21-
"@calcit/procs": "0.43.0",
21+
"@calcit/procs": "0.44.0",
2222
"feather-icons": "^4.9.0",
2323
"shortid": "^2.2.14"
2424
},

‎vite.config.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineConfig } from 'vite'
2+
3+
export default defineConfig({
4+
define: { process: 'globalThis.process' },
5+
})

‎yarn.lock‎

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)