@fluidframework/tree 2.113.1 → 2.115.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 +289 -0
- package/api-report/tree.alpha.api.md +127 -39
- 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 +4 -3
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/index.d.ts +1 -1
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js +2 -1
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +110 -0
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +47 -1
- package/dist/core/rebase/types.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 +8 -3
- package/dist/entrypoints/alpha.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +9 -6
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +16 -13
- package/dist/feature-libraries/chunked-forest/codec/codecs.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 +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -5
- 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 +11 -3
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +9 -7
- 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 +13 -7
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +59 -13
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +24 -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 +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/api/index.d.ts +1 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +2 -3
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +3 -3
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaStatics.d.ts +6 -7
- package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaStatics.js.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.d.ts +20 -24
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +48 -49
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/core/treeNode.d.ts +5 -6
- package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNode.js +2 -4
- package/dist/simple-tree/core/treeNode.js.map +1 -1
- package/dist/simple-tree/core/withType.d.ts +20 -7
- package/dist/simple-tree/core/withType.d.ts.map +1 -1
- package/dist/simple-tree/core/withType.js +4 -7
- package/dist/simple-tree/core/withType.js.map +1 -1
- package/dist/simple-tree/index.d.ts +2 -2
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +3 -4
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +6 -1
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +0 -1
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +53 -5
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +91 -10
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts +90 -0
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +26 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +2 -2
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.js +2 -2
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/text/codePointUtils.d.ts +2 -2
- package/dist/text/codePointUtils.js +2 -2
- package/dist/text/codePointUtils.js.map +1 -1
- package/dist/text/index.d.ts +3 -3
- package/dist/text/index.d.ts.map +1 -1
- package/dist/text/index.js +4 -4
- package/dist/text/index.js.map +1 -1
- package/dist/text/textDomain.d.ts +30 -18
- package/dist/text/textDomain.d.ts.map +1 -1
- package/dist/text/textDomain.js +44 -23
- package/dist/text/textDomain.js.map +1 -1
- package/dist/text/textDomainFormatted.d.ts +180 -82
- package/dist/text/textDomainFormatted.d.ts.map +1 -1
- package/dist/text/textDomainFormatted.js +164 -84
- package/dist/text/textDomainFormatted.js.map +1 -1
- package/dist/text/textDomainFormattedDefault.d.ts +48 -25
- package/dist/text/textDomainFormattedDefault.d.ts.map +1 -1
- package/dist/text/textDomainFormattedDefault.js +24 -19
- 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/dist/util/compressedIds.d.ts +22 -2
- package/dist/util/compressedIds.d.ts.map +1 -1
- package/dist/util/compressedIds.js +22 -1
- package/dist/util/compressedIds.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 +4 -3
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +2 -2
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/index.d.ts +1 -1
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +110 -0
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +46 -0
- package/lib/core/rebase/types.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/codec/codecs.d.ts +9 -6
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +16 -13
- package/lib/feature-libraries/chunked-forest/codec/codecs.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 +6 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -3
- 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 +11 -3
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +10 -8
- 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 +13 -7
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +61 -15
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +24 -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 +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/api/index.d.ts +1 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +3 -3
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaStatics.d.ts +6 -7
- package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaStatics.js.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.d.ts +20 -24
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +46 -46
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/core/treeNode.d.ts +5 -6
- package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNode.js +2 -4
- package/lib/simple-tree/core/treeNode.js.map +1 -1
- package/lib/simple-tree/core/withType.d.ts +20 -7
- package/lib/simple-tree/core/withType.d.ts.map +1 -1
- package/lib/simple-tree/core/withType.js +4 -7
- package/lib/simple-tree/core/withType.js.map +1 -1
- package/lib/simple-tree/index.d.ts +2 -2
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +1 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts +6 -1
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +0 -1
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +53 -5
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +93 -12
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts +90 -0
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +27 -2
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +3 -3
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.js +3 -3
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/text/codePointUtils.d.ts +2 -2
- package/lib/text/codePointUtils.js +2 -2
- package/lib/text/codePointUtils.js.map +1 -1
- package/lib/text/index.d.ts +3 -3
- package/lib/text/index.d.ts.map +1 -1
- package/lib/text/index.js +3 -3
- package/lib/text/index.js.map +1 -1
- package/lib/text/textDomain.d.ts +30 -18
- package/lib/text/textDomain.d.ts.map +1 -1
- package/lib/text/textDomain.js +41 -22
- package/lib/text/textDomain.js.map +1 -1
- package/lib/text/textDomainFormatted.d.ts +180 -82
- package/lib/text/textDomainFormatted.d.ts.map +1 -1
- package/lib/text/textDomainFormatted.js +165 -86
- package/lib/text/textDomainFormatted.js.map +1 -1
- package/lib/text/textDomainFormattedDefault.d.ts +48 -25
- package/lib/text/textDomainFormattedDefault.d.ts.map +1 -1
- package/lib/text/textDomainFormattedDefault.js +25 -20
- 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/lib/util/compressedIds.d.ts +22 -2
- package/lib/util/compressedIds.d.ts.map +1 -1
- package/lib/util/compressedIds.js +22 -1
- package/lib/util/compressedIds.js.map +1 -1
- package/package.json +32 -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 +11 -6
- package/src/core/rebase/index.ts +2 -0
- package/src/core/rebase/types.ts +113 -0
- 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 +9 -1
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +17 -14
- 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 +11 -4
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/serializedChange.ts +2 -2
- package/src/shared-tree/sharedTree.ts +40 -15
- 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 +136 -30
- package/src/shared-tree-core/branch.ts +41 -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 +16 -7
- package/src/shared-tree-core/transaction.ts +47 -25
- package/src/simple-tree/api/eraseSchemaDetails.ts +15 -0
- package/src/simple-tree/api/index.ts +0 -1
- package/src/simple-tree/api/schemaStatics.ts +2 -2
- package/src/simple-tree/api/treeNodeApi.ts +64 -48
- package/src/simple-tree/core/treeNode.ts +13 -10
- package/src/simple-tree/core/withType.ts +20 -7
- package/src/simple-tree/index.ts +1 -2
- package/src/simple-tree/leafNodeSchema.ts +6 -1
- package/src/simple-tree/node-kinds/array/arrayNode.ts +130 -16
- package/src/simple-tree/node-kinds/map/mapNode.ts +137 -5
- package/src/simple-tree/node-kinds/object/objectNode.ts +3 -3
- package/src/simple-tree/node-kinds/record/recordNode.ts +3 -3
- package/src/text/README.md +1 -1
- package/src/text/codePointUtils.ts +2 -2
- package/src/text/index.ts +3 -3
- package/src/text/textDomain.ts +50 -27
- package/src/text/textDomainFormatted.ts +384 -163
- package/src/text/textDomainFormattedDefault.ts +32 -32
- package/src/treeDataStore.ts +125 -0
- package/src/treeFactory.ts +11 -3
- package/src/util/compressedIds.ts +36 -3
|
@@ -4,17 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
7
|
-
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
type CodecWriteOptions,
|
|
11
|
-
FluidClientVersion,
|
|
12
|
-
FormatValidatorNoOp,
|
|
13
|
-
type IJsonCodec,
|
|
14
|
-
} from "../../codec/index.js";
|
|
15
7
|
import {
|
|
16
8
|
type IdAllocator,
|
|
17
|
-
type JsonCompatibleReadOnly,
|
|
18
9
|
type NestedMap,
|
|
19
10
|
brand,
|
|
20
11
|
deleteFromNestedMap,
|
|
@@ -24,11 +15,10 @@ import {
|
|
|
24
15
|
setInNestedMap,
|
|
25
16
|
tryGetFromNestedMap,
|
|
26
17
|
} from "../../util/index.js";
|
|
27
|
-
import type { RevisionTag
|
|
18
|
+
import type { RevisionTag } from "../rebase/index.js";
|
|
28
19
|
import type { FieldKey } from "../schema-stored/index.js";
|
|
29
20
|
|
|
30
21
|
import type * as Delta from "./delta.js";
|
|
31
|
-
import { detachedFieldIndexCodecBuilder } from "./detachedFieldIndexCodecs.js";
|
|
32
22
|
import type {
|
|
33
23
|
DetachedField,
|
|
34
24
|
DetachedFieldSummaryData,
|
|
@@ -92,9 +82,6 @@ export class DetachedFieldIndex implements ReadOnlyDetachedFieldIndex {
|
|
|
92
82
|
Delta.DetachedNodeId
|
|
93
83
|
> = new Map();
|
|
94
84
|
|
|
95
|
-
private readonly codec: IJsonCodec<DetachedFieldSummaryData>;
|
|
96
|
-
private readonly options: CodecWriteOptions;
|
|
97
|
-
|
|
98
85
|
/**
|
|
99
86
|
* The process for loading `DetachedFieldIndex` data from a summary is split into two steps:
|
|
100
87
|
* 1. Call {@link loadData}
|
|
@@ -112,28 +99,12 @@ export class DetachedFieldIndex implements ReadOnlyDetachedFieldIndex {
|
|
|
112
99
|
public constructor(
|
|
113
100
|
private readonly name: string,
|
|
114
101
|
private rootIdAllocator: IdAllocator<ForestRootId>,
|
|
115
|
-
|
|
116
|
-
private readonly idCompressor: IIdCompressor,
|
|
117
|
-
options?: CodecWriteOptions,
|
|
118
|
-
) {
|
|
119
|
-
this.options = options ?? {
|
|
120
|
-
jsonValidator: FormatValidatorNoOp,
|
|
121
|
-
minVersionForCollab: FluidClientVersion.v2_0,
|
|
122
|
-
};
|
|
123
|
-
this.codec = detachedFieldIndexCodecBuilder.build({
|
|
124
|
-
...this.options,
|
|
125
|
-
revisionTagCodec,
|
|
126
|
-
idCompressor,
|
|
127
|
-
});
|
|
128
|
-
}
|
|
102
|
+
) {}
|
|
129
103
|
|
|
130
104
|
public clone(): DetachedFieldIndex {
|
|
131
105
|
const clone = new DetachedFieldIndex(
|
|
132
106
|
this.name,
|
|
133
107
|
idAllocatorFromMaxId(this.rootIdAllocator.getMaxId()) as IdAllocator<ForestRootId>,
|
|
134
|
-
this.revisionTagCodec,
|
|
135
|
-
this.idCompressor,
|
|
136
|
-
this.options,
|
|
137
108
|
);
|
|
138
109
|
populateNestedMap(this.detachedNodeToField, clone.detachedNodeToField, true);
|
|
139
110
|
populateNestedMap(
|
|
@@ -307,19 +278,17 @@ export class DetachedFieldIndex implements ReadOnlyDetachedFieldIndex {
|
|
|
307
278
|
});
|
|
308
279
|
}
|
|
309
280
|
|
|
310
|
-
public
|
|
311
|
-
return
|
|
281
|
+
public getSummaryData(): DetachedFieldSummaryData {
|
|
282
|
+
return {
|
|
312
283
|
data: this.detachedNodeToField,
|
|
313
284
|
maxId: this.rootIdAllocator.getMaxId(),
|
|
314
|
-
}
|
|
285
|
+
};
|
|
315
286
|
}
|
|
316
287
|
|
|
317
288
|
/**
|
|
318
|
-
* Loads the tree index from
|
|
289
|
+
* Loads the tree index from summary data, this overrides any existing data.
|
|
319
290
|
*/
|
|
320
|
-
public loadData(
|
|
321
|
-
const detachedFieldIndex: DetachedFieldSummaryData = this.codec.decode(data);
|
|
322
|
-
|
|
291
|
+
public loadData(detachedFieldIndex: DetachedFieldSummaryData): void {
|
|
323
292
|
this.rootIdAllocator = idAllocatorFromMaxId(
|
|
324
293
|
detachedFieldIndex.maxId,
|
|
325
294
|
) as IdAllocator<ForestRootId>;
|
package/src/core/tree/index.ts
CHANGED
|
@@ -127,6 +127,8 @@ export {
|
|
|
127
127
|
type ReadOnlyDetachedFieldIndex,
|
|
128
128
|
} from "./detachedFieldIndex.js";
|
|
129
129
|
|
|
130
|
+
export { type DetachedFieldSummaryData } from "./detachedFieldIndexTypes.js";
|
|
131
|
+
|
|
130
132
|
export { detachedFieldIndexCodecBuilder } from "./detachedFieldIndexCodecs.js";
|
|
131
133
|
export { DetachedFieldIndexFormatVersion } from "./detachedFieldIndexFormatCommon.js";
|
|
132
134
|
export { type FormatV1 } from "./detachedFieldIndexFormatV1.js";
|
|
@@ -3,11 +3,8 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
7
|
-
|
|
8
|
-
import type { CodecWriteOptions } from "../../codec/index.js";
|
|
9
6
|
import { type IdAllocator, idAllocatorFromMaxId } from "../../util/index.js";
|
|
10
|
-
import type { RevisionTag
|
|
7
|
+
import type { RevisionTag } from "../rebase/index.js";
|
|
11
8
|
import type { FieldKey } from "../schema-stored/index.js";
|
|
12
9
|
|
|
13
10
|
import type { ITreeCursorSynchronous } from "./cursor.js";
|
|
@@ -17,19 +14,8 @@ import type { ForestRootId } from "./detachedFieldIndexTypes.js";
|
|
|
17
14
|
import type { PlaceIndex, Range } from "./pathTree.js";
|
|
18
15
|
import { type DeltaVisitor, visitDelta } from "./visitDelta.js";
|
|
19
16
|
|
|
20
|
-
export function makeDetachedFieldIndex(
|
|
21
|
-
prefix
|
|
22
|
-
revisionTagCodec: RevisionTagCodec,
|
|
23
|
-
idCompressor: IIdCompressor,
|
|
24
|
-
options?: CodecWriteOptions,
|
|
25
|
-
): DetachedFieldIndex {
|
|
26
|
-
return new DetachedFieldIndex(
|
|
27
|
-
prefix,
|
|
28
|
-
idAllocatorFromMaxId() as IdAllocator<ForestRootId>,
|
|
29
|
-
revisionTagCodec,
|
|
30
|
-
idCompressor,
|
|
31
|
-
options,
|
|
32
|
-
);
|
|
17
|
+
export function makeDetachedFieldIndex(prefix: string = "Temp"): DetachedFieldIndex {
|
|
18
|
+
return new DetachedFieldIndex(prefix, idAllocatorFromMaxId() as IdAllocator<ForestRootId>);
|
|
33
19
|
}
|
|
34
20
|
|
|
35
21
|
export function applyDelta(
|
package/src/entrypoints/alpha.ts
CHANGED
|
@@ -178,6 +178,7 @@ export {
|
|
|
178
178
|
ChangeMetadata,
|
|
179
179
|
CodecName,
|
|
180
180
|
CodecWriteOptions,
|
|
181
|
+
CommitOutcome,
|
|
181
182
|
Component,
|
|
182
183
|
CreateIndependentTreeAlphaOptions,
|
|
183
184
|
DirtyTreeMap,
|
|
@@ -197,6 +198,7 @@ export {
|
|
|
197
198
|
FormatValidatorBasic,
|
|
198
199
|
FormatValidatorNoOp,
|
|
199
200
|
FormatVersion,
|
|
201
|
+
FormattedText,
|
|
200
202
|
HandleConverter,
|
|
201
203
|
ICodecOptions,
|
|
202
204
|
ITreeAlpha,
|
|
@@ -229,6 +231,7 @@ export {
|
|
|
229
231
|
JsonTreeSchema,
|
|
230
232
|
LabelTree,
|
|
231
233
|
LocalChangeMetadata,
|
|
234
|
+
LocalCommitEvents,
|
|
232
235
|
MapNodeCustomizableSchema,
|
|
233
236
|
MapNodeCustomizableSchemaUnsafe,
|
|
234
237
|
MapNodePojoEmulationSchema,
|
|
@@ -244,6 +247,7 @@ export {
|
|
|
244
247
|
ObjectNodeSchemaWorkaround,
|
|
245
248
|
ObjectSchemaOptionsAlpha,
|
|
246
249
|
ObservationResults,
|
|
250
|
+
PlainText,
|
|
247
251
|
ReadSchema,
|
|
248
252
|
ReadableField,
|
|
249
253
|
RecordNodeCustomizableSchema,
|
|
@@ -256,6 +260,7 @@ export {
|
|
|
256
260
|
SchemaFactoryAlpha,
|
|
257
261
|
SchemaStaticsAlpha,
|
|
258
262
|
SchemaType,
|
|
263
|
+
SharedTreeAlpha,
|
|
259
264
|
SharedTreeFormatOptions,
|
|
260
265
|
SharedTreeOptions,
|
|
261
266
|
SimpleAllowedTypeAttributes,
|
|
@@ -271,7 +276,7 @@ export {
|
|
|
271
276
|
SimpleTreeSchema,
|
|
272
277
|
StagedSchemaUpgradePolicy,
|
|
273
278
|
StagedSchemaUpgradePolicyFactory,
|
|
274
|
-
|
|
279
|
+
StringSchema,
|
|
275
280
|
TransactionCallbackStatusAlpha,
|
|
276
281
|
TransactionConstraintAlpha,
|
|
277
282
|
TransactionLabels,
|
|
@@ -283,6 +288,7 @@ export {
|
|
|
283
288
|
TreeChangeEventsAlpha,
|
|
284
289
|
TreeCompressionStrategy,
|
|
285
290
|
TreeContextAlpha,
|
|
291
|
+
TreeDataStoreOptions,
|
|
286
292
|
TreeIdentifierUtils,
|
|
287
293
|
TreeMapNodeAlpha,
|
|
288
294
|
TreeParsingOptions,
|
|
@@ -307,6 +313,7 @@ export {
|
|
|
307
313
|
createArrayInsertionAnchor,
|
|
308
314
|
createIndependentTreeAlpha,
|
|
309
315
|
decodeSchemaCompatibilitySnapshot,
|
|
316
|
+
defineTreeDataStore,
|
|
310
317
|
encodeSchemaCompatibilitySnapshot,
|
|
311
318
|
eraseSchemaDetails,
|
|
312
319
|
eraseSchemaDetailsSubclassable,
|
|
@@ -321,6 +328,7 @@ export {
|
|
|
321
328
|
incrementalSummaryHint,
|
|
322
329
|
independentInitializedView,
|
|
323
330
|
independentView,
|
|
331
|
+
instantiateTreeFirstTime,
|
|
324
332
|
minimize,
|
|
325
333
|
normalizeAllowedTypes,
|
|
326
334
|
persistedToSimpleSchema,
|
|
@@ -133,10 +133,10 @@ export interface FieldBatchEncodingContext {
|
|
|
133
133
|
/**
|
|
134
134
|
* Decode-side context for {@link FieldBatchCodec}.
|
|
135
135
|
*
|
|
136
|
-
*
|
|
137
|
-
* originator-session lookup and
|
|
138
|
-
* the deterministic UUIDv5 synthesis
|
|
139
|
-
*
|
|
136
|
+
* Composes an {@link IdDecodingContext} (which carries the per-call `resolveEncodedId`
|
|
137
|
+
* function encapsulating the originator-session lookup and, for the forest-summarizer's
|
|
138
|
+
* legacy heal path, the deterministic UUIDv5 synthesis) together with the optional
|
|
139
|
+
* incremental decoder for this batch.
|
|
140
140
|
*
|
|
141
141
|
* Constructed via one of the two named static factories — {@link forOp} or
|
|
142
142
|
* {@link forSummary} — depending on the call site's semantics. The constructor
|
|
@@ -144,18 +144,19 @@ export interface FieldBatchEncodingContext {
|
|
|
144
144
|
* op-style and summary-style decoding is load-bearing (different invariants
|
|
145
145
|
* apply, and bugs in this area are typically the result of conflating them).
|
|
146
146
|
*/
|
|
147
|
-
export class FieldBatchDecodingContext
|
|
147
|
+
export class FieldBatchDecodingContext {
|
|
148
148
|
private constructor(
|
|
149
|
-
|
|
149
|
+
/**
|
|
150
|
+
* Resolves the encoded identifiers contained in this batch.
|
|
151
|
+
*/
|
|
152
|
+
public readonly idDecodingContext: IdDecodingContext,
|
|
150
153
|
/**
|
|
151
154
|
* Decoder for incremental fields. Defined when the encoded batch contains
|
|
152
155
|
* incremental chunks. Only populated on summary-style contexts; op-style
|
|
153
156
|
* contexts always have this undefined.
|
|
154
157
|
*/
|
|
155
158
|
public readonly incrementalDecoder?: IncrementalDecoder,
|
|
156
|
-
) {
|
|
157
|
-
super(options);
|
|
158
|
-
}
|
|
159
|
+
) {}
|
|
159
160
|
|
|
160
161
|
/**
|
|
161
162
|
* Construct a decode context for an op.
|
|
@@ -167,7 +168,7 @@ export class FieldBatchDecodingContext extends IdDecodingContext {
|
|
|
167
168
|
* a UUID. Incremental decoding is not used for ops.
|
|
168
169
|
*/
|
|
169
170
|
public static forOp(options: IdDecoderOptionsWithOriginator): FieldBatchDecodingContext {
|
|
170
|
-
return new FieldBatchDecodingContext(options);
|
|
171
|
+
return new FieldBatchDecodingContext(new IdDecodingContext(options));
|
|
171
172
|
}
|
|
172
173
|
|
|
173
174
|
/**
|
|
@@ -189,7 +190,7 @@ export class FieldBatchDecodingContext extends IdDecodingContext {
|
|
|
189
190
|
public static forSummary(
|
|
190
191
|
options: IdDecoderOptionsOriginatorless | IdDecoderOptionsWithOriginator,
|
|
191
192
|
): FieldBatchDecodingContext {
|
|
192
|
-
return new FieldBatchDecodingContext(options);
|
|
193
|
+
return new FieldBatchDecodingContext(new IdDecodingContext(options));
|
|
193
194
|
}
|
|
194
195
|
|
|
195
196
|
/**
|
|
@@ -206,10 +207,10 @@ export class FieldBatchDecodingContext extends IdDecodingContext {
|
|
|
206
207
|
// This mitigates the risk of using incorrect originator session ID identifiers in incremental chunks.
|
|
207
208
|
// See also private remarks on forSummary.
|
|
208
209
|
assert(
|
|
209
|
-
!this.hasOriginatorSessionId,
|
|
210
|
+
!this.idDecodingContext.hasOriginatorSessionId,
|
|
210
211
|
0xd0c /* withIncrementalDecoder can only be called on contexts without an originator session ID */,
|
|
211
212
|
);
|
|
212
|
-
return new FieldBatchDecodingContext(this.
|
|
213
|
+
return new FieldBatchDecodingContext(this.idDecodingContext, incrementalDecoder);
|
|
213
214
|
}
|
|
214
215
|
}
|
|
215
216
|
|
|
@@ -298,7 +299,9 @@ function makeFieldBatchCodecForVersion(
|
|
|
298
299
|
context: FieldBatchDecodingContext,
|
|
299
300
|
): FieldBatch => {
|
|
300
301
|
// TODO: consider checking data is in schema.
|
|
301
|
-
return decode(data, context, context.incrementalDecoder).map((chunk) =>
|
|
302
|
+
return decode(data, context.idDecodingContext, context.incrementalDecoder).map((chunk) =>
|
|
303
|
+
chunk.cursor(),
|
|
304
|
+
);
|
|
302
305
|
},
|
|
303
306
|
schema: encodedFieldBatchType,
|
|
304
307
|
};
|
|
@@ -191,6 +191,17 @@ export class TreeShape {
|
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
public equals(other: TreeShape): boolean {
|
|
194
|
+
// Shapes are commonly shared (e.g. all chunks from one chunker reference the same instance), so
|
|
195
|
+
// short-circuit on reference identity to avoid the full structural walk in the common case.
|
|
196
|
+
if (this === other) {
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// A given type usually only has one shape, so check it next to speed up the false case.
|
|
201
|
+
if (this.type !== other.type) {
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
|
|
194
205
|
// TODO: either dedupe instances and/or store a collision resistant hash for fast compare.
|
|
195
206
|
|
|
196
207
|
if (
|
|
@@ -203,7 +214,6 @@ export class TreeShape {
|
|
|
203
214
|
return false;
|
|
204
215
|
}
|
|
205
216
|
return (
|
|
206
|
-
this.type === other.type &&
|
|
207
217
|
this.hasValue === other.hasValue &&
|
|
208
218
|
this.mayContainCompressedIds === other.mayContainCompressedIds
|
|
209
219
|
);
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Listenable } from "@fluidframework/core-interfaces";
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
type Anchor,
|
|
10
|
+
type AnchorSet,
|
|
11
|
+
type AnnouncedVisitor,
|
|
12
|
+
type DeltaVisitor,
|
|
13
|
+
type FieldAnchor,
|
|
14
|
+
type ForestEvents,
|
|
15
|
+
type IEditableForest,
|
|
16
|
+
type ITreeCursorSynchronous,
|
|
17
|
+
type ITreeSubscriptionCursor,
|
|
18
|
+
type TreeChunk,
|
|
19
|
+
type TreeNavigationResult,
|
|
20
|
+
type TreeStoredSchemaSubscription,
|
|
21
|
+
type UpPath,
|
|
22
|
+
combineVisitors,
|
|
23
|
+
createAnnouncedVisitor,
|
|
24
|
+
} from "../../core/index.js";
|
|
25
|
+
import type { Breakable } from "../../util/index.js";
|
|
26
|
+
|
|
27
|
+
import { assertForestsEqual } from "../treeTextCursor.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* An {@link IEditableForest} which wraps two other forests: a `main` forest and a `reference` forest.
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* All read operations are delegated to `main`, so from the outside a `ComparisonForest` behaves exactly like its `main` forest.
|
|
34
|
+
*
|
|
35
|
+
* When a delta is applied (via {@link IEditableForest.acquireVisitor}), the delta is applied to both `main` and `reference`.
|
|
36
|
+
* Once the visitor is freed, the full contents of both forests (including all detached/removed fields) are compared,
|
|
37
|
+
* and an error is thrown if they differ.
|
|
38
|
+
*
|
|
39
|
+
* This is a testing/debugging aid: it allows validating that a forest implementation (for example the optimized `ChunkedForest`)
|
|
40
|
+
* produces the same results as a simpler reference implementation (for example the `ObjectForest`) for every delta that is applied.
|
|
41
|
+
*
|
|
42
|
+
* @privateRemarks
|
|
43
|
+
* This forest is intentionally expensive: it maintains two full copies of the data and re-reads and
|
|
44
|
+
* structurally compares all of their contents after every delta.
|
|
45
|
+
*/
|
|
46
|
+
export class ComparisonForest implements IEditableForest {
|
|
47
|
+
/**
|
|
48
|
+
* @param main - The forest whose behavior is under test.
|
|
49
|
+
* All reads are delegated to this forest, and it is the source of truth for anchors and events.
|
|
50
|
+
* @param reference - The forest to compare against.
|
|
51
|
+
* This forest receives all the same deltas as `main`, and its contents are asserted to match `main` after each delta.
|
|
52
|
+
*/
|
|
53
|
+
public constructor(
|
|
54
|
+
public readonly main: IEditableForest,
|
|
55
|
+
public readonly reference: IEditableForest,
|
|
56
|
+
) {
|
|
57
|
+
this.assertValid();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
private assertValid(): void {
|
|
61
|
+
assertForestsEqual(this.main, this.reference);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
public get events(): Listenable<ForestEvents> {
|
|
65
|
+
return this.main.events;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public get anchors(): AnchorSet {
|
|
69
|
+
return this.main.anchors;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
public get isEmpty(): boolean {
|
|
73
|
+
return this.main.isEmpty;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
public clone(schema: TreeStoredSchemaSubscription, breaker?: Breakable): ComparisonForest {
|
|
77
|
+
this.assertValid();
|
|
78
|
+
return new ComparisonForest(
|
|
79
|
+
this.main.clone(schema, breaker),
|
|
80
|
+
this.reference.clone(schema, breaker),
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
public chunkField(cursor: ITreeCursorSynchronous): TreeChunk[] {
|
|
85
|
+
return this.main.chunkField(cursor);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
public allocateCursor(source?: string): ITreeSubscriptionCursor {
|
|
89
|
+
// Currently we just use the cursor from "main", but we could use "reference" or a custom cursor ensuring both match in behavior.
|
|
90
|
+
// TODO: Add a custom combined cursor type which validates two cursors match, and use it here.
|
|
91
|
+
return this.main.allocateCursor(source);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
public forgetAnchor(anchor: Anchor): void {
|
|
95
|
+
this.main.forgetAnchor(anchor);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
public tryMoveCursorToNode(
|
|
99
|
+
destination: Anchor,
|
|
100
|
+
cursorToMove: ITreeSubscriptionCursor,
|
|
101
|
+
): TreeNavigationResult {
|
|
102
|
+
return this.main.tryMoveCursorToNode(destination, cursorToMove);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
public tryMoveCursorToField(
|
|
106
|
+
destination: FieldAnchor,
|
|
107
|
+
cursorToMove: ITreeSubscriptionCursor,
|
|
108
|
+
): TreeNavigationResult {
|
|
109
|
+
return this.main.tryMoveCursorToField(destination, cursorToMove);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
public moveCursorToPath(destination: UpPath, cursorToMove: ITreeSubscriptionCursor): void {
|
|
113
|
+
this.main.moveCursorToPath(destination, cursorToMove);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
public getCursorAboveDetachedFields(): ITreeCursorSynchronous {
|
|
117
|
+
return this.main.getCursorAboveDetachedFields();
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
public registerAnnouncedVisitor(visitor: () => AnnouncedVisitor): void {
|
|
121
|
+
this.main.registerAnnouncedVisitor(visitor);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
public deregisterAnnouncedVisitor(visitor: () => AnnouncedVisitor): void {
|
|
125
|
+
this.main.deregisterAnnouncedVisitor(visitor);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
public acquireVisitor(): DeltaVisitor {
|
|
129
|
+
this.assertValid();
|
|
130
|
+
const main = this.main;
|
|
131
|
+
const reference = this.reference;
|
|
132
|
+
const mainVisitor = main.acquireVisitor();
|
|
133
|
+
const referenceVisitor = reference.acquireVisitor();
|
|
134
|
+
// A visitor which does nothing except assert the two forests match once the delta has been fully applied to both.
|
|
135
|
+
const comparisonVisitor = createAnnouncedVisitor({
|
|
136
|
+
free: () => this.assertValid(),
|
|
137
|
+
});
|
|
138
|
+
return combineVisitors([mainVisitor, referenceVisitor, comparisonVisitor]);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -10,6 +10,7 @@ import type { CodecWriteOptions, ICodecFamily } from "../../codec/index.js";
|
|
|
10
10
|
import {
|
|
11
11
|
type ChangeAtomId,
|
|
12
12
|
type ChangeEncodingContext,
|
|
13
|
+
type ChangeDecodingContext,
|
|
13
14
|
type ChangeFamily,
|
|
14
15
|
type ChangeFamilyEditor,
|
|
15
16
|
type ChangeRebaser,
|
|
@@ -24,6 +25,7 @@ import {
|
|
|
24
25
|
type UpPath,
|
|
25
26
|
compareFieldUpPaths,
|
|
26
27
|
topDownPath,
|
|
28
|
+
type ProcessChangeFn,
|
|
27
29
|
} from "../../core/index.js";
|
|
28
30
|
import { brand } from "../../util/index.js";
|
|
29
31
|
import {
|
|
@@ -43,18 +45,20 @@ import { fieldKinds } from "./defaultFieldKinds.js";
|
|
|
43
45
|
|
|
44
46
|
export type DefaultChangeset = ModularChangeset;
|
|
45
47
|
|
|
48
|
+
export type DefaultChangeProcessingContext = ModularChangeFamily;
|
|
49
|
+
|
|
46
50
|
/**
|
|
47
51
|
* Implementation of {@link ChangeFamily} based on the default set of supported field kinds.
|
|
48
52
|
*
|
|
49
53
|
* @sealed
|
|
50
54
|
*/
|
|
51
55
|
export class DefaultChangeFamily
|
|
52
|
-
implements ChangeFamily<DefaultEditBuilder, DefaultChangeset>
|
|
56
|
+
implements ChangeFamily<DefaultEditBuilder, DefaultChangeset, DefaultChangeProcessingContext>
|
|
53
57
|
{
|
|
54
58
|
private readonly modularFamily: ModularChangeFamily;
|
|
55
59
|
|
|
56
60
|
public constructor(
|
|
57
|
-
codecs: ICodecFamily<ModularChangeset, ChangeEncodingContext>,
|
|
61
|
+
codecs: ICodecFamily<ModularChangeset, ChangeEncodingContext, ChangeDecodingContext>,
|
|
58
62
|
codecOptions: CodecWriteOptions,
|
|
59
63
|
) {
|
|
60
64
|
this.modularFamily = new ModularChangeFamily(fieldKinds, codecs, codecOptions);
|
|
@@ -64,7 +68,11 @@ export class DefaultChangeFamily
|
|
|
64
68
|
return this.modularFamily.rebaser;
|
|
65
69
|
}
|
|
66
70
|
|
|
67
|
-
public get codecs(): ICodecFamily<
|
|
71
|
+
public get codecs(): ICodecFamily<
|
|
72
|
+
DefaultChangeset,
|
|
73
|
+
ChangeEncodingContext,
|
|
74
|
+
ChangeDecodingContext
|
|
75
|
+
> {
|
|
68
76
|
return this.modularFamily.codecs;
|
|
69
77
|
}
|
|
70
78
|
|
|
@@ -73,12 +81,18 @@ export class DefaultChangeFamily
|
|
|
73
81
|
changeReceiver: (change: TaggedChange<DefaultChangeset>) => void,
|
|
74
82
|
): DefaultEditBuilder {
|
|
75
83
|
return new DefaultEditBuilder(
|
|
76
|
-
this,
|
|
84
|
+
this.modularFamily.rebaser,
|
|
77
85
|
mintRevisionTag,
|
|
78
86
|
changeReceiver,
|
|
79
87
|
this.modularFamily.codecOptions,
|
|
80
88
|
);
|
|
81
89
|
}
|
|
90
|
+
|
|
91
|
+
public buildProcessor(
|
|
92
|
+
processFn: ProcessChangeFn<DefaultChangeset, DefaultChangeProcessingContext>,
|
|
93
|
+
): (change: DefaultChangeset) => DefaultChangeset {
|
|
94
|
+
return this.modularFamily.buildProcessor(processFn);
|
|
95
|
+
}
|
|
82
96
|
}
|
|
83
97
|
|
|
84
98
|
/**
|
|
@@ -194,13 +208,13 @@ export class DefaultEditBuilder implements ChangeFamilyEditor, IDefaultEditBuild
|
|
|
194
208
|
private readonly modularBuilder: ModularEditBuilder;
|
|
195
209
|
|
|
196
210
|
public constructor(
|
|
197
|
-
|
|
211
|
+
rebaser: ChangeRebaser<DefaultChangeset>,
|
|
198
212
|
private readonly mintRevisionTag: () => RevisionTag,
|
|
199
213
|
changeReceiver: (change: TaggedChange<DefaultChangeset>) => void,
|
|
200
214
|
codecOptions: CodecWriteOptions,
|
|
201
215
|
) {
|
|
202
216
|
this.modularBuilder = new ModularEditBuilder(
|
|
203
|
-
|
|
217
|
+
rebaser,
|
|
204
218
|
fieldKinds,
|
|
205
219
|
changeReceiver,
|
|
206
220
|
codecOptions,
|
|
@@ -4,7 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { type ICodecFamily, makeCodecFamily, unitCodec } from "../../codec/index.js";
|
|
7
|
-
import type {
|
|
7
|
+
import type {
|
|
8
|
+
FieldChangeEncodingContext,
|
|
9
|
+
FieldChangeDecodingContext,
|
|
10
|
+
} from "../modular-schema/index.js";
|
|
8
11
|
|
|
9
|
-
export const noChangeCodecFamily: ICodecFamily<
|
|
10
|
-
|
|
12
|
+
export const noChangeCodecFamily: ICodecFamily<
|
|
13
|
+
0,
|
|
14
|
+
FieldChangeEncodingContext,
|
|
15
|
+
FieldChangeDecodingContext
|
|
16
|
+
> = makeCodecFamily<0, FieldChangeEncodingContext, FieldChangeDecodingContext>([
|
|
17
|
+
[1, unitCodec],
|
|
18
|
+
]);
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { bufferToString } from "@fluid-internal/client-utils";
|
|
7
7
|
import type { IChannelStorageService } from "@fluidframework/datastore-definitions/internal";
|
|
8
|
+
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
8
9
|
import type {
|
|
9
10
|
IExperimentalIncrementalSummaryContext,
|
|
10
11
|
ITelemetryContext,
|
|
@@ -12,7 +13,18 @@ import type {
|
|
|
12
13
|
} from "@fluidframework/runtime-definitions/internal";
|
|
13
14
|
import type { SummaryTreeBuilder } from "@fluidframework/runtime-utils/internal";
|
|
14
15
|
|
|
15
|
-
import
|
|
16
|
+
import {
|
|
17
|
+
type CodecWriteOptions,
|
|
18
|
+
FluidClientVersion,
|
|
19
|
+
FormatValidatorNoOp,
|
|
20
|
+
type IJsonCodec,
|
|
21
|
+
} from "../codec/index.js";
|
|
22
|
+
import {
|
|
23
|
+
type DetachedFieldIndex,
|
|
24
|
+
type DetachedFieldSummaryData,
|
|
25
|
+
type RevisionTagCodec,
|
|
26
|
+
detachedFieldIndexCodecBuilder,
|
|
27
|
+
} from "../core/index.js";
|
|
16
28
|
import {
|
|
17
29
|
type Summarizable,
|
|
18
30
|
type SummaryElementParser,
|
|
@@ -66,16 +78,31 @@ export class DetachedFieldIndexSummarizer
|
|
|
66
78
|
extends VersionedSummarizer<DetachedFieldIndexSummaryFormatVersion>
|
|
67
79
|
implements Summarizable
|
|
68
80
|
{
|
|
81
|
+
private readonly codec: IJsonCodec<DetachedFieldSummaryData>;
|
|
82
|
+
|
|
69
83
|
public constructor(
|
|
70
84
|
private readonly detachedFieldIndex: DetachedFieldIndex,
|
|
71
|
-
|
|
85
|
+
revisionTagCodec: RevisionTagCodec,
|
|
86
|
+
idCompressor: IIdCompressor,
|
|
87
|
+
options?: CodecWriteOptions,
|
|
72
88
|
) {
|
|
89
|
+
const normalizedOptions = options ?? {
|
|
90
|
+
jsonValidator: FormatValidatorNoOp,
|
|
91
|
+
minVersionForCollab: FluidClientVersion.v2_0,
|
|
92
|
+
};
|
|
73
93
|
super(
|
|
74
94
|
"DetachedFieldIndex",
|
|
75
|
-
minVersionToDetachedFieldIndexSummaryFormatVersion(
|
|
95
|
+
minVersionToDetachedFieldIndexSummaryFormatVersion(
|
|
96
|
+
normalizedOptions.minVersionForCollab,
|
|
97
|
+
),
|
|
76
98
|
supportedVersions,
|
|
77
99
|
true,
|
|
78
100
|
);
|
|
101
|
+
this.codec = detachedFieldIndexCodecBuilder.build({
|
|
102
|
+
...normalizedOptions,
|
|
103
|
+
revisionTagCodec,
|
|
104
|
+
idCompressor,
|
|
105
|
+
});
|
|
79
106
|
}
|
|
80
107
|
|
|
81
108
|
protected summarizeInternal(props: {
|
|
@@ -87,7 +114,7 @@ export class DetachedFieldIndexSummarizer
|
|
|
87
114
|
builder: SummaryTreeBuilder;
|
|
88
115
|
}): void {
|
|
89
116
|
const { stringify, builder } = props;
|
|
90
|
-
const data = this.
|
|
117
|
+
const data = this.codec.encode(this.detachedFieldIndex.getSummaryData());
|
|
91
118
|
builder.addBlob(detachedFieldIndexBlobKey, stringify(data));
|
|
92
119
|
}
|
|
93
120
|
|
|
@@ -99,7 +126,8 @@ export class DetachedFieldIndexSummarizer
|
|
|
99
126
|
const detachedFieldIndexBuffer = await services.readBlob(detachedFieldIndexBlobKey);
|
|
100
127
|
const treeBufferString = bufferToString(detachedFieldIndexBuffer, "utf8");
|
|
101
128
|
const parsed = parse(treeBufferString) as JsonCompatibleReadOnly;
|
|
102
|
-
this.
|
|
129
|
+
const decoded = this.codec.decode(parsed);
|
|
130
|
+
this.detachedFieldIndex.loadData(decoded);
|
|
103
131
|
}
|
|
104
132
|
}
|
|
105
133
|
}
|
|
@@ -20,7 +20,6 @@ import {
|
|
|
20
20
|
type IEditableForest,
|
|
21
21
|
type ITreeCursorSynchronous,
|
|
22
22
|
type ITreeSubscriptionCursor,
|
|
23
|
-
type RevisionTagCodec,
|
|
24
23
|
TreeNavigationResult,
|
|
25
24
|
applyDelta,
|
|
26
25
|
forEachField,
|
|
@@ -79,7 +78,6 @@ export class ForestSummarizer
|
|
|
79
78
|
*/
|
|
80
79
|
public constructor(
|
|
81
80
|
private readonly forest: IEditableForest,
|
|
82
|
-
private readonly revisionTagCodec: RevisionTagCodec,
|
|
83
81
|
private readonly encoderContext: FieldBatchEncodingContext,
|
|
84
82
|
private readonly decoderContext: FieldBatchDecodingContext,
|
|
85
83
|
options: CodecWriteOptions,
|
|
@@ -240,7 +238,7 @@ export class ForestSummarizer
|
|
|
240
238
|
{ build, fields: new Map(fieldChanges) },
|
|
241
239
|
undefined,
|
|
242
240
|
this.forest,
|
|
243
|
-
makeDetachedFieldIndex("init"
|
|
241
|
+
makeDetachedFieldIndex("init"),
|
|
244
242
|
);
|
|
245
243
|
}
|
|
246
244
|
}
|