@casual-simulation/aux-common 3.0.9 → 3.0.11

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.
Files changed (49) hide show
  1. package/aux-format-2/AuxCausalTree2.js +40 -5
  2. package/aux-format-2/AuxCausalTree2.js.map +1 -1
  3. package/bots/Bot.d.ts +8 -0
  4. package/bots/Bot.js +10 -0
  5. package/bots/Bot.js.map +1 -1
  6. package/bots/BotCalculations.d.ts +46 -6
  7. package/bots/BotCalculations.js +171 -14
  8. package/bots/BotCalculations.js.map +1 -1
  9. package/bots/BotEvents.d.ts +108 -22
  10. package/bots/BotEvents.js +56 -25
  11. package/bots/BotEvents.js.map +1 -1
  12. package/bots/test/BotCalculationContextTests.js +58 -6
  13. package/bots/test/BotCalculationContextTests.js.map +1 -1
  14. package/bots/test/BotTestHelpers.d.ts +4 -0
  15. package/bots/test/BotTestHelpers.js +67 -0
  16. package/bots/test/BotTestHelpers.js.map +1 -1
  17. package/math/Quaternion.d.ts +94 -0
  18. package/math/Quaternion.js +128 -0
  19. package/math/Quaternion.js.map +1 -0
  20. package/math/Rotation.d.ts +274 -0
  21. package/math/Rotation.js +378 -0
  22. package/math/Rotation.js.map +1 -0
  23. package/math/Vector2.d.ts +251 -0
  24. package/math/Vector2.js +287 -0
  25. package/math/Vector2.js.map +1 -0
  26. package/math/Vector3.d.ts +318 -0
  27. package/math/Vector3.js +370 -0
  28. package/math/Vector3.js.map +1 -0
  29. package/math/index.d.ts +5 -0
  30. package/math/index.js +5 -0
  31. package/math/index.js.map +1 -0
  32. package/package.json +4 -4
  33. package/partitions/MemoryPartition.js +23 -4
  34. package/partitions/MemoryPartition.js.map +1 -1
  35. package/partitions/RemoteYjsPartition.js +8 -4
  36. package/partitions/RemoteYjsPartition.js.map +1 -1
  37. package/partitions/YjsPartition.js +8 -0
  38. package/partitions/YjsPartition.js.map +1 -1
  39. package/runtime/AuxLibrary.d.ts +21 -44
  40. package/runtime/AuxLibrary.js +278 -95
  41. package/runtime/AuxLibrary.js.map +1 -1
  42. package/runtime/AuxLibraryDefinitions.def +642 -20
  43. package/runtime/AuxRuntime.js +26 -1
  44. package/runtime/AuxRuntime.js.map +1 -1
  45. package/runtime/Utils.js +12 -4
  46. package/runtime/Utils.js.map +1 -1
  47. package/partitions/test/PartitionTests.d.ts +0 -8
  48. package/partitions/test/PartitionTests.js +0 -1548
  49. package/partitions/test/PartitionTests.js.map +0 -1
