@fluidframework/tree 2.110.0 → 2.111.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/.vscode/settings.json +1 -0
- package/CHANGELOG.md +48 -0
- package/api-report/tree.alpha.api.md +48 -31
- package/api-report/tree.beta.api.md +38 -0
- package/api-report/tree.legacy.beta.api.md +38 -0
- package/dist/core/change-family/changeFamily.d.ts +3 -10
- package/dist/core/change-family/changeFamily.d.ts.map +1 -1
- package/dist/core/change-family/changeFamily.js.map +1 -1
- package/dist/core/rebase/types.d.ts +2 -2
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts +2 -2
- package/dist/core/schema-stored/storedSchemaRepository.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.map +1 -1
- package/dist/entrypoints/beta.d.ts +1 -1
- package/dist/entrypoints/beta.d.ts.map +1 -1
- package/dist/entrypoints/beta.js.map +1 -1
- package/dist/entrypoints/legacy.d.ts +1 -1
- package/dist/entrypoints/legacy.d.ts.map +1 -1
- package/dist/entrypoints/legacy.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +19 -14
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +13 -32
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +85 -28
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +83 -9
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +4 -2
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +11 -0
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js +2 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js +3 -15
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.js +2 -1
- package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts +3 -3
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -2
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +4 -6
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +1 -1
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +2 -1
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +9 -9
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -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/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +4 -7
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +1 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +5 -5
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +5 -0
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +7 -4
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/transactionPostProcessor.d.ts +28 -0
- package/dist/shared-tree/transactionPostProcessor.d.ts.map +1 -0
- package/dist/shared-tree/transactionPostProcessor.js +28 -0
- package/dist/shared-tree/transactionPostProcessor.js.map +1 -0
- package/dist/shared-tree/treeAlpha.js +3 -3
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +16 -12
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +18 -9
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree/unhydratedTreeContext.d.ts +5 -5
- package/dist/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
- package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts +3 -2
- 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 +3 -9
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.js +2 -4
- package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +3 -3
- 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 +3 -3
- 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 +5 -9
- package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +5 -10
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +1 -1
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +3 -2
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +3 -1
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts +84 -9
- package/dist/shared-tree-core/transaction.d.ts.map +1 -1
- package/dist/shared-tree-core/transaction.js +74 -7
- package/dist/shared-tree-core/transaction.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.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts +3 -3
- package/dist/simple-tree/api/schemaCreationUtilities.js +3 -3
- package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +1 -1
- package/dist/simple-tree/api/schemaFactory.js +2 -2
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +2 -2
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +2 -2
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/dist/simple-tree/api/transactionTypes.d.ts +91 -28
- package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/transactionTypes.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +86 -22
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/treeBeta.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +7 -7
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/index.d.ts +1 -1
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/text/index.d.ts +1 -0
- package/dist/text/index.d.ts.map +1 -1
- package/dist/text/index.js +3 -1
- package/dist/text/index.js.map +1 -1
- package/dist/text/textDomainFormatted.d.ts +69 -758
- package/dist/text/textDomainFormatted.d.ts.map +1 -1
- package/dist/text/textDomainFormatted.js +275 -322
- package/dist/text/textDomainFormatted.js.map +1 -1
- package/dist/text/textDomainFormattedDefault.d.ts +273 -0
- package/dist/text/textDomainFormattedDefault.d.ts.map +1 -0
- package/dist/text/textDomainFormattedDefault.js +94 -0
- package/dist/text/textDomainFormattedDefault.js.map +1 -0
- package/dist/util/compressedIds.d.ts +118 -0
- package/dist/util/compressedIds.d.ts.map +1 -0
- package/dist/util/compressedIds.js +133 -0
- package/dist/util/compressedIds.js.map +1 -0
- package/dist/util/index.d.ts +1 -0
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +9 -1
- package/dist/util/index.js.map +1 -1
- package/lib/core/change-family/changeFamily.d.ts +3 -10
- package/lib/core/change-family/changeFamily.d.ts.map +1 -1
- package/lib/core/change-family/changeFamily.js.map +1 -1
- package/lib/core/rebase/types.d.ts +2 -2
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts +2 -2
- package/lib/core/schema-stored/storedSchemaRepository.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.map +1 -1
- package/lib/entrypoints/beta.d.ts +1 -1
- package/lib/entrypoints/beta.d.ts.map +1 -1
- package/lib/entrypoints/beta.js.map +1 -1
- package/lib/entrypoints/legacy.d.ts +1 -1
- package/lib/entrypoints/legacy.d.ts.map +1 -1
- package/lib/entrypoints/legacy.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +19 -14
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +14 -33
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +85 -28
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +82 -9
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +4 -2
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +12 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js +3 -15
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.js +1 -1
- package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts +3 -3
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -2
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +4 -6
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +1 -1
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +1 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +10 -10
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -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/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +5 -8
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +1 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +5 -5
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +5 -0
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +8 -5
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/transactionPostProcessor.d.ts +28 -0
- package/lib/shared-tree/transactionPostProcessor.d.ts.map +1 -0
- package/lib/shared-tree/transactionPostProcessor.js +23 -0
- package/lib/shared-tree/transactionPostProcessor.js.map +1 -0
- package/lib/shared-tree/treeAlpha.js +3 -3
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +16 -12
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +18 -9
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree/unhydratedTreeContext.d.ts +5 -5
- package/lib/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
- package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts +3 -2
- 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 +3 -9
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.js +3 -5
- package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +3 -3
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +3 -3
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.d.ts +5 -9
- package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +5 -10
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +1 -1
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +1 -1
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +3 -1
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts +84 -9
- package/lib/shared-tree-core/transaction.d.ts.map +1 -1
- package/lib/shared-tree-core/transaction.js +73 -6
- package/lib/shared-tree-core/transaction.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.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts +3 -3
- package/lib/simple-tree/api/schemaCreationUtilities.js +3 -3
- package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +1 -1
- package/lib/simple-tree/api/schemaFactory.js +2 -2
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +2 -2
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js +2 -2
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/lib/simple-tree/api/transactionTypes.d.ts +91 -28
- package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/transactionTypes.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +86 -22
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/treeBeta.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +7 -7
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +1 -1
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/text/index.d.ts +1 -0
- package/lib/text/index.d.ts.map +1 -1
- package/lib/text/index.js +1 -0
- package/lib/text/index.js.map +1 -1
- package/lib/text/textDomainFormatted.d.ts +69 -758
- package/lib/text/textDomainFormatted.d.ts.map +1 -1
- package/lib/text/textDomainFormatted.js +277 -324
- package/lib/text/textDomainFormatted.js.map +1 -1
- package/lib/text/textDomainFormattedDefault.d.ts +273 -0
- package/lib/text/textDomainFormattedDefault.d.ts.map +1 -0
- package/lib/text/textDomainFormattedDefault.js +91 -0
- package/lib/text/textDomainFormattedDefault.js.map +1 -0
- package/lib/util/compressedIds.d.ts +118 -0
- package/lib/util/compressedIds.d.ts.map +1 -0
- package/lib/util/compressedIds.js +124 -0
- package/lib/util/compressedIds.js.map +1 -0
- package/lib/util/index.d.ts +1 -0
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +1 -0
- package/lib/util/index.js.map +1 -1
- package/package.json +23 -23
- package/src/core/change-family/changeFamily.ts +3 -12
- package/src/core/rebase/types.ts +2 -2
- package/src/core/schema-stored/storedSchemaRepository.ts +2 -2
- package/src/entrypoints/alpha.ts +12 -8
- package/src/entrypoints/beta.ts +8 -0
- package/src/entrypoints/legacy.ts +8 -0
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +35 -64
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +138 -42
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +32 -4
- package/src/feature-libraries/chunked-forest/codec/index.ts +1 -0
- package/src/feature-libraries/chunked-forest/codec/nodeEncoder.ts +7 -19
- package/src/feature-libraries/chunked-forest/index.ts +3 -0
- package/src/feature-libraries/forest-summary/codec.ts +5 -3
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +4 -5
- package/src/feature-libraries/index.ts +3 -0
- package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +13 -9
- package/src/index.ts +13 -8
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +5 -10
- package/src/shared-tree/index.ts +1 -0
- package/src/shared-tree/schematizingTreeView.ts +25 -25
- package/src/shared-tree/sharedTree.ts +16 -4
- package/src/shared-tree/transactionPostProcessor.ts +40 -0
- package/src/shared-tree/treeAlpha.ts +3 -3
- package/src/shared-tree/treeCheckout.ts +61 -44
- package/src/shared-tree/unhydratedTreeContext.ts +18 -15
- package/src/shared-tree-core/editManagerCodecs.ts +3 -2
- package/src/shared-tree-core/editManagerCodecsCommons.ts +10 -14
- package/src/shared-tree-core/editManagerCodecsV1toV4.ts +3 -2
- package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +3 -2
- package/src/shared-tree-core/editManagerSummarizer.ts +5 -9
- package/src/shared-tree-core/index.ts +8 -5
- package/src/shared-tree-core/sharedTreeCore.ts +3 -2
- package/src/shared-tree-core/transaction.ts +148 -18
- package/src/simple-tree/api/index.ts +13 -9
- package/src/simple-tree/api/schemaCreationUtilities.ts +3 -3
- package/src/simple-tree/api/schemaFactory.ts +2 -2
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +2 -2
- package/src/simple-tree/api/transactionTypes.ts +111 -39
- package/src/simple-tree/api/tree.ts +141 -47
- package/src/simple-tree/api/treeBeta.ts +2 -0
- package/src/simple-tree/core/treeNodeSchema.ts +7 -7
- package/src/simple-tree/index.ts +12 -8
- package/src/text/index.ts +1 -0
- package/src/text/textDomainFormatted.ts +520 -415
- package/src/text/textDomainFormattedDefault.ts +150 -0
- package/src/util/compressedIds.ts +216 -0
- package/src/util/index.ts +15 -0
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import type { ErasedType } from "@fluidframework/core-interfaces";
|
|
7
|
+
|
|
6
8
|
import type { TreeNode } from "../core/index.js";
|
|
7
9
|
|
|
8
10
|
/**
|
|
@@ -50,87 +52,148 @@ export interface NoChangeConstraint {
|
|
|
50
52
|
|
|
51
53
|
/**
|
|
52
54
|
* Contains a value returned from a transaction.
|
|
53
|
-
* @
|
|
55
|
+
* @input
|
|
56
|
+
* @beta
|
|
54
57
|
*/
|
|
55
58
|
export interface WithValue<TValue> {
|
|
56
59
|
/** The user-supplied value. */
|
|
57
|
-
value: TValue;
|
|
60
|
+
readonly value: TValue;
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
/**
|
|
61
|
-
* Contains a value and status returned from a user-supplied {@link
|
|
62
|
-
* @
|
|
64
|
+
* Contains a value and status returned from a user-supplied {@link TreeViewBeta.runTransaction | transaction callback}.
|
|
65
|
+
* @input
|
|
66
|
+
* @beta
|
|
63
67
|
*/
|
|
64
|
-
export type
|
|
68
|
+
export type TransactionCallbackStatusBeta<TSuccessValue, TFailureValue> =
|
|
65
69
|
| (WithValue<TSuccessValue> & {
|
|
66
70
|
/** Indicates that the transaction callback ran successfully. */
|
|
67
|
-
rollback?: false;
|
|
71
|
+
readonly rollback?: false;
|
|
68
72
|
})
|
|
69
73
|
| (WithValue<TFailureValue> & {
|
|
70
74
|
/** Indicates that the transaction callback failed and the transaction should be rolled back. */
|
|
71
|
-
rollback: true;
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
75
|
+
readonly rollback: true;
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The result of a {@link TreeViewBeta.runTransaction | transaction} that doesn't return a value.
|
|
80
|
+
* @input
|
|
81
|
+
* @beta
|
|
82
|
+
*/
|
|
83
|
+
export type VoidTransactionCallbackStatusBeta = Omit<
|
|
84
|
+
TransactionCallbackStatusBeta<unknown, unknown>,
|
|
85
|
+
"value"
|
|
86
|
+
>;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* {@link TransactionCallbackStatusBeta} extended with alpha-only {@link TransactionConstraintAlpha | constraint} options.
|
|
90
|
+
* @input
|
|
91
|
+
* @alpha
|
|
92
|
+
*/
|
|
93
|
+
export type TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue> =
|
|
94
|
+
TransactionCallbackStatusBeta<TSuccessValue, TFailureValue> & {
|
|
95
|
+
/**
|
|
96
|
+
* An optional list of {@link TransactionConstraintAlpha | constraints} that will be checked when the commit corresponding
|
|
97
|
+
* to this transaction is reverted. If any of these constraints are not met when the revert is being applied either
|
|
98
|
+
* locally or on remote clients, the revert will be ignored.
|
|
99
|
+
* These constraints must also be met at the time they are first introduced. If they are not met after the transaction
|
|
100
|
+
* callback returns, then `runTransaction` (which invokes the transaction callback) will throw a `UsageError`.
|
|
101
|
+
*/
|
|
102
|
+
readonly preconditionsOnRevert?: readonly TransactionConstraintAlpha[];
|
|
103
|
+
};
|
|
83
104
|
|
|
84
105
|
/**
|
|
85
106
|
* The result of a {@link TreeBranchAlpha.(runTransaction:2) | transaction} that doesn't return a value.
|
|
107
|
+
* @input
|
|
86
108
|
* @alpha
|
|
87
109
|
*/
|
|
88
|
-
export type
|
|
89
|
-
|
|
110
|
+
export type VoidTransactionCallbackStatusAlpha = Omit<
|
|
111
|
+
TransactionCallbackStatusAlpha<unknown, unknown>,
|
|
90
112
|
"value"
|
|
91
113
|
>;
|
|
92
114
|
|
|
93
115
|
/**
|
|
94
|
-
* The result of a {@link
|
|
95
|
-
* @
|
|
116
|
+
* The result of a {@link TreeViewBeta.(runTransaction:1) | transaction} that completed successfully.
|
|
117
|
+
* @sealed
|
|
118
|
+
* @beta
|
|
96
119
|
*/
|
|
97
120
|
export interface TransactionResultSuccess<TSuccessValue> extends WithValue<TSuccessValue> {
|
|
98
|
-
/** The success flag for a transaction that completed without being {@link
|
|
99
|
-
success: true;
|
|
121
|
+
/** The success flag for a transaction that completed without being {@link TransactionCallbackStatusBeta | rolled back}. */
|
|
122
|
+
readonly success: true;
|
|
100
123
|
}
|
|
101
124
|
|
|
102
125
|
/**
|
|
103
|
-
* The result of a {@link
|
|
104
|
-
* @
|
|
126
|
+
* The result of a {@link TreeViewBeta.runTransaction | transaction} that was rolled back.
|
|
127
|
+
* @sealed
|
|
128
|
+
* @beta
|
|
105
129
|
*/
|
|
106
130
|
export interface TransactionResultFailed<TFailureValue> extends WithValue<TFailureValue> {
|
|
107
|
-
/** The failure flag for a transaction that was {@link
|
|
108
|
-
success: false;
|
|
131
|
+
/** The failure flag for a transaction that was {@link TransactionCallbackStatusBeta | rolled back}. */
|
|
132
|
+
readonly success: false;
|
|
109
133
|
}
|
|
110
134
|
|
|
111
135
|
/**
|
|
112
136
|
* The result of the {@link RunTransaction | RunTransaction} API.
|
|
113
|
-
* @
|
|
137
|
+
* @sealed
|
|
138
|
+
* @beta
|
|
114
139
|
*/
|
|
115
|
-
export type
|
|
140
|
+
export type TransactionValueResult<TSuccessValue, TFailureValue> =
|
|
116
141
|
| TransactionResultSuccess<TSuccessValue>
|
|
117
142
|
| TransactionResultFailed<TFailureValue>;
|
|
118
143
|
|
|
119
144
|
/**
|
|
120
|
-
* The result of the {@link RunTransaction | RunTransaction} API. This is the same as {@link
|
|
145
|
+
* The result of the {@link RunTransaction | RunTransaction} API. This is the same as {@link TransactionValueResult}
|
|
121
146
|
* but with the `value` field omitted. This is useful when the transaction callback doesn't need to return a value.
|
|
122
|
-
* @
|
|
147
|
+
* @sealed
|
|
148
|
+
* @beta
|
|
123
149
|
*/
|
|
124
|
-
export type
|
|
150
|
+
export type TransactionVoidResult =
|
|
125
151
|
| Omit<TransactionResultSuccess<unknown>, "value">
|
|
126
152
|
| Omit<TransactionResultFailed<unknown>, "value">;
|
|
127
153
|
|
|
128
154
|
/**
|
|
129
|
-
*
|
|
155
|
+
* A type-erased function that post-processes the change produced when a transaction is committed.
|
|
156
|
+
*
|
|
157
|
+
* @remarks
|
|
158
|
+
* Supply one via {@link RunTransactionParamsAlpha.postProcessor} to process/alter
|
|
159
|
+
* the change that a transaction produces. For example a post-processor could
|
|
160
|
+
* remove extraneous information, so that the resulting squashed change contains
|
|
161
|
+
* no extraneous information.
|
|
162
|
+
*
|
|
163
|
+
* This type intentionally hides its internal representation: its concrete shape
|
|
164
|
+
* is an implementation detail of `@fluidframework/tree`. Obtain a value of this
|
|
165
|
+
* type from a `@fluidframework/tree` helper or constant rather than constructing
|
|
166
|
+
* one directly.
|
|
167
|
+
*
|
|
130
168
|
* @alpha
|
|
169
|
+
* @sealed
|
|
170
|
+
* @system
|
|
171
|
+
*/
|
|
172
|
+
export interface TransactionPostProcessor
|
|
173
|
+
extends ErasedType<"@fluidframework/tree.TransactionPostProcessor"> {}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* The parameters for the {@link RunTransaction | RunTransaction} API.
|
|
177
|
+
* @input
|
|
178
|
+
* @beta
|
|
179
|
+
*/
|
|
180
|
+
export interface RunTransactionParamsBeta {
|
|
181
|
+
/**
|
|
182
|
+
* A label for this transaction that allows it to be correlated with later edits (e.g. for controlling undo/redo grouping).
|
|
183
|
+
* @remarks
|
|
184
|
+
* If this transaction is applied to a {@link TreeBranchAlpha | branch}, the label will be available in the {@link LocalChangeMetadata.label | metadata} of the {@link TreeBranchEvents.changed | `changed`} event.
|
|
185
|
+
*
|
|
186
|
+
* If there is a nested transaction, only the outermost transaction label will be used.
|
|
187
|
+
*/
|
|
188
|
+
readonly label?: unknown;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* The parameters for the {@link RunTransaction | RunTransaction} API, extended with alpha-only {@link TransactionConstraintAlpha | constraint} options.
|
|
131
193
|
* @input
|
|
194
|
+
* @alpha
|
|
132
195
|
*/
|
|
133
|
-
export interface
|
|
196
|
+
export interface RunTransactionParamsAlpha extends RunTransactionParamsBeta {
|
|
134
197
|
/**
|
|
135
198
|
* An optional list of {@link TransactionConstraintAlpha | constraints} that are checked just before the transaction begins.
|
|
136
199
|
* @remarks
|
|
@@ -138,12 +201,21 @@ export interface RunTransactionParams {
|
|
|
138
201
|
* If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.
|
|
139
202
|
*/
|
|
140
203
|
readonly preconditions?: readonly TransactionConstraintAlpha[];
|
|
204
|
+
|
|
141
205
|
/**
|
|
142
|
-
*
|
|
206
|
+
* An optional {@link TransactionPostProcessor | post-processor} applied to
|
|
207
|
+
* the change produced when this transaction is committed.
|
|
143
208
|
* @remarks
|
|
144
|
-
*
|
|
209
|
+
* When omitted, the transaction's edits are squashed without any such processing.
|
|
145
210
|
*
|
|
146
|
-
*
|
|
211
|
+
* Specific post-processors are applied according to their own rules for
|
|
212
|
+
* optimization and other post-processing tasks in a transaction stack. For
|
|
213
|
+
* example a "minimization" post-processor may be applied once for the
|
|
214
|
+
* outermost transaction in a stack as it will process all nested edits and
|
|
215
|
+
* there is no benefit from multiple applications.
|
|
216
|
+
*
|
|
217
|
+
* Note: minimization is not yet implemented. Supplying a post-processor currently has no observable effect beyond
|
|
218
|
+
* reserving the behavior; a real post-processor will be provided in a future change.
|
|
147
219
|
*/
|
|
148
|
-
readonly
|
|
220
|
+
readonly postProcessor?: TransactionPostProcessor;
|
|
149
221
|
}
|
|
@@ -11,17 +11,14 @@ import type {
|
|
|
11
11
|
RevertibleAlphaFactory,
|
|
12
12
|
RevertibleFactory,
|
|
13
13
|
} from "../../core/index.js";
|
|
14
|
-
// This is referenced by doc comments.
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- This is referenced by doc comments.
|
|
16
15
|
import type { TreeStatus } from "../../feature-libraries/index.js";
|
|
17
16
|
import type {
|
|
18
|
-
// This is referenced by doc comments.
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports -- This is referenced by doc comments.
|
|
20
18
|
TreeAlpha,
|
|
21
19
|
} from "../../shared-tree/index.js";
|
|
22
20
|
import type { JsonCompatibleReadOnly } from "../../util/index.js";
|
|
23
|
-
// This is referenced by doc comments.
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- This is referenced by doc comments.
|
|
25
22
|
import type { Unhydrated } from "../core/index.js";
|
|
26
23
|
import type {
|
|
27
24
|
ImplicitFieldSchema,
|
|
@@ -36,11 +33,14 @@ import type { UnsafeUnknownSchema } from "../unsafeUnknownSchema.js";
|
|
|
36
33
|
|
|
37
34
|
import type { TreeViewConfiguration } from "./configuration.js";
|
|
38
35
|
import type {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
RunTransactionParamsAlpha,
|
|
37
|
+
RunTransactionParamsBeta,
|
|
38
|
+
TransactionCallbackStatusAlpha,
|
|
39
|
+
TransactionCallbackStatusBeta,
|
|
40
|
+
TransactionVoidResult,
|
|
41
|
+
TransactionValueResult,
|
|
42
|
+
VoidTransactionCallbackStatusAlpha,
|
|
43
|
+
VoidTransactionCallbackStatusBeta,
|
|
44
44
|
WithValue,
|
|
45
45
|
} from "./transactionTypes.js";
|
|
46
46
|
import type { VerboseTree } from "./verboseTree.js";
|
|
@@ -193,8 +193,8 @@ export interface TreeContextAlpha {
|
|
|
193
193
|
* Run a synchronous transaction which groups sequential edits to the tree into a single atomic edit if possible.
|
|
194
194
|
* @param transaction - A callback run during the transaction to perform user-supplied operations.
|
|
195
195
|
* It may optionally return a {@link WithValue | value }, which will be returned by the `runTransaction` call.
|
|
196
|
-
* @param params - Optional {@link
|
|
197
|
-
* @returns A {@link
|
|
196
|
+
* @param params - Optional {@link RunTransactionParamsAlpha | parameters} for the transaction.
|
|
197
|
+
* @returns A {@link TransactionValueResult | value } indicating whether or not the transaction succeeded, and containing the value returned by `transaction`.
|
|
198
198
|
* @remarks
|
|
199
199
|
* All of the changes in the transaction are applied synchronously and therefore no other changes from a remote client can be interleaved with those changes.
|
|
200
200
|
* Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.
|
|
@@ -215,11 +215,20 @@ export interface TreeContextAlpha {
|
|
|
215
215
|
*/
|
|
216
216
|
runTransaction<TValue>(
|
|
217
217
|
transaction: () => WithValue<TValue>,
|
|
218
|
-
params?:
|
|
219
|
-
):
|
|
218
|
+
params?: RunTransactionParamsAlpha,
|
|
219
|
+
): TransactionValueResult<TValue, TValue>;
|
|
220
220
|
|
|
221
|
-
/**
|
|
222
|
-
|
|
221
|
+
/**
|
|
222
|
+
* An overload of {@link TreeContextAlpha.(runTransaction:1) | runTransaction } which does not return a value.
|
|
223
|
+
*
|
|
224
|
+
* @privateRemarks
|
|
225
|
+
* TODO: Consider updating these methods to avoid the need for overloads.
|
|
226
|
+
* See {@link TreeViewBeta.runTransaction} for an example of how to do this.
|
|
227
|
+
*/
|
|
228
|
+
runTransaction(
|
|
229
|
+
transaction: () => void,
|
|
230
|
+
params?: RunTransactionParamsAlpha,
|
|
231
|
+
): TransactionVoidResult;
|
|
223
232
|
|
|
224
233
|
/**
|
|
225
234
|
* An asynchronous version of {@link TreeContextAlpha.(runTransaction:1) | runTransaction}.
|
|
@@ -234,14 +243,20 @@ export interface TreeContextAlpha {
|
|
|
234
243
|
*/
|
|
235
244
|
runTransactionAsync<TValue>(
|
|
236
245
|
transaction: () => Promise<WithValue<TValue>>,
|
|
237
|
-
params?:
|
|
238
|
-
): Promise<
|
|
246
|
+
params?: RunTransactionParamsAlpha,
|
|
247
|
+
): Promise<TransactionValueResult<TValue, TValue>>;
|
|
239
248
|
|
|
240
|
-
/**
|
|
249
|
+
/**
|
|
250
|
+
* An overload of {@link TreeContextAlpha.(runTransactionAsync:1) | runTransactionAsync } which does not return a value.
|
|
251
|
+
*
|
|
252
|
+
* @privateRemarks
|
|
253
|
+
* TODO: Consider updating these methods to avoid the need for overloads.
|
|
254
|
+
* See {@link TreeViewBeta.runTransactionAsync} for an example of how to do this.
|
|
255
|
+
*/
|
|
241
256
|
runTransactionAsync(
|
|
242
257
|
transaction: () => Promise<void>,
|
|
243
|
-
params?:
|
|
244
|
-
): Promise<
|
|
258
|
+
params?: RunTransactionParamsAlpha,
|
|
259
|
+
): Promise<TransactionVoidResult>;
|
|
245
260
|
|
|
246
261
|
/**
|
|
247
262
|
* True if this context is associated with a {@link TreeBranchAlpha | branch} and false if it is associated with an {@link Unhydrated | unhydrated } node.
|
|
@@ -295,22 +310,26 @@ export interface TreeBranchAlpha extends TreeBranch, TreeContextAlpha {
|
|
|
295
310
|
|
|
296
311
|
/**
|
|
297
312
|
* {@link TreeContextAlpha.(runTransaction:1) | Run a transaction} on a branch of the SharedTree.
|
|
298
|
-
* @param transaction - The function to run as the body of the transaction, which may optionally return a {@link
|
|
313
|
+
* @param transaction - The function to run as the body of the transaction, which may optionally return a {@link TransactionCallbackStatusAlpha | value or rollback signal}.
|
|
299
314
|
* @remarks
|
|
300
315
|
* If the transaction is rolled back, a corresponding {@link TreeBranchEvents.changed | `changed`} event will also be emitted for the rollback.
|
|
301
316
|
*/
|
|
302
317
|
runTransaction<TSuccessValue, TFailureValue>(
|
|
303
|
-
transaction: () =>
|
|
304
|
-
params?:
|
|
305
|
-
):
|
|
318
|
+
transaction: () => TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>,
|
|
319
|
+
params?: RunTransactionParamsAlpha,
|
|
320
|
+
): TransactionValueResult<TSuccessValue, TFailureValue>;
|
|
306
321
|
|
|
307
322
|
/**
|
|
308
323
|
* An overload of {@link TreeBranchAlpha.(runTransaction:1) | runTransaction } which does not return a value.
|
|
324
|
+
*
|
|
325
|
+
* @privateRemarks
|
|
326
|
+
* TODO: Consider updating these methods to avoid the need for overloads.
|
|
327
|
+
* See {@link TreeViewBeta.runTransaction} for an example of how to do this.
|
|
309
328
|
*/
|
|
310
329
|
runTransaction(
|
|
311
|
-
transaction: () =>
|
|
312
|
-
params?:
|
|
313
|
-
):
|
|
330
|
+
transaction: () => VoidTransactionCallbackStatusAlpha | void,
|
|
331
|
+
params?: RunTransactionParamsAlpha,
|
|
332
|
+
): TransactionVoidResult;
|
|
314
333
|
|
|
315
334
|
/**
|
|
316
335
|
* An asynchronous version of {@link TreeBranchAlpha.(runTransaction:1) | runTransaction}.
|
|
@@ -318,17 +337,21 @@ export interface TreeBranchAlpha extends TreeBranch, TreeContextAlpha {
|
|
|
318
337
|
*/
|
|
319
338
|
|
|
320
339
|
runTransactionAsync<TSuccessValue, TFailureValue>(
|
|
321
|
-
transaction: () => Promise<
|
|
322
|
-
params?:
|
|
323
|
-
): Promise<
|
|
340
|
+
transaction: () => Promise<TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>>,
|
|
341
|
+
params?: RunTransactionParamsAlpha,
|
|
342
|
+
): Promise<TransactionValueResult<TSuccessValue, TFailureValue>>;
|
|
324
343
|
|
|
325
344
|
/**
|
|
326
345
|
* An overload of {@link TreeBranchAlpha.(runTransactionAsync:1) | runTransactionAsync } which does not return a value.
|
|
346
|
+
*
|
|
347
|
+
* @privateRemarks
|
|
348
|
+
* TODO: Consider updating these methods to avoid the need for overloads.
|
|
349
|
+
* See {@link TreeViewBeta.runTransactionAsync} for an example of how to do this.
|
|
327
350
|
*/
|
|
328
351
|
runTransactionAsync(
|
|
329
|
-
transaction: () => Promise<
|
|
330
|
-
params?:
|
|
331
|
-
): Promise<
|
|
352
|
+
transaction: () => Promise<VoidTransactionCallbackStatusAlpha | void>,
|
|
353
|
+
params?: RunTransactionParamsAlpha,
|
|
354
|
+
): Promise<TransactionVoidResult>;
|
|
332
355
|
|
|
333
356
|
/**
|
|
334
357
|
* Apply a serialized change to this branch.
|
|
@@ -449,13 +472,92 @@ export interface TreeView<in out TSchema extends ImplicitFieldSchema> extends ID
|
|
|
449
472
|
readonly schema: TSchema;
|
|
450
473
|
}
|
|
451
474
|
|
|
475
|
+
/**
|
|
476
|
+
* {@link TreeView} with additional beta APIs.
|
|
477
|
+
* @sealed @beta
|
|
478
|
+
*/
|
|
479
|
+
export interface TreeViewBeta<in out TSchema extends ImplicitFieldSchema>
|
|
480
|
+
extends TreeView<TSchema>,
|
|
481
|
+
TreeBranch {
|
|
482
|
+
// Override the base branch method to return a typed view rather than merely a branch.
|
|
483
|
+
fork(): ReturnType<TreeBranch["fork"]> & TreeViewBeta<TSchema>;
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* Run a synchronous transaction which groups sequential edits to the tree into a single atomic edit if possible.
|
|
487
|
+
*
|
|
488
|
+
* @param transaction - The function to run as the body of the transaction, which may optionally return a {@link TransactionCallbackStatusBeta | value or rollback signal}.
|
|
489
|
+
* It may optionally return a {@link WithValue | value }, which will be returned by the `runTransaction` call.
|
|
490
|
+
*
|
|
491
|
+
* @param params - Optional {@link RunTransactionParamsBeta | parameters} for the transaction.
|
|
492
|
+
*
|
|
493
|
+
* @returns A {@link TransactionValueResult | value } indicating whether or not the transaction succeeded, and containing the value returned by `transaction`.
|
|
494
|
+
*
|
|
495
|
+
* @remarks
|
|
496
|
+
* All of the changes in the transaction are applied synchronously and therefore no other changes from a remote client can be interleaved with those changes.
|
|
497
|
+
* Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.
|
|
498
|
+
*
|
|
499
|
+
* {@link (TreeBeta:interface).on | Change events } will be emitted for changed nodes on this client _as each edit happens_, just as they would be if the changes were made outside of a transaction.
|
|
500
|
+
* Any other/future clients or contexts will process the transaction "squashed", i.e. they will apply its changes all at once, emitting only a single event per node (even if that node was edited multiple times in the transaction).
|
|
501
|
+
* Edits to the tree are not permitted within these event callbacks, therefore no other local changes from this client will be interleaved with the changes in this transaction.
|
|
502
|
+
*
|
|
503
|
+
* Using a transaction has the following additional consequences:
|
|
504
|
+
*
|
|
505
|
+
* - If {@link Revertible | reverted } (e.g. via an "undo" operation), all the changes in the transaction are reverted together.
|
|
506
|
+
* Only the "outermost" transaction commits a change to the synchronized tree state and therefore only the outermost transaction can be reverted.
|
|
507
|
+
* If a transaction is started and completed while another transaction is already in progress, then the inner transaction will be reverted together with the outer transaction.
|
|
508
|
+
* - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.
|
|
509
|
+
*
|
|
510
|
+
* If the transaction is rolled back, a corresponding {@link TreeBranchEvents.changed | `changed`} event will also be emitted for the rollback.
|
|
511
|
+
*/
|
|
512
|
+
runTransaction<
|
|
513
|
+
TOut extends
|
|
514
|
+
| TransactionCallbackStatusBeta<unknown, unknown>
|
|
515
|
+
| VoidTransactionCallbackStatusBeta
|
|
516
|
+
| void,
|
|
517
|
+
>(
|
|
518
|
+
transaction: () => TOut,
|
|
519
|
+
params?: RunTransactionParamsBeta,
|
|
520
|
+
): TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue>
|
|
521
|
+
? TransactionValueResult<TSuccessValue, TFailureValue>
|
|
522
|
+
: TransactionVoidResult;
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* An asynchronous version of {@link TreeViewBeta.runTransaction | runTransaction}.
|
|
526
|
+
*
|
|
527
|
+
* @remarks
|
|
528
|
+
* As with synchronous transactions, all of the changes in an asynchronous transaction are treated as a unit.
|
|
529
|
+
* Therefore, no other changes (either from this client or from a remote client) can be interleaved with the transaction changes.
|
|
530
|
+
*
|
|
531
|
+
* Unlike with synchronous transactions, it is possible that other changes (e.g. from a remote client) may be applied to the branch while this transaction is in progress.
|
|
532
|
+
* Those other changes will be not be reflected on the branch until after this transaction completes, at which point the transaction changes will be applied after those other changes.
|
|
533
|
+
*
|
|
534
|
+
* An asynchronous transaction may not be started while any other transaction is in progress in this view.
|
|
535
|
+
*/
|
|
536
|
+
runTransactionAsync<
|
|
537
|
+
TOut extends
|
|
538
|
+
| TransactionCallbackStatusBeta<unknown, unknown>
|
|
539
|
+
| VoidTransactionCallbackStatusBeta
|
|
540
|
+
| void,
|
|
541
|
+
>(
|
|
542
|
+
transaction: () => Promise<TOut>,
|
|
543
|
+
params?: RunTransactionParamsBeta,
|
|
544
|
+
): Promise<
|
|
545
|
+
TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue>
|
|
546
|
+
? TransactionValueResult<TSuccessValue, TFailureValue>
|
|
547
|
+
: TransactionVoidResult
|
|
548
|
+
>;
|
|
549
|
+
}
|
|
550
|
+
|
|
452
551
|
/**
|
|
453
552
|
* {@link TreeView} with proposed changes to the schema aware typing to allow use with `UnsafeUnknownSchema`.
|
|
454
553
|
* @sealed @alpha
|
|
455
554
|
*/
|
|
456
555
|
export interface TreeViewAlpha<
|
|
457
556
|
in out TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema,
|
|
458
|
-
> extends Omit<
|
|
557
|
+
> extends Omit<
|
|
558
|
+
TreeViewBeta<ReadSchema<TSchema>>,
|
|
559
|
+
"root" | "initialize" | "fork" | "runTransaction" | "runTransactionAsync"
|
|
560
|
+
>,
|
|
459
561
|
TreeBranchAlpha {
|
|
460
562
|
get root(): ReadableField<TSchema>;
|
|
461
563
|
|
|
@@ -469,23 +571,15 @@ export interface TreeViewAlpha<
|
|
|
469
571
|
fork(): ReturnType<TreeBranch["fork"]> & TreeViewAlpha<TSchema>;
|
|
470
572
|
}
|
|
471
573
|
|
|
472
|
-
/**
|
|
473
|
-
* {@link TreeView} with additional beta APIs.
|
|
474
|
-
* @sealed @beta
|
|
475
|
-
*/
|
|
476
|
-
export interface TreeViewBeta<in out TSchema extends ImplicitFieldSchema>
|
|
477
|
-
extends TreeView<TSchema>,
|
|
478
|
-
TreeBranch {
|
|
479
|
-
// Override the base branch method to return a typed view rather than merely a branch.
|
|
480
|
-
fork(): ReturnType<TreeBranch["fork"]> & TreeViewBeta<TSchema>;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
574
|
/**
|
|
484
575
|
* Information about a view schema's compatibility with the document's stored schema.
|
|
485
576
|
*
|
|
577
|
+
* @see
|
|
486
578
|
* See SharedTree's README for more information about choosing a compatibility policy.
|
|
579
|
+
*
|
|
487
580
|
* @privateRemarks
|
|
488
581
|
* See {@link SchemaCompatibilityTester} for the implementation of this compatibility checking.
|
|
582
|
+
*
|
|
489
583
|
* @sealed @public
|
|
490
584
|
*/
|
|
491
585
|
export interface SchemaCompatibilityStatus {
|
|
@@ -37,6 +37,8 @@ import type { InsertableField, UnsafeUnknownSchema } from "../unsafeUnknownSchem
|
|
|
37
37
|
import { conciseFromCursor, type ConciseTree } from "./conciseTree.js";
|
|
38
38
|
import { createFromCursor } from "./create.js";
|
|
39
39
|
import type { TreeEncodingOptions } from "./customTree.js";
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Used by docs
|
|
41
|
+
import type { ObjectSchemaOptions } from "./schemaFactory.js";
|
|
40
42
|
import type { TreeChangeEvents } from "./treeChangeEvents.js";
|
|
41
43
|
import { treeNodeApi } from "./treeNodeApi.js";
|
|
42
44
|
import { cursorFromVerbose } from "./verboseTree.js";
|
|
@@ -290,18 +290,18 @@ export interface TreeNodeSchemaCore<
|
|
|
290
290
|
readonly implicitlyConstructable: ImplicitlyConstructable;
|
|
291
291
|
|
|
292
292
|
/**
|
|
293
|
-
* All possible
|
|
293
|
+
* All possible schemas that a direct child of a node with this schema could have.
|
|
294
294
|
*
|
|
295
|
-
* Equivalently, this is also all
|
|
296
|
-
* which is also the same as the set of
|
|
295
|
+
* Equivalently, this is also all schemas directly referenced when defining this schema's allowed child types,
|
|
296
|
+
* which is also the same as the set of schemas referenced directly by the `Info` type parameter and the `info` property.
|
|
297
297
|
* This property is simply re-exposing that information in an easier to traverse format consistent across all node kinds.
|
|
298
298
|
* @remarks
|
|
299
299
|
* Some kinds of nodes may have additional restrictions on children:
|
|
300
|
-
* this set simply enumerates all directly referenced
|
|
300
|
+
* this set simply enumerates all directly referenced schemas, and can be use to walk over all referenced schema types.
|
|
301
301
|
*
|
|
302
|
-
* This set cannot be used before the
|
|
303
|
-
* more specifically, when using lazy schema references (for example to make foreword references to
|
|
304
|
-
* users must wait until after the
|
|
302
|
+
* This set cannot be used before the schemas in it have been defined:
|
|
303
|
+
* more specifically, when using lazy schema references (for example to make foreword references to schemas which have not yet been defined),
|
|
304
|
+
* users must wait until after the schemas are defined to access this set.
|
|
305
305
|
* @privateRemarks
|
|
306
306
|
* Currently there isn't much use for this in the public API,
|
|
307
307
|
* and it's possible this will want to be tweaked or renamed as part of a larger schema reflection API surface that might be added later.
|
package/src/simple-tree/index.ts
CHANGED
|
@@ -175,17 +175,21 @@ export {
|
|
|
175
175
|
tryStoredSchemaAsArray,
|
|
176
176
|
type SchemaStatics,
|
|
177
177
|
type ITreeAlpha,
|
|
178
|
+
type NoChangeConstraint,
|
|
179
|
+
type NodeInDocumentConstraint,
|
|
180
|
+
type RunTransactionParamsAlpha,
|
|
181
|
+
type RunTransactionParamsBeta,
|
|
182
|
+
type TransactionCallbackStatusAlpha,
|
|
183
|
+
type TransactionCallbackStatusBeta,
|
|
178
184
|
type TransactionConstraint,
|
|
179
185
|
type TransactionConstraintAlpha,
|
|
180
|
-
type
|
|
181
|
-
type NoChangeConstraint,
|
|
182
|
-
type RunTransactionParams,
|
|
183
|
-
type VoidTransactionCallbackStatus,
|
|
184
|
-
type TransactionCallbackStatus,
|
|
185
|
-
type TransactionResult,
|
|
186
|
-
type TransactionResultExt,
|
|
187
|
-
type TransactionResultSuccess,
|
|
186
|
+
type TransactionPostProcessor,
|
|
188
187
|
type TransactionResultFailed,
|
|
188
|
+
type TransactionResultSuccess,
|
|
189
|
+
type TransactionValueResult,
|
|
190
|
+
type TransactionVoidResult,
|
|
191
|
+
type VoidTransactionCallbackStatusAlpha,
|
|
192
|
+
type VoidTransactionCallbackStatusBeta,
|
|
189
193
|
rollback,
|
|
190
194
|
generateSchemaFromSimpleSchema,
|
|
191
195
|
replaceConciseTreeHandles,
|
package/src/text/index.ts
CHANGED
|
@@ -5,4 +5,5 @@
|
|
|
5
5
|
|
|
6
6
|
export { TextAsTree } from "./textDomain.js";
|
|
7
7
|
export { FormattedTextAsTree } from "./textDomainFormatted.js";
|
|
8
|
+
export { FormattedTextAsTreeDefault } from "./textDomainFormattedDefault.js";
|
|
8
9
|
export { codePointCount, utf16LengthForCodePoints } from "./codePointUtils.js";
|