@fluidframework/tree 2.42.0 → 2.43.0-343119
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 +59 -21
- package/api-report/tree.beta.api.md +33 -0
- package/dist/alpha.d.ts +11 -6
- package/dist/beta.d.ts +6 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +5 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/schema-stored/formatV2.d.ts +80 -0
- package/dist/core/schema-stored/formatV2.d.ts.map +1 -0
- package/dist/core/schema-stored/formatV2.js +55 -0
- package/dist/core/schema-stored/formatV2.js.map +1 -0
- package/dist/core/schema-stored/index.d.ts +3 -1
- package/dist/core/schema-stored/index.d.ts.map +1 -1
- package/dist/core/schema-stored/index.js +5 -2
- package/dist/core/schema-stored/index.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +49 -17
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +65 -22
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +9 -7
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +13 -9
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +3 -3
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +6 -6
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js +3 -3
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +8 -3
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js +2 -5
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +23 -24
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/index.d.ts +0 -1
- package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/index.js +1 -7
- package/dist/feature-libraries/flex-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +2 -2
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.js +3 -0
- package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +1 -2
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +2 -5
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts +5 -5
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +15 -7
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +8 -3
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +2 -5
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +2 -2
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +1 -2
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.d.ts +16 -2
- package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +2 -0
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +2 -0
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +8 -4
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -36
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.js +3 -3
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +59 -9
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.d.ts +1 -1
- package/dist/feature-libraries/schema-index/formatV2.d.ts +42 -0
- package/dist/feature-libraries/schema-index/formatV2.d.ts.map +1 -0
- package/dist/feature-libraries/schema-index/formatV2.js +26 -0
- package/dist/feature-libraries/schema-index/formatV2.js.map +1 -0
- package/dist/feature-libraries/schema-index/index.d.ts +2 -1
- package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/index.js +4 -2
- package/dist/feature-libraries/schema-index/index.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +7 -2
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +6 -6
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +1 -0
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +5 -1
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +34 -5
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +1 -1
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +12 -11
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.d.ts +8 -3
- package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +2 -5
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +18 -7
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +15 -2
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts +3 -3
- package/dist/simple-tree/api/schemaCreationUtilities.js +3 -3
- package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +15 -11
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +4 -0
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +41 -11
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +31 -4
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +2 -2
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/treeChangeEvents.d.ts +8 -3
- package/dist/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
- package/dist/simple-tree/api/treeChangeEvents.js.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +5 -0
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts +5 -9
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +12 -31
- package/dist/simple-tree/core/unhydratedFlexTree.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.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +2 -0
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +3 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +3 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts +3 -2
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +4 -2
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts +3 -2
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +3 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/dist/simple-tree/prepareForInsertion.js +5 -1
- package/dist/simple-tree/prepareForInsertion.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +50 -3
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js +28 -1
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +22 -4
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchema.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts +2 -0
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +13 -4
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/tableSchema.d.ts +1 -1
- package/dist/util/typeUtils.d.ts +2 -2
- package/dist/util/typeUtils.js.map +1 -1
- package/dist/util/utils.d.ts +2 -0
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js.map +1 -1
- package/lib/alpha.d.ts +11 -6
- package/lib/beta.d.ts +6 -1
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/schema-stored/formatV2.d.ts +80 -0
- package/lib/core/schema-stored/formatV2.d.ts.map +1 -0
- package/lib/core/schema-stored/formatV2.js +52 -0
- package/lib/core/schema-stored/formatV2.js.map +1 -0
- package/lib/core/schema-stored/index.d.ts +3 -1
- package/lib/core/schema-stored/index.d.ts.map +1 -1
- package/lib/core/schema-stored/index.js +3 -1
- package/lib/core/schema-stored/index.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +49 -17
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +63 -21
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +9 -7
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +11 -7
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +3 -3
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +7 -7
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js +3 -3
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +8 -3
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js +2 -5
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +23 -24
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/flex-tree/index.d.ts +0 -1
- package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/index.js +0 -1
- package/lib/feature-libraries/flex-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts +2 -2
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.js +3 -0
- package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +1 -2
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +3 -6
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts +5 -5
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +15 -7
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +8 -3
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +2 -5
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +2 -2
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +1 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.d.ts +16 -2
- package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +2 -0
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +2 -0
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +8 -4
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -36
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.js +3 -3
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +60 -10
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.d.ts +1 -1
- package/lib/feature-libraries/schema-index/formatV2.d.ts +42 -0
- package/lib/feature-libraries/schema-index/formatV2.d.ts.map +1 -0
- package/lib/feature-libraries/schema-index/formatV2.js +23 -0
- package/lib/feature-libraries/schema-index/formatV2.js.map +1 -0
- package/lib/feature-libraries/schema-index/index.d.ts +2 -1
- package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/index.js +2 -1
- package/lib/feature-libraries/schema-index/index.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +7 -2
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +6 -6
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +1 -0
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +5 -1
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +34 -5
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +1 -1
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +3 -2
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.d.ts +8 -3
- package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +2 -5
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +18 -7
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +15 -2
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.js +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts +3 -3
- package/lib/simple-tree/api/schemaCreationUtilities.js +3 -3
- package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +15 -11
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +4 -0
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +41 -11
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +31 -4
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +2 -2
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/treeChangeEvents.d.ts +8 -3
- package/lib/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
- package/lib/simple-tree/api/treeChangeEvents.js.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +5 -0
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts +5 -9
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +15 -34
- package/lib/simple-tree/core/unhydratedFlexTree.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.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts +2 -0
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +3 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +3 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts +3 -2
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +5 -3
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts +3 -2
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +3 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/lib/simple-tree/prepareForInsertion.js +5 -1
- package/lib/simple-tree/prepareForInsertion.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +50 -3
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js +28 -1
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +22 -4
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts +2 -0
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +13 -4
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/tableSchema.d.ts +1 -1
- package/lib/util/typeUtils.d.ts +2 -2
- package/lib/util/typeUtils.js.map +1 -1
- package/lib/util/utils.d.ts +2 -0
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js.map +1 -1
- package/package.json +21 -21
- package/src/core/index.ts +3 -1
- package/src/core/schema-stored/formatV2.ts +78 -0
- package/src/core/schema-stored/index.ts +4 -1
- package/src/core/schema-stored/schema.ts +123 -33
- package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +16 -11
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +16 -7
- package/src/feature-libraries/chunked-forest/codec/nodeShape.ts +4 -4
- package/src/feature-libraries/detachedFieldIndexSummarizer.ts +9 -16
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +32 -29
- package/src/feature-libraries/flex-tree/index.ts +0 -8
- package/src/feature-libraries/flex-tree/lazyEntity.ts +5 -1
- package/src/feature-libraries/flex-tree/lazyField.ts +5 -8
- package/src/feature-libraries/flex-tree/lazyNode.ts +17 -8
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +9 -16
- package/src/feature-libraries/index.ts +1 -1
- package/src/feature-libraries/mapTreeCursor.ts +17 -8
- package/src/feature-libraries/modular-schema/fieldKindWithEditor.ts +2 -0
- package/src/feature-libraries/object-forest/objectForest.ts +3 -0
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +11 -6
- package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +3 -3
- package/src/feature-libraries/schema-index/codec.ts +73 -14
- package/src/feature-libraries/schema-index/formatV2.ts +30 -0
- package/src/feature-libraries/schema-index/index.ts +2 -1
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +11 -18
- package/src/index.ts +5 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/schematizeTree.ts +1 -0
- package/src/shared-tree/sharedTree.ts +42 -12
- package/src/shared-tree/treeAlpha.ts +8 -3
- package/src/shared-tree-core/editManagerSummarizer.ts +9 -16
- package/src/shared-tree-core/sharedTreeCore.ts +33 -24
- package/src/simple-tree/api/schemaCompatibilityTester.ts +1 -1
- package/src/simple-tree/api/schemaCreationUtilities.ts +3 -3
- package/src/simple-tree/api/schemaFactory.ts +16 -11
- package/src/simple-tree/api/schemaFactoryAlpha.ts +53 -8
- package/src/simple-tree/api/storedSchema.ts +4 -4
- package/src/simple-tree/api/treeChangeEvents.ts +8 -3
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +5 -0
- package/src/simple-tree/core/treeNodeKernel.ts +1 -1
- package/src/simple-tree/core/unhydratedFlexTree.ts +22 -44
- package/src/simple-tree/index.ts +3 -0
- package/src/simple-tree/leafNodeSchema.ts +2 -0
- package/src/simple-tree/node-kinds/array/arrayNode.ts +5 -0
- package/src/simple-tree/node-kinds/map/mapNode.ts +11 -2
- package/src/simple-tree/node-kinds/object/objectNode.ts +9 -1
- package/src/simple-tree/prepareForInsertion.ts +5 -1
- package/src/simple-tree/schemaTypes.ts +96 -7
- package/src/simple-tree/simpleSchema.ts +27 -5
- package/src/simple-tree/toStoredSchema.ts +15 -4
- package/src/util/typeUtils.ts +2 -2
- package/src/util/utils.ts +2 -0
- package/dist/feature-libraries/flex-tree/navigation.d.ts +0 -46
- package/dist/feature-libraries/flex-tree/navigation.d.ts.map +0 -1
- package/dist/feature-libraries/flex-tree/navigation.js +0 -104
- package/dist/feature-libraries/flex-tree/navigation.js.map +0 -1
- package/lib/feature-libraries/flex-tree/navigation.d.ts +0 -46
- package/lib/feature-libraries/flex-tree/navigation.d.ts.map +0 -1
- package/lib/feature-libraries/flex-tree/navigation.js +0 -97
- package/lib/feature-libraries/flex-tree/navigation.js.map +0 -1
- package/src/feature-libraries/flex-tree/navigation.ts +0 -121
|
@@ -8,6 +8,7 @@ import { assert } from "@fluidframework/core-utils/internal";
|
|
|
8
8
|
import type { IChannelStorageService } from "@fluidframework/datastore-definitions/internal";
|
|
9
9
|
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
10
10
|
import type {
|
|
11
|
+
IExperimentalIncrementalSummaryContext,
|
|
11
12
|
ISummaryTreeWithStats,
|
|
12
13
|
ITelemetryContext,
|
|
13
14
|
} from "@fluidframework/runtime-definitions/internal";
|
|
@@ -49,22 +50,14 @@ export class EditManagerSummarizer<TChangeset> implements Summarizable {
|
|
|
49
50
|
private readonly schemaAndPolicy?: SchemaAndPolicy,
|
|
50
51
|
) {}
|
|
51
52
|
|
|
52
|
-
public
|
|
53
|
-
stringify: SummaryElementStringifier
|
|
54
|
-
fullTree?: boolean
|
|
55
|
-
trackState?: boolean
|
|
56
|
-
telemetryContext?: ITelemetryContext
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
public async summarize(
|
|
62
|
-
stringify: SummaryElementStringifier,
|
|
63
|
-
fullTree?: boolean,
|
|
64
|
-
trackState?: boolean,
|
|
65
|
-
telemetryContext?: ITelemetryContext,
|
|
66
|
-
): Promise<ISummaryTreeWithStats> {
|
|
67
|
-
return this.summarizeCore(stringify);
|
|
53
|
+
public summarize(props: {
|
|
54
|
+
stringify: SummaryElementStringifier;
|
|
55
|
+
fullTree?: boolean;
|
|
56
|
+
trackState?: boolean;
|
|
57
|
+
telemetryContext?: ITelemetryContext;
|
|
58
|
+
incrementalSummaryContext?: IExperimentalIncrementalSummaryContext;
|
|
59
|
+
}): ISummaryTreeWithStats {
|
|
60
|
+
return this.summarizeCore(props.stringify);
|
|
68
61
|
}
|
|
69
62
|
|
|
70
63
|
private summarizeCore(stringify: SummaryElementStringifier): ISummaryTreeWithStats {
|
|
@@ -212,20 +212,30 @@ export class SharedTreeCore<TEditor extends ChangeFamilyEditor, TChange>
|
|
|
212
212
|
serializer: IFluidSerializer,
|
|
213
213
|
telemetryContext?: ITelemetryContext,
|
|
214
214
|
incrementalSummaryContext?: IExperimentalIncrementalSummaryContext,
|
|
215
|
+
fullTree?: boolean,
|
|
215
216
|
): ISummaryTreeWithStats {
|
|
216
217
|
const builder = new SummaryTreeBuilder();
|
|
217
218
|
const summarizableBuilder = new SummaryTreeBuilder();
|
|
218
219
|
// Merge the summaries of all summarizables together under a single ISummaryTree
|
|
219
220
|
for (const s of this.summarizables) {
|
|
221
|
+
// Add the summarizable's path in the summary tree to the incremental summary context's
|
|
222
|
+
// summary path, so that the summarizable can use it to generate incremental summaries.
|
|
223
|
+
const childIncrementalSummaryContext =
|
|
224
|
+
incrementalSummaryContext === undefined
|
|
225
|
+
? undefined
|
|
226
|
+
: {
|
|
227
|
+
...incrementalSummaryContext,
|
|
228
|
+
summaryPath: `${incrementalSummaryContext.summaryPath}/${summarizablesTreeKey}/${s.key}`,
|
|
229
|
+
};
|
|
220
230
|
summarizableBuilder.addWithStats(
|
|
221
231
|
s.key,
|
|
222
|
-
s.
|
|
223
|
-
(contents) =>
|
|
224
|
-
|
|
225
|
-
|
|
232
|
+
s.summarize({
|
|
233
|
+
stringify: (contents: unknown) =>
|
|
234
|
+
serializer.stringify(contents, this.sharedObject.handle),
|
|
235
|
+
fullTree,
|
|
226
236
|
telemetryContext,
|
|
227
|
-
incrementalSummaryContext,
|
|
228
|
-
),
|
|
237
|
+
incrementalSummaryContext: childIncrementalSummaryContext,
|
|
238
|
+
}),
|
|
229
239
|
);
|
|
230
240
|
}
|
|
231
241
|
|
|
@@ -434,28 +444,27 @@ export interface Summarizable {
|
|
|
434
444
|
*/
|
|
435
445
|
readonly key: string;
|
|
436
446
|
|
|
437
|
-
/**
|
|
438
|
-
* {@inheritDoc @fluidframework/datastore-definitions#(IChannel:interface).getAttachSummary}
|
|
439
|
-
* @param stringify - Serializes the contents of the component (including {@link (IFluidHandle:interface)}s) for storage.
|
|
440
|
-
*/
|
|
441
|
-
getAttachSummary(
|
|
442
|
-
stringify: SummaryElementStringifier,
|
|
443
|
-
fullTree?: boolean,
|
|
444
|
-
trackState?: boolean,
|
|
445
|
-
telemetryContext?: ITelemetryContext,
|
|
446
|
-
incrementalSummaryContext?: IExperimentalIncrementalSummaryContext,
|
|
447
|
-
): ISummaryTreeWithStats;
|
|
448
|
-
|
|
449
447
|
/**
|
|
450
448
|
* {@inheritDoc @fluidframework/datastore-definitions#(IChannel:interface).summarize}
|
|
451
449
|
* @param stringify - Serializes the contents of the component (including {@link (IFluidHandle:interface)}s) for storage.
|
|
450
|
+
* @param fullTree - A flag indicating whether the attempt should generate a full
|
|
451
|
+
* summary tree without any handles for unchanged subtrees. It should only be set to true when generating
|
|
452
|
+
* a summary from the entire container. The default value is false.
|
|
453
|
+
* @param trackState - An optimization for tracking state of objects across summaries. If the state
|
|
454
|
+
* of an object did not change since last successful summary, an
|
|
455
|
+
* {@link @fluidframework/protocol-definitions#ISummaryHandle} can be used
|
|
456
|
+
* instead of re-summarizing it. If this is `false`, the expectation is that you should never
|
|
457
|
+
* send an `ISummaryHandle`, since you are not expected to track state. The default value is true.
|
|
458
|
+
* @param telemetryContext - See {@link @fluidframework/runtime-definitions#ITelemetryContext}.
|
|
459
|
+
* @param incrementalSummaryContext - See {@link @fluidframework/runtime-definitions#IExperimentalIncrementalSummaryContext}.
|
|
452
460
|
*/
|
|
453
|
-
summarize(
|
|
454
|
-
stringify: SummaryElementStringifier
|
|
455
|
-
fullTree?: boolean
|
|
456
|
-
trackState?: boolean
|
|
457
|
-
telemetryContext?: ITelemetryContext
|
|
458
|
-
|
|
461
|
+
summarize(props: {
|
|
462
|
+
stringify: SummaryElementStringifier;
|
|
463
|
+
fullTree?: boolean;
|
|
464
|
+
trackState?: boolean;
|
|
465
|
+
telemetryContext?: ITelemetryContext;
|
|
466
|
+
incrementalSummaryContext?: IExperimentalIncrementalSummaryContext;
|
|
467
|
+
}): ISummaryTreeWithStats;
|
|
459
468
|
|
|
460
469
|
/**
|
|
461
470
|
* Allows the component to perform custom loading. The storage service is scoped to this component and therefore
|
|
@@ -32,7 +32,7 @@ import type { UnionToTuple } from "../../util/index.js";
|
|
|
32
32
|
* This is commonly used in unions when the only information needed is which kind of node the value is.
|
|
33
33
|
* Enums are a common example of this pattern.
|
|
34
34
|
* @see {@link adaptEnum}
|
|
35
|
-
* @
|
|
35
|
+
* @beta
|
|
36
36
|
*/
|
|
37
37
|
// Return type is intentionally derived.
|
|
38
38
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
@@ -107,7 +107,7 @@ export function singletonSchema<TScope extends string, TName extends string | nu
|
|
|
107
107
|
* @privateRemarks
|
|
108
108
|
* Maybe provide `SchemaFactory.nested` to ease creating nested scopes?
|
|
109
109
|
* @see {@link enumFromStrings} for a similar function that works on arrays of strings instead of an enum.
|
|
110
|
-
* @
|
|
110
|
+
* @beta
|
|
111
111
|
*/
|
|
112
112
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
113
113
|
export function adaptEnum<
|
|
@@ -186,7 +186,7 @@ export function adaptEnum<
|
|
|
186
186
|
* class Parent extends schemaFactory.object("Parent", { mode: Mode.schema }) {}
|
|
187
187
|
* ```
|
|
188
188
|
* @see {@link adaptEnum} for a similar function that works on enums instead of arrays of strings.
|
|
189
|
-
* @
|
|
189
|
+
* @beta
|
|
190
190
|
*/
|
|
191
191
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
192
192
|
export function enumFromStrings<
|
|
@@ -56,13 +56,14 @@ import {
|
|
|
56
56
|
createFieldSchema,
|
|
57
57
|
type DefaultProvider,
|
|
58
58
|
getDefaultProvider,
|
|
59
|
-
type NodeSchemaOptions,
|
|
60
59
|
markSchemaMostDerived,
|
|
61
60
|
type FieldSchemaAlpha,
|
|
62
61
|
type ImplicitAnnotatedAllowedTypes,
|
|
63
62
|
type UnannotateImplicitAllowedTypes,
|
|
64
63
|
type UnannotateSchemaRecord,
|
|
64
|
+
type NodeSchemaOptionsAlpha,
|
|
65
65
|
normalizeAllowedTypes,
|
|
66
|
+
type FieldPropsAlpha,
|
|
66
67
|
} from "../schemaTypes.js";
|
|
67
68
|
|
|
68
69
|
import { createFieldSchemaUnsafe } from "./schemaFactoryRecursive.js";
|
|
@@ -101,7 +102,7 @@ export function schemaFromValue(value: TreeValue): TreeNodeSchema {
|
|
|
101
102
|
* @alpha
|
|
102
103
|
*/
|
|
103
104
|
export interface SchemaFactoryObjectOptions<TCustomMetadata = unknown>
|
|
104
|
-
extends
|
|
105
|
+
extends NodeSchemaOptionsAlpha<TCustomMetadata> {
|
|
105
106
|
/**
|
|
106
107
|
* Allow nodes typed with this object node schema to contain optional fields that are not present in the schema declaration.
|
|
107
108
|
* Such nodes can come into existence either via import APIs (see remarks) or by way of collaboration with another client
|
|
@@ -147,8 +148,12 @@ export interface SchemaFactoryObjectOptions<TCustomMetadata = unknown>
|
|
|
147
148
|
allowUnknownOptionalFields?: boolean;
|
|
148
149
|
}
|
|
149
150
|
|
|
151
|
+
/**
|
|
152
|
+
* Default options for Object node schema creation.
|
|
153
|
+
* @remarks Omits parameters that are not relevant for common use cases.
|
|
154
|
+
*/
|
|
150
155
|
export const defaultSchemaFactoryObjectOptions: Required<
|
|
151
|
-
Omit<SchemaFactoryObjectOptions, "metadata">
|
|
156
|
+
Omit<SchemaFactoryObjectOptions, "metadata" | "persistedMetadata">
|
|
152
157
|
> = {
|
|
153
158
|
allowUnknownOptionalFields: false,
|
|
154
159
|
};
|
|
@@ -307,7 +312,7 @@ const defaultOptionalProvider: DefaultProvider = getDefaultProvider(() => []);
|
|
|
307
312
|
|
|
308
313
|
function optional<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(
|
|
309
314
|
t: T,
|
|
310
|
-
props?: Omit<
|
|
315
|
+
props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">,
|
|
311
316
|
): FieldSchemaAlpha<FieldKind.Optional, T, TCustomMetadata>;
|
|
312
317
|
|
|
313
318
|
function optional<
|
|
@@ -315,7 +320,7 @@ function optional<
|
|
|
315
320
|
const TCustomMetadata = unknown,
|
|
316
321
|
>(
|
|
317
322
|
t: T,
|
|
318
|
-
props?: Omit<
|
|
323
|
+
props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">,
|
|
319
324
|
): FieldSchemaAlpha<FieldKind.Optional, UnannotateImplicitAllowedTypes<T>, TCustomMetadata>;
|
|
320
325
|
|
|
321
326
|
function optional<
|
|
@@ -323,7 +328,7 @@ function optional<
|
|
|
323
328
|
const TCustomMetadata = unknown,
|
|
324
329
|
>(
|
|
325
330
|
t: T,
|
|
326
|
-
props?: Omit<
|
|
331
|
+
props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">,
|
|
327
332
|
): FieldSchemaAlpha<FieldKind.Optional, UnannotateImplicitAllowedTypes<T>, TCustomMetadata> {
|
|
328
333
|
return createFieldSchema(FieldKind.Optional, t, {
|
|
329
334
|
defaultProvider: defaultOptionalProvider,
|
|
@@ -333,7 +338,7 @@ function optional<
|
|
|
333
338
|
|
|
334
339
|
function required<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(
|
|
335
340
|
t: T,
|
|
336
|
-
props?: Omit<
|
|
341
|
+
props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">,
|
|
337
342
|
): FieldSchemaAlpha<FieldKind.Required, T, TCustomMetadata>;
|
|
338
343
|
|
|
339
344
|
function required<
|
|
@@ -341,7 +346,7 @@ function required<
|
|
|
341
346
|
const TCustomMetadata = unknown,
|
|
342
347
|
>(
|
|
343
348
|
t: T,
|
|
344
|
-
props?: Omit<
|
|
349
|
+
props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">,
|
|
345
350
|
): FieldSchemaAlpha<FieldKind.Required, UnannotateImplicitAllowedTypes<T>, TCustomMetadata>;
|
|
346
351
|
|
|
347
352
|
function required<
|
|
@@ -349,7 +354,7 @@ function required<
|
|
|
349
354
|
const TCustomMetadata = unknown,
|
|
350
355
|
>(
|
|
351
356
|
t: T,
|
|
352
|
-
props?: Omit<
|
|
357
|
+
props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">,
|
|
353
358
|
): FieldSchemaAlpha<FieldKind.Required, UnannotateImplicitAllowedTypes<T>, TCustomMetadata> {
|
|
354
359
|
return createFieldSchema(FieldKind.Required, t, props);
|
|
355
360
|
}
|
|
@@ -377,7 +382,7 @@ export const schemaStaticsBase = {
|
|
|
377
382
|
const TCustomMetadata = unknown,
|
|
378
383
|
>(
|
|
379
384
|
t: T,
|
|
380
|
-
props?: Omit<
|
|
385
|
+
props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">,
|
|
381
386
|
): FieldSchemaAlphaUnsafe<FieldKind.Optional, T, TCustomMetadata> => {
|
|
382
387
|
return createFieldSchemaUnsafe(FieldKind.Optional, t, {
|
|
383
388
|
defaultProvider: defaultOptionalProvider,
|
|
@@ -390,7 +395,7 @@ export const schemaStaticsBase = {
|
|
|
390
395
|
const TCustomMetadata = unknown,
|
|
391
396
|
>(
|
|
392
397
|
t: T,
|
|
393
|
-
props?: Omit<
|
|
398
|
+
props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">,
|
|
394
399
|
): FieldSchemaAlphaUnsafe<FieldKind.Required, T, TCustomMetadata> => {
|
|
395
400
|
return createFieldSchemaUnsafe(FieldKind.Required, t, props);
|
|
396
401
|
},
|
|
@@ -23,7 +23,7 @@ import type {
|
|
|
23
23
|
ImplicitAnnotatedAllowedTypes,
|
|
24
24
|
ImplicitAnnotatedFieldSchema,
|
|
25
25
|
ImplicitFieldSchema,
|
|
26
|
-
|
|
26
|
+
NodeSchemaOptionsAlpha,
|
|
27
27
|
} from "../schemaTypes.js";
|
|
28
28
|
import type { RestrictiveStringRecord } from "../../util/index.js";
|
|
29
29
|
import type { NodeKind, TreeNodeSchemaClass } from "../core/index.js";
|
|
@@ -88,6 +88,7 @@ export class SchemaFactoryAlpha<
|
|
|
88
88
|
options?.allowUnknownOptionalFields ??
|
|
89
89
|
defaultSchemaFactoryObjectOptions.allowUnknownOptionalFields,
|
|
90
90
|
options?.metadata,
|
|
91
|
+
options?.persistedMetadata,
|
|
91
92
|
);
|
|
92
93
|
}
|
|
93
94
|
|
|
@@ -148,7 +149,7 @@ export class SchemaFactoryAlpha<
|
|
|
148
149
|
}
|
|
149
150
|
|
|
150
151
|
/**
|
|
151
|
-
* {@inheritDoc SchemaStatics.
|
|
152
|
+
* {@inheritDoc SchemaStatics.leaves}
|
|
152
153
|
*/
|
|
153
154
|
public static override readonly leaves = schemaStatics.leaves;
|
|
154
155
|
|
|
@@ -167,11 +168,41 @@ export class SchemaFactoryAlpha<
|
|
|
167
168
|
*/
|
|
168
169
|
public static override readonly optionalRecursive = schemaStatics.optionalRecursive;
|
|
169
170
|
|
|
171
|
+
/**
|
|
172
|
+
* {@inheritDoc SchemaStatics.requiredRecursive}
|
|
173
|
+
*/
|
|
174
|
+
public static override readonly requiredRecursive = schemaStatics.requiredRecursive;
|
|
175
|
+
|
|
170
176
|
/**
|
|
171
177
|
* Like {@link SchemaFactory.identifier} but static and a factory function that can be provided {@link FieldProps}.
|
|
172
178
|
*/
|
|
173
179
|
public static readonly identifier = schemaStatics.identifier;
|
|
174
180
|
|
|
181
|
+
/**
|
|
182
|
+
* {@inheritDoc SchemaStatics.leaves}
|
|
183
|
+
*/
|
|
184
|
+
public override readonly leaves = schemaStatics.leaves;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* {@inheritDoc SchemaStatics.optional}
|
|
188
|
+
*/
|
|
189
|
+
public override readonly optional = schemaStatics.optional;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* {@inheritDoc SchemaStatics.required}
|
|
193
|
+
*/
|
|
194
|
+
public override readonly required = schemaStatics.required;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* {@inheritDoc SchemaStatics.optionalRecursive}
|
|
198
|
+
*/
|
|
199
|
+
public override readonly optionalRecursive = schemaStatics.optionalRecursive;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* {@inheritDoc SchemaStatics.requiredRecursive}
|
|
203
|
+
*/
|
|
204
|
+
public override readonly requiredRecursive = schemaStatics.requiredRecursive;
|
|
205
|
+
|
|
175
206
|
/**
|
|
176
207
|
* Define a {@link TreeNodeSchema} for a {@link TreeMapNode}.
|
|
177
208
|
*
|
|
@@ -193,9 +224,16 @@ export class SchemaFactoryAlpha<
|
|
|
193
224
|
>(
|
|
194
225
|
name: Name,
|
|
195
226
|
allowedTypes: T,
|
|
196
|
-
options?:
|
|
227
|
+
options?: NodeSchemaOptionsAlpha<TCustomMetadata>,
|
|
197
228
|
): MapNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata> {
|
|
198
|
-
return mapSchema(
|
|
229
|
+
return mapSchema(
|
|
230
|
+
this.scoped2(name),
|
|
231
|
+
allowedTypes,
|
|
232
|
+
true,
|
|
233
|
+
true,
|
|
234
|
+
options?.metadata,
|
|
235
|
+
options?.persistedMetadata,
|
|
236
|
+
);
|
|
199
237
|
}
|
|
200
238
|
|
|
201
239
|
/**
|
|
@@ -206,7 +244,7 @@ export class SchemaFactoryAlpha<
|
|
|
206
244
|
Name extends TName,
|
|
207
245
|
const T extends System_Unsafe.ImplicitAllowedTypesUnsafe,
|
|
208
246
|
const TCustomMetadata = unknown,
|
|
209
|
-
>(name: Name, allowedTypes: T, options?:
|
|
247
|
+
>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>) {
|
|
210
248
|
return this.mapAlpha(
|
|
211
249
|
name,
|
|
212
250
|
allowedTypes as T & ImplicitAllowedTypes,
|
|
@@ -237,9 +275,16 @@ export class SchemaFactoryAlpha<
|
|
|
237
275
|
>(
|
|
238
276
|
name: Name,
|
|
239
277
|
allowedTypes: T,
|
|
240
|
-
options?:
|
|
278
|
+
options?: NodeSchemaOptionsAlpha<TCustomMetadata>,
|
|
241
279
|
): ArrayNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata> {
|
|
242
|
-
return arraySchema(
|
|
280
|
+
return arraySchema(
|
|
281
|
+
this.scoped2(name),
|
|
282
|
+
allowedTypes,
|
|
283
|
+
true,
|
|
284
|
+
true,
|
|
285
|
+
options?.metadata,
|
|
286
|
+
options?.persistedMetadata,
|
|
287
|
+
);
|
|
243
288
|
}
|
|
244
289
|
|
|
245
290
|
/**
|
|
@@ -250,7 +295,7 @@ export class SchemaFactoryAlpha<
|
|
|
250
295
|
const Name extends TName,
|
|
251
296
|
const T extends System_Unsafe.ImplicitAllowedTypesUnsafe,
|
|
252
297
|
const TCustomMetadata = unknown,
|
|
253
|
-
>(name: Name, allowedTypes: T, options?:
|
|
298
|
+
>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>) {
|
|
254
299
|
return this.arrayAlpha(
|
|
255
300
|
name,
|
|
256
301
|
allowedTypes as T & ImplicitAllowedTypes,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "../../feature-libraries/index.js";
|
|
13
13
|
import {
|
|
14
14
|
clientVersionToSchemaVersion,
|
|
15
|
-
type
|
|
15
|
+
type FormatV1,
|
|
16
16
|
// eslint-disable-next-line import/no-internal-modules
|
|
17
17
|
} from "../../feature-libraries/schema-index/index.js";
|
|
18
18
|
import type { JsonCompatible } from "../../util/index.js";
|
|
@@ -58,8 +58,8 @@ export function extractPersistedSchema(
|
|
|
58
58
|
oldestCompatibleClient: FluidClientVersion,
|
|
59
59
|
): JsonCompatible {
|
|
60
60
|
const stored = simpleToStoredSchema(schema);
|
|
61
|
-
const
|
|
62
|
-
return encodeTreeSchema(stored,
|
|
61
|
+
const schemaWriteVersion = clientVersionToSchemaVersion(oldestCompatibleClient);
|
|
62
|
+
return encodeTreeSchema(stored, schemaWriteVersion);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
/**
|
|
@@ -100,7 +100,7 @@ export function comparePersistedSchema(
|
|
|
100
100
|
// Any version can be passed down to makeSchemaCodec here.
|
|
101
101
|
// We only use the decode part, which always dispatches to the correct codec based on the version in the data, not the version passed to `makeSchemaCodec`.
|
|
102
102
|
const schemaCodec = makeSchemaCodec(options, SchemaVersion.v1);
|
|
103
|
-
const stored = schemaCodec.decode(persisted as
|
|
103
|
+
const stored = schemaCodec.decode(persisted as FormatV1);
|
|
104
104
|
const viewSchema = new SchemaCompatibilityTester(
|
|
105
105
|
defaultSchemaPolicy,
|
|
106
106
|
{},
|
|
@@ -26,7 +26,10 @@
|
|
|
26
26
|
*/
|
|
27
27
|
export interface TreeChangeEvents {
|
|
28
28
|
/**
|
|
29
|
-
* Emitted by a node
|
|
29
|
+
* Emitted by a node if any changes affected the node.
|
|
30
|
+
*
|
|
31
|
+
* This event is emitted after all the changes in a batch have been applied to the whole tree.
|
|
32
|
+
* This means that a handler for this event will be able to read the updated state of the tree.
|
|
30
33
|
*
|
|
31
34
|
* - Object nodes define a change as being when the value of one of its properties changes (i.e., the property's value is set, including when set to `undefined`).
|
|
32
35
|
*
|
|
@@ -65,8 +68,10 @@ export interface TreeChangeEvents {
|
|
|
65
68
|
nodeChanged(unstable?: unknown): void;
|
|
66
69
|
|
|
67
70
|
/**
|
|
68
|
-
* Emitted by a node
|
|
69
|
-
*
|
|
71
|
+
* Emitted by a node if something changed anywhere in the subtree rooted at it.
|
|
72
|
+
*
|
|
73
|
+
* This event is emitted after all the changes in a batch have been applied to the whole tree.
|
|
74
|
+
* This means that a handler for this event will be able to read the updated state of the tree.
|
|
70
75
|
*
|
|
71
76
|
* @remarks
|
|
72
77
|
* This event is not emitted when the node itself is moved to a different location in the tree or removed from the tree.
|
|
@@ -63,6 +63,7 @@ export function toSimpleTreeSchema(
|
|
|
63
63
|
allowedTypesIdentifiers: normalizedSchema.allowedTypesIdentifiers,
|
|
64
64
|
kind: normalizedSchema.kind,
|
|
65
65
|
metadata: normalizedSchema.metadata,
|
|
66
|
+
persistedMetadata: normalizedSchema.persistedMetadata,
|
|
66
67
|
} satisfies SimpleFieldSchema)
|
|
67
68
|
: normalizedSchema,
|
|
68
69
|
definitions,
|
|
@@ -94,6 +95,7 @@ function copySimpleLeafSchema(schema: SimpleLeafNodeSchema): SimpleLeafNodeSchem
|
|
|
94
95
|
kind: NodeKind.Leaf,
|
|
95
96
|
leafKind: schema.leafKind,
|
|
96
97
|
metadata: schema.metadata,
|
|
98
|
+
persistedMetadata: schema.persistedMetadata,
|
|
97
99
|
};
|
|
98
100
|
}
|
|
99
101
|
|
|
@@ -104,6 +106,7 @@ function copySimpleMapOrArraySchema(
|
|
|
104
106
|
kind: schema.kind,
|
|
105
107
|
allowedTypesIdentifiers: schema.allowedTypesIdentifiers,
|
|
106
108
|
metadata: schema.metadata,
|
|
109
|
+
persistedMetadata: schema.persistedMetadata,
|
|
107
110
|
};
|
|
108
111
|
}
|
|
109
112
|
|
|
@@ -115,6 +118,7 @@ function copySimpleObjectSchema(schema: SimpleObjectNodeSchema): SimpleObjectNod
|
|
|
115
118
|
kind: field.kind,
|
|
116
119
|
allowedTypesIdentifiers: field.allowedTypesIdentifiers,
|
|
117
120
|
metadata: field.metadata,
|
|
121
|
+
persistedMetadata: field.persistedMetadata,
|
|
118
122
|
storedKey: field.storedKey,
|
|
119
123
|
});
|
|
120
124
|
}
|
|
@@ -123,5 +127,6 @@ function copySimpleObjectSchema(schema: SimpleObjectNodeSchema): SimpleObjectNod
|
|
|
123
127
|
kind: NodeKind.Object,
|
|
124
128
|
fields,
|
|
125
129
|
metadata: schema.metadata,
|
|
130
|
+
persistedMetadata: schema.persistedMetadata,
|
|
126
131
|
};
|
|
127
132
|
}
|
|
@@ -401,7 +401,7 @@ export function tryDisposeTreeNode(anchorNode: AnchorNode): void {
|
|
|
401
401
|
*/
|
|
402
402
|
export function getSimpleNodeSchemaFromInnerNode(innerNode: InnerNode): TreeNodeSchema {
|
|
403
403
|
const context: Context = getSimpleContextFromInnerNode(innerNode);
|
|
404
|
-
return context.schema.get(innerNode.
|
|
404
|
+
return context.schema.get(innerNode.type) ?? fail(0xb3f /* missing schema from context */);
|
|
405
405
|
}
|
|
406
406
|
|
|
407
407
|
/**
|
|
@@ -10,10 +10,9 @@ import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
|
10
10
|
|
|
11
11
|
import {
|
|
12
12
|
type AnchorEvents,
|
|
13
|
-
|
|
13
|
+
dummyRoot,
|
|
14
14
|
type FieldKey,
|
|
15
15
|
type FieldKindIdentifier,
|
|
16
|
-
forbiddenFieldKindIdentifier,
|
|
17
16
|
type ITreeCursorSynchronous,
|
|
18
17
|
type NodeData,
|
|
19
18
|
type NormalizedFieldUpPath,
|
|
@@ -49,8 +48,10 @@ import {
|
|
|
49
48
|
type MapTreeFieldViewGeneric,
|
|
50
49
|
type MapTreeNodeViewGeneric,
|
|
51
50
|
type HydratedFlexTreeNode,
|
|
51
|
+
cursorForMapTreeField,
|
|
52
|
+
type MinimalFieldMap,
|
|
52
53
|
} from "../../feature-libraries/index.js";
|
|
53
|
-
import { brand, filterIterable, getOrCreate } from "../../util/index.js";
|
|
54
|
+
import { brand, filterIterable, getOrCreate, mapIterable } from "../../util/index.js";
|
|
54
55
|
|
|
55
56
|
import type { Context } from "./context.js";
|
|
56
57
|
import type { ContextualFieldProvider } from "../schemaTypes.js";
|
|
@@ -62,10 +63,7 @@ interface UnhydratedTreeSequenceFieldEditBuilder
|
|
|
62
63
|
type UnhydratedFlexTreeNodeEvents = Pick<AnchorEvents, "childrenChangedAfterBatch">;
|
|
63
64
|
|
|
64
65
|
/** A node's parent field and its index in that field */
|
|
65
|
-
|
|
66
|
-
readonly parent: FlexTreeField;
|
|
67
|
-
readonly index: number;
|
|
68
|
-
}
|
|
66
|
+
type LocationInField = FlexTreeNode["parentField"];
|
|
69
67
|
|
|
70
68
|
/**
|
|
71
69
|
* The {@link Unhydrated} implementation of {@link FlexTreeNode}.
|
|
@@ -140,15 +138,16 @@ export class UnhydratedFlexTreeNode
|
|
|
140
138
|
* Due to having to detect if a field is empty, this forces the evaluation of any pending defaults in the fields.
|
|
141
139
|
* Use {@link allFieldsLazy} to avoid evaluating pending defaults.
|
|
142
140
|
*/
|
|
143
|
-
public readonly fields:
|
|
144
|
-
Map<FieldKey, UnhydratedFlexTreeField>,
|
|
145
|
-
typeof Symbol.iterator | "get"
|
|
146
|
-
> = {
|
|
141
|
+
public readonly fields: MinimalFieldMap<UnhydratedFlexTreeField> = {
|
|
147
142
|
get: (key: FieldKey): UnhydratedFlexTreeField | undefined => this.tryGetField(key),
|
|
148
143
|
[Symbol.iterator]: (): IterableIterator<[FieldKey, UnhydratedFlexTreeField]> =>
|
|
149
144
|
filterIterable(this.fieldsAll, ([, field]) => field.length > 0),
|
|
150
145
|
};
|
|
151
146
|
|
|
147
|
+
public [Symbol.iterator](): IterableIterator<UnhydratedFlexTreeField> {
|
|
148
|
+
return mapIterable(this.fields, ([, field]) => field)[Symbol.iterator]();
|
|
149
|
+
}
|
|
150
|
+
|
|
152
151
|
/**
|
|
153
152
|
* Gets all fields, without filtering out empty ones.
|
|
154
153
|
* @remarks
|
|
@@ -162,10 +161,6 @@ export class UnhydratedFlexTreeNode
|
|
|
162
161
|
return this.data.type;
|
|
163
162
|
}
|
|
164
163
|
|
|
165
|
-
public get schema(): TreeNodeSchemaIdentifier {
|
|
166
|
-
return this.data.type;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
164
|
private getOrCreateField(key: FieldKey): UnhydratedFlexTreeField {
|
|
170
165
|
return getOrCreate(this.fieldsAll, key, () => {
|
|
171
166
|
const stored = this.storedSchema.getFieldSchema(key).kind;
|
|
@@ -239,10 +234,6 @@ export class UnhydratedFlexTreeNode
|
|
|
239
234
|
return this.getOrCreateField(fieldKey);
|
|
240
235
|
}
|
|
241
236
|
|
|
242
|
-
public boxedIterator(): IterableIterator<FlexTreeField> {
|
|
243
|
-
return Array.from(this.fields, ([key, field]) => field)[Symbol.iterator]();
|
|
244
|
-
}
|
|
245
|
-
|
|
246
237
|
public keys(): IterableIterator<FieldKey> {
|
|
247
238
|
return Array.from(this.fields, ([key]) => key)[Symbol.iterator]();
|
|
248
239
|
}
|
|
@@ -288,31 +279,16 @@ export class UnhydratedContext implements FlexTreeContext {
|
|
|
288
279
|
* However, this field cannot be used in any practical way because it is empty, i.e. it does not actually contain the children that claim to be parented under it.
|
|
289
280
|
* It has the "empty" schema and it will always contain zero children if queried.
|
|
290
281
|
* Any nodes with this location will have a dummy parent index of `-1`.
|
|
282
|
+
*
|
|
283
|
+
* TODO: make this make sense.
|
|
291
284
|
*/
|
|
292
285
|
const unparentedLocation: LocationInField = {
|
|
293
286
|
parent: {
|
|
294
|
-
|
|
295
|
-
length: 0,
|
|
296
|
-
key: EmptyKey,
|
|
287
|
+
key: dummyRoot,
|
|
297
288
|
parent: undefined,
|
|
298
|
-
|
|
299
|
-
return this.schema === kind.identifier;
|
|
300
|
-
},
|
|
301
|
-
boxedIterator(): IterableIterator<FlexTreeNode> {
|
|
302
|
-
return [].values();
|
|
303
|
-
},
|
|
304
|
-
boxedAt(index: number): FlexTreeNode | undefined {
|
|
305
|
-
return undefined;
|
|
306
|
-
},
|
|
307
|
-
schema: brand(forbiddenFieldKindIdentifier),
|
|
308
|
-
get context(): never {
|
|
309
|
-
return fail(0xb48 /* unsupported */);
|
|
310
|
-
},
|
|
311
|
-
getFieldPath() {
|
|
312
|
-
fail(0xb49 /* unsupported */);
|
|
313
|
-
},
|
|
289
|
+
schema: brand(FieldKinds.optional.identifier),
|
|
314
290
|
},
|
|
315
|
-
index:
|
|
291
|
+
index: 0,
|
|
316
292
|
};
|
|
317
293
|
|
|
318
294
|
/**
|
|
@@ -347,6 +323,12 @@ export class UnhydratedFlexTreeField
|
|
|
347
323
|
}
|
|
348
324
|
}
|
|
349
325
|
|
|
326
|
+
public borrowCursor(): ITreeCursorSynchronous {
|
|
327
|
+
return cursorForMapTreeField<MapTreeNodeViewGeneric<UnhydratedFlexTreeNode>>(
|
|
328
|
+
this.children,
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
|
|
350
332
|
private getPendingDefault(): ContextualFieldProvider | undefined {
|
|
351
333
|
return !Array.isArray(this.lazyChildren) ? this.lazyChildren : undefined;
|
|
352
334
|
}
|
|
@@ -389,10 +371,6 @@ export class UnhydratedFlexTreeField
|
|
|
389
371
|
return this.schema === kind.identifier;
|
|
390
372
|
}
|
|
391
373
|
|
|
392
|
-
public boxedIterator(): IterableIterator<UnhydratedFlexTreeNode> {
|
|
393
|
-
return this.children[Symbol.iterator]();
|
|
394
|
-
}
|
|
395
|
-
|
|
396
374
|
public boxedAt(index: number): FlexTreeNode | undefined {
|
|
397
375
|
const i = indexForAt(index, this.length);
|
|
398
376
|
if (i === undefined) {
|
|
@@ -403,7 +381,7 @@ export class UnhydratedFlexTreeField
|
|
|
403
381
|
}
|
|
404
382
|
|
|
405
383
|
public [Symbol.iterator](): IterableIterator<UnhydratedFlexTreeNode> {
|
|
406
|
-
return this.
|
|
384
|
+
return this.children[Symbol.iterator]();
|
|
407
385
|
}
|
|
408
386
|
|
|
409
387
|
/**
|
package/src/simple-tree/index.ts
CHANGED
|
@@ -131,6 +131,7 @@ export type {
|
|
|
131
131
|
SimpleArrayNodeSchema,
|
|
132
132
|
SimpleObjectNodeSchema,
|
|
133
133
|
SimpleNodeSchemaBase,
|
|
134
|
+
SimpleNodeSchemaBaseAlpha,
|
|
134
135
|
SimpleObjectFieldSchema,
|
|
135
136
|
} from "./simpleSchema.js";
|
|
136
137
|
export {
|
|
@@ -164,6 +165,7 @@ export {
|
|
|
164
165
|
type NodeBuilderData,
|
|
165
166
|
type DefaultProvider,
|
|
166
167
|
type FieldProps,
|
|
168
|
+
type FieldPropsAlpha,
|
|
167
169
|
normalizeFieldSchema,
|
|
168
170
|
areFieldSchemaEqual,
|
|
169
171
|
areImplicitFieldSchemaEqual,
|
|
@@ -179,6 +181,7 @@ export {
|
|
|
179
181
|
type ReadableField,
|
|
180
182
|
type ReadSchema,
|
|
181
183
|
type NodeSchemaOptions,
|
|
184
|
+
type NodeSchemaOptionsAlpha,
|
|
182
185
|
type NodeSchemaMetadata,
|
|
183
186
|
evaluateLazySchema,
|
|
184
187
|
} from "./schemaTypes.js";
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
import { NodeKind, type TreeNodeSchema, type TreeNodeSchemaNonClass } from "./core/index.js";
|
|
16
16
|
import type { NodeSchemaMetadata, TreeLeafValue } from "./schemaTypes.js";
|
|
17
17
|
import type { SimpleLeafNodeSchema } from "./simpleSchema.js";
|
|
18
|
+
import type { JsonCompatibleReadOnlyObject } from "../util/index.js";
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* Instances of this class are schema for leaf nodes.
|
|
@@ -50,6 +51,7 @@ export class LeafNodeSchema<Name extends string, const T extends ValueSchema>
|
|
|
50
51
|
public readonly leafKind: ValueSchema;
|
|
51
52
|
|
|
52
53
|
public readonly metadata: NodeSchemaMetadata = {};
|
|
54
|
+
public readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined;
|
|
53
55
|
|
|
54
56
|
public constructor(name: Name, t: T) {
|
|
55
57
|
this.identifier = name;
|