@fluidframework/tree 2.113.1 → 2.114.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +98 -0
- package/api-report/tree.alpha.api.md +19 -0
- package/dist/core/change-family/changeFamily.d.ts +15 -4
- package/dist/core/change-family/changeFamily.d.ts.map +1 -1
- package/dist/core/change-family/changeFamily.js.map +1 -1
- package/dist/core/change-family/editBuilder.d.ts +2 -3
- package/dist/core/change-family/editBuilder.d.ts.map +1 -1
- package/dist/core/change-family/editBuilder.js +1 -2
- package/dist/core/change-family/editBuilder.js.map +1 -1
- package/dist/core/change-family/index.d.ts +1 -1
- package/dist/core/change-family/index.d.ts.map +1 -1
- package/dist/core/change-family/index.js.map +1 -1
- package/dist/core/index.d.ts +3 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/tree/delta.d.ts +62 -16
- package/dist/core/tree/delta.d.ts.map +1 -1
- package/dist/core/tree/delta.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts +7 -13
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +32 -46
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/index.d.ts +1 -0
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js.map +1 -1
- package/dist/core/tree/visitorUtils.d.ts +2 -4
- package/dist/core/tree/visitorUtils.d.ts.map +1 -1
- package/dist/core/tree/visitorUtils.js +2 -2
- package/dist/core/tree/visitorUtils.js.map +1 -1
- package/dist/entrypoints/alpha.d.ts +1 -1
- package/dist/entrypoints/alpha.d.ts.map +1 -1
- package/dist/entrypoints/alpha.js +5 -2
- package/dist/entrypoints/alpha.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +10 -2
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/comparison-forest/comparisonForest.d.ts +51 -0
- package/dist/feature-libraries/comparison-forest/comparisonForest.d.ts.map +1 -0
- package/dist/feature-libraries/comparison-forest/comparisonForest.js +98 -0
- package/dist/feature-libraries/comparison-forest/comparisonForest.js.map +1 -0
- package/dist/feature-libraries/comparison-forest/index.d.ts +6 -0
- package/dist/feature-libraries/comparison-forest/index.d.ts.map +1 -0
- package/dist/feature-libraries/comparison-forest/index.js +10 -0
- package/dist/feature-libraries/comparison-forest/index.js.map +1 -0
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +8 -6
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
- package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/noChangeCodecs.js +3 -1
- package/dist/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +6 -3
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js +18 -6
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -3
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +2 -3
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +4 -3
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +77 -72
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.js +12 -0
- package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +9 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/invert.d.ts +15 -0
- package/dist/feature-libraries/modular-schema/invert.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/invert.js +159 -0
- package/dist/feature-libraries/modular-schema/invert.js.map +1 -0
- package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts +3 -4
- package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/minimizeModularChange.js +2 -2
- package/dist/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +9 -9
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +0 -2
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -22
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +53 -406
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts +61 -0
- package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeUtils.js +205 -0
- package/dist/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -0
- package/dist/feature-libraries/modular-schema/prune.d.ts +10 -0
- package/dist/feature-libraries/modular-schema/prune.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/prune.js +49 -0
- package/dist/feature-libraries/modular-schema/prune.js.map +1 -0
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +2 -2
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/dist/feature-libraries/treeTextCursor.d.ts +15 -0
- package/dist/feature-libraries/treeTextCursor.d.ts.map +1 -1
- package/dist/feature-libraries/treeTextCursor.js +64 -1
- package/dist/feature-libraries/treeTextCursor.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/serializedChange.d.ts +2 -2
- package/dist/shared-tree/serializedChange.d.ts.map +1 -1
- package/dist/shared-tree/serializedChange.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +6 -3
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +8 -6
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +2 -2
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +41 -4
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +57 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/transactionMinimize.d.ts.map +1 -1
- package/dist/shared-tree/transactionMinimize.js +2 -2
- package/dist/shared-tree/transactionMinimize.js.map +1 -1
- package/dist/shared-tree/transactionPostProcessor.d.ts +2 -1
- package/dist/shared-tree/transactionPostProcessor.d.ts.map +1 -1
- package/dist/shared-tree/transactionPostProcessor.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +8 -7
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +1 -1
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +23 -9
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +7 -0
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts +4 -4
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +2 -0
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts +3 -14
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +11 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +4 -11
- package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +4 -11
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.d.ts +4 -4
- package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +0 -1
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts +8 -1
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +5 -5
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts +10 -10
- package/dist/shared-tree-core/transaction.d.ts.map +1 -1
- package/dist/shared-tree-core/transaction.js +6 -3
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/simple-tree/api/eraseSchemaDetails.d.ts +15 -0
- package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
- package/dist/simple-tree/api/eraseSchemaDetails.js +15 -0
- package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +21 -2
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts +13 -0
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +9 -0
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/text/textDomain.d.ts +12 -0
- package/dist/text/textDomain.d.ts.map +1 -1
- package/dist/text/textDomain.js +37 -16
- package/dist/text/textDomain.js.map +1 -1
- package/dist/text/textDomainFormatted.d.ts +155 -61
- package/dist/text/textDomainFormatted.d.ts.map +1 -1
- package/dist/text/textDomainFormatted.js +147 -71
- package/dist/text/textDomainFormatted.js.map +1 -1
- package/dist/text/textDomainFormattedDefault.d.ts +37 -14
- package/dist/text/textDomainFormattedDefault.d.ts.map +1 -1
- package/dist/text/textDomainFormattedDefault.js +13 -5
- package/dist/text/textDomainFormattedDefault.js.map +1 -1
- package/dist/treeDataStore.d.ts +49 -0
- package/dist/treeDataStore.d.ts.map +1 -0
- package/dist/treeDataStore.js +57 -0
- package/dist/treeDataStore.js.map +1 -0
- package/dist/treeFactory.d.ts +8 -3
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +6 -1
- package/dist/treeFactory.js.map +1 -1
- package/lib/core/change-family/changeFamily.d.ts +15 -4
- package/lib/core/change-family/changeFamily.d.ts.map +1 -1
- package/lib/core/change-family/changeFamily.js.map +1 -1
- package/lib/core/change-family/editBuilder.d.ts +2 -3
- package/lib/core/change-family/editBuilder.d.ts.map +1 -1
- package/lib/core/change-family/editBuilder.js +1 -2
- package/lib/core/change-family/editBuilder.js.map +1 -1
- package/lib/core/change-family/index.d.ts +1 -1
- package/lib/core/change-family/index.d.ts.map +1 -1
- package/lib/core/change-family/index.js.map +1 -1
- package/lib/core/index.d.ts +3 -2
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/tree/delta.d.ts +62 -16
- package/lib/core/tree/delta.d.ts.map +1 -1
- package/lib/core/tree/delta.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts +7 -13
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +7 -21
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/index.d.ts +1 -0
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js.map +1 -1
- package/lib/core/tree/visitorUtils.d.ts +2 -4
- package/lib/core/tree/visitorUtils.d.ts.map +1 -1
- package/lib/core/tree/visitorUtils.js +2 -2
- package/lib/core/tree/visitorUtils.js.map +1 -1
- package/lib/entrypoints/alpha.d.ts +1 -1
- package/lib/entrypoints/alpha.d.ts.map +1 -1
- package/lib/entrypoints/alpha.js +1 -1
- package/lib/entrypoints/alpha.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +10 -2
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/comparison-forest/comparisonForest.d.ts +51 -0
- package/lib/feature-libraries/comparison-forest/comparisonForest.d.ts.map +1 -0
- package/lib/feature-libraries/comparison-forest/comparisonForest.js +94 -0
- package/lib/feature-libraries/comparison-forest/comparisonForest.js.map +1 -0
- package/lib/feature-libraries/comparison-forest/index.d.ts +6 -0
- package/lib/feature-libraries/comparison-forest/index.d.ts.map +1 -0
- package/lib/feature-libraries/comparison-forest/index.js +6 -0
- package/lib/feature-libraries/comparison-forest/index.js.map +1 -0
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +8 -6
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
- package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/noChangeCodecs.js +3 -1
- package/lib/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +6 -3
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js +16 -4
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -3
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +2 -3
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +4 -3
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +2 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.js +12 -0
- package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +9 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/invert.d.ts +15 -0
- package/lib/feature-libraries/modular-schema/invert.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/invert.js +155 -0
- package/lib/feature-libraries/modular-schema/invert.js.map +1 -0
- package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts +3 -4
- package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/minimizeModularChange.js +2 -2
- package/lib/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +9 -9
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +0 -2
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -22
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +16 -367
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts +61 -0
- package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeUtils.js +192 -0
- package/lib/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -0
- package/lib/feature-libraries/modular-schema/prune.d.ts +10 -0
- package/lib/feature-libraries/modular-schema/prune.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/prune.js +45 -0
- package/lib/feature-libraries/modular-schema/prune.js.map +1 -0
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +2 -2
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/lib/feature-libraries/treeTextCursor.d.ts +15 -0
- package/lib/feature-libraries/treeTextCursor.d.ts.map +1 -1
- package/lib/feature-libraries/treeTextCursor.js +62 -1
- package/lib/feature-libraries/treeTextCursor.js.map +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/serializedChange.d.ts +2 -2
- package/lib/shared-tree/serializedChange.d.ts.map +1 -1
- package/lib/shared-tree/serializedChange.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +6 -3
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +9 -7
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +2 -2
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +41 -4
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +55 -0
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/transactionMinimize.d.ts.map +1 -1
- package/lib/shared-tree/transactionMinimize.js +3 -3
- package/lib/shared-tree/transactionMinimize.js.map +1 -1
- package/lib/shared-tree/transactionPostProcessor.d.ts +2 -1
- package/lib/shared-tree/transactionPostProcessor.d.ts.map +1 -1
- package/lib/shared-tree/transactionPostProcessor.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +8 -7
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +1 -1
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +23 -9
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +7 -0
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts +4 -4
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +2 -0
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts +3 -14
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +11 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +4 -11
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +4 -11
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.d.ts +4 -4
- package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +0 -1
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts +8 -1
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +5 -5
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts +10 -10
- package/lib/shared-tree-core/transaction.d.ts.map +1 -1
- package/lib/shared-tree-core/transaction.js +6 -3
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/simple-tree/api/eraseSchemaDetails.d.ts +15 -0
- package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
- package/lib/simple-tree/api/eraseSchemaDetails.js +15 -0
- package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +21 -2
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts +13 -0
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +9 -0
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/text/textDomain.d.ts +12 -0
- package/lib/text/textDomain.d.ts.map +1 -1
- package/lib/text/textDomain.js +34 -15
- package/lib/text/textDomain.js.map +1 -1
- package/lib/text/textDomainFormatted.d.ts +155 -61
- package/lib/text/textDomainFormatted.d.ts.map +1 -1
- package/lib/text/textDomainFormatted.js +148 -73
- package/lib/text/textDomainFormatted.js.map +1 -1
- package/lib/text/textDomainFormattedDefault.d.ts +37 -14
- package/lib/text/textDomainFormattedDefault.d.ts.map +1 -1
- package/lib/text/textDomainFormattedDefault.js +14 -6
- package/lib/text/textDomainFormattedDefault.js.map +1 -1
- package/lib/treeDataStore.d.ts +49 -0
- package/lib/treeDataStore.d.ts.map +1 -0
- package/lib/treeDataStore.js +52 -0
- package/lib/treeDataStore.js.map +1 -0
- package/lib/treeFactory.d.ts +8 -3
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +5 -0
- package/lib/treeFactory.js.map +1 -1
- package/package.json +25 -24
- package/src/core/change-family/changeFamily.ts +32 -4
- package/src/core/change-family/editBuilder.ts +1 -2
- package/src/core/change-family/index.ts +2 -0
- package/src/core/index.ts +9 -6
- package/src/core/tree/delta.ts +62 -16
- package/src/core/tree/detachedFieldIndex.ts +7 -38
- package/src/core/tree/index.ts +2 -0
- package/src/core/tree/visitorUtils.ts +3 -17
- package/src/entrypoints/alpha.ts +7 -3
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +11 -1
- package/src/feature-libraries/comparison-forest/comparisonForest.ts +140 -0
- package/src/feature-libraries/comparison-forest/index.ts +6 -0
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +20 -6
- package/src/feature-libraries/default-schema/index.ts +1 -0
- package/src/feature-libraries/default-schema/noChangeCodecs.ts +11 -3
- package/src/feature-libraries/detachedFieldIndexSummarizer.ts +33 -5
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -3
- package/src/feature-libraries/index.ts +5 -0
- package/src/feature-libraries/mitigatedChangeFamily.ts +21 -3
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +10 -1
- package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +9 -4
- package/src/feature-libraries/modular-schema/index.ts +1 -0
- package/src/feature-libraries/modular-schema/invert.ts +338 -0
- package/src/feature-libraries/modular-schema/minimizeModularChange.ts +3 -5
- package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +16 -13
- package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +3 -1
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +2 -1
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +45 -644
- package/src/feature-libraries/modular-schema/modularChangeUtils.ts +340 -0
- package/src/feature-libraries/modular-schema/prune.ts +69 -0
- package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +4 -2
- package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +5 -2
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +4 -2
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +4 -2
- package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +6 -3
- package/src/feature-libraries/treeTextCursor.ts +66 -1
- package/src/index.ts +4 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/serializedChange.ts +2 -2
- package/src/shared-tree/sharedTree.ts +34 -14
- package/src/shared-tree/sharedTreeChangeCodecs.ts +11 -3
- package/src/shared-tree/sharedTreeChangeFamily.ts +77 -2
- package/src/shared-tree/transactionMinimize.ts +7 -3
- package/src/shared-tree/transactionPostProcessor.ts +5 -1
- package/src/shared-tree/treeCheckout.ts +55 -16
- package/src/shared-tree-core/branch.ts +40 -12
- package/src/shared-tree-core/editManager.ts +46 -25
- package/src/shared-tree-core/editManagerCodecs.ts +9 -21
- package/src/shared-tree-core/editManagerCodecsCommons.ts +14 -2
- package/src/shared-tree-core/editManagerCodecsV1toV4.ts +18 -21
- package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +18 -20
- package/src/shared-tree-core/editManagerSummarizer.ts +9 -6
- package/src/shared-tree-core/messageCodecV1ToV4.ts +3 -3
- package/src/shared-tree-core/messageCodecVSharedBranches.ts +2 -2
- package/src/shared-tree-core/messageCodecs.ts +12 -2
- package/src/shared-tree-core/sharedTreeCore.ts +15 -6
- package/src/shared-tree-core/transaction.ts +47 -25
- package/src/simple-tree/api/eraseSchemaDetails.ts +15 -0
- package/src/simple-tree/node-kinds/array/arrayNode.ts +21 -2
- package/src/simple-tree/node-kinds/map/mapNode.ts +24 -2
- package/src/text/textDomain.ts +29 -6
- package/src/text/textDomainFormatted.ts +351 -134
- package/src/text/textDomainFormattedDefault.ts +25 -16
- package/src/treeDataStore.ts +125 -0
- package/src/treeFactory.ts +11 -3
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.normalizeFieldId = exports.getParentFieldId = exports.ModularEditBuilder = exports.
|
|
7
|
+
exports.normalizeFieldId = exports.getParentFieldId = exports.ModularEditBuilder = exports.rebaseRevisionMetadataFromInfo = exports.intoDelta = exports.updateRefreshers = exports.relevantRemovedRoots = exports.ModularChangeFamily = void 0;
|
|
8
8
|
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
9
9
|
const internal_2 = require("@fluidframework/telemetry-utils/internal");
|
|
10
10
|
const sorted_btree_es6_1 = require("@tylerbu/sorted-btree-es6");
|
|
@@ -13,10 +13,12 @@ const index_js_1 = require("../../codec/index.js");
|
|
|
13
13
|
const index_js_2 = require("../../core/index.js");
|
|
14
14
|
const index_js_3 = require("../../util/index.js");
|
|
15
15
|
const changeAtomIdBTree_js_1 = require("../changeAtomIdBTree.js");
|
|
16
|
-
const crossFieldQueries_js_1 = require("./crossFieldQueries.js");
|
|
17
16
|
const fieldChangeHandler_js_1 = require("./fieldChangeHandler.js");
|
|
18
17
|
const genericFieldKind_js_1 = require("./genericFieldKind.js");
|
|
19
18
|
const modularChangeTypes_js_1 = require("./modularChangeTypes.js");
|
|
19
|
+
const modularChangeUtils_js_1 = require("./modularChangeUtils.js");
|
|
20
|
+
const invert_js_1 = require("./invert.js");
|
|
21
|
+
const prune_js_1 = require("./prune.js");
|
|
20
22
|
/**
|
|
21
23
|
* Implementation of ChangeFamily which delegates work in a given field to the appropriate FieldKind
|
|
22
24
|
* as determined by the schema.
|
|
@@ -30,6 +32,9 @@ class ModularChangeFamily {
|
|
|
30
32
|
get rebaser() {
|
|
31
33
|
return this;
|
|
32
34
|
}
|
|
35
|
+
buildProcessor(processFn) {
|
|
36
|
+
return (change) => processFn(change, this);
|
|
37
|
+
}
|
|
33
38
|
/**
|
|
34
39
|
* Produces an equivalent list of `FieldChangeset`s that all target the same {@link FlexFieldKind}.
|
|
35
40
|
* @param changes - The list of `FieldChange`s whose `FieldChangeset`s needs to be normalized.
|
|
@@ -51,8 +56,7 @@ class ModularChangeFamily {
|
|
|
51
56
|
change2: change2.change,
|
|
52
57
|
};
|
|
53
58
|
}
|
|
54
|
-
const
|
|
55
|
-
const changeHandler = fieldKind.changeHandler;
|
|
59
|
+
const changeHandler = (0, modularChangeUtils_js_1.getChangeHandler)(this.fieldKinds, kind);
|
|
56
60
|
const normalizedChange1 = this.normalizeFieldChange(change1, changeHandler);
|
|
57
61
|
const normalizedChange2 = this.normalizeFieldChange(change2, changeHandler);
|
|
58
62
|
return {
|
|
@@ -72,13 +76,13 @@ class ModularChangeFamily {
|
|
|
72
76
|
return convertedChange;
|
|
73
77
|
}
|
|
74
78
|
compose(changes) {
|
|
75
|
-
const { revInfos, maxId } = getRevInfoFromTaggedChanges(changes);
|
|
79
|
+
const { revInfos, maxId } = (0, modularChangeUtils_js_1.getRevInfoFromTaggedChanges)(changes);
|
|
76
80
|
const idState = { maxId };
|
|
77
81
|
const pairwiseDelegate = (left, right) => {
|
|
78
82
|
return this.composePair(left, right, revInfos, idState);
|
|
79
83
|
};
|
|
80
84
|
const innerChanges = changes.map((change) => change.change);
|
|
81
|
-
return (0, index_js_3.balancedReduce)(innerChanges, pairwiseDelegate, makeModularChangeset);
|
|
85
|
+
return (0, index_js_3.balancedReduce)(innerChanges, pairwiseDelegate, modularChangeUtils_js_1.makeModularChangeset);
|
|
82
86
|
}
|
|
83
87
|
composePair(change1, change2, revInfos, idState) {
|
|
84
88
|
const { fieldChanges, nodeChanges, nodeToParent, nodeAliases, crossFieldKeys } = this.composeAllFields(change1, change2, revInfos, idState);
|
|
@@ -86,7 +90,7 @@ class ModularChangeFamily {
|
|
|
86
90
|
// The composed changeset has a "no change" constraint if either change has one
|
|
87
91
|
const noChangeConstraint = change1.noChangeConstraint ?? change2.noChangeConstraint;
|
|
88
92
|
const noChangeConstraintOnRevert = change1.noChangeConstraintOnRevert ?? change2.noChangeConstraintOnRevert;
|
|
89
|
-
return makeModularChangeset({
|
|
93
|
+
return (0, modularChangeUtils_js_1.makeModularChangeset)({
|
|
90
94
|
fieldChanges,
|
|
91
95
|
nodeChanges,
|
|
92
96
|
nodeToParent,
|
|
@@ -137,7 +141,7 @@ class ModularChangeFamily {
|
|
|
137
141
|
const context = crossFieldTable.fieldToContext.get(fieldChange);
|
|
138
142
|
(0, internal_1.assert)(context !== undefined, 0x8cc /* Should have context for every invalidated field */);
|
|
139
143
|
const { fieldId, change1: fieldChange1, change2: fieldChange2, composedChange } = context;
|
|
140
|
-
const rebaser = getChangeHandler(this.fieldKinds, composedChange.fieldKind).rebaser;
|
|
144
|
+
const rebaser = (0, modularChangeUtils_js_1.getChangeHandler)(this.fieldKinds, composedChange.fieldKind).rebaser;
|
|
141
145
|
const composeNodes = (child1, child2) => {
|
|
142
146
|
if (child1 !== undefined &&
|
|
143
147
|
child2 !== undefined &&
|
|
@@ -215,7 +219,7 @@ class ModularChangeFamily {
|
|
|
215
219
|
continue;
|
|
216
220
|
}
|
|
217
221
|
const nodeId = (0, changeAtomIdBTree_js_1.getFromChangeAtomIdMap)(table.newToBaseNodeId, fieldId.nodeId) ?? fieldId.nodeId;
|
|
218
|
-
let nodeChangeset = nodeChangeFromId(composedNodes, nodeId);
|
|
222
|
+
let nodeChangeset = (0, modularChangeUtils_js_1.nodeChangeFromId)(composedNodes, nodeId);
|
|
219
223
|
if (!table.composedNodes.has(nodeChangeset)) {
|
|
220
224
|
nodeChangeset = cloneNodeChangeset(nodeChangeset);
|
|
221
225
|
(0, changeAtomIdBTree_js_1.setInChangeAtomIdMap)(composedNodes, nodeId, nodeChangeset);
|
|
@@ -283,8 +287,8 @@ class ModularChangeFamily {
|
|
|
283
287
|
return composedField;
|
|
284
288
|
}
|
|
285
289
|
composeNodesById(nodeChanges1, nodeChanges2, composedNodes, composedNodeToParent, nodeAliases, id1, id2, idAllocator, crossFieldTable, revisionMetadata) {
|
|
286
|
-
const nodeChangeset1 = nodeChangeFromId(nodeChanges1, id1);
|
|
287
|
-
const nodeChangeset2 = nodeChangeFromId(nodeChanges2, id2);
|
|
290
|
+
const nodeChangeset1 = (0, modularChangeUtils_js_1.nodeChangeFromId)(nodeChanges1, id1);
|
|
291
|
+
const nodeChangeset2 = (0, modularChangeUtils_js_1.nodeChangeFromId)(nodeChanges2, id2);
|
|
288
292
|
const composedNodeChangeset = this.composeNodeChanges(id1, nodeChangeset1, nodeChangeset2, idAllocator, crossFieldTable, revisionMetadata);
|
|
289
293
|
(0, changeAtomIdBTree_js_1.setInChangeAtomIdMap)(composedNodes, id1, composedNodeChangeset);
|
|
290
294
|
if (!(0, index_js_2.areEqualChangeAtomIds)(id1, id2)) {
|
|
@@ -322,106 +326,8 @@ class ModularChangeFamily {
|
|
|
322
326
|
}
|
|
323
327
|
return composedNodeChange;
|
|
324
328
|
}
|
|
325
|
-
/**
|
|
326
|
-
* @param change - The change to invert.
|
|
327
|
-
* @param isRollback - Whether the inverted change is meant to rollback a change on a branch as is the case when
|
|
328
|
-
* performing a sandwich rebase.
|
|
329
|
-
* @param revisionForInvert - The revision for the invert changeset.
|
|
330
|
-
*/
|
|
331
329
|
invert(change, isRollback, revisionForInvert) {
|
|
332
|
-
|
|
333
|
-
const destroys = isRollback ? invertBuilds(change.change.builds) : undefined;
|
|
334
|
-
// Destroys only occur in rollback changesets, which are never inverted.
|
|
335
|
-
(0, internal_1.assert)(change.change.destroys === undefined, 0x89a /* Unexpected destroys in change to invert */);
|
|
336
|
-
const revInfos = isRollback
|
|
337
|
-
? [{ revision: revisionForInvert, rollbackOf: change.revision }]
|
|
338
|
-
: [{ revision: revisionForInvert }];
|
|
339
|
-
const noChangeConstraint = change.change.noChangeConstraintOnRevert;
|
|
340
|
-
const noChangeConstraintOnRevert = change.change.noChangeConstraint;
|
|
341
|
-
if (hasConflicts(change.change)) {
|
|
342
|
-
return makeModularChangeset({
|
|
343
|
-
maxId: change.change.maxId,
|
|
344
|
-
revisions: revInfos,
|
|
345
|
-
destroys,
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
|
-
const genId = (0, index_js_3.idAllocatorFromMaxId)(change.change.maxId ?? -1);
|
|
349
|
-
const crossFieldTable = {
|
|
350
|
-
...newCrossFieldTable(),
|
|
351
|
-
originalFieldToContext: new Map(),
|
|
352
|
-
invertedNodeToParent: (0, index_js_3.brand)(change.change.nodeToParent.clone()),
|
|
353
|
-
};
|
|
354
|
-
const { revInfos: oldRevInfos } = getRevInfoFromTaggedChanges([change]);
|
|
355
|
-
const revisionMetadata = (0, index_js_2.revisionMetadataSourceFromInfo)(oldRevInfos);
|
|
356
|
-
const invertedFields = this.invertFieldMap(change.change.fieldChanges, undefined, isRollback, genId, crossFieldTable, revisionMetadata, revisionForInvert);
|
|
357
|
-
const invertedNodes = (0, changeAtomIdBTree_js_1.newChangeAtomIdBTree)();
|
|
358
|
-
change.change.nodeChanges.forEachPair(([revision, localId], nodeChangeset) => {
|
|
359
|
-
invertedNodes.set([revision, localId], this.invertNodeChange(nodeChangeset, { revision, localId }, isRollback, genId, crossFieldTable, revisionMetadata, revisionForInvert));
|
|
360
|
-
});
|
|
361
|
-
if (crossFieldTable.invalidatedFields.size > 0) {
|
|
362
|
-
const fieldsToUpdate = crossFieldTable.invalidatedFields;
|
|
363
|
-
crossFieldTable.invalidatedFields = new Set();
|
|
364
|
-
for (const fieldChange of fieldsToUpdate) {
|
|
365
|
-
const originalFieldChange = fieldChange.change;
|
|
366
|
-
const context = crossFieldTable.originalFieldToContext.get(fieldChange);
|
|
367
|
-
(0, internal_1.assert)(context !== undefined, 0x851 /* Should have context for every invalidated field */);
|
|
368
|
-
const { invertedField, fieldId } = context;
|
|
369
|
-
const amendedChange = getChangeHandler(this.fieldKinds, fieldChange.fieldKind).rebaser.invert(originalFieldChange, isRollback, genId, revisionForInvert, new InvertManager(crossFieldTable, fieldChange, fieldId), revisionMetadata);
|
|
370
|
-
invertedField.change = (0, index_js_3.brand)(amendedChange);
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
const crossFieldKeys = this.makeCrossFieldKeyTable(invertedFields, invertedNodes);
|
|
374
|
-
const constraintState = newConstraintState(0);
|
|
375
|
-
this.updateConstraintsForFields(invertedFields, fieldChangeHandler_js_1.NodeAttachState.Attached, constraintState, invertedNodes);
|
|
376
|
-
return makeModularChangeset({
|
|
377
|
-
fieldChanges: invertedFields,
|
|
378
|
-
nodeChanges: invertedNodes,
|
|
379
|
-
nodeToParent: crossFieldTable.invertedNodeToParent,
|
|
380
|
-
nodeAliases: change.change.nodeAliases,
|
|
381
|
-
crossFieldKeys,
|
|
382
|
-
maxId: genId.getMaxId(),
|
|
383
|
-
revisions: revInfos,
|
|
384
|
-
constraintViolationCount: constraintState.violationCount,
|
|
385
|
-
noChangeConstraint,
|
|
386
|
-
noChangeConstraintOnRevert,
|
|
387
|
-
destroys,
|
|
388
|
-
});
|
|
389
|
-
}
|
|
390
|
-
invertFieldMap(changes, parentId, isRollback, genId, crossFieldTable, revisionMetadata, revisionForInvert) {
|
|
391
|
-
const invertedFields = new Map();
|
|
392
|
-
for (const [field, fieldChange] of changes) {
|
|
393
|
-
const fieldId = { nodeId: parentId, field };
|
|
394
|
-
const manager = new InvertManager(crossFieldTable, fieldChange, fieldId);
|
|
395
|
-
const invertedChange = getChangeHandler(this.fieldKinds, fieldChange.fieldKind).rebaser.invert(fieldChange.change, isRollback, genId, revisionForInvert, manager, revisionMetadata);
|
|
396
|
-
const invertedFieldChange = {
|
|
397
|
-
...fieldChange,
|
|
398
|
-
change: (0, index_js_3.brand)(invertedChange),
|
|
399
|
-
};
|
|
400
|
-
invertedFields.set(field, invertedFieldChange);
|
|
401
|
-
crossFieldTable.originalFieldToContext.set(fieldChange, {
|
|
402
|
-
fieldId,
|
|
403
|
-
invertedField: invertedFieldChange,
|
|
404
|
-
});
|
|
405
|
-
}
|
|
406
|
-
return invertedFields;
|
|
407
|
-
}
|
|
408
|
-
invertNodeChange(change, id, isRollback, genId, crossFieldTable, revisionMetadata, revisionForInvert) {
|
|
409
|
-
const inverse = {};
|
|
410
|
-
// If the node has a constraint, it should be inverted to a node-exist-on-revert constraint. This ensure that if
|
|
411
|
-
// the inverse is inverted again, the original input constraint will be restored.
|
|
412
|
-
if (change.nodeExistsConstraint !== undefined) {
|
|
413
|
-
inverse.nodeExistsConstraintOnRevert = change.nodeExistsConstraint;
|
|
414
|
-
}
|
|
415
|
-
// The node-exist-on-revert constraint of a node is the constraint that should apply when the a change is reverted.
|
|
416
|
-
// So, it should become the constraint in the inverse. If this constraint is violated when applying the inverse,
|
|
417
|
-
// it will be discarded.
|
|
418
|
-
if (change.nodeExistsConstraintOnRevert !== undefined) {
|
|
419
|
-
inverse.nodeExistsConstraint = change.nodeExistsConstraintOnRevert;
|
|
420
|
-
}
|
|
421
|
-
if (change.fieldChanges !== undefined) {
|
|
422
|
-
inverse.fieldChanges = this.invertFieldMap(change.fieldChanges, id, isRollback, genId, crossFieldTable, revisionMetadata, revisionForInvert);
|
|
423
|
-
}
|
|
424
|
-
return inverse;
|
|
330
|
+
return (0, invert_js_1.invertModularChange)(change, isRollback, revisionForInvert, this.fieldKinds);
|
|
425
331
|
}
|
|
426
332
|
rebase(taggedChange, potentiallyConflictedOver, revisionMetadata, ignoreNoChangeViolation = false) {
|
|
427
333
|
// Our current cell ordering scheme in sequences depends on being able to rebase over a change with conflicts.
|
|
@@ -434,7 +340,7 @@ class ModularChangeFamily {
|
|
|
434
340
|
const idState = { maxId };
|
|
435
341
|
const genId = (0, index_js_3.idAllocatorFromState)(idState);
|
|
436
342
|
const crossFieldTable = {
|
|
437
|
-
...newCrossFieldTable(),
|
|
343
|
+
...(0, modularChangeUtils_js_1.newCrossFieldTable)(),
|
|
438
344
|
newChange: change,
|
|
439
345
|
baseChange: over.change,
|
|
440
346
|
baseFieldToContext: new Map(),
|
|
@@ -446,7 +352,7 @@ class ModularChangeFamily {
|
|
|
446
352
|
affectedBaseFields: newFieldIdKeyBTree(),
|
|
447
353
|
fieldsWithUnattachedChild: new Set(),
|
|
448
354
|
};
|
|
449
|
-
const getBaseRevisions = () => revisionInfoFromTaggedChange(over).map((info) => info.revision);
|
|
355
|
+
const getBaseRevisions = () => (0, modularChangeUtils_js_1.revisionInfoFromTaggedChange)(over).map((info) => info.revision);
|
|
450
356
|
const rebaseMetadata = {
|
|
451
357
|
...revisionMetadata,
|
|
452
358
|
getRevisionToRebase: () => taggedChange.revision,
|
|
@@ -455,7 +361,7 @@ class ModularChangeFamily {
|
|
|
455
361
|
const rebasedNodes = (0, index_js_3.brand)(change.nodeChanges.clone());
|
|
456
362
|
const rebasedFields = this.rebaseIntersectingFields(crossFieldTable, rebasedNodes, genId, rebaseMetadata);
|
|
457
363
|
this.rebaseInvalidatedElements(rebasedFields, rebasedNodes, crossFieldTable, rebaseMetadata, genId);
|
|
458
|
-
const constraintState = newConstraintState(change.constraintViolationCount ?? 0);
|
|
364
|
+
const constraintState = (0, modularChangeUtils_js_1.newConstraintState)(change.constraintViolationCount ?? 0);
|
|
459
365
|
let noChangeConstraint = change.noChangeConstraint;
|
|
460
366
|
if (noChangeConstraint !== undefined &&
|
|
461
367
|
!noChangeConstraint.violated &&
|
|
@@ -463,9 +369,9 @@ class ModularChangeFamily {
|
|
|
463
369
|
noChangeConstraint = { violated: true };
|
|
464
370
|
constraintState.violationCount += 1;
|
|
465
371
|
}
|
|
466
|
-
|
|
467
|
-
const rebased = makeModularChangeset({
|
|
468
|
-
fieldChanges:
|
|
372
|
+
(0, modularChangeUtils_js_1.updateConstraintsForFields)(rebasedFields, fieldChangeHandler_js_1.NodeAttachState.Attached, constraintState, rebasedNodes, this.fieldKinds);
|
|
373
|
+
const rebased = (0, modularChangeUtils_js_1.makeModularChangeset)({
|
|
374
|
+
fieldChanges: (0, prune_js_1.pruneFieldMap)(rebasedFields, rebasedNodes, this.fieldKinds),
|
|
469
375
|
nodeChanges: rebasedNodes,
|
|
470
376
|
nodeToParent: crossFieldTable.rebasedNodeToParent,
|
|
471
377
|
nodeAliases: change.nodeAliases,
|
|
@@ -510,7 +416,7 @@ class ModularChangeFamily {
|
|
|
510
416
|
}
|
|
511
417
|
// This field has no changes in the new changeset, otherwise it would have been added to
|
|
512
418
|
// `crossFieldTable.baseFieldToContext` when processing fields with both base and new changes.
|
|
513
|
-
const handler = getChangeHandler(this.fieldKinds, baseFieldChange.fieldKind);
|
|
419
|
+
const handler = (0, modularChangeUtils_js_1.getChangeHandler)(this.fieldKinds, baseFieldChange.fieldKind);
|
|
514
420
|
const fieldChange = {
|
|
515
421
|
...baseFieldChange,
|
|
516
422
|
change: (0, index_js_3.brand)(handler.createEmpty()),
|
|
@@ -608,7 +514,7 @@ class ModularChangeFamily {
|
|
|
608
514
|
table.fieldsWithUnattachedChild.add(baseFieldChange);
|
|
609
515
|
return;
|
|
610
516
|
}
|
|
611
|
-
const handler = getChangeHandler(this.fieldKinds, baseFieldChange.fieldKind);
|
|
517
|
+
const handler = (0, modularChangeUtils_js_1.getChangeHandler)(this.fieldKinds, baseFieldChange.fieldKind);
|
|
612
518
|
const fieldChange = {
|
|
613
519
|
...baseFieldChange,
|
|
614
520
|
change: (0, index_js_3.brand)(handler.createEmpty()),
|
|
@@ -662,8 +568,8 @@ class ModularChangeFamily {
|
|
|
662
568
|
return rebasedFields;
|
|
663
569
|
}
|
|
664
570
|
rebaseNodeChange(newId, baseId, genId, crossFieldTable, revisionMetadata) {
|
|
665
|
-
const change = nodeChangeFromId(crossFieldTable.newChange.nodeChanges, newId);
|
|
666
|
-
const over = nodeChangeFromId(crossFieldTable.baseChange.nodeChanges, baseId);
|
|
571
|
+
const change = (0, modularChangeUtils_js_1.nodeChangeFromId)(crossFieldTable.newChange.nodeChanges, newId);
|
|
572
|
+
const over = (0, modularChangeUtils_js_1.nodeChangeFromId)(crossFieldTable.baseChange.nodeChanges, baseId);
|
|
667
573
|
const baseMap = over?.fieldChanges ?? new Map();
|
|
668
574
|
const fieldChanges = change.fieldChanges !== undefined && over.fieldChanges !== undefined
|
|
669
575
|
? this.rebaseFieldMap(change?.fieldChanges ?? new Map(), baseMap, newId, genId, crossFieldTable, revisionMetadata)
|
|
@@ -681,66 +587,6 @@ class ModularChangeFamily {
|
|
|
681
587
|
(0, changeAtomIdBTree_js_1.setInChangeAtomIdMap)(crossFieldTable.baseToRebasedNodeId, baseId, newId);
|
|
682
588
|
return rebasedChange;
|
|
683
589
|
}
|
|
684
|
-
updateConstraintsForFields(fields, parentInputAttachState, constraintState, nodes) {
|
|
685
|
-
for (const field of fields.values()) {
|
|
686
|
-
const handler = getChangeHandler(this.fieldKinds, field.fieldKind);
|
|
687
|
-
for (const [nodeId, inputIndex, _outputIndex] of handler.getNestedChanges(field.change)) {
|
|
688
|
-
const isInputDetached = inputIndex === undefined;
|
|
689
|
-
const inputAttachState = parentInputAttachState === fieldChangeHandler_js_1.NodeAttachState.Detached || isInputDetached
|
|
690
|
-
? fieldChangeHandler_js_1.NodeAttachState.Detached
|
|
691
|
-
: fieldChangeHandler_js_1.NodeAttachState.Attached;
|
|
692
|
-
this.updateConstraintsForNode(nodeId, inputAttachState, nodes, constraintState);
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
updateConstraintsForNode(nodeId, inputAttachState, nodes, constraintState) {
|
|
697
|
-
const node = nodes.get([nodeId.revision, nodeId.localId]) ?? (0, internal_1.fail)(0xb24 /* Unknown node ID */);
|
|
698
|
-
if (node.nodeExistsConstraint !== undefined) {
|
|
699
|
-
const isNowViolated = inputAttachState === fieldChangeHandler_js_1.NodeAttachState.Detached;
|
|
700
|
-
if (node.nodeExistsConstraint.violated !== isNowViolated) {
|
|
701
|
-
node.nodeExistsConstraint = {
|
|
702
|
-
...node.nodeExistsConstraint,
|
|
703
|
-
violated: isNowViolated,
|
|
704
|
-
};
|
|
705
|
-
constraintState.violationCount += isNowViolated ? 1 : -1;
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
if (node.fieldChanges !== undefined) {
|
|
709
|
-
this.updateConstraintsForFields(node.fieldChanges, inputAttachState, constraintState, nodes);
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
pruneFieldMap(changeset, nodeMap) {
|
|
713
|
-
if (changeset === undefined) {
|
|
714
|
-
return undefined;
|
|
715
|
-
}
|
|
716
|
-
const prunedChangeset = new Map();
|
|
717
|
-
for (const [field, fieldChange] of changeset) {
|
|
718
|
-
const handler = getChangeHandler(this.fieldKinds, fieldChange.fieldKind);
|
|
719
|
-
const prunedFieldChangeset = handler.rebaser.prune(fieldChange.change, (nodeId) => this.pruneNodeChange(nodeId, nodeMap));
|
|
720
|
-
if (!handler.isEmpty(prunedFieldChangeset)) {
|
|
721
|
-
prunedChangeset.set(field, { ...fieldChange, change: (0, index_js_3.brand)(prunedFieldChangeset) });
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
return prunedChangeset.size > 0 ? prunedChangeset : undefined;
|
|
725
|
-
}
|
|
726
|
-
pruneNodeChange(nodeId, nodeMap) {
|
|
727
|
-
const changeset = nodeChangeFromId(nodeMap, nodeId);
|
|
728
|
-
const prunedFields = changeset.fieldChanges === undefined
|
|
729
|
-
? undefined
|
|
730
|
-
: this.pruneFieldMap(changeset.fieldChanges, nodeMap);
|
|
731
|
-
const prunedChange = { ...changeset, fieldChanges: prunedFields };
|
|
732
|
-
if (prunedChange.fieldChanges === undefined) {
|
|
733
|
-
delete prunedChange.fieldChanges;
|
|
734
|
-
}
|
|
735
|
-
if (isEmptyNodeChangeset(prunedChange)) {
|
|
736
|
-
nodeMap.delete([nodeId.revision, nodeId.localId]);
|
|
737
|
-
return undefined;
|
|
738
|
-
}
|
|
739
|
-
else {
|
|
740
|
-
(0, changeAtomIdBTree_js_1.setInChangeAtomIdMap)(nodeMap, nodeId, prunedChange);
|
|
741
|
-
return nodeId;
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
590
|
getRevisions(change) {
|
|
745
591
|
if (change.revisions === undefined || change.revisions.length === 0) {
|
|
746
592
|
return new Set([undefined]);
|
|
@@ -786,37 +632,16 @@ class ModularChangeFamily {
|
|
|
786
632
|
replaceFieldMapRevisions(fields, replacer) {
|
|
787
633
|
const updatedFields = new Map();
|
|
788
634
|
for (const [field, fieldChange] of fields) {
|
|
789
|
-
const updatedFieldChange = getChangeHandler(this.fieldKinds, fieldChange.fieldKind).rebaser.replaceRevisions(fieldChange.change, replacer);
|
|
635
|
+
const updatedFieldChange = (0, modularChangeUtils_js_1.getChangeHandler)(this.fieldKinds, fieldChange.fieldKind).rebaser.replaceRevisions(fieldChange.change, replacer);
|
|
790
636
|
updatedFields.set(field, { ...fieldChange, change: (0, index_js_3.brand)(updatedFieldChange) });
|
|
791
637
|
}
|
|
792
638
|
return updatedFields;
|
|
793
639
|
}
|
|
794
|
-
makeCrossFieldKeyTable(fields, nodes) {
|
|
795
|
-
const keys = (0, modularChangeTypes_js_1.newCrossFieldKeyTable)();
|
|
796
|
-
this.populateCrossFieldKeyTableForFieldMap(keys, fields, undefined);
|
|
797
|
-
nodes.forEachPair(([revision, localId], node) => {
|
|
798
|
-
if (node.fieldChanges !== undefined) {
|
|
799
|
-
this.populateCrossFieldKeyTableForFieldMap(keys, node.fieldChanges, {
|
|
800
|
-
revision,
|
|
801
|
-
localId,
|
|
802
|
-
});
|
|
803
|
-
}
|
|
804
|
-
});
|
|
805
|
-
return keys;
|
|
806
|
-
}
|
|
807
|
-
populateCrossFieldKeyTableForFieldMap(table, fields, parent) {
|
|
808
|
-
for (const [fieldKey, fieldChange] of fields) {
|
|
809
|
-
const keys = getChangeHandler(this.fieldKinds, fieldChange.fieldKind).getCrossFieldKeys(fieldChange.change);
|
|
810
|
-
for (const { key, count } of keys) {
|
|
811
|
-
table.set(key, count, { nodeId: parent, field: fieldKey });
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
640
|
buildEditor(mintRevisionTag, changeReceiver) {
|
|
816
|
-
return new ModularEditBuilder(this, this.fieldKinds, changeReceiver, this.codecOptions);
|
|
641
|
+
return new ModularEditBuilder(this.rebaser, this.fieldKinds, changeReceiver, this.codecOptions);
|
|
817
642
|
}
|
|
818
643
|
createEmptyFieldChange(fieldKind) {
|
|
819
|
-
const emptyChange = getChangeHandler(this.fieldKinds, fieldKind).createEmpty();
|
|
644
|
+
const emptyChange = (0, modularChangeUtils_js_1.getChangeHandler)(this.fieldKinds, fieldKind).createEmpty();
|
|
820
645
|
return { fieldKind, change: (0, index_js_3.brand)(emptyChange) };
|
|
821
646
|
}
|
|
822
647
|
validateChangeset(change) {
|
|
@@ -840,7 +665,7 @@ class ModularChangeFamily {
|
|
|
840
665
|
let numChildren = 0;
|
|
841
666
|
for (const [field, fieldChange] of fieldChanges.entries()) {
|
|
842
667
|
const fieldId = { nodeId: nodeParent, field };
|
|
843
|
-
const handler = getChangeHandler(this.fieldKinds, fieldChange.fieldKind);
|
|
668
|
+
const handler = (0, modularChangeUtils_js_1.getChangeHandler)(this.fieldKinds, fieldChange.fieldKind);
|
|
844
669
|
for (const [child, _index] of handler.getNestedChanges(fieldChange.change)) {
|
|
845
670
|
const parentFieldId = getParentFieldId(change, child);
|
|
846
671
|
(0, internal_1.assert)(areEqualFieldIds(parentFieldId, fieldId), 0xa4e /* Inconsistent node parentage */);
|
|
@@ -856,7 +681,7 @@ class ModularChangeFamily {
|
|
|
856
681
|
return numChildren;
|
|
857
682
|
}
|
|
858
683
|
getEffectiveChange(change) {
|
|
859
|
-
if (hasConflicts(change)) {
|
|
684
|
+
if ((0, modularChangeUtils_js_1.hasConflicts)(change)) {
|
|
860
685
|
return this.muteChange(change);
|
|
861
686
|
}
|
|
862
687
|
return change;
|
|
@@ -886,7 +711,7 @@ class ModularChangeFamily {
|
|
|
886
711
|
return new Map(Array.from(change.entries(), ([key, value]) => [key, this.muteFieldChange(value)]));
|
|
887
712
|
}
|
|
888
713
|
muteFieldChange(change) {
|
|
889
|
-
const handler = getChangeHandler(this.fieldKinds, change.fieldKind);
|
|
714
|
+
const handler = (0, modularChangeUtils_js_1.getChangeHandler)(this.fieldKinds, change.fieldKind);
|
|
890
715
|
return {
|
|
891
716
|
fieldKind: change.fieldKind,
|
|
892
717
|
change: (0, index_js_3.brand)(handler.rebaser.filterEdits(change.change, {
|
|
@@ -898,7 +723,7 @@ class ModularChangeFamily {
|
|
|
898
723
|
}
|
|
899
724
|
}
|
|
900
725
|
exports.ModularChangeFamily = ModularChangeFamily;
|
|
901
|
-
ModularChangeFamily.emptyChange = makeModularChangeset();
|
|
726
|
+
ModularChangeFamily.emptyChange = (0, modularChangeUtils_js_1.makeModularChangeset)();
|
|
902
727
|
function removeAllEditsFilter(_id, count, _endpointId) {
|
|
903
728
|
return { value: fieldChangeHandler_js_1.EditFilterStatus.Remove, length: count };
|
|
904
729
|
}
|
|
@@ -964,12 +789,6 @@ function composeBuildsDestroysAndRefreshers(change1, change2) {
|
|
|
964
789
|
}
|
|
965
790
|
return { allBuilds, allDestroys, allRefreshers };
|
|
966
791
|
}
|
|
967
|
-
function invertBuilds(builds) {
|
|
968
|
-
if (builds !== undefined) {
|
|
969
|
-
return (0, index_js_3.brand)(builds.mapValues((chunk) => chunk.topLevelLength));
|
|
970
|
-
}
|
|
971
|
-
return undefined;
|
|
972
|
-
}
|
|
973
792
|
/**
|
|
974
793
|
* Returns the set of removed roots that should be in memory for the given change to be applied.
|
|
975
794
|
* A removed root is relevant if any of the following is true:
|
|
@@ -990,7 +809,7 @@ function* relevantRemovedRoots(change, fieldKinds) {
|
|
|
990
809
|
}
|
|
991
810
|
exports.relevantRemovedRoots = relevantRemovedRoots;
|
|
992
811
|
function* relevantRemovedRootsFromNode(node, nodeChanges, fieldKinds) {
|
|
993
|
-
const nodeChangeset = nodeChangeFromId(nodeChanges, node);
|
|
812
|
+
const nodeChangeset = (0, modularChangeUtils_js_1.nodeChangeFromId)(nodeChanges, node);
|
|
994
813
|
if (nodeChangeset.fieldChanges !== undefined) {
|
|
995
814
|
yield* relevantRemovedRootsFromFields(nodeChangeset.fieldChanges, nodeChanges, fieldKinds);
|
|
996
815
|
}
|
|
@@ -998,7 +817,7 @@ function* relevantRemovedRootsFromNode(node, nodeChanges, fieldKinds) {
|
|
|
998
817
|
function* relevantRemovedRootsFromFields(change, nodeChanges, fieldKinds) {
|
|
999
818
|
const delegate = (node) => relevantRemovedRootsFromNode(node, nodeChanges, fieldKinds);
|
|
1000
819
|
for (const [_, fieldChange] of change) {
|
|
1001
|
-
const handler = getChangeHandler(fieldKinds, fieldChange.fieldKind);
|
|
820
|
+
const handler = (0, modularChangeUtils_js_1.getChangeHandler)(fieldKinds, fieldChange.fieldKind);
|
|
1002
821
|
yield* handler.relevantRemovedRoots(fieldChange.change, delegate);
|
|
1003
822
|
}
|
|
1004
823
|
}
|
|
@@ -1046,7 +865,7 @@ function updateRefreshers(change, getDetachedNode, removedRoots, requireRefreshe
|
|
|
1046
865
|
}
|
|
1047
866
|
}
|
|
1048
867
|
const { fieldChanges, nodeChanges, nodeToParent, nodeAliases, crossFieldKeys, maxId, revisions, constraintViolationCount, builds, destroys, } = change;
|
|
1049
|
-
return makeModularChangeset({
|
|
868
|
+
return (0, modularChangeUtils_js_1.makeModularChangeset)({
|
|
1050
869
|
fieldChanges,
|
|
1051
870
|
nodeChanges,
|
|
1052
871
|
nodeToParent,
|
|
@@ -1072,7 +891,7 @@ function intoDelta(taggedChange, fieldKinds) {
|
|
|
1072
891
|
const rootDelta = {};
|
|
1073
892
|
const global = [];
|
|
1074
893
|
const rename = [];
|
|
1075
|
-
if (!hasConflicts(change)) {
|
|
894
|
+
if (!(0, modularChangeUtils_js_1.hasConflicts)(change)) {
|
|
1076
895
|
// If there are no constraint violations, then tree changes apply.
|
|
1077
896
|
const fieldDeltas = intoDeltaImpl(change.fieldChanges, change.nodeChanges, fieldKinds, global, rename);
|
|
1078
897
|
if (fieldDeltas.size > 0) {
|
|
@@ -1124,8 +943,8 @@ function copyDetachedNodes(detachedNodes) {
|
|
|
1124
943
|
function intoDeltaImpl(change, nodeChanges, fieldKinds, global, rename) {
|
|
1125
944
|
const delta = new Map();
|
|
1126
945
|
for (const [field, fieldChange] of change) {
|
|
1127
|
-
const { local: fieldChanges, global: fieldGlobal, rename: fieldRename, } = getChangeHandler(fieldKinds, fieldChange.fieldKind).intoDelta(fieldChange.change, (childChange) => {
|
|
1128
|
-
const nodeChange = nodeChangeFromId(nodeChanges, childChange);
|
|
946
|
+
const { local: fieldChanges, global: fieldGlobal, rename: fieldRename, } = (0, modularChangeUtils_js_1.getChangeHandler)(fieldKinds, fieldChange.fieldKind).intoDelta(fieldChange.change, (childChange) => {
|
|
947
|
+
const nodeChange = (0, modularChangeUtils_js_1.nodeChangeFromId)(nodeChanges, childChange);
|
|
1129
948
|
return deltaFromNodeChange(nodeChange, nodeChanges, fieldKinds, global, rename);
|
|
1130
949
|
});
|
|
1131
950
|
if (fieldChanges !== undefined && fieldChanges.marks.length > 0) {
|
|
@@ -1174,27 +993,9 @@ function rebaseRevisionMetadataFromInfo(revInfos, revisionToRebase, baseRevision
|
|
|
1174
993
|
};
|
|
1175
994
|
}
|
|
1176
995
|
exports.rebaseRevisionMetadataFromInfo = rebaseRevisionMetadataFromInfo;
|
|
1177
|
-
function isEmptyNodeChangeset(change) {
|
|
1178
|
-
return (change.fieldChanges === undefined &&
|
|
1179
|
-
change.nodeExistsConstraint === undefined &&
|
|
1180
|
-
change.nodeExistsConstraintOnRevert === undefined);
|
|
1181
|
-
}
|
|
1182
|
-
function getFieldKind(fieldKinds, kind) {
|
|
1183
|
-
if (kind === genericFieldKind_js_1.genericFieldKind.identifier) {
|
|
1184
|
-
return genericFieldKind_js_1.genericFieldKind;
|
|
1185
|
-
}
|
|
1186
|
-
const fieldKind = fieldKinds.get(kind);
|
|
1187
|
-
(0, internal_1.assert)(fieldKind !== undefined, 0x3ad /* Unknown field kind */);
|
|
1188
|
-
return fieldKind;
|
|
1189
|
-
}
|
|
1190
|
-
exports.getFieldKind = getFieldKind;
|
|
1191
|
-
function getChangeHandler(fieldKinds, kind) {
|
|
1192
|
-
return getFieldKind(fieldKinds, kind).changeHandler;
|
|
1193
|
-
}
|
|
1194
|
-
exports.getChangeHandler = getChangeHandler;
|
|
1195
996
|
function newComposeTable(baseChange, newChange, composedNodeToParent) {
|
|
1196
997
|
return {
|
|
1197
|
-
...newCrossFieldTable(),
|
|
998
|
+
...(0, modularChangeUtils_js_1.newCrossFieldTable)(),
|
|
1198
999
|
baseChange,
|
|
1199
1000
|
newChange,
|
|
1200
1001
|
fieldToContext: new Map(),
|
|
@@ -1209,76 +1010,7 @@ function newComposeTable(baseChange, newChange, composedNodeToParent) {
|
|
|
1209
1010
|
},
|
|
1210
1011
|
};
|
|
1211
1012
|
}
|
|
1212
|
-
|
|
1213
|
-
return {
|
|
1214
|
-
srcTable: (0, index_js_2.newChangeAtomIdRangeMap)(),
|
|
1215
|
-
dstTable: (0, index_js_2.newChangeAtomIdRangeMap)(),
|
|
1216
|
-
srcDependents: (0, index_js_2.newChangeAtomIdRangeMap)(),
|
|
1217
|
-
dstDependents: (0, index_js_2.newChangeAtomIdRangeMap)(),
|
|
1218
|
-
invalidatedFields: new Set(),
|
|
1219
|
-
};
|
|
1220
|
-
}
|
|
1221
|
-
function newConstraintState(violationCount) {
|
|
1222
|
-
return {
|
|
1223
|
-
violationCount,
|
|
1224
|
-
};
|
|
1225
|
-
}
|
|
1226
|
-
class CrossFieldManagerI {
|
|
1227
|
-
constructor(crossFieldTable, currentFieldKey, allowInval = true) {
|
|
1228
|
-
this.crossFieldTable = crossFieldTable;
|
|
1229
|
-
this.currentFieldKey = currentFieldKey;
|
|
1230
|
-
this.allowInval = allowInval;
|
|
1231
|
-
}
|
|
1232
|
-
set(target, revision, id, count, newValue, invalidateDependents) {
|
|
1233
|
-
if (invalidateDependents && this.allowInval) {
|
|
1234
|
-
const lastChangedId = id + count - 1;
|
|
1235
|
-
let firstId = id;
|
|
1236
|
-
while (firstId <= lastChangedId) {
|
|
1237
|
-
const dependentEntry = (0, crossFieldQueries_js_1.getFirstFromCrossFieldMap)(this.getDependents(target), revision, firstId, lastChangedId - firstId + 1);
|
|
1238
|
-
if (dependentEntry.value !== undefined) {
|
|
1239
|
-
this.crossFieldTable.invalidatedFields.add(dependentEntry.value);
|
|
1240
|
-
}
|
|
1241
|
-
firstId = (0, index_js_3.brand)(firstId + dependentEntry.length);
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
(0, crossFieldQueries_js_1.setInCrossFieldMap)(this.getMap(target), revision, id, count, newValue);
|
|
1245
|
-
}
|
|
1246
|
-
get(target, revision, id, count, addDependency) {
|
|
1247
|
-
if (addDependency) {
|
|
1248
|
-
// We assume that if there is already an entry for this ID it is because
|
|
1249
|
-
// a field handler has called compose on the same node multiple times.
|
|
1250
|
-
// In this case we only want to update the latest version, so we overwrite the dependency.
|
|
1251
|
-
(0, crossFieldQueries_js_1.setInCrossFieldMap)(this.getDependents(target), revision, id, count, this.currentFieldKey);
|
|
1252
|
-
}
|
|
1253
|
-
return (0, crossFieldQueries_js_1.getFirstFromCrossFieldMap)(this.getMap(target), revision, id, count);
|
|
1254
|
-
}
|
|
1255
|
-
getMap(target) {
|
|
1256
|
-
return target === crossFieldQueries_js_1.CrossFieldTarget.Source
|
|
1257
|
-
? this.crossFieldTable.srcTable
|
|
1258
|
-
: this.crossFieldTable.dstTable;
|
|
1259
|
-
}
|
|
1260
|
-
getDependents(target) {
|
|
1261
|
-
return target === crossFieldQueries_js_1.CrossFieldTarget.Source
|
|
1262
|
-
? this.crossFieldTable.srcDependents
|
|
1263
|
-
: this.crossFieldTable.dstDependents;
|
|
1264
|
-
}
|
|
1265
|
-
}
|
|
1266
|
-
class InvertManager extends CrossFieldManagerI {
|
|
1267
|
-
constructor(table, field, fieldId, allowInval = true) {
|
|
1268
|
-
super(table, field, allowInval);
|
|
1269
|
-
this.fieldId = fieldId;
|
|
1270
|
-
}
|
|
1271
|
-
onMoveIn(id) {
|
|
1272
|
-
(0, changeAtomIdBTree_js_1.setInChangeAtomIdMap)(this.table.invertedNodeToParent, id, this.fieldId);
|
|
1273
|
-
}
|
|
1274
|
-
moveKey(target, revision, id, count) {
|
|
1275
|
-
(0, internal_1.assert)(false, 0x9c5 /* Keys should not be moved manually during invert */);
|
|
1276
|
-
}
|
|
1277
|
-
get table() {
|
|
1278
|
-
return this.crossFieldTable;
|
|
1279
|
-
}
|
|
1280
|
-
}
|
|
1281
|
-
class RebaseManager extends CrossFieldManagerI {
|
|
1013
|
+
class RebaseManager extends modularChangeUtils_js_1.CrossFieldManagerI {
|
|
1282
1014
|
constructor(table, currentField, fieldId, allowInval = true) {
|
|
1283
1015
|
super(table, currentField, allowInval);
|
|
1284
1016
|
this.fieldId = fieldId;
|
|
@@ -1314,7 +1046,7 @@ class RebaseManager extends CrossFieldManagerI {
|
|
|
1314
1046
|
}
|
|
1315
1047
|
}
|
|
1316
1048
|
// TODO: Deduplicate this with RebaseTable
|
|
1317
|
-
class ComposeManager extends CrossFieldManagerI {
|
|
1049
|
+
class ComposeManager extends modularChangeUtils_js_1.CrossFieldManagerI {
|
|
1318
1050
|
constructor(table, currentField, fieldId, allowInval = true) {
|
|
1319
1051
|
super(table, currentField, allowInval);
|
|
1320
1052
|
this.fieldId = fieldId;
|
|
@@ -1355,44 +1087,10 @@ class ComposeManager extends CrossFieldManagerI {
|
|
|
1355
1087
|
return this.crossFieldTable;
|
|
1356
1088
|
}
|
|
1357
1089
|
}
|
|
1358
|
-
function makeModularChangeset(props) {
|
|
1359
|
-
const p = props ?? { maxId: -1 };
|
|
1360
|
-
const changeset = {
|
|
1361
|
-
fieldChanges: p.fieldChanges ?? new Map(),
|
|
1362
|
-
nodeChanges: p.nodeChanges ?? (0, changeAtomIdBTree_js_1.newChangeAtomIdBTree)(),
|
|
1363
|
-
nodeToParent: p.nodeToParent ?? (0, changeAtomIdBTree_js_1.newChangeAtomIdBTree)(),
|
|
1364
|
-
nodeAliases: p.nodeAliases ?? (0, changeAtomIdBTree_js_1.newChangeAtomIdBTree)(),
|
|
1365
|
-
crossFieldKeys: p.crossFieldKeys ?? (0, modularChangeTypes_js_1.newCrossFieldKeyTable)(),
|
|
1366
|
-
};
|
|
1367
|
-
if (p.revisions !== undefined && p.revisions.length > 0) {
|
|
1368
|
-
changeset.revisions = p.revisions;
|
|
1369
|
-
}
|
|
1370
|
-
if (p.maxId >= 0) {
|
|
1371
|
-
changeset.maxId = (0, index_js_3.brand)(p.maxId);
|
|
1372
|
-
}
|
|
1373
|
-
if (p.constraintViolationCount !== undefined && p.constraintViolationCount > 0) {
|
|
1374
|
-
changeset.constraintViolationCount = p.constraintViolationCount;
|
|
1375
|
-
}
|
|
1376
|
-
if (p.noChangeConstraint !== undefined) {
|
|
1377
|
-
changeset.noChangeConstraint = p.noChangeConstraint;
|
|
1378
|
-
}
|
|
1379
|
-
if (p.noChangeConstraintOnRevert !== undefined) {
|
|
1380
|
-
changeset.noChangeConstraintOnRevert = p.noChangeConstraintOnRevert;
|
|
1381
|
-
}
|
|
1382
|
-
if (p.builds !== undefined && p.builds.size > 0) {
|
|
1383
|
-
changeset.builds = p.builds;
|
|
1384
|
-
}
|
|
1385
|
-
if (p.destroys !== undefined && p.destroys.size > 0) {
|
|
1386
|
-
changeset.destroys = p.destroys;
|
|
1387
|
-
}
|
|
1388
|
-
if (p.refreshers !== undefined && p.refreshers.size > 0) {
|
|
1389
|
-
changeset.refreshers = p.refreshers;
|
|
1390
|
-
}
|
|
1391
|
-
return changeset;
|
|
1392
|
-
}
|
|
1393
1090
|
class ModularEditBuilder extends index_js_2.EditBuilder {
|
|
1394
|
-
constructor(
|
|
1395
|
-
super(
|
|
1091
|
+
constructor(rebaser, fieldKinds, changeReceiver, codecOptions) {
|
|
1092
|
+
super(changeReceiver);
|
|
1093
|
+
this.rebaser = rebaser;
|
|
1396
1094
|
this.fieldKinds = fieldKinds;
|
|
1397
1095
|
this.transactionDepth = 0;
|
|
1398
1096
|
this.idAllocator = (0, index_js_3.idAllocatorFromMaxId)();
|
|
@@ -1442,7 +1140,7 @@ class ModularEditBuilder extends index_js_2.EditBuilder {
|
|
|
1442
1140
|
* @param revision - the revision of the change
|
|
1443
1141
|
*/
|
|
1444
1142
|
submitChange(field, fieldKind, change, revision) {
|
|
1445
|
-
const localCrossFieldKeys = getChangeHandler(this.fieldKinds, fieldKind).getCrossFieldKeys(change);
|
|
1143
|
+
const localCrossFieldKeys = (0, modularChangeUtils_js_1.getChangeHandler)(this.fieldKinds, fieldKind).getCrossFieldKeys(change);
|
|
1446
1144
|
const modularChange = buildModularChangesetFromField({
|
|
1447
1145
|
path: field,
|
|
1448
1146
|
fieldChange: { fieldKind, change },
|
|
@@ -1464,7 +1162,7 @@ class ModularEditBuilder extends index_js_2.EditBuilder {
|
|
|
1464
1162
|
const changeMaps = changes.map((change) => {
|
|
1465
1163
|
revisions.add(change.revision);
|
|
1466
1164
|
return (0, index_js_2.makeAnonChange)(change.type === "global"
|
|
1467
|
-
? makeModularChangeset({
|
|
1165
|
+
? (0, modularChangeUtils_js_1.makeModularChangeset)({
|
|
1468
1166
|
maxId: this.idAllocator.getMaxId(),
|
|
1469
1167
|
builds: change.builds,
|
|
1470
1168
|
revisions: [{ revision: change.revision }],
|
|
@@ -1479,13 +1177,13 @@ class ModularEditBuilder extends index_js_2.EditBuilder {
|
|
|
1479
1177
|
nodeToParent: (0, changeAtomIdBTree_js_1.newChangeAtomIdBTree)(),
|
|
1480
1178
|
crossFieldKeys: (0, modularChangeTypes_js_1.newCrossFieldKeyTable)(),
|
|
1481
1179
|
idAllocator: this.idAllocator,
|
|
1482
|
-
localCrossFieldKeys: getChangeHandler(this.fieldKinds, change.fieldKind).getCrossFieldKeys(change.change),
|
|
1180
|
+
localCrossFieldKeys: (0, modularChangeUtils_js_1.getChangeHandler)(this.fieldKinds, change.fieldKind).getCrossFieldKeys(change.change),
|
|
1483
1181
|
revision: change.revision,
|
|
1484
1182
|
}));
|
|
1485
1183
|
});
|
|
1486
1184
|
const revInfo = [...revisions].map((revision) => ({ revision }));
|
|
1487
1185
|
const composedChange = {
|
|
1488
|
-
...this.
|
|
1186
|
+
...this.rebaser.compose(changeMaps),
|
|
1489
1187
|
revisions: revInfo,
|
|
1490
1188
|
};
|
|
1491
1189
|
const maxId = (0, index_js_3.brand)(this.idAllocator.getMaxId());
|
|
@@ -1529,7 +1227,7 @@ class ModularEditBuilder extends index_js_2.EditBuilder {
|
|
|
1529
1227
|
if ((0, semver_ts_1.lt)(this.codecOptions.minVersionForCollab, index_js_1.FluidClientVersion.v2_80)) {
|
|
1530
1228
|
throw new internal_2.UsageError(`No change constraints require min client version of at least ${index_js_1.FluidClientVersion.v2_80}`);
|
|
1531
1229
|
}
|
|
1532
|
-
const changeset = makeModularChangeset({
|
|
1230
|
+
const changeset = (0, modularChangeUtils_js_1.makeModularChangeset)({
|
|
1533
1231
|
maxId: -1,
|
|
1534
1232
|
noChangeConstraint: { violated: false },
|
|
1535
1233
|
});
|
|
@@ -1539,7 +1237,7 @@ class ModularEditBuilder extends index_js_2.EditBuilder {
|
|
|
1539
1237
|
if ((0, semver_ts_1.lt)(this.codecOptions.minVersionForCollab, index_js_1.FluidClientVersion.v2_80)) {
|
|
1540
1238
|
throw new internal_2.UsageError(`No change constraints require min client version of at least ${index_js_1.FluidClientVersion.v2_80}`);
|
|
1541
1239
|
}
|
|
1542
|
-
const changeset = makeModularChangeset({
|
|
1240
|
+
const changeset = (0, modularChangeUtils_js_1.makeModularChangeset)({
|
|
1543
1241
|
maxId: -1,
|
|
1544
1242
|
noChangeConstraintOnRevert: { violated: false },
|
|
1545
1243
|
});
|
|
@@ -1560,7 +1258,7 @@ function buildModularChangesetFromField(props) {
|
|
|
1560
1258
|
field: path.field,
|
|
1561
1259
|
});
|
|
1562
1260
|
}
|
|
1563
|
-
return makeModularChangeset({
|
|
1261
|
+
return (0, modularChangeUtils_js_1.makeModularChangeset)({
|
|
1564
1262
|
fieldChanges,
|
|
1565
1263
|
nodeChanges,
|
|
1566
1264
|
nodeToParent,
|
|
@@ -1611,49 +1309,6 @@ function buildModularChangesetFromNode(props) {
|
|
|
1611
1309
|
childId: nodeId,
|
|
1612
1310
|
});
|
|
1613
1311
|
}
|
|
1614
|
-
function getRevInfoFromTaggedChanges(changes) {
|
|
1615
|
-
let maxId = -1;
|
|
1616
|
-
const revInfos = [];
|
|
1617
|
-
const revisions = new Set();
|
|
1618
|
-
for (const taggedChange of changes) {
|
|
1619
|
-
const change = taggedChange.change;
|
|
1620
|
-
maxId = Math.max(change.maxId ?? -1, maxId);
|
|
1621
|
-
const infosToAdd = revisionInfoFromTaggedChange(taggedChange);
|
|
1622
|
-
for (const info of infosToAdd) {
|
|
1623
|
-
if (!revisions.has(info.revision)) {
|
|
1624
|
-
revisions.add(info.revision);
|
|
1625
|
-
revInfos.push(info);
|
|
1626
|
-
}
|
|
1627
|
-
}
|
|
1628
|
-
}
|
|
1629
|
-
const rolledBackRevisions = [];
|
|
1630
|
-
for (const info of revInfos) {
|
|
1631
|
-
if (info.rollbackOf !== undefined) {
|
|
1632
|
-
rolledBackRevisions.push(info.rollbackOf);
|
|
1633
|
-
}
|
|
1634
|
-
}
|
|
1635
|
-
rolledBackRevisions.reverse();
|
|
1636
|
-
for (const revision of rolledBackRevisions) {
|
|
1637
|
-
if (!revisions.has(revision)) {
|
|
1638
|
-
revInfos.push({ revision });
|
|
1639
|
-
}
|
|
1640
|
-
}
|
|
1641
|
-
return { maxId: (0, index_js_3.brand)(maxId), revInfos };
|
|
1642
|
-
}
|
|
1643
|
-
function revisionInfoFromTaggedChange(taggedChange) {
|
|
1644
|
-
const revInfos = [];
|
|
1645
|
-
if (taggedChange.change.revisions !== undefined) {
|
|
1646
|
-
revInfos.push(...taggedChange.change.revisions);
|
|
1647
|
-
}
|
|
1648
|
-
else if (taggedChange.revision !== undefined) {
|
|
1649
|
-
const info = { revision: taggedChange.revision };
|
|
1650
|
-
if (taggedChange.rollbackOf !== undefined) {
|
|
1651
|
-
info.rollbackOf = taggedChange.rollbackOf;
|
|
1652
|
-
}
|
|
1653
|
-
revInfos.push(info);
|
|
1654
|
-
}
|
|
1655
|
-
return revInfos;
|
|
1656
|
-
}
|
|
1657
1312
|
function fieldChangeFromId(fields, nodes, id) {
|
|
1658
1313
|
const fieldMap = fieldMapFromNodeId(fields, nodes, id.nodeId);
|
|
1659
1314
|
return fieldMap.get(id.field) ?? (0, internal_1.fail)(0xb25 /* No field exists for the given ID */);
|
|
@@ -1662,7 +1317,7 @@ function fieldMapFromNodeId(rootFieldMap, nodes, nodeId) {
|
|
|
1662
1317
|
if (nodeId === undefined) {
|
|
1663
1318
|
return rootFieldMap;
|
|
1664
1319
|
}
|
|
1665
|
-
const node = nodeChangeFromId(nodes, nodeId);
|
|
1320
|
+
const node = (0, modularChangeUtils_js_1.nodeChangeFromId)(nodes, nodeId);
|
|
1666
1321
|
(0, internal_1.assert)(node.fieldChanges !== undefined, 0x9c9 /* Expected node to have field changes */);
|
|
1667
1322
|
return node.fieldChanges;
|
|
1668
1323
|
}
|
|
@@ -1675,11 +1330,6 @@ function rebasedFieldIdFromBaseId(table, baseId) {
|
|
|
1675
1330
|
function rebasedNodeIdFromBaseNodeId(table, baseId) {
|
|
1676
1331
|
return (0, changeAtomIdBTree_js_1.getFromChangeAtomIdMap)(table.baseToRebasedNodeId, baseId) ?? baseId;
|
|
1677
1332
|
}
|
|
1678
|
-
function nodeChangeFromId(nodes, id) {
|
|
1679
|
-
const node = (0, changeAtomIdBTree_js_1.getFromChangeAtomIdMap)(nodes, id);
|
|
1680
|
-
(0, internal_1.assert)(node !== undefined, 0x9ca /* Unknown node ID */);
|
|
1681
|
-
return node;
|
|
1682
|
-
}
|
|
1683
1333
|
function fieldIdFromFieldIdKey([revision, localId, field]) {
|
|
1684
1334
|
const nodeId = localId === undefined ? undefined : { revision, localId };
|
|
1685
1335
|
return { nodeId, field };
|
|
@@ -1734,9 +1384,6 @@ function normalizeNodeId(nodeId, nodeAliases) {
|
|
|
1734
1384
|
currentId = dealiased;
|
|
1735
1385
|
}
|
|
1736
1386
|
}
|
|
1737
|
-
function hasConflicts(change) {
|
|
1738
|
-
return (change.constraintViolationCount ?? 0) > 0;
|
|
1739
|
-
}
|
|
1740
1387
|
/**
|
|
1741
1388
|
* A rebaseChild callback for fields with no new changes.
|
|
1742
1389
|
* Asserts that there are no new changes and returns undefined.
|