@lionweb/class-core 0.7.0-beta.9 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -1
- package/README.md +6 -6
- package/dist/LionCore_builtins.g.d.ts +2 -2
- package/dist/LionCore_builtins.g.d.ts.map +1 -1
- package/dist/LionCore_builtins.g.js +1 -1
- package/dist/LionCore_builtins.g.js.map +1 -1
- package/dist/base-types.d.ts +7 -11
- package/dist/base-types.d.ts.map +1 -1
- package/dist/base-types.js +3 -28
- package/dist/base-types.js.map +1 -1
- package/dist/convenience.d.ts +10 -9
- package/dist/convenience.d.ts.map +1 -1
- package/dist/convenience.js +12 -11
- package/dist/convenience.js.map +1 -1
- package/dist/deltas/appliers.d.ts +5 -4
- package/dist/deltas/appliers.d.ts.map +1 -1
- package/dist/deltas/appliers.js +369 -163
- package/dist/deltas/appliers.js.map +1 -1
- package/dist/deltas/compositor.d.ts +51 -0
- package/dist/deltas/compositor.d.ts.map +1 -0
- package/dist/deltas/compositor.js +95 -0
- package/dist/deltas/compositor.js.map +1 -0
- package/dist/deltas/index.d.ts +2 -1
- package/dist/deltas/index.d.ts.map +1 -1
- package/dist/deltas/index.js +2 -1
- package/dist/deltas/index.js.map +1 -1
- package/dist/deltas/inverters.d.ts.map +1 -1
- package/dist/deltas/inverters.js +91 -28
- package/dist/deltas/inverters.js.map +1 -1
- package/dist/deltas/receivers.d.ts +39 -0
- package/dist/deltas/receivers.d.ts.map +1 -0
- package/dist/deltas/receivers.js +60 -0
- package/dist/deltas/receivers.js.map +1 -0
- package/dist/deltas/serialization/deserializer.g.d.ts.map +1 -1
- package/dist/deltas/serialization/deserializer.g.js +167 -59
- package/dist/deltas/serialization/deserializer.g.js.map +1 -1
- package/dist/deltas/serialization/serializer-helpers.d.ts +1 -1
- package/dist/deltas/serialization/serializer-helpers.d.ts.map +1 -1
- package/dist/deltas/serialization/serializer-helpers.js +3 -4
- package/dist/deltas/serialization/serializer-helpers.js.map +1 -1
- package/dist/deltas/serialization/serializer.g.d.ts +2 -2
- package/dist/deltas/serialization/serializer.g.d.ts.map +1 -1
- package/dist/deltas/serialization/serializer.g.js +186 -47
- package/dist/deltas/serialization/serializer.g.js.map +1 -1
- package/dist/deltas/serialization/types.g.d.ts +156 -43
- package/dist/deltas/serialization/types.g.d.ts.map +1 -1
- package/dist/deltas/types.g.d.ts +155 -55
- package/dist/deltas/types.g.d.ts.map +1 -1
- package/dist/deltas/types.g.js +170 -57
- package/dist/deltas/types.g.js.map +1 -1
- package/dist/deserializer.d.ts +6 -6
- package/dist/deserializer.d.ts.map +1 -1
- package/dist/deserializer.js +16 -27
- package/dist/deserializer.js.map +1 -1
- package/dist/duplicator.d.ts.map +1 -1
- package/dist/duplicator.js.map +1 -1
- package/dist/factory.d.ts +10 -2
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +25 -16
- package/dist/factory.js.map +1 -1
- package/dist/id-mapping.d.ts +31 -3
- package/dist/id-mapping.d.ts.map +1 -1
- package/dist/id-mapping.js +46 -14
- package/dist/id-mapping.js.map +1 -1
- package/dist/serializer.d.ts.map +1 -1
- package/dist/textualizer.d.ts +1 -1
- package/dist/textualizer.d.ts.map +1 -1
- package/dist/textualizer.js +1 -1
- package/dist/textualizer.js.map +1 -1
- package/dist/value-managers/annotations.d.ts +5 -0
- package/dist/value-managers/annotations.d.ts.map +1 -1
- package/dist/value-managers/annotations.js +31 -3
- package/dist/value-managers/annotations.js.map +1 -1
- package/dist/value-managers/base.d.ts +2 -2
- package/dist/value-managers/base.d.ts.map +1 -1
- package/dist/value-managers/base.js +4 -4
- package/dist/value-managers/base.js.map +1 -1
- package/dist/value-managers/containments.d.ts +4 -1
- package/dist/value-managers/containments.d.ts.map +1 -1
- package/dist/value-managers/containments.js +151 -20
- package/dist/value-managers/containments.js.map +1 -1
- package/dist/value-managers/properties.d.ts.map +1 -1
- package/dist/value-managers/properties.js +1 -0
- package/dist/value-managers/properties.js.map +1 -1
- package/dist/value-managers/references.d.ts +3 -0
- package/dist/value-managers/references.d.ts.map +1 -1
- package/dist/value-managers/references.js +26 -8
- package/dist/value-managers/references.js.map +1 -1
- package/package.json +34 -37
- package/src/LionCore_builtins.g.ts +2 -2
- package/src/base-types.ts +6 -32
- package/src/convenience.ts +15 -14
- package/src/deltas/appliers.ts +377 -177
- package/src/deltas/compositor.ts +107 -0
- package/src/deltas/index.ts +3 -1
- package/src/deltas/inverters.ts +108 -36
- package/src/deltas/receivers.ts +92 -0
- package/src/deltas/serialization/deserializer.g.ts +185 -64
- package/src/deltas/serialization/serializer-helpers.ts +3 -10
- package/src/deltas/serialization/serializer.g.ts +242 -63
- package/src/deltas/serialization/types.g.ts +190 -51
- package/src/deltas/types.g.ts +190 -51
- package/src/deserializer.ts +32 -43
- package/src/duplicator.ts +1 -1
- package/src/factory.ts +31 -17
- package/src/id-mapping.ts +43 -5
- package/src/textualizer.ts +1 -1
- package/src/value-managers/annotations.ts +28 -2
- package/src/value-managers/base.ts +4 -4
- package/src/value-managers/containments.ts +144 -20
- package/src/value-managers/properties.ts +1 -0
- package/src/value-managers/references.ts +28 -8
- package/dist/deltas/handlers.d.ts +0 -17
- package/dist/deltas/handlers.d.ts.map +0 -1
- package/dist/deltas/handlers.js +0 -43
- package/dist/deltas/handlers.js.map +0 -1
- package/src/deltas/handlers.ts +0 -64
|
@@ -23,49 +23,69 @@ import { LionWebId, LionWebJsonMetaPointer, LionWebJsonChunk } from "@lionweb/js
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
export type SerializedDelta =
|
|
26
|
-
|
|
|
26
|
+
| PartitionAddedSerializedDelta
|
|
27
|
+
| PartitionDeletedSerializedDelta
|
|
27
28
|
| PropertyAddedSerializedDelta
|
|
28
29
|
| PropertyDeletedSerializedDelta
|
|
29
30
|
| PropertyChangedSerializedDelta
|
|
30
31
|
| ChildAddedSerializedDelta
|
|
31
32
|
| ChildDeletedSerializedDelta
|
|
32
33
|
| ChildReplacedSerializedDelta
|
|
33
|
-
|
|
|
34
|
+
| ChildMovedFromOtherContainmentSerializedDelta
|
|
35
|
+
| ChildMovedFromOtherContainmentInSameParentSerializedDelta
|
|
34
36
|
| ChildMovedInSameContainmentSerializedDelta
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
| ReferenceMovedSerializedDelta
|
|
39
|
-
| ReferenceMovedInSameReferenceSerializedDelta
|
|
37
|
+
| ChildMovedAndReplacedFromOtherContainmentSerializedDelta
|
|
38
|
+
| ChildMovedAndReplacedFromOtherContainmentInSameParentSerializedDelta
|
|
39
|
+
| ChildMovedAndReplacedInSameContainmentSerializedDelta
|
|
40
40
|
| AnnotationAddedSerializedDelta
|
|
41
41
|
| AnnotationDeletedSerializedDelta
|
|
42
42
|
| AnnotationReplacedSerializedDelta
|
|
43
43
|
| AnnotationMovedFromOtherParentSerializedDelta
|
|
44
44
|
| AnnotationMovedInSameParentSerializedDelta
|
|
45
|
+
| AnnotationMovedAndReplacedFromOtherParentSerializedDelta
|
|
46
|
+
| AnnotationMovedAndReplacedInSameParentSerializedDelta
|
|
47
|
+
| ReferenceAddedSerializedDelta
|
|
48
|
+
| ReferenceDeletedSerializedDelta
|
|
49
|
+
| ReferenceChangedSerializedDelta
|
|
50
|
+
| EntryMovedFromOtherReferenceSerializedDelta
|
|
51
|
+
| EntryMovedFromOtherReferenceInSameParentSerializedDelta
|
|
52
|
+
| EntryMovedInSameReferenceSerializedDelta
|
|
53
|
+
| EntryMovedAndReplacedFromOtherReferenceSerializedDelta
|
|
54
|
+
| EntryMovedAndReplacedFromOtherReferenceInSameParentSerializedDelta
|
|
55
|
+
| EntryMovedAndReplacedInSameReferenceSerializedDelta
|
|
56
|
+
| CompositeSerializedDelta
|
|
57
|
+
| NoOpSerializedDelta
|
|
45
58
|
;
|
|
46
59
|
|
|
47
60
|
|
|
48
|
-
export type
|
|
49
|
-
kind: "
|
|
61
|
+
export type PartitionAddedSerializedDelta = {
|
|
62
|
+
kind: "PartitionAdded"
|
|
63
|
+
newPartition: LionWebId
|
|
64
|
+
newNodes: LionWebJsonChunk
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export type PartitionDeletedSerializedDelta = {
|
|
68
|
+
kind: "PartitionDeleted"
|
|
69
|
+
deletedPartition: LionWebId
|
|
50
70
|
}
|
|
51
71
|
|
|
52
72
|
export type PropertyAddedSerializedDelta = {
|
|
53
73
|
kind: "PropertyAdded"
|
|
54
|
-
|
|
74
|
+
node: LionWebId
|
|
55
75
|
property: LionWebJsonMetaPointer
|
|
56
76
|
value: string
|
|
57
77
|
}
|
|
58
78
|
|
|
59
79
|
export type PropertyDeletedSerializedDelta = {
|
|
60
80
|
kind: "PropertyDeleted"
|
|
61
|
-
|
|
81
|
+
node: LionWebId
|
|
62
82
|
property: LionWebJsonMetaPointer
|
|
63
83
|
oldValue: string
|
|
64
84
|
}
|
|
65
85
|
|
|
66
86
|
export type PropertyChangedSerializedDelta = {
|
|
67
87
|
kind: "PropertyChanged"
|
|
68
|
-
|
|
88
|
+
node: LionWebId
|
|
69
89
|
property: LionWebJsonMetaPointer
|
|
70
90
|
oldValue: string
|
|
71
91
|
newValue: string
|
|
@@ -100,15 +120,25 @@ export type ChildReplacedSerializedDelta = {
|
|
|
100
120
|
newNodes: LionWebJsonChunk
|
|
101
121
|
}
|
|
102
122
|
|
|
103
|
-
export type
|
|
104
|
-
kind: "
|
|
123
|
+
export type ChildMovedFromOtherContainmentSerializedDelta = {
|
|
124
|
+
kind: "ChildMovedFromOtherContainment"
|
|
105
125
|
oldParent: LionWebId
|
|
106
126
|
oldContainment: LionWebJsonMetaPointer
|
|
107
127
|
oldIndex: number
|
|
108
128
|
newParent: LionWebId
|
|
109
129
|
newContainment: LionWebJsonMetaPointer
|
|
110
130
|
newIndex: number
|
|
111
|
-
|
|
131
|
+
movedChild: LionWebId
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export type ChildMovedFromOtherContainmentInSameParentSerializedDelta = {
|
|
135
|
+
kind: "ChildMovedFromOtherContainmentInSameParent"
|
|
136
|
+
parent: LionWebId
|
|
137
|
+
oldContainment: LionWebJsonMetaPointer
|
|
138
|
+
oldIndex: number
|
|
139
|
+
movedChild: LionWebId
|
|
140
|
+
newContainment: LionWebJsonMetaPointer
|
|
141
|
+
newIndex: number
|
|
112
142
|
}
|
|
113
143
|
|
|
114
144
|
export type ChildMovedInSameContainmentSerializedDelta = {
|
|
@@ -117,52 +147,43 @@ export type ChildMovedInSameContainmentSerializedDelta = {
|
|
|
117
147
|
containment: LionWebJsonMetaPointer
|
|
118
148
|
oldIndex: number
|
|
119
149
|
newIndex: number
|
|
120
|
-
|
|
150
|
+
movedChild: LionWebId
|
|
121
151
|
}
|
|
122
152
|
|
|
123
|
-
export type
|
|
124
|
-
kind: "
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
reference: LionWebJsonMetaPointer
|
|
135
|
-
index: number
|
|
136
|
-
deletedTarget: IdOrUnresolved
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export type ReferenceReplacedSerializedDelta = {
|
|
140
|
-
kind: "ReferenceReplaced"
|
|
141
|
-
container: LionWebId
|
|
142
|
-
reference: LionWebJsonMetaPointer
|
|
143
|
-
index: number
|
|
144
|
-
replacedTarget: IdOrUnresolved
|
|
145
|
-
newTarget: IdOrUnresolved
|
|
153
|
+
export type ChildMovedAndReplacedFromOtherContainmentSerializedDelta = {
|
|
154
|
+
kind: "ChildMovedAndReplacedFromOtherContainment"
|
|
155
|
+
newParent: LionWebId
|
|
156
|
+
newContainment: LionWebJsonMetaPointer
|
|
157
|
+
newIndex: number
|
|
158
|
+
movedChild: LionWebId
|
|
159
|
+
oldParent: LionWebId
|
|
160
|
+
oldContainment: LionWebJsonMetaPointer
|
|
161
|
+
oldIndex: number
|
|
162
|
+
replacedChild: LionWebId
|
|
163
|
+
replacedChildAsNodes: LionWebJsonChunk
|
|
146
164
|
}
|
|
147
165
|
|
|
148
|
-
export type
|
|
149
|
-
kind: "
|
|
150
|
-
|
|
151
|
-
|
|
166
|
+
export type ChildMovedAndReplacedFromOtherContainmentInSameParentSerializedDelta = {
|
|
167
|
+
kind: "ChildMovedAndReplacedFromOtherContainmentInSameParent"
|
|
168
|
+
parent: LionWebId
|
|
169
|
+
oldContainment: LionWebJsonMetaPointer
|
|
152
170
|
oldIndex: number
|
|
153
|
-
|
|
154
|
-
newReference: LionWebJsonMetaPointer
|
|
171
|
+
newContainment: LionWebJsonMetaPointer
|
|
155
172
|
newIndex: number
|
|
156
|
-
|
|
173
|
+
movedChild: LionWebId
|
|
174
|
+
replacedChild: LionWebId
|
|
175
|
+
replacedChildAsNodes: LionWebJsonChunk
|
|
157
176
|
}
|
|
158
177
|
|
|
159
|
-
export type
|
|
160
|
-
kind: "
|
|
161
|
-
|
|
162
|
-
|
|
178
|
+
export type ChildMovedAndReplacedInSameContainmentSerializedDelta = {
|
|
179
|
+
kind: "ChildMovedAndReplacedInSameContainment"
|
|
180
|
+
parent: LionWebId
|
|
181
|
+
containment: LionWebJsonMetaPointer
|
|
163
182
|
oldIndex: number
|
|
164
183
|
newIndex: number
|
|
165
|
-
|
|
184
|
+
movedChild: LionWebId
|
|
185
|
+
replacedChild: LionWebId
|
|
186
|
+
replacedChildAsNodes: LionWebJsonChunk
|
|
166
187
|
}
|
|
167
188
|
|
|
168
189
|
export type AnnotationAddedSerializedDelta = {
|
|
@@ -208,3 +229,121 @@ export type AnnotationMovedInSameParentSerializedDelta = {
|
|
|
208
229
|
movedAnnotation: LionWebId
|
|
209
230
|
}
|
|
210
231
|
|
|
232
|
+
export type AnnotationMovedAndReplacedFromOtherParentSerializedDelta = {
|
|
233
|
+
kind: "AnnotationMovedAndReplacedFromOtherParent"
|
|
234
|
+
oldParent: LionWebId
|
|
235
|
+
oldIndex: number
|
|
236
|
+
replacedAnnotation: LionWebId
|
|
237
|
+
replacedAnnotationNodes: LionWebJsonChunk
|
|
238
|
+
newParent: LionWebId
|
|
239
|
+
newIndex: number
|
|
240
|
+
movedAnnotation: LionWebId
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export type AnnotationMovedAndReplacedInSameParentSerializedDelta = {
|
|
244
|
+
kind: "AnnotationMovedAndReplacedInSameParent"
|
|
245
|
+
parent: LionWebId
|
|
246
|
+
oldIndex: number
|
|
247
|
+
newIndex: number
|
|
248
|
+
replacedAnnotation: LionWebId
|
|
249
|
+
replacedAnnotationNodes: LionWebJsonChunk
|
|
250
|
+
movedAnnotation: LionWebId
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export type ReferenceAddedSerializedDelta = {
|
|
254
|
+
kind: "ReferenceAdded"
|
|
255
|
+
parent: LionWebId
|
|
256
|
+
reference: LionWebJsonMetaPointer
|
|
257
|
+
index: number
|
|
258
|
+
newTarget: IdOrUnresolved
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export type ReferenceDeletedSerializedDelta = {
|
|
262
|
+
kind: "ReferenceDeleted"
|
|
263
|
+
parent: LionWebId
|
|
264
|
+
reference: LionWebJsonMetaPointer
|
|
265
|
+
index: number
|
|
266
|
+
deletedTarget: IdOrUnresolved
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export type ReferenceChangedSerializedDelta = {
|
|
270
|
+
kind: "ReferenceChanged"
|
|
271
|
+
parent: LionWebId
|
|
272
|
+
reference: LionWebJsonMetaPointer
|
|
273
|
+
index: number
|
|
274
|
+
newTarget: IdOrUnresolved
|
|
275
|
+
oldTarget: IdOrUnresolved
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export type EntryMovedFromOtherReferenceSerializedDelta = {
|
|
279
|
+
kind: "EntryMovedFromOtherReference"
|
|
280
|
+
oldParent: LionWebId
|
|
281
|
+
oldReference: LionWebJsonMetaPointer
|
|
282
|
+
oldIndex: number
|
|
283
|
+
newParent: LionWebId
|
|
284
|
+
newReference: LionWebJsonMetaPointer
|
|
285
|
+
newIndex: number
|
|
286
|
+
movedTarget: IdOrUnresolved
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export type EntryMovedFromOtherReferenceInSameParentSerializedDelta = {
|
|
290
|
+
kind: "EntryMovedFromOtherReferenceInSameParent"
|
|
291
|
+
parent: LionWebId
|
|
292
|
+
oldReference: LionWebJsonMetaPointer
|
|
293
|
+
oldIndex: number
|
|
294
|
+
newReference: LionWebJsonMetaPointer
|
|
295
|
+
newIndex: number
|
|
296
|
+
movedTarget: IdOrUnresolved
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export type EntryMovedInSameReferenceSerializedDelta = {
|
|
300
|
+
kind: "EntryMovedInSameReference"
|
|
301
|
+
parent: LionWebId
|
|
302
|
+
reference: LionWebJsonMetaPointer
|
|
303
|
+
oldIndex: number
|
|
304
|
+
newIndex: number
|
|
305
|
+
movedTarget: IdOrUnresolved
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export type EntryMovedAndReplacedFromOtherReferenceSerializedDelta = {
|
|
309
|
+
kind: "EntryMovedAndReplacedFromOtherReference"
|
|
310
|
+
newParent: LionWebId
|
|
311
|
+
newReference: LionWebJsonMetaPointer
|
|
312
|
+
newIndex: number
|
|
313
|
+
movedTarget: IdOrUnresolved
|
|
314
|
+
oldParent: LionWebId
|
|
315
|
+
oldReference: LionWebJsonMetaPointer
|
|
316
|
+
oldIndex: number
|
|
317
|
+
replacedTarget: IdOrUnresolved
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export type EntryMovedAndReplacedFromOtherReferenceInSameParentSerializedDelta = {
|
|
321
|
+
kind: "EntryMovedAndReplacedFromOtherReferenceInSameParent"
|
|
322
|
+
parent: LionWebId
|
|
323
|
+
oldReference: LionWebJsonMetaPointer
|
|
324
|
+
oldIndex: number
|
|
325
|
+
newReference: LionWebJsonMetaPointer
|
|
326
|
+
newIndex: number
|
|
327
|
+
movedTarget: IdOrUnresolved
|
|
328
|
+
replacedTarget: IdOrUnresolved
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
export type EntryMovedAndReplacedInSameReferenceSerializedDelta = {
|
|
332
|
+
kind: "EntryMovedAndReplacedInSameReference"
|
|
333
|
+
parent: LionWebId
|
|
334
|
+
reference: LionWebJsonMetaPointer
|
|
335
|
+
oldIndex: number
|
|
336
|
+
newIndex: number
|
|
337
|
+
movedTarget: IdOrUnresolved
|
|
338
|
+
replacedTarget: IdOrUnresolved
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export type CompositeSerializedDelta = {
|
|
342
|
+
kind: "Composite"
|
|
343
|
+
parts: SerializedDelta[]
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export type NoOpSerializedDelta = {
|
|
347
|
+
kind: "NoOp"
|
|
348
|
+
}
|
|
349
|
+
|
package/src/deltas/types.g.ts
CHANGED
|
@@ -29,16 +29,23 @@ import { INodeBase } from "../base-types.js";
|
|
|
29
29
|
import { IDelta } from "./base.js";
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
export class PartitionAddedDelta implements IDelta {
|
|
33
|
+
constructor(
|
|
34
|
+
public readonly newPartition: INodeBase
|
|
35
|
+
) {
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export class PartitionDeletedDelta implements IDelta {
|
|
40
|
+
constructor(
|
|
41
|
+
public readonly deletedPartition: INodeBase
|
|
42
|
+
) {
|
|
43
|
+
}
|
|
37
44
|
}
|
|
38
45
|
|
|
39
46
|
export class PropertyAddedDelta<T> implements IDelta {
|
|
40
47
|
constructor(
|
|
41
|
-
public readonly
|
|
48
|
+
public readonly node: INodeBase,
|
|
42
49
|
public readonly property: Property,
|
|
43
50
|
public readonly value: T
|
|
44
51
|
) {
|
|
@@ -47,7 +54,7 @@ export class PropertyAddedDelta<T> implements IDelta {
|
|
|
47
54
|
|
|
48
55
|
export class PropertyDeletedDelta<T> implements IDelta {
|
|
49
56
|
constructor(
|
|
50
|
-
public readonly
|
|
57
|
+
public readonly node: INodeBase,
|
|
51
58
|
public readonly property: Property,
|
|
52
59
|
public readonly oldValue: T
|
|
53
60
|
) {
|
|
@@ -56,7 +63,7 @@ export class PropertyDeletedDelta<T> implements IDelta {
|
|
|
56
63
|
|
|
57
64
|
export class PropertyChangedDelta<T> implements IDelta {
|
|
58
65
|
constructor(
|
|
59
|
-
public readonly
|
|
66
|
+
public readonly node: INodeBase,
|
|
60
67
|
public readonly property: Property,
|
|
61
68
|
public readonly oldValue: T,
|
|
62
69
|
public readonly newValue: T
|
|
@@ -95,7 +102,7 @@ export class ChildReplacedDelta implements IDelta {
|
|
|
95
102
|
}
|
|
96
103
|
}
|
|
97
104
|
|
|
98
|
-
export class
|
|
105
|
+
export class ChildMovedFromOtherContainmentDelta implements IDelta {
|
|
99
106
|
constructor(
|
|
100
107
|
public readonly oldParent: INodeBase,
|
|
101
108
|
public readonly oldContainment: Containment,
|
|
@@ -103,79 +110,69 @@ export class ChildMovedDelta implements IDelta {
|
|
|
103
110
|
public readonly newParent: INodeBase,
|
|
104
111
|
public readonly newContainment: Containment,
|
|
105
112
|
public readonly newIndex: number,
|
|
106
|
-
public readonly
|
|
113
|
+
public readonly movedChild: INodeBase
|
|
107
114
|
) {
|
|
108
115
|
}
|
|
109
116
|
}
|
|
110
117
|
|
|
111
|
-
export class
|
|
118
|
+
export class ChildMovedFromOtherContainmentInSameParentDelta implements IDelta {
|
|
112
119
|
constructor(
|
|
113
120
|
public readonly parent: INodeBase,
|
|
114
|
-
public readonly
|
|
121
|
+
public readonly oldContainment: Containment,
|
|
115
122
|
public readonly oldIndex: number,
|
|
116
|
-
public readonly
|
|
117
|
-
public readonly
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export class ReferenceAddedDelta implements IDelta {
|
|
123
|
-
constructor(
|
|
124
|
-
public readonly container: INodeBase,
|
|
125
|
-
public readonly reference: Reference,
|
|
126
|
-
public readonly index: number,
|
|
127
|
-
public readonly newTarget: SingleRef<INodeBase>
|
|
123
|
+
public readonly movedChild: INodeBase,
|
|
124
|
+
public readonly newContainment: Containment,
|
|
125
|
+
public readonly newIndex: number
|
|
128
126
|
) {
|
|
129
127
|
}
|
|
130
128
|
}
|
|
131
129
|
|
|
132
|
-
export class
|
|
130
|
+
export class ChildMovedInSameContainmentDelta implements IDelta {
|
|
133
131
|
constructor(
|
|
134
|
-
public readonly
|
|
135
|
-
public readonly
|
|
136
|
-
public readonly
|
|
137
|
-
public readonly
|
|
132
|
+
public readonly parent: INodeBase,
|
|
133
|
+
public readonly containment: Containment,
|
|
134
|
+
public readonly oldIndex: number,
|
|
135
|
+
public readonly newIndex: number,
|
|
136
|
+
public readonly movedChild: INodeBase
|
|
138
137
|
) {
|
|
139
138
|
}
|
|
140
139
|
}
|
|
141
140
|
|
|
142
|
-
|
|
143
|
-
* Note: corresponds to "reference changed" in delta proposal!
|
|
144
|
-
*/
|
|
145
|
-
export class ReferenceReplacedDelta implements IDelta {
|
|
141
|
+
export class ChildMovedAndReplacedFromOtherContainmentDelta implements IDelta {
|
|
146
142
|
constructor(
|
|
147
|
-
public readonly
|
|
148
|
-
public readonly
|
|
149
|
-
public readonly
|
|
150
|
-
public readonly
|
|
151
|
-
public readonly
|
|
143
|
+
public readonly newParent: INodeBase,
|
|
144
|
+
public readonly newContainment: Containment,
|
|
145
|
+
public readonly newIndex: number,
|
|
146
|
+
public readonly movedChild: INodeBase,
|
|
147
|
+
public readonly oldParent: INodeBase,
|
|
148
|
+
public readonly oldContainment: Containment,
|
|
149
|
+
public readonly oldIndex: number,
|
|
150
|
+
public readonly replacedChild: INodeBase
|
|
152
151
|
) {
|
|
153
152
|
}
|
|
154
153
|
}
|
|
155
154
|
|
|
156
|
-
|
|
157
|
-
* Note: corresponds to "entry moved from other reference" in delta proposal!
|
|
158
|
-
*/
|
|
159
|
-
export class ReferenceMovedDelta implements IDelta {
|
|
155
|
+
export class ChildMovedAndReplacedFromOtherContainmentInSameParentDelta implements IDelta {
|
|
160
156
|
constructor(
|
|
161
|
-
public readonly
|
|
162
|
-
public readonly
|
|
157
|
+
public readonly parent: INodeBase,
|
|
158
|
+
public readonly oldContainment: Containment,
|
|
163
159
|
public readonly oldIndex: number,
|
|
164
|
-
public readonly
|
|
165
|
-
public readonly newReference: Reference,
|
|
160
|
+
public readonly newContainment: Containment,
|
|
166
161
|
public readonly newIndex: number,
|
|
167
|
-
public readonly
|
|
162
|
+
public readonly movedChild: INodeBase,
|
|
163
|
+
public readonly replacedChild: INodeBase
|
|
168
164
|
) {
|
|
169
165
|
}
|
|
170
166
|
}
|
|
171
167
|
|
|
172
|
-
export class
|
|
168
|
+
export class ChildMovedAndReplacedInSameContainmentDelta implements IDelta {
|
|
173
169
|
constructor(
|
|
174
|
-
public readonly
|
|
175
|
-
public readonly
|
|
170
|
+
public readonly parent: INodeBase,
|
|
171
|
+
public readonly containment: Containment,
|
|
176
172
|
public readonly oldIndex: number,
|
|
177
173
|
public readonly newIndex: number,
|
|
178
|
-
public readonly
|
|
174
|
+
public readonly movedChild: INodeBase,
|
|
175
|
+
public readonly replacedChild: INodeBase
|
|
179
176
|
) {
|
|
180
177
|
}
|
|
181
178
|
}
|
|
@@ -229,3 +226,145 @@ export class AnnotationMovedInSameParentDelta implements IDelta {
|
|
|
229
226
|
}
|
|
230
227
|
}
|
|
231
228
|
|
|
229
|
+
export class AnnotationMovedAndReplacedFromOtherParentDelta implements IDelta {
|
|
230
|
+
constructor(
|
|
231
|
+
public readonly oldParent: INodeBase,
|
|
232
|
+
public readonly oldIndex: number,
|
|
233
|
+
public readonly replacedAnnotation: INodeBase,
|
|
234
|
+
public readonly newParent: INodeBase,
|
|
235
|
+
public readonly newIndex: number,
|
|
236
|
+
public readonly movedAnnotation: INodeBase
|
|
237
|
+
) {
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export class AnnotationMovedAndReplacedInSameParentDelta implements IDelta {
|
|
242
|
+
constructor(
|
|
243
|
+
public readonly parent: INodeBase,
|
|
244
|
+
public readonly oldIndex: number,
|
|
245
|
+
public readonly newIndex: number,
|
|
246
|
+
public readonly replacedAnnotation: INodeBase,
|
|
247
|
+
public readonly movedAnnotation: INodeBase
|
|
248
|
+
) {
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export class ReferenceAddedDelta implements IDelta {
|
|
253
|
+
constructor(
|
|
254
|
+
public readonly parent: INodeBase,
|
|
255
|
+
public readonly reference: Reference,
|
|
256
|
+
public readonly index: number,
|
|
257
|
+
public readonly newTarget: SingleRef<INodeBase>
|
|
258
|
+
) {
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export class ReferenceDeletedDelta implements IDelta {
|
|
263
|
+
constructor(
|
|
264
|
+
public readonly parent: INodeBase,
|
|
265
|
+
public readonly reference: Reference,
|
|
266
|
+
public readonly index: number,
|
|
267
|
+
public readonly deletedTarget: SingleRef<INodeBase>
|
|
268
|
+
) {
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export class ReferenceChangedDelta implements IDelta {
|
|
273
|
+
constructor(
|
|
274
|
+
public readonly parent: INodeBase,
|
|
275
|
+
public readonly reference: Reference,
|
|
276
|
+
public readonly index: number,
|
|
277
|
+
public readonly newTarget: SingleRef<INodeBase>,
|
|
278
|
+
public readonly oldTarget: SingleRef<INodeBase>
|
|
279
|
+
) {
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export class EntryMovedFromOtherReferenceDelta implements IDelta {
|
|
284
|
+
constructor(
|
|
285
|
+
public readonly oldParent: INodeBase,
|
|
286
|
+
public readonly oldReference: Reference,
|
|
287
|
+
public readonly oldIndex: number,
|
|
288
|
+
public readonly newParent: INodeBase,
|
|
289
|
+
public readonly newReference: Reference,
|
|
290
|
+
public readonly newIndex: number,
|
|
291
|
+
public readonly movedTarget: SingleRef<INodeBase>
|
|
292
|
+
) {
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export class EntryMovedFromOtherReferenceInSameParentDelta implements IDelta {
|
|
297
|
+
constructor(
|
|
298
|
+
public readonly parent: INodeBase,
|
|
299
|
+
public readonly oldReference: Reference,
|
|
300
|
+
public readonly oldIndex: number,
|
|
301
|
+
public readonly newReference: Reference,
|
|
302
|
+
public readonly newIndex: number,
|
|
303
|
+
public readonly movedTarget: SingleRef<INodeBase>
|
|
304
|
+
) {
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export class EntryMovedInSameReferenceDelta implements IDelta {
|
|
309
|
+
constructor(
|
|
310
|
+
public readonly parent: INodeBase,
|
|
311
|
+
public readonly reference: Reference,
|
|
312
|
+
public readonly oldIndex: number,
|
|
313
|
+
public readonly newIndex: number,
|
|
314
|
+
public readonly movedTarget: SingleRef<INodeBase>
|
|
315
|
+
) {
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export class EntryMovedAndReplacedFromOtherReferenceDelta implements IDelta {
|
|
320
|
+
constructor(
|
|
321
|
+
public readonly newParent: INodeBase,
|
|
322
|
+
public readonly newReference: Reference,
|
|
323
|
+
public readonly newIndex: number,
|
|
324
|
+
public readonly movedTarget: SingleRef<INodeBase>,
|
|
325
|
+
public readonly oldParent: INodeBase,
|
|
326
|
+
public readonly oldReference: Reference,
|
|
327
|
+
public readonly oldIndex: number,
|
|
328
|
+
public readonly replacedTarget: SingleRef<INodeBase>
|
|
329
|
+
) {
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export class EntryMovedAndReplacedFromOtherReferenceInSameParentDelta implements IDelta {
|
|
334
|
+
constructor(
|
|
335
|
+
public readonly parent: INodeBase,
|
|
336
|
+
public readonly oldReference: Reference,
|
|
337
|
+
public readonly oldIndex: number,
|
|
338
|
+
public readonly newReference: Reference,
|
|
339
|
+
public readonly newIndex: number,
|
|
340
|
+
public readonly movedTarget: SingleRef<INodeBase>,
|
|
341
|
+
public readonly replacedTarget: SingleRef<INodeBase>
|
|
342
|
+
) {
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export class EntryMovedAndReplacedInSameReferenceDelta implements IDelta {
|
|
347
|
+
constructor(
|
|
348
|
+
public readonly parent: INodeBase,
|
|
349
|
+
public readonly reference: Reference,
|
|
350
|
+
public readonly oldIndex: number,
|
|
351
|
+
public readonly newIndex: number,
|
|
352
|
+
public readonly movedTarget: SingleRef<INodeBase>,
|
|
353
|
+
public readonly replacedTarget: SingleRef<INodeBase>
|
|
354
|
+
) {
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
export class CompositeDelta implements IDelta {
|
|
359
|
+
constructor(
|
|
360
|
+
public readonly parts: IDelta[]
|
|
361
|
+
) {
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Delta that does nothing.
|
|
367
|
+
*/
|
|
368
|
+
export class NoOpDelta implements IDelta {
|
|
369
|
+
}
|
|
370
|
+
|