@fluidframework/tree 2.42.0 → 2.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +189 -0
- package/api-report/tree.alpha.api.md +72 -25
- package/api-report/tree.beta.api.md +34 -0
- package/api-report/tree.legacy.alpha.api.md +1 -0
- package/api-report/tree.legacy.public.api.md +1 -0
- package/api-report/tree.public.api.md +1 -0
- package/dist/alpha.d.ts +12 -6
- package/dist/beta.d.ts +6 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +5 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/schema-stored/formatV2.d.ts +80 -0
- package/dist/core/schema-stored/formatV2.d.ts.map +1 -0
- package/dist/core/schema-stored/formatV2.js +55 -0
- package/dist/core/schema-stored/formatV2.js.map +1 -0
- package/dist/core/schema-stored/index.d.ts +3 -1
- package/dist/core/schema-stored/index.d.ts.map +1 -1
- package/dist/core/schema-stored/index.js +5 -2
- package/dist/core/schema-stored/index.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +49 -17
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +65 -22
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +9 -7
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +13 -9
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +3 -3
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +6 -6
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js +3 -3
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +8 -3
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js +2 -5
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +24 -25
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/index.d.ts +0 -1
- package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/index.js +1 -7
- package/dist/feature-libraries/flex-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +2 -2
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.js +3 -0
- package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +1 -2
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +2 -5
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts +5 -5
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +15 -7
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +8 -3
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +2 -5
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +2 -2
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +1 -2
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.d.ts +16 -2
- package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +2 -0
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +2 -0
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +8 -4
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -36
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.js +3 -3
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +59 -9
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.d.ts +1 -1
- package/dist/feature-libraries/schema-index/formatV2.d.ts +42 -0
- package/dist/feature-libraries/schema-index/formatV2.d.ts.map +1 -0
- package/dist/feature-libraries/schema-index/formatV2.js +26 -0
- package/dist/feature-libraries/schema-index/formatV2.js.map +1 -0
- package/dist/feature-libraries/schema-index/index.d.ts +2 -1
- package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/index.js +4 -2
- package/dist/feature-libraries/schema-index/index.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +7 -2
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +6 -6
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.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.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +3 -3
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +5 -1
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +34 -5
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +39 -1
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +117 -11
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.d.ts +8 -3
- package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +2 -5
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +18 -7
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +15 -2
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/simple-tree/api/configuration.d.ts +15 -3
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js +40 -22
- package/dist/simple-tree/api/configuration.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 +4 -4
- 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 +15 -11
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +4 -0
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +41 -11
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +31 -4
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +2 -2
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/treeChangeEvents.d.ts +8 -3
- package/dist/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
- package/dist/simple-tree/api/treeChangeEvents.js.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.d.ts +3 -0
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +1 -1
- package/dist/simple-tree/api/treeNodeApi.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/context.d.ts +3 -3
- package/dist/simple-tree/core/context.d.ts.map +1 -1
- package/dist/simple-tree/core/context.js.map +1 -1
- package/dist/simple-tree/core/getOrCreateNode.d.ts +9 -0
- package/dist/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
- package/dist/simple-tree/core/getOrCreateNode.js +12 -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 -1
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +2 -2
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +68 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js +24 -1
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts +5 -9
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +12 -31
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/core/walkSchema.d.ts +3 -3
- package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/walkSchema.js +9 -5
- package/dist/simple-tree/core/walkSchema.js.map +1 -1
- package/dist/simple-tree/createContext.js +1 -1
- package/dist/simple-tree/createContext.js.map +1 -1
- package/dist/simple-tree/getTreeNodeForField.d.ts +1 -1
- package/dist/simple-tree/getTreeNodeForField.d.ts.map +1 -1
- package/dist/simple-tree/getTreeNodeForField.js +3 -3
- package/dist/simple-tree/getTreeNodeForField.js.map +1 -1
- package/dist/simple-tree/index.d.ts +6 -6
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +8 -5
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +4 -1
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +1 -0
- 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 +21 -16
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts +3 -2
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +11 -5
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts +3 -2
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +12 -7
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/dist/simple-tree/prepareForInsertion.js +5 -1
- package/dist/simple-tree/prepareForInsertion.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +63 -30
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js +73 -40
- 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 +4 -0
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +15 -4
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/treeNodeValid.js +1 -2
- package/dist/simple-tree/treeNodeValid.js.map +1 -1
- package/dist/simple-tree/walkFieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/walkFieldSchema.js +1 -1
- package/dist/simple-tree/walkFieldSchema.js.map +1 -1
- package/dist/tableSchema.d.ts +1 -1
- package/dist/util/typeUtils.d.ts +2 -2
- package/dist/util/typeUtils.js.map +1 -1
- package/dist/util/utils.d.ts +2 -0
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js.map +1 -1
- package/lib/alpha.d.ts +12 -6
- package/lib/beta.d.ts +6 -1
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/schema-stored/formatV2.d.ts +80 -0
- package/lib/core/schema-stored/formatV2.d.ts.map +1 -0
- package/lib/core/schema-stored/formatV2.js +52 -0
- package/lib/core/schema-stored/formatV2.js.map +1 -0
- package/lib/core/schema-stored/index.d.ts +3 -1
- package/lib/core/schema-stored/index.d.ts.map +1 -1
- package/lib/core/schema-stored/index.js +3 -1
- package/lib/core/schema-stored/index.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +49 -17
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +63 -21
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +9 -7
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +11 -7
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +3 -3
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +7 -7
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js +3 -3
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +8 -3
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js +2 -5
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +24 -25
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/flex-tree/index.d.ts +0 -1
- package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/index.js +0 -1
- package/lib/feature-libraries/flex-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts +2 -2
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.js +3 -0
- package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +1 -2
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +3 -6
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts +5 -5
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +15 -7
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +8 -3
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +2 -5
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +2 -2
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +1 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.d.ts +16 -2
- package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +2 -0
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +2 -0
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +8 -4
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -36
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.js +3 -3
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +60 -10
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.d.ts +1 -1
- package/lib/feature-libraries/schema-index/formatV2.d.ts +42 -0
- package/lib/feature-libraries/schema-index/formatV2.d.ts.map +1 -0
- package/lib/feature-libraries/schema-index/formatV2.js +23 -0
- package/lib/feature-libraries/schema-index/formatV2.js.map +1 -0
- package/lib/feature-libraries/schema-index/index.d.ts +2 -1
- package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/index.js +2 -1
- package/lib/feature-libraries/schema-index/index.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +7 -2
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +6 -6
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.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.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +4 -4
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +5 -1
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +34 -5
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +39 -1
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +111 -5
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.d.ts +8 -3
- package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +2 -5
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +18 -7
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +15 -2
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/simple-tree/api/configuration.d.ts +15 -3
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js +42 -24
- package/lib/simple-tree/api/configuration.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 +15 -11
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +4 -0
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +41 -11
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +31 -4
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +2 -2
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/treeChangeEvents.d.ts +8 -3
- package/lib/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
- package/lib/simple-tree/api/treeChangeEvents.js.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.d.ts +3 -0
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +2 -2
- package/lib/simple-tree/api/treeNodeApi.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/context.d.ts +3 -3
- package/lib/simple-tree/core/context.d.ts.map +1 -1
- package/lib/simple-tree/core/context.js.map +1 -1
- package/lib/simple-tree/core/getOrCreateNode.d.ts +9 -0
- package/lib/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
- package/lib/simple-tree/core/getOrCreateNode.js +10 -0
- 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.js +2 -2
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +68 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js +21 -0
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts +5 -9
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +15 -34
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/core/walkSchema.d.ts +3 -3
- package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/walkSchema.js +9 -5
- package/lib/simple-tree/core/walkSchema.js.map +1 -1
- package/lib/simple-tree/createContext.js +1 -1
- package/lib/simple-tree/createContext.js.map +1 -1
- package/lib/simple-tree/getTreeNodeForField.d.ts +1 -1
- package/lib/simple-tree/getTreeNodeForField.d.ts.map +1 -1
- package/lib/simple-tree/getTreeNodeForField.js +1 -1
- package/lib/simple-tree/getTreeNodeForField.js.map +1 -1
- package/lib/simple-tree/index.d.ts +6 -6
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +4 -4
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts +4 -1
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +2 -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 +13 -8
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts +3 -2
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +14 -8
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts +3 -2
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +14 -9
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/lib/simple-tree/prepareForInsertion.js +5 -1
- package/lib/simple-tree/prepareForInsertion.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +63 -30
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js +70 -36
- 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 +4 -0
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +15 -4
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/treeNodeValid.js +1 -2
- package/lib/simple-tree/treeNodeValid.js.map +1 -1
- package/lib/simple-tree/walkFieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/walkFieldSchema.js +1 -1
- package/lib/simple-tree/walkFieldSchema.js.map +1 -1
- package/lib/tableSchema.d.ts +1 -1
- package/lib/util/typeUtils.d.ts +2 -2
- package/lib/util/typeUtils.js.map +1 -1
- package/lib/util/utils.d.ts +2 -0
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js.map +1 -1
- package/package.json +23 -23
- package/src/core/index.ts +3 -1
- package/src/core/schema-stored/formatV2.ts +78 -0
- package/src/core/schema-stored/index.ts +4 -1
- package/src/core/schema-stored/schema.ts +123 -33
- package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +16 -11
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +16 -7
- package/src/feature-libraries/chunked-forest/codec/nodeShape.ts +4 -4
- package/src/feature-libraries/detachedFieldIndexSummarizer.ts +9 -16
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +33 -30
- package/src/feature-libraries/flex-tree/index.ts +0 -8
- package/src/feature-libraries/flex-tree/lazyEntity.ts +5 -1
- package/src/feature-libraries/flex-tree/lazyField.ts +5 -8
- package/src/feature-libraries/flex-tree/lazyNode.ts +17 -8
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +9 -16
- package/src/feature-libraries/index.ts +1 -1
- package/src/feature-libraries/mapTreeCursor.ts +17 -8
- package/src/feature-libraries/modular-schema/fieldKindWithEditor.ts +2 -0
- package/src/feature-libraries/object-forest/objectForest.ts +3 -0
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +11 -6
- package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +3 -3
- package/src/feature-libraries/schema-index/codec.ts +73 -14
- package/src/feature-libraries/schema-index/formatV2.ts +30 -0
- package/src/feature-libraries/schema-index/index.ts +2 -1
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +11 -18
- package/src/index.ts +6 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/schematizeTree.ts +1 -0
- package/src/shared-tree/schematizingTreeView.ts +8 -5
- package/src/shared-tree/sharedTree.ts +42 -12
- package/src/shared-tree/treeAlpha.ts +196 -6
- 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 +59 -27
- package/src/simple-tree/api/index.ts +3 -3
- package/src/simple-tree/api/schemaCompatibilityTester.ts +1 -1
- package/src/simple-tree/api/schemaCreationUtilities.ts +3 -3
- package/src/simple-tree/api/schemaFactory.ts +16 -11
- package/src/simple-tree/api/schemaFactoryAlpha.ts +53 -8
- package/src/simple-tree/api/storedSchema.ts +4 -4
- package/src/simple-tree/api/treeChangeEvents.ts +8 -3
- package/src/simple-tree/api/treeNodeApi.ts +5 -2
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +5 -0
- package/src/simple-tree/core/context.ts +3 -3
- package/src/simple-tree/core/getOrCreateNode.ts +14 -0
- package/src/simple-tree/core/index.ts +7 -1
- package/src/simple-tree/core/treeNodeKernel.ts +2 -2
- package/src/simple-tree/core/treeNodeSchema.ts +113 -1
- package/src/simple-tree/core/unhydratedFlexTree.ts +22 -44
- package/src/simple-tree/core/walkSchema.ts +16 -7
- package/src/simple-tree/createContext.ts +1 -1
- package/src/simple-tree/getTreeNodeForField.ts +3 -1
- package/src/simple-tree/index.ts +12 -5
- package/src/simple-tree/leafNodeSchema.ts +9 -1
- package/src/simple-tree/node-kinds/array/arrayNode.ts +20 -9
- package/src/simple-tree/node-kinds/map/mapNode.ts +21 -6
- package/src/simple-tree/node-kinds/object/objectNode.ts +29 -12
- package/src/simple-tree/prepareForInsertion.ts +5 -1
- package/src/simple-tree/schemaTypes.ts +151 -71
- package/src/simple-tree/simpleSchema.ts +27 -5
- package/src/simple-tree/toStoredSchema.ts +17 -4
- package/src/simple-tree/treeNodeValid.ts +1 -1
- package/src/simple-tree/walkFieldSchema.ts +5 -1
- package/src/util/typeUtils.ts +2 -2
- package/src/util/utils.ts +2 -0
- package/dist/feature-libraries/flex-tree/navigation.d.ts +0 -46
- package/dist/feature-libraries/flex-tree/navigation.d.ts.map +0 -1
- package/dist/feature-libraries/flex-tree/navigation.js +0 -104
- package/dist/feature-libraries/flex-tree/navigation.js.map +0 -1
- package/lib/feature-libraries/flex-tree/navigation.d.ts +0 -46
- package/lib/feature-libraries/flex-tree/navigation.d.ts.map +0 -1
- package/lib/feature-libraries/flex-tree/navigation.js +0 -97
- package/lib/feature-libraries/flex-tree/navigation.js.map +0 -1
- package/src/feature-libraries/flex-tree/navigation.ts +0 -121
|
@@ -53,11 +53,11 @@ function createProxyHandler(schema, allowAdditionalProperties) {
|
|
|
53
53
|
(0, internal_1.debugAssert)(() => !flexNode.context.isDisposed() || "FlexTreeNode is disposed");
|
|
54
54
|
const field = flexNode.tryGetField(fieldInfo.storedKey);
|
|
55
55
|
if (field !== undefined) {
|
|
56
|
-
return (0, getTreeNodeForField_js_1.
|
|
56
|
+
return (0, getTreeNodeForField_js_1.tryGetTreeNodeForField)(field);
|
|
57
57
|
}
|
|
58
58
|
return undefined;
|
|
59
59
|
}
|
|
60
|
-
// POJO mode objects don't have TreeNode's
|
|
60
|
+
// POJO mode objects don't have TreeNode's built in members on their targets, so special case them:
|
|
61
61
|
if (propertyKey === index_js_2.typeSchemaSymbol) {
|
|
62
62
|
return schema;
|
|
63
63
|
}
|
|
@@ -106,7 +106,7 @@ function createProxyHandler(schema, allowAdditionalProperties) {
|
|
|
106
106
|
const proxy = targetToProxy.get(target) ?? (0, internal_1.fail)(0xadd /* missing proxy */);
|
|
107
107
|
const field = (0, index_js_2.getOrCreateInnerNode)(proxy).tryGetField(fieldInfo.storedKey);
|
|
108
108
|
const p = {
|
|
109
|
-
value: field === undefined ? undefined : (0, getTreeNodeForField_js_1.
|
|
109
|
+
value: field === undefined ? undefined : (0, getTreeNodeForField_js_1.tryGetTreeNodeForField)(field),
|
|
110
110
|
writable: true,
|
|
111
111
|
// Report empty fields as own properties so they shadow inherited properties (even when empty) to match TypeScript typing.
|
|
112
112
|
// Make empty fields not enumerable so they get skipped when iterating over an object to better align with
|
|
@@ -146,16 +146,16 @@ CustomObjectNodeBase.kind = index_js_2.NodeKind.Object;
|
|
|
146
146
|
*
|
|
147
147
|
* @param name - Unique identifier for this schema within this factory's scope.
|
|
148
148
|
* @param fields - Schema for fields of the object node's schema. Defines what children can be placed under each key.
|
|
149
|
+
* @param persistedMetadata - Optional persisted metadata for the object node schema.
|
|
149
150
|
*/
|
|
150
|
-
function objectSchema(identifier, info, implicitlyConstructable, allowUnknownOptionalFields, metadata) {
|
|
151
|
+
function objectSchema(identifier, info, implicitlyConstructable, allowUnknownOptionalFields, metadata, persistedMetadata) {
|
|
151
152
|
// Field set can't be modified after this since derived data is stored in maps.
|
|
152
153
|
Object.freeze(info);
|
|
153
|
-
const unannotatedInfo = (0, schemaTypes_js_1.unannotateSchemaRecord)(info);
|
|
154
154
|
// Ensure no collisions between final set of property keys, and final set of stored keys (including those
|
|
155
155
|
// implicitly derived from property keys)
|
|
156
|
-
assertUniqueKeys(identifier,
|
|
156
|
+
assertUniqueKeys(identifier, info);
|
|
157
157
|
// Performance optimization: cache property key => stored key and schema.
|
|
158
|
-
const flexKeyMap = createFlexKeyMapping(
|
|
158
|
+
const flexKeyMap = createFlexKeyMapping(info);
|
|
159
159
|
const identifierFieldKeys = [];
|
|
160
160
|
for (const item of flexKeyMap.values()) {
|
|
161
161
|
if (item.schema.kind === schemaTypes_js_1.FieldKind.Identifier) {
|
|
@@ -163,6 +163,7 @@ function objectSchema(identifier, info, implicitlyConstructable, allowUnknownOpt
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
const lazyChildTypes = new internal_1.Lazy(() => new Set(Array.from(flexKeyMap.values(), (f) => [...f.schema.allowedTypeSet]).flat()));
|
|
166
|
+
const lazyAnnotatedTypes = new internal_1.Lazy(() => Array.from(flexKeyMap.values(), ({ schema }) => (0, schemaTypes_js_1.normalizeFieldSchema)(schema).annotatedAllowedTypesNormalized));
|
|
166
167
|
let handler;
|
|
167
168
|
let customizable;
|
|
168
169
|
let unhydratedContext;
|
|
@@ -226,6 +227,9 @@ function objectSchema(identifier, info, implicitlyConstructable, allowUnknownOpt
|
|
|
226
227
|
static get childTypes() {
|
|
227
228
|
return lazyChildTypes.value;
|
|
228
229
|
}
|
|
230
|
+
static get childAnnotatedAllowedTypes() {
|
|
231
|
+
return lazyAnnotatedTypes.value;
|
|
232
|
+
}
|
|
229
233
|
// eslint-disable-next-line import/no-deprecated
|
|
230
234
|
get [index_js_2.typeNameSymbol]() {
|
|
231
235
|
return identifier;
|
|
@@ -253,6 +257,7 @@ function objectSchema(identifier, info, implicitlyConstructable, allowUnknownOpt
|
|
|
253
257
|
CustomObjectNode.info = info;
|
|
254
258
|
CustomObjectNode.implicitlyConstructable = implicitlyConstructable;
|
|
255
259
|
CustomObjectNode.metadata = metadata ?? {};
|
|
260
|
+
CustomObjectNode.persistedMetadata = persistedMetadata;
|
|
256
261
|
return CustomObjectNode;
|
|
257
262
|
}
|
|
258
263
|
exports.objectSchema = objectSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectNode.js","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/object/objectNode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAsF;AACtF,uEAAsE;AAGtE,kEAM6C;AAG7C,kDAY6B;AAC7B,6DAA8D;AAC9D,yEAAmE;AACnE,6DAI8B;AAC9B,yEAAmE;AACnE,yDAe8B;AAE9B,mGAGmD;AACnD,6DAA6E;AAiI7E;;GAEG;AACH,SAAS,oBAAoB,CAAC,MAA2C;IACxE,MAAM,MAAM,GAAuE,IAAI,GAAG,EAAE,CAAC;IAC7F,KAAK,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM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ACnB,yBAAyB,SAAS,gBAAgB,UAAU,wDAAwD,CACpH,CAAC;QACH,CAAC;QACD,kBAAkB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;IAED,wDAAwD;IACxD,uEAAuE;IACvE,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAU,CAAC;IAC5C,KAAK,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5D,MAAM,SAAS,GAAG,IAAA,6BAAY,EAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QACpD,IAAI,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;YACtC,MAAM,IAAI,qBAAU,CACnB,eAAe,SAAS,gBAAgB,UAAU,6JAA6J,CAC/M,CAAC;QACH,CAAC;QACD,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;AACF,CAAC;AAED;;;GAGG;AACH,SAAgB,gCAAgC,CAC/C,MAA2B;IAE3B,MAAM,OAAO,GAAG,IAAA,uCAAoB,EAAC,MAAM,CAAC,CAAC;IAC7C,OAAO,CAAC,UAAU,EAAE,EAAE;QACrB,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACpD,OAAO,CACN,YAAY,KAAK,SAAS;YAC1B,IAAA,uCAAkB,EAAC,YAAY,CAAC;YAChC,YAAY,CAAC,0BAA0B,CACvC,CAAC;IACH,CAAC,CAAC;AACH,CAAC;AAZD,4EAYC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, Lazy, fail, debugAssert } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { FieldKey, SchemaPolicy } from \"../../../core/index.js\";\nimport {\n\tFieldKinds,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n} from \"../../../feature-libraries/index.js\";\nimport type { RestrictiveStringRecord, FlattenKeys } from \"../../../util/index.js\";\n\nimport {\n\ttype TreeNodeSchema,\n\tNodeKind,\n\ttype WithType,\n\t// eslint-disable-next-line import/no-deprecated\n\ttypeNameSymbol,\n\ttypeSchemaSymbol,\n\ttype InternalTreeNode,\n\ttype TreeNode,\n\ttype Context,\n\ttype UnhydratedFlexTreeNode,\n\tgetOrCreateInnerNode,\n} from \"../../core/index.js\";\nimport { getUnhydratedContext } from \"../../createContext.js\";\nimport { getTreeNodeForField } from \"../../getTreeNodeForField.js\";\nimport {\n\tisObjectNodeSchema,\n\ttype ObjectNodeSchema,\n\ttype ObjectNodeSchemaInternalData,\n} from \"./objectNodeTypes.js\";\nimport { prepareForInsertion } from \"../../prepareForInsertion.js\";\nimport {\n\ttype ImplicitFieldSchema,\n\tgetStoredKey,\n\tgetExplicitStoredKey,\n\ttype TreeFieldFromImplicitField,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype FieldSchema,\n\tnormalizeFieldSchema,\n\tFieldKind,\n\ttype NodeSchemaMetadata,\n\ttype FieldSchemaAlpha,\n\tObjectFieldSchema,\n\ttype ImplicitAnnotatedFieldSchema,\n\tunannotateSchemaRecord,\n\ttype UnannotateSchemaRecord,\n} from \"../../schemaTypes.js\";\nimport type { SimpleObjectFieldSchema } from \"../../simpleSchema.js\";\nimport {\n\tunhydratedFlexTreeFromInsertable,\n\ttype InsertableContent,\n} from \"../../unhydratedFlexTreeFromInsertable.js\";\nimport { TreeNodeValid, type MostDerivedData } from \"../../treeNodeValid.js\";\n\n/**\n * Generates the properties for an ObjectNode from its field schema object.\n * @remarks\n * Due to {@link https://github.com/microsoft/TypeScript/issues/43826}, we can't enable implicit construction of {@link TreeNode|TreeNodes} for setters.\n * Therefore code assigning to these fields must explicitly construct nodes using the schema's constructor or create method,\n * or using some other method like {@link (TreeAlpha:interface).create}.\n * @system @public\n */\nexport type ObjectFromSchemaRecord<T extends RestrictiveStringRecord<ImplicitFieldSchema>> =\n\tRestrictiveStringRecord<ImplicitFieldSchema> extends T\n\t\t? // eslint-disable-next-line @typescript-eslint/ban-types\n\t\t\t{}\n\t\t: {\n\t\t\t\t-readonly [Property in keyof T]: Property extends string\n\t\t\t\t\t? TreeFieldFromImplicitField<T[Property]>\n\t\t\t\t\t: unknown;\n\t\t\t};\n\n/**\n * A {@link TreeNode} which models a JavaScript object.\n * @remarks\n * Object nodes consist of a type which specifies which {@link TreeNodeSchema} they use (see {@link TreeNodeApi.schema} and {@link SchemaFactory.object}),\n * and a collections of fields, each with a distinct `key` and its own {@link FieldSchema} defining what can be placed under that key.\n *\n * All fields on an object node are exposed as own properties with string keys.\n * Non-empty fields are enumerable and empty optional fields are non-enumerable own properties with the value `undefined`.\n * No other own `own` or `enumerable` properties are included on object nodes unless the user of the node manually adds custom session only state.\n * This allows a majority of general purpose JavaScript object processing operations (like `for...in`, `Reflect.ownKeys()` and `Object.entries()`) to enumerate all the children.\n *\n * The API for fields is defined by {@link ObjectFromSchemaRecord}.\n * @public\n */\nexport type TreeObjectNode<\n\tT extends RestrictiveStringRecord<ImplicitFieldSchema>,\n\tTypeName extends string = string,\n> = TreeNode & ObjectFromSchemaRecord<T> & WithType<TypeName, NodeKind.Object, T>;\n\n/**\n * Type utility for determining if an implicit field schema is known to have a default value.\n *\n * @remarks Yields `false` when unknown.\n *\n * @privateRemarks\n * TODO: Account for field schemas with default value providers.\n * For now, this only captures field kinds that we know always have defaults - optional fields and identifier fields.\n *\n * @system @public\n */\nexport type FieldHasDefault<T extends ImplicitFieldSchema> = [T] extends [\n\tFieldSchema<FieldKind.Optional | FieldKind.Identifier>,\n]\n\t? true\n\t: false;\n\n/**\n * Helper used to produce types for:\n *\n * 1. Insertable content which can be used to construct an object node.\n * In this case, only own properties are considered.\n * This reduces the risk of incorrectly interpreting data at the cost of occasionally requiring users to convert data into a compatible format.\n *\n * 2. Insertable content which is an unhydrated object node.\n *\n * 3. Union of 1 and 2.\n *\n * @see {@link Input}\n *\n * @privateRemarks\n * TODO: consider separating these cases into different types.\n *\n * Empty objects don't get \"no excess property\" checks in literals.\n * To prevent extraneous properties in literals for the fields of an empty object from compiling, the empty case is special cased to produce `Record<string, never>`.\n * More details at {@link https://mercury.com/blog/creating-an-emptyobject-type-in-typescript}.\n *\n * Additionally when T is exactly `RestrictiveStringRecord<ImplicitFieldSchema>` produce just `never` so that it is assignable to the insertable for any given object type.\n *\n * Separating `{}` from `RestrictiveStringRecord<ImplicitFieldSchema>` is a bit messy since both extend each-other despite them being very different types.\n * A third dummy type `{ arbitraryKey: \"arbitraryValue\" }` is used to resolve this.\n *\n * @system @public\n */\nexport type InsertableObjectFromSchemaRecord<\n\tT extends RestrictiveStringRecord<ImplicitFieldSchema>,\n> = RestrictiveStringRecord<ImplicitFieldSchema> extends T\n\t? { arbitraryKey: \"arbitraryValue\" } extends T\n\t\t? // {} case\n\t\t\tRecord<string, never>\n\t\t: // RestrictiveStringRecord<ImplicitFieldSchema> case\n\t\t\tnever\n\t: FlattenKeys<\n\t\t\t{\n\t\t\t\treadonly [Property in keyof T]?: InsertableTreeFieldFromImplicitField<\n\t\t\t\t\tT[Property & string]\n\t\t\t\t>;\n\t\t\t} & {\n\t\t\t\t// Field does not have a known default, make it required:\n\t\t\t\treadonly [Property in keyof T as FieldHasDefault<T[Property & string]> extends false\n\t\t\t\t\t? Property\n\t\t\t\t\t: never]: InsertableTreeFieldFromImplicitField<T[Property & string]>;\n\t\t\t}\n\t\t>;\n\n/**\n * Helper used to remove annotations from a schema record and produce insertable objects,\n *\n * @privateremarks\n * This calls {@link InsertableObjectFromSchemaRecord} in order to produce the insertable objects.\n *\n * @system @alpha\n */\nexport type InsertableObjectFromAnnotatedSchemaRecord<\n\tT extends RestrictiveStringRecord<ImplicitAnnotatedFieldSchema>,\n> = InsertableObjectFromSchemaRecord<UnannotateSchemaRecord<T>>;\n\n/**\n * Maps from simple field keys (\"property\" keys) to information about the field.\n *\n * @remarks\n * A missing entry for a given property key indicates that no such field exists.\n * Keys with symbols are currently never used, but allowed to make lookups on non-field things\n * (returning undefined) easier.\n */\nexport type SimpleKeyMap = ReadonlyMap<\n\tstring | symbol,\n\t{ storedKey: FieldKey; schema: FieldSchema }\n>;\n\n/**\n * Caches the mappings from property keys to stored keys for the provided object field schemas in {@link simpleKeyToFlexKeyCache}.\n */\nfunction createFlexKeyMapping(fields: Record<string, ImplicitFieldSchema>): SimpleKeyMap {\n\tconst keyMap: Map<string | symbol, { storedKey: FieldKey; schema: FieldSchema }> = new Map();\n\tfor (const [propertyKey, fieldSchema] of Object.entries(fields)) {\n\t\tconst storedKey = getStoredKey(propertyKey, fieldSchema);\n\t\tkeyMap.set(propertyKey, { storedKey, schema: normalizeFieldSchema(fieldSchema) });\n\t}\n\n\treturn keyMap;\n}\n\n/**\n * Creates a proxy handler for the given schema.\n *\n * @param allowAdditionalProperties - If true, setting of unexpected properties will be forwarded to the target object.\n * Otherwise setting of unexpected properties will error.\n * TODO: consider implementing this using `Object.preventExtension` instead.\n * @param customTargetObject - Target object of the proxy.\n * If not provided `{}` is used for the target.\n */\nfunction createProxyHandler(\n\tschema: ObjectNodeSchema & ObjectNodeSchemaInternalData,\n\tallowAdditionalProperties: boolean,\n): ProxyHandler<TreeNode> {\n\t// To satisfy 'deepEquals' level scrutiny, the target of the proxy must be an object with the same\n\t// prototype as an object literal '{}'. This is because 'deepEquals' uses 'Object.getPrototypeOf'\n\t// as a way to quickly reject objects with different prototype chains.\n\t//\n\t// (Note that the prototype of an object literal appears as '[Object: null prototype] {}', not because\n\t// the prototype is null, but because the prototype object itself has a null prototype.)\n\n\t// TODO: Although the target is an object literal, it's still worthwhile to try experimenting with\n\t// a dispatch object to see if it improves performance.\n\tconst handler: ProxyHandler<TreeNode> = {\n\t\tget(target, propertyKey, proxy): unknown {\n\t\t\tconst fieldInfo = schema.flexKeyMap.get(propertyKey);\n\t\t\tif (fieldInfo !== undefined) {\n\t\t\t\tconst flexNode = getOrCreateInnerNode(proxy);\n\t\t\t\tdebugAssert(() => !flexNode.context.isDisposed() || \"FlexTreeNode is disposed\");\n\t\t\t\tconst field = flexNode.tryGetField(fieldInfo.storedKey);\n\t\t\t\tif (field !== undefined) {\n\t\t\t\t\treturn getTreeNodeForField(field);\n\t\t\t\t}\n\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// POJO mode objects don't have TreeNode's build in members on their targets, so special case them:\n\t\t\tif (propertyKey === typeSchemaSymbol) {\n\t\t\t\treturn schema;\n\t\t\t}\n\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\tif (propertyKey === typeNameSymbol) {\n\t\t\t\treturn schema.identifier;\n\t\t\t}\n\n\t\t\t// Pass the proxy as the receiver here, so that any methods on the prototype receive `proxy` as `this`.\n\t\t\treturn Reflect.get(target, propertyKey, proxy);\n\t\t},\n\t\tset(target, propertyKey, value: InsertableContent | undefined, proxy) {\n\t\t\tconst fieldInfo = schema.flexKeyMap.get(propertyKey);\n\t\t\tif (fieldInfo === undefined) {\n\t\t\t\t// Pass the proxy as the receiver here, so that setters on the prototype receive `proxy` as `this`.\n\t\t\t\treturn allowAdditionalProperties\n\t\t\t\t\t? Reflect.set(target, propertyKey, value, proxy)\n\t\t\t\t\t: false;\n\t\t\t}\n\n\t\t\tsetField(\n\t\t\t\tgetOrCreateInnerNode(proxy).getBoxed(fieldInfo.storedKey),\n\t\t\t\tfieldInfo.schema,\n\t\t\t\tvalue,\n\t\t\t);\n\t\t\treturn true;\n\t\t},\n\t\tdeleteProperty(target, propertyKey): boolean {\n\t\t\t// TODO: supporting delete when it makes sense (custom local fields, and optional field) could be added as a feature in the future.\n\t\t\tthrow new UsageError(\n\t\t\t\t`Object nodes do not support the delete operator. Optional fields can be assigned to undefined instead.`,\n\t\t\t);\n\t\t},\n\t\thas: (target, propertyKey) => {\n\t\t\treturn (\n\t\t\t\tschema.flexKeyMap.has(propertyKey) ||\n\t\t\t\t(allowAdditionalProperties ? Reflect.has(target, propertyKey) : false)\n\t\t\t);\n\t\t},\n\t\townKeys: (target) => {\n\t\t\treturn [\n\t\t\t\t...schema.flexKeyMap.keys(),\n\t\t\t\t...(allowAdditionalProperties ? Reflect.ownKeys(target) : []),\n\t\t\t];\n\t\t},\n\t\tgetOwnPropertyDescriptor: (target, propertyKey) => {\n\t\t\tconst fieldInfo = schema.flexKeyMap.get(propertyKey);\n\n\t\t\tif (fieldInfo === undefined) {\n\t\t\t\treturn allowAdditionalProperties\n\t\t\t\t\t? Reflect.getOwnPropertyDescriptor(target, propertyKey)\n\t\t\t\t\t: undefined;\n\t\t\t}\n\n\t\t\t// For some reason, the getOwnPropertyDescriptor is not passed in the receiver, so use a weak map.\n\t\t\t// If a refactoring is done to associated flex tree data with the target not the proxy, this extra map could be removed,\n\t\t\t// and the design would be more compatible with proxyless nodes.\n\t\t\tconst proxy = targetToProxy.get(target) ?? fail(0xadd /* missing proxy */);\n\t\t\tconst field = getOrCreateInnerNode(proxy).tryGetField(fieldInfo.storedKey);\n\n\t\t\tconst p: PropertyDescriptor = {\n\t\t\t\tvalue: field === undefined ? undefined : getTreeNodeForField(field),\n\t\t\t\twritable: true,\n\t\t\t\t// Report empty fields as own properties so they shadow inherited properties (even when empty) to match TypeScript typing.\n\t\t\t\t// Make empty fields not enumerable so they get skipped when iterating over an object to better align with\n\t\t\t\t// JSON and deep equals with JSON compatible object (which can't have undefined fields).\n\t\t\t\tenumerable: field !== undefined,\n\t\t\t\tconfigurable: true, // Must be 'configurable' if property is absent from proxy target.\n\t\t\t};\n\n\t\t\treturn p;\n\t\t},\n\t};\n\treturn handler;\n}\n\nexport function setField(\n\tfield: FlexTreeField,\n\tsimpleFieldSchema: FieldSchema,\n\tvalue: InsertableContent | undefined,\n): void {\n\tconst mapTree = prepareForInsertion(value, simpleFieldSchema, field.context);\n\n\tswitch (field.schema) {\n\t\tcase FieldKinds.required.identifier: {\n\t\t\tassert(mapTree !== undefined, 0xa04 /* Cannot set a required field to undefined */);\n\t\t\tconst typedField = field as FlexTreeRequiredField;\n\t\t\ttypedField.editor.set(mapTree);\n\t\t\tbreak;\n\t\t}\n\t\tcase FieldKinds.optional.identifier: {\n\t\t\tconst typedField = field as FlexTreeOptionalField;\n\t\t\ttypedField.editor.set(mapTree, typedField.length === 0);\n\t\t\tbreak;\n\t\t}\n\n\t\tdefault:\n\t\t\tfail(0xade /* invalid FieldKind */);\n\t}\n}\n\nabstract class CustomObjectNodeBase<\n\tconst T extends RestrictiveStringRecord<ImplicitFieldSchema>,\n> extends TreeNodeValid<InsertableObjectFromSchemaRecord<T>> {\n\tpublic static readonly kind = NodeKind.Object;\n}\n\n/**\n * Define a {@link TreeNodeSchema} for a {@link TreeObjectNode}.\n *\n * @param name - Unique identifier for this schema within this factory's scope.\n * @param fields - Schema for fields of the object node's schema. Defines what children can be placed under each key.\n */\nexport function objectSchema<\n\tTName extends string,\n\tconst T extends RestrictiveStringRecord<ImplicitAnnotatedFieldSchema>,\n\tconst ImplicitlyConstructable extends boolean,\n\tconst TCustomMetadata = unknown,\n>(\n\tidentifier: TName,\n\tinfo: T,\n\timplicitlyConstructable: ImplicitlyConstructable,\n\tallowUnknownOptionalFields: boolean,\n\tmetadata?: NodeSchemaMetadata<TCustomMetadata>,\n): ObjectNodeSchema<TName, T, ImplicitlyConstructable, TCustomMetadata> &\n\tObjectNodeSchemaInternalData {\n\t// Field set can't be modified after this since derived data is stored in maps.\n\tObject.freeze(info);\n\n\tconst unannotatedInfo = unannotateSchemaRecord(info);\n\n\t// Ensure no collisions between final set of property keys, and final set of stored keys (including those\n\t// implicitly derived from property keys)\n\tassertUniqueKeys(identifier, unannotatedInfo);\n\n\t// Performance optimization: cache property key => stored key and schema.\n\tconst flexKeyMap: SimpleKeyMap = createFlexKeyMapping(unannotatedInfo);\n\n\tconst identifierFieldKeys: FieldKey[] = [];\n\tfor (const item of flexKeyMap.values()) {\n\t\tif (item.schema.kind === FieldKind.Identifier) {\n\t\t\tidentifierFieldKeys.push(item.storedKey);\n\t\t}\n\t}\n\n\tconst lazyChildTypes = new Lazy(\n\t\t() => new Set(Array.from(flexKeyMap.values(), (f) => [...f.schema.allowedTypeSet]).flat()),\n\t);\n\n\tlet handler: ProxyHandler<object>;\n\tlet customizable: boolean;\n\tlet unhydratedContext: Context;\n\n\tclass CustomObjectNode extends CustomObjectNodeBase<UnannotateSchemaRecord<T>> {\n\t\tpublic static readonly fields: ReadonlyMap<\n\t\t\tstring,\n\t\t\tFieldSchemaAlpha & SimpleObjectFieldSchema\n\t\t> = new Map(\n\t\t\tArray.from(flexKeyMap, ([key, value]) => [\n\t\t\t\tkey as string,\n\t\t\t\tnew ObjectFieldSchema(\n\t\t\t\t\tvalue.schema.kind,\n\t\t\t\t\tvalue.schema.allowedTypes,\n\t\t\t\t\t(value.schema as FieldSchemaAlpha).annotatedAllowedTypes,\n\t\t\t\t\t{\n\t\t\t\t\t\t...value.schema.props,\n\t\t\t\t\t\tkey: getStoredKey(key as string, value.schema),\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t]),\n\t\t);\n\t\tpublic static readonly flexKeyMap: SimpleKeyMap = flexKeyMap;\n\t\tpublic static readonly storedKeyToPropertyKey: ReadonlyMap<FieldKey, string> = new Map<\n\t\t\tFieldKey,\n\t\t\tstring\n\t\t>(\n\t\t\tArray.from(flexKeyMap, ([key, value]): [FieldKey, string] => [\n\t\t\t\tvalue.storedKey,\n\t\t\t\tkey as string,\n\t\t\t]),\n\t\t);\n\t\tpublic static readonly identifierFieldKeys: readonly FieldKey[] = identifierFieldKeys;\n\t\tpublic static readonly allowUnknownOptionalFields: boolean = allowUnknownOptionalFields;\n\n\t\tpublic static override prepareInstance<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tflexNode: FlexTreeNode,\n\t\t): TreeNodeValid<T2> {\n\t\t\t// Differentiate between the following cases:\n\t\t\t//\n\t\t\t// Case 1: Direct construction (POJO emulation)\n\t\t\t//\n\t\t\t// const Foo = schemaFactory.object(\"Foo\", {bar: schemaFactory.number});\n\t\t\t//\n\t\t\t// assert.deepEqual(new Foo({ bar: 42 }), { bar: 42 },\n\t\t\t//\t\t \"Prototype chain equivalent to POJO.\");\n\t\t\t//\n\t\t\t// Case 2: Subclass construction (Customizable Object)\n\t\t\t//\n\t\t\t// \t class Foo extends schemaFactory.object(\"Foo\", {bar: schemaFactory.number}) {}\n\t\t\t//\n\t\t\t// \t assert.notDeepEqual(new Foo({ bar: 42 }), { bar: 42 },\n\t\t\t// \t \"Subclass prototype chain differs from POJO.\");\n\t\t\t//\n\t\t\t// In Case 1 (POJO emulation), the prototype chain match '{}' (proxyTarget = undefined)\n\t\t\t// In Case 2 (Customizable Object), the prototype chain include the user's subclass (proxyTarget = this)\n\n\t\t\tconst proxyTarget = customizable ? instance : {};\n\t\t\tconst proxy = new Proxy(proxyTarget, handler) as CustomObjectNode;\n\t\t\ttargetToProxy.set(proxyTarget, proxy);\n\t\t\treturn proxy;\n\t\t}\n\n\t\tpublic static override buildRawNode<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tinput: T2,\n\t\t): UnhydratedFlexTreeNode {\n\t\t\treturn unhydratedFlexTreeFromInsertable(input as object, this as Output);\n\t\t}\n\n\t\tprotected static override constructorCached: MostDerivedData | undefined = undefined;\n\n\t\tprotected static override oneTimeSetup<T2>(this: typeof TreeNodeValid<T2>): Context {\n\t\t\t// One time initialization that required knowing the most derived type (from this.constructor) and thus has to be lazy.\n\t\t\tcustomizable = (this as unknown) !== CustomObjectNode;\n\t\t\tconst schema = this as unknown as ObjectNodeSchema & ObjectNodeSchemaInternalData;\n\t\t\thandler = createProxyHandler(schema, customizable);\n\t\t\tunhydratedContext = getUnhydratedContext(schema);\n\n\t\t\t// First run, do extra validation.\n\t\t\t// TODO: provide a way for TreeConfiguration to trigger this same validation to ensure it gets run early.\n\t\t\t// Scan for shadowing inherited members which won't work, but stop scan early to allow shadowing built in (which seems to work ok).\n\t\t\t{\n\t\t\t\tlet prototype: object = this.prototype;\n\t\t\t\t// There isn't a clear cleaner way to author this loop.\n\t\t\t\twhile (prototype !== CustomObjectNode.prototype) {\n\t\t\t\t\tfor (const [key] of flexKeyMap) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t// constructor is a special case, since one is built in on the derived type, and shadowing it works fine since we only use it before fields are applied.\n\t\t\t\t\t\t\tkey !== \"constructor\" &&\n\t\t\t\t\t\t\tReflect.getOwnPropertyDescriptor(prototype, key) !== undefined\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\t`Schema ${identifier} defines an inherited property \"${key.toString()}\" which shadows a field. Since fields are exposed as own properties, this shadowing will not work, and is an error.`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Since this stops at CustomObjectNode, it should never see a null prototype, so this case is safe.\n\t\t\t\t\t// Additionally, if the prototype chain is ever messed up such that CustomObjectNode is not in it,\n\t\t\t\t\t// the null that would show up here does at least ensure this code throws instead of hanging.\n\t\t\t\t\tprototype = Reflect.getPrototypeOf(prototype) as object;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn unhydratedContext;\n\t\t}\n\n\t\tpublic static readonly identifier = identifier;\n\t\tpublic static readonly info = info;\n\t\tpublic static readonly implicitlyConstructable: ImplicitlyConstructable =\n\t\t\timplicitlyConstructable;\n\t\tpublic static get childTypes(): ReadonlySet<TreeNodeSchema> {\n\t\t\treturn lazyChildTypes.value;\n\t\t}\n\t\tpublic static readonly metadata: NodeSchemaMetadata<TCustomMetadata> = metadata ?? {};\n\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tpublic get [typeNameSymbol](): TName {\n\t\t\treturn identifier;\n\t\t}\n\t\tpublic get [typeSchemaSymbol](): Output {\n\t\t\treturn CustomObjectNode.constructorCached?.constructor as unknown as Output;\n\t\t}\n\t}\n\ttype Output = typeof CustomObjectNode &\n\t\t(new (\n\t\t\tinput: InsertableObjectFromAnnotatedSchemaRecord<T> | InternalTreeNode,\n\t\t) => TreeObjectNode<UnannotateSchemaRecord<T>, TName>);\n\treturn CustomObjectNode as Output;\n}\n\nconst targetToProxy: WeakMap<object, TreeNode> = new WeakMap();\n\n/**\n * Ensures that the set of property keys in the schema is unique.\n * Also ensure that the final set of stored keys (including those implicitly derived from property keys) is unique.\n * @throws Throws a `UsageError` if either of the key uniqueness invariants is violated.\n */\nfunction assertUniqueKeys<\n\tconst Name extends number | string,\n\tconst Fields extends RestrictiveStringRecord<ImplicitFieldSchema>,\n>(schemaName: Name, fields: Fields): void {\n\t// Verify that there are no duplicates among the explicitly specified stored keys.\n\tconst explicitStoredKeys = new Set<string>();\n\tfor (const schema of Object.values(fields)) {\n\t\tconst storedKey = getExplicitStoredKey(schema);\n\t\tif (storedKey === undefined) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (explicitStoredKeys.has(storedKey)) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Duplicate stored key \"${storedKey}\" in schema \"${schemaName}\". Stored keys must be unique within an object schema.`,\n\t\t\t);\n\t\t}\n\t\texplicitStoredKeys.add(storedKey);\n\t}\n\n\t// Verify that there are no duplicates among the derived\n\t// (including those implicitly derived from property keys) stored keys.\n\tconst derivedStoredKeys = new Set<string>();\n\tfor (const [propertyKey, schema] of Object.entries(fields)) {\n\t\tconst storedKey = getStoredKey(propertyKey, schema);\n\t\tif (derivedStoredKeys.has(storedKey)) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Stored key \"${storedKey}\" in schema \"${schemaName}\" conflicts with a property key of the same name, which is not overridden by a stored key. The final set of stored keys in an object schema must be unique.`,\n\t\t\t);\n\t\t}\n\t\tderivedStoredKeys.add(storedKey);\n\t}\n}\n\n/**\n * Creates a policy for allowing unknown optional fields on an object node which delegates to the policy defined\n * on the object node's internal schema data.\n */\nexport function createUnknownOptionalFieldPolicy(\n\tschema: ImplicitFieldSchema,\n): SchemaPolicy[\"allowUnknownOptionalFields\"] {\n\tconst context = getUnhydratedContext(schema);\n\treturn (identifier) => {\n\t\tconst storedSchema = context.schema.get(identifier);\n\t\treturn (\n\t\t\tstoredSchema !== undefined &&\n\t\t\tisObjectNodeSchema(storedSchema) &&\n\t\t\tstoredSchema.allowUnknownOptionalFields\n\t\t);\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"objectNode.js","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/object/objectNode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAsF;AACtF,uEAAsE;AAGtE,kEAM6C;AAO7C,kDAa6B;AAC7B,6DAA8D;AAC9D,yEAAsE;AACtE,6DAI8B;AAC9B,yEAAmE;AACnE,yDAc8B;AAE9B,mGAGmD;AACnD,6DAA6E;AAiI7E;;GAEG;AACH,SAAS,oBAAoB,CAC5B,MAAoD;IAEpD,MAAM,MAAM,GAAuE,IAAI,GAAG,EAAE,CAAC;IAC7F,KAAK,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACjE,MAAM,SAAS,GAAG,IAAA,6BAAY,EAAC,WAAW,EAAE,WAAW,CAAC,CAAC;QACzD,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,IAAA,qCAAoB,EAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,kBAAkB,CAC1B,MAAuD,EACvD,yBAAkC;IAElC,kGAAkG;IAClG,kGAAkG;IAClG,sEAAsE;IACtE,EAAE;IACF,sGAAsG;IACtG,wFAAwF;IAExF,kGAAkG;IAClG,uDAAuD;IACvD,MAAM,OAAO,GAA2B;QACvC,GA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,GAAG,EAAU,CAAC;IAC5C,KAAK,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5D,MAAM,SAAS,GAAG,IAAA,6BAAY,EAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QACpD,IAAI,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;YACtC,MAAM,IAAI,qBAAU,CACnB,eAAe,SAAS,gBAAgB,UAAU,6JAA6J,CAC/M,CAAC;QACH,CAAC;QACD,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;AACF,CAAC;AAED;;;GAGG;AACH,SAAgB,gCAAgC,CAC/C,MAA2B;IAE3B,MAAM,OAAO,GAAG,IAAA,uCAAoB,EAAC,MAAM,CAAC,CAAC;IAC7C,OAAO,CAAC,UAAU,EAAE,EAAE;QACrB,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACpD,OAAO,CACN,YAAY,KAAK,SAAS;YAC1B,IAAA,uCAAkB,EAAC,YAAY,CAAC;YAChC,YAAY,CAAC,0BAA0B,CACvC,CAAC;IACH,CAAC,CAAC;AACH,CAAC;AAZD,4EAYC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, Lazy, fail, debugAssert } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { FieldKey, SchemaPolicy } from \"../../../core/index.js\";\nimport {\n\tFieldKinds,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n} from \"../../../feature-libraries/index.js\";\nimport type {\n\tRestrictiveStringRecord,\n\tFlattenKeys,\n\tJsonCompatibleReadOnlyObject,\n} from \"../../../util/index.js\";\n\nimport {\n\ttype TreeNodeSchema,\n\tNodeKind,\n\ttype WithType,\n\t// eslint-disable-next-line import/no-deprecated\n\ttypeNameSymbol,\n\ttypeSchemaSymbol,\n\ttype InternalTreeNode,\n\ttype TreeNode,\n\ttype Context,\n\ttype UnhydratedFlexTreeNode,\n\tgetOrCreateInnerNode,\n\ttype NormalizedAnnotatedAllowedTypes,\n} from \"../../core/index.js\";\nimport { getUnhydratedContext } from \"../../createContext.js\";\nimport { tryGetTreeNodeForField } from \"../../getTreeNodeForField.js\";\nimport {\n\tisObjectNodeSchema,\n\ttype ObjectNodeSchema,\n\ttype ObjectNodeSchemaInternalData,\n} from \"./objectNodeTypes.js\";\nimport { prepareForInsertion } from \"../../prepareForInsertion.js\";\nimport {\n\ttype ImplicitFieldSchema,\n\tgetStoredKey,\n\tgetExplicitStoredKey,\n\ttype TreeFieldFromImplicitField,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype FieldSchema,\n\tnormalizeFieldSchema,\n\tFieldKind,\n\ttype NodeSchemaMetadata,\n\ttype FieldSchemaAlpha,\n\tObjectFieldSchema,\n\ttype ImplicitAnnotatedFieldSchema,\n\ttype UnannotateSchemaRecord,\n} from \"../../schemaTypes.js\";\nimport type { SimpleObjectFieldSchema } from \"../../simpleSchema.js\";\nimport {\n\tunhydratedFlexTreeFromInsertable,\n\ttype InsertableContent,\n} from \"../../unhydratedFlexTreeFromInsertable.js\";\nimport { TreeNodeValid, type MostDerivedData } from \"../../treeNodeValid.js\";\n\n/**\n * Generates the properties for an ObjectNode from its field schema object.\n * @remarks\n * Due to {@link https://github.com/microsoft/TypeScript/issues/43826}, we can't enable implicit construction of {@link TreeNode|TreeNodes} for setters.\n * Therefore code assigning to these fields must explicitly construct nodes using the schema's constructor or create method,\n * or using some other method like {@link (TreeAlpha:interface).create}.\n * @system @public\n */\nexport type ObjectFromSchemaRecord<T extends RestrictiveStringRecord<ImplicitFieldSchema>> =\n\tRestrictiveStringRecord<ImplicitFieldSchema> extends T\n\t\t? // eslint-disable-next-line @typescript-eslint/ban-types\n\t\t\t{}\n\t\t: {\n\t\t\t\t-readonly [Property in keyof T]: Property extends string\n\t\t\t\t\t? TreeFieldFromImplicitField<T[Property]>\n\t\t\t\t\t: unknown;\n\t\t\t};\n\n/**\n * A {@link TreeNode} which models a JavaScript object.\n * @remarks\n * Object nodes consist of a type which specifies which {@link TreeNodeSchema} they use (see {@link TreeNodeApi.schema} and {@link SchemaFactory.object}),\n * and a collections of fields, each with a distinct `key` and its own {@link FieldSchema} defining what can be placed under that key.\n *\n * All fields on an object node are exposed as own properties with string keys.\n * Non-empty fields are enumerable and empty optional fields are non-enumerable own properties with the value `undefined`.\n * No other own `own` or `enumerable` properties are included on object nodes unless the user of the node manually adds custom session only state.\n * This allows a majority of general purpose JavaScript object processing operations (like `for...in`, `Reflect.ownKeys()` and `Object.entries()`) to enumerate all the children.\n *\n * The API for fields is defined by {@link ObjectFromSchemaRecord}.\n * @public\n */\nexport type TreeObjectNode<\n\tT extends RestrictiveStringRecord<ImplicitFieldSchema>,\n\tTypeName extends string = string,\n> = TreeNode & ObjectFromSchemaRecord<T> & WithType<TypeName, NodeKind.Object, T>;\n\n/**\n * Type utility for determining if an implicit field schema is known to have a default value.\n *\n * @remarks Yields `false` when unknown.\n *\n * @privateRemarks\n * TODO: Account for field schemas with default value providers.\n * For now, this only captures field kinds that we know always have defaults - optional fields and identifier fields.\n *\n * @system @public\n */\nexport type FieldHasDefault<T extends ImplicitFieldSchema> = [T] extends [\n\tFieldSchema<FieldKind.Optional | FieldKind.Identifier>,\n]\n\t? true\n\t: false;\n\n/**\n * Helper used to produce types for:\n *\n * 1. Insertable content which can be used to construct an object node.\n * In this case, only own properties are considered.\n * This reduces the risk of incorrectly interpreting data at the cost of occasionally requiring users to convert data into a compatible format.\n *\n * 2. Insertable content which is an unhydrated object node.\n *\n * 3. Union of 1 and 2.\n *\n * @see {@link Input}\n *\n * @privateRemarks\n * TODO: consider separating these cases into different types.\n *\n * Empty objects don't get \"no excess property\" checks in literals.\n * To prevent extraneous properties in literals for the fields of an empty object from compiling, the empty case is special cased to produce `Record<string, never>`.\n * More details at {@link https://mercury.com/blog/creating-an-emptyobject-type-in-typescript}.\n *\n * Additionally when T is exactly `RestrictiveStringRecord<ImplicitFieldSchema>` produce just `never` so that it is assignable to the insertable for any given object type.\n *\n * Separating `{}` from `RestrictiveStringRecord<ImplicitFieldSchema>` is a bit messy since both extend each-other despite them being very different types.\n * A third dummy type `{ arbitraryKey: \"arbitraryValue\" }` is used to resolve this.\n *\n * @system @public\n */\nexport type InsertableObjectFromSchemaRecord<\n\tT extends RestrictiveStringRecord<ImplicitFieldSchema>,\n> = RestrictiveStringRecord<ImplicitFieldSchema> extends T\n\t? { arbitraryKey: \"arbitraryValue\" } extends T\n\t\t? // {} case\n\t\t\tRecord<string, never>\n\t\t: // RestrictiveStringRecord<ImplicitFieldSchema> case\n\t\t\tnever\n\t: FlattenKeys<\n\t\t\t{\n\t\t\t\treadonly [Property in keyof T]?: InsertableTreeFieldFromImplicitField<\n\t\t\t\t\tT[Property & string]\n\t\t\t\t>;\n\t\t\t} & {\n\t\t\t\t// Field does not have a known default, make it required:\n\t\t\t\treadonly [Property in keyof T as FieldHasDefault<T[Property & string]> extends false\n\t\t\t\t\t? Property\n\t\t\t\t\t: never]: InsertableTreeFieldFromImplicitField<T[Property & string]>;\n\t\t\t}\n\t\t>;\n\n/**\n * Helper used to remove annotations from a schema record and produce insertable objects,\n *\n * @privateremarks\n * This calls {@link InsertableObjectFromSchemaRecord} in order to produce the insertable objects.\n *\n * @system @alpha\n */\nexport type InsertableObjectFromAnnotatedSchemaRecord<\n\tT extends RestrictiveStringRecord<ImplicitAnnotatedFieldSchema>,\n> = InsertableObjectFromSchemaRecord<UnannotateSchemaRecord<T>>;\n\n/**\n * Maps from simple field keys (\"property\" keys) to information about the field.\n *\n * @remarks\n * A missing entry for a given property key indicates that no such field exists.\n * Keys with symbols are currently never used, but allowed to make lookups on non-field things\n * (returning undefined) easier.\n */\nexport type SimpleKeyMap = ReadonlyMap<\n\tstring | symbol,\n\t{ storedKey: FieldKey; schema: FieldSchema }\n>;\n\n/**\n * Caches the mappings from property keys to stored keys for the provided object field schemas in {@link simpleKeyToFlexKeyCache}.\n */\nfunction createFlexKeyMapping(\n\tfields: Record<string, ImplicitAnnotatedFieldSchema>,\n): SimpleKeyMap {\n\tconst keyMap: Map<string | symbol, { storedKey: FieldKey; schema: FieldSchema }> = new Map();\n\tfor (const [propertyKey, fieldSchema] of Object.entries(fields)) {\n\t\tconst storedKey = getStoredKey(propertyKey, fieldSchema);\n\t\tkeyMap.set(propertyKey, { storedKey, schema: normalizeFieldSchema(fieldSchema) });\n\t}\n\n\treturn keyMap;\n}\n\n/**\n * Creates a proxy handler for the given schema.\n *\n * @param allowAdditionalProperties - If true, setting of unexpected properties will be forwarded to the target object.\n * Otherwise setting of unexpected properties will error.\n * TODO: consider implementing this using `Object.preventExtension` instead.\n * @param customTargetObject - Target object of the proxy.\n * If not provided `{}` is used for the target.\n */\nfunction createProxyHandler(\n\tschema: ObjectNodeSchema & ObjectNodeSchemaInternalData,\n\tallowAdditionalProperties: boolean,\n): ProxyHandler<TreeNode> {\n\t// To satisfy 'deepEquals' level scrutiny, the target of the proxy must be an object with the same\n\t// prototype as an object literal '{}'. This is because 'deepEquals' uses 'Object.getPrototypeOf'\n\t// as a way to quickly reject objects with different prototype chains.\n\t//\n\t// (Note that the prototype of an object literal appears as '[Object: null prototype] {}', not because\n\t// the prototype is null, but because the prototype object itself has a null prototype.)\n\n\t// TODO: Although the target is an object literal, it's still worthwhile to try experimenting with\n\t// a dispatch object to see if it improves performance.\n\tconst handler: ProxyHandler<TreeNode> = {\n\t\tget(target, propertyKey, proxy): unknown {\n\t\t\tconst fieldInfo = schema.flexKeyMap.get(propertyKey);\n\t\t\tif (fieldInfo !== undefined) {\n\t\t\t\tconst flexNode = getOrCreateInnerNode(proxy);\n\t\t\t\tdebugAssert(() => !flexNode.context.isDisposed() || \"FlexTreeNode is disposed\");\n\t\t\t\tconst field = flexNode.tryGetField(fieldInfo.storedKey);\n\t\t\t\tif (field !== undefined) {\n\t\t\t\t\treturn tryGetTreeNodeForField(field);\n\t\t\t\t}\n\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// POJO mode objects don't have TreeNode's built in members on their targets, so special case them:\n\t\t\tif (propertyKey === typeSchemaSymbol) {\n\t\t\t\treturn schema;\n\t\t\t}\n\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\tif (propertyKey === typeNameSymbol) {\n\t\t\t\treturn schema.identifier;\n\t\t\t}\n\n\t\t\t// Pass the proxy as the receiver here, so that any methods on the prototype receive `proxy` as `this`.\n\t\t\treturn Reflect.get(target, propertyKey, proxy);\n\t\t},\n\t\tset(target, propertyKey, value: InsertableContent | undefined, proxy) {\n\t\t\tconst fieldInfo = schema.flexKeyMap.get(propertyKey);\n\t\t\tif (fieldInfo === undefined) {\n\t\t\t\t// Pass the proxy as the receiver here, so that setters on the prototype receive `proxy` as `this`.\n\t\t\t\treturn allowAdditionalProperties\n\t\t\t\t\t? Reflect.set(target, propertyKey, value, proxy)\n\t\t\t\t\t: false;\n\t\t\t}\n\n\t\t\tsetField(\n\t\t\t\tgetOrCreateInnerNode(proxy).getBoxed(fieldInfo.storedKey),\n\t\t\t\tfieldInfo.schema,\n\t\t\t\tvalue,\n\t\t\t);\n\t\t\treturn true;\n\t\t},\n\t\tdeleteProperty(target, propertyKey): boolean {\n\t\t\t// TODO: supporting delete when it makes sense (custom local fields, and optional field) could be added as a feature in the future.\n\t\t\tthrow new UsageError(\n\t\t\t\t`Object nodes do not support the delete operator. Optional fields can be assigned to undefined instead.`,\n\t\t\t);\n\t\t},\n\t\thas: (target, propertyKey) => {\n\t\t\treturn (\n\t\t\t\tschema.flexKeyMap.has(propertyKey) ||\n\t\t\t\t(allowAdditionalProperties ? Reflect.has(target, propertyKey) : false)\n\t\t\t);\n\t\t},\n\t\townKeys: (target) => {\n\t\t\treturn [\n\t\t\t\t...schema.flexKeyMap.keys(),\n\t\t\t\t...(allowAdditionalProperties ? Reflect.ownKeys(target) : []),\n\t\t\t];\n\t\t},\n\t\tgetOwnPropertyDescriptor: (target, propertyKey) => {\n\t\t\tconst fieldInfo = schema.flexKeyMap.get(propertyKey);\n\n\t\t\tif (fieldInfo === undefined) {\n\t\t\t\treturn allowAdditionalProperties\n\t\t\t\t\t? Reflect.getOwnPropertyDescriptor(target, propertyKey)\n\t\t\t\t\t: undefined;\n\t\t\t}\n\n\t\t\t// For some reason, the getOwnPropertyDescriptor is not passed in the receiver, so use a weak map.\n\t\t\t// If a refactoring is done to associated flex tree data with the target not the proxy, this extra map could be removed,\n\t\t\t// and the design would be more compatible with proxyless nodes.\n\t\t\tconst proxy = targetToProxy.get(target) ?? fail(0xadd /* missing proxy */);\n\t\t\tconst field = getOrCreateInnerNode(proxy).tryGetField(fieldInfo.storedKey);\n\n\t\t\tconst p: PropertyDescriptor = {\n\t\t\t\tvalue: field === undefined ? undefined : tryGetTreeNodeForField(field),\n\t\t\t\twritable: true,\n\t\t\t\t// Report empty fields as own properties so they shadow inherited properties (even when empty) to match TypeScript typing.\n\t\t\t\t// Make empty fields not enumerable so they get skipped when iterating over an object to better align with\n\t\t\t\t// JSON and deep equals with JSON compatible object (which can't have undefined fields).\n\t\t\t\tenumerable: field !== undefined,\n\t\t\t\tconfigurable: true, // Must be 'configurable' if property is absent from proxy target.\n\t\t\t};\n\n\t\t\treturn p;\n\t\t},\n\t};\n\treturn handler;\n}\n\nexport function setField(\n\tfield: FlexTreeField,\n\tsimpleFieldSchema: FieldSchema,\n\tvalue: InsertableContent | undefined,\n): void {\n\tconst mapTree = prepareForInsertion(value, simpleFieldSchema, field.context);\n\n\tswitch (field.schema) {\n\t\tcase FieldKinds.required.identifier: {\n\t\t\tassert(mapTree !== undefined, 0xa04 /* Cannot set a required field to undefined */);\n\t\t\tconst typedField = field as FlexTreeRequiredField;\n\t\t\ttypedField.editor.set(mapTree);\n\t\t\tbreak;\n\t\t}\n\t\tcase FieldKinds.optional.identifier: {\n\t\t\tconst typedField = field as FlexTreeOptionalField;\n\t\t\ttypedField.editor.set(mapTree, typedField.length === 0);\n\t\t\tbreak;\n\t\t}\n\n\t\tdefault:\n\t\t\tfail(0xade /* invalid FieldKind */);\n\t}\n}\n\nabstract class CustomObjectNodeBase<\n\tconst T extends RestrictiveStringRecord<ImplicitFieldSchema>,\n> extends TreeNodeValid<InsertableObjectFromSchemaRecord<T>> {\n\tpublic static readonly kind = NodeKind.Object;\n}\n\n/**\n * Define a {@link TreeNodeSchema} for a {@link TreeObjectNode}.\n *\n * @param name - Unique identifier for this schema within this factory's scope.\n * @param fields - Schema for fields of the object node's schema. Defines what children can be placed under each key.\n * @param persistedMetadata - Optional persisted metadata for the object node schema.\n */\nexport function objectSchema<\n\tTName extends string,\n\tconst T extends RestrictiveStringRecord<ImplicitAnnotatedFieldSchema>,\n\tconst ImplicitlyConstructable extends boolean,\n\tconst TCustomMetadata = unknown,\n>(\n\tidentifier: TName,\n\tinfo: T,\n\timplicitlyConstructable: ImplicitlyConstructable,\n\tallowUnknownOptionalFields: boolean,\n\tmetadata?: NodeSchemaMetadata<TCustomMetadata>,\n\tpersistedMetadata?: JsonCompatibleReadOnlyObject | undefined,\n): ObjectNodeSchema<TName, T, ImplicitlyConstructable, TCustomMetadata> &\n\tObjectNodeSchemaInternalData {\n\t// Field set can't be modified after this since derived data is stored in maps.\n\tObject.freeze(info);\n\n\t// Ensure no collisions between final set of property keys, and final set of stored keys (including those\n\t// implicitly derived from property keys)\n\tassertUniqueKeys(identifier, info);\n\n\t// Performance optimization: cache property key => stored key and schema.\n\tconst flexKeyMap: SimpleKeyMap = createFlexKeyMapping(info);\n\n\tconst identifierFieldKeys: FieldKey[] = [];\n\tfor (const item of flexKeyMap.values()) {\n\t\tif (item.schema.kind === FieldKind.Identifier) {\n\t\t\tidentifierFieldKeys.push(item.storedKey);\n\t\t}\n\t}\n\n\tconst lazyChildTypes = new Lazy(\n\t\t() => new Set(Array.from(flexKeyMap.values(), (f) => [...f.schema.allowedTypeSet]).flat()),\n\t);\n\tconst lazyAnnotatedTypes = new Lazy(() =>\n\t\tArray.from(\n\t\t\tflexKeyMap.values(),\n\t\t\t({ schema }) => normalizeFieldSchema(schema).annotatedAllowedTypesNormalized,\n\t\t),\n\t);\n\n\tlet handler: ProxyHandler<object>;\n\tlet customizable: boolean;\n\tlet unhydratedContext: Context;\n\n\tclass CustomObjectNode extends CustomObjectNodeBase<UnannotateSchemaRecord<T>> {\n\t\tpublic static readonly fields: ReadonlyMap<\n\t\t\tstring,\n\t\t\tFieldSchemaAlpha & SimpleObjectFieldSchema\n\t\t> = new Map(\n\t\t\tArray.from(flexKeyMap, ([key, value]) => [\n\t\t\t\tkey as string,\n\t\t\t\tnew ObjectFieldSchema(\n\t\t\t\t\tvalue.schema.kind,\n\t\t\t\t\tvalue.schema.allowedTypes,\n\t\t\t\t\t(value.schema as FieldSchemaAlpha).annotatedAllowedTypes,\n\t\t\t\t\t{\n\t\t\t\t\t\t...value.schema.props,\n\t\t\t\t\t\tkey: getStoredKey(key as string, value.schema),\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t]),\n\t\t);\n\t\tpublic static readonly flexKeyMap: SimpleKeyMap = flexKeyMap;\n\t\tpublic static readonly storedKeyToPropertyKey: ReadonlyMap<FieldKey, string> = new Map<\n\t\t\tFieldKey,\n\t\t\tstring\n\t\t>(\n\t\t\tArray.from(flexKeyMap, ([key, value]): [FieldKey, string] => [\n\t\t\t\tvalue.storedKey,\n\t\t\t\tkey as string,\n\t\t\t]),\n\t\t);\n\t\tpublic static readonly identifierFieldKeys: readonly FieldKey[] = identifierFieldKeys;\n\t\tpublic static readonly allowUnknownOptionalFields: boolean = allowUnknownOptionalFields;\n\n\t\tpublic static override prepareInstance<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tflexNode: FlexTreeNode,\n\t\t): TreeNodeValid<T2> {\n\t\t\t// Differentiate between the following cases:\n\t\t\t//\n\t\t\t// Case 1: Direct construction (POJO emulation)\n\t\t\t//\n\t\t\t// const Foo = schemaFactory.object(\"Foo\", {bar: schemaFactory.number});\n\t\t\t//\n\t\t\t// assert.deepEqual(new Foo({ bar: 42 }), { bar: 42 },\n\t\t\t//\t\t \"Prototype chain equivalent to POJO.\");\n\t\t\t//\n\t\t\t// Case 2: Subclass construction (Customizable Object)\n\t\t\t//\n\t\t\t// \t class Foo extends schemaFactory.object(\"Foo\", {bar: schemaFactory.number}) {}\n\t\t\t//\n\t\t\t// \t assert.notDeepEqual(new Foo({ bar: 42 }), { bar: 42 },\n\t\t\t// \t \"Subclass prototype chain differs from POJO.\");\n\t\t\t//\n\t\t\t// In Case 1 (POJO emulation), the prototype chain match '{}' (proxyTarget = undefined)\n\t\t\t// In Case 2 (Customizable Object), the prototype chain include the user's subclass (proxyTarget = this)\n\n\t\t\tconst proxyTarget = customizable ? instance : {};\n\t\t\tconst proxy = new Proxy(proxyTarget, handler) as CustomObjectNode;\n\t\t\ttargetToProxy.set(proxyTarget, proxy);\n\t\t\treturn proxy;\n\t\t}\n\n\t\tpublic static override buildRawNode<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tinput: T2,\n\t\t): UnhydratedFlexTreeNode {\n\t\t\treturn unhydratedFlexTreeFromInsertable(input as object, this as Output);\n\t\t}\n\n\t\tprotected static override constructorCached: MostDerivedData | undefined = undefined;\n\n\t\tprotected static override oneTimeSetup<T2>(this: typeof TreeNodeValid<T2>): Context {\n\t\t\t// One time initialization that required knowing the most derived type (from this.constructor) and thus has to be lazy.\n\t\t\tcustomizable = (this as unknown) !== CustomObjectNode;\n\t\t\tconst schema = this as unknown as ObjectNodeSchema & ObjectNodeSchemaInternalData;\n\t\t\thandler = createProxyHandler(schema, customizable);\n\t\t\tunhydratedContext = getUnhydratedContext(schema);\n\n\t\t\t// First run, do extra validation.\n\t\t\t// TODO: provide a way for TreeConfiguration to trigger this same validation to ensure it gets run early.\n\t\t\t// Scan for shadowing inherited members which won't work, but stop scan early to allow shadowing built in (which seems to work ok).\n\t\t\t{\n\t\t\t\tlet prototype: object = this.prototype;\n\t\t\t\t// There isn't a clear cleaner way to author this loop.\n\t\t\t\twhile (prototype !== CustomObjectNode.prototype) {\n\t\t\t\t\tfor (const [key] of flexKeyMap) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t// constructor is a special case, since one is built in on the derived type, and shadowing it works fine since we only use it before fields are applied.\n\t\t\t\t\t\t\tkey !== \"constructor\" &&\n\t\t\t\t\t\t\tReflect.getOwnPropertyDescriptor(prototype, key) !== undefined\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\t`Schema ${identifier} defines an inherited property \"${key.toString()}\" which shadows a field. Since fields are exposed as own properties, this shadowing will not work, and is an error.`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Since this stops at CustomObjectNode, it should never see a null prototype, so this case is safe.\n\t\t\t\t\t// Additionally, if the prototype chain is ever messed up such that CustomObjectNode is not in it,\n\t\t\t\t\t// the null that would show up here does at least ensure this code throws instead of hanging.\n\t\t\t\t\tprototype = Reflect.getPrototypeOf(prototype) as object;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn unhydratedContext;\n\t\t}\n\n\t\tpublic static readonly identifier = identifier;\n\t\tpublic static readonly info = info;\n\t\tpublic static readonly implicitlyConstructable: ImplicitlyConstructable =\n\t\t\timplicitlyConstructable;\n\t\tpublic static get childTypes(): ReadonlySet<TreeNodeSchema> {\n\t\t\treturn lazyChildTypes.value;\n\t\t}\n\t\tpublic static get childAnnotatedAllowedTypes(): readonly NormalizedAnnotatedAllowedTypes[] {\n\t\t\treturn lazyAnnotatedTypes.value;\n\t\t}\n\t\tpublic static readonly metadata: NodeSchemaMetadata<TCustomMetadata> = metadata ?? {};\n\t\tpublic static readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined =\n\t\t\tpersistedMetadata;\n\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tpublic get [typeNameSymbol](): TName {\n\t\t\treturn identifier;\n\t\t}\n\t\tpublic get [typeSchemaSymbol](): Output {\n\t\t\treturn CustomObjectNode.constructorCached?.constructor as unknown as Output;\n\t\t}\n\t}\n\ttype Output = typeof CustomObjectNode &\n\t\t(new (\n\t\t\tinput: InsertableObjectFromAnnotatedSchemaRecord<T> | InternalTreeNode,\n\t\t) => TreeObjectNode<UnannotateSchemaRecord<T>, TName>);\n\treturn CustomObjectNode as Output;\n}\n\nconst targetToProxy: WeakMap<object, TreeNode> = new WeakMap();\n\n/**\n * Ensures that the set of property keys in the schema is unique.\n * Also ensure that the final set of stored keys (including those implicitly derived from property keys) is unique.\n * @throws Throws a `UsageError` if either of the key uniqueness invariants is violated.\n */\nfunction assertUniqueKeys<\n\tconst Name extends number | string,\n\tconst Fields extends RestrictiveStringRecord<ImplicitAnnotatedFieldSchema>,\n>(schemaName: Name, fields: Fields): void {\n\t// Verify that there are no duplicates among the explicitly specified stored keys.\n\tconst explicitStoredKeys = new Set<string>();\n\tfor (const schema of Object.values(fields)) {\n\t\tconst storedKey = getExplicitStoredKey(schema);\n\t\tif (storedKey === undefined) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (explicitStoredKeys.has(storedKey)) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Duplicate stored key \"${storedKey}\" in schema \"${schemaName}\". Stored keys must be unique within an object schema.`,\n\t\t\t);\n\t\t}\n\t\texplicitStoredKeys.add(storedKey);\n\t}\n\n\t// Verify that there are no duplicates among the derived\n\t// (including those implicitly derived from property keys) stored keys.\n\tconst derivedStoredKeys = new Set<string>();\n\tfor (const [propertyKey, schema] of Object.entries(fields)) {\n\t\tconst storedKey = getStoredKey(propertyKey, schema);\n\t\tif (derivedStoredKeys.has(storedKey)) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Stored key \"${storedKey}\" in schema \"${schemaName}\" conflicts with a property key of the same name, which is not overridden by a stored key. The final set of stored keys in an object schema must be unique.`,\n\t\t\t);\n\t\t}\n\t\tderivedStoredKeys.add(storedKey);\n\t}\n}\n\n/**\n * Creates a policy for allowing unknown optional fields on an object node which delegates to the policy defined\n * on the object node's internal schema data.\n */\nexport function createUnknownOptionalFieldPolicy(\n\tschema: ImplicitFieldSchema,\n): SchemaPolicy[\"allowUnknownOptionalFields\"] {\n\tconst context = getUnhydratedContext(schema);\n\treturn (identifier) => {\n\t\tconst storedSchema = context.schema.get(identifier);\n\t\treturn (\n\t\t\tstoredSchema !== undefined &&\n\t\t\tisObjectNodeSchema(storedSchema) &&\n\t\t\tstoredSchema.allowUnknownOptionalFields\n\t\t);\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepareForInsertion.d.ts","sourceRoot":"","sources":["../../src/simple-tree/prepareForInsertion.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,eAAe,EACf,mBAAmB,EAMnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,KAAK,eAAe,EAEpB,KAAK,8BAA8B,EAEnC,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEN,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,KAAK,iBAAiB,EAEtB,MAAM,uCAAuC,CAAC;AAG/C,OAAO,EAA4B,KAAK,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAKxF;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,SAAS,iBAAiB,GAAG,SAAS,EAC5E,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,mBAAmB,EAC3B,kBAAkB,EAAE,eAAe,GACjC,GAAG,SAAS,SAAS,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AAY,EAAE,8BAA8B,GAAG,SAAS,GACtD,GAAG,SAAS,SAAS,GAAG,SAAS,GAAG,mBAAmB,CAQzD;AA2DD;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,CACzC,OAAO,EAAE,SAAS,sBAAsB,EAAE,EAC1C,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE,8BAA8B,GACrC,IAAI,CAuBN"}
|
|
@@ -42,7 +42,11 @@ exports.prepareForInsertion = prepareForInsertion;
|
|
|
42
42
|
function prepareArrayContentForInsertion(data, schema, destinationContext) {
|
|
43
43
|
const mapTrees = data.map((item) => (0, unhydratedFlexTreeFromInsertable_js_1.unhydratedFlexTreeFromInsertable)(item, schema));
|
|
44
44
|
const fieldSchema = (0, toStoredSchema_js_1.convertField)((0, schemaTypes_js_1.normalizeFieldSchema)(schema));
|
|
45
|
-
validateAndPrepare((0, index_js_1.getSchemaAndPolicy)(destinationContext), destinationContext.isHydrated() ? destinationContext : undefined, {
|
|
45
|
+
validateAndPrepare((0, index_js_1.getSchemaAndPolicy)(destinationContext), destinationContext.isHydrated() ? destinationContext : undefined, {
|
|
46
|
+
kind: index_js_1.FieldKinds.sequence.identifier,
|
|
47
|
+
types: fieldSchema.types,
|
|
48
|
+
persistedMetadata: undefined,
|
|
49
|
+
}, mapTrees);
|
|
46
50
|
return mapTrees;
|
|
47
51
|
}
|
|
48
52
|
exports.prepareArrayContentForInsertion = prepareArrayContentForInsertion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepareForInsertion.js","sourceRoot":"","sources":["../../src/simple-tree/prepareForInsertion.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH,4DAOuC;AACvC,qDAI0B;AAC1B,+FAG+C;AAC/C,uEAAsE;AACtE,+CAAyC;AACzC,8CAAwF;AACxF,kEAAuE;AACvE,4DAAiF;AACjF,2DAAmD;AAEnD;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CAClC,IAAS,EACT,MAA2B,EAC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AED;;;;;;GAMG;AACH,SAAS,iBAAiB,CACzB,YAA0C,EAC1C,MAA2B;IAE3B,yIAAyI;IACzI,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,8GAA8G;QAC9G,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,EAAE;YAClE,kIAAkI;YAClI,MAAM,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC,IAAI,IAAA,cAAG,GAAE,CAAC;YACvC,IAAA,sBAAW,EAAC,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,KAAK,cAAc,CAAC,CAAC;YACjE,KAAK,CAAC,QAAQ,CAAC,WAAW,GAAG,IAAA,gBAAK,EAAC,QAAQ,CAAC,CAAC;YAC7C,KAAK,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;gBAC1C,IAAA,oBAAS,EAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YAC/C,CAAC;YACD,IAAI,EAAE,CAAC,KAAK,YAAY,CAAC,MAAM,EAAE,CAAC;gBACjC,GAAG,EAAE,CAAC;YACP,CAAC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tSchemaAndPolicy,\n\tIForestSubscription,\n\tUpPath,\n\tNodeIndex,\n\tFieldKey,\n\tDetachedField,\n\tTreeFieldStoredSchema,\n} from \"../core/index.js\";\nimport {\n\ttype FlexTreeContext,\n\tgetSchemaAndPolicy,\n\ttype FlexTreeHydratedContextMinimal,\n\tFieldKinds,\n\ttype FlexibleFieldContent,\n\ttype FlexibleNodeContent,\n} from \"../feature-libraries/index.js\";\nimport {\n\tnormalizeFieldSchema,\n\ttype ImplicitAllowedTypes,\n\ttype ImplicitFieldSchema,\n} from \"./schemaTypes.js\";\nimport {\n\ttype InsertableContent,\n\tunhydratedFlexTreeFromInsertable,\n} from \"./unhydratedFlexTreeFromInsertable.js\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { brand } from \"../util/index.js\";\nimport { getKernel, type TreeNode, type UnhydratedFlexTreeNode } from \"./core/index.js\";\nimport { debugAssert, oob } from \"@fluidframework/core-utils/internal\";\nimport { inSchemaOrThrow, isFieldInSchema } from \"../feature-libraries/index.js\";\nimport { convertField } from \"./toStoredSchema.js\";\n\n/**\n * Prepare content from a user for insertion into a tree.\n * @remarks\n * This validates and converts the input, and if necessary invokes {@link prepareContentForHydration}.\n *\n * The next edit made to `destinationContext`'s forest must be the creation of a detached field containing this content,\n * (Triggering {@link ForestEvents.afterRootFieldCreated}) otherwise hydration will break.\n */\nexport function prepareForInsertion<TIn extends InsertableContent | undefined>(\n\tdata: TIn,\n\tschema: ImplicitFieldSchema,\n\tdestinationContext: FlexTreeContext,\n): TIn extends undefined ? undefined : FlexibleNodeContent {\n\treturn prepareForInsertionContextless(\n\t\tdata,\n\t\tschema,\n\t\tgetSchemaAndPolicy(destinationContext),\n\t\tdestinationContext.isHydrated() ? destinationContext : undefined,\n\t);\n}\n\n/**\n * {@link prepareForInsertion} but batched for array content.\n * @remarks\n * This is for inserting items into an array, not a inserting a {@link TreeArrayNode} (that would use {@link prepareForInsertion}).\n *\n * The next edits made to `destinationContext`'s forest must be the creation of a detached field.\n * One edit for each item in `data`, in order.\n *\n * @privateRemarks\n * This has to be done as a single operation for all items in data\n * (as opposed to mapping {@link prepareForInsertion} over the array)\n * due to how the eventing in prepareContentForHydration works.\n */\nexport function prepareArrayContentForInsertion(\n\tdata: readonly InsertableContent[],\n\tschema: ImplicitAllowedTypes,\n\tdestinationContext: FlexTreeContext,\n): FlexibleFieldContent {\n\tconst mapTrees: UnhydratedFlexTreeNode[] = data.map((item) =>\n\t\tunhydratedFlexTreeFromInsertable(item, schema),\n\t);\n\n\tconst fieldSchema = convertField(normalizeFieldSchema(schema));\n\n\tvalidateAndPrepare(\n\t\tgetSchemaAndPolicy(destinationContext),\n\t\tdestinationContext.isHydrated() ? destinationContext : undefined,\n\t\t{ kind: FieldKinds.sequence.identifier, types: fieldSchema.types },\n\t\tmapTrees,\n\t);\n\n\treturn mapTrees;\n}\n\n/**\n * Split out from {@link prepareForInsertion} as to allow use without a context.\n *\n * @param hydratedData - If specified, the `mapTrees` will be prepared for hydration into this context.\n * `undefined` when `mapTrees` are being inserted into an {@link Unhydrated} tree.\n *\n * @remarks\n * Adding this entry point is a workaround for initialize not currently having a context.\n */\nexport function prepareForInsertionContextless<TIn extends InsertableContent | undefined>(\n\tdata: TIn,\n\tschema: ImplicitFieldSchema,\n\tschemaAndPolicy: SchemaAndPolicy,\n\thydratedData: FlexTreeHydratedContextMinimal | undefined,\n): TIn extends undefined ? undefined : FlexibleNodeContent {\n\tconst mapTree = unhydratedFlexTreeFromInsertable(data, schema);\n\n\tconst contentArray = mapTree === undefined ? [] : [mapTree];\n\tconst fieldSchema = convertField(normalizeFieldSchema(schema));\n\tvalidateAndPrepare(schemaAndPolicy, hydratedData, fieldSchema, contentArray);\n\n\treturn mapTree;\n}\n\n/**\n * If hydrating, do a final validation against the schema and prepare the content for hydration.\n *\n * @param hydratedData - If specified, the `mapTrees` will be prepared for hydration into this context.\n * `undefined` when `mapTrees` are being inserted into an {@link Unhydrated} tree.\n */\nfunction validateAndPrepare(\n\tschemaAndPolicy: SchemaAndPolicy,\n\thydratedData: FlexTreeHydratedContextMinimal | undefined,\n\tfieldSchema: TreeFieldStoredSchema,\n\tmapTrees: readonly UnhydratedFlexTreeNode[],\n): void {\n\tif (hydratedData !== undefined) {\n\t\t// Run `prepareContentForHydration` before walking the tree in `isFieldInSchema`.\n\t\t// This ensures that when `isFieldInSchema` requests identifiers (or any other contextual defaults),\n\t\t// they were already creating used the more specific context we have access to from `hydratedData`.\n\t\tprepareContentForHydration(mapTrees, hydratedData.checkout.forest, hydratedData);\n\t\tif (schemaAndPolicy.policy.validateSchema === true) {\n\t\t\tconst maybeError = isFieldInSchema(mapTrees, fieldSchema, schemaAndPolicy);\n\t\t\tinSchemaOrThrow(maybeError);\n\t\t}\n\t}\n}\n\n/**\n * An {@link UpPath} that is just index zero in a {@link DetachedField} which can be modified at a later time.\n */\ninterface Root extends UpPath {\n\treadonly parent: undefined;\n\tparentField: DetachedField & FieldKey;\n\treadonly parentIndex: NodeIndex & 0;\n}\n\n/**\n * The path from the included node to the root of the content tree it was inserted as part of.\n */\ninterface RelativeNodePath {\n\treadonly path: UpPath;\n\treadonly node: TreeNode;\n}\n\n/**\n * {@link RelativeNodePath}s for every {@link TreeNode} in the content tree inserted as an atomic operation.\n */\ninterface LocatedNodesBatch {\n\t/**\n\t * UpPath shared by all {@link RelativeNodePath}s in this batch corresponding to the root of the inserted content.\n\t */\n\treadonly rootPath: Root;\n\treadonly paths: RelativeNodePath[];\n}\n\n/**\n * A dummy key value used in {@link LocatedNodesBatch.rootPath} which will be replaced with the actual detached field once it is known.\n */\nconst placeholderKey: DetachedField & FieldKey = brand(\"placeholder\" as const);\n\n/**\n * Records any {@link TreeNode}s in the given `content` tree and does the necessary bookkeeping to ensure they are synchronized with subsequent reads of the tree.\n * Additionally populates any {@link UnhydratedFlexTreeField.pendingDefault}s using the provided `context`.\n *\n * @remarks If the content tree contains has any associated {@link TreeNode}s, this function must be called just prior to inserting the content into the tree.\n * Specifically, no other content may be inserted into the tree between the invocation of this function and the insertion of `content`.\n * The insertion of `content` must occur or else this function will cause memory leaks.\n *\n * Exported for testing purposes: otherwise should not be used outside this module.\n * @param content - the content subsequence to be inserted, of which might deeply contain {@link TreeNode}s which need to be hydrated.\n * @param forest - the forest the content is being inserted into.\n */\nexport function prepareContentForHydration(\n\tcontent: readonly UnhydratedFlexTreeNode[],\n\tforest: IForestSubscription,\n\tcontext: FlexTreeHydratedContextMinimal,\n): void {\n\tconst batches: LocatedNodesBatch[] = [];\n\tfor (const item of content) {\n\t\tconst batch: LocatedNodesBatch = {\n\t\t\trootPath: {\n\t\t\t\tparent: undefined,\n\t\t\t\tparentField: placeholderKey,\n\t\t\t\tparentIndex: 0,\n\t\t\t},\n\t\t\tpaths: [],\n\t\t};\n\t\tbatches.push(batch);\n\t\twalkMapTree(\n\t\t\titem,\n\t\t\tbatch.rootPath,\n\t\t\t(p, node) => {\n\t\t\t\tbatch.paths.push({ path: p, node });\n\t\t\t},\n\t\t\tcontext,\n\t\t);\n\t}\n\n\tscheduleHydration(batches, forest);\n}\n\nfunction walkMapTree(\n\troot: UnhydratedFlexTreeNode,\n\tpath: UpPath,\n\tonVisitTreeNode: (path: UpPath, treeNode: TreeNode) => void,\n\tcontext: FlexTreeHydratedContextMinimal,\n): void {\n\tif (root.parentField.parent.parent !== undefined) {\n\t\tthrow new UsageError(\n\t\t\t\"Attempted to insert a node which is already under a parent. If this is desired, remove the node from its parent before inserting it elsewhere.\",\n\t\t);\n\t}\n\n\ttype Next = [path: UpPath, tree: UnhydratedFlexTreeNode];\n\tconst nexts: Next[] = [];\n\tfor (let next: Next | undefined = [path, root]; next !== undefined; next = nexts.pop()) {\n\t\tconst [p, node] = next;\n\t\tif (node !== undefined) {\n\t\t\tconst treeNode = node.treeNode;\n\t\t\tif (treeNode !== undefined) {\n\t\t\t\tonVisitTreeNode(p, treeNode);\n\t\t\t}\n\t\t}\n\n\t\tfor (const [key, field] of node.allFieldsLazy) {\n\t\t\tfield.fillPendingDefaults(context);\n\t\t\tfor (const [i, child] of field.children.entries()) {\n\t\t\t\tnexts.push([\n\t\t\t\t\t{\n\t\t\t\t\t\tparent: p,\n\t\t\t\t\t\tparentField: key,\n\t\t\t\t\t\tparentIndex: i,\n\t\t\t\t\t},\n\t\t\t\t\tchild,\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Register events which will hydrate batches of nodes when they are inserted.\n * The next edits to forest must be their insertions, in order, or data corruption can occur.\n * @param locatedNodes - the nodes to register with the forest.\n * Each index in this array expects its content to be added and produce its own `afterRootFieldCreated` event.\n * If array subsequence insertion is optimized to produce a single event, this will not work correctly as is, and will need to be modified to take in a single {@link LocatedNodesBatch}.\n */\nfunction scheduleHydration(\n\tlocatedNodes: readonly LocatedNodesBatch[],\n\tforest: IForestSubscription,\n): void {\n\t// Only subscribe to the event if there is at least one TreeNode tree to hydrate - this is not the case when inserting an empty array [].\n\tif (locatedNodes.length > 0) {\n\t\t// Creating a new array emits one event per element in the array, so listen to the event once for each element\n\t\tlet i = 0;\n\t\tconst off = forest.events.on(\"afterRootFieldCreated\", (fieldKey) => {\n\t\t\t// Indexing is safe here because of the length check above. This assumes the array has not been modified which should be the case.\n\t\t\tconst batch = locatedNodes[i] ?? oob();\n\t\t\tdebugAssert(() => batch.rootPath.parentField === placeholderKey);\n\t\t\tbatch.rootPath.parentField = brand(fieldKey);\n\t\t\tfor (const { path, node } of batch.paths) {\n\t\t\t\tgetKernel(node).hydrate(forest.anchors, path);\n\t\t\t}\n\t\t\tif (++i === locatedNodes.length) {\n\t\t\t\toff();\n\t\t\t}\n\t\t});\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"prepareForInsertion.js","sourceRoot":"","sources":["../../src/simple-tree/prepareForInsertion.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH,4DAOuC;AACvC,qDAI0B;AAC1B,+FAG+C;AAC/C,uEAAsE;AACtE,+CAAyC;AACzC,8CAAwF;AACxF,kEAAuE;AACvE,4DAAiF;AACjF,2DAAmD;AAEnD;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CAClC,IAAS,EACT,MAA2B,EAC3B,kBAAmC;IAEnC,OAAO,8BAA8B,CACpC,IAAI,EACJ,MAAM,EACN,IAAA,6BAAkB,EAAC,kBAAkB,CAAC,EACtC,kBAAkB,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC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AAE,CAAC;QAC7B,8GAA8G;QAC9G,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,EAAE;YAClE,kIAAkI;YAClI,MAAM,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC,IAAI,IAAA,cAAG,GAAE,CAAC;YACvC,IAAA,sBAAW,EAAC,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,KAAK,cAAc,CAAC,CAAC;YACjE,KAAK,CAAC,QAAQ,CAAC,WAAW,GAAG,IAAA,gBAAK,EAAC,QAAQ,CAAC,CAAC;YAC7C,KAAK,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;gBAC1C,IAAA,oBAAS,EAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YAC/C,CAAC;YACD,IAAI,EAAE,CAAC,KAAK,YAAY,CAAC,MAAM,EAAE,CAAC;gBACjC,GAAG,EAAE,CAAC;YACP,CAAC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tSchemaAndPolicy,\n\tIForestSubscription,\n\tUpPath,\n\tNodeIndex,\n\tFieldKey,\n\tDetachedField,\n\tTreeFieldStoredSchema,\n} from \"../core/index.js\";\nimport {\n\ttype FlexTreeContext,\n\tgetSchemaAndPolicy,\n\ttype FlexTreeHydratedContextMinimal,\n\tFieldKinds,\n\ttype FlexibleFieldContent,\n\ttype FlexibleNodeContent,\n} from \"../feature-libraries/index.js\";\nimport {\n\tnormalizeFieldSchema,\n\ttype ImplicitAllowedTypes,\n\ttype ImplicitFieldSchema,\n} from \"./schemaTypes.js\";\nimport {\n\ttype InsertableContent,\n\tunhydratedFlexTreeFromInsertable,\n} from \"./unhydratedFlexTreeFromInsertable.js\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { brand } from \"../util/index.js\";\nimport { getKernel, type TreeNode, type UnhydratedFlexTreeNode } from \"./core/index.js\";\nimport { debugAssert, oob } from \"@fluidframework/core-utils/internal\";\nimport { inSchemaOrThrow, isFieldInSchema } from \"../feature-libraries/index.js\";\nimport { convertField } from \"./toStoredSchema.js\";\n\n/**\n * Prepare content from a user for insertion into a tree.\n * @remarks\n * This validates and converts the input, and if necessary invokes {@link prepareContentForHydration}.\n *\n * The next edit made to `destinationContext`'s forest must be the creation of a detached field containing this content,\n * (Triggering {@link ForestEvents.afterRootFieldCreated}) otherwise hydration will break.\n */\nexport function prepareForInsertion<TIn extends InsertableContent | undefined>(\n\tdata: TIn,\n\tschema: ImplicitFieldSchema,\n\tdestinationContext: FlexTreeContext,\n): TIn extends undefined ? undefined : FlexibleNodeContent {\n\treturn prepareForInsertionContextless(\n\t\tdata,\n\t\tschema,\n\t\tgetSchemaAndPolicy(destinationContext),\n\t\tdestinationContext.isHydrated() ? destinationContext : undefined,\n\t);\n}\n\n/**\n * {@link prepareForInsertion} but batched for array content.\n * @remarks\n * This is for inserting items into an array, not a inserting a {@link TreeArrayNode} (that would use {@link prepareForInsertion}).\n *\n * The next edits made to `destinationContext`'s forest must be the creation of a detached field.\n * One edit for each item in `data`, in order.\n *\n * @privateRemarks\n * This has to be done as a single operation for all items in data\n * (as opposed to mapping {@link prepareForInsertion} over the array)\n * due to how the eventing in prepareContentForHydration works.\n */\nexport function prepareArrayContentForInsertion(\n\tdata: readonly InsertableContent[],\n\tschema: ImplicitAllowedTypes,\n\tdestinationContext: FlexTreeContext,\n): FlexibleFieldContent {\n\tconst mapTrees: UnhydratedFlexTreeNode[] = data.map((item) =>\n\t\tunhydratedFlexTreeFromInsertable(item, schema),\n\t);\n\n\tconst fieldSchema = convertField(normalizeFieldSchema(schema));\n\n\tvalidateAndPrepare(\n\t\tgetSchemaAndPolicy(destinationContext),\n\t\tdestinationContext.isHydrated() ? destinationContext : undefined,\n\t\t{\n\t\t\tkind: FieldKinds.sequence.identifier,\n\t\t\ttypes: fieldSchema.types,\n\t\t\tpersistedMetadata: undefined,\n\t\t},\n\t\tmapTrees,\n\t);\n\n\treturn mapTrees;\n}\n\n/**\n * Split out from {@link prepareForInsertion} as to allow use without a context.\n *\n * @param hydratedData - If specified, the `mapTrees` will be prepared for hydration into this context.\n * `undefined` when `mapTrees` are being inserted into an {@link Unhydrated} tree.\n *\n * @remarks\n * Adding this entry point is a workaround for initialize not currently having a context.\n */\nexport function prepareForInsertionContextless<TIn extends InsertableContent | undefined>(\n\tdata: TIn,\n\tschema: ImplicitFieldSchema,\n\tschemaAndPolicy: SchemaAndPolicy,\n\thydratedData: FlexTreeHydratedContextMinimal | undefined,\n): TIn extends undefined ? undefined : FlexibleNodeContent {\n\tconst mapTree = unhydratedFlexTreeFromInsertable(data, schema);\n\n\tconst contentArray = mapTree === undefined ? [] : [mapTree];\n\tconst fieldSchema = convertField(normalizeFieldSchema(schema));\n\tvalidateAndPrepare(schemaAndPolicy, hydratedData, fieldSchema, contentArray);\n\n\treturn mapTree;\n}\n\n/**\n * If hydrating, do a final validation against the schema and prepare the content for hydration.\n *\n * @param hydratedData - If specified, the `mapTrees` will be prepared for hydration into this context.\n * `undefined` when `mapTrees` are being inserted into an {@link Unhydrated} tree.\n */\nfunction validateAndPrepare(\n\tschemaAndPolicy: SchemaAndPolicy,\n\thydratedData: FlexTreeHydratedContextMinimal | undefined,\n\tfieldSchema: TreeFieldStoredSchema,\n\tmapTrees: readonly UnhydratedFlexTreeNode[],\n): void {\n\tif (hydratedData !== undefined) {\n\t\t// Run `prepareContentForHydration` before walking the tree in `isFieldInSchema`.\n\t\t// This ensures that when `isFieldInSchema` requests identifiers (or any other contextual defaults),\n\t\t// they were already creating used the more specific context we have access to from `hydratedData`.\n\t\tprepareContentForHydration(mapTrees, hydratedData.checkout.forest, hydratedData);\n\t\tif (schemaAndPolicy.policy.validateSchema === true) {\n\t\t\tconst maybeError = isFieldInSchema(mapTrees, fieldSchema, schemaAndPolicy);\n\t\t\tinSchemaOrThrow(maybeError);\n\t\t}\n\t}\n}\n\n/**\n * An {@link UpPath} that is just index zero in a {@link DetachedField} which can be modified at a later time.\n */\ninterface Root extends UpPath {\n\treadonly parent: undefined;\n\tparentField: DetachedField & FieldKey;\n\treadonly parentIndex: NodeIndex & 0;\n}\n\n/**\n * The path from the included node to the root of the content tree it was inserted as part of.\n */\ninterface RelativeNodePath {\n\treadonly path: UpPath;\n\treadonly node: TreeNode;\n}\n\n/**\n * {@link RelativeNodePath}s for every {@link TreeNode} in the content tree inserted as an atomic operation.\n */\ninterface LocatedNodesBatch {\n\t/**\n\t * UpPath shared by all {@link RelativeNodePath}s in this batch corresponding to the root of the inserted content.\n\t */\n\treadonly rootPath: Root;\n\treadonly paths: RelativeNodePath[];\n}\n\n/**\n * A dummy key value used in {@link LocatedNodesBatch.rootPath} which will be replaced with the actual detached field once it is known.\n */\nconst placeholderKey: DetachedField & FieldKey = brand(\"placeholder\" as const);\n\n/**\n * Records any {@link TreeNode}s in the given `content` tree and does the necessary bookkeeping to ensure they are synchronized with subsequent reads of the tree.\n * Additionally populates any {@link UnhydratedFlexTreeField.pendingDefault}s using the provided `context`.\n *\n * @remarks If the content tree contains has any associated {@link TreeNode}s, this function must be called just prior to inserting the content into the tree.\n * Specifically, no other content may be inserted into the tree between the invocation of this function and the insertion of `content`.\n * The insertion of `content` must occur or else this function will cause memory leaks.\n *\n * Exported for testing purposes: otherwise should not be used outside this module.\n * @param content - the content subsequence to be inserted, of which might deeply contain {@link TreeNode}s which need to be hydrated.\n * @param forest - the forest the content is being inserted into.\n */\nexport function prepareContentForHydration(\n\tcontent: readonly UnhydratedFlexTreeNode[],\n\tforest: IForestSubscription,\n\tcontext: FlexTreeHydratedContextMinimal,\n): void {\n\tconst batches: LocatedNodesBatch[] = [];\n\tfor (const item of content) {\n\t\tconst batch: LocatedNodesBatch = {\n\t\t\trootPath: {\n\t\t\t\tparent: undefined,\n\t\t\t\tparentField: placeholderKey,\n\t\t\t\tparentIndex: 0,\n\t\t\t},\n\t\t\tpaths: [],\n\t\t};\n\t\tbatches.push(batch);\n\t\twalkMapTree(\n\t\t\titem,\n\t\t\tbatch.rootPath,\n\t\t\t(p, node) => {\n\t\t\t\tbatch.paths.push({ path: p, node });\n\t\t\t},\n\t\t\tcontext,\n\t\t);\n\t}\n\n\tscheduleHydration(batches, forest);\n}\n\nfunction walkMapTree(\n\troot: UnhydratedFlexTreeNode,\n\tpath: UpPath,\n\tonVisitTreeNode: (path: UpPath, treeNode: TreeNode) => void,\n\tcontext: FlexTreeHydratedContextMinimal,\n): void {\n\tif (root.parentField.parent.parent !== undefined) {\n\t\tthrow new UsageError(\n\t\t\t\"Attempted to insert a node which is already under a parent. If this is desired, remove the node from its parent before inserting it elsewhere.\",\n\t\t);\n\t}\n\n\ttype Next = [path: UpPath, tree: UnhydratedFlexTreeNode];\n\tconst nexts: Next[] = [];\n\tfor (let next: Next | undefined = [path, root]; next !== undefined; next = nexts.pop()) {\n\t\tconst [p, node] = next;\n\t\tif (node !== undefined) {\n\t\t\tconst treeNode = node.treeNode;\n\t\t\tif (treeNode !== undefined) {\n\t\t\t\tonVisitTreeNode(p, treeNode);\n\t\t\t}\n\t\t}\n\n\t\tfor (const [key, field] of node.allFieldsLazy) {\n\t\t\tfield.fillPendingDefaults(context);\n\t\t\tfor (const [i, child] of field.children.entries()) {\n\t\t\t\tnexts.push([\n\t\t\t\t\t{\n\t\t\t\t\t\tparent: p,\n\t\t\t\t\t\tparentField: key,\n\t\t\t\t\t\tparentIndex: i,\n\t\t\t\t\t},\n\t\t\t\t\tchild,\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Register events which will hydrate batches of nodes when they are inserted.\n * The next edits to forest must be their insertions, in order, or data corruption can occur.\n * @param locatedNodes - the nodes to register with the forest.\n * Each index in this array expects its content to be added and produce its own `afterRootFieldCreated` event.\n * If array subsequence insertion is optimized to produce a single event, this will not work correctly as is, and will need to be modified to take in a single {@link LocatedNodesBatch}.\n */\nfunction scheduleHydration(\n\tlocatedNodes: readonly LocatedNodesBatch[],\n\tforest: IForestSubscription,\n): void {\n\t// Only subscribe to the event if there is at least one TreeNode tree to hydrate - this is not the case when inserting an empty array [].\n\tif (locatedNodes.length > 0) {\n\t\t// Creating a new array emits one event per element in the array, so listen to the event once for each element\n\t\tlet i = 0;\n\t\tconst off = forest.events.on(\"afterRootFieldCreated\", (fieldKey) => {\n\t\t\t// Indexing is safe here because of the length check above. This assumes the array has not been modified which should be the case.\n\t\t\tconst batch = locatedNodes[i] ?? oob();\n\t\t\tdebugAssert(() => batch.rootPath.parentField === placeholderKey);\n\t\t\tbatch.rootPath.parentField = brand(fieldKey);\n\t\t\tfor (const { path, node } of batch.paths) {\n\t\t\t\tgetKernel(node).hydrate(forest.anchors, path);\n\t\t\t}\n\t\t\tif (++i === locatedNodes.length) {\n\t\t\t\toff();\n\t\t\t}\n\t\t});\n\t}\n}\n"]}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import type { ErasedType, IFluidHandle } from "@fluidframework/core-interfaces";
|
|
6
6
|
import type { FieldKey } from "../core/index.js";
|
|
7
7
|
import type { FlexTreeHydratedContextMinimal } from "../feature-libraries/index.js";
|
|
8
|
-
import { type MakeNominal, type UnionToIntersection, type RestrictiveStringRecord, type IsUnion } from "../util/index.js";
|
|
9
|
-
import type { Unhydrated, NodeKind, TreeNodeSchema, TreeNodeSchemaClass, TreeNode, TreeNodeSchemaCore, TreeNodeSchemaNonClass, UnhydratedFlexTreeNode } from "./core/index.js";
|
|
8
|
+
import { type MakeNominal, type UnionToIntersection, type RestrictiveStringRecord, type IsUnion, type JsonCompatibleReadOnlyObject } from "../util/index.js";
|
|
9
|
+
import type { Unhydrated, NodeKind, TreeNodeSchema, TreeNodeSchemaClass, TreeNode, TreeNodeSchemaCore, TreeNodeSchemaNonClass, UnhydratedFlexTreeNode, AnnotatedAllowedType, NormalizedAnnotatedAllowedTypes } from "./core/index.js";
|
|
10
10
|
import { type FlexListToUnion, type LazyItem } from "./flexList.js";
|
|
11
11
|
import type { SimpleFieldSchema, SimpleObjectFieldSchema } from "./simpleSchema.js";
|
|
12
12
|
import type { InsertableContent } from "./unhydratedFlexTreeFromInsertable.js";
|
|
@@ -53,10 +53,6 @@ export interface AnnotatedAllowedTypes {
|
|
|
53
53
|
*/
|
|
54
54
|
readonly types: readonly (AnnotatedAllowedType | LazyItem<TreeNodeSchema>)[];
|
|
55
55
|
}
|
|
56
|
-
/**
|
|
57
|
-
* Checks if the input is an {@link AnnotatedAllowedTypes}.
|
|
58
|
-
*/
|
|
59
|
-
export declare function isAnnotatedAllowedTypes(allowedTypes: ImplicitAnnotatedAllowedTypes): allowedTypes is AnnotatedAllowedTypes;
|
|
60
56
|
/**
|
|
61
57
|
* Annotations that apply to a set of allowed types.
|
|
62
58
|
* @remarks
|
|
@@ -69,20 +65,6 @@ export interface AllowedTypesMetadata {
|
|
|
69
65
|
*/
|
|
70
66
|
readonly custom?: unknown;
|
|
71
67
|
}
|
|
72
|
-
/**
|
|
73
|
-
* Stores annotations for an individual allowed type.
|
|
74
|
-
* @alpha
|
|
75
|
-
*/
|
|
76
|
-
export interface AnnotatedAllowedType<T extends TreeNodeSchema = TreeNodeSchema> {
|
|
77
|
-
/**
|
|
78
|
-
* Annotations for the allowed type.
|
|
79
|
-
*/
|
|
80
|
-
readonly metadata: AllowedTypeMetadata;
|
|
81
|
-
/**
|
|
82
|
-
* The allowed type the annotations apply to in a particular schema.
|
|
83
|
-
*/
|
|
84
|
-
readonly type: LazyItem<T>;
|
|
85
|
-
}
|
|
86
68
|
/**
|
|
87
69
|
* Checks if the given allowed type is annotated with {@link AllowedTypeMetadata}.
|
|
88
70
|
*/
|
|
@@ -136,12 +118,12 @@ export declare enum FieldKind {
|
|
|
136
118
|
* If an explicit stored key was specified in the schema, it will be used.
|
|
137
119
|
* Otherwise, the stored key is the same as the property key.
|
|
138
120
|
*/
|
|
139
|
-
export declare function getStoredKey(propertyKey: string, fieldSchema:
|
|
121
|
+
export declare function getStoredKey(propertyKey: string, fieldSchema: ImplicitAnnotatedFieldSchema): FieldKey;
|
|
140
122
|
/**
|
|
141
123
|
* Gets the {@link FieldProps.key | stored key} specified by the schema, if one was explicitly specified.
|
|
142
124
|
* Otherwise, returns undefined.
|
|
143
125
|
*/
|
|
144
|
-
export declare function getExplicitStoredKey(fieldSchema:
|
|
126
|
+
export declare function getExplicitStoredKey(fieldSchema: ImplicitAnnotatedFieldSchema): string | undefined;
|
|
145
127
|
/**
|
|
146
128
|
* Additional information to provide to a {@link FieldSchema}.
|
|
147
129
|
*
|
|
@@ -218,7 +200,21 @@ export interface FieldProps<TCustomMetadata = unknown> {
|
|
|
218
200
|
readonly metadata?: FieldSchemaMetadata<TCustomMetadata>;
|
|
219
201
|
}
|
|
220
202
|
/**
|
|
221
|
-
*
|
|
203
|
+
* {@link FieldProps} extended with additional `alpha` options.
|
|
204
|
+
*
|
|
205
|
+
* @typeParam TCustomMetadata - Custom metadata properties to associate with the field.
|
|
206
|
+
* See {@link FieldSchemaMetadata.custom}.
|
|
207
|
+
*
|
|
208
|
+
* @alpha @input
|
|
209
|
+
*/
|
|
210
|
+
export interface FieldPropsAlpha<TCustomMetadata = unknown> extends FieldProps<TCustomMetadata> {
|
|
211
|
+
/**
|
|
212
|
+
* The persisted metadata for this schema element.
|
|
213
|
+
*/
|
|
214
|
+
readonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* A {@link FieldProvider} which requires additional context in order to produce its content
|
|
222
218
|
*/
|
|
223
219
|
export type ContextualFieldProvider = (context: FlexTreeHydratedContextMinimal | "UseGlobalContext") => UnhydratedFlexTreeNode[];
|
|
224
220
|
/**
|
|
@@ -267,6 +263,20 @@ export interface FieldSchemaMetadata<TCustomMetadata = unknown> {
|
|
|
267
263
|
*/
|
|
268
264
|
readonly description?: string | undefined;
|
|
269
265
|
}
|
|
266
|
+
/**
|
|
267
|
+
* Metadata associated with a {@link FieldSchema}. Includes fields used by alpha features.
|
|
268
|
+
*
|
|
269
|
+
* @remarks Specified via {@link FieldProps.metadata}.
|
|
270
|
+
*
|
|
271
|
+
* @sealed
|
|
272
|
+
* @alpha
|
|
273
|
+
*/
|
|
274
|
+
export interface FieldSchemaMetadataAlpha<TCustomMetadata = unknown> extends FieldSchemaMetadata<TCustomMetadata> {
|
|
275
|
+
/**
|
|
276
|
+
* The persisted metadata for this schema element.
|
|
277
|
+
*/
|
|
278
|
+
readonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;
|
|
279
|
+
}
|
|
270
280
|
/**
|
|
271
281
|
* Package internal construction API.
|
|
272
282
|
*/
|
|
@@ -355,17 +365,22 @@ export declare class FieldSchemaAlpha<Kind extends FieldKind = FieldKind, Types
|
|
|
355
365
|
readonly annotatedAllowedTypes: ImplicitAnnotatedAllowedTypes;
|
|
356
366
|
private readonly lazyIdentifiers;
|
|
357
367
|
private readonly lazyAnnotatedTypes;
|
|
368
|
+
private readonly propsAlpha;
|
|
358
369
|
/**
|
|
359
370
|
* Metadata on the types of tree nodes allowed on this field.
|
|
360
371
|
*/
|
|
361
372
|
readonly allowedTypesMetadata: AllowedTypesMetadata;
|
|
362
|
-
|
|
373
|
+
/**
|
|
374
|
+
* Persisted metadata for this field schema.
|
|
375
|
+
*/
|
|
376
|
+
get persistedMetadata(): JsonCompatibleReadOnlyObject | undefined;
|
|
377
|
+
protected constructor(kind: Kind, types: Types, annotatedAllowedTypes: ImplicitAnnotatedAllowedTypes, props?: FieldPropsAlpha<TCustomMetadata>);
|
|
363
378
|
get allowedTypesIdentifiers(): ReadonlySet<string>;
|
|
364
379
|
/**
|
|
365
380
|
* What types of tree nodes are allowed in this field and their annotations.
|
|
366
381
|
* @remarks Counterpart to {@link FieldSchemaAlpha.annotatedAllowedTypes}, with any lazy definitions evaluated.
|
|
367
382
|
*/
|
|
368
|
-
get
|
|
383
|
+
get annotatedAllowedTypesNormalized(): NormalizedAnnotatedAllowedTypes;
|
|
369
384
|
}
|
|
370
385
|
/**
|
|
371
386
|
* {@link FieldSchemaAlpha} including {@link SimpleObjectFieldSchema}.
|
|
@@ -393,7 +408,15 @@ export declare function normalizeAllowedTypes(types: ImplicitAllowedTypes): Read
|
|
|
393
408
|
/**
|
|
394
409
|
* Normalizes an allowed type to an {@link AnnotatedAllowedType}, by adding empty annotations if they don't already exist.
|
|
395
410
|
*/
|
|
396
|
-
export declare function normalizeToAnnotatedAllowedType<T extends TreeNodeSchema>(type: T | AnnotatedAllowedType<T>): AnnotatedAllowedType<T
|
|
411
|
+
export declare function normalizeToAnnotatedAllowedType<T extends TreeNodeSchema>(type: T | AnnotatedAllowedType<T> | AnnotatedAllowedType<LazyItem<T>>): AnnotatedAllowedType<T> | AnnotatedAllowedType<LazyItem<T>>;
|
|
412
|
+
/**
|
|
413
|
+
* Normalizes a {@link ImplicitAnnotatedAllowedTypes} to a set of {@link AnnotatedAllowedSchema}s, by eagerly evaluating any
|
|
414
|
+
* lazy schema declarations and adding empty metadata if it doesn't already exist.
|
|
415
|
+
*
|
|
416
|
+
* @remarks Note: this must only be called after all required schemas have been declared, otherwise evaluation of
|
|
417
|
+
* recursive schemas may fail.
|
|
418
|
+
*/
|
|
419
|
+
export declare function normalizeAnnotatedAllowedTypes(types: ImplicitAnnotatedAllowedTypes): NormalizedAnnotatedAllowedTypes;
|
|
397
420
|
/**
|
|
398
421
|
* Converts an {@link ImplicitAnnotatedAllowedTypes} to an {@link ImplicitAllowedTypes}s, by removing
|
|
399
422
|
* any annotations.
|
|
@@ -405,10 +428,6 @@ export declare function unannotateImplicitAllowedTypes<Types extends ImplicitAnn
|
|
|
405
428
|
* Removes annotations from a schema record.
|
|
406
429
|
*/
|
|
407
430
|
export declare function unannotateSchemaRecord<Schema extends RestrictiveStringRecord<ImplicitAnnotatedFieldSchema>>(schemaRecord: Schema): UnannotateSchemaRecord<Schema>;
|
|
408
|
-
/**
|
|
409
|
-
* Converts annotated allowed types into a mapping between the type schema and their associated annotations.
|
|
410
|
-
*/
|
|
411
|
-
export declare function extractAnnotationsFromAllowedTypes(types: ImplicitAnnotatedAllowedTypes): ReadonlyMap<TreeNodeSchema, AllowedTypeMetadata>;
|
|
412
431
|
/**
|
|
413
432
|
* Returns true if the given {@link ImplicitFieldSchema} are equivalent, otherwise false.
|
|
414
433
|
* @remarks Two ImplicitFieldSchema are considered equivalent if all of the following are true:
|
|
@@ -796,6 +815,20 @@ export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
|
|
|
796
815
|
*/
|
|
797
816
|
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
798
817
|
}
|
|
818
|
+
/**
|
|
819
|
+
* Additional information to provide to Node Schema creation. Includes fields for alpha features.
|
|
820
|
+
*
|
|
821
|
+
* @typeParam TCustomMetadata - Custom metadata properties to associate with the Node Schema.
|
|
822
|
+
* See {@link NodeSchemaMetadata.custom}.
|
|
823
|
+
*
|
|
824
|
+
* @alpha
|
|
825
|
+
*/
|
|
826
|
+
export interface NodeSchemaOptionsAlpha<out TCustomMetadata = unknown> extends NodeSchemaOptions<TCustomMetadata> {
|
|
827
|
+
/**
|
|
828
|
+
* The persisted metadata for this schema element.
|
|
829
|
+
*/
|
|
830
|
+
readonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;
|
|
831
|
+
}
|
|
799
832
|
/**
|
|
800
833
|
* Metadata associated with a Node Schema.
|
|
801
834
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaTypes.d.ts","sourceRoot":"","sources":["../../src/simple-tree/schemaTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAIhF,OAAO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