@fluidframework/tree 2.23.0-323641 → 2.23.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/.vscode/extensions.json +1 -0
- package/CHANGELOG.md +47 -0
- package/api-report/tree.alpha.api.md +31 -0
- package/dist/alpha.d.ts +1 -0
- package/dist/codec/codec.js +3 -3
- 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/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +3 -3
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +5 -4
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/treeTextFormat.js +1 -1
- package/dist/core/tree/treeTextFormat.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js +11 -8
- package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +2 -2
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +3 -3
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +2 -2
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -3
- 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.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js +3 -3
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/emptyChunk.js +14 -14
- package/dist/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +6 -4
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +4 -3
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +5 -4
- package/dist/feature-libraries/flex-tree/lazyNode.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/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +6 -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 +4 -4
- package/dist/feature-libraries/modular-schema/isNeverTree.js.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.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +5 -5
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/node-key/mockNodeKeyManager.js +1 -1
- package/dist/feature-libraries/node-key/mockNodeKeyManager.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +1 -1
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +1 -1
- package/dist/feature-libraries/sequence-field/compose.js.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.js +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.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 +6 -4
- package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/jsonDomainSchema.d.ts +113 -0
- package/dist/jsonDomainSchema.d.ts.map +1 -0
- package/dist/jsonDomainSchema.js +101 -0
- package/dist/jsonDomainSchema.js.map +1 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/serializableDomainSchema.d.ts +108 -0
- package/dist/serializableDomainSchema.d.ts.map +1 -0
- package/dist/serializableDomainSchema.js +90 -0
- package/dist/serializableDomainSchema.js.map +1 -0
- 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.map +1 -1
- package/dist/shared-tree/schematizeTree.js +1 -1
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +35 -19
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +14 -17
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/treeApiAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeApiAlpha.js +4 -4
- package/dist/shared-tree/treeApiAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.js +1 -1
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +8 -7
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +1 -2
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +2 -2
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/simple-tree/api/customTree.js +3 -3
- package/dist/simple-tree/api/customTree.js.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.js +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.js +3 -3
- package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/dist/simple-tree/api/tree.js +1 -1
- 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 +9 -5
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +5 -4
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/api/view.js +1 -1
- package/dist/simple-tree/api/view.js.map +1 -1
- package/dist/simple-tree/arrayNode.js +2 -2
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
- package/dist/simple-tree/core/getOrCreateNode.js +1 -1
- package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
- package/dist/simple-tree/core/schemaCaching.js +1 -1
- package/dist/simple-tree/core/schemaCaching.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +6 -6
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- 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/objectNode.js +2 -2
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/proxies.js +1 -1
- package/dist/simple-tree/proxies.js.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 -1
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/treeNodeValid.js +5 -2
- package/dist/simple-tree/treeNodeValid.js.map +1 -1
- package/dist/util/idAllocator.js +1 -1
- package/dist/util/idAllocator.js.map +1 -1
- package/dist/util/index.d.ts +2 -2
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +4 -4
- package/dist/util/index.js.map +1 -1
- package/dist/util/nestedMap.d.ts +2 -10
- package/dist/util/nestedMap.d.ts.map +1 -1
- package/dist/util/nestedMap.js +9 -28
- package/dist/util/nestedMap.js.map +1 -1
- package/dist/util/utils.d.ts +7 -6
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +18 -13
- package/dist/util/utils.js.map +1 -1
- package/lib/alpha.d.ts +1 -0
- package/lib/codec/codec.js +3 -3
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/discriminatedUnions.d.ts.map +1 -1
- package/lib/codec/discriminatedUnions.js +1 -1
- package/lib/codec/discriminatedUnions.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +3 -3
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +5 -4
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/treeTextFormat.js +1 -1
- package/lib/core/tree/treeTextFormat.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js +11 -8
- package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +2 -2
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +3 -3
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +2 -2
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -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.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js +3 -3
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/emptyChunk.js +14 -14
- package/lib/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +6 -4
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.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/schemaChecker.js +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +4 -3
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +5 -4
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.js +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +6 -4
- 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 +4 -4
- package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +4 -4
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +6 -6
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/node-key/mockNodeKeyManager.js +1 -1
- package/lib/feature-libraries/node-key/mockNodeKeyManager.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +1 -1
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +1 -1
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.js +1 -1
- package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.js +1 -1
- 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 +6 -4
- package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/jsonDomainSchema.d.ts +113 -0
- package/lib/jsonDomainSchema.d.ts.map +1 -0
- package/lib/jsonDomainSchema.js +98 -0
- package/lib/jsonDomainSchema.js.map +1 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/serializableDomainSchema.d.ts +108 -0
- package/lib/serializableDomainSchema.d.ts.map +1 -0
- package/lib/serializableDomainSchema.js +87 -0
- package/lib/serializableDomainSchema.js.map +1 -0
- 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.map +1 -1
- package/lib/shared-tree/schematizeTree.js +1 -1
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +35 -19
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +15 -18
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/treeApiAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeApiAlpha.js +4 -4
- package/lib/shared-tree/treeApiAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.js +1 -1
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +8 -7
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +1 -2
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +2 -2
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/simple-tree/api/customTree.js +3 -3
- package/lib/simple-tree/api/customTree.js.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/schemaFactoryRecursive.d.ts +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/api/simpleTreeIndex.js +3 -3
- package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/lib/simple-tree/api/tree.js +1 -1
- 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 +9 -5
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +5 -4
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/api/view.js +1 -1
- package/lib/simple-tree/api/view.js.map +1 -1
- package/lib/simple-tree/arrayNode.js +2 -2
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
- package/lib/simple-tree/core/getOrCreateNode.js +1 -1
- package/lib/simple-tree/core/getOrCreateNode.js.map +1 -1
- package/lib/simple-tree/core/schemaCaching.js +1 -1
- package/lib/simple-tree/core/schemaCaching.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +6 -6
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +5 -5
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/objectNode.js +2 -2
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/proxies.js +1 -1
- package/lib/simple-tree/proxies.js.map +1 -1
- package/lib/simple-tree/toMapTree.js +3 -3
- 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 +2 -1
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/treeNodeValid.js +5 -2
- package/lib/simple-tree/treeNodeValid.js.map +1 -1
- package/lib/util/idAllocator.js +1 -1
- package/lib/util/idAllocator.js.map +1 -1
- package/lib/util/index.d.ts +2 -2
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -2
- package/lib/util/index.js.map +1 -1
- package/lib/util/nestedMap.d.ts +2 -10
- package/lib/util/nestedMap.d.ts.map +1 -1
- package/lib/util/nestedMap.js +5 -23
- package/lib/util/nestedMap.js.map +1 -1
- package/lib/util/utils.d.ts +7 -6
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js +15 -11
- package/lib/util/utils.js.map +1 -1
- package/package.json +22 -22
- package/src/codec/codec.ts +3 -3
- package/src/codec/discriminatedUnions.ts +2 -1
- package/src/core/schema-stored/schema.ts +5 -3
- package/src/core/tree/anchorSet.ts +5 -4
- package/src/core/tree/treeTextFormat.ts +1 -1
- package/src/feature-libraries/chunked-forest/basicChunk.ts +11 -8
- package/src/feature-libraries/chunked-forest/chunkTree.ts +2 -2
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +3 -3
- package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +2 -2
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +4 -3
- package/src/feature-libraries/chunked-forest/codec/nodeShape.ts +2 -2
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncoding.ts +4 -3
- package/src/feature-libraries/chunked-forest/emptyChunk.ts +14 -14
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +6 -4
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +1 -1
- package/src/feature-libraries/default-schema/schemaChecker.ts +1 -1
- package/src/feature-libraries/flex-tree/lazyField.ts +6 -8
- package/src/feature-libraries/flex-tree/lazyNode.ts +6 -4
- package/src/feature-libraries/indexing/anchorTreeIndex.ts +2 -1
- package/src/feature-libraries/modular-schema/comparison.ts +7 -5
- package/src/feature-libraries/modular-schema/isNeverTree.ts +6 -4
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +4 -4
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +7 -6
- package/src/feature-libraries/node-key/mockNodeKeyManager.ts +1 -1
- package/src/feature-libraries/object-forest/objectForest.ts +1 -1
- package/src/feature-libraries/schema-index/codec.ts +1 -1
- package/src/feature-libraries/sequence-field/compose.ts +1 -1
- package/src/feature-libraries/sequence-field/invert.ts +1 -1
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +1 -1
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +1 -1
- package/src/feature-libraries/sequence-field/utils.ts +1 -1
- package/src/feature-libraries/treeCursorUtils.ts +6 -4
- package/src/index.ts +3 -1
- package/src/jsonDomainSchema.ts +129 -0
- package/src/packageVersion.ts +1 -1
- package/src/serializableDomainSchema.ts +121 -0
- package/src/shared-tree/index.ts +0 -1
- package/src/shared-tree/schematizeTree.ts +1 -1
- package/src/shared-tree/sharedTree.ts +26 -41
- package/src/shared-tree/sharedTreeChangeFamily.ts +1 -1
- package/src/shared-tree/treeApiAlpha.ts +12 -4
- package/src/shared-tree/treeCheckout.ts +1 -1
- package/src/shared-tree-core/editManager.ts +8 -7
- package/src/shared-tree-core/sharedTreeCore.ts +6 -4
- package/src/simple-tree/api/customTree.ts +3 -3
- package/src/simple-tree/api/schemaCreationUtilities.ts +1 -1
- package/src/simple-tree/api/schemaFactoryRecursive.ts +1 -1
- package/src/simple-tree/api/simpleTreeIndex.ts +3 -3
- package/src/simple-tree/api/tree.ts +1 -1
- package/src/simple-tree/api/treeNodeApi.ts +11 -6
- package/src/simple-tree/api/verboseTree.ts +8 -4
- package/src/simple-tree/api/view.ts +1 -1
- package/src/simple-tree/arrayNode.ts +2 -2
- package/src/simple-tree/core/getOrCreateNode.ts +2 -1
- package/src/simple-tree/core/schemaCaching.ts +1 -1
- package/src/simple-tree/core/treeNodeKernel.ts +9 -6
- package/src/simple-tree/core/unhydratedFlexTree.ts +7 -5
- package/src/simple-tree/objectNode.ts +2 -2
- package/src/simple-tree/proxies.ts +1 -1
- package/src/simple-tree/toMapTree.ts +3 -3
- package/src/simple-tree/toStoredSchema.ts +2 -1
- package/src/simple-tree/treeNodeValid.ts +5 -2
- package/src/util/idAllocator.ts +1 -1
- package/src/util/index.ts +2 -2
- package/src/util/nestedMap.ts +9 -33
- package/src/util/utils.ts +20 -12
|
@@ -247,7 +247,7 @@ export function tryShapeFromSchema(
|
|
|
247
247
|
shapes: Map<TreeNodeSchemaIdentifier, ShapeInfo>,
|
|
248
248
|
): ShapeInfo {
|
|
249
249
|
return getOrCreate(shapes, type, () => {
|
|
250
|
-
const treeSchema = schema.nodeSchema.get(type) ?? fail(
|
|
250
|
+
const treeSchema = schema.nodeSchema.get(type) ?? fail(0xaf9 /* missing schema */);
|
|
251
251
|
if (treeSchema instanceof LeafNodeStoredSchema) {
|
|
252
252
|
// Allow all string values (but only string values) to be compressed by the id compressor.
|
|
253
253
|
// This allows compressing all compressible identifiers without requiring additional context to know which values could be identifiers.
|
|
@@ -284,7 +284,7 @@ export function tryShapeFromFieldSchema(
|
|
|
284
284
|
key: FieldKey,
|
|
285
285
|
shapes: Map<TreeNodeSchemaIdentifier, ShapeInfo>,
|
|
286
286
|
): FieldShape | undefined {
|
|
287
|
-
const kind = policy.fieldKinds.get(type.kind) ?? fail(
|
|
287
|
+
const kind = policy.fieldKinds.get(type.kind) ?? fail(0xafa /* missing FieldKind */);
|
|
288
288
|
if (kind.multiplicity !== Multiplicity.Single) {
|
|
289
289
|
return undefined;
|
|
290
290
|
}
|
|
@@ -227,7 +227,7 @@ export class ChunkedForest implements IEditableForest {
|
|
|
227
227
|
assert(this.mutableChunk === undefined, 0x535 /* should be in field */);
|
|
228
228
|
const parent = this.getParent();
|
|
229
229
|
const chunks =
|
|
230
|
-
parent.mutableChunk.fields.get(parent.key) ?? fail(
|
|
230
|
+
parent.mutableChunk.fields.get(parent.key) ?? fail(0xaf6 /* missing edited field */);
|
|
231
231
|
let indexWithinChunk = index;
|
|
232
232
|
let indexOfChunk = 0;
|
|
233
233
|
let chunk = chunks[indexOfChunk] ?? oob();
|
|
@@ -236,7 +236,7 @@ export class ChunkedForest implements IEditableForest {
|
|
|
236
236
|
indexWithinChunk -= chunk.topLevelLength;
|
|
237
237
|
indexOfChunk++;
|
|
238
238
|
if (indexOfChunk === chunks.length) {
|
|
239
|
-
fail(
|
|
239
|
+
fail(0xaf7 /* missing edited node */);
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
242
|
let found = chunks[indexOfChunk] ?? oob();
|
|
@@ -277,7 +277,7 @@ export class ChunkedForest implements IEditableForest {
|
|
|
277
277
|
this.mutableChunk = undefined;
|
|
278
278
|
},
|
|
279
279
|
exitField(key: FieldKey): void {
|
|
280
|
-
const top = this.mutableChunkStack.pop() ?? fail(
|
|
280
|
+
const top = this.mutableChunkStack.pop() ?? fail(0xaf8 /* should not be at root */);
|
|
281
281
|
assert(this.mutableChunk === undefined, 0x539 /* should be in field */);
|
|
282
282
|
this.mutableChunk = top.mutableChunk;
|
|
283
283
|
},
|
|
@@ -85,7 +85,7 @@ export function handleShapesAndIdentifiers<TEncodedShape>(
|
|
|
85
85
|
) {
|
|
86
86
|
// because "serializable" is allowed in buffer and it has type `any`, its very easy to mess up including of shapes in the buffer.
|
|
87
87
|
// This catches the easiest way to get it wrong.
|
|
88
|
-
fail(
|
|
88
|
+
fail(0xb4b /* encoder interface instead of shape written to stream */);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -108,7 +108,7 @@ export function handleShapesAndIdentifiers<TEncodedShape>(
|
|
|
108
108
|
if (item instanceof IdentifierToken) {
|
|
109
109
|
array[index] = identifierTable.valueToIndex.get(item.identifier) ?? item.identifier;
|
|
110
110
|
} else if (item instanceof Shape) {
|
|
111
|
-
array[index] = shapeTable.valueToIndex.get(item) ?? fail(
|
|
111
|
+
array[index] = shapeTable.valueToIndex.get(item) ?? fail(0xb4c /* missing shape */);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
}
|
|
@@ -273,7 +273,7 @@ export class InlineArrayShape
|
|
|
273
273
|
shapes: EncoderCache,
|
|
274
274
|
outputBuffer: BufferFormat,
|
|
275
275
|
): void {
|
|
276
|
-
fail(
|
|
276
|
+
fail(0xb4d /* Empty array should not encode any nodes */);
|
|
277
277
|
},
|
|
278
278
|
});
|
|
279
279
|
|
|
@@ -324,7 +324,7 @@ export class InlineArrayShape
|
|
|
324
324
|
return {
|
|
325
325
|
b: {
|
|
326
326
|
length: this.length,
|
|
327
|
-
shape: shapes.valueToIndex.get(this.inner.shape) ?? fail(
|
|
327
|
+
shape: shapes.valueToIndex.get(this.inner.shape) ?? fail(0xb4e /* missing shape */),
|
|
328
328
|
},
|
|
329
329
|
};
|
|
330
330
|
}
|
|
@@ -380,7 +380,8 @@ export class NestedArrayShape extends ShapeGeneric<EncodedChunkShape> implements
|
|
|
380
380
|
shapes: DeduplicationTable<Shape>,
|
|
381
381
|
): EncodedChunkShape {
|
|
382
382
|
const shape: EncodedNestedArray =
|
|
383
|
-
shapes.valueToIndex.get(this.inner.shape) ??
|
|
383
|
+
shapes.valueToIndex.get(this.inner.shape) ??
|
|
384
|
+
fail(0xb4f /* index for shape not found in table */);
|
|
384
385
|
return {
|
|
385
386
|
a: shape,
|
|
386
387
|
};
|
|
@@ -138,7 +138,7 @@ export function encodeFieldShapes(
|
|
|
138
138
|
// key
|
|
139
139
|
encodeIdentifier(field.key, identifiers),
|
|
140
140
|
// shape
|
|
141
|
-
shapes.valueToIndex.get(field.shape.shape) ?? fail(
|
|
141
|
+
shapes.valueToIndex.get(field.shape.shape) ?? fail(0xb50 /* missing shape */),
|
|
142
142
|
]);
|
|
143
143
|
}
|
|
144
144
|
|
|
@@ -167,5 +167,5 @@ function dedupShape(
|
|
|
167
167
|
shape: Shape<EncodedChunkShape>,
|
|
168
168
|
shapes: DeduplicationTable<Shape<EncodedChunkShape>>,
|
|
169
169
|
): number {
|
|
170
|
-
return shapes.valueToIndex.get(shape) ?? fail(
|
|
170
|
+
return shapes.valueToIndex.get(shape) ?? fail(0xb51 /* missing shape */);
|
|
171
171
|
}
|
|
@@ -74,7 +74,7 @@ export function fieldShaper(
|
|
|
74
74
|
cache: EncoderCache,
|
|
75
75
|
storedSchema: StoredSchemaCollection,
|
|
76
76
|
): FieldEncoder {
|
|
77
|
-
const kind = cache.fieldShapes.get(field.kind) ?? fail(
|
|
77
|
+
const kind = cache.fieldShapes.get(field.kind) ?? fail(0xb52 /* missing FieldKind */);
|
|
78
78
|
const type = oneFromSet(field.types);
|
|
79
79
|
const nodeEncoder = type !== undefined ? treeHandler.shapeFromTree(type) : anyNodeEncoder;
|
|
80
80
|
if (kind.multiplicity === Multiplicity.Single) {
|
|
@@ -113,7 +113,8 @@ export function treeShaper(
|
|
|
113
113
|
fieldHandler: FieldShaper,
|
|
114
114
|
schemaName: TreeNodeSchemaIdentifier,
|
|
115
115
|
): NodeShape {
|
|
116
|
-
const schema =
|
|
116
|
+
const schema =
|
|
117
|
+
fullSchema.nodeSchema.get(schemaName) ?? fail(0xb53 /* missing node schema */);
|
|
117
118
|
|
|
118
119
|
if (schema instanceof ObjectNodeStoredSchema) {
|
|
119
120
|
// TODO:Performance:
|
|
@@ -146,7 +147,7 @@ export function treeShaper(
|
|
|
146
147
|
);
|
|
147
148
|
return shape;
|
|
148
149
|
}
|
|
149
|
-
fail(
|
|
150
|
+
fail(0xb54 /* unsupported node kind */);
|
|
150
151
|
}
|
|
151
152
|
|
|
152
153
|
export function oneFromSet<T>(set: ReadonlySet<T> | undefined): T | undefined {
|
|
@@ -52,10 +52,10 @@ export const emptyCursor: ChunkedCursor = {
|
|
|
52
52
|
mode: CursorLocationType.Fields,
|
|
53
53
|
[cursorChunk]: emptyChunk,
|
|
54
54
|
nextField(): boolean {
|
|
55
|
-
fail(
|
|
55
|
+
fail(0xafb /* cannot navigate above root */);
|
|
56
56
|
},
|
|
57
57
|
exitField(): void {
|
|
58
|
-
fail(
|
|
58
|
+
fail(0xafc /* cannot navigate above root */);
|
|
59
59
|
},
|
|
60
60
|
skipPendingFields(): boolean {
|
|
61
61
|
return true;
|
|
@@ -70,43 +70,43 @@ export const emptyCursor: ChunkedCursor = {
|
|
|
70
70
|
return false;
|
|
71
71
|
},
|
|
72
72
|
enterNode(childIndex: number): void {
|
|
73
|
-
fail(
|
|
73
|
+
fail(0xafd /* empty cursor has no nodes */);
|
|
74
74
|
},
|
|
75
75
|
getFieldPath(prefix?: PathRootPrefix): FieldUpPath {
|
|
76
76
|
return prefixFieldPath(prefix, emptyPath);
|
|
77
77
|
},
|
|
78
78
|
getPath(): UpPath | undefined {
|
|
79
|
-
fail(
|
|
79
|
+
fail(0xafe /* empty cursor has no nodes */);
|
|
80
80
|
},
|
|
81
81
|
get fieldIndex(): never {
|
|
82
|
-
return fail(
|
|
82
|
+
return fail(0xaff /* empty cursor has no nodes */);
|
|
83
83
|
},
|
|
84
84
|
get chunkStart(): never {
|
|
85
|
-
return fail(
|
|
85
|
+
return fail(0xb00 /* empty cursor has no nodes */);
|
|
86
86
|
},
|
|
87
87
|
get chunkLength(): never {
|
|
88
|
-
return fail(
|
|
88
|
+
return fail(0xb01 /* empty cursor has no nodes */);
|
|
89
89
|
},
|
|
90
90
|
seekNodes(offset: number): boolean {
|
|
91
|
-
fail(
|
|
91
|
+
fail(0xb02 /* empty cursor has no nodes */);
|
|
92
92
|
},
|
|
93
93
|
nextNode(): boolean {
|
|
94
|
-
fail(
|
|
94
|
+
fail(0xb03 /* empty cursor has no nodes */);
|
|
95
95
|
},
|
|
96
96
|
exitNode(): void {
|
|
97
|
-
fail(
|
|
97
|
+
fail(0xb04 /* empty cursor has no nodes */);
|
|
98
98
|
},
|
|
99
99
|
firstField(): boolean {
|
|
100
|
-
fail(
|
|
100
|
+
fail(0xb05 /* empty cursor has no nodes */);
|
|
101
101
|
},
|
|
102
102
|
enterField(key: FieldKey): void {
|
|
103
|
-
fail(
|
|
103
|
+
fail(0xb06 /* empty cursor has no nodes */);
|
|
104
104
|
},
|
|
105
105
|
get type(): never {
|
|
106
|
-
return fail(
|
|
106
|
+
return fail(0xb07 /* empty cursor has no nodes */);
|
|
107
107
|
},
|
|
108
108
|
get value(): never {
|
|
109
|
-
return fail(
|
|
109
|
+
return fail(0xb08 /* empty cursor has no nodes */);
|
|
110
110
|
},
|
|
111
111
|
atChunkRoot(): boolean {
|
|
112
112
|
return true;
|
|
@@ -382,7 +382,7 @@ class Cursor extends SynchronousCursor implements ChunkedCursor {
|
|
|
382
382
|
}
|
|
383
383
|
|
|
384
384
|
public getFieldKey(): FieldKey {
|
|
385
|
-
return this.fieldKey ?? fail(
|
|
385
|
+
return this.fieldKey ?? fail(0xb09 /* not in a field */);
|
|
386
386
|
}
|
|
387
387
|
|
|
388
388
|
public getFieldLength(): number {
|
|
@@ -510,11 +510,13 @@ class Cursor extends SynchronousCursor implements ChunkedCursor {
|
|
|
510
510
|
public exitNode(): void {
|
|
511
511
|
const info = this.nodeInfo(CursorLocationType.Nodes);
|
|
512
512
|
this.indexOfField =
|
|
513
|
-
info.indexOfParentField ??
|
|
513
|
+
info.indexOfParentField ??
|
|
514
|
+
fail(0xb0a /* navigation up to root field not yet supported */); // TODO;
|
|
514
515
|
this.fieldKey = info.parentField;
|
|
515
516
|
this.mode = CursorLocationType.Fields;
|
|
516
517
|
this.moveToPosition(
|
|
517
|
-
info.indexOfParentPosition ??
|
|
518
|
+
info.indexOfParentPosition ??
|
|
519
|
+
fail(0xb0b /* navigation up to root field not yet supported */),
|
|
518
520
|
); // TODO
|
|
519
521
|
}
|
|
520
522
|
|
|
@@ -536,7 +538,7 @@ class Cursor extends SynchronousCursor implements ChunkedCursor {
|
|
|
536
538
|
this.indexOfField =
|
|
537
539
|
fieldInfo === undefined
|
|
538
540
|
? fieldMap.size
|
|
539
|
-
: (fieldInfo.indexOfParentField ?? fail(
|
|
541
|
+
: (fieldInfo.indexOfParentField ?? fail(0xb0c /* children should have parents */));
|
|
540
542
|
this.fieldKey = key;
|
|
541
543
|
this.mode = CursorLocationType.Fields;
|
|
542
544
|
}
|
|
@@ -42,7 +42,7 @@ export const noChangeHandler: FieldChangeHandler<0> = {
|
|
|
42
42
|
rebase: (change: 0, over: 0) => 0,
|
|
43
43
|
}),
|
|
44
44
|
codecsFactory: () => noChangeCodecFamily,
|
|
45
|
-
editor: { buildChildChanges: () => fail(
|
|
45
|
+
editor: { buildChildChanges: () => fail(0xb0d /* Child changes not supported */) },
|
|
46
46
|
intoDelta: (change, deltaFromChild: ToDelta): FieldChangeDelta => ({}),
|
|
47
47
|
relevantRemovedRoots: (change): Iterable<DeltaDetachedNodeId> => [],
|
|
48
48
|
isEmpty: (change: 0) => true,
|
|
@@ -82,12 +82,9 @@ export function makeField(
|
|
|
82
82
|
|
|
83
83
|
const makeFlexTreeField = (): FlexTreeField => {
|
|
84
84
|
usedAnchor = true;
|
|
85
|
-
const field = new (
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
cursor,
|
|
89
|
-
fieldAnchor,
|
|
90
|
-
);
|
|
85
|
+
const field = new (
|
|
86
|
+
kindToClass.get(schema) ?? fail(0xb0f /* missing field implementation */)
|
|
87
|
+
)(context, schema, cursor, fieldAnchor);
|
|
91
88
|
return field;
|
|
92
89
|
};
|
|
93
90
|
|
|
@@ -97,7 +94,8 @@ export function makeField(
|
|
|
97
94
|
|
|
98
95
|
// For the common case (all but roots), cache field associated with its node's anchor and field key.
|
|
99
96
|
const anchorNode =
|
|
100
|
-
context.checkout.forest.anchors.locate(fieldAnchor.parent) ??
|
|
97
|
+
context.checkout.forest.anchors.locate(fieldAnchor.parent) ??
|
|
98
|
+
fail(0xb10 /* missing anchor */);
|
|
101
99
|
|
|
102
100
|
// Since anchor-set could be reused across a flex tree context getting disposed, key off the flex tree node not the anchor.
|
|
103
101
|
const cacheKey = anchorNode.slots.get(flexTreeSlot);
|
|
@@ -150,7 +148,7 @@ export abstract class LazyField extends LazyEntity<FieldAnchor> implements FlexT
|
|
|
150
148
|
if (fieldAnchor.parent !== undefined) {
|
|
151
149
|
const anchorNode =
|
|
152
150
|
context.checkout.forest.anchors.locate(fieldAnchor.parent) ??
|
|
153
|
-
fail(
|
|
151
|
+
fail(0xb11 /* parent anchor node should always exist since field is under a node */);
|
|
154
152
|
this.offAfterDestroy = anchorNode.events.on("afterDestroy", () => {
|
|
155
153
|
this[disposeSymbol]();
|
|
156
154
|
});
|
|
@@ -48,7 +48,7 @@ export function makeTree(context: Context, cursor: ITreeSubscriptionCursor): Laz
|
|
|
48
48
|
const anchor = cursor.buildAnchor();
|
|
49
49
|
const anchorNode =
|
|
50
50
|
context.checkout.forest.anchors.locate(anchor) ??
|
|
51
|
-
fail(
|
|
51
|
+
fail(0xb12 /* cursor should point to a node that is not the root of the AnchorSet */);
|
|
52
52
|
const cached = anchorNode.slots.get(flexTreeSlot);
|
|
53
53
|
if (cached !== undefined) {
|
|
54
54
|
context.checkout.forest.anchors.forget(anchor);
|
|
@@ -60,7 +60,8 @@ export function makeTree(context: Context, cursor: ITreeSubscriptionCursor): Laz
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
function cleanupTree(anchor: AnchorNode): void {
|
|
63
|
-
const cached =
|
|
63
|
+
const cached =
|
|
64
|
+
anchor.slots.get(flexTreeSlot) ?? fail(0xb13 /* tree should only be cleaned up once */);
|
|
64
65
|
assert(cached instanceof LazyTreeNode, 0x92d /* Expected LazyTreeNode */);
|
|
65
66
|
cached[disposeSymbol]();
|
|
66
67
|
}
|
|
@@ -86,7 +87,8 @@ export class LazyTreeNode extends LazyEntity<Anchor> implements FlexTreeNode {
|
|
|
86
87
|
anchor: Anchor,
|
|
87
88
|
) {
|
|
88
89
|
super(context, cursor, anchor);
|
|
89
|
-
this.storedSchema =
|
|
90
|
+
this.storedSchema =
|
|
91
|
+
context.schema.nodeSchema.get(this.schema) ?? fail(0xb14 /* missing schema */);
|
|
90
92
|
assert(cursor.mode === CursorLocationType.Nodes, 0x783 /* must be in nodes mode */);
|
|
91
93
|
anchorNode.slots.set(flexTreeSlot, this);
|
|
92
94
|
this.#removeDeleteCallback = anchorNode.events.on("afterDestroy", cleanupTree);
|
|
@@ -180,7 +182,7 @@ export class LazyTreeNode extends LazyEntity<Anchor> implements FlexTreeNode {
|
|
|
180
182
|
cursor.enterField(key);
|
|
181
183
|
const nodeSchema =
|
|
182
184
|
this.context.schema.nodeSchema.get(parentType) ??
|
|
183
|
-
fail(
|
|
185
|
+
fail(0xb15 /* requested schema that does not exist */);
|
|
184
186
|
fieldSchema = nodeSchema.getFieldSchema(key).kind;
|
|
185
187
|
}
|
|
186
188
|
|
|
@@ -359,7 +359,8 @@ export class AnchorTreeIndex<TKey extends TreeIndexKey, TValue>
|
|
|
359
359
|
throw new Error("key finder should be pure and functional");
|
|
360
360
|
}
|
|
361
361
|
const anchor = nodeCursor.buildAnchor();
|
|
362
|
-
const anchorNode =
|
|
362
|
+
const anchorNode =
|
|
363
|
+
this.forest.anchors.locate(anchor) ?? fail(0xb16 /* expected anchor node */);
|
|
363
364
|
|
|
364
365
|
// check if this anchor node already exists in the index
|
|
365
366
|
const existingKey = this.nodeToKey.get(anchorNode);
|
|
@@ -104,7 +104,8 @@ export function allowsTreeSuperset(
|
|
|
104
104
|
allowsFieldSuperset(
|
|
105
105
|
policy,
|
|
106
106
|
originalData,
|
|
107
|
-
original.objectNodeFields.get(originalField) ??
|
|
107
|
+
original.objectNodeFields.get(originalField) ??
|
|
108
|
+
fail(0xb17 /* missing expected field */),
|
|
108
109
|
normalizeField(undefined),
|
|
109
110
|
),
|
|
110
111
|
bExtra: (supersetField) =>
|
|
@@ -112,14 +113,15 @@ export function allowsTreeSuperset(
|
|
|
112
113
|
policy,
|
|
113
114
|
originalData,
|
|
114
115
|
normalizeField(undefined),
|
|
115
|
-
superset.objectNodeFields.get(supersetField) ??
|
|
116
|
+
superset.objectNodeFields.get(supersetField) ??
|
|
117
|
+
fail(0xb18 /* missing expected field */),
|
|
116
118
|
),
|
|
117
119
|
same: (sameField) =>
|
|
118
120
|
allowsFieldSuperset(
|
|
119
121
|
policy,
|
|
120
122
|
originalData,
|
|
121
|
-
original.objectNodeFields.get(sameField) ?? fail(
|
|
122
|
-
superset.objectNodeFields.get(sameField) ?? fail(
|
|
123
|
+
original.objectNodeFields.get(sameField) ?? fail(0xb19 /* missing expected field */),
|
|
124
|
+
superset.objectNodeFields.get(sameField) ?? fail(0xb1a /* missing expected field */),
|
|
123
125
|
),
|
|
124
126
|
});
|
|
125
127
|
}
|
|
@@ -148,7 +150,7 @@ export function allowsFieldSuperset(
|
|
|
148
150
|
superset: TreeFieldStoredSchema,
|
|
149
151
|
): boolean {
|
|
150
152
|
return withEditor(
|
|
151
|
-
policy.fieldKinds.get(original.kind) ?? fail(
|
|
153
|
+
policy.fieldKinds.get(original.kind) ?? fail(0xb1b /* missing kind */),
|
|
152
154
|
).allowsFieldSuperset(policy, originalData, original.types, superset);
|
|
153
155
|
}
|
|
154
156
|
|
|
@@ -35,8 +35,8 @@ export function isNeverFieldRecursive(
|
|
|
35
35
|
parentTypeStack: Set<TreeNodeStoredSchema>,
|
|
36
36
|
): boolean {
|
|
37
37
|
if (
|
|
38
|
-
(policy.fieldKinds.get(field.kind) ?? fail(
|
|
39
|
-
Multiplicity.Single &&
|
|
38
|
+
(policy.fieldKinds.get(field.kind) ?? fail(0xb1c /* missing field kind */))
|
|
39
|
+
.multiplicity === Multiplicity.Single &&
|
|
40
40
|
field.types !== undefined
|
|
41
41
|
) {
|
|
42
42
|
for (const type of field.types) {
|
|
@@ -94,8 +94,10 @@ export function isNeverTreeRecursive(
|
|
|
94
94
|
parentTypeStack.add(treeNode);
|
|
95
95
|
if (treeNode instanceof MapNodeStoredSchema) {
|
|
96
96
|
return (
|
|
97
|
-
(
|
|
98
|
-
.
|
|
97
|
+
(
|
|
98
|
+
policy.fieldKinds.get(treeNode.mapFields.kind) ??
|
|
99
|
+
fail(0xb1d /* missing field kind */)
|
|
100
|
+
).multiplicity === Multiplicity.Single
|
|
99
101
|
);
|
|
100
102
|
} else if (treeNode instanceof ObjectNodeStoredSchema) {
|
|
101
103
|
for (const field of treeNode.objectNodeFields.values()) {
|
|
@@ -177,7 +177,7 @@ function makeModularChangeCodec(
|
|
|
177
177
|
return encodeNodeChangesForJson(node, fieldContext);
|
|
178
178
|
},
|
|
179
179
|
|
|
180
|
-
decodeNode: () => fail(
|
|
180
|
+
decodeNode: () => fail(0xb1e /* Should not decode nodes during field encoding */),
|
|
181
181
|
};
|
|
182
182
|
|
|
183
183
|
return encodeFieldChangesForJsonI(change, fieldContext);
|
|
@@ -193,7 +193,7 @@ function makeModularChangeCodec(
|
|
|
193
193
|
const { codec, compiledSchema } = getFieldChangesetCodec(fieldChange.fieldKind);
|
|
194
194
|
const encodedChange = codec.json.encode(fieldChange.change, context);
|
|
195
195
|
if (compiledSchema !== undefined && !compiledSchema.check(encodedChange)) {
|
|
196
|
-
fail(
|
|
196
|
+
fail(0xb1f /* Encoded change didn't pass schema validation. */);
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
const fieldKey: FieldKey = field;
|
|
@@ -238,7 +238,7 @@ function makeModularChangeCodec(
|
|
|
238
238
|
for (const field of encodedChange) {
|
|
239
239
|
const { codec, compiledSchema } = getFieldChangesetCodec(field.fieldKind);
|
|
240
240
|
if (compiledSchema !== undefined && !compiledSchema.check(field.change)) {
|
|
241
|
-
fail(
|
|
241
|
+
fail(0xb20 /* Encoded change didn't pass schema validation. */);
|
|
242
242
|
}
|
|
243
243
|
|
|
244
244
|
const fieldId: FieldId = {
|
|
@@ -249,7 +249,7 @@ function makeModularChangeCodec(
|
|
|
249
249
|
const fieldContext: FieldChangeEncodingContext = {
|
|
250
250
|
baseContext: context,
|
|
251
251
|
|
|
252
|
-
encodeNode: () => fail(
|
|
252
|
+
encodeNode: () => fail(0xb21 /* Should not encode nodes during field decoding */),
|
|
253
253
|
|
|
254
254
|
decodeNode: (encodedNode: EncodedNodeChangeset): NodeId => {
|
|
255
255
|
const nodeId: NodeId = {
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
idAllocatorFromMaxId,
|
|
53
53
|
idAllocatorFromState,
|
|
54
54
|
type RangeQueryResult,
|
|
55
|
-
|
|
55
|
+
getOrCreate,
|
|
56
56
|
newTupleBTree,
|
|
57
57
|
mergeTupleBTrees,
|
|
58
58
|
type TupleBTree,
|
|
@@ -321,7 +321,7 @@ export class ModularChangeFamily
|
|
|
321
321
|
crossFieldTable.pendingCompositions.nodeIdsToCompose.push([child1, child2]);
|
|
322
322
|
}
|
|
323
323
|
|
|
324
|
-
return child1 ?? child2 ?? fail(
|
|
324
|
+
return child1 ?? child2 ?? fail(0xb22 /* Should not compose two undefined nodes */);
|
|
325
325
|
};
|
|
326
326
|
|
|
327
327
|
const amendedChange = rebaser.compose(
|
|
@@ -566,7 +566,7 @@ export class ModularChangeFamily
|
|
|
566
566
|
setInChangeAtomIdMap(crossFieldTable.newToBaseNodeId, child2, child1);
|
|
567
567
|
crossFieldTable.pendingCompositions.nodeIdsToCompose.push([child1, child2]);
|
|
568
568
|
}
|
|
569
|
-
return child1 ?? child2 ?? fail(
|
|
569
|
+
return child1 ?? child2 ?? fail(0xb23 /* Should not compose two undefined nodes */);
|
|
570
570
|
},
|
|
571
571
|
idAllocator,
|
|
572
572
|
manager,
|
|
@@ -1426,7 +1426,8 @@ export class ModularChangeFamily
|
|
|
1426
1426
|
constraintState: ConstraintState,
|
|
1427
1427
|
revertConstraintState: ConstraintState,
|
|
1428
1428
|
): void {
|
|
1429
|
-
const node =
|
|
1429
|
+
const node =
|
|
1430
|
+
nodes.get([nodeId.revision, nodeId.localId]) ?? fail(0xb24 /* Unknown node ID */);
|
|
1430
1431
|
if (node.nodeExistsConstraint !== undefined) {
|
|
1431
1432
|
const isNowViolated = inputAttachState === NodeAttachState.Detached;
|
|
1432
1433
|
if (node.nodeExistsConstraint.violated !== isNowViolated) {
|
|
@@ -1924,7 +1925,7 @@ export function updateRefreshers(
|
|
|
1924
1925
|
|
|
1925
1926
|
if (change.builds !== undefined) {
|
|
1926
1927
|
for (const [[revision, id], chunk] of change.builds.entries()) {
|
|
1927
|
-
const lengthTree =
|
|
1928
|
+
const lengthTree = getOrCreate(chunkLengths, revision, () => new BTree());
|
|
1928
1929
|
lengthTree.set(id, chunk.topLevelLength);
|
|
1929
1930
|
}
|
|
1930
1931
|
}
|
|
@@ -3002,7 +3003,7 @@ function fieldChangeFromId(
|
|
|
3002
3003
|
id: FieldId,
|
|
3003
3004
|
): FieldChange {
|
|
3004
3005
|
const fieldMap = fieldMapFromNodeId(fields, nodes, id.nodeId);
|
|
3005
|
-
return fieldMap.get(id.field) ?? fail(
|
|
3006
|
+
return fieldMap.get(id.field) ?? fail(0xb25 /* No field exists for the given ID */);
|
|
3006
3007
|
}
|
|
3007
3008
|
|
|
3008
3009
|
function fieldMapFromNodeId(
|
|
@@ -27,7 +27,7 @@ export class MockNodeKeyManager implements NodeKeyManager {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
public localizeNodeKey(key: StableNodeKey): LocalNodeKey {
|
|
30
|
-
return this.tryLocalizeNodeKey(key) ?? fail(
|
|
30
|
+
return this.tryLocalizeNodeKey(key) ?? fail(0xb26 /* Key is not compressible */);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
public stabilizeNodeKey(key: LocalNodeKey): StableNodeKey {
|
|
@@ -439,7 +439,7 @@ class Cursor extends SynchronousCursor implements ITreeSubscriptionCursor {
|
|
|
439
439
|
}
|
|
440
440
|
public getPath(prefix?: PathRootPrefix): UpPath {
|
|
441
441
|
assert(this.innerCursor !== undefined, 0x436 /* Cursor must be current to be used */);
|
|
442
|
-
return this.innerCursor.getPath(prefix) ?? fail(
|
|
442
|
+
return this.innerCursor.getPath(prefix) ?? fail(0xb27 /* no path when at root */);
|
|
443
443
|
}
|
|
444
444
|
public get fieldIndex(): number {
|
|
445
445
|
assert(this.innerCursor !== undefined, 0x437 /* Cursor must be current to be used */);
|
|
@@ -27,7 +27,7 @@ export function encodeRepo(repo: TreeStoredSchema): Format {
|
|
|
27
27
|
Object.create(null);
|
|
28
28
|
const rootFieldSchema = encodeFieldSchema(repo.rootFieldSchema);
|
|
29
29
|
for (const name of [...repo.nodeSchema.keys()].sort()) {
|
|
30
|
-
const schema = repo.nodeSchema.get(name) ?? fail(
|
|
30
|
+
const schema = repo.nodeSchema.get(name) ?? fail(0xb28 /* missing schema */);
|
|
31
31
|
Object.defineProperty(nodeSchema, name, {
|
|
32
32
|
enumerable: true,
|
|
33
33
|
configurable: true,
|
|
@@ -540,7 +540,7 @@ export class ComposeQueue {
|
|
|
540
540
|
return this.dequeueBase();
|
|
541
541
|
} else if (areOutputCellsEmpty(baseMark) && areInputCellsEmpty(newMark)) {
|
|
542
542
|
const baseCellId: ChangeAtomId =
|
|
543
|
-
getOutputCellId(baseMark) ?? fail(
|
|
543
|
+
getOutputCellId(baseMark) ?? fail(0xb29 /* Expected defined output ID */);
|
|
544
544
|
|
|
545
545
|
if (markEmptiesCells(baseMark) && baseCellId.revision === undefined) {
|
|
546
546
|
// The base revision should always be defined except when squashing changes into a transaction.
|
|
@@ -176,7 +176,7 @@ function invertMark(
|
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
const cellId = getDetachOutputCellId(mark) ?? {
|
|
179
|
-
revision: mark.revision ?? fail(
|
|
179
|
+
revision: mark.revision ?? fail(0xb2a /* Revision must be defined */),
|
|
180
180
|
localId: mark.id,
|
|
181
181
|
};
|
|
182
182
|
|
|
@@ -132,7 +132,7 @@ export function makeV2CodecHelpers(
|
|
|
132
132
|
context,
|
|
133
133
|
);
|
|
134
134
|
case NoopMarkType:
|
|
135
|
-
fail(
|
|
135
|
+
fail(0xb2c /* Mark type: NoopMarkType should not be encoded. */);
|
|
136
136
|
default:
|
|
137
137
|
unreachableCase(type);
|
|
138
138
|
}
|
|
@@ -747,7 +747,7 @@ export function splitMark<TMark extends Mark>(mark: TMark, length: number): [TMa
|
|
|
747
747
|
const markLength = mark.count;
|
|
748
748
|
const remainder = markLength - length;
|
|
749
749
|
if (length < 1 || remainder < 1) {
|
|
750
|
-
fail(
|
|
750
|
+
fail(0xb2d /* Unable to split mark due to lengths */);
|
|
751
751
|
}
|
|
752
752
|
|
|
753
753
|
const [effect1, effect2] = splitMarkEffect(mark, length);
|
|
@@ -345,14 +345,16 @@ class StackCursor<TNode> extends SynchronousCursor implements CursorWithNode<TNo
|
|
|
345
345
|
|
|
346
346
|
public exitField(): void {
|
|
347
347
|
// assert(this.mode === CursorLocationType.Fields, "can only navigate up from field when in field");
|
|
348
|
-
this.siblings =
|
|
349
|
-
|
|
348
|
+
this.siblings =
|
|
349
|
+
this.siblingStack.pop() ?? fail(0xac3 /* Unexpected siblingStack.length */);
|
|
350
|
+
this.index = this.indexStack.pop() ?? fail(0xac4 /* Unexpected indexStack.length */);
|
|
350
351
|
}
|
|
351
352
|
|
|
352
353
|
public exitNode(): void {
|
|
353
354
|
// assert(this.mode === CursorLocationType.Nodes, "can only navigate up from node when in node");
|
|
354
|
-
this.siblings =
|
|
355
|
-
|
|
355
|
+
this.siblings =
|
|
356
|
+
this.siblingStack.pop() ?? fail(0xac5 /* Unexpected siblingStack.length */);
|
|
357
|
+
this.index = this.indexStack.pop() ?? fail(0xac6 /* Unexpected indexStack.length */);
|
|
356
358
|
}
|
|
357
359
|
|
|
358
360
|
public getNode(): TNode {
|
package/src/index.ts
CHANGED
|
@@ -73,7 +73,6 @@ export {
|
|
|
73
73
|
ForestTypeOptimized,
|
|
74
74
|
ForestTypeExpensiveDebug,
|
|
75
75
|
ForestTypeReference,
|
|
76
|
-
type IChannelView,
|
|
77
76
|
} from "./shared-tree/index.js";
|
|
78
77
|
|
|
79
78
|
export {
|
|
@@ -259,3 +258,6 @@ export {
|
|
|
259
258
|
export type { MapNodeInsertableData } from "./simple-tree/index.js";
|
|
260
259
|
|
|
261
260
|
export type { JsonCompatible, JsonCompatibleObject } from "./util/index.js";
|
|
261
|
+
|
|
262
|
+
export { JsonAsTree } from "./jsonDomainSchema.js";
|
|
263
|
+
export { FluidSerializableAsTree } from "./serializableDomainSchema.js";
|