@@ -0,0 +1,370 @@
1
+ import { clamp } from '../utils';
2
+ import { Vector2 } from './Vector2';
3
+ /**
4
+ * Defines a class that represents a 3D point in space.
5
+ */
6
+ export class Vector3 {
7
+ /**
8
+ * Constructs a new 3D vector with the given X and Y values.
9
+ * @param x The X value of the vector.
10
+ * @param y The Y value of the vector.
11
+ * @param z The Z value of the vector.
12
+ *
13
+ * @example Create a new Vector3 object with the position (2, 3, 4).
14
+ * let myVector = new Vector3(2, 3, 4);
15
+ *
16
+ * os.toast(`X: ${myVector.x}, Y: ${myVector.y}, Z: ${myVector.z}`);
17
+ *
18
+ * @example Move this bot to (1, 2, 3) in the home dimension.
19
+ * tags.homePosition = new Vector3(1, 2, 3);
20
+ */
21
+ constructor(x = 0, y = 0, z = 0) {
22
+ this.x = x;
23
+ this.y = y;
24
+ this.z = z;
25
+ Object.freeze(this);
26
+ }
27
+ /**
28
+ * Gets a new Vector2 that contains this vector's X and Y components.
29
+ */
30
+ get xy() {
31
+ return new Vector2(this.x, this.y);
32
+ }
33
+ /**
34
+ * Gets a new Vector2 that contains this vector's X and Z components.
35
+ */
36
+ get xz() {
37
+ return new Vector2(this.x, this.z);
38
+ }
39
+ /**
40
+ * Gets a new Vector2 that contains this vector's Y and Z components.
41
+ */
42
+ get yz() {
43
+ return new Vector2(this.y, this.z);
44
+ }
45
+ /**
46
+ * Creates a 3D vector with the given X and Y values that is normalized immediately upon creation.
47
+ * @param x The X value of the vector.
48
+ * @param y The Y value of the vector.
49
+ * @param z The Z value of the vector.
50
+ *
51
+ * @example Create a normalized vector
52
+ * const vector = Vector3.createNormalized(1, 2, 3);
53
+ */
54
+ static createNormalized(x, y, z) {
55
+ const length = Math.sqrt(x * x + y * y + z * z);
56
+ return new Vector3(x / length, y / length, z / length);
57
+ }
58
+ /**
59
+ * Calculates the angle between the two given vectors and returns the result in radians.
60
+ * @param first The first vector that should be used for comparision.
61
+ * @param second The second vector that should be used for comparision.
62
+ *
63
+ * @example Find the angle between two vectors.
64
+ * const first = new Vector3(
65
+ * Math.cos(Math.PI / 3),
66
+ * Math.sin(Math.PI / 3),
67
+ * 0,
68
+ * ); // 60 degrees
69
+ * const second = new Vector3(
70
+ * Math.cos(Math.PI / 2),
71
+ * Math.sin(Math.PI / 2),
72
+ * 0
73
+ * ); // 90 degrees
74
+ *
75
+ * const angle = Vector3.angleBetween(first, second);
76
+ * os.toast(angle);
77
+ */
78
+ static angleBetween(first, second) {
79
+ const dot = first.dot(second);
80
+ const l1 = first.length();
81
+ const l2 = second.length();
82
+ const cos = dot / (l1 * l2);
83
+ if (cos <= 1 && cos >= -1) {
84
+ return Math.acos(cos);
85
+ }
86
+ else {
87
+ // Sometimes the dot product ends up outside the 1 <-> -1 range and we need to clamp it.
88
+ return Math.acos(clamp(cos, -1, 1));
89
+ }
90
+ }
91
+ /**
92
+ * Calculates the distance between the two given vectors and returns the result.
93
+ * @param first The first vector that should be used for comparision.
94
+ * @param second The second vector that should be used for comparision.
95
+ *
96
+ * @example Find the distance between two vectors.
97
+ * const first = new Vector3(5, 10, 3);
98
+ * const second = new Vector3(9, 2, 6);
99
+ * const distance = Vector3.distanceBetween(first, second);
100
+ *
101
+ * os.toast(`Distance: ${distance}`);
102
+ */
103
+ static distanceBetween(first, second) {
104
+ const direction = second.subtract(first);
105
+ return direction.length();
106
+ }
107
+ /**
108
+ * Constructs a new vector that is the linear interpolation between the given start and end positions.
109
+ * The degree that the result is interpolated is determined by the given amount parameter.
110
+ * @param start The start position.
111
+ * @param finish The end position.
112
+ * @param amount The amount that the resulting position should be interpolated between the start and end positions. Values near 0 indicate rotations close to the first and values near 1 indicate rotations close to the second.
113
+ *
114
+ * @example Find the position that is halfway between two vectors.
115
+ * const start = new Vector3(5, 10, 15);
116
+ * const finish = new Vector3(9, 2, 6);
117
+ * const halfway = Vector3.interpolatePosition(start, finish, 0.5);
118
+ *
119
+ * os.toast(halfway);
120
+ *
121
+ * @example Find the position that is 1/4 between two vectors.
122
+ * const start = new Vector3(5, 10, 15);
123
+ * const finish = new Vector3(9, 2, 6);
124
+ * const halfway = Vector3.interpolatePosition(start, finish, 0.25);
125
+ *
126
+ * os.toast(halfway);
127
+ */
128
+ static interpolatePosition(start, finish, amount) {
129
+ const dir = finish.subtract(start);
130
+ const lerp = dir.multiplyScalar(amount);
131
+ return start.add(lerp);
132
+ }
133
+ /**
134
+ * Constructs a new vector that is the directional linear interpolation between the given start and end positions.
135
+ * The degree that the result is interpolated is determined by the given amount parameter.
136
+ *
137
+ * This function works similarly to interpolatePosition(), except the result is always a normalized vector.
138
+ *
139
+ * @param start The start position.
140
+ * @param finish The end position.
141
+ * @param amount The amount that the resulting position should be interpolated between the start and end positions. Values near 0 indicate rotations close to the first and values near 1 indicate rotations close to the second.
142
+ *
143
+ * @example Find the direction that points halfway between the two vectors.
144
+ * const start = new Vector3(5, 10, 16);
145
+ * const finish = new Vector3(9, 2, 6);
146
+ * const halfway = Vector3.interpolatePosition(start, finish, 0.5);
147
+ *
148
+ * os.toast(halfway);
149
+ */
150
+ static interpolateDirection(start, finish, amount) {
151
+ return Vector3.interpolatePosition(start, finish, amount).normalize();
152
+ }
153
+ /**
154
+ * Adds this vector with the other vector and returns the result.
155
+ * @param other The other vector to add with this vector.
156
+ *
157
+ * @example Add two vectors together.
158
+ * const first = new Vector3(1, 2, 3);
159
+ * const second = new Vector3(3, 4, 5);
160
+ * const added = first.add(second);
161
+ *
162
+ * os.toast(added); // Prints (4, 6, 8)
163
+ */
164
+ add(other) {
165
+ return new Vector3(this.x + other.x, this.y + other.y, this.z + other.z);
166
+ }
167
+ /**
168
+ * Subtracts the other vector from this vector and returns the result.
169
+ * @param other The other vector that should be subtracted from this vector.
170
+ *
171
+ * @example Subtract two vectors.
172
+ * const first = new Vector3(1, 2, 3);
173
+ * const second = new Vector3(3, 4, 5);
174
+ * const subtracted = first.subtract(second);
175
+ * os.toast(subtracted);
176
+ *
177
+ * @example Find the direction from one vector to another.
178
+ * const first = new Vector3(1, 2, 3);
179
+ * const second = new Vector3(3, 4, 5);
180
+ *
181
+ * const directionFromFirstToSecond = second.subtract(first);
182
+ * const directionFromSecondToFirst = first.subtract(second);
183
+ *
184
+ * os.toast(`first -> second = ${directionFromFirstToSecond}; second -> first = ${directionFromSecondToFirst}`);
185
+ */
186
+ subtract(other) {
187
+ return new Vector3(this.x - other.x, this.y - other.y, this.z - other.z);
188
+ }
189
+ /**
190
+ * Multiplies each component of this vector by the given value and returns the result.
191
+ * @param scale The scale that should be applied to this vector.
192
+ *
193
+ * @example Scale a vector by 10.
194
+ * const myVector = new Vector3(1, 1, 1);
195
+ * const scaled = myVector.multiplyScalar(10);
196
+ * os.toast(scaled); // Prints (10, 10, 10)
197
+ */
198
+ multiplyScalar(scale) {
199
+ return new Vector3(this.x * scale, this.y * scale, this.z * scale);
200
+ }
201
+ /**
202
+ * Multiplies this vector by the given other vector and returns the result.
203
+ * @param other The other vector to multiply with this vector.
204
+ *
205
+ * @example Multiply two vectors together.
206
+ * const first = new Vector3(1, 2, 3);
207
+ * const second = new Vector3(3, 4, 5);
208
+ * const multiplied = first.multiply(second);
209
+ *
210
+ * os.toast(multiplied); // Prints (3, 8, 15)
211
+ */
212
+ multiply(other) {
213
+ return new Vector3(this.x * other.x, this.y * other.y, this.z * other.z);
214
+ }
215
+ /**
216
+ * Calculates the dot product of this vector compared to the given other vector.
217
+ * Returns a number that is positive if the vectors point in the same direction,
218
+ * negative if they point in opposite directions, and zero if they are perpendicular.
219
+ * For normalized vectors, this value is clamped to 1 and -1.
220
+ * @param other The other vector to calculate the dot product with.
221
+ *
222
+ * @example Determine how two vectors are pointing towards/away from the same direction.
223
+ * const first = new Vector3(1, 2, 3);
224
+ * const second = new Vector3(3, 4, 5);
225
+ *
226
+ * const dot = first.dot(second);
227
+ * if (dot < 0) {
228
+ * os.toast("Vectors are pointing away from each other!");
229
+ * } else if (dot === 0) {
230
+ * os.toast("Vectors 90 degrees away from each other!");
231
+ * } else {
232
+ * os.toast("Vectors are pointing towards from each other!");
233
+ * }
234
+ */
235
+ dot(other) {
236
+ return this.x * other.x + this.y * other.y + this.z * other.z;
237
+ }
238
+ /**
239
+ * Calculates the cross product of this vector with the given other vector.
240
+ * Returns a new vector that is perpendicular to both vectors.
241
+ * Note that the order of the vectors greatly matters. For example, (1, 0, 0).cross(0, 1, 0) === (0, 0, 1) but (0, 1, 0).cross(1, 0, 0) === (0, 0, -1).
242
+ * @param other The other vector to calculate the cross product with.
243
+ *
244
+ * @example Calculate a vector that is perpendicular to two vectors.
245
+ * const first = new Vector3(1, 0, 0);
246
+ * const second = new Vector3(0, 1, 0);
247
+ *
248
+ * const result = first.cross(second);
249
+ * os.toast(`Result: ${result}`); // Prints (0, 0, 1)
250
+ */
251
+ cross(other) {
252
+ return new Vector3(this.y * other.z - other.y * this.z, this.z * other.x - other.z * this.x, this.x * other.y - other.x * this.y);
253
+ }
254
+ /**
255
+ * Calculates the length of this vector and returns the result.
256
+ *
257
+ * @example Get the length of the vector.
258
+ * const myVector = new Vector3(1, 2, 3);
259
+ * const length = myVector.length();
260
+ *
261
+ * os.toast(`Vector is ${length} units long`);
262
+ */
263
+ length() {
264
+ return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
265
+ }
266
+ /**
267
+ * Calculates the square length of this vector and returns the result.
268
+ * This is equivalent to length^2, but it is faster to calculate than length because it doesn't require
269
+ * calculating a square root.
270
+ *
271
+ * @example Get the square length of the vector.
272
+ * const myVector = new Vector3(1, 2, 3);
273
+ * const length = myVector.squareLength();
274
+ *
275
+ * os.toast(`Vector is ${length}^2 units long`);
276
+ */
277
+ squareLength() {
278
+ return this.x * this.x + this.y * this.y + this.z * this.z;
279
+ }
280
+ /**
281
+ * Calculates the normalized version of this vector and returns it.
282
+ * A normalized vector is a vector whose length equals 1.
283
+ *
284
+ * Normalizing a vector preserves its directionality while making the length (i.e. scale) of it 1.
285
+ *
286
+ * @example Normalize a vector.
287
+ * const myVector = new Vector3(1, 2, 3);
288
+ * const normalized = myVector.normalize();
289
+ *
290
+ * os.toast(`Vector: ${myVector}, Normalized: ${normalized}`);
291
+ */
292
+ normalize() {
293
+ const length = this.length();
294
+ if (length === 1) {
295
+ return this;
296
+ }
297
+ return new Vector3(this.x / length, this.y / length, this.z / length);
298
+ }
299
+ /**
300
+ * Negates each component of this vector and returns a new vector that contains the result.
301
+ *
302
+ * @example Negate a vector.
303
+ * const myVector = new Vector3(1, 2, 3);
304
+ * const negated = myVector.negate();
305
+ *
306
+ * os.toast(`Vector: ${myVector}, Negated: ${negated}`);
307
+ */
308
+ negate() {
309
+ return new Vector3(-this.x, -this.y, -this.z);
310
+ }
311
+ /**
312
+ * Converts this vector to a human-readable string representation.
313
+ *
314
+ * @example Get a string of a vector.
315
+ * const myVector = new Vector3(1, 2, 3);
316
+ * const vectorString = myVector.toString();
317
+ *
318
+ * os.toast('My Vector: ' + vectorString);
319
+ */
320
+ toString() {
321
+ return `Vector3(${this.x}, ${this.y}, ${this.z})`;
322
+ }
323
+ /**
324
+ * Determines if this vector equals the other vector.
325
+ * @param other The other value to compare to.
326
+ *
327
+ * @example Determine if two vectors represent the same value.
328
+ * const first = new Vector3(1, 2, 3);
329
+ * const second = new Vector3(3, 4, 5);
330
+ * const third = new Vector3(1, 2, 3);
331
+ *
332
+ * os.toast(`first == second: ${first.equals(second)}; first == third: ${first.equals(third)}`)
333
+ */
334
+ equals(other) {
335
+ return this.x === other.x && this.y === other.y && this.z === other.z;
336
+ }
337
+ }
338
+ /**
339
+ * A 3D vector that contains (0, 0, 0).
340
+ */
341
+ export const ZERO = new Vector3();
342
+ /**
343
+ * A 3D vector that contains (1, 1, 1).
344
+ */
345
+ export const ONE = new Vector3(1, 1, 1);
346
+ /**
347
+ * A 3D vector that contains (0, 1, 0).
348
+ */
349
+ export const FORWARD = new Vector3(0, 1, 0);
350
+ /**
351
+ * A 3D vector that contains (0, -1, 0).
352
+ */
353
+ export const BACK = new Vector3(0, -1, 0);
354
+ /**
355
+ * A 3D vector that contains (1, 0, 0).
356
+ */
357
+ export const RIGHT = new Vector3(1, 0, 0);
358
+ /**
359
+ * A 3D vector that contains (-1, 0, 0).
360
+ */
361
+ export const LEFT = new Vector3(-1, 0, 0);
362
+ /**
363
+ * A 3D vector that contains (0, 0, 1).
364
+ */
365
+ export const UP = new Vector3(0, 0, 1);
366
+ /**
367
+ * A 3D vector that contains (0, 0, -1).
368
+ */
369
+ export const DOWN = new Vector3(0, 0, -1);
370
+ //# sourceMappingURL=Vector3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Vector3.js","sourceRoot":"","sources":["Vector3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;GAEG;AACH,MAAM,OAAO,OAAO;IAqChB;;;;;;;;;;;;;OAaG;IACH,YAAY,IAAY,CAAC,EAAE,IAAY,CAAC,EAAE,IAAY,CAAC;QACnD,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAxCD;;OAEG;IACH,IAAI,EAAE;QACF,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,IAAI,EAAE;QACF,OAAO,IAAI,OAAO,CA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AG,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,EAAE,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './Vector2';
2
+ export * from './Vector3';
3
+ export * from './Quaternion';
4
+ export * from './Rotation';
5
+ //# sourceMappingURL=index.d.ts.map
package/math/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export * from './Vector2';
2
+ export * from './Vector3';
3
+ export * from './Quaternion';
4
+ export * from './Rotation';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@casual-simulation/aux-common",
3
- "version": "3.0.9",
3
+ "version": "3.0.11",
4
4
  "description": "Common library for AUX projects",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -33,14 +33,14 @@
