feat: undo-redo & edit snapshots (#2436)

* feat: undo-redo & edit snapshots

* fix merge

* add simple history back

* fix some undo

* change app latest version

* fix

* chatconfig

* fix snapshot

* fix

* fix

* fix

* fix compare

* fix initial

* fix merge:

* fix useEffect

* fix snapshot initial and saved state

* chore

* fix

* compare snapshot

* nodes edges useEffct

* fix chatconfig

* fix

* delete unused method

* fix

* fix

* fix

* default version name
This commit is contained in:
heheer
2024-08-23 15:58:43 +08:00
committed by GitHub
parent de573e4303
commit 6288dc9492
49 changed files with 1559 additions and 349 deletions

View File

@@ -0,0 +1,3 @@
<svg viewBox="0 0 14 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path id="Polygon 8 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M4.24277 12.4952L10.0403 9.23726C10.9183 8.74387 11.4621 8.43615 11.8323 8.18154C11.9539 8.09794 12.0294 8.03772 12.0732 7.99999C12.0294 7.96226 11.9539 7.90203 11.8323 7.81844C11.4621 7.56383 10.9183 7.25611 10.0403 6.76272L4.24277 3.50479C3.36511 3.01159 2.81898 2.70681 2.40643 2.52163C2.23511 2.44473 2.1322 2.41044 2.08127 2.3957C2.05236 2.40455 2.02714 2.41733 2.00603 2.43216C1.9951 2.48511 1.98005 2.5748 1.96697 2.71367C1.92612 3.14704 1.9241 3.7532 1.9241 4.74206L1.9241 11.2579C1.9241 12.2468 1.92612 12.8529 1.96697 13.2863C1.98006 13.4252 1.99511 13.5149 2.00603 13.5678C2.02714 13.5826 2.05235 13.5954 2.08127 13.6043C2.1322 13.5895 2.23511 13.5553 2.40643 13.4784C2.81898 13.2932 3.36511 12.9884 4.24277 12.4952ZM13.7929 7.14993C13.5091 6.52957 12.6635 6.05439 10.9724 5.10405L5.17486 1.84612C3.48371 0.895784 2.63813 0.420614 1.94427 0.491596C1.33906 0.55351 0.789265 0.862468 0.431571 1.34166C0.0214848 1.89104 0.0214847 2.84138 0.0214847 4.74206L0.0214844 11.2579C0.0214843 13.1586 0.0214843 14.1089 0.43157 14.6583C0.789264 15.1375 1.33906 15.4465 1.94427 15.5084C2.63813 15.5794 3.48371 15.1042 5.17486 14.1539L10.9724 10.8959C12.6635 9.94558 13.5091 9.47042 13.7929 8.85005C14.0404 8.30895 14.0404 7.69103 13.7929 7.14993Z" fill="#3370FF"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,3 @@
<svg viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.14996 9C3.14996 8.58579 3.48575 8.25 3.89996 8.25H14.1C14.5142 8.25 14.85 8.58579 14.85 9C14.85 9.41421 14.5142 9.75 14.1 9.75H3.89996C3.48575 9.75 3.14996 9.41421 3.14996 9Z" fill="#485264"/>
</svg>

After

Width:  |  Height:  |  Size: 325 B

View File

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.7733 1.94544C9.14771 1.73464 9.57012 1.6239 9.99979 1.6239C10.4295 1.6239 10.8519 1.73464 11.2263 1.94544C11.6007 2.15623 11.9145 2.45996 12.1373 2.82733L12.1397 2.83129L19.198 14.6146L19.2048 14.6261C19.4231 15.0042 19.5386 15.4328 19.5398 15.8693C19.541 16.3058 19.4279 16.7351 19.2118 17.1143C18.9956 17.4935 18.6839 17.8096 18.3076 18.031C17.9314 18.2523 17.5038 18.3713 17.0673 18.3761L17.0581 18.3762L2.9323 18.3762C2.4958 18.3714 2.06816 18.2523 1.69194 18.031C1.31571 17.8096 1.004 17.4935 0.787835 17.1143C0.571665 16.7351 0.458565 16.3058 0.459788 15.8693C0.46101 15.4328 0.576512 15.0042 0.794801 14.6261L0.801571 14.6146L7.86228 2.82732C8.08512 2.45996 8.39889 2.15623 8.7733 1.94544ZM9.99979 3.29057C9.85657 3.29057 9.71576 3.32748 9.59096 3.39775C9.46672 3.46769 9.36252 3.56834 9.2883 3.69005L2.23537 15.4644C2.16438 15.5892 2.12685 15.7303 2.12645 15.874C2.12604 16.0195 2.16374 16.1625 2.2358 16.289C2.30785 16.4154 2.41176 16.5207 2.53716 16.5945C2.66148 16.6677 2.80262 16.7073 2.94679 16.7095H17.0528C17.197 16.7073 17.3381 16.6677 17.4624 16.5945C17.5878 16.5207 17.6917 16.4154 17.7638 16.289C17.8358 16.1625 17.8735 16.0195 17.8731 15.874C17.8727 15.7303 17.8352 15.5892 17.7642 15.4644L10.7123 3.69171C10.712 3.69116 10.7116 3.69061 10.7113 3.69005C10.6371 3.56834 10.5329 3.46769 10.4086 3.39775C10.2838 3.32748 10.143 3.29057 9.99979 3.29057ZM9.99979 6.70952C10.46 6.70952 10.8331 7.08262 10.8331 7.54285V10.8762C10.8331 11.3364 10.46 11.7095 9.99979 11.7095C9.53956 11.7095 9.16646 11.3364 9.16646 10.8762V7.54285C9.16646 7.08262 9.53956 6.70952 9.99979 6.70952ZM9.16646 14.2095C9.16646 13.7493 9.53956 13.3762 9.99979 13.3762H10.0081C10.4684 13.3762 10.8415 13.7493 10.8415 14.2095C10.8415 14.6698 10.4684 15.0429 10.0081 15.0429H9.99979C9.53956 15.0429 9.16646 14.6698 9.16646 14.2095Z" fill="#F79009"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB