@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":"SharedTreeWithAnchors.js","sourceRoot":"","sources":["../../src/anchored-edits/SharedTreeWithAnchors.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,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;QAChE,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;YAC3B,OAAO,mCAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;SACtD;QACD,OAAO,+BAAqB,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACzD,CAAC;CACD;AA9DD,sDA8DC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';\nimport { EditId } from '../Identifiers';\nimport { Snapshot } from '../Snapshot';\nimport { Edit, BuildNode, fullHistorySummarizer, GenericSharedTree, NodeData, SharedTreeSummaryBase } from '../generic';\nimport { OrderedEditSet } from '../EditLog';\nimport { noHistorySummarizer, revert } from '../default-edits';\nimport {\n\tAnchoredChange,\n\tAnchoredDelete,\n\tAnchoredInsert,\n\tAnchoredMove,\n\tRangeAnchor,\n\tPlaceAnchor,\n\tNodeAnchor,\n} from './PersistedTypes';\nimport { SharedTreeWithAnchorsFactory, SharedTreeWithAnchorsFactoryNoHistory } from './Factory';\nimport { TransactionWithAnchors } from './TransactionWithAnchors';\n\n/**\n * Wrapper around a `SharedTreeWithAnchorsEditor` which provides ergonomic imperative editing functionality. All methods apply changes in\n * their own edit.\n *\n * @example\n * // The following two lines of code are equivalent:\n * tree.applyEdit(...AnchoredInsert.create([newNode], PlaceAnchor.before(existingNode)));\n * tree.editor.insert(newNode, PlaceAnchor.before(existingNode))\n * @public\n */\nexport class SharedTreeWithAnchorsEditor {\n\tprivate readonly tree: SharedTreeWithAnchors;\n\n\tpublic constructor(tree: SharedTreeWithAnchors) {\n\t\tthis.tree = tree;\n\t}\n\n\t/**\n\t * Inserts a node at a location.\n\t * @param node - Node to insert.\n\t * @param destination - PlaceAnchor at which the insert should take place.\n\t */\n\tpublic insert(node: BuildNode, destination: PlaceAnchor): EditId;\n\t/**\n\t * Inserts nodes at a location.\n\t * @param nodes - Nodes to insert.\n\t * @param destination - PlaceAnchor at which the insert should take place.\n\t */\n\tpublic insert(nodes: BuildNode[], destination: PlaceAnchor): EditId;\n\tpublic insert(nodeOrNodes: BuildNode | BuildNode[], destination: PlaceAnchor): EditId {\n\t\treturn this.tree.applyEdit(\n\t\t\t...AnchoredInsert.create(Array.isArray(nodeOrNodes) ? nodeOrNodes : [nodeOrNodes], destination)\n\t\t);\n\t}\n\n\t/**\n\t * Moves a node to a specified location.\n\t * @param source - Node to move.\n\t * @param destination - PlaceAnchor to which the node should be moved.\n\t */\n\tpublic move(source: NodeData, destination: PlaceAnchor): EditId;\n\t/**\n\t * Moves a node to a specified location.\n\t * @param source - Node to move.\n\t * @param destination - PlaceAnchor to which the node should be moved.\n\t */\n\tpublic move(source: NodeAnchor, destination: PlaceAnchor): EditId;\n\t/**\n\t * Moves a part of a trait to a specified location.\n\t * @param source - Portion of a trait to move.\n\t * @param destination - PlaceAnchor to which the portion of the trait should be moved.\n\t */\n\tpublic move(source: RangeAnchor, destination: PlaceAnchor): EditId;\n\tpublic move(source: NodeData | NodeAnchor | RangeAnchor, destination: PlaceAnchor): EditId {\n\t\tif (!this.isRange(source)) {\n\t\t\treturn this.tree.applyEdit(...AnchoredMove.create(RangeAnchor.only(source), destination));\n\t\t}\n\n\t\treturn this.tree.applyEdit(...AnchoredMove.create(source, destination));\n\t}\n\n\t/**\n\t * Deletes a node.\n\t * @param target - Node to delete\n\t */\n\tpublic delete(target: NodeData): EditId;\n\t/**\n\t * Deletes a node.\n\t * @param target - Node to delete\n\t */\n\tpublic delete(target: NodeAnchor): EditId;\n\t/**\n\t * Deletes a portion of a trait.\n\t * @param target - Range of nodes to delete, specified as a `RangeAnchor`\n\t */\n\tpublic delete(target: RangeAnchor): EditId;\n\tpublic delete(target: NodeData | NodeAnchor | RangeAnchor): EditId {\n\t\tif (!this.isRange(target)) {\n\t\t\treturn this.tree.applyEdit(AnchoredDelete.create(RangeAnchor.only(target)));\n\t\t}\n\n\t\treturn this.tree.applyEdit(AnchoredDelete.create(target));\n\t}\n\n\t/**\n\t * Reverts a previous edit.\n\t * @param edit - the edit to revert\n\t * @param view - the revision to which the edit is applied (not the output of applying edit: it's the one just before that)\n\t */\n\tpublic revert(edit: Edit<AnchoredChange>, view: Snapshot): EditId {\n\t\treturn this.tree.applyEdit(...revert(edit.changes, view));\n\t}\n\n\tpublic applyChanges(changes: readonly AnchoredChange[]): EditId {\n\t\treturn this.tree.applyEdit(...changes);\n\t}\n\n\tprivate isRange(source: NodeData | NodeAnchor | RangeAnchor): source is RangeAnchor {\n\t\treturn (source as RangeAnchor).start !== undefined && (source as RangeAnchor).end !== undefined;\n\t}\n}\n\n/**\n * A distributed tree.\n *\n * Does not currently guarantee convergence among nodes. This is due to the fact that the current summary information is insufficient to\n * ensure that all nodes have access to all the relevant data for the application of a given edit. For example, if edit was sequenced after\n * a given summary but references an edit before that summary then nodes that do not have that earlier edit's information in memory will not\n * have the full context for the application of the change. This currently leads to a \"best effort\" application which takes into account\n * whatever data is available. Remedying this is tracked by #57176.\n *\n * @public\n * @sealed\n */\nexport class SharedTreeWithAnchors extends GenericSharedTree<AnchoredChange> {\n\t/**\n\t * Create a new SharedTreeWithAnchors. It will contain the default value (see initialTree).\n\t */\n\tpublic static create(runtime: IFluidDataStoreRuntime, id?: string): SharedTreeWithAnchors {\n\t\treturn runtime.createChannel(id, SharedTreeWithAnchorsFactory.Type) as SharedTreeWithAnchors;\n\t}\n\n\t/**\n\t * Get a factory for SharedTreeWithAnchors to register with the data store.\n\t * @param historySummarizing - determines how history is summarized by the returned `SharedTreeWithAnchors`.\n\t * @returns A factory that creates `SharedTreeWithAnchors`s and loads them from storage.\n\t */\n\tpublic static getFactory(summarizeHistory = true): SharedTreeWithAnchorsFactory {\n\t\treturn summarizeHistory ? new SharedTreeWithAnchorsFactory() : new SharedTreeWithAnchorsFactoryNoHistory();\n\t}\n\n\t/**\n\t * Create a new SharedTreeFactory.\n\t * @param runtime - The runtime the SharedTreeWithAnchors will be associated with\n\t * @param id - Unique ID for the SharedTreeWithAnchors\n\t * @param expensiveValidation - enable expensive asserts\n\t * @param summarizeHistory - Determines if the history is included in summaries.\n\t */\n\tpublic constructor(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\texpensiveValidation = false,\n\t\tsummarizeHistory = true\n\t) {\n\t\tsuper(\n\t\t\truntime,\n\t\t\tid,\n\t\t\tTransactionWithAnchors.factory,\n\t\t\tSharedTreeWithAnchorsFactory.Attributes,\n\t\t\texpensiveValidation,\n\t\t\tsummarizeHistory\n\t\t);\n\t}\n\n\tprivate _editor: SharedTreeWithAnchorsEditor | undefined;\n\n\t/**\n\t * Returns a `SharedTreeEditor` for editing this tree in an imperative fashion. All edits are performed on the current tree view.\n\t */\n\tpublic get editor(): SharedTreeWithAnchorsEditor {\n\t\tif (!this._editor) {\n\t\t\tthis._editor = new SharedTreeWithAnchorsEditor(this);\n\t\t}\n\n\t\treturn this._editor;\n\t}\n\n\t/**\n\t * {@inheritDoc GenericSharedTree.generateSummary}\n\t */\n\tprotected generateSummary(editLog: OrderedEditSet<AnchoredChange>): SharedTreeSummaryBase {\n\t\tif (!this.summarizeHistory) {\n\t\t\treturn noHistorySummarizer(editLog, this.currentView);\n\t\t}\n\t\treturn fullHistorySummarizer(editLog, this.currentView);\n\t}\n}\n"]}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { NodeId, DetachedSequenceId } from '../Identifiers';
|
|
6
|
-
import { Snapshot } from '../Snapshot';
|
|
7
|
-
import { ReconciliationPath } from '../ReconciliationPath';
|
|
8
|
-
import { Transaction } from '../default-edits';
|
|
9
|
-
import { AnchoredChange } from './PersistedTypes';
|
|
10
|
-
/**
|
|
11
|
-
* A mutable transaction for applying sequences of changes to a Snapshot.
|
|
12
|
-
* Allows viewing the intermediate states.
|
|
13
|
-
*
|
|
14
|
-
* Contains necessary state to apply changes within an edit to a Snapshot.
|
|
15
|
-
*
|
|
16
|
-
* May have any number of changes applied to make up the edit.
|
|
17
|
-
* Use `close` to complete the transaction, returning the array of changes and an EditingResult showing the
|
|
18
|
-
* results of applying the changes as an Edit to the initial Snapshot (passed to the constructor).
|
|
19
|
-
*
|
|
20
|
-
* No data outside the Transaction is modified by Transaction:
|
|
21
|
-
* the results from `close` must be used to actually submit an `Edit`.
|
|
22
|
-
*/
|
|
23
|
-
export declare class TransactionWithAnchors extends Transaction {
|
|
24
|
-
protected readonly detached: Map<DetachedSequenceId, readonly NodeId[]>;
|
|
25
|
-
static factory(snapshot: Snapshot): TransactionWithAnchors;
|
|
26
|
-
protected tryResolveChange(change: AnchoredChange, path: ReconciliationPath<AnchoredChange>): AnchoredChange | undefined;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=TransactionWithAnchors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionWithAnchors.d.ts","sourceRoot":"","sources":["../../src/anchored-edits/TransactionWithAnchors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD;;;;;;;;;;;;GAYG;AACH,qBAAa,sBAAuB,SAAQ,WAAW;IACtD,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC,CAAa;WAEtE,OAAO,CAAC,QAAQ,EAAE,QAAQ,GAAG,sBAAsB;IAIjE,SAAS,CAAC,gBAAgB,CACzB,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,kBAAkB,CAAC,cAAc,CAAC,GACtC,cAAc,GAAG,SAAS;CAG7B"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.TransactionWithAnchors = void 0;
|
|
8
|
-
const default_edits_1 = require("../default-edits");
|
|
9
|
-
const AnchorResolution_1 = require("./AnchorResolution");
|
|
10
|
-
/**
|
|
11
|
-
* A mutable transaction for applying sequences of changes to a Snapshot.
|
|
12
|
-
* Allows viewing the intermediate states.
|
|
13
|
-
*
|
|
14
|
-
* Contains necessary state to apply changes within an edit to a Snapshot.
|
|
15
|
-
*
|
|
16
|
-
* May have any number of changes applied to make up the edit.
|
|
17
|
-
* Use `close` to complete the transaction, returning the array of changes and an EditingResult showing the
|
|
18
|
-
* results of applying the changes as an Edit to the initial Snapshot (passed to the constructor).
|
|
19
|
-
*
|
|
20
|
-
* No data outside the Transaction is modified by Transaction:
|
|
21
|
-
* the results from `close` must be used to actually submit an `Edit`.
|
|
22
|
-
*/
|
|
23
|
-
class TransactionWithAnchors extends default_edits_1.Transaction {
|
|
24
|
-
constructor() {
|
|
25
|
-
super(...arguments);
|
|
26
|
-
this.detached = new Map();
|
|
27
|
-
}
|
|
28
|
-
static factory(snapshot) {
|
|
29
|
-
return new TransactionWithAnchors(snapshot);
|
|
30
|
-
}
|
|
31
|
-
tryResolveChange(change, path) {
|
|
32
|
-
return AnchorResolution_1.resolveChangeAnchors(change, this.view, path);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.TransactionWithAnchors = TransactionWithAnchors;
|
|
36
|
-
//# sourceMappingURL=TransactionWithAnchors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionWithAnchors.js","sourceRoot":"","sources":["../../src/anchored-edits/TransactionWithAnchors.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,oDAA+C;AAE/C,yDAA0D;AAE1D;;;;;;;;;;;;GAYG;AACH,MAAa,sBAAuB,SAAQ,2BAAW;IAAvD;;QACoB,aAAQ,GAA+C,IAAI,GAAG,EAAE,CAAC;IAYrF,CAAC;IAVO,MAAM,CAAC,OAAO,CAAC,QAAkB;QACvC,OAAO,IAAI,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAES,gBAAgB,CACzB,MAAsB,EACtB,IAAwC;QAExC,OAAO,uCAAoB,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;CACD;AAbD,wDAaC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { NodeId, DetachedSequenceId } from '../Identifiers';\nimport { Snapshot } from '../Snapshot';\nimport { ReconciliationPath } from '../ReconciliationPath';\nimport { Transaction } from '../default-edits';\nimport { AnchoredChange } from './PersistedTypes';\nimport { resolveChangeAnchors } from './AnchorResolution';\n\n/**\n * A mutable transaction for applying sequences of changes to a Snapshot.\n * Allows viewing the intermediate states.\n *\n * Contains necessary state to apply changes within an edit to a Snapshot.\n *\n * May have any number of changes applied to make up the edit.\n * Use `close` to complete the transaction, returning the array of changes and an EditingResult showing the\n * results of applying the changes as an Edit to the initial Snapshot (passed to the constructor).\n *\n * No data outside the Transaction is modified by Transaction:\n * the results from `close` must be used to actually submit an `Edit`.\n */\nexport class TransactionWithAnchors extends Transaction {\n\tprotected readonly detached: Map<DetachedSequenceId, readonly NodeId[]> = new Map();\n\n\tpublic static factory(snapshot: Snapshot): TransactionWithAnchors {\n\t\treturn new TransactionWithAnchors(snapshot);\n\t}\n\n\tprotected tryResolveChange(\n\t\tchange: AnchoredChange,\n\t\tpath: ReconciliationPath<AnchoredChange>\n\t): AnchoredChange | undefined {\n\t\treturn resolveChangeAnchors(change, this.view, path);\n\t}\n}\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
export { SharedTreeWithAnchors, SharedTreeWithAnchorsEditor } from './SharedTreeWithAnchors';
|
|
6
|
-
export * from './PersistedTypes';
|
|
7
|
-
export * from './Factory';
|
|
8
|
-
export { TransactionWithAnchors } from './TransactionWithAnchors';
|
|
9
|
-
export { resolveChangeAnchors, findLastOffendingChange, resolveNodeAnchor, resolvePlaceAnchor, resolveRangeAnchor, updateRelativePlaceAnchorForChange, updateRelativePlaceAnchorForPath, EvaluatedChange, } from './AnchorResolution';
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/anchored-edits/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAC7F,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EACN,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kCAAkC,EAClC,gCAAgC,EAChC,eAAe,GACf,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.updateRelativePlaceAnchorForPath = exports.updateRelativePlaceAnchorForChange = exports.resolveRangeAnchor = exports.resolvePlaceAnchor = exports.resolveNodeAnchor = exports.findLastOffendingChange = exports.resolveChangeAnchors = exports.TransactionWithAnchors = exports.SharedTreeWithAnchorsEditor = exports.SharedTreeWithAnchors = void 0;
|
|
18
|
-
// API Exports
|
|
19
|
-
var SharedTreeWithAnchors_1 = require("./SharedTreeWithAnchors");
|
|
20
|
-
Object.defineProperty(exports, "SharedTreeWithAnchors", { enumerable: true, get: function () { return SharedTreeWithAnchors_1.SharedTreeWithAnchors; } });
|
|
21
|
-
Object.defineProperty(exports, "SharedTreeWithAnchorsEditor", { enumerable: true, get: function () { return SharedTreeWithAnchors_1.SharedTreeWithAnchorsEditor; } });
|
|
22
|
-
__exportStar(require("./PersistedTypes"), exports);
|
|
23
|
-
__exportStar(require("./Factory"), exports);
|
|
24
|
-
var TransactionWithAnchors_1 = require("./TransactionWithAnchors");
|
|
25
|
-
Object.defineProperty(exports, "TransactionWithAnchors", { enumerable: true, get: function () { return TransactionWithAnchors_1.TransactionWithAnchors; } });
|
|
26
|
-
var AnchorResolution_1 = require("./AnchorResolution");
|
|
27
|
-
Object.defineProperty(exports, "resolveChangeAnchors", { enumerable: true, get: function () { return AnchorResolution_1.resolveChangeAnchors; } });
|
|
28
|
-
Object.defineProperty(exports, "findLastOffendingChange", { enumerable: true, get: function () { return AnchorResolution_1.findLastOffendingChange; } });
|
|
29
|
-
Object.defineProperty(exports, "resolveNodeAnchor", { enumerable: true, get: function () { return AnchorResolution_1.resolveNodeAnchor; } });
|
|
30
|
-
Object.defineProperty(exports, "resolvePlaceAnchor", { enumerable: true, get: function () { return AnchorResolution_1.resolvePlaceAnchor; } });
|
|
31
|
-
Object.defineProperty(exports, "resolveRangeAnchor", { enumerable: true, get: function () { return AnchorResolution_1.resolveRangeAnchor; } });
|
|
32
|
-
Object.defineProperty(exports, "updateRelativePlaceAnchorForChange", { enumerable: true, get: function () { return AnchorResolution_1.updateRelativePlaceAnchorForChange; } });
|
|
33
|
-
Object.defineProperty(exports, "updateRelativePlaceAnchorForPath", { enumerable: true, get: function () { return AnchorResolution_1.updateRelativePlaceAnchorForPath; } });
|
|
34
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/anchored-edits/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;AAEH,cAAc;AAEd,iEAA6F;AAApF,8HAAA,qBAAqB,OAAA;AAAE,oIAAA,2BAA2B,OAAA;AAC3D,mDAAiC;AACjC,4CAA0B;AAC1B,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAC/B,uDAS4B;AAR3B,wHAAA,oBAAoB,OAAA;AACpB,2HAAA,uBAAuB,OAAA;AACvB,qHAAA,iBAAiB,OAAA;AACjB,sHAAA,kBAAkB,OAAA;AAClB,sHAAA,kBAAkB,OAAA;AAClB,sIAAA,kCAAkC,OAAA;AAClC,oIAAA,gCAAgC,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// API Exports\n\nexport { SharedTreeWithAnchors, SharedTreeWithAnchorsEditor } from './SharedTreeWithAnchors';\nexport * from './PersistedTypes';\nexport * from './Factory';\nexport { TransactionWithAnchors } from './TransactionWithAnchors';\nexport {\n\tresolveChangeAnchors,\n\tfindLastOffendingChange,\n\tresolveNodeAnchor,\n\tresolvePlaceAnchor,\n\tresolveRangeAnchor,\n\tupdateRelativePlaceAnchorForChange,\n\tupdateRelativePlaceAnchorForPath,\n\tEvaluatedChange,\n} from './AnchorResolution';\n"]}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { DetachedSequenceId, NodeId } from '../Identifiers';
|
|
6
|
-
import { Snapshot, SnapshotPlace, SnapshotRange } from '../Snapshot';
|
|
7
|
-
import { EditValidationResult } from '../Checkout';
|
|
8
|
-
import { BuildNode, TraitLocation, TreeNodeSequence } from '../generic';
|
|
9
|
-
import { Change, StablePlace, StableRange } from './PersistedTypes';
|
|
10
|
-
/**
|
|
11
|
-
* Functions for constructing edits.
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* Create a sequence of changes that resets the contents of `trait`.
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
17
|
-
export declare function setTrait(trait: TraitLocation, nodes: TreeNodeSequence<BuildNode>): readonly Change[];
|
|
18
|
-
/**
|
|
19
|
-
* Check the validity of the given `StablePlace`
|
|
20
|
-
* @param snapshot - the `Snapshot` within which to validate the given place
|
|
21
|
-
* @param place - the `StablePlace` to check
|
|
22
|
-
*/
|
|
23
|
-
export declare function validateStablePlace(snapshot: Snapshot, place: StablePlace): EditValidationResult;
|
|
24
|
-
/**
|
|
25
|
-
* Check the validity of the given `StableRange`
|
|
26
|
-
* @param snapshot - the `Snapshot` within which to validate the given range
|
|
27
|
-
* @param range - the `StableRange` to check
|
|
28
|
-
*/
|
|
29
|
-
export declare function validateStableRange(snapshot: Snapshot, range: StableRange): EditValidationResult;
|
|
30
|
-
/**
|
|
31
|
-
* Express the given `StableRange` as a `Range`
|
|
32
|
-
*/
|
|
33
|
-
export declare function rangeFromStableRange(snapshot: Snapshot, range: StableRange): SnapshotRange;
|
|
34
|
-
/**
|
|
35
|
-
* Express the given `StablePlace` as a `Place`
|
|
36
|
-
*/
|
|
37
|
-
export declare function placeFromStablePlace(snapshot: Snapshot, stablePlace: StablePlace): SnapshotPlace;
|
|
38
|
-
/**
|
|
39
|
-
* Parents a set of nodes in a specified location within a trait.
|
|
40
|
-
* @param nodesToInsert - the nodes to parent in the specified place. The nodes must already be present in the Snapshot.
|
|
41
|
-
* @param placeToInsert - the location to insert the nodes.
|
|
42
|
-
*/
|
|
43
|
-
export declare function insertIntoTrait(snapshot: Snapshot, nodesToInsert: readonly NodeId[], placeToInsert: StablePlace): Snapshot;
|
|
44
|
-
/**
|
|
45
|
-
* Detaches a range of nodes from their parent. The detached nodes remain in the Snapshot.
|
|
46
|
-
* @param rangeToDetach - the range of nodes to detach
|
|
47
|
-
*/
|
|
48
|
-
export declare function detachRange(snapshot: Snapshot, rangeToDetach: StableRange): {
|
|
49
|
-
snapshot: Snapshot;
|
|
50
|
-
detached: readonly NodeId[];
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Determine if an BuildNode is a DetachedSequenceId.
|
|
54
|
-
* @internal
|
|
55
|
-
*/
|
|
56
|
-
export declare function isDetachedSequenceId(node: BuildNode): node is DetachedSequenceId;
|
|
57
|
-
//# sourceMappingURL=EditUtilities.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EditUtilities.d.ts","sourceRoot":"","sources":["../../src/default-edits/EditUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAErE,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC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contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.isDetachedSequenceId = exports.detachRange = exports.insertIntoTrait = exports.placeFromStablePlace = exports.rangeFromStableRange = exports.validateStableRange = exports.validateStablePlace = exports.setTrait = void 0;
|
|
8
|
-
const Common_1 = require("../Common");
|
|
9
|
-
const Checkout_1 = require("../Checkout");
|
|
10
|
-
const PersistedTypes_1 = require("./PersistedTypes");
|
|
11
|
-
/**
|
|
12
|
-
* Functions for constructing edits.
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* Create a sequence of changes that resets the contents of `trait`.
|
|
16
|
-
* @public
|
|
17
|
-
*/
|
|
18
|
-
function setTrait(trait, nodes) {
|
|
19
|
-
const id = 0;
|
|
20
|
-
const traitContents = PersistedTypes_1.StableRange.all(trait);
|
|
21
|
-
return [PersistedTypes_1.Change.detach(traitContents), PersistedTypes_1.Change.build(nodes, id), PersistedTypes_1.Change.insert(id, traitContents.start)];
|
|
22
|
-
}
|
|
23
|
-
exports.setTrait = setTrait;
|
|
24
|
-
/**
|
|
25
|
-
* Check the validity of the given `StablePlace`
|
|
26
|
-
* @param snapshot - the `Snapshot` within which to validate the given place
|
|
27
|
-
* @param place - the `StablePlace` to check
|
|
28
|
-
*/
|
|
29
|
-
function validateStablePlace(snapshot, place) {
|
|
30
|
-
/* A StablePlace is valid if the following conditions are met:
|
|
31
|
-
* 1. A sibling or trait is defined.
|
|
32
|
-
* 2. If a sibling is defined, both it and its parent exist in the `Snapshot`.
|
|
33
|
-
* 3. If a trait is defined, its parent node exists in the `Snapshot`.
|
|
34
|
-
* 4. If a sibling and a trait location are both specified, the sibling needs to actually be in that trait.
|
|
35
|
-
*/
|
|
36
|
-
const { referenceSibling, referenceTrait } = place;
|
|
37
|
-
// A well-formed `StablePlace` specifies exactly one of `referenceSibling` and `referenceTrait`.
|
|
38
|
-
if ((referenceSibling === undefined && referenceTrait === undefined) ||
|
|
39
|
-
(referenceSibling !== undefined && referenceTrait !== undefined)) {
|
|
40
|
-
return Checkout_1.EditValidationResult.Malformed;
|
|
41
|
-
}
|
|
42
|
-
if (referenceSibling !== undefined) {
|
|
43
|
-
if (!snapshot.hasNode(referenceSibling)) {
|
|
44
|
-
return Checkout_1.EditValidationResult.Invalid;
|
|
45
|
-
}
|
|
46
|
-
// Detached nodes and the root are invalid anchors.
|
|
47
|
-
if (snapshot.getTraitLabel(referenceSibling) === undefined) {
|
|
48
|
-
return Checkout_1.EditValidationResult.Invalid;
|
|
49
|
-
}
|
|
50
|
-
return Checkout_1.EditValidationResult.Valid;
|
|
51
|
-
}
|
|
52
|
-
if (!snapshot.hasNode(Common_1.assertNotUndefined(referenceTrait).parent)) {
|
|
53
|
-
return Checkout_1.EditValidationResult.Invalid;
|
|
54
|
-
}
|
|
55
|
-
return Checkout_1.EditValidationResult.Valid;
|
|
56
|
-
}
|
|
57
|
-
exports.validateStablePlace = validateStablePlace;
|
|
58
|
-
/**
|
|
59
|
-
* Check the validity of the given `StableRange`
|
|
60
|
-
* @param snapshot - the `Snapshot` within which to validate the given range
|
|
61
|
-
* @param range - the `StableRange` to check
|
|
62
|
-
*/
|
|
63
|
-
function validateStableRange(snapshot, range) {
|
|
64
|
-
/* A StableRange is valid if the following conditions are met:
|
|
65
|
-
* 1. Its start and end places are valid.
|
|
66
|
-
* 2. Its start and end places are within the same trait.
|
|
67
|
-
* 3. Its start place is before its end place.
|
|
68
|
-
*/
|
|
69
|
-
const { start, end } = range;
|
|
70
|
-
const startValidationResult = validateStablePlace(snapshot, start);
|
|
71
|
-
if (startValidationResult !== Checkout_1.EditValidationResult.Valid) {
|
|
72
|
-
return startValidationResult;
|
|
73
|
-
}
|
|
74
|
-
const endValidationResult = validateStablePlace(snapshot, end);
|
|
75
|
-
if (endValidationResult !== Checkout_1.EditValidationResult.Valid) {
|
|
76
|
-
return endValidationResult;
|
|
77
|
-
}
|
|
78
|
-
const startTraitLocation = start.referenceTrait || snapshot.getTraitLocation(Common_1.assertNotUndefined(start.referenceSibling));
|
|
79
|
-
const endTraitLocation = end.referenceTrait || snapshot.getTraitLocation(Common_1.assertNotUndefined(end.referenceSibling));
|
|
80
|
-
if (!compareTraits(startTraitLocation, endTraitLocation)) {
|
|
81
|
-
return Checkout_1.EditValidationResult.Invalid;
|
|
82
|
-
}
|
|
83
|
-
const { start: startPlace, end: endPlace } = rangeFromStableRange(snapshot, range);
|
|
84
|
-
const startIndex = snapshot.findIndexWithinTrait(startPlace);
|
|
85
|
-
const endIndex = snapshot.findIndexWithinTrait(endPlace);
|
|
86
|
-
if (startIndex > endIndex) {
|
|
87
|
-
return Checkout_1.EditValidationResult.Invalid;
|
|
88
|
-
}
|
|
89
|
-
return Checkout_1.EditValidationResult.Valid;
|
|
90
|
-
}
|
|
91
|
-
exports.validateStableRange = validateStableRange;
|
|
92
|
-
/**
|
|
93
|
-
* @param snapshot - the `Snapshot` within which to retrieve the trait location
|
|
94
|
-
* @param range - must be well formed and valid
|
|
95
|
-
*/
|
|
96
|
-
function getTraitLocationOfRange(snapshot, range) {
|
|
97
|
-
var _a, _b, _c;
|
|
98
|
-
const referenceTrait = (_a = range.start.referenceTrait) !== null && _a !== void 0 ? _a : range.end.referenceTrait;
|
|
99
|
-
if (referenceTrait) {
|
|
100
|
-
return referenceTrait;
|
|
101
|
-
}
|
|
102
|
-
const sibling = (_c = (_b = range.start.referenceSibling) !== null && _b !== void 0 ? _b : range.end.referenceSibling) !== null && _c !== void 0 ? _c : Common_1.fail('malformed range does not indicate trait');
|
|
103
|
-
return snapshot.getTraitLocation(sibling);
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Describes the side of a range.
|
|
107
|
-
*/
|
|
108
|
-
var SideOfRange;
|
|
109
|
-
(function (SideOfRange) {
|
|
110
|
-
/**
|
|
111
|
-
* The start of the range
|
|
112
|
-
*/
|
|
113
|
-
SideOfRange[SideOfRange["Start"] = 0] = "Start";
|
|
114
|
-
/**
|
|
115
|
-
* The end of the range
|
|
116
|
-
*/
|
|
117
|
-
SideOfRange[SideOfRange["End"] = 1] = "End";
|
|
118
|
-
})(SideOfRange || (SideOfRange = {}));
|
|
119
|
-
function sideOfRange(range, sideOfRange, trait) {
|
|
120
|
-
const siblingRelative = sideOfRange === SideOfRange.Start ? range.start : range.end;
|
|
121
|
-
return {
|
|
122
|
-
trait,
|
|
123
|
-
side: siblingRelative.side,
|
|
124
|
-
sibling: siblingRelative.referenceSibling,
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Express the given `StableRange` as a `Range`
|
|
129
|
-
*/
|
|
130
|
-
function rangeFromStableRange(snapshot, range) {
|
|
131
|
-
const location = getTraitLocationOfRange(snapshot, range);
|
|
132
|
-
// This can be optimized for better constant factors.
|
|
133
|
-
return {
|
|
134
|
-
start: sideOfRange(range, SideOfRange.Start, location),
|
|
135
|
-
end: sideOfRange(range, SideOfRange.End, location),
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
exports.rangeFromStableRange = rangeFromStableRange;
|
|
139
|
-
/**
|
|
140
|
-
* Express the given `StablePlace` as a `Place`
|
|
141
|
-
*/
|
|
142
|
-
function placeFromStablePlace(snapshot, stablePlace) {
|
|
143
|
-
const { side } = stablePlace;
|
|
144
|
-
if (stablePlace.referenceSibling === undefined) {
|
|
145
|
-
Common_1.assert(stablePlace.referenceTrait !== undefined);
|
|
146
|
-
return {
|
|
147
|
-
trait: stablePlace.referenceTrait,
|
|
148
|
-
side,
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
return {
|
|
152
|
-
trait: snapshot.getTraitLocation(stablePlace.referenceSibling),
|
|
153
|
-
side: stablePlace.side,
|
|
154
|
-
sibling: stablePlace.referenceSibling,
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
exports.placeFromStablePlace = placeFromStablePlace;
|
|
158
|
-
/**
|
|
159
|
-
* Check if two TraitLocations are equal.
|
|
160
|
-
*/
|
|
161
|
-
function compareTraits(traitA, traitB) {
|
|
162
|
-
if (traitA.label !== traitB.label || traitA.parent !== traitB.parent) {
|
|
163
|
-
return false;
|
|
164
|
-
}
|
|
165
|
-
return true;
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Parents a set of nodes in a specified location within a trait.
|
|
169
|
-
* @param nodesToInsert - the nodes to parent in the specified place. The nodes must already be present in the Snapshot.
|
|
170
|
-
* @param placeToInsert - the location to insert the nodes.
|
|
171
|
-
*/
|
|
172
|
-
function insertIntoTrait(snapshot, nodesToInsert, placeToInsert) {
|
|
173
|
-
return snapshot.attachRange(nodesToInsert, placeFromStablePlace(snapshot, placeToInsert));
|
|
174
|
-
}
|
|
175
|
-
exports.insertIntoTrait = insertIntoTrait;
|
|
176
|
-
/**
|
|
177
|
-
* Detaches a range of nodes from their parent. The detached nodes remain in the Snapshot.
|
|
178
|
-
* @param rangeToDetach - the range of nodes to detach
|
|
179
|
-
*/
|
|
180
|
-
function detachRange(snapshot, rangeToDetach) {
|
|
181
|
-
return snapshot.detachRange(rangeFromStableRange(snapshot, rangeToDetach));
|
|
182
|
-
}
|
|
183
|
-
exports.detachRange = detachRange;
|
|
184
|
-
/**
|
|
185
|
-
* Determine if an BuildNode is a DetachedSequenceId.
|
|
186
|
-
* @internal
|
|
187
|
-
*/
|
|
188
|
-
function isDetachedSequenceId(node) {
|
|
189
|
-
return typeof node !== 'object';
|
|
190
|
-
}
|
|
191
|
-
exports.isDetachedSequenceId = isDetachedSequenceId;
|
|
192
|
-
//# sourceMappingURL=EditUtilities.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EditUtilities.js","sourceRoot":"","sources":["../../src/default-edits/EditUtilities.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,sCAA6D;AAC7D,0CAAmD;AAEnD,qDAAoE;AAEpE;;GAEG;AAEH;;;GAGG;AACH,SAAgB,QAAQ,CAAC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IT License.\n */\n\nimport { DetachedSequenceId, NodeId } from '../Identifiers';\nimport { Snapshot, SnapshotPlace, SnapshotRange } from '../Snapshot';\nimport { assert, assertNotUndefined, fail } from '../Common';\nimport { EditValidationResult } from '../Checkout';\nimport { BuildNode, TraitLocation, TreeNodeSequence } from '../generic';\nimport { Change, StablePlace, StableRange } from './PersistedTypes';\n\n/**\n * Functions for constructing edits.\n */\n\n/**\n * Create a sequence of changes that resets the contents of `trait`.\n * @public\n */\nexport function setTrait(trait: TraitLocation, nodes: TreeNodeSequence<BuildNode>): readonly Change[] {\n\tconst id = 0 as DetachedSequenceId;\n\tconst traitContents = StableRange.all(trait);\n\n\treturn [Change.detach(traitContents), Change.build(nodes, id), Change.insert(id, traitContents.start)];\n}\n\n/**\n * Check the validity of the given `StablePlace`\n * @param snapshot - the `Snapshot` within which to validate the given place\n * @param place - the `StablePlace` to check\n */\nexport function validateStablePlace(snapshot: Snapshot, place: StablePlace): EditValidationResult {\n\t/* A StablePlace is valid if the following conditions are met:\n\t * 1. A sibling or trait is defined.\n\t * 2. If a sibling is defined, both it and its parent exist in the `Snapshot`.\n\t * 3. If a trait is defined, its parent node exists in the `Snapshot`.\n\t * 4. If a sibling and a trait location are both specified, the sibling needs to actually be in that trait.\n\t */\n\tconst { referenceSibling, referenceTrait } = place;\n\n\t// A well-formed `StablePlace` specifies exactly one of `referenceSibling` and `referenceTrait`.\n\tif (\n\t\t(referenceSibling === undefined && referenceTrait === undefined) ||\n\t\t(referenceSibling !== undefined && referenceTrait !== undefined)\n\t) {\n\t\treturn EditValidationResult.Malformed;\n\t}\n\n\tif (referenceSibling !== undefined) {\n\t\tif (!snapshot.hasNode(referenceSibling)) {\n\t\t\treturn EditValidationResult.Invalid;\n\t\t}\n\n\t\t// Detached nodes and the root are invalid anchors.\n\t\tif (snapshot.getTraitLabel(referenceSibling) === undefined) {\n\t\t\treturn EditValidationResult.Invalid;\n\t\t}\n\n\t\treturn EditValidationResult.Valid;\n\t}\n\n\tif (!snapshot.hasNode(assertNotUndefined(referenceTrait).parent)) {\n\t\treturn EditValidationResult.Invalid;\n\t}\n\n\treturn EditValidationResult.Valid;\n}\n\n/**\n * Check the validity of the given `StableRange`\n * @param snapshot - the `Snapshot` within which to validate the given range\n * @param range - the `StableRange` to check\n */\nexport function validateStableRange(snapshot: Snapshot, range: StableRange): EditValidationResult {\n\t/* A StableRange is valid if the following conditions are met:\n\t * 1. Its start and end places are valid.\n\t * 2. Its start and end places are within the same trait.\n\t * 3. Its start place is before its end place.\n\t */\n\tconst { start, end } = range;\n\n\tconst startValidationResult = validateStablePlace(snapshot, start);\n\tif (startValidationResult !== EditValidationResult.Valid) {\n\t\treturn startValidationResult;\n\t}\n\n\tconst endValidationResult = validateStablePlace(snapshot, end);\n\tif (endValidationResult !== EditValidationResult.Valid) {\n\t\treturn endValidationResult;\n\t}\n\n\tconst startTraitLocation =\n\t\tstart.referenceTrait || snapshot.getTraitLocation(assertNotUndefined(start.referenceSibling));\n\tconst endTraitLocation = end.referenceTrait || snapshot.getTraitLocation(assertNotUndefined(end.referenceSibling));\n\tif (!compareTraits(startTraitLocation, endTraitLocation)) {\n\t\treturn EditValidationResult.Invalid;\n\t}\n\n\tconst { start: startPlace, end: endPlace } = rangeFromStableRange(snapshot, range);\n\tconst startIndex = snapshot.findIndexWithinTrait(startPlace);\n\tconst endIndex = snapshot.findIndexWithinTrait(endPlace);\n\n\tif (startIndex > endIndex) {\n\t\treturn EditValidationResult.Invalid;\n\t}\n\n\treturn EditValidationResult.Valid;\n}\n\n/**\n * @param snapshot - the `Snapshot` within which to retrieve the trait location\n * @param range - must be well formed and valid\n */\nfunction getTraitLocationOfRange(snapshot: Snapshot, range: StableRange): TraitLocation {\n\tconst referenceTrait = range.start.referenceTrait ?? range.end.referenceTrait;\n\tif (referenceTrait) {\n\t\treturn referenceTrait;\n\t}\n\tconst sibling =\n\t\trange.start.referenceSibling ?? range.end.referenceSibling ?? fail('malformed range does not indicate trait');\n\treturn snapshot.getTraitLocation(sibling);\n}\n\n/**\n * Describes the side of a range.\n */\nenum SideOfRange {\n\t/**\n\t * The start of the range\n\t */\n\tStart = 0,\n\t/**\n\t * The end of the range\n\t */\n\tEnd = 1,\n}\n\nfunction sideOfRange(range: StableRange, sideOfRange: SideOfRange, trait: TraitLocation): SnapshotPlace {\n\tconst siblingRelative = sideOfRange === SideOfRange.Start ? range.start : range.end;\n\treturn {\n\t\ttrait,\n\t\tside: siblingRelative.side,\n\t\tsibling: siblingRelative.referenceSibling,\n\t};\n}\n\n/**\n * Express the given `StableRange` as a `Range`\n */\nexport function rangeFromStableRange(snapshot: Snapshot, range: StableRange): SnapshotRange {\n\tconst location = getTraitLocationOfRange(snapshot, range);\n\t// This can be optimized for better constant factors.\n\treturn {\n\t\tstart: sideOfRange(range, SideOfRange.Start, location),\n\t\tend: sideOfRange(range, SideOfRange.End, location),\n\t};\n}\n\n/**\n * Express the given `StablePlace` as a `Place`\n */\nexport function placeFromStablePlace(snapshot: Snapshot, stablePlace: StablePlace): SnapshotPlace {\n\tconst { side } = stablePlace;\n\tif (stablePlace.referenceSibling === undefined) {\n\t\tassert(stablePlace.referenceTrait !== undefined);\n\t\treturn {\n\t\t\ttrait: stablePlace.referenceTrait,\n\t\t\tside,\n\t\t};\n\t}\n\treturn {\n\t\ttrait: snapshot.getTraitLocation(stablePlace.referenceSibling),\n\t\tside: stablePlace.side,\n\t\tsibling: stablePlace.referenceSibling,\n\t};\n}\n\n/**\n * Check if two TraitLocations are equal.\n */\nfunction compareTraits(traitA: TraitLocation, traitB: TraitLocation): boolean {\n\tif (traitA.label !== traitB.label || traitA.parent !== traitB.parent) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n/**\n * Parents a set of nodes in a specified location within a trait.\n * @param nodesToInsert - the nodes to parent in the specified place. The nodes must already be present in the Snapshot.\n * @param placeToInsert - the location to insert the nodes.\n */\nexport function insertIntoTrait(\n\tsnapshot: Snapshot,\n\tnodesToInsert: readonly NodeId[],\n\tplaceToInsert: StablePlace\n): Snapshot {\n\treturn snapshot.attachRange(nodesToInsert, placeFromStablePlace(snapshot, placeToInsert));\n}\n\n/**\n * Detaches a range of nodes from their parent. The detached nodes remain in the Snapshot.\n * @param rangeToDetach - the range of nodes to detach\n */\nexport function detachRange(\n\tsnapshot: Snapshot,\n\trangeToDetach: StableRange\n): { snapshot: Snapshot; detached: readonly NodeId[] } {\n\treturn snapshot.detachRange(rangeFromStableRange(snapshot, rangeToDetach));\n}\n\n/**\n * Determine if an BuildNode is a DetachedSequenceId.\n * @internal\n */\nexport function isDetachedSequenceId(node: BuildNode): node is DetachedSequenceId {\n\treturn typeof node !== 'object';\n}\n"]}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { IChannelAttributes, IFluidDataStoreRuntime, IChannelServices, IChannelFactory } from '@fluidframework/datastore-definitions';
|
|
6
|
-
import { ISharedObject } from '@fluidframework/shared-object-base';
|
|
7
|
-
import { SharedTree } from './SharedTree';
|
|
8
|
-
/**
|
|
9
|
-
* Factory for SharedTree.
|
|
10
|
-
* Includes history in the summary.
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
13
|
-
export declare class SharedTreeFactory implements IChannelFactory {
|
|
14
|
-
/**
|
|
15
|
-
* {@inheritDoc @fluidframework/shared-object-base#ISharedObjectFactory."type"}
|
|
16
|
-
*/
|
|
17
|
-
static Type: string;
|
|
18
|
-
/**
|
|
19
|
-
* {@inheritDoc @fluidframework/shared-object-base#ISharedObjectFactory.attributes}
|
|
20
|
-
*/
|
|
21
|
-
static Attributes: IChannelAttributes;
|
|
22
|
-
/**
|
|
23
|
-
* {@inheritDoc @fluidframework/shared-object-base#ISharedObjectFactory."type"}
|
|
24
|
-
*/
|
|
25
|
-
get type(): string;
|
|
26
|
-
/**
|
|
27
|
-
* {@inheritDoc @fluidframework/shared-object-base#ISharedObjectFactory.attributes}
|
|
28
|
-
*/
|
|
29
|
-
get attributes(): IChannelAttributes;
|
|
30
|
-
/**
|
|
31
|
-
* {@inheritDoc @fluidframework/shared-object-base#ISharedObjectFactory.load}
|
|
32
|
-
*/
|
|
33
|
-
load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, _channelAttributes: Readonly<IChannelAttributes>): Promise<ISharedObject>;
|
|
34
|
-
/**
|
|
35
|
-
* Create a new SharedTree.
|
|
36
|
-
* @param runtime - data store runtime that owns the new SharedTree
|
|
37
|
-
* @param id - optional name for the SharedTree
|
|
38
|
-
*/
|
|
39
|
-
create(runtime: IFluidDataStoreRuntime, id: string, expensiveValidation?: boolean): SharedTree;
|
|
40
|
-
/**
|
|
41
|
-
* Determines how the SharedTree will summarize the history.
|
|
42
|
-
* This is a workaround for lacking the ability to construct DDSs with custom parameters.
|
|
43
|
-
*/
|
|
44
|
-
protected includeHistoryInSummary(): boolean;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Factory for SharedTree.
|
|
48
|
-
* Does not include the history in the summary.
|
|
49
|
-
* This is a workaround for lacking the ability to construct DDSs with custom parameters.
|
|
50
|
-
* TODO:#54918: Clean up when DDS parameterization is supported.
|
|
51
|
-
* @public
|
|
52
|
-
*/
|
|
53
|
-
export declare class SharedTreeFactoryNoHistory extends SharedTreeFactory {
|
|
54
|
-
protected includeHistoryInSummary(): boolean;
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=Factory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Factory.d.ts","sourceRoot":"","sources":["../../src/default-edits/Factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;;GAIG;AACH,qBAAa,iBAAkB,YAAW,eAAe;IACxD;;OAEG;IACH,OAAc,IAAI,SAAgB;IAElC;;OAEG;IACH,OAAc,UAAU,EAAE,kBAAkB,CAI1C;IAEF;;OAEG;IACH,IAAW,IAAI,IAAI,MAAM,CAExB;IAED;;OAEG;IACH,IAAW,UAAU,IAAI,kBAAkB,CAE1C;IAED;;OAEG;IACU,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB,CAAC,GAC9C,OAAO,CAAC,aAAa,CAAC;IAMzB;;;;OAIG;IACI,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,EAAE,mBAAmB,CAAC,EAAE,OAAO,GAAG,UAAU;IAMrG;;;OAGG;IACH,SAAS,CAAC,uBAAuB,IAAI,OAAO;CAG5C;AAED;;;;;;GAMG;AACH,qBAAa,0BAA2B,SAAQ,iBAAiB;IAChE,SAAS,CAAC,uBAAuB,IAAI,OAAO;CAG5C"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.SharedTreeFactoryNoHistory = exports.SharedTreeFactory = void 0;
|
|
8
|
-
const SharedTree_1 = require("./SharedTree");
|
|
9
|
-
/**
|
|
10
|
-
* Factory for SharedTree.
|
|
11
|
-
* Includes history in the summary.
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
14
|
-
class SharedTreeFactory {
|
|
15
|
-
/**
|
|
16
|
-
* {@inheritDoc @fluidframework/shared-object-base#ISharedObjectFactory."type"}
|
|
17
|
-
*/
|
|
18
|
-
get type() {
|
|
19
|
-
return SharedTreeFactory.Type;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* {@inheritDoc @fluidframework/shared-object-base#ISharedObjectFactory.attributes}
|
|
23
|
-
*/
|
|
24
|
-
get attributes() {
|
|
25
|
-
return SharedTreeFactory.Attributes;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* {@inheritDoc @fluidframework/shared-object-base#ISharedObjectFactory.load}
|
|
29
|
-
*/
|
|
30
|
-
async load(runtime, id, services, _channelAttributes) {
|
|
31
|
-
const sharedTree = new SharedTree_1.SharedTree(runtime, id);
|
|
32
|
-
await sharedTree.load(services);
|
|
33
|
-
return sharedTree;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Create a new SharedTree.
|
|
37
|
-
* @param runtime - data store runtime that owns the new SharedTree
|
|
38
|
-
* @param id - optional name for the SharedTree
|
|
39
|
-
*/
|
|
40
|
-
create(runtime, id, expensiveValidation) {
|
|
41
|
-
const sharedTree = new SharedTree_1.SharedTree(runtime, id, expensiveValidation, this.includeHistoryInSummary());
|
|
42
|
-
sharedTree.initializeLocal();
|
|
43
|
-
return sharedTree;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Determines how the SharedTree will summarize the history.
|
|
47
|
-
* This is a workaround for lacking the ability to construct DDSs with custom parameters.
|
|
48
|
-
*/
|
|
49
|
-
includeHistoryInSummary() {
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
exports.SharedTreeFactory = SharedTreeFactory;
|
|
54
|
-
/**
|
|
55
|
-
* {@inheritDoc @fluidframework/shared-object-base#ISharedObjectFactory."type"}
|
|
56
|
-
*/
|
|
57
|
-
SharedTreeFactory.Type = 'SharedTree';
|
|
58
|
-
/**
|
|
59
|
-
* {@inheritDoc @fluidframework/shared-object-base#ISharedObjectFactory.attributes}
|
|
60
|
-
*/
|
|
61
|
-
SharedTreeFactory.Attributes = {
|
|
62
|
-
type: SharedTreeFactory.Type,
|
|
63
|
-
snapshotFormatVersion: '0.1',
|
|
64
|
-
packageVersion: '0.1',
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Factory for SharedTree.
|
|
68
|
-
* Does not include the history in the summary.
|
|
69
|
-
* This is a workaround for lacking the ability to construct DDSs with custom parameters.
|
|
70
|
-
* TODO:#54918: Clean up when DDS parameterization is supported.
|
|
71
|
-
* @public
|
|
72
|
-
*/
|
|
73
|
-
class SharedTreeFactoryNoHistory extends SharedTreeFactory {
|
|
74
|
-
includeHistoryInSummary() {
|
|
75
|
-
return false;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
exports.SharedTreeFactoryNoHistory = SharedTreeFactoryNoHistory;
|
|
79
|
-
//# sourceMappingURL=Factory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Factory.js","sourceRoot":"","sources":["../../src/default-edits/Factory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,6CAA0C;AAE1C;;;;GAIG;AACH,MAAa,iBAAiB;IAe7B;;OAEG;IACH,IAAW,IAAI;QACd,OAAO,iBAAiB,CAAC,IAAI,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACpB,OAAO,iBAAiB,CAAC,UAAU,CAAC;IACrC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,kBAAgD;QAEhD,MAAM,UAAU,GAAG,IAAI,uBAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAC/C,MAAM,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChC,OAAO,UAAU,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,OAA+B,EAAE,EAAU,EAAE,mBAA6B;QACvF,MAAM,UAAU,GAAG,IAAI,uBAAU,CAAC,OAAO,EAAE,EAAE,EAAE,mBAAmB,EAAE,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC;QACpG,UAAU,CAAC,eAAe,EAAE,CAAC;QAC7B,OAAO,UAAU,CAAC;IACnB,CAAC;IAED;;;OAGG;IACO,uBAAuB;QAChC,OAAO,IAAI,CAAC;IACb,CAAC;;AA5DF,8CA6DC;AA5DA;;GAEG;AACW,sBAAI,GAAG,YAAY,CAAC;AAElC;;GAEG;AACW,4BAAU,GAAuB;IAC9C,IAAI,EAAE,iBAAiB,CAAC,IAAI;IAC5B,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,KAAK;CACrB,CAAC;AAkDH;;;;;;GAMG;AACH,MAAa,0BAA2B,SAAQ,iBAAiB;IACtD,uBAAuB;QAChC,OAAO,KAAK,CAAC;IACd,CAAC;CACD;AAJD,gEAIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n\tIChannelFactory,\n} from '@fluidframework/datastore-definitions';\nimport { ISharedObject } from '@fluidframework/shared-object-base';\nimport { SharedTree } from './SharedTree';\n\n/**\n * Factory for SharedTree.\n * Includes history in the summary.\n * @public\n */\nexport class SharedTreeFactory implements IChannelFactory {\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#ISharedObjectFactory.\"type\"}\n\t */\n\tpublic static Type = 'SharedTree';\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#ISharedObjectFactory.attributes}\n\t */\n\tpublic static Attributes: IChannelAttributes = {\n\t\ttype: SharedTreeFactory.Type,\n\t\tsnapshotFormatVersion: '0.1',\n\t\tpackageVersion: '0.1',\n\t};\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#ISharedObjectFactory.\"type\"}\n\t */\n\tpublic get type(): string {\n\t\treturn SharedTreeFactory.Type;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#ISharedObjectFactory.attributes}\n\t */\n\tpublic get attributes(): IChannelAttributes {\n\t\treturn SharedTreeFactory.Attributes;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#ISharedObjectFactory.load}\n\t */\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\t_channelAttributes: Readonly<IChannelAttributes>\n\t): Promise<ISharedObject> {\n\t\tconst sharedTree = new SharedTree(runtime, id);\n\t\tawait sharedTree.load(services);\n\t\treturn sharedTree;\n\t}\n\n\t/**\n\t * Create a new SharedTree.\n\t * @param runtime - data store runtime that owns the new SharedTree\n\t * @param id - optional name for the SharedTree\n\t */\n\tpublic create(runtime: IFluidDataStoreRuntime, id: string, expensiveValidation?: boolean): SharedTree {\n\t\tconst sharedTree = new SharedTree(runtime, id, expensiveValidation, this.includeHistoryInSummary());\n\t\tsharedTree.initializeLocal();\n\t\treturn sharedTree;\n\t}\n\n\t/**\n\t * Determines how the SharedTree will summarize the history.\n\t * This is a workaround for lacking the ability to construct DDSs with custom parameters.\n\t */\n\tprotected includeHistoryInSummary(): boolean {\n\t\treturn true;\n\t}\n}\n\n/**\n * Factory for SharedTree.\n * Does not include the history in the summary.\n * This is a workaround for lacking the ability to construct DDSs with custom parameters.\n * TODO:#54918: Clean up when DDS parameterization is supported.\n * @public\n */\nexport class SharedTreeFactoryNoHistory extends SharedTreeFactory {\n\tprotected includeHistoryInSummary(): boolean {\n\t\treturn false;\n\t}\n}\n"]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { Snapshot } from '../Snapshot';
|
|
6
|
-
import { Change } from './PersistedTypes';
|
|
7
|
-
/**
|
|
8
|
-
* Given a sequence of changes, produces an inverse sequence of changes, i.e. the minimal changes required to revert the given changes
|
|
9
|
-
* @param changes - the changes for which to produce an inverse.
|
|
10
|
-
* @param before - a snapshot of the tree state before `changes` are/were applied - used as a basis for generating the inverse.
|
|
11
|
-
* @returns a sequence of changes _r_ that will produce `before` if applied to a snapshot _A_, where _A_ is the result of
|
|
12
|
-
* applying `changes` to `before`. Applying _r_ to snapshots other than _A_ is legal but may cause the changes to fail to apply or may
|
|
13
|
-
* not be a true semantic inverse.
|
|
14
|
-
*
|
|
15
|
-
* TODO: what should this do if `changes` fails to apply to `before`?
|
|
16
|
-
* @public
|
|
17
|
-
*/
|
|
18
|
-
export declare function revert(changes: readonly Change[], before: Snapshot): Change[];
|
|
19
|
-
//# sourceMappingURL=HistoryEditFactory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HistoryEditFactory.d.ts","sourceRoot":"","sources":["../../src/default-edits/HistoryEditFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,QAAQ,EAAQ,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAkE,MAAM,kBAAkB,CAAC;AAI1G;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,CA4E7E"}
|