@fluid-experimental/tree 2.0.0-rc.1.0.3 → 2.0.0-rc.2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{.eslintrc.js → .eslintrc.cjs} +1 -1
- package/{.mocharc.js → .mocharc.cjs} +1 -1
- package/.vscode/settings.json +1 -1
- package/CHANGELOG.md +4 -0
- package/api-report/experimental-tree.api.md +4 -15
- package/dist/ChangeCompression.d.ts +5 -5
- package/dist/ChangeCompression.d.ts.map +1 -1
- package/dist/ChangeCompression.js +24 -24
- package/dist/ChangeCompression.js.map +1 -1
- package/dist/ChangeTypes.d.ts +3 -3
- package/dist/ChangeTypes.d.ts.map +1 -1
- package/dist/ChangeTypes.js +9 -9
- package/dist/ChangeTypes.js.map +1 -1
- package/dist/Checkout.d.ts +7 -7
- package/dist/Checkout.d.ts.map +1 -1
- package/dist/Checkout.js +27 -27
- package/dist/Checkout.js.map +1 -1
- package/dist/Common.d.ts +2 -2
- package/dist/Common.d.ts.map +1 -1
- package/dist/Common.js.map +1 -1
- package/dist/EagerCheckout.d.ts +3 -3
- package/dist/EagerCheckout.d.ts.map +1 -1
- package/dist/EagerCheckout.js +2 -2
- package/dist/EagerCheckout.js.map +1 -1
- package/dist/EditLog.d.ts +4 -6
- package/dist/EditLog.d.ts.map +1 -1
- package/dist/EditLog.js +9 -9
- package/dist/EditLog.js.map +1 -1
- package/dist/EditUtilities.d.ts +6 -6
- package/dist/EditUtilities.d.ts.map +1 -1
- package/dist/EditUtilities.js +28 -28
- package/dist/EditUtilities.js.map +1 -1
- package/dist/Forest.d.ts +2 -2
- package/dist/Forest.d.ts.map +1 -1
- package/dist/Forest.js +13 -13
- package/dist/Forest.js.map +1 -1
- package/dist/HistoryEditFactory.d.ts +3 -3
- package/dist/HistoryEditFactory.d.ts.map +1 -1
- package/dist/HistoryEditFactory.js +36 -36
- package/dist/HistoryEditFactory.js.map +1 -1
- package/dist/IdConversion.d.ts +3 -3
- package/dist/IdConversion.d.ts.map +1 -1
- package/dist/IdConversion.js +23 -23
- package/dist/IdConversion.js.map +1 -1
- package/dist/InitialTree.d.ts +1 -1
- package/dist/InitialTree.d.ts.map +1 -1
- package/dist/InitialTree.js +2 -2
- package/dist/InitialTree.js.map +1 -1
- package/dist/LazyCheckout.d.ts +5 -5
- package/dist/LazyCheckout.d.ts.map +1 -1
- package/dist/LazyCheckout.js +2 -2
- package/dist/LazyCheckout.js.map +1 -1
- package/dist/LogViewer.d.ts +7 -7
- package/dist/LogViewer.d.ts.map +1 -1
- package/dist/LogViewer.js +25 -25
- package/dist/LogViewer.js.map +1 -1
- package/dist/MergeHealth.d.ts +1 -1
- package/dist/MergeHealth.d.ts.map +1 -1
- package/dist/MergeHealth.js +32 -32
- package/dist/MergeHealth.js.map +1 -1
- package/dist/NodeIdUtilities.d.ts +3 -3
- package/dist/NodeIdUtilities.d.ts.map +1 -1
- package/dist/NodeIdUtilities.js +4 -4
- package/dist/NodeIdUtilities.js.map +1 -1
- package/dist/PayloadUtilities.d.ts +1 -1
- package/dist/PayloadUtilities.d.ts.map +1 -1
- package/dist/PayloadUtilities.js.map +1 -1
- package/dist/ReconciliationPath.d.ts +3 -3
- package/dist/ReconciliationPath.d.ts.map +1 -1
- package/dist/ReconciliationPath.js.map +1 -1
- package/dist/RevisionValueCache.js +5 -5
- package/dist/RevisionValueCache.js.map +1 -1
- package/dist/RevisionView.d.ts +5 -5
- package/dist/RevisionView.d.ts.map +1 -1
- package/dist/RevisionView.js +11 -11
- package/dist/RevisionView.js.map +1 -1
- package/dist/SerializationUtilities.d.ts +4 -4
- package/dist/SerializationUtilities.d.ts.map +1 -1
- package/dist/SerializationUtilities.js +5 -5
- package/dist/SerializationUtilities.js.map +1 -1
- package/dist/SharedTree.d.ts +15 -18
- package/dist/SharedTree.d.ts.map +1 -1
- package/dist/SharedTree.js +154 -166
- package/dist/SharedTree.js.map +1 -1
- package/dist/SharedTreeEncoder.d.ts +8 -8
- package/dist/SharedTreeEncoder.d.ts.map +1 -1
- package/dist/SharedTreeEncoder.js +67 -67
- package/dist/SharedTreeEncoder.js.map +1 -1
- package/dist/StringInterner.d.ts +1 -1
- package/dist/StringInterner.d.ts.map +1 -1
- package/dist/StringInterner.js +2 -2
- package/dist/StringInterner.js.map +1 -1
- package/dist/Summary.d.ts +4 -4
- package/dist/Summary.d.ts.map +1 -1
- package/dist/Summary.js +2 -2
- package/dist/Summary.js.map +1 -1
- package/dist/SummaryBackCompatibility.d.ts +3 -3
- package/dist/SummaryBackCompatibility.d.ts.map +1 -1
- package/dist/SummaryBackCompatibility.js +13 -13
- package/dist/SummaryBackCompatibility.js.map +1 -1
- package/dist/SummaryTestUtilities.d.ts +2 -2
- package/dist/SummaryTestUtilities.d.ts.map +1 -1
- package/dist/SummaryTestUtilities.js.map +1 -1
- package/dist/Transaction.d.ts +4 -4
- package/dist/Transaction.d.ts.map +1 -1
- package/dist/Transaction.js +10 -10
- package/dist/Transaction.js.map +1 -1
- package/dist/TransactionInternal.d.ts +7 -7
- package/dist/TransactionInternal.d.ts.map +1 -1
- package/dist/TransactionInternal.js +87 -87
- package/dist/TransactionInternal.js.map +1 -1
- package/dist/TreeCompressor.d.ts +4 -4
- package/dist/TreeCompressor.d.ts.map +1 -1
- package/dist/TreeCompressor.js +6 -6
- package/dist/TreeCompressor.js.map +1 -1
- package/dist/TreeNodeHandle.d.ts +3 -3
- package/dist/TreeNodeHandle.d.ts.map +1 -1
- package/dist/TreeNodeHandle.js +5 -5
- package/dist/TreeNodeHandle.js.map +1 -1
- package/dist/TreeView.d.ts +3 -3
- package/dist/TreeView.d.ts.map +1 -1
- package/dist/TreeView.js +10 -10
- package/dist/TreeView.js.map +1 -1
- package/dist/TreeViewUtilities.d.ts +2 -2
- package/dist/TreeViewUtilities.d.ts.map +1 -1
- package/dist/TreeViewUtilities.js +3 -3
- package/dist/TreeViewUtilities.js.map +1 -1
- package/dist/UndoRedoHandler.d.ts +2 -2
- package/dist/UndoRedoHandler.d.ts.map +1 -1
- package/dist/UndoRedoHandler.js +5 -5
- package/dist/UndoRedoHandler.js.map +1 -1
- package/dist/UuidUtilities.d.ts +1 -1
- package/dist/UuidUtilities.d.ts.map +1 -1
- package/dist/UuidUtilities.js +3 -3
- package/dist/UuidUtilities.js.map +1 -1
- package/dist/id-compressor/AppendOnlySortedMap.js +4 -4
- package/dist/id-compressor/AppendOnlySortedMap.js.map +1 -1
- package/dist/id-compressor/IdCompressor.d.ts +2 -2
- package/dist/id-compressor/IdCompressor.d.ts.map +1 -1
- package/dist/id-compressor/IdCompressor.js +78 -78
- package/dist/id-compressor/IdCompressor.js.map +1 -1
- package/dist/id-compressor/IdRange.d.ts +1 -1
- package/dist/id-compressor/IdRange.d.ts.map +1 -1
- package/dist/id-compressor/IdRange.js.map +1 -1
- package/dist/id-compressor/NumericUuid.d.ts +1 -1
- package/dist/id-compressor/NumericUuid.d.ts.map +1 -1
- package/dist/id-compressor/NumericUuid.js +6 -6
- package/dist/id-compressor/NumericUuid.js.map +1 -1
- package/dist/id-compressor/SessionIdNormalizer.d.ts +2 -2
- package/dist/id-compressor/SessionIdNormalizer.d.ts.map +1 -1
- package/dist/id-compressor/SessionIdNormalizer.js +14 -14
- package/dist/id-compressor/SessionIdNormalizer.js.map +1 -1
- package/dist/id-compressor/index.d.ts +4 -4
- package/dist/id-compressor/index.d.ts.map +1 -1
- package/dist/id-compressor/index.js +11 -11
- package/dist/id-compressor/index.js.map +1 -1
- package/dist/id-compressor/persisted-types/0.0.1.d.ts +1 -1
- package/dist/id-compressor/persisted-types/0.0.1.d.ts.map +1 -1
- package/dist/id-compressor/persisted-types/0.0.1.js.map +1 -1
- package/dist/id-compressor/persisted-types/index.d.ts +1 -1
- package/dist/id-compressor/persisted-types/index.d.ts.map +1 -1
- package/dist/id-compressor/persisted-types/index.js.map +1 -1
- package/dist/index.d.ts +29 -29
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +73 -73
- package/dist/index.js.map +1 -1
- package/dist/migration-shim/migrationDeltaHandler.d.ts +1 -1
- package/dist/migration-shim/migrationDeltaHandler.d.ts.map +1 -1
- package/dist/migration-shim/migrationDeltaHandler.js +5 -8
- package/dist/migration-shim/migrationDeltaHandler.js.map +1 -1
- package/dist/migration-shim/migrationShim.d.ts +1 -1
- package/dist/migration-shim/migrationShim.d.ts.map +1 -1
- package/dist/migration-shim/migrationShim.js +1 -1
- package/dist/migration-shim/migrationShim.js.map +1 -1
- package/dist/migration-shim/migrationShimFactory.d.ts +1 -1
- package/dist/migration-shim/migrationShimFactory.d.ts.map +1 -1
- package/dist/migration-shim/migrationShimFactory.js.map +1 -1
- package/dist/migration-shim/sharedTreeDeltaHandler.d.ts +1 -1
- package/dist/migration-shim/sharedTreeDeltaHandler.d.ts.map +1 -1
- package/dist/migration-shim/sharedTreeDeltaHandler.js +2 -5
- package/dist/migration-shim/sharedTreeDeltaHandler.js.map +1 -1
- package/dist/migration-shim/types.d.ts +1 -1
- package/dist/migration-shim/types.d.ts.map +1 -1
- package/dist/migration-shim/types.js.map +1 -1
- package/dist/package.json +3 -0
- package/dist/persisted-types/0.0.2.d.ts +1 -1
- package/dist/persisted-types/0.0.2.d.ts.map +1 -1
- package/dist/persisted-types/0.0.2.js.map +1 -1
- package/dist/persisted-types/0.1.1.d.ts +4 -4
- package/dist/persisted-types/0.1.1.d.ts.map +1 -1
- package/dist/persisted-types/0.1.1.js +13 -13
- package/dist/persisted-types/0.1.1.js.map +1 -1
- package/dist/persisted-types/index.d.ts +2 -2
- package/dist/persisted-types/index.d.ts.map +1 -1
- package/dist/persisted-types/index.js +13 -13
- package/dist/persisted-types/index.js.map +1 -1
- package/dist/tree-alpha.d.ts +5 -8
- package/dist/tree-beta.d.ts +5 -1
- package/dist/tree-public.d.ts +5 -1
- package/dist/tree-untrimmed.d.ts +5 -8
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/ChangeCompression.d.ts +5 -5
- package/lib/ChangeCompression.d.ts.map +1 -1
- package/lib/ChangeCompression.js +3 -3
- package/lib/ChangeCompression.js.map +1 -1
- package/lib/ChangeTypes.d.ts +3 -3
- package/lib/ChangeTypes.d.ts.map +1 -1
- package/lib/ChangeTypes.js +3 -3
- package/lib/ChangeTypes.js.map +1 -1
- package/lib/Checkout.d.ts +7 -7
- package/lib/Checkout.d.ts.map +1 -1
- package/lib/Checkout.js +6 -6
- package/lib/Checkout.js.map +1 -1
- package/lib/Common.d.ts +2 -2
- package/lib/Common.d.ts.map +1 -1
- package/lib/Common.js.map +1 -1
- package/lib/EagerCheckout.d.ts +3 -3
- package/lib/EagerCheckout.d.ts.map +1 -1
- package/lib/EagerCheckout.js +1 -1
- package/lib/EagerCheckout.js.map +1 -1
- package/lib/EditLog.d.ts +4 -6
- package/lib/EditLog.d.ts.map +1 -1
- package/lib/EditLog.js +1 -1
- package/lib/EditLog.js.map +1 -1
- package/lib/EditUtilities.d.ts +6 -6
- package/lib/EditUtilities.d.ts.map +1 -1
- package/lib/EditUtilities.js +7 -7
- package/lib/EditUtilities.js.map +1 -1
- package/lib/Forest.d.ts +2 -2
- package/lib/Forest.d.ts.map +1 -1
- package/lib/Forest.js +2 -2
- package/lib/Forest.js.map +1 -1
- package/lib/HistoryEditFactory.d.ts +3 -3
- package/lib/HistoryEditFactory.d.ts.map +1 -1
- package/lib/HistoryEditFactory.js +7 -7
- package/lib/HistoryEditFactory.js.map +1 -1
- package/lib/IdConversion.d.ts +3 -3
- package/lib/IdConversion.d.ts.map +1 -1
- package/lib/IdConversion.js +4 -4
- package/lib/IdConversion.js.map +1 -1
- package/lib/InitialTree.d.ts +1 -1
- package/lib/InitialTree.d.ts.map +1 -1
- package/lib/InitialTree.js +1 -1
- package/lib/InitialTree.js.map +1 -1
- package/lib/LazyCheckout.d.ts +5 -5
- package/lib/LazyCheckout.d.ts.map +1 -1
- package/lib/LazyCheckout.js +1 -1
- package/lib/LazyCheckout.js.map +1 -1
- package/lib/LogViewer.d.ts +7 -7
- package/lib/LogViewer.d.ts.map +1 -1
- package/lib/LogViewer.js +4 -4
- package/lib/LogViewer.js.map +1 -1
- package/lib/MergeHealth.d.ts +1 -1
- package/lib/MergeHealth.d.ts.map +1 -1
- package/lib/MergeHealth.js +5 -5
- package/lib/MergeHealth.js.map +1 -1
- package/lib/NodeIdUtilities.d.ts +3 -3
- package/lib/NodeIdUtilities.d.ts.map +1 -1
- package/lib/NodeIdUtilities.js +2 -2
- package/lib/NodeIdUtilities.js.map +1 -1
- package/lib/PayloadUtilities.d.ts +1 -1
- package/lib/PayloadUtilities.d.ts.map +1 -1
- package/lib/PayloadUtilities.js.map +1 -1
- package/lib/ReconciliationPath.d.ts +3 -3
- package/lib/ReconciliationPath.d.ts.map +1 -1
- package/lib/ReconciliationPath.js.map +1 -1
- package/lib/RevisionValueCache.js +1 -1
- package/lib/RevisionValueCache.js.map +1 -1
- package/lib/RevisionView.d.ts +5 -5
- package/lib/RevisionView.d.ts.map +1 -1
- package/lib/RevisionView.js +3 -3
- package/lib/RevisionView.js.map +1 -1
- package/lib/SerializationUtilities.d.ts +4 -4
- package/lib/SerializationUtilities.d.ts.map +1 -1
- package/lib/SerializationUtilities.js +1 -1
- package/lib/SerializationUtilities.js.map +1 -1
- package/lib/SharedTree.d.ts +15 -18
- package/lib/SharedTree.d.ts.map +1 -1
- package/lib/SharedTree.js +28 -40
- package/lib/SharedTree.js.map +1 -1
- package/lib/SharedTreeEncoder.d.ts +8 -8
- package/lib/SharedTreeEncoder.d.ts.map +1 -1
- package/lib/SharedTreeEncoder.js +12 -12
- package/lib/SharedTreeEncoder.js.map +1 -1
- package/lib/StringInterner.d.ts +1 -1
- package/lib/StringInterner.d.ts.map +1 -1
- package/lib/StringInterner.js +1 -1
- package/lib/StringInterner.js.map +1 -1
- package/lib/Summary.d.ts +4 -4
- package/lib/Summary.d.ts.map +1 -1
- package/lib/Summary.js +1 -1
- package/lib/Summary.js.map +1 -1
- package/lib/SummaryBackCompatibility.d.ts +3 -3
- package/lib/SummaryBackCompatibility.d.ts.map +1 -1
- package/lib/SummaryBackCompatibility.js +3 -3
- package/lib/SummaryBackCompatibility.js.map +1 -1
- package/lib/SummaryTestUtilities.d.ts +2 -2
- package/lib/SummaryTestUtilities.d.ts.map +1 -1
- package/lib/SummaryTestUtilities.js.map +1 -1
- package/lib/Transaction.d.ts +4 -4
- package/lib/Transaction.d.ts.map +1 -1
- package/lib/Transaction.js +5 -5
- package/lib/Transaction.js.map +1 -1
- package/lib/TransactionInternal.d.ts +7 -7
- package/lib/TransactionInternal.d.ts.map +1 -1
- package/lib/TransactionInternal.js +5 -5
- package/lib/TransactionInternal.js.map +1 -1
- package/lib/TreeCompressor.d.ts +4 -4
- package/lib/TreeCompressor.d.ts.map +1 -1
- package/lib/TreeCompressor.js +2 -2
- package/lib/TreeCompressor.js.map +1 -1
- package/lib/TreeNodeHandle.d.ts +3 -3
- package/lib/TreeNodeHandle.d.ts.map +1 -1
- package/lib/TreeNodeHandle.js +1 -1
- package/lib/TreeNodeHandle.js.map +1 -1
- package/lib/TreeView.d.ts +3 -3
- package/lib/TreeView.d.ts.map +1 -1
- package/lib/TreeView.js +3 -3
- package/lib/TreeView.js.map +1 -1
- package/lib/TreeViewUtilities.d.ts +2 -2
- package/lib/TreeViewUtilities.d.ts.map +1 -1
- package/lib/TreeViewUtilities.js +1 -1
- package/lib/TreeViewUtilities.js.map +1 -1
- package/lib/UndoRedoHandler.d.ts +2 -2
- package/lib/UndoRedoHandler.d.ts.map +1 -1
- package/lib/UndoRedoHandler.js +2 -2
- package/lib/UndoRedoHandler.js.map +1 -1
- package/lib/UuidUtilities.d.ts +1 -1
- package/lib/UuidUtilities.d.ts.map +1 -1
- package/lib/UuidUtilities.js +1 -1
- package/lib/UuidUtilities.js.map +1 -1
- package/lib/id-compressor/AppendOnlySortedMap.js +1 -1
- package/lib/id-compressor/AppendOnlySortedMap.js.map +1 -1
- package/lib/id-compressor/IdCompressor.d.ts +2 -2
- package/lib/id-compressor/IdCompressor.d.ts.map +1 -1
- package/lib/id-compressor/IdCompressor.js +6 -6
- package/lib/id-compressor/IdCompressor.js.map +1 -1
- package/lib/id-compressor/IdRange.d.ts +1 -1
- package/lib/id-compressor/IdRange.d.ts.map +1 -1
- package/lib/id-compressor/IdRange.js.map +1 -1
- package/lib/id-compressor/NumericUuid.d.ts +1 -1
- package/lib/id-compressor/NumericUuid.d.ts.map +1 -1
- package/lib/id-compressor/NumericUuid.js +2 -2
- package/lib/id-compressor/NumericUuid.js.map +1 -1
- package/lib/id-compressor/SessionIdNormalizer.d.ts +2 -2
- package/lib/id-compressor/SessionIdNormalizer.d.ts.map +1 -1
- package/lib/id-compressor/SessionIdNormalizer.js +2 -2
- package/lib/id-compressor/SessionIdNormalizer.js.map +1 -1
- package/lib/id-compressor/index.d.ts +4 -4
- package/lib/id-compressor/index.d.ts.map +1 -1
- package/lib/id-compressor/index.js +3 -3
- package/lib/id-compressor/index.js.map +1 -1
- package/lib/id-compressor/persisted-types/0.0.1.d.ts +1 -1
- package/lib/id-compressor/persisted-types/0.0.1.d.ts.map +1 -1
- package/lib/id-compressor/persisted-types/0.0.1.js.map +1 -1
- package/lib/id-compressor/persisted-types/index.d.ts +1 -1
- package/lib/id-compressor/persisted-types/index.d.ts.map +1 -1
- package/lib/id-compressor/persisted-types/index.js.map +1 -1
- package/lib/index.d.ts +29 -29
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +22 -22
- package/lib/index.js.map +1 -1
- package/lib/migration-shim/migrationDeltaHandler.d.ts +1 -1
- package/lib/migration-shim/migrationDeltaHandler.d.ts.map +1 -1
- package/lib/migration-shim/migrationDeltaHandler.js +5 -8
- package/lib/migration-shim/migrationDeltaHandler.js.map +1 -1
- package/lib/migration-shim/migrationShim.d.ts +1 -1
- package/lib/migration-shim/migrationShim.d.ts.map +1 -1
- package/lib/migration-shim/migrationShim.js +1 -1
- package/lib/migration-shim/migrationShim.js.map +1 -1
- package/lib/migration-shim/migrationShimFactory.d.ts +1 -1
- package/lib/migration-shim/migrationShimFactory.d.ts.map +1 -1
- package/lib/migration-shim/migrationShimFactory.js.map +1 -1
- package/lib/migration-shim/sharedTreeDeltaHandler.d.ts +1 -1
- package/lib/migration-shim/sharedTreeDeltaHandler.d.ts.map +1 -1
- package/lib/migration-shim/sharedTreeDeltaHandler.js +2 -5
- package/lib/migration-shim/sharedTreeDeltaHandler.js.map +1 -1
- package/lib/migration-shim/types.d.ts +1 -1
- package/lib/migration-shim/types.d.ts.map +1 -1
- package/lib/migration-shim/types.js.map +1 -1
- package/lib/persisted-types/0.0.2.d.ts +1 -1
- package/lib/persisted-types/0.0.2.d.ts.map +1 -1
- package/lib/persisted-types/0.0.2.js.map +1 -1
- package/lib/persisted-types/0.1.1.d.ts +4 -4
- package/lib/persisted-types/0.1.1.d.ts.map +1 -1
- package/lib/persisted-types/0.1.1.js +2 -2
- package/lib/persisted-types/0.1.1.js.map +1 -1
- package/lib/persisted-types/index.d.ts +2 -2
- package/lib/persisted-types/index.d.ts.map +1 -1
- package/lib/persisted-types/index.js +2 -2
- package/lib/persisted-types/index.js.map +1 -1
- package/lib/test/AppendOnlySortedMap.perf.tests.js +2 -2
- package/lib/test/AppendOnlySortedMap.perf.tests.js.map +1 -1
- package/lib/test/AppendOnlySortedMap.tests.js +2 -2
- package/lib/test/AppendOnlySortedMap.tests.js.map +1 -1
- package/lib/test/ChangeCompression.tests.js +9 -9
- package/lib/test/ChangeCompression.tests.js.map +1 -1
- package/lib/test/Checkout.tests.d.ts +1 -1
- package/lib/test/Checkout.tests.d.ts.map +1 -1
- package/lib/test/Checkout.tests.js +2 -2
- package/lib/test/Checkout.tests.js.map +1 -1
- package/lib/test/Common.tests.js +1 -1
- package/lib/test/Common.tests.js.map +1 -1
- package/lib/test/EagerCheckout.tests.js +4 -4
- package/lib/test/EagerCheckout.tests.js.map +1 -1
- package/lib/test/Edit.tests.js +2 -2
- package/lib/test/Edit.tests.js.map +1 -1
- package/lib/test/EditLog.perf.tests.js +4 -4
- package/lib/test/EditLog.perf.tests.js.map +1 -1
- package/lib/test/EditLog.tests.js +3 -3
- package/lib/test/EditLog.tests.js.map +1 -1
- package/lib/test/EditUtilities.tests.js +6 -6
- package/lib/test/EditUtilities.tests.js.map +1 -1
- package/lib/test/Forest.perf.tests.js +4 -4
- package/lib/test/Forest.perf.tests.js.map +1 -1
- package/lib/test/Forest.tests.js +2 -2
- package/lib/test/Forest.tests.js.map +1 -1
- package/lib/test/GenericTransaction.tests.js +3 -3
- package/lib/test/GenericTransaction.tests.js.map +1 -1
- package/lib/test/HistoryEditFactory.tests.js +4 -4
- package/lib/test/HistoryEditFactory.tests.js.map +1 -1
- package/lib/test/IdCompressor.perf.tests.js +4 -4
- package/lib/test/IdCompressor.perf.tests.js.map +1 -1
- package/lib/test/IdCompressor.tests.js +7 -7
- package/lib/test/IdCompressor.tests.js.map +1 -1
- package/lib/test/IdConversion.tests.js +3 -3
- package/lib/test/IdConversion.tests.js.map +1 -1
- package/lib/test/LazyCheckout.tests.js +4 -4
- package/lib/test/LazyCheckout.tests.js.map +1 -1
- package/lib/test/LogViewer.tests.js +12 -12
- package/lib/test/LogViewer.tests.js.map +1 -1
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.js +6 -6
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.js.map +1 -1
- package/lib/test/NumericUuid.perf.tests.js +3 -3
- package/lib/test/NumericUuid.perf.tests.js.map +1 -1
- package/lib/test/NumericUuid.tests.js +4 -4
- package/lib/test/NumericUuid.tests.js.map +1 -1
- package/lib/test/RevisionValueCache.tests.js +2 -2
- package/lib/test/RevisionValueCache.tests.js.map +1 -1
- package/lib/test/RevisionView.tests.js +6 -6
- package/lib/test/RevisionView.tests.js.map +1 -1
- package/lib/test/SessionIdNormalizer.tests.js +3 -3
- package/lib/test/SessionIdNormalizer.tests.js.map +1 -1
- package/lib/test/SharedTree.fuzz.tests.js +1 -1
- package/lib/test/SharedTree.fuzz.tests.js.map +1 -1
- package/lib/test/SharedTree.perf.tests.js +2 -2
- package/lib/test/SharedTree.perf.tests.js.map +1 -1
- package/lib/test/SharedTree.tests.js +7 -7
- package/lib/test/SharedTree.tests.js.map +1 -1
- package/lib/test/StringInterner.tests.js +1 -1
- package/lib/test/StringInterner.tests.js.map +1 -1
- package/lib/test/Summary.tests.d.ts +2 -2
- package/lib/test/Summary.tests.d.ts.map +1 -1
- package/lib/test/Summary.tests.js +14 -14
- package/lib/test/Summary.tests.js.map +1 -1
- package/lib/test/Transaction.tests.js +5 -5
- package/lib/test/Transaction.tests.js.map +1 -1
- package/lib/test/TransactionInternal.tests.js +7 -7
- package/lib/test/TransactionInternal.tests.js.map +1 -1
- package/lib/test/TreeCompression.tests.js +8 -8
- package/lib/test/TreeCompression.tests.js.map +1 -1
- package/lib/test/TreeView.tests.js +3 -3
- package/lib/test/TreeView.tests.js.map +1 -1
- package/lib/test/UndoRedoHandler.tests.js +2 -2
- package/lib/test/UndoRedoHandler.tests.js.map +1 -1
- package/lib/test/fuzz/Generators.d.ts +1 -1
- package/lib/test/fuzz/Generators.d.ts.map +1 -1
- package/lib/test/fuzz/Generators.js +4 -4
- package/lib/test/fuzz/Generators.js.map +1 -1
- package/lib/test/fuzz/SharedTreeFuzzTests.d.ts +1 -1
- package/lib/test/fuzz/SharedTreeFuzzTests.d.ts.map +1 -1
- package/lib/test/fuzz/SharedTreeFuzzTests.js +5 -5
- package/lib/test/fuzz/SharedTreeFuzzTests.js.map +1 -1
- package/lib/test/fuzz/Types.d.ts +6 -6
- package/lib/test/fuzz/Types.d.ts.map +1 -1
- package/lib/test/fuzz/Types.js.map +1 -1
- package/lib/test/utilities/IdCompressorTestUtilities.d.ts +6 -6
- package/lib/test/utilities/IdCompressorTestUtilities.d.ts.map +1 -1
- package/lib/test/utilities/IdCompressorTestUtilities.js +6 -6
- package/lib/test/utilities/IdCompressorTestUtilities.js.map +1 -1
- package/lib/test/utilities/MockTransaction.d.ts +4 -4
- package/lib/test/utilities/MockTransaction.d.ts.map +1 -1
- package/lib/test/utilities/MockTransaction.js +3 -3
- package/lib/test/utilities/MockTransaction.js.map +1 -1
- package/lib/test/utilities/PendingLocalStateTests.d.ts +1 -1
- package/lib/test/utilities/PendingLocalStateTests.d.ts.map +1 -1
- package/lib/test/utilities/PendingLocalStateTests.js +5 -5
- package/lib/test/utilities/PendingLocalStateTests.js.map +1 -1
- package/lib/test/utilities/SharedTreeTests.d.ts +2 -2
- package/lib/test/utilities/SharedTreeTests.d.ts.map +1 -1
- package/lib/test/utilities/SharedTreeTests.js +22 -22
- package/lib/test/utilities/SharedTreeTests.js.map +1 -1
- package/lib/test/utilities/SharedTreeVersioningTests.d.ts +1 -1
- package/lib/test/utilities/SharedTreeVersioningTests.d.ts.map +1 -1
- package/lib/test/utilities/SharedTreeVersioningTests.js +10 -10
- package/lib/test/utilities/SharedTreeVersioningTests.js.map +1 -1
- package/lib/test/utilities/SummaryLoadPerfTests.js +6 -6
- package/lib/test/utilities/SummaryLoadPerfTests.js.map +1 -1
- package/lib/test/utilities/SummarySizeTests.d.ts +1 -1
- package/lib/test/utilities/SummarySizeTests.d.ts.map +1 -1
- package/lib/test/utilities/SummarySizeTests.js +5 -5
- package/lib/test/utilities/SummarySizeTests.js.map +1 -1
- package/lib/test/utilities/TestNode.d.ts +6 -6
- package/lib/test/utilities/TestNode.d.ts.map +1 -1
- package/lib/test/utilities/TestNode.js +5 -5
- package/lib/test/utilities/TestNode.js.map +1 -1
- package/lib/test/utilities/TestUtilities.d.ts +12 -12
- package/lib/test/utilities/TestUtilities.d.ts.map +1 -1
- package/lib/test/utilities/TestUtilities.js +18 -19
- package/lib/test/utilities/TestUtilities.js.map +1 -1
- package/lib/test/utilities/UndoRedoTests.d.ts +2 -2
- package/lib/test/utilities/UndoRedoTests.d.ts.map +1 -1
- package/lib/test/utilities/UndoRedoTests.js +7 -7
- package/lib/test/utilities/UndoRedoTests.js.map +1 -1
- package/package.json +57 -31
- package/src/ChangeCompression.ts +7 -7
- package/src/ChangeTypes.ts +5 -5
- package/src/Checkout.ts +13 -13
- package/src/Common.ts +2 -2
- package/src/EagerCheckout.ts +3 -3
- package/src/EditLog.ts +6 -7
- package/src/EditUtilities.ts +10 -10
- package/src/Forest.ts +4 -4
- package/src/HistoryEditFactory.ts +11 -11
- package/src/IdConversion.ts +4 -4
- package/src/InitialTree.ts +3 -3
- package/src/LazyCheckout.ts +5 -5
- package/src/LogViewer.ts +8 -8
- package/src/MergeHealth.ts +6 -6
- package/src/NodeIdUtilities.ts +4 -4
- package/src/PayloadUtilities.ts +1 -1
- package/src/ReconciliationPath.ts +3 -3
- package/src/RevisionValueCache.ts +1 -1
- package/src/RevisionView.ts +7 -7
- package/src/SerializationUtilities.ts +5 -5
- package/src/SharedTree.ts +34 -54
- package/src/SharedTreeEncoder.ts +15 -15
- package/src/StringInterner.ts +2 -2
- package/src/Summary.ts +5 -5
- package/src/SummaryBackCompatibility.ts +10 -5
- package/src/SummaryTestUtilities.ts +3 -3
- package/src/Transaction.ts +8 -8
- package/src/TransactionInternal.ts +8 -8
- package/src/TreeCompressor.ts +6 -6
- package/src/TreeNodeHandle.ts +4 -4
- package/src/TreeView.ts +4 -4
- package/src/TreeViewUtilities.ts +3 -3
- package/src/UndoRedoHandler.ts +4 -4
- package/src/UuidUtilities.ts +2 -2
- package/src/id-compressor/AppendOnlySortedMap.ts +1 -1
- package/src/id-compressor/IdCompressor.ts +8 -8
- package/src/id-compressor/IdRange.ts +1 -1
- package/src/id-compressor/NumericUuid.ts +3 -3
- package/src/id-compressor/SessionIdNormalizer.ts +4 -4
- package/src/id-compressor/index.ts +4 -4
- package/src/id-compressor/persisted-types/0.0.1.ts +1 -1
- package/src/id-compressor/persisted-types/index.ts +1 -1
- package/src/index.ts +29 -29
- package/src/migration-shim/migrationDeltaHandler.ts +9 -10
- package/src/migration-shim/migrationShim.ts +7 -5
- package/src/migration-shim/migrationShimFactory.ts +4 -1
- package/src/migration-shim/sharedTreeDeltaHandler.ts +7 -6
- package/src/migration-shim/types.ts +1 -1
- package/src/persisted-types/0.0.2.ts +1 -1
- package/src/persisted-types/0.1.1.ts +4 -4
- package/src/persisted-types/index.ts +2 -2
- package/tsconfig.esnext.json +1 -2
- package/tsconfig.json +3 -0
- package/lib/test/Attach.tests.d.ts +0 -6
- package/lib/test/Attach.tests.d.ts.map +0 -1
- package/lib/test/Attach.tests.js +0 -52
- package/lib/test/Attach.tests.js.map +0 -1
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.TransactionInternal = exports.GenericTransaction = void 0;
|
|
8
8
|
const core_utils_1 = require("@fluidframework/core-utils");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
9
|
+
const Common_js_1 = require("./Common.js");
|
|
10
|
+
const Identifiers_js_1 = require("./Identifiers.js");
|
|
11
|
+
const TreeViewUtilities_js_1 = require("./TreeViewUtilities.js");
|
|
12
|
+
const index_js_1 = require("./persisted-types/index.js");
|
|
13
|
+
const EditUtilities_js_1 = require("./EditUtilities.js");
|
|
14
14
|
/**
|
|
15
15
|
* A mutable transaction for applying sequences of changes to a TreeView.
|
|
16
16
|
* Allows viewing the intermediate states.
|
|
@@ -36,7 +36,7 @@ class GenericTransaction {
|
|
|
36
36
|
this.policy = policy;
|
|
37
37
|
this.state = {
|
|
38
38
|
view: view.openForTransaction(),
|
|
39
|
-
status:
|
|
39
|
+
status: index_js_1.EditStatus.Applied,
|
|
40
40
|
changes: [],
|
|
41
41
|
steps: [],
|
|
42
42
|
};
|
|
@@ -79,14 +79,14 @@ class GenericTransaction {
|
|
|
79
79
|
close() {
|
|
80
80
|
(0, core_utils_1.assert)(this.open, 0x638 /* transaction has already been closed */);
|
|
81
81
|
this.open = false;
|
|
82
|
-
if (this.state.status ===
|
|
82
|
+
if (this.state.status === index_js_1.EditStatus.Applied) {
|
|
83
83
|
const validation = this.policy.validateOnClose(this.state);
|
|
84
|
-
if (
|
|
84
|
+
if (Common_js_1.Result.isOk(validation)) {
|
|
85
85
|
if (validation.result !== this.view) {
|
|
86
86
|
this.state = { ...this.state, view: validation.result };
|
|
87
87
|
}
|
|
88
88
|
return {
|
|
89
|
-
status:
|
|
89
|
+
status: index_js_1.EditStatus.Applied,
|
|
90
90
|
steps: this.steps,
|
|
91
91
|
changes: this.changes,
|
|
92
92
|
before: this.before,
|
|
@@ -122,13 +122,13 @@ class GenericTransaction {
|
|
|
122
122
|
let iterResult = iter.next();
|
|
123
123
|
if (iterResult.done === true) {
|
|
124
124
|
for (const change of changes) {
|
|
125
|
-
if (this.applyChange(change, path).status !==
|
|
125
|
+
if (this.applyChange(change, path).status !== index_js_1.EditStatus.Applied) {
|
|
126
126
|
return this;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
return this;
|
|
130
130
|
}
|
|
131
|
-
if (this.applyChange(firsChangeInternal, path).status !==
|
|
131
|
+
if (this.applyChange(firsChangeInternal, path).status !== index_js_1.EditStatus.Applied) {
|
|
132
132
|
return this;
|
|
133
133
|
}
|
|
134
134
|
const ongoingEdit = {
|
|
@@ -150,7 +150,7 @@ class GenericTransaction {
|
|
|
150
150
|
},
|
|
151
151
|
});
|
|
152
152
|
while (iterResult.done !== true) {
|
|
153
|
-
if (this.applyChange(iterResult.value, pathWithOngoingEdit).status !==
|
|
153
|
+
if (this.applyChange(iterResult.value, pathWithOngoingEdit).status !== index_js_1.EditStatus.Applied) {
|
|
154
154
|
return this;
|
|
155
155
|
}
|
|
156
156
|
ongoingEdit[ongoingEdit.length] = this.steps[this.steps.length - 1];
|
|
@@ -169,19 +169,19 @@ class GenericTransaction {
|
|
|
169
169
|
*/
|
|
170
170
|
applyChange(change, path = []) {
|
|
171
171
|
(0, core_utils_1.assert)(this.open, 0x639 /* Editor must be open to apply changes. */);
|
|
172
|
-
if (this.state.status !==
|
|
173
|
-
(0,
|
|
172
|
+
if (this.state.status !== index_js_1.EditStatus.Applied) {
|
|
173
|
+
(0, Common_js_1.fail)('Cannot apply change to an edit unless all previous changes have applied');
|
|
174
174
|
}
|
|
175
175
|
const resolutionResult = this.policy.tryResolveChange(this.state, change, path);
|
|
176
|
-
if (
|
|
176
|
+
if (Common_js_1.Result.isError(resolutionResult)) {
|
|
177
177
|
this.state = { ...this.state, ...resolutionResult.error };
|
|
178
178
|
return this;
|
|
179
179
|
}
|
|
180
180
|
const resolvedChange = resolutionResult.result;
|
|
181
181
|
const changeResult = this.policy.dispatchChange(this.state, resolvedChange);
|
|
182
|
-
this.state =
|
|
182
|
+
this.state = Common_js_1.Result.isOk(changeResult)
|
|
183
183
|
? {
|
|
184
|
-
status:
|
|
184
|
+
status: index_js_1.EditStatus.Applied,
|
|
185
185
|
view: changeResult.result,
|
|
186
186
|
changes: this.changes.concat(change),
|
|
187
187
|
steps: this.steps.concat({ resolvedChange, after: changeResult.result }),
|
|
@@ -238,7 +238,7 @@ var TransactionInternal;
|
|
|
238
238
|
* @returns Result.Ok which contains change
|
|
239
239
|
*/
|
|
240
240
|
tryResolveChange(state, change) {
|
|
241
|
-
return
|
|
241
|
+
return Common_js_1.Result.ok(change);
|
|
242
242
|
}
|
|
243
243
|
/**
|
|
244
244
|
* Validates the transaction when it is closed
|
|
@@ -249,14 +249,14 @@ var TransactionInternal;
|
|
|
249
249
|
validateOnClose(state) {
|
|
250
250
|
// Making the policy choice that storing a detached sequences in an edit but not using it is an error.
|
|
251
251
|
return this.detached.size !== 0
|
|
252
|
-
?
|
|
253
|
-
status:
|
|
252
|
+
? Common_js_1.Result.error({
|
|
253
|
+
status: index_js_1.EditStatus.Malformed,
|
|
254
254
|
failure: {
|
|
255
255
|
kind: FailureKind.UnusedDetachedSequence,
|
|
256
256
|
sequenceId: this.detached.keys().next().value,
|
|
257
257
|
},
|
|
258
258
|
})
|
|
259
|
-
:
|
|
259
|
+
: Common_js_1.Result.ok(state.view);
|
|
260
260
|
}
|
|
261
261
|
/**
|
|
262
262
|
* Applies a given change
|
|
@@ -267,24 +267,24 @@ var TransactionInternal;
|
|
|
267
267
|
*/
|
|
268
268
|
dispatchChange(state, change) {
|
|
269
269
|
switch (change.type) {
|
|
270
|
-
case
|
|
270
|
+
case index_js_1.ChangeTypeInternal.Build:
|
|
271
271
|
return this.applyBuild(state, change);
|
|
272
|
-
case
|
|
272
|
+
case index_js_1.ChangeTypeInternal.Insert:
|
|
273
273
|
return this.applyInsert(state, change);
|
|
274
|
-
case
|
|
274
|
+
case index_js_1.ChangeTypeInternal.Detach:
|
|
275
275
|
return this.applyDetach(state, change);
|
|
276
|
-
case
|
|
276
|
+
case index_js_1.ChangeTypeInternal.Constraint:
|
|
277
277
|
return this.applyConstraint(state, change);
|
|
278
|
-
case
|
|
278
|
+
case index_js_1.ChangeTypeInternal.SetValue:
|
|
279
279
|
return this.applySetValue(state, change);
|
|
280
280
|
default:
|
|
281
|
-
return (0,
|
|
281
|
+
return (0, Common_js_1.fail)('Attempted to apply unsupported change');
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
applyBuild(state, change) {
|
|
285
285
|
if (this.detached.has(change.destination)) {
|
|
286
|
-
return
|
|
287
|
-
status:
|
|
286
|
+
return Common_js_1.Result.error({
|
|
287
|
+
status: index_js_1.EditStatus.Malformed,
|
|
288
288
|
failure: {
|
|
289
289
|
kind: FailureKind.DetachedSequenceIdAlreadyInUse,
|
|
290
290
|
change,
|
|
@@ -312,26 +312,26 @@ var TransactionInternal;
|
|
|
312
312
|
detachedSequenceNotFound = detachedId;
|
|
313
313
|
});
|
|
314
314
|
if (idAlreadyPresent !== undefined) {
|
|
315
|
-
return
|
|
316
|
-
status:
|
|
315
|
+
return Common_js_1.Result.error({
|
|
316
|
+
status: index_js_1.EditStatus.Invalid,
|
|
317
317
|
failure: { kind: FailureKind.IdAlreadyInUse, change, id: idAlreadyPresent },
|
|
318
318
|
});
|
|
319
319
|
}
|
|
320
320
|
if (duplicateIdInBuild !== undefined) {
|
|
321
|
-
return
|
|
322
|
-
status:
|
|
321
|
+
return Common_js_1.Result.error({
|
|
322
|
+
status: index_js_1.EditStatus.Malformed,
|
|
323
323
|
failure: { kind: FailureKind.DuplicateIdInBuild, change, id: duplicateIdInBuild },
|
|
324
324
|
});
|
|
325
325
|
}
|
|
326
326
|
if (invalidId !== undefined) {
|
|
327
|
-
return
|
|
328
|
-
status:
|
|
327
|
+
return Common_js_1.Result.error({
|
|
328
|
+
status: index_js_1.EditStatus.Invalid,
|
|
329
329
|
failure: { kind: FailureKind.UnknownId, change, id: invalidId },
|
|
330
330
|
});
|
|
331
331
|
}
|
|
332
332
|
if (detachedSequenceNotFound !== undefined) {
|
|
333
|
-
return
|
|
334
|
-
status:
|
|
333
|
+
return Common_js_1.Result.error({
|
|
334
|
+
status: index_js_1.EditStatus.Malformed,
|
|
335
335
|
failure: {
|
|
336
336
|
kind: FailureKind.DetachedSequenceNotFound,
|
|
337
337
|
change,
|
|
@@ -340,14 +340,14 @@ var TransactionInternal;
|
|
|
340
340
|
});
|
|
341
341
|
}
|
|
342
342
|
const view = state.view.addNodes(map.values());
|
|
343
|
-
this.detached.set(change.destination, newIds ?? (0,
|
|
344
|
-
return
|
|
343
|
+
this.detached.set(change.destination, newIds ?? (0, Common_js_1.fail)('Unhandled failure case in Transaction.createViewNodesForTree'));
|
|
344
|
+
return Common_js_1.Result.ok(view);
|
|
345
345
|
}
|
|
346
346
|
applyInsert(state, change) {
|
|
347
347
|
const source = this.detached.get(change.source);
|
|
348
348
|
if (source === undefined) {
|
|
349
|
-
return
|
|
350
|
-
status:
|
|
349
|
+
return Common_js_1.Result.error({
|
|
350
|
+
status: index_js_1.EditStatus.Malformed,
|
|
351
351
|
failure: {
|
|
352
352
|
kind: FailureKind.DetachedSequenceNotFound,
|
|
353
353
|
change,
|
|
@@ -355,12 +355,12 @@ var TransactionInternal;
|
|
|
355
355
|
},
|
|
356
356
|
});
|
|
357
357
|
}
|
|
358
|
-
const validatedDestination = (0,
|
|
359
|
-
if (validatedDestination.result !==
|
|
360
|
-
return
|
|
361
|
-
status: validatedDestination.result ===
|
|
362
|
-
?
|
|
363
|
-
:
|
|
358
|
+
const validatedDestination = (0, EditUtilities_js_1.validateStablePlace)(state.view, change.destination);
|
|
359
|
+
if (validatedDestination.result !== EditUtilities_js_1.PlaceValidationResult.Valid) {
|
|
360
|
+
return Common_js_1.Result.error({
|
|
361
|
+
status: validatedDestination.result === EditUtilities_js_1.PlaceValidationResult.Malformed
|
|
362
|
+
? index_js_1.EditStatus.Malformed
|
|
363
|
+
: index_js_1.EditStatus.Invalid,
|
|
364
364
|
failure: {
|
|
365
365
|
kind: FailureKind.BadPlace,
|
|
366
366
|
change,
|
|
@@ -370,18 +370,18 @@ var TransactionInternal;
|
|
|
370
370
|
});
|
|
371
371
|
}
|
|
372
372
|
this.detached.delete(change.source);
|
|
373
|
-
const view = (0,
|
|
374
|
-
return
|
|
373
|
+
const view = (0, EditUtilities_js_1.insertIntoTrait)(state.view, source, validatedDestination);
|
|
374
|
+
return Common_js_1.Result.ok(view);
|
|
375
375
|
}
|
|
376
376
|
applyDetach(state, change) {
|
|
377
|
-
const validatedSource = (0,
|
|
378
|
-
if (validatedSource.result !==
|
|
379
|
-
return
|
|
380
|
-
status: validatedSource.result ===
|
|
381
|
-
validatedSource.result ===
|
|
382
|
-
validatedSource.result.placeFailure !==
|
|
383
|
-
?
|
|
384
|
-
:
|
|
377
|
+
const validatedSource = (0, EditUtilities_js_1.validateStableRange)(state.view, change.source);
|
|
378
|
+
if (validatedSource.result !== EditUtilities_js_1.RangeValidationResultKind.Valid) {
|
|
379
|
+
return Common_js_1.Result.error({
|
|
380
|
+
status: validatedSource.result === EditUtilities_js_1.RangeValidationResultKind.PlacesInDifferentTraits ||
|
|
381
|
+
validatedSource.result === EditUtilities_js_1.RangeValidationResultKind.Inverted ||
|
|
382
|
+
validatedSource.result.placeFailure !== EditUtilities_js_1.PlaceValidationResult.Malformed
|
|
383
|
+
? index_js_1.EditStatus.Invalid
|
|
384
|
+
: index_js_1.EditStatus.Malformed,
|
|
385
385
|
failure: {
|
|
386
386
|
kind: FailureKind.BadRange,
|
|
387
387
|
change,
|
|
@@ -390,14 +390,14 @@ var TransactionInternal;
|
|
|
390
390
|
},
|
|
391
391
|
});
|
|
392
392
|
}
|
|
393
|
-
const result = (0,
|
|
393
|
+
const result = (0, EditUtilities_js_1.detachRange)(state.view, validatedSource);
|
|
394
394
|
let modifiedView = result.view;
|
|
395
395
|
const { detached } = result;
|
|
396
396
|
// Store or dispose detached
|
|
397
397
|
if (change.destination !== undefined) {
|
|
398
398
|
if (this.detached.has(change.destination)) {
|
|
399
|
-
return
|
|
400
|
-
status:
|
|
399
|
+
return Common_js_1.Result.error({
|
|
400
|
+
status: index_js_1.EditStatus.Malformed,
|
|
401
401
|
failure: {
|
|
402
402
|
kind: FailureKind.DetachedSequenceIdAlreadyInUse,
|
|
403
403
|
change,
|
|
@@ -410,21 +410,21 @@ var TransactionInternal;
|
|
|
410
410
|
else {
|
|
411
411
|
modifiedView = modifiedView.deleteNodes(detached);
|
|
412
412
|
}
|
|
413
|
-
return
|
|
413
|
+
return Common_js_1.Result.ok(modifiedView);
|
|
414
414
|
}
|
|
415
415
|
applyConstraint(state, change) {
|
|
416
416
|
// TODO: Implement identityHash and contentHash
|
|
417
417
|
(0, core_utils_1.assert)(change.identityHash === undefined, 0x63a /* identityHash constraint is not implemented */);
|
|
418
418
|
(0, core_utils_1.assert)(change.contentHash === undefined, 0x63b /* contentHash constraint is not implemented */);
|
|
419
|
-
const validatedChange = (0,
|
|
420
|
-
if (validatedChange.result !==
|
|
421
|
-
return validatedChange.result !==
|
|
422
|
-
validatedChange.result !==
|
|
423
|
-
validatedChange.result.placeFailure !==
|
|
424
|
-
? change.effect ===
|
|
425
|
-
?
|
|
426
|
-
:
|
|
427
|
-
status:
|
|
419
|
+
const validatedChange = (0, EditUtilities_js_1.validateStableRange)(state.view, change.toConstrain);
|
|
420
|
+
if (validatedChange.result !== EditUtilities_js_1.RangeValidationResultKind.Valid) {
|
|
421
|
+
return validatedChange.result !== EditUtilities_js_1.RangeValidationResultKind.PlacesInDifferentTraits &&
|
|
422
|
+
validatedChange.result !== EditUtilities_js_1.RangeValidationResultKind.Inverted &&
|
|
423
|
+
validatedChange.result.placeFailure !== EditUtilities_js_1.PlaceValidationResult.Malformed
|
|
424
|
+
? change.effect === index_js_1.ConstraintEffect.ValidRetry
|
|
425
|
+
? Common_js_1.Result.ok(state.view)
|
|
426
|
+
: Common_js_1.Result.error({
|
|
427
|
+
status: index_js_1.EditStatus.Invalid,
|
|
428
428
|
failure: {
|
|
429
429
|
kind: FailureKind.ConstraintViolation,
|
|
430
430
|
constraint: change,
|
|
@@ -434,8 +434,8 @@ var TransactionInternal;
|
|
|
434
434
|
},
|
|
435
435
|
},
|
|
436
436
|
})
|
|
437
|
-
:
|
|
438
|
-
status:
|
|
437
|
+
: Common_js_1.Result.error({
|
|
438
|
+
status: index_js_1.EditStatus.Malformed,
|
|
439
439
|
failure: {
|
|
440
440
|
kind: FailureKind.ConstraintViolation,
|
|
441
441
|
constraint: change,
|
|
@@ -446,12 +446,12 @@ var TransactionInternal;
|
|
|
446
446
|
},
|
|
447
447
|
});
|
|
448
448
|
}
|
|
449
|
-
const { start, end } = (0,
|
|
449
|
+
const { start, end } = (0, TreeViewUtilities_js_1.rangeFromStableRange)(state.view, validatedChange);
|
|
450
450
|
const startIndex = state.view.findIndexWithinTrait(start);
|
|
451
451
|
const endIndex = state.view.findIndexWithinTrait(end);
|
|
452
452
|
if (change.length !== undefined && change.length !== endIndex - startIndex) {
|
|
453
|
-
return
|
|
454
|
-
status:
|
|
453
|
+
return Common_js_1.Result.error({
|
|
454
|
+
status: index_js_1.EditStatus.Invalid,
|
|
455
455
|
failure: {
|
|
456
456
|
kind: FailureKind.ConstraintViolation,
|
|
457
457
|
constraint: change,
|
|
@@ -463,8 +463,8 @@ var TransactionInternal;
|
|
|
463
463
|
});
|
|
464
464
|
}
|
|
465
465
|
if (change.parentNode !== undefined && change.parentNode !== end.trait.parent) {
|
|
466
|
-
return
|
|
467
|
-
status:
|
|
466
|
+
return Common_js_1.Result.error({
|
|
467
|
+
status: index_js_1.EditStatus.Invalid,
|
|
468
468
|
failure: {
|
|
469
469
|
kind: FailureKind.ConstraintViolation,
|
|
470
470
|
constraint: change,
|
|
@@ -476,8 +476,8 @@ var TransactionInternal;
|
|
|
476
476
|
});
|
|
477
477
|
}
|
|
478
478
|
if (change.label !== undefined && change.label !== end.trait.label) {
|
|
479
|
-
return
|
|
480
|
-
status:
|
|
479
|
+
return Common_js_1.Result.error({
|
|
480
|
+
status: index_js_1.EditStatus.Invalid,
|
|
481
481
|
failure: {
|
|
482
482
|
kind: FailureKind.ConstraintViolation,
|
|
483
483
|
constraint: change,
|
|
@@ -488,17 +488,17 @@ var TransactionInternal;
|
|
|
488
488
|
},
|
|
489
489
|
});
|
|
490
490
|
}
|
|
491
|
-
return
|
|
491
|
+
return Common_js_1.Result.ok(state.view);
|
|
492
492
|
}
|
|
493
493
|
applySetValue(state, change) {
|
|
494
494
|
if (!state.view.hasNode(change.nodeToModify)) {
|
|
495
|
-
return
|
|
496
|
-
status:
|
|
495
|
+
return Common_js_1.Result.error({
|
|
496
|
+
status: index_js_1.EditStatus.Invalid,
|
|
497
497
|
failure: { kind: FailureKind.UnknownId, change, id: change.nodeToModify },
|
|
498
498
|
});
|
|
499
499
|
}
|
|
500
500
|
const newView = state.view.setNodeValue(change.nodeToModify, change.payload);
|
|
501
|
-
return
|
|
501
|
+
return Common_js_1.Result.ok(newView);
|
|
502
502
|
}
|
|
503
503
|
/**
|
|
504
504
|
* Generates tree view nodes from the supplied edit nodes.
|
|
@@ -510,7 +510,7 @@ var TransactionInternal;
|
|
|
510
510
|
const topLevelIds = [];
|
|
511
511
|
const unprocessed = [];
|
|
512
512
|
for (const buildNode of sequence) {
|
|
513
|
-
if ((0,
|
|
513
|
+
if ((0, Identifiers_js_1.isDetachedSequenceId)(buildNode)) {
|
|
514
514
|
const detachedIds = this.getDetachedNodeIds(buildNode, onInvalidDetachedId);
|
|
515
515
|
if (detachedIds === undefined) {
|
|
516
516
|
return undefined;
|
|
@@ -524,7 +524,7 @@ var TransactionInternal;
|
|
|
524
524
|
}
|
|
525
525
|
while (unprocessed.length > 0) {
|
|
526
526
|
const node = unprocessed.pop();
|
|
527
|
-
(0,
|
|
527
|
+
(0, Common_js_1.assertWithMessage)(node !== undefined && !(0, Identifiers_js_1.isDetachedSequenceId)(node));
|
|
528
528
|
const traits = new Map();
|
|
529
529
|
// eslint-disable-next-line no-restricted-syntax
|
|
530
530
|
for (const key in node.traits) {
|
|
@@ -533,7 +533,7 @@ var TransactionInternal;
|
|
|
533
533
|
if (children.length > 0) {
|
|
534
534
|
const childIds = [];
|
|
535
535
|
for (const child of children) {
|
|
536
|
-
if ((0,
|
|
536
|
+
if ((0, Identifiers_js_1.isDetachedSequenceId)(child)) {
|
|
537
537
|
const detachedIds = this.getDetachedNodeIds(child, onInvalidDetachedId);
|
|
538
538
|
if (detachedIds === undefined) {
|
|
539
539
|
return undefined;
|
|
@@ -554,7 +554,7 @@ var TransactionInternal;
|
|
|
554
554
|
definition: node.definition,
|
|
555
555
|
traits,
|
|
556
556
|
};
|
|
557
|
-
(0,
|
|
557
|
+
(0, Common_js_1.copyPropertyIfDefined)(node, newNode, 'payload');
|
|
558
558
|
if (onCreateNode(node.identifier, newNode)) {
|
|
559
559
|
return undefined;
|
|
560
560
|
}
|