33
33
  "access": "public"
34
34
  },
35
35
  "dependencies": {
36
- "@casual-simulation/aux-records": "^3.0.5",
36
+ "@casual-simulation/aux-records": "^3.0.10",
37
37
  "@casual-simulation/causal-trees": "^3.0.2",
38
38
  "@casual-simulation/crypto": "^3.0.0",
39
39
  "@casual-simulation/error-stack-parser": "^2.0.7",
40
40
  "@casual-simulation/expect": "^3.0.5",
41
41
  "@casual-simulation/fast-json-stable-stringify": "^3.0.0",
42
42
  "@casual-simulation/stacktrace": "^3.0.0",
43
- "@casual-simulation/three": "^0.139.5",
43
+ "@casual-simulation/three": "^0.140.3",
44
44
  "@tweenjs/tween.js": "18.6.0",
45
45
  "@types/acorn": "^4.0.6",
46
46
  "@types/estraverse": "^5.1.1",
@@ -73,5 +73,5 @@
73
73
  "**/*.d.ts",
74
74
  "**/*.def"
75
75
  ],
76
- "gitHead": "c91b84a963540b078272722528fe0671087a1dfd"
76
+ "gitHead": "e5b13c6f8cc2eb143f8cea7fc0e9447d7340196c"
77
77
  }
