|
@@ -1,3 +1,4 @@
|
|
1
|
+/* eslint-disable @typescript-eslint/ban-ts-comment */
|
1
|
2
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
2
|
3
|
import { StateManager } from 'rko'
|
3
|
4
|
import { Vec } from '@tldraw/vec'
|
|
@@ -99,6 +100,15 @@ export class TLDrawState extends StateManager<Data> {
|
99
|
100
|
onUserChange?: (tlstate: TLDrawState, user: TLDrawUser) => void
|
100
|
101
|
) {
|
101
|
102
|
super(TLDrawState.defaultState, id, TLDrawState.version, (prev, next) => {
|
|
103
|
+ Object.values(prev.document.pages).forEach((page) => {
|
|
104
|
+ Object.values(page.bindings).forEach((binding) => {
|
|
105
|
+ if ('meta' in binding) {
|
|
106
|
+ // @ts-ignore
|
|
107
|
+ Object.assign(binding, binding.meta)
|
|
108
|
+ }
|
|
109
|
+ })
|
|
110
|
+ })
|
|
111
|
+
|
102
|
112
|
return {
|
103
|
113
|
...next,
|
104
|
114
|
document: { ...next.document, ...prev.document },
|
|
@@ -2446,7 +2456,7 @@ export class TLDrawState extends StateManager<Data> {
|
2446
|
2456
|
}
|
2447
|
2457
|
}
|
2448
|
2458
|
|
2449
|
|
- static version = 10.5
|
|
2459
|
+ static version = 11
|
2450
|
2460
|
|
2451
|
2461
|
static defaultDocument: TLDrawDocument = {
|
2452
|
2462
|
id: 'doc',
|