@fluid-experimental/tree 0.58.2001 → 0.59.2000-61729
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/README.md +159 -46
- package/dist/ChangeCompression.d.ts +39 -0
- package/dist/ChangeCompression.d.ts.map +1 -0
- package/dist/ChangeCompression.js +117 -0
- package/dist/ChangeCompression.js.map +1 -0
- package/{lib/default-edits/PersistedTypes.d.ts → dist/ChangeTypes.d.ts} +58 -105
- package/dist/ChangeTypes.d.ts.map +1 -0
- package/dist/{default-edits/PersistedTypes.js → ChangeTypes.js} +21 -76
- package/dist/ChangeTypes.js.map +1 -0
- package/dist/Checkout.d.ts +39 -27
- package/dist/Checkout.d.ts.map +1 -1
- package/dist/Checkout.js +61 -32
- package/dist/Checkout.js.map +1 -1
- package/dist/Common.d.ts +175 -38
- package/dist/Common.d.ts.map +1 -1
- package/dist/Common.js +240 -103
- package/dist/Common.js.map +1 -1
- package/dist/EagerCheckout.d.ts +24 -0
- package/dist/EagerCheckout.d.ts.map +1 -0
- package/dist/{BasicCheckout.js → EagerCheckout.js} +9 -6
- package/dist/EagerCheckout.js.map +1 -0
- package/dist/EditLog.d.ts +77 -63
- package/dist/EditLog.d.ts.map +1 -1
- package/dist/EditLog.js +85 -48
- package/dist/EditLog.js.map +1 -1
- package/dist/EditUtilities.d.ts +168 -0
- package/dist/EditUtilities.d.ts.map +1 -0
- package/dist/EditUtilities.js +373 -0
- package/dist/EditUtilities.js.map +1 -0
- package/dist/EventTypes.d.ts +73 -0
- package/dist/EventTypes.d.ts.map +1 -0
- package/dist/EventTypes.js +78 -0
- package/dist/EventTypes.js.map +1 -0
- package/dist/Forest.d.ts +29 -7
- package/dist/Forest.d.ts.map +1 -1
- package/dist/Forest.js +60 -36
- package/dist/Forest.js.map +1 -1
- package/dist/HistoryEditFactory.d.ts +20 -0
- package/dist/HistoryEditFactory.d.ts.map +1 -0
- package/dist/HistoryEditFactory.js +226 -0
- package/dist/HistoryEditFactory.js.map +1 -0
- package/dist/IdConversion.d.ts +12 -0
- package/dist/IdConversion.d.ts.map +1 -0
- package/dist/IdConversion.js +98 -0
- package/dist/IdConversion.js.map +1 -0
- package/dist/Identifiers.d.ts +89 -2
- package/dist/Identifiers.d.ts.map +1 -1
- package/dist/Identifiers.js +10 -0
- package/dist/Identifiers.js.map +1 -1
- package/dist/InitialTree.d.ts +2 -2
- package/dist/InitialTree.d.ts.map +1 -1
- package/dist/InitialTree.js +2 -1
- package/dist/InitialTree.js.map +1 -1
- package/dist/LazyCheckout.d.ts +28 -0
- package/dist/LazyCheckout.d.ts.map +1 -0
- package/dist/LazyCheckout.js +44 -0
- package/dist/LazyCheckout.js.map +1 -0
- package/dist/LogViewer.d.ts +129 -85
- package/dist/LogViewer.d.ts.map +1 -1
- package/dist/LogViewer.js +111 -85
- package/dist/LogViewer.js.map +1 -1
- package/dist/MergeHealth.d.ts +221 -0
- package/dist/MergeHealth.d.ts.map +1 -0
- package/dist/MergeHealth.js +263 -0
- package/dist/MergeHealth.js.map +1 -0
- package/dist/NodeIdUtilities.d.ts +105 -0
- package/dist/NodeIdUtilities.d.ts.map +1 -0
- package/dist/NodeIdUtilities.js +60 -0
- package/dist/NodeIdUtilities.js.map +1 -0
- package/dist/PayloadUtilities.d.ts +42 -0
- package/dist/PayloadUtilities.d.ts.map +1 -0
- package/dist/PayloadUtilities.js +114 -0
- package/dist/PayloadUtilities.js.map +1 -0
- package/dist/ReconciliationPath.d.ts +18 -13
- package/dist/ReconciliationPath.d.ts.map +1 -1
- package/dist/ReconciliationPath.js.map +1 -1
- package/dist/RevisionValueCache.d.ts +11 -2
- package/dist/RevisionValueCache.d.ts.map +1 -1
- package/dist/RevisionValueCache.js +2 -3
- package/dist/RevisionValueCache.js.map +1 -1
- package/dist/RevisionView.d.ts +83 -0
- package/dist/RevisionView.d.ts.map +1 -0
- package/dist/RevisionView.js +182 -0
- package/dist/RevisionView.js.map +1 -0
- package/dist/SerializationUtilities.d.ts +36 -0
- package/dist/SerializationUtilities.d.ts.map +1 -0
- package/dist/SerializationUtilities.js +102 -0
- package/dist/SerializationUtilities.js.map +1 -0
- package/dist/SharedTree.d.ts +439 -0
- package/dist/SharedTree.d.ts.map +1 -0
- package/dist/SharedTree.js +1109 -0
- package/dist/SharedTree.js.map +1 -0
- package/dist/SharedTreeEncoder.d.ts +102 -0
- package/dist/SharedTreeEncoder.d.ts.map +1 -0
- package/dist/SharedTreeEncoder.js +313 -0
- package/dist/SharedTreeEncoder.js.map +1 -0
- package/dist/StringInterner.d.ts +46 -0
- package/dist/StringInterner.d.ts.map +1 -0
- package/dist/StringInterner.js +61 -0
- package/dist/StringInterner.js.map +1 -0
- package/dist/Summary.d.ts +40 -0
- package/dist/Summary.d.ts.map +1 -0
- package/dist/Summary.js +23 -0
- package/dist/Summary.js.map +1 -0
- package/dist/SummaryBackCompatibility.d.ts +22 -22
- package/dist/SummaryBackCompatibility.d.ts.map +1 -1
- package/dist/SummaryBackCompatibility.js +30 -33
- package/dist/SummaryBackCompatibility.js.map +1 -1
- package/dist/SummaryTestUtilities.d.ts +31 -0
- package/dist/SummaryTestUtilities.d.ts.map +1 -0
- package/dist/SummaryTestUtilities.js +37 -0
- package/dist/SummaryTestUtilities.js.map +1 -0
- package/dist/Transaction.d.ts +71 -0
- package/dist/Transaction.d.ts.map +1 -0
- package/dist/Transaction.js +92 -0
- package/dist/Transaction.js.map +1 -0
- package/dist/TransactionInternal.d.ts +540 -0
- package/dist/TransactionInternal.d.ts.map +1 -0
- package/dist/TransactionInternal.js +626 -0
- package/dist/TransactionInternal.js.map +1 -0
- package/dist/TreeCompressor.d.ts +36 -0
- package/dist/TreeCompressor.d.ts.map +1 -0
- package/dist/TreeCompressor.js +137 -0
- package/dist/TreeCompressor.js.map +1 -0
- package/dist/TreeNodeHandle.d.ts +12 -18
- package/dist/TreeNodeHandle.d.ts.map +1 -1
- package/dist/TreeNodeHandle.js +13 -23
- package/dist/TreeNodeHandle.js.map +1 -1
- package/dist/TreeView.d.ts +166 -0
- package/dist/TreeView.d.ts.map +1 -0
- package/dist/TreeView.js +218 -0
- package/dist/TreeView.js.map +1 -0
- package/dist/TreeViewUtilities.d.ts +21 -0
- package/dist/TreeViewUtilities.d.ts.map +1 -0
- package/dist/TreeViewUtilities.js +77 -0
- package/dist/TreeViewUtilities.js.map +1 -0
- package/dist/{default-edits/UndoRedoHandler.d.ts → UndoRedoHandler.d.ts} +2 -2
- package/dist/UndoRedoHandler.d.ts.map +1 -0
- package/dist/{default-edits/UndoRedoHandler.js → UndoRedoHandler.js} +5 -9
- package/dist/UndoRedoHandler.js.map +1 -0
- package/dist/id-compressor/AppendOnlySortedMap.d.ts +127 -0
- package/dist/id-compressor/AppendOnlySortedMap.d.ts.map +1 -0
- package/dist/id-compressor/AppendOnlySortedMap.js +283 -0
- package/dist/id-compressor/AppendOnlySortedMap.js.map +1 -0
- package/dist/id-compressor/IdCompressor.d.ts +389 -0
- package/dist/id-compressor/IdCompressor.d.ts.map +1 -0
- package/dist/id-compressor/IdCompressor.js +1353 -0
- package/dist/id-compressor/IdCompressor.js.map +1 -0
- package/dist/id-compressor/IdRange.d.ts +11 -0
- package/dist/id-compressor/IdRange.d.ts.map +1 -0
- package/dist/id-compressor/IdRange.js +29 -0
- package/dist/id-compressor/IdRange.js.map +1 -0
- package/dist/id-compressor/NumericUuid.d.ts +63 -0
- package/dist/id-compressor/NumericUuid.d.ts.map +1 -0
- package/dist/id-compressor/NumericUuid.js +377 -0
- package/dist/id-compressor/NumericUuid.js.map +1 -0
- package/dist/id-compressor/index.d.ts +12 -0
- package/dist/id-compressor/index.d.ts.map +1 -0
- package/dist/id-compressor/index.js +26 -0
- package/dist/id-compressor/index.js.map +1 -0
- package/dist/id-compressor/persisted-types/0.0.1.d.ts +156 -0
- package/dist/id-compressor/persisted-types/0.0.1.d.ts.map +1 -0
- package/dist/id-compressor/persisted-types/0.0.1.js +7 -0
- package/dist/id-compressor/persisted-types/0.0.1.js.map +1 -0
- package/dist/id-compressor/persisted-types/index.d.ts +6 -0
- package/dist/id-compressor/persisted-types/index.d.ts.map +1 -0
- package/dist/id-compressor/persisted-types/index.js +18 -0
- package/dist/id-compressor/persisted-types/index.js.map +1 -0
- package/dist/index.d.ts +29 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +50 -35
- package/dist/index.js.map +1 -1
- package/dist/persisted-types/0.0.2.d.ts +385 -0
- package/dist/persisted-types/0.0.2.d.ts.map +1 -0
- package/dist/persisted-types/0.0.2.js +113 -0
- package/dist/persisted-types/0.0.2.js.map +1 -0
- package/dist/persisted-types/0.1.1.d.ts +314 -0
- package/dist/persisted-types/0.1.1.d.ts.map +1 -0
- package/dist/persisted-types/0.1.1.js +153 -0
- package/dist/persisted-types/0.1.1.js.map +1 -0
- package/dist/persisted-types/index.d.ts +7 -0
- package/dist/persisted-types/index.d.ts.map +1 -0
- package/dist/persisted-types/index.js +20 -0
- package/dist/persisted-types/index.js.map +1 -0
- package/docs/0-1-1-Compression.md +228 -0
- package/docs/Breaking-Change-Migration.md +52 -0
- package/docs/Compression.md +2 -2
- package/docs/Telemetry.md +43 -0
- package/docs/Write-Format.md +19 -0
- package/lib/ChangeCompression.d.ts +39 -0
- package/lib/ChangeCompression.d.ts.map +1 -0
- package/lib/ChangeCompression.js +111 -0
- package/lib/ChangeCompression.js.map +1 -0
- package/{dist/default-edits/PersistedTypes.d.ts → lib/ChangeTypes.d.ts} +58 -105
- package/lib/ChangeTypes.d.ts.map +1 -0
- package/lib/{default-edits/PersistedTypes.js → ChangeTypes.js} +15 -68
- package/lib/ChangeTypes.js.map +1 -0
- package/lib/Checkout.d.ts +39 -27
- package/lib/Checkout.d.ts.map +1 -1
- package/lib/Checkout.js +53 -24
- package/lib/Checkout.js.map +1 -1
- package/lib/Common.d.ts +175 -38
- package/lib/Common.d.ts.map +1 -1
- package/lib/Common.js +226 -101
- package/lib/Common.js.map +1 -1
- package/lib/EagerCheckout.d.ts +24 -0
- package/lib/EagerCheckout.d.ts.map +1 -0
- package/lib/{BasicCheckout.js → EagerCheckout.js} +7 -4
- package/lib/EagerCheckout.js.map +1 -0
- package/lib/EditLog.d.ts +77 -63
- package/lib/EditLog.d.ts.map +1 -1
- package/lib/EditLog.js +83 -47
- package/lib/EditLog.js.map +1 -1
- package/lib/EditUtilities.d.ts +168 -0
- package/lib/EditUtilities.d.ts.map +1 -0
- package/lib/EditUtilities.js +353 -0
- package/lib/EditUtilities.js.map +1 -0
- package/lib/EventTypes.d.ts +73 -0
- package/lib/EventTypes.d.ts.map +1 -0
- package/lib/EventTypes.js +75 -0
- package/lib/EventTypes.js.map +1 -0
- package/lib/Forest.d.ts +29 -7
- package/lib/Forest.d.ts.map +1 -1
- package/lib/Forest.js +58 -35
- package/lib/Forest.js.map +1 -1
- package/lib/HistoryEditFactory.d.ts +20 -0
- package/lib/HistoryEditFactory.d.ts.map +1 -0
- package/lib/{default-edits/HistoryEditFactory.js → HistoryEditFactory.js} +78 -39
- package/lib/HistoryEditFactory.js.map +1 -0
- package/lib/IdConversion.d.ts +12 -0
- package/lib/IdConversion.d.ts.map +1 -0
- package/lib/IdConversion.js +91 -0
- package/lib/IdConversion.js.map +1 -0
- package/lib/Identifiers.d.ts +89 -2
- package/lib/Identifiers.d.ts.map +1 -1
- package/lib/Identifiers.js +8 -1
- package/lib/Identifiers.js.map +1 -1
- package/lib/InitialTree.d.ts +2 -2
- package/lib/InitialTree.d.ts.map +1 -1
- package/lib/InitialTree.js +2 -1
- package/lib/InitialTree.js.map +1 -1
- package/lib/LazyCheckout.d.ts +28 -0
- package/lib/LazyCheckout.d.ts.map +1 -0
- package/lib/LazyCheckout.js +40 -0
- package/lib/LazyCheckout.js.map +1 -0
- package/lib/LogViewer.d.ts +129 -85
- package/lib/LogViewer.d.ts.map +1 -1
- package/lib/LogViewer.js +103 -77
- package/lib/LogViewer.js.map +1 -1
- package/lib/MergeHealth.d.ts +221 -0
- package/lib/MergeHealth.d.ts.map +1 -0
- package/lib/MergeHealth.js +258 -0
- package/lib/MergeHealth.js.map +1 -0
- package/lib/NodeIdUtilities.d.ts +105 -0
- package/lib/NodeIdUtilities.d.ts.map +1 -0
- package/lib/NodeIdUtilities.js +53 -0
- package/lib/NodeIdUtilities.js.map +1 -0
- package/lib/PayloadUtilities.d.ts +42 -0
- package/lib/PayloadUtilities.d.ts.map +1 -0
- package/lib/PayloadUtilities.js +110 -0
- package/lib/PayloadUtilities.js.map +1 -0
- package/lib/ReconciliationPath.d.ts +18 -13
- package/lib/ReconciliationPath.d.ts.map +1 -1
- package/lib/ReconciliationPath.js.map +1 -1
- package/lib/RevisionValueCache.d.ts +11 -2
- package/lib/RevisionValueCache.d.ts.map +1 -1
- package/lib/RevisionValueCache.js +2 -3
- package/lib/RevisionValueCache.js.map +1 -1
- package/lib/RevisionView.d.ts +83 -0
- package/lib/RevisionView.d.ts.map +1 -0
- package/lib/RevisionView.js +175 -0
- package/lib/RevisionView.js.map +1 -0
- package/lib/SerializationUtilities.d.ts +36 -0
- package/lib/SerializationUtilities.d.ts.map +1 -0
- package/lib/SerializationUtilities.js +95 -0
- package/lib/SerializationUtilities.js.map +1 -0
- package/lib/SharedTree.d.ts +439 -0
- package/lib/SharedTree.d.ts.map +1 -0
- package/lib/SharedTree.js +1104 -0
- package/lib/SharedTree.js.map +1 -0
- package/lib/SharedTreeEncoder.d.ts +102 -0
- package/lib/SharedTreeEncoder.d.ts.map +1 -0
- package/lib/SharedTreeEncoder.js +308 -0
- package/lib/SharedTreeEncoder.js.map +1 -0
- package/lib/StringInterner.d.ts +46 -0
- package/lib/StringInterner.d.ts.map +1 -0
- package/lib/StringInterner.js +57 -0
- package/lib/StringInterner.js.map +1 -0
- package/lib/Summary.d.ts +40 -0
- package/lib/Summary.d.ts.map +1 -0
- package/lib/Summary.js +19 -0
- package/lib/Summary.js.map +1 -0
- package/lib/SummaryBackCompatibility.d.ts +22 -22
- package/lib/SummaryBackCompatibility.d.ts.map +1 -1
- package/lib/SummaryBackCompatibility.js +29 -32
- package/lib/SummaryBackCompatibility.js.map +1 -1
- package/lib/SummaryTestUtilities.d.ts +31 -0
- package/lib/SummaryTestUtilities.d.ts.map +1 -0
- package/lib/SummaryTestUtilities.js +32 -0
- package/lib/SummaryTestUtilities.js.map +1 -0
- package/lib/Transaction.d.ts +71 -0
- package/lib/Transaction.d.ts.map +1 -0
- package/lib/Transaction.js +88 -0
- package/lib/Transaction.js.map +1 -0
- package/lib/TransactionInternal.d.ts +540 -0
- package/lib/TransactionInternal.d.ts.map +1 -0
- package/lib/TransactionInternal.js +622 -0
- package/lib/TransactionInternal.js.map +1 -0
- package/lib/TreeCompressor.d.ts +36 -0
- package/lib/TreeCompressor.d.ts.map +1 -0
- package/lib/TreeCompressor.js +133 -0
- package/lib/TreeCompressor.js.map +1 -0
- package/lib/TreeNodeHandle.d.ts +12 -18
- package/lib/TreeNodeHandle.d.ts.map +1 -1
- package/lib/TreeNodeHandle.js +14 -24
- package/lib/TreeNodeHandle.js.map +1 -1
- package/lib/TreeView.d.ts +166 -0
- package/lib/TreeView.d.ts.map +1 -0
- package/lib/TreeView.js +214 -0
- package/lib/TreeView.js.map +1 -0
- package/lib/TreeViewUtilities.d.ts +21 -0
- package/lib/TreeViewUtilities.d.ts.map +1 -0
- package/lib/TreeViewUtilities.js +71 -0
- package/lib/TreeViewUtilities.js.map +1 -0
- package/lib/{default-edits/UndoRedoHandler.d.ts → UndoRedoHandler.d.ts} +2 -2
- package/lib/UndoRedoHandler.d.ts.map +1 -0
- package/lib/{default-edits/UndoRedoHandler.js → UndoRedoHandler.js} +3 -7
- package/lib/UndoRedoHandler.js.map +1 -0
- package/lib/id-compressor/AppendOnlySortedMap.d.ts +127 -0
- package/lib/id-compressor/AppendOnlySortedMap.d.ts.map +1 -0
- package/lib/id-compressor/AppendOnlySortedMap.js +278 -0
- package/lib/id-compressor/AppendOnlySortedMap.js.map +1 -0
- package/lib/id-compressor/IdCompressor.d.ts +389 -0
- package/lib/id-compressor/IdCompressor.d.ts.map +1 -0
- package/lib/id-compressor/IdCompressor.js +1343 -0
- package/lib/id-compressor/IdCompressor.js.map +1 -0
- package/lib/id-compressor/IdRange.d.ts +11 -0
- package/lib/id-compressor/IdRange.d.ts.map +1 -0
- package/lib/id-compressor/IdRange.js +25 -0
- package/lib/id-compressor/IdRange.js.map +1 -0
- package/lib/id-compressor/NumericUuid.d.ts +63 -0
- package/lib/id-compressor/NumericUuid.d.ts.map +1 -0
- package/lib/id-compressor/NumericUuid.js +365 -0
- package/lib/id-compressor/NumericUuid.js.map +1 -0
- package/lib/id-compressor/index.d.ts +12 -0
- package/lib/id-compressor/index.d.ts.map +1 -0
- package/lib/id-compressor/index.js +12 -0
- package/lib/id-compressor/index.js.map +1 -0
- package/lib/id-compressor/persisted-types/0.0.1.d.ts +156 -0
- package/lib/id-compressor/persisted-types/0.0.1.d.ts.map +1 -0
- package/lib/{test/Snapshot.tests.d.ts → id-compressor/persisted-types/0.0.1.js} +1 -1
- package/lib/id-compressor/persisted-types/0.0.1.js.map +1 -0
- package/lib/id-compressor/persisted-types/index.d.ts +6 -0
- package/lib/id-compressor/persisted-types/index.d.ts.map +1 -0
- package/lib/id-compressor/persisted-types/index.js +6 -0
- package/lib/id-compressor/persisted-types/index.js.map +1 -0
- package/lib/index.d.ts +29 -9
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +23 -6
- package/lib/index.js.map +1 -1
- package/lib/persisted-types/0.0.2.d.ts +385 -0
- package/lib/persisted-types/0.0.2.d.ts.map +1 -0
- package/lib/persisted-types/0.0.2.js +110 -0
- package/lib/persisted-types/0.0.2.js.map +1 -0
- package/lib/persisted-types/0.1.1.d.ts +314 -0
- package/lib/persisted-types/0.1.1.d.ts.map +1 -0
- package/lib/persisted-types/0.1.1.js +150 -0
- package/lib/persisted-types/0.1.1.js.map +1 -0
- package/lib/persisted-types/index.d.ts +7 -0
- package/lib/persisted-types/index.d.ts.map +1 -0
- package/lib/persisted-types/index.js +8 -0
- package/lib/persisted-types/index.js.map +1 -0
- package/lib/test/AppendOnlySortedMap.tests.d.ts +6 -0
- package/lib/test/AppendOnlySortedMap.tests.d.ts.map +1 -0
- package/lib/test/AppendOnlySortedMap.tests.js +169 -0
- package/lib/test/AppendOnlySortedMap.tests.js.map +1 -0
- package/lib/test/{SnapshotUtilities.tests.d.ts → ChangeCompression.tests.d.ts} +1 -1
- package/lib/test/ChangeCompression.tests.d.ts.map +1 -0
- package/lib/test/ChangeCompression.tests.js +145 -0
- package/lib/test/ChangeCompression.tests.js.map +1 -0
- package/lib/test/Checkout.tests.d.ts +2 -3
- package/lib/test/Checkout.tests.d.ts.map +1 -1
- package/lib/test/Checkout.tests.js +126 -69
- package/lib/test/Checkout.tests.js.map +1 -1
- package/lib/test/Common.tests.js +60 -2
- package/lib/test/Common.tests.js.map +1 -1
- package/lib/test/{BasicCheckout.tests.d.ts → EagerCheckout.tests.d.ts} +1 -1
- package/lib/test/EagerCheckout.tests.d.ts.map +1 -0
- package/lib/test/EagerCheckout.tests.js +20 -0
- package/lib/test/EagerCheckout.tests.js.map +1 -0
- package/lib/test/Edit.tests.js +22 -14
- package/lib/test/Edit.tests.js.map +1 -1
- package/lib/test/{Anchors.glassBox.tests.d.ts → EditLog.perf.tests.d.ts} +1 -1
- package/lib/test/EditLog.perf.tests.d.ts.map +1 -0
- package/lib/test/EditLog.perf.tests.js +30 -0
- package/lib/test/EditLog.perf.tests.js.map +1 -0
- package/lib/test/EditLog.tests.js +10 -6
- package/lib/test/EditLog.tests.js.map +1 -1
- package/lib/test/EditUtilities.tests.d.ts +6 -0
- package/lib/test/EditUtilities.tests.d.ts.map +1 -0
- package/lib/test/EditUtilities.tests.js +503 -0
- package/lib/test/EditUtilities.tests.js.map +1 -0
- package/lib/test/Forest.perf.tests.d.ts +6 -0
- package/lib/test/Forest.perf.tests.d.ts.map +1 -0
- package/lib/test/Forest.perf.tests.js +133 -0
- package/lib/test/Forest.perf.tests.js.map +1 -0
- package/lib/test/Forest.tests.js +54 -27
- package/lib/test/Forest.tests.js.map +1 -1
- package/lib/test/GenericTransaction.tests.js +12 -3
- package/lib/test/GenericTransaction.tests.js.map +1 -1
- package/lib/test/HistoryEditFactory.tests.d.ts +6 -0
- package/lib/test/HistoryEditFactory.tests.d.ts.map +1 -0
- package/lib/test/HistoryEditFactory.tests.js +90 -0
- package/lib/test/HistoryEditFactory.tests.js.map +1 -0
- package/lib/test/IdCompressor.perf.tests.d.ts +6 -0
- package/lib/test/IdCompressor.perf.tests.d.ts.map +1 -0
- package/lib/test/IdCompressor.perf.tests.js +304 -0
- package/lib/test/IdCompressor.perf.tests.js.map +1 -0
- package/lib/test/IdCompressor.tests.d.ts +6 -0
- package/lib/test/IdCompressor.tests.d.ts.map +1 -0
- package/lib/test/IdCompressor.tests.js +1075 -0
- package/lib/test/IdCompressor.tests.js.map +1 -0
- package/lib/test/IdConversion.tests.d.ts +6 -0
- package/lib/test/IdConversion.tests.d.ts.map +1 -0
- package/lib/test/IdConversion.tests.js +36 -0
- package/lib/test/IdConversion.tests.js.map +1 -0
- package/lib/test/LazyCheckout.tests.d.ts +6 -0
- package/lib/test/LazyCheckout.tests.d.ts.map +1 -0
- package/lib/test/LazyCheckout.tests.js +22 -0
- package/lib/test/LazyCheckout.tests.js.map +1 -0
- package/lib/test/LogViewer.tests.js +276 -191
- package/lib/test/LogViewer.tests.js.map +1 -1
- package/lib/test/{SharedTreeWithAnchors.tests.d.ts → MergeHealthTelemetryHeartbeat.tests.d.ts} +1 -1
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.d.ts.map +1 -0
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.js +342 -0
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.js.map +1 -0
- package/lib/test/NumericUuid.perf.tests.d.ts +6 -0
- package/lib/test/NumericUuid.perf.tests.d.ts.map +1 -0
- package/lib/test/NumericUuid.perf.tests.js +68 -0
- package/lib/test/NumericUuid.perf.tests.js.map +1 -0
- package/lib/test/NumericUuid.tests.d.ts +6 -0
- package/lib/test/NumericUuid.tests.d.ts.map +1 -0
- package/lib/test/NumericUuid.tests.js +191 -0
- package/lib/test/NumericUuid.tests.js.map +1 -0
- package/lib/test/RevisionView.tests.d.ts +6 -0
- package/lib/test/RevisionView.tests.d.ts.map +1 -0
- package/lib/test/RevisionView.tests.js +133 -0
- package/lib/test/RevisionView.tests.js.map +1 -0
- package/lib/test/SharedTree.perf.tests.d.ts +6 -0
- package/lib/test/SharedTree.perf.tests.d.ts.map +1 -0
- package/lib/test/SharedTree.perf.tests.js +39 -0
- package/lib/test/SharedTree.perf.tests.js.map +1 -0
- package/lib/test/SharedTree.tests.js +15 -3
- package/lib/test/SharedTree.tests.js.map +1 -1
- package/lib/test/StringInterner.tests.d.ts +6 -0
- package/lib/test/StringInterner.tests.d.ts.map +1 -0
- package/lib/test/StringInterner.tests.js +71 -0
- package/lib/test/StringInterner.tests.js.map +1 -0
- package/lib/test/Summary.tests.d.ts +8 -0
- package/lib/test/Summary.tests.d.ts.map +1 -0
- package/lib/test/Summary.tests.js +407 -0
- package/lib/test/Summary.tests.js.map +1 -0
- package/lib/test/Transaction.tests.js +109 -329
- package/lib/test/Transaction.tests.js.map +1 -1
- package/lib/test/TransactionInternal.tests.d.ts +6 -0
- package/lib/test/TransactionInternal.tests.d.ts.map +1 -0
- package/lib/test/TransactionInternal.tests.js +568 -0
- package/lib/test/TransactionInternal.tests.js.map +1 -0
- package/lib/test/TreeCompression.tests.d.ts +6 -0
- package/lib/test/TreeCompression.tests.d.ts.map +1 -0
- package/lib/test/TreeCompression.tests.js +292 -0
- package/lib/test/TreeCompression.tests.js.map +1 -0
- package/lib/test/TreeView.tests.d.ts +6 -0
- package/lib/test/TreeView.tests.d.ts.map +1 -0
- package/lib/test/TreeView.tests.js +176 -0
- package/lib/test/TreeView.tests.js.map +1 -0
- package/lib/test/UndoRedoHandler.tests.js +2 -2
- package/lib/test/UndoRedoHandler.tests.js.map +1 -1
- package/lib/test/Virtualization.tests.js +146 -62
- package/lib/test/Virtualization.tests.js.map +1 -1
- package/lib/test/fuzz/Generators.d.ts +19 -0
- package/lib/test/fuzz/Generators.d.ts.map +1 -0
- package/lib/test/fuzz/Generators.js +420 -0
- package/lib/test/fuzz/Generators.js.map +1 -0
- package/lib/test/fuzz/SharedTreeFuzzTests.d.ts +20 -0
- package/lib/test/fuzz/SharedTreeFuzzTests.d.ts.map +1 -0
- package/lib/test/fuzz/SharedTreeFuzzTests.js +217 -0
- package/lib/test/fuzz/SharedTreeFuzzTests.js.map +1 -0
- package/lib/test/fuzz/Types.d.ts +133 -0
- package/lib/test/fuzz/Types.d.ts.map +1 -0
- package/lib/test/{GenericTransactionWithAnchors.tests.d.ts → fuzz/Types.js} +2 -2
- package/lib/test/fuzz/Types.js.map +1 -0
- package/lib/test/utilities/IdCompressorTestUtilities.d.ts +180 -0
- package/lib/test/utilities/IdCompressorTestUtilities.d.ts.map +1 -0
- package/lib/test/utilities/IdCompressorTestUtilities.js +528 -0
- package/lib/test/utilities/IdCompressorTestUtilities.js.map +1 -0
- package/lib/test/utilities/MockTransaction.d.ts +26 -7
- package/lib/test/utilities/MockTransaction.d.ts.map +1 -1
- package/lib/test/utilities/MockTransaction.js +40 -11
- package/lib/test/utilities/MockTransaction.js.map +1 -1
- package/lib/test/utilities/PendingLocalStateTests.d.ts +12 -0
- package/lib/test/utilities/PendingLocalStateTests.d.ts.map +1 -0
- package/lib/test/utilities/PendingLocalStateTests.js +105 -0
- package/lib/test/utilities/PendingLocalStateTests.js.map +1 -0
- package/lib/test/utilities/SharedTreeTests.d.ts +3 -4
- package/lib/test/utilities/SharedTreeTests.d.ts.map +1 -1
- package/lib/test/utilities/SharedTreeTests.js +696 -439
- package/lib/test/utilities/SharedTreeTests.js.map +1 -1
- package/lib/test/utilities/SharedTreeVersioningTests.d.ts +11 -0
- package/lib/test/utilities/SharedTreeVersioningTests.d.ts.map +1 -0
- package/lib/test/utilities/SharedTreeVersioningTests.js +370 -0
- package/lib/test/utilities/SharedTreeVersioningTests.js.map +1 -0
- package/lib/test/utilities/SummaryLoadPerfTests.d.ts +10 -0
- package/lib/test/utilities/SummaryLoadPerfTests.d.ts.map +1 -0
- package/lib/test/utilities/SummaryLoadPerfTests.js +102 -0
- package/lib/test/utilities/SummaryLoadPerfTests.js.map +1 -0
- package/lib/test/utilities/SummarySizeTests.d.ts +11 -0
- package/lib/test/utilities/SummarySizeTests.d.ts.map +1 -0
- package/lib/test/utilities/SummarySizeTests.js +158 -0
- package/lib/test/utilities/SummarySizeTests.js.map +1 -0
- package/lib/test/utilities/TestCommon.d.ts +9 -0
- package/lib/test/utilities/TestCommon.d.ts.map +1 -0
- package/lib/test/utilities/TestCommon.js +13 -0
- package/lib/test/utilities/TestCommon.js.map +1 -0
- package/lib/test/utilities/TestNode.d.ts +140 -0
- package/lib/test/utilities/TestNode.d.ts.map +1 -0
- package/lib/test/utilities/TestNode.js +292 -0
- package/lib/test/utilities/TestNode.js.map +1 -0
- package/lib/test/utilities/TestUtilities.d.ts +84 -70
- package/lib/test/utilities/TestUtilities.d.ts.map +1 -1
- package/lib/test/utilities/TestUtilities.js +218 -143
- package/lib/test/utilities/TestUtilities.js.map +1 -1
- package/lib/test/utilities/UndoRedoTests.d.ts +4 -5
- package/lib/test/utilities/UndoRedoTests.d.ts.map +1 -1
- package/lib/test/utilities/UndoRedoTests.js +138 -149
- package/lib/test/utilities/UndoRedoTests.js.map +1 -1
- package/package.json +22 -17
- package/src/ChangeCompression.ts +159 -0
- package/src/{default-edits/PersistedTypes.ts → ChangeTypes.ts} +62 -125
- package/src/Checkout.ts +82 -53
- package/src/Common.ts +317 -117
- package/src/EagerCheckout.ts +38 -0
- package/src/EditLog.ts +153 -100
- package/src/EditUtilities.ts +559 -0
- package/src/EventTypes.ts +74 -0
- package/src/Forest.ts +81 -73
- package/src/{default-edits/HistoryEditFactory.ts → HistoryEditFactory.ts} +103 -53
- package/src/IdConversion.ts +125 -0
- package/src/Identifiers.ts +101 -1
- package/src/InitialTree.ts +5 -4
- package/src/LazyCheckout.ts +51 -0
- package/src/LogViewer.ts +242 -166
- package/src/MergeHealth.ts +447 -0
- package/src/NodeIdUtilities.ts +156 -0
- package/src/PayloadUtilities.ts +124 -0
- package/src/ReconciliationPath.ts +18 -13
- package/src/RevisionValueCache.ts +14 -5
- package/src/RevisionView.ts +252 -0
- package/src/SerializationUtilities.ts +130 -0
- package/src/SharedTree.ts +1501 -0
- package/src/SharedTreeEncoder.ts +493 -0
- package/src/StringInterner.ts +72 -0
- package/src/Summary.ts +48 -0
- package/src/SummaryBackCompatibility.ts +47 -57
- package/src/SummaryTestUtilities.ts +54 -0
- package/src/Transaction.ts +120 -0
- package/src/TransactionInternal.ts +1087 -0
- package/src/TreeCompressor.ts +213 -0
- package/src/TreeNodeHandle.ts +19 -32
- package/src/TreeView.ts +322 -0
- package/src/TreeViewUtilities.ts +77 -0
- package/src/{default-edits/UndoRedoHandler.ts → UndoRedoHandler.ts} +8 -13
- package/src/id-compressor/AppendOnlySortedMap.ts +325 -0
- package/src/id-compressor/IdCompressor.md +3 -0
- package/src/id-compressor/IdCompressor.ts +1848 -0
- package/src/id-compressor/IdRange.ts +33 -0
- package/src/id-compressor/NumericUuid.ts +414 -0
- package/src/id-compressor/index.ts +13 -0
- package/src/id-compressor/persisted-types/0.0.1.ts +179 -0
- package/src/id-compressor/persisted-types/README.md +3 -0
- package/src/id-compressor/persisted-types/index.ts +6 -0
- package/src/index.ts +118 -59
- package/src/persisted-types/0.0.2.ts +442 -0
- package/src/persisted-types/0.1.1.ts +476 -0
- package/src/persisted-types/README.md +22 -0
- package/src/persisted-types/index.ts +9 -0
- package/.mocharc.js +0 -41
- package/api/tree.api.md +0 -729
- package/dist/BasicCheckout.d.ts +0 -23
- package/dist/BasicCheckout.d.ts.map +0 -1
- package/dist/BasicCheckout.js.map +0 -1
- package/dist/Snapshot.d.ts +0 -198
- package/dist/Snapshot.d.ts.map +0 -1
- package/dist/Snapshot.js +0 -267
- package/dist/Snapshot.js.map +0 -1
- package/dist/SnapshotUtilities.d.ts +0 -29
- package/dist/SnapshotUtilities.d.ts.map +0 -1
- package/dist/SnapshotUtilities.js +0 -73
- package/dist/SnapshotUtilities.js.map +0 -1
- package/dist/anchored-edits/AnchorResolution.d.ts +0 -144
- package/dist/anchored-edits/AnchorResolution.d.ts.map +0 -1
- package/dist/anchored-edits/AnchorResolution.js +0 -162
- package/dist/anchored-edits/AnchorResolution.js.map +0 -1
- package/dist/anchored-edits/Factory.d.ts +0 -56
- package/dist/anchored-edits/Factory.d.ts.map +0 -1
- package/dist/anchored-edits/Factory.js +0 -79
- package/dist/anchored-edits/Factory.js.map +0 -1
- package/dist/anchored-edits/PersistedTypes.d.ts +0 -245
- package/dist/anchored-edits/PersistedTypes.d.ts.map +0 -1
- package/dist/anchored-edits/PersistedTypes.js +0 -131
- package/dist/anchored-edits/PersistedTypes.js.map +0 -1
- package/dist/anchored-edits/SharedTreeWithAnchors.d.ts +0 -120
- package/dist/anchored-edits/SharedTreeWithAnchors.d.ts.map +0 -1
- package/dist/anchored-edits/SharedTreeWithAnchors.js +0 -115
- package/dist/anchored-edits/SharedTreeWithAnchors.js.map +0 -1
- package/dist/anchored-edits/TransactionWithAnchors.d.ts +0 -28
- package/dist/anchored-edits/TransactionWithAnchors.d.ts.map +0 -1
- package/dist/anchored-edits/TransactionWithAnchors.js +0 -36
- package/dist/anchored-edits/TransactionWithAnchors.js.map +0 -1
- package/dist/anchored-edits/index.d.ts +0 -10
- package/dist/anchored-edits/index.d.ts.map +0 -1
- package/dist/anchored-edits/index.js +0 -34
- package/dist/anchored-edits/index.js.map +0 -1
- package/dist/default-edits/EditUtilities.d.ts +0 -57
- package/dist/default-edits/EditUtilities.d.ts.map +0 -1
- package/dist/default-edits/EditUtilities.js +0 -192
- package/dist/default-edits/EditUtilities.js.map +0 -1
- package/dist/default-edits/Factory.d.ts +0 -56
- package/dist/default-edits/Factory.d.ts.map +0 -1
- package/dist/default-edits/Factory.js +0 -79
- package/dist/default-edits/Factory.js.map +0 -1
- package/dist/default-edits/HistoryEditFactory.d.ts +0 -19
- package/dist/default-edits/HistoryEditFactory.d.ts.map +0 -1
- package/dist/default-edits/HistoryEditFactory.js +0 -187
- package/dist/default-edits/HistoryEditFactory.js.map +0 -1
- package/dist/default-edits/PersistedTypes.d.ts.map +0 -1
- package/dist/default-edits/PersistedTypes.js.map +0 -1
- package/dist/default-edits/SharedTree.d.ts +0 -111
- package/dist/default-edits/SharedTree.d.ts.map +0 -1
- package/dist/default-edits/SharedTree.js +0 -124
- package/dist/default-edits/SharedTree.js.map +0 -1
- package/dist/default-edits/Summary.d.ts +0 -15
- package/dist/default-edits/Summary.d.ts.map +0 -1
- package/dist/default-edits/Summary.js +0 -35
- package/dist/default-edits/Summary.js.map +0 -1
- package/dist/default-edits/Transaction.d.ts +0 -41
- package/dist/default-edits/Transaction.d.ts.map +0 -1
- package/dist/default-edits/Transaction.js +0 -225
- package/dist/default-edits/Transaction.js.map +0 -1
- package/dist/default-edits/UndoRedoHandler.d.ts.map +0 -1
- package/dist/default-edits/UndoRedoHandler.js.map +0 -1
- package/dist/default-edits/index.d.ts +0 -13
- package/dist/default-edits/index.d.ts.map +0 -1
- package/dist/default-edits/index.js +0 -41
- package/dist/default-edits/index.js.map +0 -1
- package/dist/generic/GenericEditUtilities.d.ts +0 -26
- package/dist/generic/GenericEditUtilities.d.ts.map +0 -1
- package/dist/generic/GenericEditUtilities.js +0 -45
- package/dist/generic/GenericEditUtilities.js.map +0 -1
- package/dist/generic/GenericSharedTree.d.ts +0 -221
- package/dist/generic/GenericSharedTree.d.ts.map +0 -1
- package/dist/generic/GenericSharedTree.js +0 -447
- package/dist/generic/GenericSharedTree.js.map +0 -1
- package/dist/generic/GenericTransaction.d.ts +0 -87
- package/dist/generic/GenericTransaction.d.ts.map +0 -1
- package/dist/generic/GenericTransaction.js +0 -144
- package/dist/generic/GenericTransaction.js.map +0 -1
- package/dist/generic/PersistedTypes.d.ts +0 -194
- package/dist/generic/PersistedTypes.d.ts.map +0 -1
- package/dist/generic/PersistedTypes.js +0 -42
- package/dist/generic/PersistedTypes.js.map +0 -1
- package/dist/generic/Summary.d.ts +0 -63
- package/dist/generic/Summary.d.ts.map +0 -1
- package/dist/generic/Summary.js +0 -64
- package/dist/generic/Summary.js.map +0 -1
- package/dist/generic/index.d.ts +0 -10
- package/dist/generic/index.d.ts.map +0 -1
- package/dist/generic/index.js +0 -26
- package/dist/generic/index.js.map +0 -1
- package/docs/Future.md +0 -155
- package/lib/BasicCheckout.d.ts +0 -23
- package/lib/BasicCheckout.d.ts.map +0 -1
- package/lib/BasicCheckout.js.map +0 -1
- package/lib/Snapshot.d.ts +0 -198
- package/lib/Snapshot.d.ts.map +0 -1
- package/lib/Snapshot.js +0 -263
- package/lib/Snapshot.js.map +0 -1
- package/lib/SnapshotUtilities.d.ts +0 -29
- package/lib/SnapshotUtilities.d.ts.map +0 -1
- package/lib/SnapshotUtilities.js +0 -67
- package/lib/SnapshotUtilities.js.map +0 -1
- package/lib/anchored-edits/AnchorResolution.d.ts +0 -144
- package/lib/anchored-edits/AnchorResolution.d.ts.map +0 -1
- package/lib/anchored-edits/AnchorResolution.js +0 -152
- package/lib/anchored-edits/AnchorResolution.js.map +0 -1
- package/lib/anchored-edits/Factory.d.ts +0 -56
- package/lib/anchored-edits/Factory.d.ts.map +0 -1
- package/lib/anchored-edits/Factory.js +0 -74
- package/lib/anchored-edits/Factory.js.map +0 -1
- package/lib/anchored-edits/PersistedTypes.d.ts +0 -245
- package/lib/anchored-edits/PersistedTypes.d.ts.map +0 -1
- package/lib/anchored-edits/PersistedTypes.js +0 -128
- package/lib/anchored-edits/PersistedTypes.js.map +0 -1
- package/lib/anchored-edits/SharedTreeWithAnchors.d.ts +0 -120
- package/lib/anchored-edits/SharedTreeWithAnchors.d.ts.map +0 -1
- package/lib/anchored-edits/SharedTreeWithAnchors.js +0 -110
- package/lib/anchored-edits/SharedTreeWithAnchors.js.map +0 -1
- package/lib/anchored-edits/TransactionWithAnchors.d.ts +0 -28
- package/lib/anchored-edits/TransactionWithAnchors.d.ts.map +0 -1
- package/lib/anchored-edits/TransactionWithAnchors.js +0 -32
- package/lib/anchored-edits/TransactionWithAnchors.js.map +0 -1
- package/lib/anchored-edits/index.d.ts +0 -10
- package/lib/anchored-edits/index.d.ts.map +0 -1
- package/lib/anchored-edits/index.js +0 -11
- package/lib/anchored-edits/index.js.map +0 -1
- package/lib/default-edits/EditUtilities.d.ts +0 -57
- package/lib/default-edits/EditUtilities.d.ts.map +0 -1
- package/lib/default-edits/EditUtilities.js +0 -181
- package/lib/default-edits/EditUtilities.js.map +0 -1
- package/lib/default-edits/Factory.d.ts +0 -56
- package/lib/default-edits/Factory.d.ts.map +0 -1
- package/lib/default-edits/Factory.js +0 -74
- package/lib/default-edits/Factory.js.map +0 -1
- package/lib/default-edits/HistoryEditFactory.d.ts +0 -19
- package/lib/default-edits/HistoryEditFactory.d.ts.map +0 -1
- package/lib/default-edits/HistoryEditFactory.js.map +0 -1
- package/lib/default-edits/PersistedTypes.d.ts.map +0 -1
- package/lib/default-edits/PersistedTypes.js.map +0 -1
- package/lib/default-edits/SharedTree.d.ts +0 -111
- package/lib/default-edits/SharedTree.d.ts.map +0 -1
- package/lib/default-edits/SharedTree.js +0 -100
- package/lib/default-edits/SharedTree.js.map +0 -1
- package/lib/default-edits/Summary.d.ts +0 -15
- package/lib/default-edits/Summary.d.ts.map +0 -1
- package/lib/default-edits/Summary.js +0 -31
- package/lib/default-edits/Summary.js.map +0 -1
- package/lib/default-edits/Transaction.d.ts +0 -41
- package/lib/default-edits/Transaction.d.ts.map +0 -1
- package/lib/default-edits/Transaction.js +0 -221
- package/lib/default-edits/Transaction.js.map +0 -1
- package/lib/default-edits/UndoRedoHandler.d.ts.map +0 -1
- package/lib/default-edits/UndoRedoHandler.js.map +0 -1
- package/lib/default-edits/index.d.ts +0 -13
- package/lib/default-edits/index.d.ts.map +0 -1
- package/lib/default-edits/index.js +0 -14
- package/lib/default-edits/index.js.map +0 -1
- package/lib/generic/GenericEditUtilities.d.ts +0 -26
- package/lib/generic/GenericEditUtilities.d.ts.map +0 -1
- package/lib/generic/GenericEditUtilities.js +0 -38
- package/lib/generic/GenericEditUtilities.js.map +0 -1
- package/lib/generic/GenericSharedTree.d.ts +0 -221
- package/lib/generic/GenericSharedTree.d.ts.map +0 -1
- package/lib/generic/GenericSharedTree.js +0 -443
- package/lib/generic/GenericSharedTree.js.map +0 -1
- package/lib/generic/GenericTransaction.d.ts +0 -87
- package/lib/generic/GenericTransaction.d.ts.map +0 -1
- package/lib/generic/GenericTransaction.js +0 -140
- package/lib/generic/GenericTransaction.js.map +0 -1
- package/lib/generic/PersistedTypes.d.ts +0 -194
- package/lib/generic/PersistedTypes.d.ts.map +0 -1
- package/lib/generic/PersistedTypes.js +0 -39
- package/lib/generic/PersistedTypes.js.map +0 -1
- package/lib/generic/Summary.d.ts +0 -63
- package/lib/generic/Summary.d.ts.map +0 -1
- package/lib/generic/Summary.js +0 -58
- package/lib/generic/Summary.js.map +0 -1
- package/lib/generic/index.d.ts +0 -10
- package/lib/generic/index.d.ts.map +0 -1
- package/lib/generic/index.js +0 -11
- package/lib/generic/index.js.map +0 -1
- package/lib/test/Anchors.glassBox.tests.d.ts.map +0 -1
- package/lib/test/Anchors.glassBox.tests.js +0 -410
- package/lib/test/Anchors.glassBox.tests.js.map +0 -1
- package/lib/test/BasicCheckout.tests.d.ts.map +0 -1
- package/lib/test/BasicCheckout.tests.js +0 -8
- package/lib/test/BasicCheckout.tests.js.map +0 -1
- package/lib/test/GenericTransactionWithAnchors.tests.d.ts.map +0 -1
- package/lib/test/GenericTransactionWithAnchors.tests.js +0 -25
- package/lib/test/GenericTransactionWithAnchors.tests.js.map +0 -1
- package/lib/test/SharedTreeWithAnchors.tests.d.ts.map +0 -1
- package/lib/test/SharedTreeWithAnchors.tests.js +0 -420
- package/lib/test/SharedTreeWithAnchors.tests.js.map +0 -1
- package/lib/test/Snapshot.tests.d.ts.map +0 -1
- package/lib/test/Snapshot.tests.js +0 -96
- package/lib/test/Snapshot.tests.js.map +0 -1
- package/lib/test/SnapshotUtilities.tests.d.ts.map +0 -1
- package/lib/test/SnapshotUtilities.tests.js +0 -168
- package/lib/test/SnapshotUtilities.tests.js.map +0 -1
- package/lib/test/undoRedoStackManager.d.ts +0 -26
- package/lib/test/undoRedoStackManager.d.ts.map +0 -1
- package/lib/test/undoRedoStackManager.js +0 -176
- package/lib/test/undoRedoStackManager.js.map +0 -1
- package/lib/test/utilities/SummaryFormatCompatibilityTests.d.ts +0 -13
- package/lib/test/utilities/SummaryFormatCompatibilityTests.d.ts.map +0 -1
- package/lib/test/utilities/SummaryFormatCompatibilityTests.js +0 -154
- package/lib/test/utilities/SummaryFormatCompatibilityTests.js.map +0 -1
- package/src/BasicCheckout.ts +0 -34
- package/src/Snapshot.ts +0 -363
- package/src/SnapshotUtilities.ts +0 -88
- package/src/anchored-edits/AnchorResolution.ts +0 -442
- package/src/anchored-edits/Factory.ts +0 -94
- package/src/anchored-edits/PersistedTypes.ts +0 -310
- package/src/anchored-edits/SharedTreeWithAnchors.ts +0 -200
- package/src/anchored-edits/TransactionWithAnchors.ts +0 -39
- package/src/anchored-edits/index.ts +0 -21
- package/src/default-edits/EditUtilities.ts +0 -220
- package/src/default-edits/Factory.ts +0 -94
- package/src/default-edits/SharedTree.ts +0 -174
- package/src/default-edits/Summary.ts +0 -44
- package/src/default-edits/Transaction.ts +0 -262
- package/src/default-edits/index.ts +0 -29
- package/src/generic/GenericEditUtilities.ts +0 -46
- package/src/generic/GenericSharedTree.ts +0 -593
- package/src/generic/GenericTransaction.ts +0 -194
- package/src/generic/PersistedTypes.ts +0 -221
- package/src/generic/Summary.ts +0 -113
- package/src/generic/index.ts +0 -41
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Anchors.glassBox.tests.js","sourceRoot":"","sources":["../../src/test/Anchors.glassBox.tests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EA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and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { expect } from 'chai';\nimport { DetachedSequenceId, NodeId } from '../Identifiers';\nimport { ChangeNode } from '../generic';\nimport { StablePlace, StableRange, ConstraintEffect } from '../default-edits';\nimport {\n\tAnchoredChange,\n\tPlaceAnchor,\n\tPlaceAnchorSemanticsChoice,\n\tRangeAnchor,\n\tRelativePlaceAnchor,\n\tresolveChangeAnchors,\n\tfindLastOffendingChange,\n\tresolveNodeAnchor,\n\tresolvePlaceAnchor,\n\tresolveRangeAnchor,\n\tupdateRelativePlaceAnchorForChange,\n\tupdateRelativePlaceAnchorForPath,\n\tEvaluatedChange,\n} from '../anchored-edits';\nimport { assert, fail } from '../Common';\nimport { Side, Snapshot } from '../Snapshot';\nimport { EditValidationResult } from '../Checkout';\nimport { ReconciliationChange, ReconciliationEdit, ReconciliationPath } from '../ReconciliationPath';\nimport { makeEmptyNode, leftTraitLabel, rightTraitLabel } from './utilities/TestUtilities';\n\nconst left: ChangeNode = makeEmptyNode('left' as NodeId);\nconst priorSibling: ChangeNode = makeEmptyNode('prior' as NodeId);\nconst nextSibling: ChangeNode = makeEmptyNode('next' as NodeId);\nconst right: ChangeNode = makeEmptyNode('right' as NodeId);\nconst parent: ChangeNode = {\n\t...makeEmptyNode('parent' as NodeId),\n\ttraits: { [leftTraitLabel]: [left], [rightTraitLabel]: [right] },\n};\nconst initialTree: ChangeNode = {\n\t...makeEmptyNode('root' as NodeId),\n\ttraits: {\n\t\tparentTraitLabel: [parent],\n\t},\n};\nconst leftTraitLocation = {\n\tparent: parent.identifier,\n\tlabel: leftTraitLabel,\n};\n\nconst startPlace = StablePlace.atStartOf(leftTraitLocation);\nconst endPlace = StablePlace.atEndOf(leftTraitLocation);\nconst beforePlace = StablePlace.before(left);\nconst afterPlace = StablePlace.after(left);\n\nconst startAnchor = PlaceAnchor.atStartOf(\n\tleftTraitLocation,\n\tPlaceAnchorSemanticsChoice.RelativeToNode\n) as RelativePlaceAnchor;\nconst endAnchor = PlaceAnchor.atEndOf(\n\tleftTraitLocation,\n\tPlaceAnchorSemanticsChoice.RelativeToNode\n) as RelativePlaceAnchor;\nconst beforeAnchor = PlaceAnchor.before(left, PlaceAnchorSemanticsChoice.RelativeToNode) as RelativePlaceAnchor;\nconst afterAnchor = PlaceAnchor.after(left, PlaceAnchorSemanticsChoice.RelativeToNode) as RelativePlaceAnchor;\n\nconst mockDetachedSequenceId = 42 as DetachedSequenceId;\nconst mockNodeId = 'mock-node-id' as NodeId;\nconst mockPlace = 'mock-place' as unknown as StablePlace;\nconst mockRange = 'mock-range' as unknown as StableRange;\nconst mockPlaceAnchor = 'mock-place-anchor' as unknown as RelativePlaceAnchor;\nconst mockSnapshot = 'mock-snapshot' as unknown as Snapshot;\nconst mockPath = 'mock-path' as unknown as ReconciliationPath<AnchoredChange>;\nconst mockEvaluatedChange = 'mock-evaluated-change' as unknown as EvaluatedChange<AnchoredChange>;\n\ndescribe('Anchor Glass Box Tests', () => {\n\tdescribe(resolveChangeAnchors.name, () => {\n\t\tconst testCases = [\n\t\t\t{\n\t\t\t\tname: 'Insert',\n\t\t\t\tinput: AnchoredChange.insert(mockDetachedSequenceId, beforeAnchor),\n\t\t\t\texpected: AnchoredChange.insert(mockDetachedSequenceId, mockPlace),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Detach',\n\t\t\t\tinput: AnchoredChange.detach(RangeAnchor.only(right), mockDetachedSequenceId),\n\t\t\t\texpected: AnchoredChange.detach(mockRange, mockDetachedSequenceId),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'SetValue (set payload)',\n\t\t\t\tinput: AnchoredChange.setPayload(left.identifier, 42),\n\t\t\t\texpected: AnchoredChange.setPayload(mockNodeId, 42),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'SetValue (clear payload)',\n\t\t\t\tinput: AnchoredChange.clearPayload(left.identifier),\n\t\t\t\texpected: AnchoredChange.clearPayload(mockNodeId),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Constraint',\n\t\t\t\tinput: AnchoredChange.constraint(RangeAnchor.only(right), ConstraintEffect.ValidRetry),\n\t\t\t\texpected: AnchoredChange.constraint(mockRange, ConstraintEffect.ValidRetry),\n\t\t\t},\n\t\t];\n\t\tfor (const testCase of testCases) {\n\t\t\tit(`attempts to resolve anchors in ${testCase.name} changes`, () => {\n\t\t\t\tconst change = testCase.input;\n\t\t\t\tconst actualHappy = resolveChangeAnchors(change, mockSnapshot, [], {\n\t\t\t\t\tnodeResolver: () => mockNodeId,\n\t\t\t\t\tplaceResolver: () => mockPlace,\n\t\t\t\t\trangeResolver: () => mockRange,\n\t\t\t\t});\n\t\t\t\texpect(actualHappy).deep.equal(testCase.expected);\n\t\t\t\tconst actualSad = resolveChangeAnchors(change, mockSnapshot, [], {\n\t\t\t\t\tnodeResolver: () => undefined,\n\t\t\t\t\tplaceResolver: () => undefined,\n\t\t\t\t\trangeResolver: () => undefined,\n\t\t\t\t});\n\t\t\t\texpect(actualSad).equal(undefined);\n\t\t\t});\n\t\t}\n\n\t\tit('throws when given an unsupported change type', () => {\n\t\t\tconst fakeChange = { type: -42 };\n\t\t\texpect(() => resolveChangeAnchors(fakeChange as AnchoredChange, mockSnapshot, [])).throws();\n\t\t});\n\t});\n\n\tdescribe(resolveNodeAnchor.name, () => {\n\t\tit('returns the given NodeAnchor as a NodeId if the node exists in the snapshot', () => {\n\t\t\tconst snapshot = Snapshot.fromTree(left);\n\t\t\texpect(resolveNodeAnchor(left.identifier, snapshot, [])).equals(left.identifier);\n\t\t});\n\n\t\tit('returns undefined if the node does not exists in the snapshot', () => {\n\t\t\tconst snapshot = Snapshot.fromTree(left);\n\t\t\texpect(resolveNodeAnchor(mockNodeId, snapshot, [])).equals(undefined);\n\t\t});\n\t});\n\n\tdescribe(resolveRangeAnchor.name, () => {\n\t\tit('returns a range with resolved places when possible', () => {\n\t\t\texpect(\n\t\t\t\tresolveRangeAnchor(RangeAnchor.only(left), mockSnapshot, [], {\n\t\t\t\t\tplaceResolver: () => mockPlace,\n\t\t\t\t\trangeValidator: () => EditValidationResult.Valid,\n\t\t\t\t})\n\t\t\t).deep.equals(RangeAnchor.from(mockPlace).to(mockPlace));\n\t\t});\n\n\t\tit('returns undefined if either place cannot be resolved', () => {\n\t\t\texpect(\n\t\t\t\tresolveRangeAnchor(RangeAnchor.only(left), mockSnapshot, [], {\n\t\t\t\t\tplaceResolver: (place: PlaceAnchor) => (place.side === Side.After ? mockPlace : undefined),\n\t\t\t\t\trangeValidator: () => EditValidationResult.Valid,\n\t\t\t\t})\n\t\t\t).equals(undefined);\n\t\t\texpect(\n\t\t\t\tresolveRangeAnchor(RangeAnchor.only(left), mockSnapshot, [], {\n\t\t\t\t\tplaceResolver: (place: PlaceAnchor) => (place.side === Side.Before ? undefined : mockPlace),\n\t\t\t\t\trangeValidator: () => EditValidationResult.Valid,\n\t\t\t\t})\n\t\t\t).equals(undefined);\n\t\t});\n\n\t\tit('returns undefined the resolved places do not make a valid range', () => {\n\t\t\texpect(\n\t\t\t\tresolveRangeAnchor(RangeAnchor.only(left), mockSnapshot, [], {\n\t\t\t\t\tplaceResolver: () => mockPlace,\n\t\t\t\t\trangeValidator: () => EditValidationResult.Malformed,\n\t\t\t\t})\n\t\t\t).equals(undefined);\n\t\t\texpect(\n\t\t\t\tresolveRangeAnchor(RangeAnchor.only(left), mockSnapshot, [], {\n\t\t\t\t\tplaceResolver: () => mockPlace,\n\t\t\t\t\trangeValidator: () => EditValidationResult.Invalid,\n\t\t\t\t})\n\t\t\t).equals(undefined);\n\t\t});\n\t});\n\n\tdescribe(resolvePlaceAnchor.name, () => {\n\t\tit('returns the given anchor when that anchor is valid in the current snapshot', () => {\n\t\t\tconst snapshot = Snapshot.fromTree(initialTree);\n\t\t\tconst testWithPlace = (place) => resolvePlaceAnchor(place, snapshot, []);\n\t\t\texpect(testWithPlace(startPlace)).contains(startPlace);\n\t\t\texpect(testWithPlace(endPlace)).contains(endPlace);\n\t\t\texpect(testWithPlace(beforePlace)).contains(beforePlace);\n\t\t\texpect(testWithPlace(afterPlace)).contains(afterPlace);\n\t\t\texpect(testWithPlace(PlaceAnchor.atStartOf(leftTraitLocation))).contains(startPlace);\n\t\t\texpect(testWithPlace(PlaceAnchor.atEndOf(leftTraitLocation))).contains(endPlace);\n\t\t\texpect(testWithPlace(PlaceAnchor.before(left))).contains(beforePlace);\n\t\t\texpect(testWithPlace(PlaceAnchor.after(left))).contains(afterPlace);\n\t\t});\n\n\t\tit('returns undefined when the anchor is invalid and not updatable', () => {\n\t\t\texpect(\n\t\t\t\tresolvePlaceAnchor(mockPlace, mockSnapshot, [], {\n\t\t\t\t\tplaceUpdatorForPath: () => undefined,\n\t\t\t\t\tplaceValidator: () => EditValidationResult.Invalid,\n\t\t\t\t})\n\t\t\t).equals(undefined);\n\t\t});\n\n\t\tit('returns undefined when the anchor is invalid and bound to the node', () => {\n\t\t\tconst resolvePlaceAnchorForInvalidPlace = (place) =>\n\t\t\t\tresolvePlaceAnchor(place, mockSnapshot, [], {\n\t\t\t\t\tplaceUpdatorForPath: () => fail(),\n\t\t\t\t\tplaceValidator: () => EditValidationResult.Invalid,\n\t\t\t\t});\n\t\t\texpect(resolvePlaceAnchorForInvalidPlace(startPlace)).equals(undefined);\n\t\t\texpect(resolvePlaceAnchorForInvalidPlace(endPlace)).equals(undefined);\n\t\t\texpect(resolvePlaceAnchorForInvalidPlace(beforePlace)).equals(undefined);\n\t\t\texpect(resolvePlaceAnchorForInvalidPlace(afterPlace)).equals(undefined);\n\t\t});\n\n\t\tit('returns an updated anchor when the anchor is invalid but updatable to be valid', () => {\n\t\t\tlet updateCountdown = 5;\n\t\t\tconst inputSnapshot = Snapshot.fromTree(initialTree);\n\t\t\tconst inputPlace = PlaceAnchor.after(mockNodeId);\n\t\t\tconst placeUpdatorForPath = (\n\t\t\t\tplace: RelativePlaceAnchor,\n\t\t\t\tpath: ReconciliationPath<AnchoredChange>\n\t\t\t): PlaceAnchor | undefined => {\n\t\t\t\texpect(place).equals(inputPlace);\n\t\t\t\texpect(path).equals(mockPath);\n\t\t\t\treturn --updateCountdown ? inputPlace : afterAnchor;\n\t\t\t};\n\t\t\tconst placeValidator = (snapshot, place) => {\n\t\t\t\texpect(snapshot).equals(inputSnapshot);\n\t\t\t\treturn place === inputPlace ? EditValidationResult.Invalid : EditValidationResult.Valid;\n\t\t\t};\n\t\t\texpect(\n\t\t\t\tresolvePlaceAnchor(inputPlace, inputSnapshot, mockPath, {\n\t\t\t\t\tplaceUpdatorForPath,\n\t\t\t\t\tplaceValidator,\n\t\t\t\t})\n\t\t\t).contains(PlaceAnchor.after(left));\n\t\t\t// Check that it took the expected number of updates\n\t\t\texpect(updateCountdown).equals(0);\n\t\t});\n\n\t\tit('returns undefined when the anchor is invalid and updatable to be invalid', () => {\n\t\t\tlet updateCountdown = 5;\n\t\t\tconst inputSnapshot = Snapshot.fromTree(initialTree);\n\t\t\tconst inputPlace = PlaceAnchor.after(mockNodeId);\n\t\t\tconst placeUpdatorForPath = (\n\t\t\t\tplace: RelativePlaceAnchor,\n\t\t\t\tpath: ReconciliationPath<AnchoredChange>\n\t\t\t): PlaceAnchor | undefined => {\n\t\t\t\texpect(place).equals(inputPlace);\n\t\t\t\texpect(path).equals(mockPath);\n\t\t\t\treturn --updateCountdown ? inputPlace : undefined;\n\t\t\t};\n\t\t\tconst placeValidator = (snapshot, place) => {\n\t\t\t\texpect(snapshot).equals(inputSnapshot);\n\t\t\t\texpect(place).equals(inputPlace);\n\t\t\t\treturn EditValidationResult.Invalid;\n\t\t\t};\n\t\t\texpect(\n\t\t\t\tresolvePlaceAnchor(inputPlace, inputSnapshot, mockPath, {\n\t\t\t\t\tplaceUpdatorForPath,\n\t\t\t\t\tplaceValidator,\n\t\t\t\t})\n\t\t\t).equals(undefined);\n\t\t\t// Check that it took the expected number of updates\n\t\t\texpect(updateCountdown).equals(0);\n\t\t});\n\n\t\tit('throws when given an unsupported choice of anchor semantics', () => {\n\t\t\tconst fakeAnchor = { semantics: -42 };\n\t\t\texpect(() => resolvePlaceAnchor(fakeAnchor as PlaceAnchor, mockSnapshot, [])).throws();\n\t\t});\n\t});\n\n\tdescribe(updateRelativePlaceAnchorForPath.name, () => {\n\t\tit('does not update anchors for start and end of traits', () => {\n\t\t\texpect(updateRelativePlaceAnchorForPath(startAnchor, [])).equals(undefined);\n\t\t\texpect(updateRelativePlaceAnchorForPath(endAnchor, [])).equals(undefined);\n\t\t});\n\n\t\tit('does not update anchors when the last offending change is not found', () => {\n\t\t\texpect(\n\t\t\t\tupdateRelativePlaceAnchorForPath(startAnchor, [], {\n\t\t\t\t\tlastOffendingChangeFinder: () => undefined,\n\t\t\t\t\tplaceUpdatorForChange: () => fail(),\n\t\t\t\t})\n\t\t\t).equals(undefined);\n\t\t});\n\n\t\tit('tries to update anchors when the last offending change is found', () => {\n\t\t\texpect(\n\t\t\t\tupdateRelativePlaceAnchorForPath(beforeAnchor, [], {\n\t\t\t\t\tlastOffendingChangeFinder: () => mockEvaluatedChange,\n\t\t\t\t\tplaceUpdatorForChange: (place, change) => {\n\t\t\t\t\t\texpect(place).equals(beforeAnchor);\n\t\t\t\t\t\texpect(change).equals(mockEvaluatedChange);\n\t\t\t\t\t\treturn mockPlace;\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t).equals(mockPlace);\n\t\t\texpect(\n\t\t\t\tupdateRelativePlaceAnchorForPath(beforeAnchor, [], {\n\t\t\t\t\tlastOffendingChangeFinder: () => mockEvaluatedChange,\n\t\t\t\t\tplaceUpdatorForChange: (place, change) => {\n\t\t\t\t\t\texpect(place).equals(beforeAnchor);\n\t\t\t\t\t\texpect(change).equals(mockEvaluatedChange);\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t).equals(undefined);\n\t\t});\n\t});\n\n\tdescribe(findLastOffendingChange.name, () => {\n\t\tfunction makeEdit(changes: readonly AnchoredChange[]): ReconciliationEdit<AnchoredChange> {\n\t\t\tassert(changes.length > 0);\n\t\t\tconst steps: ReconciliationChange<AnchoredChange>[] = changes.map(makeChange);\n\t\t\treturn Object.assign(steps, {\n\t\t\t\tbefore: snapshotBeforeChange(changes[0]),\n\t\t\t\tafter: steps[steps.length - 1].after,\n\t\t\t});\n\t\t}\n\n\t\tfunction makeChange(change: AnchoredChange): ReconciliationChange<AnchoredChange> {\n\t\t\treturn {\n\t\t\t\tresolvedChange: change,\n\t\t\t\tafter: snapshotAfterChange(change),\n\t\t\t};\n\t\t}\n\n\t\tfunction snapshotBeforeChange(change: AnchoredChange): Snapshot {\n\t\t\treturn change === stayInvalidChange || change === mendingChange ? invalidSnapshot : validSnapshot;\n\t\t}\n\n\t\tfunction snapshotAfterChange(change: AnchoredChange): Snapshot {\n\t\t\treturn change === stayValidChange || change === mendingChange ? validSnapshot : invalidSnapshot;\n\t\t}\n\n\t\tconst validSnapshot = 'valid-snapshot' as unknown as Snapshot;\n\t\tconst invalidSnapshot = 'invalid-snapshot' as unknown as Snapshot;\n\t\tconst priorOffendingChange = 'prior-offending-change' as unknown as AnchoredChange;\n\t\tconst lastOffendingChange = 'last-offending-change' as unknown as AnchoredChange;\n\t\tconst stayValidChange = 'stay-valid-change' as unknown as AnchoredChange;\n\t\tconst stayInvalidChange = 'stay-invalid-change' as unknown as AnchoredChange;\n\t\tconst mendingChange = 'mending-change' as unknown as AnchoredChange;\n\t\tconst priorOffendingEdit = makeEdit([priorOffendingChange]);\n\t\tconst lastOffendingEdit = makeEdit([lastOffendingChange]);\n\t\tconst mendingEdit = makeEdit([mendingChange]);\n\t\tconst stayValidEdit = makeEdit([stayValidChange]);\n\t\tconst stayInvalidEdit = makeEdit([stayInvalidChange]);\n\n\t\tconst testWithPath = (path: ReconciliationPath<AnchoredChange>) =>\n\t\t\tfindLastOffendingChange(mockPlaceAnchor, path, {\n\t\t\t\tplaceValidator: (snapshot) =>\n\t\t\t\t\tsnapshot === invalidSnapshot\n\t\t\t\t\t\t? EditValidationResult.Invalid\n\t\t\t\t\t\t: snapshot === validSnapshot\n\t\t\t\t\t\t? EditValidationResult.Valid\n\t\t\t\t\t\t: fail(),\n\t\t\t});\n\n\t\tdescribe('returns undefined when the place is invalid throughout the path', () => {\n\t\t\tconst testCases: ReconciliationPath<AnchoredChange>[] = [\n\t\t\t\t[],\n\t\t\t\t[stayInvalidEdit],\n\t\t\t\t[stayInvalidEdit, stayInvalidEdit, stayInvalidEdit],\n\t\t\t\t[makeEdit([stayInvalidChange, stayInvalidChange, stayInvalidChange])],\n\t\t\t];\n\t\t\tfor (let i = 0; i < testCases.length; ++i) {\n\t\t\t\tit(`Test Case ${i}`, () => {\n\t\t\t\t\texpect(testWithPath(testCases[i])).equals(undefined);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tdescribe('returns the last offending change when there is one', () => {\n\t\t\tconst testCases: ReconciliationPath<AnchoredChange>[] = [\n\t\t\t\t[lastOffendingEdit],\n\t\t\t\t[lastOffendingEdit, stayInvalidEdit],\n\t\t\t\t[stayValidEdit, lastOffendingEdit],\n\t\t\t\t[stayValidEdit, lastOffendingEdit, stayInvalidEdit],\n\t\t\t\t[stayValidEdit, priorOffendingEdit, stayInvalidEdit, mendingEdit, lastOffendingEdit],\n\t\t\t\t[stayValidEdit, priorOffendingEdit, stayInvalidEdit, mendingEdit, lastOffendingEdit, stayInvalidEdit],\n\t\t\t\t[priorOffendingEdit, mendingEdit, priorOffendingEdit, mendingEdit, lastOffendingEdit],\n\t\t\t\t[makeEdit([stayValidChange, lastOffendingChange])],\n\t\t\t\t[makeEdit([lastOffendingChange, stayInvalidChange])],\n\t\t\t\t[makeEdit([stayValidChange, lastOffendingChange, stayInvalidChange])],\n\t\t\t\t[makeEdit([stayValidChange, priorOffendingChange, mendingChange, lastOffendingChange])],\n\t\t\t\t[\n\t\t\t\t\tmakeEdit([\n\t\t\t\t\t\tpriorOffendingChange,\n\t\t\t\t\t\tmendingChange,\n\t\t\t\t\t\tpriorOffendingChange,\n\t\t\t\t\t\tmendingChange,\n\t\t\t\t\t\tlastOffendingChange,\n\t\t\t\t\t]),\n\t\t\t\t],\n\t\t\t\t[stayInvalidEdit, makeEdit([mendingChange, lastOffendingChange])],\n\t\t\t];\n\t\t\tfor (let i = 0; i < testCases.length; ++i) {\n\t\t\t\tit(`Test Case ${i}`, () => {\n\t\t\t\t\tconst actual = testWithPath(testCases[i]);\n\t\t\t\t\texpect(actual).deep.equals({\n\t\t\t\t\t\tbefore: validSnapshot,\n\t\t\t\t\t\tafter: invalidSnapshot,\n\t\t\t\t\t\tchange: lastOffendingChange,\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t});\n\n\tdescribe(updateRelativePlaceAnchorForChange.name, () => {\n\t\tconst afterPrior = PlaceAnchor.after(priorSibling);\n\t\tconst beforeNext = PlaceAnchor.before(nextSibling);\n\t\tconst rangesInSitu = [\n\t\t\t{\n\t\t\t\trange: RangeAnchor.from(startAnchor).to(beforeNext),\n\t\t\t\ttrait: [left, nextSibling],\n\t\t\t},\n\t\t\t{\n\t\t\t\trange: RangeAnchor.from(startAnchor).to(afterAnchor),\n\t\t\t\ttrait: [left],\n\t\t\t},\n\t\t\t{\n\t\t\t\trange: RangeAnchor.from(startAnchor).to(endAnchor),\n\t\t\t\ttrait: [left],\n\t\t\t},\n\t\t\t{\n\t\t\t\trange: RangeAnchor.from(beforeAnchor).to(beforeNext),\n\t\t\t\ttrait: [left, nextSibling],\n\t\t\t},\n\t\t\t{\n\t\t\t\trange: RangeAnchor.from(beforeAnchor).to(afterAnchor),\n\t\t\t\ttrait: [left],\n\t\t\t},\n\t\t\t{\n\t\t\t\trange: RangeAnchor.from(beforeAnchor).to(endAnchor),\n\t\t\t\ttrait: [left],\n\t\t\t},\n\t\t\t{\n\t\t\t\trange: RangeAnchor.from(afterPrior).to(beforeNext),\n\t\t\t\ttrait: [priorSibling, left, nextSibling],\n\t\t\t},\n\t\t\t{\n\t\t\t\trange: RangeAnchor.from(afterPrior).to(afterAnchor),\n\t\t\t\ttrait: [priorSibling, left],\n\t\t\t},\n\t\t\t{\n\t\t\t\trange: RangeAnchor.from(afterPrior).to(endAnchor),\n\t\t\t\ttrait: [priorSibling, left],\n\t\t\t},\n\t\t];\n\n\t\tfunction evaluateCase(caseIndex: number, anchor: RelativePlaceAnchor): PlaceAnchor | undefined {\n\t\t\tconst before = Snapshot.fromTree({\n\t\t\t\t...parent,\n\t\t\t\ttraits: { [leftTraitLabel]: rangesInSitu[caseIndex].trait },\n\t\t\t});\n\t\t\tconst filteredTrait = rangesInSitu[caseIndex].trait.filter((sibling) => sibling !== left);\n\t\t\tconst after = Snapshot.fromTree({\n\t\t\t\t...parent,\n\t\t\t\ttraits: filteredTrait.length ? { [leftTraitLabel]: filteredTrait } : {},\n\t\t\t});\n\t\t\tconst evaluatedChange: EvaluatedChange<AnchoredChange> = {\n\t\t\t\tchange: AnchoredChange.detach(rangesInSitu[caseIndex].range),\n\t\t\t\tbefore,\n\t\t\t\tafter,\n\t\t\t};\n\t\t\treturn updateRelativePlaceAnchorForChange(anchor, evaluatedChange);\n\t\t}\n\n\t\tdescribe('can update before(X) and after(X) when X is detached', () => {\n\t\t\tfor (let i = 0; i < rangesInSitu.length; ++i) {\n\t\t\t\tit(`Test Case ${i}`, () => {\n\t\t\t\t\tconst expectedAfter = rangesInSitu[i].trait[0] === priorSibling ? afterPrior : startAnchor;\n\t\t\t\t\tconst expectedBefore =\n\t\t\t\t\t\trangesInSitu[i].trait[rangesInSitu[i].trait.length - 1] === nextSibling\n\t\t\t\t\t\t\t? beforeNext\n\t\t\t\t\t\t\t: endAnchor;\n\t\t\t\t\texpect(evaluateCase(i, afterAnchor)).deep.equals(expectedAfter);\n\t\t\t\t\texpect(evaluateCase(i, beforeAnchor)).deep.equals(expectedBefore);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tdescribe('does not update anchors for start and end of traits', () => {\n\t\t\tfor (let i = 0; i < rangesInSitu.length; ++i) {\n\t\t\t\tit(`Test Case ${i}`, () => {\n\t\t\t\t\texpect(evaluateCase(i, startAnchor)).equals(undefined);\n\t\t\t\t\texpect(evaluateCase(i, endAnchor)).equals(undefined);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tit('does not update anchors when the containing parent is deleted', () => {\n\t\t\tconst before = Snapshot.fromTree(initialTree);\n\t\t\tconst after = Snapshot.fromTree({\n\t\t\t\t...initialTree,\n\t\t\t\ttraits: {},\n\t\t\t});\n\t\t\tconst evaluatedChange: EvaluatedChange<AnchoredChange> = {\n\t\t\t\tchange: AnchoredChange.detach(RangeAnchor.only(parent)),\n\t\t\t\tbefore,\n\t\t\t\tafter,\n\t\t\t};\n\t\t\texpect(updateRelativePlaceAnchorForChange(startAnchor, evaluatedChange)).equals(undefined);\n\t\t\texpect(updateRelativePlaceAnchorForChange(endAnchor, evaluatedChange)).equals(undefined);\n\t\t\texpect(updateRelativePlaceAnchorForChange(afterAnchor, evaluatedChange)).equals(undefined);\n\t\t\texpect(updateRelativePlaceAnchorForChange(beforeAnchor, evaluatedChange)).equals(undefined);\n\t\t});\n\t});\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BasicCheckout.tests.d.ts","sourceRoot":"","sources":["../../src/test/BasicCheckout.tests.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { BasicCheckout } from '../BasicCheckout';
|
|
6
|
-
import { checkoutTests } from './Checkout.tests';
|
|
7
|
-
checkoutTests('BasicCheckout', async (tree) => Promise.resolve(new BasicCheckout(tree)));
|
|
8
|
-
//# sourceMappingURL=BasicCheckout.tests.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BasicCheckout.tests.js","sourceRoot":"","sources":["../../src/test/BasicCheckout.tests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,aAAa,CAAC,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { BasicCheckout } from '../BasicCheckout';\nimport { checkoutTests } from './Checkout.tests';\n\ncheckoutTests('BasicCheckout', async (tree) => Promise.resolve(new BasicCheckout(tree)));\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GenericTransactionWithAnchors.tests.d.ts","sourceRoot":"","sources":["../../src/test/GenericTransactionWithAnchors.tests.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { expect } from 'chai';
|
|
6
|
-
import { EditStatus } from '../generic';
|
|
7
|
-
import { AnchoredChange, PlaceAnchorSemanticsChoice, RangeAnchor, TransactionWithAnchors } from '../anchored-edits';
|
|
8
|
-
import { simpleTreeSnapshotWithValidation, left, right } from './utilities/TestUtilities';
|
|
9
|
-
describe('TransactionWithAnchors', () => {
|
|
10
|
-
it('does not read the reconciliation path when change resolution does not require it', () => {
|
|
11
|
-
const trappedPath = new Proxy([], {
|
|
12
|
-
get: (target, prop) => {
|
|
13
|
-
expect('the path was read').equals('the path should not be read');
|
|
14
|
-
return target[prop];
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
const transaction = new TransactionWithAnchors(simpleTreeSnapshotWithValidation);
|
|
18
|
-
transaction.applyChanges([
|
|
19
|
-
AnchoredChange.detach(RangeAnchor.only(left, PlaceAnchorSemanticsChoice.BoundToNode)),
|
|
20
|
-
AnchoredChange.detach(RangeAnchor.only(right, PlaceAnchorSemanticsChoice.BoundToNode)),
|
|
21
|
-
], trappedPath);
|
|
22
|
-
expect(transaction.status).equals(EditStatus.Applied);
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
//# sourceMappingURL=GenericTransactionWithAnchors.tests.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GenericTransactionWithAnchors.tests.js","sourceRoot":"","sources":["../../src/test/GenericTransactionWithAnchors.tests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACpH,OAAO,EAAE,gCAAgC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAE1F,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACvC,EAAE,CAAC,kFAAkF,EAAE,GAAG,EAAE;QAC3F,MAAM,WAAW,GAAG,IAAI,KAAK,CAAC,EAA0C,EAAE;YACzE,GAAG,EAAE,CAAC,MAAM,EAAE,IAAI,EAAW,EAAE;gBAC9B,MAAM,CAAC,mBAAmB,CAAC,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAC;gBAClE,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;YACrB,CAAC;SACD,CAAC,CAAC;QACH,MAAM,WAAW,GAAG,IAAI,sBAAsB,CAAC,gCAAgC,CAAC,CAAC;QACjF,WAAW,CAAC,YAAY,CACvB;YACC,cAAc,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,0BAA0B,CAAC,WAAW,CAAC,CAAC;YACrF,cAAc,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,0BAA0B,CAAC,WAAW,CAAC,CAAC;SACtF,EACD,WAAW,CACX,CAAC;QACF,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { expect } from 'chai';\nimport { EditStatus } from '../generic';\nimport { ReconciliationEdit } from '../ReconciliationPath';\nimport { AnchoredChange, PlaceAnchorSemanticsChoice, RangeAnchor, TransactionWithAnchors } from '../anchored-edits';\nimport { simpleTreeSnapshotWithValidation, left, right } from './utilities/TestUtilities';\n\ndescribe('TransactionWithAnchors', () => {\n\tit('does not read the reconciliation path when change resolution does not require it', () => {\n\t\tconst trappedPath = new Proxy([] as ReconciliationEdit<AnchoredChange>[], {\n\t\t\tget: (target, prop): unknown => {\n\t\t\t\texpect('the path was read').equals('the path should not be read');\n\t\t\t\treturn target[prop];\n\t\t\t},\n\t\t});\n\t\tconst transaction = new TransactionWithAnchors(simpleTreeSnapshotWithValidation);\n\t\ttransaction.applyChanges(\n\t\t\t[\n\t\t\t\tAnchoredChange.detach(RangeAnchor.only(left, PlaceAnchorSemanticsChoice.BoundToNode)),\n\t\t\t\tAnchoredChange.detach(RangeAnchor.only(right, PlaceAnchorSemanticsChoice.BoundToNode)),\n\t\t\t],\n\t\t\ttrappedPath\n\t\t);\n\t\texpect(transaction.status).equals(EditStatus.Applied);\n\t});\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SharedTreeWithAnchors.tests.d.ts","sourceRoot":"","sources":["../../src/test/SharedTreeWithAnchors.tests.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -1,420 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { expect } from 'chai';
|
|
6
|
-
import { StablePlace, StableRange, ConstraintEffect, revert } from '../default-edits';
|
|
7
|
-
import { AnchoredChange, AnchoredDelete, AnchoredInsert, AnchoredMove, PlaceAnchor, PlaceAnchorSemanticsChoice, RangeAnchor, } from '../anchored-edits';
|
|
8
|
-
import { fail } from '../Common';
|
|
9
|
-
import { makeEmptyNode, setUpTestSharedTreeWithAnchors, leftTraitLabel, rightTraitLabel, setUpLocalServerTestSharedTreeWithAnchors, } from './utilities/TestUtilities';
|
|
10
|
-
import { runSharedTreeOperationsTests } from './utilities/SharedTreeTests';
|
|
11
|
-
import { runSummaryTests } from './utilities/SummaryFormatCompatibilityTests';
|
|
12
|
-
const left = makeEmptyNode('left');
|
|
13
|
-
const right = makeEmptyNode('right');
|
|
14
|
-
const parent = Object.assign(Object.assign({}, makeEmptyNode('parent')), { traits: { [leftTraitLabel]: [left], [rightTraitLabel]: [right] } });
|
|
15
|
-
const initialTree = Object.assign(Object.assign({}, makeEmptyNode('root')), { traits: {
|
|
16
|
-
parentTraitLabel: [parent],
|
|
17
|
-
} });
|
|
18
|
-
const leftTraitLocation = {
|
|
19
|
-
parent: parent.identifier,
|
|
20
|
-
label: leftTraitLabel,
|
|
21
|
-
};
|
|
22
|
-
const rightTraitLocation = {
|
|
23
|
-
parent: parent.identifier,
|
|
24
|
-
label: rightTraitLabel,
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Used for tests that require more than the left and right nodes.
|
|
28
|
-
*/
|
|
29
|
-
const extra = makeEmptyNode('extra');
|
|
30
|
-
/**
|
|
31
|
-
* The node inserted by the change whose anchors are being tested.
|
|
32
|
-
* Tests outcomes are decided based on where this node ends up (if present at all).
|
|
33
|
-
*/
|
|
34
|
-
const inserted = makeEmptyNode('inserted');
|
|
35
|
-
/**
|
|
36
|
-
* Used for tests cases where we check `inserted`'s final location with respect to another node that is concurrently inserted.
|
|
37
|
-
*/
|
|
38
|
-
const concurrentlyInserted = makeEmptyNode('concurrently inserted');
|
|
39
|
-
const treeOptions = {
|
|
40
|
-
initialTree,
|
|
41
|
-
localMode: false,
|
|
42
|
-
enableAnchors: true,
|
|
43
|
-
allowInvalid: true,
|
|
44
|
-
};
|
|
45
|
-
const secondTreeOptions = {
|
|
46
|
-
id: 'secondTestSharedTree',
|
|
47
|
-
localMode: false,
|
|
48
|
-
enableAnchors: true,
|
|
49
|
-
allowInvalid: true,
|
|
50
|
-
};
|
|
51
|
-
const thirdTreeOptions = {
|
|
52
|
-
id: 'thirdTestSharedTree',
|
|
53
|
-
localMode: false,
|
|
54
|
-
enableAnchors: true,
|
|
55
|
-
allowInvalid: true,
|
|
56
|
-
};
|
|
57
|
-
const boundToNodeBefore = {
|
|
58
|
-
name: 'BoundToNode Before(left)',
|
|
59
|
-
insertionPlace: PlaceAnchor.before(left, PlaceAnchorSemanticsChoice.BoundToNode),
|
|
60
|
-
onNoConcurrency: { leftTrait: [inserted, left] },
|
|
61
|
-
onMove: { leftTrait: [], rightTrait: [inserted, left, right] },
|
|
62
|
-
onDelete: { leftTrait: [] },
|
|
63
|
-
onDroppedEdit: { leftTrait: [inserted, left] },
|
|
64
|
-
onInsert: { leftTrait: [concurrentlyInserted, inserted, left] },
|
|
65
|
-
};
|
|
66
|
-
const boundToNodeAfter = Object.assign(Object.assign({}, boundToNodeBefore), { name: 'BoundToNode After(left)', insertionPlace: PlaceAnchor.after(left, PlaceAnchorSemanticsChoice.BoundToNode), onNoConcurrency: { leftTrait: [left, inserted] }, onMove: { leftTrait: [], rightTrait: [left, inserted, right] }, onDroppedEdit: { leftTrait: [left, inserted] }, onInsert: { leftTrait: [left, inserted, concurrentlyInserted] } });
|
|
67
|
-
const boundToNodeStart = Object.assign(Object.assign({}, boundToNodeBefore), { name: 'BoundToNode Start(left trait)', insertionPlace: PlaceAnchor.atStartOf(leftTraitLocation, PlaceAnchorSemanticsChoice.BoundToNode), onMove: { leftTrait: [inserted], rightTrait: [left, right] }, onDelete: { leftTrait: [inserted] }, onInsert: { leftTrait: [inserted, concurrentlyInserted, left] } });
|
|
68
|
-
const boundToNodeEnd = Object.assign(Object.assign({}, boundToNodeAfter), { name: 'BoundToNode End(left trait)', insertionPlace: PlaceAnchor.atEndOf(leftTraitLocation, PlaceAnchorSemanticsChoice.BoundToNode), onMove: { leftTrait: [inserted], rightTrait: [left, right] }, onDelete: { leftTrait: [inserted] }, onInsert: { leftTrait: [left, concurrentlyInserted, inserted] } });
|
|
69
|
-
const relativeToNodeBefore = Object.assign(Object.assign({}, boundToNodeBefore), { name: 'RelativeToNode Before(left)', insertionPlace: PlaceAnchor.before(left, PlaceAnchorSemanticsChoice.RelativeToNode), onDelete: { leftTrait: [inserted] } });
|
|
70
|
-
const relativeToNodeAfter = Object.assign(Object.assign({}, boundToNodeAfter), { name: 'RelativeToNode After(left)', insertionPlace: PlaceAnchor.after(left, PlaceAnchorSemanticsChoice.RelativeToNode), onDelete: relativeToNodeBefore.onDelete });
|
|
71
|
-
const relativeToNodeStart = Object.assign(Object.assign({}, boundToNodeStart), { name: 'RelativeToNode Start(left trait)', insertionPlace: PlaceAnchor.atStartOf(leftTraitLocation, PlaceAnchorSemanticsChoice.RelativeToNode) });
|
|
72
|
-
const relativeToNodeEnd = Object.assign(Object.assign({}, boundToNodeEnd), { name: 'RelativeToNode End(left trait)', insertionPlace: PlaceAnchor.atEndOf(leftTraitLocation, PlaceAnchorSemanticsChoice.RelativeToNode) });
|
|
73
|
-
/**
|
|
74
|
-
* A representative set of possible anchors with a variety of semantics and in a variety of contexts.
|
|
75
|
-
* Includes the expected outcome of inserting the `inserted` node at the given anchor for various test scenarios.
|
|
76
|
-
*/
|
|
77
|
-
const anchorCases = [
|
|
78
|
-
boundToNodeBefore,
|
|
79
|
-
boundToNodeAfter,
|
|
80
|
-
boundToNodeStart,
|
|
81
|
-
boundToNodeEnd,
|
|
82
|
-
relativeToNodeBefore,
|
|
83
|
-
relativeToNodeAfter,
|
|
84
|
-
relativeToNodeStart,
|
|
85
|
-
relativeToNodeEnd,
|
|
86
|
-
];
|
|
87
|
-
/**
|
|
88
|
-
* A set of test scenario where `inserted` is inserted at a given anchor.
|
|
89
|
-
*/
|
|
90
|
-
const insertScenarios = [
|
|
91
|
-
{
|
|
92
|
-
title: 'when there are no concurrent edits',
|
|
93
|
-
outcomeKey: 'onNoConcurrency',
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
title: 'when target sibling is moved to a different trait',
|
|
97
|
-
outcomeKey: 'onMove',
|
|
98
|
-
concurrent: AnchoredMove.create(StableRange.only(left), StablePlace.before(right)),
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
title: 'when target sibling is deleted then re-inserted in a different trait',
|
|
102
|
-
outcomeKey: 'onTeleport',
|
|
103
|
-
concurrent: [
|
|
104
|
-
AnchoredDelete.create(StableRange.only(left)),
|
|
105
|
-
...AnchoredInsert.create([left], StablePlace.before(right)),
|
|
106
|
-
],
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
title: 'when target sibling is deleted with (before, before) range',
|
|
110
|
-
outcomeKey: 'onDelete',
|
|
111
|
-
concurrent: AnchoredDelete.create({
|
|
112
|
-
start: StablePlace.before(left),
|
|
113
|
-
end: StablePlace.atEndOf(leftTraitLocation),
|
|
114
|
-
}),
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
title: 'when target sibling is deleted with (before, after) range',
|
|
118
|
-
outcomeKey: 'onDelete',
|
|
119
|
-
concurrent: AnchoredDelete.create({
|
|
120
|
-
start: StablePlace.before(left),
|
|
121
|
-
end: StablePlace.after(left),
|
|
122
|
-
}),
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
title: 'when target sibling is deleted with (after, before) range',
|
|
126
|
-
outcomeKey: 'onDelete',
|
|
127
|
-
concurrent: AnchoredDelete.create({
|
|
128
|
-
start: StablePlace.atStartOf(leftTraitLocation),
|
|
129
|
-
end: StablePlace.atEndOf(leftTraitLocation),
|
|
130
|
-
}),
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
title: 'when target sibling is deleted with (after, after) range',
|
|
134
|
-
outcomeKey: 'onDelete',
|
|
135
|
-
concurrent: AnchoredDelete.create({
|
|
136
|
-
start: StablePlace.atStartOf(leftTraitLocation),
|
|
137
|
-
end: StablePlace.after(left),
|
|
138
|
-
}),
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
title: 'when target sibling is deleted then un-deleted',
|
|
142
|
-
outcomeKey: 'onUndoDelete',
|
|
143
|
-
concurrent: (tree) => {
|
|
144
|
-
const deletionEditId = tree.editor.delete(StableRange.only(left));
|
|
145
|
-
const deletionEditIndex = tree.edits.getIndexOfId(deletionEditId);
|
|
146
|
-
const deletionEdit = tree.edits.getEditInSessionAtIndex(deletionEditIndex);
|
|
147
|
-
return revert(deletionEdit.changes, tree.logViewer.getSnapshotInSession(deletionEditIndex));
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
title: 'when target sibling is deleted then un-deleted and re-deleted',
|
|
152
|
-
outcomeKey: 'onUndoRedoDelete',
|
|
153
|
-
concurrent: (tree) => {
|
|
154
|
-
const deletionEditId = tree.editor.delete(StableRange.only(left));
|
|
155
|
-
const deletionEditIndex = tree.edits.getIndexOfId(deletionEditId);
|
|
156
|
-
const deletionEdit = tree.edits.getEditInSessionAtIndex(deletionEditIndex);
|
|
157
|
-
const undoEditId = tree.editor.revert(deletionEdit, tree.logViewer.getSnapshotInSession(deletionEditIndex));
|
|
158
|
-
const undoEditIndex = tree.edits.getIndexOfId(undoEditId);
|
|
159
|
-
const undoEdit = tree.edits.getEditInSessionAtIndex(undoEditIndex);
|
|
160
|
-
return revert(undoEdit.changes, tree.logViewer.getSnapshotInSession(undoEditIndex));
|
|
161
|
-
},
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
title: 'when target sibling parent is deleted',
|
|
165
|
-
outcomeKey: 'onDeleteParent',
|
|
166
|
-
concurrent: AnchoredDelete.create(StableRange.only(parent)),
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
title: 'when target sibling is moved in an edit that is dropped',
|
|
170
|
-
outcomeKey: 'onDroppedEdit',
|
|
171
|
-
concurrent: [
|
|
172
|
-
// Valid move
|
|
173
|
-
...AnchoredMove.create(StableRange.only(left), StablePlace.before(right)),
|
|
174
|
-
// Invalid constraint
|
|
175
|
-
AnchoredChange.constraint(StableRange.only(left), ConstraintEffect.InvalidAndDiscard, undefined, 0),
|
|
176
|
-
],
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
title: 'when target sibling is deleted in an edit that is dropped',
|
|
180
|
-
outcomeKey: 'onDroppedEdit',
|
|
181
|
-
concurrent: [
|
|
182
|
-
// Valid delete
|
|
183
|
-
AnchoredDelete.create(StableRange.only(left)),
|
|
184
|
-
// Invalid constraint
|
|
185
|
-
AnchoredChange.constraint(StableRange.only(left), ConstraintEffect.InvalidAndDiscard, undefined, 0),
|
|
186
|
-
],
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
title: 'when target place is inserted at',
|
|
190
|
-
outcomeKey: 'onInsert',
|
|
191
|
-
concurrent: (_, anchorCase) => AnchoredInsert.create([concurrentlyInserted], anchorCase.insertionPlace),
|
|
192
|
-
},
|
|
193
|
-
];
|
|
194
|
-
describe('SharedTreeWithAnchors', () => {
|
|
195
|
-
describe('Fulfills the SharedTree contract', () => {
|
|
196
|
-
runSharedTreeOperationsTests('SharedTree Operations', setUpTestSharedTreeWithAnchors);
|
|
197
|
-
runSummaryTests('SharedTree Summary', setUpTestSharedTreeWithAnchors, setUpLocalServerTestSharedTreeWithAnchors);
|
|
198
|
-
});
|
|
199
|
-
it('PlaceAnchor builders default to RelativeToNode semantics', () => {
|
|
200
|
-
const start = PlaceAnchor.atStartOf(leftTraitLocation);
|
|
201
|
-
const end = PlaceAnchor.atEndOf(leftTraitLocation);
|
|
202
|
-
const before = PlaceAnchor.before(left);
|
|
203
|
-
const after = PlaceAnchor.after(left);
|
|
204
|
-
expect(start.semantics).equals(PlaceAnchorSemanticsChoice.RelativeToNode);
|
|
205
|
-
expect(end.semantics).equals(PlaceAnchorSemanticsChoice.RelativeToNode);
|
|
206
|
-
expect(before.semantics).equals(PlaceAnchorSemanticsChoice.RelativeToNode);
|
|
207
|
-
expect(after.semantics).equals(PlaceAnchorSemanticsChoice.RelativeToNode);
|
|
208
|
-
});
|
|
209
|
-
it('RangeAnchor builders default to RelativeToNode semantics', () => {
|
|
210
|
-
const range = RangeAnchor.only(left);
|
|
211
|
-
expect(range.start.semantics).equals(PlaceAnchorSemanticsChoice.RelativeToNode);
|
|
212
|
-
expect(range.end.semantics).equals(PlaceAnchorSemanticsChoice.RelativeToNode);
|
|
213
|
-
});
|
|
214
|
-
// This is the main battery of tests.
|
|
215
|
-
// These tests insert the `inserted` node at a given PlaceAnchor in different scenarios and check where that node ends up.
|
|
216
|
-
// The scenarios cover the various ways concurrent change might affect an anchor.
|
|
217
|
-
describe('Basic scenarios', () => {
|
|
218
|
-
for (const insertScenario of insertScenarios) {
|
|
219
|
-
describe(insertScenario.title, () => {
|
|
220
|
-
insertTestsWithExtraChanges(insertScenario.outcomeKey, insertScenario.concurrent);
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
// These tests exercise special scenarios that the main battery of tests (above) does not cover.
|
|
225
|
-
// They are mainly aimed at uncovering invalid assumptions that the anchor resolution implementation might make.
|
|
226
|
-
// While these tests could be made exhaustive like the main battery, doing so would just add redundant coverage.
|
|
227
|
-
describe(`Special scenarios`, () => {
|
|
228
|
-
it('when target place is invalid', () => {
|
|
229
|
-
const { treeA, treeB, container } = setupTrees();
|
|
230
|
-
treeA.editor.insert(inserted, PlaceAnchor.before(inserted));
|
|
231
|
-
container.processAllMessages();
|
|
232
|
-
expectChangedTraits(treeA, treeB, {});
|
|
233
|
-
});
|
|
234
|
-
// For each scenario we test with:
|
|
235
|
-
// groupInEdit=true: the concurrent changes that introduced the conflict were applied in a single edit
|
|
236
|
-
// groupInEdit=false: the concurrent changes that introduced the conflict were applied in separate edits
|
|
237
|
-
for (const groupInEdit of [true, false]) {
|
|
238
|
-
describe(groupInEdit ? 'In one edit' : 'In separate edits', () => {
|
|
239
|
-
// These tests verify that re-anchoring works even when more than one place anchor needs updating.
|
|
240
|
-
it('when target place and source range both need updating due to two deletes', () => {
|
|
241
|
-
const { treeA, treeB, container } = setupTrees();
|
|
242
|
-
treeA.editor.insert(extra, StablePlace.before(left));
|
|
243
|
-
container.processAllMessages();
|
|
244
|
-
if (groupInEdit) {
|
|
245
|
-
treeB.editor.applyChanges([
|
|
246
|
-
AnchoredDelete.create(RangeAnchor.only(left)),
|
|
247
|
-
AnchoredDelete.create(RangeAnchor.all(rightTraitLocation)),
|
|
248
|
-
]);
|
|
249
|
-
}
|
|
250
|
-
else {
|
|
251
|
-
treeB.editor.delete(RangeAnchor.only(left));
|
|
252
|
-
treeB.editor.delete(RangeAnchor.all(rightTraitLocation));
|
|
253
|
-
}
|
|
254
|
-
const beforeExtra = PlaceAnchor.before(extra);
|
|
255
|
-
const afterExtra = PlaceAnchor.after(extra);
|
|
256
|
-
treeA.editor.move(RangeAnchor.from(beforeExtra).to(afterExtra), PlaceAnchor.before(right));
|
|
257
|
-
container.processAllMessages();
|
|
258
|
-
expectChangedTraits(treeA, treeB, { leftTrait: [], rightTrait: [extra] });
|
|
259
|
-
});
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
// This test covers the scenario that yields different results depending on whether the front-biased approach
|
|
263
|
-
// seeks backward to find the most recent offending change at the granularity of changes or at the granularity of edits
|
|
264
|
-
// and then proceeds through changes forward.
|
|
265
|
-
it('when target place is teleported then deleted in a single edit', () => {
|
|
266
|
-
const { treeA, treeB, container } = setupTrees();
|
|
267
|
-
treeB.editor.applyChanges([
|
|
268
|
-
// The reanchor will happen on this change if seeking backward through edits and then forward through changes
|
|
269
|
-
AnchoredDelete.create(RangeAnchor.only(left)),
|
|
270
|
-
...AnchoredInsert.create([left], PlaceAnchor.atStartOf(rightTraitLocation)),
|
|
271
|
-
// The reanchor will happen on this change if seeking backward through changes
|
|
272
|
-
AnchoredDelete.create(RangeAnchor.only(left)),
|
|
273
|
-
]);
|
|
274
|
-
treeA.editor.insert(inserted, PlaceAnchor.before(left));
|
|
275
|
-
container.processAllMessages();
|
|
276
|
-
expectChangedTraits(treeA, treeB, { leftTrait: [], rightTrait: [inserted, right] });
|
|
277
|
-
});
|
|
278
|
-
// This test covers the scenario that yields different results depending on whether the front-biased approach
|
|
279
|
-
// seeks backward to find the most recent offending change at the granularity of changes or at the granularity of edits.
|
|
280
|
-
it('when target place is teleported then deleted across edits', () => {
|
|
281
|
-
const { treeA, treeB, container } = setupTrees();
|
|
282
|
-
// The reanchor will happen on this change if seeking backward through edits
|
|
283
|
-
treeB.editor.delete(left);
|
|
284
|
-
treeB.editor.applyChanges([
|
|
285
|
-
...AnchoredInsert.create([left], StablePlace.atStartOf(rightTraitLocation)),
|
|
286
|
-
// The reanchor will happen on this change if seeking backward through changes
|
|
287
|
-
AnchoredDelete.create(StableRange.only(left)),
|
|
288
|
-
]);
|
|
289
|
-
treeA.editor.insert(inserted, PlaceAnchor.before(left));
|
|
290
|
-
container.processAllMessages();
|
|
291
|
-
expectChangedTraits(treeA, treeB, { leftTrait: [], rightTrait: [inserted, right] });
|
|
292
|
-
});
|
|
293
|
-
// This test covers the scenario that yields different results depending on whether the changes of the edit being applied are
|
|
294
|
-
// included in the reconciliation path or not.
|
|
295
|
-
it('when target place is deleted by the edit being rebased', () => {
|
|
296
|
-
const { treeA, treeB, container } = setupTrees();
|
|
297
|
-
treeB.editor.move(left, PlaceAnchor.before(right));
|
|
298
|
-
treeA.editor.applyChanges([
|
|
299
|
-
// The reanchor will happen on this change if changes for this edit are included in the reconciliation path
|
|
300
|
-
AnchoredDelete.create(RangeAnchor.all(rightTraitLocation)),
|
|
301
|
-
// This change will fail if changes for this edit are not included in the reconciliation path
|
|
302
|
-
...AnchoredInsert.create([inserted], PlaceAnchor.before(left)),
|
|
303
|
-
]);
|
|
304
|
-
container.processAllMessages();
|
|
305
|
-
expectChangedTraits(treeA, treeB, { leftTrait: [], rightTrait: [inserted] });
|
|
306
|
-
});
|
|
307
|
-
// These tests cover the scenario that yields different results depending on whether the change application performed on the
|
|
308
|
-
// reconciliation path is itself using anchor resolution
|
|
309
|
-
for (const extraChange of [false, true]) {
|
|
310
|
-
it(`when target place resolution requires resolution of a different place in another edit${extraChange ? ' (with extra change)' : ''}`, () => {
|
|
311
|
-
const { treeA, treeB, container } = setupTrees();
|
|
312
|
-
const { tree: treeC } = setUpTestSharedTreeWithAnchors(Object.assign({ containerRuntimeFactory: container }, thirdTreeOptions));
|
|
313
|
-
treeA.editor.insert(extra, StablePlace.before(right));
|
|
314
|
-
treeA.editor.move(left, StablePlace.before(extra));
|
|
315
|
-
container.processAllMessages();
|
|
316
|
-
// State of right trait: [left, extra, right]
|
|
317
|
-
treeB.editor.move(left, StablePlace.after(extra));
|
|
318
|
-
// State of right trait: [extra, left, right]
|
|
319
|
-
treeB.editor.delete(left);
|
|
320
|
-
// State of right trait: [extra, left-tombstone, right]
|
|
321
|
-
treeC.editor.applyChanges([
|
|
322
|
-
// Will be re-anchored to delete [right] instead of [left, extra, right]
|
|
323
|
-
AnchoredDelete.create(RangeAnchor.from(PlaceAnchor.before(left)).to(StablePlace.atEndOf(rightTraitLocation))),
|
|
324
|
-
// When present, the no-op change after the change of interest to ensures the anchor resolution uses resolved
|
|
325
|
-
// changes in the reconciliation path (or derives them).
|
|
326
|
-
// When not present, the above delete is the only change in the edit so there's a possibility that the anchor
|
|
327
|
-
// resolution would use cached edit results (which reflect the resolved changes) and therefore don't require
|
|
328
|
-
// the actual use of resolved changes.
|
|
329
|
-
// We still want to test without this extra change to ensure that such a possibility, if leveraged, does work
|
|
330
|
-
// properly.
|
|
331
|
-
...(extraChange ? [AnchoredChange.clearPayload(parent.identifier)] : []),
|
|
332
|
-
]);
|
|
333
|
-
// State of right trait: [extra, left-tombstone, right-tombstone]
|
|
334
|
-
treeA.editor.insert(inserted, PlaceAnchor.after(right));
|
|
335
|
-
// State of right trait: [extra, left-tombstone, right-tombstone, inserted]
|
|
336
|
-
// Unless anchor resolution is not performed which case the edit will fail when it tries to apply the
|
|
337
|
-
// "delete everything before left" edit because it will not take into account the resolved location for "before left".
|
|
338
|
-
container.processAllMessages();
|
|
339
|
-
expectChangedTraits(treeA, treeB, { leftTrait: [], rightTrait: [extra, inserted] });
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
});
|
|
344
|
-
/**
|
|
345
|
-
* Runs an insertion test scenario on all possible anchors.
|
|
346
|
-
*/
|
|
347
|
-
function insertTestsWithExtraChanges(outcomeField, concurrentSteps) {
|
|
348
|
-
for (const anchorCase of anchorCases) {
|
|
349
|
-
const outcome = outcomeFromCaseAndField(anchorCase, outcomeField);
|
|
350
|
-
insertTest(anchorCase, outcome, concurrentSteps);
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* Provides the expected outcome for a particular `AnchorCase` instance and scenario (described by its `outcomeField`)
|
|
355
|
-
* This helps reduce cruft in the `AnchorCase` by providing general expectations (e.g., concurrently deleting a node and undoing the
|
|
356
|
-
* deletion is expected, unless otherwise specified, to yield the same outcome as through no concurrent changes were made).
|
|
357
|
-
*/
|
|
358
|
-
function outcomeFromCaseAndField(anchorCase, outcomeField) {
|
|
359
|
-
if (anchorCase[outcomeField] !== undefined) {
|
|
360
|
-
return anchorCase[outcomeField];
|
|
361
|
-
}
|
|
362
|
-
switch (outcomeField) {
|
|
363
|
-
case 'onUndoDelete':
|
|
364
|
-
return outcomeFromCaseAndField(anchorCase, 'onNoConcurrency');
|
|
365
|
-
case 'onUndoRedoDelete':
|
|
366
|
-
return outcomeFromCaseAndField(anchorCase, 'onDelete');
|
|
367
|
-
case 'onTeleport':
|
|
368
|
-
return outcomeFromCaseAndField(anchorCase, 'onMove');
|
|
369
|
-
case 'onDeleteParent':
|
|
370
|
-
return { leftTrait: [], rightTrait: [] };
|
|
371
|
-
default:
|
|
372
|
-
fail('The expected outcome for this case has not been specified');
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
/**
|
|
376
|
-
* Runs the insertion test characterized by the anchor as which to insert, the expected outcome, and the concurrent changes to apply.
|
|
377
|
-
*/
|
|
378
|
-
function insertTest(anchorCase, expected, concurrentSteps) {
|
|
379
|
-
it(anchorCase.name, () => {
|
|
380
|
-
const { tree: treeA, containerRuntimeFactory } = setUpTestSharedTreeWithAnchors(treeOptions);
|
|
381
|
-
const { tree: treeB } = setUpTestSharedTreeWithAnchors(Object.assign({ containerRuntimeFactory }, secondTreeOptions));
|
|
382
|
-
// Sync initial tree
|
|
383
|
-
containerRuntimeFactory.processAllMessages();
|
|
384
|
-
const concurrentChanges = concurrentSteps === undefined
|
|
385
|
-
? []
|
|
386
|
-
: typeof concurrentSteps === 'function'
|
|
387
|
-
? concurrentSteps(treeB, anchorCase)
|
|
388
|
-
: Array.isArray(concurrentSteps)
|
|
389
|
-
? concurrentSteps
|
|
390
|
-
: [concurrentSteps];
|
|
391
|
-
// Perform the concurrent edit(s) to be sequenced first
|
|
392
|
-
if (concurrentSteps) {
|
|
393
|
-
treeB.editor.applyChanges(concurrentChanges);
|
|
394
|
-
}
|
|
395
|
-
// Make the insertion at the anchored place
|
|
396
|
-
treeA.editor.insert(inserted, anchorCase.insertionPlace);
|
|
397
|
-
containerRuntimeFactory.processAllMessages();
|
|
398
|
-
// Test the outcome matches expectations
|
|
399
|
-
expectChangedTraits(treeA, treeB, expected);
|
|
400
|
-
});
|
|
401
|
-
}
|
|
402
|
-
function expectChangedTraits(treeA, treeB, expected) {
|
|
403
|
-
var _a, _b;
|
|
404
|
-
const leftIds = ((_a = expected.leftTrait) !== null && _a !== void 0 ? _a : [left]).map((node) => node.identifier);
|
|
405
|
-
const rightIds = ((_b = expected.rightTrait) !== null && _b !== void 0 ? _b : [right]).map((node) => node.identifier);
|
|
406
|
-
expect(tryGetTrait(treeA, leftTraitLocation)).deep.equal(leftIds);
|
|
407
|
-
expect(tryGetTrait(treeB, leftTraitLocation)).deep.equal(leftIds);
|
|
408
|
-
expect(tryGetTrait(treeA, rightTraitLocation)).deep.equal(rightIds);
|
|
409
|
-
expect(tryGetTrait(treeB, rightTraitLocation)).deep.equal(rightIds);
|
|
410
|
-
}
|
|
411
|
-
function tryGetTrait(tree, location) {
|
|
412
|
-
return tree.currentView.hasNode(location.parent) ? tree.currentView.getTrait(location) : [];
|
|
413
|
-
}
|
|
414
|
-
function setupTrees() {
|
|
415
|
-
const { tree: treeA, containerRuntimeFactory: container } = setUpTestSharedTreeWithAnchors(treeOptions);
|
|
416
|
-
const { tree: treeB } = setUpTestSharedTreeWithAnchors(Object.assign({ containerRuntimeFactory: container }, secondTreeOptions));
|
|
417
|
-
container.processAllMessages();
|
|
418
|
-
return { treeA, treeB, container };
|
|
419
|
-
}
|
|
420
|
-
//# sourceMappingURL=SharedTreeWithAnchors.tests.js.map
|