@liveblocks/core 3.13.0-vincent1 → 3.13.0-vincent2
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/dist/index.cjs +15 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -7
- package/dist/index.d.ts +1 -7
- package/dist/index.js +15 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6,7 +6,7 @@ var __export = (target, all) => {
|
|
|
6
6
|
|
|
7
7
|
// src/version.ts
|
|
8
8
|
var PKG_NAME = "@liveblocks/core";
|
|
9
|
-
var PKG_VERSION = "3.13.0-
|
|
9
|
+
var PKG_VERSION = "3.13.0-vincent2";
|
|
10
10
|
var PKG_FORMAT = "cjs";
|
|
11
11
|
|
|
12
12
|
// src/dupe-detection.ts
|
|
@@ -5925,9 +5925,7 @@ var OpCode = Object.freeze({
|
|
|
5925
5925
|
DELETE_CRDT: 5,
|
|
5926
5926
|
DELETE_OBJECT_KEY: 6,
|
|
5927
5927
|
CREATE_MAP: 7,
|
|
5928
|
-
CREATE_REGISTER: 8
|
|
5929
|
-
ACK: 9
|
|
5930
|
-
// Will only appear in v8+
|
|
5928
|
+
CREATE_REGISTER: 8
|
|
5931
5929
|
});
|
|
5932
5930
|
function isAckOp(op) {
|
|
5933
5931
|
return op.type === OpCode.DELETE_CRDT && op.id === "ACK";
|
|
@@ -6153,21 +6151,23 @@ function isRootCrdt(id, _) {
|
|
|
6153
6151
|
}
|
|
6154
6152
|
function* compactNodesToNodeStream(nodes) {
|
|
6155
6153
|
for (const node of nodes) {
|
|
6154
|
+
const id = node[0];
|
|
6155
|
+
if (isRootNode(node)) {
|
|
6156
|
+
yield [id, { type: CrdtType.OBJECT, data: node[1] }];
|
|
6157
|
+
continue;
|
|
6158
|
+
}
|
|
6156
6159
|
switch (node[1]) {
|
|
6157
6160
|
case CrdtType.OBJECT:
|
|
6158
|
-
yield
|
|
6159
|
-
// prettier-ignore
|
|
6160
|
-
[node[0], { type: CrdtType.OBJECT, parentId: node[2], parentKey: node[3], data: node[4] }]
|
|
6161
|
-
);
|
|
6161
|
+
yield [id, { type: CrdtType.OBJECT, parentId: node[2], parentKey: node[3], data: node[4] }];
|
|
6162
6162
|
break;
|
|
6163
6163
|
case CrdtType.LIST:
|
|
6164
|
-
yield [
|
|
6164
|
+
yield [id, { type: CrdtType.LIST, parentId: node[2], parentKey: node[3] }];
|
|
6165
6165
|
break;
|
|
6166
6166
|
case CrdtType.MAP:
|
|
6167
|
-
yield [
|
|
6167
|
+
yield [id, { type: CrdtType.MAP, parentId: node[2], parentKey: node[3] }];
|
|
6168
6168
|
break;
|
|
6169
6169
|
case CrdtType.REGISTER:
|
|
6170
|
-
yield [
|
|
6170
|
+
yield [id, { type: CrdtType.REGISTER, parentId: node[2], parentKey: node[3], data: node[4] }];
|
|
6171
6171
|
break;
|
|
6172
6172
|
}
|
|
6173
6173
|
}
|
|
@@ -6176,10 +6176,11 @@ function* nodeStreamToCompactNodes(nodes) {
|
|
|
6176
6176
|
for (const [id, node] of nodes) {
|
|
6177
6177
|
switch (node.type) {
|
|
6178
6178
|
case CrdtType.OBJECT:
|
|
6179
|
-
if (isRootCrdt(id, node))
|
|
6180
|
-
yield [id,
|
|
6181
|
-
else
|
|
6179
|
+
if (isRootCrdt(id, node)) {
|
|
6180
|
+
yield [id, node.data];
|
|
6181
|
+
} else {
|
|
6182
6182
|
yield [id, CrdtType.OBJECT, node.parentId, node.parentKey, node.data];
|
|
6183
|
+
}
|
|
6183
6184
|
break;
|
|
6184
6185
|
case CrdtType.LIST:
|
|
6185
6186
|
yield [id, CrdtType.LIST, node.parentId, node.parentKey];
|