@fluidframework/tree 2.23.0 → 2.31.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 +1636 -1466
- package/api-extractor/api-extractor.current.json +0 -3
- package/api-report/tree.alpha.api.md +261 -100
- package/api-report/tree.beta.api.md +86 -61
- package/api-report/tree.legacy.alpha.api.md +86 -61
- package/api-report/tree.legacy.public.api.md +86 -61
- package/api-report/tree.public.api.md +86 -61
- package/dist/alpha.d.ts +32 -1
- package/dist/beta.d.ts +5 -1
- package/dist/codec/codec.d.ts +1 -1
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +3 -4
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/discriminatedUnions.d.ts.map +1 -1
- package/dist/codec/discriminatedUnions.js +1 -1
- package/dist/codec/discriminatedUnions.js.map +1 -1
- package/dist/core/forest/editableForest.d.ts +1 -14
- package/dist/core/forest/editableForest.d.ts.map +1 -1
- package/dist/core/forest/editableForest.js +1 -28
- package/dist/core/forest/editableForest.js.map +1 -1
- package/dist/core/forest/forest.d.ts +16 -3
- package/dist/core/forest/forest.d.ts.map +1 -1
- package/dist/core/forest/forest.js +4 -1
- package/dist/core/forest/forest.js.map +1 -1
- package/dist/core/forest/index.d.ts +1 -1
- package/dist/core/forest/index.d.ts.map +1 -1
- package/dist/core/forest/index.js +1 -2
- package/dist/core/forest/index.js.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/utils.js +1 -1
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +4 -1
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +8 -4
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts +8 -3
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +16 -9
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/delta.d.ts +8 -23
- package/dist/core/tree/delta.d.ts.map +1 -1
- package/dist/core/tree/delta.js.map +1 -1
- package/dist/core/tree/deltaUtil.d.ts +3 -3
- package/dist/core/tree/deltaUtil.d.ts.map +1 -1
- package/dist/core/tree/deltaUtil.js +2 -2
- package/dist/core/tree/deltaUtil.js.map +1 -1
- package/dist/core/tree/index.d.ts +2 -2
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js +2 -1
- package/dist/core/tree/index.js.map +1 -1
- package/dist/core/tree/pathTree.d.ts +54 -1
- package/dist/core/tree/pathTree.d.ts.map +1 -1
- package/dist/core/tree/pathTree.js +8 -1
- package/dist/core/tree/pathTree.js.map +1 -1
- package/dist/core/tree/treeTextFormat.js +2 -2
- package/dist/core/tree/treeTextFormat.js.map +1 -1
- package/dist/core/tree/visitDelta.d.ts +7 -5
- package/dist/core/tree/visitDelta.d.ts.map +1 -1
- package/dist/core/tree/visitDelta.js +19 -9
- package/dist/core/tree/visitDelta.js.map +1 -1
- package/dist/core/tree/visitorUtils.d.ts +5 -23
- package/dist/core/tree/visitorUtils.d.ts.map +1 -1
- package/dist/core/tree/visitorUtils.js +8 -5
- package/dist/core/tree/visitorUtils.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js +9 -9
- package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +5 -3
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +12 -9
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +1 -0
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +8 -5
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +3 -3
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +2 -2
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -4
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js +2 -2
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/{schemaBasedEncoding.d.ts → schemaBasedEncode.d.ts} +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -0
- package/dist/feature-libraries/chunked-forest/codec/{schemaBasedEncoding.js → schemaBasedEncode.js} +4 -5
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/emptyChunk.js +15 -15
- package/dist/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +3 -2
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +7 -6
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +12 -14
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +5 -6
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +19 -19
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +1 -0
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js +3 -1
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +21 -0
- package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -0
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js +57 -0
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -0
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js +1 -2
- package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/deltaUtils.js +1 -1
- package/dist/feature-libraries/deltaUtils.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +5 -5
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +2 -2
- 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/lazyField.d.ts +5 -4
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +12 -9
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +4 -4
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +4 -5
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +2 -1
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +9 -7
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.js +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/dist/feature-libraries/initializeForest.d.ts +18 -0
- package/dist/feature-libraries/initializeForest.d.ts.map +1 -0
- package/dist/feature-libraries/initializeForest.js +35 -0
- package/dist/feature-libraries/initializeForest.js.map +1 -0
- package/dist/feature-libraries/modular-schema/comparison.js +4 -4
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.js +2 -3
- package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +4 -4
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +5 -5
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +13 -19
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/node-identifier/index.d.ts +8 -0
- package/dist/feature-libraries/node-identifier/index.d.ts.map +1 -0
- package/dist/feature-libraries/node-identifier/index.js +16 -0
- package/dist/feature-libraries/node-identifier/index.js.map +1 -0
- package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.d.ts +22 -0
- package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.d.ts.map +1 -0
- package/dist/feature-libraries/{node-key/mockNodeKeyManager.js → node-identifier/mockNodeIdentifierManager.js} +18 -18
- package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -0
- package/dist/feature-libraries/node-identifier/nodeIdentifier.d.ts +38 -0
- package/dist/feature-libraries/node-identifier/nodeIdentifier.d.ts.map +1 -0
- package/dist/feature-libraries/node-identifier/nodeIdentifier.js +26 -0
- package/dist/feature-libraries/node-identifier/nodeIdentifier.js.map +1 -0
- package/dist/feature-libraries/node-identifier/nodeIdentifierManager.d.ts +37 -0
- package/dist/feature-libraries/node-identifier/nodeIdentifierManager.d.ts.map +1 -0
- package/dist/feature-libraries/node-identifier/nodeIdentifierManager.js +48 -0
- package/dist/feature-libraries/node-identifier/nodeIdentifierManager.js.map +1 -0
- package/dist/feature-libraries/object-forest/objectForest.d.ts +2 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +7 -3
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +2 -1
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.d.ts +1 -1
- package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +16 -17
- package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.js +1 -1
- package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.js +1 -1
- package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.d.ts.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.js +5 -6
- package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/jsonDomainSchema.d.ts +15 -16
- package/dist/jsonDomainSchema.d.ts.map +1 -1
- package/dist/jsonDomainSchema.js +10 -5
- package/dist/jsonDomainSchema.js.map +1 -1
- package/dist/legacy.d.ts +5 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/public.d.ts +5 -1
- package/dist/serializableDomainSchema.d.ts +8 -14
- package/dist/serializableDomainSchema.d.ts.map +1 -1
- package/dist/shared-tree/checkoutFlexTreeView.d.ts +3 -3
- package/dist/shared-tree/checkoutFlexTreeView.d.ts.map +1 -1
- package/dist/shared-tree/checkoutFlexTreeView.js.map +1 -1
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +3 -18
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +1 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +2 -1
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +4 -3
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +4 -4
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +1 -0
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +27 -19
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +2 -2
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts +1 -2
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js +2 -2
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/treeApiAlpha.d.ts +9 -30
- package/dist/shared-tree/treeApiAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeApiAlpha.js +22 -34
- package/dist/shared-tree/treeApiAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +2 -2
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +4 -3
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +2 -2
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +37 -31
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/sharedTreeAttributes.d.ts +18 -0
- package/dist/sharedTreeAttributes.d.ts.map +1 -0
- package/dist/sharedTreeAttributes.js +25 -0
- package/dist/sharedTreeAttributes.js.map +1 -0
- package/dist/simple-tree/api/conciseTree.d.ts +8 -2
- package/dist/simple-tree/api/conciseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/conciseTree.js +10 -1
- package/dist/simple-tree/api/conciseTree.js.map +1 -1
- package/dist/simple-tree/api/create.d.ts +3 -3
- package/dist/simple-tree/api/create.d.ts.map +1 -1
- package/dist/simple-tree/api/create.js.map +1 -1
- package/dist/simple-tree/api/customTree.d.ts +42 -12
- package/dist/simple-tree/api/customTree.d.ts.map +1 -1
- package/dist/simple-tree/api/customTree.js +33 -5
- package/dist/simple-tree/api/customTree.js.map +1 -1
- package/dist/simple-tree/api/getJsonSchema.d.ts +10 -0
- package/dist/simple-tree/api/getJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/getJsonSchema.js +10 -0
- package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/getSimpleSchema.d.ts +13 -43
- package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/getSimpleSchema.js +13 -43
- package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +7 -6
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +8 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.js +2 -2
- package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +112 -67
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +80 -158
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +38 -23
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +26 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +40 -5
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts +19 -0
- package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -0
- package/dist/simple-tree/api/schemaFromSimple.js +71 -0
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -0
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +3 -2
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +7 -6
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.js +4 -3
- package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/dist/simple-tree/api/testRecursiveDomain.d.ts +10 -10
- package/dist/simple-tree/api/tree.d.ts +12 -6
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js +17 -8
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +5 -20
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +102 -36
- package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.js +0 -1
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.d.ts +16 -25
- package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +19 -14
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/api/view.d.ts.map +1 -1
- package/dist/simple-tree/api/view.js +16 -17
- package/dist/simple-tree/api/view.js.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +16 -3
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +70 -147
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts +5 -4
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js +13 -9
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/arrayNodeTypes.d.ts +46 -0
- package/dist/simple-tree/arrayNodeTypes.d.ts.map +1 -0
- package/dist/simple-tree/arrayNodeTypes.js +30 -0
- package/dist/simple-tree/arrayNodeTypes.js.map +1 -0
- package/dist/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
- package/dist/simple-tree/core/getOrCreateNode.js +1 -11
- package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +1 -2
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +2 -3
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts +12 -5
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +36 -20
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +14 -7
- package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts +2 -2
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +5 -5
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/flexList.d.ts +4 -5
- package/dist/simple-tree/flexList.d.ts.map +1 -1
- package/dist/simple-tree/flexList.js +1 -14
- package/dist/simple-tree/flexList.js.map +1 -1
- package/dist/simple-tree/index.d.ts +9 -2
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +15 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +22 -5
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +2 -0
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/mapNode.d.ts +3 -2
- package/dist/simple-tree/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/mapNode.js +5 -1
- package/dist/simple-tree/mapNode.js.map +1 -1
- package/dist/simple-tree/mapNodeTypes.d.ts +46 -0
- package/dist/simple-tree/mapNodeTypes.d.ts.map +1 -0
- package/dist/simple-tree/mapNodeTypes.js +30 -0
- package/dist/simple-tree/mapNodeTypes.js.map +1 -0
- package/dist/simple-tree/objectNode.d.ts +10 -3
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +12 -5
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/objectNodeTypes.d.ts +9 -5
- package/dist/simple-tree/objectNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/objectNodeTypes.js +3 -0
- package/dist/simple-tree/objectNodeTypes.js.map +1 -1
- package/dist/simple-tree/proxies.js +2 -1
- package/dist/simple-tree/proxies.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +81 -8
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js +94 -5
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/{api/simpleSchema.d.ts → simpleSchema.d.ts} +55 -28
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -0
- package/dist/simple-tree/simpleSchema.js.map +1 -0
- package/dist/simple-tree/toMapTree.d.ts +4 -4
- package/dist/simple-tree/toMapTree.d.ts.map +1 -1
- package/dist/simple-tree/toMapTree.js +3 -3
- package/dist/simple-tree/toMapTree.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +2 -6
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/treeNodeValid.d.ts +7 -1
- package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/treeNodeValid.js +17 -10
- package/dist/simple-tree/treeNodeValid.js.map +1 -1
- package/dist/treeFactory.d.ts +0 -12
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +5 -21
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/cloneWithReplacements.d.ts +21 -0
- package/dist/util/cloneWithReplacements.d.ts.map +1 -0
- package/dist/util/cloneWithReplacements.js +38 -0
- package/dist/util/cloneWithReplacements.js.map +1 -0
- package/dist/util/idAllocator.d.ts.map +1 -1
- package/dist/util/idAllocator.js +1 -2
- package/dist/util/idAllocator.js.map +1 -1
- package/dist/util/index.d.ts +2 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +4 -3
- package/dist/util/index.js.map +1 -1
- package/dist/util/referenceCounting.d.ts +18 -0
- package/dist/util/referenceCounting.d.ts.map +1 -1
- package/dist/util/referenceCounting.js.map +1 -1
- package/dist/util/typeCheck.d.ts +7 -0
- package/dist/util/typeCheck.d.ts.map +1 -1
- package/dist/util/typeCheck.js.map +1 -1
- package/dist/util/utils.d.ts +0 -1
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +1 -4
- package/dist/util/utils.js.map +1 -1
- package/lib/alpha.d.ts +32 -1
- package/lib/beta.d.ts +5 -1
- package/lib/codec/codec.d.ts +1 -1
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +1 -2
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/discriminatedUnions.d.ts.map +1 -1
- package/lib/codec/discriminatedUnions.js +2 -2
- package/lib/codec/discriminatedUnions.js.map +1 -1
- package/lib/core/forest/editableForest.d.ts +1 -14
- package/lib/core/forest/editableForest.d.ts.map +1 -1
- package/lib/core/forest/editableForest.js +0 -26
- package/lib/core/forest/editableForest.js.map +1 -1
- package/lib/core/forest/forest.d.ts +16 -3
- package/lib/core/forest/forest.d.ts.map +1 -1
- package/lib/core/forest/forest.js +4 -1
- package/lib/core/forest/forest.js.map +1 -1
- package/lib/core/forest/index.d.ts +1 -1
- package/lib/core/forest/index.d.ts.map +1 -1
- package/lib/core/forest/index.js +1 -1
- package/lib/core/forest/index.js.map +1 -1
- package/lib/core/index.d.ts +2 -2
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +2 -2
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/utils.js +1 -1
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +4 -1
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +6 -2
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/anchorSet.d.ts +8 -3
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +14 -7
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/delta.d.ts +8 -23
- package/lib/core/tree/delta.d.ts.map +1 -1
- package/lib/core/tree/delta.js.map +1 -1
- package/lib/core/tree/deltaUtil.d.ts +3 -3
- package/lib/core/tree/deltaUtil.d.ts.map +1 -1
- package/lib/core/tree/deltaUtil.js +2 -2
- package/lib/core/tree/deltaUtil.js.map +1 -1
- package/lib/core/tree/index.d.ts +2 -2
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +1 -1
- package/lib/core/tree/index.js.map +1 -1
- package/lib/core/tree/pathTree.d.ts +54 -1
- package/lib/core/tree/pathTree.d.ts.map +1 -1
- package/lib/core/tree/pathTree.js +6 -0
- package/lib/core/tree/pathTree.js.map +1 -1
- package/lib/core/tree/treeTextFormat.js +1 -1
- package/lib/core/tree/treeTextFormat.js.map +1 -1
- package/lib/core/tree/visitDelta.d.ts +7 -5
- package/lib/core/tree/visitDelta.d.ts.map +1 -1
- package/lib/core/tree/visitDelta.js +19 -9
- package/lib/core/tree/visitDelta.js.map +1 -1
- package/lib/core/tree/visitorUtils.d.ts +5 -23
- package/lib/core/tree/visitorUtils.d.ts.map +1 -1
- package/lib/core/tree/visitorUtils.js +8 -5
- package/lib/core/tree/visitorUtils.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js +3 -3
- package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +5 -3
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +12 -9
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +1 -0
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +8 -5
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +3 -3
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js +2 -2
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/{schemaBasedEncoding.d.ts → schemaBasedEncode.d.ts} +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -0
- package/lib/feature-libraries/chunked-forest/codec/{schemaBasedEncoding.js → schemaBasedEncode.js} +2 -3
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/emptyChunk.js +1 -1
- package/lib/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +3 -2
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +5 -4
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +12 -14
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +5 -6
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +1 -0
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js +1 -0
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +21 -0
- package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -0
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js +53 -0
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -0
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js +1 -2
- package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/deltaUtils.js +1 -1
- package/lib/feature-libraries/deltaUtils.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +5 -5
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +2 -2
- 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/lazyField.d.ts +5 -4
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +13 -10
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +2 -2
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +6 -7
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +2 -1
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +2 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.js +2 -2
- package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/lib/feature-libraries/initializeForest.d.ts +18 -0
- package/lib/feature-libraries/initializeForest.d.ts.map +1 -0
- package/lib/feature-libraries/initializeForest.js +31 -0
- package/lib/feature-libraries/initializeForest.js.map +1 -0
- package/lib/feature-libraries/modular-schema/comparison.js +2 -2
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.js +1 -2
- package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +5 -5
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +12 -18
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/node-identifier/index.d.ts +8 -0
- package/lib/feature-libraries/node-identifier/index.d.ts.map +1 -0
- package/lib/feature-libraries/node-identifier/index.js +8 -0
- package/lib/feature-libraries/node-identifier/index.js.map +1 -0
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.d.ts +22 -0
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.d.ts.map +1 -0
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js +45 -0
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -0
- package/lib/feature-libraries/node-identifier/nodeIdentifier.d.ts +38 -0
- package/lib/feature-libraries/node-identifier/nodeIdentifier.d.ts.map +1 -0
- package/lib/feature-libraries/node-identifier/nodeIdentifier.js +22 -0
- package/lib/feature-libraries/node-identifier/nodeIdentifier.js.map +1 -0
- package/lib/feature-libraries/node-identifier/nodeIdentifierManager.d.ts +37 -0
- package/lib/feature-libraries/node-identifier/nodeIdentifierManager.d.ts.map +1 -0
- package/lib/feature-libraries/node-identifier/nodeIdentifierManager.js +43 -0
- package/lib/feature-libraries/node-identifier/nodeIdentifierManager.js.map +1 -0
- package/lib/feature-libraries/object-forest/objectForest.d.ts +2 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +8 -4
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +2 -1
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.d.ts +1 -1
- package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +1 -2
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.js +2 -2
- package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +2 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +2 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.js +2 -2
- package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.d.ts.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.js +2 -3
- package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
- package/lib/index.d.ts +5 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -3
- package/lib/index.js.map +1 -1
- package/lib/jsonDomainSchema.d.ts +15 -16
- package/lib/jsonDomainSchema.d.ts.map +1 -1
- package/lib/jsonDomainSchema.js +11 -6
- package/lib/jsonDomainSchema.js.map +1 -1
- package/lib/legacy.d.ts +5 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +5 -1
- package/lib/serializableDomainSchema.d.ts +8 -14
- package/lib/serializableDomainSchema.d.ts.map +1 -1
- package/lib/shared-tree/checkoutFlexTreeView.d.ts +3 -3
- package/lib/shared-tree/checkoutFlexTreeView.d.ts.map +1 -1
- package/lib/shared-tree/checkoutFlexTreeView.js.map +1 -1
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +5 -20
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +1 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +5 -4
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +4 -4
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +1 -0
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +23 -16
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +3 -3
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts +1 -2
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js +2 -2
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/treeApiAlpha.d.ts +9 -30
- package/lib/shared-tree/treeApiAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeApiAlpha.js +12 -24
- package/lib/shared-tree/treeApiAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +4 -4
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +4 -3
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +2 -2
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +35 -29
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/sharedTreeAttributes.d.ts +18 -0
- package/lib/sharedTreeAttributes.d.ts.map +1 -0
- package/lib/sharedTreeAttributes.js +22 -0
- package/lib/sharedTreeAttributes.js.map +1 -0
- package/lib/simple-tree/api/conciseTree.d.ts +8 -2
- package/lib/simple-tree/api/conciseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/conciseTree.js +9 -1
- package/lib/simple-tree/api/conciseTree.js.map +1 -1
- package/lib/simple-tree/api/create.d.ts +3 -3
- package/lib/simple-tree/api/create.d.ts.map +1 -1
- package/lib/simple-tree/api/create.js.map +1 -1
- package/lib/simple-tree/api/customTree.d.ts +42 -12
- package/lib/simple-tree/api/customTree.d.ts.map +1 -1
- package/lib/simple-tree/api/customTree.js +30 -3
- package/lib/simple-tree/api/customTree.js.map +1 -1
- package/lib/simple-tree/api/getJsonSchema.d.ts +10 -0
- package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/getJsonSchema.js +10 -0
- package/lib/simple-tree/api/getJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/getSimpleSchema.d.ts +13 -43
- package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/getSimpleSchema.js +13 -43
- package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +7 -6
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +5 -3
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.js +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +112 -67
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +78 -155
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +38 -23
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +27 -2
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +40 -5
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts +19 -0
- package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -0
- package/lib/simple-tree/api/schemaFromSimple.js +67 -0
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -0
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +3 -2
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +6 -6
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleTreeIndex.js +2 -1
- package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/lib/simple-tree/api/testRecursiveDomain.d.ts +10 -10
- package/lib/simple-tree/api/tree.d.ts +12 -6
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js +14 -5
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +5 -20
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +102 -36
- package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.js +0 -1
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.d.ts +16 -25
- package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +16 -12
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/api/view.d.ts.map +1 -1
- package/lib/simple-tree/api/view.js +1 -2
- package/lib/simple-tree/api/view.js.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +16 -3
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +69 -146
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/lib/simple-tree/arrayNode.d.ts +5 -4
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js +7 -3
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/arrayNodeTypes.d.ts +46 -0
- package/lib/simple-tree/arrayNodeTypes.d.ts.map +1 -0
- package/lib/simple-tree/arrayNodeTypes.js +26 -0
- package/lib/simple-tree/arrayNodeTypes.js.map +1 -0
- package/lib/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
- package/lib/simple-tree/core/getOrCreateNode.js +2 -12
- package/lib/simple-tree/core/getOrCreateNode.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +1 -2
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +1 -2
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts +12 -5
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +28 -14
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +14 -7
- package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts +2 -2
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +2 -2
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/flexList.d.ts +4 -5
- package/lib/simple-tree/flexList.d.ts.map +1 -1
- package/lib/simple-tree/flexList.js +0 -12
- package/lib/simple-tree/flexList.js.map +1 -1
- package/lib/simple-tree/index.d.ts +9 -2
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +5 -2
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts +22 -5
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +2 -0
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/mapNode.d.ts +3 -2
- package/lib/simple-tree/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/mapNode.js +5 -1
- package/lib/simple-tree/mapNode.js.map +1 -1
- package/lib/simple-tree/mapNodeTypes.d.ts +46 -0
- package/lib/simple-tree/mapNodeTypes.d.ts.map +1 -0
- package/lib/simple-tree/mapNodeTypes.js +26 -0
- package/lib/simple-tree/mapNodeTypes.js.map +1 -0
- package/lib/simple-tree/objectNode.d.ts +10 -3
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +12 -5
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/objectNodeTypes.d.ts +9 -5
- package/lib/simple-tree/objectNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/objectNodeTypes.js +3 -0
- package/lib/simple-tree/objectNodeTypes.js.map +1 -1
- package/lib/simple-tree/proxies.js +2 -1
- package/lib/simple-tree/proxies.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +81 -8
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js +91 -6
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/{api/simpleSchema.d.ts → simpleSchema.d.ts} +55 -28
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -0
- package/lib/simple-tree/simpleSchema.js.map +1 -0
- package/lib/simple-tree/toMapTree.d.ts +4 -4
- package/lib/simple-tree/toMapTree.d.ts.map +1 -1
- package/lib/simple-tree/toMapTree.js +2 -2
- package/lib/simple-tree/toMapTree.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +4 -8
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/treeNodeValid.d.ts +7 -1
- package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/treeNodeValid.js +14 -7
- package/lib/simple-tree/treeNodeValid.js.map +1 -1
- package/lib/treeFactory.d.ts +0 -12
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +1 -17
- package/lib/treeFactory.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/util/cloneWithReplacements.d.ts +21 -0
- package/lib/util/cloneWithReplacements.d.ts.map +1 -0
- package/lib/util/cloneWithReplacements.js +34 -0
- package/lib/util/cloneWithReplacements.js.map +1 -0
- package/lib/util/idAllocator.d.ts.map +1 -1
- package/lib/util/idAllocator.js +1 -2
- package/lib/util/idAllocator.js.map +1 -1
- package/lib/util/index.d.ts +2 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -1
- package/lib/util/index.js.map +1 -1
- package/lib/util/referenceCounting.d.ts +18 -0
- package/lib/util/referenceCounting.d.ts.map +1 -1
- package/lib/util/referenceCounting.js.map +1 -1
- package/lib/util/typeCheck.d.ts +7 -0
- package/lib/util/typeCheck.d.ts.map +1 -1
- package/lib/util/typeCheck.js.map +1 -1
- package/lib/util/utils.d.ts +0 -1
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js +0 -2
- package/lib/util/utils.js.map +1 -1
- package/package.json +37 -27
- package/src/codec/codec.ts +2 -2
- package/src/codec/discriminatedUnions.ts +2 -2
- package/src/core/forest/editableForest.ts +1 -52
- package/src/core/forest/forest.ts +17 -2
- package/src/core/forest/index.ts +0 -1
- package/src/core/index.ts +4 -2
- package/src/core/rebase/utils.ts +1 -1
- package/src/core/schema-stored/schema.ts +6 -2
- package/src/core/tree/anchorSet.ts +42 -12
- package/src/core/tree/delta.ts +8 -25
- package/src/core/tree/deltaUtil.ts +5 -5
- package/src/core/tree/index.ts +4 -1
- package/src/core/tree/pathTree.ts +72 -1
- package/src/core/tree/treeTextFormat.ts +1 -1
- package/src/core/tree/visitDelta.ts +38 -17
- package/src/core/tree/visitorUtils.ts +22 -36
- package/src/feature-libraries/chunked-forest/basicChunk.ts +3 -3
- package/src/feature-libraries/chunked-forest/chunkTree.ts +20 -9
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +10 -6
- package/src/feature-libraries/chunked-forest/codec/README.md +3 -3
- package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +1 -1
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +1 -1
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +3 -3
- package/src/feature-libraries/chunked-forest/codec/nodeShape.ts +2 -2
- package/src/feature-libraries/chunked-forest/codec/{schemaBasedEncoding.ts → schemaBasedEncode.ts} +1 -2
- package/src/feature-libraries/chunked-forest/emptyChunk.ts +1 -1
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +5 -4
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +21 -38
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +1 -1
- package/src/feature-libraries/default-schema/index.ts +2 -0
- package/src/feature-libraries/default-schema/mappedEditBuilder.ts +68 -0
- package/src/feature-libraries/default-schema/schemaChecker.ts +1 -2
- package/src/feature-libraries/deltaUtils.ts +1 -1
- package/src/feature-libraries/flex-tree/context.ts +4 -4
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +2 -2
- package/src/feature-libraries/flex-tree/lazyField.ts +21 -12
- package/src/feature-libraries/flex-tree/lazyNode.ts +2 -2
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +5 -9
- package/src/feature-libraries/index.ts +10 -8
- package/src/feature-libraries/indexing/anchorTreeIndex.ts +4 -4
- package/src/feature-libraries/initializeForest.ts +55 -0
- package/src/feature-libraries/modular-schema/comparison.ts +2 -2
- package/src/feature-libraries/modular-schema/isNeverTree.ts +1 -2
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +1 -2
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +13 -30
- package/src/feature-libraries/node-identifier/README.md +11 -0
- package/src/feature-libraries/node-identifier/index.ts +17 -0
- package/src/feature-libraries/node-identifier/mockNodeIdentifierManager.ts +59 -0
- package/src/feature-libraries/node-identifier/nodeIdentifier.ts +50 -0
- package/src/feature-libraries/node-identifier/nodeIdentifierManager.ts +95 -0
- package/src/feature-libraries/object-forest/objectForest.ts +11 -5
- package/src/feature-libraries/schema-index/codec.ts +2 -1
- package/src/feature-libraries/sequence-field/compose.ts +2 -2
- package/src/feature-libraries/sequence-field/invert.ts +2 -2
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +2 -2
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +2 -2
- package/src/feature-libraries/sequence-field/utils.ts +2 -2
- package/src/feature-libraries/treeCursorUtils.ts +2 -3
- package/src/index.ts +43 -13
- package/src/jsonDomainSchema.ts +30 -11
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/checkoutFlexTreeView.ts +2 -2
- package/src/shared-tree/independentView.ts +5 -29
- package/src/shared-tree/index.ts +1 -0
- package/src/shared-tree/schematizeTree.ts +5 -4
- package/src/shared-tree/schematizingTreeView.ts +3 -3
- package/src/shared-tree/sharedTree.ts +29 -19
- package/src/shared-tree/sharedTreeChangeFamily.ts +1 -3
- package/src/shared-tree/sharedTreeEditBuilder.ts +5 -11
- package/src/shared-tree/treeApiAlpha.ts +45 -85
- package/src/shared-tree/treeCheckout.ts +4 -10
- package/src/shared-tree-core/branch.ts +5 -3
- package/src/shared-tree-core/editManager.ts +37 -45
- package/src/sharedTreeAttributes.ts +25 -0
- package/src/simple-tree/api/conciseTree.ts +25 -8
- package/src/simple-tree/api/create.ts +3 -3
- package/src/simple-tree/api/customTree.ts +60 -17
- package/src/simple-tree/api/getJsonSchema.ts +10 -0
- package/src/simple-tree/api/getSimpleSchema.ts +14 -44
- package/src/simple-tree/api/index.ts +17 -12
- package/src/simple-tree/api/schemaCreationUtilities.ts +1 -2
- package/src/simple-tree/api/schemaFactory.ts +179 -118
- package/src/simple-tree/api/schemaFactoryAlpha.ts +74 -67
- package/src/simple-tree/api/schemaFactoryRecursive.ts +44 -12
- package/src/simple-tree/api/schemaFromSimple.ts +96 -0
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +7 -7
- package/src/simple-tree/api/simpleTreeIndex.ts +2 -1
- package/src/simple-tree/api/tree.ts +16 -11
- package/src/simple-tree/api/treeNodeApi.ts +5 -18
- package/src/simple-tree/api/typesUnsafe.ts +166 -48
- package/src/simple-tree/api/verboseTree.ts +45 -57
- package/src/simple-tree/api/view.ts +1 -2
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +80 -185
- package/src/simple-tree/arrayNode.ts +20 -14
- package/src/simple-tree/arrayNodeTypes.ts +93 -0
- package/src/simple-tree/core/getOrCreateNode.ts +3 -13
- package/src/simple-tree/core/index.ts +1 -1
- package/src/simple-tree/core/treeNodeKernel.ts +32 -18
- package/src/simple-tree/core/treeNodeSchema.ts +14 -8
- package/src/simple-tree/core/unhydratedFlexTree.ts +4 -4
- package/src/simple-tree/flexList.ts +4 -14
- package/src/simple-tree/index.ts +36 -9
- package/src/simple-tree/leafNodeSchema.ts +28 -7
- package/src/simple-tree/mapNode.ts +13 -11
- package/src/simple-tree/mapNodeTypes.ts +90 -0
- package/src/simple-tree/objectNode.ts +40 -13
- package/src/simple-tree/objectNodeTypes.ts +21 -16
- package/src/simple-tree/proxies.ts +2 -2
- package/src/simple-tree/schemaTypes.ts +153 -23
- package/src/simple-tree/{api/simpleSchema.ts → simpleSchema.ts} +67 -28
- package/src/simple-tree/toMapTree.ts +8 -8
- package/src/simple-tree/toStoredSchema.ts +4 -7
- package/src/simple-tree/treeNodeValid.ts +17 -7
- package/src/treeFactory.ts +1 -19
- package/src/util/cloneWithReplacements.ts +41 -0
- package/src/util/idAllocator.ts +1 -3
- package/src/util/index.ts +2 -1
- package/src/util/referenceCounting.ts +18 -1
- package/src/util/typeCheck.ts +7 -0
- package/src/util/utils.ts +0 -3
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts.map +0 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js.map +0 -1
- package/dist/feature-libraries/node-key/index.d.ts +0 -8
- package/dist/feature-libraries/node-key/index.d.ts.map +0 -1
- package/dist/feature-libraries/node-key/index.js +0 -16
- package/dist/feature-libraries/node-key/index.js.map +0 -1
- package/dist/feature-libraries/node-key/mockNodeKeyManager.d.ts +0 -22
- package/dist/feature-libraries/node-key/mockNodeKeyManager.d.ts.map +0 -1
- package/dist/feature-libraries/node-key/mockNodeKeyManager.js.map +0 -1
- package/dist/feature-libraries/node-key/nodeKey.d.ts +0 -38
- package/dist/feature-libraries/node-key/nodeKey.d.ts.map +0 -1
- package/dist/feature-libraries/node-key/nodeKey.js +0 -26
- package/dist/feature-libraries/node-key/nodeKey.js.map +0 -1
- package/dist/feature-libraries/node-key/nodeKeyManager.d.ts +0 -37
- package/dist/feature-libraries/node-key/nodeKeyManager.d.ts.map +0 -1
- package/dist/feature-libraries/node-key/nodeKeyManager.js +0 -48
- package/dist/feature-libraries/node-key/nodeKeyManager.js.map +0 -1
- package/dist/simple-tree/api/simpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/api/simpleSchema.js.map +0 -1
- package/dist/simple-tree/core/schemaCaching.d.ts +0 -16
- package/dist/simple-tree/core/schemaCaching.d.ts.map +0 -1
- package/dist/simple-tree/core/schemaCaching.js +0 -32
- package/dist/simple-tree/core/schemaCaching.js.map +0 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts.map +0 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js.map +0 -1
- package/lib/feature-libraries/node-key/index.d.ts +0 -8
- package/lib/feature-libraries/node-key/index.d.ts.map +0 -1
- package/lib/feature-libraries/node-key/index.js +0 -8
- package/lib/feature-libraries/node-key/index.js.map +0 -1
- package/lib/feature-libraries/node-key/mockNodeKeyManager.d.ts +0 -22
- package/lib/feature-libraries/node-key/mockNodeKeyManager.d.ts.map +0 -1
- package/lib/feature-libraries/node-key/mockNodeKeyManager.js +0 -45
- package/lib/feature-libraries/node-key/mockNodeKeyManager.js.map +0 -1
- package/lib/feature-libraries/node-key/nodeKey.d.ts +0 -38
- package/lib/feature-libraries/node-key/nodeKey.d.ts.map +0 -1
- package/lib/feature-libraries/node-key/nodeKey.js +0 -22
- package/lib/feature-libraries/node-key/nodeKey.js.map +0 -1
- package/lib/feature-libraries/node-key/nodeKeyManager.d.ts +0 -37
- package/lib/feature-libraries/node-key/nodeKeyManager.d.ts.map +0 -1
- package/lib/feature-libraries/node-key/nodeKeyManager.js +0 -43
- package/lib/feature-libraries/node-key/nodeKeyManager.js.map +0 -1
- package/lib/simple-tree/api/simpleSchema.d.ts.map +0 -1
- package/lib/simple-tree/api/simpleSchema.js.map +0 -1
- package/lib/simple-tree/core/schemaCaching.d.ts +0 -16
- package/lib/simple-tree/core/schemaCaching.d.ts.map +0 -1
- package/lib/simple-tree/core/schemaCaching.js +0 -27
- package/lib/simple-tree/core/schemaCaching.js.map +0 -1
- package/prettier.config.cjs +0 -8
- package/src/feature-libraries/node-key/README.md +0 -11
- package/src/feature-libraries/node-key/index.ts +0 -17
- package/src/feature-libraries/node-key/mockNodeKeyManager.ts +0 -54
- package/src/feature-libraries/node-key/nodeKey.ts +0 -47
- package/src/feature-libraries/node-key/nodeKeyManager.ts +0 -93
- package/src/simple-tree/core/schemaCaching.ts +0 -35
- /package/dist/simple-tree/{api/simpleSchema.js → simpleSchema.js} +0 -0
- /package/lib/simple-tree/{api/simpleSchema.js → simpleSchema.js} +0 -0
|
@@ -15,7 +15,7 @@ export { SequenceField };
|
|
|
15
15
|
export { isNeverField, ModularEditBuilder, type FieldEditDescription as EditDescription, type FieldChangeHandler, type FieldChangeRebaser, type FieldEditor, type FieldChangeMap, type FieldChange, type FieldChangeset, type ToDelta, type ModularChangeset, makeModularChangeCodecFamily, type NodeChangeComposer, type NodeChangeInverter, type NodeChangeRebaser, type NodeChangePruner, type CrossFieldManager, CrossFieldTarget, FlexFieldKind, type FullSchemaPolicy, allowsRepoSuperset, type GenericChangeset, genericFieldKind, type HasFieldChanges, type NodeExistsConstraint, FieldKindWithEditor, ModularChangeFamily, type RelevantRemovedRootsFromChild, EncodedModularChangeset, updateRefreshers, type NodeId, type FieldChangeEncodingContext, type FieldKindConfiguration, type FieldKindConfigurationEntry, getAllowedContentDiscrepancies, isRepoSuperset, type AllowedTypeDiscrepancy, type FieldKindDiscrepancy, type ValueSchemaDiscrepancy, type FieldDiscrepancy, type NodeDiscrepancy, type NodeKindDiscrepancy, type NodeFieldsDiscrepancy, isNeverTree, type LinearExtension, type Realizer, fieldRealizer, PosetComparisonResult, comparePosetElements, posetLte, } from "./modular-schema/index.js";
|
|
16
16
|
export { mapRootChanges } from "./deltaUtils.js";
|
|
17
17
|
export { type TreeChunk, chunkTree, chunkFieldSingle, buildChunkedForest, defaultChunkPolicy, type FieldBatch, type FieldBatchCodec, makeTreeChunker, makeFieldBatchCodec, type FieldBatchEncodingContext, } from "./chunked-forest/index.js";
|
|
18
|
-
export {
|
|
18
|
+
export { compareLocalNodeIdentifiers, createNodeIdentifierManager, isStableNodeIdentifier, type LocalNodeIdentifier, MockNodeIdentifierManager, type NodeIdentifierManager, nodeKeyTreeIdentifier, type StableNodeIdentifier, } from "./node-identifier/index.js";
|
|
19
19
|
export { FieldKinds, type Required, type Optional, type Sequence, type Identifier, type Forbidden, type DefaultChangeset, DefaultChangeFamily, DefaultEditBuilder, type IDefaultEditBuilder, type ValueFieldEditBuilder, type OptionalFieldEditBuilder, type SequenceFieldEditBuilder, defaultSchemaPolicy, fieldKinds, fieldKindConfigurations, intoDelta, relevantRemovedRoots, SchemaValidationErrors, isNodeInSchema, isFieldInSchema, } from "./default-schema/index.js";
|
|
20
20
|
export { type FlexTreeOptionalField, type FlexTreeRequiredField, type FlexTreeSequenceField, Skip, type FlexTreeContext, type FlexTreeHydratedContext, type FlexTreeTypedField, type FlexTreeEntity, type FlexTreeField, type FlexTreeNode, getTreeContext, TreeStatus, Context, type FlexTreeNodeEvents, type FlexTreeUnknownUnboxed, isFlexTreeNode, ContextSlot, flexTreeMarker, assertFlexTreeEntityNotFreed, flexTreeSlot, getSchemaAndPolicy, isFreedSymbol, LazyEntity, treeStatusFromAnchorCache, indexForAt, FlexTreeEntityKind, } from "./flex-tree/index.js";
|
|
21
21
|
export { TreeCompressionStrategy } from "./treeCompressionUtils.js";
|
|
@@ -24,4 +24,5 @@ export { DetachedFieldIndexSummarizer } from "./detachedFieldIndexSummarizer.js"
|
|
|
24
24
|
export { type SchemaChange, makeSchemaChangeCodecs, EncodedSchemaChange, } from "./schema-edits/index.js";
|
|
25
25
|
export { makeMitigatedChangeFamily } from "./mitigatedChangeFamily.js";
|
|
26
26
|
export { type KeyFinder, AnchorTreeIndex, hasElement, type TreeIndex, type TreeIndexKey, type TreeIndexNodes, } from "./indexing/index.js";
|
|
27
|
+
export { initializeForest } from "./initializeForest.js";
|
|
27
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sour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rB,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,mBAAmB,EACnB,mBAAmB,EACnB,KAAK,6BAA6B,EAClC,uBAAuB,EACvB,gBAAgB,EAChB,KAAK,MAAM,EACX,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,8BAA8B,EAC9B,cAAc,EACd,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,WAAW,EACX,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACpB,QAAQ,GACR,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EACN,KAAK,SAAS,EACd,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,eAAe,EACf,mBAAmB,EACnB,KAAK,yBAAyB,GAC9B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACN,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,QAAQ,EACb,UAAU,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,gBAA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,EACb,UAAU,EACV,yBAAyB,EACzB,UAAU,EACV,kBAAkB,GAClB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,OAAO,EACN,KAAK,YAAY,EACjB,sBAAsB,EACtB,mBAAmB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EACN,KAAK,SAAS,EACd,eAAe,EACf,UAAU,EACV,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,cAAc,GACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -27,8 +27,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
27
27
|
return result;
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.
|
|
31
|
-
exports.hasElement = exports.AnchorTreeIndex = exports.makeMitigatedChangeFamily = exports.EncodedSchemaChange = exports.makeSchemaChangeCodecs = exports.DetachedFieldIndexSummarizer = exports.valueSchemaAllows = exports.TreeCompressionStrategy = exports.FlexTreeEntityKind = exports.indexForAt = exports.treeStatusFromAnchorCache = exports.LazyEntity = exports.isFreedSymbol = exports.getSchemaAndPolicy = exports.flexTreeSlot = exports.assertFlexTreeEntityNotFreed = exports.flexTreeMarker = exports.ContextSlot = exports.isFlexTreeNode = exports.Context = exports.TreeStatus = exports.getTreeContext = exports.Skip = exports.isFieldInSchema = exports.isNodeInSchema = exports.SchemaValidationErrors = exports.relevantRemovedRoots = exports.intoDelta = exports.fieldKindConfigurations = exports.fieldKinds = exports.defaultSchemaPolicy = exports.DefaultEditBuilder = exports.DefaultChangeFamily = exports.FieldKinds = exports.nodeKeyTreeIdentifier = exports.
|
|
30
|
+
exports.createNodeIdentifierManager = exports.compareLocalNodeIdentifiers = exports.makeFieldBatchCodec = exports.makeTreeChunker = exports.defaultChunkPolicy = exports.buildChunkedForest = exports.chunkFieldSingle = exports.chunkTree = exports.mapRootChanges = exports.posetLte = exports.comparePosetElements = exports.PosetComparisonResult = exports.fieldRealizer = exports.isNeverTree = exports.isRepoSuperset = exports.getAllowedContentDiscrepancies = exports.updateRefreshers = exports.EncodedModularChangeset = exports.ModularChangeFamily = exports.FieldKindWithEditor = exports.genericFieldKind = exports.allowsRepoSuperset = exports.FlexFieldKind = exports.CrossFieldTarget = exports.makeModularChangeCodecFamily = exports.ModularEditBuilder = exports.isNeverField = exports.SequenceField = exports.jsonableTreeFromForest = exports.jsonableTreeFromFieldCursor = exports.jsonableTreeFromCursor = exports.cursorForJsonableTreeField = exports.cursorForJsonableTreeNode = exports.stackTreeFieldCursor = exports.prefixFieldPath = exports.prefixPath = exports.stackTreeNodeCursor = exports.makeSchemaCodec = exports.encodeTreeSchema = exports.SchemaSummarizer = exports.buildForest = exports.mapTreeFieldFromCursor = exports.mapTreeFromCursor = exports.cursorForMapTreeNode = exports.cursorForMapTreeField = exports.ForestSummarizer = exports.isTreeValue = exports.assertAllowedValue = exports.allowsValue = exports.toDownPath = void 0;
|
|
31
|
+
exports.initializeForest = exports.hasElement = exports.AnchorTreeIndex = exports.makeMitigatedChangeFamily = exports.EncodedSchemaChange = exports.makeSchemaChangeCodecs = exports.DetachedFieldIndexSummarizer = exports.valueSchemaAllows = exports.TreeCompressionStrategy = exports.FlexTreeEntityKind = exports.indexForAt = exports.treeStatusFromAnchorCache = exports.LazyEntity = exports.isFreedSymbol = exports.getSchemaAndPolicy = exports.flexTreeSlot = exports.assertFlexTreeEntityNotFreed = exports.flexTreeMarker = exports.ContextSlot = exports.isFlexTreeNode = exports.Context = exports.TreeStatus = exports.getTreeContext = exports.Skip = exports.isFieldInSchema = exports.isNodeInSchema = exports.SchemaValidationErrors = exports.relevantRemovedRoots = exports.intoDelta = exports.fieldKindConfigurations = exports.fieldKinds = exports.defaultSchemaPolicy = exports.DefaultEditBuilder = exports.DefaultChangeFamily = exports.FieldKinds = exports.nodeKeyTreeIdentifier = exports.MockNodeIdentifierManager = exports.isStableNodeIdentifier = void 0;
|
|
32
32
|
var editableTreeBinder_js_1 = require("./editableTreeBinder.js");
|
|
33
33
|
Object.defineProperty(exports, "toDownPath", { enumerable: true, get: function () { return editableTreeBinder_js_1.toDownPath; } });
|
|
34
34
|
var valueUtilities_js_1 = require("./valueUtilities.js");
|
|
@@ -90,11 +90,11 @@ Object.defineProperty(exports, "buildChunkedForest", { enumerable: true, get: fu
|
|
|
90
90
|
Object.defineProperty(exports, "defaultChunkPolicy", { enumerable: true, get: function () { return index_js_5.defaultChunkPolicy; } });
|
|
91
91
|
Object.defineProperty(exports, "makeTreeChunker", { enumerable: true, get: function () { return index_js_5.makeTreeChunker; } });
|
|
92
92
|
Object.defineProperty(exports, "makeFieldBatchCodec", { enumerable: true, get: function () { return index_js_5.makeFieldBatchCodec; } });
|
|
93
|
-
var index_js_6 = require("./node-
|
|
94
|
-
Object.defineProperty(exports, "
|
|
95
|
-
Object.defineProperty(exports, "
|
|
96
|
-
Object.defineProperty(exports, "
|
|
97
|
-
Object.defineProperty(exports, "
|
|
93
|
+
var index_js_6 = require("./node-identifier/index.js");
|
|
94
|
+
Object.defineProperty(exports, "compareLocalNodeIdentifiers", { enumerable: true, get: function () { return index_js_6.compareLocalNodeIdentifiers; } });
|
|
95
|
+
Object.defineProperty(exports, "createNodeIdentifierManager", { enumerable: true, get: function () { return index_js_6.createNodeIdentifierManager; } });
|
|
96
|
+
Object.defineProperty(exports, "isStableNodeIdentifier", { enumerable: true, get: function () { return index_js_6.isStableNodeIdentifier; } });
|
|
97
|
+
Object.defineProperty(exports, "MockNodeIdentifierManager", { enumerable: true, get: function () { return index_js_6.MockNodeIdentifierManager; } });
|
|
98
98
|
Object.defineProperty(exports, "nodeKeyTreeIdentifier", { enumerable: true, get: function () { return index_js_6.nodeKeyTreeIdentifier; } });
|
|
99
99
|
var index_js_7 = require("./default-schema/index.js");
|
|
100
100
|
Object.defineProperty(exports, "FieldKinds", { enumerable: true, get: function () { return index_js_7.FieldKinds; } });
|
|
@@ -139,4 +139,6 @@ Object.defineProperty(exports, "makeMitigatedChangeFamily", { enumerable: true,
|
|
|
139
139
|
var index_js_10 = require("./indexing/index.js");
|
|
140
140
|
Object.defineProperty(exports, "AnchorTreeIndex", { enumerable: true, get: function () { return index_js_10.AnchorTreeIndex; } });
|
|
141
141
|
Object.defineProperty(exports, "hasElement", { enumerable: true, get: function () { return index_js_10.hasElement; } });
|
|
142
|
+
var initializeForest_js_1 = require("./initializeForest.js");
|
|
143
|
+
Object.defineProperty(exports, "initializeForest", { enumerable: true, get: function () { return initializeForest_js_1.initializeForest; } });
|
|
142
144
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iEAGiC;AADhC,mHAAA,UAAU,OAAA;AAEX,yDAAmF;AAA1E,gHAAA,WAAW,OAAA;AAAE,uHAAA,kBAAkB,OAAA;AAAE,gHAAA,WAAW,OAAA;AAErD,sDAA6D;AAApD,4GAAA,gBAAgB,OAAA;AACzB,uDAK4B;AAJ3B,yHAAA,qBAAqB,OAAA;AACrB,wHAAA,oBAAoB,OAAA;AACpB,qHAAA,iBAAiB,OAAA;AACjB,0HAAA,sBAAsB,OAAA;AAEvB,qDAAuD;AAA9C,uGAAA,WAAW,OAAA;AACpB,oDAA8F;AAArF,4GAAA,gBAAgB,OAAA;AAAE,4GAAA,gBAAgB,OAAA;AAAE,2GAAA,eAAe,OAAA;AAC5D,2DAO8B;AAN7B,yHAAA,mBAAmB,OAAA;AAEnB,gHAA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AGpB,uEAAuE;AAA9D,qIAAA,yBAAyB,OAAA;AAElC,iDAO6B;AAL5B,4GAAA,eAAe,OAAA;AACf,uGAAA,UAAU,OAAA;AAMX,6DAAyD;AAAhD,uHAAA,gBAAgB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype DownPath,\n\ttoDownPath,\n} from \"./editableTreeBinder.js\";\nexport { allowsValue, assertAllowedValue, isTreeValue } from \"./valueUtilities.js\";\n\nexport { ForestSummarizer } from \"./forest-summary/index.js\";\nexport {\n\tcursorForMapTreeField,\n\tcursorForMapTreeNode,\n\tmapTreeFromCursor,\n\tmapTreeFieldFromCursor,\n} from \"./mapTreeCursor.js\";\nexport { buildForest } from \"./object-forest/index.js\";\nexport { SchemaSummarizer, encodeTreeSchema, makeSchemaCodec } from \"./schema-index/index.js\";\nexport {\n\tstackTreeNodeCursor,\n\ttype CursorAdapter,\n\tprefixPath,\n\tprefixFieldPath,\n\ttype CursorWithNode,\n\tstackTreeFieldCursor,\n} from \"./treeCursorUtils.js\";\nexport {\n\tcursorForJsonableTreeNode,\n\tcursorForJsonableTreeField,\n\tjsonableTreeFromCursor,\n\tjsonableTreeFromFieldCursor,\n\tjsonableTreeFromForest,\n} from \"./treeTextCursor.js\";\n\n// Split this up into separate import and export for compatibility with API-Extractor.\nimport * as SequenceField from \"./sequence-field/index.js\";\nexport { SequenceField };\n\nexport {\n\tisNeverField,\n\tModularEditBuilder,\n\ttype FieldEditDescription as EditDescription,\n\ttype FieldChangeHandler,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype FieldChangeMap,\n\ttype FieldChange,\n\ttype FieldChangeset,\n\ttype ToDelta,\n\ttype ModularChangeset,\n\tmakeModularChangeCodecFamily,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\tallowsRepoSuperset,\n\ttype GenericChangeset,\n\tgenericFieldKind,\n\ttype HasFieldChanges,\n\ttype NodeExistsConstraint,\n\tFieldKindWithEditor,\n\tModularChangeFamily,\n\ttype RelevantRemovedRootsFromChild,\n\tEncodedModularChangeset,\n\tupdateRefreshers,\n\ttype NodeId,\n\ttype FieldChangeEncodingContext,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tgetAllowedContentDiscrepancies,\n\tisRepoSuperset,\n\ttype AllowedTypeDiscrepancy,\n\ttype FieldKindDiscrepancy,\n\ttype ValueSchemaDiscrepancy,\n\ttype FieldDiscrepancy,\n\ttype NodeDiscrepancy,\n\ttype NodeKindDiscrepancy,\n\ttype NodeFieldsDiscrepancy,\n\tisNeverTree,\n\ttype LinearExtension,\n\ttype Realizer,\n\tfieldRealizer,\n\tPosetComparisonResult,\n\tcomparePosetElements,\n\tposetLte,\n} from \"./modular-schema/index.js\";\n\nexport { mapRootChanges } from \"./deltaUtils.js\";\n\nexport {\n\ttype TreeChunk,\n\tchunkTree,\n\tchunkFieldSingle,\n\tbuildChunkedForest,\n\tdefaultChunkPolicy,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tmakeTreeChunker,\n\tmakeFieldBatchCodec,\n\ttype FieldBatchEncodingContext,\n} from \"./chunked-forest/index.js\";\n\nexport {\n\tcompareLocalNodeIdentifiers,\n\tcreateNodeIdentifierManager,\n\tisStableNodeIdentifier,\n\ttype LocalNodeIdentifier,\n\tMockNodeIdentifierManager,\n\ttype NodeIdentifierManager,\n\tnodeKeyTreeIdentifier,\n\ttype StableNodeIdentifier,\n} from \"./node-identifier/index.js\";\n\nexport {\n\tFieldKinds,\n\ttype Required,\n\ttype Optional,\n\ttype Sequence,\n\ttype Identifier,\n\ttype Forbidden,\n\ttype DefaultChangeset,\n\tDefaultChangeFamily,\n\tDefaultEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\tdefaultSchemaPolicy,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tSchemaValidationErrors,\n\tisNodeInSchema,\n\tisFieldInSchema,\n} from \"./default-schema/index.js\";\n\nexport {\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\tSkip,\n\ttype FlexTreeContext,\n\ttype FlexTreeHydratedContext,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeEntity,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\tgetTreeContext,\n\tTreeStatus,\n\tContext,\n\ttype FlexTreeNodeEvents,\n\ttype FlexTreeUnknownUnboxed,\n\tisFlexTreeNode,\n\tContextSlot,\n\t// Internal\n\tflexTreeMarker,\n\tassertFlexTreeEntityNotFreed,\n\tflexTreeSlot,\n\tgetSchemaAndPolicy,\n\tisFreedSymbol,\n\tLazyEntity,\n\ttreeStatusFromAnchorCache,\n\tindexForAt,\n\tFlexTreeEntityKind,\n} from \"./flex-tree/index.js\";\n\nexport { TreeCompressionStrategy } from \"./treeCompressionUtils.js\";\n\nexport { valueSchemaAllows } from \"./valueUtilities.js\";\n\nexport { DetachedFieldIndexSummarizer } from \"./detachedFieldIndexSummarizer.js\";\n\nexport {\n\ttype SchemaChange,\n\tmakeSchemaChangeCodecs,\n\tEncodedSchemaChange,\n} from \"./schema-edits/index.js\";\n\nexport { makeMitigatedChangeFamily } from \"./mitigatedChangeFamily.js\";\n\nexport {\n\ttype KeyFinder,\n\tAnchorTreeIndex,\n\thasElement,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n} from \"./indexing/index.js\";\n\nexport { initializeForest } from \"./initializeForest.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchorTreeIndex.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/indexing/anchorTreeIndex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"anchorTreeIndex.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/indexing/anchorTreeIndex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAe,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAEN,KAAK,UAAU,EAEf,KAAK,wBAAwB,EAG7B,KAAK,uBAAuB,EAE5B,KAAK,mBAAmB,EASxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,SAAS,CAAC,IAAI,SAAS,YAAY,IAAI,CAAC,IAAI,EAAE,uBAAuB,KAAK,IAAI,CAAC;AAE3F;;;;;;;GAOG;AACH,qBAAa,eAAe,CAAC,IAAI,SAAS,YAAY,EAAE,MAAM,CAC7D,YAAW,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;IAqCjC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAGxB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,cAAc;IAzCzB,QAAQ,UAAS;IACxB;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA+D;IAC1F;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAiC;IAC5D;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA+B;IACzD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmC;IAC3D;;;OAGG;IACH,OAAO,C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CAAC,YAAY;IAcpB,OAAO,CAAC,gBAAgB;IASxB;;OAEG;IACH,OAAO,CAAC,SAAS;IA8CjB;;OAEG;IACH,OAAO,CAAC,UAAU;IAUlB;;OAEG;IACH,OAAO,CAAC,UAAU;IAuBlB,OAAO,CAAC,YAAY;IAqBpB;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAUxB;AAgBD;;GAEG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,KAAK,IAAI,cAAc,CAAC,CAAC,CAAC,CAE7E"}
|
|
@@ -283,7 +283,7 @@ class AnchorTreeIndex {
|
|
|
283
283
|
throw new Error("key finder should be pure and functional");
|
|
284
284
|
}
|
|
285
285
|
const anchor = nodeCursor.buildAnchor();
|
|
286
|
-
const anchorNode = this.forest.anchors.locate(anchor) ?? (0,
|
|
286
|
+
const anchorNode = this.forest.anchors.locate(anchor) ?? (0, internal_1.fail)(0xb16 /* expected anchor node */);
|
|
287
287
|
// check if this anchor node already exists in the index
|
|
288
288
|
const existingKey = this.nodeToKey.get(anchorNode);
|
|
289
289
|
if (existingKey !== undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchorTreeIndex.js","sourceRoot":"","sources":["../../../src/feature-libraries/indexing/anchorTreeIndex.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAC7D,kDAAuE;AACvE,kDAkB6B;AAE7B,oDAAmD;AAenD;;;;;;;GAOG;AACH,MAAa,eAAe;IA4B3B;;;;;;;;OAQG;IACH,YACkB,MAA2B,EAC3B,OAEe,EACf,QAAyE,EACzE,eAA6D,EAC7D,iBAAiB,KAAK;QANtB,WAAM,GAAN,MAAM,CAAqB;QAC3B,YAAO,GAAP,OAAO,CAEQ;QACf,aAAQ,GAAR,QAAQ,CAAiE;QACzE,oBAAe,GAAf,eAAe,CAA8C;QAC7D,mBAAc,GAAd,cAAc,CAAQ;QAzCjC,aAAQ,GA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C,CAAC;QACrC,CAAC;IACF,CAAC;CACD;AA3ZD,0CA2ZC;AAED;;GAEG;AACH,SAAS,WAAW,CACnB,WAA8C,EAC9C,MAAqC;IAErC,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAgB,UAAU,CAAI,KAAmB;IAChD,OAAO,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;AAC1B,CAAC;AAFD,gCAEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { disposeSymbol, fail, getOrCreate } from \"../../util/index.js\";\nimport {\n\ttype Anchor,\n\ttype AnchorNode,\n\ttype FieldKey,\n\ttype TreeNodeSchemaIdentifier,\n\tforEachField,\n\tforEachNode,\n\ttype ITreeSubscriptionCursor,\n\tcreateAnnouncedVisitor,\n\ttype IForestSubscription,\n\ttype AnnouncedVisitor,\n\tCursorLocationType,\n\trootField,\n\ttype UpPath,\n\ttype ProtoNodes,\n\tkeyAsDetachedField,\n\tcompareUpPaths,\n\tTreeNavigationResult,\n} from \"../../core/index.js\";\nimport type { TreeIndex, TreeIndexKey, TreeIndexNodes } from \"./types.js\";\nimport { TreeStatus } from \"../flex-tree/index.js\";\n\n/**\n * A function that gets the value to index a node on, must be pure and functional.\n * The given cursor should point to the node that will be indexed.\n *\n * @returns a value the index will use as the key for the given node\n *\n * @remarks\n * This function does not own the cursor in any way, it walks the cursor to find the key the node is indexed on\n * but returns the cursor to the state it was in before being passed to the function. It should also not be disposed by this function\n * and must be disposed elsewhere.\n */\nexport type KeyFinder<TKey extends TreeIndexKey> = (tree: ITreeSubscriptionCursor) => TKey;\n\n/**\n * An index from some arbitrary keys to anchor nodes. Keys can be anything that is a {@link TreeValue}.\n * A key can map to multiple nodes but each collection of nodes only results in a single value.\n *\n * @remarks\n * Detached nodes are stored in the index but filtered out when any public facing apis are called. This means that\n * calling {@link keys} will not include any keys that are stored in the index but only map to detached nodes.\n */\nexport class AnchorTreeIndex<TKey extends TreeIndexKey, TValue>\n\timplements TreeIndex<TKey, TValue>\n{\n\tpublic disposed = false;\n\t/**\n\t * Caches {@link KeyFinder}s for each schema definition. If a schema maps to null, it does not\n\t * need to be considered at all for this index. This allows us to skip subtrees that aren't relevant\n\t * as a performance optimization.\n\t */\n\tprivate readonly keyFinders = new Map<TreeNodeSchemaIdentifier, KeyFinder<TKey> | null>();\n\t/**\n\t * The actual index from keys to anchor nodes.\n\t */\n\tprivate readonly keyToNodes = new Map<TKey, AnchorNode[]>();\n\t/**\n\t * Maintained for efficient removal of anchor nodes from the index when updating their keys\n\t */\n\tprivate readonly nodeToKey = new Map<AnchorNode, TKey>();\n\t/**\n\t * Keeps track of anchors for disposal.\n\t */\n\tprivate readonly anchors = new Map<AnchorNode, Anchor[]>();\n\t/**\n\t * The key finder that is registered on the forest to keep this index updated, maintained\n\t * here for deregistration on disposal\n\t */\n\tprivate readonly keyFinder = this.acquireVisitor.bind(this);\n\n\t/**\n\t * @param forest - the forest that is being indexed\n\t * @param indexer - a function that retrieves the key finder based on a given schema or undefined if the schema does not have an associated key finder\n\t * @param getValue - a pure and functional function that returns the associated value of one or more anchor nodes, can be used to map and filter the indexed anchor nodes\n\t * so that the values returned from the index are more usable\n\t * @param checkTreeStatus - a function that gets the tree status from an anchor node, used for filtering out detached nodes\n\t * @param isShallowIndex - indicates if this index is shallow, meaning that it only allows nodes to be keyed off of fields directly under them rather than anywhere in their subtree.\n\t * As a performance optimization, re-indexing up the spine can be turned off for shallow indexes.\n\t */\n\tpublic constructor(\n\t\tprivate readonly forest: IForestSubscription,\n\t\tprivate readonly indexer: (\n\t\t\tschemaId: TreeNodeSchemaIdentifier,\n\t\t) => KeyFinder<TKey> | undefined,\n\t\tprivate readonly getValue: (anchorNodes: TreeIndexNodes<AnchorNode>) => TValue | undefined,\n\t\tprivate readonly checkTreeStatus: (node: AnchorNode) => TreeStatus | undefined,\n\t\tprivate readonly isShallowIndex = false,\n\t) {\n\t\tthis.forest.registerAnnouncedVisitor(this.keyFinder);\n\n\t\tconst detachedFieldKeys: FieldKey[] = [];\n\t\tconst detachedFieldsCursor = forest.getCursorAboveDetachedFields();\n\t\tforEachField(detachedFieldsCursor, (field) => {\n\t\t\tdetachedFieldKeys.push(field.getFieldKey());\n\t\t});\n\n\t\t// index all existing trees (this includes the primary document tree and all other detached/removed trees)\n\t\tfor (const fieldKey of detachedFieldKeys) {\n\t\t\tconst cursor = forest.allocateCursor();\n\t\t\tforest.tryMoveCursorToField({ fieldKey, parent: undefined }, cursor);\n\t\t\tthis.indexField(cursor);\n\t\t\tcursor.free();\n\t\t}\n\t}\n\n\t/**\n\t * Creates an announced visitor that responds to edits to the forest and updates the index accordingly.\n\t */\n\tprivate acquireVisitor(): AnnouncedVisitor {\n\t\tthis.checkNotDisposed(\n\t\t\t\"visitor getter should be deregistered from the forest when index is disposed\",\n\t\t);\n\t\tlet parentField: FieldKey | undefined;\n\t\tlet parent: UpPath | undefined;\n\n\t\treturn createAnnouncedVisitor({\n\t\t\t// nodes (and their entire subtrees) are added to the index as soon as they are created\n\t\t\tafterCreate: (content: ProtoNodes, destination: FieldKey) => {\n\t\t\t\tconst detachedCursor = this.forest.allocateCursor();\n\t\t\t\tassert(\n\t\t\t\t\tthis.forest.tryMoveCursorToField(\n\t\t\t\t\t\t{ fieldKey: destination, parent: undefined },\n\t\t\t\t\t\tdetachedCursor,\n\t\t\t\t\t) === TreeNavigationResult.Ok,\n\t\t\t\t\t0xa8a /* destination of created nodes must be a valid detached field */,\n\t\t\t\t);\n\t\t\t\tthis.indexField(detachedCursor);\n\t\t\t\tdetachedCursor.free();\n\t\t\t},\n\t\t\tafterAttach: () => {\n\t\t\t\tassert(parent !== undefined, 0xa99 /* must have a parent */);\n\t\t\t\tthis.reIndexSpine(parent);\n\t\t\t},\n\t\t\tafterDetach: () => {\n\t\t\t\tassert(parent !== undefined, 0xa9a /* must have a parent */);\n\t\t\t\tthis.reIndexSpine(parent);\n\t\t\t},\n\t\t\t// when a replace happens, the keys of previously indexed nodes could be changed so we must re-index them\n\t\t\tafterReplace: () => {\n\t\t\t\tassert(parent !== undefined, 0xa8b /* must have a parent */);\n\t\t\t\tconst cursor = this.forest.allocateCursor();\n\t\t\t\tthis.forest.moveCursorToPath(parent, cursor);\n\t\t\t\tassert(\n\t\t\t\t\tcursor.mode === CursorLocationType.Nodes,\n\t\t\t\t\t0xa8c /* replace should happen in a node */,\n\t\t\t\t);\n\t\t\t\tcursor.exitNode();\n\t\t\t\tthis.indexField(cursor);\n\t\t\t\tif (!this.isShallowIndex) {\n\t\t\t\t\t// we must also re-index the spine if the key finders allow for any value under a subtree to be the key\n\t\t\t\t\t// this means that a replace can cause the key for any node up its spine to be changed\n\t\t\t\t\tthis.indexSpine(cursor);\n\t\t\t\t}\n\t\t\t\tcursor.clear();\n\t\t\t},\n\t\t\t// the methods below are used to keep track of the path that has been traversed by the visitor\n\t\t\t// this is required so that cursors can be moved to the correct location when index updates are required\n\t\t\tenterNode(index: number): void {\n\t\t\t\tassert(parentField !== undefined, 0xa8d /* must be in a field to enter node */);\n\n\t\t\t\tparent = {\n\t\t\t\t\tparent,\n\t\t\t\t\tparentField,\n\t\t\t\t\tparentIndex: index,\n\t\t\t\t};\n\t\t\t\tparentField = undefined;\n\t\t\t},\n\t\t\texitNode(index: number): void {\n\t\t\t\tassert(parent !== undefined, 0xa8e /* must have parent node */);\n\t\t\t\tconst temp = parent;\n\t\t\t\tparentField = temp.parentField;\n\t\t\t\tparent = temp.parent;\n\t\t\t},\n\t\t\tenterField: (key: FieldKey) => {\n\t\t\t\tparentField = key;\n\t\t\t},\n\t\t\texitField(key: FieldKey): void {\n\t\t\t\tparentField = undefined;\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * Returns the value associated with the given key if it has been indexed\n\t */\n\tpublic get(key: TKey): TValue | undefined {\n\t\tthis.checkNotDisposed();\n\t\treturn this.getFilteredValue(this.keyToNodes.get(key));\n\t}\n\n\t/**\n\t * Returns true iff the key exists in the index\n\t */\n\tpublic has(key: TKey): boolean {\n\t\tthis.checkNotDisposed();\n\t\treturn this.get(key) !== undefined;\n\t}\n\n\t/**\n\t * Returns the number of values that are indexed\n\t */\n\tpublic get size(): number {\n\t\tthis.checkNotDisposed();\n\t\tlet s = 0;\n\t\tfor (const nodes of this.keyToNodes.values()) {\n\t\t\tif (this.getFilteredValue(nodes) !== undefined) {\n\t\t\t\ts += 1;\n\t\t\t}\n\t\t}\n\t\treturn s;\n\t}\n\n\t/**\n\t * Returns all keys in the index\n\t */\n\tpublic *keys(): IterableIterator<TKey> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tif (this.getFilteredValue(nodes) !== undefined) {\n\t\t\t\tyield key;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterable of values in the index\n\t */\n\tpublic *values(): IterableIterator<TValue> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const nodes of this.keyToNodes.values()) {\n\t\t\tconst filtered = this.getFilteredValue(nodes);\n\t\t\tif (filtered !== undefined) {\n\t\t\t\tyield filtered;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the index\n\t */\n\tpublic *entries(): IterableIterator<[TKey, TValue]> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tconst filtered = this.getFilteredValue(nodes);\n\t\t\tif (filtered !== undefined) {\n\t\t\t\tyield [key, filtered];\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<[TKey, TValue]> {\n\t\tthis.checkNotDisposed();\n\t\treturn this.entries();\n\t}\n\n\t/**\n\t * Applies the provided callback to each entry in the index.\n\t */\n\tpublic forEach(\n\t\tcallbackfn: (value: TValue, key: TKey, map: AnchorTreeIndex<TKey, TValue>) => void,\n\t\tthisArg?: unknown,\n\t): void {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tconst filtered = this.getFilteredValue(nodes);\n\t\t\tif (filtered !== undefined) {\n\t\t\t\tcallbackfn.call(thisArg, filtered, key, this);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the index, including ones that are detached.\n\t * This function should only be used for testing purposes, it is not exposed as part of the public {@link TreeIndex} API.\n\t */\n\tpublic *allEntries(): IterableIterator<[TKey, TValue]> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tconst value = this.getValue(nodes as unknown as TreeIndexNodes<AnchorNode>);\n\t\t\tif (value !== undefined) {\n\t\t\t\tyield [key, value];\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic dispose(): void {\n\t\tthis[disposeSymbol]();\n\t}\n\n\t/**\n\t * Disposes this index and all the anchors it holds onto.\n\t */\n\tpublic [disposeSymbol](): void {\n\t\tthis.checkNotDisposed(\"index is already disposed\");\n\t\tfor (const anchors of this.anchors.values()) {\n\t\t\tfor (const anchor of anchors) {\n\t\t\t\tthis.forest.forgetAnchor(anchor);\n\t\t\t}\n\t\t}\n\t\tthis.keyToNodes.clear();\n\t\tthis.anchors.clear();\n\t\tthis.forest.deregisterAnnouncedVisitor(this.keyFinder);\n\t\tthis.disposed = true;\n\t}\n\n\t/**\n\t * Checks if the spine needs to be re-indexed and if so, re-indexes it starting from the given path.\n\t */\n\tprivate reIndexSpine(path: UpPath): void {\n\t\tif (!this.isShallowIndex) {\n\t\t\tconst cursor = this.forest.allocateCursor();\n\t\t\tthis.forest.moveCursorToPath(path, cursor);\n\t\t\tassert(\n\t\t\t\tcursor.mode === CursorLocationType.Nodes,\n\t\t\t\t0xa9b /* attach should happen in a node */,\n\t\t\t);\n\t\t\tcursor.exitNode();\n\t\t\tthis.indexSpine(cursor);\n\t\t\tcursor.clear();\n\t\t}\n\t}\n\n\tprivate checkNotDisposed(errorMessage?: string): void {\n\t\tif (this.disposed) {\n\t\t\tif (errorMessage !== undefined) {\n\t\t\t\tthrow new Error(errorMessage);\n\t\t\t}\n\t\t\tassert(false, 0xa8f /* invalid operation on a disposed index */);\n\t\t}\n\t}\n\n\t/**\n\t * Given a cursor in node mode, indexes it.\n\t */\n\tprivate indexNode(nodeCursor: ITreeSubscriptionCursor): void {\n\t\tconst keyFinder = getOrCreate(\n\t\t\tthis.keyFinders,\n\t\t\t// the node schema type to look up\n\t\t\tnodeCursor.type,\n\t\t\t// if the indexer does not return a key finder for this schema, we cache a null value to indicate the indexer\n\t\t\t// does not need to be called if this schema is encountered in the future\n\t\t\t(schema) => this.indexer(schema) ?? null,\n\t\t);\n\n\t\tif (keyFinder !== null) {\n\t\t\tconst expectedPath = nodeCursor.getPath();\n\t\t\tconst key = keyFinder(nodeCursor);\n\t\t\t// TODO: determine perf impact of this check, alternative is not doing it in which case (if the key finder is not pure and functional),\n\t\t\t// an error may be thrown further down the line if the structure of the nodes aren't expected or the contents of the index could be inaccurate\n\t\t\tif (!compareUpPaths(nodeCursor.getPath(), expectedPath)) {\n\t\t\t\tthrow new Error(\"key finder should be pure and functional\");\n\t\t\t}\n\t\t\tconst anchor = nodeCursor.buildAnchor();\n\t\t\tconst anchorNode =\n\t\t\t\tthis.forest.anchors.locate(anchor) ?? fail(0xb16 /* expected anchor node */);\n\n\t\t\t// check if this anchor node already exists in the index\n\t\t\tconst existingKey = this.nodeToKey.get(anchorNode);\n\t\t\tif (existingKey !== undefined) {\n\t\t\t\t// if the node already exists but has the same key, we return early\n\t\t\t\tif (existingKey === key) {\n\t\t\t\t\tthis.forest.forgetAnchor(anchor);\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\t// if the node has a different key, we remove the existing one first because it means the key had been detached\n\t\t\t\t\tthis.removeAnchor(anchorNode, existingKey);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tgetOrCreate(this.keyToNodes, key, () => []).push(anchorNode);\n\t\t\tthis.nodeToKey.set(anchorNode, key);\n\n\t\t\tgetOrCreate(this.anchors, anchorNode, () => []).push(anchor);\n\t\t\t// when the anchor node is destroyed, delete it from the index\n\t\t\tanchorNode.events.on(\"afterDestroy\", () => {\n\t\t\t\tthis.removeAnchor(anchorNode, key);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Given a cursor in field mode, recursively indexes all nodes under the field.\n\t */\n\tprivate indexField(fieldCursor: ITreeSubscriptionCursor): void {\n\t\tforEachNode(fieldCursor, (nodeCursor) => {\n\t\t\tthis.indexNode(nodeCursor);\n\n\t\t\tforEachField(nodeCursor, (f) => {\n\t\t\t\tthis.indexField(f);\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Given a cursor in field mode, indexes all nodes under the field and then indexes all nodes up the spine.\n\t */\n\tprivate indexSpine(cursor: ITreeSubscriptionCursor): void {\n\t\tif (keyAsDetachedField(cursor.getFieldKey()) !== rootField) {\n\t\t\tcursor.exitField();\n\t\t\tcursor.exitNode();\n\t\t} else {\n\t\t\t// return early if we're already at the root field\n\t\t\treturn;\n\t\t}\n\n\t\t// walk up the spine and index nodes until we reach the root\n\t\twhile (\n\t\t\tcursor.mode === CursorLocationType.Fields &&\n\t\t\tkeyAsDetachedField(cursor.getFieldKey()) !== rootField\n\t\t) {\n\t\t\tforEachNode(cursor, (nodeCursor) => {\n\t\t\t\tthis.indexNode(nodeCursor);\n\t\t\t});\n\n\t\t\tcursor.exitField();\n\t\t\tcursor.exitNode();\n\t\t}\n\t}\n\n\tprivate removeAnchor(anchorNode: AnchorNode, key: TKey): void {\n\t\tconst indexedNodes = this.keyToNodes.get(key);\n\t\tassert(\n\t\t\tindexedNodes !== undefined,\n\t\t\t0xa90 /* destroyed anchor node should be tracked by index */,\n\t\t);\n\t\tconst index = indexedNodes.indexOf(anchorNode);\n\t\tassert(index !== -1, 0xa91 /* destroyed anchor node should be tracked by index */);\n\t\tconst newNodes = filterNodes(indexedNodes, (n) => n !== anchorNode);\n\t\tif (newNodes !== undefined && newNodes.length > 0) {\n\t\t\tthis.keyToNodes.set(key, newNodes);\n\t\t} else {\n\t\t\tthis.keyToNodes.delete(key);\n\t\t}\n\t\tthis.nodeToKey.delete(anchorNode);\n\t\tassert(\n\t\t\tthis.anchors.delete(anchorNode),\n\t\t\t0xa92 /* destroyed anchor should be tracked by index */,\n\t\t);\n\t}\n\n\t/**\n\t * Filters out any anchor nodes that are detached and returns the value for the remaining nodes.\n\t */\n\tprivate getFilteredValue(anchorNodes: AnchorNode[] | undefined): TValue | undefined {\n\t\tconst attachedNodes = filterNodes(anchorNodes, (anchorNode) => {\n\t\t\tconst nodeStatus = this.checkTreeStatus(anchorNode);\n\t\t\treturn nodeStatus === TreeStatus.InDocument;\n\t\t});\n\n\t\tif (attachedNodes !== undefined && hasElement(attachedNodes)) {\n\t\t\treturn this.getValue(attachedNodes);\n\t\t}\n\t}\n}\n\n/**\n * Filters the given anchor nodes based on the given filter function.\n */\nfunction filterNodes(\n\tanchorNodes: readonly AnchorNode[] | undefined,\n\tfilter: (node: AnchorNode) => boolean,\n): AnchorNode[] | undefined {\n\tif (anchorNodes !== undefined) {\n\t\treturn anchorNodes.filter(filter);\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Checks that an array is of the type {@link TreeIndexNodes} and has at least one element.\n */\nexport function hasElement<T>(array: readonly T[]): array is TreeIndexNodes<T> {\n\treturn array.length >= 1;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"anchorTreeIndex.js","sourceRoot":"","sources":["../../../src/feature-libraries/indexing/anchorTreeIndex.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AACnE,kDAAiE;AACjE,kDAkB6B;AAE7B,oDAAmD;AAenD;;;;;;;GAOG;AACH,MAAa,eAAe;IA4B3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EAAE,EAAE;YAC7D,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;YACpD,OAAO,UAAU,KAAK,qBAAU,CAAC,UAAU,CAAC;QAC7C,CAAC,CAAC,CAAC;QAEH,IAAI,aAAa,KAAK,SAAS,IAAI,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;YAC9D,OAAO,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QACrC,CAAC;IACF,CAAC;CACD;AA3ZD,0CA2ZC;AAED;;GAEG;AACH,SAAS,WAAW,CACnB,WAA8C,EAC9C,MAAqC;IAErC,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAgB,UAAU,CAAI,KAAmB;IAChD,OAAO,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;AAC1B,CAAC;AAFD,gCAEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport { disposeSymbol, getOrCreate } from \"../../util/index.js\";\nimport {\n\ttype Anchor,\n\ttype AnchorNode,\n\ttype FieldKey,\n\ttype TreeNodeSchemaIdentifier,\n\tforEachField,\n\tforEachNode,\n\ttype ITreeSubscriptionCursor,\n\tcreateAnnouncedVisitor,\n\ttype IForestSubscription,\n\ttype AnnouncedVisitor,\n\tCursorLocationType,\n\trootField,\n\ttype UpPath,\n\tkeyAsDetachedField,\n\tcompareUpPaths,\n\tTreeNavigationResult,\n\ttype ITreeCursorSynchronous,\n} from \"../../core/index.js\";\nimport type { TreeIndex, TreeIndexKey, TreeIndexNodes } from \"./types.js\";\nimport { TreeStatus } from \"../flex-tree/index.js\";\n\n/**\n * A function that gets the value to index a node on, must be pure and functional.\n * The given cursor should point to the node that will be indexed.\n *\n * @returns a value the index will use as the key for the given node\n *\n * @remarks\n * This function does not own the cursor in any way, it walks the cursor to find the key the node is indexed on\n * but returns the cursor to the state it was in before being passed to the function. It should also not be disposed by this function\n * and must be disposed elsewhere.\n */\nexport type KeyFinder<TKey extends TreeIndexKey> = (tree: ITreeSubscriptionCursor) => TKey;\n\n/**\n * An index from some arbitrary keys to anchor nodes. Keys can be anything that is a {@link TreeValue}.\n * A key can map to multiple nodes but each collection of nodes only results in a single value.\n *\n * @remarks\n * Detached nodes are stored in the index but filtered out when any public facing apis are called. This means that\n * calling {@link keys} will not include any keys that are stored in the index but only map to detached nodes.\n */\nexport class AnchorTreeIndex<TKey extends TreeIndexKey, TValue>\n\timplements TreeIndex<TKey, TValue>\n{\n\tpublic disposed = false;\n\t/**\n\t * Caches {@link KeyFinder}s for each schema definition. If a schema maps to null, it does not\n\t * need to be considered at all for this index. This allows us to skip subtrees that aren't relevant\n\t * as a performance optimization.\n\t */\n\tprivate readonly keyFinders = new Map<TreeNodeSchemaIdentifier, KeyFinder<TKey> | null>();\n\t/**\n\t * The actual index from keys to anchor nodes.\n\t */\n\tprivate readonly keyToNodes = new Map<TKey, AnchorNode[]>();\n\t/**\n\t * Maintained for efficient removal of anchor nodes from the index when updating their keys\n\t */\n\tprivate readonly nodeToKey = new Map<AnchorNode, TKey>();\n\t/**\n\t * Keeps track of anchors for disposal.\n\t */\n\tprivate readonly anchors = new Map<AnchorNode, Anchor[]>();\n\t/**\n\t * The key finder that is registered on the forest to keep this index updated, maintained\n\t * here for deregistration on disposal\n\t */\n\tprivate readonly keyFinder = this.acquireVisitor.bind(this);\n\n\t/**\n\t * @param forest - the forest that is being indexed\n\t * @param indexer - a function that retrieves the key finder based on a given schema or undefined if the schema does not have an associated key finder\n\t * @param getValue - a pure and functional function that returns the associated value of one or more anchor nodes, can be used to map and filter the indexed anchor nodes\n\t * so that the values returned from the index are more usable\n\t * @param checkTreeStatus - a function that gets the tree status from an anchor node, used for filtering out detached nodes\n\t * @param isShallowIndex - indicates if this index is shallow, meaning that it only allows nodes to be keyed off of fields directly under them rather than anywhere in their subtree.\n\t * As a performance optimization, re-indexing up the spine can be turned off for shallow indexes.\n\t */\n\tpublic constructor(\n\t\tprivate readonly forest: IForestSubscription,\n\t\tprivate readonly indexer: (\n\t\t\tschemaId: TreeNodeSchemaIdentifier,\n\t\t) => KeyFinder<TKey> | undefined,\n\t\tprivate readonly getValue: (anchorNodes: TreeIndexNodes<AnchorNode>) => TValue | undefined,\n\t\tprivate readonly checkTreeStatus: (node: AnchorNode) => TreeStatus | undefined,\n\t\tprivate readonly isShallowIndex = false,\n\t) {\n\t\tthis.forest.registerAnnouncedVisitor(this.keyFinder);\n\n\t\tconst detachedFieldKeys: FieldKey[] = [];\n\t\tconst detachedFieldsCursor = forest.getCursorAboveDetachedFields();\n\t\tforEachField(detachedFieldsCursor, (field) => {\n\t\t\tdetachedFieldKeys.push(field.getFieldKey());\n\t\t});\n\n\t\t// index all existing trees (this includes the primary document tree and all other detached/removed trees)\n\t\tfor (const fieldKey of detachedFieldKeys) {\n\t\t\tconst cursor = forest.allocateCursor();\n\t\t\tforest.tryMoveCursorToField({ fieldKey, parent: undefined }, cursor);\n\t\t\tthis.indexField(cursor);\n\t\t\tcursor.free();\n\t\t}\n\t}\n\n\t/**\n\t * Creates an announced visitor that responds to edits to the forest and updates the index accordingly.\n\t */\n\tprivate acquireVisitor(): AnnouncedVisitor {\n\t\tthis.checkNotDisposed(\n\t\t\t\"visitor getter should be deregistered from the forest when index is disposed\",\n\t\t);\n\t\tlet parentField: FieldKey | undefined;\n\t\tlet parent: UpPath | undefined;\n\n\t\treturn createAnnouncedVisitor({\n\t\t\t// nodes (and their entire subtrees) are added to the index as soon as they are created\n\t\t\tafterCreate: (content: readonly ITreeCursorSynchronous[], destination: FieldKey) => {\n\t\t\t\tconst detachedCursor = this.forest.allocateCursor();\n\t\t\t\tassert(\n\t\t\t\t\tthis.forest.tryMoveCursorToField(\n\t\t\t\t\t\t{ fieldKey: destination, parent: undefined },\n\t\t\t\t\t\tdetachedCursor,\n\t\t\t\t\t) === TreeNavigationResult.Ok,\n\t\t\t\t\t0xa8a /* destination of created nodes must be a valid detached field */,\n\t\t\t\t);\n\t\t\t\tthis.indexField(detachedCursor);\n\t\t\t\tdetachedCursor.free();\n\t\t\t},\n\t\t\tafterAttach: () => {\n\t\t\t\tassert(parent !== undefined, 0xa99 /* must have a parent */);\n\t\t\t\tthis.reIndexSpine(parent);\n\t\t\t},\n\t\t\tafterDetach: () => {\n\t\t\t\tassert(parent !== undefined, 0xa9a /* must have a parent */);\n\t\t\t\tthis.reIndexSpine(parent);\n\t\t\t},\n\t\t\t// when a replace happens, the keys of previously indexed nodes could be changed so we must re-index them\n\t\t\tafterReplace: () => {\n\t\t\t\tassert(parent !== undefined, 0xa8b /* must have a parent */);\n\t\t\t\tconst cursor = this.forest.allocateCursor();\n\t\t\t\tthis.forest.moveCursorToPath(parent, cursor);\n\t\t\t\tassert(\n\t\t\t\t\tcursor.mode === CursorLocationType.Nodes,\n\t\t\t\t\t0xa8c /* replace should happen in a node */,\n\t\t\t\t);\n\t\t\t\tcursor.exitNode();\n\t\t\t\tthis.indexField(cursor);\n\t\t\t\tif (!this.isShallowIndex) {\n\t\t\t\t\t// we must also re-index the spine if the key finders allow for any value under a subtree to be the key\n\t\t\t\t\t// this means that a replace can cause the key for any node up its spine to be changed\n\t\t\t\t\tthis.indexSpine(cursor);\n\t\t\t\t}\n\t\t\t\tcursor.clear();\n\t\t\t},\n\t\t\t// the methods below are used to keep track of the path that has been traversed by the visitor\n\t\t\t// this is required so that cursors can be moved to the correct location when index updates are required\n\t\t\tenterNode(index: number): void {\n\t\t\t\tassert(parentField !== undefined, 0xa8d /* must be in a field to enter node */);\n\n\t\t\t\tparent = {\n\t\t\t\t\tparent,\n\t\t\t\t\tparentField,\n\t\t\t\t\tparentIndex: index,\n\t\t\t\t};\n\t\t\t\tparentField = undefined;\n\t\t\t},\n\t\t\texitNode(index: number): void {\n\t\t\t\tassert(parent !== undefined, 0xa8e /* must have parent node */);\n\t\t\t\tconst temp = parent;\n\t\t\t\tparentField = temp.parentField;\n\t\t\t\tparent = temp.parent;\n\t\t\t},\n\t\t\tenterField: (key: FieldKey) => {\n\t\t\t\tparentField = key;\n\t\t\t},\n\t\t\texitField(key: FieldKey): void {\n\t\t\t\tparentField = undefined;\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * Returns the value associated with the given key if it has been indexed\n\t */\n\tpublic get(key: TKey): TValue | undefined {\n\t\tthis.checkNotDisposed();\n\t\treturn this.getFilteredValue(this.keyToNodes.get(key));\n\t}\n\n\t/**\n\t * Returns true iff the key exists in the index\n\t */\n\tpublic has(key: TKey): boolean {\n\t\tthis.checkNotDisposed();\n\t\treturn this.get(key) !== undefined;\n\t}\n\n\t/**\n\t * Returns the number of values that are indexed\n\t */\n\tpublic get size(): number {\n\t\tthis.checkNotDisposed();\n\t\tlet s = 0;\n\t\tfor (const nodes of this.keyToNodes.values()) {\n\t\t\tif (this.getFilteredValue(nodes) !== undefined) {\n\t\t\t\ts += 1;\n\t\t\t}\n\t\t}\n\t\treturn s;\n\t}\n\n\t/**\n\t * Returns all keys in the index\n\t */\n\tpublic *keys(): IterableIterator<TKey> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tif (this.getFilteredValue(nodes) !== undefined) {\n\t\t\t\tyield key;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterable of values in the index\n\t */\n\tpublic *values(): IterableIterator<TValue> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const nodes of this.keyToNodes.values()) {\n\t\t\tconst filtered = this.getFilteredValue(nodes);\n\t\t\tif (filtered !== undefined) {\n\t\t\t\tyield filtered;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the index\n\t */\n\tpublic *entries(): IterableIterator<[TKey, TValue]> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tconst filtered = this.getFilteredValue(nodes);\n\t\t\tif (filtered !== undefined) {\n\t\t\t\tyield [key, filtered];\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<[TKey, TValue]> {\n\t\tthis.checkNotDisposed();\n\t\treturn this.entries();\n\t}\n\n\t/**\n\t * Applies the provided callback to each entry in the index.\n\t */\n\tpublic forEach(\n\t\tcallbackfn: (value: TValue, key: TKey, map: AnchorTreeIndex<TKey, TValue>) => void,\n\t\tthisArg?: unknown,\n\t): void {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tconst filtered = this.getFilteredValue(nodes);\n\t\t\tif (filtered !== undefined) {\n\t\t\t\tcallbackfn.call(thisArg, filtered, key, this);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the index, including ones that are detached.\n\t * This function should only be used for testing purposes, it is not exposed as part of the public {@link TreeIndex} API.\n\t */\n\tpublic *allEntries(): IterableIterator<[TKey, TValue]> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tconst value = this.getValue(nodes as unknown as TreeIndexNodes<AnchorNode>);\n\t\t\tif (value !== undefined) {\n\t\t\t\tyield [key, value];\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic dispose(): void {\n\t\tthis[disposeSymbol]();\n\t}\n\n\t/**\n\t * Disposes this index and all the anchors it holds onto.\n\t */\n\tpublic [disposeSymbol](): void {\n\t\tthis.checkNotDisposed(\"index is already disposed\");\n\t\tfor (const anchors of this.anchors.values()) {\n\t\t\tfor (const anchor of anchors) {\n\t\t\t\tthis.forest.forgetAnchor(anchor);\n\t\t\t}\n\t\t}\n\t\tthis.keyToNodes.clear();\n\t\tthis.anchors.clear();\n\t\tthis.forest.deregisterAnnouncedVisitor(this.keyFinder);\n\t\tthis.disposed = true;\n\t}\n\n\t/**\n\t * Checks if the spine needs to be re-indexed and if so, re-indexes it starting from the given path.\n\t */\n\tprivate reIndexSpine(path: UpPath): void {\n\t\tif (!this.isShallowIndex) {\n\t\t\tconst cursor = this.forest.allocateCursor();\n\t\t\tthis.forest.moveCursorToPath(path, cursor);\n\t\t\tassert(\n\t\t\t\tcursor.mode === CursorLocationType.Nodes,\n\t\t\t\t0xa9b /* attach should happen in a node */,\n\t\t\t);\n\t\t\tcursor.exitNode();\n\t\t\tthis.indexSpine(cursor);\n\t\t\tcursor.clear();\n\t\t}\n\t}\n\n\tprivate checkNotDisposed(errorMessage?: string): void {\n\t\tif (this.disposed) {\n\t\t\tif (errorMessage !== undefined) {\n\t\t\t\tthrow new Error(errorMessage);\n\t\t\t}\n\t\t\tassert(false, 0xa8f /* invalid operation on a disposed index */);\n\t\t}\n\t}\n\n\t/**\n\t * Given a cursor in node mode, indexes it.\n\t */\n\tprivate indexNode(nodeCursor: ITreeSubscriptionCursor): void {\n\t\tconst keyFinder = getOrCreate(\n\t\t\tthis.keyFinders,\n\t\t\t// the node schema type to look up\n\t\t\tnodeCursor.type,\n\t\t\t// if the indexer does not return a key finder for this schema, we cache a null value to indicate the indexer\n\t\t\t// does not need to be called if this schema is encountered in the future\n\t\t\t(schema) => this.indexer(schema) ?? null,\n\t\t);\n\n\t\tif (keyFinder !== null) {\n\t\t\tconst expectedPath = nodeCursor.getPath();\n\t\t\tconst key = keyFinder(nodeCursor);\n\t\t\t// TODO: determine perf impact of this check, alternative is not doing it in which case (if the key finder is not pure and functional),\n\t\t\t// an error may be thrown further down the line if the structure of the nodes aren't expected or the contents of the index could be inaccurate\n\t\t\tif (!compareUpPaths(nodeCursor.getPath(), expectedPath)) {\n\t\t\t\tthrow new Error(\"key finder should be pure and functional\");\n\t\t\t}\n\t\t\tconst anchor = nodeCursor.buildAnchor();\n\t\t\tconst anchorNode =\n\t\t\t\tthis.forest.anchors.locate(anchor) ?? fail(0xb16 /* expected anchor node */);\n\n\t\t\t// check if this anchor node already exists in the index\n\t\t\tconst existingKey = this.nodeToKey.get(anchorNode);\n\t\t\tif (existingKey !== undefined) {\n\t\t\t\t// if the node already exists but has the same key, we return early\n\t\t\t\tif (existingKey === key) {\n\t\t\t\t\tthis.forest.forgetAnchor(anchor);\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\t// if the node has a different key, we remove the existing one first because it means the key had been detached\n\t\t\t\t\tthis.removeAnchor(anchorNode, existingKey);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tgetOrCreate(this.keyToNodes, key, () => []).push(anchorNode);\n\t\t\tthis.nodeToKey.set(anchorNode, key);\n\n\t\t\tgetOrCreate(this.anchors, anchorNode, () => []).push(anchor);\n\t\t\t// when the anchor node is destroyed, delete it from the index\n\t\t\tanchorNode.events.on(\"afterDestroy\", () => {\n\t\t\t\tthis.removeAnchor(anchorNode, key);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Given a cursor in field mode, recursively indexes all nodes under the field.\n\t */\n\tprivate indexField(fieldCursor: ITreeSubscriptionCursor): void {\n\t\tforEachNode(fieldCursor, (nodeCursor) => {\n\t\t\tthis.indexNode(nodeCursor);\n\n\t\t\tforEachField(nodeCursor, (f) => {\n\t\t\t\tthis.indexField(f);\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Given a cursor in field mode, indexes all nodes under the field and then indexes all nodes up the spine.\n\t */\n\tprivate indexSpine(cursor: ITreeSubscriptionCursor): void {\n\t\tif (keyAsDetachedField(cursor.getFieldKey()) !== rootField) {\n\t\t\tcursor.exitField();\n\t\t\tcursor.exitNode();\n\t\t} else {\n\t\t\t// return early if we're already at the root field\n\t\t\treturn;\n\t\t}\n\n\t\t// walk up the spine and index nodes until we reach the root\n\t\twhile (\n\t\t\tcursor.mode === CursorLocationType.Fields &&\n\t\t\tkeyAsDetachedField(cursor.getFieldKey()) !== rootField\n\t\t) {\n\t\t\tforEachNode(cursor, (nodeCursor) => {\n\t\t\t\tthis.indexNode(nodeCursor);\n\t\t\t});\n\n\t\t\tcursor.exitField();\n\t\t\tcursor.exitNode();\n\t\t}\n\t}\n\n\tprivate removeAnchor(anchorNode: AnchorNode, key: TKey): void {\n\t\tconst indexedNodes = this.keyToNodes.get(key);\n\t\tassert(\n\t\t\tindexedNodes !== undefined,\n\t\t\t0xa90 /* destroyed anchor node should be tracked by index */,\n\t\t);\n\t\tconst index = indexedNodes.indexOf(anchorNode);\n\t\tassert(index !== -1, 0xa91 /* destroyed anchor node should be tracked by index */);\n\t\tconst newNodes = filterNodes(indexedNodes, (n) => n !== anchorNode);\n\t\tif (newNodes !== undefined && newNodes.length > 0) {\n\t\t\tthis.keyToNodes.set(key, newNodes);\n\t\t} else {\n\t\t\tthis.keyToNodes.delete(key);\n\t\t}\n\t\tthis.nodeToKey.delete(anchorNode);\n\t\tassert(\n\t\t\tthis.anchors.delete(anchorNode),\n\t\t\t0xa92 /* destroyed anchor should be tracked by index */,\n\t\t);\n\t}\n\n\t/**\n\t * Filters out any anchor nodes that are detached and returns the value for the remaining nodes.\n\t */\n\tprivate getFilteredValue(anchorNodes: AnchorNode[] | undefined): TValue | undefined {\n\t\tconst attachedNodes = filterNodes(anchorNodes, (anchorNode) => {\n\t\t\tconst nodeStatus = this.checkTreeStatus(anchorNode);\n\t\t\treturn nodeStatus === TreeStatus.InDocument;\n\t\t});\n\n\t\tif (attachedNodes !== undefined && hasElement(attachedNodes)) {\n\t\t\treturn this.getValue(attachedNodes);\n\t\t}\n\t}\n}\n\n/**\n * Filters the given anchor nodes based on the given filter function.\n */\nfunction filterNodes(\n\tanchorNodes: readonly AnchorNode[] | undefined,\n\tfilter: (node: AnchorNode) => boolean,\n): AnchorNode[] | undefined {\n\tif (anchorNodes !== undefined) {\n\t\treturn anchorNodes.filter(filter);\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Checks that an array is of the type {@link TreeIndexNodes} and has at least one element.\n */\nexport function hasElement<T>(array: readonly T[]): array is TreeIndexNodes<T> {\n\treturn array.length >= 1;\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
6
|
+
import { type IEditableForest, type ITreeCursorSynchronous, type RevisionTagCodec } from "../core/index.js";
|
|
7
|
+
/**
|
|
8
|
+
* Initializes the given forest with the given content.
|
|
9
|
+
* @remarks The forest must be empty when this function is called.
|
|
10
|
+
* This does not perform an edit in the typical sense.
|
|
11
|
+
* Instead, it creates a delta expressing a creation and insertion of the `content` under the {@link rootFieldKey}, and then applies the delta to the forest.
|
|
12
|
+
* If `visitAnchors` is enabled, then the delta will also be applied to the forest's {@link AnchorSet} (in which case there must be no existing anchors when this function is called).
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* This does not perform an edit: it updates the forest content as if there was an edit that did that.
|
|
16
|
+
*/
|
|
17
|
+
export declare function initializeForest(forest: IEditableForest, content: ITreeCursorSynchronous, revisionTagCodec: RevisionTagCodec, idCompressor: IIdCompressor, visitAnchors?: boolean): void;
|
|
18
|
+
//# sourceMappingURL=initializeForest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initializeForest.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/initializeForest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAA4B,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAG7F,OAAO,EAEN,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EAKrB,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC/B,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,sBAAsB,EAC/B,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,aAAa,EAC3B,YAAY,UAAQ,GAClB,IAAI,CAmBN"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.initializeForest = void 0;
|
|
8
|
+
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
9
|
+
const index_js_1 = require("../core/index.js");
|
|
10
|
+
/**
|
|
11
|
+
* Initializes the given forest with the given content.
|
|
12
|
+
* @remarks The forest must be empty when this function is called.
|
|
13
|
+
* This does not perform an edit in the typical sense.
|
|
14
|
+
* Instead, it creates a delta expressing a creation and insertion of the `content` under the {@link rootFieldKey}, and then applies the delta to the forest.
|
|
15
|
+
* If `visitAnchors` is enabled, then the delta will also be applied to the forest's {@link AnchorSet} (in which case there must be no existing anchors when this function is called).
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* This does not perform an edit: it updates the forest content as if there was an edit that did that.
|
|
19
|
+
*/
|
|
20
|
+
function initializeForest(forest, content, revisionTagCodec, idCompressor, visitAnchors = false) {
|
|
21
|
+
(0, internal_1.assert)(forest.isEmpty, 0x747 /* forest must be empty */);
|
|
22
|
+
const delta = (0, index_js_1.deltaForRootInitialization)(forest.chunkField(content));
|
|
23
|
+
let visitor = forest.acquireVisitor();
|
|
24
|
+
if (visitAnchors) {
|
|
25
|
+
(0, internal_1.assert)(forest.anchors.isEmpty(), 0x9b7 /* anchor set must be empty */);
|
|
26
|
+
const anchorVisitor = forest.anchors.acquireVisitor();
|
|
27
|
+
visitor = (0, index_js_1.combineVisitors)([visitor, anchorVisitor]);
|
|
28
|
+
}
|
|
29
|
+
// any detached trees built here are immediately attached so the revision used here doesn't matter
|
|
30
|
+
// we use a dummy revision to make correctness checks in the detached field index easier
|
|
31
|
+
(0, index_js_1.visitDelta)(delta, visitor, (0, index_js_1.makeDetachedFieldIndex)("init", revisionTagCodec, idCompressor), 0);
|
|
32
|
+
visitor.free();
|
|
33
|
+
}
|
|
34
|
+
exports.initializeForest = initializeForest;
|
|
35
|
+
//# sourceMappingURL=initializeForest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initializeForest.js","sourceRoot":"","sources":["../../src/feature-libraries/initializeForest.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAA6D;AAE7D,+CAS0B;AAE1B;;;;;;;;;GASG;AACH,SAAgB,gBAAgB,CAC/B,MAAuB,EACvB,OAA+B,EAC/B,gBAAkC,EAClC,YAA2B,EAC3B,YAAY,GAAG,KAAK;IAEpB,IAAA,iBAAM,EAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,0BAA0B,CAAC,CAAC;IACzD,MAAM,KAAK,GAAc,IAAA,qCAA0B,EAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;IAChF,IAAI,OAAO,GAAG,MAAM,CAAC,cAAc,EAAE,CAAC;IACtC,IAAI,YAAY,EAAE,CAAC;QAClB,IAAA,iBAAM,EAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,8BAA8B,CAAC,CAAC;QACvE,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;QACtD,OAAO,GAAG,IAAA,0BAAe,EAAC,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;IACrD,CAAC;IAED,kGAAkG;IAClG,wFAAwF;IACxF,IAAA,qBAAU,EACT,KAAK,EACL,OAAO,EACP,IAAA,iCAAsB,EAAC,MAAM,EAAE,gBAAgB,EAAE,YAAY,CAAC,EAC9D,CAA6B,CAC7B,CAAC;IACF,OAAO,CAAC,IAAI,EAAE,CAAC;AAChB,CAAC;AAzBD,4CAyBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { SessionSpaceCompressedId, IIdCompressor } from \"@fluidframework/id-compressor\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype DeltaRoot,\n\ttype IEditableForest,\n\ttype ITreeCursorSynchronous,\n\ttype RevisionTagCodec,\n\tcombineVisitors,\n\tdeltaForRootInitialization,\n\tmakeDetachedFieldIndex,\n\tvisitDelta,\n} from \"../core/index.js\";\n\n/**\n * Initializes the given forest with the given content.\n * @remarks The forest must be empty when this function is called.\n * This does not perform an edit in the typical sense.\n * Instead, it creates a delta expressing a creation and insertion of the `content` under the {@link rootFieldKey}, and then applies the delta to the forest.\n * If `visitAnchors` is enabled, then the delta will also be applied to the forest's {@link AnchorSet} (in which case there must be no existing anchors when this function is called).\n *\n * @remarks\n * This does not perform an edit: it updates the forest content as if there was an edit that did that.\n */\nexport function initializeForest(\n\tforest: IEditableForest,\n\tcontent: ITreeCursorSynchronous,\n\trevisionTagCodec: RevisionTagCodec,\n\tidCompressor: IIdCompressor,\n\tvisitAnchors = false,\n): void {\n\tassert(forest.isEmpty, 0x747 /* forest must be empty */);\n\tconst delta: DeltaRoot = deltaForRootInitialization(forest.chunkField(content));\n\tlet visitor = forest.acquireVisitor();\n\tif (visitAnchors) {\n\t\tassert(forest.anchors.isEmpty(), 0x9b7 /* anchor set must be empty */);\n\t\tconst anchorVisitor = forest.anchors.acquireVisitor();\n\t\tvisitor = combineVisitors([visitor, anchorVisitor]);\n\t}\n\n\t// any detached trees built here are immediately attached so the revision used here doesn't matter\n\t// we use a dummy revision to make correctness checks in the detached field index easier\n\tvisitDelta(\n\t\tdelta,\n\t\tvisitor,\n\t\tmakeDetachedFieldIndex(\"init\", revisionTagCodec, idCompressor),\n\t\t0 as SessionSpaceCompressedId,\n\t);\n\tvisitor.free();\n}\n"]}
|
|
@@ -60,10 +60,10 @@ function allowsTreeSuperset(policy, originalData, original, superset) {
|
|
|
60
60
|
a: original.objectNodeFields,
|
|
61
61
|
b: superset.objectNodeFields,
|
|
62
62
|
aExtra: (originalField) => allowsFieldSuperset(policy, originalData, original.objectNodeFields.get(originalField) ??
|
|
63
|
-
(0,
|
|
63
|
+
(0, internal_1.fail)(0xb17 /* missing expected field */), normalizeField(undefined)),
|
|
64
64
|
bExtra: (supersetField) => allowsFieldSuperset(policy, originalData, normalizeField(undefined), superset.objectNodeFields.get(supersetField) ??
|
|
65
|
-
(0,
|
|
66
|
-
same: (sameField) => allowsFieldSuperset(policy, originalData, original.objectNodeFields.get(sameField) ?? (0,
|
|
65
|
+
(0, internal_1.fail)(0xb18 /* missing expected field */)),
|
|
66
|
+
same: (sameField) => allowsFieldSuperset(policy, originalData, original.objectNodeFields.get(sameField) ?? (0, internal_1.fail)(0xb19 /* missing expected field */), superset.objectNodeFields.get(sameField) ?? (0, internal_1.fail)(0xb1a /* missing expected field */)),
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
exports.allowsTreeSuperset = allowsTreeSuperset;
|
|
@@ -82,7 +82,7 @@ exports.allowsValueSuperset = allowsValueSuperset;
|
|
|
82
82
|
* This does not require a strict (aka proper) superset: equivalent schema will return true.
|
|
83
83
|
*/
|
|
84
84
|
function allowsFieldSuperset(policy, originalData, original, superset) {
|
|
85
|
-
return (0, fieldKindWithEditor_js_1.withEditor)(policy.fieldKinds.get(original.kind) ?? (0,
|
|
85
|
+
return (0, fieldKindWithEditor_js_1.withEditor)(policy.fieldKinds.get(original.kind) ?? (0, internal_1.fail)(0xb1b /* missing kind */)).allowsFieldSuperset(policy, originalData, original.types, superset);
|
|
86
86
|
}
|
|
87
87
|
exports.allowsFieldSuperset = allowsFieldSuperset;
|
|
88
88
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comparison.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA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,IACC,CAAC,mBAAmB,CACnB,MAAM,EACN,QAAQ,EACR,QAAQ,CAAC,eAAe,EACxB,QAAQ,CAAC,eAAe,CACxB,EACA,CAAC;YACF,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,KAAK,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC;QACjD,yGAAyG;QACzG,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACjF,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAzBD,gDAyBC;AAED,SAAgB,cAAc,CAC7B,MAAyC;IAEzC,OAAO,MAAM,IAAI,iCAAsB,CAAC;AACzC,CAAC;AAJD,wCAIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n\tstoredEmptyFieldSchema,\n} from \"../../core/index.js\";\nimport { compareSets, fail } from \"../../util/index.js\";\n\nimport type { FullSchemaPolicy } from \"./fieldKind.js\";\nimport { withEditor } from \"./fieldKindWithEditor.js\";\nimport { isNeverTree } from \"./isNeverTree.js\";\n\n// TODO:\n// The comparisons in this file seem redundant with those in discrepancies.ts.\n// Rather than both existing, one of which just returns boolean and the other which returns additional details, a simple comparison which returns everything needed should be used.\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * `undefined` TreeNodeStoredSchema means the schema is not present (and thus treated as a NeverTree).\n */\nexport function allowsTreeSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeNodeStoredSchema | undefined,\n\tsuperset: TreeNodeStoredSchema | undefined,\n): boolean {\n\tif (isNeverTree(policy, originalData, original)) {\n\t\treturn true;\n\t}\n\tif (isNeverTree(policy, originalData, superset)) {\n\t\treturn false;\n\t}\n\tassert(original !== undefined, 0x716 /* only never trees have undefined schema */);\n\tassert(superset !== undefined, 0x717 /* only never trees have undefined schema */);\n\tif (original instanceof LeafNodeStoredSchema) {\n\t\tif (superset instanceof LeafNodeStoredSchema) {\n\t\t\treturn allowsValueSuperset(original.leafValue, superset.leafValue);\n\t\t}\n\t\treturn false;\n\t}\n\n\tif (superset instanceof LeafNodeStoredSchema) {\n\t\treturn false;\n\t}\n\n\tassert(\n\t\toriginal instanceof MapNodeStoredSchema || original instanceof ObjectNodeStoredSchema,\n\t\t0x893 /* unsupported node kind */,\n\t);\n\tassert(\n\t\tsuperset instanceof MapNodeStoredSchema || superset instanceof ObjectNodeStoredSchema,\n\t\t0x894 /* unsupported node kind */,\n\t);\n\n\tif (original instanceof MapNodeStoredSchema) {\n\t\tif (superset instanceof MapNodeStoredSchema) {\n\t\t\treturn allowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\tnormalizeField(original.mapFields),\n\t\t\t\tnormalizeField(superset.mapFields),\n\t\t\t);\n\t\t}\n\t\treturn false;\n\t}\n\n\tassert(original instanceof ObjectNodeStoredSchema, 0x895 /* unsupported node kind */);\n\tif (superset instanceof MapNodeStoredSchema) {\n\t\tfor (const [_key, field] of original.objectNodeFields) {\n\t\t\tif (\n\t\t\t\t!allowsFieldSuperset(\n\t\t\t\t\tpolicy,\n\t\t\t\t\toriginalData,\n\t\t\t\t\tnormalizeField(field),\n\t\t\t\t\tnormalizeField(superset.mapFields),\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\tassert(superset instanceof ObjectNodeStoredSchema, 0x896 /* unsupported node kind */);\n\n\treturn compareSets({\n\t\ta: original.objectNodeFields,\n\t\tb: superset.objectNodeFields,\n\t\taExtra: (originalField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(originalField) ??\n\t\t\t\t\tfail(0xb17 /* missing expected field */),\n\t\t\t\tnormalizeField(undefined),\n\t\t\t),\n\t\tbExtra: (supersetField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\tnormalizeField(undefined),\n\t\t\t\tsuperset.objectNodeFields.get(supersetField) ??\n\t\t\t\t\tfail(0xb18 /* missing expected field */),\n\t\t\t),\n\t\tsame: (sameField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(sameField) ?? fail(0xb19 /* missing expected field */),\n\t\t\t\tsuperset.objectNodeFields.get(sameField) ?? fail(0xb1a /* missing expected field */),\n\t\t\t),\n\t});\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsValueSuperset(\n\toriginal: ValueSchema | undefined,\n\tsuperset: ValueSchema | undefined,\n): boolean {\n\treturn original === superset;\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsFieldSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeFieldStoredSchema,\n\tsuperset: TreeFieldStoredSchema,\n): boolean {\n\treturn withEditor(\n\t\tpolicy.fieldKinds.get(original.kind) ?? fail(0xb1b /* missing kind */),\n\t).allowsFieldSuperset(policy, originalData, original.types, superset);\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsTreeSchemaIdentifierSuperset(\n\toriginal: TreeTypeSet,\n\tsuperset: TreeTypeSet,\n): boolean {\n\tfor (const originalType of original) {\n\t\tif (!superset.has(originalType)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * A version of this that assumes a specific root field could be slightly more permissive in some simple cases,\n * however if any extra fields and fields with unconstrained types are reachable,\n * it would have to compare everything anyway.\n */\nexport function allowsRepoSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginal: TreeStoredSchema,\n\tsuperset: TreeStoredSchema,\n): boolean {\n\t{\n\t\t// TODO: I think its ok to use the field from superset here, but I should confirm it is, and document why.\n\t\tif (\n\t\t\t!allowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginal,\n\t\t\t\toriginal.rootFieldSchema,\n\t\t\t\tsuperset.rootFieldSchema,\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\tfor (const [key, schema] of original.nodeSchema) {\n\t\t// TODO: I think its ok to use the tree from superset here, but I should confirm it is, and document why.\n\t\tif (!allowsTreeSuperset(policy, original, schema, superset.nodeSchema.get(key))) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nexport function normalizeField(\n\tschema: TreeFieldStoredSchema | undefined,\n): TreeFieldStoredSchema {\n\treturn schema ?? storedEmptyFieldSchema;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"comparison.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AAEnE,kDAU6B;AAC7B,kDAAkD;AAGlD,qEAAsD;AACtD,qDAA+C;AAE/C,QAAQ;AACR,8EAA8E;AAC9E,mLAAmL;AAEnL;;;;;;GAM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K,CAAC;QACd,CAAC;IACF,CAAC;IACD,KAAK,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC;QACjD,yGAAyG;QACzG,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACjF,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAzBD,gDAyBC;AAED,SAAgB,cAAc,CAC7B,MAAyC;IAEzC,OAAO,MAAM,IAAI,iCAAsB,CAAC;AACzC,CAAC;AAJD,wCAIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n\tstoredEmptyFieldSchema,\n} from \"../../core/index.js\";\nimport { compareSets } from \"../../util/index.js\";\n\nimport type { FullSchemaPolicy } from \"./fieldKind.js\";\nimport { withEditor } from \"./fieldKindWithEditor.js\";\nimport { isNeverTree } from \"./isNeverTree.js\";\n\n// TODO:\n// The comparisons in this file seem redundant with those in discrepancies.ts.\n// Rather than both existing, one of which just returns boolean and the other which returns additional details, a simple comparison which returns everything needed should be used.\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * `undefined` TreeNodeStoredSchema means the schema is not present (and thus treated as a NeverTree).\n */\nexport function allowsTreeSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeNodeStoredSchema | undefined,\n\tsuperset: TreeNodeStoredSchema | undefined,\n): boolean {\n\tif (isNeverTree(policy, originalData, original)) {\n\t\treturn true;\n\t}\n\tif (isNeverTree(policy, originalData, superset)) {\n\t\treturn false;\n\t}\n\tassert(original !== undefined, 0x716 /* only never trees have undefined schema */);\n\tassert(superset !== undefined, 0x717 /* only never trees have undefined schema */);\n\tif (original instanceof LeafNodeStoredSchema) {\n\t\tif (superset instanceof LeafNodeStoredSchema) {\n\t\t\treturn allowsValueSuperset(original.leafValue, superset.leafValue);\n\t\t}\n\t\treturn false;\n\t}\n\n\tif (superset instanceof LeafNodeStoredSchema) {\n\t\treturn false;\n\t}\n\n\tassert(\n\t\toriginal instanceof MapNodeStoredSchema || original instanceof ObjectNodeStoredSchema,\n\t\t0x893 /* unsupported node kind */,\n\t);\n\tassert(\n\t\tsuperset instanceof MapNodeStoredSchema || superset instanceof ObjectNodeStoredSchema,\n\t\t0x894 /* unsupported node kind */,\n\t);\n\n\tif (original instanceof MapNodeStoredSchema) {\n\t\tif (superset instanceof MapNodeStoredSchema) {\n\t\t\treturn allowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\tnormalizeField(original.mapFields),\n\t\t\t\tnormalizeField(superset.mapFields),\n\t\t\t);\n\t\t}\n\t\treturn false;\n\t}\n\n\tassert(original instanceof ObjectNodeStoredSchema, 0x895 /* unsupported node kind */);\n\tif (superset instanceof MapNodeStoredSchema) {\n\t\tfor (const [_key, field] of original.objectNodeFields) {\n\t\t\tif (\n\t\t\t\t!allowsFieldSuperset(\n\t\t\t\t\tpolicy,\n\t\t\t\t\toriginalData,\n\t\t\t\t\tnormalizeField(field),\n\t\t\t\t\tnormalizeField(superset.mapFields),\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\tassert(superset instanceof ObjectNodeStoredSchema, 0x896 /* unsupported node kind */);\n\n\treturn compareSets({\n\t\ta: original.objectNodeFields,\n\t\tb: superset.objectNodeFields,\n\t\taExtra: (originalField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(originalField) ??\n\t\t\t\t\tfail(0xb17 /* missing expected field */),\n\t\t\t\tnormalizeField(undefined),\n\t\t\t),\n\t\tbExtra: (supersetField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\tnormalizeField(undefined),\n\t\t\t\tsuperset.objectNodeFields.get(supersetField) ??\n\t\t\t\t\tfail(0xb18 /* missing expected field */),\n\t\t\t),\n\t\tsame: (sameField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(sameField) ?? fail(0xb19 /* missing expected field */),\n\t\t\t\tsuperset.objectNodeFields.get(sameField) ?? fail(0xb1a /* missing expected field */),\n\t\t\t),\n\t});\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsValueSuperset(\n\toriginal: ValueSchema | undefined,\n\tsuperset: ValueSchema | undefined,\n): boolean {\n\treturn original === superset;\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsFieldSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeFieldStoredSchema,\n\tsuperset: TreeFieldStoredSchema,\n): boolean {\n\treturn withEditor(\n\t\tpolicy.fieldKinds.get(original.kind) ?? fail(0xb1b /* missing kind */),\n\t).allowsFieldSuperset(policy, originalData, original.types, superset);\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsTreeSchemaIdentifierSuperset(\n\toriginal: TreeTypeSet,\n\tsuperset: TreeTypeSet,\n): boolean {\n\tfor (const originalType of original) {\n\t\tif (!superset.has(originalType)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * A version of this that assumes a specific root field could be slightly more permissive in some simple cases,\n * however if any extra fields and fields with unconstrained types are reachable,\n * it would have to compare everything anyway.\n */\nexport function allowsRepoSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginal: TreeStoredSchema,\n\tsuperset: TreeStoredSchema,\n): boolean {\n\t{\n\t\t// TODO: I think its ok to use the field from superset here, but I should confirm it is, and document why.\n\t\tif (\n\t\t\t!allowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginal,\n\t\t\t\toriginal.rootFieldSchema,\n\t\t\t\tsuperset.rootFieldSchema,\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\tfor (const [key, schema] of original.nodeSchema) {\n\t\t// TODO: I think its ok to use the tree from superset here, but I should confirm it is, and document why.\n\t\tif (!allowsTreeSuperset(policy, original, schema, superset.nodeSchema.get(key))) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nexport function normalizeField(\n\tschema: TreeFieldStoredSchema | undefined,\n): TreeFieldStoredSchema {\n\treturn schema ?? storedEmptyFieldSchema;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isNeverTree.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/isNeverTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAIN,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EAErB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"isNeverTree.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/isNeverTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAIN,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EAErB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;GACG;AACH,wBAAgB,YAAY,CAC3B,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,gBAAgB,EAC9B,KAAK,EAAE,qBAAqB,GAC1B,OAAO,CAET;AAED,wBAAgB,qBAAqB,CACpC,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,gBAAgB,EAC9B,KAAK,EAAE,qBAAqB,EAC5B,eAAe,EAAE,GAAG,CAAC,oBAAoB,CAAC,GACxC,OAAO,CAuBT;AACD;;;;;GAKG;AAEH,wBAAgB,WAAW,CAC1B,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,oBAAoB,GAAG,SAAS,GACxC,OAAO,CAET;AACD;;;;;GAKG;AAEH,wBAAgB,oBAAoB,CACnC,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,oBAAoB,GAAG,SAAS,EAC1C,eAAe,EAAE,GAAG,CAAC,oBAAoB,CAAC,GACxC,OAAO,CAkCT"}
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.isNeverTreeRecursive = exports.isNeverTree = exports.isNeverFieldRecursive = exports.isNeverField = void 0;
|
|
8
8
|
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
9
9
|
const index_js_1 = require("../../core/index.js");
|
|
10
|
-
const index_js_2 = require("../../util/index.js");
|
|
11
10
|
/**
|
|
12
11
|
*/
|
|
13
12
|
function isNeverField(policy, originalData, field) {
|
|
@@ -15,7 +14,7 @@ function isNeverField(policy, originalData, field) {
|
|
|
15
14
|
}
|
|
16
15
|
exports.isNeverField = isNeverField;
|
|
17
16
|
function isNeverFieldRecursive(policy, originalData, field, parentTypeStack) {
|
|
18
|
-
if ((policy.fieldKinds.get(field.kind) ?? (0,
|
|
17
|
+
if ((policy.fieldKinds.get(field.kind) ?? (0, internal_1.fail)(0xb1c /* missing field kind */))
|
|
19
18
|
.multiplicity === index_js_1.Multiplicity.Single &&
|
|
20
19
|
field.types !== undefined) {
|
|
21
20
|
for (const type of field.types) {
|
|
@@ -57,7 +56,7 @@ function isNeverTreeRecursive(policy, originalData, treeNode, parentTypeStack) {
|
|
|
57
56
|
parentTypeStack.add(treeNode);
|
|
58
57
|
if (treeNode instanceof index_js_1.MapNodeStoredSchema) {
|
|
59
58
|
return ((policy.fieldKinds.get(treeNode.mapFields.kind) ??
|
|
60
|
-
(0,
|
|
59
|
+
(0, internal_1.fail)(0xb1d /* missing field kind */)).multiplicity === index_js_1.Multiplicity.Single);
|
|
61
60
|
}
|
|
62
61
|
else if (treeNode instanceof index_js_1.ObjectNodeStoredSchema) {
|
|
63
62
|
for (const field of treeNode.objectNodeFields.values()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isNeverTree.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/isNeverTree.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"isNeverTree.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/isNeverTree.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AAEnE,kDAQ6B;AAI7B;GACG;AACH,SAAgB,YAAY,CAC3B,MAAwB,EACxB,YAA8B,EAC9B,KAA4B;IAE5B,OAAO,qBAAqB,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AACtE,CAAC;AAND,oCAMC;AAED,SAAgB,qBAAqB,CACpC,MAAwB,EACxB,YAA8B,EAC9B,KAA4B,EAC5B,eAA0C;IAE1C,IACC,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,KA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AAC,CACpC,CAAC,YAAY,KAAK,uBAAY,CAAC,MAAM,CACtC,CAAC;QACH,CAAC;aAAM,IAAI,QAAQ,YAAY,iCAAsB,EAAE,CAAC;YACvD,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,EAAE,CAAC;gBACxD,yFAAyF;gBACzF,qDAAqD;gBACrD,4GAA4G;gBAC5G,6EAA6E;gBAC7E,IAAI,qBAAqB,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,CAAC,EAAE,CAAC;oBACzE,OAAO,IAAI,CAAC;gBACb,CAAC;YACF,CAAC;YACD,OAAO,KAAK,CAAC;QACd,CAAC;aAAM,CAAC;YACP,IAAA,iBAAM,EAAC,QAAQ,YAAY,+BAAoB,EAAE,KAAK,CAAC,2BAA2B,CAAC,CAAC;YACpF,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;YAAS,CAAC;QACV,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;AACF,CAAC;AAvCD,oDAuCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\tMultiplicity,\n} from \"../../core/index.js\";\n\nimport type { FullSchemaPolicy } from \"./fieldKind.js\";\n\n/**\n */\nexport function isNeverField(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\tfield: TreeFieldStoredSchema,\n): boolean {\n\treturn isNeverFieldRecursive(policy, originalData, field, new Set());\n}\n\nexport function isNeverFieldRecursive(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\tfield: TreeFieldStoredSchema,\n\tparentTypeStack: Set<TreeNodeStoredSchema>,\n): boolean {\n\tif (\n\t\t(policy.fieldKinds.get(field.kind) ?? fail(0xb1c /* missing field kind */))\n\t\t\t.multiplicity === Multiplicity.Single &&\n\t\tfield.types !== undefined\n\t) {\n\t\tfor (const type of field.types) {\n\t\t\tif (\n\t\t\t\t!isNeverTreeRecursive(\n\t\t\t\t\tpolicy,\n\t\t\t\t\toriginalData,\n\t\t\t\t\toriginalData.nodeSchema.get(type),\n\t\t\t\t\tparentTypeStack,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// This field requires at least one child, and there are no types permitted in it that can exist,\n\t\t// so this is a never field (field which no sequence of children content could ever be in schema for)\n\t\treturn true;\n\t}\n\treturn false;\n}\n/**\n * Returns true iff there are no possible trees that could meet this schema.\n * Trees which are infinite (like endless linked lists) are considered impossible.\n *\n * `undefined` means the schema is not present and thus a NeverTree.\n */\n\nexport function isNeverTree(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\ttreeNode: TreeNodeStoredSchema | undefined,\n): boolean {\n\treturn isNeverTreeRecursive(policy, originalData, treeNode, new Set());\n}\n/**\n * Returns true iff there are no possible trees that could meet this schema.\n * Trees which are infinite (like endless linked lists) are considered impossible.\n *\n * `undefined` means the schema is not present and thus a NeverTree.\n */\n\nexport function isNeverTreeRecursive(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\ttreeNode: TreeNodeStoredSchema | undefined,\n\tparentTypeStack: Set<TreeNodeStoredSchema>,\n): boolean {\n\tif (treeNode === undefined) {\n\t\treturn true;\n\t}\n\tif (parentTypeStack.has(treeNode)) {\n\t\treturn true;\n\t}\n\ttry {\n\t\tparentTypeStack.add(treeNode);\n\t\tif (treeNode instanceof MapNodeStoredSchema) {\n\t\t\treturn (\n\t\t\t\t(\n\t\t\t\t\tpolicy.fieldKinds.get(treeNode.mapFields.kind) ??\n\t\t\t\t\tfail(0xb1d /* missing field kind */)\n\t\t\t\t).multiplicity === Multiplicity.Single\n\t\t\t);\n\t\t} else if (treeNode instanceof ObjectNodeStoredSchema) {\n\t\t\tfor (const field of treeNode.objectNodeFields.values()) {\n\t\t\t\t// TODO: this can recurse infinitely for schema that include themselves in a value field.\n\t\t\t\t// This breaks even if there are other allowed types.\n\t\t\t\t// Such schema should either be rejected (as an error here) or considered never (and thus detected by this).\n\t\t\t\t// This can be done by passing a set/stack of current types recursively here.\n\t\t\t\tif (isNeverFieldRecursive(policy, originalData, field, parentTypeStack)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\tassert(treeNode instanceof LeafNodeStoredSchema, 0x897 /* unsupported node kind */);\n\t\t\treturn false;\n\t\t}\n\t} finally {\n\t\tparentTypeStack.delete(treeNode);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modularChangeCodecs.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,UAAU,EAKf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACX,qBAAqB,EAErB,kBAAkB,EAKlB,WAAW,EACX,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"modularChangeCodecs.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,UAAU,EAKf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACX,qBAAqB,EAErB,kBAAkB,EAKlB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAS7B,OAAO,EACN,KAAK,eAAe,EAIpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAErE,OAAO,KAAK,EACX,sBAAsB,EAEtB,MAAM,6BAA6B,CAAC;AAWrC,OAAO,EAMN,KAAK,gBAAgB,EAGrB,MAAM,yBAAyB,CAAC;AAGjC,wBAAgB,4BAA4B,CAC3C,uBAAuB,EAAE,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAAC,EACpE,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,EACD,WAAW,EAAE,eAAe,EAC5B,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,aAAa,EAC3C,wBAAwB,GAAE,uBAA4D,GACpF,YAAY,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,CAavD"}
|
|
@@ -57,7 +57,7 @@ function makeModularChangeCodec(fieldKinds, revisionTagCodec, fieldsCodec, { jso
|
|
|
57
57
|
(0, internal_1.assert)(node !== undefined, 0x92e /* Unknown node ID */);
|
|
58
58
|
return encodeNodeChangesForJson(node, fieldContext);
|
|
59
59
|
},
|
|
60
|
-
decodeNode: () => (0,
|
|
60
|
+
decodeNode: () => (0, internal_1.fail)(0xb1e /* Should not decode nodes during field encoding */),
|
|
61
61
|
};
|
|
62
62
|
return encodeFieldChangesForJsonI(change, fieldContext);
|
|
63
63
|
}
|
|
@@ -67,7 +67,7 @@ function makeModularChangeCodec(fieldKinds, revisionTagCodec, fieldsCodec, { jso
|
|
|
67
67
|
const { codec, compiledSchema } = getFieldChangesetCodec(fieldChange.fieldKind);
|
|
68
68
|
const encodedChange = codec.json.encode(fieldChange.change, context);
|
|
69
69
|
if (compiledSchema !== undefined && !compiledSchema.check(encodedChange)) {
|
|
70
|
-
(0,
|
|
70
|
+
(0, internal_1.fail)(0xb1f /* Encoded change didn't pass schema validation. */);
|
|
71
71
|
}
|
|
72
72
|
const fieldKey = field;
|
|
73
73
|
const encodedField = {
|
|
@@ -95,7 +95,7 @@ function makeModularChangeCodec(fieldKinds, revisionTagCodec, fieldsCodec, { jso
|
|
|
95
95
|
for (const field of encodedChange) {
|
|
96
96
|
const { codec, compiledSchema } = getFieldChangesetCodec(field.fieldKind);
|
|
97
97
|
if (compiledSchema !== undefined && !compiledSchema.check(field.change)) {
|
|
98
|
-
(0,
|
|
98
|
+
(0, internal_1.fail)(0xb20 /* Encoded change didn't pass schema validation. */);
|
|
99
99
|
}
|
|
100
100
|
const fieldId = {
|
|
101
101
|
nodeId: parentId,
|
|
@@ -103,7 +103,7 @@ function makeModularChangeCodec(fieldKinds, revisionTagCodec, fieldsCodec, { jso
|
|
|
103
103
|
};
|
|
104
104
|
const fieldContext = {
|
|
105
105
|
baseContext: context,
|
|
106
|
-
encodeNode: () => (0,
|
|
106
|
+
encodeNode: () => (0, internal_1.fail)(0xb21 /* Should not encode nodes during field decoding */),
|
|
107
107
|
decodeNode: (encodedNode) => {
|
|
108
108
|
const nodeId = {
|
|
109
109
|
revision: context.revision,
|