@fluidframework/tree 2.10.0 → 2.12.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 +29 -0
- package/api-report/tree.alpha.api.md +49 -18
- package/api-report/tree.beta.api.md +6 -15
- package/api-report/tree.legacy.alpha.api.md +6 -15
- package/api-report/tree.legacy.public.api.md +6 -15
- package/api-report/tree.public.api.md +6 -15
- package/dist/alpha.d.ts +9 -0
- package/dist/core/forest/forest.d.ts +10 -2
- package/dist/core/forest/forest.d.ts.map +1 -1
- package/dist/core/forest/forest.js.map +1 -1
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +6 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/utils.d.ts +1 -1
- package/dist/core/rebase/utils.d.ts.map +1 -1
- package/dist/core/rebase/utils.js +13 -17
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/revertible.d.ts +30 -1
- package/dist/core/revertible.d.ts.map +1 -1
- package/dist/core/revertible.js.map +1 -1
- package/dist/core/schema-stored/format.d.ts +0 -3
- package/dist/core/schema-stored/format.d.ts.map +1 -1
- package/dist/core/schema-stored/format.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +12 -10
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +3 -5
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts +2 -2
- package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.js +5 -5
- package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/dist/core/schema-view/index.d.ts +1 -1
- package/dist/core/schema-view/index.d.ts.map +1 -1
- package/dist/core/schema-view/index.js +1 -2
- package/dist/core/schema-view/index.js.map +1 -1
- package/dist/core/schema-view/view.d.ts +0 -7
- package/dist/core/schema-view/view.d.ts.map +1 -1
- package/dist/core/schema-view/view.js +1 -12
- package/dist/core/schema-view/view.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts +2 -2
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +21 -21
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/{lib/feature-libraries/chunked-forest → dist/core/tree}/chunk.d.ts +2 -1
- package/dist/core/tree/chunk.d.ts.map +1 -0
- package/dist/{feature-libraries/chunked-forest → core/tree}/chunk.js +2 -2
- package/dist/core/tree/chunk.js.map +1 -0
- package/dist/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodec.js +3 -2
- package/dist/core/tree/detachedFieldIndexCodec.js.map +1 -1
- package/dist/core/tree/index.d.ts +2 -1
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js +6 -1
- package/dist/core/tree/index.js.map +1 -1
- package/dist/core/tree/treeTextFormat.d.ts +0 -5
- package/dist/core/tree/treeTextFormat.d.ts.map +1 -1
- package/dist/core/tree/treeTextFormat.js.map +1 -1
- package/dist/core/tree/types.d.ts +0 -5
- package/dist/core/tree/types.d.ts.map +1 -1
- package/dist/core/tree/types.js +0 -1
- package/dist/core/tree/types.js.map +1 -1
- package/dist/core/tree/visitorUtils.d.ts +25 -1
- package/dist/core/tree/visitorUtils.d.ts.map +1 -1
- package/dist/core/tree/visitorUtils.js +29 -1
- package/dist/core/tree/visitorUtils.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts +1 -2
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js +14 -14
- package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +1 -2
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +2 -3
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +5 -3
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +24 -14
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts +1 -2
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -2
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/emptyChunk.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/emptyChunk.js +2 -3
- package/dist/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.js +5 -5
- package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.js +2 -2
- package/dist/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +1 -2
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +14 -14
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultSchema.js +1 -0
- package/dist/feature-libraries/default-schema/defaultSchema.js.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js +2 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +1 -1
- 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/index.d.ts +2 -1
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +9 -2
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +139 -0
- package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -0
- package/dist/feature-libraries/indexing/anchorTreeIndex.js +387 -0
- package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -0
- package/dist/feature-libraries/indexing/index.d.ts +7 -0
- package/dist/feature-libraries/indexing/index.d.ts.map +1 -0
- package/dist/feature-libraries/indexing/index.js +11 -0
- package/dist/feature-libraries/indexing/index.js.map +1 -0
- package/dist/feature-libraries/indexing/types.d.ts +32 -0
- package/dist/feature-libraries/indexing/types.d.ts.map +1 -0
- package/dist/{events/interop.js → feature-libraries/indexing/types.js} +1 -1
- package/dist/feature-libraries/indexing/types.js.map +1 -0
- package/dist/feature-libraries/modular-schema/discrepancies.d.ts +84 -24
- package/dist/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/discrepancies.js +32 -33
- package/dist/feature-libraries/modular-schema/discrepancies.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +5 -1
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.d.ts +0 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.js +0 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts +5 -2
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +21 -11
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +6 -6
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +7 -7
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +12 -12
- package/dist/feature-libraries/sequence-field/formatV1.d.ts +99 -99
- package/dist/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.d.ts +76 -76
- package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV3.d.ts +54 -54
- package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.js +2 -2
- package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +3 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/dist/feature-libraries/sequence-field/types.d.ts +0 -1
- package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/types.js.map +1 -1
- package/dist/index.d.ts +6 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -13
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/index.d.ts +2 -2
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +1 -2
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts +1 -1
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +6 -6
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +7 -1
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +35 -38
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +27 -6
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +146 -21
- 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 +3 -3
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +59 -72
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +243 -188
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +29 -107
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +51 -195
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.d.ts +24 -32
- package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.js +70 -53
- package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.js +2 -1
- package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +4 -4
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +3 -3
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +5 -4
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +3 -10
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +14 -67
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts +146 -0
- package/dist/shared-tree-core/transaction.d.ts.map +1 -0
- package/dist/shared-tree-core/transaction.js +211 -0
- package/dist/shared-tree-core/transaction.js.map +1 -0
- package/dist/shared-tree-core/transactionEnricher.d.ts +8 -13
- package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.js +41 -21
- package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
- package/dist/simple-tree/api/conciseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/conciseTree.js +1 -1
- package/dist/simple-tree/api/conciseTree.js.map +1 -1
- package/dist/simple-tree/api/create.d.ts.map +1 -1
- package/dist/simple-tree/api/create.js +5 -1
- package/dist/simple-tree/api/create.js.map +1 -1
- package/dist/simple-tree/api/customTree.d.ts +14 -2
- package/dist/simple-tree/api/customTree.d.ts.map +1 -1
- package/dist/simple-tree/api/customTree.js +53 -3
- package/dist/simple-tree/api/customTree.js.map +1 -1
- package/dist/simple-tree/api/identifierIndex.d.ts +21 -0
- package/dist/simple-tree/api/identifierIndex.d.ts.map +1 -0
- package/dist/simple-tree/api/identifierIndex.js +45 -0
- package/dist/simple-tree/api/identifierIndex.js.map +1 -0
- package/dist/simple-tree/api/index.d.ts +4 -2
- 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/schemaFactory.d.ts +48 -0
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +5 -2
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/simpleSchema.d.ts +3 -1
- package/dist/simple-tree/api/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchema.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +9 -7
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.d.ts +65 -0
- package/dist/simple-tree/api/simpleTreeIndex.d.ts.map +1 -0
- package/dist/simple-tree/api/simpleTreeIndex.js +93 -0
- package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -0
- package/dist/simple-tree/api/storedSchema.d.ts +4 -4
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +8 -21
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +5 -5
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +1 -1
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/api/view.d.ts +14 -9
- package/dist/simple-tree/api/view.d.ts.map +1 -1
- package/dist/simple-tree/api/view.js +129 -40
- package/dist/simple-tree/api/view.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +1 -1
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +2 -1
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts +6 -2
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +53 -22
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +2 -2
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/index.d.ts +2 -2
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +7 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +0 -15
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +0 -15
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/objectNode.d.ts +15 -5
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +18 -2
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/objectNodeTypes.d.ts +4 -0
- package/dist/simple-tree/objectNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/objectNodeTypes.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +4 -2
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/toMapTree.js +3 -3
- package/dist/simple-tree/toMapTree.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +18 -13
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/util/brand.d.ts +0 -2
- package/dist/util/brand.d.ts.map +1 -1
- package/dist/util/brand.js +0 -1
- package/dist/util/brand.js.map +1 -1
- package/dist/util/index.d.ts +1 -2
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +6 -4
- package/dist/util/index.js.map +1 -1
- package/dist/util/typeCheck.d.ts +6 -3
- package/dist/util/typeCheck.d.ts.map +1 -1
- package/dist/util/typeCheck.js.map +1 -1
- package/dist/util/typeCheckTests.d.ts +14 -2
- package/dist/util/typeCheckTests.d.ts.map +1 -1
- package/dist/util/typeCheckTests.js.map +1 -1
- package/dist/util/utils.d.ts +42 -0
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +35 -1
- package/dist/util/utils.js.map +1 -1
- package/lib/alpha.d.ts +9 -0
- package/lib/core/forest/forest.d.ts +10 -2
- package/lib/core/forest/forest.d.ts.map +1 -1
- package/lib/core/forest/forest.js.map +1 -1
- package/lib/core/index.d.ts +3 -3
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +3 -3
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/utils.d.ts +1 -1
- package/lib/core/rebase/utils.d.ts.map +1 -1
- package/lib/core/rebase/utils.js +13 -17
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/revertible.d.ts +30 -1
- package/lib/core/revertible.d.ts.map +1 -1
- package/lib/core/revertible.js.map +1 -1
- package/lib/core/schema-stored/format.d.ts +0 -3
- package/lib/core/schema-stored/format.d.ts.map +1 -1
- package/lib/core/schema-stored/format.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +12 -10
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +3 -5
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts +2 -2
- package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.js +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/lib/core/schema-view/index.d.ts +1 -1
- package/lib/core/schema-view/index.d.ts.map +1 -1
- package/lib/core/schema-view/index.js +1 -1
- package/lib/core/schema-view/index.js.map +1 -1
- package/lib/core/schema-view/view.d.ts +0 -7
- package/lib/core/schema-view/view.d.ts.map +1 -1
- package/lib/core/schema-view/view.js +0 -11
- package/lib/core/schema-view/view.js.map +1 -1
- package/lib/core/tree/anchorSet.d.ts +2 -2
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +1 -1
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/{dist/feature-libraries/chunked-forest → lib/core/tree}/chunk.d.ts +2 -1
- package/lib/core/tree/chunk.d.ts.map +1 -0
- package/lib/{feature-libraries/chunked-forest → core/tree}/chunk.js +1 -1
- package/lib/core/tree/chunk.js.map +1 -0
- package/lib/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodec.js +4 -3
- package/lib/core/tree/detachedFieldIndexCodec.js.map +1 -1
- package/lib/core/tree/index.d.ts +2 -1
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +2 -1
- package/lib/core/tree/index.js.map +1 -1
- package/lib/core/tree/treeTextFormat.d.ts +0 -5
- package/lib/core/tree/treeTextFormat.d.ts.map +1 -1
- package/lib/core/tree/treeTextFormat.js.map +1 -1
- package/lib/core/tree/types.d.ts +0 -5
- package/lib/core/tree/types.d.ts.map +1 -1
- package/lib/core/tree/types.js +0 -1
- package/lib/core/tree/types.js.map +1 -1
- package/lib/core/tree/visitorUtils.d.ts +25 -1
- package/lib/core/tree/visitorUtils.d.ts.map +1 -1
- package/lib/core/tree/visitorUtils.js +27 -0
- package/lib/core/tree/visitorUtils.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts +1 -2
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +1 -2
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +1 -2
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +5 -3
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +18 -8
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts +1 -2
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -2
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/emptyChunk.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/emptyChunk.js +1 -2
- package/lib/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.js +1 -1
- package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.js +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +1 -2
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +4 -4
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultSchema.js +1 -0
- package/lib/feature-libraries/default-schema/defaultSchema.js.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js +2 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +1 -1
- 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/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 +139 -0
- package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -0
- package/lib/feature-libraries/indexing/anchorTreeIndex.js +382 -0
- package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -0
- package/lib/feature-libraries/indexing/index.d.ts +7 -0
- package/lib/feature-libraries/indexing/index.d.ts.map +1 -0
- package/lib/{events → feature-libraries/indexing}/index.js +1 -1
- package/lib/feature-libraries/indexing/index.js.map +1 -0
- package/lib/feature-libraries/indexing/types.d.ts +32 -0
- package/lib/feature-libraries/indexing/types.d.ts.map +1 -0
- package/lib/{events/interop.js → feature-libraries/indexing/types.js} +1 -1
- package/lib/feature-libraries/indexing/types.js.map +1 -0
- package/lib/feature-libraries/modular-schema/discrepancies.d.ts +84 -24
- package/lib/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/discrepancies.js +25 -28
- package/lib/feature-libraries/modular-schema/discrepancies.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +1 -1
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.d.ts +0 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.js +0 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts +5 -2
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +15 -5
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +6 -6
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +7 -7
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +12 -12
- package/lib/feature-libraries/sequence-field/formatV1.d.ts +99 -99
- package/lib/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV2.d.ts +76 -76
- package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV3.d.ts +54 -54
- package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.js +4 -4
- package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +4 -3
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/lib/feature-libraries/sequence-field/types.d.ts +0 -1
- package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/types.js.map +1 -1
- package/lib/index.d.ts +6 -7
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -4
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/index.d.ts +2 -2
- 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 +1 -1
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +7 -7
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +7 -1
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +12 -16
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +27 -6
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +135 -10
- 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 +5 -5
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +59 -72
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +233 -177
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +29 -107
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +50 -193
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.d.ts +24 -32
- package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.js +71 -54
- package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.js +3 -2
- package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +4 -4
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +3 -3
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +2 -2
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +3 -10
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +15 -68
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts +146 -0
- package/lib/shared-tree-core/transaction.d.ts.map +1 -0
- package/lib/shared-tree-core/transaction.js +206 -0
- package/lib/shared-tree-core/transaction.js.map +1 -0
- package/lib/shared-tree-core/transactionEnricher.d.ts +8 -13
- package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.js +41 -21
- package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
- package/lib/simple-tree/api/conciseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/conciseTree.js +2 -2
- package/lib/simple-tree/api/conciseTree.js.map +1 -1
- package/lib/simple-tree/api/create.d.ts.map +1 -1
- package/lib/simple-tree/api/create.js +5 -1
- package/lib/simple-tree/api/create.js.map +1 -1
- package/lib/simple-tree/api/customTree.d.ts +14 -2
- package/lib/simple-tree/api/customTree.d.ts.map +1 -1
- package/lib/simple-tree/api/customTree.js +50 -2
- package/lib/simple-tree/api/customTree.js.map +1 -1
- package/lib/simple-tree/api/identifierIndex.d.ts +21 -0
- package/lib/simple-tree/api/identifierIndex.d.ts.map +1 -0
- package/lib/simple-tree/api/identifierIndex.js +41 -0
- package/lib/simple-tree/api/identifierIndex.js.map +1 -0
- package/lib/simple-tree/api/index.d.ts +4 -2
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +4 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +48 -0
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +4 -1
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/simpleSchema.d.ts +3 -1
- package/lib/simple-tree/api/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchema.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +11 -9
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/simpleTreeIndex.d.ts +65 -0
- package/lib/simple-tree/api/simpleTreeIndex.d.ts.map +1 -0
- package/lib/simple-tree/api/simpleTreeIndex.js +89 -0
- package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -0
- package/lib/simple-tree/api/storedSchema.d.ts +4 -4
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +5 -18
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +5 -5
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +2 -2
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/api/view.d.ts +14 -9
- package/lib/simple-tree/api/view.d.ts.map +1 -1
- package/lib/simple-tree/api/view.js +131 -42
- package/lib/simple-tree/api/view.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +1 -1
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +1 -1
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts +6 -2
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +31 -1
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/index.d.ts +2 -2
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +2 -2
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts +0 -15
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +0 -15
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/objectNode.d.ts +15 -5
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +16 -1
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/objectNodeTypes.d.ts +4 -0
- package/lib/simple-tree/objectNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/objectNodeTypes.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +4 -2
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/toMapTree.js +5 -5
- 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 +19 -14
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/util/brand.d.ts +0 -2
- package/lib/util/brand.d.ts.map +1 -1
- package/lib/util/brand.js +0 -1
- package/lib/util/brand.js.map +1 -1
- package/lib/util/index.d.ts +1 -2
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +1 -2
- package/lib/util/index.js.map +1 -1
- package/lib/util/typeCheck.d.ts +6 -3
- package/lib/util/typeCheck.d.ts.map +1 -1
- package/lib/util/typeCheck.js.map +1 -1
- package/lib/util/typeCheckTests.d.ts +14 -2
- package/lib/util/typeCheckTests.d.ts.map +1 -1
- package/lib/util/typeCheckTests.js.map +1 -1
- package/lib/util/utils.d.ts +42 -0
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js +30 -0
- package/lib/util/utils.js.map +1 -1
- package/package.json +23 -23
- package/src/core/forest/forest.ts +12 -1
- package/src/core/index.ts +13 -2
- package/src/core/rebase/utils.ts +28 -29
- package/src/core/revertible.ts +35 -1
- package/src/core/schema-stored/format.ts +0 -3
- package/src/core/schema-stored/schema.ts +13 -10
- package/src/core/schema-stored/storedSchemaRepository.ts +2 -1
- package/src/core/schema-view/index.ts +0 -1
- package/src/core/schema-view/view.ts +0 -11
- package/src/core/tree/anchorSet.ts +2 -1
- package/src/{feature-libraries/chunked-forest → core/tree}/chunk.ts +4 -4
- package/src/core/tree/detachedFieldIndexCodec.ts +4 -3
- package/src/core/tree/index.ts +9 -0
- package/src/core/tree/treeTextFormat.ts +0 -5
- package/src/core/tree/types.ts +0 -5
- package/src/core/tree/visitorUtils.ts +56 -1
- package/src/feature-libraries/chunked-forest/basicChunk.ts +4 -2
- package/src/feature-libraries/chunked-forest/chunkTree.ts +2 -1
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +35 -8
- package/src/feature-libraries/chunked-forest/codec/chunkCodecUtilities.ts +1 -2
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +6 -2
- package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +1 -1
- package/src/feature-libraries/chunked-forest/emptyChunk.ts +4 -2
- package/src/feature-libraries/chunked-forest/index.ts +1 -1
- package/src/feature-libraries/chunked-forest/sequenceChunk.ts +1 -1
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +7 -4
- package/src/feature-libraries/default-schema/defaultSchema.ts +1 -0
- package/src/feature-libraries/default-schema/schemaChecker.ts +4 -1
- package/src/feature-libraries/flex-tree/context.ts +1 -1
- package/src/feature-libraries/index.ts +22 -0
- package/src/feature-libraries/indexing/anchorTreeIndex.ts +482 -0
- package/src/feature-libraries/indexing/index.ts +11 -0
- package/src/feature-libraries/indexing/types.ts +37 -0
- package/src/feature-libraries/modular-schema/discrepancies.ts +76 -38
- package/src/feature-libraries/modular-schema/index.ts +13 -0
- package/src/feature-libraries/modular-schema/isNeverTree.ts +0 -2
- package/src/feature-libraries/object-forest/objectForest.ts +22 -4
- package/src/feature-libraries/sequence-field/invert.ts +4 -4
- package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +4 -4
- package/src/feature-libraries/sequence-field/types.ts +0 -1
- package/src/index.ts +17 -35
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/index.ts +1 -2
- package/src/shared-tree/schematizeTree.ts +6 -10
- package/src/shared-tree/schematizingTreeView.ts +18 -28
- package/src/shared-tree/sharedTree.ts +216 -30
- package/src/shared-tree/sharedTreeChangeFamily.ts +5 -4
- package/src/shared-tree/treeCheckout.ts +341 -299
- package/src/shared-tree-core/branch.ts +80 -300
- package/src/shared-tree-core/branchCommitEnricher.ts +66 -62
- package/src/shared-tree-core/defaultResubmitMachine.ts +3 -2
- package/src/shared-tree-core/editManager.ts +4 -9
- package/src/shared-tree-core/index.ts +11 -3
- package/src/shared-tree-core/sharedTreeCore.ts +23 -79
- package/src/shared-tree-core/transaction.ts +310 -0
- package/src/shared-tree-core/transactionEnricher.ts +30 -24
- package/src/simple-tree/api/conciseTree.ts +2 -2
- package/src/simple-tree/api/create.ts +5 -1
- package/src/simple-tree/api/customTree.ts +69 -1
- package/src/simple-tree/api/identifierIndex.ts +64 -0
- package/src/simple-tree/api/index.ts +17 -2
- package/src/simple-tree/api/schemaFactory.ts +62 -1
- package/src/simple-tree/api/simpleSchema.ts +3 -1
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +17 -18
- package/src/simple-tree/api/simpleTreeIndex.ts +233 -0
- package/src/simple-tree/api/storedSchema.ts +7 -22
- package/src/simple-tree/api/tree.ts +14 -5
- package/src/simple-tree/api/treeNodeApi.ts +1 -1
- package/src/simple-tree/api/verboseTree.ts +2 -2
- package/src/simple-tree/api/view.ts +197 -51
- package/src/simple-tree/core/index.ts +1 -0
- package/src/simple-tree/core/treeNodeKernel.ts +37 -2
- package/src/simple-tree/core/unhydratedFlexTree.ts +2 -1
- package/src/simple-tree/index.ts +10 -0
- package/src/simple-tree/leafNodeSchema.ts +0 -19
- package/src/simple-tree/objectNode.ts +45 -14
- package/src/simple-tree/objectNodeTypes.ts +5 -0
- package/src/simple-tree/schemaTypes.ts +7 -2
- package/src/simple-tree/toMapTree.ts +5 -5
- package/src/simple-tree/toStoredSchema.ts +25 -19
- package/src/util/brand.ts +0 -2
- package/src/util/index.ts +4 -1
- package/src/util/typeCheck.ts +6 -3
- package/src/util/typeCheckTests.ts +11 -1
- package/src/util/utils.ts +64 -0
- package/dist/events/emitter.d.ts +0 -139
- package/dist/events/emitter.d.ts.map +0 -1
- package/dist/events/emitter.js +0 -165
- package/dist/events/emitter.js.map +0 -1
- package/dist/events/index.d.ts +0 -7
- package/dist/events/index.d.ts.map +0 -1
- package/dist/events/index.js +0 -11
- package/dist/events/index.js.map +0 -1
- package/dist/events/interop.d.ts +0 -30
- package/dist/events/interop.d.ts.map +0 -1
- package/dist/events/interop.js.map +0 -1
- package/dist/events/listeners.d.ts +0 -76
- package/dist/events/listeners.d.ts.map +0 -1
- package/dist/events/listeners.js +0 -7
- package/dist/events/listeners.js.map +0 -1
- package/dist/feature-libraries/chunked-forest/chunk.d.ts.map +0 -1
- package/dist/feature-libraries/chunked-forest/chunk.js.map +0 -1
- package/dist/shared-tree-core/transactionStack.d.ts +0 -29
- package/dist/shared-tree-core/transactionStack.d.ts.map +0 -1
- package/dist/shared-tree-core/transactionStack.js +0 -41
- package/dist/shared-tree-core/transactionStack.js.map +0 -1
- package/dist/util/transactionResult.d.ts +0 -19
- package/dist/util/transactionResult.d.ts.map +0 -1
- package/dist/util/transactionResult.js +0 -23
- package/dist/util/transactionResult.js.map +0 -1
- package/lib/events/emitter.d.ts +0 -139
- package/lib/events/emitter.d.ts.map +0 -1
- package/lib/events/emitter.js +0 -160
- package/lib/events/emitter.js.map +0 -1
- package/lib/events/index.d.ts +0 -7
- package/lib/events/index.d.ts.map +0 -1
- package/lib/events/index.js.map +0 -1
- package/lib/events/interop.d.ts +0 -30
- package/lib/events/interop.d.ts.map +0 -1
- package/lib/events/interop.js.map +0 -1
- package/lib/events/listeners.d.ts +0 -76
- package/lib/events/listeners.d.ts.map +0 -1
- package/lib/events/listeners.js +0 -6
- package/lib/events/listeners.js.map +0 -1
- package/lib/feature-libraries/chunked-forest/chunk.d.ts.map +0 -1
- package/lib/feature-libraries/chunked-forest/chunk.js.map +0 -1
- package/lib/shared-tree-core/transactionStack.d.ts +0 -29
- package/lib/shared-tree-core/transactionStack.d.ts.map +0 -1
- package/lib/shared-tree-core/transactionStack.js +0 -37
- package/lib/shared-tree-core/transactionStack.js.map +0 -1
- package/lib/util/transactionResult.d.ts +0 -19
- package/lib/util/transactionResult.d.ts.map +0 -1
- package/lib/util/transactionResult.js +0 -20
- package/lib/util/transactionResult.js.map +0 -1
- package/src/events/README.md +0 -3
- package/src/events/emitter.ts +0 -256
- package/src/events/index.ts +0 -19
- package/src/events/interop.ts +0 -38
- package/src/events/listeners.ts +0 -80
- package/src/shared-tree-core/transactionStack.ts +0 -45
- package/src/util/transactionResult.ts +0 -19
|
@@ -14,7 +14,6 @@ export const version = 1 as const;
|
|
|
14
14
|
* Key (aka Name or Label) for a field which is scoped to a specific TreeNodeStoredSchema.
|
|
15
15
|
*
|
|
16
16
|
* Stable identifier, used when persisting data.
|
|
17
|
-
* @internal
|
|
18
17
|
*/
|
|
19
18
|
export type FieldKey = Brand<string, "tree.FieldKey">;
|
|
20
19
|
|
|
@@ -28,7 +27,6 @@ export const FieldKeySchema = brandedStringType<FieldKey>();
|
|
|
28
27
|
* Also known as "Definition"
|
|
29
28
|
*
|
|
30
29
|
* Stable identifier, used when persisting data.
|
|
31
|
-
* @internal
|
|
32
30
|
*/
|
|
33
31
|
export type TreeNodeSchemaIdentifier<TName extends string = string> = Brand<
|
|
34
32
|
TName,
|
|
@@ -40,7 +38,6 @@ export type TreeNodeSchemaIdentifier<TName extends string = string> = Brand<
|
|
|
40
38
|
* Refers to an exact stable policy (ex: specific version of a policy),
|
|
41
39
|
* for how to handle (ex: edit and merge edits to) fields marked with this kind.
|
|
42
40
|
* Persisted in documents as part of stored schema.
|
|
43
|
-
* @internal
|
|
44
41
|
*/
|
|
45
42
|
export type FieldKindIdentifier = Brand<string, "tree.FieldKindIdentifier">;
|
|
46
43
|
export const FieldKindIdentifierSchema = brandedStringType<FieldKindIdentifier>();
|
|
@@ -17,7 +17,9 @@ import {
|
|
|
17
17
|
import type { Multiplicity } from "./multiplicity.js";
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* Schema for what {@link
|
|
20
|
+
* Schema for what {@link TreeLeafValue} is allowed on a Leaf node.
|
|
21
|
+
* @privateRemarks
|
|
22
|
+
* See also {@link TreeValue}.
|
|
21
23
|
* @internal
|
|
22
24
|
*/
|
|
23
25
|
export enum ValueSchema {
|
|
@@ -51,7 +53,6 @@ export enum ValueSchema {
|
|
|
51
53
|
* - Constrain the types allowed based on which types guarantee their data will always meet the constraints.
|
|
52
54
|
*
|
|
53
55
|
* Care would need to be taken to make sure this is sound for the schema updating mechanisms.
|
|
54
|
-
* @internal
|
|
55
56
|
*/
|
|
56
57
|
export type TreeTypeSet = ReadonlySet<TreeNodeSchemaIdentifier>;
|
|
57
58
|
|
|
@@ -91,12 +92,21 @@ export interface SchemaPolicy {
|
|
|
91
92
|
* If true, new content inserted into the tree should be validated against the stored schema.
|
|
92
93
|
*/
|
|
93
94
|
readonly validateSchema: boolean;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Whether to allow a document to be opened when a particular stored schema (identified by `identifier`)
|
|
98
|
+
* contains optional fields that are not known to the view schema.
|
|
99
|
+
*
|
|
100
|
+
* @privateRemarks
|
|
101
|
+
* Plumbing this in via `SchemaPolicy` avoids needing to walk the view schema representation repeatedly in places
|
|
102
|
+
* that need it (schema validation, view vs stored compatibility checks).
|
|
103
|
+
*/
|
|
104
|
+
allowUnknownOptionalFields(identifier: TreeNodeSchemaIdentifier): boolean;
|
|
94
105
|
}
|
|
95
106
|
|
|
96
107
|
/**
|
|
97
108
|
* Schema for a field.
|
|
98
109
|
* Object implementing this interface should never be modified.
|
|
99
|
-
* @internal
|
|
100
110
|
*/
|
|
101
111
|
export interface TreeFieldStoredSchema {
|
|
102
112
|
readonly kind: FieldKindIdentifier;
|
|
@@ -136,7 +146,6 @@ export const identifierFieldKindIdentifier = "Identifier";
|
|
|
136
146
|
|
|
137
147
|
/**
|
|
138
148
|
* Opaque type erased handle to the encoded representation of the contents of a stored schema.
|
|
139
|
-
* @internal
|
|
140
149
|
*/
|
|
141
150
|
export interface ErasedTreeNodeSchemaDataFormat
|
|
142
151
|
extends ErasedType<"TreeNodeSchemaDataFormat"> {}
|
|
@@ -154,7 +163,6 @@ export function toTreeNodeSchemaDataFormat(
|
|
|
154
163
|
}
|
|
155
164
|
|
|
156
165
|
/**
|
|
157
|
-
* @internal
|
|
158
166
|
*/
|
|
159
167
|
export abstract class TreeNodeStoredSchema {
|
|
160
168
|
protected _typeCheck!: MakeNominal;
|
|
@@ -174,7 +182,6 @@ export abstract class TreeNodeStoredSchema {
|
|
|
174
182
|
}
|
|
175
183
|
|
|
176
184
|
/**
|
|
177
|
-
* @internal
|
|
178
185
|
*/
|
|
179
186
|
export class ObjectNodeStoredSchema extends TreeNodeStoredSchema {
|
|
180
187
|
/**
|
|
@@ -214,7 +221,6 @@ export class ObjectNodeStoredSchema extends TreeNodeStoredSchema {
|
|
|
214
221
|
}
|
|
215
222
|
|
|
216
223
|
/**
|
|
217
|
-
* @internal
|
|
218
224
|
*/
|
|
219
225
|
export class MapNodeStoredSchema extends TreeNodeStoredSchema {
|
|
220
226
|
/**
|
|
@@ -241,7 +247,6 @@ export class MapNodeStoredSchema extends TreeNodeStoredSchema {
|
|
|
241
247
|
}
|
|
242
248
|
|
|
243
249
|
/**
|
|
244
|
-
* @internal
|
|
245
250
|
*/
|
|
246
251
|
export class LeafNodeStoredSchema extends TreeNodeStoredSchema {
|
|
247
252
|
/**
|
|
@@ -330,7 +335,6 @@ export function decodeFieldSchema(schema: FieldSchemaFormat): TreeFieldStoredSch
|
|
|
330
335
|
* @remarks
|
|
331
336
|
* Note: the owner of this may modify it over time:
|
|
332
337
|
* thus if needing to hand onto a specific version, make a copy.
|
|
333
|
-
* @internal
|
|
334
338
|
*/
|
|
335
339
|
export interface TreeStoredSchema extends StoredSchemaCollection {
|
|
336
340
|
/**
|
|
@@ -345,7 +349,6 @@ export interface TreeStoredSchema extends StoredSchemaCollection {
|
|
|
345
349
|
* @remarks
|
|
346
350
|
* Note: the owner of this may modify it over time:
|
|
347
351
|
* thus if needing to hang onto a specific version, make a copy.
|
|
348
|
-
* @internal
|
|
349
352
|
*/
|
|
350
353
|
export interface StoredSchemaCollection {
|
|
351
354
|
/**
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import { BTree } from "@tylerbu/sorted-btree-es6";
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import type { Listenable } from "@fluidframework/core-interfaces/internal";
|
|
9
|
+
import { createEmitter } from "@fluid-internal/client-utils";
|
|
9
10
|
import { compareStrings } from "../../util/index.js";
|
|
10
11
|
|
|
11
12
|
import type { TreeNodeSchemaIdentifier } from "./format.js";
|
|
@@ -9,17 +9,6 @@ import type { TreeNodeSchemaIdentifier, TreeStoredSchema } from "../schema-store
|
|
|
9
9
|
* APIs for applying `view schema` to documents.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* How compatible a particular view schema is for some operation on some specific document.
|
|
14
|
-
*/
|
|
15
|
-
export enum Compatibility {
|
|
16
|
-
Incompatible,
|
|
17
|
-
// For write compatibility this can include compatible schema updates to stored schema.
|
|
18
|
-
// TODO: separate schema updates from adapters.
|
|
19
|
-
// RequiresAdapters,
|
|
20
|
-
Compatible,
|
|
21
|
-
}
|
|
22
|
-
|
|
23
12
|
/**
|
|
24
13
|
* What kinds of updates to stored schema to permit.
|
|
25
14
|
*
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import type { Listenable } from "@fluidframework/core-interfaces/internal";
|
|
11
|
+
import { createEmitter } from "@fluid-internal/client-utils";
|
|
11
12
|
import {
|
|
12
13
|
type Brand,
|
|
13
14
|
type BrandedKey,
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
7
7
|
|
|
8
|
+
import type { ReferenceCounted } from "../../util/index.js";
|
|
9
|
+
import type { FieldKey } from "../schema-stored/index.js";
|
|
10
|
+
import { rootFieldKey } from "./types.js";
|
|
8
11
|
import {
|
|
9
12
|
CursorLocationType,
|
|
10
|
-
type FieldKey,
|
|
11
13
|
type ITreeCursor,
|
|
12
14
|
type ITreeCursorSynchronous,
|
|
13
|
-
|
|
14
|
-
} from "../../core/index.js";
|
|
15
|
-
import type { ReferenceCounted } from "../../util/index.js";
|
|
15
|
+
} from "./cursor.js";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Contiguous part of the tree which get stored together in some data format.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { assert
|
|
6
|
+
import { assert } from "@fluidframework/core-utils/internal";
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
9
|
type ICodecOptions,
|
|
@@ -24,6 +24,7 @@ import type {
|
|
|
24
24
|
Major,
|
|
25
25
|
} from "./detachedFieldIndexTypes.js";
|
|
26
26
|
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
27
|
+
import { hasSingle } from "../../util/index.js";
|
|
27
28
|
|
|
28
29
|
class MajorCodec implements IJsonCodec<Major> {
|
|
29
30
|
public constructor(
|
|
@@ -83,8 +84,8 @@ export function makeDetachedNodeToFieldCodec(
|
|
|
83
84
|
for (const [minor, detachedField] of innerMap) {
|
|
84
85
|
rootRanges.push([minor, detachedField.root]);
|
|
85
86
|
}
|
|
86
|
-
if (rootRanges
|
|
87
|
-
const firstRootRange = rootRanges[0]
|
|
87
|
+
if (hasSingle(rootRanges)) {
|
|
88
|
+
const firstRootRange = rootRanges[0];
|
|
88
89
|
const rootsForRevision: EncodedRootsForRevision = [
|
|
89
90
|
encodedRevision,
|
|
90
91
|
firstRootRange[0],
|
package/src/core/tree/index.ts
CHANGED
|
@@ -94,6 +94,7 @@ export {
|
|
|
94
94
|
type AnnouncedVisitor,
|
|
95
95
|
announceDelta,
|
|
96
96
|
applyDelta,
|
|
97
|
+
createAnnouncedVisitor,
|
|
97
98
|
combineVisitors,
|
|
98
99
|
makeDetachedFieldIndex,
|
|
99
100
|
} from "./visitorUtils.js";
|
|
@@ -110,5 +111,13 @@ export {
|
|
|
110
111
|
emptyDelta,
|
|
111
112
|
} from "./deltaUtil.js";
|
|
112
113
|
|
|
114
|
+
export {
|
|
115
|
+
type TreeChunk,
|
|
116
|
+
dummyRoot,
|
|
117
|
+
cursorChunk,
|
|
118
|
+
tryGetChunk,
|
|
119
|
+
type ChunkedCursor,
|
|
120
|
+
} from "./chunk.js";
|
|
121
|
+
|
|
113
122
|
export { DetachedFieldIndex } from "./detachedFieldIndex.js";
|
|
114
123
|
export { type ForestRootId } from "./detachedFieldIndexTypes.js";
|
|
@@ -49,8 +49,6 @@ import type { NodeData } from "./types.js";
|
|
|
49
49
|
* Only use this type when needed for json compatible maps,
|
|
50
50
|
* but even in those cases consider lists of key value pairs for serialization and using `Map`
|
|
51
51
|
* for runtime.
|
|
52
|
-
*
|
|
53
|
-
* @internal
|
|
54
52
|
*/
|
|
55
53
|
export interface FieldMapObject<TChild> {
|
|
56
54
|
[key: string]: TChild[];
|
|
@@ -59,14 +57,12 @@ export interface FieldMapObject<TChild> {
|
|
|
59
57
|
/**
|
|
60
58
|
* Json comparable tree node, generic over child type.
|
|
61
59
|
* Json compatibility assumes `TChild` is also json compatible.
|
|
62
|
-
* @internal
|
|
63
60
|
*/
|
|
64
61
|
export interface GenericTreeNode<TChild> extends GenericFieldsNode<TChild>, NodeData {}
|
|
65
62
|
|
|
66
63
|
/**
|
|
67
64
|
* Json comparable field collection, generic over child type.
|
|
68
65
|
* Json compatibility assumes `TChild` is also json compatible.
|
|
69
|
-
* @internal
|
|
70
66
|
*/
|
|
71
67
|
export interface GenericFieldsNode<TChild> {
|
|
72
68
|
fields?: FieldMapObject<TChild>;
|
|
@@ -79,7 +75,6 @@ export interface GenericFieldsNode<TChild> {
|
|
|
79
75
|
* {@link @fluidframework/shared-object-base#IFluidSerializer.stringify} must be used instead of `JSON.stringify`.
|
|
80
76
|
*
|
|
81
77
|
* JsonableTrees should not store empty fields.
|
|
82
|
-
* @internal
|
|
83
78
|
*/
|
|
84
79
|
export interface JsonableTree extends GenericTreeNode<JsonableTree> {}
|
|
85
80
|
|
package/src/core/tree/types.ts
CHANGED
|
@@ -33,7 +33,6 @@ export type TreeType = TreeNodeSchemaIdentifier;
|
|
|
33
33
|
* This has to be a FieldKey since different nodes will have different TreeFieldStoredSchema for it.
|
|
34
34
|
* This makes it prone to collisions and suggests
|
|
35
35
|
* that this intention may be better conveyed by metadata on the ITreeSchema.
|
|
36
|
-
* @internal
|
|
37
36
|
*/
|
|
38
37
|
export const EmptyKey: FieldKey = brand("");
|
|
39
38
|
|
|
@@ -116,7 +115,6 @@ export interface FieldKind {
|
|
|
116
115
|
|
|
117
116
|
/**
|
|
118
117
|
* Value that may be stored on a leaf node.
|
|
119
|
-
* @internal
|
|
120
118
|
*/
|
|
121
119
|
export type TreeValue<TSchema extends ValueSchema = ValueSchema> = [
|
|
122
120
|
{
|
|
@@ -131,7 +129,6 @@ export type TreeValue<TSchema extends ValueSchema = ValueSchema> = [
|
|
|
131
129
|
|
|
132
130
|
/**
|
|
133
131
|
* Value stored on a node.
|
|
134
|
-
* @internal
|
|
135
132
|
*/
|
|
136
133
|
export type Value = undefined | TreeValue;
|
|
137
134
|
|
|
@@ -141,8 +138,6 @@ export type Value = undefined | TreeValue;
|
|
|
141
138
|
* @privateRemarks A forked version of this type is used in `persistedTreeTextFormat.ts`.
|
|
142
139
|
* Changes to this type might necessitate changes to `EncodedNodeData` or codecs.
|
|
143
140
|
* See persistedTreeTextFormat's module documentation for more details.
|
|
144
|
-
*
|
|
145
|
-
* @internal
|
|
146
141
|
*/
|
|
147
142
|
export interface NodeData {
|
|
148
143
|
/**
|
|
@@ -13,7 +13,7 @@ import type { FieldKey } from "../schema-stored/index.js";
|
|
|
13
13
|
import type { ProtoNodes, Root } from "./delta.js";
|
|
14
14
|
import { DetachedFieldIndex } from "./detachedFieldIndex.js";
|
|
15
15
|
import type { ForestRootId } from "./detachedFieldIndexTypes.js";
|
|
16
|
-
import type { PlaceIndex, Range } from "./pathTree.js";
|
|
16
|
+
import type { NodeIndex, PlaceIndex, Range } from "./pathTree.js";
|
|
17
17
|
import { type DeltaVisitor, visitDelta } from "./visitDelta.js";
|
|
18
18
|
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
19
19
|
|
|
@@ -133,3 +133,58 @@ export interface AnnouncedVisitor extends DeltaVisitor {
|
|
|
133
133
|
): void;
|
|
134
134
|
afterReplace(newContentSource: FieldKey, newContent: Range, oldContent: FieldKey): void;
|
|
135
135
|
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Creates an announced visitor with only the provided functions and uses a no op for the rest.
|
|
139
|
+
* This is provided to make some of the delta visitor definitions cleaner.
|
|
140
|
+
*/
|
|
141
|
+
export function createAnnouncedVisitor(visitorFunctions: {
|
|
142
|
+
free?: () => void;
|
|
143
|
+
create?: (content: ProtoNodes, destination: FieldKey) => void;
|
|
144
|
+
afterCreate?: (content: ProtoNodes, destination: FieldKey) => void;
|
|
145
|
+
beforeDestroy?: (field: FieldKey, count: number) => void;
|
|
146
|
+
destroy?: (detachedField: FieldKey, count: number) => void;
|
|
147
|
+
beforeAttach?: (source: FieldKey, count: number, destination: PlaceIndex) => void;
|
|
148
|
+
attach?: (source: FieldKey, count: number, destination: PlaceIndex) => void;
|
|
149
|
+
afterAttach?: (source: FieldKey, destination: Range) => void;
|
|
150
|
+
beforeDetach?: (source: Range, destination: FieldKey) => void;
|
|
151
|
+
afterDetach?: (source: PlaceIndex, count: number, destination: FieldKey) => void;
|
|
152
|
+
detach?: (source: Range, destination: FieldKey) => void;
|
|
153
|
+
beforeReplace?: (
|
|
154
|
+
newContent: FieldKey,
|
|
155
|
+
oldContent: Range,
|
|
156
|
+
oldContentDestination: FieldKey,
|
|
157
|
+
) => void;
|
|
158
|
+
replace?: (
|
|
159
|
+
newContentSource: FieldKey,
|
|
160
|
+
range: Range,
|
|
161
|
+
oldContentDestination: FieldKey,
|
|
162
|
+
) => void;
|
|
163
|
+
afterReplace?: (newContentSource: FieldKey, newContent: Range, oldContent: FieldKey) => void;
|
|
164
|
+
enterNode?: (index: NodeIndex) => void;
|
|
165
|
+
exitNode?: (index: NodeIndex) => void;
|
|
166
|
+
enterField?: (key: FieldKey) => void;
|
|
167
|
+
exitField?: (key: FieldKey) => void;
|
|
168
|
+
}): AnnouncedVisitor {
|
|
169
|
+
const noOp = (): void => {};
|
|
170
|
+
return {
|
|
171
|
+
free: visitorFunctions.free ?? noOp,
|
|
172
|
+
create: visitorFunctions.create ?? noOp,
|
|
173
|
+
afterCreate: visitorFunctions.afterCreate ?? noOp,
|
|
174
|
+
beforeDestroy: visitorFunctions.beforeDestroy ?? noOp,
|
|
175
|
+
destroy: visitorFunctions.destroy ?? noOp,
|
|
176
|
+
beforeAttach: visitorFunctions.beforeAttach ?? noOp,
|
|
177
|
+
attach: visitorFunctions.attach ?? noOp,
|
|
178
|
+
afterAttach: visitorFunctions.afterAttach ?? noOp,
|
|
179
|
+
beforeDetach: visitorFunctions.beforeDetach ?? noOp,
|
|
180
|
+
detach: visitorFunctions.detach ?? noOp,
|
|
181
|
+
afterDetach: visitorFunctions.afterDetach ?? noOp,
|
|
182
|
+
beforeReplace: visitorFunctions.beforeReplace ?? noOp,
|
|
183
|
+
replace: visitorFunctions.replace ?? noOp,
|
|
184
|
+
afterReplace: visitorFunctions.afterReplace ?? noOp,
|
|
185
|
+
enterNode: visitorFunctions.enterNode ?? noOp,
|
|
186
|
+
exitNode: visitorFunctions.exitNode ?? noOp,
|
|
187
|
+
enterField: visitorFunctions.enterField ?? noOp,
|
|
188
|
+
exitField: visitorFunctions.exitField ?? noOp,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
@@ -15,12 +15,14 @@ import {
|
|
|
15
15
|
type TreeValue,
|
|
16
16
|
type UpPath,
|
|
17
17
|
type Value,
|
|
18
|
+
type ChunkedCursor,
|
|
19
|
+
type TreeChunk,
|
|
20
|
+
cursorChunk,
|
|
21
|
+
dummyRoot,
|
|
18
22
|
} from "../../core/index.js";
|
|
19
23
|
import { ReferenceCountedBase, fail } from "../../util/index.js";
|
|
20
24
|
import { SynchronousCursor, prefixPath } from "../treeCursorUtils.js";
|
|
21
25
|
|
|
22
|
-
import { type ChunkedCursor, type TreeChunk, cursorChunk, dummyRoot } from "./chunk.js";
|
|
23
|
-
|
|
24
26
|
/**
|
|
25
27
|
* General purpose one node chunk.
|
|
26
28
|
*/
|
|
@@ -21,12 +21,13 @@ import {
|
|
|
21
21
|
mapCursorFields,
|
|
22
22
|
Multiplicity,
|
|
23
23
|
ValueSchema,
|
|
24
|
+
type TreeChunk,
|
|
25
|
+
tryGetChunk,
|
|
24
26
|
} from "../../core/index.js";
|
|
25
27
|
import { fail, getOrCreate } from "../../util/index.js";
|
|
26
28
|
import type { FullSchemaPolicy } from "../modular-schema/index.js";
|
|
27
29
|
|
|
28
30
|
import { BasicChunk } from "./basicChunk.js";
|
|
29
|
-
import { type TreeChunk, tryGetChunk } from "./chunk.js";
|
|
30
31
|
import { SequenceChunk } from "./sequenceChunk.js";
|
|
31
32
|
import { type FieldShape, TreeShape, UniformChunk } from "./uniformChunk.js";
|
|
32
33
|
import { isStableNodeKey } from "../node-key/index.js";
|
|
@@ -4,10 +4,13 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { assert, oob } from "@fluidframework/core-utils/internal";
|
|
7
|
+
import type { Listenable } from "@fluidframework/core-interfaces";
|
|
8
|
+
import { createEmitter } from "@fluid-internal/client-utils";
|
|
7
9
|
|
|
8
10
|
import {
|
|
9
11
|
type Anchor,
|
|
10
12
|
AnchorSet,
|
|
13
|
+
type AnnouncedVisitor,
|
|
11
14
|
type DeltaVisitor,
|
|
12
15
|
type DetachedField,
|
|
13
16
|
type FieldAnchor,
|
|
@@ -24,15 +27,23 @@ import {
|
|
|
24
27
|
type TreeStoredSchemaSubscription,
|
|
25
28
|
type UpPath,
|
|
26
29
|
aboveRootPlaceholder,
|
|
30
|
+
combineVisitors,
|
|
27
31
|
detachedFieldAsKey,
|
|
28
32
|
mapCursorField,
|
|
29
33
|
rootFieldKey,
|
|
34
|
+
type ChunkedCursor,
|
|
35
|
+
type TreeChunk,
|
|
30
36
|
} from "../../core/index.js";
|
|
31
|
-
import {
|
|
32
|
-
|
|
37
|
+
import {
|
|
38
|
+
assertValidRange,
|
|
39
|
+
brand,
|
|
40
|
+
fail,
|
|
41
|
+
getLast,
|
|
42
|
+
getOrAddEmptyToMap,
|
|
43
|
+
hasSome,
|
|
44
|
+
} from "../../util/index.js";
|
|
33
45
|
|
|
34
46
|
import { BasicChunk, BasicChunkCursor, type SiblingsOrKey } from "./basicChunk.js";
|
|
35
|
-
import type { ChunkedCursor, TreeChunk } from "./chunk.js";
|
|
36
47
|
import { type IChunker, basicChunkTree, chunkTree } from "./chunkTree.js";
|
|
37
48
|
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
38
49
|
|
|
@@ -53,6 +64,7 @@ interface StackNode {
|
|
|
53
64
|
export class ChunkedForest implements IEditableForest {
|
|
54
65
|
private activeVisitor?: DeltaVisitor;
|
|
55
66
|
|
|
67
|
+
private readonly deltaVisitors: Set<() => AnnouncedVisitor> = new Set();
|
|
56
68
|
readonly #events = createEmitter<ForestEvents>();
|
|
57
69
|
public readonly events: Listenable<ForestEvents> = this.#events;
|
|
58
70
|
|
|
@@ -83,6 +95,14 @@ export class ChunkedForest implements IEditableForest {
|
|
|
83
95
|
this.anchors.forget(anchor);
|
|
84
96
|
}
|
|
85
97
|
|
|
98
|
+
public registerAnnouncedVisitor(visitor: () => AnnouncedVisitor): void {
|
|
99
|
+
this.deltaVisitors.add(visitor);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
public deregisterAnnouncedVisitor(visitor: () => AnnouncedVisitor): void {
|
|
103
|
+
this.deltaVisitors.delete(visitor);
|
|
104
|
+
}
|
|
105
|
+
|
|
86
106
|
public acquireVisitor(): DeltaVisitor {
|
|
87
107
|
assert(
|
|
88
108
|
this.activeVisitor === undefined,
|
|
@@ -93,15 +113,15 @@ export class ChunkedForest implements IEditableForest {
|
|
|
93
113
|
this.roots = this.roots.clone();
|
|
94
114
|
}
|
|
95
115
|
|
|
96
|
-
const
|
|
116
|
+
const forestVisitor = {
|
|
97
117
|
forest: this,
|
|
98
118
|
// Current location in the tree, as a non-shared BasicChunk (TODO: support in-place modification of other chunk formats when possible).
|
|
99
119
|
// Start above root detached sequences.
|
|
100
120
|
mutableChunkStack: [] as StackNode[],
|
|
101
121
|
mutableChunk: this.roots as BasicChunk | undefined,
|
|
102
122
|
getParent(): StackNode {
|
|
103
|
-
assert(this.mutableChunkStack
|
|
104
|
-
return this.mutableChunkStack
|
|
123
|
+
assert(hasSome(this.mutableChunkStack), 0x532 /* invalid access to root's parent */);
|
|
124
|
+
return getLast(this.mutableChunkStack);
|
|
105
125
|
},
|
|
106
126
|
free(): void {
|
|
107
127
|
this.mutableChunk = undefined;
|
|
@@ -262,8 +282,15 @@ export class ChunkedForest implements IEditableForest {
|
|
|
262
282
|
this.mutableChunk = top.mutableChunk;
|
|
263
283
|
},
|
|
264
284
|
};
|
|
265
|
-
|
|
266
|
-
|
|
285
|
+
|
|
286
|
+
const announcedVisitors: AnnouncedVisitor[] = [];
|
|
287
|
+
this.deltaVisitors.forEach((getVisitor) => announcedVisitors.push(getVisitor()));
|
|
288
|
+
const combinedVisitor = combineVisitors(
|
|
289
|
+
[forestVisitor, ...announcedVisitors],
|
|
290
|
+
announcedVisitors,
|
|
291
|
+
);
|
|
292
|
+
this.activeVisitor = combinedVisitor;
|
|
293
|
+
return combinedVisitor;
|
|
267
294
|
}
|
|
268
295
|
|
|
269
296
|
private nextDetachedFieldIdentifier = 0;
|
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
import { assert, oob } from "@fluidframework/core-utils/internal";
|
|
7
7
|
|
|
8
|
-
import type { TreeValue } from "../../../core/index.js";
|
|
8
|
+
import type { TreeValue, TreeChunk } from "../../../core/index.js";
|
|
9
9
|
import { assertValidIndex } from "../../../util/index.js";
|
|
10
10
|
import { type FluidSerializableReadOnly, assertAllowedValue } from "../../valueUtilities.js";
|
|
11
|
-
import type { TreeChunk } from "../chunk.js";
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* Utilities related to chunk encoding and decoding that do not depend on specific chunk types or formats.
|
|
@@ -6,10 +6,14 @@
|
|
|
6
6
|
import { assert, unreachableCase, oob } from "@fluidframework/core-utils/internal";
|
|
7
7
|
|
|
8
8
|
import { DiscriminatedUnionDispatcher } from "../../../codec/index.js";
|
|
9
|
-
import type {
|
|
9
|
+
import type {
|
|
10
|
+
FieldKey,
|
|
11
|
+
TreeNodeSchemaIdentifier,
|
|
12
|
+
Value,
|
|
13
|
+
TreeChunk,
|
|
14
|
+
} from "../../../core/index.js";
|
|
10
15
|
import { assertValidIndex } from "../../../util/index.js";
|
|
11
16
|
import { BasicChunk } from "../basicChunk.js";
|
|
12
|
-
import type { TreeChunk } from "../chunk.js";
|
|
13
17
|
import { emptyChunk } from "../emptyChunk.js";
|
|
14
18
|
import { SequenceChunk } from "../sequenceChunk.js";
|
|
15
19
|
|
|
@@ -7,7 +7,7 @@ import { assert } from "@fluidframework/core-utils/internal";
|
|
|
7
7
|
|
|
8
8
|
import type { DiscriminatedUnionDispatcher } from "../../../codec/index.js";
|
|
9
9
|
import type { BrandedType } from "../../../util/index.js";
|
|
10
|
-
import type { TreeChunk } from "
|
|
10
|
+
import type { TreeChunk } from "../../../core/index.js";
|
|
11
11
|
|
|
12
12
|
import {
|
|
13
13
|
type ChunkDecoder,
|
|
@@ -10,12 +10,14 @@ import {
|
|
|
10
10
|
type FieldUpPath,
|
|
11
11
|
type PathRootPrefix,
|
|
12
12
|
type UpPath,
|
|
13
|
+
type ChunkedCursor,
|
|
14
|
+
type TreeChunk,
|
|
15
|
+
cursorChunk,
|
|
16
|
+
dummyRoot,
|
|
13
17
|
} from "../../core/index.js";
|
|
14
18
|
import { fail } from "../../util/index.js";
|
|
15
19
|
import { prefixFieldPath } from "../treeCursorUtils.js";
|
|
16
20
|
|
|
17
|
-
import { type ChunkedCursor, type TreeChunk, cursorChunk, dummyRoot } from "./chunk.js";
|
|
18
|
-
|
|
19
21
|
/**
|
|
20
22
|
* Chunk that is empty.
|
|
21
23
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { ReferenceCountedBase } from "../../util/index.js";
|
|
7
7
|
|
|
8
8
|
import { BasicChunkCursor } from "./basicChunk.js";
|
|
9
|
-
import { type ChunkedCursor, type TreeChunk, dummyRoot } from "
|
|
9
|
+
import { type ChunkedCursor, type TreeChunk, dummyRoot } from "../../core/index.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* General purpose multi-node sequence chunk.
|
|
@@ -14,11 +14,14 @@ import {
|
|
|
14
14
|
type TreeValue,
|
|
15
15
|
type UpPath,
|
|
16
16
|
type Value,
|
|
17
|
+
type ChunkedCursor,
|
|
18
|
+
type TreeChunk,
|
|
19
|
+
cursorChunk,
|
|
20
|
+
dummyRoot,
|
|
17
21
|
} from "../../core/index.js";
|
|
18
|
-
import { ReferenceCountedBase, fail } from "../../util/index.js";
|
|
22
|
+
import { ReferenceCountedBase, fail, hasSome } from "../../util/index.js";
|
|
19
23
|
import { SynchronousCursor, prefixFieldPath, prefixPath } from "../treeCursorUtils.js";
|
|
20
24
|
|
|
21
|
-
import { type ChunkedCursor, type TreeChunk, cursorChunk, dummyRoot } from "./chunk.js";
|
|
22
25
|
import type { SessionSpaceCompressedId, IIdCompressor } from "@fluidframework/id-compressor";
|
|
23
26
|
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
24
27
|
|
|
@@ -517,12 +520,12 @@ class Cursor extends SynchronousCursor implements ChunkedCursor {
|
|
|
517
520
|
|
|
518
521
|
public firstField(): boolean {
|
|
519
522
|
const fieldsArray = this.nodeInfo(CursorLocationType.Nodes).shape.fieldsArray;
|
|
520
|
-
if (fieldsArray
|
|
523
|
+
if (!hasSome(fieldsArray)) {
|
|
521
524
|
return false;
|
|
522
525
|
}
|
|
523
526
|
this.indexOfField = 0;
|
|
524
527
|
this.mode = CursorLocationType.Fields;
|
|
525
|
-
const fields = fieldsArray[0]
|
|
528
|
+
const fields = fieldsArray[0];
|
|
526
529
|
this.fieldKey = fields[0];
|
|
527
530
|
return true;
|
|
528
531
|
}
|
|
@@ -73,7 +73,10 @@ export function isNodeInSchema(
|
|
|
73
73
|
uncheckedFieldsFromNode.delete(fieldKey);
|
|
74
74
|
}
|
|
75
75
|
// The node has fields that we did not check as part of looking at every field defined in the node's schema
|
|
76
|
-
if (
|
|
76
|
+
if (
|
|
77
|
+
uncheckedFieldsFromNode.size !== 0 &&
|
|
78
|
+
!schemaAndPolicy.policy.allowUnknownOptionalFields(node.type)
|
|
79
|
+
) {
|
|
77
80
|
return SchemaValidationErrors.ObjectNode_FieldNotInSchema;
|
|
78
81
|
}
|
|
79
82
|
} else if (schema instanceof MapNodeStoredSchema) {
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
anchorSlot,
|
|
13
13
|
moveToDetachedField,
|
|
14
14
|
} from "../../core/index.js";
|
|
15
|
-
import type { Listenable } from "
|
|
15
|
+
import type { Listenable } from "@fluidframework/core-interfaces";
|
|
16
16
|
import { type IDisposable, disposeSymbol } from "../../util/index.js";
|
|
17
17
|
import type { NodeKeyManager } from "../node-key/index.js";
|
|
18
18
|
|