@fluidframework/tree 2.41.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/.vscode/settings.json +1 -0
- package/CHANGELOG.md +33 -0
- package/api-report/tree.alpha.api.md +70 -28
- package/api-report/tree.beta.api.md +33 -0
- package/dist/alpha.d.ts +12 -6
- package/dist/beta.d.ts +6 -1
- package/dist/codec/codec.d.ts +23 -3
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/index.d.ts +1 -1
- package/dist/codec/index.d.ts.map +1 -1
- package/dist/codec/index.js.map +1 -1
- package/dist/codec/versioned/codec.d.ts +35 -2
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js +38 -3
- package/dist/codec/versioned/codec.js.map +1 -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/core/tree/detachedFieldIndex.d.ts +2 -2
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +5 -1
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/mapTree.d.ts +2 -1
- package/dist/core/tree/mapTree.d.ts.map +1 -1
- package/dist/core/tree/mapTree.js +11 -5
- package/dist/core/tree/mapTree.js.map +1 -1
- package/dist/core/tree/visitorUtils.d.ts +2 -2
- package/dist/core/tree/visitorUtils.d.ts.map +1 -1
- package/dist/core/tree/visitorUtils.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/default-schema/defaultEditBuilder.d.ts +3 -2
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts +4 -3
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js +4 -3
- package/dist/feature-libraries/default-schema/schemaChecker.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/context.d.ts +14 -6
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +48 -29
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js +4 -0
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/index.d.ts +2 -3
- 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 +6 -7
- 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 +8 -7
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +17 -6
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +10 -5
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +9 -12
- 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 +4 -3
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.d.ts +53 -3
- package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.js +45 -7
- 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/modular-schema/modularChangeCodecs.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +5 -5
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.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/feature-libraries/treeCursorUtils.d.ts +5 -1
- package/dist/feature-libraries/treeCursorUtils.d.ts.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.js +8 -2
- package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
- package/dist/index.d.ts +3 -3
- 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/schematizingTreeView.d.ts +11 -1
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +36 -22
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +8 -4
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +35 -5
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/tree.d.ts.map +1 -1
- package/dist/shared-tree/tree.js +8 -24
- package/dist/shared-tree/tree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +2 -3
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +4 -5
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +5 -2
- package/dist/shared-tree/treeCheckout.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/configuration.d.ts +2 -2
- package/dist/simple-tree/api/configuration.js +1 -1
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/create.d.ts +9 -4
- package/dist/simple-tree/api/create.d.ts.map +1 -1
- package/dist/simple-tree/api/create.js +29 -16
- package/dist/simple-tree/api/create.js.map +1 -1
- package/dist/simple-tree/api/customTree.d.ts +4 -0
- package/dist/simple-tree/api/customTree.d.ts.map +1 -1
- package/dist/simple-tree/api/customTree.js +9 -1
- package/dist/simple-tree/api/customTree.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +1 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +1 -2
- package/dist/simple-tree/api/index.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 +25 -13
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +42 -9
- 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/treeNodeApi.d.ts +14 -3
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +32 -17
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +12 -9
- package/dist/simple-tree/api/verboseTree.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/getOrCreateNode.d.ts.map +1 -1
- package/dist/simple-tree/core/getOrCreateNode.js +2 -1
- package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +2 -2
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +3 -4
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts +15 -25
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +27 -34
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts +129 -64
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +175 -207
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/index.d.ts +5 -5
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +5 -5
- 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 +8 -7
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/index.d.ts +1 -1
- package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/index.js +1 -2
- package/dist/simple-tree/node-kinds/index.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 +6 -4
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/index.d.ts +1 -1
- package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/index.js +1 -2
- package/dist/simple-tree/node-kinds/object/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts +5 -15
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +15 -44
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/prepareForInsertion.d.ts +20 -6
- package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/dist/simple-tree/prepareForInsertion.js +31 -20
- package/dist/simple-tree/prepareForInsertion.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +56 -9
- 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 +8 -1
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +19 -7
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/{lib/simple-tree/toMapTree.d.ts → dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts} +12 -23
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -0
- package/dist/simple-tree/{toMapTree.js → unhydratedFlexTreeFromInsertable.js} +103 -185
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -0
- package/dist/tableSchema.d.ts +1 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +6 -1
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/index.d.ts +1 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +2 -1
- package/dist/util/index.js.map +1 -1
- package/dist/util/typeUtils.d.ts +2 -2
- package/dist/util/typeUtils.js.map +1 -1
- package/dist/util/utils.d.ts +6 -0
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +8 -1
- package/dist/util/utils.js.map +1 -1
- package/docs/user-facing/schema-evolution.md +1 -1
- package/lib/alpha.d.ts +12 -6
- package/lib/beta.d.ts +6 -1
- package/lib/codec/codec.d.ts +23 -3
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/index.d.ts +1 -1
- package/lib/codec/index.d.ts.map +1 -1
- package/lib/codec/index.js.map +1 -1
- package/lib/codec/versioned/codec.d.ts +35 -2
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js +36 -2
- package/lib/codec/versioned/codec.js.map +1 -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/core/tree/detachedFieldIndex.d.ts +2 -2
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +6 -2
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/mapTree.d.ts +2 -1
- package/lib/core/tree/mapTree.d.ts.map +1 -1
- package/lib/core/tree/mapTree.js +11 -5
- package/lib/core/tree/mapTree.js.map +1 -1
- package/lib/core/tree/visitorUtils.d.ts +2 -2
- package/lib/core/tree/visitorUtils.d.ts.map +1 -1
- package/lib/core/tree/visitorUtils.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/default-schema/defaultEditBuilder.d.ts +3 -2
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts +4 -3
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js +4 -3
- package/lib/feature-libraries/default-schema/schemaChecker.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/context.d.ts +14 -6
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +48 -29
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js +4 -0
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/flex-tree/index.d.ts +2 -3
- 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 +6 -7
- 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 +8 -7
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +17 -6
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +10 -5
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +4 -7
- 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 +2 -2
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.d.ts +53 -3
- package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.js +43 -7
- 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/modular-schema/modularChangeCodecs.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +5 -5
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.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/feature-libraries/treeCursorUtils.d.ts +5 -1
- package/lib/feature-libraries/treeCursorUtils.d.ts.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.js +8 -2
- package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
- package/lib/index.d.ts +3 -3
- 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/schematizingTreeView.d.ts +11 -1
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +34 -21
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +8 -4
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +36 -6
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/tree.d.ts.map +1 -1
- package/lib/shared-tree/tree.js +2 -18
- package/lib/shared-tree/tree.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +2 -3
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +6 -7
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +6 -3
- package/lib/shared-tree/treeCheckout.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/configuration.d.ts +2 -2
- package/lib/simple-tree/api/configuration.js +1 -1
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/create.d.ts +9 -4
- package/lib/simple-tree/api/create.d.ts.map +1 -1
- package/lib/simple-tree/api/create.js +22 -9
- package/lib/simple-tree/api/create.js.map +1 -1
- package/lib/simple-tree/api/customTree.d.ts +4 -0
- package/lib/simple-tree/api/customTree.d.ts.map +1 -1
- package/lib/simple-tree/api/customTree.js +7 -0
- package/lib/simple-tree/api/customTree.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +1 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/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 +25 -13
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +44 -11
- 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/treeNodeApi.d.ts +14 -3
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +35 -20
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +13 -10
- package/lib/simple-tree/api/verboseTree.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/getOrCreateNode.d.ts.map +1 -1
- package/lib/simple-tree/core/getOrCreateNode.js +3 -2
- package/lib/simple-tree/core/getOrCreateNode.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +2 -2
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +2 -2
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts +15 -25
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +25 -33
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts +129 -64
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +174 -208
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/index.d.ts +5 -5
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +3 -3
- 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 +7 -6
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/index.d.ts +1 -1
- package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/index.js +1 -1
- package/lib/simple-tree/node-kinds/index.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 +8 -6
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/index.d.ts +1 -1
- package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/index.js +1 -1
- package/lib/simple-tree/node-kinds/object/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts +5 -15
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +6 -34
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/prepareForInsertion.d.ts +20 -6
- package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/lib/simple-tree/prepareForInsertion.js +30 -20
- package/lib/simple-tree/prepareForInsertion.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +56 -9
- 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 +8 -1
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +17 -5
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/{dist/simple-tree/toMapTree.d.ts → lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts} +12 -23
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -0
- package/lib/simple-tree/{toMapTree.js → unhydratedFlexTreeFromInsertable.js} +105 -186
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -0
- package/lib/tableSchema.d.ts +1 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +6 -1
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/index.d.ts +1 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +1 -1
- package/lib/util/index.js.map +1 -1
- package/lib/util/typeUtils.d.ts +2 -2
- package/lib/util/typeUtils.js.map +1 -1
- package/lib/util/utils.d.ts +6 -0
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js +6 -0
- package/lib/util/utils.js.map +1 -1
- package/package.json +21 -21
- package/src/codec/codec.ts +24 -3
- package/src/codec/index.ts +1 -0
- package/src/codec/versioned/codec.ts +42 -5
- 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/core/tree/detachedFieldIndex.ts +13 -4
- package/src/core/tree/mapTree.ts +22 -7
- package/src/core/tree/visitorUtils.ts +2 -2
- 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/default-schema/defaultEditBuilder.ts +3 -2
- package/src/feature-libraries/default-schema/schemaChecker.ts +7 -6
- package/src/feature-libraries/detachedFieldIndexSummarizer.ts +9 -16
- package/src/feature-libraries/flex-tree/context.ts +17 -7
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +57 -33
- package/src/feature-libraries/flex-tree/index.ts +4 -8
- package/src/feature-libraries/flex-tree/lazyEntity.ts +5 -1
- package/src/feature-libraries/flex-tree/lazyField.ts +12 -13
- package/src/feature-libraries/flex-tree/lazyNode.ts +21 -8
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +12 -18
- package/src/feature-libraries/index.ts +10 -1
- package/src/feature-libraries/mapTreeCursor.ts +112 -16
- package/src/feature-libraries/modular-schema/fieldKindWithEditor.ts +2 -0
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +9 -5
- 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/feature-libraries/treeCursorUtils.ts +21 -10
- package/src/index.ts +6 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/schematizeTree.ts +1 -0
- package/src/shared-tree/schematizingTreeView.ts +40 -22
- package/src/shared-tree/sharedTree.ts +51 -15
- package/src/shared-tree/tree.ts +5 -20
- package/src/shared-tree/treeAlpha.ts +23 -12
- package/src/shared-tree/treeCheckout.ts +6 -3
- package/src/shared-tree-core/editManagerSummarizer.ts +9 -16
- package/src/shared-tree-core/sharedTreeCore.ts +33 -24
- package/src/simple-tree/api/configuration.ts +3 -3
- package/src/simple-tree/api/create.ts +49 -19
- package/src/simple-tree/api/customTree.ts +10 -0
- package/src/simple-tree/api/index.ts +1 -4
- 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 +78 -24
- 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/treeNodeApi.ts +48 -27
- package/src/simple-tree/api/verboseTree.ts +15 -12
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +5 -0
- package/src/simple-tree/core/getOrCreateNode.ts +4 -2
- package/src/simple-tree/core/index.ts +2 -3
- package/src/simple-tree/core/treeNodeKernel.ts +38 -55
- package/src/simple-tree/core/unhydratedFlexTree.ts +231 -292
- package/src/simple-tree/index.ts +6 -3
- package/src/simple-tree/leafNodeSchema.ts +2 -0
- package/src/simple-tree/node-kinds/array/arrayNode.ts +17 -13
- package/src/simple-tree/node-kinds/index.ts +0 -1
- package/src/simple-tree/node-kinds/map/mapNode.ts +17 -11
- package/src/simple-tree/node-kinds/object/index.ts +0 -1
- package/src/simple-tree/node-kinds/object/objectNode.ts +15 -49
- package/src/simple-tree/prepareForInsertion.ts +54 -43
- package/src/simple-tree/schemaTypes.ts +103 -13
- package/src/simple-tree/simpleSchema.ts +27 -5
- package/src/simple-tree/toStoredSchema.ts +22 -5
- package/src/simple-tree/{toMapTree.ts → unhydratedFlexTreeFromInsertable.ts} +134 -226
- package/src/treeFactory.ts +6 -1
- package/src/util/index.ts +1 -0
- package/src/util/typeUtils.ts +2 -2
- package/src/util/utils.ts +9 -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/dist/simple-tree/toMapTree.d.ts.map +0 -1
- package/dist/simple-tree/toMapTree.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/lib/simple-tree/toMapTree.d.ts.map +0 -1
- package/lib/simple-tree/toMapTree.js.map +0 -1
- package/src/feature-libraries/flex-tree/navigation.ts +0 -121
|
@@ -247,28 +247,7 @@ export class SchematizingSimpleTreeView<
|
|
|
247
247
|
constraintsOnRevert: boolean,
|
|
248
248
|
constraints: readonly TransactionConstraint[] = [],
|
|
249
249
|
): void => {
|
|
250
|
-
|
|
251
|
-
switch (constraint.type) {
|
|
252
|
-
case "nodeInDocument": {
|
|
253
|
-
const node = getOrCreateInnerNode(constraint.node);
|
|
254
|
-
const nodeStatus = getKernel(constraint.node).getStatus();
|
|
255
|
-
if (nodeStatus !== TreeStatus.InDocument) {
|
|
256
|
-
const revertText = constraintsOnRevert ? " on revert" : "";
|
|
257
|
-
throw new UsageError(
|
|
258
|
-
`Attempted to add a "nodeInDocument" constraint${revertText}, but the node is not currently in the document. Node status: ${nodeStatus}`,
|
|
259
|
-
);
|
|
260
|
-
}
|
|
261
|
-
if (constraintsOnRevert) {
|
|
262
|
-
this.checkout.editor.addNodeExistsConstraintOnRevert(node.anchorNode);
|
|
263
|
-
} else {
|
|
264
|
-
this.checkout.editor.addNodeExistsConstraint(node.anchorNode);
|
|
265
|
-
}
|
|
266
|
-
break;
|
|
267
|
-
}
|
|
268
|
-
default:
|
|
269
|
-
unreachableCase(constraint.type);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
250
|
+
addConstraintsToTransaction(this.checkout, constraintsOnRevert, constraints);
|
|
272
251
|
};
|
|
273
252
|
|
|
274
253
|
this.checkout.transaction.start();
|
|
@@ -520,3 +499,42 @@ export function requireSchema(
|
|
|
520
499
|
|
|
521
500
|
return view;
|
|
522
501
|
}
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Adds constraints to a `checkout`'s pending transaction.
|
|
505
|
+
*
|
|
506
|
+
* @param checkout - The checkout's who's transaction will have the constraints added to it.
|
|
507
|
+
* @param constraintsOnRevert - If true, use {@link ISharedTreeEditor.addNodeExistsConstraintOnRevert}.
|
|
508
|
+
* @param constraints - The constraints to add to the transaction.
|
|
509
|
+
*
|
|
510
|
+
* @see {@link RunTransactionParams.preconditions}.
|
|
511
|
+
*/
|
|
512
|
+
export function addConstraintsToTransaction(
|
|
513
|
+
checkout: ITreeCheckout,
|
|
514
|
+
constraintsOnRevert: boolean,
|
|
515
|
+
constraints: readonly TransactionConstraint[] = [],
|
|
516
|
+
): void {
|
|
517
|
+
for (const constraint of constraints) {
|
|
518
|
+
switch (constraint.type) {
|
|
519
|
+
case "nodeInDocument": {
|
|
520
|
+
const node = getOrCreateInnerNode(constraint.node);
|
|
521
|
+
const nodeStatus = getKernel(constraint.node).getStatus();
|
|
522
|
+
if (nodeStatus !== TreeStatus.InDocument) {
|
|
523
|
+
const revertText = constraintsOnRevert ? " on revert" : "";
|
|
524
|
+
throw new UsageError(
|
|
525
|
+
`Attempted to add a "nodeInDocument" constraint${revertText}, but the node is not currently in the document. Node status: ${nodeStatus}`,
|
|
526
|
+
);
|
|
527
|
+
}
|
|
528
|
+
assert(node.isHydrated(), "In document node must be hydrated.");
|
|
529
|
+
if (constraintsOnRevert) {
|
|
530
|
+
checkout.editor.addNodeExistsConstraintOnRevert(node.anchorNode);
|
|
531
|
+
} else {
|
|
532
|
+
checkout.editor.addNodeExistsConstraint(node.anchorNode);
|
|
533
|
+
}
|
|
534
|
+
break;
|
|
535
|
+
}
|
|
536
|
+
default:
|
|
537
|
+
unreachableCase(constraint.type);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
@@ -21,7 +21,12 @@ import {
|
|
|
21
21
|
type ITelemetryLoggerExt,
|
|
22
22
|
} from "@fluidframework/telemetry-utils/internal";
|
|
23
23
|
|
|
24
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
type CodecWriteOptions,
|
|
26
|
+
FluidClientVersion,
|
|
27
|
+
type ICodecOptions,
|
|
28
|
+
noopValidator,
|
|
29
|
+
} from "../codec/index.js";
|
|
25
30
|
import {
|
|
26
31
|
type FieldKey,
|
|
27
32
|
type GraphCommit,
|
|
@@ -59,7 +64,7 @@ import {
|
|
|
59
64
|
makeTreeChunker,
|
|
60
65
|
} from "../feature-libraries/index.js";
|
|
61
66
|
// eslint-disable-next-line import/no-internal-modules
|
|
62
|
-
import type {
|
|
67
|
+
import type { FormatV1 } from "../feature-libraries/schema-index/index.js";
|
|
63
68
|
import {
|
|
64
69
|
type ClonableSchemaAndPolicy,
|
|
65
70
|
DefaultResubmitMachine,
|
|
@@ -87,12 +92,6 @@ import {
|
|
|
87
92
|
type ITreeAlpha,
|
|
88
93
|
type SimpleObjectFieldSchema,
|
|
89
94
|
} from "../simple-tree/index.js";
|
|
90
|
-
import {
|
|
91
|
-
type Breakable,
|
|
92
|
-
breakingClass,
|
|
93
|
-
type JsonCompatible,
|
|
94
|
-
throwIfBroken,
|
|
95
|
-
} from "../util/index.js";
|
|
96
95
|
|
|
97
96
|
import { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
|
|
98
97
|
import { SharedTreeReadonlyChangeEnricher } from "./sharedTreeChangeEnricher.js";
|
|
@@ -100,6 +99,12 @@ import { SharedTreeChangeFamily } from "./sharedTreeChangeFamily.js";
|
|
|
100
99
|
import type { SharedTreeChange } from "./sharedTreeChangeTypes.js";
|
|
101
100
|
import type { SharedTreeEditBuilder } from "./sharedTreeEditBuilder.js";
|
|
102
101
|
import { type TreeCheckout, type BranchableTree, createTreeCheckout } from "./treeCheckout.js";
|
|
102
|
+
import {
|
|
103
|
+
type Breakable,
|
|
104
|
+
breakingClass,
|
|
105
|
+
type JsonCompatible,
|
|
106
|
+
throwIfBroken,
|
|
107
|
+
} from "../util/index.js";
|
|
103
108
|
|
|
104
109
|
/**
|
|
105
110
|
* Copy of data from an {@link ITreePrivate} at some point in time.
|
|
@@ -187,6 +192,10 @@ const formatVersionToTopLevelCodecVersions = new Map<number, ExplicitCodecVersio
|
|
|
187
192
|
4,
|
|
188
193
|
{ forest: 1, schema: 1, detachedFieldIndex: 1, editManager: 4, message: 4, fieldBatch: 1 },
|
|
189
194
|
],
|
|
195
|
+
[
|
|
196
|
+
5,
|
|
197
|
+
{ forest: 1, schema: 2, detachedFieldIndex: 1, editManager: 4, message: 4, fieldBatch: 1 },
|
|
198
|
+
],
|
|
190
199
|
]);
|
|
191
200
|
|
|
192
201
|
function getCodecVersions(formatVersion: number): ExplicitCodecVersions {
|
|
@@ -506,7 +515,7 @@ export function persistedToSimpleSchema(
|
|
|
506
515
|
options: ICodecOptions,
|
|
507
516
|
): SimpleTreeSchema {
|
|
508
517
|
const schemaCodec = makeSchemaCodec(options, SchemaVersion.v1);
|
|
509
|
-
const stored = schemaCodec.decode(persisted as
|
|
518
|
+
const stored = schemaCodec.decode(persisted as FormatV1);
|
|
510
519
|
return exportSimpleSchema(stored);
|
|
511
520
|
}
|
|
512
521
|
|
|
@@ -567,6 +576,11 @@ export const SharedTreeFormatVersion = {
|
|
|
567
576
|
* Requires \@fluidframework/tree \>= 2.0.0.
|
|
568
577
|
*/
|
|
569
578
|
v3: 3,
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* Requires \@fluidframework/tree \>= 2.0.0.
|
|
582
|
+
*/
|
|
583
|
+
v5: 5,
|
|
570
584
|
} as const;
|
|
571
585
|
|
|
572
586
|
/**
|
|
@@ -585,9 +599,9 @@ export type SharedTreeFormatVersion = typeof SharedTreeFormatVersion;
|
|
|
585
599
|
|
|
586
600
|
/**
|
|
587
601
|
* Configuration options for SharedTree.
|
|
588
|
-
* @alpha
|
|
602
|
+
* @alpha @input
|
|
589
603
|
*/
|
|
590
|
-
export type SharedTreeOptions = Partial<
|
|
604
|
+
export type SharedTreeOptions = Partial<CodecWriteOptions> &
|
|
591
605
|
Partial<SharedTreeFormatOptions> &
|
|
592
606
|
ForestOptions;
|
|
593
607
|
|
|
@@ -702,6 +716,7 @@ export function buildConfiguredForest(
|
|
|
702
716
|
|
|
703
717
|
export const defaultSharedTreeOptions: Required<SharedTreeOptionsInternal> = {
|
|
704
718
|
jsonValidator: noopValidator,
|
|
719
|
+
oldestCompatibleClient: FluidClientVersion.v2_0,
|
|
705
720
|
forest: ForestTypeReference,
|
|
706
721
|
treeEncodeType: TreeCompressionStrategy.Compressed,
|
|
707
722
|
formatVersion: SharedTreeFormatVersion.v3,
|
|
@@ -744,20 +759,35 @@ function exportSimpleFieldSchemaStored(schema: TreeFieldStoredSchema): SimpleFie
|
|
|
744
759
|
default:
|
|
745
760
|
fail(0xaca /* invalid field kind */);
|
|
746
761
|
}
|
|
747
|
-
return {
|
|
762
|
+
return {
|
|
763
|
+
kind,
|
|
764
|
+
allowedTypesIdentifiers: schema.types,
|
|
765
|
+
metadata: {},
|
|
766
|
+
persistedMetadata: schema.persistedMetadata,
|
|
767
|
+
};
|
|
748
768
|
}
|
|
749
769
|
|
|
770
|
+
/**
|
|
771
|
+
* Export a {@link SimpleNodeSchema} from a {@link TreeNodeStoredSchema}.
|
|
772
|
+
* @privateRemarks
|
|
773
|
+
* TODO: Persist node metadata once schema FormatV2 is supported.
|
|
774
|
+
*/
|
|
750
775
|
function exportSimpleNodeSchemaStored(schema: TreeNodeStoredSchema): SimpleNodeSchema {
|
|
751
776
|
const arrayTypes = tryStoredSchemaAsArray(schema);
|
|
752
777
|
if (arrayTypes !== undefined) {
|
|
753
|
-
return {
|
|
778
|
+
return {
|
|
779
|
+
kind: NodeKind.Array,
|
|
780
|
+
allowedTypesIdentifiers: arrayTypes,
|
|
781
|
+
metadata: {},
|
|
782
|
+
persistedMetadata: schema.metadata,
|
|
783
|
+
};
|
|
754
784
|
}
|
|
755
785
|
if (schema instanceof ObjectNodeStoredSchema) {
|
|
756
786
|
const fields = new Map<FieldKey, SimpleObjectFieldSchema>();
|
|
757
787
|
for (const [storedKey, field] of schema.objectNodeFields) {
|
|
758
788
|
fields.set(storedKey, { ...exportSimpleFieldSchemaStored(field), storedKey });
|
|
759
789
|
}
|
|
760
|
-
return { kind: NodeKind.Object, fields, metadata: {} };
|
|
790
|
+
return { kind: NodeKind.Object, fields, metadata: {}, persistedMetadata: schema.metadata };
|
|
761
791
|
}
|
|
762
792
|
if (schema instanceof MapNodeStoredSchema) {
|
|
763
793
|
assert(
|
|
@@ -768,10 +798,16 @@ function exportSimpleNodeSchemaStored(schema: TreeNodeStoredSchema): SimpleNodeS
|
|
|
768
798
|
kind: NodeKind.Map,
|
|
769
799
|
allowedTypesIdentifiers: schema.mapFields.types,
|
|
770
800
|
metadata: {},
|
|
801
|
+
persistedMetadata: schema.metadata,
|
|
771
802
|
};
|
|
772
803
|
}
|
|
773
804
|
if (schema instanceof LeafNodeStoredSchema) {
|
|
774
|
-
return {
|
|
805
|
+
return {
|
|
806
|
+
kind: NodeKind.Leaf,
|
|
807
|
+
leafKind: schema.leafValue,
|
|
808
|
+
metadata: {},
|
|
809
|
+
persistedMetadata: schema.metadata,
|
|
810
|
+
};
|
|
775
811
|
}
|
|
776
812
|
fail(0xacb /* invalid schema kind */);
|
|
777
813
|
}
|
package/src/shared-tree/tree.ts
CHANGED
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { unreachableCase } from "@fluidframework/core-utils/internal";
|
|
7
6
|
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
8
7
|
|
|
9
|
-
import { TreeStatus } from "../feature-libraries/index.js";
|
|
10
8
|
import {
|
|
11
9
|
type ImplicitFieldSchema,
|
|
12
10
|
type TreeNode,
|
|
@@ -19,7 +17,10 @@ import {
|
|
|
19
17
|
} from "../simple-tree/index.js";
|
|
20
18
|
|
|
21
19
|
import { getCheckoutFlexTreeView } from "./checkoutFlexTreeView.js";
|
|
22
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
addConstraintsToTransaction,
|
|
22
|
+
SchematizingSimpleTreeView,
|
|
23
|
+
} from "./schematizingTreeView.js";
|
|
23
24
|
import type { ITreeCheckout } from "./treeCheckout.js";
|
|
24
25
|
|
|
25
26
|
/**
|
|
@@ -463,23 +464,7 @@ function runTransactionInCheckout<TResult>(
|
|
|
463
464
|
preconditions: readonly TransactionConstraint[],
|
|
464
465
|
): TResult | typeof rollback {
|
|
465
466
|
checkout.transaction.start();
|
|
466
|
-
|
|
467
|
-
switch (constraint.type) {
|
|
468
|
-
case "nodeInDocument": {
|
|
469
|
-
const node = getOrCreateInnerNode(constraint.node);
|
|
470
|
-
const nodeStatus = Tree.status(constraint.node);
|
|
471
|
-
if (nodeStatus !== TreeStatus.InDocument) {
|
|
472
|
-
throw new UsageError(
|
|
473
|
-
`Attempted to add a "nodeInDocument" constraint, but the node is not currently in the document. Node status: ${nodeStatus}`,
|
|
474
|
-
);
|
|
475
|
-
}
|
|
476
|
-
checkout.editor.addNodeExistsConstraint(node.anchorNode);
|
|
477
|
-
break;
|
|
478
|
-
}
|
|
479
|
-
default:
|
|
480
|
-
unreachableCase(constraint.type);
|
|
481
|
-
}
|
|
482
|
-
}
|
|
467
|
+
addConstraintsToTransaction(checkout, false, preconditions);
|
|
483
468
|
|
|
484
469
|
let result: ReturnType<typeof transaction>;
|
|
485
470
|
try {
|
|
@@ -38,10 +38,16 @@ import {
|
|
|
38
38
|
getPropertyKeyFromStoredKey,
|
|
39
39
|
treeNodeApi,
|
|
40
40
|
getIdentifierFromNode,
|
|
41
|
-
|
|
41
|
+
unhydratedFlexTreeFromInsertable,
|
|
42
|
+
getOrCreateNodeFromInnerNode,
|
|
42
43
|
} from "../simple-tree/index.js";
|
|
43
44
|
import { extractFromOpaque, type JsonCompatible } from "../util/index.js";
|
|
44
|
-
import {
|
|
45
|
+
import {
|
|
46
|
+
FluidClientVersion,
|
|
47
|
+
noopValidator,
|
|
48
|
+
type ICodecOptions,
|
|
49
|
+
type CodecWriteOptions,
|
|
50
|
+
} from "../codec/index.js";
|
|
45
51
|
import type { ITreeCursorSynchronous } from "../core/index.js";
|
|
46
52
|
import {
|
|
47
53
|
cursorForMapTreeField,
|
|
@@ -57,8 +63,6 @@ import {
|
|
|
57
63
|
} from "../feature-libraries/index.js";
|
|
58
64
|
import { independentInitializedView, type ViewContent } from "./independentView.js";
|
|
59
65
|
import { SchematizingSimpleTreeView, ViewSlot } from "./schematizingTreeView.js";
|
|
60
|
-
import { currentVersion } from "../codec/index.js";
|
|
61
|
-
import { createFromMapTree } from "../simple-tree/index.js";
|
|
62
66
|
|
|
63
67
|
const identifier: TreeIdentifierUtils = (node: TreeNode): string | undefined => {
|
|
64
68
|
const nodeIdentifier = getIdentifierFromNode(node, "uncompressed");
|
|
@@ -295,7 +299,10 @@ export interface TreeAlpha {
|
|
|
295
299
|
*/
|
|
296
300
|
exportCompressed(
|
|
297
301
|
tree: TreeNode | TreeLeafValue,
|
|
298
|
-
options: {
|
|
302
|
+
options: { idCompressor?: IIdCompressor } & Pick<
|
|
303
|
+
CodecWriteOptions,
|
|
304
|
+
"oldestCompatibleClient"
|
|
305
|
+
>,
|
|
299
306
|
): JsonCompatible<IFluidHandle>;
|
|
300
307
|
|
|
301
308
|
/**
|
|
@@ -367,8 +374,11 @@ export const TreeAlpha: TreeAlpha = {
|
|
|
367
374
|
? TreeFieldFromImplicitField<TSchema>
|
|
368
375
|
: TreeNode | TreeLeafValue | undefined
|
|
369
376
|
> {
|
|
370
|
-
const mapTree =
|
|
371
|
-
|
|
377
|
+
const mapTree = unhydratedFlexTreeFromInsertable(
|
|
378
|
+
data as InsertableField<UnsafeUnknownSchema>,
|
|
379
|
+
schema,
|
|
380
|
+
);
|
|
381
|
+
const result = mapTree === undefined ? undefined : getOrCreateNodeFromInnerNode(mapTree);
|
|
372
382
|
return result as Unhydrated<
|
|
373
383
|
TSchema extends ImplicitFieldSchema
|
|
374
384
|
? TreeFieldFromImplicitField<TSchema>
|
|
@@ -426,10 +436,10 @@ export const TreeAlpha: TreeAlpha = {
|
|
|
426
436
|
|
|
427
437
|
exportCompressed(
|
|
428
438
|
node: TreeNode | TreeLeafValue,
|
|
429
|
-
options: {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
439
|
+
options: { idCompressor?: IIdCompressor } & Pick<
|
|
440
|
+
CodecWriteOptions,
|
|
441
|
+
"oldestCompatibleClient"
|
|
442
|
+
>,
|
|
433
443
|
): JsonCompatible<IFluidHandle> {
|
|
434
444
|
const schema = tryGetSchema(node) ?? fail(0xacf /* invalid input */);
|
|
435
445
|
const format = fluidVersionToFieldBatchCodecWriteVersion(options.oldestCompatibleClient);
|
|
@@ -457,7 +467,8 @@ export const TreeAlpha: TreeAlpha = {
|
|
|
457
467
|
): Unhydrated<TreeFieldFromImplicitField<TSchema>> {
|
|
458
468
|
const config = new TreeViewConfigurationAlpha({ schema });
|
|
459
469
|
const content: ViewContent = {
|
|
460
|
-
schema
|
|
470
|
+
// Always use a v1 schema codec for consistency.
|
|
471
|
+
schema: extractPersistedSchema(config, FluidClientVersion.v2_0),
|
|
461
472
|
tree: compressedData,
|
|
462
473
|
idCompressor: options.idCompressor ?? createIdCompressor(),
|
|
463
474
|
};
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
UsageError,
|
|
12
12
|
type ITelemetryLoggerExt,
|
|
13
13
|
} from "@fluidframework/telemetry-utils/internal";
|
|
14
|
-
import { noopValidator } from "../codec/index.js";
|
|
14
|
+
import { FluidClientVersion, noopValidator } from "../codec/index.js";
|
|
15
15
|
import {
|
|
16
16
|
type Anchor,
|
|
17
17
|
type AnchorLocator,
|
|
@@ -279,7 +279,10 @@ export function createTreeCheckout(
|
|
|
279
279
|
const breaker = args?.breaker ?? new Breakable("TreeCheckout");
|
|
280
280
|
const schema = args?.schema ?? new TreeStoredSchemaRepository();
|
|
281
281
|
const forest = args?.forest ?? buildForest(breaker, schema);
|
|
282
|
-
const defaultCodecOptions = {
|
|
282
|
+
const defaultCodecOptions = {
|
|
283
|
+
jsonValidator: noopValidator,
|
|
284
|
+
oldestCompatibleClient: FluidClientVersion.v2_0,
|
|
285
|
+
};
|
|
283
286
|
const defaultFieldBatchVersion = 1;
|
|
284
287
|
const changeFamily =
|
|
285
288
|
args?.changeFamily ??
|
|
@@ -287,7 +290,7 @@ export function createTreeCheckout(
|
|
|
287
290
|
revisionTagCodec,
|
|
288
291
|
args?.fieldBatchCodec ??
|
|
289
292
|
makeFieldBatchCodec(defaultCodecOptions, defaultFieldBatchVersion),
|
|
290
|
-
|
|
293
|
+
defaultCodecOptions,
|
|
291
294
|
args?.chunkCompressionStrategy,
|
|
292
295
|
idCompressor,
|
|
293
296
|
);
|
|
@@ -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
|
|
@@ -107,8 +107,8 @@ export interface ITreeConfigurationOptions {
|
|
|
107
107
|
*
|
|
108
108
|
* To make this more permissive in the future we can:
|
|
109
109
|
*
|
|
110
|
-
* - Make
|
|
111
|
-
* - Update this check to more tightly match
|
|
110
|
+
* - Make unhydratedFlexTreeFromInsertable more permissive (ex: allow disambiguation based on leaf type)
|
|
111
|
+
* - Update this check to more tightly match unhydratedFlexTreeFromInsertable
|
|
112
112
|
* - Add options to help schema authors disambiguate their types, such as "constant fields" which are not persisted, and always have a constant value.
|
|
113
113
|
*
|
|
114
114
|
* The above examples exist in executable form in this files tests, and should be updated there then copied back here.
|
|
@@ -343,7 +343,7 @@ export function checkUnion(union: Iterable<TreeNodeSchema>, errors: string[]): v
|
|
|
343
343
|
// Allow using the type of the field to disambiguate, at least for leaf types.
|
|
344
344
|
// Add "constant" fields which can be used to disambiguate even more cases without adding persisted data: maybe make them optional in constructor?
|
|
345
345
|
// Consider separating unambiguous implicit construction format from constructor arguments at type level, allowing constructor to superset the implicit construction options (ex: optional constant fields).
|
|
346
|
-
// The policy here however must remain at least as conservative as shallowCompatibilityTest in src/simple-tree/
|
|
346
|
+
// The policy here however must remain at least as conservative as shallowCompatibilityTest in src/simple-tree/unhydratedFlexTreeFromInsertable.ts.
|
|
347
347
|
|
|
348
348
|
errors.push(
|
|
349
349
|
`The required fields of ${JSON.stringify(schema.identifier)} are insufficient to differentiate it from the following types: ${formatTypes(possiblyAmbiguous)}. For objects to be considered unambiguous, each must have required fields that do not all occur on any other object in the union.`,
|
|
@@ -5,35 +5,46 @@
|
|
|
5
5
|
|
|
6
6
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
7
7
|
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import {
|
|
9
|
+
CursorLocationType,
|
|
10
|
+
mapCursorField,
|
|
11
|
+
mapCursorFields,
|
|
12
|
+
type ITreeCursorSynchronous,
|
|
13
|
+
type SchemaAndPolicy,
|
|
12
14
|
} from "../../core/index.js";
|
|
13
15
|
import type { ImplicitFieldSchema, TreeFieldFromImplicitField } from "../schemaTypes.js";
|
|
14
16
|
import {
|
|
17
|
+
type Context,
|
|
15
18
|
getOrCreateNodeFromInnerNode,
|
|
16
|
-
|
|
19
|
+
type NodeKind,
|
|
17
20
|
type Unhydrated,
|
|
21
|
+
UnhydratedFlexTreeNode,
|
|
22
|
+
createField,
|
|
18
23
|
} from "../core/index.js";
|
|
19
24
|
import {
|
|
20
25
|
defaultSchemaPolicy,
|
|
21
26
|
inSchemaOrThrow,
|
|
22
|
-
mapTreeFromCursor,
|
|
23
27
|
isFieldInSchema,
|
|
24
28
|
} from "../../feature-libraries/index.js";
|
|
25
29
|
import { getUnhydratedContext } from "../createContext.js";
|
|
26
30
|
import { createUnknownOptionalFieldPolicy } from "../node-kinds/index.js";
|
|
31
|
+
import type { SimpleNodeSchema, SimpleNodeSchemaBase } from "../simpleSchema.js";
|
|
32
|
+
import { getStoredSchema } from "../toStoredSchema.js";
|
|
33
|
+
import { unknownTypeError } from "./customTree.js";
|
|
27
34
|
|
|
28
35
|
/**
|
|
29
36
|
* Creates an unhydrated simple-tree field from a cursor in nodes mode.
|
|
37
|
+
* @remarks
|
|
38
|
+
* Does not support defaults.
|
|
39
|
+
* Validates the field is in schema.
|
|
30
40
|
*/
|
|
31
41
|
export function createFromCursor<const TSchema extends ImplicitFieldSchema>(
|
|
32
42
|
schema: TSchema,
|
|
33
43
|
cursor: ITreeCursorSynchronous | undefined,
|
|
34
44
|
): Unhydrated<TreeFieldFromImplicitField<TSchema>> {
|
|
35
|
-
const mapTrees = cursor === undefined ? [] : [mapTreeFromCursor(cursor)];
|
|
36
45
|
const context = getUnhydratedContext(schema);
|
|
46
|
+
const mapTrees = cursor === undefined ? [] : [unhydratedFlexTreeFromCursor(context, cursor)];
|
|
47
|
+
|
|
37
48
|
const flexSchema = context.flexContext.schema;
|
|
38
49
|
|
|
39
50
|
const schemaValidationPolicy: SchemaAndPolicy = {
|
|
@@ -58,21 +69,40 @@ export function createFromCursor<const TSchema extends ImplicitFieldSchema>(
|
|
|
58
69
|
// Length asserted above, so this is safe. This assert is done instead of checking for undefined after indexing to ensure a length greater than 1 also errors.
|
|
59
70
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
60
71
|
const mapTree = mapTrees[0]!;
|
|
61
|
-
|
|
72
|
+
|
|
73
|
+
return getOrCreateNodeFromInnerNode(mapTree) as Unhydrated<
|
|
74
|
+
TreeFieldFromImplicitField<TSchema>
|
|
75
|
+
>;
|
|
62
76
|
}
|
|
63
77
|
|
|
64
78
|
/**
|
|
65
|
-
*
|
|
79
|
+
* Construct an {@link UnhydratedFlexTreeNode} from a cursor in Nodes mode.
|
|
80
|
+
* @remarks
|
|
81
|
+
* This does not validate the node is in schema.
|
|
66
82
|
*/
|
|
67
|
-
export function
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
):
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
83
|
+
export function unhydratedFlexTreeFromCursor(
|
|
84
|
+
context: Context,
|
|
85
|
+
cursor: ITreeCursorSynchronous,
|
|
86
|
+
): UnhydratedFlexTreeNode {
|
|
87
|
+
assert(cursor.mode === CursorLocationType.Nodes, 0xbb4 /* Expected nodes cursor */);
|
|
88
|
+
const schema = context.schema.get(cursor.type) ?? unknownTypeError(cursor.type);
|
|
89
|
+
const storedSchema = getStoredSchema(
|
|
90
|
+
schema as SimpleNodeSchemaBase<NodeKind> as SimpleNodeSchema,
|
|
91
|
+
);
|
|
92
|
+
const fields = new Map(
|
|
93
|
+
mapCursorFields(cursor, () => [
|
|
94
|
+
cursor.getFieldKey(),
|
|
95
|
+
createField(
|
|
96
|
+
context.flexContext,
|
|
97
|
+
storedSchema.getFieldSchema(cursor.getFieldKey()).kind,
|
|
98
|
+
cursor.getFieldKey(),
|
|
99
|
+
mapCursorField(cursor, () => unhydratedFlexTreeFromCursor(context, cursor)),
|
|
100
|
+
),
|
|
101
|
+
]),
|
|
102
|
+
);
|
|
103
|
+
return new UnhydratedFlexTreeNode(
|
|
104
|
+
{ type: cursor.type, value: cursor.value },
|
|
105
|
+
fields,
|
|
106
|
+
context,
|
|
74
107
|
);
|
|
75
|
-
|
|
76
|
-
const result = getOrCreateNodeFromInnerNode(mapTreeNode);
|
|
77
|
-
return result as Unhydrated<TreeFieldFromImplicitField<TSchema>>;
|
|
78
108
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import type { IFluidHandle } from "@fluidframework/core-interfaces";
|
|
7
7
|
import { assert, fail } from "@fluidframework/core-utils/internal";
|
|
8
8
|
import { isFluidHandle } from "@fluidframework/runtime-utils/internal";
|
|
9
|
+
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
9
10
|
|
|
10
11
|
import {
|
|
11
12
|
EmptyKey,
|
|
@@ -231,3 +232,12 @@ export function replaceHandles<T>(tree: unknown, replacer: HandleConverter<T>):
|
|
|
231
232
|
}
|
|
232
233
|
});
|
|
233
234
|
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Throws a `UsageError` indicating that a type is unknown in the current context.
|
|
238
|
+
*/
|
|
239
|
+
export function unknownTypeError(type: string): never {
|
|
240
|
+
throw new UsageError(
|
|
241
|
+
`Failed to parse tree due to occurrence of type ${JSON.stringify(type)} which is not defined in this context.`,
|
|
242
|
+
);
|
|
243
|
+
}
|
|
@@ -52,10 +52,7 @@ export {
|
|
|
52
52
|
getPropertyKeyFromStoredKey,
|
|
53
53
|
getIdentifierFromNode,
|
|
54
54
|
} from "./treeNodeApi.js";
|
|
55
|
-
export {
|
|
56
|
-
createFromCursor,
|
|
57
|
-
createFromMapTree,
|
|
58
|
-
} from "./create.js";
|
|
55
|
+
export { createFromCursor } from "./create.js";
|
|
59
56
|
export {
|
|
60
57
|
type JsonSchemaId,
|
|
61
58
|
type JsonSchemaType,
|