@@ -23,7 +23,7 @@ import { BehaviorSubject, Subject } from 'rxjs';
23
23
  import { startWith } from 'rxjs/operators';
24
24
  import { flatMap, union } from 'lodash';
25
25
  import { merge } from '../utils';
26
- import { applyTagEdit, edits, isTagEdit } from '../aux-format-2';
26
+ import { applyTagEdit, edits, isTagEdit, } from '../aux-format-2';
27
27
  import { v4 as uuid } from 'uuid';
28
28
  /**
29
29
  * Attempts to create a MemoryPartition from the given config.
@@ -135,6 +135,7 @@ export class MemoryPartitionImpl {
135
135
  this.closed = true;
136
136
  }
137
137
  _applyEvents(events) {
138
+ var _a, _b;
138
139
  let added = new Map();
139
140
  let removed = [];
140
141
  let updated = new Map();
@@ -164,7 +165,7 @@ export class MemoryPartitionImpl {
164
165
  delete this.state[event.id];
165
166
  }
166
167
  else {
167
- let _a = this.state, _b = event.id, removedBot = _a[_b], state = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
168
+ let _c = this.state, _d = event.id, removedBot = _c[_d], state = __rest(_c, [typeof _d === "symbol" ? _d : _d + ""]);
168
169
  this.state = state;
169
170
  createdNewState = true;
170
171
  }
@@ -177,6 +178,7 @@ export class MemoryPartitionImpl {
177
178
  if (event.update.tags && this.state[event.id]) {
178
179
  let newBot = Object.assign({}, this.state[event.id]);
179
180
  let changedTags = [];
181
+ let lastBot = updatedState[event.id];
180
182
  const updatedBot = (updatedState[event.id] = merge(updatedState[event.id] || {}, event.update));
181
183
  for (let tag of Object.keys(event.update.tags)) {
182
184
  const newVal = event.update.tags[tag];
@@ -188,7 +190,15 @@ export class MemoryPartitionImpl {
188
190
  if (isTagEdit(newVal)) {
189
191
  newBot.tags[tag] = applyTagEdit(newBot.tags[tag], newVal);
190
192
  nextVersion = this.getNextVersion(newVal);
191
- updatedBot.tags[tag] = edits(nextVersion.vector, ...newVal.operations);
193
+ let combinedEdits = [];
194
+ if (lastBot) {
195
+ const lastVal = lastBot.tags[tag];
196
+ if (lastVal !== oldVal &&
197
+ isTagEdit(lastVal)) {
198
+ combinedEdits = lastVal.operations;
199
+ }
200
+ }
201
+ updatedBot.tags[tag] = edits(nextVersion.vector, ...combinedEdits, ...newVal.operations);
192
202
  }
193
203
  else {
194
204
  newBot.tags[tag] = newVal;
@@ -225,6 +235,7 @@ export class MemoryPartitionImpl {
225
235
  if (!newBot.masks[this.space]) {
226
236
  newBot.masks[this.space] = {};
227
237
  }
238
+ let lastMasks = (_b = (_a = updatedState[event.id]) === null || _a === void 0 ? void 0 : _a.masks) === null || _b === void 0 ? void 0 : _b[this.space];
228
239
  const masks = newBot.masks[this.space];
229
240
  const updatedBot = (updatedState[event.id] = merge(updatedState[event.id] || {}, event.update));
230
241
  let changedTags = [];
@@ -238,7 +249,15 @@ export class MemoryPartitionImpl {
238
249
  if (isTagEdit(newVal)) {
239
250
  masks[tag] = applyTagEdit(masks[tag], newVal);
240
251
  nextVersion = this.getNextVersion(newVal);
241
- updatedBot.masks[this.space][tag] = edits(nextVersion.vector, ...newVal.operations);
252
+ let combinedEdits = [];
253
+ if (lastMasks) {
254
+ const lastVal = lastMasks[tag];
255
+ if (lastVal !== oldVal &&
256
+ isTagEdit(lastVal)) {
257
+ combinedEdits = lastVal.operations;
258
+ }
259
+ }
260
+ updatedBot.masks[this.space][tag] = edits(nextVersion.vector, ...combinedEdits, ...newVal.operations);
242
261
  }
243
262
  else {
244
263
  masks[tag] = newVal;
@@ -1 +1 @@
1
- {"version":3,"file":"MemoryPartition.js","sourceRoot":"","sources":["MemoryPartition.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAKA,OAAO,EAMH,QAAQ,EACR,gBAAgB,EAIhB,yBAAyB,EAEzB,iBAAiB,GAGpB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,eAAe,EAAc,OAAO,EAAE,MAAM,MAAM,CAAC;AAM5D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAW,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAElC;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACjC,MAAuB;IAEvB,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE;QAC1B,IAAI,cAAc,IAAI,MAAM,EAAE;YAC1B,OAAO,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;SAC1C;aAAM;YACH,OAAO,MAAM,CAAC,SAAS,CAAC;SAC3B;KACJ;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,MAAM,OAAO,mBAAmB;IAwD5B,YAAY,MAAkC;QAvDtC,iBAAY,GAAG,IAAI,OAAO,EAAS,CAAC;QACpC,mBAAc,GAAG,IAAI,OAAO,EAAY,CAAC;QACzC,mBAAc,GAAG,IAAI,OAAO,EAAgB,CAAC;QAC7C,oBAAe,GAAG,IAAI,OAAO,EAAqB,CAAC;QAEnD,aAAQ,GAAG,IAAI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,CAAC;IAED,cAAc,CAAC,QAAiB;QAC5B,OAAO;YACH,WAAW,EAAE,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,WAAW;YACrD,UAAU,EAAE,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,UAAU;YACnD,MAAM,kCACC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,MAAM,KACtC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EACjD,CAAC,IAAI,CAAC,cAAc,IAAI,CAAC,CAAC,GACjC;SACJ,CAAC;IACN,CAAC;CACJ"}
@@ -460,6 +460,10 @@ export class RemoteYjsPartitionImpl {
460
460
  for (let [type, events] of transaction.changedParentTypes) {
461
461
  if (type === this._bots) {
462
462
  for (let event of events) {
463
+ // Update the current target so that the event
464
+ // path is calculated from the bots map.
465
+ // see https://github.com/yjs/yjs/blob/5244755879daaa7b5a1ca64e6af617cdbb110462/src/utils/YEvent.js#L63
466
+ event.currentTarget = this._bots;
463
467
  const target = event.target;
464
468
  if (target === type) {
465
469
  // Bot was added or removed
@@ -496,6 +500,10 @@ export class RemoteYjsPartitionImpl {
496
500
  }
497
501
  else if (type === this._masks) {
498
502
  for (let event of events) {
503
+ // Update the current target so that the event
504
+ // path is calculated from the bots map.
505
+ // see https://github.com/yjs/yjs/blob/5244755879daaa7b5a1ca64e6af617cdbb110462/src/utils/YEvent.js#L63
506
+ event.currentTarget = this._masks;
499
507
  const target = event.target;
500
508
  this._handleValueUpdates(target, event, memoryEvents, version, (event) => event.path[event.path.length - 1], (event, key) => parseTagMaskId(key), (event) => parseTagMaskId(event.path[event.path.length - 1]), (id, tags) => botUpdated(id, {
501
509
  masks: {
@@ -629,10 +637,6 @@ export class RemoteYjsPartitionImpl {
629
637
  }
630
638
  }
631
639
  else {
632
- // Update the current target so that the event
633
- // path is calculated from the bots map.
634
- // see https://github.com/yjs/yjs/blob/5244755879daaa7b5a1ca64e6af617cdbb110462/src/utils/YEvent.js#L63
635
- event.currentTarget = this._bots;
636
640
  // Maps are only used for bots and tags
637
641
  // so a map that is not the bots map must be for a tag
638
642
  const id = getMapBotId(event);