@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
|
@@ -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<
|
|
@@ -6,14 +6,15 @@
|
|
|
6
6
|
import type { IFluidHandle } from "@fluidframework/core-interfaces";
|
|
7
7
|
import { assert, unreachableCase } 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 type { TreeValue } from "../../core/index.js";
|
|
11
|
-
import type { NodeIdentifierManager } from "../../feature-libraries/index.js";
|
|
12
12
|
// This import is required for intellisense in @link doc comments on mouseover in VSCode.
|
|
13
13
|
// eslint-disable-next-line unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars
|
|
14
14
|
import type { TreeAlpha } from "../../shared-tree/index.js";
|
|
15
15
|
import {
|
|
16
16
|
type RestrictiveStringRecord,
|
|
17
|
+
compareSets,
|
|
17
18
|
getOrCreate,
|
|
18
19
|
isReadonlyArray,
|
|
19
20
|
} from "../../util/index.js";
|
|
@@ -24,6 +25,7 @@ import type {
|
|
|
24
25
|
TreeNodeSchemaClass,
|
|
25
26
|
TreeNodeSchemaNonClass,
|
|
26
27
|
TreeNodeSchemaBoth,
|
|
28
|
+
UnhydratedFlexTreeNode,
|
|
27
29
|
} from "../core/index.js";
|
|
28
30
|
import { isLazy } from "../flexList.js";
|
|
29
31
|
import {
|
|
@@ -54,16 +56,22 @@ import {
|
|
|
54
56
|
createFieldSchema,
|
|
55
57
|
type DefaultProvider,
|
|
56
58
|
getDefaultProvider,
|
|
57
|
-
type NodeSchemaOptions,
|
|
58
59
|
markSchemaMostDerived,
|
|
59
60
|
type FieldSchemaAlpha,
|
|
60
61
|
type ImplicitAnnotatedAllowedTypes,
|
|
61
62
|
type UnannotateImplicitAllowedTypes,
|
|
62
63
|
type UnannotateSchemaRecord,
|
|
64
|
+
type NodeSchemaOptionsAlpha,
|
|
65
|
+
normalizeAllowedTypes,
|
|
66
|
+
type FieldPropsAlpha,
|
|
63
67
|
} from "../schemaTypes.js";
|
|
64
68
|
|
|
65
69
|
import { createFieldSchemaUnsafe } from "./schemaFactoryRecursive.js";
|
|
66
70
|
import type { System_Unsafe, FieldSchemaAlphaUnsafe } from "./typesUnsafe.js";
|
|
71
|
+
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
72
|
+
import { createIdCompressor } from "@fluidframework/id-compressor/internal";
|
|
73
|
+
import type { FlexTreeHydratedContextMinimal } from "../../feature-libraries/index.js";
|
|
74
|
+
import { unhydratedFlexTreeFromInsertable } from "../unhydratedFlexTreeFromInsertable.js";
|
|
67
75
|
|
|
68
76
|
/**
|
|
69
77
|
* Gets the leaf domain schema compatible with a given {@link TreeValue}.
|
|
@@ -94,7 +102,7 @@ export function schemaFromValue(value: TreeValue): TreeNodeSchema {
|
|
|
94
102
|
* @alpha
|
|
95
103
|
*/
|
|
96
104
|
export interface SchemaFactoryObjectOptions<TCustomMetadata = unknown>
|
|
97
|
-
extends
|
|
105
|
+
extends NodeSchemaOptionsAlpha<TCustomMetadata> {
|
|
98
106
|
/**
|
|
99
107
|
* Allow nodes typed with this object node schema to contain optional fields that are not present in the schema declaration.
|
|
100
108
|
* Such nodes can come into existence either via import APIs (see remarks) or by way of collaboration with another client
|
|
@@ -140,8 +148,12 @@ export interface SchemaFactoryObjectOptions<TCustomMetadata = unknown>
|
|
|
140
148
|
allowUnknownOptionalFields?: boolean;
|
|
141
149
|
}
|
|
142
150
|
|
|
151
|
+
/**
|
|
152
|
+
* Default options for Object node schema creation.
|
|
153
|
+
* @remarks Omits parameters that are not relevant for common use cases.
|
|
154
|
+
*/
|
|
143
155
|
export const defaultSchemaFactoryObjectOptions: Required<
|
|
144
|
-
Omit<SchemaFactoryObjectOptions, "metadata">
|
|
156
|
+
Omit<SchemaFactoryObjectOptions, "metadata" | "persistedMetadata">
|
|
145
157
|
> = {
|
|
146
158
|
allowUnknownOptionalFields: false,
|
|
147
159
|
};
|
|
@@ -293,16 +305,14 @@ export interface SchemaStatics {
|
|
|
293
305
|
) => System_Unsafe.FieldSchemaUnsafe<FieldKind.Required, T, TCustomMetadata>;
|
|
294
306
|
}
|
|
295
307
|
|
|
296
|
-
const defaultOptionalProvider: DefaultProvider = getDefaultProvider(() =>
|
|
297
|
-
return undefined;
|
|
298
|
-
});
|
|
308
|
+
const defaultOptionalProvider: DefaultProvider = getDefaultProvider(() => []);
|
|
299
309
|
|
|
300
310
|
// The following overloads for optional and required are used to get around the fact that
|
|
301
311
|
// the compiler can't infer that UnannotateImplicitAllowedTypes<T> is equal to T when T is known to extend ImplicitAllowedTypes
|
|
302
312
|
|
|
303
313
|
function optional<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(
|
|
304
314
|
t: T,
|
|
305
|
-
props?: Omit<
|
|
315
|
+
props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">,
|
|
306
316
|
): FieldSchemaAlpha<FieldKind.Optional, T, TCustomMetadata>;
|
|
307
317
|
|
|
308
318
|
function optional<
|
|
@@ -310,7 +320,7 @@ function optional<
|
|
|
310
320
|
const TCustomMetadata = unknown,
|
|
311
321
|
>(
|
|
312
322
|
t: T,
|
|
313
|
-
props?: Omit<
|
|
323
|
+
props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">,
|
|
314
324
|
): FieldSchemaAlpha<FieldKind.Optional, UnannotateImplicitAllowedTypes<T>, TCustomMetadata>;
|
|
315
325
|
|
|
316
326
|
function optional<
|
|
@@ -318,7 +328,7 @@ function optional<
|
|
|
318
328
|
const TCustomMetadata = unknown,
|
|
319
329
|
>(
|
|
320
330
|
t: T,
|
|
321
|
-
props?: Omit<
|
|
331
|
+
props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">,
|
|
322
332
|
): FieldSchemaAlpha<FieldKind.Optional, UnannotateImplicitAllowedTypes<T>, TCustomMetadata> {
|
|
323
333
|
return createFieldSchema(FieldKind.Optional, t, {
|
|
324
334
|
defaultProvider: defaultOptionalProvider,
|
|
@@ -328,7 +338,7 @@ function optional<
|
|
|
328
338
|
|
|
329
339
|
function required<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(
|
|
330
340
|
t: T,
|
|
331
|
-
props?: Omit<
|
|
341
|
+
props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">,
|
|
332
342
|
): FieldSchemaAlpha<FieldKind.Required, T, TCustomMetadata>;
|
|
333
343
|
|
|
334
344
|
function required<
|
|
@@ -336,7 +346,7 @@ function required<
|
|
|
336
346
|
const TCustomMetadata = unknown,
|
|
337
347
|
>(
|
|
338
348
|
t: T,
|
|
339
|
-
props?: Omit<
|
|
349
|
+
props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">,
|
|
340
350
|
): FieldSchemaAlpha<FieldKind.Required, UnannotateImplicitAllowedTypes<T>, TCustomMetadata>;
|
|
341
351
|
|
|
342
352
|
function required<
|
|
@@ -344,7 +354,7 @@ function required<
|
|
|
344
354
|
const TCustomMetadata = unknown,
|
|
345
355
|
>(
|
|
346
356
|
t: T,
|
|
347
|
-
props?: Omit<
|
|
357
|
+
props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">,
|
|
348
358
|
): FieldSchemaAlpha<FieldKind.Required, UnannotateImplicitAllowedTypes<T>, TCustomMetadata> {
|
|
349
359
|
return createFieldSchema(FieldKind.Required, t, props);
|
|
350
360
|
}
|
|
@@ -372,7 +382,7 @@ export const schemaStaticsBase = {
|
|
|
372
382
|
const TCustomMetadata = unknown,
|
|
373
383
|
>(
|
|
374
384
|
t: T,
|
|
375
|
-
props?: Omit<
|
|
385
|
+
props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">,
|
|
376
386
|
): FieldSchemaAlphaUnsafe<FieldKind.Optional, T, TCustomMetadata> => {
|
|
377
387
|
return createFieldSchemaUnsafe(FieldKind.Optional, t, {
|
|
378
388
|
defaultProvider: defaultOptionalProvider,
|
|
@@ -385,7 +395,7 @@ export const schemaStaticsBase = {
|
|
|
385
395
|
const TCustomMetadata = unknown,
|
|
386
396
|
>(
|
|
387
397
|
t: T,
|
|
388
|
-
props?: Omit<
|
|
398
|
+
props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">,
|
|
389
399
|
): FieldSchemaAlphaUnsafe<FieldKind.Required, T, TCustomMetadata> => {
|
|
390
400
|
return createFieldSchemaUnsafe(FieldKind.Required, t, props);
|
|
391
401
|
},
|
|
@@ -766,9 +776,9 @@ export class SchemaFactory<
|
|
|
766
776
|
if (allowedTypes === undefined) {
|
|
767
777
|
const types = nameOrAllowedTypes as (T & TreeNodeSchema) | readonly TreeNodeSchema[];
|
|
768
778
|
const fullName = structuralName("Map", types);
|
|
769
|
-
return
|
|
770
|
-
this.structuralTypes,
|
|
779
|
+
return this.getStructuralType(
|
|
771
780
|
fullName,
|
|
781
|
+
types,
|
|
772
782
|
() =>
|
|
773
783
|
this.namedMap(
|
|
774
784
|
fullName as TName,
|
|
@@ -954,7 +964,7 @@ export class SchemaFactory<
|
|
|
954
964
|
if (allowedTypes === undefined) {
|
|
955
965
|
const types = nameOrAllowedTypes as (T & TreeNodeSchema) | readonly TreeNodeSchema[];
|
|
956
966
|
const fullName = structuralName("Array", types);
|
|
957
|
-
return
|
|
967
|
+
return this.getStructuralType(fullName, types, () =>
|
|
958
968
|
this.namedArray(fullName, nameOrAllowedTypes as T, false, true),
|
|
959
969
|
) as TreeNodeSchemaClass<
|
|
960
970
|
ScopedSchemaName<TScope, string>,
|
|
@@ -978,6 +988,35 @@ export class SchemaFactory<
|
|
|
978
988
|
return out;
|
|
979
989
|
}
|
|
980
990
|
|
|
991
|
+
/**
|
|
992
|
+
* Retrieves or creates a structural {@link TreeNodeSchema} with the specified name and types.
|
|
993
|
+
*
|
|
994
|
+
* @param fullName - The name for the structural schema.
|
|
995
|
+
* @param types - The input schema(s) used to define the structural schema.
|
|
996
|
+
* @param builder - A function that builds the schema if it does not already exist.
|
|
997
|
+
* @returns The structural {@link TreeNodeSchema} associated with the given name and types.
|
|
998
|
+
* @throws `UsageError` if a schema structurally named schema with the same name is cached in `structuralTypes` but had different input types.
|
|
999
|
+
*/
|
|
1000
|
+
private getStructuralType(
|
|
1001
|
+
fullName: string,
|
|
1002
|
+
types: TreeNodeSchema | readonly TreeNodeSchema[],
|
|
1003
|
+
builder: () => TreeNodeSchema,
|
|
1004
|
+
): TreeNodeSchema {
|
|
1005
|
+
const structural = getOrCreate(this.structuralTypes, fullName, builder);
|
|
1006
|
+
const inputTypes = new Set(normalizeAllowedTypes(types));
|
|
1007
|
+
const outputTypes = new Set(
|
|
1008
|
+
normalizeAllowedTypes(structural.info as TreeNodeSchema | readonly TreeNodeSchema[]),
|
|
1009
|
+
);
|
|
1010
|
+
// If our cached value had a different set of types then were requested, the user must have caused a collision.
|
|
1011
|
+
const same = compareSets({ a: inputTypes, b: outputTypes });
|
|
1012
|
+
if (!same) {
|
|
1013
|
+
throw new UsageError(
|
|
1014
|
+
`Structurally named schema collision: two schema named "${fullName}" were defined with different input schema.`,
|
|
1015
|
+
);
|
|
1016
|
+
}
|
|
1017
|
+
return structural;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
981
1020
|
/**
|
|
982
1021
|
* Define a {@link TreeNodeSchema} for a {@link (TreeArrayNode:interface)}.
|
|
983
1022
|
*
|
|
@@ -1080,8 +1119,6 @@ export class SchemaFactory<
|
|
|
1080
1119
|
*
|
|
1081
1120
|
* - A compressed form of the identifier can be accessed at runtime via the {@link TreeNodeApi.shortId|Tree.shortId()} API.
|
|
1082
1121
|
*
|
|
1083
|
-
* - It will not be present in the object's iterable properties until explicitly read or until having been inserted into a tree.
|
|
1084
|
-
*
|
|
1085
1122
|
* However, a user may alternatively supply their own string as the identifier if desired (for example, if importing identifiers from another system).
|
|
1086
1123
|
* In that case, if the user requires it to be unique, it is up to them to ensure uniqueness.
|
|
1087
1124
|
* User-supplied identifiers may be read immediately, even before insertion into the tree.
|
|
@@ -1090,10 +1127,19 @@ export class SchemaFactory<
|
|
|
1090
1127
|
*/
|
|
1091
1128
|
public get identifier(): FieldSchema<FieldKind.Identifier, typeof this.string> {
|
|
1092
1129
|
const defaultIdentifierProvider: DefaultProvider = getDefaultProvider(
|
|
1093
|
-
(
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1130
|
+
(
|
|
1131
|
+
context: FlexTreeHydratedContextMinimal | "UseGlobalContext",
|
|
1132
|
+
): UnhydratedFlexTreeNode[] => {
|
|
1133
|
+
const id =
|
|
1134
|
+
context === "UseGlobalContext"
|
|
1135
|
+
? globalIdentifierAllocator.decompress(
|
|
1136
|
+
globalIdentifierAllocator.generateCompressedId(),
|
|
1137
|
+
)
|
|
1138
|
+
: context.nodeKeyManager.stabilizeNodeIdentifier(
|
|
1139
|
+
context.nodeKeyManager.generateLocalNodeIdentifier(),
|
|
1140
|
+
);
|
|
1141
|
+
|
|
1142
|
+
return [unhydratedFlexTreeFromInsertable(id, this.string)];
|
|
1097
1143
|
},
|
|
1098
1144
|
);
|
|
1099
1145
|
return createFieldSchema(FieldKind.Identifier, this.string, {
|
|
@@ -1266,3 +1312,11 @@ export function structuralName<const T extends string>(
|
|
|
1266
1312
|
}
|
|
1267
1313
|
return `${collectionName}<${inner}>`;
|
|
1268
1314
|
}
|
|
1315
|
+
|
|
1316
|
+
/**
|
|
1317
|
+
* Used to allocate default identifiers for unhydrated nodes when no context is available.
|
|
1318
|
+
* @remarks
|
|
1319
|
+
* The identifiers allocated by this will never be compressed to Short Ids.
|
|
1320
|
+
* Using this is only better than creating fully random V4 UUIDs because it reduces the entropy making it possible for things like text compression to work slightly better.
|
|
1321
|
+
*/
|
|
1322
|
+
const globalIdentifierAllocator: IIdCompressor = createIdCompressor();
|
|
@@ -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.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { assert, oob, fail } from "@fluidframework/core-utils/internal";
|
|
6
|
+
import { assert, oob, fail, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
7
7
|
|
|
8
8
|
import { EmptyKey, rootFieldKey } from "../../core/index.js";
|
|
9
9
|
import { type TreeStatus, isTreeValue, FieldKinds } from "../../feature-libraries/index.js";
|
|
@@ -34,17 +34,23 @@ import {
|
|
|
34
34
|
type TreeNode,
|
|
35
35
|
tryGetTreeNodeSchema,
|
|
36
36
|
getOrCreateNodeFromInnerNode,
|
|
37
|
-
UnhydratedFlexTreeNode,
|
|
38
37
|
typeSchemaSymbol,
|
|
39
38
|
getOrCreateInnerNode,
|
|
40
39
|
} from "../core/index.js";
|
|
41
40
|
import type { TreeChangeEvents } from "./treeChangeEvents.js";
|
|
42
|
-
import {
|
|
41
|
+
import { isObjectNodeSchema } from "../node-kinds/index.js";
|
|
42
|
+
import { getTreeNodeForField } from "../getTreeNodeForField.js";
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Provides various functions for analyzing {@link TreeNode}s.
|
|
46
|
-
*
|
|
47
|
-
*
|
|
46
|
+
*
|
|
47
|
+
* @remarks
|
|
48
|
+
* With the exception of {@link TreeNodeApi.status}, these functions should not be called with nodes that have
|
|
49
|
+
* been {@link TreeStatus.Deleted | deleted}.
|
|
50
|
+
* To verify whether or not a node already has been deleted, use the {@link TreeNodeApi.status} function.
|
|
51
|
+
*
|
|
52
|
+
* This type should only be used via the public {@link (Tree:variable)} export.
|
|
53
|
+
*
|
|
48
54
|
* @privateRemarks
|
|
49
55
|
* Due to limitations of API-Extractor link resolution, this type can't be moved into internalTypes but should be considered just an implementation detail of the `Tree` export.
|
|
50
56
|
*
|
|
@@ -75,14 +81,19 @@ export interface TreeNodeApi {
|
|
|
75
81
|
|
|
76
82
|
/**
|
|
77
83
|
* Return the node under which this node resides in the tree (or undefined if this is a root node of the tree).
|
|
84
|
+
*
|
|
85
|
+
* @throws A {@link @fluidframework/telemetry-utils#UsageError} if the node has been {@link TreeStatus.Deleted | deleted}.
|
|
78
86
|
*/
|
|
79
87
|
parent(node: TreeNode): TreeNode | undefined;
|
|
80
88
|
|
|
81
89
|
/**
|
|
82
90
|
* The key of the given node under its parent.
|
|
91
|
+
*
|
|
83
92
|
* @remarks
|
|
84
93
|
* If `node` is an element in a {@link (TreeArrayNode:interface)}, this returns the index of `node` in the array node (a `number`).
|
|
85
94
|
* Otherwise, this returns the key of the field that it is under (a `string`).
|
|
95
|
+
*
|
|
96
|
+
* @throws A {@link @fluidframework/telemetry-utils#UsageError} if the node has been {@link TreeStatus.Deleted | deleted}.
|
|
86
97
|
*/
|
|
87
98
|
key(node: TreeNode): string | number;
|
|
88
99
|
|
|
@@ -126,7 +137,7 @@ export interface TreeNodeApi {
|
|
|
126
137
|
}
|
|
127
138
|
|
|
128
139
|
/**
|
|
129
|
-
*
|
|
140
|
+
* {@inheritDoc TreeNodeApi}
|
|
130
141
|
*/
|
|
131
142
|
export const treeNodeApi: TreeNodeApi = {
|
|
132
143
|
parent(node: TreeNode): TreeNode | undefined {
|
|
@@ -303,29 +314,39 @@ export function getIdentifierFromNode(
|
|
|
303
314
|
return undefined;
|
|
304
315
|
case 1: {
|
|
305
316
|
const key = identifierFieldKeys[0] ?? oob();
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
}
|
|
311
|
-
return identifier.value as string;
|
|
312
|
-
}
|
|
313
|
-
assert(
|
|
314
|
-
identifier?.context.isHydrated() === true,
|
|
315
|
-
0xa27 /* Expected hydrated identifier */,
|
|
316
|
-
);
|
|
317
|
-
const identifierValue = identifier.value as string;
|
|
317
|
+
const identifierField = flexNode.tryGetField(key);
|
|
318
|
+
assert(identifierField !== undefined, 0xbb5 /* missing identifier field */);
|
|
319
|
+
const identifierValue = getTreeNodeForField(identifierField);
|
|
320
|
+
assert(typeof identifierValue === "string", 0xbb6 /* identifier not a string */);
|
|
318
321
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
322
|
+
const context = flexNode.context;
|
|
323
|
+
switch (compression) {
|
|
324
|
+
case "preferCompressed": {
|
|
325
|
+
if (context.isHydrated()) {
|
|
326
|
+
const localNodeKey =
|
|
327
|
+
context.nodeKeyManager.tryLocalizeNodeIdentifier(identifierValue);
|
|
328
|
+
return localNodeKey !== undefined
|
|
329
|
+
? extractFromOpaque(localNodeKey)
|
|
330
|
+
: identifierValue;
|
|
331
|
+
} else {
|
|
332
|
+
return identifierValue;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
case "compressed": {
|
|
336
|
+
if (context.isHydrated()) {
|
|
337
|
+
const localNodeKey =
|
|
338
|
+
context.nodeKeyManager.tryLocalizeNodeIdentifier(identifierValue);
|
|
339
|
+
return localNodeKey !== undefined ? extractFromOpaque(localNodeKey) : undefined;
|
|
340
|
+
} else {
|
|
341
|
+
return undefined;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
case "uncompressed": {
|
|
345
|
+
return identifierValue;
|
|
346
|
+
}
|
|
347
|
+
default:
|
|
348
|
+
unreachableCase(compression);
|
|
327
349
|
}
|
|
328
|
-
return identifierValue;
|
|
329
350
|
}
|
|
330
351
|
default:
|
|
331
352
|
throw new UsageError(
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import type { IFluidHandle } from "@fluidframework/core-interfaces";
|
|
7
7
|
import { isFluidHandle } from "@fluidframework/runtime-utils/internal";
|
|
8
8
|
import { assert, fail } from "@fluidframework/core-utils/internal";
|
|
9
|
+
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
9
10
|
|
|
10
11
|
import {
|
|
11
12
|
aboveRootPlaceholder,
|
|
@@ -14,7 +15,6 @@ import {
|
|
|
14
15
|
type FieldKey,
|
|
15
16
|
type ITreeCursor,
|
|
16
17
|
type ITreeCursorSynchronous,
|
|
17
|
-
type TreeNodeSchemaIdentifier,
|
|
18
18
|
} from "../../core/index.js";
|
|
19
19
|
import { brand } from "../../util/index.js";
|
|
20
20
|
import type {
|
|
@@ -40,6 +40,7 @@ import { isObjectNodeSchema } from "../node-kinds/index.js";
|
|
|
40
40
|
import {
|
|
41
41
|
customFromCursor,
|
|
42
42
|
replaceHandles,
|
|
43
|
+
unknownTypeError,
|
|
43
44
|
type CustomTreeNode,
|
|
44
45
|
type HandleConverter,
|
|
45
46
|
type SchemalessParseOptions,
|
|
@@ -153,12 +154,14 @@ export function applySchemaToParserOptions(
|
|
|
153
154
|
return key;
|
|
154
155
|
},
|
|
155
156
|
parse: (type, inputKey): FieldKey => {
|
|
156
|
-
const simpleNodeSchema =
|
|
157
|
-
context.schema.get(brand(type)) ?? fail(0xb3a /* missing schema */);
|
|
157
|
+
const simpleNodeSchema = context.schema.get(brand(type)) ?? unknownTypeError(type);
|
|
158
158
|
if (isObjectNodeSchema(simpleNodeSchema)) {
|
|
159
|
-
const info =
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
const info = simpleNodeSchema.flexKeyMap.get(inputKey);
|
|
160
|
+
if (info === undefined) {
|
|
161
|
+
throw new UsageError(
|
|
162
|
+
`Failed to parse VerboseTree due to unexpected key ${JSON.stringify(inputKey)} on type ${JSON.stringify(type)}.`,
|
|
163
|
+
);
|
|
164
|
+
}
|
|
162
165
|
return info.storedKey;
|
|
163
166
|
}
|
|
164
167
|
return brand(inputKey);
|
|
@@ -203,19 +206,19 @@ function verboseTreeAdapter(options: SchemalessParseOptions): CursorAdapter<Verb
|
|
|
203
206
|
type: (node: VerboseTree) => {
|
|
204
207
|
switch (typeof node) {
|
|
205
208
|
case "number":
|
|
206
|
-
return numberSchema.identifier
|
|
209
|
+
return brand(numberSchema.identifier);
|
|
207
210
|
case "string":
|
|
208
|
-
return stringSchema.identifier
|
|
211
|
+
return brand(stringSchema.identifier);
|
|
209
212
|
case "boolean":
|
|
210
|
-
return booleanSchema.identifier
|
|
213
|
+
return brand(booleanSchema.identifier);
|
|
211
214
|
default:
|
|
212
215
|
if (node === null) {
|
|
213
|
-
return nullSchema.identifier
|
|
216
|
+
return brand(nullSchema.identifier);
|
|
214
217
|
}
|
|
215
218
|
if (isFluidHandle(node)) {
|
|
216
|
-
return handleSchema.identifier
|
|
219
|
+
return brand(handleSchema.identifier);
|
|
217
220
|
}
|
|
218
|
-
return node.type
|
|
221
|
+
return brand(node.type);
|
|
219
222
|
}
|
|
220
223
|
},
|
|
221
224
|
keysFromNode: (node: VerboseTree): readonly FieldKey[] => {
|