Skip to content

Commit 84f106b

Browse files
committed
build: upgrade to latest Slate, fix issues
1 parent 7ff265f commit 84f106b

File tree

8 files changed

+76
-72
lines changed

8 files changed

+76
-72
lines changed

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@
2929
"npm-run-all": "^4.1.5",
3030
"ts-protoc-gen": "^0.15.0"
3131
},
32-
"resolutions": {
33-
"immer": "9.0.19"
34-
},
32+
"resolutions": {},
3533
"scripts": {
3634
"js-needs-format": "find src -name '*.ts' -o -name '*.tsx' | egrep -v '/(lib(\\.(browser|module))?|core)/' | xargs prettier -l",
3735
"rust-needs-format": "cargo fmt -- --check",

src/app/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@
6565
"webpack-manifest-plugin": "^5.0.0",
6666
"wouter": "^3.6.0"
6767
},
68-
"resolutions": {
69-
"immer": "9.0.19"
70-
},
68+
"resolutions": {},
7169
"scripts": {
7270
"needs-format": "prettier -l '**/*.ts' '**/*.tsx'",
7371
"format": "prettier --write '**/*.ts' '**/*.tsx'",

src/diagram/VariableDetails.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ export const VariableDetails = styled(
343343
<CardContent>
344344
<Slate
345345
editor={this.state.equationEditor}
346-
value={this.state.equationContents}
346+
initialValue={this.state.equationContents}
347347
onChange={this.handleEquationChange}
348348
>
349349
<Editable
@@ -355,7 +355,7 @@ export const VariableDetails = styled(
355355
/>
356356
</Slate>
357357

358-
<Slate editor={this.state.unitsEditor} value={this.state.unitsContents} onChange={this.handleUnitsChange}>
358+
<Slate editor={this.state.unitsEditor} initialValue={this.state.unitsContents} onChange={this.handleUnitsChange}>
359359
<Editable
360360
className="simlin-variabledetails-unitseditor"
361361
renderLeaf={this.renderLeaf}
@@ -365,7 +365,7 @@ export const VariableDetails = styled(
365365
/>
366366
</Slate>
367367

368-
<Slate editor={this.state.notesEditor} value={this.state.notesContents} onChange={this.handleNotesChange}>
368+
<Slate editor={this.state.notesEditor} initialValue={this.state.notesContents} onChange={this.handleNotesChange}>
369369
<Editable
370370
className="simlin-variabledetails-noteseditor"
371371
renderLeaf={this.renderLeaf}

src/diagram/drawing/EditableLabel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const EditableLabel = styled(
3535
editor.children = value;
3636
Transforms.select(editor, {
3737
anchor: {
38-
path: [0],
38+
path: [0, 0],
3939
offset: 0,
4040
},
4141
focus: Editor.end(editor, [value.length - 1]),
@@ -146,7 +146,7 @@ export const EditableLabel = styled(
146146
onPointerDown={this.handlePointerUpDown}
147147
onPointerUp={this.handlePointerUpDown}
148148
>
149-
<Slate editor={this.state.editor} value={value} onChange={this.handleChange}>
149+
<Slate editor={this.state.editor} initialValue={value} onChange={this.handleChange}>
150150
<Editable autoFocus={true} onKeyUp={this.handleKeyPress} />
151151
</Slate>
152152
</div>

src/diagram/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@
3232
"js-base64": "^3.7.7",
3333
"react": "^18.1.0",
3434
"react-dom": "^18.1.0",
35-
"slate": "^0.87.0",
36-
"slate-history": "^0.86.0",
37-
"slate-react": "^0.88.0",
35+
"slate": "^0.112.0",
36+
"slate-dom": "^0.112.2",
37+
"slate-history": "^0.110.3",
38+
"slate-react": "^0.112.1",
3839
"wouter": "^3.6.0"
3940
},
4041
"resolutions": {
41-
"@types/slate*/**/immutable": "5.0.3",
42-
"immer": "9.0.19"
42+
"@types/slate*/**/immutable": "5.0.3"
4343
},
4444
"devDependencies": {
4545
"@babel/core": "^7.13.1",

src/server/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@
4949
"prettier": "^3.0.0",
5050
"typescript": "^5.7.2"
5151
},
52-
"resolutions": {
53-
"immer": "9.0.19"
54-
},
52+
"resolutions": {},
5553
"scripts": {
5654
"needs-format": "prettier -l '**/*.ts' '**/*.tsx'",
5755
"format": "prettier --write '**/*.ts' '**/*.tsx'",

website/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
"react-dom": "^18.1.0",
2525
"typescript": "^5.7.2"
2626
},
27-
"resolutions": {
28-
"immer": "9.0.19"
29-
},
27+
"resolutions": {},
3028
"browserslist": {
3129
"production": [
3230
"last 2 Chrome versions",

yarn.lock

Lines changed: 62 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2937,6 +2937,11 @@
29372937
resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796"
29382938
integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==
29392939

2940+
"@juggle/resize-observer@^3.4.0":
2941+
version "3.4.0"
2942+
resolved "https://registry.yarnpkg.com/@juggle/resize-observer/-/resize-observer-3.4.0.tgz#08d6c5e20cf7e4cc02fd181c4b0c225cd31dbb60"
2943+
integrity sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==
2944+
29402945
"@leichtgewicht/ip-codec@^2.0.1":
29412946
version "2.0.5"
29422947
resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz#4fc56c15c580b9adb7dc3c333a134e540b44bfb1"
@@ -3675,11 +3680,6 @@
36753680
dependencies:
36763681
"@types/node" "*"
36773682

3678-
"@types/is-hotkey@^0.1.1":
3679-
version "0.1.10"
3680-
resolved "https://registry.yarnpkg.com/@types/is-hotkey/-/is-hotkey-0.1.10.tgz#cf440fab9bf75ffba4e1a16e8df28938de0778c9"
3681-
integrity sha512-RvC8KMw5BCac1NvRRyaHgMMEtBaZ6wh0pyPTBu7izn4Sj/AX9Y4aXU5c7rX8PnM/knsuUpC1IeoBkANtxBypsQ==
3682-
36833683
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
36843684
version "2.0.6"
36853685
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz#7739c232a1fee9b4d3ce8985f314c0c6d33549d7"
@@ -3721,11 +3721,6 @@
37213721
resolved "https://registry.yarnpkg.com/@types/katex/-/katex-0.11.1.tgz#34de04477dcf79e2ef6c8d23b41a3d81f9ebeaf5"
37223722
integrity sha512-DUlIj2nk0YnJdlWgsFuVKcX27MLW0KbKmGVoUHmFr+74FYYNUDAaj9ZqTADvsbE8rfxuVmSFc7KczYn5Y09ozg==
37233723

3724-
"@types/lodash@^4.14.149":
3725-
version "4.17.13"
3726-
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.13.tgz#786e2d67cfd95e32862143abe7463a7f90c300eb"
3727-
integrity sha512-lfx+dftrEZcdBPczf9d0Qv0x+j/rfNCMuC6OcfXmO8gkfeNAY88PgKUbvG56whcN23gc27yenwF6oJZXGFpYxg==
3728-
37293724
"@types/long@^4.0.0":
37303725
version "4.0.2"
37313726
resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a"
@@ -5667,10 +5662,10 @@ compression@^1.7.0, compression@^1.7.4:
56675662
safe-buffer "5.2.1"
56685663
vary "~1.1.2"
56695664

5670-
compute-scroll-into-view@^1.0.20:
5671-
version "1.0.20"
5672-
resolved "https://registry.yarnpkg.com/compute-scroll-into-view/-/compute-scroll-into-view-1.0.20.tgz#1768b5522d1172754f5d0c9b02de3af6be506a43"
5673-
integrity sha512-UCB0ioiyj8CRjtrvaceBLqqhZCVP+1B8+NWQhmdsm0VXOJtobBCf1dBQmebCCo34qZmUwZfIH2MZLqNHazrfjg==
5665+
compute-scroll-into-view@^3.0.2:
5666+
version "3.1.1"
5667+
resolved "https://registry.yarnpkg.com/compute-scroll-into-view/-/compute-scroll-into-view-3.1.1.tgz#02c3386ec531fb6a9881967388e53e8564f3e9aa"
5668+
integrity sha512-VRhuHOLoKYOy4UbilLbUzbYg93XLjv2PncJC50EuTWPA3gaja1UjBsUP/D/9/juV3vQFr6XBEzn9KCAHdUvOHw==
56745669

56755670
56765671
version "0.0.1"
@@ -6463,7 +6458,7 @@ dir-glob@^3.0.1:
64636458
dependencies:
64646459
path-type "^4.0.0"
64656460

6466-
direction@^1.0.3:
6461+
direction@^1.0.4:
64676462
version "1.0.4"
64686463
resolved "https://registry.yarnpkg.com/direction/-/direction-1.0.4.tgz#2b86fb686967e987088caf8b89059370d4837442"
64696464
integrity sha512-GYqKi1aH7PJXxdhTeZBFrg8vUBeKXi+cNprXsC1kpJcbcVnV9wBsrOu1cQEdG0WeQwlfHiy3XvnKfIrJ2R0NzQ==
@@ -8826,7 +8821,12 @@ image-size@^1.0.2:
88268821
dependencies:
88278822
queue "6.0.2"
88288823

8829-
[email protected], immer@^9.0.6, immer@^9.0.7:
8824+
immer@^10.0.3:
8825+
version "10.1.1"
8826+
resolved "https://registry.yarnpkg.com/immer/-/immer-10.1.1.tgz#206f344ea372d8ea176891545ee53ccc062db7bc"
8827+
integrity sha512-s2MPrmjovJcoMaHtx6K11Ra7oD05NT97w1IC5zpMkT6Atjr7H8LjaDd81iIxUYpMKSRRNMJE703M1Fhr/TctHw==
8828+
8829+
immer@^9.0.7:
88308830
version "9.0.19"
88318831
resolved "https://registry.yarnpkg.com/immer/-/immer-9.0.19.tgz#67fb97310555690b5f9cd8380d38fc0aabb6b38b"
88328832
integrity sha512-eY+Y0qcsB4TZKwgQzLaE/lqYMlKhv5J9dyd2RhhtGhNo2njPXDqU9XPfcNfa3MIDsdtZt5KlkIsirlo4dHsWdQ==
@@ -9153,10 +9153,10 @@ is-hexadecimal@^2.0.0:
91539153
resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz#86b5bf668fca307498d319dfc03289d781a90027"
91549154
integrity sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==
91559155

9156-
is-hotkey@^0.1.6:
9157-
version "0.1.8"
9158-
resolved "https://registry.yarnpkg.com/is-hotkey/-/is-hotkey-0.1.8.tgz#6b1f4b2d0e5639934e20c05ed24d623a21d36d25"
9159-
integrity sha512-qs3NZ1INIS+H+yeo7cD9pDfwYV/jqRh1JG9S9zYrNudkoUQg7OL7ziXqRKu+InFjUIDoP2o6HIkLYMh1pcWgyQ==
9156+
is-hotkey@^0.2.0:
9157+
version "0.2.0"
9158+
resolved "https://registry.yarnpkg.com/is-hotkey/-/is-hotkey-0.2.0.tgz#1835a68171a91e5c9460869d96336947c8340cef"
9159+
integrity sha512-UknnZK4RakDmTgz4PI1wIph5yxSs/mvChWs9ifnlXsKuXgWmOkY/hAE0H/k2MIqH0RlRye0i1oC07MCRSD28Mw==
91609160

91619161
is-installed-globally@^0.4.0:
91629162
version "0.4.0"
@@ -9982,7 +9982,7 @@ lodash.uniq@^4.5.0:
99829982
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
99839983
integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==
99849984

9985-
lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4:
9985+
lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21:
99869986
version "4.17.21"
99879987
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
99889988
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
@@ -13623,12 +13623,12 @@ schema-utils@^4.0.0, schema-utils@^4.0.1, schema-utils@^4.2.0, schema-utils@^4.3
1362313623
ajv-formats "^2.1.1"
1362413624
ajv-keywords "^5.1.0"
1362513625

13626-
scroll-into-view-if-needed@^2.2.20:
13627-
version "2.2.31"
13628-
resolved "https://registry.yarnpkg.com/scroll-into-view-if-needed/-/scroll-into-view-if-needed-2.2.31.tgz#d3c482959dc483e37962d1521254e3295d0d1587"
13629-
integrity sha512-dGCXy99wZQivjmjIqihaBQNjryrz5rueJY7eHfTdyWEiR4ttYpsajb14rn9s5d4DY4EcY6+4+U/maARBXJedkA==
13626+
scroll-into-view-if-needed@^3.1.0:
13627+
version "3.1.0"
13628+
resolved "https://registry.yarnpkg.com/scroll-into-view-if-needed/-/scroll-into-view-if-needed-3.1.0.tgz#fa9524518c799b45a2ef6bbffb92bcad0296d01f"
13629+
integrity sha512-49oNpRjWRvnU8NyGVmUaYG4jtTkNonFZI86MmGRDqBphEK2EXT9gdEUoQPZhuBM8yWHxCWbobltqYO5M4XrUvQ==
1363013630
dependencies:
13631-
compute-scroll-into-view "^1.0.20"
13631+
compute-scroll-into-view "^3.0.2"
1363213632

1363313633
section-matter@^1.0.0:
1363413634
version "1.0.0"
@@ -13974,33 +13974,45 @@ slash@^4.0.0:
1397413974
resolved "https://registry.yarnpkg.com/slash/-/slash-4.0.0.tgz#2422372176c4c6c5addb5e2ada885af984b396a7"
1397513975
integrity sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==
1397613976

13977-
slate-history@^0.86.0:
13978-
version "0.86.0"
13979-
resolved "https://registry.yarnpkg.com/slate-history/-/slate-history-0.86.0.tgz#5554612271d2fc1018a7918be3961bb66e620c58"
13980-
integrity sha512-OxObL9tbhgwvSlnKSCpGIh7wnuaqvOj5jRExGjEyCU2Ke8ctf22HjT+jw7GEi9ttLzNTUmTEU3YIzqKGeqN+og==
13977+
slate-dom@^0.112.2:
13978+
version "0.112.2"
13979+
resolved "https://registry.yarnpkg.com/slate-dom/-/slate-dom-0.112.2.tgz#216d89c39cb6fbb296b31c1ca03a931c451d5f57"
13980+
integrity sha512-cozITMlpcBxrov854reM6+TooiHiqpfM/nZPrnjpN1wSiDsAQmYbWUyftC+jlwcpFj80vywfDHzlG6hXIc5h6A==
1398113981
dependencies:
13982+
"@juggle/resize-observer" "^3.4.0"
13983+
direction "^1.0.4"
13984+
is-hotkey "^0.2.0"
1398213985
is-plain-object "^5.0.0"
13986+
lodash "^4.17.21"
13987+
scroll-into-view-if-needed "^3.1.0"
13988+
tiny-invariant "1.3.1"
1398313989

13984-
slate-react@^0.88.0:
13985-
version "0.88.2"
13986-
resolved "https://registry.yarnpkg.com/slate-react/-/slate-react-0.88.2.tgz#e072d54980876ec11ca057703a0e386dd290c03e"
13987-
integrity sha512-r06i+b7c1deP9PH69D3kJLStB2cbwryCVUGC++3phG7G3Ie+qEeJ5AZqogdxtsXd2vZaVGYKEjSASd3bTnj3tw==
13990+
slate-history@^0.110.3:
13991+
version "0.110.3"
13992+
resolved "https://registry.yarnpkg.com/slate-history/-/slate-history-0.110.3.tgz#aff849376ac637cc27bcc6b437c80004f432ec8c"
13993+
integrity sha512-sgdff4Usdflmw5ZUbhDkxFwCBQ2qlDKMMkF93w66KdV48vHOgN2BmLrf+2H8SdX8PYIpP/cTB0w8qWC2GwhDVA==
1398813994
dependencies:
13989-
"@types/is-hotkey" "^0.1.1"
13990-
"@types/lodash" "^4.14.149"
13991-
direction "^1.0.3"
13992-
is-hotkey "^0.1.6"
1399313995
is-plain-object "^5.0.0"
13994-
lodash "^4.17.4"
13995-
scroll-into-view-if-needed "^2.2.20"
13996-
tiny-invariant "1.0.6"
1399713996

13998-
slate@^0.87.0:
13999-
version "0.87.0"
14000-
resolved "https://registry.yarnpkg.com/slate/-/slate-0.87.0.tgz#ba68aef379918f7f6302d68fdacf561ab8e70178"
14001-
integrity sha512-m+IWERpdtb7Zna09MxHlUYIAoo4WVdxp2fSf7c+jSV9pDmJ4QvUTuHghX/TVrxtr+8BKGhyQCWIerZt32B1Ysg==
13997+
slate-react@^0.112.1:
13998+
version "0.112.1"
13999+
resolved "https://registry.yarnpkg.com/slate-react/-/slate-react-0.112.1.tgz#9d651d2132b86828fa8b55db0d58d2907e022414"
14000+
integrity sha512-V9b+waxPweXqAkSQmKQ1afG4Me6nVQACPpxQtHPIX02N7MXa5f5WilYv+bKt7vKKw+IZC2F0Gjzhv5BekVgP/A==
1400214001
dependencies:
14003-
immer "^9.0.6"
14002+
"@juggle/resize-observer" "^3.4.0"
14003+
direction "^1.0.4"
14004+
is-hotkey "^0.2.0"
14005+
is-plain-object "^5.0.0"
14006+
lodash "^4.17.21"
14007+
scroll-into-view-if-needed "^3.1.0"
14008+
tiny-invariant "1.3.1"
14009+
14010+
slate@^0.112.0:
14011+
version "0.112.0"
14012+
resolved "https://registry.yarnpkg.com/slate/-/slate-0.112.0.tgz#674092eccd89951201bc859e0eeb1216d2a0b752"
14013+
integrity sha512-PRnfFgDA3tSop4OH47zu4M1R4Uuhm/AmASu29Qp7sGghVFb713kPBKEnSf1op7Lx/nCHkRlCa3ThfHtCBy+5Yw==
14014+
dependencies:
14015+
immer "^10.0.3"
1400414016
is-plain-object "^5.0.0"
1400514017
tiny-warning "^1.0.3"
1400614018

@@ -14710,10 +14722,10 @@ thunky@^1.0.2:
1471014722
resolved "https://registry.yarnpkg.com/thunky/-/thunky-1.1.0.tgz#5abaf714a9405db0504732bbccd2cedd9ef9537d"
1471114723
integrity sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==
1471214724

14713-
tiny-invariant@1.0.6:
14714-
version "1.0.6"
14715-
resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.0.6.tgz#b3f9b38835e36a41c843a3b0907a5a7b3755de73"
14716-
integrity sha512-FOyLWWVjG+aC0UqG76V53yAWdXfH8bO6FNmyZOuUrzDzK8DI3/JRY25UD7+g49JWM1LXwymsKERB+DzI0dTEQA==
14725+
tiny-invariant@1.3.1:
14726+
version "1.3.1"
14727+
resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.3.1.tgz#8560808c916ef02ecfd55e66090df23a4b7aa642"
14728+
integrity sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==
1471714729

1471814730
tiny-invariant@^1.0.2, tiny-invariant@^1.3.1:
1471914731
version "1.3.3"

0 commit comments

Comments
 (0)