@y/y 14.0.0-rc.0 → 14.0.0-rc.2
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/src/internals.d.ts +1 -1
- package/dist/src/structs/Item.d.ts +4 -4
- package/dist/src/structs/Item.d.ts.map +1 -1
- package/dist/src/utils/BlockSet.d.ts +34 -0
- package/dist/src/utils/BlockSet.d.ts.map +1 -0
- package/dist/src/utils/encoding.d.ts +4 -0
- package/dist/src/utils/encoding.d.ts.map +1 -1
- package/dist/src/utils/meta.d.ts +1 -1
- package/dist/src/utils/meta.d.ts.map +1 -1
- package/dist/src/utils/updates.d.ts +1 -0
- package/dist/src/utils/updates.d.ts.map +1 -1
- package/dist/src/ytype.d.ts.map +1 -1
- package/dist/tests/snapshot.tests.d.ts +1 -0
- package/dist/tests/snapshot.tests.d.ts.map +1 -1
- package/dist/tests/testHelper.d.ts +3 -0
- package/dist/tests/testHelper.d.ts.map +1 -1
- package/dist/tests/updates.tests.d.ts +1 -0
- package/dist/tests/updates.tests.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/internals.js +1 -1
- package/src/structs/Item.js +5 -3
- package/src/utils/BlockSet.js +291 -0
- package/src/utils/encoding.js +6 -7
- package/src/utils/meta.js +1 -1
- package/src/utils/updates.js +13 -117
- package/src/ytype.js +3 -1
- package/tests/testHelper.js +3 -0
- package/dist/src/utils/StructSet.d.ts +0 -27
- package/dist/src/utils/StructSet.d.ts.map +0 -1
- package/src/utils/StructSet.js +0 -137
package/dist/src/internals.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export * from "./utils/Transaction.js";
|
|
|
14
14
|
export * from "./utils/UndoManager.js";
|
|
15
15
|
export * from "./utils/updates.js";
|
|
16
16
|
export * from "./utils/YEvent.js";
|
|
17
|
-
export * from "./utils/
|
|
17
|
+
export * from "./utils/BlockSet.js";
|
|
18
18
|
export * from "./utils/IdMap.js";
|
|
19
19
|
export * from "./utils/AttributionManager.js";
|
|
20
20
|
export * from "./utils/delta-helpers.js";
|
|
@@ -16,11 +16,11 @@ export class Item extends AbstractStruct {
|
|
|
16
16
|
* @param {ID | null} origin
|
|
17
17
|
* @param {Item | null} right
|
|
18
18
|
* @param {ID | null} rightOrigin
|
|
19
|
-
* @param {YType|ID|null} parent Is a type if integrated, is null if it is possible to copy parent from left or right, is ID before integration to search for it
|
|
19
|
+
* @param {YType|ID|string|null} parent Is a type if integrated, is null if it is possible to copy parent from left or right, is ID before integration to search for it, is string if child of top-level-parent
|
|
20
20
|
* @param {string | null} parentSub
|
|
21
21
|
* @param {AbstractContent} content
|
|
22
22
|
*/
|
|
23
|
-
constructor(id: ID, left: Item | null, origin: ID | null, right: Item | null, rightOrigin: ID | null, parent: YType | ID | null, parentSub: string | null, content: AbstractContent);
|
|
23
|
+
constructor(id: ID, left: Item | null, origin: ID | null, right: Item | null, rightOrigin: ID | null, parent: YType | ID | string | null, parentSub: string | null, content: AbstractContent);
|
|
24
24
|
/**
|
|
25
25
|
* The item that was originally to the left of this item.
|
|
26
26
|
* @type {ID | null}
|
|
@@ -42,9 +42,9 @@ export class Item extends AbstractStruct {
|
|
|
42
42
|
*/
|
|
43
43
|
rightOrigin: ID | null;
|
|
44
44
|
/**
|
|
45
|
-
* @type {YType|ID|null}
|
|
45
|
+
* @type {YType|ID|string|null}
|
|
46
46
|
*/
|
|
47
|
-
parent: YType | ID | null;
|
|
47
|
+
parent: YType | ID | string | null;
|
|
48
48
|
/**
|
|
49
49
|
* If the parent refers to this item with some kind of key (e.g. YMap, the
|
|
50
50
|
* key is specified here. The key is then used to refer to the list in which
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../src/structs/Item.js"],"names":[],"mappings":"AAsCO,oCAJI,WAAW,MACX,EAAE,GACD;IAAC,IAAI,EAAC,IAAI,CAAC;IAAC,IAAI,EAAC,MAAM,CAAA;CAAC,CAoBnC;AAWM,+BAHI,IAAI,GAAC,IAAI,QACT,OAAO,QAOjB;AAYM,uCARI,WAAW,OAAC,YACZ,IAAI,QACJ,MAAM,GACL,IAAI,CA8Cf;AAYM,yCARI,WAAW,OAAC,cACZ,cAAc,QACd,MAAM,GACL,EAAE,GAAC,IAAI,CAalB;AAsBM,sCAXI,WAAW,QACX,IAAI,aACJ,GAAG,CAAC,IAAI,CAAC,iBACT,KAAK,0BACL,OAAO,MACP,OAAO,yBAAyB,EAAE,WAAW,GAE5C,IAAI,GAAC,IAAI,CAyGpB;AAED;;GAEG;AACH;IACE;;;;;;;;;OASG;IACH,gBATW,EAAE,QACF,IAAI,GAAG,IAAI,UACX,EAAE,GAAG,IAAI,SACT,IAAI,GAAG,IAAI,eACX,EAAE,GAAG,IAAI,UACT,KAAK,GAAC,EAAE,GAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../src/structs/Item.js"],"names":[],"mappings":"AAsCO,oCAJI,WAAW,MACX,EAAE,GACD;IAAC,IAAI,EAAC,IAAI,CAAC;IAAC,IAAI,EAAC,MAAM,CAAA;CAAC,CAoBnC;AAWM,+BAHI,IAAI,GAAC,IAAI,QACT,OAAO,QAOjB;AAYM,uCARI,WAAW,OAAC,YACZ,IAAI,QACJ,MAAM,GACL,IAAI,CA8Cf;AAYM,yCARI,WAAW,OAAC,cACZ,cAAc,QACd,MAAM,GACL,EAAE,GAAC,IAAI,CAalB;AAsBM,sCAXI,WAAW,QACX,IAAI,aACJ,GAAG,CAAC,IAAI,CAAC,iBACT,KAAK,0BACL,OAAO,MACP,OAAO,yBAAyB,EAAE,WAAW,GAE5C,IAAI,GAAC,IAAI,CAyGpB;AAED;;GAEG;AACH;IACE;;;;;;;;;OASG;IACH,gBATW,EAAE,QACF,IAAI,GAAG,IAAI,UACX,EAAE,GAAG,IAAI,SACT,IAAI,GAAG,IAAI,eACX,EAAE,GAAG,IAAI,UACT,KAAK,GAAC,EAAE,GAAC,MAAM,GAAC,IAAI,aACpB,MAA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AED;;OAEG;IACH,QAFY,eAAe,CAI1B;IAED;;;OAGG;IACH,gBAHW,MAAM,GACL,eAAe,CAI1B;IAED;;;OAGG;IACH,kBAHW,eAAe,GACd,OAAO,CAIlB;IAED;;;OAGG;IACH,wBAHW,WAAW,SACX,IAAI,QAId;IAED;;OAEG;IACH,qBAFW,WAAW,QAIrB;IAED;;OAEG;IACH,iBAFW,WAAW,QAIrB;IAED;;;;OAIG;IACH,gBAJW,eAAe,GAAG,eAAe,WACjC,MAAM,cACN,MAAM,QAIhB;IAED;;OAEG;IACH,UAFY,MAAM,CAIjB;CACF;4BAjzBM,iBAAiB;mBAAjB,iBAAiB;4BAAjB,iBAAiB;+BAAjB,iBAAiB;mBAAjB,iBAAiB;sBAAjB,iBAAiB;sBAAjB,iBAAiB;gCAAjB,iBAAiB;gCAAjB,iBAAiB;gCAAjB,iBAAiB;gCAAjB,iBAAiB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export function readBlockSet(decoder: UpdateDecoderV1 | UpdateDecoderV2): BlockSet;
|
|
2
|
+
export function writeBlockSet(encoder: UpdateEncoderV1 | UpdateEncoderV2, blocks: BlockSet): void;
|
|
3
|
+
export class BlockSet {
|
|
4
|
+
/**
|
|
5
|
+
* @type {Map<number, BlockRange>}
|
|
6
|
+
*/
|
|
7
|
+
clients: Map<number, BlockRange>;
|
|
8
|
+
toIdSet(): import("./IdSet.js").IdSet;
|
|
9
|
+
/**
|
|
10
|
+
* Remove id-ranges from update - convert them to skip if applicable.
|
|
11
|
+
*
|
|
12
|
+
* @param {IdSet} exclude
|
|
13
|
+
*/
|
|
14
|
+
exclude(exclude: IdSet): void;
|
|
15
|
+
/**
|
|
16
|
+
* @param {BlockSet} inserts
|
|
17
|
+
*/
|
|
18
|
+
insertInto(inserts: BlockSet): void;
|
|
19
|
+
}
|
|
20
|
+
declare class BlockRange {
|
|
21
|
+
/**
|
|
22
|
+
* @param {Array<Item|GC>} refs
|
|
23
|
+
*/
|
|
24
|
+
constructor(refs: Array<Item | GC>);
|
|
25
|
+
i: number;
|
|
26
|
+
/**
|
|
27
|
+
* @type {Array<Item | GC>}
|
|
28
|
+
*/
|
|
29
|
+
refs: Array<Item | GC>;
|
|
30
|
+
}
|
|
31
|
+
import { Item } from '../internals.js';
|
|
32
|
+
import { GC } from '../internals.js';
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=BlockSet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockSet.d.ts","sourceRoot":"","sources":["../../../src/utils/BlockSet.js"],"names":[],"mappings":"AA2BO,sCANI,eAAe,GAAG,eAAe,GAChC,QAAQ,CA6DnB;AAMM,uCAHI,eAAe,GAAG,eAAe,UACjC,QAAQ,QAUlB;AAeD;IAEI;;OAEG;IACH,SAFU,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAEN;IAG7B,sCAmBC;IAED;;;;OAIG;IACH,iBAFW,KAAK,QAgCf;IAED;;OAEG;IACH,oBAFW,QAAQ,QA8GlB;CACF;AA/LD;IACE;;OAEG;IACH,kBAFW,KAAK,CAAC,IAAI,GAAC,EAAE,CAAC,EAQxB;IALC,UAAU;IACV;;OAEG;IACH,MAFU,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC,CAEV;CAEnB;qBApGM,iBAAiB;mBAAjB,iBAAiB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export function writeStructs(encoder: UpdateEncoderV1 | UpdateEncoderV2, structs: Array<GC | Item>, client: number, idranges: Array<IdRange>): void;
|
|
1
2
|
export function writeClientsStructs(encoder: UpdateEncoderV1 | UpdateEncoderV2, store: StructStore, _sm: Map<number, number>): void;
|
|
2
3
|
export function writeStructsFromIdSet(encoder: UpdateEncoderV1 | UpdateEncoderV2, store: StructStore, idset: IdSet): void;
|
|
3
4
|
export function writeStructsFromTransaction(encoder: UpdateEncoderV1 | UpdateEncoderV2, transaction: Transaction): void;
|
|
@@ -16,6 +17,9 @@ export function encodeStateVectorV2(doc: Doc | Map<number, number>, encoder?: Id
|
|
|
16
17
|
export function encodeStateVector(doc: Doc | Map<number, number>): Uint8Array<ArrayBuffer>;
|
|
17
18
|
import { UpdateEncoderV1 } from '../internals.js';
|
|
18
19
|
import { UpdateEncoderV2 } from '../internals.js';
|
|
20
|
+
import { GC } from '../internals.js';
|
|
21
|
+
import { Item } from '../internals.js';
|
|
22
|
+
import { IdRange } from '../internals.js';
|
|
19
23
|
import { StructStore } from '../internals.js';
|
|
20
24
|
import { IdSet } from '../internals.js';
|
|
21
25
|
import { Transaction } from '../internals.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../../../src/utils/encoding.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../../../src/utils/encoding.js"],"names":[],"mappings":"AAwDO,sCAPI,eAAe,GAAG,eAAe,WACjC,KAAK,CAAC,EAAE,GAAC,IAAI,CAAC,UACd,MAAM,YACN,KAAK,CAAC,OAAO,CAAC,QAmDxB;AAUM,6CAPI,eAAe,GAAG,eAAe,SACjC,WAAW,OACX,GAAG,CAAC,MAAM,EAAC,MAAM,CAAC,QA4B5B;AAYM,+CATI,eAAe,GAAG,eAAe,SACjC,WAAW,SACX,KAAK,QAiBf;AA6KM,qDANI,eAAe,GAAG,eAAe,eACjC,WAAW,QAK2H;AAc1I,sCAPI,QAAQ,CAAC,OAAO,QAChB,GAAG,sBACH,GAAG,kBACH,eAAe,GAAG,eAAe,QAqFd;AAavB,oCANI,QAAQ,CAAC,OAAO,QAChB,GAAG,sBACH,GAAG,QAI8H;AAcrI,oCAPI,GAAG,UACH,UAAU,sBACV,GAAG,aACH,OAAO,eAAe,GAAG,OAAO,eAAe,QAOzD;AAaM,kCANI,GAAG,UACH,UAAU,sBACV,GAAG,QAIiH;AAYxH,4CANI,eAAe,GAAG,eAAe,OACjC,GAAG,sBACH,GAAG,CAAC,MAAM,EAAC,MAAM,CAAC,QAO5B;AAeM,2CAPI,GAAG,6BACH,UAAU,YACV,eAAe,GAAG,eAAe,GAChC,UAAU,CAAC,WAAW,CAAC,CAuBlC;AAcM,yCANI,GAAG,6BACH,UAAU,GACT,UAAU,CAAC,WAAW,CAAC,CAI8G;AAU1I,yCALI,cAAc,GAAG,cAAc,GAC9B,GAAG,CAAC,MAAM,EAAC,MAAM,CAAC,CAa7B;AAoBM,gDALI,UAAU,GACT,GAAG,CAAC,MAAM,EAAC,MAAM,CAAC,CAI4F;AAOnH,0CAJI,cAAc,GAAG,cAAc,MAC/B,GAAG,CAAC,MAAM,EAAC,MAAM,CAAC,mCAU5B;AAQM,kDALI,cAAc,GAAG,cAAc,OAC/B,GAAG,mCAIgG;AAWvG,yCANI,GAAG,GAAC,GAAG,CAAC,MAAM,EAAC,MAAM,CAAC,YACtB,cAAc,GAAG,cAAc,GAC9B,UAAU,CAAC,WAAW,CAAC,CAWlC;AAUM,uCALI,GAAG,GAAC,GAAG,CAAC,MAAM,EAAC,MAAM,CAAC,GACrB,UAAU,CAAC,WAAW,CAAC,CAImD;gCArkB/E,iBAAiB;gCAAjB,iBAAiB;mBAAjB,iBAAiB;qBAAjB,iBAAiB;wBAAjB,iBAAiB;4BAAjB,iBAAiB;sBAAjB,iBAAiB;4BAAjB,iBAAiB;0BAGE,eAAe;oBAHlC,iBAAiB;gCAAjB,iBAAiB;gCAAjB,iBAAiB;+BAAjB,iBAAiB;+BAAjB,iBAAiB;+BAAjB,iBAAiB;+BAAjB,iBAAiB"}
|
package/dist/src/utils/meta.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export function excludeContentIds(content: ContentIds, excludeContent: ContentId
|
|
|
18
18
|
inserts: idset.IdSet;
|
|
19
19
|
deletes: idset.IdSet;
|
|
20
20
|
};
|
|
21
|
-
export function
|
|
21
|
+
export function excludeContentMap(content: ContentMap, excludeContent: ContentIds | ContentMap): {
|
|
22
22
|
inserts: idmap.IdMap<any>;
|
|
23
23
|
deletes: idmap.IdMap<any>;
|
|
24
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/utils/meta.js"],"names":[],"mappings":"AAsBO,2CAHI,OAAO,YAAY,EAAE,KAAK,YAC1B,OAAO,YAAY,EAAE,KAAK;;;EAEmF;AAKjH,2DAFI,UAAU;;;EAKpB;AAKM,8CAFI,OAAO,UAAU,EAAE,GAAG;;;EAKhC;AAMM,sDAHI,OAAO,UAAU,EAAE,GAAG,YACtB,OAAO,UAAU,EAAE,GAAG;;;EAGwD;AAMlF,2CAHI,UAAU,kBACV,UAAU;;;EAGiH;AAM/H,
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/utils/meta.js"],"names":[],"mappings":"AAsBO,2CAHI,OAAO,YAAY,EAAE,KAAK,YAC1B,OAAO,YAAY,EAAE,KAAK;;;EAEmF;AAKjH,2DAFI,UAAU;;;EAKpB;AAKM,8CAFI,OAAO,UAAU,EAAE,GAAG;;;EAKhC;AAMM,sDAHI,OAAO,UAAU,EAAE,GAAG,YACtB,OAAO,UAAU,EAAE,GAAG;;;EAGwD;AAMlF,2CAHI,UAAU,kBACV,UAAU;;;EAGiH;AAM/H,2CAHI,UAAU,kBACV,UAAU,GAAG,UAAU;;;EAKjC;AAKM,2CAFI,KAAK,CAAC,UAAU,CAAC;;;EAK3B;AAKM,0CAFI,KAAK,CAAC,UAAU,CAAC;;;EAK3B;AAMM,0CAHI,OAAO,YAAY,EAAE,KAAK,CAAC,GAAG,CAAC,WAC/B,OAAO,YAAY,EAAE,KAAK,CAAC,GAAG,CAAC;;;EAEkC;AAOrE,2DAJI,UAAU,eACV,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,gBAClC,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;;;EAK5C;AAMM,yCAHI,OAAO,oBAAoB,EAAE,YAAY,cACzC,UAAU,QAKpB;AAKM,6CAFI,UAAU,2BAMpB;AAQM,wCAHI,OAAO,oBAAoB,EAAE,YAAY,GACxC,UAAU,CAKrB;AAKM,sCAFI,UAAU,CAAC,GAAG,CAAC,cAE4E;AAQ/F,yCAHI,OAAO,oBAAoB,EAAE,YAAY,cACzC,UAAU,QAKpB;AAQM,wCAHI,OAAO,oBAAoB,EAAE,YAAY,GACxC,UAAU,CAKrB;AAKM,6CAFI,UAAU,2BAMpB;AAMM,0CAHI,UAAU,QACV,UAAU,GAAC,UAAU;;;EAK/B;AAMM,0CAHI,UAAU,QACV,UAAU,GAAC,UAAU;;;EAK/B;AAKM,sCAFI,UAAU,CAAC,GAAG,CAAC,cAE4E;AAQ/F,6CAJI,UAAU,mBACV,CAAC,CAAC,EAAC,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,KAAG,OAAO,mBAC/C,CAAC,CAAC,EAAC,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,KAAG,OAAO;;;EAEwJ;yBAlLrM;IAAE,OAAO,EAAE,OAAO,YAAY,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,OAAO,YAAY,EAAE,KAAK,CAAA;CAAE;yBAI5E;IAAE,OAAO,EAAE,OAAO,YAAY,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAAC,OAAO,EAAE,OAAO,YAAY,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;CAAE;uBAV5E,YAAY;uBADZ,YAAY"}
|
|
@@ -55,6 +55,7 @@ export function encodeStateVectorFromUpdateV2(update: Uint8Array, YEncoder?: typ
|
|
|
55
55
|
export function encodeStateVectorFromUpdate(update: Uint8Array): Uint8Array<ArrayBuffer>;
|
|
56
56
|
export function createContentIdsFromUpdateV2(update: Uint8Array, YDecoder?: typeof UpdateDecoderV2 | typeof UpdateDecoderV1): import("./meta.js").ContentIds;
|
|
57
57
|
export function createContentIdsFromUpdate(update: Uint8Array): import("./meta.js").ContentIds;
|
|
58
|
+
export function sliceStruct(left: Item | GC | Skip, diff: number): Item | GC;
|
|
58
59
|
export function mergeUpdatesV2(updates: Array<Uint8Array<ArrayBuffer>>, YDecoder?: typeof UpdateDecoderV1 | typeof UpdateDecoderV2, YEncoder?: typeof UpdateEncoderV1 | typeof UpdateEncoderV2): Uint8Array<ArrayBuffer>;
|
|
59
60
|
export function diffUpdateV2(update: Uint8Array, sv: Uint8Array, YDecoder?: typeof UpdateDecoderV1 | typeof UpdateDecoderV2, YEncoder?: typeof UpdateEncoderV1 | typeof UpdateEncoderV2): Uint8Array<ArrayBuffer>;
|
|
60
61
|
export function diffUpdate(update: Uint8Array<ArrayBuffer>, sv: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updates.d.ts","sourceRoot":"","sources":["../../../src/utils/updates.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"updates.d.ts","sourceRoot":"","sources":["../../../src/utils/updates.js"],"names":[],"mappings":"AA0FA;IACE;;;OAGG;IACH,qBAHW,eAAe,GAAG,eAAe,eACjC,OAAO,EAWjB;IARC,gDAA6C;IAC7C;;OAEG;IACH,MAFU,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,EAAE,CAEjB;IAChB,cAAiB;IACjB,qBAA8B;IAIhC;;OAEG;IACH,QAFY,IAAI,GAAG,EAAE,GAAG,IAAI,GAAE,IAAI,CAQjC;CACF;AAKM,kCAFI,UAAU,QAEkD;AAMhE,oCAHI,UAAU,aACV,OAAO,eAAe,GAAG,OAAO,eAAe,QAYzD;AAKM,qCAFI,UAAU;;;EAE0D;AAOxE,uCAJI,UAAU,aACV,OAAO,eAAe,GAAG,OAAO,eAAe;;;EAczD;AAED;IACE;;OAEG;IACH,qBAFW,eAAe,GAAG,eAAe,EAkB3C;IAfC,mBAAmB;IACnB,mBAAmB;IACnB,gBAAgB;IAChB,2CAA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;;OAEG;IACH,eAFU,IAAI,GAAG,KAAK,CAAC,iBAAiB,CAAC,CAEhB;IACzB;;;OAGG;IACH,iBAAqE;IACrE,uBAAsG;IAKtG;;;OAGG;IACH,wBAA2B;IAc7B,qBAGC;IAED;;;OAGG;IACH,cAFU,KAAK,CAAC,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAIhD;IAED;;OAEG;IACH,cAFY,KAAK,CAAC,GAAG,CAAC,OAAC,CAItB;IAED;;;;;;;;;OASG;IACH,cAHW,GAAG,QACH,IAAI,GAAC,IAAI,QASnB;IAFG,aAAmB;IAIvB;;OAEG;IACH,SAFY,KAAK,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"ytype.d.ts","sourceRoot":"","sources":["../../src/ytype.js"],"names":[],"mappings":"AA4CO,4CAAiH;AAaxH;IACE;;;;;;OAMG;IACH,kBANW,IAAI,GAAC,IAAI,SACT,IAAI,GAAC,IAAI,SACT,MAAM,qBACN,GAAG,CAAC,MAAM,EAAC,GAAG,CAAC,MACf,0BAA0B,EAQpC;IALC,kBAAgB;IAChB,mBAAkB;IAClB,cAAkB;IAClB,oCAA0C;IAC1C,+BAAY;IAGd;;OAEG;IACH,gBAgBC;IAED;;;;;;;OAOG;IACH,wBAPW,WAAW,UACX,KAAK,UACL,MAAM;;aA4EhB;CACF;AAqHM,2CATI,WAAW,UACX,KAAK,WACL,oBAAoB,WACpB,OAAO,mBAAmB,EAAE,eAAe;;SA0BrD;AASM,iDANI,WAAW,UACX,KAAK,WACL,oBAAoB,UACpB,KAAK,CAAC,GAAG,CAAC,GAAC,MAAM;;SA0B3B;AAWM,wCARI,WAAW,WACX,oBAAoB,UACpB,MAAM,GACL,oBAAoB,CAkD/B;AAED;IACE;;;OAGG;IACH,eAHW,IAAI,SACJ,MAAM,EAOhB;IAHC,QAAU;IACV,cAAkB;IAClB,kBAA8C;CAEjD;AAqDM,mCAHI,KAAK,SACL,MAAM,4BAgDhB;AAWM,kDAJI,K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gBAAgB;gCAAhB,gBAAgB;gCAAhB,gBAAgB;wBAIC,aAAa"}
|
|
@@ -9,5 +9,6 @@ export function testDeletedItemsBase(_tc: t.TestCase): void;
|
|
|
9
9
|
export function testDeletedItems2(_tc: t.TestCase): void;
|
|
10
10
|
export function testDependentChanges(tc: t.TestCase): void;
|
|
11
11
|
export function testContainsUpdate(_tc: t.TestCase): void;
|
|
12
|
+
export function testContainsUpdate2(_tc: t.TestCase): void;
|
|
12
13
|
import * as t from 'lib0/testing';
|
|
13
14
|
//# sourceMappingURL=snapshot.tests.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot.tests.d.ts","sourceRoot":"","sources":["../../tests/snapshot.tests.js"],"names":[],"mappings":"AAQO,+BAFI,CAAC,CAAC,QAAQ,QASpB;AAKM,4CAFI,CAAC,CAAC,QAAQ,QAYpB;AAKM,8CAFI,CAAC,CAAC,QAAQ,QAYpB;AAKM,8CAFI,CAAC,CAAC,QAAQ,QAiBpB;AAKM,oDAFI,CAAC,CAAC,QAAQ,QAwBpB;AAKM,6CAFI,CAAC,CAAC,QAAQ,QAapB;AAKM,yCAFI,CAAC,CAAC,QAAQ,QAepB;AAKM,0CAFI,CAAC,CAAC,QAAQ,QAapB;AAKM,uCAFI,CAAC,CAAC,QAAQ,QAapB;AAKM,yCAFI,CAAC,CAAC,QAAQ,QAyCpB;AAKM,wCAFI,CAAC,CAAC,QAAQ,QAsBpB;
|
|
1
|
+
{"version":3,"file":"snapshot.tests.d.ts","sourceRoot":"","sources":["../../tests/snapshot.tests.js"],"names":[],"mappings":"AAQO,+BAFI,CAAC,CAAC,QAAQ,QASpB;AAKM,4CAFI,CAAC,CAAC,QAAQ,QAYpB;AAKM,8CAFI,CAAC,CAAC,QAAQ,QAYpB;AAKM,8CAFI,CAAC,CAAC,QAAQ,QAiBpB;AAKM,oDAFI,CAAC,CAAC,QAAQ,QAwBpB;AAKM,6CAFI,CAAC,CAAC,QAAQ,QAapB;AA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C,IAAI;UAAM,CAAC,CAAC,IAAI;UAAM,CAAC,CAAC,IAAI;EA6TjS;mCAtCY,CAAC,QAEH,aAAa,KACZ,CAAC;qCAsCA,UAAU,CAAC,OAAO,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"testHelper.d.ts","sourceRoot":"","sources":["../../tests/testHelper.js"],"names":[],"mappings":";AAoCA,0BAAwB;;;;;;yBAOM,QAAQ;;;;;;;;;;;;2BASR,UAAU;;;;;;AAiBxC;;GAEG;AACH;IACE;;;OAGG;IACH,2BAHW,aAAa,YACb,MAAM,EA8BhB;IA1BC,eAAsB;IACtB;;OAEG;IACH,IAFU,aAAa,CAEA;IACvB;;OAEG;IACH,WAFU,GAAG,CAAC,aAAa,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAErB;IAE1B;;;;OAIG;IACH,SAFU,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAEvB;IAanB;;OAEG;IACH,mBAGC;IAED;;;OAGG;IACH,gBAgBC;IAED;;;;;;OAMG;IACH,kBAHW,UAAU,gBACV,aAAa,QAIvB;CACF;AAED;;;;;GAKG;AACH;IACE;;OAEG;IACH,iBAFW,IAAI,CAAC,IAAI,EAenB;IAZC;;OAEG;IACH,UAFU,GAAG,CAAC,aAAa,CAAC,CAEH;IACzB;;OAEG;IACH,aAFU,GAAG,CAAC,aAAa,CAAC,CAEA;IAC5B;;OAEG;IACH,MAFU,IAAI,CAAC,IAAI,CAEJ;IAGjB;;;OAGG;IACH,kBAFW,MAAM,iBAIhB;IAED;;;;;OAKG;IACH,sBAFY,OAAO,CA0BlB;IAED;;OAEG;IACH,oBAFY,OAAO,CAQlB;IAED,qBAEC;IAED,sBAEC;IAED,gBAGC;IAED;;OAEG;IACH,oBAFY,OAAO,CAQlB;IAED;;OAEG;IACH,mBAFY,OAAO,CAiBlB;CACF;AASM,qBANM,CAAC,MACH,CAAC,CAAC,QAAQ,cACV;IAAC,KAAK,CAAC,EAAC,MAAM,CAA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,CAAC,OAAO,gBAAgB,CAAC;mBA5kB7B,iBAAiB;sBANd,WAAW;mBADd,cAAc"}
|
|
@@ -2,6 +2,7 @@ export function testMergeUpdates(tc: t.TestCase): void;
|
|
|
2
2
|
export function testKeyEncoding(tc: t.TestCase): void;
|
|
3
3
|
export function testMergeUpdates1(_tc: t.TestCase): void;
|
|
4
4
|
export function testMergeUpdates2(_tc: t.TestCase): void;
|
|
5
|
+
export function testMergeUpdatesStressTest(_tc: t.TestCase): void;
|
|
5
6
|
export function testMergePendingUpdates(_tc: t.TestCase): void;
|
|
6
7
|
export function testObfuscateUpdates(_tc: t.TestCase): void;
|
|
7
8
|
export function testIntersectDoc(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updates.tests.d.ts","sourceRoot":"","sources":["../../tests/updates.tests.js"],"names":[],"mappings":"AAwGO,qCAFI,CAAC,CAAC,QAAQ,QAapB;AAKM,oCAFI,CAAC,CAAC,QAAQ,QAuBpB;AA0FM,uCAFI,CAAC,CAAC,QAAQ,QAepB;AAKM,uCAFI,CAAC,CAAC,QAAQ,QAepB;AAKM,6CAFI,CAAC,CAAC,QAAQ,QA4CpB;AAKM,0CAFI,CAAC,CAAC,QAAQ,QAgDpB;AAEM,yCAUN;;
|
|
1
|
+
{"version":3,"file":"updates.tests.d.ts","sourceRoot":"","sources":["../../tests/updates.tests.js"],"names":[],"mappings":"AAwGO,qCAFI,CAAC,CAAC,QAAQ,QAapB;AAKM,oCAFI,CAAC,CAAC,QAAQ,QAuBpB;AA0FM,uCAFI,CAAC,CAAC,QAAQ,QAepB;AAKM,uCAFI,CAAC,CAAC,QAAQ,QAepB;AAKM,gDAFI,CAAC,CAAC,QAAQ,QA2BpB;AAKM,6CAFI,CAAC,CAAC,QAAQ,QA4CpB;AAKM,0CAFI,CAAC,CAAC,QAAQ,QAgDpB;AAEM,yCAUN;;kBAtYa,CAAS,IAA8B,EAA9B,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,KAAE,UAAU,CAAC,WAAW,CAAC;yBAChE,CAAS,IAAK,EAAL,CAAC,CAAC,GAAG,KAAE,UAAU,CAAC,WAAW,CAAC;iBACvC,CAAS,IAAK,EAAL,CAAC,CAAC,GAAG,EAAE,IAAU,EAAV,UAAU,KAAE,IAAI;eAChC,CAAS,IAAU,EAAV,UAAU,KAAE,IAAI;4BACzB,CAAS,IAAU,EAAV,UAAU,KAAE;QAAC,OAAO,EAAC,CAAC,CAAC,KAAK,CAAC;QAAA,OAAO,EAAC,CAAC,CAAC,KAAK,CAAA;KAAC;uBACtD,CAAS,IAAK,EAAL,CAAC,CAAC,GAAG,KAAE,UAAU,CAAC,WAAW,CAAC;iCACvC,CAAS,IAAU,EAAV,UAAU,KAAE,UAAU,CAAC,WAAW,CAAC;qBAC5C,QAAQ,GAAC,UAAU;iBACnB,MAAM;gBACN,CAAS,IAAuB,EAAvB,UAAU,CAAC,WAAW,CAAC,EAAE,IAAuB,EAAvB,UAAU,CAAC,WAAW,CAAC,KAAE,UAAU,CAAC,WAAW,CAAC;;mBArB7E,cAAc;mBACd,iBAAiB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@y/y",
|
|
3
|
-
"version": "14.0.0-rc.
|
|
3
|
+
"version": "14.0.0-rc.2",
|
|
4
4
|
"description": "Shared Editing Library",
|
|
5
5
|
"types": "./dist/src/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"clean": "rm -rf dist",
|
|
14
14
|
"test": "NODE_ENV=development node ./tests/index.js --repetition-time 50",
|
|
15
15
|
"test-extensive": "node ./tests/index.js --production --repetition-time 10000",
|
|
16
|
-
"dist": "npm run clean && (tsc --skipLibCheck|| true)",
|
|
16
|
+
"dist": "npm run clean && (tsc --skipLibCheck --noEmit false|| true)",
|
|
17
|
+
"release": "PRODUCTION=1 npm run dist && test -e dist/src/index.d.ts && np",
|
|
17
18
|
"lint": "markdownlint README.md && standard && tsc --skipLibCheck",
|
|
18
|
-
"preversion": "PRODUCTION=1 npm run dist && test -e dist/src/index.d.ts",
|
|
19
19
|
"debug": "npm run gentesthtml && 0serve -o test.html",
|
|
20
20
|
"debug:node": "node --inspect-brk tests/index.js",
|
|
21
21
|
"trace-deopt": "clear && node --trace-deopt ./tests/index.js",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
},
|
|
77
77
|
"homepage": "https://docs.yjs.dev",
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"lib0": "^1.0.0-rc.
|
|
79
|
+
"lib0": "^1.0.0-rc.5"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@types/node": "^22.14.1",
|
package/src/internals.js
CHANGED
|
@@ -14,7 +14,7 @@ export * from './utils/Transaction.js'
|
|
|
14
14
|
export * from './utils/UndoManager.js'
|
|
15
15
|
export * from './utils/updates.js'
|
|
16
16
|
export * from './utils/YEvent.js'
|
|
17
|
-
export * from './utils/
|
|
17
|
+
export * from './utils/BlockSet.js'
|
|
18
18
|
export * from './utils/IdMap.js'
|
|
19
19
|
export * from './utils/AttributionManager.js'
|
|
20
20
|
export * from './utils/delta-helpers.js'
|
package/src/structs/Item.js
CHANGED
|
@@ -278,7 +278,7 @@ export class Item extends AbstractStruct {
|
|
|
278
278
|
* @param {ID | null} origin
|
|
279
279
|
* @param {Item | null} right
|
|
280
280
|
* @param {ID | null} rightOrigin
|
|
281
|
-
* @param {YType|ID|null} parent Is a type if integrated, is null if it is possible to copy parent from left or right, is ID before integration to search for it
|
|
281
|
+
* @param {YType|ID|string|null} parent Is a type if integrated, is null if it is possible to copy parent from left or right, is ID before integration to search for it, is string if child of top-level-parent
|
|
282
282
|
* @param {string | null} parentSub
|
|
283
283
|
* @param {AbstractContent} content
|
|
284
284
|
*/
|
|
@@ -305,7 +305,7 @@ export class Item extends AbstractStruct {
|
|
|
305
305
|
*/
|
|
306
306
|
this.rightOrigin = rightOrigin
|
|
307
307
|
/**
|
|
308
|
-
* @type {YType|ID|null}
|
|
308
|
+
* @type {YType|ID|string|null}
|
|
309
309
|
*/
|
|
310
310
|
this.parent = parent
|
|
311
311
|
/**
|
|
@@ -414,7 +414,7 @@ export class Item extends AbstractStruct {
|
|
|
414
414
|
}
|
|
415
415
|
if ((this.left && this.left.constructor === GC) || (this.right && this.right.constructor === GC)) {
|
|
416
416
|
this.parent = null
|
|
417
|
-
} else if (
|
|
417
|
+
} else if (this.parent == null) {
|
|
418
418
|
// only set parent if this shouldn't be garbage collected
|
|
419
419
|
if (this.left && this.left.constructor === Item) {
|
|
420
420
|
this.parent = this.left.parent
|
|
@@ -430,6 +430,8 @@ export class Item extends AbstractStruct {
|
|
|
430
430
|
} else {
|
|
431
431
|
this.parent = /** @type {ContentType} */ (parentItem.content).type
|
|
432
432
|
}
|
|
433
|
+
} else if (typeof this.parent === 'string') {
|
|
434
|
+
this.parent = transaction.doc.get(this.parent)
|
|
433
435
|
}
|
|
434
436
|
return null
|
|
435
437
|
}
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createID,
|
|
3
|
+
readItemContent,
|
|
4
|
+
findIndexCleanStart,
|
|
5
|
+
Skip,
|
|
6
|
+
createIdSet,
|
|
7
|
+
sliceStruct,
|
|
8
|
+
IdRange,
|
|
9
|
+
GC, Item, ID,
|
|
10
|
+
writeStructs
|
|
11
|
+
} from '../internals.js'
|
|
12
|
+
|
|
13
|
+
import * as decoding from 'lib0/decoding'
|
|
14
|
+
import * as binary from 'lib0/binary'
|
|
15
|
+
import * as map from 'lib0/map'
|
|
16
|
+
import * as array from 'lib0/array'
|
|
17
|
+
import * as math from 'lib0/math'
|
|
18
|
+
import * as encoding from 'lib0/encoding'
|
|
19
|
+
import * as number from 'lib0/number'
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @param {UpdateDecoderV1 | UpdateDecoderV2} decoder The decoder object to read data from.
|
|
23
|
+
* @return {BlockSet}
|
|
24
|
+
*
|
|
25
|
+
* @private
|
|
26
|
+
* @function
|
|
27
|
+
*/
|
|
28
|
+
export const readBlockSet = (decoder) => {
|
|
29
|
+
const clientRefs = new BlockSet()
|
|
30
|
+
const numOfStateUpdates = decoding.readVarUint(decoder.restDecoder)
|
|
31
|
+
for (let i = 0; i < numOfStateUpdates; i++) {
|
|
32
|
+
const numberOfBlocks = decoding.readVarUint(decoder.restDecoder)
|
|
33
|
+
/**
|
|
34
|
+
* @type {Array<GC|Item>}
|
|
35
|
+
*/
|
|
36
|
+
const refs = new Array(numberOfBlocks)
|
|
37
|
+
const client = decoder.readClient()
|
|
38
|
+
let clock = decoding.readVarUint(decoder.restDecoder)
|
|
39
|
+
clientRefs.clients.set(client, new BlockRange(refs))
|
|
40
|
+
for (let i = 0; i < numberOfBlocks; i++) {
|
|
41
|
+
const info = decoder.readInfo()
|
|
42
|
+
switch (binary.BITS5 & info) {
|
|
43
|
+
case 0: { // GC
|
|
44
|
+
const len = decoder.readLen()
|
|
45
|
+
refs[i] = new GC(createID(client, clock), len)
|
|
46
|
+
clock += len
|
|
47
|
+
break
|
|
48
|
+
}
|
|
49
|
+
case 10: { // Skip Block (nothing to apply)
|
|
50
|
+
// @todo we could reduce the amount of checks by adding Skip block to clientRefs so we know that something is missing.
|
|
51
|
+
const len = decoding.readVarUint(decoder.restDecoder)
|
|
52
|
+
refs[i] = new Skip(createID(client, clock), len)
|
|
53
|
+
clock += len
|
|
54
|
+
break
|
|
55
|
+
}
|
|
56
|
+
default: { // Item with content
|
|
57
|
+
/**
|
|
58
|
+
* The optimized implementation doesn't use any variables because inlining variables is faster.
|
|
59
|
+
* Below a non-optimized version is shown that implements the basic algorithm with
|
|
60
|
+
* a few comments
|
|
61
|
+
*/
|
|
62
|
+
const cantCopyParentInfo = (info & (binary.BIT7 | binary.BIT8)) === 0
|
|
63
|
+
// If parent = null and neither left nor right are defined, then we know that `parent` is child of `y`
|
|
64
|
+
// and we read the next string as parentYKey.
|
|
65
|
+
// It indicates how we store/retrieve parent from `y.share`
|
|
66
|
+
// @type {string|null}
|
|
67
|
+
const block = new Item(
|
|
68
|
+
createID(client, clock),
|
|
69
|
+
null, // left
|
|
70
|
+
(info & binary.BIT8) === binary.BIT8 ? decoder.readLeftID() : null, // origin
|
|
71
|
+
null, // right
|
|
72
|
+
(info & binary.BIT7) === binary.BIT7 ? decoder.readRightID() : null, // right origin
|
|
73
|
+
cantCopyParentInfo ? (decoder.readParentInfo() ? decoder.readString() : decoder.readLeftID()) : null, // parent
|
|
74
|
+
cantCopyParentInfo && (info & binary.BIT6) === binary.BIT6 ? decoder.readString() : null, // parentSub
|
|
75
|
+
readItemContent(decoder, info) // item content
|
|
76
|
+
)
|
|
77
|
+
refs[i] = block
|
|
78
|
+
clock += block.length
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return clientRefs
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @param {UpdateEncoderV1 | UpdateEncoderV2} encoder
|
|
88
|
+
* @param {BlockSet} blocks
|
|
89
|
+
*/
|
|
90
|
+
export const writeBlockSet = (encoder, blocks) => {
|
|
91
|
+
// write # states that were updated
|
|
92
|
+
encoding.writeVarUint(encoder.restEncoder, blocks.clients.size)
|
|
93
|
+
// Write items with higher client ids first
|
|
94
|
+
// This heavily improves the conflict algorithm.
|
|
95
|
+
array.from(blocks.clients.entries()).sort((a, b) => b[0] - a[0]).forEach(([client, blockrange]) => {
|
|
96
|
+
writeStructs(encoder, blockrange.refs, client, [new IdRange(0, number.MAX_SAFE_INTEGER)])
|
|
97
|
+
})
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
class BlockRange {
|
|
101
|
+
/**
|
|
102
|
+
* @param {Array<Item|GC>} refs
|
|
103
|
+
*/
|
|
104
|
+
constructor (refs) {
|
|
105
|
+
this.i = 0
|
|
106
|
+
/**
|
|
107
|
+
* @type {Array<Item | GC>}
|
|
108
|
+
*/
|
|
109
|
+
this.refs = refs
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export class BlockSet {
|
|
114
|
+
constructor () {
|
|
115
|
+
/**
|
|
116
|
+
* @type {Map<number, BlockRange>}
|
|
117
|
+
*/
|
|
118
|
+
this.clients = map.create()
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
toIdSet () {
|
|
122
|
+
const inserts = createIdSet()
|
|
123
|
+
this.clients.forEach((ranges, clientid) => {
|
|
124
|
+
let lastClock = 0
|
|
125
|
+
let lastLen = 0
|
|
126
|
+
ranges.refs.forEach(block => {
|
|
127
|
+
if (block instanceof Skip) return
|
|
128
|
+
if (lastClock + lastLen === block.id.clock) {
|
|
129
|
+
// default case: extend prev entry
|
|
130
|
+
lastLen += block.length
|
|
131
|
+
} else {
|
|
132
|
+
lastLen > 0 && inserts.add(clientid, lastClock, lastLen)
|
|
133
|
+
lastClock = block.id.clock
|
|
134
|
+
lastLen = block.length
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
inserts.add(clientid, lastClock, lastLen)
|
|
138
|
+
})
|
|
139
|
+
return inserts
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Remove id-ranges from update - convert them to skip if applicable.
|
|
144
|
+
*
|
|
145
|
+
* @param {IdSet} exclude
|
|
146
|
+
*/
|
|
147
|
+
exclude (exclude) {
|
|
148
|
+
const clientids = this.clients.size < exclude.clients.size ? this.clients.keys() : exclude.clients.keys()
|
|
149
|
+
for (const client of clientids) {
|
|
150
|
+
const range = exclude.clients.get(client)
|
|
151
|
+
const structs = this.clients.get(client)?.refs
|
|
152
|
+
if (range == null || structs == null) return
|
|
153
|
+
const firstStruct = structs[0]
|
|
154
|
+
const lastStruct = structs[structs.length - 1]
|
|
155
|
+
const idranges = range.getIds()
|
|
156
|
+
for (let i = 0; i < idranges.length; i++) {
|
|
157
|
+
const range = idranges[i]
|
|
158
|
+
let startIndex = 0
|
|
159
|
+
if (range.clock >= lastStruct.id.clock + lastStruct.length) continue
|
|
160
|
+
if (range.clock > firstStruct.id.clock) {
|
|
161
|
+
startIndex = findIndexCleanStart(null, structs, range.clock)
|
|
162
|
+
}
|
|
163
|
+
let endIndex = structs.length // must be set here, after structs is modified
|
|
164
|
+
if (range.clock + range.len <= firstStruct.id.clock) continue
|
|
165
|
+
if (range.clock + range.len < lastStruct.id.clock + lastStruct.length) {
|
|
166
|
+
endIndex = findIndexCleanStart(null, structs, range.clock + range.len)
|
|
167
|
+
}
|
|
168
|
+
if (startIndex < endIndex) {
|
|
169
|
+
structs[startIndex] = new Skip(new ID(client, range.clock), range.len)
|
|
170
|
+
const d = endIndex - startIndex
|
|
171
|
+
if (d > 1) {
|
|
172
|
+
structs.splice(startIndex + 1, d - 1)
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* @param {BlockSet} inserts
|
|
181
|
+
*/
|
|
182
|
+
insertInto (inserts) {
|
|
183
|
+
inserts.clients.forEach((newranges, clientid) => {
|
|
184
|
+
const ranges = this.clients.get(clientid)
|
|
185
|
+
if (ranges == null) {
|
|
186
|
+
this.clients.set(clientid, newranges)
|
|
187
|
+
} else {
|
|
188
|
+
const localIsLeft = ranges.refs[0].id.clock < newranges.refs[0].id.clock
|
|
189
|
+
const leftRanges = (localIsLeft ? ranges : newranges).refs
|
|
190
|
+
const rightRanges = (localIsLeft ? newranges : ranges).refs
|
|
191
|
+
const lastBlockLeft = array.last(leftRanges)
|
|
192
|
+
const firstBlockRight = rightRanges[0]
|
|
193
|
+
const gapSize = firstBlockRight.id.clock - lastBlockLeft.id.clock - lastBlockLeft.length
|
|
194
|
+
if (gapSize >= 0) {
|
|
195
|
+
// we can do a simple efficient merge
|
|
196
|
+
if (gapSize > 0) {
|
|
197
|
+
leftRanges.push(new Skip(new ID(clientid, lastBlockLeft.id.clock + lastBlockLeft.length), gapSize))
|
|
198
|
+
}
|
|
199
|
+
leftRanges.push(...rightRanges)
|
|
200
|
+
ranges.refs = leftRanges
|
|
201
|
+
} else {
|
|
202
|
+
// requires more computation because we need to filter duplicates
|
|
203
|
+
/**
|
|
204
|
+
* @type {Array<GC|Item>}
|
|
205
|
+
*/
|
|
206
|
+
const result = []
|
|
207
|
+
let nextExpectedClock = leftRanges[0].id.clock
|
|
208
|
+
/**
|
|
209
|
+
* @param {Item|GC} block
|
|
210
|
+
*/
|
|
211
|
+
const addToResult = block => {
|
|
212
|
+
result.push(block)
|
|
213
|
+
nextExpectedClock = block.id.clock + block.length
|
|
214
|
+
}
|
|
215
|
+
let li = 0
|
|
216
|
+
let ri = 0
|
|
217
|
+
/**
|
|
218
|
+
* @type {Item|GC|undefined}
|
|
219
|
+
*/
|
|
220
|
+
let lblock = leftRanges[li]
|
|
221
|
+
/**
|
|
222
|
+
* @type {Item|GC|undefined}
|
|
223
|
+
*/
|
|
224
|
+
let rblock = rightRanges[ri]
|
|
225
|
+
const applyLeft = () => {
|
|
226
|
+
if (lblock === undefined) return
|
|
227
|
+
// first try to consume left
|
|
228
|
+
// left: filter skips and known ops
|
|
229
|
+
while (lblock !== undefined && (lblock.constructor === Skip || lblock.id.clock + lblock.length <= nextExpectedClock)) {
|
|
230
|
+
lblock = leftRanges[++li]
|
|
231
|
+
}
|
|
232
|
+
// left: trim first op
|
|
233
|
+
if (lblock !== undefined && lblock.id.clock < nextExpectedClock && lblock.id.clock + lblock.length > nextExpectedClock) {
|
|
234
|
+
lblock = sliceStruct(lblock, lblock.id.clock + lblock.length - nextExpectedClock)
|
|
235
|
+
}
|
|
236
|
+
// left: add to result
|
|
237
|
+
while (lblock !== undefined && lblock.id.clock === nextExpectedClock && lblock.constructor !== Skip) {
|
|
238
|
+
addToResult(lblock)
|
|
239
|
+
lblock = leftRanges[++li]
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
const applyRight = () => {
|
|
243
|
+
// right: filter skips and known ops
|
|
244
|
+
while (rblock !== undefined && (rblock.constructor === Skip || rblock.id.clock + rblock.length <= nextExpectedClock)) {
|
|
245
|
+
rblock = rightRanges[++ri]
|
|
246
|
+
}
|
|
247
|
+
// right: trim first op
|
|
248
|
+
if (rblock !== undefined && rblock.id.clock < nextExpectedClock && rblock.id.clock + rblock.length > nextExpectedClock) {
|
|
249
|
+
rblock = sliceStruct(rblock, rblock.id.clock + rblock.length - nextExpectedClock)
|
|
250
|
+
}
|
|
251
|
+
// right: add to result
|
|
252
|
+
while (rblock !== undefined && rblock.id.clock === nextExpectedClock && rblock.constructor !== Skip) {
|
|
253
|
+
addToResult(rblock)
|
|
254
|
+
rblock = rightRanges[++ri]
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
for (; li < leftRanges.length && ri < rightRanges.length;) {
|
|
258
|
+
applyLeft()
|
|
259
|
+
applyRight()
|
|
260
|
+
// add skip if necessary
|
|
261
|
+
const minNextClock = math.min(lblock?.id.clock || 0, rblock?.id.clock || 0)
|
|
262
|
+
const gapSize = minNextClock - nextExpectedClock
|
|
263
|
+
if (gapSize > 0) {
|
|
264
|
+
addToResult(new Skip(new ID(clientid, nextExpectedClock), gapSize))
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
while (li < leftRanges.length) {
|
|
268
|
+
applyLeft()
|
|
269
|
+
if (lblock !== undefined) {
|
|
270
|
+
const gapSize = lblock.id.clock - nextExpectedClock
|
|
271
|
+
if (gapSize > 0) {
|
|
272
|
+
addToResult(new Skip(new ID(clientid, nextExpectedClock), gapSize))
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
while (ri < rightRanges.length) {
|
|
277
|
+
applyRight()
|
|
278
|
+
if (rblock !== undefined) {
|
|
279
|
+
const gapSize = rblock.id.clock - nextExpectedClock
|
|
280
|
+
if (gapSize > 0) {
|
|
281
|
+
addToResult(new Skip(new ID(clientid, nextExpectedClock), gapSize))
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
ranges.refs = result
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
})
|
|
289
|
+
inserts.clients.clear()
|
|
290
|
+
}
|
|
291
|
+
}
|
package/src/utils/encoding.js
CHANGED
|
@@ -33,10 +33,9 @@ import {
|
|
|
33
33
|
Skip,
|
|
34
34
|
diffUpdateV2,
|
|
35
35
|
convertUpdateFormatV2ToV1,
|
|
36
|
-
|
|
37
|
-
removeRangesFromStructSet,
|
|
36
|
+
readBlockSet,
|
|
38
37
|
createIdSet,
|
|
39
|
-
|
|
38
|
+
BlockSet, IdSet, IdSetDecoderV2, Doc, Transaction, GC, Item, StructStore, // eslint-disable-line
|
|
40
39
|
createID,
|
|
41
40
|
IdRange
|
|
42
41
|
} from '../internals.js'
|
|
@@ -55,7 +54,7 @@ import * as array from 'lib0/array'
|
|
|
55
54
|
*
|
|
56
55
|
* @function
|
|
57
56
|
*/
|
|
58
|
-
const writeStructs = (encoder, structs, client, idranges) => {
|
|
57
|
+
export const writeStructs = (encoder, structs, client, idranges) => {
|
|
59
58
|
let structsToWrite = 0 // this accounts for the skips
|
|
60
59
|
/**
|
|
61
60
|
* @type {Array<{ start: number, end: number, startClock: number, endClock: number }>}
|
|
@@ -180,7 +179,7 @@ export const writeStructsFromIdSet = (encoder, store, idset) => {
|
|
|
180
179
|
*
|
|
181
180
|
* @param {Transaction} transaction
|
|
182
181
|
* @param {StructStore} store
|
|
183
|
-
* @param {
|
|
182
|
+
* @param {BlockSet} clientsStructRefs
|
|
184
183
|
* @return { null | { update: Uint8Array<ArrayBuffer>, missing: Map<number,number> } }
|
|
185
184
|
*
|
|
186
185
|
* @private
|
|
@@ -352,7 +351,7 @@ export const readUpdateV2 = (decoder, ydoc, transactionOrigin, structDecoder = n
|
|
|
352
351
|
const doc = transaction.doc
|
|
353
352
|
const store = doc.store
|
|
354
353
|
// let start = performance.now()
|
|
355
|
-
const ss =
|
|
354
|
+
const ss = readBlockSet(structDecoder)
|
|
356
355
|
const knownState = createIdSet()
|
|
357
356
|
ss.clients.forEach((_, client) => {
|
|
358
357
|
const storeStructs = store.clients.get(client)
|
|
@@ -366,7 +365,7 @@ export const readUpdateV2 = (decoder, ydoc, transactionOrigin, structDecoder = n
|
|
|
366
365
|
}
|
|
367
366
|
})
|
|
368
367
|
// remove known items from ss
|
|
369
|
-
|
|
368
|
+
ss.exclude(knownState)
|
|
370
369
|
// console.log('time to read structs: ', performance.now() - start) // @todo remove
|
|
371
370
|
// start = performance.now()
|
|
372
371
|
// console.log('time to merge: ', performance.now() - start) // @todo remove
|
package/src/utils/meta.js
CHANGED
|
@@ -56,7 +56,7 @@ export const excludeContentIds = (content, excludeContent) =>
|
|
|
56
56
|
* @param {ContentMap} content
|
|
57
57
|
* @param {ContentIds | ContentMap} excludeContent
|
|
58
58
|
*/
|
|
59
|
-
export const
|
|
59
|
+
export const excludeContentMap = (content, excludeContent) => createContentMap(
|
|
60
60
|
idmap.diffIdMap(content.inserts, excludeContent.inserts),
|
|
61
61
|
idmap.diffIdMap(content.deletes, excludeContent.deletes)
|
|
62
62
|
)
|
package/src/utils/updates.js
CHANGED
|
@@ -36,7 +36,10 @@ import {
|
|
|
36
36
|
createIdSet,
|
|
37
37
|
Doc,
|
|
38
38
|
applyUpdate,
|
|
39
|
-
applyUpdateV2
|
|
39
|
+
applyUpdateV2,
|
|
40
|
+
readBlockSet,
|
|
41
|
+
writeBlockSet,
|
|
42
|
+
encodeStateAsUpdateV2
|
|
40
43
|
} from '../internals.js'
|
|
41
44
|
|
|
42
45
|
import * as idset from './IdSet.js'
|
|
@@ -293,7 +296,7 @@ export const createContentIdsFromUpdate = update => createContentIdsFromUpdateV2
|
|
|
293
296
|
* @param {number} diff
|
|
294
297
|
* @return {Item | GC}
|
|
295
298
|
*/
|
|
296
|
-
const sliceStruct = (left, diff) => {
|
|
299
|
+
export const sliceStruct = (left, diff) => {
|
|
297
300
|
if (left.constructor === GC) {
|
|
298
301
|
const { client, clock } = left.id
|
|
299
302
|
return new GC(createID(client, clock + diff), left.length - diff)
|
|
@@ -328,125 +331,18 @@ const sliceStruct = (left, diff) => {
|
|
|
328
331
|
export const mergeUpdatesV2 = (updates, YDecoder = UpdateDecoderV2, YEncoder = UpdateEncoderV2) => {
|
|
329
332
|
if (updates.length === 1) {
|
|
330
333
|
return updates[0]
|
|
334
|
+
} else if (updates.length === 0) {
|
|
335
|
+
return encodeStateAsUpdateV2(new Doc(), new Uint8Array([0]), new YEncoder())
|
|
331
336
|
}
|
|
332
337
|
const updateDecoders = updates.map(update => new YDecoder(decoding.createDecoder(update)))
|
|
333
|
-
|
|
338
|
+
const blocksets = updateDecoders.map(dec => readBlockSet(dec))
|
|
334
339
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
*/
|
|
339
|
-
let currWrite = null
|
|
340
|
-
|
|
341
|
-
const updateEncoder = new YEncoder()
|
|
342
|
-
// write structs lazily
|
|
343
|
-
const lazyStructEncoder = new LazyStructWriter(updateEncoder)
|
|
344
|
-
|
|
345
|
-
// Note: We need to ensure that all lazyStructDecoders are fully consumed
|
|
346
|
-
// Note: Should merge document updates whenever possible - even from different updates
|
|
347
|
-
// Note: Should handle that some operations cannot be applied yet ()
|
|
348
|
-
|
|
349
|
-
while (true) {
|
|
350
|
-
// Write higher clients first ⇒ sort by clientID & clock and remove decoders without content
|
|
351
|
-
lazyStructDecoders = lazyStructDecoders.filter(dec => dec.curr !== null)
|
|
352
|
-
lazyStructDecoders.sort(
|
|
353
|
-
/** @type {function(any,any):number} */ (dec1, dec2) => {
|
|
354
|
-
if (dec1.curr.id.client === dec2.curr.id.client) {
|
|
355
|
-
const clockDiff = dec1.curr.id.clock - dec2.curr.id.clock
|
|
356
|
-
if (clockDiff === 0) {
|
|
357
|
-
// @todo remove references to skip since the structDecoders must filter Skips.
|
|
358
|
-
return dec1.curr.constructor === dec2.curr.constructor
|
|
359
|
-
? 0
|
|
360
|
-
: dec1.curr.constructor === Skip ? 1 : -1 // we are filtering skips anyway.
|
|
361
|
-
} else {
|
|
362
|
-
return clockDiff
|
|
363
|
-
}
|
|
364
|
-
} else {
|
|
365
|
-
return dec2.curr.id.client - dec1.curr.id.client
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
)
|
|
369
|
-
if (lazyStructDecoders.length === 0) {
|
|
370
|
-
break
|
|
371
|
-
}
|
|
372
|
-
const currDecoder = lazyStructDecoders[0]
|
|
373
|
-
// write from currDecoder until the next operation is from another client or if filler-struct
|
|
374
|
-
// then we need to reorder the decoders and find the next operation to write
|
|
375
|
-
const firstClient = /** @type {Item | GC} */ (currDecoder.curr).id.client
|
|
376
|
-
|
|
377
|
-
if (currWrite !== null) {
|
|
378
|
-
let curr = /** @type {Item | GC | null} */ (currDecoder.curr)
|
|
379
|
-
let iterated = false
|
|
380
|
-
|
|
381
|
-
// iterate until we find something that we haven't written already
|
|
382
|
-
// remember: first the high client-ids are written
|
|
383
|
-
while (curr !== null && curr.id.clock + curr.length <= currWrite.struct.id.clock + currWrite.struct.length && curr.id.client >= currWrite.struct.id.client) {
|
|
384
|
-
curr = currDecoder.next()
|
|
385
|
-
iterated = true
|
|
386
|
-
}
|
|
387
|
-
if (
|
|
388
|
-
curr === null || // current decoder is empty
|
|
389
|
-
curr.id.client !== firstClient || // check whether there is another decoder that has has updates from `firstClient`
|
|
390
|
-
(iterated && curr.id.clock > currWrite.struct.id.clock + currWrite.struct.length) // the above while loop was used and we are potentially missing updates
|
|
391
|
-
) {
|
|
392
|
-
continue
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
if (firstClient !== currWrite.struct.id.client) {
|
|
396
|
-
writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset, 0)
|
|
397
|
-
currWrite = { struct: curr, offset: 0 }
|
|
398
|
-
currDecoder.next()
|
|
399
|
-
} else {
|
|
400
|
-
if (currWrite.struct.id.clock + currWrite.struct.length < curr.id.clock) {
|
|
401
|
-
// @todo write currStruct & set currStruct = Skip(clock = currStruct.id.clock + currStruct.length, length = curr.id.clock - self.clock)
|
|
402
|
-
if (currWrite.struct.constructor === Skip) {
|
|
403
|
-
// extend existing skip
|
|
404
|
-
currWrite.struct.length = curr.id.clock + curr.length - currWrite.struct.id.clock
|
|
405
|
-
} else {
|
|
406
|
-
writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset, 0)
|
|
407
|
-
const diff = curr.id.clock - currWrite.struct.id.clock - currWrite.struct.length
|
|
408
|
-
/**
|
|
409
|
-
* @type {Skip}
|
|
410
|
-
*/
|
|
411
|
-
const struct = new Skip(createID(firstClient, currWrite.struct.id.clock + currWrite.struct.length), diff)
|
|
412
|
-
currWrite = { struct, offset: 0 }
|
|
413
|
-
}
|
|
414
|
-
} else { // if (currWrite.struct.id.clock + currWrite.struct.length >= curr.id.clock) {
|
|
415
|
-
const diff = currWrite.struct.id.clock + currWrite.struct.length - curr.id.clock
|
|
416
|
-
if (diff > 0) {
|
|
417
|
-
if (currWrite.struct.constructor === Skip) {
|
|
418
|
-
// prefer to slice Skip because the other struct might contain more information
|
|
419
|
-
currWrite.struct.length -= diff
|
|
420
|
-
} else {
|
|
421
|
-
curr = sliceStruct(curr, diff)
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
if (!currWrite.struct.mergeWith(/** @type {any} */ (curr))) {
|
|
425
|
-
writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset, 0)
|
|
426
|
-
currWrite = { struct: curr, offset: 0 }
|
|
427
|
-
currDecoder.next()
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
} else {
|
|
432
|
-
currWrite = { struct: /** @type {Item | GC} */ (currDecoder.curr), offset: 0 }
|
|
433
|
-
currDecoder.next()
|
|
434
|
-
}
|
|
435
|
-
for (
|
|
436
|
-
let next = currDecoder.curr;
|
|
437
|
-
next !== null && next.id.client === firstClient && next.id.clock === currWrite.struct.id.clock + currWrite.struct.length && next.constructor !== Skip;
|
|
438
|
-
next = currDecoder.next()
|
|
439
|
-
) {
|
|
440
|
-
writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset, 0)
|
|
441
|
-
currWrite = { struct: next, offset: 0 }
|
|
442
|
-
}
|
|
340
|
+
const mergedBlockset = blocksets[0]
|
|
341
|
+
for (let i = 1; i < blocksets.length; i++) {
|
|
342
|
+
mergedBlockset.insertInto(blocksets[i])
|
|
443
343
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
currWrite = null
|
|
447
|
-
}
|
|
448
|
-
finishLazyStructWriting(lazyStructEncoder)
|
|
449
|
-
|
|
344
|
+
const updateEncoder = new YEncoder()
|
|
345
|
+
writeBlockSet(updateEncoder, mergedBlockset)
|
|
450
346
|
const dss = updateDecoders.map(decoder => readIdSet(decoder))
|
|
451
347
|
const ds = mergeIdSets(dss)
|
|
452
348
|
writeIdSet(updateEncoder, ds)
|
package/src/ytype.js
CHANGED
package/tests/testHelper.js
CHANGED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export function readStructSet(decoder: UpdateDecoderV1 | UpdateDecoderV2, doc: Doc): StructSet;
|
|
2
|
-
export function removeRangesFromStructSet(ss: StructSet, exclude: IdSet): void;
|
|
3
|
-
export class StructSet {
|
|
4
|
-
/**
|
|
5
|
-
* @type {Map<number, StructRange>}
|
|
6
|
-
*/
|
|
7
|
-
clients: Map<number, StructRange>;
|
|
8
|
-
}
|
|
9
|
-
import { UpdateDecoderV1 } from '../internals.js';
|
|
10
|
-
import { UpdateDecoderV2 } from '../internals.js';
|
|
11
|
-
import { Doc } from '../internals.js';
|
|
12
|
-
import { IdSet } from '../internals.js';
|
|
13
|
-
declare class StructRange {
|
|
14
|
-
/**
|
|
15
|
-
* @param {Array<Item|GC>} refs
|
|
16
|
-
*/
|
|
17
|
-
constructor(refs: Array<Item | GC>);
|
|
18
|
-
i: number;
|
|
19
|
-
/**
|
|
20
|
-
* @type {Array<Item | GC>}
|
|
21
|
-
*/
|
|
22
|
-
refs: Array<Item | GC>;
|
|
23
|
-
}
|
|
24
|
-
import { Item } from '../internals.js';
|
|
25
|
-
import { GC } from '../internals.js';
|
|
26
|
-
export {};
|
|
27
|
-
//# sourceMappingURL=StructSet.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StructSet.d.ts","sourceRoot":"","sources":["../../../src/utils/StructSet.js"],"names":[],"mappings":"AAoBO,uCAPI,eAAe,GAAG,eAAe,OACjC,GAAG,GACF,SAAS,CA6DpB;AAQM,8CAHI,SAAS,WACT,KAAK,QAgCf;AAeD;IAEI;;OAEG;IACH,SAFU,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAEP;CAE9B;gCAlIM,iBAAiB;gCAAjB,iBAAiB;oBAAjB,iBAAiB;sBAAjB,iBAAiB;AA8GxB;IACE;;OAEG;IACH,kBAFW,KAAK,CAAC,IAAI,GAAC,EAAE,CAAC,EAQxB;IALC,UAAU;IACV;;OAEG;IACH,MAFU,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC,CAEV;CAEnB;qBAzHM,iBAAiB;mBAAjB,iBAAiB"}
|
package/src/utils/StructSet.js
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createID,
|
|
3
|
-
readItemContent,
|
|
4
|
-
findIndexCleanStart,
|
|
5
|
-
Skip,
|
|
6
|
-
UpdateDecoderV1, UpdateDecoderV2, IdSet, Doc, GC, Item, ID, // eslint-disable-line
|
|
7
|
-
} from '../internals.js'
|
|
8
|
-
|
|
9
|
-
import * as decoding from 'lib0/decoding'
|
|
10
|
-
import * as binary from 'lib0/binary'
|
|
11
|
-
import * as map from 'lib0/map'
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @param {UpdateDecoderV1 | UpdateDecoderV2} decoder The decoder object to read data from.
|
|
15
|
-
* @param {Doc} doc
|
|
16
|
-
* @return {StructSet}
|
|
17
|
-
*
|
|
18
|
-
* @private
|
|
19
|
-
* @function
|
|
20
|
-
*/
|
|
21
|
-
export const readStructSet = (decoder, doc) => {
|
|
22
|
-
const clientRefs = new StructSet()
|
|
23
|
-
const numOfStateUpdates = decoding.readVarUint(decoder.restDecoder)
|
|
24
|
-
for (let i = 0; i < numOfStateUpdates; i++) {
|
|
25
|
-
const numberOfStructs = decoding.readVarUint(decoder.restDecoder)
|
|
26
|
-
/**
|
|
27
|
-
* @type {Array<GC|Item>}
|
|
28
|
-
*/
|
|
29
|
-
const refs = new Array(numberOfStructs)
|
|
30
|
-
const client = decoder.readClient()
|
|
31
|
-
let clock = decoding.readVarUint(decoder.restDecoder)
|
|
32
|
-
clientRefs.clients.set(client, new StructRange(refs))
|
|
33
|
-
for (let i = 0; i < numberOfStructs; i++) {
|
|
34
|
-
const info = decoder.readInfo()
|
|
35
|
-
switch (binary.BITS5 & info) {
|
|
36
|
-
case 0: { // GC
|
|
37
|
-
const len = decoder.readLen()
|
|
38
|
-
refs[i] = new GC(createID(client, clock), len)
|
|
39
|
-
clock += len
|
|
40
|
-
break
|
|
41
|
-
}
|
|
42
|
-
case 10: { // Skip Struct (nothing to apply)
|
|
43
|
-
// @todo we could reduce the amount of checks by adding Skip struct to clientRefs so we know that something is missing.
|
|
44
|
-
const len = decoding.readVarUint(decoder.restDecoder)
|
|
45
|
-
refs[i] = new Skip(createID(client, clock), len)
|
|
46
|
-
clock += len
|
|
47
|
-
break
|
|
48
|
-
}
|
|
49
|
-
default: { // Item with content
|
|
50
|
-
/**
|
|
51
|
-
* The optimized implementation doesn't use any variables because inlining variables is faster.
|
|
52
|
-
* Below a non-optimized version is shown that implements the basic algorithm with
|
|
53
|
-
* a few comments
|
|
54
|
-
*/
|
|
55
|
-
const cantCopyParentInfo = (info & (binary.BIT7 | binary.BIT8)) === 0
|
|
56
|
-
// If parent = null and neither left nor right are defined, then we know that `parent` is child of `y`
|
|
57
|
-
// and we read the next string as parentYKey.
|
|
58
|
-
// It indicates how we store/retrieve parent from `y.share`
|
|
59
|
-
// @type {string|null}
|
|
60
|
-
const struct = new Item(
|
|
61
|
-
createID(client, clock),
|
|
62
|
-
null, // left
|
|
63
|
-
(info & binary.BIT8) === binary.BIT8 ? decoder.readLeftID() : null, // origin
|
|
64
|
-
null, // right
|
|
65
|
-
(info & binary.BIT7) === binary.BIT7 ? decoder.readRightID() : null, // right origin
|
|
66
|
-
cantCopyParentInfo ? (decoder.readParentInfo() ? doc.get(decoder.readString()) : decoder.readLeftID()) : null, // parent
|
|
67
|
-
cantCopyParentInfo && (info & binary.BIT6) === binary.BIT6 ? decoder.readString() : null, // parentSub
|
|
68
|
-
readItemContent(decoder, info) // item content
|
|
69
|
-
)
|
|
70
|
-
refs[i] = struct
|
|
71
|
-
clock += struct.length
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return clientRefs
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Remove item-ranges from the StructSet.
|
|
81
|
-
*
|
|
82
|
-
* @param {StructSet} ss
|
|
83
|
-
* @param {IdSet} exclude
|
|
84
|
-
*/
|
|
85
|
-
export const removeRangesFromStructSet = (ss, exclude) => {
|
|
86
|
-
// @todo walk through ss instead to reduce iterations
|
|
87
|
-
exclude.clients.forEach((range, client) => {
|
|
88
|
-
const structs = /** @type {StructRange} */ (ss.clients.get(client))?.refs
|
|
89
|
-
if (structs != null) {
|
|
90
|
-
const firstStruct = structs[0]
|
|
91
|
-
const lastStruct = structs[structs.length - 1]
|
|
92
|
-
const idranges = range.getIds()
|
|
93
|
-
for (let i = 0; i < idranges.length; i++) {
|
|
94
|
-
const range = idranges[i]
|
|
95
|
-
let startIndex = 0
|
|
96
|
-
if (range.clock >= lastStruct.id.clock + lastStruct.length) continue
|
|
97
|
-
if (range.clock > firstStruct.id.clock) {
|
|
98
|
-
startIndex = findIndexCleanStart(null, structs, range.clock)
|
|
99
|
-
}
|
|
100
|
-
let endIndex = structs.length // must be set here, after structs is modified
|
|
101
|
-
if (range.clock + range.len <= firstStruct.id.clock) continue
|
|
102
|
-
if (range.clock + range.len < lastStruct.id.clock + lastStruct.length) {
|
|
103
|
-
endIndex = findIndexCleanStart(null, structs, range.clock + range.len)
|
|
104
|
-
}
|
|
105
|
-
if (startIndex < endIndex) {
|
|
106
|
-
structs[startIndex] = new Skip(new ID(client, range.clock), range.len)
|
|
107
|
-
const d = endIndex - startIndex
|
|
108
|
-
if (d > 1) {
|
|
109
|
-
structs.splice(startIndex + 1, d - 1)
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
})
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
class StructRange {
|
|
118
|
-
/**
|
|
119
|
-
* @param {Array<Item|GC>} refs
|
|
120
|
-
*/
|
|
121
|
-
constructor (refs) {
|
|
122
|
-
this.i = 0
|
|
123
|
-
/**
|
|
124
|
-
* @type {Array<Item | GC>}
|
|
125
|
-
*/
|
|
126
|
-
this.refs = refs
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export class StructSet {
|
|
131
|
-
constructor () {
|
|
132
|
-
/**
|
|
133
|
-
* @type {Map<number, StructRange>}
|
|
134
|
-
*/
|
|
135
|
-
this.clients = map.create()
|
|
136
|
-
}
|
|
137
|
-
}
|