@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
package/dist/feature-libraries/chunked-forest/codec/{schemaBasedEncoding.js → schemaBasedEncode.js}
RENAMED
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.oneFromSet = exports.treeShaper = exports.fieldShaper = exports.buildCache = exports.schemaCompressedEncode = 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
|
const compressedEncode_js_1 = require("./compressedEncode.js");
|
|
12
11
|
const format_js_1 = require("./format.js");
|
|
13
12
|
const nodeShape_js_1 = require("./nodeShape.js");
|
|
@@ -30,7 +29,7 @@ exports.buildCache = buildCache;
|
|
|
30
29
|
* Selects shapes to use to encode fields.
|
|
31
30
|
*/
|
|
32
31
|
function fieldShaper(treeHandler, field, cache, storedSchema) {
|
|
33
|
-
const kind = cache.fieldShapes.get(field.kind) ?? (0,
|
|
32
|
+
const kind = cache.fieldShapes.get(field.kind) ?? (0, internal_1.fail)(0xb52 /* missing FieldKind */);
|
|
34
33
|
const type = oneFromSet(field.types);
|
|
35
34
|
const nodeEncoder = type !== undefined ? treeHandler.shapeFromTree(type) : compressedEncode_js_1.anyNodeEncoder;
|
|
36
35
|
if (kind.multiplicity === index_js_1.Multiplicity.Single) {
|
|
@@ -54,7 +53,7 @@ exports.fieldShaper = fieldShaper;
|
|
|
54
53
|
* Selects shapes to use to encode trees.
|
|
55
54
|
*/
|
|
56
55
|
function treeShaper(fullSchema, policy, fieldHandler, schemaName) {
|
|
57
|
-
const schema = fullSchema.nodeSchema.get(schemaName) ?? (0,
|
|
56
|
+
const schema = fullSchema.nodeSchema.get(schemaName) ?? (0, internal_1.fail)(0xb53 /* missing node schema */);
|
|
58
57
|
if (schema instanceof index_js_1.ObjectNodeStoredSchema) {
|
|
59
58
|
// TODO:Performance:
|
|
60
59
|
// consider moving some optional and sequence fields to extra fields if they are commonly empty
|
|
@@ -74,7 +73,7 @@ function treeShaper(fullSchema, policy, fieldHandler, schemaName) {
|
|
|
74
73
|
const shape = new nodeShape_js_1.NodeShape(schemaName, false, [], fieldHandler.shapeFromField(schema.mapFields));
|
|
75
74
|
return shape;
|
|
76
75
|
}
|
|
77
|
-
(0,
|
|
76
|
+
(0, internal_1.fail)(0xb54 /* unsupported node kind */);
|
|
78
77
|
}
|
|
79
78
|
exports.treeShaper = treeShaper;
|
|
80
79
|
function oneFromSet(set) {
|
|
@@ -104,4 +103,4 @@ function valueShapeFromSchema(schema) {
|
|
|
104
103
|
(0, internal_1.unreachableCase)(schema);
|
|
105
104
|
}
|
|
106
105
|
}
|
|
107
|
-
//# sourceMappingURL=
|
|
106
|
+
//# sourceMappingURL=schemaBasedEncode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaBasedEncode.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAEpF,qDAUgC;AAGhC,+DAS+B;AAE/B,2CAA2F;AAC3F,iDAA2C;AAG3C;;;;;GAKG;AACH,SAAgB,sBAAsB,CACrC,MAA8B,EAC9B,MAAwB,EACxB,UAAsB,EACtB,YAA2B;IAE3B,OAAO,IAAA,sCAAgB,EAAC,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;AAC/E,CAAC;AAPD,wDAOC;A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corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype StoredSchemaCollection,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\tValueSchema,\n\tMultiplicity,\n\tidentifierFieldKindIdentifier,\n} from \"../../../core/index.js\";\nimport type { FullSchemaPolicy } from \"../../modular-schema/index.js\";\n\nimport {\n\tEncoderCache,\n\ttype FieldEncoder,\n\ttype FieldShaper,\n\ttype KeyedFieldEncoder,\n\ttype TreeShaper,\n\tanyNodeEncoder,\n\tasFieldEncoder,\n\tcompressedEncode,\n} from \"./compressedEncode.js\";\nimport type { FieldBatch } from \"./fieldBatch.js\";\nimport { type EncodedFieldBatch, type EncodedValueShape, SpecialField } from \"./format.js\";\nimport { NodeShape } from \"./nodeShape.js\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk`.\n *\n * Optimized for encoded size and encoding performance.\n * TODO: This function should eventually also take in the root FieldSchema to more efficiently compress the nodes.\n */\nexport function schemaCompressedEncode(\n\tschema: StoredSchemaCollection,\n\tpolicy: FullSchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n): EncodedFieldBatch {\n\treturn compressedEncode(fieldBatch, buildCache(schema, policy, idCompressor));\n}\n\nexport function buildCache(\n\tschema: StoredSchemaCollection,\n\tpolicy: FullSchemaPolicy,\n\tidCompressor: IIdCompressor,\n): EncoderCache {\n\tconst cache: EncoderCache = new EncoderCache(\n\t\t(fieldHandler: FieldShaper, schemaName: TreeNodeSchemaIdentifier) =>\n\t\t\ttreeShaper(schema, policy, fieldHandler, schemaName),\n\t\t(treeHandler: TreeShaper, field: TreeFieldStoredSchema) =>\n\t\t\tfieldShaper(treeHandler, field, cache, schema),\n\t\tpolicy.fieldKinds,\n\t\tidCompressor,\n\t);\n\treturn cache;\n}\n\n/**\n * Selects shapes to use to encode fields.\n */\nexport function fieldShaper(\n\ttreeHandler: TreeShaper,\n\tfield: TreeFieldStoredSchema,\n\tcache: EncoderCache,\n\tstoredSchema: StoredSchemaCollection,\n): FieldEncoder {\n\tconst kind = cache.fieldShapes.get(field.kind) ?? fail(0xb52 /* missing FieldKind */);\n\tconst type = oneFromSet(field.types);\n\tconst nodeEncoder = type !== undefined ? treeHandler.shapeFromTree(type) : anyNodeEncoder;\n\tif (kind.multiplicity === Multiplicity.Single) {\n\t\tif (field.kind === identifierFieldKindIdentifier) {\n\t\t\tassert(type !== undefined, 0x999 /* field type must be defined in identifier field */);\n\t\t\tconst nodeSchema = storedSchema.nodeSchema.get(type);\n\t\t\tassert(nodeSchema !== undefined, 0x99a /* nodeSchema must be defined */);\n\t\t\tassert(\n\t\t\t\tnodeSchema instanceof LeafNodeStoredSchema,\n\t\t\t\t0x99b /* nodeSchema must be LeafNodeStoredSchema */,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\tnodeSchema.leafValue === ValueSchema.String,\n\t\t\t\t0x99c /* identifier field can only be type string */,\n\t\t\t);\n\t\t\tconst identifierNodeEncoder = new NodeShape(\n\t\t\t\ttype,\n\t\t\t\tSpecialField.Identifier,\n\t\t\t\t[],\n\t\t\t\tundefined,\n\t\t\t);\n\t\t\treturn asFieldEncoder(identifierNodeEncoder);\n\t\t}\n\t\treturn asFieldEncoder(nodeEncoder);\n\t} else {\n\t\treturn cache.nestedArray(nodeEncoder);\n\t}\n}\n\n/**\n * Selects shapes to use to encode trees.\n */\nexport function treeShaper(\n\tfullSchema: StoredSchemaCollection,\n\tpolicy: FullSchemaPolicy,\n\tfieldHandler: FieldShaper,\n\tschemaName: TreeNodeSchemaIdentifier,\n): NodeShape {\n\tconst schema =\n\t\tfullSchema.nodeSchema.get(schemaName) ?? fail(0xb53 /* missing node schema */);\n\n\tif (schema instanceof ObjectNodeStoredSchema) {\n\t\t// TODO:Performance:\n\t\t// consider moving some optional and sequence fields to extra fields if they are commonly empty\n\t\t// to reduce encoded size.\n\n\t\tconst objectNodeFields: KeyedFieldEncoder[] = [];\n\t\tfor (const [key, field] of schema.objectNodeFields ?? []) {\n\t\t\tobjectNodeFields.push({ key, shape: fieldHandler.shapeFromField(field) });\n\t\t}\n\n\t\tconst shape = new NodeShape(schemaName, false, objectNodeFields, undefined);\n\t\treturn shape;\n\t}\n\tif (schema instanceof LeafNodeStoredSchema) {\n\t\tconst shape = new NodeShape(\n\t\t\tschemaName,\n\t\t\tvalueShapeFromSchema(schema.leafValue),\n\t\t\t[],\n\t\t\tundefined,\n\t\t);\n\t\treturn shape;\n\t}\n\tif (schema instanceof MapNodeStoredSchema) {\n\t\tconst shape = new NodeShape(\n\t\t\tschemaName,\n\t\t\tfalse,\n\t\t\t[],\n\t\t\tfieldHandler.shapeFromField(schema.mapFields),\n\t\t);\n\t\treturn shape;\n\t}\n\tfail(0xb54 /* unsupported node kind */);\n}\n\nexport function oneFromSet<T>(set: ReadonlySet<T> | undefined): T | undefined {\n\tif (set === undefined) {\n\t\treturn undefined;\n\t}\n\tif (set.size !== 1) {\n\t\treturn undefined;\n\t}\n\tfor (const item of set) {\n\t\treturn item;\n\t}\n}\n\nfunction valueShapeFromSchema(schema: ValueSchema | undefined): undefined | EncodedValueShape {\n\tswitch (schema) {\n\t\tcase undefined:\n\t\t\treturn false;\n\t\tcase ValueSchema.Number:\n\t\tcase ValueSchema.String:\n\t\tcase ValueSchema.Boolean:\n\t\tcase ValueSchema.FluidHandle:\n\t\t\treturn true;\n\t\tcase ValueSchema.Null:\n\t\t\treturn [null];\n\t\tdefault:\n\t\t\tunreachableCase(schema);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emptyChunk.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/emptyChunk.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"emptyChunk.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/emptyChunk.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAON,KAAK,aAAa,EAClB,KAAK,SAAS,EAGd,MAAM,qBAAqB,CAAC;AAG7B;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,EAAE,SAUxB,CAAC;AAOF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,aAoEzB,CAAC"}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.emptyCursor = exports.emptyChunk = void 0;
|
|
8
|
+
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
8
9
|
const index_js_1 = require("../../core/index.js");
|
|
9
|
-
const index_js_2 = require("../../util/index.js");
|
|
10
10
|
const treeCursorUtils_js_1 = require("../treeCursorUtils.js");
|
|
11
11
|
/**
|
|
12
12
|
* Chunk that is empty.
|
|
@@ -40,10 +40,10 @@ exports.emptyCursor = {
|
|
|
40
40
|
mode: 1 /* CursorLocationType.Fields */,
|
|
41
41
|
[index_js_1.cursorChunk]: exports.emptyChunk,
|
|
42
42
|
nextField() {
|
|
43
|
-
(0,
|
|
43
|
+
(0, internal_1.fail)(0xafb /* cannot navigate above root */);
|
|
44
44
|
},
|
|
45
45
|
exitField() {
|
|
46
|
-
(0,
|
|
46
|
+
(0, internal_1.fail)(0xafc /* cannot navigate above root */);
|
|
47
47
|
},
|
|
48
48
|
skipPendingFields() {
|
|
49
49
|
return true;
|
|
@@ -58,43 +58,43 @@ exports.emptyCursor = {
|
|
|
58
58
|
return false;
|
|
59
59
|
},
|
|
60
60
|
enterNode(childIndex) {
|
|
61
|
-
(0,
|
|
61
|
+
(0, internal_1.fail)(0xafd /* empty cursor has no nodes */);
|
|
62
62
|
},
|
|
63
63
|
getFieldPath(prefix) {
|
|
64
64
|
return (0, treeCursorUtils_js_1.prefixFieldPath)(prefix, emptyPath);
|
|
65
65
|
},
|
|
66
66
|
getPath() {
|
|
67
|
-
(0,
|
|
67
|
+
(0, internal_1.fail)(0xafe /* empty cursor has no nodes */);
|
|
68
68
|
},
|
|
69
69
|
get fieldIndex() {
|
|
70
|
-
return (0,
|
|
70
|
+
return (0, internal_1.fail)(0xaff /* empty cursor has no nodes */);
|
|
71
71
|
},
|
|
72
72
|
get chunkStart() {
|
|
73
|
-
return (0,
|
|
73
|
+
return (0, internal_1.fail)(0xb00 /* empty cursor has no nodes */);
|
|
74
74
|
},
|
|
75
75
|
get chunkLength() {
|
|
76
|
-
return (0,
|
|
76
|
+
return (0, internal_1.fail)(0xb01 /* empty cursor has no nodes */);
|
|
77
77
|
},
|
|
78
78
|
seekNodes(offset) {
|
|
79
|
-
(0,
|
|
79
|
+
(0, internal_1.fail)(0xb02 /* empty cursor has no nodes */);
|
|
80
80
|
},
|
|
81
81
|
nextNode() {
|
|
82
|
-
(0,
|
|
82
|
+
(0, internal_1.fail)(0xb03 /* empty cursor has no nodes */);
|
|
83
83
|
},
|
|
84
84
|
exitNode() {
|
|
85
|
-
(0,
|
|
85
|
+
(0, internal_1.fail)(0xb04 /* empty cursor has no nodes */);
|
|
86
86
|
},
|
|
87
87
|
firstField() {
|
|
88
|
-
(0,
|
|
88
|
+
(0, internal_1.fail)(0xb05 /* empty cursor has no nodes */);
|
|
89
89
|
},
|
|
90
90
|
enterField(key) {
|
|
91
|
-
(0,
|
|
91
|
+
(0, internal_1.fail)(0xb06 /* empty cursor has no nodes */);
|
|
92
92
|
},
|
|
93
93
|
get type() {
|
|
94
|
-
return (0,
|
|
94
|
+
return (0, internal_1.fail)(0xb07 /* empty cursor has no nodes */);
|
|
95
95
|
},
|
|
96
96
|
get value() {
|
|
97
|
-
return (0,
|
|
97
|
+
return (0, internal_1.fail)(0xb08 /* empty cursor has no nodes */);
|
|
98
98
|
},
|
|
99
99
|
atChunkRoot() {
|
|
100
100
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emptyChunk.js","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/emptyChunk.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kDAW6B;AAC7B,
|
|
1
|
+
{"version":3,"file":"emptyChunk.js","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/emptyChunk.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA2D;AAC3D,kDAW6B;AAC7B,8DAAwD;AAExD;;;;;;GAMG;AACU,QAAA,UAAU,GAAc;IACpC,cAAc,EAAE,CAAC;IACjB,MAAM;QACL,OAAO,mBAAW,CAAC;IACpB,CAAC;IACD,cAAc,KAAU,CAAC;IACzB,gBAAgB,KAAU,CAAC;IAC3B,QAAQ;QACP,OAAO,KAAK,CAAC,CAAC,yCAAyC;IACxD,CAAC;CACD,CAAC;AAEF,MAAM,SAAS,GAAgB;IAC9B,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,oBAAS;CAChB,CAAC;AAEF;;;GAGG;AACU,QAAA,WAAW,GAAkB;IACzC,CAAC,uBAAY,CAAC,EAAE,IAAI;IACpB,OAAO,EAAE,KAAK;IACd,IAAI,mCAA2B;IAC/B,CAAC,sBAAW,CAAC,EAAE,kBAAU;IACzB,SAAS;QACR,IAAA,eAAI,EAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;IAC9C,CAAC;IACD,SAAS;QACR,IAAA,eAAI,EAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;IAC9C,CAAC;IACD,iBAAiB;QAChB,OAAO,IAAI,CAAC;IACb,CAAC;IACD,WAAW;QACV,OAAO,SAAS,CAAC,KAAK,CAAC;IACxB,CAAC;IACD,cAAc;QACb,OAAO,CAAC,CAAC;IACV,CAAC;IACD,SAAS;QACR,OAAO,KAAK,CAAC;IACd,CAAC;IACD,SAAS,CAAC,UAAkB;QAC3B,IAAA,eAAI,EAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAC7C,CAAC;IACD,YAAY,CAAC,MAAuB;QACnC,OAAO,IAAA,oCAAe,EAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO;QACN,IAAA,eAAI,EAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAC7C,CAAC;IACD,IAAI,UAAU;QACb,OAAO,IAAA,eAAI,EAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACpD,CAAC;IACD,IAAI,UAAU;QACb,OAAO,IAAA,eAAI,EAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACpD,CAAC;IACD,IAAI,WAAW;QACd,OAAO,IAAA,eAAI,EAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACpD,CAAC;IACD,SAAS,CAAC,MAAc;QACvB,IAAA,eAAI,EAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAC7C,CAAC;IACD,QAAQ;QACP,IAAA,eAAI,EAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAC7C,CAAC;IACD,QAAQ;QACP,IAAA,eAAI,EAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAC7C,CAAC;IACD,UAAU;QACT,IAAA,eAAI,EAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAC7C,CAAC;IACD,UAAU,CAAC,GAAa;QACvB,IAAA,eAAI,EAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAC7C,CAAC;IACD,IAAI,IAAI;QACP,OAAO,IAAA,eAAI,EAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACpD,CAAC;IACD,IAAI,KAAK;QACR,OAAO,IAAA,eAAI,EAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACpD,CAAC;IACD,WAAW;QACV,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI;QACH,OAAO,mBAAW,CAAC;IACpB,CAAC;CACD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\nimport {\n\tCursorLocationType,\n\tCursorMarker,\n\ttype FieldKey,\n\ttype FieldUpPath,\n\ttype PathRootPrefix,\n\ttype UpPath,\n\ttype ChunkedCursor,\n\ttype TreeChunk,\n\tcursorChunk,\n\tdummyRoot,\n} from \"../../core/index.js\";\nimport { prefixFieldPath } from \"../treeCursorUtils.js\";\n\n/**\n * Chunk that is empty.\n *\n * Since all emptiness is the same, this is a singleton.\n *\n * Useful for when a chunk or cursor is needed for an empty field or detached sequence.\n */\nexport const emptyChunk: TreeChunk = {\n\ttopLevelLength: 0,\n\tcursor(): ChunkedCursor {\n\t\treturn emptyCursor;\n\t},\n\treferenceAdded(): void {},\n\treferenceRemoved(): void {},\n\tisShared(): boolean {\n\t\treturn false; // Immutable, so sharing does not matter.\n\t},\n};\n\nconst emptyPath: FieldUpPath = {\n\tparent: undefined,\n\tfield: dummyRoot,\n};\n\n/**\n * Cursor over an empty field.\n * Contains no nodes and is stateless.\n */\nexport const emptyCursor: ChunkedCursor = {\n\t[CursorMarker]: true,\n\tpending: false,\n\tmode: CursorLocationType.Fields,\n\t[cursorChunk]: emptyChunk,\n\tnextField(): boolean {\n\t\tfail(0xafb /* cannot navigate above root */);\n\t},\n\texitField(): void {\n\t\tfail(0xafc /* cannot navigate above root */);\n\t},\n\tskipPendingFields(): boolean {\n\t\treturn true;\n\t},\n\tgetFieldKey(): FieldKey {\n\t\treturn emptyPath.field;\n\t},\n\tgetFieldLength(): number {\n\t\treturn 0;\n\t},\n\tfirstNode(): boolean {\n\t\treturn false;\n\t},\n\tenterNode(childIndex: number): void {\n\t\tfail(0xafd /* empty cursor has no nodes */);\n\t},\n\tgetFieldPath(prefix?: PathRootPrefix): FieldUpPath {\n\t\treturn prefixFieldPath(prefix, emptyPath);\n\t},\n\tgetPath(): UpPath | undefined {\n\t\tfail(0xafe /* empty cursor has no nodes */);\n\t},\n\tget fieldIndex(): never {\n\t\treturn fail(0xaff /* empty cursor has no nodes */);\n\t},\n\tget chunkStart(): never {\n\t\treturn fail(0xb00 /* empty cursor has no nodes */);\n\t},\n\tget chunkLength(): never {\n\t\treturn fail(0xb01 /* empty cursor has no nodes */);\n\t},\n\tseekNodes(offset: number): boolean {\n\t\tfail(0xb02 /* empty cursor has no nodes */);\n\t},\n\tnextNode(): boolean {\n\t\tfail(0xb03 /* empty cursor has no nodes */);\n\t},\n\texitNode(): void {\n\t\tfail(0xb04 /* empty cursor has no nodes */);\n\t},\n\tfirstField(): boolean {\n\t\tfail(0xb05 /* empty cursor has no nodes */);\n\t},\n\tenterField(key: FieldKey): void {\n\t\tfail(0xb06 /* empty cursor has no nodes */);\n\t},\n\tget type(): never {\n\t\treturn fail(0xb07 /* empty cursor has no nodes */);\n\t},\n\tget value(): never {\n\t\treturn fail(0xb08 /* empty cursor has no nodes */);\n\t},\n\tatChunkRoot(): boolean {\n\t\treturn true;\n\t},\n\tfork(): ChunkedCursor {\n\t\treturn emptyCursor;\n\t},\n};\n"]}
|
|
@@ -101,9 +101,10 @@ declare class OffsetShape {
|
|
|
101
101
|
/**
|
|
102
102
|
* @param shape - the shape of each child in this field
|
|
103
103
|
* @param topLevelLength - number of top level nodes in this sequence chunk (either field within a chunk, or top level chunk)
|
|
104
|
-
* @param offset - number of nodes before this in the parent's subtree
|
|
104
|
+
* @param offset - number of nodes before this in the parent's subtree. The nodes are considered in depth first pre order
|
|
105
|
+
* traversal, so a parent is the first node in its subtree (before its children) with offset 0
|
|
105
106
|
* @param key - field key
|
|
106
|
-
* @param indexOfParentField - index
|
|
107
|
+
* @param indexOfParentField - index to this shape in the parent's array of fields
|
|
107
108
|
*/
|
|
108
109
|
constructor(shape: TreeShape, topLevelLength: number, offset: number, key: FieldKey, indexOfParentField: number | undefined);
|
|
109
110
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uniformChunk.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/uniformChunk.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,kBAAkB,EAClB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,WAAW,EAEX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"uniformChunk.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/uniformChunk.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,kBAAkB,EAClB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,WAAW,EAEX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAW,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAA+B,MAAM,uBAAuB,CAAC;AAEvF,OAAO,KAAK,EAA4B,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAG7F;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,CAE9E;AAED;;;;;GAKG;AACH,qBAAa,YAAa,SAAQ,oBAAqB,YAAW,SAAS;IASlE,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,SAAS,EAAE;IATpB,YAAY,EAAE,SAAS,GAAG,aAAa,CAAC;IAC/C;;;;;OAKG;gBAEK,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,SAAS,EAAE,EAC1B,YAAY,CAAC,EAAE,aAAa;IAU7B,IAAW,cAAc,IAAI,MAAM,CAElC;IAEM,KAAK,IAAI,YAAY;IAI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;;;;OAMG;IACH,OAAO,CAAC,cAAc;IAStB;;;;;;;;;OASG;IACH,OAAO,CAAC,QAAQ;IAST,SAAS,IAAI,OAAO;IAYpB,SAAS,IAAI,IAAI;IAOjB,WAAW,IAAI,QAAQ;IAIvB,cAAc,IAAI,MAAM;IAexB,SAAS,IAAI,OAAO;IAepB,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAkB1C;;;OAGG;IACH,OAAO,CAAC,cAAc;IAiBtB,OAAO,CAAC,kBAAkB;IAQnB,YAAY,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,WAAW;IAOlD,OAAO,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS;IAI3D,IAAW,UAAU,IAAI,MAAM,CAE9B;IAED,SAAgB,UAAU,EAAE,MAAM,CAAK;IAEvC,IAAW,WAAW,IAAI,MAAM,CAE/B;IAEM,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAWlC,QAAQ,IAAI,OAAO;IAanB,QAAQ,IAAI,IAAI;IAahB,UAAU,IAAI,OAAO;IAYrB,UAAU,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI;IAWtC,IAAW,IAAI,IAAI,wBAAwB,CAE1C;IAED,IAAW,KAAK,IAAI,KAAK,CAYxB;CACD"}
|
|
@@ -155,9 +155,10 @@ class OffsetShape {
|
|
|
155
155
|
/**
|
|
156
156
|
* @param shape - the shape of each child in this field
|
|
157
157
|
* @param topLevelLength - number of top level nodes in this sequence chunk (either field within a chunk, or top level chunk)
|
|
158
|
-
* @param offset - number of nodes before this in the parent's subtree
|
|
158
|
+
* @param offset - number of nodes before this in the parent's subtree. The nodes are considered in depth first pre order
|
|
159
|
+
* traversal, so a parent is the first node in its subtree (before its children) with offset 0
|
|
159
160
|
* @param key - field key
|
|
160
|
-
* @param indexOfParentField - index
|
|
161
|
+
* @param indexOfParentField - index to this shape in the parent's array of fields
|
|
161
162
|
*/
|
|
162
163
|
constructor(shape, topLevelLength, offset, key, indexOfParentField) {
|
|
163
164
|
this.shape = shape;
|
|
@@ -277,7 +278,7 @@ class Cursor extends treeCursorUtils_js_1.SynchronousCursor {
|
|
|
277
278
|
this.mode = 0 /* CursorLocationType.Nodes */;
|
|
278
279
|
}
|
|
279
280
|
getFieldKey() {
|
|
280
|
-
return this.fieldKey ?? (0,
|
|
281
|
+
return this.fieldKey ?? (0, internal_1.fail)(0xb09 /* not in a field */);
|
|
281
282
|
}
|
|
282
283
|
getFieldLength() {
|
|
283
284
|
(0, internal_1.assert)(this.mode === 1 /* CursorLocationType.Fields */, 0x53f /* tried to access cursor when in wrong mode */);
|
|
@@ -380,11 +381,11 @@ class Cursor extends treeCursorUtils_js_1.SynchronousCursor {
|
|
|
380
381
|
const info = this.nodeInfo(0 /* CursorLocationType.Nodes */);
|
|
381
382
|
this.indexOfField =
|
|
382
383
|
info.indexOfParentField ??
|
|
383
|
-
(0,
|
|
384
|
+
(0, internal_1.fail)(0xb0a /* navigation up to root field not yet supported */); // TODO;
|
|
384
385
|
this.fieldKey = info.parentField;
|
|
385
386
|
this.mode = 1 /* CursorLocationType.Fields */;
|
|
386
387
|
this.moveToPosition(info.indexOfParentPosition ??
|
|
387
|
-
(0,
|
|
388
|
+
(0, internal_1.fail)(0xb0b /* navigation up to root field not yet supported */)); // TODO
|
|
388
389
|
}
|
|
389
390
|
firstField() {
|
|
390
391
|
const fieldsArray = this.nodeInfo(0 /* CursorLocationType.Nodes */).shape.fieldsArray;
|
|
@@ -403,7 +404,7 @@ class Cursor extends treeCursorUtils_js_1.SynchronousCursor {
|
|
|
403
404
|
this.indexOfField =
|
|
404
405
|
fieldInfo === undefined
|
|
405
406
|
? fieldMap.size
|
|
406
|
-
: (fieldInfo.indexOfParentField ?? (0,
|
|
407
|
+
: (fieldInfo.indexOfParentField ?? (0, internal_1.fail)(0xb0c /* children should have parents */));
|
|
407
408
|
this.fieldKey = key;
|
|
408
409
|
this.mode = 1 /* CursorLocationType.Fields */;
|
|
409
410
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uniformChunk.js","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/uniformChunk.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAiF;AAEjF,kDAa6B;AAC7B,kDAA0E;AAC1E,8DAAuF;AAGvF,uEAAsE;AAEtE;;;;;GAKG;AACH,SAAgB,YAAY,CAAC,KAAiB,EAAE,MAAmB;IAClE,OAAO,IAAI,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACxC,CAAC;AAFD,oCAEC;AAED;;;;;GAKG;AACH,MAAa,YAAa,SAAQ,+BAAoB;IAErD;;;;;OAKG;IACH,YACQ,KAAiB,EACjB,MAAmB,EAC1B,YAA4B;QAE5B,KAAK,EAAE,CAAC;QAJD,UAAK,GAAL,KAAK,CAAY;QACjB,WAAM,GAAN,MAAM,CAAa;QAI1B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAA,iBAAM,EACL,KAAK,CAAC,SAAS,CAAC,qBAAqB,GAAG,KAAK,CAAC,cAAc,KAAK,MAAM,CAAC,MAAM,EAC9E,KAAK,CAAC,wCAAwC,CAC9C,CAAC;IACH,CAAC;IAED,IAAW,cAAc;QACxB,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC;IAClC,CAAC;IAEM,KAAK;QACX,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IAC1D,CAAC;IAEM,MAAM;QACZ,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAES,cAAc,KAAU,CAAC;CACnC;AAlCD,oCAkCC;AAUD;;;;;;;GAOG;AACH,MAAa,SAAS;IAQrB;;;;;;;;;OASG;IACH,YACiB,IAA8B,EAC9B,QAAiB,EACjB,WAAkC,EAClC,kCAA2C,KAAK;QAHhD,SAAI,GAAJ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IT License.\n */\n\nimport { assert, compareArrays, oob } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tCursorLocationType,\n\ttype FieldKey,\n\ttype FieldUpPath,\n\ttype PathRootPrefix,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeValue,\n\ttype UpPath,\n\ttype Value,\n\ttype ChunkedCursor,\n\ttype TreeChunk,\n\tcursorChunk,\n\tdummyRoot,\n} from \"../../core/index.js\";\nimport { ReferenceCountedBase, fail, hasSome } from \"../../util/index.js\";\nimport { SynchronousCursor, prefixFieldPath, prefixPath } from \"../treeCursorUtils.js\";\n\nimport type { SessionSpaceCompressedId, IIdCompressor } from \"@fluidframework/id-compressor\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * Create a tree chunk with ref count 1.\n *\n * @param shape - describes the semantics and layout of `values`.\n * @param values - provides exclusive ownership of this array to this object (which might mutate it in the future).\n */\nexport function uniformChunk(shape: ChunkShape, values: TreeValue[]): TreeChunk {\n\treturn new UniformChunk(shape, values);\n}\n\n/**\n * Chunk which handles a sequence of trees with identical \"shape\" (see `TreeShape`).\n *\n * Separates shape from content,\n * allowing deduplication of shape information and storing of content as a flat sequence of values.\n */\nexport class UniformChunk extends ReferenceCountedBase implements TreeChunk {\n\tpublic idCompressor: undefined | IIdCompressor;\n\t/**\n\t * Create a tree chunk with ref count 1.\n\t *\n\t * @param shape - describes the semantics and layout of `values`.\n\t * @param values - provides exclusive ownership of this array to this object (which might mutate it in the future).\n\t */\n\tpublic constructor(\n\t\tpublic shape: ChunkShape,\n\t\tpublic values: TreeValue[],\n\t\tidCompressor?: IIdCompressor,\n\t) {\n\t\tsuper();\n\t\tthis.idCompressor = idCompressor;\n\t\tassert(\n\t\t\tshape.treeShape.valuesPerTopLevelNode * shape.topLevelLength === values.length,\n\t\t\t0x4c3 /* invalid number of values for shape */,\n\t\t);\n\t}\n\n\tpublic get topLevelLength(): number {\n\t\treturn this.shape.topLevelLength;\n\t}\n\n\tpublic clone(): UniformChunk {\n\t\treturn new UniformChunk(this.shape, this.values.slice());\n\t}\n\n\tpublic cursor(): Cursor {\n\t\treturn new Cursor(this);\n\t}\n\n\tprotected onUnreferenced(): void {}\n}\n\n/**\n * The \"shape\" of a field.\n *\n * Requires that all trees in the field have the same shape, which is described by `TreeShape`.\n * Note that this requirement means that not all fields can be described using this type.\n */\nexport type FieldShape = readonly [FieldKey, TreeShape, number];\n\n/**\n * The \"shape\" of a tree.\n * Does not contain the actual values from the tree, but describes everything else,\n * including where the values would be found in a flat values array.\n *\n * Note that since this requires fields to have uniform shapes (see `FieldShape`),\n * not all trees can have their shape described using this type.\n */\nexport class TreeShape {\n\tpublic readonly fields: ReadonlyMap<FieldKey, OffsetShape>;\n\tpublic readonly fieldsOffsetArray: readonly OffsetShape[];\n\tpublic readonly valuesPerTopLevelNode: number;\n\n\t// TODO: this is only needed at chunk roots. Optimize it base on that.\n\tpublic readonly positions: readonly NodePositionInfo[];\n\n\t/**\n\t *\n\t * @param type - {@link TreeNodeSchemaIdentifier} used to compare shapes.\n\t * @param hasValue - whether or not the TreeShape has a value.\n\t * @param fieldsArray - an array of {@link FieldShape} values, which contains a TreeShape for each FieldKey.\n\t *\n\t * @param maybeDecompressedStringAsNumber - used to check whether or not the value could have been compressed by the idCompressor.\n\t * This flag can only be set on string leaf nodes, and will throw a usage error otherwise.\n\t * If set to true, an additional check can be made (example: getting the value of {@link Cursor}) to return the original uncompressed value.\n\t */\n\tpublic constructor(\n\t\tpublic readonly type: TreeNodeSchemaIdentifier,\n\t\tpublic readonly hasValue: boolean,\n\t\tpublic readonly fieldsArray: readonly FieldShape[],\n\t\tpublic readonly maybeDecompressedStringAsNumber: boolean = false,\n\t) {\n\t\tif (\n\t\t\tmaybeDecompressedStringAsNumber &&\n\t\t\t!(hasValue && type === \"com.fluidframework.leaf.string\")\n\t\t) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"maybeDecompressedStringAsNumber flag can only be set to true for string leaf node.\",\n\t\t\t);\n\t\t}\n\t\tconst fields: Map<FieldKey, OffsetShape> = new Map();\n\t\tlet numberOfValues = hasValue ? 1 : 0;\n\t\tconst infos: NodePositionInfo[] = [\n\t\t\tnew NodePositionInfo(undefined, dummyRoot, 0, undefined, undefined, this, 1, 0),\n\t\t];\n\t\tlet fieldIndex = 0;\n\t\tfor (const [k, f, length] of fieldsArray) {\n\t\t\tassert(!fields.has(k), 0x4c5 /* no duplicate keys */);\n\t\t\tconst offset = new OffsetShape(f, length, infos.length, k, fieldIndex);\n\t\t\tfields.set(k, offset);\n\t\t\tclonePositions(0, [k, f, length], fieldIndex, numberOfValues, infos);\n\t\t\tnumberOfValues += f.valuesPerTopLevelNode * length;\n\t\t\tfieldIndex++;\n\t\t}\n\t\tthis.fields = fields;\n\t\tthis.valuesPerTopLevelNode = numberOfValues;\n\t\tthis.positions = infos;\n\n\t\tthis.fieldsOffsetArray = [...fields.values()];\n\t}\n\n\tpublic equals(other: TreeShape): boolean {\n\t\t// TODO: either dedup instances and/or store a collision resistant hash for fast compare.\n\n\t\tif (\n\t\t\t!compareArrays(\n\t\t\t\tthis.fieldsArray,\n\t\t\t\tother.fieldsArray,\n\t\t\t\t([k, f, l], [k2, f2, l2]) => k === k2 && l === l2 && f.equals(f2),\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t\treturn this.type === other.type && this.hasValue === other.hasValue;\n\t}\n\n\tpublic withTopLevelLength(topLevelLength: number): ChunkShape {\n\t\treturn new ChunkShape(this, topLevelLength);\n\t}\n}\n\nfunction clonePositions(\n\tindexOfParentInOutput: number | undefined,\n\t[key, shape, copies]: FieldShape,\n\tindexOfParentField: number,\n\tvalueOffset: number,\n\toutputInto: NodePositionInfo[] | (NodePositionInfo | undefined)[],\n): void {\n\tconst offset = outputInto.length;\n\tfor (let index = 0; index < copies; index++) {\n\t\tfor (const inner of shape.positions) {\n\t\t\tconst wasRoot = inner.indexOfParentPosition === undefined;\n\t\t\tconst parentPositionIndex = wasRoot\n\t\t\t\t? indexOfParentInOutput\n\t\t\t\t: inner.indexOfParentPosition + index * shape.positions.length + offset;\n\t\t\toutputInto.push(\n\t\t\t\tnew NodePositionInfo(\n\t\t\t\t\tparentPositionIndex === undefined ? undefined : outputInto[parentPositionIndex],\n\t\t\t\t\tinner.parentField === dummyRoot ? key : inner.parentField,\n\t\t\t\t\twasRoot ? index : inner.parentIndex,\n\t\t\t\t\tinner.indexOfParentField ?? indexOfParentField,\n\t\t\t\t\tparentPositionIndex,\n\t\t\t\t\tinner.shape,\n\t\t\t\t\twasRoot ? copies : inner.topLevelLength,\n\t\t\t\t\tinner.valueOffset + valueOffset + shape.valuesPerTopLevelNode * index,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t}\n}\n\n/**\n * The shape (see `TreeShape`) of a sequence of trees, all with the same shape (like `FieldShape`, but without a field key).\n *\n * This shape is optimized (by caching derived data like the positions array),\n * so that when paired with a value array it can be efficiently traversed like a tree by an {@link ITreeCursorSynchronous}.\n * See {@link uniformChunk} for how to do this.\n *\n * TODO: consider storing shape information in WASM\n */\nexport class ChunkShape {\n\tpublic readonly positions: readonly (NodePositionInfo | undefined)[];\n\n\tpublic constructor(\n\t\tpublic readonly treeShape: TreeShape,\n\t\tpublic readonly topLevelLength: number,\n\t) {\n\t\tassert(topLevelLength > 0, 0x4c6 /* topLevelLength must be greater than 0 */);\n\n\t\t// TODO: avoid duplication from inner loop\n\t\tconst positions: (NodePositionInfo | undefined)[] = [undefined];\n\t\tclonePositions(0, [dummyRoot, treeShape, topLevelLength], 0, 0, positions);\n\t\tthis.positions = positions;\n\t}\n\n\tpublic equals(other: ChunkShape): boolean {\n\t\t// TODO: either dedup instances and/or store a collision resistant hash for fast compare.\n\t\treturn this.topLevelLength === other.topLevelLength && this.treeShape === other.treeShape;\n\t}\n}\n\n/**\n * Shape of a field (like `FieldShape`) but with information about how it would be offset within a chunk because of its parents.\n */\nclass OffsetShape {\n\t/**\n\t * @param shape - the shape of each child in this field\n\t * @param topLevelLength - number of top level nodes in this sequence chunk (either field within a chunk, or top level chunk)\n\t * @param offset - number of nodes before this in the parent's subtree\n\t * @param key - field key\n\t * @param indexOfParentField - index of node with this shape\n\t */\n\tpublic constructor(\n\t\tpublic readonly shape: TreeShape,\n\t\tpublic readonly topLevelLength: number,\n\t\tpublic readonly offset: number,\n\t\tpublic readonly key: FieldKey,\n\t\tpublic readonly indexOfParentField: number | undefined,\n\t) {}\n}\n\n/**\n * Information about a node at a specific position within a uniform chunk.\n */\nclass NodePositionInfo implements UpPath {\n\t/**\n\t * @param parent - TODO\n\t * @param parentField - TODO\n\t * @param parentIndex - indexWithinParentField\n\t * @param indexOfParentField - which field of the parent `parentIndex` is indexing into to locate this.\n\t * @param indexOfParentPosition - Index of parent NodePositionInfo in positions array. TODO: use offsets to avoid copying at top level?\n\t * @param shape - Shape of the top level sequence this node is part of\n\t * @param valueOffset - TODO\n\t */\n\tpublic constructor(\n\t\tpublic readonly parent: NodePositionInfo | undefined, // TODO; general UpPath to allow prefixing here?\n\t\tpublic readonly parentField: FieldKey,\n\t\tpublic readonly parentIndex: number,\n\t\tpublic readonly indexOfParentField: number | undefined,\n\t\tpublic readonly indexOfParentPosition: number | undefined,\n\t\tpublic readonly shape: TreeShape, // Shape of sequence that contains this node (top level is parent of this node)\n\t\tpublic readonly topLevelLength: number,\n\t\tpublic readonly valueOffset: number,\n\t) {}\n}\n\n/**\n * The cursor implementation for `UniformChunk`.\n *\n * Works by tracking its location in the chunk's `positions` array.\n */\nclass Cursor extends SynchronousCursor implements ChunkedCursor {\n\tprivate positionIndex!: number; // When in fields mode, this points to the parent node.\n\t// Undefined when in root field\n\tprivate nodePositionInfo: NodePositionInfo | undefined;\n\n\t// Cached constants for faster access\n\tprivate readonly shape: ChunkShape;\n\tprivate readonly positions: readonly (NodePositionInfo | undefined)[];\n\n\tpublic mode: CursorLocationType = CursorLocationType.Fields;\n\n\t// Undefined when not in fields mode.\n\tprivate fieldKey?: FieldKey;\n\n\t// Valid only in fields mode. Can be past end for empty fields.\n\t// This is redundant with fieldKey above (but might be worth keeping for perf), and could be removed.\n\tprivate indexOfField: number = 0;\n\n\t// TODO: support prefix (path above root, including index offset of chunk in its containing field)\n\tpublic constructor(private readonly chunk: UniformChunk) {\n\t\tsuper();\n\t\tthis.shape = this.chunk.shape;\n\t\tthis.positions = this.shape.positions;\n\t\tthis.fieldKey = dummyRoot;\n\t\tthis.moveToPosition(0);\n\t}\n\n\tpublic get [cursorChunk](): UniformChunk | undefined {\n\t\treturn this.atChunkRoot() ? this.chunk : undefined;\n\t}\n\n\tpublic atChunkRoot(): boolean {\n\t\tassert(\n\t\t\t(this.fieldKey === undefined) === (this.mode === CursorLocationType.Nodes),\n\t\t\t0x560 /* expect valid field key */,\n\t\t);\n\t\treturn (\n\t\t\tthis.nodePositionInfo === undefined ||\n\t\t\t(this.nodePositionInfo.parent === undefined && this.fieldKey === undefined)\n\t\t);\n\t}\n\n\tpublic fork(): Cursor {\n\t\tconst cursor = new Cursor(this.chunk);\n\t\tcursor.mode = this.mode;\n\t\tcursor.fieldKey = this.fieldKey;\n\t\tcursor.indexOfField = this.indexOfField;\n\t\tcursor.moveToPosition(this.positionIndex);\n\t\treturn cursor;\n\t}\n\n\t/**\n\t * Change the current node within the chunk.\n\t * See `nodeInfo` for getting data about the current node.\n\t *\n\t * @param positionIndex - index of the position of the newly selected node in `positions`.\n\t * This is NOT an index within a field, and is not bounds checked.\n\t */\n\tprivate moveToPosition(positionIndex: number): void {\n\t\tthis.nodePositionInfo = this.positions[positionIndex];\n\t\tthis.positionIndex = positionIndex;\n\t\tif (this.nodePositionInfo === undefined) {\n\t\t\tassert(positionIndex === 0, 0x561 /* expected root at start */);\n\t\t\tassert(this.mode === CursorLocationType.Fields, 0x562 /* expected root to be a field */);\n\t\t}\n\t}\n\n\t/**\n\t * Gets information about the current node.\n\t *\n\t * When in Nodes mode, this means the node this cursor is current at.\n\t * When if fields mode, this means the node which is the parent of the current field.\n\t * This cursor is in Nodes mode at the root, so there is no case where a fields mode does not have a parent.\n\t *\n\t * @param requiredMode - asserts that the mode matches this. Since the semantics of this function are somewhat mode dependent,\n\t * providing this ensures that the caller knows what the results will mean.\n\t */\n\tprivate nodeInfo(requiredMode: CursorLocationType): NodePositionInfo {\n\t\tassert(this.mode === requiredMode, 0x4c8 /* tried to access cursor when in wrong mode */);\n\t\tassert(\n\t\t\tthis.nodePositionInfo !== undefined,\n\t\t\t0x53e /* can not access nodeInfo in root field */,\n\t\t);\n\t\treturn this.nodePositionInfo;\n\t}\n\n\tpublic nextField(): boolean {\n\t\tthis.indexOfField++;\n\t\tconst fields = this.nodeInfo(CursorLocationType.Fields).shape.fieldsArray;\n\t\tif (this.indexOfField < fields.length) {\n\t\t\tconst fieldArr = fields[this.indexOfField] ?? oob();\n\t\t\tthis.fieldKey = fieldArr[0];\n\t\t\treturn true;\n\t\t}\n\t\tthis.exitField();\n\t\treturn false;\n\t}\n\n\tpublic exitField(): void {\n\t\tassert(this.mode === CursorLocationType.Fields, 0x4c9 /* exitField when in wrong mode */);\n\t\tassert(this.nodePositionInfo !== undefined, 0x563 /* can not exit root field */);\n\t\tthis.fieldKey = undefined;\n\t\tthis.mode = CursorLocationType.Nodes;\n\t}\n\n\tpublic getFieldKey(): FieldKey {\n\t\treturn this.fieldKey ?? fail(0xb09 /* not in a field */);\n\t}\n\n\tpublic getFieldLength(): number {\n\t\tassert(\n\t\t\tthis.mode === CursorLocationType.Fields,\n\t\t\t0x53f /* tried to access cursor when in wrong mode */,\n\t\t);\n\t\tif (this.nodePositionInfo === undefined) {\n\t\t\treturn this.shape.topLevelLength;\n\t\t}\n\t\tconst fieldInfo = this.nodePositionInfo.shape.fieldsArray[this.indexOfField];\n\t\tif (fieldInfo === undefined) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn fieldInfo[2];\n\t}\n\n\tpublic firstNode(): boolean {\n\t\tassert(\n\t\t\tthis.mode === CursorLocationType.Fields,\n\t\t\t0x540 /* tried to access cursor when in wrong mode */,\n\t\t);\n\n\t\tif (this.nodePositionInfo === undefined) {\n\t\t\t// Root field is not allowed to be empty, so we can skip handling that case.\n\t\t\tthis.enterRootNodeInner(0);\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn this.enterNodeInner(this.nodePositionInfo, 0);\n\t\t}\n\t}\n\n\tpublic enterNode(childIndex: number): void {\n\t\tassert(\n\t\t\tthis.mode === CursorLocationType.Fields,\n\t\t\t0x541 /* tried to access cursor when in wrong mode */,\n\t\t);\n\t\tassert(childIndex >= 0, 0x4ca /* index must be positive */);\n\t\tif (this.nodePositionInfo === undefined) {\n\t\t\tassert(\n\t\t\t\tchildIndex < this.shape.topLevelLength,\n\t\t\t\t0x542 /* index must not be past the end of the field */,\n\t\t\t);\n\t\t\tthis.enterRootNodeInner(childIndex);\n\t\t} else {\n\t\t\tconst moved = this.enterNodeInner(this.nodePositionInfo, childIndex);\n\t\t\tassert(moved, 0x4cb /* index must not be past the end of the field */);\n\t\t}\n\t}\n\n\t/**\n\t * Enter the current field, at `childIndex`.\n\t * @param childIndex - index into current field to navigate to. Must be non-negative integer.\n\t */\n\tprivate enterNodeInner(currentPosition: NodePositionInfo, childIndex: number): boolean {\n\t\tconst shape = currentPosition.shape;\n\t\tconst fields = shape.fieldsOffsetArray;\n\t\tif (this.indexOfField >= fields.length) {\n\t\t\treturn false; // Handle empty field (indexed by key into empty field)\n\t\t}\n\t\tconst f = shape.fieldsOffsetArray[this.indexOfField] ?? oob();\n\t\tif (childIndex >= f.topLevelLength) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.mode = CursorLocationType.Nodes;\n\t\tthis.fieldKey = undefined;\n\t\tthis.moveToPosition(this.positionIndex + f.offset + childIndex * f.shape.positions.length);\n\t\tassert(this.fieldIndex === childIndex, 0x4cc /* should be at selected child */);\n\t\treturn true;\n\t}\n\n\tprivate enterRootNodeInner(childIndex: number): void {\n\t\tthis.mode = CursorLocationType.Nodes;\n\t\tthis.fieldKey = undefined;\n\t\t// 1 for the \"undefined\" at the beginning of the positions array, then stride by top level tree shape.\n\t\tthis.moveToPosition(1 + childIndex * this.shape.treeShape.positions.length);\n\t\tassert(this.fieldIndex === childIndex, 0x543 /* should be at selected child */);\n\t}\n\n\tpublic getFieldPath(prefix?: PathRootPrefix): FieldUpPath {\n\t\treturn prefixFieldPath(prefix, {\n\t\t\tfield: this.getFieldKey(),\n\t\t\tparent: this.nodePositionInfo,\n\t\t});\n\t}\n\n\tpublic getPath(prefix?: PathRootPrefix): UpPath | undefined {\n\t\treturn prefixPath(prefix, this.nodeInfo(CursorLocationType.Nodes));\n\t}\n\n\tpublic get fieldIndex(): number {\n\t\treturn this.nodeInfo(CursorLocationType.Nodes).parentIndex;\n\t}\n\n\tpublic readonly chunkStart: number = 0;\n\n\tpublic get chunkLength(): number {\n\t\treturn this.nodeInfo(CursorLocationType.Nodes).topLevelLength;\n\t}\n\n\tpublic seekNodes(offset: number): boolean {\n\t\tconst info = this.nodeInfo(CursorLocationType.Nodes);\n\t\tconst index = offset + info.parentIndex;\n\t\tif (index >= 0 && index < info.topLevelLength) {\n\t\t\tthis.moveToPosition(this.positionIndex + offset * info.shape.positions.length);\n\t\t\treturn true;\n\t\t}\n\t\tthis.exitNode();\n\t\treturn false;\n\t}\n\n\tpublic nextNode(): boolean {\n\t\t// This is the same as `return this.seekNodes(1);` but slightly faster.\n\n\t\tconst info = this.nodeInfo(CursorLocationType.Nodes);\n\t\tconst index = info.parentIndex + 1;\n\t\tif (index === info.topLevelLength) {\n\t\t\tthis.exitNode();\n\t\t\treturn false;\n\t\t}\n\t\tthis.moveToPosition(this.positionIndex + info.shape.positions.length);\n\t\treturn true;\n\t}\n\n\tpublic exitNode(): void {\n\t\tconst info = this.nodeInfo(CursorLocationType.Nodes);\n\t\tthis.indexOfField =\n\t\t\tinfo.indexOfParentField ??\n\t\t\tfail(0xb0a /* navigation up to root field not yet supported */); // TODO;\n\t\tthis.fieldKey = info.parentField;\n\t\tthis.mode = CursorLocationType.Fields;\n\t\tthis.moveToPosition(\n\t\t\tinfo.indexOfParentPosition ??\n\t\t\t\tfail(0xb0b /* navigation up to root field not yet supported */),\n\t\t); // TODO\n\t}\n\n\tpublic firstField(): boolean {\n\t\tconst fieldsArray = this.nodeInfo(CursorLocationType.Nodes).shape.fieldsArray;\n\t\tif (!hasSome(fieldsArray)) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.indexOfField = 0;\n\t\tthis.mode = CursorLocationType.Fields;\n\t\tconst fields = fieldsArray[0];\n\t\tthis.fieldKey = fields[0];\n\t\treturn true;\n\t}\n\n\tpublic enterField(key: FieldKey): void {\n\t\tconst fieldMap = this.nodeInfo(CursorLocationType.Nodes).shape.fields;\n\t\tconst fieldInfo = fieldMap.get(key);\n\t\tthis.indexOfField =\n\t\t\tfieldInfo === undefined\n\t\t\t\t? fieldMap.size\n\t\t\t\t: (fieldInfo.indexOfParentField ?? fail(0xb0c /* children should have parents */));\n\t\tthis.fieldKey = key;\n\t\tthis.mode = CursorLocationType.Fields;\n\t}\n\n\tpublic get type(): TreeNodeSchemaIdentifier {\n\t\treturn this.nodeInfo(CursorLocationType.Nodes).shape.type;\n\t}\n\n\tpublic get value(): Value {\n\t\tconst idCompressor = this.chunk.idCompressor;\n\t\tconst info = this.nodeInfo(CursorLocationType.Nodes);\n\t\t// If the maybeDecompressedStringAsNumber flag is set to true, we check if the value is a number.\n\t\t// This flag can only ever be set on string leaf nodes, so if the value is a number, we can assume it is a compressible, known stable id.\n\t\tif (info.shape.hasValue && info.shape.maybeDecompressedStringAsNumber) {\n\t\t\tconst value = this.chunk.values[info.valueOffset];\n\t\t\tif (typeof value === \"number\" && idCompressor !== undefined) {\n\t\t\t\treturn idCompressor.decompress(value as SessionSpaceCompressedId);\n\t\t\t}\n\t\t}\n\t\treturn info.shape.hasValue ? this.chunk.values[info.valueOffset] : undefined;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"uniformChunk.js","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/uniformCh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C;QACpC,IAAI,CAAC,YAAY;YAChB,SAAS,KAAK,SAAS;gBACtB,CAAC,CAAC,QAAQ,CAAC,IAAI;gBACf,CAAC,CAAC,CAAC,SAAS,CAAC,kBAAkB,IAAI,IAAA,eAAI,EAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC,CAAC;QACrF,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,IAAI,oCAA4B,CAAC;IACvC,CAAC;IAED,IAAW,IAAI;QACd,OAAO,IAAI,CAAC,QAAQ,kCAA0B,CAAC,KAAK,CAAC,IAAI,CAAC;IAC3D,CAAC;IAED,IAAW,KAAK;QACf,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;QAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,kCAA0B,CAAC;QACrD,iGAAiG;QACjG,yIAAyI;QACzI,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,+BAA+B,EAAE,CAAC;YACvE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAClD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;gBAC7D,OAAO,YAAY,CAAC,UAAU,CAAC,KAAiC,CAAC,CAAC;YACnE,CAAC;QACF,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9E,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, compareArrays, oob, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tCursorLocationType,\n\ttype FieldKey,\n\ttype FieldUpPath,\n\ttype PathRootPrefix,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeValue,\n\ttype UpPath,\n\ttype Value,\n\ttype ChunkedCursor,\n\ttype TreeChunk,\n\tcursorChunk,\n\tdummyRoot,\n} from \"../../core/index.js\";\nimport { ReferenceCountedBase, hasSome } from \"../../util/index.js\";\nimport { SynchronousCursor, prefixFieldPath, prefixPath } from \"../treeCursorUtils.js\";\n\nimport type { SessionSpaceCompressedId, IIdCompressor } from \"@fluidframework/id-compressor\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * Create a tree chunk with ref count 1.\n *\n * @param shape - describes the semantics and layout of `values`.\n * @param values - provides exclusive ownership of this array to this object (which might mutate it in the future).\n */\nexport function uniformChunk(shape: ChunkShape, values: TreeValue[]): TreeChunk {\n\treturn new UniformChunk(shape, values);\n}\n\n/**\n * Chunk which handles a sequence of trees with identical \"shape\" (see `TreeShape`).\n *\n * Separates shape from content,\n * allowing deduplication of shape information and storing of content as a flat sequence of values.\n */\nexport class UniformChunk extends ReferenceCountedBase implements TreeChunk {\n\tpublic idCompressor: undefined | IIdCompressor;\n\t/**\n\t * Create a tree chunk with ref count 1.\n\t *\n\t * @param shape - describes the semantics and layout of `values`.\n\t * @param values - provides exclusive ownership of this array to this object (which might mutate it in the future).\n\t */\n\tpublic constructor(\n\t\tpublic shape: ChunkShape,\n\t\tpublic values: TreeValue[],\n\t\tidCompressor?: IIdCompressor,\n\t) {\n\t\tsuper();\n\t\tthis.idCompressor = idCompressor;\n\t\tassert(\n\t\t\tshape.treeShape.valuesPerTopLevelNode * shape.topLevelLength === values.length,\n\t\t\t0x4c3 /* invalid number of values for shape */,\n\t\t);\n\t}\n\n\tpublic get topLevelLength(): number {\n\t\treturn this.shape.topLevelLength;\n\t}\n\n\tpublic clone(): UniformChunk {\n\t\treturn new UniformChunk(this.shape, this.values.slice());\n\t}\n\n\tpublic cursor(): Cursor {\n\t\treturn new Cursor(this);\n\t}\n\n\tprotected onUnreferenced(): void {}\n}\n\n/**\n * The \"shape\" of a field.\n *\n * Requires that all trees in the field have the same shape, which is described by `TreeShape`.\n * Note that this requirement means that not all fields can be described using this type.\n */\nexport type FieldShape = readonly [FieldKey, TreeShape, number];\n\n/**\n * The \"shape\" of a tree.\n * Does not contain the actual values from the tree, but describes everything else,\n * including where the values would be found in a flat values array.\n *\n * Note that since this requires fields to have uniform shapes (see `FieldShape`),\n * not all trees can have their shape described using this type.\n */\nexport class TreeShape {\n\tpublic readonly fields: ReadonlyMap<FieldKey, OffsetShape>;\n\tpublic readonly fieldsOffsetArray: readonly OffsetShape[];\n\tpublic readonly valuesPerTopLevelNode: number;\n\n\t// TODO: this is only needed at chunk roots. Optimize it base on that.\n\tpublic readonly positions: readonly NodePositionInfo[];\n\n\t/**\n\t *\n\t * @param type - {@link TreeNodeSchemaIdentifier} used to compare shapes.\n\t * @param hasValue - whether or not the TreeShape has a value.\n\t * @param fieldsArray - an array of {@link FieldShape} values, which contains a TreeShape for each FieldKey.\n\t *\n\t * @param maybeDecompressedStringAsNumber - used to check whether or not the value could have been compressed by the idCompressor.\n\t * This flag can only be set on string leaf nodes, and will throw a usage error otherwise.\n\t * If set to true, an additional check can be made (example: getting the value of {@link Cursor}) to return the original uncompressed value.\n\t */\n\tpublic constructor(\n\t\tpublic readonly type: TreeNodeSchemaIdentifier,\n\t\tpublic readonly hasValue: boolean,\n\t\tpublic readonly fieldsArray: readonly FieldShape[],\n\t\tpublic readonly maybeDecompressedStringAsNumber: boolean = false,\n\t) {\n\t\tif (\n\t\t\tmaybeDecompressedStringAsNumber &&\n\t\t\t!(hasValue && type === \"com.fluidframework.leaf.string\")\n\t\t) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"maybeDecompressedStringAsNumber flag can only be set to true for string leaf node.\",\n\t\t\t);\n\t\t}\n\t\tconst fields: Map<FieldKey, OffsetShape> = new Map();\n\t\tlet numberOfValues = hasValue ? 1 : 0;\n\t\tconst infos: NodePositionInfo[] = [\n\t\t\tnew NodePositionInfo(undefined, dummyRoot, 0, undefined, undefined, this, 1, 0),\n\t\t];\n\t\tlet fieldIndex = 0;\n\t\tfor (const [k, f, length] of fieldsArray) {\n\t\t\tassert(!fields.has(k), 0x4c5 /* no duplicate keys */);\n\t\t\tconst offset = new OffsetShape(f, length, infos.length, k, fieldIndex);\n\t\t\tfields.set(k, offset);\n\t\t\tclonePositions(0, [k, f, length], fieldIndex, numberOfValues, infos);\n\t\t\tnumberOfValues += f.valuesPerTopLevelNode * length;\n\t\t\tfieldIndex++;\n\t\t}\n\t\tthis.fields = fields;\n\t\tthis.valuesPerTopLevelNode = numberOfValues;\n\t\tthis.positions = infos;\n\n\t\tthis.fieldsOffsetArray = [...fields.values()];\n\t}\n\n\tpublic equals(other: TreeShape): boolean {\n\t\t// TODO: either dedup instances and/or store a collision resistant hash for fast compare.\n\n\t\tif (\n\t\t\t!compareArrays(\n\t\t\t\tthis.fieldsArray,\n\t\t\t\tother.fieldsArray,\n\t\t\t\t([k, f, l], [k2, f2, l2]) => k === k2 && l === l2 && f.equals(f2),\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t\treturn this.type === other.type && this.hasValue === other.hasValue;\n\t}\n\n\tpublic withTopLevelLength(topLevelLength: number): ChunkShape {\n\t\treturn new ChunkShape(this, topLevelLength);\n\t}\n}\n\nfunction clonePositions(\n\tindexOfParentInOutput: number | undefined,\n\t[key, shape, copies]: FieldShape,\n\tindexOfParentField: number,\n\tvalueOffset: number,\n\toutputInto: NodePositionInfo[] | (NodePositionInfo | undefined)[],\n): void {\n\tconst offset = outputInto.length;\n\tfor (let index = 0; index < copies; index++) {\n\t\tfor (const inner of shape.positions) {\n\t\t\tconst wasRoot = inner.indexOfParentPosition === undefined;\n\t\t\tconst parentPositionIndex = wasRoot\n\t\t\t\t? indexOfParentInOutput\n\t\t\t\t: inner.indexOfParentPosition + index * shape.positions.length + offset;\n\t\t\toutputInto.push(\n\t\t\t\tnew NodePositionInfo(\n\t\t\t\t\tparentPositionIndex === undefined ? undefined : outputInto[parentPositionIndex],\n\t\t\t\t\tinner.parentField === dummyRoot ? key : inner.parentField,\n\t\t\t\t\twasRoot ? index : inner.parentIndex,\n\t\t\t\t\tinner.indexOfParentField ?? indexOfParentField,\n\t\t\t\t\tparentPositionIndex,\n\t\t\t\t\tinner.shape,\n\t\t\t\t\twasRoot ? copies : inner.topLevelLength,\n\t\t\t\t\tinner.valueOffset + valueOffset + shape.valuesPerTopLevelNode * index,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t}\n}\n\n/**\n * The shape (see `TreeShape`) of a sequence of trees, all with the same shape (like `FieldShape`, but without a field key).\n *\n * This shape is optimized (by caching derived data like the positions array),\n * so that when paired with a value array it can be efficiently traversed like a tree by an {@link ITreeCursorSynchronous}.\n * See {@link uniformChunk} for how to do this.\n *\n * TODO: consider storing shape information in WASM\n */\nexport class ChunkShape {\n\tpublic readonly positions: readonly (NodePositionInfo | undefined)[];\n\n\tpublic constructor(\n\t\tpublic readonly treeShape: TreeShape,\n\t\tpublic readonly topLevelLength: number,\n\t) {\n\t\tassert(topLevelLength > 0, 0x4c6 /* topLevelLength must be greater than 0 */);\n\n\t\t// TODO: avoid duplication from inner loop\n\t\tconst positions: (NodePositionInfo | undefined)[] = [undefined];\n\t\tclonePositions(0, [dummyRoot, treeShape, topLevelLength], 0, 0, positions);\n\t\tthis.positions = positions;\n\t}\n\n\tpublic equals(other: ChunkShape): boolean {\n\t\t// TODO: either dedup instances and/or store a collision resistant hash for fast compare.\n\t\treturn this.topLevelLength === other.topLevelLength && this.treeShape === other.treeShape;\n\t}\n}\n\n/**\n * Shape of a field (like `FieldShape`) but with information about how it would be offset within a chunk because of its parents.\n */\nclass OffsetShape {\n\t/**\n\t * @param shape - the shape of each child in this field\n\t * @param topLevelLength - number of top level nodes in this sequence chunk (either field within a chunk, or top level chunk)\n\t * @param offset - number of nodes before this in the parent's subtree. The nodes are considered in depth first pre order\n\t * traversal, so a parent is the first node in its subtree (before its children) with offset 0\n\t * @param key - field key\n\t * @param indexOfParentField - index to this shape in the parent's array of fields\n\t */\n\tpublic constructor(\n\t\tpublic readonly shape: TreeShape,\n\t\tpublic readonly topLevelLength: number,\n\t\tpublic readonly offset: number,\n\t\tpublic readonly key: FieldKey,\n\t\tpublic readonly indexOfParentField: number | undefined,\n\t) {}\n}\n\n/**\n * Information about a node at a specific position within a uniform chunk.\n */\nclass NodePositionInfo implements UpPath {\n\t/**\n\t * @param parent - TODO\n\t * @param parentField - TODO\n\t * @param parentIndex - indexWithinParentField\n\t * @param indexOfParentField - which field of the parent `parentIndex` is indexing into to locate this.\n\t * @param indexOfParentPosition - Index of parent NodePositionInfo in positions array. TODO: use offsets to avoid copying at top level?\n\t * @param shape - Shape of the top level sequence this node is part of\n\t * @param valueOffset - TODO\n\t */\n\tpublic constructor(\n\t\tpublic readonly parent: NodePositionInfo | undefined, // TODO; general UpPath to allow prefixing here?\n\t\tpublic readonly parentField: FieldKey,\n\t\tpublic readonly parentIndex: number,\n\t\tpublic readonly indexOfParentField: number | undefined,\n\t\tpublic readonly indexOfParentPosition: number | undefined,\n\t\tpublic readonly shape: TreeShape, // Shape of sequence that contains this node (top level is parent of this node)\n\t\tpublic readonly topLevelLength: number,\n\t\tpublic readonly valueOffset: number,\n\t) {}\n}\n\n/**\n * The cursor implementation for `UniformChunk`.\n *\n * Works by tracking its location in the chunk's `positions` array.\n */\nclass Cursor extends SynchronousCursor implements ChunkedCursor {\n\tprivate positionIndex!: number; // When in fields mode, this points to the parent node.\n\t// Undefined when in root field\n\tprivate nodePositionInfo: NodePositionInfo | undefined;\n\n\t// Cached constants for faster access\n\tprivate readonly shape: ChunkShape;\n\tprivate readonly positions: readonly (NodePositionInfo | undefined)[];\n\n\tpublic mode: CursorLocationType = CursorLocationType.Fields;\n\n\t// Undefined when not in fields mode.\n\tprivate fieldKey?: FieldKey;\n\n\t// Valid only in fields mode. Can be past end for empty fields.\n\t// This is redundant with fieldKey above (but might be worth keeping for perf), and could be removed.\n\tprivate indexOfField: number = 0;\n\n\t// TODO: support prefix (path above root, including index offset of chunk in its containing field)\n\tpublic constructor(private readonly chunk: UniformChunk) {\n\t\tsuper();\n\t\tthis.shape = this.chunk.shape;\n\t\tthis.positions = this.shape.positions;\n\t\tthis.fieldKey = dummyRoot;\n\t\tthis.moveToPosition(0);\n\t}\n\n\tpublic get [cursorChunk](): UniformChunk | undefined {\n\t\treturn this.atChunkRoot() ? this.chunk : undefined;\n\t}\n\n\tpublic atChunkRoot(): boolean {\n\t\tassert(\n\t\t\t(this.fieldKey === undefined) === (this.mode === CursorLocationType.Nodes),\n\t\t\t0x560 /* expect valid field key */,\n\t\t);\n\t\treturn (\n\t\t\tthis.nodePositionInfo === undefined ||\n\t\t\t(this.nodePositionInfo.parent === undefined && this.fieldKey === undefined)\n\t\t);\n\t}\n\n\tpublic fork(): Cursor {\n\t\tconst cursor = new Cursor(this.chunk);\n\t\tcursor.mode = this.mode;\n\t\tcursor.fieldKey = this.fieldKey;\n\t\tcursor.indexOfField = this.indexOfField;\n\t\tcursor.moveToPosition(this.positionIndex);\n\t\treturn cursor;\n\t}\n\n\t/**\n\t * Change the current node within the chunk.\n\t * See `nodeInfo` for getting data about the current node.\n\t *\n\t * @param positionIndex - index of the position of the newly selected node in `positions`.\n\t * This is NOT an index within a field, and is not bounds checked.\n\t */\n\tprivate moveToPosition(positionIndex: number): void {\n\t\tthis.nodePositionInfo = this.positions[positionIndex];\n\t\tthis.positionIndex = positionIndex;\n\t\tif (this.nodePositionInfo === undefined) {\n\t\t\tassert(positionIndex === 0, 0x561 /* expected root at start */);\n\t\t\tassert(this.mode === CursorLocationType.Fields, 0x562 /* expected root to be a field */);\n\t\t}\n\t}\n\n\t/**\n\t * Gets information about the current node.\n\t *\n\t * When in Nodes mode, this means the node this cursor is current at.\n\t * When if fields mode, this means the node which is the parent of the current field.\n\t * This cursor is in Nodes mode at the root, so there is no case where a fields mode does not have a parent.\n\t *\n\t * @param requiredMode - asserts that the mode matches this. Since the semantics of this function are somewhat mode dependent,\n\t * providing this ensures that the caller knows what the results will mean.\n\t */\n\tprivate nodeInfo(requiredMode: CursorLocationType): NodePositionInfo {\n\t\tassert(this.mode === requiredMode, 0x4c8 /* tried to access cursor when in wrong mode */);\n\t\tassert(\n\t\t\tthis.nodePositionInfo !== undefined,\n\t\t\t0x53e /* can not access nodeInfo in root field */,\n\t\t);\n\t\treturn this.nodePositionInfo;\n\t}\n\n\tpublic nextField(): boolean {\n\t\tthis.indexOfField++;\n\t\tconst fields = this.nodeInfo(CursorLocationType.Fields).shape.fieldsArray;\n\t\tif (this.indexOfField < fields.length) {\n\t\t\tconst fieldArr = fields[this.indexOfField] ?? oob();\n\t\t\tthis.fieldKey = fieldArr[0];\n\t\t\treturn true;\n\t\t}\n\t\tthis.exitField();\n\t\treturn false;\n\t}\n\n\tpublic exitField(): void {\n\t\tassert(this.mode === CursorLocationType.Fields, 0x4c9 /* exitField when in wrong mode */);\n\t\tassert(this.nodePositionInfo !== undefined, 0x563 /* can not exit root field */);\n\t\tthis.fieldKey = undefined;\n\t\tthis.mode = CursorLocationType.Nodes;\n\t}\n\n\tpublic getFieldKey(): FieldKey {\n\t\treturn this.fieldKey ?? fail(0xb09 /* not in a field */);\n\t}\n\n\tpublic getFieldLength(): number {\n\t\tassert(\n\t\t\tthis.mode === CursorLocationType.Fields,\n\t\t\t0x53f /* tried to access cursor when in wrong mode */,\n\t\t);\n\t\tif (this.nodePositionInfo === undefined) {\n\t\t\treturn this.shape.topLevelLength;\n\t\t}\n\t\tconst fieldInfo = this.nodePositionInfo.shape.fieldsArray[this.indexOfField];\n\t\tif (fieldInfo === undefined) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn fieldInfo[2];\n\t}\n\n\tpublic firstNode(): boolean {\n\t\tassert(\n\t\t\tthis.mode === CursorLocationType.Fields,\n\t\t\t0x540 /* tried to access cursor when in wrong mode */,\n\t\t);\n\n\t\tif (this.nodePositionInfo === undefined) {\n\t\t\t// Root field is not allowed to be empty, so we can skip handling that case.\n\t\t\tthis.enterRootNodeInner(0);\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn this.enterNodeInner(this.nodePositionInfo, 0);\n\t\t}\n\t}\n\n\tpublic enterNode(childIndex: number): void {\n\t\tassert(\n\t\t\tthis.mode === CursorLocationType.Fields,\n\t\t\t0x541 /* tried to access cursor when in wrong mode */,\n\t\t);\n\t\tassert(childIndex >= 0, 0x4ca /* index must be positive */);\n\t\tif (this.nodePositionInfo === undefined) {\n\t\t\tassert(\n\t\t\t\tchildIndex < this.shape.topLevelLength,\n\t\t\t\t0x542 /* index must not be past the end of the field */,\n\t\t\t);\n\t\t\tthis.enterRootNodeInner(childIndex);\n\t\t} else {\n\t\t\tconst moved = this.enterNodeInner(this.nodePositionInfo, childIndex);\n\t\t\tassert(moved, 0x4cb /* index must not be past the end of the field */);\n\t\t}\n\t}\n\n\t/**\n\t * Enter the current field, at `childIndex`.\n\t * @param childIndex - index into current field to navigate to. Must be non-negative integer.\n\t */\n\tprivate enterNodeInner(currentPosition: NodePositionInfo, childIndex: number): boolean {\n\t\tconst shape = currentPosition.shape;\n\t\tconst fields = shape.fieldsOffsetArray;\n\t\tif (this.indexOfField >= fields.length) {\n\t\t\treturn false; // Handle empty field (indexed by key into empty field)\n\t\t}\n\t\tconst f = shape.fieldsOffsetArray[this.indexOfField] ?? oob();\n\t\tif (childIndex >= f.topLevelLength) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.mode = CursorLocationType.Nodes;\n\t\tthis.fieldKey = undefined;\n\t\tthis.moveToPosition(this.positionIndex + f.offset + childIndex * f.shape.positions.length);\n\t\tassert(this.fieldIndex === childIndex, 0x4cc /* should be at selected child */);\n\t\treturn true;\n\t}\n\n\tprivate enterRootNodeInner(childIndex: number): void {\n\t\tthis.mode = CursorLocationType.Nodes;\n\t\tthis.fieldKey = undefined;\n\t\t// 1 for the \"undefined\" at the beginning of the positions array, then stride by top level tree shape.\n\t\tthis.moveToPosition(1 + childIndex * this.shape.treeShape.positions.length);\n\t\tassert(this.fieldIndex === childIndex, 0x543 /* should be at selected child */);\n\t}\n\n\tpublic getFieldPath(prefix?: PathRootPrefix): FieldUpPath {\n\t\treturn prefixFieldPath(prefix, {\n\t\t\tfield: this.getFieldKey(),\n\t\t\tparent: this.nodePositionInfo,\n\t\t});\n\t}\n\n\tpublic getPath(prefix?: PathRootPrefix): UpPath | undefined {\n\t\treturn prefixPath(prefix, this.nodeInfo(CursorLocationType.Nodes));\n\t}\n\n\tpublic get fieldIndex(): number {\n\t\treturn this.nodeInfo(CursorLocationType.Nodes).parentIndex;\n\t}\n\n\tpublic readonly chunkStart: number = 0;\n\n\tpublic get chunkLength(): number {\n\t\treturn this.nodeInfo(CursorLocationType.Nodes).topLevelLength;\n\t}\n\n\tpublic seekNodes(offset: number): boolean {\n\t\tconst info = this.nodeInfo(CursorLocationType.Nodes);\n\t\tconst index = offset + info.parentIndex;\n\t\tif (index >= 0 && index < info.topLevelLength) {\n\t\t\tthis.moveToPosition(this.positionIndex + offset * info.shape.positions.length);\n\t\t\treturn true;\n\t\t}\n\t\tthis.exitNode();\n\t\treturn false;\n\t}\n\n\tpublic nextNode(): boolean {\n\t\t// This is the same as `return this.seekNodes(1);` but slightly faster.\n\n\t\tconst info = this.nodeInfo(CursorLocationType.Nodes);\n\t\tconst index = info.parentIndex + 1;\n\t\tif (index === info.topLevelLength) {\n\t\t\tthis.exitNode();\n\t\t\treturn false;\n\t\t}\n\t\tthis.moveToPosition(this.positionIndex + info.shape.positions.length);\n\t\treturn true;\n\t}\n\n\tpublic exitNode(): void {\n\t\tconst info = this.nodeInfo(CursorLocationType.Nodes);\n\t\tthis.indexOfField =\n\t\t\tinfo.indexOfParentField ??\n\t\t\tfail(0xb0a /* navigation up to root field not yet supported */); // TODO;\n\t\tthis.fieldKey = info.parentField;\n\t\tthis.mode = CursorLocationType.Fields;\n\t\tthis.moveToPosition(\n\t\t\tinfo.indexOfParentPosition ??\n\t\t\t\tfail(0xb0b /* navigation up to root field not yet supported */),\n\t\t); // TODO\n\t}\n\n\tpublic firstField(): boolean {\n\t\tconst fieldsArray = this.nodeInfo(CursorLocationType.Nodes).shape.fieldsArray;\n\t\tif (!hasSome(fieldsArray)) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.indexOfField = 0;\n\t\tthis.mode = CursorLocationType.Fields;\n\t\tconst fields = fieldsArray[0];\n\t\tthis.fieldKey = fields[0];\n\t\treturn true;\n\t}\n\n\tpublic enterField(key: FieldKey): void {\n\t\tconst fieldMap = this.nodeInfo(CursorLocationType.Nodes).shape.fields;\n\t\tconst fieldInfo = fieldMap.get(key);\n\t\tthis.indexOfField =\n\t\t\tfieldInfo === undefined\n\t\t\t\t? fieldMap.size\n\t\t\t\t: (fieldInfo.indexOfParentField ?? fail(0xb0c /* children should have parents */));\n\t\tthis.fieldKey = key;\n\t\tthis.mode = CursorLocationType.Fields;\n\t}\n\n\tpublic get type(): TreeNodeSchemaIdentifier {\n\t\treturn this.nodeInfo(CursorLocationType.Nodes).shape.type;\n\t}\n\n\tpublic get value(): Value {\n\t\tconst idCompressor = this.chunk.idCompressor;\n\t\tconst info = this.nodeInfo(CursorLocationType.Nodes);\n\t\t// If the maybeDecompressedStringAsNumber flag is set to true, we check if the value is a number.\n\t\t// This flag can only ever be set on string leaf nodes, so if the value is a number, we can assume it is a compressible, known stable id.\n\t\tif (info.shape.hasValue && info.shape.maybeDecompressedStringAsNumber) {\n\t\t\tconst value = this.chunk.values[info.valueOffset];\n\t\t\tif (typeof value === \"number\" && idCompressor !== undefined) {\n\t\t\t\treturn idCompressor.decompress(value as SessionSpaceCompressedId);\n\t\t\t}\n\t\t}\n\t\treturn info.shape.hasValue ? this.chunk.values[info.valueOffset] : undefined;\n\t}\n}\n"]}
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import type { ICodecFamily } from "../../codec/index.js";
|
|
6
|
-
import { type ChangeEncodingContext, type ChangeFamily, type ChangeFamilyEditor, type ChangeRebaser, type DeltaDetachedNodeId, type DeltaRoot, type FieldUpPath, type
|
|
6
|
+
import { type ChangeEncodingContext, type ChangeFamily, type ChangeFamilyEditor, type ChangeRebaser, type DeltaDetachedNodeId, type DeltaRoot, type FieldUpPath, type NormalizedFieldUpPath, type NormalizedUpPath, type RevisionTag, type TaggedChange, type TreeChunk, type UpPath } from "../../core/index.js";
|
|
7
7
|
import { type ModularChangeset } from "../modular-schema/index.js";
|
|
8
|
-
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
9
8
|
export type DefaultChangeset = ModularChangeset;
|
|
10
9
|
/**
|
|
11
10
|
* Implementation of {@link ChangeFamily} based on the default set of supported field kinds.
|
|
@@ -55,21 +54,21 @@ export declare function relevantRemovedRoots(change: ModularChangeset): Iterable
|
|
|
55
54
|
* If/when such a mechanism becomes available, an evaluation should be done to determine if any existing editing operations should be changed to leverage it
|
|
56
55
|
* (Possibly by adding opt ins at the view schema layer).
|
|
57
56
|
*/
|
|
58
|
-
export interface IDefaultEditBuilder {
|
|
57
|
+
export interface IDefaultEditBuilder<TContent = TreeChunk> {
|
|
59
58
|
/**
|
|
60
59
|
* @param field - the value field which is being edited under the parent node
|
|
61
60
|
* @returns An object with methods to edit the given field of the given parent.
|
|
62
61
|
* The returned object can be used (i.e., have its methods called) multiple times but its lifetime
|
|
63
62
|
* is bounded by the lifetime of this edit builder.
|
|
64
63
|
*/
|
|
65
|
-
valueField(field:
|
|
64
|
+
valueField(field: NormalizedFieldUpPath): ValueFieldEditBuilder<TContent>;
|
|
66
65
|
/**
|
|
67
66
|
* @param field - the optional field which is being edited under the parent node
|
|
68
67
|
* @returns An object with methods to edit the given field of the given parent.
|
|
69
68
|
* The returned object can be used (i.e., have its methods called) multiple times but its lifetime
|
|
70
69
|
* is bounded by the lifetime of this edit builder.
|
|
71
70
|
*/
|
|
72
|
-
optionalField(field:
|
|
71
|
+
optionalField(field: NormalizedFieldUpPath): OptionalFieldEditBuilder<TContent>;
|
|
73
72
|
/**
|
|
74
73
|
* @param field - the sequence field which is being edited under the parent node
|
|
75
74
|
*
|
|
@@ -77,24 +76,24 @@ export interface IDefaultEditBuilder {
|
|
|
77
76
|
* The returned object can be used (i.e., have its methods called) multiple times but its lifetime
|
|
78
77
|
* is bounded by the lifetime of this edit builder.
|
|
79
78
|
*/
|
|
80
|
-
sequenceField(field:
|
|
79
|
+
sequenceField(field: NormalizedFieldUpPath): SequenceFieldEditBuilder<TContent>;
|
|
81
80
|
/**
|
|
82
81
|
* Moves a subsequence from one sequence field to another sequence field.
|
|
83
82
|
*
|
|
84
83
|
* Note that the `destinationIndex` is interpreted based on the state of the sequence *before* the move operation.
|
|
85
84
|
* For example, `move(field, 0, 1, field, 2)` changes `[A, B, C]` to `[B, A, C]`.
|
|
86
85
|
*/
|
|
87
|
-
move(sourceField:
|
|
86
|
+
move(sourceField: NormalizedFieldUpPath, sourceIndex: number, count: number, destinationField: NormalizedFieldUpPath, destinationIndex: number): void;
|
|
88
87
|
/**
|
|
89
88
|
* Add a constraint that the node at the given path must exist.
|
|
90
89
|
* @param path - The path to the node that must exist.
|
|
91
90
|
*/
|
|
92
|
-
addNodeExistsConstraint(path:
|
|
91
|
+
addNodeExistsConstraint(path: NormalizedUpPath): void;
|
|
93
92
|
/**
|
|
94
93
|
* Add a constraint that the node at the given path must exist when reverting a change.
|
|
95
94
|
* @param path - The path to the node that must exist when reverting a change.
|
|
96
95
|
*/
|
|
97
|
-
addNodeExistsConstraintOnRevert(path:
|
|
96
|
+
addNodeExistsConstraintOnRevert(path: NormalizedUpPath): void;
|
|
98
97
|
}
|
|
99
98
|
/**
|
|
100
99
|
* Implementation of {@link IDefaultEditBuilder} based on the default set of supported field kinds.
|
|
@@ -102,17 +101,16 @@ export interface IDefaultEditBuilder {
|
|
|
102
101
|
*/
|
|
103
102
|
export declare class DefaultEditBuilder implements ChangeFamilyEditor, IDefaultEditBuilder {
|
|
104
103
|
private readonly mintRevisionTag;
|
|
105
|
-
private readonly idCompressor?;
|
|
106
104
|
private readonly modularBuilder;
|
|
107
|
-
constructor(family: ChangeFamily<ChangeFamilyEditor, DefaultChangeset>, mintRevisionTag: () => RevisionTag, changeReceiver: (change: TaggedChange<DefaultChangeset>) => void
|
|
105
|
+
constructor(family: ChangeFamily<ChangeFamilyEditor, DefaultChangeset>, mintRevisionTag: () => RevisionTag, changeReceiver: (change: TaggedChange<DefaultChangeset>) => void);
|
|
108
106
|
enterTransaction(): void;
|
|
109
107
|
exitTransaction(): void;
|
|
110
108
|
addNodeExistsConstraint(path: UpPath): void;
|
|
111
109
|
addNodeExistsConstraintOnRevert(path: UpPath): void;
|
|
112
|
-
valueField(field: FieldUpPath): ValueFieldEditBuilder<
|
|
113
|
-
optionalField(field: FieldUpPath): OptionalFieldEditBuilder<
|
|
110
|
+
valueField(field: FieldUpPath): ValueFieldEditBuilder<TreeChunk>;
|
|
111
|
+
optionalField(field: FieldUpPath): OptionalFieldEditBuilder<TreeChunk>;
|
|
114
112
|
move(sourceField: FieldUpPath, sourceIndex: number, count: number, destinationField: FieldUpPath, destIndex: number): void;
|
|
115
|
-
sequenceField(field: FieldUpPath): SequenceFieldEditBuilder<
|
|
113
|
+
sequenceField(field: FieldUpPath): SequenceFieldEditBuilder<TreeChunk>;
|
|
116
114
|
}
|
|
117
115
|
/**
|
|
118
116
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultEditBuilder.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultEditBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAEN,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,aAAa,
|
|
1
|
+
{"version":3,"file":"defaultEditBuilder.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/default-sch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AC;IAmCtE,IAAI,CACV,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,WAAW,EAC7B,SAAS,EAAE,MAAM,GACf,IAAI;IAoGA,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,wBAAwB,CAAC,SAAS,CAAC;CAsC7E;AAED;GACG;AACH,MAAM,WAAW,qBAAqB,CAAC,QAAQ;IAC9C;;;;OAIG;IACH,GAAG,CAAC,UAAU,EAAE,QAAQ,GAAG,IAAI,CAAC;CAChC;AAED;GACG;AACH,MAAM,WAAW,wBAAwB,CAAC,QAAQ;IACjD;;;;;OAKG;IACH,GAAG,CAAC,UAAU,EAAE,QAAQ,GAAG,SAAS,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/D;AAED;GACG;AACH,MAAM,WAAW,wBAAwB,CAAC,QAAQ;IACjD;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,GAAG,IAAI,CAAC;IAElD;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3C"}
|
|
@@ -61,9 +61,8 @@ exports.relevantRemovedRoots = relevantRemovedRoots;
|
|
|
61
61
|
* @sealed
|
|
62
62
|
*/
|
|
63
63
|
class DefaultEditBuilder {
|
|
64
|
-
constructor(family, mintRevisionTag, changeReceiver
|
|
64
|
+
constructor(family, mintRevisionTag, changeReceiver) {
|
|
65
65
|
this.mintRevisionTag = mintRevisionTag;
|
|
66
|
-
this.idCompressor = idCompressor;
|
|
67
66
|
this.modularBuilder = new index_js_3.ModularEditBuilder(family, defaultFieldKinds_js_1.fieldKinds, changeReceiver);
|
|
68
67
|
}
|
|
69
68
|
enterTransaction() {
|
|
@@ -84,7 +83,7 @@ class DefaultEditBuilder {
|
|
|
84
83
|
const revision = this.mintRevisionTag();
|
|
85
84
|
const fill = { localId: this.modularBuilder.generateId(), revision };
|
|
86
85
|
const detach = { localId: this.modularBuilder.generateId(), revision };
|
|
87
|
-
const build = this.modularBuilder.buildTrees(fill.localId, newContent, revision
|
|
86
|
+
const build = this.modularBuilder.buildTrees(fill.localId, newContent, revision);
|
|
88
87
|
const change = (0, index_js_2.brand)(defaultFieldKinds_js_1.required.changeHandler.editor.set({
|
|
89
88
|
fill,
|
|
90
89
|
detach,
|
|
@@ -109,7 +108,7 @@ class DefaultEditBuilder {
|
|
|
109
108
|
const detach = { localId: this.modularBuilder.generateId(), revision };
|
|
110
109
|
if (newContent !== undefined) {
|
|
111
110
|
const fill = { localId: this.modularBuilder.generateId(), revision };
|
|
112
|
-
const build = this.modularBuilder.buildTrees(fill.localId, newContent, revision
|
|
111
|
+
const build = this.modularBuilder.buildTrees(fill.localId, newContent, revision);
|
|
113
112
|
edits.push(build);
|
|
114
113
|
optionalChange = defaultFieldKinds_js_1.optional.changeHandler.editor.set(wasEmpty, {
|
|
115
114
|
fill,
|
|
@@ -210,13 +209,13 @@ class DefaultEditBuilder {
|
|
|
210
209
|
sequenceField(field) {
|
|
211
210
|
return {
|
|
212
211
|
insert: (index, content) => {
|
|
213
|
-
const length = content.
|
|
212
|
+
const length = content.topLevelLength;
|
|
214
213
|
if (length === 0) {
|
|
215
214
|
return;
|
|
216
215
|
}
|
|
217
216
|
const revision = this.mintRevisionTag();
|
|
218
217
|
const firstId = { localId: this.modularBuilder.generateId(length), revision };
|
|
219
|
-
const build = this.modularBuilder.buildTrees(firstId.localId, content, revision
|
|
218
|
+
const build = this.modularBuilder.buildTrees(firstId.localId, content, revision);
|
|
220
219
|
const change = (0, index_js_2.brand)(defaultFieldKinds_js_1.sequence.changeHandler.editor.insert(index, length, firstId, revision));
|
|
221
220
|
const attach = {
|
|
222
221
|
type: "field",
|