@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
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { Lazy, oob, fail, assert } from "@fluidframework/core-utils/internal";
|
|
6
|
+
import { Lazy, oob, fail, assert, clamp } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
8
8
|
|
|
9
|
-
import { EmptyKey, ObjectNodeStoredSchema } from "../../../core/index.js";
|
|
9
|
+
import { EmptyKey, ObjectNodeStoredSchema, type DeltaMark } from "../../../core/index.js";
|
|
10
10
|
import type {
|
|
11
11
|
FlexibleFieldContent,
|
|
12
12
|
FlexTreeNode,
|
|
@@ -23,7 +23,7 @@ import type { NodeSchemaOptionsAlpha, System_Unsafe } from "../../api/index.js";
|
|
|
23
23
|
import {
|
|
24
24
|
CompatibilityLevel,
|
|
25
25
|
type WithType,
|
|
26
|
-
// eslint-disable-next-line import-x/no-deprecated
|
|
26
|
+
// eslint-disable-next-line import-x/no-deprecated -- Required to implement the deprecated typeNameSymbol API.
|
|
27
27
|
typeNameSymbol,
|
|
28
28
|
NodeKind,
|
|
29
29
|
type TreeNode,
|
|
@@ -158,6 +158,11 @@ export interface TreeArrayNode<
|
|
|
158
158
|
* Removes the item at the specified location.
|
|
159
159
|
* @param index - The index at which to remove the item.
|
|
160
160
|
* @throws Throws if `index` is not in the range [0, `array.length`).
|
|
161
|
+
* @remarks
|
|
162
|
+
* The item to remove is determined when this method is called, not when the resulting edit is sequenced.
|
|
163
|
+
* This means that, once the edit is sequenced, the item being removed may no longer be at `index`,
|
|
164
|
+
* and may in fact no longer be in this array at all (for example, if a concurrent edit moved it to another array).
|
|
165
|
+
* This operation removes that item from wherever it then resides.
|
|
161
166
|
*/
|
|
162
167
|
removeAt(index: number): void;
|
|
163
168
|
|
|
@@ -534,12 +539,22 @@ export interface TreeArrayNodeAlpha<
|
|
|
534
539
|
/**
|
|
535
540
|
* Removes the last item from the array and returns it.
|
|
536
541
|
* @returns The removed item, or `undefined` if the array is empty (in which case the array is not modified).
|
|
542
|
+
* @remarks
|
|
543
|
+
* Equivalent to `removeAt(array.length - 1)`, additionally returning the removed item:
|
|
544
|
+
* see {@link (TreeArrayNode:interface).removeAt} for details, including merge semantics with concurrent edits.
|
|
545
|
+
* In particular, the item removed is the one that is last at the time this method is called,
|
|
546
|
+
* not the one that is last at the time the resulting edit is sequenced.
|
|
537
547
|
*/
|
|
538
548
|
pop(): T | undefined;
|
|
539
549
|
|
|
540
550
|
/**
|
|
541
551
|
* Removes the first item from the array and returns it.
|
|
542
552
|
* @returns The removed item, or `undefined` if the array is empty (in which case the array is not modified).
|
|
553
|
+
* @remarks
|
|
554
|
+
* Equivalent to `removeAt(0)`, additionally returning the removed item:
|
|
555
|
+
* see {@link (TreeArrayNode:interface).removeAt} for details, including merge semantics with concurrent edits.
|
|
556
|
+
* In particular, the item removed is the one that is first at the time this method is called,
|
|
557
|
+
* not the one that is first at the time the resulting edit is sequenced.
|
|
543
558
|
*/
|
|
544
559
|
shift(): T | undefined;
|
|
545
560
|
|
|
@@ -550,8 +565,10 @@ export interface TreeArrayNodeAlpha<
|
|
|
550
565
|
* @remarks
|
|
551
566
|
* Unlike `Array.prototype.unshift`, this method does not return the new length of the array.
|
|
552
567
|
*
|
|
553
|
-
*
|
|
554
|
-
*
|
|
568
|
+
* All items inserted by a single call to this method are inserted consecutively.
|
|
569
|
+
* The order of the inserted items relative to other concurrently inserted items is fully specified:
|
|
570
|
+
* Concurrently unshifting `[A, B]` and `[X, Y]` will yield `[A, B, X, Y]` if the edit unshifting `[A, B]`
|
|
571
|
+
* is sequenced after the edit unshifting `[X, Y]`.
|
|
555
572
|
*/
|
|
556
573
|
unshift(...value: readonly (TNew | IterableTreeArrayContent<TNew>)[]): void;
|
|
557
574
|
|
|
@@ -563,6 +580,8 @@ export interface TreeArrayNodeAlpha<
|
|
|
563
580
|
* Must be a non-negative integer no greater than the number of items from `start` to the end of the array.
|
|
564
581
|
* @param items - The item(s) to insert at `start`.
|
|
565
582
|
* @returns An array containing the item(s) that were removed.
|
|
583
|
+
* @remarks
|
|
584
|
+
* See {@link (TreeArrayNode:interface).insertAt} for the merge semantics of the inserted items.
|
|
566
585
|
*/
|
|
567
586
|
splice(
|
|
568
587
|
start: number,
|
|
@@ -1515,7 +1534,7 @@ export function arraySchema<
|
|
|
1515
1534
|
public static readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined =
|
|
1516
1535
|
persistedMetadata;
|
|
1517
1536
|
|
|
1518
|
-
// eslint-disable-next-line import-x/no-deprecated
|
|
1537
|
+
// eslint-disable-next-line import-x/no-deprecated -- Required to implement the deprecated typeNameSymbol API.
|
|
1519
1538
|
public get [typeNameSymbol](): TName {
|
|
1520
1539
|
return identifier;
|
|
1521
1540
|
}
|
|
@@ -1649,11 +1668,21 @@ export interface ArrayPlaceAnchor {
|
|
|
1649
1668
|
* The current index within the array that this anchor refers to.
|
|
1650
1669
|
* @remarks
|
|
1651
1670
|
* This value is updated as the array is edited in a way that depends on the specific anchor implementation.
|
|
1652
|
-
* This index
|
|
1671
|
+
* This index is a value from 0 to the current length of the array (inclusive).
|
|
1653
1672
|
* If used as the index to insert content into the array, this means it can point to any location in the array,
|
|
1654
1673
|
* including just after the last child.
|
|
1674
|
+
* @throws A {@link @fluidframework/telemetry-utils#UsageError} if the anchor has been {@link ArrayPlaceAnchor.dispose | disposed}.
|
|
1655
1675
|
*/
|
|
1656
1676
|
get index(): number;
|
|
1677
|
+
|
|
1678
|
+
/**
|
|
1679
|
+
* Stop tracking this anchor and release any resources it holds.
|
|
1680
|
+
* @remarks
|
|
1681
|
+
* Call this when the anchor is no longer needed (for example when a tracked cursor position is discarded).
|
|
1682
|
+
* Interacting with an anchor (including reading its properties) after it has been disposed is invalid and will throw.
|
|
1683
|
+
* Calling `dispose` more than once has no effect.
|
|
1684
|
+
*/
|
|
1685
|
+
dispose(): void;
|
|
1657
1686
|
}
|
|
1658
1687
|
|
|
1659
1688
|
/**
|
|
@@ -1671,9 +1700,29 @@ export interface ArrayPlaceAnchor {
|
|
|
1671
1700
|
* This is intended to track a location that might be used for an insertion point (for example in a text editor): future changes to its details should
|
|
1672
1701
|
* make it behave better for such uses.
|
|
1673
1702
|
*
|
|
1674
|
-
*
|
|
1675
|
-
*
|
|
1703
|
+
* In rare cases the tracked index cannot be updated precisely and the anchor falls back to best-effort behavior:
|
|
1704
|
+
* it keeps reporting a valid in-bounds index, but that index may no longer correspond to the same logical position
|
|
1705
|
+
* as before the change (this can happen when an incremental delta is unavailable for a change, such as during a
|
|
1706
|
+
* schema change). Consumers that require an accurate position across such changes should re-derive it from their
|
|
1707
|
+
* own state rather than relying solely on this anchor.
|
|
1676
1708
|
* @privateRemarks
|
|
1709
|
+
* The index is maintained incrementally from the shallow (insert/remove) delta delivered by the array node's
|
|
1710
|
+
* `childrenChangedAfterBatch` event: inserts and removes before the anchor point shift it, while edits after it
|
|
1711
|
+
* (or a removal of the span it sits between) leave it in place. This keeps the anchor pinned to the gap between
|
|
1712
|
+
* children even when the child originally at its index is removed.
|
|
1713
|
+
*
|
|
1714
|
+
* The best-effort behavior noted in the public remarks is the no-delta path: when the composed delta is unavailable
|
|
1715
|
+
* (see {@link NodeChangedDataDelta.delta}), the exact shift is unknown so the index is only clamped back into range.
|
|
1716
|
+
* This is intentionally weak rather than reintroducing a per-edit O(n) snapshot of the array to diff old-vs-new
|
|
1717
|
+
* (which would defeat the point of delta-based tracking) for a case that is rare and, for this alpha API, acceptable
|
|
1718
|
+
* to degrade. A stronger fallback could instead let a consumer that already maintains the array contents re-seed the
|
|
1719
|
+
* anchor's position on this path, so it lives with the consumer that has the data instead of being duplicated here.
|
|
1720
|
+
*
|
|
1721
|
+
* TODO: The no-delta case above is one of several places whose behavior is limited by changes for which a composed
|
|
1722
|
+
* delta cannot be produced (see {@link NodeChangedDataDelta.delta}). The underlying eventing limitation should be
|
|
1723
|
+
* fixed so a delta is always available; when adding new code constrained by it, note it here (or track it centrally)
|
|
1724
|
+
* so the full set of affected call sites is known and can be prioritized.
|
|
1725
|
+
*
|
|
1677
1726
|
* When stabilized, this should probably become a method on {@link (TreeArrayNode:interface)}.
|
|
1678
1727
|
* Future versions of this should use rebaser / changeset logic to do a better job of tracking a location across removals or reinsertion.
|
|
1679
1728
|
* How this would work, especially for unhydrated nodes is not yet clear.
|
|
@@ -1683,17 +1732,82 @@ export function createArrayInsertionAnchor(
|
|
|
1683
1732
|
node: TreeArrayNode,
|
|
1684
1733
|
currentIndex: number,
|
|
1685
1734
|
): ArrayPlaceAnchor {
|
|
1735
|
+
// An out-of-range or non-integer index is a usage error. An index equal to the array length is valid
|
|
1736
|
+
// (it points just past the last child).
|
|
1686
1737
|
const field = getInnerNode(node).getBoxed(EmptyKey);
|
|
1687
|
-
|
|
1738
|
+
validateIndex(currentIndex, field, "createArrayInsertionAnchor", /* allowOnePastEnd */ true);
|
|
1739
|
+
let trackedIndex = currentIndex;
|
|
1740
|
+
|
|
1741
|
+
const kernel = getKernel(node);
|
|
1742
|
+
let off: (() => void) | undefined = kernel.events.on(
|
|
1743
|
+
"childrenChangedAfterBatch",
|
|
1744
|
+
({ fieldMarks }) => {
|
|
1745
|
+
const marks = fieldMarks.get(EmptyKey);
|
|
1746
|
+
// This event fires after the change is applied, so the field reflects the post-edit length.
|
|
1747
|
+
const length = getInnerNode(node).getBoxed(EmptyKey).length;
|
|
1748
|
+
if (marks === undefined) {
|
|
1749
|
+
// No-delta path: the composed delta is unavailable, so the exact shift is unknown. Keep the
|
|
1750
|
+
// index valid by clamping it to the current length (best-effort). See this function's
|
|
1751
|
+
// @privateRemarks for when this happens and why the fallback is intentionally weak.
|
|
1752
|
+
trackedIndex = clamp(trackedIndex, 0, length);
|
|
1753
|
+
return;
|
|
1754
|
+
}
|
|
1755
|
+
// Clamp defensively so a malformed or partial delta can never push the tracked index outside the
|
|
1756
|
+
// valid insertion range while the anchor is live (adjustIndexForArrayDelta has no final clamp).
|
|
1757
|
+
trackedIndex = clamp(adjustIndexForArrayDelta(trackedIndex, marks), 0, length);
|
|
1758
|
+
},
|
|
1759
|
+
);
|
|
1760
|
+
|
|
1688
1761
|
return {
|
|
1689
1762
|
get index() {
|
|
1690
|
-
if (
|
|
1691
|
-
|
|
1692
|
-
}
|
|
1693
|
-
if (child.parentField.parent !== field) {
|
|
1694
|
-
return field.length;
|
|
1763
|
+
if (off === undefined) {
|
|
1764
|
+
throw new UsageError("Cannot read the index of a disposed ArrayPlaceAnchor.");
|
|
1695
1765
|
}
|
|
1696
|
-
return
|
|
1766
|
+
return trackedIndex;
|
|
1767
|
+
},
|
|
1768
|
+
dispose() {
|
|
1769
|
+
off?.();
|
|
1770
|
+
off = undefined;
|
|
1697
1771
|
},
|
|
1698
1772
|
};
|
|
1699
1773
|
}
|
|
1774
|
+
|
|
1775
|
+
/**
|
|
1776
|
+
* Compute the new index of an {@link ArrayPlaceAnchor} after applying a shallow array delta.
|
|
1777
|
+
* @remarks
|
|
1778
|
+
* The marks cover the array's sequence field in order. `readPosition` walks the pre-edit array as the marks are
|
|
1779
|
+
* consumed while `index` stays fixed at the anchor's pre-edit location; comparing the two (both in pre-edit
|
|
1780
|
+
* coordinates) shifts `newIndex` to keep the anchor in the same gap between children as content is inserted or
|
|
1781
|
+
* removed around it. Each mark is a removal (`detach`), an insertion (`attach`), or a retain (neither); a mark may
|
|
1782
|
+
* carry both `detach` and `attach`, which is handled as a removal followed by an insertion. The per-mark behavior is
|
|
1783
|
+
* commented inline below.
|
|
1784
|
+
*/
|
|
1785
|
+
function adjustIndexForArrayDelta(index: number, marks: readonly DeltaMark[]): number {
|
|
1786
|
+
let readPosition = 0;
|
|
1787
|
+
let newIndex = index;
|
|
1788
|
+
for (const mark of marks) {
|
|
1789
|
+
// A removal consumes pre-edit content: if it lies entirely before the anchor it pulls the anchor left,
|
|
1790
|
+
// and if it contains the anchor's position the anchor collapses to the start of the removed span.
|
|
1791
|
+
if (mark.detach !== undefined) {
|
|
1792
|
+
const removeEnd = readPosition + mark.count;
|
|
1793
|
+
if (removeEnd <= index) {
|
|
1794
|
+
newIndex -= mark.count;
|
|
1795
|
+
} else if (readPosition < index) {
|
|
1796
|
+
newIndex -= index - readPosition;
|
|
1797
|
+
}
|
|
1798
|
+
readPosition += mark.count;
|
|
1799
|
+
}
|
|
1800
|
+
if (mark.attach !== undefined) {
|
|
1801
|
+
// Content inserted at or before the anchor pushes it right; inserting exactly at the anchor leaves the
|
|
1802
|
+
// anchor after the new content (insertion-point behavior). Inserted content is new, so it does not
|
|
1803
|
+
// advance the pre-edit read position.
|
|
1804
|
+
if (readPosition <= index) {
|
|
1805
|
+
newIndex += mark.count;
|
|
1806
|
+
}
|
|
1807
|
+
} else if (mark.detach === undefined) {
|
|
1808
|
+
// Retain: existing content that was neither inserted nor removed.
|
|
1809
|
+
readPosition += mark.count;
|
|
1810
|
+
}
|
|
1811
|
+
}
|
|
1812
|
+
return newIndex;
|
|
1813
|
+
}
|
|
@@ -22,14 +22,18 @@ import {
|
|
|
22
22
|
type JsonCompatibleReadOnlyObject,
|
|
23
23
|
type RestrictiveStringRecord,
|
|
24
24
|
} from "../../../util/index.js";
|
|
25
|
-
import type {
|
|
25
|
+
import type {
|
|
26
|
+
NodeSchemaOptionsAlpha,
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Referenced by TSDoc {@link} in this file.
|
|
28
|
+
RunTransactionParamsAlpha,
|
|
29
|
+
} from "../../api/index.js";
|
|
26
30
|
import {
|
|
27
31
|
CompatibilityLevel,
|
|
28
32
|
getKernel,
|
|
29
33
|
type InnerNode,
|
|
30
34
|
NodeKind,
|
|
31
35
|
type TreeNodeSchema,
|
|
32
|
-
// eslint-disable-next-line import-x/no-deprecated
|
|
36
|
+
// eslint-disable-next-line import-x/no-deprecated -- Required to implement the deprecated typeNameSymbol API.
|
|
33
37
|
typeNameSymbol,
|
|
34
38
|
type TreeNode,
|
|
35
39
|
typeSchemaSymbol,
|
|
@@ -166,7 +170,105 @@ export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTyp
|
|
|
166
170
|
export interface TreeMapNodeAlpha<T extends ImplicitAllowedTypes = ImplicitAllowedTypes>
|
|
167
171
|
extends FluidReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>,
|
|
168
172
|
TreeNode,
|
|
169
|
-
Pick<TreeMapNode<T>, "set" | "delete"> {
|
|
173
|
+
Pick<TreeMapNode<T>, "set" | "delete"> {
|
|
174
|
+
/**
|
|
175
|
+
* Removes all elements from the map.
|
|
176
|
+
* @remarks
|
|
177
|
+
* The merge semantics of this operation are loosely specified. Either of the following may occur:
|
|
178
|
+
*
|
|
179
|
+
* - `clear` may remove all elements that were in the map when the edit was authored,
|
|
180
|
+
* even if some of those elements have since been moved elsewhere in the tree
|
|
181
|
+
* (in which case they are removed from their new location).
|
|
182
|
+
*
|
|
183
|
+
* - `clear` may remove all elements that are in the map when the edit is sequenced,
|
|
184
|
+
* even if some of those elements were not yet in the map when the edit was authored.
|
|
185
|
+
*/
|
|
186
|
+
clear(): void;
|
|
187
|
+
/**
|
|
188
|
+
* Returns the value at `key`, first inserting `fallbackValue` if this map has no entry for `key`.
|
|
189
|
+
*
|
|
190
|
+
* @param key - The key of the element to return or insert at.
|
|
191
|
+
* @param fallbackValue - The value to insert if `key` has no entry.
|
|
192
|
+
* @returns The value at `key`, which may be the provided `fallbackValue`
|
|
193
|
+
* if the map had no previous entry for `key`.
|
|
194
|
+
*
|
|
195
|
+
* @remarks
|
|
196
|
+
* The check for the presence of an existing entry with the given `key` is performed at the time the edit is authored.
|
|
197
|
+
* This has implications for the merge semantics of this operation:
|
|
198
|
+
*
|
|
199
|
+
* - If no entry is present for `key` at authoring time (thus leading to an insert)
|
|
200
|
+
* while a peer concurrently inserts a value for the same `key`,
|
|
201
|
+
* then the two inserts will race and the one that is sequenced second will overwrite the value inserted by the one
|
|
202
|
+
* that is sequenced first.
|
|
203
|
+
*
|
|
204
|
+
* - If an entry is present for `key` at authoring time (thus leading to no insert)
|
|
205
|
+
* while a peer concurrently deletes the entry for `key`,
|
|
206
|
+
* then the map will end up with no entry for `key` no matter how the two edits are sequenced.
|
|
207
|
+
*
|
|
208
|
+
* - If an entry is present for `key` at authoring time (thus leading to no insert)
|
|
209
|
+
* while a peer concurrently inserts a new entry for `key`,
|
|
210
|
+
* then the map will end up with the entry set by the peer no matter how the two edits are sequenced.
|
|
211
|
+
*
|
|
212
|
+
* These last two points mean that, upon sequencing of an edit made with this API,
|
|
213
|
+
* there is no guarantee that the entry for the given key will be the current one (if any) or the fallback one.
|
|
214
|
+
* If such a guarantee is important, then consider using {@link RunTransactionParamsAlpha.preconditions}
|
|
215
|
+
* to ensure the edit only applies when appropriate.
|
|
216
|
+
*
|
|
217
|
+
* This API is **not** equivalent to the following alternative:
|
|
218
|
+
*
|
|
219
|
+
* ```typescript
|
|
220
|
+
* map.set(key, map.get(key) ?? fallbackValue);
|
|
221
|
+
* ```
|
|
222
|
+
*
|
|
223
|
+
* They differ in the following ways:
|
|
224
|
+
*
|
|
225
|
+
* - This API treats entries containing `null` values as populated.
|
|
226
|
+
* By contrast, the above alternative's usage of `??` means that a `null` entry is treated as equivalent to a missing entry.
|
|
227
|
+
*
|
|
228
|
+
* - This API only inserts/sets the entry for the given `key` when there is no current one.
|
|
229
|
+
* By contrast, the above alternative always performs an insert.
|
|
230
|
+
* That insert will throw an error for non-leaf types (objects, maps, arrays, and records) in cases where the entry
|
|
231
|
+
* is already populated, because inserting a node that was already inserted is not supported.
|
|
232
|
+
* It will always succeed for leaf types (number, string, boolean, null, and handle) since a new node is created
|
|
233
|
+
* from the value.
|
|
234
|
+
* Note that even in the cases where it does not throw,
|
|
235
|
+
* the `set` operation has the potential to overwrite entries that are concurrently inserted even when the map had
|
|
236
|
+
* an entry for `key`, which is not the case with this API.
|
|
237
|
+
*
|
|
238
|
+
* Avoid using this API to write a default value into the document when the application could instead return that
|
|
239
|
+
* default when reading a missing entry, which is much less costly.
|
|
240
|
+
* A more appropriate use of this API is when the value to be optionally inserted varies with the key.
|
|
241
|
+
*/
|
|
242
|
+
getOrInsert(
|
|
243
|
+
key: string,
|
|
244
|
+
fallbackValue: InsertableTreeNodeFromImplicitAllowedTypes<T>,
|
|
245
|
+
): TreeNodeFromImplicitAllowedTypes<T>;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Returns the value at `key`, first inserting the value produced by `callback` if this map has no entry for `key`.
|
|
249
|
+
*
|
|
250
|
+
* @param key - The key of the element to return or insert at.
|
|
251
|
+
* @param callback - Invoked with `key` to produce the value to insert if `key` has no entry.
|
|
252
|
+
* Not invoked if an entry is present.
|
|
253
|
+
* @returns The value at `key`, which may be the value produced by `callback`
|
|
254
|
+
* if the map had no previous entry for `key`.
|
|
255
|
+
*
|
|
256
|
+
* @remarks
|
|
257
|
+
* This API is equivalent to {@link TreeMapNodeAlpha.getOrInsert} except that the fallback value is computed lazily:
|
|
258
|
+
* `callback` is only invoked when the map has no entry for `key`.
|
|
259
|
+
* Prefer this API over {@link TreeMapNodeAlpha.getOrInsert} when producing the fallback value is expensive.
|
|
260
|
+
*
|
|
261
|
+
* The check for the presence of an existing entry with the given `key` is performed at the time the edit is authored.
|
|
262
|
+
* See {@link TreeMapNodeAlpha.getOrInsert} for the implications this has on the merge semantics of this operation.
|
|
263
|
+
*
|
|
264
|
+
* If `callback` throws, no edit is made and the error is propagated to the caller.
|
|
265
|
+
* If `callback` sets an entry for `key` in this map, that entry is overwritten with the value `callback` returned.
|
|
266
|
+
*/
|
|
267
|
+
getOrInsertComputed(
|
|
268
|
+
key: string,
|
|
269
|
+
callback: (key: string) => InsertableTreeNodeFromImplicitAllowedTypes<T>,
|
|
270
|
+
): TreeNodeFromImplicitAllowedTypes<T>;
|
|
271
|
+
}
|
|
170
272
|
|
|
171
273
|
// TreeMapNode is invariant over schema type, so for this handler to work with all schema, the only possible type for the schema is `any`.
|
|
172
274
|
// This is not ideal, but no alternatives are possible.
|
|
@@ -247,6 +349,28 @@ abstract class CustomMapNodeBase<const T extends ImplicitAllowedTypes> extends T
|
|
|
247
349
|
this.editor(key).set(mapTree, field.length === 0);
|
|
248
350
|
return this;
|
|
249
351
|
}
|
|
352
|
+
public getOrInsert(
|
|
353
|
+
key: string,
|
|
354
|
+
fallbackValue: InsertableTreeNodeFromImplicitAllowedTypes<T>,
|
|
355
|
+
): TreeNodeFromImplicitAllowedTypes<T> {
|
|
356
|
+
const existing = this.get(key);
|
|
357
|
+
if (existing !== undefined) {
|
|
358
|
+
return existing;
|
|
359
|
+
}
|
|
360
|
+
this.set(key, fallbackValue);
|
|
361
|
+
return this.get(key);
|
|
362
|
+
}
|
|
363
|
+
public getOrInsertComputed(
|
|
364
|
+
key: string,
|
|
365
|
+
callback: (key: string) => InsertableTreeNodeFromImplicitAllowedTypes<T>,
|
|
366
|
+
): TreeNodeFromImplicitAllowedTypes<T> {
|
|
367
|
+
const existing = this.get(key);
|
|
368
|
+
if (existing !== undefined) {
|
|
369
|
+
return existing;
|
|
370
|
+
}
|
|
371
|
+
this.set(key, callback(key));
|
|
372
|
+
return this.get(key);
|
|
373
|
+
}
|
|
250
374
|
public get size(): number {
|
|
251
375
|
return count(this.innerNode.keys());
|
|
252
376
|
}
|
|
@@ -265,7 +389,15 @@ abstract class CustomMapNodeBase<const T extends ImplicitAllowedTypes> extends T
|
|
|
265
389
|
callbackFn.call(thisArg, node, field.key, this);
|
|
266
390
|
}
|
|
267
391
|
}
|
|
268
|
-
|
|
392
|
+
public clear(): void {
|
|
393
|
+
const node = this.innerNode;
|
|
394
|
+
const transaction = node.isHydrated() ? node.context.checkout.transaction : undefined;
|
|
395
|
+
transaction?.start();
|
|
396
|
+
for (const key of [...node.keys()]) {
|
|
397
|
+
this.delete(key);
|
|
398
|
+
}
|
|
399
|
+
transaction?.commit();
|
|
400
|
+
}
|
|
269
401
|
}
|
|
270
402
|
|
|
271
403
|
/**
|
|
@@ -353,7 +485,7 @@ export function mapSchema<
|
|
|
353
485
|
public static readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined =
|
|
354
486
|
persistedMetadata;
|
|
355
487
|
|
|
356
|
-
// eslint-disable-next-line import-x/no-deprecated
|
|
488
|
+
// eslint-disable-next-line import-x/no-deprecated -- Required to implement the deprecated typeNameSymbol API.
|
|
357
489
|
public get [typeNameSymbol](): TName {
|
|
358
490
|
return identifier;
|
|
359
491
|
}
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
type TreeNodeSchema,
|
|
33
33
|
NodeKind,
|
|
34
34
|
type WithType,
|
|
35
|
-
// eslint-disable-next-line import-x/no-deprecated
|
|
35
|
+
// eslint-disable-next-line import-x/no-deprecated -- Required to handle the deprecated typeNameSymbol API.
|
|
36
36
|
typeNameSymbol,
|
|
37
37
|
typeSchemaSymbol,
|
|
38
38
|
type InternalTreeNode,
|
|
@@ -335,7 +335,7 @@ function createProxyHandler(
|
|
|
335
335
|
if (propertyKey === typeSchemaSymbol) {
|
|
336
336
|
return schema;
|
|
337
337
|
}
|
|
338
|
-
// eslint-disable-next-line import-x/no-deprecated
|
|
338
|
+
// eslint-disable-next-line import-x/no-deprecated -- Required to handle the deprecated typeNameSymbol API.
|
|
339
339
|
if (propertyKey === typeNameSymbol) {
|
|
340
340
|
return schema.identifier;
|
|
341
341
|
}
|
|
@@ -633,7 +633,7 @@ export function objectSchema<
|
|
|
633
633
|
public static readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined =
|
|
634
634
|
nodeOptions.persistedMetadata;
|
|
635
635
|
|
|
636
|
-
// eslint-disable-next-line import-x/no-deprecated
|
|
636
|
+
// eslint-disable-next-line import-x/no-deprecated -- Required to implement the deprecated typeNameSymbol API.
|
|
637
637
|
public get [typeNameSymbol](): TName {
|
|
638
638
|
return identifier;
|
|
639
639
|
}
|
|
@@ -17,7 +17,7 @@ import type { NodeSchemaOptionsAlpha } from "../../api/index.js";
|
|
|
17
17
|
import {
|
|
18
18
|
type TreeNodeSchema,
|
|
19
19
|
NodeKind,
|
|
20
|
-
// eslint-disable-next-line import-x/no-deprecated
|
|
20
|
+
// eslint-disable-next-line import-x/no-deprecated -- Required to handle the deprecated typeNameSymbol API.
|
|
21
21
|
typeNameSymbol,
|
|
22
22
|
typeSchemaSymbol,
|
|
23
23
|
type UnhydratedFlexTreeNode,
|
|
@@ -78,7 +78,7 @@ function createRecordNodeProxy(
|
|
|
78
78
|
case typeSchemaSymbol: {
|
|
79
79
|
return schema;
|
|
80
80
|
}
|
|
81
|
-
// eslint-disable-next-line import-x/no-deprecated
|
|
81
|
+
// eslint-disable-next-line import-x/no-deprecated -- Required to handle the deprecated typeNameSymbol API.
|
|
82
82
|
case typeNameSymbol: {
|
|
83
83
|
return schema.identifier;
|
|
84
84
|
}
|
|
@@ -370,7 +370,7 @@ export function recordSchema<
|
|
|
370
370
|
public static readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined =
|
|
371
371
|
persistedMetadata;
|
|
372
372
|
|
|
373
|
-
// eslint-disable-next-line import-x/no-deprecated
|
|
373
|
+
// eslint-disable-next-line import-x/no-deprecated -- Required to implement the deprecated typeNameSymbol API.
|
|
374
374
|
public get [typeNameSymbol](): TName {
|
|
375
375
|
return identifier;
|
|
376
376
|
}
|
package/src/text/README.md
CHANGED
|
@@ -9,7 +9,7 @@ import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
|
9
9
|
* Returns the number of Unicode code points in `value`.
|
|
10
10
|
* @remarks
|
|
11
11
|
* Use this to translate a JavaScript string length (which is in UTF-16 code units) into
|
|
12
|
-
* the atom/code-point space used by {@link
|
|
12
|
+
* the atom/code-point space used by {@link PlainText} and {@link FormattedText}.
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
15
|
* ```typescript
|
|
@@ -33,7 +33,7 @@ export function codePointCount(value: string): number {
|
|
|
33
33
|
* Returns the number of UTF-16 code units occupied by the first `count` Unicode code points in `value`,
|
|
34
34
|
* starting at UTF-16 index `start`.
|
|
35
35
|
* @remarks
|
|
36
|
-
* Use this to translate {@link
|
|
36
|
+
* Use this to translate {@link PlainText}-space counts (code points) into JavaScript string indices (UTF-16).
|
|
37
37
|
* One code point outside the Basic Multilingual Plane (e.g. most emoji) occupies two UTF-16 code units.
|
|
38
38
|
*
|
|
39
39
|
* Validates that the requested `count` code points are fully consumable from `start`; silent truncation
|
package/src/text/index.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
6
|
+
export { PlainText } from "./textDomain.js";
|
|
7
|
+
export { FormattedText } from "./textDomainFormatted.js";
|
|
8
|
+
export { FormattedTextDefault } from "./textDomainFormattedDefault.js";
|
|
9
9
|
export { codePointCount, utf16LengthForCodePoints } from "./codePointUtils.js";
|