@fluidframework/merge-tree 2.0.0-rc.2.0.1 → 2.0.0-rc.3.0.0
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/CHANGELOG.md +23 -0
- package/api-report/merge-tree.api.md +16 -4
- package/dist/MergeTreeTextHelper.d.ts.map +1 -1
- package/dist/MergeTreeTextHelper.js.map +1 -1
- package/dist/attributionCollection.d.ts +1 -1
- package/dist/attributionCollection.d.ts.map +1 -1
- package/dist/attributionCollection.js +6 -6
- package/dist/attributionCollection.js.map +1 -1
- package/dist/attributionPolicy.d.ts +2 -2
- package/dist/attributionPolicy.d.ts.map +1 -1
- package/dist/attributionPolicy.js +5 -5
- package/dist/attributionPolicy.js.map +1 -1
- package/dist/client.d.ts +8 -8
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +37 -48
- package/dist/client.js.map +1 -1
- package/dist/collections/list.js +3 -3
- package/dist/collections/list.js.map +1 -1
- package/dist/endOfTreeSegment.d.ts +5 -5
- package/dist/endOfTreeSegment.d.ts.map +1 -1
- package/dist/endOfTreeSegment.js +2 -2
- package/dist/endOfTreeSegment.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +76 -0
- package/dist/localReference.d.ts.map +1 -1
- package/dist/localReference.js +7 -7
- package/dist/localReference.js.map +1 -1
- package/dist/mergeTree.d.ts +8 -8
- package/dist/mergeTree.d.ts.map +1 -1
- package/dist/mergeTree.js +44 -57
- package/dist/mergeTree.js.map +1 -1
- package/dist/mergeTreeDeltaCallback.d.ts +1 -1
- package/dist/mergeTreeDeltaCallback.d.ts.map +1 -1
- package/dist/mergeTreeDeltaCallback.js +4 -0
- package/dist/mergeTreeDeltaCallback.js.map +1 -1
- package/dist/mergeTreeNodeWalk.d.ts +3 -3
- package/dist/mergeTreeNodeWalk.d.ts.map +1 -1
- package/dist/mergeTreeNodeWalk.js.map +1 -1
- package/dist/mergeTreeNodes.d.ts +37 -55
- package/dist/mergeTreeNodes.d.ts.map +1 -1
- package/dist/mergeTreeNodes.js +40 -19
- package/dist/mergeTreeNodes.js.map +1 -1
- package/dist/opBuilder.d.ts +1 -1
- package/dist/opBuilder.d.ts.map +1 -1
- package/dist/opBuilder.js.map +1 -1
- package/dist/ordinal.js +2 -2
- package/dist/ordinal.js.map +1 -1
- package/dist/partialLengths.d.ts +6 -6
- package/dist/partialLengths.d.ts.map +1 -1
- package/dist/partialLengths.js +13 -13
- package/dist/partialLengths.js.map +1 -1
- package/dist/public.d.ts +12 -0
- package/dist/revertibles.d.ts +1 -1
- package/dist/revertibles.d.ts.map +1 -1
- package/dist/revertibles.js +15 -15
- package/dist/revertibles.js.map +1 -1
- package/dist/segmentPropertiesManager.d.ts.map +1 -1
- package/dist/segmentPropertiesManager.js +2 -2
- package/dist/segmentPropertiesManager.js.map +1 -1
- package/dist/snapshotChunks.d.ts +2 -2
- package/dist/snapshotChunks.d.ts.map +1 -1
- package/dist/snapshotChunks.js.map +1 -1
- package/dist/snapshotLoader.d.ts +2 -2
- package/dist/snapshotLoader.d.ts.map +1 -1
- package/dist/snapshotLoader.js +11 -11
- package/dist/snapshotLoader.js.map +1 -1
- package/dist/snapshotV1.d.ts +3 -3
- package/dist/snapshotV1.d.ts.map +1 -1
- package/dist/snapshotV1.js +10 -10
- package/dist/snapshotV1.js.map +1 -1
- package/dist/snapshotlegacy.d.ts +4 -4
- package/dist/snapshotlegacy.d.ts.map +1 -1
- package/dist/snapshotlegacy.js +9 -10
- package/dist/snapshotlegacy.js.map +1 -1
- package/dist/test/Insertion.perf.spec.js.map +1 -1
- package/dist/test/PartialLengths.perf.spec.js +1 -1
- package/dist/test/PartialLengths.perf.spec.js.map +1 -1
- package/dist/test/Removal.perf.spec.js +1 -1
- package/dist/test/Removal.perf.spec.js.map +1 -1
- package/dist/test/Snapshot.perf.spec.js.map +1 -1
- package/dist/test/attributionCollection.perf.spec.js +2 -2
- package/dist/test/attributionCollection.perf.spec.js.map +1 -1
- package/dist/test/attributionCollection.spec.js.map +1 -1
- package/dist/test/attributionPolicy.spec.js.map +1 -1
- package/dist/test/beastTest.spec.d.ts.map +1 -1
- package/dist/test/beastTest.spec.js +7 -7
- package/dist/test/beastTest.spec.js.map +1 -1
- package/dist/test/client.annotateMarker.spec.js.map +1 -1
- package/dist/test/client.apis.spec.d.ts.map +1 -1
- package/dist/test/client.apis.spec.js.map +1 -1
- package/dist/test/client.applyMsg.spec.js +2 -2
- package/dist/test/client.applyMsg.spec.js.map +1 -1
- package/dist/test/client.applyStashedOpFarm.spec.d.ts +1 -1
- package/dist/test/client.applyStashedOpFarm.spec.d.ts.map +1 -1
- package/dist/test/client.applyStashedOpFarm.spec.js.map +1 -1
- package/dist/test/client.attributionFarm.spec.d.ts.map +1 -1
- package/dist/test/client.attributionFarm.spec.js +1 -1
- package/dist/test/client.attributionFarm.spec.js.map +1 -1
- package/dist/test/client.conflictFarm.spec.d.ts.map +1 -1
- package/dist/test/client.conflictFarm.spec.js.map +1 -1
- package/dist/test/client.getPosition.spec.js +1 -1
- package/dist/test/client.getPosition.spec.js.map +1 -1
- package/dist/test/client.localReference.spec.js +6 -6
- package/dist/test/client.localReference.spec.js.map +1 -1
- package/dist/test/client.localReferenceFarm.spec.js +2 -2
- package/dist/test/client.localReferenceFarm.spec.js.map +1 -1
- package/dist/test/client.rebasePosition.spec.js.map +1 -1
- package/dist/test/client.reconnectFarm.spec.d.ts +1 -1
- package/dist/test/client.reconnectFarm.spec.d.ts.map +1 -1
- package/dist/test/client.reconnectFarm.spec.js +1 -1
- package/dist/test/client.reconnectFarm.spec.js.map +1 -1
- package/dist/test/client.replay.spec.js +4 -4
- package/dist/test/client.replay.spec.js.map +1 -1
- package/dist/test/client.rollback.spec.js +2 -2
- package/dist/test/client.rollback.spec.js.map +1 -1
- package/dist/test/client.rollbackFarm.spec.js.map +1 -1
- package/dist/test/client.searchForMarker.spec.js +1 -1
- package/dist/test/client.searchForMarker.spec.js.map +1 -1
- package/dist/test/client.walkSegments.spec.js.map +1 -1
- package/dist/test/collections.list.spec.js.map +1 -1
- package/dist/test/createInsertOnlyAttributionPolicy.spec.js.map +1 -1
- package/dist/test/mergeTree.annotate.deltaCallback.spec.js +3 -3
- package/dist/test/mergeTree.annotate.deltaCallback.spec.js.map +1 -1
- package/dist/test/mergeTree.annotate.spec.js +1 -1
- package/dist/test/mergeTree.annotate.spec.js.map +1 -1
- package/dist/test/mergeTree.insert.deltaCallback.spec.js +1 -1
- package/dist/test/mergeTree.insert.deltaCallback.spec.js.map +1 -1
- package/dist/test/mergeTree.insertingWalk.spec.js +3 -3
- package/dist/test/mergeTree.insertingWalk.spec.js.map +1 -1
- package/dist/test/mergeTree.markRangeRemoved.deltaCallback.spec.js +1 -1
- package/dist/test/mergeTree.markRangeRemoved.deltaCallback.spec.js.map +1 -1
- package/dist/test/mergeTree.markRangeRemoved.spec.js +1 -1
- package/dist/test/mergeTree.markRangeRemoved.spec.js.map +1 -1
- package/dist/test/mergeTree.walk.spec.js +2 -2
- package/dist/test/mergeTree.walk.spec.js.map +1 -1
- package/dist/test/mergeTree.zamboni.spec.js.map +1 -1
- package/dist/test/mergeTreeOperationRunner.d.ts +2 -2
- package/dist/test/mergeTreeOperationRunner.d.ts.map +1 -1
- package/dist/test/mergeTreeOperationRunner.js +3 -3
- package/dist/test/mergeTreeOperationRunner.js.map +1 -1
- package/dist/test/mergeTreeOperationRunner.spec.js.map +1 -1
- package/dist/test/obliterate.concurrent.spec.js +2 -2
- package/dist/test/obliterate.concurrent.spec.js.map +1 -1
- package/dist/test/obliterate.deltaCallback.spec.js +1 -1
- package/dist/test/obliterate.deltaCallback.spec.js.map +1 -1
- package/dist/test/obliterate.partialLength.spec.js.map +1 -1
- package/dist/test/obliterate.reconnect.spec.js.map +1 -1
- package/dist/test/obliterate.spec.js.map +1 -1
- package/dist/test/ordinal.spec.d.ts +4 -0
- package/dist/test/ordinal.spec.d.ts.map +1 -1
- package/dist/test/ordinal.spec.js +4 -4
- package/dist/test/ordinal.spec.js.map +1 -1
- package/dist/test/partialLength.spec.js.map +1 -1
- package/dist/test/properties.spec.js.map +1 -1
- package/dist/test/reconnectHelper.d.ts +1 -1
- package/dist/test/reconnectHelper.d.ts.map +1 -1
- package/dist/test/reconnectHelper.js.map +1 -1
- package/dist/test/resetPendingSegmentsToOp.spec.js +1 -1
- package/dist/test/resetPendingSegmentsToOp.spec.js.map +1 -1
- package/dist/test/revertibleFarm.spec.js +1 -1
- package/dist/test/revertibleFarm.spec.js.map +1 -1
- package/dist/test/revertibles.spec.d.ts.map +1 -1
- package/dist/test/revertibles.spec.js +1 -1
- package/dist/test/revertibles.spec.js.map +1 -1
- package/dist/test/segmentGroupCollection.spec.js.map +1 -1
- package/dist/test/snapshot.spec.js +1 -1
- package/dist/test/snapshot.spec.js.map +1 -1
- package/dist/test/snapshot.utils.d.ts +1 -1
- package/dist/test/snapshot.utils.d.ts.map +1 -1
- package/dist/test/snapshot.utils.js +3 -3
- package/dist/test/snapshot.utils.js.map +1 -1
- package/dist/test/snapshotlegacy.spec.js +8 -8
- package/dist/test/snapshotlegacy.spec.js.map +1 -1
- package/dist/test/sortedSegmentSet.spec.js +2 -2
- package/dist/test/sortedSegmentSet.spec.js.map +1 -1
- package/dist/test/testClient.d.ts +5 -5
- package/dist/test/testClient.d.ts.map +1 -1
- package/dist/test/testClient.js +11 -11
- package/dist/test/testClient.js.map +1 -1
- package/dist/test/testClientLogger.d.ts +1 -1
- package/dist/test/testClientLogger.d.ts.map +1 -1
- package/dist/test/testClientLogger.js +10 -8
- package/dist/test/testClientLogger.js.map +1 -1
- package/dist/test/testSerializer.d.ts.map +1 -1
- package/dist/test/testSerializer.js +2 -2
- package/dist/test/testSerializer.js.map +1 -1
- package/dist/test/testServer.d.ts +1 -1
- package/dist/test/testServer.d.ts.map +1 -1
- package/dist/test/testServer.js +4 -4
- package/dist/test/testServer.js.map +1 -1
- package/dist/test/testUtils.d.ts +5 -5
- package/dist/test/testUtils.d.ts.map +1 -1
- package/dist/test/testUtils.js +3 -3
- package/dist/test/testUtils.js.map +1 -1
- package/dist/test/text.d.ts +1 -1
- package/dist/test/text.d.ts.map +1 -1
- package/dist/test/text.js.map +1 -1
- package/dist/test/tracking.spec.js.map +1 -1
- package/dist/test/wordUnitTests.spec.d.ts.map +1 -1
- package/dist/test/wordUnitTests.spec.js +2 -2
- package/dist/test/wordUnitTests.spec.js.map +1 -1
- package/dist/textSegment.d.ts.map +1 -1
- package/dist/textSegment.js +2 -2
- package/dist/textSegment.js.map +1 -1
- package/dist/zamboni.d.ts +2 -2
- package/dist/zamboni.d.ts.map +1 -1
- package/dist/zamboni.js.map +1 -1
- package/internal.d.ts +11 -0
- package/legacy.d.ts +11 -0
- package/lib/MergeTreeTextHelper.d.ts.map +1 -1
- package/lib/MergeTreeTextHelper.js.map +1 -1
- package/lib/attributionCollection.d.ts +1 -1
- package/lib/attributionCollection.d.ts.map +1 -1
- package/lib/attributionCollection.js +1 -1
- package/lib/attributionCollection.js.map +1 -1
- package/lib/attributionPolicy.d.ts +2 -2
- package/lib/attributionPolicy.d.ts.map +1 -1
- package/lib/attributionPolicy.js +4 -4
- package/lib/attributionPolicy.js.map +1 -1
- package/lib/client.d.ts +8 -8
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +14 -25
- package/lib/client.js.map +1 -1
- package/lib/collections/list.js +1 -1
- package/lib/collections/list.js.map +1 -1
- package/lib/endOfTreeSegment.d.ts +5 -5
- package/lib/endOfTreeSegment.d.ts.map +1 -1
- package/lib/endOfTreeSegment.js +2 -2
- package/lib/endOfTreeSegment.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +76 -0
- package/lib/localReference.d.ts.map +1 -1
- package/lib/localReference.js +2 -2
- package/lib/localReference.js.map +1 -1
- package/lib/mergeTree.d.ts +8 -8
- package/lib/mergeTree.d.ts.map +1 -1
- package/lib/mergeTree.js +23 -36
- package/lib/mergeTree.js.map +1 -1
- package/lib/mergeTreeDeltaCallback.d.ts +1 -1
- package/lib/mergeTreeDeltaCallback.d.ts.map +1 -1
- package/lib/mergeTreeDeltaCallback.js +4 -0
- package/lib/mergeTreeDeltaCallback.js.map +1 -1
- package/lib/mergeTreeNodeWalk.d.ts +3 -3
- package/lib/mergeTreeNodeWalk.d.ts.map +1 -1
- package/lib/mergeTreeNodeWalk.js.map +1 -1
- package/lib/mergeTreeNodes.d.ts +37 -55
- package/lib/mergeTreeNodes.d.ts.map +1 -1
- package/lib/mergeTreeNodes.js +28 -8
- package/lib/mergeTreeNodes.js.map +1 -1
- package/lib/opBuilder.d.ts +1 -1
- package/lib/opBuilder.d.ts.map +1 -1
- package/lib/opBuilder.js.map +1 -1
- package/lib/ordinal.js +1 -1
- package/lib/ordinal.js.map +1 -1
- package/lib/partialLengths.d.ts +6 -6
- package/lib/partialLengths.d.ts.map +1 -1
- package/lib/partialLengths.js +3 -3
- package/lib/partialLengths.js.map +1 -1
- package/lib/public.d.ts +12 -0
- package/lib/revertibles.d.ts +1 -1
- package/lib/revertibles.d.ts.map +1 -1
- package/lib/revertibles.js +4 -4
- package/lib/revertibles.js.map +1 -1
- package/lib/segmentPropertiesManager.d.ts.map +1 -1
- package/lib/segmentPropertiesManager.js +1 -1
- package/lib/segmentPropertiesManager.js.map +1 -1
- package/lib/snapshotChunks.d.ts +2 -2
- package/lib/snapshotChunks.d.ts.map +1 -1
- package/lib/snapshotChunks.js.map +1 -1
- package/lib/snapshotLoader.d.ts +2 -2
- package/lib/snapshotLoader.d.ts.map +1 -1
- package/lib/snapshotLoader.js +2 -2
- package/lib/snapshotLoader.js.map +1 -1
- package/lib/snapshotV1.d.ts +3 -3
- package/lib/snapshotV1.d.ts.map +1 -1
- package/lib/snapshotV1.js +5 -5
- package/lib/snapshotV1.js.map +1 -1
- package/lib/snapshotlegacy.d.ts +4 -4
- package/lib/snapshotlegacy.d.ts.map +1 -1
- package/lib/snapshotlegacy.js +3 -4
- package/lib/snapshotlegacy.js.map +1 -1
- package/lib/test/Insertion.perf.spec.js +1 -1
- package/lib/test/Insertion.perf.spec.js.map +1 -1
- package/lib/test/PartialLengths.perf.spec.js +2 -2
- package/lib/test/PartialLengths.perf.spec.js.map +1 -1
- package/lib/test/Removal.perf.spec.js +2 -2
- package/lib/test/Removal.perf.spec.js.map +1 -1
- package/lib/test/Snapshot.perf.spec.js +2 -2
- package/lib/test/Snapshot.perf.spec.js.map +1 -1
- package/lib/test/attributionCollection.perf.spec.js +4 -4
- package/lib/test/attributionCollection.perf.spec.js.map +1 -1
- package/lib/test/attributionCollection.spec.js.map +1 -1
- package/lib/test/attributionPolicy.spec.js.map +1 -1
- package/lib/test/beastTest.spec.d.ts.map +1 -1
- package/lib/test/beastTest.spec.js +8 -8
- package/lib/test/beastTest.spec.js.map +1 -1
- package/lib/test/client.annotateMarker.spec.js.map +1 -1
- package/lib/test/client.apis.spec.d.ts.map +1 -1
- package/lib/test/client.apis.spec.js.map +1 -1
- package/lib/test/client.applyMsg.spec.js +3 -3
- package/lib/test/client.applyMsg.spec.js.map +1 -1
- package/lib/test/client.applyStashedOpFarm.spec.d.ts +1 -1
- package/lib/test/client.applyStashedOpFarm.spec.d.ts.map +1 -1
- package/lib/test/client.applyStashedOpFarm.spec.js +1 -1
- package/lib/test/client.applyStashedOpFarm.spec.js.map +1 -1
- package/lib/test/client.attributionFarm.spec.d.ts.map +1 -1
- package/lib/test/client.attributionFarm.spec.js +2 -2
- package/lib/test/client.attributionFarm.spec.js.map +1 -1
- package/lib/test/client.conflictFarm.spec.d.ts.map +1 -1
- package/lib/test/client.conflictFarm.spec.js +1 -1
- package/lib/test/client.conflictFarm.spec.js.map +1 -1
- package/lib/test/client.getPosition.spec.js.map +1 -1
- package/lib/test/client.localReference.spec.js +5 -5
- package/lib/test/client.localReference.spec.js.map +1 -1
- package/lib/test/client.localReferenceFarm.spec.js +2 -2
- package/lib/test/client.localReferenceFarm.spec.js.map +1 -1
- package/lib/test/client.rebasePosition.spec.js.map +1 -1
- package/lib/test/client.reconnectFarm.spec.d.ts +1 -1
- package/lib/test/client.reconnectFarm.spec.d.ts.map +1 -1
- package/lib/test/client.reconnectFarm.spec.js +2 -2
- package/lib/test/client.reconnectFarm.spec.js.map +1 -1
- package/lib/test/client.replay.spec.js +3 -3
- package/lib/test/client.replay.spec.js.map +1 -1
- package/lib/test/client.rollback.spec.js +1 -1
- package/lib/test/client.rollback.spec.js.map +1 -1
- package/lib/test/client.rollbackFarm.spec.js +1 -1
- package/lib/test/client.rollbackFarm.spec.js.map +1 -1
- package/lib/test/client.searchForMarker.spec.js +2 -2
- package/lib/test/client.searchForMarker.spec.js.map +1 -1
- package/lib/test/client.walkSegments.spec.js.map +1 -1
- package/lib/test/collections.list.spec.js.map +1 -1
- package/lib/test/createInsertOnlyAttributionPolicy.spec.js.map +1 -1
- package/lib/test/mergeTree.annotate.deltaCallback.spec.js +3 -3
- package/lib/test/mergeTree.annotate.deltaCallback.spec.js.map +1 -1
- package/lib/test/mergeTree.annotate.spec.js +1 -1
- package/lib/test/mergeTree.annotate.spec.js.map +1 -1
- package/lib/test/mergeTree.insert.deltaCallback.spec.js +1 -1
- package/lib/test/mergeTree.insert.deltaCallback.spec.js.map +1 -1
- package/lib/test/mergeTree.insertingWalk.spec.js +3 -3
- package/lib/test/mergeTree.insertingWalk.spec.js.map +1 -1
- package/lib/test/mergeTree.markRangeRemoved.deltaCallback.spec.js +1 -1
- package/lib/test/mergeTree.markRangeRemoved.deltaCallback.spec.js.map +1 -1
- package/lib/test/mergeTree.markRangeRemoved.spec.js.map +1 -1
- package/lib/test/mergeTree.walk.spec.js +2 -2
- package/lib/test/mergeTree.walk.spec.js.map +1 -1
- package/lib/test/mergeTree.zamboni.spec.js +1 -1
- package/lib/test/mergeTree.zamboni.spec.js.map +1 -1
- package/lib/test/mergeTreeOperationRunner.d.ts +2 -2
- package/lib/test/mergeTreeOperationRunner.d.ts.map +1 -1
- package/lib/test/mergeTreeOperationRunner.js +3 -3
- package/lib/test/mergeTreeOperationRunner.js.map +1 -1
- package/lib/test/mergeTreeOperationRunner.spec.js.map +1 -1
- package/lib/test/obliterate.concurrent.spec.js +1 -1
- package/lib/test/obliterate.concurrent.spec.js.map +1 -1
- package/lib/test/obliterate.deltaCallback.spec.js +1 -1
- package/lib/test/obliterate.deltaCallback.spec.js.map +1 -1
- package/lib/test/obliterate.partialLength.spec.js.map +1 -1
- package/lib/test/obliterate.reconnect.spec.js.map +1 -1
- package/lib/test/obliterate.spec.js.map +1 -1
- package/lib/test/ordinal.spec.d.ts +4 -0
- package/lib/test/ordinal.spec.d.ts.map +1 -1
- package/lib/test/ordinal.spec.js.map +1 -1
- package/lib/test/partialLength.spec.js.map +1 -1
- package/lib/test/properties.spec.js.map +1 -1
- package/lib/test/reconnectHelper.d.ts +1 -1
- package/lib/test/reconnectHelper.d.ts.map +1 -1
- package/lib/test/reconnectHelper.js +1 -1
- package/lib/test/reconnectHelper.js.map +1 -1
- package/lib/test/resetPendingSegmentsToOp.spec.js.map +1 -1
- package/lib/test/revertibleFarm.spec.js +3 -3
- package/lib/test/revertibleFarm.spec.js.map +1 -1
- package/lib/test/revertibles.spec.d.ts.map +1 -1
- package/lib/test/revertibles.spec.js +2 -2
- package/lib/test/revertibles.spec.js.map +1 -1
- package/lib/test/segmentGroupCollection.spec.js.map +1 -1
- package/lib/test/snapshot.spec.js +2 -2
- package/lib/test/snapshot.spec.js.map +1 -1
- package/lib/test/snapshot.utils.d.ts +1 -1
- package/lib/test/snapshot.utils.d.ts.map +1 -1
- package/lib/test/snapshot.utils.js +2 -2
- package/lib/test/snapshot.utils.js.map +1 -1
- package/lib/test/snapshotlegacy.spec.js +4 -4
- package/lib/test/snapshotlegacy.spec.js.map +1 -1
- package/lib/test/sortedSegmentSet.spec.js +2 -2
- package/lib/test/sortedSegmentSet.spec.js.map +1 -1
- package/lib/test/testClient.d.ts +5 -5
- package/lib/test/testClient.d.ts.map +1 -1
- package/lib/test/testClient.js +7 -7
- package/lib/test/testClient.js.map +1 -1
- package/lib/test/testClientLogger.d.ts +1 -1
- package/lib/test/testClientLogger.d.ts.map +1 -1
- package/lib/test/testClientLogger.js +9 -7
- package/lib/test/testClientLogger.js.map +1 -1
- package/lib/test/testSerializer.d.ts.map +1 -1
- package/lib/test/testSerializer.js +1 -1
- package/lib/test/testSerializer.js.map +1 -1
- package/lib/test/testServer.d.ts +1 -1
- package/lib/test/testServer.d.ts.map +1 -1
- package/lib/test/testServer.js +2 -2
- package/lib/test/testServer.js.map +1 -1
- package/lib/test/testUtils.d.ts +5 -5
- package/lib/test/testUtils.d.ts.map +1 -1
- package/lib/test/testUtils.js +3 -3
- package/lib/test/testUtils.js.map +1 -1
- package/lib/test/text.d.ts +1 -1
- package/lib/test/text.d.ts.map +1 -1
- package/lib/test/text.js.map +1 -1
- package/lib/test/tracking.spec.js.map +1 -1
- package/lib/test/wordUnitTests.spec.d.ts.map +1 -1
- package/lib/test/wordUnitTests.spec.js +2 -2
- package/lib/test/wordUnitTests.spec.js.map +1 -1
- package/lib/textSegment.d.ts.map +1 -1
- package/lib/textSegment.js +1 -1
- package/lib/textSegment.js.map +1 -1
- package/lib/zamboni.d.ts +2 -2
- package/lib/zamboni.d.ts.map +1 -1
- package/lib/zamboni.js.map +1 -1
- package/package.json +37 -58
- package/src/MergeTreeTextHelper.ts +1 -1
- package/src/attributionCollection.ts +4 -3
- package/src/attributionPolicy.ts +7 -6
- package/src/client.ts +32 -45
- package/src/collections/list.ts +1 -1
- package/src/endOfTreeSegment.ts +5 -4
- package/src/index.ts +5 -1
- package/src/localReference.ts +4 -3
- package/src/mergeTree.ts +66 -84
- package/src/mergeTreeDeltaCallback.ts +3 -1
- package/src/mergeTreeNodeWalk.ts +6 -6
- package/src/mergeTreeNodes.ts +59 -61
- package/src/opBuilder.ts +3 -3
- package/src/ordinal.ts +1 -1
- package/src/partialLengths.ts +11 -10
- package/src/revertibles.ts +6 -5
- package/src/segmentPropertiesManager.ts +3 -2
- package/src/snapshotChunks.ts +3 -2
- package/src/snapshotLoader.ts +10 -12
- package/src/snapshotV1.ts +15 -12
- package/src/snapshotlegacy.ts +8 -6
- package/src/textSegment.ts +2 -1
- package/src/zamboni.ts +7 -7
- package/api-extractor-cjs.json +0 -8
- package/dist/merge-tree-alpha.d.ts +0 -1558
- package/dist/merge-tree-beta.d.ts +0 -230
- package/dist/merge-tree-public.d.ts +0 -230
- package/dist/merge-tree-untrimmed.d.ts +0 -1894
- package/lib/merge-tree-alpha.d.ts +0 -1558
- package/lib/merge-tree-beta.d.ts +0 -230
- package/lib/merge-tree-public.d.ts +0 -230
- package/lib/merge-tree-untrimmed.d.ts +0 -1894
- package/lib/test/types/validateMergeTreePrevious.generated.d.ts +0 -2
- package/lib/test/types/validateMergeTreePrevious.generated.d.ts.map +0 -1
- package/lib/test/types/validateMergeTreePrevious.generated.js +0 -228
- package/lib/test/types/validateMergeTreePrevious.generated.js.map +0 -1
- /package/{dist → lib}/tsdoc-metadata.json +0 -0
package/lib/textSegment.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { assert } from "@fluidframework/core-utils";
|
|
5
|
+
import { assert } from "@fluidframework/core-utils/internal";
|
|
6
6
|
import { BaseSegment } from "./mergeTreeNodes.js";
|
|
7
7
|
// Maximum length of text segment to be considered to be merged with other segment.
|
|
8
8
|
// Maximum segment length is at least 2x of it (not taking into account initial segment creation).
|
package/lib/textSegment.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textSegment.js","sourceRoot":"","sources":["../src/textSegment.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+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AAC,EAAE;YACZ,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;YAC/C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YACxC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;YACrC,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,aAAa,CAAC,CAAC;YACnD,OAAO,WAAW,CAAC;SACnB;IACF,CAAC;;AAtEsB,gBAAI,GAAG,aAAa,AAAhB,CAAiB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { BaseSegment, ISegment } from \"./mergeTreeNodes.js\";\nimport { IJSONSegment } from \"./ops.js\";\nimport { PropertySet } from \"./properties.js\";\n\n// Maximum length of text segment to be considered to be merged with other segment.\n// Maximum segment length is at least 2x of it (not taking into account initial segment creation).\n// The bigger it is, the more expensive it is to break segment into sub-segments (on edits)\n// The smaller it is, the more segments we have in snapshots (and in memory) - it's more expensive to load snapshots.\n// Small number also makes ReplayTool produce false positives (\"same\" snapshots have slightly different binary\n// representations). More measurements needs to be done, but it's very likely the right spot is somewhere between\n// 1K-2K mark. That said, we also break segments on newline and there are very few segments that are longer than 256\n// because of it. Must be an even number.\n// Exported for test use only.\nexport const TextSegmentGranularity = 256;\n\n/**\n * @alpha\n */\nexport interface IJSONTextSegment extends IJSONSegment {\n\ttext: string;\n}\n\n/**\n * @alpha\n */\nexport class TextSegment extends BaseSegment {\n\tpublic static readonly type = \"TextSegment\";\n\tpublic readonly type = TextSegment.type;\n\n\tpublic static is(segment: ISegment): segment is TextSegment {\n\t\treturn segment.type === TextSegment.type;\n\t}\n\n\tpublic static make(text: string, props?: PropertySet) {\n\t\tconst seg = new TextSegment(text);\n\t\tif (props) {\n\t\t\tseg.addProperties(props);\n\t\t}\n\t\treturn seg;\n\t}\n\n\tpublic static fromJSONObject(spec: any) {\n\t\tif (typeof spec === \"string\") {\n\t\t\treturn new TextSegment(spec);\n\t\t} else if (spec && typeof spec === \"object\" && \"text\" in spec) {\n\t\t\tconst textSpec = spec as IJSONTextSegment;\n\t\t\treturn TextSegment.make(textSpec.text, textSpec.props as PropertySet);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tconstructor(public text: string) {\n\t\tsuper();\n\t\tthis.cachedLength = text.length;\n\t}\n\n\tpublic toJSONObject(): IJSONTextSegment | string {\n\t\t// To reduce snapshot/ops size, we serialize a TextSegment as a plain 'string' if it is\n\t\t// not annotated.\n\t\treturn this.properties ? { text: this.text, props: this.properties } : this.text;\n\t}\n\n\tpublic clone(start = 0, end?: number) {\n\t\tconst text = this.text.substring(start, end);\n\t\tconst b = TextSegment.make(text, this.properties);\n\t\tthis.cloneInto(b);\n\t\treturn b;\n\t}\n\n\tpublic canAppend(segment: ISegment): boolean {\n\t\treturn (\n\t\t\t!this.text.endsWith(\"\\n\") &&\n\t\t\tTextSegment.is(segment) &&\n\t\t\t(this.cachedLength <= TextSegmentGranularity ||\n\t\t\t\tsegment.cachedLength <= TextSegmentGranularity)\n\t\t);\n\t}\n\n\tpublic toString() {\n\t\treturn this.text;\n\t}\n\n\tpublic append(segment: ISegment) {\n\t\tassert(TextSegment.is(segment), 0x447 /* can only append text segment */);\n\t\tsuper.append(segment);\n\t\tthis.text += segment.text;\n\t}\n\n\tprotected createSplitSegmentAt(pos: number) {\n\t\tif (pos > 0) {\n\t\t\tconst remainingText = this.text.substring(pos);\n\t\t\tthis.text = this.text.substring(0, pos);\n\t\t\tthis.cachedLength = this.text.length;\n\t\t\tconst leafSegment = new TextSegment(remainingText);\n\t\t\treturn leafSegment;\n\t\t}\n\t}\n}\n\n/**\n * @deprecated This functionality was not meant to be exported and will be removed in a future release\n * @alpha\n */\nexport interface IMergeTreeTextHelper {\n\tgetText(\n\t\trefSeq: number,\n\t\tclientId: number,\n\t\tplaceholder: string,\n\t\tstart?: number,\n\t\tend?: number,\n\t): string;\n}\n"]}
|
package/lib/zamboni.d.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { MergeTree } from "./mergeTree.js";
|
|
6
|
-
import {
|
|
6
|
+
import { type MergeBlock } from "./mergeTreeNodes.js";
|
|
7
7
|
export declare const zamboniSegmentsMax = 2;
|
|
8
8
|
export declare function zamboniSegments(mergeTree: MergeTree, zamboniSegmentsMaxCount?: number): void;
|
|
9
|
-
export declare function packParent(parent:
|
|
9
|
+
export declare function packParent(parent: MergeBlock, mergeTree: MergeTree): void;
|
|
10
10
|
//# sourceMappingURL=zamboni.d.ts.map
|
package/lib/zamboni.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zamboni.d.ts","sourceRoot":"","sources":["../src/zamboni.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EACN,
|
|
1
|
+
{"version":3,"file":"zamboni.d.ts","sourceRoot":"","sources":["../src/zamboni.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EACN,KAAK,UAAU,EAQf,MAAM,qBAAqB,CAAC;AAG7B,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAKpC,wBAAgB,eAAe,CAC9B,SAAS,EAAE,SAAS,EACpB,uBAAuB,SAAqB,QAuC5C;AAGD,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,QAwDlE"}
|
package/lib/zamboni.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zamboni.js","sourceRoot":"","sources":["../src/zamboni.ts"],"names":[],"mappings":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ClE,wBAAwB,CAAC;gBAE1B,IAAI,SAAS,EAAE;oBACd,WAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;oBAC7B,SAAS,CAAC,4BAA4B,EAAE,CACvC;wBACC,SAAS,EAAE,wBAAwB,CAAC,MAAM;wBAC1C,aAAa,EAAE,CAAC,EAAE,OAAO,EAAE,WAAY,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC;qBACvD,EACD,SAAS,CACT,CAAC;oBAEF,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;oBAC3B,OAAO,CAAC,kBAAkB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;iBAC9E;qBAAM;oBACN,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBACxB,WAAW,GAAG,wBAAwB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;iBAC7D;aACD;iBAAM;gBACN,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACxB,WAAW,GAAG,SAAS,CAAC;aACxB;SACD;KACD;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\n\nimport { UnassignedSequenceNumber } from \"./constants.js\";\nimport { MergeTree } from \"./mergeTree.js\";\nimport { MergeTreeMaintenanceType } from \"./mergeTreeDeltaCallback.js\";\nimport {\n\tIMergeBlock,\n\tIMergeNode,\n\tISegment,\n\tMarker,\n\tMaxNodesInBlock,\n\tseqLTE,\n\ttoMoveInfo,\n\ttoRemovalInfo,\n} from \"./mergeTreeNodes.js\";\nimport { matchProperties } from \"./properties.js\";\n\nexport const zamboniSegmentsMax = 2;\nfunction underflow(node: IMergeBlock) {\n\treturn node.childCount < MaxNodesInBlock / 2;\n}\n\nexport function zamboniSegments(\n\tmergeTree: MergeTree,\n\tzamboniSegmentsMaxCount = zamboniSegmentsMax,\n) {\n\tif (!mergeTree.collabWindow.collaborating) {\n\t\treturn;\n\t}\n\n\tfor (let i = 0; i < zamboniSegmentsMaxCount; i++) {\n\t\tlet segmentToScour = mergeTree.segmentsToScour.peek()?.value;\n\t\tif (!segmentToScour || segmentToScour.maxSeq > mergeTree.collabWindow.minSeq) {\n\t\t\tbreak;\n\t\t}\n\t\tsegmentToScour = mergeTree.segmentsToScour.get()!;\n\t\t// Only skip scouring if needs scour is explicitly false, not true or undefined\n\t\tif (segmentToScour?.segment?.parent && segmentToScour.segment.parent.needsScour !== false) {\n\t\t\tconst block = segmentToScour.segment.parent;\n\t\t\tconst childrenCopy: IMergeNode[] = [];\n\t\t\tscourNode(block, childrenCopy, mergeTree);\n\t\t\t// This will avoid the cost of re-scouring nodes\n\t\t\t// that have recently been scoured\n\t\t\tblock.needsScour = false;\n\n\t\t\tconst newChildCount = childrenCopy.length;\n\n\t\t\tif (newChildCount < block.childCount) {\n\t\t\t\tblock.childCount = newChildCount;\n\t\t\t\tblock.children = childrenCopy;\n\t\t\t\tfor (let j = 0; j < newChildCount; j++) {\n\t\t\t\t\tblock.assignChild(childrenCopy[j], j, false);\n\t\t\t\t}\n\n\t\t\t\tif (underflow(block) && block.parent) {\n\t\t\t\t\tpackParent(block.parent, mergeTree);\n\t\t\t\t} else {\n\t\t\t\t\tmergeTree.nodeUpdateOrdinals(block);\n\t\t\t\t\tmergeTree.blockUpdatePathLengths(block, UnassignedSequenceNumber, -1, true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Interior node with all node children\nexport function packParent(parent: IMergeBlock, mergeTree: MergeTree) {\n\tconst children = parent.children;\n\tlet childIndex: number;\n\tlet childBlock: IMergeBlock;\n\tconst holdNodes: IMergeNode[] = [];\n\tfor (childIndex = 0; childIndex < parent.childCount; childIndex++) {\n\t\t// Debug assert not isLeaf()\n\t\tchildBlock = children[childIndex] as IMergeBlock;\n\t\tscourNode(childBlock, holdNodes, mergeTree);\n\t\t// Will replace this block with a packed block\n\t\tchildBlock.parent = undefined;\n\t}\n\tif (holdNodes.length > 0) {\n\t\tconst totalNodeCount = holdNodes.length;\n\t\tconst halfOfMaxNodeCount = MaxNodesInBlock / 2;\n\t\tlet childCount = Math.min(\n\t\t\tMaxNodesInBlock - 1,\n\t\t\tMath.floor(totalNodeCount / halfOfMaxNodeCount),\n\t\t);\n\t\tif (childCount < 1) {\n\t\t\tchildCount = 1;\n\t\t}\n\t\tconst baseNodesInBlockCount = Math.floor(totalNodeCount / childCount);\n\t\tlet remainderCount = totalNodeCount % childCount;\n\t\tconst packedBlocks = new Array<IMergeBlock>(MaxNodesInBlock);\n\t\tlet childrenPackedCount = 0;\n\t\tfor (let nodeIndex = 0; nodeIndex < childCount; nodeIndex++) {\n\t\t\tlet nodeCount = baseNodesInBlockCount;\n\t\t\tif (remainderCount > 0) {\n\t\t\t\tnodeCount++;\n\t\t\t\tremainderCount--;\n\t\t\t}\n\t\t\tconst packedBlock = mergeTree.makeBlock(nodeCount);\n\t\t\tfor (let packedNodeIndex = 0; packedNodeIndex < nodeCount; packedNodeIndex++) {\n\t\t\t\tconst nodeToPack = holdNodes[childrenPackedCount++];\n\t\t\t\tpackedBlock.assignChild(nodeToPack, packedNodeIndex, false);\n\t\t\t}\n\t\t\tpackedBlock.parent = parent;\n\t\t\tpackedBlocks[nodeIndex] = packedBlock;\n\t\t\tmergeTree.nodeUpdateLengthNewStructure(packedBlock);\n\t\t}\n\t\tparent.children = packedBlocks;\n\t\tfor (let j = 0; j < childCount; j++) {\n\t\t\tparent.assignChild(packedBlocks[j], j, false);\n\t\t}\n\t\tparent.childCount = childCount;\n\t} else {\n\t\tparent.children = [];\n\t\tparent.childCount = 0;\n\t}\n\tif (underflow(parent) && parent.parent) {\n\t\tpackParent(parent.parent, mergeTree);\n\t} else {\n\t\tmergeTree.nodeUpdateOrdinals(parent);\n\t\tmergeTree.blockUpdatePathLengths(parent, UnassignedSequenceNumber, -1, true);\n\t}\n}\n\nfunction scourNode(node: IMergeBlock, holdNodes: IMergeNode[], mergeTree: MergeTree) {\n\t// The previous segment is tracked while scouring for the purposes of merging adjacent segments\n\t// when possible.\n\tlet prevSegment: ISegment | undefined;\n\tfor (let k = 0; k < node.childCount; k++) {\n\t\tconst childNode = node.children[k];\n\t\tif (!childNode.isLeaf() || !childNode.segmentGroups.empty) {\n\t\t\tholdNodes.push(childNode);\n\t\t\tprevSegment = undefined;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst segment = childNode;\n\t\tconst removalInfo = toRemovalInfo(segment);\n\t\tconst moveInfo = toMoveInfo(segment);\n\t\tif (removalInfo !== undefined || moveInfo !== undefined) {\n\t\t\t// If the segment's removal is below the MSN and it's not being held onto by a tracking group,\n\t\t\t// it can be unlinked (i.e. removed from the merge-tree)\n\t\t\tif (\n\t\t\t\t((!!removalInfo && seqLTE(removalInfo.removedSeq, mergeTree.collabWindow.minSeq)) ||\n\t\t\t\t\t(!!moveInfo && seqLTE(moveInfo.movedSeq, mergeTree.collabWindow.minSeq))) &&\n\t\t\t\tsegment.trackingCollection.empty\n\t\t\t) {\n\t\t\t\tmergeTree.mergeTreeMaintenanceCallback?.(\n\t\t\t\t\t{\n\t\t\t\t\t\toperation: MergeTreeMaintenanceType.UNLINK,\n\t\t\t\t\t\tdeltaSegments: [{ segment }],\n\t\t\t\t\t},\n\t\t\t\t\tundefined,\n\t\t\t\t);\n\n\t\t\t\tsegment.parent = undefined;\n\n\t\t\t\tif (Marker.is(segment)) {\n\t\t\t\t\tmergeTree.unlinkMarker(segment);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tholdNodes.push(segment);\n\t\t\t}\n\n\t\t\tprevSegment = undefined;\n\t\t} else {\n\t\t\tif (segment.seq! <= mergeTree.collabWindow.minSeq) {\n\t\t\t\tconst segmentHasPositiveLength = (mergeTree.localNetLength(segment) ?? 0) > 0;\n\t\t\t\tconst canAppend =\n\t\t\t\t\tprevSegment?.canAppend(segment) &&\n\t\t\t\t\tmatchProperties(prevSegment.properties, segment.properties) &&\n\t\t\t\t\tprevSegment.trackingCollection.matches(segment.trackingCollection) &&\n\t\t\t\t\tsegmentHasPositiveLength;\n\n\t\t\t\tif (canAppend) {\n\t\t\t\t\tprevSegment!.append(segment);\n\t\t\t\t\tmergeTree.mergeTreeMaintenanceCallback?.(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toperation: MergeTreeMaintenanceType.APPEND,\n\t\t\t\t\t\t\tdeltaSegments: [{ segment: prevSegment! }, { segment }],\n\t\t\t\t\t\t},\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t);\n\n\t\t\t\t\tsegment.parent = undefined;\n\t\t\t\t\tsegment.trackingCollection.trackingGroups.forEach((tg) => tg.unlink(segment));\n\t\t\t\t} else {\n\t\t\t\t\tholdNodes.push(segment);\n\t\t\t\t\tprevSegment = segmentHasPositiveLength ? segment : undefined;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tholdNodes.push(segment);\n\t\t\t\tprevSegment = undefined;\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"zamboni.js","sourceRoot":"","sources":["../src/zamboni.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,6DAA6D;AAE7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAIN,MAAM,EACN,eAAe,EACf,MAAM,EACN,UAAU,EACV,aAAa,GACb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AACpC,SAAS,SAAS,CAAC,IAAgB;IAClC,OAAO,IAAI,CAAC,UAAU,GAAG,eAAe,GAAG,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM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,CAAC,CAAC,CAAC;iBAC9E;qBAAM;oBACN,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBACxB,WAAW,GAAG,wBAAwB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;iBAC7D;aACD;iBAAM;gBACN,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACxB,WAAW,GAAG,SAAS,CAAC;aACxB;SACD;KACD;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\n\nimport { UnassignedSequenceNumber } from \"./constants.js\";\nimport { MergeTree } from \"./mergeTree.js\";\nimport { MergeTreeMaintenanceType } from \"./mergeTreeDeltaCallback.js\";\nimport {\n\ttype MergeBlock,\n\tIMergeNode,\n\tISegment,\n\tMarker,\n\tMaxNodesInBlock,\n\tseqLTE,\n\ttoMoveInfo,\n\ttoRemovalInfo,\n} from \"./mergeTreeNodes.js\";\nimport { matchProperties } from \"./properties.js\";\n\nexport const zamboniSegmentsMax = 2;\nfunction underflow(node: MergeBlock) {\n\treturn node.childCount < MaxNodesInBlock / 2;\n}\n\nexport function zamboniSegments(\n\tmergeTree: MergeTree,\n\tzamboniSegmentsMaxCount = zamboniSegmentsMax,\n) {\n\tif (!mergeTree.collabWindow.collaborating) {\n\t\treturn;\n\t}\n\n\tfor (let i = 0; i < zamboniSegmentsMaxCount; i++) {\n\t\tlet segmentToScour = mergeTree.segmentsToScour.peek()?.value;\n\t\tif (!segmentToScour || segmentToScour.maxSeq > mergeTree.collabWindow.minSeq) {\n\t\t\tbreak;\n\t\t}\n\t\tsegmentToScour = mergeTree.segmentsToScour.get()!;\n\t\t// Only skip scouring if needs scour is explicitly false, not true or undefined\n\t\tif (segmentToScour?.segment?.parent && segmentToScour.segment.parent.needsScour !== false) {\n\t\t\tconst block = segmentToScour.segment.parent;\n\t\t\tconst childrenCopy: IMergeNode[] = [];\n\t\t\tscourNode(block, childrenCopy, mergeTree);\n\t\t\t// This will avoid the cost of re-scouring nodes\n\t\t\t// that have recently been scoured\n\t\t\tblock.needsScour = false;\n\n\t\t\tconst newChildCount = childrenCopy.length;\n\n\t\t\tif (newChildCount < block.childCount) {\n\t\t\t\tblock.childCount = newChildCount;\n\t\t\t\tblock.children = childrenCopy;\n\t\t\t\tfor (let j = 0; j < newChildCount; j++) {\n\t\t\t\t\tblock.assignChild(childrenCopy[j], j, false);\n\t\t\t\t}\n\n\t\t\t\tif (underflow(block) && block.parent) {\n\t\t\t\t\tpackParent(block.parent, mergeTree);\n\t\t\t\t} else {\n\t\t\t\t\tmergeTree.nodeUpdateOrdinals(block);\n\t\t\t\t\tmergeTree.blockUpdatePathLengths(block, UnassignedSequenceNumber, -1, true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Interior node with all node children\nexport function packParent(parent: MergeBlock, mergeTree: MergeTree) {\n\tconst children = parent.children;\n\tlet childIndex: number;\n\tlet childBlock: MergeBlock;\n\tconst holdNodes: IMergeNode[] = [];\n\tfor (childIndex = 0; childIndex < parent.childCount; childIndex++) {\n\t\t// Debug assert not isLeaf()\n\t\tchildBlock = children[childIndex] as MergeBlock;\n\t\tscourNode(childBlock, holdNodes, mergeTree);\n\t\t// Will replace this block with a packed block\n\t\tchildBlock.parent = undefined;\n\t}\n\tif (holdNodes.length > 0) {\n\t\tconst totalNodeCount = holdNodes.length;\n\t\tconst halfOfMaxNodeCount = MaxNodesInBlock / 2;\n\t\tlet childCount = Math.min(\n\t\t\tMaxNodesInBlock - 1,\n\t\t\tMath.floor(totalNodeCount / halfOfMaxNodeCount),\n\t\t);\n\t\tif (childCount < 1) {\n\t\t\tchildCount = 1;\n\t\t}\n\t\tconst baseNodesInBlockCount = Math.floor(totalNodeCount / childCount);\n\t\tlet remainderCount = totalNodeCount % childCount;\n\t\tconst packedBlocks = new Array<MergeBlock>(MaxNodesInBlock);\n\t\tlet childrenPackedCount = 0;\n\t\tfor (let nodeIndex = 0; nodeIndex < childCount; nodeIndex++) {\n\t\t\tlet nodeCount = baseNodesInBlockCount;\n\t\t\tif (remainderCount > 0) {\n\t\t\t\tnodeCount++;\n\t\t\t\tremainderCount--;\n\t\t\t}\n\t\t\tconst packedBlock = mergeTree.makeBlock(nodeCount);\n\t\t\tfor (let packedNodeIndex = 0; packedNodeIndex < nodeCount; packedNodeIndex++) {\n\t\t\t\tconst nodeToPack = holdNodes[childrenPackedCount++];\n\t\t\t\tpackedBlock.assignChild(nodeToPack, packedNodeIndex, false);\n\t\t\t}\n\t\t\tpackedBlock.parent = parent;\n\t\t\tpackedBlocks[nodeIndex] = packedBlock;\n\t\t\tmergeTree.nodeUpdateLengthNewStructure(packedBlock);\n\t\t}\n\t\tparent.children = packedBlocks;\n\t\tfor (let j = 0; j < childCount; j++) {\n\t\t\tparent.assignChild(packedBlocks[j], j, false);\n\t\t}\n\t\tparent.childCount = childCount;\n\t} else {\n\t\tparent.children = [];\n\t\tparent.childCount = 0;\n\t}\n\tif (underflow(parent) && parent.parent) {\n\t\tpackParent(parent.parent, mergeTree);\n\t} else {\n\t\tmergeTree.nodeUpdateOrdinals(parent);\n\t\tmergeTree.blockUpdatePathLengths(parent, UnassignedSequenceNumber, -1, true);\n\t}\n}\n\nfunction scourNode(node: MergeBlock, holdNodes: IMergeNode[], mergeTree: MergeTree) {\n\t// The previous segment is tracked while scouring for the purposes of merging adjacent segments\n\t// when possible.\n\tlet prevSegment: ISegment | undefined;\n\tfor (let k = 0; k < node.childCount; k++) {\n\t\tconst childNode = node.children[k];\n\t\tif (!childNode.isLeaf() || !childNode.segmentGroups.empty) {\n\t\t\tholdNodes.push(childNode);\n\t\t\tprevSegment = undefined;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst segment = childNode;\n\t\tconst removalInfo = toRemovalInfo(segment);\n\t\tconst moveInfo = toMoveInfo(segment);\n\t\tif (removalInfo !== undefined || moveInfo !== undefined) {\n\t\t\t// If the segment's removal is below the MSN and it's not being held onto by a tracking group,\n\t\t\t// it can be unlinked (i.e. removed from the merge-tree)\n\t\t\tif (\n\t\t\t\t((!!removalInfo && seqLTE(removalInfo.removedSeq, mergeTree.collabWindow.minSeq)) ||\n\t\t\t\t\t(!!moveInfo && seqLTE(moveInfo.movedSeq, mergeTree.collabWindow.minSeq))) &&\n\t\t\t\tsegment.trackingCollection.empty\n\t\t\t) {\n\t\t\t\tmergeTree.mergeTreeMaintenanceCallback?.(\n\t\t\t\t\t{\n\t\t\t\t\t\toperation: MergeTreeMaintenanceType.UNLINK,\n\t\t\t\t\t\tdeltaSegments: [{ segment }],\n\t\t\t\t\t},\n\t\t\t\t\tundefined,\n\t\t\t\t);\n\n\t\t\t\tsegment.parent = undefined;\n\n\t\t\t\tif (Marker.is(segment)) {\n\t\t\t\t\tmergeTree.unlinkMarker(segment);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tholdNodes.push(segment);\n\t\t\t}\n\n\t\t\tprevSegment = undefined;\n\t\t} else {\n\t\t\tif (segment.seq! <= mergeTree.collabWindow.minSeq) {\n\t\t\t\tconst segmentHasPositiveLength = (mergeTree.localNetLength(segment) ?? 0) > 0;\n\t\t\t\tconst canAppend =\n\t\t\t\t\tprevSegment?.canAppend(segment) &&\n\t\t\t\t\tmatchProperties(prevSegment.properties, segment.properties) &&\n\t\t\t\t\tprevSegment.trackingCollection.matches(segment.trackingCollection) &&\n\t\t\t\t\tsegmentHasPositiveLength;\n\n\t\t\t\tif (canAppend) {\n\t\t\t\t\tprevSegment!.append(segment);\n\t\t\t\t\tmergeTree.mergeTreeMaintenanceCallback?.(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toperation: MergeTreeMaintenanceType.APPEND,\n\t\t\t\t\t\t\tdeltaSegments: [{ segment: prevSegment! }, { segment }],\n\t\t\t\t\t\t},\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t);\n\n\t\t\t\t\tsegment.parent = undefined;\n\t\t\t\t\tsegment.trackingCollection.trackingGroups.forEach((tg) => tg.unlink(segment));\n\t\t\t\t} else {\n\t\t\t\t\tholdNodes.push(segment);\n\t\t\t\t\tprevSegment = segmentHasPositiveLength ? segment : undefined;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tholdNodes.push(segment);\n\t\t\t\tprevSegment = undefined;\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/merge-tree",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.3.0.0",
|
|
4
4
|
"description": "Merge tree",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -15,31 +15,21 @@
|
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
17
|
"import": {
|
|
18
|
-
"types": "./lib/
|
|
19
|
-
"default": "./lib/index.js"
|
|
20
|
-
},
|
|
21
|
-
"require": {
|
|
22
|
-
"types": "./dist/index.d.ts",
|
|
23
|
-
"default": "./dist/index.js"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"./public": {
|
|
27
|
-
"import": {
|
|
28
|
-
"types": "./lib/merge-tree-public.d.ts",
|
|
18
|
+
"types": "./lib/public.d.ts",
|
|
29
19
|
"default": "./lib/index.js"
|
|
30
20
|
},
|
|
31
21
|
"require": {
|
|
32
|
-
"types": "./dist/
|
|
22
|
+
"types": "./dist/public.d.ts",
|
|
33
23
|
"default": "./dist/index.js"
|
|
34
24
|
}
|
|
35
25
|
},
|
|
36
|
-
"./
|
|
26
|
+
"./legacy": {
|
|
37
27
|
"import": {
|
|
38
|
-
"types": "./lib/
|
|
28
|
+
"types": "./lib/legacy.d.ts",
|
|
39
29
|
"default": "./lib/index.js"
|
|
40
30
|
},
|
|
41
31
|
"require": {
|
|
42
|
-
"types": "./dist/
|
|
32
|
+
"types": "./dist/legacy.d.ts",
|
|
43
33
|
"default": "./dist/index.js"
|
|
44
34
|
}
|
|
45
35
|
},
|
|
@@ -53,7 +43,7 @@
|
|
|
53
43
|
"default": "./dist/index.js"
|
|
54
44
|
}
|
|
55
45
|
},
|
|
56
|
-
"./test": {
|
|
46
|
+
"./internal/test": {
|
|
57
47
|
"import": {
|
|
58
48
|
"types": "./lib/test/index.d.ts",
|
|
59
49
|
"default": "./lib/test/index.js"
|
|
@@ -64,8 +54,8 @@
|
|
|
64
54
|
}
|
|
65
55
|
}
|
|
66
56
|
},
|
|
67
|
-
"main": "
|
|
68
|
-
"types": "
|
|
57
|
+
"main": "lib/index.js",
|
|
58
|
+
"types": "lib/public.d.ts",
|
|
69
59
|
"c8": {
|
|
70
60
|
"all": true,
|
|
71
61
|
"cache-dir": "nyc/.cache",
|
|
@@ -87,29 +77,30 @@
|
|
|
87
77
|
"temp-directory": "nyc/.nyc_output"
|
|
88
78
|
},
|
|
89
79
|
"dependencies": {
|
|
90
|
-
"@fluid-internal/client-utils": ">=2.0.0-rc.
|
|
91
|
-
"@fluidframework/container-definitions": ">=2.0.0-rc.
|
|
92
|
-
"@fluidframework/core-interfaces": ">=2.0.0-rc.
|
|
93
|
-
"@fluidframework/core-utils": ">=2.0.0-rc.
|
|
94
|
-
"@fluidframework/datastore-definitions": ">=2.0.0-rc.
|
|
80
|
+
"@fluid-internal/client-utils": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
81
|
+
"@fluidframework/container-definitions": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
82
|
+
"@fluidframework/core-interfaces": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
83
|
+
"@fluidframework/core-utils": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
84
|
+
"@fluidframework/datastore-definitions": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
95
85
|
"@fluidframework/protocol-definitions": "^3.2.0",
|
|
96
|
-
"@fluidframework/runtime-definitions": ">=2.0.0-rc.
|
|
97
|
-
"@fluidframework/runtime-utils": ">=2.0.0-rc.
|
|
98
|
-
"@fluidframework/shared-object-base": ">=2.0.0-rc.
|
|
99
|
-
"@fluidframework/telemetry-utils": ">=2.0.0-rc.
|
|
86
|
+
"@fluidframework/runtime-definitions": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
87
|
+
"@fluidframework/runtime-utils": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
88
|
+
"@fluidframework/shared-object-base": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
89
|
+
"@fluidframework/telemetry-utils": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0"
|
|
100
90
|
},
|
|
101
91
|
"devDependencies": {
|
|
102
|
-
"@arethetypeswrong/cli": "^0.
|
|
103
|
-
"@
|
|
104
|
-
"@fluid-
|
|
105
|
-
"@fluid-private/test-
|
|
92
|
+
"@arethetypeswrong/cli": "^0.15.2",
|
|
93
|
+
"@biomejs/biome": "^1.6.2",
|
|
94
|
+
"@fluid-internal/mocha-test-setup": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
95
|
+
"@fluid-private/stochastic-test-utils": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
96
|
+
"@fluid-private/test-pairwise-generator": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
106
97
|
"@fluid-tools/benchmark": "^0.48.0",
|
|
107
|
-
"@fluid-tools/build-cli": "^0.
|
|
98
|
+
"@fluid-tools/build-cli": "^0.37.0",
|
|
108
99
|
"@fluidframework/build-common": "^2.0.3",
|
|
109
|
-
"@fluidframework/build-tools": "^0.
|
|
110
|
-
"@fluidframework/eslint-config-fluid": "^
|
|
100
|
+
"@fluidframework/build-tools": "^0.37.0",
|
|
101
|
+
"@fluidframework/eslint-config-fluid": "^5.1.0",
|
|
111
102
|
"@fluidframework/merge-tree-previous": "npm:@fluidframework/merge-tree@2.0.0-internal.8.0.0",
|
|
112
|
-
"@fluidframework/test-runtime-utils": ">=2.0.0-rc.
|
|
103
|
+
"@fluidframework/test-runtime-utils": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
113
104
|
"@microsoft/api-extractor": "^7.42.3",
|
|
114
105
|
"@types/diff": "^3.5.1",
|
|
115
106
|
"@types/mocha": "^9.1.1",
|
|
@@ -128,18 +119,6 @@
|
|
|
128
119
|
"rimraf": "^4.4.0",
|
|
129
120
|
"typescript": "~5.1.6"
|
|
130
121
|
},
|
|
131
|
-
"fluidBuild": {
|
|
132
|
-
"tasks": {
|
|
133
|
-
"build:docs": {
|
|
134
|
-
"dependsOn": [
|
|
135
|
-
"...",
|
|
136
|
-
"api-extractor:commonjs",
|
|
137
|
-
"api-extractor:esnext"
|
|
138
|
-
],
|
|
139
|
-
"script": false
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
122
|
"typeValidation": {
|
|
144
123
|
"broken": {
|
|
145
124
|
"ClassDeclaration_Client": {
|
|
@@ -149,30 +128,30 @@
|
|
|
149
128
|
},
|
|
150
129
|
"scripts": {
|
|
151
130
|
"api": "fluid-build . --task api",
|
|
152
|
-
"api-extractor:commonjs": "
|
|
153
|
-
"api-extractor:esnext": "
|
|
131
|
+
"api-extractor:commonjs": "flub generate entrypoints --outFileAlpha legacy --outDir ./dist",
|
|
132
|
+
"api-extractor:esnext": "flub generate entrypoints --outFileAlpha legacy --outDir ./lib --node10TypeCompat",
|
|
154
133
|
"build": "fluid-build . --task build",
|
|
155
134
|
"build:commonjs": "fluid-build . --task commonjs",
|
|
156
135
|
"build:compile": "fluid-build . --task compile",
|
|
157
|
-
"build:docs": "
|
|
136
|
+
"build:docs": "api-extractor run --local",
|
|
158
137
|
"build:esnext": "tsc --project ./tsconfig.json",
|
|
159
138
|
"build:test": "npm run build:test:esm && npm run build:test:cjs",
|
|
160
139
|
"build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
|
|
161
140
|
"build:test:esm": "tsc --project ./src/test/tsconfig.json",
|
|
162
|
-
"check:are-the-types-wrong": "attw --pack . --entrypoints
|
|
141
|
+
"check:are-the-types-wrong": "attw --pack . --exclude-entrypoints ./internal/test",
|
|
142
|
+
"check:prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
|
|
163
143
|
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
|
|
164
144
|
"ci:build:docs": "api-extractor run",
|
|
165
|
-
"clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
|
|
145
|
+
"clean": "rimraf --glob dist lib \"*.d.ts\" \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
|
|
166
146
|
"eslint": "eslint --format stylish src",
|
|
167
147
|
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
168
|
-
"format": "
|
|
169
|
-
"
|
|
170
|
-
"lint
|
|
148
|
+
"format": "fluid-build --task format .",
|
|
149
|
+
"format:prettier": "prettier --write . --cache --ignore-path ../../../.prettierignore",
|
|
150
|
+
"lint": "fluid-build . --task lint",
|
|
151
|
+
"lint:fix": "fluid-build . --task eslint:fix --task format",
|
|
171
152
|
"perf": "cross-env FLUID_TEST_VERBOSE=1 mocha \"dist/**/*.spec.*js\" --node-option unhandled-rejections=strict,expose-gc --exit --perfMode --fgrep @Benchmark --reporter @fluid-tools/benchmark/dist/MochaReporter.js --timeout 30000",
|
|
172
153
|
"perf:measure": "npm run perf -- --fgrep @Measurement",
|
|
173
154
|
"perf:profile": "node --inspect-brk ./node_modules/mocha/bin/mocha.js \"dist/**/*.spec.*js\" --node-option unhandled-rejections=strict,expose-gc --exit --perfMode --fgrep @Benchmark --reporter @fluid-tools/benchmark/dist/MochaReporter.js --timeout 30000",
|
|
174
|
-
"prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
|
|
175
|
-
"prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
|
|
176
155
|
"test": "npm run test:mocha",
|
|
177
156
|
"test:benchmark:report": "mocha \"dist/test/*.perf.spec.*js\" --node-option unhandled-rejections=strict,expose-gc --exit --perfMode --fgrep @Benchmark -r @fluid-internal/mocha-test-setup --reporter @fluid-tools/benchmark/dist/MochaReporter.js --timeout 60000",
|
|
178
157
|
"test:coverage": "c8 npm test",
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { IIntegerRange } from "./client.js";
|
|
7
|
-
import { ISegment } from "./mergeTreeNodes.js";
|
|
8
7
|
import { MergeTree } from "./mergeTree.js";
|
|
8
|
+
import { ISegment } from "./mergeTreeNodes.js";
|
|
9
9
|
// eslint-disable-next-line import/no-deprecated
|
|
10
10
|
import { IMergeTreeTextHelper, TextSegment } from "./textSegment.js";
|
|
11
11
|
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { assert, unreachableCase } from "@fluidframework/core-utils";
|
|
6
|
+
import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import {
|
|
8
8
|
AttributionKey,
|
|
9
|
-
OpAttributionKey,
|
|
10
9
|
DetachedAttributionKey,
|
|
11
|
-
|
|
10
|
+
OpAttributionKey,
|
|
11
|
+
} from "@fluidframework/runtime-definitions/internal";
|
|
12
|
+
|
|
12
13
|
import { ISegment } from "./mergeTreeNodes.js";
|
|
13
14
|
|
|
14
15
|
/**
|
package/src/attributionPolicy.ts
CHANGED
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { assert } from "@fluidframework/core-utils";
|
|
7
|
-
import { AttributionKey } from "@fluidframework/runtime-definitions";
|
|
6
|
+
import { assert } from "@fluidframework/core-utils/internal";
|
|
8
7
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
9
|
-
import {
|
|
8
|
+
import { AttributionKey } from "@fluidframework/runtime-definitions/internal";
|
|
9
|
+
|
|
10
|
+
import { AttributionCollection } from "./attributionCollection.js";
|
|
10
11
|
// eslint-disable-next-line import/no-deprecated
|
|
11
12
|
import { Client } from "./client.js";
|
|
13
|
+
import { AttributionPolicy } from "./mergeTree.js";
|
|
12
14
|
import {
|
|
13
15
|
IMergeTreeDeltaCallbackArgs,
|
|
14
16
|
IMergeTreeDeltaOpArgs,
|
|
@@ -17,7 +19,6 @@ import {
|
|
|
17
19
|
MergeTreeMaintenanceType,
|
|
18
20
|
} from "./mergeTreeDeltaCallback.js";
|
|
19
21
|
import { MergeTreeDeltaType } from "./ops.js";
|
|
20
|
-
import { AttributionCollection } from "./attributionCollection.js";
|
|
21
22
|
|
|
22
23
|
// Note: these thinly wrap MergeTreeDeltaCallback and MergeTreeMaintenanceCallback to provide the client.
|
|
23
24
|
// This is because the base callbacks don't always have enough information to infer whether the op being
|
|
@@ -223,7 +224,7 @@ export function createInsertOnlyAttributionPolicy(): AttributionPolicy {
|
|
|
223
224
|
* const lastBoldedAttributionKey = segment.attribution?.getAtOffset(0, "bold");
|
|
224
225
|
* const lastItalicizedAttributionKey = segment.attribution?.getAtOffset(0, "italic");
|
|
225
226
|
* ```
|
|
226
|
-
* @
|
|
227
|
+
* @internal
|
|
227
228
|
*/
|
|
228
229
|
export function createPropertyTrackingAttributionPolicyFactory(
|
|
229
230
|
...propNames: string[]
|
|
@@ -241,7 +242,7 @@ export function createPropertyTrackingAttributionPolicyFactory(
|
|
|
241
242
|
* Creates an attribution policy which tracks insertion as well as annotation of certain property names.
|
|
242
243
|
* This combines the policies creatable using {@link createPropertyTrackingAttributionPolicyFactory} and
|
|
243
244
|
* {@link createInsertOnlyAttributionPolicy}: see there for more details.
|
|
244
|
-
* @
|
|
245
|
+
* @internal
|
|
245
246
|
*/
|
|
246
247
|
export function createPropertyTrackingAndInsertionAttributionPolicyFactory(
|
|
247
248
|
...propNames: string[]
|
package/src/client.ts
CHANGED
|
@@ -5,31 +5,42 @@
|
|
|
5
5
|
|
|
6
6
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
9
|
+
import { type IEventThisPlaceHolder, IFluidHandle } from "@fluidframework/core-interfaces";
|
|
10
|
+
import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
11
11
|
import {
|
|
12
|
-
IFluidDataStoreRuntime,
|
|
13
12
|
IChannelStorageService,
|
|
13
|
+
IFluidDataStoreRuntime,
|
|
14
14
|
} from "@fluidframework/datastore-definitions";
|
|
15
|
+
import { ISequencedDocumentMessage, MessageType } from "@fluidframework/protocol-definitions";
|
|
15
16
|
import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
17
|
+
import { IFluidSerializer } from "@fluidframework/shared-object-base";
|
|
18
|
+
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
19
|
+
import { LoggingError, UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
20
|
+
|
|
21
|
+
import { MergeTreeTextHelper } from "./MergeTreeTextHelper.js";
|
|
19
22
|
import { DoublyLinkedList, RedBlackTree } from "./collections/index.js";
|
|
20
23
|
import { UnassignedSequenceNumber, UniversalSequenceNumber } from "./constants.js";
|
|
21
24
|
import { LocalReferencePosition, SlidingPreference } from "./localReference.js";
|
|
25
|
+
import { IMergeTreeOptions, MergeTree } from "./mergeTree.js";
|
|
26
|
+
import type {
|
|
27
|
+
IMergeTreeClientSequenceArgs,
|
|
28
|
+
IMergeTreeDeltaCallbackArgs,
|
|
29
|
+
IMergeTreeDeltaOpArgs,
|
|
30
|
+
IMergeTreeMaintenanceCallbackArgs,
|
|
31
|
+
} from "./mergeTreeDeltaCallback.js";
|
|
32
|
+
import { walkAllChildSegments } from "./mergeTreeNodeWalk.js";
|
|
22
33
|
import {
|
|
23
34
|
// eslint-disable-next-line import/no-deprecated
|
|
24
35
|
CollaborationWindow,
|
|
25
|
-
compareStrings,
|
|
26
36
|
IMoveInfo,
|
|
27
|
-
ISegmentLeaf,
|
|
28
37
|
ISegment,
|
|
29
38
|
ISegmentAction,
|
|
39
|
+
ISegmentLeaf,
|
|
30
40
|
Marker,
|
|
31
41
|
// eslint-disable-next-line import/no-deprecated
|
|
32
42
|
SegmentGroup,
|
|
43
|
+
compareStrings,
|
|
33
44
|
} from "./mergeTreeNodes.js";
|
|
34
45
|
import {
|
|
35
46
|
createAnnotateMarkerOp,
|
|
@@ -47,30 +58,21 @@ import {
|
|
|
47
58
|
// eslint-disable-next-line import/no-deprecated
|
|
48
59
|
IMergeTreeGroupMsg,
|
|
49
60
|
IMergeTreeInsertMsg,
|
|
50
|
-
|
|
61
|
+
// eslint-disable-next-line import/no-deprecated
|
|
62
|
+
IMergeTreeObliterateMsg,
|
|
51
63
|
IMergeTreeOp,
|
|
64
|
+
IMergeTreeRemoveMsg,
|
|
52
65
|
IRelativePosition,
|
|
53
66
|
MergeTreeDeltaType,
|
|
54
67
|
ReferenceType,
|
|
55
|
-
// eslint-disable-next-line import/no-deprecated
|
|
56
|
-
IMergeTreeObliterateMsg,
|
|
57
68
|
} from "./ops.js";
|
|
58
69
|
import { PropertySet } from "./properties.js";
|
|
59
|
-
import {
|
|
70
|
+
import { DetachedReferencePosition, ReferencePosition } from "./referencePositions.js";
|
|
60
71
|
import { SnapshotLoader } from "./snapshotLoader.js";
|
|
72
|
+
import { SnapshotV1 } from "./snapshotV1.js";
|
|
73
|
+
import { SnapshotLegacy } from "./snapshotlegacy.js";
|
|
61
74
|
// eslint-disable-next-line import/no-deprecated
|
|
62
75
|
import { IMergeTreeTextHelper } from "./textSegment.js";
|
|
63
|
-
import { SnapshotV1 } from "./snapshotV1.js";
|
|
64
|
-
import { ReferencePosition, DetachedReferencePosition } from "./referencePositions.js";
|
|
65
|
-
import { IMergeTreeOptions, MergeTree } from "./mergeTree.js";
|
|
66
|
-
import { MergeTreeTextHelper } from "./MergeTreeTextHelper.js";
|
|
67
|
-
import { walkAllChildSegments } from "./mergeTreeNodeWalk.js";
|
|
68
|
-
import {
|
|
69
|
-
IMergeTreeClientSequenceArgs,
|
|
70
|
-
IMergeTreeDeltaCallbackArgs,
|
|
71
|
-
IMergeTreeDeltaOpArgs,
|
|
72
|
-
IMergeTreeMaintenanceCallbackArgs,
|
|
73
|
-
} from "./index.js";
|
|
74
76
|
|
|
75
77
|
type IMergeTreeDeltaRemoteOpArgs = Omit<IMergeTreeDeltaOpArgs, "sequencedMessage"> &
|
|
76
78
|
Required<Pick<IMergeTreeDeltaOpArgs, "sequencedMessage">>;
|
|
@@ -262,10 +264,8 @@ export class Client extends TypedEventEmitter<IClientEvents> {
|
|
|
262
264
|
return undefined;
|
|
263
265
|
}
|
|
264
266
|
const insertOp = createInsertSegmentOp(pos, segment);
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}
|
|
268
|
-
return undefined;
|
|
267
|
+
this.applyInsertOp({ op: insertOp });
|
|
268
|
+
return insertOp;
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
/**
|
|
@@ -283,13 +283,9 @@ export class Client extends TypedEventEmitter<IClientEvents> {
|
|
|
283
283
|
);
|
|
284
284
|
|
|
285
285
|
if (pos === DetachedReferencePosition) {
|
|
286
|
-
|
|
287
|
-
}
|
|
288
|
-
const op = createInsertSegmentOp(pos, segment);
|
|
289
|
-
|
|
290
|
-
if (this.applyInsertOp({ op })) {
|
|
291
|
-
return op;
|
|
286
|
+
throw new UsageError("Cannot insert at detached local reference.");
|
|
292
287
|
}
|
|
288
|
+
return this.insertSegmentLocal(pos, segment);
|
|
293
289
|
}
|
|
294
290
|
|
|
295
291
|
public walkSegments<TClientData>(
|
|
@@ -533,7 +529,7 @@ export class Client extends TypedEventEmitter<IClientEvents> {
|
|
|
533
529
|
* @param opArgs - The ops args for the op
|
|
534
530
|
* @returns True if the insert was applied. False if it could not be.
|
|
535
531
|
*/
|
|
536
|
-
private applyInsertOp(opArgs: IMergeTreeDeltaOpArgs):
|
|
532
|
+
private applyInsertOp(opArgs: IMergeTreeDeltaOpArgs): void {
|
|
537
533
|
assert(
|
|
538
534
|
opArgs.op.type === MergeTreeDeltaType.INSERT,
|
|
539
535
|
0x02f /* "Unexpected op type on range insert!" */,
|
|
@@ -542,14 +538,7 @@ export class Client extends TypedEventEmitter<IClientEvents> {
|
|
|
542
538
|
const clientArgs = this.getClientSequenceArgs(opArgs);
|
|
543
539
|
const range = this.getValidOpRange(op, clientArgs);
|
|
544
540
|
|
|
545
|
-
|
|
546
|
-
if (op.seg) {
|
|
547
|
-
segments = [this.specToSegment(op.seg)];
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
if (!segments || segments.length === 0) {
|
|
551
|
-
return false;
|
|
552
|
-
}
|
|
541
|
+
const segments = [this.specToSegment(op.seg)];
|
|
553
542
|
|
|
554
543
|
this._mergeTree.insertSegments(
|
|
555
544
|
range.start,
|
|
@@ -559,8 +548,6 @@ export class Client extends TypedEventEmitter<IClientEvents> {
|
|
|
559
548
|
clientArgs.sequenceNumber,
|
|
560
549
|
opArgs,
|
|
561
550
|
);
|
|
562
|
-
|
|
563
|
-
return true;
|
|
564
551
|
}
|
|
565
552
|
|
|
566
553
|
/**
|
package/src/collections/list.ts
CHANGED
package/src/endOfTreeSegment.ts
CHANGED
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { assert } from "@fluidframework/core-utils";
|
|
6
|
+
import { assert } from "@fluidframework/core-utils/internal";
|
|
7
|
+
|
|
7
8
|
import { LocalClientId } from "./constants.js";
|
|
8
9
|
import { LocalReferenceCollection } from "./localReference.js";
|
|
9
10
|
import { MergeTree } from "./mergeTree.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
11
|
+
import { NodeAction, depthFirstNodeWalk } from "./mergeTreeNodeWalk.js";
|
|
12
|
+
import { IRemovalInfo, ISegment, ISegmentLeaf, type MergeBlock } from "./mergeTreeNodes.js";
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* This is a special segment that is not bound or known by the merge tree itself,
|
|
@@ -55,7 +56,7 @@ abstract class BaseEndpointSegment {
|
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
protected abstract endpointSegmentProps(): {
|
|
58
|
-
parent:
|
|
59
|
+
parent: MergeBlock;
|
|
59
60
|
index: number;
|
|
60
61
|
depth: number;
|
|
61
62
|
};
|
package/src/index.ts
CHANGED
|
@@ -10,7 +10,11 @@ export {
|
|
|
10
10
|
SerializedAttributionCollection,
|
|
11
11
|
SequenceOffsets,
|
|
12
12
|
} from "./attributionCollection.js";
|
|
13
|
-
export {
|
|
13
|
+
export {
|
|
14
|
+
createInsertOnlyAttributionPolicy,
|
|
15
|
+
createPropertyTrackingAttributionPolicyFactory,
|
|
16
|
+
createPropertyTrackingAndInsertionAttributionPolicyFactory,
|
|
17
|
+
} from "./attributionPolicy.js";
|
|
14
18
|
export { Client, IClientEvents } from "./client.js";
|
|
15
19
|
export {
|
|
16
20
|
ConflictAction,
|
package/src/localReference.ts
CHANGED
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { assert } from "@fluidframework/core-utils";
|
|
7
|
-
import { UsageError } from "@fluidframework/telemetry-utils";
|
|
6
|
+
import { assert } from "@fluidframework/core-utils/internal";
|
|
7
|
+
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
8
|
+
|
|
8
9
|
import { DoublyLinkedList, ListNode, walkList } from "./collections/index.js";
|
|
9
10
|
import { ISegment } from "./mergeTreeNodes.js";
|
|
10
11
|
import { TrackingGroup, TrackingGroupCollection } from "./mergeTreeTracking.js";
|
|
11
12
|
import { ReferenceType } from "./ops.js";
|
|
12
13
|
// eslint-disable-next-line import/no-deprecated
|
|
13
|
-
import {
|
|
14
|
+
import { PropertySet, addProperties } from "./properties.js";
|
|
14
15
|
import { ReferencePosition, refTypeIncludesFlag } from "./referencePositions.js";
|
|
15
16
|
|
|
16
17
|
/**
|