@liveblocks/core 3.13.0-vincent1 → 3.13.0-vincent3
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 +21 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -18
- package/dist/index.d.ts +14 -18
- package/dist/index.js +21 -19
- 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-vincent3";
|
|
10
10
|
var PKG_FORMAT = "cjs";
|
|
11
11
|
|
|
12
12
|
// src/dupe-detection.ts
|
|
@@ -3094,6 +3094,8 @@ var ServerMsgCode = Object.freeze({
|
|
|
3094
3094
|
// Only sent in V7
|
|
3095
3095
|
STORAGE_CHUNK: 210,
|
|
3096
3096
|
// Used in V8+
|
|
3097
|
+
STORAGE_STREAM_END: 211,
|
|
3098
|
+
// Used in V8+
|
|
3097
3099
|
UPDATE_STORAGE: 201,
|
|
3098
3100
|
// For Yjs Docs
|
|
3099
3101
|
UPDATE_YDOC: 300,
|
|
@@ -5925,9 +5927,7 @@ var OpCode = Object.freeze({
|
|
|
5925
5927
|
DELETE_CRDT: 5,
|
|
5926
5928
|
DELETE_OBJECT_KEY: 6,
|
|
5927
5929
|
CREATE_MAP: 7,
|
|
5928
|
-
CREATE_REGISTER: 8
|
|
5929
|
-
ACK: 9
|
|
5930
|
-
// Will only appear in v8+
|
|
5930
|
+
CREATE_REGISTER: 8
|
|
5931
5931
|
});
|
|
5932
5932
|
function isAckOp(op) {
|
|
5933
5933
|
return op.type === OpCode.DELETE_CRDT && op.id === "ACK";
|
|
@@ -6153,21 +6153,23 @@ function isRootCrdt(id, _) {
|
|
|
6153
6153
|
}
|
|
6154
6154
|
function* compactNodesToNodeStream(nodes) {
|
|
6155
6155
|
for (const node of nodes) {
|
|
6156
|
+
const id = node[0];
|
|
6157
|
+
if (isRootNode(node)) {
|
|
6158
|
+
yield [id, { type: CrdtType.OBJECT, data: node[1] }];
|
|
6159
|
+
continue;
|
|
6160
|
+
}
|
|
6156
6161
|
switch (node[1]) {
|
|
6157
6162
|
case CrdtType.OBJECT:
|
|
6158
|
-
yield
|
|
6159
|
-
// prettier-ignore
|
|
6160
|
-
[node[0], { type: CrdtType.OBJECT, parentId: node[2], parentKey: node[3], data: node[4] }]
|
|
6161
|
-
);
|
|
6163
|
+
yield [id, { type: CrdtType.OBJECT, parentId: node[2], parentKey: node[3], data: node[4] }];
|
|
6162
6164
|
break;
|
|
6163
6165
|
case CrdtType.LIST:
|
|
6164
|
-
yield [
|
|
6166
|
+
yield [id, { type: CrdtType.LIST, parentId: node[2], parentKey: node[3] }];
|
|
6165
6167
|
break;
|
|
6166
6168
|
case CrdtType.MAP:
|
|
6167
|
-
yield [
|
|
6169
|
+
yield [id, { type: CrdtType.MAP, parentId: node[2], parentKey: node[3] }];
|
|
6168
6170
|
break;
|
|
6169
6171
|
case CrdtType.REGISTER:
|
|
6170
|
-
yield [
|
|
6172
|
+
yield [id, { type: CrdtType.REGISTER, parentId: node[2], parentKey: node[3], data: node[4] }];
|
|
6171
6173
|
break;
|
|
6172
6174
|
}
|
|
6173
6175
|
}
|
|
@@ -6176,10 +6178,11 @@ function* nodeStreamToCompactNodes(nodes) {
|
|
|
6176
6178
|
for (const [id, node] of nodes) {
|
|
6177
6179
|
switch (node.type) {
|
|
6178
6180
|
case CrdtType.OBJECT:
|
|
6179
|
-
if (isRootCrdt(id, node))
|
|
6180
|
-
yield [id,
|
|
6181
|
-
else
|
|
6181
|
+
if (isRootCrdt(id, node)) {
|
|
6182
|
+
yield [id, node.data];
|
|
6183
|
+
} else {
|
|
6182
6184
|
yield [id, CrdtType.OBJECT, node.parentId, node.parentKey, node.data];
|
|
6185
|
+
}
|
|
6183
6186
|
break;
|
|
6184
6187
|
case CrdtType.LIST:
|
|
6185
6188
|
yield [id, CrdtType.LIST, node.parentId, node.parentKey];
|
|
@@ -9539,13 +9542,12 @@ function createRoom(options, config) {
|
|
|
9539
9542
|
updates.others.push(onRoomStateMessage(message));
|
|
9540
9543
|
break;
|
|
9541
9544
|
}
|
|
9542
|
-
case ServerMsgCode.STORAGE_CHUNK:
|
|
9545
|
+
case ServerMsgCode.STORAGE_CHUNK:
|
|
9543
9546
|
partialNodes.append(compactNodesToNodeStream(message.nodes));
|
|
9544
|
-
if (message.done) {
|
|
9545
|
-
processInitialStorage(partialNodes.clear());
|
|
9546
|
-
}
|
|
9547
9547
|
break;
|
|
9548
|
-
|
|
9548
|
+
case ServerMsgCode.STORAGE_STREAM_END:
|
|
9549
|
+
processInitialStorage(partialNodes.clear());
|
|
9550
|
+
break;
|
|
9549
9551
|
case ServerMsgCode.UPDATE_STORAGE: {
|
|
9550
9552
|
const applyResult = applyOps(
|
|
9551
9553
|
message.ops,
|