@fluidframework/tree 2.0.0-dev-rc.5.0.0.271262 → 2.0.0-dev-rc.5.0.0.271717
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/api-report/tree.alpha.api.md +2 -13
- package/api-report/tree.beta.api.md +2 -13
- package/api-report/tree.public.api.md +2 -13
- package/dist/beta.d.ts +0 -1
- package/dist/codec/codec.js +0 -1
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/discriminatedUnions.js +0 -1
- package/dist/codec/discriminatedUnions.js.map +1 -1
- package/dist/core/change-family/editBuilder.js +0 -2
- package/dist/core/change-family/editBuilder.js.map +1 -1
- package/dist/core/rebase/revisionTagCodec.js +0 -2
- package/dist/core/rebase/revisionTagCodec.js.map +1 -1
- package/dist/core/schema-stored/schema.js +0 -4
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.js +1 -3
- package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/dist/core/schema-view/view.js +0 -2
- package/dist/core/schema-view/view.js.map +1 -1
- package/dist/core/tree/anchorSet.js +46 -51
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +2 -8
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodec.js +0 -3
- package/dist/core/tree/detachedFieldIndexCodec.js.map +1 -1
- package/dist/core/tree/sparseTree.js +11 -15
- package/dist/core/tree/sparseTree.js.map +1 -1
- package/dist/domains/schemaBuilder.js +70 -70
- package/dist/domains/schemaBuilder.js.map +1 -1
- package/dist/events/events.js +1 -2
- package/dist/events/events.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js +1 -14
- package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +6 -13
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +2 -9
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +3 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +13 -3
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +6 -11
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +3 -3
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +2 -5
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +0 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +2 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +4 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +13 -25
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js +5 -8
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.js +0 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +5 -40
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +0 -2
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js +1 -2
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/dist/feature-libraries/editableTreeBinder.js +12 -13
- package/dist/feature-libraries/editableTreeBinder.js.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +11 -12
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +3 -7
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.js +22 -13
- package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +0 -6
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +17 -10
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +1 -6
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.js +0 -2
- package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -3
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +2 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +2 -5
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/node-key/mockNodeKeyManager.js +4 -2
- package/dist/feature-libraries/node-key/mockNodeKeyManager.js.map +1 -1
- package/dist/feature-libraries/node-key/nodeKeyIndex.js +0 -3
- package/dist/feature-libraries/node-key/nodeKeyIndex.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +28 -23
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.js +3 -1
- package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +1 -5
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/feature-libraries/schemaBuilderBase.js +3 -14
- package/dist/feature-libraries/schemaBuilderBase.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +0 -6
- package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
- package/dist/feature-libraries/sequence-field/markListFactory.js +4 -3
- package/dist/feature-libraries/sequence-field/markListFactory.js.map +1 -1
- package/dist/feature-libraries/sequence-field/markQueue.js +2 -4
- package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.js +0 -6
- package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.js +9 -13
- package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js +4 -23
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/dist/feature-libraries/typed-schema/view.js +0 -7
- package/dist/feature-libraries/typed-schema/view.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- 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/public.d.ts +0 -1
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +10 -27
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +4 -0
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +13 -10
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js +11 -14
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +3 -5
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js +0 -2
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/treeCheckout.js +11 -22
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree/treeView.js +0 -6
- package/dist/shared-tree/treeView.js.map +1 -1
- package/dist/shared-tree-core/branch.js +25 -31
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.js +9 -12
- package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.js +19 -21
- package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/dist/shared-tree-core/editManager.js +37 -53
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +1 -5
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +7 -24
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.js +1 -3
- package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
- package/dist/shared-tree-core/transactionStack.js +3 -1
- package/dist/shared-tree-core/transactionStack.js.map +1 -1
- package/dist/simple-tree/arrayNode.js +34 -26
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +2 -4
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/mapNode.js +5 -5
- package/dist/simple-tree/mapNode.js.map +1 -1
- package/dist/simple-tree/objectNode.js +6 -6
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/schemaFactory.d.ts +18 -5
- package/dist/simple-tree/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/schemaFactory.js +65 -53
- package/dist/simple-tree/schemaFactory.js.map +1 -1
- package/dist/simple-tree/schemaTypes.js +3 -12
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/tree.d.ts +1 -22
- package/dist/simple-tree/tree.d.ts.map +1 -1
- package/dist/simple-tree/tree.js +0 -21
- package/dist/simple-tree/tree.js.map +1 -1
- package/dist/simple-tree/treeNodeApi.d.ts +13 -4
- package/dist/simple-tree/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/treeNodeApi.js +8 -3
- package/dist/simple-tree/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/types.d.ts +26 -6
- package/dist/simple-tree/types.d.ts.map +1 -1
- package/dist/simple-tree/types.js +79 -54
- package/dist/simple-tree/types.js.map +1 -1
- package/dist/treeFactory.js +10 -9
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/brand.js +0 -1
- package/dist/util/brand.js.map +1 -1
- package/dist/util/nestedMap.js +4 -2
- package/dist/util/nestedMap.js.map +1 -1
- package/dist/util/offsetList.js +4 -2
- package/dist/util/offsetList.js.map +1 -1
- package/dist/util/referenceCounting.js +0 -1
- package/dist/util/referenceCounting.js.map +1 -1
- package/dist/util/stackyIterator.js +2 -3
- package/dist/util/stackyIterator.js.map +1 -1
- package/lib/beta.d.ts +0 -1
- package/lib/codec/codec.js +0 -1
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/discriminatedUnions.js +0 -1
- package/lib/codec/discriminatedUnions.js.map +1 -1
- package/lib/core/change-family/editBuilder.js +0 -2
- package/lib/core/change-family/editBuilder.js.map +1 -1
- package/lib/core/rebase/revisionTagCodec.js +0 -2
- package/lib/core/rebase/revisionTagCodec.js.map +1 -1
- package/lib/core/schema-stored/schema.js +0 -4
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.js +1 -3
- package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/lib/core/schema-view/view.js +0 -2
- package/lib/core/schema-view/view.js.map +1 -1
- package/lib/core/tree/anchorSet.js +46 -51
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +2 -8
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodec.js +0 -3
- package/lib/core/tree/detachedFieldIndexCodec.js.map +1 -1
- package/lib/core/tree/sparseTree.js +11 -15
- package/lib/core/tree/sparseTree.js.map +1 -1
- package/lib/domains/schemaBuilder.js +70 -70
- package/lib/domains/schemaBuilder.js.map +1 -1
- package/lib/events/events.js +1 -2
- package/lib/events/events.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js +1 -14
- package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +6 -13
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +2 -9
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +3 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +13 -3
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +6 -11
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +3 -3
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +2 -5
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +0 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +2 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +4 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +13 -25
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js +5 -8
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.js +0 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +5 -40
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +0 -2
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js +1 -2
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/lib/feature-libraries/editableTreeBinder.js +12 -13
- package/lib/feature-libraries/editableTreeBinder.js.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js +11 -12
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +3 -7
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.js +22 -13
- package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +0 -6
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +17 -10
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +1 -6
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.js +0 -2
- package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -3
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +2 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +2 -5
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/node-key/mockNodeKeyManager.js +4 -2
- package/lib/feature-libraries/node-key/mockNodeKeyManager.js.map +1 -1
- package/lib/feature-libraries/node-key/nodeKeyIndex.js +0 -3
- package/lib/feature-libraries/node-key/nodeKeyIndex.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +28 -23
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.js +3 -1
- package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +1 -5
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/feature-libraries/schemaBuilderBase.js +3 -14
- package/lib/feature-libraries/schemaBuilderBase.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +0 -6
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/markListFactory.js +4 -3
- package/lib/feature-libraries/sequence-field/markListFactory.js.map +1 -1
- package/lib/feature-libraries/sequence-field/markQueue.js +2 -4
- package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.js +0 -6
- package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.js +9 -13
- package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js +4 -23
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/lib/feature-libraries/typed-schema/view.js +0 -7
- package/lib/feature-libraries/typed-schema/view.js.map +1 -1
- package/lib/index.d.ts +1 -1
- 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/public.d.ts +0 -1
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +10 -27
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +4 -0
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +13 -10
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js +11 -14
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +3 -5
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js +0 -2
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/treeCheckout.js +11 -22
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree/treeView.js +0 -6
- package/lib/shared-tree/treeView.js.map +1 -1
- package/lib/shared-tree-core/branch.js +25 -31
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.js +9 -12
- package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.js +19 -21
- package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/lib/shared-tree-core/editManager.js +37 -53
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +1 -5
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +7 -24
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.js +1 -3
- package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
- package/lib/shared-tree-core/transactionStack.js +3 -1
- package/lib/shared-tree-core/transactionStack.js.map +1 -1
- package/lib/simple-tree/arrayNode.js +34 -26
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +2 -4
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/mapNode.js +5 -5
- package/lib/simple-tree/mapNode.js.map +1 -1
- package/lib/simple-tree/objectNode.js +6 -6
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/schemaFactory.d.ts +18 -5
- package/lib/simple-tree/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/schemaFactory.js +65 -53
- package/lib/simple-tree/schemaFactory.js.map +1 -1
- package/lib/simple-tree/schemaTypes.js +3 -12
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/tree.d.ts +1 -22
- package/lib/simple-tree/tree.d.ts.map +1 -1
- package/lib/simple-tree/tree.js +0 -21
- package/lib/simple-tree/tree.js.map +1 -1
- package/lib/simple-tree/treeNodeApi.d.ts +13 -4
- package/lib/simple-tree/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/treeNodeApi.js +8 -3
- package/lib/simple-tree/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/types.d.ts +26 -6
- package/lib/simple-tree/types.d.ts.map +1 -1
- package/lib/simple-tree/types.js +78 -54
- package/lib/simple-tree/types.js.map +1 -1
- package/lib/treeFactory.js +10 -9
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/brand.js +0 -1
- package/lib/util/brand.js.map +1 -1
- package/lib/util/nestedMap.js +4 -2
- package/lib/util/nestedMap.js.map +1 -1
- package/lib/util/offsetList.js +4 -2
- package/lib/util/offsetList.js.map +1 -1
- package/lib/util/referenceCounting.js +0 -1
- package/lib/util/referenceCounting.js.map +1 -1
- package/lib/util/stackyIterator.js +2 -3
- package/lib/util/stackyIterator.js.map +1 -1
- package/package.json +20 -20
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +22 -6
- package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +2 -2
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +6 -2
- package/src/feature-libraries/chunked-forest/codec/nodeShape.ts +8 -3
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +2 -0
- package/src/index.ts +0 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/schematizingTreeView.ts +0 -2
- package/src/shared-tree/sharedTree.ts +8 -1
- package/src/simple-tree/arrayNode.ts +17 -17
- package/src/simple-tree/schemaFactory.ts +18 -5
- package/src/simple-tree/tree.ts +1 -26
- package/src/simple-tree/treeNodeApi.ts +25 -7
- package/src/simple-tree/types.ts +57 -9
package/lib/util/offsetList.js
CHANGED
|
@@ -12,8 +12,10 @@
|
|
|
12
12
|
* - Merges runs of offsets together
|
|
13
13
|
*/
|
|
14
14
|
export class OffsetListFactory {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
constructor() {
|
|
16
|
+
this.offset = 0;
|
|
17
|
+
this.list = [];
|
|
18
|
+
}
|
|
17
19
|
push(...offsetOrContent) {
|
|
18
20
|
for (const item of offsetOrContent) {
|
|
19
21
|
if (typeof item === "number") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offsetList.js","sourceRoot":"","sources":["../../src/util/offsetList.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH;;;;;;;;GAQG;AACH,MAAM,OAAO,iBAAiB;
|
|
1
|
+
{"version":3,"file":"offsetList.js","sourceRoot":"","sources":["../../src/util/offsetList.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH;;;;;;;;GAQG;AACH,MAAM,OAAO,iBAAiB;IAA9B;QACS,WAAM,GAAG,CAAC,CAAC;QACH,SAAI,GAAyB,EAAE,CAAC;IAuBjD,CAAC;IArBO,IAAI,CAAC,GAAG,eAAsC;QACpD,KAAK,MAAM,IAAI,IAAI,eAAe,EAAE,CAAC;YACpC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC9B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YACvB,CAAC;iBAAM,CAAC;gBACP,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YACxB,CAAC;QACF,CAAC;IACF,CAAC;IAEM,UAAU,CAAC,MAAc;QAC/B,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC;IACvB,CAAC;IAEM,WAAW,CAAC,OAAiB;QACnC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC5B,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QACjB,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type OffsetList<TContent = Exclude<unknown, number>, TOffset = number> = (\n\t| TOffset\n\t| TContent\n)[];\n\n/**\n * Helper class for constructing an offset list that...\n *\n * - Does not insert offsets if there is no content after them\n *\n * - Does not insert 0-sized offsets\n *\n * - Merges runs of offsets together\n */\nexport class OffsetListFactory<TContent> {\n\tprivate offset = 0;\n\tpublic readonly list: OffsetList<TContent> = [];\n\n\tpublic push(...offsetOrContent: (number | TContent)[]): void {\n\t\tfor (const item of offsetOrContent) {\n\t\t\tif (typeof item === \"number\") {\n\t\t\t\tthis.pushOffset(item);\n\t\t\t} else {\n\t\t\t\tthis.pushContent(item);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic pushOffset(offset: number): void {\n\t\tthis.offset += offset;\n\t}\n\n\tpublic pushContent(content: TContent): void {\n\t\tif (this.offset > 0) {\n\t\t\tthis.list.push(this.offset);\n\t\t\tthis.offset = 0;\n\t\t}\n\t\tthis.list.push(content);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"referenceCounting.js","sourceRoot":"","sources":["../../src/util/referenceCounting.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAe7D;;GAEG;AACH,MAAM,OAAgB,oBAAoB;
|
|
1
|
+
{"version":3,"file":"referenceCounting.js","sourceRoot":"","sources":["../../src/util/referenceCounting.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAe7D;;GAEG;AACH,MAAM,OAAgB,oBAAoB;IACzC,YAA8B,WAAmB,CAAC;QAApB,aAAQ,GAAR,QAAQ,CAAY;IAAG,CAAC;IAE/C,cAAc,CAAC,KAAK,GAAG,CAAC;QAC9B,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC;IACxB,CAAC;IAEM,gBAAgB,CAAC,KAAK,GAAG,CAAC;QAChC,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC;QACvB,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC3D,IAAI,IAAI,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;YACzB,IAAI,CAAC,cAAc,EAAE,CAAC;QACvB,CAAC;IACF,CAAC;IAEM,QAAQ;QACd,OAAO,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;IAC1B,CAAC;IAEM,cAAc;QACpB,OAAO,IAAI,CAAC,QAAQ,KAAK,CAAC,CAAC;IAC5B,CAAC;CAMD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nexport interface ReferenceCounted {\n\treferenceAdded(): void;\n\n\treferenceRemoved(): void;\n\n\t/**\n\t * @returns true if mutating this object may impact other users of it.\n\t *\n\t * Implementations can return true if the refcount is 1 OR the content is logically immutable.\n\t */\n\tisShared(): boolean;\n}\n\n/**\n * Base class to assist with implementing ReferenceCounted.\n */\nexport abstract class ReferenceCountedBase implements ReferenceCounted {\n\tprotected constructor(private refCount: number = 1) {}\n\n\tpublic referenceAdded(count = 1): void {\n\t\tthis.refCount += count;\n\t}\n\n\tpublic referenceRemoved(count = 1): void {\n\t\tthis.refCount -= count;\n\t\tassert(this.refCount >= 0, 0x4c4 /* Negative ref count */);\n\t\tif (this.refCount === 0) {\n\t\t\tthis.onUnreferenced();\n\t\t}\n\t}\n\n\tpublic isShared(): boolean {\n\t\treturn this.refCount > 1;\n\t}\n\n\tpublic isUnreferenced(): boolean {\n\t\treturn this.refCount === 0;\n\t}\n\n\t/**\n\t * Called when refcount reaches 0.\n\t */\n\tprotected abstract onUnreferenced(): void;\n}\n"]}
|
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
* An iterator that supports having items pushed onto it for later iteration.
|
|
7
7
|
*/
|
|
8
8
|
export class StackyIterator {
|
|
9
|
-
list;
|
|
10
|
-
stack = [];
|
|
11
|
-
index = 0;
|
|
12
9
|
constructor(list) {
|
|
10
|
+
this.stack = [];
|
|
11
|
+
this.index = 0;
|
|
13
12
|
this.list = list;
|
|
14
13
|
}
|
|
15
14
|
[Symbol.iterator]() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stackyIterator.js","sourceRoot":"","sources":["../../src/util/stackyIterator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,OAAO,cAAc;
|
|
1
|
+
{"version":3,"file":"stackyIterator.js","sourceRoot":"","sources":["../../src/util/stackyIterator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,OAAO,cAAc;IAK1B,YAAmB,IAAkB;QAHpB,UAAK,GAAQ,EAAE,CAAC;QACzB,UAAK,GAAG,CAAC,CAAC;QAGjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;IAEM,CAAC,MAAM,CAAC,QAAQ,CAAC;QACvB,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,IAAI;QACV,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACf,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QACzC,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,EAAO,EAAE,CAAC;IACnC,CAAC;IAED,IAAW,IAAI;QACd,OAAO,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC;IAClE,CAAC;IAEM,IAAI,CAAC,IAAO;QAClB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAEM,GAAG;QACT,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;QACzB,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACpC,OAAO,SAAS,CAAC;QAClB,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;IAChC,CAAC;IAEM,IAAI;QACV,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * An iterator that supports having items pushed onto it for later iteration.\n */\nexport class StackyIterator<T> implements Iterator<T>, Iterable<T> {\n\tprivate readonly list: readonly T[];\n\tprivate readonly stack: T[] = [];\n\tprivate index = 0;\n\n\tpublic constructor(list: readonly T[]) {\n\t\tthis.list = list;\n\t}\n\n\tpublic [Symbol.iterator](): Iterator<T> {\n\t\treturn this;\n\t}\n\n\tpublic next(): IteratorResult<T> {\n\t\tif (this.done) {\n\t\t\treturn { value: undefined, done: true };\n\t\t}\n\t\treturn { value: this.pop() as T };\n\t}\n\n\tpublic get done(): boolean {\n\t\treturn this.index >= this.list.length && this.stack.length === 0;\n\t}\n\n\tpublic push(item: T): void {\n\t\tthis.stack.push(item);\n\t}\n\n\tpublic pop(): T | undefined {\n\t\tif (this.stack.length > 0) {\n\t\t\treturn this.stack.pop();\n\t\t}\n\t\tif (this.index >= this.list.length) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.list[this.index++];\n\t}\n\n\tpublic peek(): T | undefined {\n\t\tif (this.stack.length > 0) {\n\t\t\treturn this.stack[this.stack.length - 1];\n\t\t}\n\t\treturn this.list[this.index];\n\t}\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/tree",
|
|
3
|
-
"version": "2.0.0-dev-rc.5.0.0.
|
|
3
|
+
"version": "2.0.0-dev-rc.5.0.0.271717",
|
|
4
4
|
"description": "Distributed tree",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -67,17 +67,17 @@
|
|
|
67
67
|
"temp-directory": "nyc/.nyc_output"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@fluid-internal/client-utils": "2.0.0-dev-rc.5.0.0.
|
|
71
|
-
"@fluidframework/container-runtime": "2.0.0-dev-rc.5.0.0.
|
|
72
|
-
"@fluidframework/core-interfaces": "2.0.0-dev-rc.5.0.0.
|
|
73
|
-
"@fluidframework/core-utils": "2.0.0-dev-rc.5.0.0.
|
|
74
|
-
"@fluidframework/datastore-definitions": "2.0.0-dev-rc.5.0.0.
|
|
75
|
-
"@fluidframework/driver-definitions": "2.0.0-dev-rc.5.0.0.
|
|
76
|
-
"@fluidframework/id-compressor": "2.0.0-dev-rc.5.0.0.
|
|
77
|
-
"@fluidframework/runtime-definitions": "2.0.0-dev-rc.5.0.0.
|
|
78
|
-
"@fluidframework/runtime-utils": "2.0.0-dev-rc.5.0.0.
|
|
79
|
-
"@fluidframework/shared-object-base": "2.0.0-dev-rc.5.0.0.
|
|
80
|
-
"@fluidframework/telemetry-utils": "2.0.0-dev-rc.5.0.0.
|
|
70
|
+
"@fluid-internal/client-utils": "2.0.0-dev-rc.5.0.0.271717",
|
|
71
|
+
"@fluidframework/container-runtime": "2.0.0-dev-rc.5.0.0.271717",
|
|
72
|
+
"@fluidframework/core-interfaces": "2.0.0-dev-rc.5.0.0.271717",
|
|
73
|
+
"@fluidframework/core-utils": "2.0.0-dev-rc.5.0.0.271717",
|
|
74
|
+
"@fluidframework/datastore-definitions": "2.0.0-dev-rc.5.0.0.271717",
|
|
75
|
+
"@fluidframework/driver-definitions": "2.0.0-dev-rc.5.0.0.271717",
|
|
76
|
+
"@fluidframework/id-compressor": "2.0.0-dev-rc.5.0.0.271717",
|
|
77
|
+
"@fluidframework/runtime-definitions": "2.0.0-dev-rc.5.0.0.271717",
|
|
78
|
+
"@fluidframework/runtime-utils": "2.0.0-dev-rc.5.0.0.271717",
|
|
79
|
+
"@fluidframework/shared-object-base": "2.0.0-dev-rc.5.0.0.271717",
|
|
80
|
+
"@fluidframework/telemetry-utils": "2.0.0-dev-rc.5.0.0.271717",
|
|
81
81
|
"@sinclair/typebox": "^0.32.29",
|
|
82
82
|
"@tylerbu/sorted-btree-es6": "^1.8.0",
|
|
83
83
|
"@ungap/structured-clone": "^1.2.0",
|
|
@@ -86,19 +86,19 @@
|
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@arethetypeswrong/cli": "^0.15.2",
|
|
88
88
|
"@biomejs/biome": "^1.7.3",
|
|
89
|
-
"@fluid-internal/mocha-test-setup": "2.0.0-dev-rc.5.0.0.
|
|
90
|
-
"@fluid-private/stochastic-test-utils": "2.0.0-dev-rc.5.0.0.
|
|
91
|
-
"@fluid-private/test-dds-utils": "2.0.0-dev-rc.5.0.0.
|
|
92
|
-
"@fluid-private/test-drivers": "2.0.0-dev-rc.5.0.0.
|
|
89
|
+
"@fluid-internal/mocha-test-setup": "2.0.0-dev-rc.5.0.0.271717",
|
|
90
|
+
"@fluid-private/stochastic-test-utils": "2.0.0-dev-rc.5.0.0.271717",
|
|
91
|
+
"@fluid-private/test-dds-utils": "2.0.0-dev-rc.5.0.0.271717",
|
|
92
|
+
"@fluid-private/test-drivers": "2.0.0-dev-rc.5.0.0.271717",
|
|
93
93
|
"@fluid-tools/benchmark": "^0.48.0",
|
|
94
94
|
"@fluid-tools/build-cli": "^0.39.0",
|
|
95
95
|
"@fluidframework/build-common": "^2.0.3",
|
|
96
96
|
"@fluidframework/build-tools": "^0.39.0",
|
|
97
|
-
"@fluidframework/container-definitions": "2.0.0-dev-rc.5.0.0.
|
|
98
|
-
"@fluidframework/container-loader": "2.0.0-dev-rc.5.0.0.
|
|
97
|
+
"@fluidframework/container-definitions": "2.0.0-dev-rc.5.0.0.271717",
|
|
98
|
+
"@fluidframework/container-loader": "2.0.0-dev-rc.5.0.0.271717",
|
|
99
99
|
"@fluidframework/eslint-config-fluid": "^5.3.0",
|
|
100
|
-
"@fluidframework/test-runtime-utils": "2.0.0-dev-rc.5.0.0.
|
|
101
|
-
"@fluidframework/test-utils": "2.0.0-dev-rc.5.0.0.
|
|
100
|
+
"@fluidframework/test-runtime-utils": "2.0.0-dev-rc.5.0.0.271717",
|
|
101
|
+
"@fluidframework/test-utils": "2.0.0-dev-rc.5.0.0.271717",
|
|
102
102
|
"@microsoft/api-extractor": "^7.45.1",
|
|
103
103
|
"@types/diff": "^3.5.1",
|
|
104
104
|
"@types/easy-table": "^0.0.32",
|
|
@@ -38,15 +38,25 @@ import {
|
|
|
38
38
|
type EncodedValueShape,
|
|
39
39
|
SpecialField,
|
|
40
40
|
} from "./format.js";
|
|
41
|
-
import type { IIdCompressor,
|
|
41
|
+
import type { IIdCompressor, OpSpaceCompressedId, SessionId } from "@fluidframework/id-compressor";
|
|
42
42
|
|
|
43
|
+
export interface IdDecodingContext {
|
|
44
|
+
idCompressor: IIdCompressor;
|
|
45
|
+
/**
|
|
46
|
+
* The creator of any local Ids to be decoded.
|
|
47
|
+
*/
|
|
48
|
+
originatorId: SessionId;
|
|
49
|
+
}
|
|
43
50
|
/**
|
|
44
51
|
* Decode `chunk` into a TreeChunk.
|
|
45
52
|
*/
|
|
46
|
-
export function decode(
|
|
53
|
+
export function decode(
|
|
54
|
+
chunk: EncodedFieldBatch,
|
|
55
|
+
idDecodingContext: { idCompressor: IIdCompressor; originatorId: SessionId },
|
|
56
|
+
): TreeChunk[] {
|
|
47
57
|
return genericDecode(
|
|
48
58
|
decoderLibrary,
|
|
49
|
-
new DecoderContext(chunk.identifiers, chunk.shapes,
|
|
59
|
+
new DecoderContext(chunk.identifiers, chunk.shapes, idDecodingContext),
|
|
50
60
|
chunk,
|
|
51
61
|
anyDecoder,
|
|
52
62
|
);
|
|
@@ -77,7 +87,7 @@ const decoderLibrary = new DiscriminatedUnionDispatcher<
|
|
|
77
87
|
export function readValue(
|
|
78
88
|
stream: StreamCursor,
|
|
79
89
|
shape: EncodedValueShape,
|
|
80
|
-
|
|
90
|
+
idDecodingContext: IdDecodingContext,
|
|
81
91
|
): Value {
|
|
82
92
|
if (shape === undefined) {
|
|
83
93
|
return readStreamBoolean(stream) ? readStreamValue(stream) : undefined;
|
|
@@ -96,8 +106,14 @@ export function readValue(
|
|
|
96
106
|
typeof streamValue === "number" || typeof streamValue === "string",
|
|
97
107
|
"identifier must be string or number.",
|
|
98
108
|
);
|
|
109
|
+
const idCompressor = idDecodingContext.idCompressor;
|
|
99
110
|
return typeof streamValue === "number"
|
|
100
|
-
? idCompressor.decompress(
|
|
111
|
+
? idCompressor.decompress(
|
|
112
|
+
idCompressor.normalizeToSessionSpace(
|
|
113
|
+
streamValue as OpSpaceCompressedId,
|
|
114
|
+
idDecodingContext.originatorId,
|
|
115
|
+
),
|
|
116
|
+
)
|
|
101
117
|
: streamValue;
|
|
102
118
|
} else {
|
|
103
119
|
// EncodedCounter case:
|
|
@@ -259,7 +275,7 @@ export class TreeDecoder implements ChunkDecoder {
|
|
|
259
275
|
this.type ?? readStreamIdentifier(stream, this.cache);
|
|
260
276
|
// TODO: Consider typechecking against stored schema in here somewhere.
|
|
261
277
|
|
|
262
|
-
const value = readValue(stream, this.shape.value, this.cache.
|
|
278
|
+
const value = readValue(stream, this.shape.value, this.cache.idDecodingContext);
|
|
263
279
|
const fields: Map<FieldKey, TreeChunk[]> = new Map();
|
|
264
280
|
|
|
265
281
|
// Helper to add fields, but with unneeded array chunks removed.
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
readStream,
|
|
17
17
|
} from "./chunkCodecUtilities.js";
|
|
18
18
|
import type { EncodedFieldBatchGeneric, IdentifierOrIndex } from "./formatGeneric.js";
|
|
19
|
-
import type {
|
|
19
|
+
import type { IdDecodingContext } from "./chunkDecoding.js";
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* General purpose shape based tree decoder which gets its support for specific shapes from the caller.
|
|
@@ -52,7 +52,7 @@ export class DecoderContext<TEncodedShape = unknown> {
|
|
|
52
52
|
public constructor(
|
|
53
53
|
public readonly identifiers: readonly string[],
|
|
54
54
|
public readonly shapes: readonly TEncodedShape[],
|
|
55
|
-
public readonly
|
|
55
|
+
public readonly idDecodingContext: IdDecodingContext,
|
|
56
56
|
) {}
|
|
57
57
|
|
|
58
58
|
public identifier<T extends string & BrandedType<string, string>>(
|
|
@@ -19,11 +19,12 @@ import type { FieldBatch } from "./fieldBatch.js";
|
|
|
19
19
|
import { EncodedFieldBatch, validVersions } from "./format.js";
|
|
20
20
|
import { schemaCompressedEncode } from "./schemaBasedEncoding.js";
|
|
21
21
|
import { uncompressedEncode } from "./uncompressedEncode.js";
|
|
22
|
-
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
22
|
+
import type { IIdCompressor, SessionId } from "@fluidframework/id-compressor";
|
|
23
23
|
|
|
24
24
|
export interface FieldBatchEncodingContext {
|
|
25
25
|
readonly encodeType: TreeCompressionStrategy;
|
|
26
26
|
readonly idCompressor: IIdCompressor;
|
|
27
|
+
readonly originatorId: SessionId;
|
|
27
28
|
readonly schema?: SchemaAndPolicy;
|
|
28
29
|
}
|
|
29
30
|
/**
|
|
@@ -81,7 +82,10 @@ export function makeFieldBatchCodec(options: ICodecOptions, writeVersion: number
|
|
|
81
82
|
},
|
|
82
83
|
decode: (data: EncodedFieldBatch, context: FieldBatchEncodingContext): FieldBatch => {
|
|
83
84
|
// TODO: consider checking data is in schema.
|
|
84
|
-
return decode(data,
|
|
85
|
+
return decode(data, {
|
|
86
|
+
idCompressor: context.idCompressor,
|
|
87
|
+
originatorId: context.originatorId,
|
|
88
|
+
}).map((chunk) => chunk.cursor());
|
|
85
89
|
},
|
|
86
90
|
});
|
|
87
91
|
}
|
|
@@ -51,9 +51,14 @@ export class NodeShape extends Shape<EncodedChunkShape> implements NodeEncoder {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
if (this.value === 0) {
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
const sessionSpaceCompressedId = cache.idCompressor.tryRecompress(
|
|
55
|
+
cursor.value as StableId,
|
|
56
|
+
);
|
|
57
|
+
const opSpaceCompressedId =
|
|
58
|
+
sessionSpaceCompressedId !== undefined
|
|
59
|
+
? cache.idCompressor.normalizeToOpSpace(sessionSpaceCompressedId)
|
|
60
|
+
: cursor.value;
|
|
61
|
+
encodeValue(opSpaceCompressedId, this.value, outputBuffer);
|
|
57
62
|
} else {
|
|
58
63
|
encodeValue(cursor.value, this.value, outputBuffer);
|
|
59
64
|
}
|
|
@@ -326,6 +326,7 @@ function makeModularChangeCodec(
|
|
|
326
326
|
trees: fieldsCodec.encode(treesToEncode, {
|
|
327
327
|
encodeType: chunkCompressionStrategy,
|
|
328
328
|
schema: context.schema,
|
|
329
|
+
originatorId: context.originatorId,
|
|
329
330
|
idCompressor: context.idCompressor,
|
|
330
331
|
}),
|
|
331
332
|
};
|
|
@@ -341,6 +342,7 @@ function makeModularChangeCodec(
|
|
|
341
342
|
|
|
342
343
|
const chunks = fieldsCodec.decode(encoded.trees, {
|
|
343
344
|
encodeType: chunkCompressionStrategy,
|
|
345
|
+
originatorId: context.originatorId,
|
|
344
346
|
idCompressor: context.idCompressor,
|
|
345
347
|
});
|
|
346
348
|
const getChunk = (index: number): TreeChunk => {
|
package/src/index.ts
CHANGED
package/src/packageVersion.ts
CHANGED
|
@@ -142,6 +142,7 @@ interface ExplicitCodecVersions extends ExplicitCoreCodecVersions {
|
|
|
142
142
|
const formatVersionToTopLevelCodecVersions = new Map<number, ExplicitCodecVersions>([
|
|
143
143
|
[1, { forest: 1, schema: 1, detachedFieldIndex: 1, editManager: 1, message: 1, fieldBatch: 1 }],
|
|
144
144
|
[2, { forest: 1, schema: 1, detachedFieldIndex: 1, editManager: 2, message: 2, fieldBatch: 1 }],
|
|
145
|
+
[3, { forest: 1, schema: 1, detachedFieldIndex: 1, editManager: 3, message: 3, fieldBatch: 1 }],
|
|
145
146
|
]);
|
|
146
147
|
|
|
147
148
|
function getCodecVersions(formatVersion: number): ExplicitCodecVersions {
|
|
@@ -203,6 +204,7 @@ export class SharedTree
|
|
|
203
204
|
policy: defaultSchemaPolicy,
|
|
204
205
|
},
|
|
205
206
|
encodeType: options.treeEncodeType,
|
|
207
|
+
originatorId: runtime.idCompressor.localSessionId,
|
|
206
208
|
idCompressor: runtime.idCompressor,
|
|
207
209
|
};
|
|
208
210
|
const forestSummarizer = new ForestSummarizer(
|
|
@@ -361,6 +363,11 @@ export const SharedTreeFormatVersion = {
|
|
|
361
363
|
* Requires \@fluidframework/tree \>= 2.0.0.
|
|
362
364
|
*/
|
|
363
365
|
v2: 2,
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Requires \@fluidframework/tree \>= 2.0.0.
|
|
369
|
+
*/
|
|
370
|
+
v3: 3,
|
|
364
371
|
} as const;
|
|
365
372
|
|
|
366
373
|
/**
|
|
@@ -427,7 +434,7 @@ export const defaultSharedTreeOptions: Required<SharedTreeOptions> = {
|
|
|
427
434
|
jsonValidator: noopValidator,
|
|
428
435
|
forest: ForestType.Reference,
|
|
429
436
|
treeEncodeType: TreeCompressionStrategy.Compressed,
|
|
430
|
-
formatVersion: SharedTreeFormatVersion.
|
|
437
|
+
formatVersion: SharedTreeFormatVersion.v3,
|
|
431
438
|
};
|
|
432
439
|
|
|
433
440
|
/**
|
|
@@ -376,34 +376,34 @@ declare abstract class NodeWithArrayFeatures<Input, T>
|
|
|
376
376
|
{
|
|
377
377
|
concat(...items: ConcatArray<T>[]): T[];
|
|
378
378
|
concat(...items: (T | ConcatArray<T>)[]): T[];
|
|
379
|
-
|
|
380
|
-
slice(start?: number | undefined, end?: number | undefined): T[];
|
|
381
|
-
indexOf(searchElement: T, fromIndex?: number | undefined): number;
|
|
382
|
-
lastIndexOf(searchElement: T, fromIndex?: number | undefined): number;
|
|
379
|
+
entries(): IterableIterator<[number, T]>;
|
|
383
380
|
every<S extends T>(predicate: (value: T, index: number, array: readonly T[]) => value is S, thisArg?: any): this is readonly S[];
|
|
384
381
|
every(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): boolean;
|
|
385
|
-
some(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): boolean;
|
|
386
|
-
forEach(callbackfn: (value: T, index: number, array: readonly T[]) => void, thisArg?: any): void;
|
|
387
|
-
map<U>(callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: any): U[];
|
|
388
382
|
filter<S extends T>(predicate: (value: T, index: number, array: readonly T[]) => value is S, thisArg?: any): S[];
|
|
389
383
|
filter(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): T[];
|
|
384
|
+
find<S extends T>(predicate: (value: T, index: number, obj: readonly T[]) => value is S, thisArg?: any): S | undefined;
|
|
385
|
+
find(predicate: (value: T, index: number, obj: readonly T[]) => unknown, thisArg?: any): T | undefined;
|
|
386
|
+
findIndex(predicate: (value: T, index: number, obj: readonly T[]) => unknown, thisArg?: any): number;
|
|
387
|
+
flat<A, D extends number = 1>(this: A, depth?: D | undefined): FlatArray<A, D>[];
|
|
388
|
+
flatMap<U, This = undefined>(callback: (this: This, value: T, index: number, array: T[]) => U | readonly U[], thisArg?: This | undefined): U[];
|
|
389
|
+
forEach(callbackfn: (value: T, index: number, array: readonly T[]) => void, thisArg?: any): void;
|
|
390
|
+
includes(searchElement: T, fromIndex?: number | undefined): boolean;
|
|
391
|
+
indexOf(searchElement: T, fromIndex?: number | undefined): number;
|
|
392
|
+
join(separator?: string | undefined): string;
|
|
393
|
+
keys(): IterableIterator<number>;
|
|
394
|
+
lastIndexOf(searchElement: T, fromIndex?: number | undefined): number;
|
|
395
|
+
map<U>(callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: any): U[];
|
|
390
396
|
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T): T;
|
|
391
397
|
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T;
|
|
392
398
|
reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U, initialValue: U): U;
|
|
393
399
|
reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T): T;
|
|
394
400
|
reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T;
|
|
395
401
|
reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U, initialValue: U): U;
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
findIndex(predicate: (value: T, index: number, obj: readonly T[]) => unknown, thisArg?: any): number;
|
|
399
|
-
entries(): IterableIterator<[number, T]>;
|
|
400
|
-
keys(): IterableIterator<number>;
|
|
401
|
-
values(): IterableIterator<T>;
|
|
402
|
-
includes(searchElement: T, fromIndex?: number | undefined): boolean;
|
|
403
|
-
flatMap<U, This = undefined>(callback: (this: This, value: T, index: number, array: T[]) => U | readonly U[], thisArg?: This | undefined): U[];
|
|
404
|
-
flat<A, D extends number = 1>(this: A, depth?: D | undefined): FlatArray<A, D>[];
|
|
405
|
-
toString(): string;
|
|
402
|
+
slice(start?: number | undefined, end?: number | undefined): T[];
|
|
403
|
+
some(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): boolean;
|
|
406
404
|
toLocaleString(): string;
|
|
405
|
+
toString(): string;
|
|
406
|
+
values(): IterableIterator<T>;
|
|
407
407
|
}
|
|
408
408
|
/* eslint-enable @typescript-eslint/explicit-member-accessibility, @typescript-eslint/no-explicit-any */
|
|
409
409
|
|
|
@@ -567,11 +567,24 @@ export class SchemaFactory<
|
|
|
567
567
|
}
|
|
568
568
|
|
|
569
569
|
/**
|
|
570
|
-
*
|
|
571
|
-
* @remarks
|
|
572
|
-
*
|
|
573
|
-
*
|
|
574
|
-
*
|
|
570
|
+
* A special field which holds a unique identifier for an object node.
|
|
571
|
+
* @remarks
|
|
572
|
+
* The value of this field, a "node identifier", uniquely identifies a node among all other nodes in the tree.
|
|
573
|
+
* Node identifiers are strings, and can therefore be used as lookup keys in maps or written to a database.
|
|
574
|
+
* When the node is constructed, the identifier field does not need to be populated.
|
|
575
|
+
* The SharedTree will provide an identifier for the node automatically.
|
|
576
|
+
* An identifier provided automatically by the SharedTree has the following properties:
|
|
577
|
+
* - It is a UUID.
|
|
578
|
+
* - It is compressed to a space-efficient representation when stored in the document.
|
|
579
|
+
* - A compressed form of the identifier can be accessed at runtime via the `Tree.shortId()` API.
|
|
580
|
+
* - It will error if read (and will not be present in the object's iterable properties) before the node has been inserted into the tree.
|
|
581
|
+
*
|
|
582
|
+
* However, a user may alternatively supply their own string as the identifier if desired (for example, if importing identifiers from another system).
|
|
583
|
+
* In that case, it is up to the user to ensure that the identifier is unique within the current tree - no other node should have the same identifier at the same time.
|
|
584
|
+
* If the identifier is not unique, it may be read, but may cause libraries or features which operate over node identifiers to misbehave.
|
|
585
|
+
* User-supplied identifiers may be read immediately, even before insertion into the tree.
|
|
586
|
+
*
|
|
587
|
+
* A node may have more than one identifier field (though note that this precludes the use of the `Tree.shortId()` API).
|
|
575
588
|
*/
|
|
576
589
|
public get identifier(): FieldSchema<FieldKind.Identifier, typeof this.string> {
|
|
577
590
|
const defaultIdentifierProvider: DefaultProvider = getDefaultProvider(
|
package/src/simple-tree/tree.ts
CHANGED
|
@@ -57,30 +57,10 @@ export interface ITree extends IFluidLoadable {
|
|
|
57
57
|
viewWith<TRoot extends ImplicitFieldSchema>(
|
|
58
58
|
config: TreeViewConfiguration<TRoot>,
|
|
59
59
|
): TreeView<TRoot>;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Returns a {@link TreeView} using the provided schema.
|
|
63
|
-
* If the stored schema is view-compatible with the view schema specified by `config`,
|
|
64
|
-
* the returned {@link TreeView} will expose the root with a schema-aware API based on the provided view schema.
|
|
65
|
-
* See {@link TreeView.compatibility} for information about the compatibility between the view and stored schemas.
|
|
66
|
-
*
|
|
67
|
-
* @remarks
|
|
68
|
-
* If the tree is uninitialized, it will be implicitly initialized by this function.
|
|
69
|
-
*
|
|
70
|
-
* Note that other clients can modify the document at any time, causing the view to change its compatibility status: see {@link TreeView.events} for how to handle invalidation in these cases.
|
|
71
|
-
*
|
|
72
|
-
* Only one schematized view may exist for a given ITree at a time.
|
|
73
|
-
* If creating a second, the first must be disposed before calling `schematize` again.
|
|
74
|
-
* @deprecated Replaced by {@link ITree.viewWith}. Use that method instead. Note that `viewWith` does not implicitly initialize the tree:
|
|
75
|
-
* to initialize it, call {@link TreeView.initialize} on the returned view.
|
|
76
|
-
*/
|
|
77
|
-
schematize<TRoot extends ImplicitFieldSchema>(
|
|
78
|
-
config: TreeConfiguration<TRoot>,
|
|
79
|
-
): TreeView<TRoot>;
|
|
80
60
|
}
|
|
81
61
|
|
|
82
62
|
/**
|
|
83
|
-
* Options when
|
|
63
|
+
* Options when constructing a tree view.
|
|
84
64
|
* @public
|
|
85
65
|
*/
|
|
86
66
|
export interface ITreeConfigurationOptions {
|
|
@@ -342,11 +322,6 @@ export interface SchemaCompatibilityStatus {
|
|
|
342
322
|
* @public
|
|
343
323
|
*/
|
|
344
324
|
export interface TreeViewEvents {
|
|
345
|
-
/**
|
|
346
|
-
* A batch of changes has finished processing and the view has been updated.
|
|
347
|
-
*/
|
|
348
|
-
afterBatch(): void;
|
|
349
|
-
|
|
350
325
|
/**
|
|
351
326
|
* Raised whenever {@link TreeView.root} is invalidated.
|
|
352
327
|
*
|
|
@@ -36,6 +36,7 @@ import {
|
|
|
36
36
|
stringSchema,
|
|
37
37
|
} from "./leafNodeSchema.js";
|
|
38
38
|
import { isFluidHandle } from "@fluidframework/runtime-utils/internal";
|
|
39
|
+
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
39
40
|
|
|
40
41
|
/**
|
|
41
42
|
* Provides various functions for analyzing {@link TreeNode}s.
|
|
@@ -101,11 +102,20 @@ export interface TreeNodeApi {
|
|
|
101
102
|
readonly status: (node: TreeNode) => TreeStatus;
|
|
102
103
|
|
|
103
104
|
/**
|
|
104
|
-
* Returns the {@link
|
|
105
|
+
* Returns the {@link SchemaFactory.identifier | identifier} of the given node in the most compressed form possible.
|
|
105
106
|
* @remarks
|
|
106
|
-
* If the node's identifier is a valid
|
|
107
|
-
*
|
|
108
|
-
*
|
|
107
|
+
* If the node's identifier is a valid UUID that was automatically generated by the SharedTree, then this will return a process-unique integer corresponding to that identifier.
|
|
108
|
+
* This is useful for performance-sensitive scenarios involving many nodes with identifiers that need to be compactly retained in memory or used for efficient lookup.
|
|
109
|
+
*
|
|
110
|
+
* If the node's identifier is any other user-provided string, then this will return that string.
|
|
111
|
+
*
|
|
112
|
+
* If the node has no identifier (that is, it has no {@link SchemaFactory.identifier | identifier} field), then this returns `undefined`.
|
|
113
|
+
*
|
|
114
|
+
* If the node has more than one identifier, then this will throw an error.
|
|
115
|
+
*
|
|
116
|
+
* The returned integer must not be serialized or preserved outside of the current process.
|
|
117
|
+
* Its lifetime is that of the current in-memory instance of the FF container for this client, and it is not guaranteed to be unique or stable outside of that context.
|
|
118
|
+
* The same node's identifier may, for example, be different across multiple sessions for the same client and document, or different across two clients in the same session.
|
|
109
119
|
*/
|
|
110
120
|
shortId(node: TreeNode): number | string | undefined;
|
|
111
121
|
}
|
|
@@ -188,18 +198,26 @@ export const treeNodeApi: TreeNodeApi = {
|
|
|
188
198
|
},
|
|
189
199
|
shortId(node: TreeNode): number | string | undefined {
|
|
190
200
|
const flexNode = getFlexNode(node);
|
|
201
|
+
let shortId: number | string | undefined;
|
|
191
202
|
for (const field of flexNode.boxedIterator()) {
|
|
192
203
|
if (field.schema.kind === FieldKinds.identifier) {
|
|
204
|
+
if (shortId !== undefined) {
|
|
205
|
+
throw new UsageError(
|
|
206
|
+
"shortId() may not be called on a node with more than one identifier. Consider converting extraneous identifier fields to string fields.",
|
|
207
|
+
);
|
|
208
|
+
}
|
|
193
209
|
const identifier = field.boxedAt(0);
|
|
194
210
|
assert(identifier !== undefined, 0x927 /* The identifier must exist */);
|
|
195
211
|
const identifierValue = identifier.value as string;
|
|
196
212
|
const localNodeKey =
|
|
197
213
|
identifier.context.nodeKeyManager.tryLocalizeNodeKey(identifierValue);
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
: identifierValue;
|
|
214
|
+
|
|
215
|
+
shortId =
|
|
216
|
+
localNodeKey !== undefined ? extractFromOpaque(localNodeKey) : identifierValue;
|
|
201
217
|
}
|
|
202
218
|
}
|
|
219
|
+
|
|
220
|
+
return shortId;
|
|
203
221
|
},
|
|
204
222
|
};
|
|
205
223
|
|