@yorkie-js/react 0.6.25 → 0.6.26
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.
|
@@ -8370,12 +8370,12 @@ class ElementRHT {
|
|
|
8370
8370
|
set(key, value, executedAt) {
|
|
8371
8371
|
let removed;
|
|
8372
8372
|
const node = this.nodeMapByKey.get(key);
|
|
8373
|
-
if (node
|
|
8373
|
+
if (!!node && !node.isRemoved() && node.remove(executedAt)) {
|
|
8374
8374
|
removed = node.getValue();
|
|
8375
8375
|
}
|
|
8376
8376
|
const newNode = ElementRHTNode.of(key, value);
|
|
8377
8377
|
this.nodeMapByCreatedAt.set(value.getCreatedAt().toIDString(), newNode);
|
|
8378
|
-
if (node
|
|
8378
|
+
if (!node || executedAt.after(node.getValue().getPositionedAt())) {
|
|
8379
8379
|
this.nodeMapByKey.set(key, newNode);
|
|
8380
8380
|
value.setMovedAt(executedAt);
|
|
8381
8381
|
}
|
|
@@ -8429,7 +8429,7 @@ class ElementRHT {
|
|
|
8429
8429
|
*/
|
|
8430
8430
|
deleteByKey(key, removedAt) {
|
|
8431
8431
|
const node = this.nodeMapByKey.get(key);
|
|
8432
|
-
if (node
|
|
8432
|
+
if (!node) {
|
|
8433
8433
|
return;
|
|
8434
8434
|
}
|
|
8435
8435
|
if (!node.remove(removedAt)) {
|
|
@@ -8442,7 +8442,7 @@ class ElementRHT {
|
|
|
8442
8442
|
*/
|
|
8443
8443
|
has(key) {
|
|
8444
8444
|
const node = this.nodeMapByKey.get(key);
|
|
8445
|
-
if (node
|
|
8445
|
+
if (!node) {
|
|
8446
8446
|
return false;
|
|
8447
8447
|
}
|
|
8448
8448
|
return !node.isRemoved();
|
|
@@ -14413,6 +14413,12 @@ class VersionVector {
|
|
|
14413
14413
|
get(actorID) {
|
|
14414
14414
|
return this.vector.get(actorID);
|
|
14415
14415
|
}
|
|
14416
|
+
/**
|
|
14417
|
+
* `has` checks if the given actor exists in the VersionVector.
|
|
14418
|
+
*/
|
|
14419
|
+
has(actorID) {
|
|
14420
|
+
return this.vector.has(actorID);
|
|
14421
|
+
}
|
|
14416
14422
|
/**
|
|
14417
14423
|
* `maxLamport` returns max lamport value from vector
|
|
14418
14424
|
*/
|
|
@@ -15285,11 +15291,12 @@ class RGATreeSplitNode extends SplayNode {
|
|
|
15285
15291
|
/**
|
|
15286
15292
|
* `canDelete` checks if node is able to delete.
|
|
15287
15293
|
*/
|
|
15288
|
-
|
|
15289
|
-
|
|
15290
|
-
|
|
15291
|
-
|
|
15292
|
-
|
|
15294
|
+
canRemove(creationKnown) {
|
|
15295
|
+
if (!creationKnown) {
|
|
15296
|
+
return false;
|
|
15297
|
+
}
|
|
15298
|
+
if (!this.removedAt) {
|
|
15299
|
+
return true;
|
|
15293
15300
|
}
|
|
15294
15301
|
return false;
|
|
15295
15302
|
}
|
|
@@ -15301,10 +15308,22 @@ class RGATreeSplitNode extends SplayNode {
|
|
|
15301
15308
|
return nodeExisted && (!this.removedAt || editedAt.after(this.removedAt));
|
|
15302
15309
|
}
|
|
15303
15310
|
/**
|
|
15304
|
-
* `
|
|
15311
|
+
* `setRemovedAt` sets the remove time of this node.
|
|
15312
|
+
*/
|
|
15313
|
+
setRemovedAt(removedAt) {
|
|
15314
|
+
this.removedAt = removedAt;
|
|
15315
|
+
}
|
|
15316
|
+
/**
|
|
15317
|
+
* `remove` removes the node of the given edited time.
|
|
15305
15318
|
*/
|
|
15306
|
-
remove(
|
|
15307
|
-
this.removedAt
|
|
15319
|
+
remove(removedAt, tombstoneKnown) {
|
|
15320
|
+
if (!this.removedAt) {
|
|
15321
|
+
this.removedAt = removedAt;
|
|
15322
|
+
return;
|
|
15323
|
+
}
|
|
15324
|
+
if (!tombstoneKnown && removedAt.after(this.removedAt)) {
|
|
15325
|
+
this.removedAt = removedAt;
|
|
15326
|
+
}
|
|
15308
15327
|
}
|
|
15309
15328
|
/**
|
|
15310
15329
|
* `createRange` creates ranges of RGATreeSplitPos.
|
|
@@ -15635,43 +15654,34 @@ class RGATreeSplit {
|
|
|
15635
15654
|
subDataSize(diff, prvSize);
|
|
15636
15655
|
return [splitNode, diff];
|
|
15637
15656
|
}
|
|
15638
|
-
deleteNodes(candidates, editedAt,
|
|
15657
|
+
deleteNodes(candidates, editedAt, vector) {
|
|
15639
15658
|
if (!candidates.length) {
|
|
15640
15659
|
return [[], /* @__PURE__ */ new Map()];
|
|
15641
15660
|
}
|
|
15642
|
-
const
|
|
15643
|
-
|
|
15644
|
-
editedAt,
|
|
15645
|
-
versionVector
|
|
15646
|
-
);
|
|
15647
|
-
const removedNodes = /* @__PURE__ */ new Map();
|
|
15648
|
-
const changes = this.makeChanges(nodesToKeep, editedAt);
|
|
15649
|
-
for (const node of nodesToDelete) {
|
|
15650
|
-
removedNodes.set(node.getID().toIDString(), node);
|
|
15651
|
-
node.remove(editedAt);
|
|
15652
|
-
}
|
|
15653
|
-
this.deleteIndexNodes(nodesToKeep);
|
|
15654
|
-
return [changes, removedNodes];
|
|
15655
|
-
}
|
|
15656
|
-
filterNodes(candidates, editedAt, versionVector) {
|
|
15657
|
-
const nodesToDelete = [];
|
|
15661
|
+
const isLocal = vector === void 0;
|
|
15662
|
+
const nodesToRemove = [];
|
|
15658
15663
|
const nodesToKeep = [];
|
|
15659
15664
|
const [leftEdge, rightEdge] = this.findEdgesOfCandidates(candidates);
|
|
15660
15665
|
nodesToKeep.push(leftEdge);
|
|
15661
15666
|
for (const node of candidates) {
|
|
15662
|
-
|
|
15663
|
-
|
|
15664
|
-
if (versionVector != void 0) {
|
|
15665
|
-
clientLamportAtChange = versionVector.get(actorID) ? versionVector.get(actorID) : 0n;
|
|
15666
|
-
}
|
|
15667
|
-
if (node.canDelete(editedAt, clientLamportAtChange)) {
|
|
15668
|
-
nodesToDelete.push(node);
|
|
15667
|
+
if (node.canRemove(isLocal || vector.afterOrEqual(node.getCreatedAt()))) {
|
|
15668
|
+
nodesToRemove.push(node);
|
|
15669
15669
|
} else {
|
|
15670
15670
|
nodesToKeep.push(node);
|
|
15671
15671
|
}
|
|
15672
15672
|
}
|
|
15673
15673
|
nodesToKeep.push(rightEdge);
|
|
15674
|
-
|
|
15674
|
+
const changes = this.makeChanges(nodesToKeep, editedAt);
|
|
15675
|
+
const removedNodes = /* @__PURE__ */ new Map();
|
|
15676
|
+
for (const node of nodesToRemove) {
|
|
15677
|
+
removedNodes.set(node.getID().toIDString(), node);
|
|
15678
|
+
node.remove(
|
|
15679
|
+
editedAt,
|
|
15680
|
+
node.isRemoved() && (isLocal || vector.afterOrEqual(node.getRemovedAt()))
|
|
15681
|
+
);
|
|
15682
|
+
}
|
|
15683
|
+
this.deleteIndexNodes(nodesToKeep);
|
|
15684
|
+
return [changes, removedNodes];
|
|
15675
15685
|
}
|
|
15676
15686
|
/**
|
|
15677
15687
|
* `findEdgesOfCandidates` finds the edges outside `candidates`,
|
|
@@ -16969,7 +16979,7 @@ function fromTextNode(pbTextNode) {
|
|
|
16969
16979
|
fromTextNodeID(pbTextNode.id),
|
|
16970
16980
|
textValue
|
|
16971
16981
|
);
|
|
16972
|
-
textNode.
|
|
16982
|
+
textNode.setRemovedAt(fromTimeTicket(pbTextNode.removedAt));
|
|
16973
16983
|
return textNode;
|
|
16974
16984
|
}
|
|
16975
16985
|
function fromTreePos(pbTreePos) {
|
|
@@ -17629,7 +17639,7 @@ function validateValue(value, rule) {
|
|
|
17629
17639
|
errors: [
|
|
17630
17640
|
{
|
|
17631
17641
|
path: rule.path,
|
|
17632
|
-
message: `
|
|
17642
|
+
message: `expected object at path ${rule.path}`
|
|
17633
17643
|
}
|
|
17634
17644
|
]
|
|
17635
17645
|
};
|
|
@@ -17642,7 +17652,7 @@ function validateValue(value, rule) {
|
|
|
17642
17652
|
errors: [
|
|
17643
17653
|
{
|
|
17644
17654
|
path: rule.path,
|
|
17645
|
-
message: `
|
|
17655
|
+
message: `expected array at path ${rule.path}`
|
|
17646
17656
|
}
|
|
17647
17657
|
]
|
|
17648
17658
|
};
|
|
@@ -17655,7 +17665,7 @@ function validateValue(value, rule) {
|
|
|
17655
17665
|
errors: [
|
|
17656
17666
|
{
|
|
17657
17667
|
path: rule.path,
|
|
17658
|
-
message: `
|
|
17668
|
+
message: `expected yorkie.Text at path ${rule.path}`
|
|
17659
17669
|
}
|
|
17660
17670
|
]
|
|
17661
17671
|
};
|
|
@@ -17668,7 +17678,7 @@ function validateValue(value, rule) {
|
|
|
17668
17678
|
errors: [
|
|
17669
17679
|
{
|
|
17670
17680
|
path: rule.path,
|
|
17671
|
-
message: `
|
|
17681
|
+
message: `expected yorkie.Tree at path ${rule.path}`
|
|
17672
17682
|
}
|
|
17673
17683
|
]
|
|
17674
17684
|
};
|
|
@@ -17681,7 +17691,7 @@ function validateValue(value, rule) {
|
|
|
17681
17691
|
errors: [
|
|
17682
17692
|
{
|
|
17683
17693
|
path: rule.path,
|
|
17684
|
-
message: `
|
|
17694
|
+
message: `expected yorkie.Counter at path ${rule.path}`
|
|
17685
17695
|
}
|
|
17686
17696
|
]
|
|
17687
17697
|
};
|
|
@@ -17725,7 +17735,7 @@ function validatePrimitiveValue(value, rule) {
|
|
|
17725
17735
|
errors: [
|
|
17726
17736
|
{
|
|
17727
17737
|
path: rule.path,
|
|
17728
|
-
message: `
|
|
17738
|
+
message: `expected ${rule.type} at path ${rule.path}`
|
|
17729
17739
|
}
|
|
17730
17740
|
]
|
|
17731
17741
|
};
|
|
@@ -21576,7 +21586,7 @@ function createAuthInterceptor(apiKey, token) {
|
|
|
21576
21586
|
};
|
|
21577
21587
|
}
|
|
21578
21588
|
const name$1 = "@yorkie-js/sdk";
|
|
21579
|
-
const version$1 = "0.6.
|
|
21589
|
+
const version$1 = "0.6.26";
|
|
21580
21590
|
const pkg$1 = {
|
|
21581
21591
|
name: name$1,
|
|
21582
21592
|
version: version$1
|
|
@@ -22339,6 +22349,7 @@ class Client {
|
|
|
22339
22349
|
return;
|
|
22340
22350
|
}
|
|
22341
22351
|
attachment.cancelWatchStream();
|
|
22352
|
+
attachment.doc.resetOnlineClients();
|
|
22342
22353
|
attachment.unsubscribeBroadcastEvent();
|
|
22343
22354
|
this.attachmentMap.delete(docKey);
|
|
22344
22355
|
}
|
|
@@ -22466,7 +22477,7 @@ if (typeof globalThis !== "undefined") {
|
|
|
22466
22477
|
};
|
|
22467
22478
|
}
|
|
22468
22479
|
const name = "@yorkie-js/react";
|
|
22469
|
-
const version = "0.6.
|
|
22480
|
+
const version = "0.6.26";
|
|
22470
22481
|
const pkg = {
|
|
22471
22482
|
name,
|
|
22472
22483
|
version
|