@fluidframework/tree 2.0.0-dev-rc.5.0.0.271262 → 2.0.0-dev-rc.5.0.0.272251
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/api-extractor/api-extractor-lint-beta.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-beta.esm.json +5 -0
- package/api-extractor/api-extractor-lint-bundle.json +5 -0
- package/api-extractor/api-extractor-lint-public.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-public.esm.json +5 -0
- package/api-report/tree.alpha.api.md +2 -13
- package/api-report/tree.beta.api.md +2 -13
- package/api-report/tree.public.api.md +2 -13
- package/dist/beta.d.ts +0 -1
- package/dist/codec/codec.js +0 -1
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/discriminatedUnions.js +0 -1
- package/dist/codec/discriminatedUnions.js.map +1 -1
- package/dist/core/change-family/editBuilder.js +0 -2
- package/dist/core/change-family/editBuilder.js.map +1 -1
- package/dist/core/rebase/revisionTagCodec.js +0 -2
- package/dist/core/rebase/revisionTagCodec.js.map +1 -1
- package/dist/core/schema-stored/schema.js +0 -4
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.js +1 -3
- package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/dist/core/schema-view/view.js +0 -2
- package/dist/core/schema-view/view.js.map +1 -1
- package/dist/core/tree/anchorSet.js +46 -51
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +2 -8
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodec.js +0 -3
- package/dist/core/tree/detachedFieldIndexCodec.js.map +1 -1
- package/dist/core/tree/sparseTree.js +11 -15
- package/dist/core/tree/sparseTree.js.map +1 -1
- package/dist/domains/schemaBuilder.js +70 -70
- package/dist/domains/schemaBuilder.js.map +1 -1
- package/dist/events/events.js +1 -2
- package/dist/events/events.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js +1 -14
- package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +6 -13
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +2 -9
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +3 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +13 -3
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +6 -11
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +3 -3
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +2 -5
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +0 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +2 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +4 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +13 -25
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js +5 -8
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.js +0 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +5 -40
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +0 -2
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js +1 -2
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/dist/feature-libraries/editableTreeBinder.js +12 -13
- package/dist/feature-libraries/editableTreeBinder.js.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +11 -12
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +3 -7
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.js +22 -13
- package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +0 -6
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +17 -10
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +1 -6
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +1 -1
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +2 -3
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +7 -7
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js +6 -6
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.js +0 -2
- package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -3
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.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 +2 -2
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +2 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -0
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +39 -24
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/node-key/mockNodeKeyManager.js +4 -2
- package/dist/feature-libraries/node-key/mockNodeKeyManager.js.map +1 -1
- package/dist/feature-libraries/node-key/nodeKeyIndex.js +0 -3
- package/dist/feature-libraries/node-key/nodeKeyIndex.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +28 -23
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.js +5 -3
- package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +1 -5
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/feature-libraries/schemaBuilderBase.js +3 -14
- package/dist/feature-libraries/schemaBuilderBase.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +0 -6
- package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
- package/dist/feature-libraries/sequence-field/markListFactory.js +4 -3
- package/dist/feature-libraries/sequence-field/markListFactory.js.map +1 -1
- package/dist/feature-libraries/sequence-field/markQueue.js +2 -4
- package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.js +20 -20
- package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.js +9 -13
- package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js +4 -23
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/dist/feature-libraries/typed-schema/view.js +0 -7
- package/dist/feature-libraries/typed-schema/view.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- 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/public.d.ts +0 -1
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +10 -27
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +4 -0
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +13 -10
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js +11 -14
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +3 -5
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js +0 -2
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/treeCheckout.js +11 -22
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree/treeView.js +0 -6
- package/dist/shared-tree/treeView.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +18 -0
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +28 -31
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.d.ts +4 -2
- package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.js +19 -15
- package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.js +19 -21
- package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/dist/shared-tree-core/editManager.js +37 -53
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +1 -5
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +16 -24
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.d.ts +11 -1
- package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.js +25 -4
- package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
- package/dist/shared-tree-core/transactionStack.js +3 -1
- package/dist/shared-tree-core/transactionStack.js.map +1 -1
- package/dist/simple-tree/arrayNode.js +34 -26
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +2 -4
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/mapNode.js +5 -5
- package/dist/simple-tree/mapNode.js.map +1 -1
- package/dist/simple-tree/objectNode.js +6 -6
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/schemaFactory.d.ts +18 -5
- package/dist/simple-tree/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/schemaFactory.js +65 -53
- package/dist/simple-tree/schemaFactory.js.map +1 -1
- package/dist/simple-tree/schemaTypes.js +3 -12
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/tree.d.ts +1 -22
- package/dist/simple-tree/tree.d.ts.map +1 -1
- package/dist/simple-tree/tree.js +0 -21
- package/dist/simple-tree/tree.js.map +1 -1
- package/dist/simple-tree/treeNodeApi.d.ts +13 -4
- package/dist/simple-tree/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/treeNodeApi.js +8 -3
- package/dist/simple-tree/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/types.d.ts +26 -6
- package/dist/simple-tree/types.d.ts.map +1 -1
- package/dist/simple-tree/types.js +79 -54
- package/dist/simple-tree/types.js.map +1 -1
- package/dist/treeFactory.js +10 -9
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/brand.js +0 -1
- package/dist/util/brand.js.map +1 -1
- package/dist/util/nestedMap.js +4 -2
- package/dist/util/nestedMap.js.map +1 -1
- package/dist/util/offsetList.js +4 -2
- package/dist/util/offsetList.js.map +1 -1
- package/dist/util/referenceCounting.js +0 -1
- package/dist/util/referenceCounting.js.map +1 -1
- package/dist/util/stackyIterator.js +2 -3
- package/dist/util/stackyIterator.js.map +1 -1
- package/lib/beta.d.ts +0 -1
- package/lib/codec/codec.js +0 -1
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/discriminatedUnions.js +0 -1
- package/lib/codec/discriminatedUnions.js.map +1 -1
- package/lib/core/change-family/editBuilder.js +0 -2
- package/lib/core/change-family/editBuilder.js.map +1 -1
- package/lib/core/rebase/revisionTagCodec.js +0 -2
- package/lib/core/rebase/revisionTagCodec.js.map +1 -1
- package/lib/core/schema-stored/schema.js +0 -4
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.js +1 -3
- package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/lib/core/schema-view/view.js +0 -2
- package/lib/core/schema-view/view.js.map +1 -1
- package/lib/core/tree/anchorSet.js +46 -51
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +2 -8
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodec.js +0 -3
- package/lib/core/tree/detachedFieldIndexCodec.js.map +1 -1
- package/lib/core/tree/sparseTree.js +11 -15
- package/lib/core/tree/sparseTree.js.map +1 -1
- package/lib/domains/schemaBuilder.js +70 -70
- package/lib/domains/schemaBuilder.js.map +1 -1
- package/lib/events/events.js +1 -2
- package/lib/events/events.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js +1 -14
- package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +6 -13
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +2 -9
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +3 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +13 -3
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +6 -11
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +3 -3
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +2 -5
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +0 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +2 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +4 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +13 -25
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js +5 -8
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.js +0 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +5 -40
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +0 -2
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js +1 -2
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/lib/feature-libraries/editableTreeBinder.js +12 -13
- package/lib/feature-libraries/editableTreeBinder.js.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js +11 -12
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +3 -7
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.js +22 -13
- package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +0 -6
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +17 -10
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +1 -6
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +1 -1
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +1 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +7 -7
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js +5 -5
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.js +0 -2
- package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -3
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.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/modularChangeCodecs.js +2 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -0
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +40 -25
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/node-key/mockNodeKeyManager.js +4 -2
- package/lib/feature-libraries/node-key/mockNodeKeyManager.js.map +1 -1
- package/lib/feature-libraries/node-key/nodeKeyIndex.js +0 -3
- package/lib/feature-libraries/node-key/nodeKeyIndex.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +28 -23
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.js +6 -4
- package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +1 -5
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/feature-libraries/schemaBuilderBase.js +3 -14
- package/lib/feature-libraries/schemaBuilderBase.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +0 -6
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/markListFactory.js +4 -3
- package/lib/feature-libraries/sequence-field/markListFactory.js.map +1 -1
- package/lib/feature-libraries/sequence-field/markQueue.js +2 -4
- package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.js +21 -21
- package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.js +9 -13
- package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js +4 -23
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/lib/feature-libraries/typed-schema/view.js +0 -7
- package/lib/feature-libraries/typed-schema/view.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +0 -1
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +10 -27
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +4 -0
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +13 -10
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js +11 -14
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +3 -5
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js +0 -2
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/treeCheckout.js +11 -22
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree/treeView.js +0 -6
- package/lib/shared-tree/treeView.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +18 -0
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +28 -31
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.d.ts +4 -2
- package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.js +19 -15
- package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.js +19 -21
- package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/lib/shared-tree-core/editManager.js +37 -53
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +1 -5
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +16 -24
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.d.ts +11 -1
- package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.js +25 -4
- package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
- package/lib/shared-tree-core/transactionStack.js +3 -1
- package/lib/shared-tree-core/transactionStack.js.map +1 -1
- package/lib/simple-tree/arrayNode.js +34 -26
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +2 -4
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/mapNode.js +5 -5
- package/lib/simple-tree/mapNode.js.map +1 -1
- package/lib/simple-tree/objectNode.js +6 -6
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/schemaFactory.d.ts +18 -5
- package/lib/simple-tree/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/schemaFactory.js +65 -53
- package/lib/simple-tree/schemaFactory.js.map +1 -1
- package/lib/simple-tree/schemaTypes.js +3 -12
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/tree.d.ts +1 -22
- package/lib/simple-tree/tree.d.ts.map +1 -1
- package/lib/simple-tree/tree.js +0 -21
- package/lib/simple-tree/tree.js.map +1 -1
- package/lib/simple-tree/treeNodeApi.d.ts +13 -4
- package/lib/simple-tree/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/treeNodeApi.js +8 -3
- package/lib/simple-tree/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/types.d.ts +26 -6
- package/lib/simple-tree/types.d.ts.map +1 -1
- package/lib/simple-tree/types.js +78 -54
- package/lib/simple-tree/types.js.map +1 -1
- package/lib/treeFactory.js +10 -9
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/brand.js +0 -1
- package/lib/util/brand.js.map +1 -1
- package/lib/util/nestedMap.js +4 -2
- package/lib/util/nestedMap.js.map +1 -1
- package/lib/util/offsetList.js +4 -2
- package/lib/util/offsetList.js.map +1 -1
- package/lib/util/referenceCounting.js +0 -1
- package/lib/util/referenceCounting.js.map +1 -1
- package/lib/util/stackyIterator.js +2 -3
- package/lib/util/stackyIterator.js.map +1 -1
- package/package.json +27 -24
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +22 -6
- package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +2 -2
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +6 -2
- package/src/feature-libraries/chunked-forest/codec/nodeShape.ts +8 -3
- package/src/feature-libraries/index.ts +0 -1
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +6 -7
- package/src/feature-libraries/modular-schema/index.ts +1 -1
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +2 -0
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +55 -23
- package/src/feature-libraries/optional-field/optionalField.ts +3 -3
- package/src/feature-libraries/sequence-field/rebase.ts +15 -33
- package/src/index.ts +0 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/schematizingTreeView.ts +0 -2
- package/src/shared-tree/sharedTree.ts +8 -1
- package/src/shared-tree-core/branch.ts +24 -0
- package/src/shared-tree-core/branchCommitEnricher.ts +15 -6
- package/src/shared-tree-core/sharedTreeCore.ts +9 -0
- package/src/shared-tree-core/transactionEnricher.ts +27 -1
- package/src/simple-tree/arrayNode.ts +17 -17
- package/src/simple-tree/schemaFactory.ts +18 -5
- package/src/simple-tree/tree.ts +1 -26
- package/src/simple-tree/treeNodeApi.ts +25 -7
- package/src/simple-tree/types.ts +57 -9
- package/tsdoc.json +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/view.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,iBAAiB,EAEjB,aAAa,GAKb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAc,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAyB,kBAAkB,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEpG,OAAO,EAA6C,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEnG;;GAEG;AACH,MAAM,OAAO,UAAU;
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/view.ts"],"names":[],"mappings":"AAAA;;;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AAI,iBAAiB,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACK,UAAU,CAAC,QAA+B;QACjD,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAClC,MAAM,KAAK,GAAkC,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YACrE,KAAK,MAAM,WAAW,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC;gBACrD,IAAI,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;oBAClC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;oBAChC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;gBAC/B,CAAC;YACF,CAAC;YAED,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;QACvC,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;IAEO,SAAS,CAAC,QAA8B;QAC/C,sDAAsD;QACtD,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tAdaptedViewSchema,\n\ttype Adapters,\n\tCompatibility,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n} from \"../../core/index.js\";\nimport { type Named, fail } from \"../../util/index.js\";\nimport { type FullSchemaPolicy, allowsRepoSuperset, isNeverTree } from \"../modular-schema/index.js\";\n\nimport { type FlexFieldSchema, type FlexTreeSchema, intoStoredSchema } from \"./typedTreeSchema.js\";\n\n/**\n * A collection of View information for schema, including policy.\n */\nexport class ViewSchema<out TSchema extends FlexFieldSchema = FlexFieldSchema> {\n\t/**\n\t * Cached conversion of `schema` into a stored schema.\n\t */\n\tpublic readonly storedSchema: TreeStoredSchema;\n\tpublic constructor(\n\t\tpublic readonly policy: FullSchemaPolicy,\n\t\tpublic readonly adapters: Adapters,\n\t\tpublic readonly schema: FlexTreeSchema<TSchema>,\n\t) {\n\t\tthis.storedSchema = intoStoredSchema(schema);\n\t}\n\n\t/**\n\t * Determines the compatibility of a stored document\n\t * (based on its stored schema) with a viewer (based on its view schema).\n\t *\n\t * Adapters can be provided to handle differences between the two schema.\n\t * Adapters should only use to types in the `view` SchemaRepository.\n\t *\n\t * TODO: this API violates the parse don't validate design philosophy.\n\t * It should be wrapped with (or replaced by) a parse style API.\n\t */\n\tpublic checkCompatibility(stored: TreeStoredSchema): {\n\t\tread: Compatibility;\n\t\twrite: Compatibility;\n\t\twriteAllowingStoredSchemaUpdates: Compatibility;\n\t} {\n\t\t// TODO: support adapters\n\t\t// const adapted = this.adaptRepo(stored);\n\n\t\tconst read = allowsRepoSuperset(this.policy, stored, this.storedSchema)\n\t\t\t? Compatibility.Compatible\n\t\t\t: // TODO: support adapters\n\t\t\t // : allowsRepoSuperset(this.policy, adapted.adaptedForViewSchema, this.storedSchema)\n\t\t\t // ? Compatibility.RequiresAdapters\n\t\t\t Compatibility.Incompatible;\n\t\t// TODO: Extract subset of adapters that are valid to use on stored\n\t\t// TODO: separate adapters from schema updates\n\t\tconst write = allowsRepoSuperset(this.policy, this.storedSchema, stored)\n\t\t\t? Compatibility.Compatible\n\t\t\t: // TODO: support adapters\n\t\t\t // : allowsRepoSuperset(this.policy, this.storedSchema, adapted.adaptedForViewSchema)\n\t\t\t // TODO: IThis assumes adapters are bidirectional.\n\t\t\t // Compatibility.RequiresAdapters\n\t\t\t Compatibility.Incompatible;\n\n\t\t// TODO: compute this properly (and maybe include the set of schema changes needed for it?).\n\t\t// Maybe updates would happen lazily when needed to store data?\n\t\t// When willingness to updates can avoid need for some adapters,\n\t\t// how should it be decided if the adapter should be used to avoid the update?\n\t\t// TODO: is this case actually bi-variant, making this correct if we did it for each schema independently?\n\t\tlet writeAllowingStoredSchemaUpdates =\n\t\t\t// TODO: This should consider just the updates needed\n\t\t\t// (ex: when view covers a subset of stored after stored has a update to that subset).\n\t\t\tallowsRepoSuperset(this.policy, stored, this.storedSchema)\n\t\t\t\t? Compatibility.Compatible\n\t\t\t\t: // TODO: this assumes adapters can translate in both directions. In general this will not be true.\n\t\t\t\t // TODO: this also assumes that schema updates to the adapted repo would translate to\n\t\t\t\t // updates on the stored schema, which is also likely untrue.\n\t\t\t\t // // TODO: support adapters\n\t\t\t\t // allowsRepoSuperset(this.policy, adapted.adaptedForViewSchema, this.storedSchema)\n\t\t\t\t // ? Compatibility.RequiresAdapters // Requires schema updates. TODO: consider adapters that can update writes.\n\t\t\t\t Compatibility.Incompatible;\n\n\t\t// Since the above does not consider partial updates,\n\t\t// we can improve the tolerance a bit by considering the op-op update:\n\t\twriteAllowingStoredSchemaUpdates = Math.max(writeAllowingStoredSchemaUpdates, write);\n\n\t\treturn { read, write, writeAllowingStoredSchemaUpdates };\n\t}\n\n\t/**\n\t * Compute a schema that `original` could be viewed as using adapters as needed.\n\t *\n\t * TODO: have a way for callers to get invalidated on schema updates.\n\t */\n\tpublic adaptRepo(stored: TreeStoredSchema): AdaptedViewSchema {\n\t\t// Sanity check on adapters:\n\t\t// it's probably a bug it they use the never types,\n\t\t// since there never is a reason to have a never type as an adapter input,\n\t\t// and its impossible for an adapter to be correctly implemented if its output type is never\n\t\t// (unless its input is also never).\n\t\tfor (const adapter of this.adapters?.tree ?? []) {\n\t\t\tif (\n\t\t\t\tisNeverTree(\n\t\t\t\t\tthis.policy,\n\t\t\t\t\tthis.storedSchema,\n\t\t\t\t\tthis.storedSchema.nodeSchema.get(adapter.output),\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tfail(\"tree adapter for stored adapter.output should not be never\");\n\t\t\t}\n\t\t}\n\n\t\tconst adapted = {\n\t\t\trootFieldSchema: this.adaptField(stored.rootFieldSchema),\n\t\t\tnodeSchema: new Map<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>(),\n\t\t};\n\n\t\tfor (const [key, schema] of stored.nodeSchema) {\n\t\t\tconst adapatedTree = this.adaptTree(schema);\n\t\t\tadapted.nodeSchema.set(key, adapatedTree);\n\t\t}\n\n\t\t// TODO: subset these adapters to the ones that were needed/used.\n\t\treturn new AdaptedViewSchema(this.adapters, adapted);\n\t}\n\n\t/**\n\t * Adapt original such that it allows member types which can be adapted to its specified types.\n\t */\n\tprivate adaptField(original: TreeFieldStoredSchema): TreeFieldStoredSchema {\n\t\tif (original.types !== undefined) {\n\t\t\tconst types: Set<TreeNodeSchemaIdentifier> = new Set(original.types);\n\t\t\tfor (const treeAdapter of this.adapters?.tree ?? []) {\n\t\t\t\tif (types.has(treeAdapter.input)) {\n\t\t\t\t\ttypes.delete(treeAdapter.input);\n\t\t\t\t\ttypes.add(treeAdapter.output);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn { kind: original.kind, types };\n\t\t}\n\t\treturn original;\n\t}\n\n\tprivate adaptTree(original: TreeNodeStoredSchema): TreeNodeStoredSchema {\n\t\t// TODO: support adapters like missing field adapters.\n\t\treturn original;\n\t}\n}\n\n/**\n * Record where a schema came from for error reporting purposes.\n * @internal\n */\nexport interface Sourced {\n\treadonly builder: Named<string>;\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { type Listeners, type IsListener, type Listenable, type Off, createEmitt
|
|
|
8
8
|
export { leaf } from "./domains/index.js";
|
|
9
9
|
export { FlexFieldKind, isNeverField, type FullSchemaPolicy, typeNameSymbol, valueSymbol, type ContextuallyTypedNodeDataObject, type ContextuallyTypedNodeData, type MarkedArrayLike, isContextuallyTypedNodeDataObject, defaultSchemaPolicy, jsonableTreeFromCursor, type StableNodeKey, type LocalNodeKey, compareLocalNodeKeys, type IDefaultEditBuilder, type ValueFieldEditBuilder, type OptionalFieldEditBuilder, type SequenceFieldEditBuilder, prefixPath, prefixFieldPath, cursorForJsonableTreeNode, stackTreeNodeCursor, type CursorAdapter, type CursorWithNode, type FlexTreeNodeEvents, type ArrayLikeMut, FieldKinds, type ContextuallyTypedFieldData, cursorFromContextualData, type FlexAllowedTypes, type FlexTreeNodeSchema, type FlexTreeSchema, type SchemaLibrary, type SchemaLibraryData, FlexFieldSchema, Any, type NewFieldContent, type NodeExistsConstraint, cursorForTypedTreeData, type LazyTreeNodeSchema, type FieldGenerator, type TreeDataContext, type SchemaLintConfiguration, TreeStatus, type FlexTreeFieldNode, type FlexibleFieldContent, type FlexibleNodeContent, type FlexTreeLeafNode, type FlexTreeMapNode, type FlexTreeOptionalField, type FlexTreeRequiredField, type FlexTreeSequenceField, type FlexTreeObjectNode, type FlexTreeObjectNodeTyped, type AssignableFieldKinds, type FlexTreeContext, type FlexTreeTypedField, type FlexTreeTypedNode, type FlexTreeTypedNodeUnion, type FlexTreeEntity, type FlexTreeField, type FlexTreeNode, TreeNodeSchemaBase, FlexFieldNodeSchema, LeafNodeSchema, FlexMapNodeSchema, FlexObjectNodeSchema, type CheckTypesOverlap, SchemaBuilderBase, type FlexImplicitFieldSchema, type FlexImplicitAllowedTypes, type Unenforced, schemaIsFieldNode, schemaIsLeaf, schemaIsMap, schemaIsObjectNode, type AllowedTypeSet, type SchemaBuilderOptions, type SchemaCollection, TreeCompressionStrategy, treeSchemaFromStoredSchema, encodeTreeSchema, stackTreeFieldCursor, type FlexTreeUnknownUnboxed, type InsertableFlexNode, type InsertableFlexField, type AllowedTypesToFlexInsertableTree, type ApplyMultiplicity, type NormalizeObjectNodeFields, type NormalizeFieldSchema, type FlexObjectNodeFields, type FlexMapFieldSchema, type LazyItem, type PropertyNameFromFieldKey, type ReservedObjectNodeFieldPropertyNames, type ReservedObjectNodeFieldPropertyNamePrefixes, reservedObjectNodeFieldPropertyNames, reservedObjectNodeFieldPropertyNamePrefixes, type FlexTreeObjectNodeFieldsInner, } from "./feature-libraries/index.js";
|
|
10
10
|
export { type ISharedTree, type ITreeCheckout, type ITransaction, runSynchronous, type SharedTreeOptions, type ITreeCheckoutFork, type CheckoutEvents, type SchematizeConfiguration, type TreeContent, type InitializeAndSchematizeConfiguration, type SchemaConfiguration, ForestType, type SharedTreeContentSnapshot, type FlexTreeView, type ITreeViewFork, buildTreeConfiguration, type ISharedTreeEditor, type ISchemaEditor, type RevertibleFactory, type SharedTreeFormatOptions, SharedTreeFormatVersion, Tree, type TreeApi, type TransactionConstraint, type NodeInDocumentConstraint, type RunTransaction, rollback, } from "./shared-tree/index.js";
|
|
11
|
-
export { TreeArrayNode, type Unhydrated, IterableTreeArrayContent, TreeNode, type TreeArrayNodeBase, type ITree, type TreeNodeSchema,
|
|
11
|
+
export { TreeArrayNode, type Unhydrated, IterableTreeArrayContent, TreeNode, type TreeArrayNodeBase, type ITree, type TreeNodeSchema, TreeViewConfiguration, type ITreeViewConfiguration, type ITreeConfigurationOptions, type TreeView, type TreeViewEvents, SchemaFactory, type ScopedSchemaName, type TreeNodeApi, type ImplicitFieldSchema, type TreeFieldFromImplicitField, type TreeChangeEvents, type NodeFromSchema, type TreeMapNode, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, type, type WithType, type AllowedTypes, FieldKind, FieldSchema, type FieldHasDefault, type FieldHasDefaultUnsafe, type ImplicitAllowedTypes, type InsertableObjectFromSchemaRecord, type InsertableTreeFieldFromImplicitField, type InsertableTypedNode, InternalSimpleTreeTypes, type NodeBuilderData, NodeKind, type ObjectFromSchemaRecord, type TreeObjectNode, type TreeNodeFromImplicitAllowedTypes, type TreeNodeSchemaClass, type TreeNodeSchemaCore, type TreeNodeSchemaNonClass, type SchemaCompatibilityStatus, type DefaultProvider, type FieldProps, type InternalTreeNode, type ValidateRecursiveSchema, type ObjectFromSchemaRecordUnsafe, type TreeObjectNodeUnsafe, type TreeFieldFromImplicitFieldUnsafe, type TreeNodeFromImplicitAllowedTypesUnsafe, type FieldSchemaUnsafe, type InsertableTreeNodeFromImplicitAllowedTypesUnsafe, type TreeArrayNodeUnsafe, type TreeMapNodeUnsafe, type InsertableObjectFromSchemaRecordUnsafe, type InsertableTreeFieldFromImplicitFieldUnsafe, type InsertableTypedNodeUnsafe, type NodeBuilderDataUnsafe, type NodeFromSchemaUnsafe, adaptEnum, enumFromStrings, singletonSchema, typedObjectValues, test_RecursiveObject, test_RecursiveObject_base, test_RecursiveObjectPojoMode, } from "./simple-tree/index.js";
|
|
12
12
|
export { SharedTree, configuredSharedTree } from "./treeFactory.js";
|
|
13
13
|
export type { ICodecOptions, JsonValidator, SchemaValidationFunction } from "./codec/index.js";
|
|
14
14
|
export { noopValidator } from "./codec/index.js";
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,SAAS,EACd,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,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AE,MAAM,kBAAkB,CAAC;AAEpE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,OAAO,EACN,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,WAAW,EACX,KAAK,iBAAiB,EACtB,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,KAAK,EACV,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,WAAW,EAChB,KAAK,iBAAiB,GACtB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAC5B,cAAc,EACd,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,qBAAqB,EAIrB,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,QAAQ,GACb,MAAM,8BAA8B,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -8,7 +8,7 @@ export { createEmitter, } from "./events/index.js";
|
|
|
8
8
|
export { leaf } from "./domains/index.js";
|
|
9
9
|
export { FlexFieldKind, isNeverField, typeNameSymbol, valueSymbol, isContextuallyTypedNodeDataObject, defaultSchemaPolicy, jsonableTreeFromCursor, compareLocalNodeKeys, prefixPath, prefixFieldPath, cursorForJsonableTreeNode, stackTreeNodeCursor, FieldKinds, cursorFromContextualData, FlexFieldSchema, Any, cursorForTypedTreeData, TreeStatus, TreeNodeSchemaBase, FlexFieldNodeSchema, LeafNodeSchema, FlexMapNodeSchema, FlexObjectNodeSchema, SchemaBuilderBase, schemaIsFieldNode, schemaIsLeaf, schemaIsMap, schemaIsObjectNode, TreeCompressionStrategy, treeSchemaFromStoredSchema, encodeTreeSchema, stackTreeFieldCursor, reservedObjectNodeFieldPropertyNames, reservedObjectNodeFieldPropertyNamePrefixes, } from "./feature-libraries/index.js";
|
|
10
10
|
export { runSynchronous, ForestType, buildTreeConfiguration, SharedTreeFormatVersion, Tree, rollback, } from "./shared-tree/index.js";
|
|
11
|
-
export { TreeArrayNode, IterableTreeArrayContent,
|
|
11
|
+
export { TreeArrayNode, IterableTreeArrayContent, TreeViewConfiguration, SchemaFactory, type, FieldKind, FieldSchema, InternalSimpleTreeTypes, NodeKind,
|
|
12
12
|
// experimental @internal APIs:
|
|
13
13
|
adaptEnum, enumFromStrings, singletonSchema, typedObjectValues,
|
|
14
14
|
// test recursive schema for checking that d.ts files handles schema correctly
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EAKR,SAAS,EAiCT,YAAY,EACZ,SAAS,EAET,kBAAkB,EAIlB,oBAAoB,EAOpB,4BAA4B,EAG5B,WAAW,EACX,oBAAoB,EAYpB,UAAU,EAKV,iBAAiB,EAMjB,UAAU,EACV,gBAAgB,EAEhB,4BAA4B,EAC5B,6BAA6B,EAG7B,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,GAEZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAGN,iBAAiB,EACjB,KAAK,EAML,IAAI,EAEJ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AE,MAAM,+BAA+B,CAAC;AAEjE,oKAAoK;AACpK,OAAO,EAIN,WAAW,GAaX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAYN,cAAc,EACd,kBAAkB,EAOlB,qBAAqB,GASrB,MAAM,8BAA8B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tEmptyKey,\n\ttype FieldKey,\n\ttype TreeType,\n\ttype Value,\n\ttype TreeValue,\n\tAnchorSet,\n\ttype DetachedField,\n\ttype UpPath,\n\ttype Range,\n\ttype RangeUpPath,\n\ttype PlaceUpPath,\n\ttype DetachedRangeUpPath,\n\ttype DetachedPlaceUpPath,\n\ttype PlaceIndex,\n\ttype NodeIndex,\n\ttype FieldUpPath,\n\ttype Anchor,\n\ttype RootField,\n\ttype ChildCollection,\n\ttype ChildLocation,\n\ttype DeltaVisitor,\n\ttype AnnouncedVisitor,\n\ttype FieldMapObject,\n\ttype NodeData,\n\ttype GenericTreeNode,\n\ttype JsonableTree,\n\ttype ProtoNodes,\n\ttype DeltaRoot,\n\ttype DeltaProtoNode,\n\ttype DeltaMark,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaFieldMap,\n\ttype DeltaDetachedNodeChanges,\n\ttype DeltaDetachedNodeBuild,\n\ttype DeltaDetachedNodeDestruction,\n\ttype DeltaDetachedNodeRename,\n\ttype DeltaFieldChanges,\n\ttype RevisionTag,\n\trootFieldKey,\n\trootField,\n\ttype ITreeCursor,\n\tCursorLocationType,\n\ttype ITreeCursorSynchronous,\n\ttype GenericFieldsNode,\n\ttype AnchorLocator,\n\tTreeNavigationResult,\n\ttype IEditableForest,\n\ttype IForestSubscription,\n\ttype TreeLocation,\n\ttype FieldLocation,\n\ttype ForestLocation,\n\ttype ITreeSubscriptionCursor,\n\tITreeSubscriptionCursorState,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeFieldStoredSchema,\n\tValueSchema,\n\tTreeNodeStoredSchema,\n\ttype TreeStoredSchemaSubscription,\n\ttype FieldKindIdentifier,\n\ttype TreeTypeSet,\n\ttype TreeStoredSchema,\n\ttype FieldAnchor,\n\ttype SchemaEvents,\n\ttype ChangesetLocalId,\n\ttype ForestEvents,\n\ttype PathRootPrefix,\n\ttype AnchorSlot,\n\ttype AnchorNode,\n\tanchorSlot,\n\ttype UpPathDefault,\n\ttype AnchorEvents,\n\ttype AnchorSetRootEvents,\n\ttype FieldKindData,\n\tAllowedUpdateType,\n\ttype PathVisitor,\n\ttype Adapters,\n\ttype TreeAdapter,\n\ttype MapTree,\n\ttype Revertible,\n\tCommitKind,\n\tRevertibleStatus,\n\ttype CommitMetadata,\n\tforbiddenFieldKindIdentifier,\n\tidentifierFieldKindIdentifier,\n\ttype StoredSchemaCollection,\n\ttype ErasedTreeNodeSchemaDataFormat,\n\tObjectNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tLeafNodeStoredSchema,\n\tMultiplicity,\n\ttype SchemaPolicy,\n} from \"./core/index.js\";\n\nexport {\n\ttype Brand,\n\ttype Opaque,\n\textractFromOpaque,\n\tbrand,\n\ttype ValueFromBranded,\n\ttype NameFromBranded,\n\ttype JsonCompatible,\n\ttype JsonCompatibleObject,\n\ttype NestedMap,\n\tfail,\n\ttype IdAllocator,\n\tTransactionResult,\n\ttype BrandedKey,\n\ttype BrandedMapSubset,\n\ttype RangeQueryResult,\n\ttype Named,\n\toneFromSet,\n\tdisposeSymbol,\n\ttype IDisposable,\n} from \"./util/index.js\";\n\nexport {\n\ttype Listeners,\n\ttype IsListener,\n\ttype Listenable,\n\ttype Off,\n\tcreateEmitter,\n\ttype IEmitter,\n\ttype NoListenersCallback,\n\ttype HasListeners,\n} from \"./events/index.js\";\n\nexport { leaf } from \"./domains/index.js\";\n\nexport {\n\tFlexFieldKind,\n\tisNeverField,\n\ttype FullSchemaPolicy,\n\ttypeNameSymbol,\n\tvalueSymbol,\n\ttype ContextuallyTypedNodeDataObject,\n\ttype ContextuallyTypedNodeData,\n\ttype MarkedArrayLike,\n\tisContextuallyTypedNodeDataObject,\n\tdefaultSchemaPolicy,\n\tjsonableTreeFromCursor,\n\ttype StableNodeKey,\n\ttype LocalNodeKey,\n\tcompareLocalNodeKeys,\n\ttype IDefaultEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\tprefixPath,\n\tprefixFieldPath,\n\tcursorForJsonableTreeNode,\n\tstackTreeNodeCursor,\n\ttype CursorAdapter,\n\ttype CursorWithNode,\n\ttype FlexTreeNodeEvents,\n\ttype ArrayLikeMut,\n\tFieldKinds,\n\ttype ContextuallyTypedFieldData,\n\tcursorFromContextualData,\n\ttype FlexAllowedTypes,\n\ttype FlexTreeNodeSchema,\n\ttype FlexTreeSchema,\n\ttype SchemaLibrary,\n\ttype SchemaLibraryData,\n\tFlexFieldSchema,\n\tAny,\n\ttype NewFieldContent,\n\ttype NodeExistsConstraint,\n\tcursorForTypedTreeData,\n\ttype LazyTreeNodeSchema,\n\ttype FieldGenerator,\n\ttype TreeDataContext,\n\ttype SchemaLintConfiguration,\n\tTreeStatus,\n\ttype FlexTreeFieldNode,\n\ttype FlexibleFieldContent,\n\ttype FlexibleNodeContent,\n\ttype FlexTreeLeafNode,\n\ttype FlexTreeMapNode,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeObjectNode,\n\ttype FlexTreeObjectNodeTyped,\n\ttype AssignableFieldKinds,\n\ttype FlexTreeContext,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeTypedNode,\n\ttype FlexTreeTypedNodeUnion,\n\ttype FlexTreeEntity,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\tTreeNodeSchemaBase,\n\tFlexFieldNodeSchema,\n\tLeafNodeSchema,\n\tFlexMapNodeSchema,\n\tFlexObjectNodeSchema,\n\ttype CheckTypesOverlap,\n\tSchemaBuilderBase,\n\ttype FlexImplicitFieldSchema,\n\ttype FlexImplicitAllowedTypes,\n\ttype Unenforced,\n\tschemaIsFieldNode,\n\tschemaIsLeaf,\n\tschemaIsMap,\n\tschemaIsObjectNode,\n\ttype AllowedTypeSet,\n\ttype SchemaBuilderOptions,\n\ttype SchemaCollection,\n\tTreeCompressionStrategy,\n\ttreeSchemaFromStoredSchema,\n\tencodeTreeSchema,\n\tstackTreeFieldCursor,\n\ttype FlexTreeUnknownUnboxed,\n\ttype InsertableFlexNode,\n\ttype InsertableFlexField,\n\ttype AllowedTypesToFlexInsertableTree,\n\ttype ApplyMultiplicity,\n\ttype NormalizeObjectNodeFields,\n\ttype NormalizeFieldSchema,\n\ttype FlexObjectNodeFields,\n\ttype FlexMapFieldSchema,\n\ttype LazyItem,\n\ttype PropertyNameFromFieldKey,\n\ttype ReservedObjectNodeFieldPropertyNames,\n\ttype ReservedObjectNodeFieldPropertyNamePrefixes,\n\treservedObjectNodeFieldPropertyNames,\n\treservedObjectNodeFieldPropertyNamePrefixes,\n\ttype FlexTreeObjectNodeFieldsInner,\n} from \"./feature-libraries/index.js\";\n\nexport {\n\ttype ISharedTree,\n\ttype ITreeCheckout,\n\ttype ITransaction,\n\trunSynchronous,\n\ttype SharedTreeOptions,\n\ttype ITreeCheckoutFork,\n\ttype CheckoutEvents,\n\ttype SchematizeConfiguration,\n\ttype TreeContent,\n\ttype InitializeAndSchematizeConfiguration,\n\ttype SchemaConfiguration,\n\tForestType,\n\ttype SharedTreeContentSnapshot,\n\ttype FlexTreeView,\n\ttype ITreeViewFork,\n\tbuildTreeConfiguration,\n\ttype ISharedTreeEditor,\n\ttype ISchemaEditor,\n\ttype RevertibleFactory,\n\ttype SharedTreeFormatOptions,\n\tSharedTreeFormatVersion,\n\tTree,\n\ttype TreeApi,\n\ttype TransactionConstraint,\n\ttype NodeInDocumentConstraint,\n\ttype RunTransaction,\n\trollback,\n} from \"./shared-tree/index.js\";\n\nexport {\n\tTreeArrayNode,\n\ttype Unhydrated,\n\tIterableTreeArrayContent,\n\tTreeNode,\n\ttype TreeArrayNodeBase,\n\ttype ITree,\n\ttype TreeNodeSchema,\n\tTreeConfiguration,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype ITreeConfigurationOptions,\n\ttype TreeView,\n\ttype TreeViewEvents,\n\tSchemaFactory,\n\ttype ScopedSchemaName,\n\ttype TreeNodeApi,\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\ttype TreeChangeEvents,\n\ttype NodeFromSchema,\n\ttype TreeMapNode,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\ttype,\n\ttype WithType,\n\ttype AllowedTypes,\n\tFieldKind,\n\tFieldSchema,\n\ttype FieldHasDefault,\n\ttype FieldHasDefaultUnsafe,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InsertableTypedNode,\n\tInternalSimpleTreeTypes,\n\ttype NodeBuilderData,\n\tNodeKind,\n\ttype ObjectFromSchemaRecord,\n\ttype TreeObjectNode,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchemaCore,\n\ttype TreeNodeSchemaNonClass,\n\ttype SchemaCompatibilityStatus,\n\ttype DefaultProvider,\n\ttype FieldProps,\n\ttype InternalTreeNode,\n\n\t// Recursive Schema APIs\n\ttype ValidateRecursiveSchema,\n\ttype ObjectFromSchemaRecordUnsafe,\n\ttype TreeObjectNodeUnsafe,\n\ttype TreeFieldFromImplicitFieldUnsafe,\n\ttype TreeNodeFromImplicitAllowedTypesUnsafe,\n\ttype FieldSchemaUnsafe,\n\ttype InsertableTreeNodeFromImplicitAllowedTypesUnsafe,\n\ttype TreeArrayNodeUnsafe,\n\ttype TreeMapNodeUnsafe,\n\ttype InsertableObjectFromSchemaRecordUnsafe,\n\ttype InsertableTreeFieldFromImplicitFieldUnsafe,\n\ttype InsertableTypedNodeUnsafe,\n\ttype NodeBuilderDataUnsafe,\n\ttype NodeFromSchemaUnsafe,\n\n\t// experimental @internal APIs:\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttypedObjectValues,\n\n\t// test recursive schema for checking that d.ts files handles schema correctly\n\ttest_RecursiveObject,\n\ttest_RecursiveObject_base,\n\ttest_RecursiveObjectPojoMode,\n} from \"./simple-tree/index.js\";\nexport { SharedTree, configuredSharedTree } from \"./treeFactory.js\";\n\nexport type { ICodecOptions, JsonValidator, SchemaValidationFunction } from \"./codec/index.js\";\nexport { noopValidator } from \"./codec/index.js\";\nexport { typeboxValidator } from \"./external-utilities/index.js\";\n\n// TODO: When previously tagged '@internal', these types could not be included in `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639\nexport {\n\ttype Invariant,\n\ttype Contravariant,\n\ttype Covariant,\n\tBrandedType,\n\ttype ExtractFromOpaque,\n\ttype Assume,\n\ttype AllowOptional,\n\ttype RequiredFields,\n\ttype OptionalFields,\n\ttype _RecursiveTrick,\n\ttype AllowOptionalNotFlattened,\n\ttype isAny,\n\ttype BrandedKeyContent,\n\ttype RestrictiveReadonlyRecord,\n\ttype MakeNominal,\n\ttype InternalUtilTypes,\n} from \"./util/index.js\";\n\nexport {\n\ttype NormalizeField,\n\ttype NormalizeAllowedTypes,\n\ttype FlexTreeTypedFieldInner,\n\ttype FlexTreeUnboxFieldInner,\n\ttype FlexTreeObjectNodeFields,\n\ttype FlexTreeUnboxField,\n\ttype FlexTreeUnboxNode,\n\ttype FlexTreeUnboxNodeUnion,\n\ttype FlexTreeNodeKeyField,\n\ttype IsArrayOfOne,\n\ttype FlexibleNodeSubSequence,\n\tflexTreeMarker,\n\tFlexTreeEntityKind,\n\ttype NodeKeyManager,\n\ttype CollectOptions,\n\ttype TypedFields,\n\ttype UnbrandedName,\n\ttype EmptyObject,\n\ttype FlexList,\n\tInternalFlexListTypes,\n\n\t// These field kind types really only need to show up via FieldKinds.name, and not as top level names in the package.\n\t// These names also are collision prone.\n\ttype Required,\n\ttype Optional,\n\ttype Identifier,\n\ttype Forbidden,\n\ttype Sequence,\n} from \"./feature-libraries/index.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EAKR,SAAS,EAiCT,YAAY,EACZ,SAAS,EAET,kBAAkB,EAIlB,oBAAoB,EAOpB,4BAA4B,EAG5B,WAAW,EACX,oBAAoB,EAYpB,UAAU,EAKV,iBAAiB,EAMjB,UAAU,EACV,gBAAgB,EAEhB,4BAA4B,EAC5B,6BAA6B,EAG7B,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,GAEZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAGN,iBAAiB,EACjB,KAAK,EAML,IAAI,EAEJ,iBAAiB,EAKjB,UAAU,EACV,aAAa,GAEb,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAKN,aAAa,GAIb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EACN,aAAa,EACb,YAAY,EAEZ,cAAc,EACd,WAAW,EAIX,iCAAiC,EACjC,mBAAmB,EACnB,sBAAsB,EAGtB,oBAAoB,EAKpB,UAAU,EACV,eAAe,EACf,yBAAyB,EACzB,mBAAmB,EAKnB,UAAU,EAEV,wBAAwB,EAMxB,eAAe,EACf,GAAG,EAGH,sBAAsB,EAKtB,UAAU,EAmBV,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EAEpB,iBAAiB,EAIjB,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,kBAAkB,EAIlB,uBAAuB,EACvB,0BAA0B,EAC1B,gBAAgB,EAChB,oBAAoB,EAcpB,oCAAoC,EACpC,2CAA2C,GAE3C,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAIN,cAAc,EAQd,UAAU,EAIV,sBAAsB,EAKtB,uBAAuB,EACvB,IAAI,EAKJ,QAAQ,GACR,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACN,aAAa,EAEb,wBAAwB,EAKxB,qBAAqB,EAKrB,aAAa,EAUb,IAAI,EAGJ,SAAS,EACT,WAAW,EAOX,uBAAuB,EAEvB,QAAQ;AA4BR,+BAA+B;AAC/B,SAAS,EACT,eAAe,EACf,eAAe,EACf,iBAAiB;AAEjB,8EAA8E;AAC9E,oBAAoB,EACpB,yBAAyB,EACzB,4BAA4B,GAC5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAGpE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,oKAAoK;AACpK,OAAO,EAIN,WAAW,GAaX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAYN,cAAc,EACd,kBAAkB,EAOlB,qBAAqB,GASrB,MAAM,8BAA8B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tEmptyKey,\n\ttype FieldKey,\n\ttype TreeType,\n\ttype Value,\n\ttype TreeValue,\n\tAnchorSet,\n\ttype DetachedField,\n\ttype UpPath,\n\ttype Range,\n\ttype RangeUpPath,\n\ttype PlaceUpPath,\n\ttype DetachedRangeUpPath,\n\ttype DetachedPlaceUpPath,\n\ttype PlaceIndex,\n\ttype NodeIndex,\n\ttype FieldUpPath,\n\ttype Anchor,\n\ttype RootField,\n\ttype ChildCollection,\n\ttype ChildLocation,\n\ttype DeltaVisitor,\n\ttype AnnouncedVisitor,\n\ttype FieldMapObject,\n\ttype NodeData,\n\ttype GenericTreeNode,\n\ttype JsonableTree,\n\ttype ProtoNodes,\n\ttype DeltaRoot,\n\ttype DeltaProtoNode,\n\ttype DeltaMark,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaFieldMap,\n\ttype DeltaDetachedNodeChanges,\n\ttype DeltaDetachedNodeBuild,\n\ttype DeltaDetachedNodeDestruction,\n\ttype DeltaDetachedNodeRename,\n\ttype DeltaFieldChanges,\n\ttype RevisionTag,\n\trootFieldKey,\n\trootField,\n\ttype ITreeCursor,\n\tCursorLocationType,\n\ttype ITreeCursorSynchronous,\n\ttype GenericFieldsNode,\n\ttype AnchorLocator,\n\tTreeNavigationResult,\n\ttype IEditableForest,\n\ttype IForestSubscription,\n\ttype TreeLocation,\n\ttype FieldLocation,\n\ttype ForestLocation,\n\ttype ITreeSubscriptionCursor,\n\tITreeSubscriptionCursorState,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeFieldStoredSchema,\n\tValueSchema,\n\tTreeNodeStoredSchema,\n\ttype TreeStoredSchemaSubscription,\n\ttype FieldKindIdentifier,\n\ttype TreeTypeSet,\n\ttype TreeStoredSchema,\n\ttype FieldAnchor,\n\ttype SchemaEvents,\n\ttype ChangesetLocalId,\n\ttype ForestEvents,\n\ttype PathRootPrefix,\n\ttype AnchorSlot,\n\ttype AnchorNode,\n\tanchorSlot,\n\ttype UpPathDefault,\n\ttype AnchorEvents,\n\ttype AnchorSetRootEvents,\n\ttype FieldKindData,\n\tAllowedUpdateType,\n\ttype PathVisitor,\n\ttype Adapters,\n\ttype TreeAdapter,\n\ttype MapTree,\n\ttype Revertible,\n\tCommitKind,\n\tRevertibleStatus,\n\ttype CommitMetadata,\n\tforbiddenFieldKindIdentifier,\n\tidentifierFieldKindIdentifier,\n\ttype StoredSchemaCollection,\n\ttype ErasedTreeNodeSchemaDataFormat,\n\tObjectNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tLeafNodeStoredSchema,\n\tMultiplicity,\n\ttype SchemaPolicy,\n} from \"./core/index.js\";\n\nexport {\n\ttype Brand,\n\ttype Opaque,\n\textractFromOpaque,\n\tbrand,\n\ttype ValueFromBranded,\n\ttype NameFromBranded,\n\ttype JsonCompatible,\n\ttype JsonCompatibleObject,\n\ttype NestedMap,\n\tfail,\n\ttype IdAllocator,\n\tTransactionResult,\n\ttype BrandedKey,\n\ttype BrandedMapSubset,\n\ttype RangeQueryResult,\n\ttype Named,\n\toneFromSet,\n\tdisposeSymbol,\n\ttype IDisposable,\n} from \"./util/index.js\";\n\nexport {\n\ttype Listeners,\n\ttype IsListener,\n\ttype Listenable,\n\ttype Off,\n\tcreateEmitter,\n\ttype IEmitter,\n\ttype NoListenersCallback,\n\ttype HasListeners,\n} from \"./events/index.js\";\n\nexport { leaf } from \"./domains/index.js\";\n\nexport {\n\tFlexFieldKind,\n\tisNeverField,\n\ttype FullSchemaPolicy,\n\ttypeNameSymbol,\n\tvalueSymbol,\n\ttype ContextuallyTypedNodeDataObject,\n\ttype ContextuallyTypedNodeData,\n\ttype MarkedArrayLike,\n\tisContextuallyTypedNodeDataObject,\n\tdefaultSchemaPolicy,\n\tjsonableTreeFromCursor,\n\ttype StableNodeKey,\n\ttype LocalNodeKey,\n\tcompareLocalNodeKeys,\n\ttype IDefaultEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\tprefixPath,\n\tprefixFieldPath,\n\tcursorForJsonableTreeNode,\n\tstackTreeNodeCursor,\n\ttype CursorAdapter,\n\ttype CursorWithNode,\n\ttype FlexTreeNodeEvents,\n\ttype ArrayLikeMut,\n\tFieldKinds,\n\ttype ContextuallyTypedFieldData,\n\tcursorFromContextualData,\n\ttype FlexAllowedTypes,\n\ttype FlexTreeNodeSchema,\n\ttype FlexTreeSchema,\n\ttype SchemaLibrary,\n\ttype SchemaLibraryData,\n\tFlexFieldSchema,\n\tAny,\n\ttype NewFieldContent,\n\ttype NodeExistsConstraint,\n\tcursorForTypedTreeData,\n\ttype LazyTreeNodeSchema,\n\ttype FieldGenerator,\n\ttype TreeDataContext,\n\ttype SchemaLintConfiguration,\n\tTreeStatus,\n\ttype FlexTreeFieldNode,\n\ttype FlexibleFieldContent,\n\ttype FlexibleNodeContent,\n\ttype FlexTreeLeafNode,\n\ttype FlexTreeMapNode,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeObjectNode,\n\ttype FlexTreeObjectNodeTyped,\n\ttype AssignableFieldKinds,\n\ttype FlexTreeContext,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeTypedNode,\n\ttype FlexTreeTypedNodeUnion,\n\ttype FlexTreeEntity,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\tTreeNodeSchemaBase,\n\tFlexFieldNodeSchema,\n\tLeafNodeSchema,\n\tFlexMapNodeSchema,\n\tFlexObjectNodeSchema,\n\ttype CheckTypesOverlap,\n\tSchemaBuilderBase,\n\ttype FlexImplicitFieldSchema,\n\ttype FlexImplicitAllowedTypes,\n\ttype Unenforced,\n\tschemaIsFieldNode,\n\tschemaIsLeaf,\n\tschemaIsMap,\n\tschemaIsObjectNode,\n\ttype AllowedTypeSet,\n\ttype SchemaBuilderOptions,\n\ttype SchemaCollection,\n\tTreeCompressionStrategy,\n\ttreeSchemaFromStoredSchema,\n\tencodeTreeSchema,\n\tstackTreeFieldCursor,\n\ttype FlexTreeUnknownUnboxed,\n\ttype InsertableFlexNode,\n\ttype InsertableFlexField,\n\ttype AllowedTypesToFlexInsertableTree,\n\ttype ApplyMultiplicity,\n\ttype NormalizeObjectNodeFields,\n\ttype NormalizeFieldSchema,\n\ttype FlexObjectNodeFields,\n\ttype FlexMapFieldSchema,\n\ttype LazyItem,\n\ttype PropertyNameFromFieldKey,\n\ttype ReservedObjectNodeFieldPropertyNames,\n\ttype ReservedObjectNodeFieldPropertyNamePrefixes,\n\treservedObjectNodeFieldPropertyNames,\n\treservedObjectNodeFieldPropertyNamePrefixes,\n\ttype FlexTreeObjectNodeFieldsInner,\n} from \"./feature-libraries/index.js\";\n\nexport {\n\ttype ISharedTree,\n\ttype ITreeCheckout,\n\ttype ITransaction,\n\trunSynchronous,\n\ttype SharedTreeOptions,\n\ttype ITreeCheckoutFork,\n\ttype CheckoutEvents,\n\ttype SchematizeConfiguration,\n\ttype TreeContent,\n\ttype InitializeAndSchematizeConfiguration,\n\ttype SchemaConfiguration,\n\tForestType,\n\ttype SharedTreeContentSnapshot,\n\ttype FlexTreeView,\n\ttype ITreeViewFork,\n\tbuildTreeConfiguration,\n\ttype ISharedTreeEditor,\n\ttype ISchemaEditor,\n\ttype RevertibleFactory,\n\ttype SharedTreeFormatOptions,\n\tSharedTreeFormatVersion,\n\tTree,\n\ttype TreeApi,\n\ttype TransactionConstraint,\n\ttype NodeInDocumentConstraint,\n\ttype RunTransaction,\n\trollback,\n} from \"./shared-tree/index.js\";\n\nexport {\n\tTreeArrayNode,\n\ttype Unhydrated,\n\tIterableTreeArrayContent,\n\tTreeNode,\n\ttype TreeArrayNodeBase,\n\ttype ITree,\n\ttype TreeNodeSchema,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype ITreeConfigurationOptions,\n\ttype TreeView,\n\ttype TreeViewEvents,\n\tSchemaFactory,\n\ttype ScopedSchemaName,\n\ttype TreeNodeApi,\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\ttype TreeChangeEvents,\n\ttype NodeFromSchema,\n\ttype TreeMapNode,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\ttype,\n\ttype WithType,\n\ttype AllowedTypes,\n\tFieldKind,\n\tFieldSchema,\n\ttype FieldHasDefault,\n\ttype FieldHasDefaultUnsafe,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InsertableTypedNode,\n\tInternalSimpleTreeTypes,\n\ttype NodeBuilderData,\n\tNodeKind,\n\ttype ObjectFromSchemaRecord,\n\ttype TreeObjectNode,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchemaCore,\n\ttype TreeNodeSchemaNonClass,\n\ttype SchemaCompatibilityStatus,\n\ttype DefaultProvider,\n\ttype FieldProps,\n\ttype InternalTreeNode,\n\n\t// Recursive Schema APIs\n\ttype ValidateRecursiveSchema,\n\ttype ObjectFromSchemaRecordUnsafe,\n\ttype TreeObjectNodeUnsafe,\n\ttype TreeFieldFromImplicitFieldUnsafe,\n\ttype TreeNodeFromImplicitAllowedTypesUnsafe,\n\ttype FieldSchemaUnsafe,\n\ttype InsertableTreeNodeFromImplicitAllowedTypesUnsafe,\n\ttype TreeArrayNodeUnsafe,\n\ttype TreeMapNodeUnsafe,\n\ttype InsertableObjectFromSchemaRecordUnsafe,\n\ttype InsertableTreeFieldFromImplicitFieldUnsafe,\n\ttype InsertableTypedNodeUnsafe,\n\ttype NodeBuilderDataUnsafe,\n\ttype NodeFromSchemaUnsafe,\n\n\t// experimental @internal APIs:\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttypedObjectValues,\n\n\t// test recursive schema for checking that d.ts files handles schema correctly\n\ttest_RecursiveObject,\n\ttest_RecursiveObject_base,\n\ttest_RecursiveObjectPojoMode,\n} from \"./simple-tree/index.js\";\nexport { SharedTree, configuredSharedTree } from \"./treeFactory.js\";\n\nexport type { ICodecOptions, JsonValidator, SchemaValidationFunction } from \"./codec/index.js\";\nexport { noopValidator } from \"./codec/index.js\";\nexport { typeboxValidator } from \"./external-utilities/index.js\";\n\n// TODO: When previously tagged '@internal', these types could not be included in `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639\nexport {\n\ttype Invariant,\n\ttype Contravariant,\n\ttype Covariant,\n\tBrandedType,\n\ttype ExtractFromOpaque,\n\ttype Assume,\n\ttype AllowOptional,\n\ttype RequiredFields,\n\ttype OptionalFields,\n\ttype _RecursiveTrick,\n\ttype AllowOptionalNotFlattened,\n\ttype isAny,\n\ttype BrandedKeyContent,\n\ttype RestrictiveReadonlyRecord,\n\ttype MakeNominal,\n\ttype InternalUtilTypes,\n} from \"./util/index.js\";\n\nexport {\n\ttype NormalizeField,\n\ttype NormalizeAllowedTypes,\n\ttype FlexTreeTypedFieldInner,\n\ttype FlexTreeUnboxFieldInner,\n\ttype FlexTreeObjectNodeFields,\n\ttype FlexTreeUnboxField,\n\ttype FlexTreeUnboxNode,\n\ttype FlexTreeUnboxNodeUnion,\n\ttype FlexTreeNodeKeyField,\n\ttype IsArrayOfOne,\n\ttype FlexibleNodeSubSequence,\n\tflexTreeMarker,\n\tFlexTreeEntityKind,\n\ttype NodeKeyManager,\n\ttype CollectOptions,\n\ttype TypedFields,\n\ttype UnbrandedName,\n\ttype EmptyObject,\n\ttype FlexList,\n\tInternalFlexListTypes,\n\n\t// These field kind types really only need to show up via FieldKinds.name, and not as top level names in the package.\n\t// These names also are collision prone.\n\ttype Required,\n\ttype Optional,\n\ttype Identifier,\n\ttype Forbidden,\n\ttype Sequence,\n} from \"./feature-libraries/index.js\";\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/tree";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-dev-rc.5.0.0.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-dev-rc.5.0.0.272251";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export const pkgName = "@fluidframework/tree";
|
|
8
|
-
export const pkgVersion = "2.0.0-dev-rc.5.0.0.
|
|
8
|
+
export const pkgVersion = "2.0.0-dev-rc.5.0.0.272251";
|
|
9
9
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,sBAAsB,CAAC;AAC9C,MAAM,CAAC,MAAM,UAAU,GAAG,2BAA2B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/tree\";\nexport const pkgVersion = \"2.0.0-dev-rc.5.0.0.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,sBAAsB,CAAC;AAC9C,MAAM,CAAC,MAAM,UAAU,GAAG,2BAA2B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/tree\";\nexport const pkgVersion = \"2.0.0-dev-rc.5.0.0.272251\";\n"]}
|
package/lib/public.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schematizingTreeView.d.ts","sourceRoot":"","sources":["../../src/shared-tree/schematizingTreeView.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,UAAU,EAEf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,UAAU,EAGV,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEN,K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SimpleTreeView {
|
|
18
|
-
checkout;
|
|
19
|
-
config;
|
|
20
|
-
nodeKeyManager;
|
|
21
|
-
/**
|
|
22
|
-
* The view is set to undefined when this object is disposed or the view schema does not support viewing the document's stored schema.
|
|
23
|
-
*
|
|
24
|
-
* The view schema may be incompatible with the stored schema. Use `compatibility` to check.
|
|
25
|
-
*/
|
|
26
|
-
view;
|
|
27
|
-
/**
|
|
28
|
-
* Undefined iff uninitialized or disposed.
|
|
29
|
-
*/
|
|
30
|
-
currentCompatibility;
|
|
31
|
-
flexConfig;
|
|
32
|
-
events = createEmitter();
|
|
33
|
-
viewSchema;
|
|
34
|
-
unregisterCallbacks = new Set();
|
|
35
|
-
disposed = false;
|
|
36
|
-
/**
|
|
37
|
-
* This is set to true while an edit impacting the document schema is in progress.
|
|
38
|
-
* This allows suppressing extra rootChanged / schemaChanged events until the edit concludes.
|
|
39
|
-
* This is useful especially for some initialization edits, since document initialization can involve transient schemas
|
|
40
|
-
* which are implementation details and should not be exposed to the user.
|
|
41
|
-
*/
|
|
42
|
-
midUpgrade = false;
|
|
43
|
-
rootFieldSchema;
|
|
44
18
|
constructor(checkout,
|
|
45
19
|
// eslint-disable-next-line import/no-deprecated
|
|
46
20
|
config, nodeKeyManager) {
|
|
47
21
|
this.checkout = checkout;
|
|
48
22
|
this.config = config;
|
|
49
23
|
this.nodeKeyManager = nodeKeyManager;
|
|
24
|
+
this.events = createEmitter();
|
|
25
|
+
this.unregisterCallbacks = new Set();
|
|
26
|
+
this.disposed = false;
|
|
27
|
+
/**
|
|
28
|
+
* This is set to true while an edit impacting the document schema is in progress.
|
|
29
|
+
* This allows suppressing extra rootChanged / schemaChanged events until the edit concludes.
|
|
30
|
+
* This is useful especially for some initialization edits, since document initialization can involve transient schemas
|
|
31
|
+
* which are implementation details and should not be exposed to the user.
|
|
32
|
+
*/
|
|
33
|
+
this.midUpgrade = false;
|
|
50
34
|
const policy = {
|
|
51
35
|
...defaultSchemaPolicy,
|
|
52
36
|
validateSchema: config.enableSchemaValidation,
|
|
@@ -161,7 +145,6 @@ export class SchematizingSimpleTreeView {
|
|
|
161
145
|
lastRoot = this.root;
|
|
162
146
|
this.events.emit("rootChanged");
|
|
163
147
|
}
|
|
164
|
-
this.events.emit("afterBatch");
|
|
165
148
|
});
|
|
166
149
|
const onViewDispose = () => {
|
|
167
150
|
cleanupCheckOutEvents();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schematizingTreeView.js","sourceRoot":"","sources":["../../src/shared-tree/schematizingTreeView.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAIN,aAAa,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGN,UAAU,EACV,mBAAmB,EACnB,WAAW,GACX,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAUN,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,oBAAoB,EAEpB,wBAAwB,GAExB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAoB,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEhG,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,0BAA0B;IAmCrB;IAEA;IACA;IAnCjB;;;;OAIG;IACK,IAAI,CAAoD;IAEhE;;OAEG;IACK,oBAAoB,CAAwC;IACnD,UAAU,CAAc;IACzB,MAAM,GAEU,aAAa,EAAE,CAAC;IAE/B,UAAU,CAAa;IAEvB,mBAAmB,GAAG,IAAI,GAAG,EAAc,CAAC;IAEtD,QAAQ,GAAG,KAAK,CAAC;IACxB;;;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EH,OAAO,IAAI,CAAC;AACb,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { AllowedUpdateType, Compatibility } from \"../core/index.js\";\nimport {\n\ttype HasListeners,\n\ttype IEmitter,\n\ttype Listenable,\n\tcreateEmitter,\n} from \"../events/index.js\";\nimport {\n\ttype FlexFieldSchema,\n\ttype NodeKeyManager,\n\tViewSchema,\n\tdefaultSchemaPolicy,\n\tContextSlot,\n} from \"../feature-libraries/index.js\";\nimport {\n\ttype FieldSchema,\n\ttype ImplicitFieldSchema,\n\ttype SchemaCompatibilityStatus,\n\ttype InsertableTreeFieldFromImplicitField,\n\t// eslint-disable-next-line import/no-deprecated\n\ttype TreeConfiguration,\n\ttype TreeFieldFromImplicitField,\n\ttype TreeView,\n\ttype TreeViewEvents,\n\tgetProxyForField,\n\ttoFlexConfig,\n\tsetField,\n\tnormalizeFieldSchema,\n\ttype InsertableContent,\n\tcursorFromUnhydratedRoot,\n\ttype TreeViewConfiguration,\n} from \"../simple-tree/index.js\";\nimport { disposeSymbol } from \"../util/index.js\";\n\nimport { type TreeContent, canInitialize, ensureSchema, initialize } from \"./schematizeTree.js\";\nimport type { TreeCheckout } from \"./treeCheckout.js\";\nimport { CheckoutFlexTreeView } from \"./treeView.js\";\n\n/**\n * Implementation of TreeView wrapping a FlexTreeView.\n */\nexport class SchematizingSimpleTreeView<in out TRootSchema extends ImplicitFieldSchema>\n\timplements TreeView<TRootSchema>\n{\n\t/**\n\t * The view is set to undefined when this object is disposed or the view schema does not support viewing the document's stored schema.\n\t *\n\t * The view schema may be incompatible with the stored schema. Use `compatibility` to check.\n\t */\n\tprivate view: CheckoutFlexTreeView<FlexFieldSchema> | undefined;\n\n\t/**\n\t * Undefined iff uninitialized or disposed.\n\t */\n\tprivate currentCompatibility: SchemaCompatibilityStatus | undefined;\n\tprivate readonly flexConfig: TreeContent;\n\tpublic readonly events: Listenable<TreeViewEvents> &\n\t\tIEmitter<TreeViewEvents> &\n\t\tHasListeners<TreeViewEvents> = createEmitter();\n\n\tprivate readonly viewSchema: ViewSchema;\n\n\tprivate readonly unregisterCallbacks = new Set<() => void>();\n\n\tpublic disposed = false;\n\t/**\n\t * This is set to true while an edit impacting the document schema is in progress.\n\t * This allows suppressing extra rootChanged / schemaChanged events until the edit concludes.\n\t * This is useful especially for some initialization edits, since document initialization can involve transient schemas\n\t * which are implementation details and should not be exposed to the user.\n\t */\n\tprivate midUpgrade = false;\n\n\tprivate readonly rootFieldSchema: FieldSchema;\n\n\tpublic constructor(\n\t\tpublic readonly checkout: TreeCheckout,\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tpublic readonly config: TreeConfiguration<TRootSchema> | TreeViewConfiguration<TRootSchema>,\n\t\tpublic readonly nodeKeyManager: NodeKeyManager,\n\t) {\n\t\tconst policy = {\n\t\t\t...defaultSchemaPolicy,\n\t\t\tvalidateSchema: config.enableSchemaValidation,\n\t\t};\n\t\tthis.rootFieldSchema = normalizeFieldSchema(config.schema);\n\t\tthis.flexConfig = toFlexConfig(config, nodeKeyManager, {\n\t\t\tschema: checkout.storedSchema,\n\t\t\tpolicy,\n\t\t});\n\t\tthis.viewSchema = new ViewSchema(policy, {}, this.flexConfig.schema);\n\t\t// This must be initialized before `update` can be called.\n\t\tthis.currentCompatibility = {\n\t\t\tcanView: false,\n\t\t\tcanUpgrade: true,\n\t\t\tisEquivalent: false,\n\t\t\tcanInitialize: true,\n\t\t};\n\t\tthis.update();\n\n\t\tthis.unregisterCallbacks.add(\n\t\t\tthis.checkout.events.on(\"commitApplied\", (data, getRevertible) =>\n\t\t\t\tthis.events.emit(\"commitApplied\", data, getRevertible),\n\t\t\t),\n\t\t);\n\t}\n\n\tpublic initialize(content: InsertableTreeFieldFromImplicitField<TRootSchema>): void {\n\t\tthis.ensureUndisposed();\n\n\t\tconst compatibility = this.compatibility;\n\t\tif (!compatibility.canInitialize) {\n\t\t\tthrow new UsageError(\"Tree cannot be initialized more than once.\");\n\t\t}\n\n\t\tthis.runSchemaEdit(() => {\n\t\t\tinitialize(this.checkout, {\n\t\t\t\tschema: this.flexConfig.schema,\n\t\t\t\tinitialTree:\n\t\t\t\t\tcontent === undefined\n\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t: cursorFromUnhydratedRoot(\n\t\t\t\t\t\t\t\tthis.config.schema,\n\t\t\t\t\t\t\t\tcontent,\n\t\t\t\t\t\t\t\tthis.nodeKeyManager,\n\t\t\t\t\t\t ),\n\t\t\t});\n\t\t});\n\t}\n\n\tpublic upgradeSchema(): void {\n\t\tthis.ensureUndisposed();\n\n\t\tconst compatibility = this.compatibility;\n\t\tif (compatibility.isEquivalent) {\n\t\t\t// No-op\n\t\t\treturn;\n\t\t}\n\n\t\tif (!compatibility.canUpgrade) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"Existing stored schema can not be upgraded (see TreeView.compatibility.canUpgrade).\",\n\t\t\t);\n\t\t}\n\n\t\tthis.runSchemaEdit(() => {\n\t\t\tconst result = ensureSchema(\n\t\t\t\tthis.viewSchema,\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tAllowedUpdateType.SchemaCompatible | AllowedUpdateType.Initialize,\n\t\t\t\tthis.checkout,\n\t\t\t\tthis.flexConfig,\n\t\t\t);\n\t\t\tassert(result, 0x8bf /* Schema upgrade should always work if canUpgrade is set. */);\n\t\t});\n\t}\n\n\t/**\n\t * Gets the view. Throws when disposed.\n\t */\n\tpublic getView(): CheckoutFlexTreeView<FlexFieldSchema> {\n\t\tthis.ensureUndisposed();\n\t\tassert(this.view !== undefined, 0x8c0 /* unexpected getViewOrError */);\n\t\treturn this.view;\n\t}\n\n\tprivate ensureUndisposed(): void {\n\t\tif (this.disposed) {\n\t\t\tthis.failDisposed();\n\t\t}\n\t}\n\n\tprivate failDisposed(): never {\n\t\tthrow new UsageError(\"Accessed a disposed TreeView.\");\n\t}\n\n\t/**\n\t * Updates `this.view` and the current compatibility status.\n\t * Invoked during initialization and when `this.view` needs to be replaced due to stored schema changes.\n\t * Handles re-registering for events to call update in the future.\n\t * @remarks\n\t * This does not check if the view needs to be replaced, it replaces it unconditionally:\n\t * callers should do any checking to detect if it's really needed before calling `update`.\n\t * @privateRemarks\n\t * This implementation avoids making any edits, which prevents it from being invoked reentrantly.\n\t * If implicit initialization (or some other edit) is desired, it should be done outside of this method.\n\t */\n\tprivate update(): void {\n\t\tthis.disposeView();\n\n\t\tconst result = this.viewSchema.checkCompatibility(this.checkout.storedSchema);\n\n\t\t// TODO: AB#8121: Weaken this check to support viewing under additional circumstances.\n\t\t// In the near term, this should support viewing documents with additional optional fields in their schema on object types.\n\t\t// Longer-term (as demand arises), we could also add APIs to constructing view schema to allow for more flexibility\n\t\t// (e.g. out-of-schema content handlers could allow support for viewing docs which have extra allowed types in a particular field)\n\t\tconst canView =\n\t\t\tresult.write === Compatibility.Compatible && result.read === Compatibility.Compatible;\n\t\tconst canUpgrade = result.read === Compatibility.Compatible;\n\t\tconst isEquivalent = canView && canUpgrade;\n\t\tconst compatibility: SchemaCompatibilityStatus = {\n\t\t\tcanView,\n\t\t\tcanUpgrade,\n\t\t\tisEquivalent,\n\t\t\tcanInitialize: canInitialize(this.checkout),\n\t\t};\n\t\tlet lastRoot =\n\t\t\tthis.compatibility.canView && this.view !== undefined ? this.root : undefined;\n\t\tthis.currentCompatibility = compatibility;\n\n\t\tif (compatibility.canView) {\n\t\t\t// Trigger \"rootChanged\" if the root changes in the future.\n\t\t\t// Currently there is no good way to do this as FlexTreeField has no events for changes.\n\t\t\t// this.view.flexTree.on(????)\n\t\t\t// As a workaround for the above, trigger \"rootChanged\" in \"afterBatch\"\n\t\t\t// which isn't the correct time since we normally do events during the batch when the forest is modified, but its better than nothing.\n\t\t\t// TODO: provide a better event: this.view.flexTree.on(????)\n\t\t\tconst cleanupCheckOutEvents = this.checkout.events.on(\"afterBatch\", () => {\n\t\t\t\t// In the initialization flow, this event is raised before the correct compatibility w.r.t the new schema is calculated.\n\t\t\t\t// Accessing `this.root` in that case can throw. It's OK to ignore this because:\n\t\t\t\t// - The rootChanged event will already be raised at the end of the current upgrade\n\t\t\t\t// - It doesn't matter that `lastRoot` isn't updated in this case, because `update` will be called again before the upgrade\n\t\t\t\t// completes (at which point this callback and the `lastRoot` captured here will be out of scope anyway)\n\t\t\t\tif (!this.midUpgrade && lastRoot !== this.root) {\n\t\t\t\t\tlastRoot = this.root;\n\t\t\t\t\tthis.events.emit(\"rootChanged\");\n\t\t\t\t}\n\n\t\t\t\tthis.events.emit(\"afterBatch\");\n\t\t\t});\n\n\t\t\tconst onViewDispose = (): void => {\n\t\t\t\tcleanupCheckOutEvents();\n\t\t\t\tthis.view = undefined;\n\t\t\t\tif (!this.disposed) {\n\t\t\t\t\tthis.update();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.view = requireSchema(\n\t\t\t\tthis.checkout,\n\t\t\t\tthis.viewSchema,\n\t\t\t\tonViewDispose,\n\t\t\t\tthis.nodeKeyManager,\n\t\t\t);\n\t\t} else {\n\t\t\tthis.view = undefined;\n\n\t\t\tconst unregister = this.checkout.storedSchema.on(\"afterSchemaChange\", () => {\n\t\t\t\tunregister();\n\t\t\t\tthis.unregisterCallbacks.delete(unregister);\n\t\t\t\tthis.update();\n\t\t\t});\n\t\t\tthis.unregisterCallbacks.add(unregister);\n\t\t}\n\n\t\tif (!this.midUpgrade) {\n\t\t\tthis.events.emit(\"schemaChanged\");\n\t\t\tthis.events.emit(\"rootChanged\");\n\t\t}\n\t}\n\n\tprivate runSchemaEdit(edit: () => void): void {\n\t\tthis.midUpgrade = true;\n\t\ttry {\n\t\t\tedit();\n\t\t} finally {\n\t\t\tthis.midUpgrade = false;\n\t\t}\n\t\tthis.events.emit(\"schemaChanged\");\n\t\tthis.events.emit(\"rootChanged\");\n\t}\n\n\tprivate disposeView(): void {\n\t\tif (this.view !== undefined) {\n\t\t\tthis.view[disposeSymbol]();\n\t\t\tthis.view = undefined;\n\t\t\tthis.unregisterCallbacks.forEach((unregister) => unregister());\n\t\t}\n\t}\n\n\tpublic get compatibility(): SchemaCompatibilityStatus {\n\t\tif (!this.currentCompatibility) {\n\t\t\tthis.failDisposed();\n\t\t}\n\t\treturn this.currentCompatibility;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.disposed = true;\n\t\tthis.disposeView();\n\t\tthis.currentCompatibility = undefined;\n\t}\n\n\tpublic get root(): TreeFieldFromImplicitField<TRootSchema> {\n\t\tif (!this.compatibility.canView) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"Document is out of schema. Check TreeView.compatibility before accessing TreeView.root.\",\n\t\t\t);\n\t\t}\n\t\tconst view = this.getView();\n\t\treturn getProxyForField(view.flexTree) as TreeFieldFromImplicitField<TRootSchema>;\n\t}\n\n\tpublic set root(newRoot: InsertableTreeFieldFromImplicitField<TRootSchema>) {\n\t\tif (!this.compatibility.canView) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"Document is out of schema. Check TreeView.compatibility before accessing TreeView.root.\",\n\t\t\t);\n\t\t}\n\t\tconst view = this.getView();\n\t\tsetField(view.context.root, this.rootFieldSchema, newRoot as InsertableContent);\n\t}\n}\n\n/**\n * Creates a view that self-disposes whenenever the stored schema changes.\n * This may only be called when the schema is already known to be compatible (typically via ensureSchema).\n */\nexport function requireSchema<TRoot extends FlexFieldSchema>(\n\tcheckout: TreeCheckout,\n\tviewSchema: ViewSchema<TRoot>,\n\tonDispose: () => void,\n\tnodeKeyManager: NodeKeyManager,\n): CheckoutFlexTreeView<TRoot> {\n\tconst slots = checkout.forest.anchors.slots;\n\tassert(!slots.has(ContextSlot), 0x8c2 /* Cannot create second view from checkout */);\n\n\t{\n\t\tconst compatibility = viewSchema.checkCompatibility(checkout.storedSchema);\n\t\tassert(\n\t\t\tcompatibility.write === Compatibility.Compatible &&\n\t\t\t\tcompatibility.read === Compatibility.Compatible,\n\t\t\t0x8c3 /* requireSchema invoked with incompatible schema */,\n\t\t);\n\t}\n\n\tconst view = new CheckoutFlexTreeView(checkout, viewSchema.schema, nodeKeyManager, onDispose);\n\tassert(slots.has(ContextSlot), 0x90d /* Context should be tracked in slot */);\n\n\tconst unregister = checkout.storedSchema.on(\"afterSchemaChange\", () => {\n\t\tunregister();\n\t\tview[disposeSymbol]();\n\t});\n\n\treturn view;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"schematizingTreeView.js","sourceRoot":"","sources":["../../src/shared-tree/schematizingTreeView.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAIN,aAAa,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGN,UAAU,EACV,mBAAmB,EACnB,WAAW,GACX,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAUN,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,oBAAoB,EAEpB,wBAAwB,GAExB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAoB,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEhG,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,0BAA0B;IAkCtC,YACiB,QAAsB;IACtC,gDAAgD;IAChC,MAA2E,EAC3E,cAA8B;QAH9B,aAAQ,GAAR,QAAQ,CAAc;QAEtB,WAAM,GAAN,MAAM,CAAqE;QAC3E,mBAAc,GAAd,cAAc,CAAgB;QAvB/B,WAAM,GAEU,aAAa,EAAE,CAAC;QAI/B,wBAAmB,GAAG,IAA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,IAAI,CAAC,OAAO,EAAE,CAAC;QAC5B,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,eAAe,EAAE,OAA4B,CAAC,CAAC;IACjF,CAAC;CACD;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAC5B,QAAsB,EACtB,UAA6B,EAC7B,SAAqB,EACrB,cAA8B;IAE9B,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;IAC5C,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,6CAA6C,CAAC,CAAC;IAErF,CAAC;QACA,MAAM,aAAa,GAAG,UAAU,CAAC,kBAAkB,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QAC3E,MAAM,CACL,aAAa,CAAC,KAAK,KAAK,aAAa,CAAC,UAAU;YAC/C,aAAa,CAAC,IAAI,KAAK,aAAa,CAAC,UAAU,EAChD,KAAK,CAAC,oDAAoD,CAC1D,CAAC;IACH,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,oBAAoB,CAAC,QAAQ,EAAE,UAAU,CAAC,MAAM,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC;IAC9F,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAE9E,MAAM,UAAU,GAAG,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,mBAAmB,EAAE,GAAG,EAAE;QACrE,UAAU,EAAE,CAAC;QACb,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACb,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { AllowedUpdateType, Compatibility } from \"../core/index.js\";\nimport {\n\ttype HasListeners,\n\ttype IEmitter,\n\ttype Listenable,\n\tcreateEmitter,\n} from \"../events/index.js\";\nimport {\n\ttype FlexFieldSchema,\n\ttype NodeKeyManager,\n\tViewSchema,\n\tdefaultSchemaPolicy,\n\tContextSlot,\n} from \"../feature-libraries/index.js\";\nimport {\n\ttype FieldSchema,\n\ttype ImplicitFieldSchema,\n\ttype SchemaCompatibilityStatus,\n\ttype InsertableTreeFieldFromImplicitField,\n\t// eslint-disable-next-line import/no-deprecated\n\ttype TreeConfiguration,\n\ttype TreeFieldFromImplicitField,\n\ttype TreeView,\n\ttype TreeViewEvents,\n\tgetProxyForField,\n\ttoFlexConfig,\n\tsetField,\n\tnormalizeFieldSchema,\n\ttype InsertableContent,\n\tcursorFromUnhydratedRoot,\n\ttype TreeViewConfiguration,\n} from \"../simple-tree/index.js\";\nimport { disposeSymbol } from \"../util/index.js\";\n\nimport { type TreeContent, canInitialize, ensureSchema, initialize } from \"./schematizeTree.js\";\nimport type { TreeCheckout } from \"./treeCheckout.js\";\nimport { CheckoutFlexTreeView } from \"./treeView.js\";\n\n/**\n * Implementation of TreeView wrapping a FlexTreeView.\n */\nexport class SchematizingSimpleTreeView<in out TRootSchema extends ImplicitFieldSchema>\n\timplements TreeView<TRootSchema>\n{\n\t/**\n\t * The view is set to undefined when this object is disposed or the view schema does not support viewing the document's stored schema.\n\t *\n\t * The view schema may be incompatible with the stored schema. Use `compatibility` to check.\n\t */\n\tprivate view: CheckoutFlexTreeView<FlexFieldSchema> | undefined;\n\n\t/**\n\t * Undefined iff uninitialized or disposed.\n\t */\n\tprivate currentCompatibility: SchemaCompatibilityStatus | undefined;\n\tprivate readonly flexConfig: TreeContent;\n\tpublic readonly events: Listenable<TreeViewEvents> &\n\t\tIEmitter<TreeViewEvents> &\n\t\tHasListeners<TreeViewEvents> = createEmitter();\n\n\tprivate readonly viewSchema: ViewSchema;\n\n\tprivate readonly unregisterCallbacks = new Set<() => void>();\n\n\tpublic disposed = false;\n\t/**\n\t * This is set to true while an edit impacting the document schema is in progress.\n\t * This allows suppressing extra rootChanged / schemaChanged events until the edit concludes.\n\t * This is useful especially for some initialization edits, since document initialization can involve transient schemas\n\t * which are implementation details and should not be exposed to the user.\n\t */\n\tprivate midUpgrade = false;\n\n\tprivate readonly rootFieldSchema: FieldSchema;\n\n\tpublic constructor(\n\t\tpublic readonly checkout: TreeCheckout,\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tpublic readonly config: TreeConfiguration<TRootSchema> | TreeViewConfiguration<TRootSchema>,\n\t\tpublic readonly nodeKeyManager: NodeKeyManager,\n\t) {\n\t\tconst policy = {\n\t\t\t...defaultSchemaPolicy,\n\t\t\tvalidateSchema: config.enableSchemaValidation,\n\t\t};\n\t\tthis.rootFieldSchema = normalizeFieldSchema(config.schema);\n\t\tthis.flexConfig = toFlexConfig(config, nodeKeyManager, {\n\t\t\tschema: checkout.storedSchema,\n\t\t\tpolicy,\n\t\t});\n\t\tthis.viewSchema = new ViewSchema(policy, {}, this.flexConfig.schema);\n\t\t// This must be initialized before `update` can be called.\n\t\tthis.currentCompatibility = {\n\t\t\tcanView: false,\n\t\t\tcanUpgrade: true,\n\t\t\tisEquivalent: false,\n\t\t\tcanInitialize: true,\n\t\t};\n\t\tthis.update();\n\n\t\tthis.unregisterCallbacks.add(\n\t\t\tthis.checkout.events.on(\"commitApplied\", (data, getRevertible) =>\n\t\t\t\tthis.events.emit(\"commitApplied\", data, getRevertible),\n\t\t\t),\n\t\t);\n\t}\n\n\tpublic initialize(content: InsertableTreeFieldFromImplicitField<TRootSchema>): void {\n\t\tthis.ensureUndisposed();\n\n\t\tconst compatibility = this.compatibility;\n\t\tif (!compatibility.canInitialize) {\n\t\t\tthrow new UsageError(\"Tree cannot be initialized more than once.\");\n\t\t}\n\n\t\tthis.runSchemaEdit(() => {\n\t\t\tinitialize(this.checkout, {\n\t\t\t\tschema: this.flexConfig.schema,\n\t\t\t\tinitialTree:\n\t\t\t\t\tcontent === undefined\n\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t: cursorFromUnhydratedRoot(\n\t\t\t\t\t\t\t\tthis.config.schema,\n\t\t\t\t\t\t\t\tcontent,\n\t\t\t\t\t\t\t\tthis.nodeKeyManager,\n\t\t\t\t\t\t ),\n\t\t\t});\n\t\t});\n\t}\n\n\tpublic upgradeSchema(): void {\n\t\tthis.ensureUndisposed();\n\n\t\tconst compatibility = this.compatibility;\n\t\tif (compatibility.isEquivalent) {\n\t\t\t// No-op\n\t\t\treturn;\n\t\t}\n\n\t\tif (!compatibility.canUpgrade) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"Existing stored schema can not be upgraded (see TreeView.compatibility.canUpgrade).\",\n\t\t\t);\n\t\t}\n\n\t\tthis.runSchemaEdit(() => {\n\t\t\tconst result = ensureSchema(\n\t\t\t\tthis.viewSchema,\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tAllowedUpdateType.SchemaCompatible | AllowedUpdateType.Initialize,\n\t\t\t\tthis.checkout,\n\t\t\t\tthis.flexConfig,\n\t\t\t);\n\t\t\tassert(result, 0x8bf /* Schema upgrade should always work if canUpgrade is set. */);\n\t\t});\n\t}\n\n\t/**\n\t * Gets the view. Throws when disposed.\n\t */\n\tpublic getView(): CheckoutFlexTreeView<FlexFieldSchema> {\n\t\tthis.ensureUndisposed();\n\t\tassert(this.view !== undefined, 0x8c0 /* unexpected getViewOrError */);\n\t\treturn this.view;\n\t}\n\n\tprivate ensureUndisposed(): void {\n\t\tif (this.disposed) {\n\t\t\tthis.failDisposed();\n\t\t}\n\t}\n\n\tprivate failDisposed(): never {\n\t\tthrow new UsageError(\"Accessed a disposed TreeView.\");\n\t}\n\n\t/**\n\t * Updates `this.view` and the current compatibility status.\n\t * Invoked during initialization and when `this.view` needs to be replaced due to stored schema changes.\n\t * Handles re-registering for events to call update in the future.\n\t * @remarks\n\t * This does not check if the view needs to be replaced, it replaces it unconditionally:\n\t * callers should do any checking to detect if it's really needed before calling `update`.\n\t * @privateRemarks\n\t * This implementation avoids making any edits, which prevents it from being invoked reentrantly.\n\t * If implicit initialization (or some other edit) is desired, it should be done outside of this method.\n\t */\n\tprivate update(): void {\n\t\tthis.disposeView();\n\n\t\tconst result = this.viewSchema.checkCompatibility(this.checkout.storedSchema);\n\n\t\t// TODO: AB#8121: Weaken this check to support viewing under additional circumstances.\n\t\t// In the near term, this should support viewing documents with additional optional fields in their schema on object types.\n\t\t// Longer-term (as demand arises), we could also add APIs to constructing view schema to allow for more flexibility\n\t\t// (e.g. out-of-schema content handlers could allow support for viewing docs which have extra allowed types in a particular field)\n\t\tconst canView =\n\t\t\tresult.write === Compatibility.Compatible && result.read === Compatibility.Compatible;\n\t\tconst canUpgrade = result.read === Compatibility.Compatible;\n\t\tconst isEquivalent = canView && canUpgrade;\n\t\tconst compatibility: SchemaCompatibilityStatus = {\n\t\t\tcanView,\n\t\t\tcanUpgrade,\n\t\t\tisEquivalent,\n\t\t\tcanInitialize: canInitialize(this.checkout),\n\t\t};\n\t\tlet lastRoot =\n\t\t\tthis.compatibility.canView && this.view !== undefined ? this.root : undefined;\n\t\tthis.currentCompatibility = compatibility;\n\n\t\tif (compatibility.canView) {\n\t\t\t// Trigger \"rootChanged\" if the root changes in the future.\n\t\t\t// Currently there is no good way to do this as FlexTreeField has no events for changes.\n\t\t\t// this.view.flexTree.on(????)\n\t\t\t// As a workaround for the above, trigger \"rootChanged\" in \"afterBatch\"\n\t\t\t// which isn't the correct time since we normally do events during the batch when the forest is modified, but its better than nothing.\n\t\t\t// TODO: provide a better event: this.view.flexTree.on(????)\n\t\t\tconst cleanupCheckOutEvents = this.checkout.events.on(\"afterBatch\", () => {\n\t\t\t\t// In the initialization flow, this event is raised before the correct compatibility w.r.t the new schema is calculated.\n\t\t\t\t// Accessing `this.root` in that case can throw. It's OK to ignore this because:\n\t\t\t\t// - The rootChanged event will already be raised at the end of the current upgrade\n\t\t\t\t// - It doesn't matter that `lastRoot` isn't updated in this case, because `update` will be called again before the upgrade\n\t\t\t\t// completes (at which point this callback and the `lastRoot` captured here will be out of scope anyway)\n\t\t\t\tif (!this.midUpgrade && lastRoot !== this.root) {\n\t\t\t\t\tlastRoot = this.root;\n\t\t\t\t\tthis.events.emit(\"rootChanged\");\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tconst onViewDispose = (): void => {\n\t\t\t\tcleanupCheckOutEvents();\n\t\t\t\tthis.view = undefined;\n\t\t\t\tif (!this.disposed) {\n\t\t\t\t\tthis.update();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.view = requireSchema(\n\t\t\t\tthis.checkout,\n\t\t\t\tthis.viewSchema,\n\t\t\t\tonViewDispose,\n\t\t\t\tthis.nodeKeyManager,\n\t\t\t);\n\t\t} else {\n\t\t\tthis.view = undefined;\n\n\t\t\tconst unregister = this.checkout.storedSchema.on(\"afterSchemaChange\", () => {\n\t\t\t\tunregister();\n\t\t\t\tthis.unregisterCallbacks.delete(unregister);\n\t\t\t\tthis.update();\n\t\t\t});\n\t\t\tthis.unregisterCallbacks.add(unregister);\n\t\t}\n\n\t\tif (!this.midUpgrade) {\n\t\t\tthis.events.emit(\"schemaChanged\");\n\t\t\tthis.events.emit(\"rootChanged\");\n\t\t}\n\t}\n\n\tprivate runSchemaEdit(edit: () => void): void {\n\t\tthis.midUpgrade = true;\n\t\ttry {\n\t\t\tedit();\n\t\t} finally {\n\t\t\tthis.midUpgrade = false;\n\t\t}\n\t\tthis.events.emit(\"schemaChanged\");\n\t\tthis.events.emit(\"rootChanged\");\n\t}\n\n\tprivate disposeView(): void {\n\t\tif (this.view !== undefined) {\n\t\t\tthis.view[disposeSymbol]();\n\t\t\tthis.view = undefined;\n\t\t\tthis.unregisterCallbacks.forEach((unregister) => unregister());\n\t\t}\n\t}\n\n\tpublic get compatibility(): SchemaCompatibilityStatus {\n\t\tif (!this.currentCompatibility) {\n\t\t\tthis.failDisposed();\n\t\t}\n\t\treturn this.currentCompatibility;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.disposed = true;\n\t\tthis.disposeView();\n\t\tthis.currentCompatibility = undefined;\n\t}\n\n\tpublic get root(): TreeFieldFromImplicitField<TRootSchema> {\n\t\tif (!this.compatibility.canView) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"Document is out of schema. Check TreeView.compatibility before accessing TreeView.root.\",\n\t\t\t);\n\t\t}\n\t\tconst view = this.getView();\n\t\treturn getProxyForField(view.flexTree) as TreeFieldFromImplicitField<TRootSchema>;\n\t}\n\n\tpublic set root(newRoot: InsertableTreeFieldFromImplicitField<TRootSchema>) {\n\t\tif (!this.compatibility.canView) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"Document is out of schema. Check TreeView.compatibility before accessing TreeView.root.\",\n\t\t\t);\n\t\t}\n\t\tconst view = this.getView();\n\t\tsetField(view.context.root, this.rootFieldSchema, newRoot as InsertableContent);\n\t}\n}\n\n/**\n * Creates a view that self-disposes whenenever the stored schema changes.\n * This may only be called when the schema is already known to be compatible (typically via ensureSchema).\n */\nexport function requireSchema<TRoot extends FlexFieldSchema>(\n\tcheckout: TreeCheckout,\n\tviewSchema: ViewSchema<TRoot>,\n\tonDispose: () => void,\n\tnodeKeyManager: NodeKeyManager,\n): CheckoutFlexTreeView<TRoot> {\n\tconst slots = checkout.forest.anchors.slots;\n\tassert(!slots.has(ContextSlot), 0x8c2 /* Cannot create second view from checkout */);\n\n\t{\n\t\tconst compatibility = viewSchema.checkCompatibility(checkout.storedSchema);\n\t\tassert(\n\t\t\tcompatibility.write === Compatibility.Compatible &&\n\t\t\t\tcompatibility.read === Compatibility.Compatible,\n\t\t\t0x8c3 /* requireSchema invoked with incompatible schema */,\n\t\t);\n\t}\n\n\tconst view = new CheckoutFlexTreeView(checkout, viewSchema.schema, nodeKeyManager, onDispose);\n\tassert(slots.has(ContextSlot), 0x90d /* Context should be tracked in slot */);\n\n\tconst unregister = checkout.storedSchema.on(\"afterSchemaChange\", () => {\n\t\tunregister();\n\t\tview[disposeSymbol]();\n\t});\n\n\treturn view;\n}\n"]}
|
|
@@ -96,6 +96,10 @@ export declare const SharedTreeFormatVersion: {
|
|
|
96
96
|
* Requires \@fluidframework/tree \>= 2.0.0.
|
|
97
97
|
*/
|
|
98
98
|
readonly v2: 2;
|
|
99
|
+
/**
|
|
100
|
+
* Requires \@fluidframework/tree \>= 2.0.0.
|
|
101
|
+
*/
|
|
102
|
+
readonly v3: 3;
|
|
99
103
|
};
|
|
100
104
|
/**
|
|
101
105
|
* Format versions supported by SharedTree.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedTree.d.ts","sourceRoot":"","sources":["../../src/shared-tree/sharedTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACX,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAGjF,OAAO,EAAE,KAAK,aAAa,EAAiB,MAAM,mBAAmB,CAAC;AACtE,OAAO,EACN,KAAK,YAAY,EAEjB,KAAK,gBAAgB,EACrB,0BAA0B,EAG1B,MAAM,kBAAkB,CAAC;AAO1B,OAAO,EAEN,KAAK,eAAe,EAGpB,uBAAuB,EAUvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAGN,cAAc,EACd,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EACX,KAAK,EACL,mBAAmB,EAEnB,iBAAiB,EACjB,QAAQ,EACR,qBAAqB,EACrB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,KAAK,oCAAoC,EAAgB,MAAM,qBAAqB,CAAC;AAI9F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAuB,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;;OAEG;IACH,SAAS,IAAI;CACb;AAED,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,iBAAiB,CAKhE,CAAC;AAEF;;GAEG;AACH,qBAAa,iBAAkB,YAAW,eAAe,CAAC,WAAW,CAAC;IASlD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAR3C,SAAgB,IAAI,EAAE,MAAM,CAA4C;IAExE,SAAgB,UAAU,EAAE,kBAAkB,CAI5C;gBAEkC,OAAO,GAAE,iBAAsB;IAEtD,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,iBAAiB,EAAE,QAAQ,CAAC,kBAAkB,CAAC,GAC7C,OAAO,CAAC,UAAU,CAAC;IAMf,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,UAAU;CAKtE"}
|
|
@@ -17,6 +17,7 @@ import { createTreeCheckout } from "./treeCheckout.js";
|
|
|
17
17
|
const formatVersionToTopLevelCodecVersions = new Map([
|
|
18
18
|
[1, { forest: 1, schema: 1, detachedFieldIndex: 1, editManager: 1, message: 1, fieldBatch: 1 }],
|
|
19
19
|
[2, { forest: 1, schema: 1, detachedFieldIndex: 1, editManager: 2, message: 2, fieldBatch: 1 }],
|
|
20
|
+
[3, { forest: 1, schema: 1, detachedFieldIndex: 1, editManager: 3, message: 3, fieldBatch: 1 }],
|
|
20
21
|
]);
|
|
21
22
|
function getCodecVersions(formatVersion) {
|
|
22
23
|
const versions = formatVersionToTopLevelCodecVersions.get(formatVersion);
|
|
@@ -29,8 +30,6 @@ function getCodecVersions(formatVersion) {
|
|
|
29
30
|
* TODO: detail compatibility requirements.
|
|
30
31
|
*/
|
|
31
32
|
export class SharedTree extends SharedTreeCore {
|
|
32
|
-
_events;
|
|
33
|
-
checkout;
|
|
34
33
|
get storedSchema() {
|
|
35
34
|
return this.checkout.storedSchema;
|
|
36
35
|
}
|
|
@@ -56,6 +55,7 @@ export class SharedTree extends SharedTreeCore {
|
|
|
56
55
|
policy: defaultSchemaPolicy,
|
|
57
56
|
},
|
|
58
57
|
encodeType: options.treeEncodeType,
|
|
58
|
+
originatorId: runtime.idCompressor.localSessionId,
|
|
59
59
|
idCompressor: runtime.idCompressor,
|
|
60
60
|
};
|
|
61
61
|
const forestSummarizer = new ForestSummarizer(forest, revisionTagCodec, fieldBatchCodec, encoderContext, options, runtime.idCompressor);
|
|
@@ -151,6 +151,10 @@ export const SharedTreeFormatVersion = {
|
|
|
151
151
|
* Requires \@fluidframework/tree \>= 2.0.0.
|
|
152
152
|
*/
|
|
153
153
|
v2: 2,
|
|
154
|
+
/**
|
|
155
|
+
* Requires \@fluidframework/tree \>= 2.0.0.
|
|
156
|
+
*/
|
|
157
|
+
v3: 3,
|
|
154
158
|
};
|
|
155
159
|
/**
|
|
156
160
|
* Used to distinguish between different forest types.
|
|
@@ -171,21 +175,20 @@ export const defaultSharedTreeOptions = {
|
|
|
171
175
|
jsonValidator: noopValidator,
|
|
172
176
|
forest: ForestType.Reference,
|
|
173
177
|
treeEncodeType: TreeCompressionStrategy.Compressed,
|
|
174
|
-
formatVersion: SharedTreeFormatVersion.
|
|
178
|
+
formatVersion: SharedTreeFormatVersion.v3,
|
|
175
179
|
};
|
|
176
180
|
/**
|
|
177
181
|
* A channel factory that creates {@link ISharedTree}s.
|
|
178
182
|
*/
|
|
179
183
|
export class SharedTreeFactory {
|
|
180
|
-
options;
|
|
181
|
-
type = "https://graph.microsoft.com/types/tree";
|
|
182
|
-
attributes = {
|
|
183
|
-
type: this.type,
|
|
184
|
-
snapshotFormatVersion: "0.0.0",
|
|
185
|
-
packageVersion: "0.0.0",
|
|
186
|
-
};
|
|
187
184
|
constructor(options = {}) {
|
|
188
185
|
this.options = options;
|
|
186
|
+
this.type = "https://graph.microsoft.com/types/tree";
|
|
187
|
+
this.attributes = {
|
|
188
|
+
type: this.type,
|
|
189
|
+
snapshotFormatVersion: "0.0.0",
|
|
190
|
+
packageVersion: "0.0.0",
|
|
191
|
+
};
|
|
189
192
|
}
|
|
190
193
|
async load(runtime, id, services, channelAttributes) {
|
|
191
194
|
const tree = new SharedTree(id, runtime, channelAttributes, this.options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedTree.js","sourceRoot":"","sources":["../../src/shared-tree/sharedTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAS7D,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EAAsB,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAEN,gBAAgB,EAEhB,0BAA0B,EAC1B,sBAAsB,EACtB,mBAAmB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAIN,aAAa,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,4BAA4B,EAE5B,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EACpB,mBAAmB,EACnB,2BAA2B,EAC3B,mBAAmB,EACnB,yBAAyB,EACzB,eAAe,GACf,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,sBAAsB,EAEtB,cAAc,GACd,MAAM,8BAA8B,CAAC;AAUtC,OAAO,EAA6C,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9F,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAGrE,OAAO,EAA0C,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AA0E/F,MAAM,oCAAoC,GAAG,IAAI,GAAG,CAAgC;IACnF,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAA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,CAAC,OAAO,CAAC,CAAC;QACxE,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACb,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type {\n\tIChannelAttributes,\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n\tIChannelStorageService,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport type { ISharedObject } from \"@fluidframework/shared-object-base/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { type ICodecOptions, noopValidator } from \"../codec/index.js\";\nimport {\n\ttype JsonableTree,\n\tRevisionTagCodec,\n\ttype TreeStoredSchema,\n\tTreeStoredSchemaRepository,\n\tmakeDetachedFieldIndex,\n\tmoveToDetachedField,\n} from \"../core/index.js\";\nimport {\n\ttype HasListeners,\n\ttype IEmitter,\n\ttype Listenable,\n\tcreateEmitter,\n} from \"../events/index.js\";\nimport {\n\tDetachedFieldIndexSummarizer,\n\ttype FlexFieldSchema,\n\tForestSummarizer,\n\tSchemaSummarizer,\n\tTreeCompressionStrategy,\n\tViewSchema,\n\tbuildChunkedForest,\n\tbuildForest,\n\tcreateNodeKeyManager,\n\tdefaultSchemaPolicy,\n\tjsonableTreeFromFieldCursor,\n\tmakeFieldBatchCodec,\n\tmakeMitigatedChangeFamily,\n\tmakeTreeChunker,\n} from \"../feature-libraries/index.js\";\nimport {\n\tDefaultResubmitMachine,\n\ttype ExplicitCoreCodecVersions,\n\tSharedTreeCore,\n} from \"../shared-tree-core/index.js\";\nimport type {\n\tITree,\n\tImplicitFieldSchema,\n\t// eslint-disable-next-line import/no-deprecated\n\tTreeConfiguration,\n\tTreeView,\n\tTreeViewConfiguration,\n} from \"../simple-tree/index.js\";\n\nimport { type InitializeAndSchematizeConfiguration, ensureSchema } from \"./schematizeTree.js\";\nimport { SchematizingSimpleTreeView, requireSchema } from \"./schematizingTreeView.js\";\nimport { SharedTreeReadonlyChangeEnricher } from \"./sharedTreeChangeEnricher.js\";\nimport { SharedTreeChangeFamily } from \"./sharedTreeChangeFamily.js\";\nimport type { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\nimport type { SharedTreeEditBuilder } from \"./sharedTreeEditBuilder.js\";\nimport { type CheckoutEvents, type TreeCheckout, createTreeCheckout } from \"./treeCheckout.js\";\nimport type { CheckoutFlexTreeView, FlexTreeView } from \"./treeView.js\";\n\n/**\n * Copy of data from an {@link ISharedTree} at some point in time.\n * @remarks\n * This is unrelated to Fluids concept of \"snapshots\".\n * @internal\n */\nexport interface SharedTreeContentSnapshot {\n\t/**\n\t * The schema stored in the document.\n\t *\n\t * @remarks\n\t * Edits to the schema can mutate the schema stored of the tree which took this snapshot (but this snapshot will remain the same)\n\t * This is mainly useful for debugging cases where schematize reports an incompatible view schema.\n\t */\n\treadonly schema: TreeStoredSchema;\n\t/**\n\t * All {@link TreeStatus#InDocument} content.\n\t */\n\treadonly tree: JsonableTree[];\n\t/**\n\t * All {@link TreeStatus#Removed} content.\n\t */\n\treadonly removed: [string | number | undefined, number, JsonableTree][];\n}\n\n/**\n * Collaboratively editable tree distributed data-structure,\n * powered by {@link @fluidframework/shared-object-base#ISharedObject}.\n *\n * See [the README](../../README.md) for details.\n * @internal\n */\nexport interface ISharedTree extends ISharedObject, ITree {\n\t/**\n\t * Provides a copy of the current content of the tree.\n\t * This can be useful for inspecting the tree when no suitable view schema is available.\n\t * This is only intended for use in testing and exceptional code paths: it is not performant.\n\t *\n\t * This does not include everything that is included in a tree summary, since information about how to merge future edits is omitted.\n\t */\n\tcontentSnapshot(): SharedTreeContentSnapshot;\n\n\t/**\n\t * Like {@link ITree.viewWith}, but uses the flex-tree schema system and exposes the tree as a flex-tree.\n\t *\n\t * Returned view is disposed when the stored schema becomes incompatible with the view schema.\n\t * Undefined is returned if the stored data could not be made compatible with the view schema.\n\t */\n\tschematizeFlexTree<TRoot extends FlexFieldSchema>(\n\t\tconfig: InitializeAndSchematizeConfiguration<TRoot>,\n\t\tonDispose: () => void,\n\t): FlexTreeView<TRoot> | undefined;\n}\n\n/**\n * Has an entry for each codec which writes an explicit version into its data.\n *\n * This is used to map the single API entrypoint controlling the format {@link SharedTreeOptions.formatVersion}\n * to a list of write versions that for each codec that should be used for that format.\n *\n * Note that all explicitly versioned codecs should be using the format version from the data to read encoded data.\n *\n * TODO: Plumb these write versions into forest, schema, detached field index codec creation.\n */\ninterface ExplicitCodecVersions extends ExplicitCoreCodecVersions {\n\tforest: number;\n\tschema: number;\n\tdetachedFieldIndex: number;\n\tfieldBatch: number;\n}\n\nconst formatVersionToTopLevelCodecVersions = new Map<number, ExplicitCodecVersions>([\n\t[1, { forest: 1, schema: 1, detachedFieldIndex: 1, editManager: 1, message: 1, fieldBatch: 1 }],\n\t[2, { forest: 1, schema: 1, detachedFieldIndex: 1, editManager: 2, message: 2, fieldBatch: 1 }],\n]);\n\nfunction getCodecVersions(formatVersion: number): ExplicitCodecVersions {\n\tconst versions = formatVersionToTopLevelCodecVersions.get(formatVersion);\n\tassert(versions !== undefined, 0x90e /* Unknown format version */);\n\treturn versions;\n}\n\n/**\n * Shared tree, configured with a good set of indexes and field kinds which will maintain compatibility over time.\n *\n * TODO: detail compatibility requirements.\n */\nexport class SharedTree\n\textends SharedTreeCore<SharedTreeEditBuilder, SharedTreeChange>\n\timplements ISharedTree\n{\n\tprivate readonly _events: Listenable<CheckoutEvents> &\n\t\tIEmitter<CheckoutEvents> &\n\t\tHasListeners<CheckoutEvents>;\n\tpublic readonly checkout: TreeCheckout;\n\tpublic get storedSchema(): TreeStoredSchemaRepository {\n\t\treturn this.checkout.storedSchema;\n\t}\n\n\tpublic constructor(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t\toptionsParam: SharedTreeOptions,\n\t\ttelemetryContextPrefix: string = \"fluid_sharedTree_\",\n\t) {\n\t\tif (runtime.idCompressor === undefined) {\n\t\t\tthrow new UsageError(\"IdCompressor must be enabled to use SharedTree\");\n\t\t}\n\n\t\tconst options = { ...defaultSharedTreeOptions, ...optionsParam };\n\t\tconst codecVersions = getCodecVersions(options.formatVersion);\n\t\tconst schema = new TreeStoredSchemaRepository();\n\t\tconst forest =\n\t\t\toptions.forest === ForestType.Optimized\n\t\t\t\t? buildChunkedForest(makeTreeChunker(schema, defaultSchemaPolicy))\n\t\t\t\t: buildForest();\n\t\tconst revisionTagCodec = new RevisionTagCodec(runtime.idCompressor);\n\t\tconst removedRoots = makeDetachedFieldIndex(\n\t\t\t\"repair\",\n\t\t\trevisionTagCodec,\n\t\t\truntime.idCompressor,\n\t\t\toptions,\n\t\t);\n\t\tconst schemaSummarizer = new SchemaSummarizer(runtime, schema, options, {\n\t\t\tgetCurrentSeq: () => this.deltaManager.lastSequenceNumber,\n\t\t});\n\t\tconst fieldBatchCodec = makeFieldBatchCodec(options, codecVersions.fieldBatch);\n\n\t\tconst encoderContext = {\n\t\t\tschema: {\n\t\t\t\tschema,\n\t\t\t\tpolicy: defaultSchemaPolicy,\n\t\t\t},\n\t\t\tencodeType: options.treeEncodeType,\n\t\t\tidCompressor: runtime.idCompressor,\n\t\t};\n\t\tconst forestSummarizer = new ForestSummarizer(\n\t\t\tforest,\n\t\t\trevisionTagCodec,\n\t\t\tfieldBatchCodec,\n\t\t\tencoderContext,\n\t\t\toptions,\n\t\t\truntime.idCompressor,\n\t\t);\n\t\tconst removedRootsSummarizer = new DetachedFieldIndexSummarizer(removedRoots);\n\t\tconst innerChangeFamily = new SharedTreeChangeFamily(\n\t\t\trevisionTagCodec,\n\t\t\tfieldBatchCodec,\n\t\t\toptions,\n\t\t\toptions.treeEncodeType,\n\t\t);\n\t\tconst changeFamily = makeMitigatedChangeFamily(\n\t\t\tinnerChangeFamily,\n\t\t\tSharedTreeChangeFamily.emptyChange,\n\t\t\t(error: unknown) => {\n\t\t\t\t// TODO:6344 Add telemetry for these errors.\n\t\t\t\t// Rethrowing the error has a different effect depending on the context in which the\n\t\t\t\t// ChangeFamily was invoked:\n\t\t\t\t// - If the ChangeFamily was invoked as part of incoming op processing, rethrowing the error\n\t\t\t\t// will cause the runtime to disconnect the client, log a severe error, and not reconnect.\n\t\t\t\t// This will not cause the host application to crash because it is not on the stack at that time.\n\t\t\t\t// TODO: let the host application know that the client is now disconnected.\n\t\t\t\t// - If the ChangeFamily was invoked as part of dealing with a local change, rethrowing the\n\t\t\t\t// error will cause the host application to crash. This is not ideal, but is better than\n\t\t\t\t// letting the application either send an invalid change to the server or allowing the\n\t\t\t\t// application to continue working when its local branches contain edits that cannot be\n\t\t\t\t// reflected in its views.\n\t\t\t\t// The best course of action for a host application in such a state is to restart.\n\t\t\t\t// TODO: let the host application know about this situation and provide a way to\n\t\t\t\t// programmatically reload the SharedTree container.\n\t\t\t\tthrow error;\n\t\t\t},\n\t\t);\n\t\tconst changeEnricher = new SharedTreeReadonlyChangeEnricher(forest, schema, removedRoots);\n\t\tsuper(\n\t\t\t[schemaSummarizer, forestSummarizer, removedRootsSummarizer],\n\t\t\tchangeFamily,\n\t\t\toptions,\n\t\t\tcodecVersions,\n\t\t\tid,\n\t\t\truntime,\n\t\t\tattributes,\n\t\t\ttelemetryContextPrefix,\n\t\t\tschema,\n\t\t\tdefaultSchemaPolicy,\n\t\t\tnew DefaultResubmitMachine(\n\t\t\t\tchangeFamily.rebaser.invert.bind(changeFamily.rebaser),\n\t\t\t\tchangeEnricher,\n\t\t\t),\n\t\t\tchangeEnricher,\n\t\t);\n\t\tthis._events = createEmitter<CheckoutEvents>();\n\t\tconst localBranch = this.getLocalBranch();\n\t\tthis.checkout = createTreeCheckout(\n\t\t\truntime.idCompressor,\n\t\t\tthis.mintRevisionTag,\n\t\t\trevisionTagCodec,\n\t\t\t{\n\t\t\t\tbranch: localBranch,\n\t\t\t\tchangeFamily,\n\t\t\t\tschema,\n\t\t\t\tforest,\n\t\t\t\tfieldBatchCodec,\n\t\t\t\tevents: this._events,\n\t\t\t\tremovedRoots,\n\t\t\t\tchunkCompressionStrategy: options.treeEncodeType,\n\t\t\t},\n\t\t);\n\t}\n\n\tpublic contentSnapshot(): SharedTreeContentSnapshot {\n\t\tconst cursor = this.checkout.forest.allocateCursor(\"contentSnapshot\");\n\t\ttry {\n\t\t\tmoveToDetachedField(this.checkout.forest, cursor);\n\t\t\treturn {\n\t\t\t\tschema: this.storedSchema.clone(),\n\t\t\t\ttree: jsonableTreeFromFieldCursor(cursor),\n\t\t\t\tremoved: this.checkout.getRemovedRoots(),\n\t\t\t};\n\t\t} finally {\n\t\t\tcursor.free();\n\t\t}\n\t}\n\n\tpublic schematizeFlexTree<TRoot extends FlexFieldSchema>(\n\t\tconfig: InitializeAndSchematizeConfiguration<TRoot>,\n\t\tonDispose: () => void,\n\t): CheckoutFlexTreeView<TRoot> | undefined {\n\t\tconst viewSchema = new ViewSchema(defaultSchemaPolicy, {}, config.schema);\n\t\tif (!ensureSchema(viewSchema, config.allowedSchemaModifications, this.checkout, config)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn requireSchema(\n\t\t\tthis.checkout,\n\t\t\tviewSchema,\n\t\t\tonDispose,\n\t\t\tcreateNodeKeyManager(this.runtime.idCompressor),\n\t\t);\n\t}\n\n\tpublic schematize<TRoot extends ImplicitFieldSchema>(\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tconfig: TreeConfiguration<TRoot>,\n\t): TreeView<TRoot> {\n\t\tconst view = new SchematizingSimpleTreeView(\n\t\t\tthis.checkout,\n\t\t\tconfig,\n\t\t\tcreateNodeKeyManager(this.runtime.idCompressor),\n\t\t);\n\t\t// As a subjective API design choice, we initialize the tree here if it is not already initialized.\n\t\tif (view.compatibility.canInitialize === true) {\n\t\t\tview.initialize(config.initialTree());\n\t\t}\n\t\treturn view;\n\t}\n\n\tpublic viewWith<TRoot extends ImplicitFieldSchema>(\n\t\tconfig: TreeViewConfiguration<TRoot>,\n\t): TreeView<TRoot> {\n\t\treturn new SchematizingSimpleTreeView(\n\t\t\tthis.checkout,\n\t\t\tconfig,\n\t\t\tcreateNodeKeyManager(this.runtime.idCompressor),\n\t\t);\n\t}\n\n\tprotected override async loadCore(services: IChannelStorageService): Promise<void> {\n\t\tawait super.loadCore(services);\n\t\tthis._events.emit(\"afterBatch\");\n\t}\n}\n\n/**\n * Format versions supported by SharedTree.\n *\n * Each version documents a required minimum version of the \\@fluidframework/tree package.\n * @internal\n */\nexport const SharedTreeFormatVersion = {\n\t/**\n\t * Requires \\@fluidframework/tree \\>= 2.0.0.\n\t *\n\t * @deprecated - FF does not currently plan on supporting this format long-term.\n\t * Do not write production documents using this format, as they may not be loadable in the future.\n\t */\n\tv1: 1,\n\n\t/**\n\t * Requires \\@fluidframework/tree \\>= 2.0.0.\n\t */\n\tv2: 2,\n} as const;\n\n/**\n * Format versions supported by SharedTree.\n *\n * Each version documents a required minimum version of the \\@fluidframework/tree package.\n * @internal\n * @privateRemarks\n * See packages/dds/tree/docs/main/compatibility.md for information on how to add support for a new format.\n */\nexport type SharedTreeFormatVersion = typeof SharedTreeFormatVersion;\n\n/**\n * @internal\n */\nexport type SharedTreeOptions = Partial<ICodecOptions> &\n\tPartial<SharedTreeFormatOptions> & {\n\t\t/**\n\t\t * The {@link ForestType} indicating which forest type should be created for the SharedTree.\n\t\t */\n\t\tforest?: ForestType;\n\t};\n\n/**\n * Options for configuring the persisted format SharedTree uses.\n * @internal\n */\nexport interface SharedTreeFormatOptions {\n\t/**\n\t * See {@link TreeCompressionStrategy}.\n\t * default: TreeCompressionStrategy.Compressed\n\t */\n\ttreeEncodeType: TreeCompressionStrategy;\n\t/**\n\t * The format version SharedTree should use to persist documents.\n\t *\n\t * This option has compatibility implications for applications using SharedTree.\n\t * Each version documents a required minimum version of \\@fluidframework/tree.\n\t * If this minimum version fails to be met, the SharedTree may fail to load.\n\t * To be safe, application authors should verify that they have saturated this version\n\t * of \\@fluidframework/tree in their ecosystem before changing the format version.\n\t *\n\t * This option defaults to SharedTreeFormatVersion.v2.\n\t */\n\tformatVersion: SharedTreeFormatVersion[keyof SharedTreeFormatVersion];\n}\n\n/**\n * Used to distinguish between different forest types.\n * @internal\n */\nexport enum ForestType {\n\t/**\n\t * The \"ObjectForest\" forest type.\n\t */\n\tReference = 0,\n\t/**\n\t * The \"ChunkedForest\" forest type.\n\t */\n\tOptimized = 1,\n}\n\nexport const defaultSharedTreeOptions: Required<SharedTreeOptions> = {\n\tjsonValidator: noopValidator,\n\tforest: ForestType.Reference,\n\ttreeEncodeType: TreeCompressionStrategy.Compressed,\n\tformatVersion: SharedTreeFormatVersion.v2,\n};\n\n/**\n * A channel factory that creates {@link ISharedTree}s.\n */\nexport class SharedTreeFactory implements IChannelFactory<ISharedTree> {\n\tpublic readonly type: string = \"https://graph.microsoft.com/types/tree\";\n\n\tpublic readonly attributes: IChannelAttributes = {\n\t\ttype: this.type,\n\t\tsnapshotFormatVersion: \"0.0.0\",\n\t\tpackageVersion: \"0.0.0\",\n\t};\n\n\tpublic constructor(private readonly options: SharedTreeOptions = {}) {}\n\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tchannelAttributes: Readonly<IChannelAttributes>,\n\t): Promise<SharedTree> {\n\t\tconst tree = new SharedTree(id, runtime, channelAttributes, this.options);\n\t\tawait tree.load(services);\n\t\treturn tree;\n\t}\n\n\tpublic create(runtime: IFluidDataStoreRuntime, id: string): SharedTree {\n\t\tconst tree = new SharedTree(id, runtime, this.attributes, this.options);\n\t\ttree.initializeLocal();\n\t\treturn tree;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sharedTree.js","sourceRoot":"","sources":["../../src/shared-tree/sharedTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAS7D,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,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ights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type {\n\tIChannelAttributes,\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n\tIChannelStorageService,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport type { ISharedObject } from \"@fluidframework/shared-object-base/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { type ICodecOptions, noopValidator } from \"../codec/index.js\";\nimport {\n\ttype JsonableTree,\n\tRevisionTagCodec,\n\ttype TreeStoredSchema,\n\tTreeStoredSchemaRepository,\n\tmakeDetachedFieldIndex,\n\tmoveToDetachedField,\n} from \"../core/index.js\";\nimport {\n\ttype HasListeners,\n\ttype IEmitter,\n\ttype Listenable,\n\tcreateEmitter,\n} from \"../events/index.js\";\nimport {\n\tDetachedFieldIndexSummarizer,\n\ttype FlexFieldSchema,\n\tForestSummarizer,\n\tSchemaSummarizer,\n\tTreeCompressionStrategy,\n\tViewSchema,\n\tbuildChunkedForest,\n\tbuildForest,\n\tcreateNodeKeyManager,\n\tdefaultSchemaPolicy,\n\tjsonableTreeFromFieldCursor,\n\tmakeFieldBatchCodec,\n\tmakeMitigatedChangeFamily,\n\tmakeTreeChunker,\n} from \"../feature-libraries/index.js\";\nimport {\n\tDefaultResubmitMachine,\n\ttype ExplicitCoreCodecVersions,\n\tSharedTreeCore,\n} from \"../shared-tree-core/index.js\";\nimport type {\n\tITree,\n\tImplicitFieldSchema,\n\t// eslint-disable-next-line import/no-deprecated\n\tTreeConfiguration,\n\tTreeView,\n\tTreeViewConfiguration,\n} from \"../simple-tree/index.js\";\n\nimport { type InitializeAndSchematizeConfiguration, ensureSchema } from \"./schematizeTree.js\";\nimport { SchematizingSimpleTreeView, requireSchema } from \"./schematizingTreeView.js\";\nimport { SharedTreeReadonlyChangeEnricher } from \"./sharedTreeChangeEnricher.js\";\nimport { SharedTreeChangeFamily } from \"./sharedTreeChangeFamily.js\";\nimport type { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\nimport type { SharedTreeEditBuilder } from \"./sharedTreeEditBuilder.js\";\nimport { type CheckoutEvents, type TreeCheckout, createTreeCheckout } from \"./treeCheckout.js\";\nimport type { CheckoutFlexTreeView, FlexTreeView } from \"./treeView.js\";\n\n/**\n * Copy of data from an {@link ISharedTree} at some point in time.\n * @remarks\n * This is unrelated to Fluids concept of \"snapshots\".\n * @internal\n */\nexport interface SharedTreeContentSnapshot {\n\t/**\n\t * The schema stored in the document.\n\t *\n\t * @remarks\n\t * Edits to the schema can mutate the schema stored of the tree which took this snapshot (but this snapshot will remain the same)\n\t * This is mainly useful for debugging cases where schematize reports an incompatible view schema.\n\t */\n\treadonly schema: TreeStoredSchema;\n\t/**\n\t * All {@link TreeStatus#InDocument} content.\n\t */\n\treadonly tree: JsonableTree[];\n\t/**\n\t * All {@link TreeStatus#Removed} content.\n\t */\n\treadonly removed: [string | number | undefined, number, JsonableTree][];\n}\n\n/**\n * Collaboratively editable tree distributed data-structure,\n * powered by {@link @fluidframework/shared-object-base#ISharedObject}.\n *\n * See [the README](../../README.md) for details.\n * @internal\n */\nexport interface ISharedTree extends ISharedObject, ITree {\n\t/**\n\t * Provides a copy of the current content of the tree.\n\t * This can be useful for inspecting the tree when no suitable view schema is available.\n\t * This is only intended for use in testing and exceptional code paths: it is not performant.\n\t *\n\t * This does not include everything that is included in a tree summary, since information about how to merge future edits is omitted.\n\t */\n\tcontentSnapshot(): SharedTreeContentSnapshot;\n\n\t/**\n\t * Like {@link ITree.viewWith}, but uses the flex-tree schema system and exposes the tree as a flex-tree.\n\t *\n\t * Returned view is disposed when the stored schema becomes incompatible with the view schema.\n\t * Undefined is returned if the stored data could not be made compatible with the view schema.\n\t */\n\tschematizeFlexTree<TRoot extends FlexFieldSchema>(\n\t\tconfig: InitializeAndSchematizeConfiguration<TRoot>,\n\t\tonDispose: () => void,\n\t): FlexTreeView<TRoot> | undefined;\n}\n\n/**\n * Has an entry for each codec which writes an explicit version into its data.\n *\n * This is used to map the single API entrypoint controlling the format {@link SharedTreeOptions.formatVersion}\n * to a list of write versions that for each codec that should be used for that format.\n *\n * Note that all explicitly versioned codecs should be using the format version from the data to read encoded data.\n *\n * TODO: Plumb these write versions into forest, schema, detached field index codec creation.\n */\ninterface ExplicitCodecVersions extends ExplicitCoreCodecVersions {\n\tforest: number;\n\tschema: number;\n\tdetachedFieldIndex: number;\n\tfieldBatch: number;\n}\n\nconst formatVersionToTopLevelCodecVersions = new Map<number, ExplicitCodecVersions>([\n\t[1, { forest: 1, schema: 1, detachedFieldIndex: 1, editManager: 1, message: 1, fieldBatch: 1 }],\n\t[2, { forest: 1, schema: 1, detachedFieldIndex: 1, editManager: 2, message: 2, fieldBatch: 1 }],\n\t[3, { forest: 1, schema: 1, detachedFieldIndex: 1, editManager: 3, message: 3, fieldBatch: 1 }],\n]);\n\nfunction getCodecVersions(formatVersion: number): ExplicitCodecVersions {\n\tconst versions = formatVersionToTopLevelCodecVersions.get(formatVersion);\n\tassert(versions !== undefined, 0x90e /* Unknown format version */);\n\treturn versions;\n}\n\n/**\n * Shared tree, configured with a good set of indexes and field kinds which will maintain compatibility over time.\n *\n * TODO: detail compatibility requirements.\n */\nexport class SharedTree\n\textends SharedTreeCore<SharedTreeEditBuilder, SharedTreeChange>\n\timplements ISharedTree\n{\n\tprivate readonly _events: Listenable<CheckoutEvents> &\n\t\tIEmitter<CheckoutEvents> &\n\t\tHasListeners<CheckoutEvents>;\n\tpublic readonly checkout: TreeCheckout;\n\tpublic get storedSchema(): TreeStoredSchemaRepository {\n\t\treturn this.checkout.storedSchema;\n\t}\n\n\tpublic constructor(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t\toptionsParam: SharedTreeOptions,\n\t\ttelemetryContextPrefix: string = \"fluid_sharedTree_\",\n\t) {\n\t\tif (runtime.idCompressor === undefined) {\n\t\t\tthrow new UsageError(\"IdCompressor must be enabled to use SharedTree\");\n\t\t}\n\n\t\tconst options = { ...defaultSharedTreeOptions, ...optionsParam };\n\t\tconst codecVersions = getCodecVersions(options.formatVersion);\n\t\tconst schema = new TreeStoredSchemaRepository();\n\t\tconst forest =\n\t\t\toptions.forest === ForestType.Optimized\n\t\t\t\t? buildChunkedForest(makeTreeChunker(schema, defaultSchemaPolicy))\n\t\t\t\t: buildForest();\n\t\tconst revisionTagCodec = new RevisionTagCodec(runtime.idCompressor);\n\t\tconst removedRoots = makeDetachedFieldIndex(\n\t\t\t\"repair\",\n\t\t\trevisionTagCodec,\n\t\t\truntime.idCompressor,\n\t\t\toptions,\n\t\t);\n\t\tconst schemaSummarizer = new SchemaSummarizer(runtime, schema, options, {\n\t\t\tgetCurrentSeq: () => this.deltaManager.lastSequenceNumber,\n\t\t});\n\t\tconst fieldBatchCodec = makeFieldBatchCodec(options, codecVersions.fieldBatch);\n\n\t\tconst encoderContext = {\n\t\t\tschema: {\n\t\t\t\tschema,\n\t\t\t\tpolicy: defaultSchemaPolicy,\n\t\t\t},\n\t\t\tencodeType: options.treeEncodeType,\n\t\t\toriginatorId: runtime.idCompressor.localSessionId,\n\t\t\tidCompressor: runtime.idCompressor,\n\t\t};\n\t\tconst forestSummarizer = new ForestSummarizer(\n\t\t\tforest,\n\t\t\trevisionTagCodec,\n\t\t\tfieldBatchCodec,\n\t\t\tencoderContext,\n\t\t\toptions,\n\t\t\truntime.idCompressor,\n\t\t);\n\t\tconst removedRootsSummarizer = new DetachedFieldIndexSummarizer(removedRoots);\n\t\tconst innerChangeFamily = new SharedTreeChangeFamily(\n\t\t\trevisionTagCodec,\n\t\t\tfieldBatchCodec,\n\t\t\toptions,\n\t\t\toptions.treeEncodeType,\n\t\t);\n\t\tconst changeFamily = makeMitigatedChangeFamily(\n\t\t\tinnerChangeFamily,\n\t\t\tSharedTreeChangeFamily.emptyChange,\n\t\t\t(error: unknown) => {\n\t\t\t\t// TODO:6344 Add telemetry for these errors.\n\t\t\t\t// Rethrowing the error has a different effect depending on the context in which the\n\t\t\t\t// ChangeFamily was invoked:\n\t\t\t\t// - If the ChangeFamily was invoked as part of incoming op processing, rethrowing the error\n\t\t\t\t// will cause the runtime to disconnect the client, log a severe error, and not reconnect.\n\t\t\t\t// This will not cause the host application to crash because it is not on the stack at that time.\n\t\t\t\t// TODO: let the host application know that the client is now disconnected.\n\t\t\t\t// - If the ChangeFamily was invoked as part of dealing with a local change, rethrowing the\n\t\t\t\t// error will cause the host application to crash. This is not ideal, but is better than\n\t\t\t\t// letting the application either send an invalid change to the server or allowing the\n\t\t\t\t// application to continue working when its local branches contain edits that cannot be\n\t\t\t\t// reflected in its views.\n\t\t\t\t// The best course of action for a host application in such a state is to restart.\n\t\t\t\t// TODO: let the host application know about this situation and provide a way to\n\t\t\t\t// programmatically reload the SharedTree container.\n\t\t\t\tthrow error;\n\t\t\t},\n\t\t);\n\t\tconst changeEnricher = new SharedTreeReadonlyChangeEnricher(forest, schema, removedRoots);\n\t\tsuper(\n\t\t\t[schemaSummarizer, forestSummarizer, removedRootsSummarizer],\n\t\t\tchangeFamily,\n\t\t\toptions,\n\t\t\tcodecVersions,\n\t\t\tid,\n\t\t\truntime,\n\t\t\tattributes,\n\t\t\ttelemetryContextPrefix,\n\t\t\tschema,\n\t\t\tdefaultSchemaPolicy,\n\t\t\tnew DefaultResubmitMachine(\n\t\t\t\tchangeFamily.rebaser.invert.bind(changeFamily.rebaser),\n\t\t\t\tchangeEnricher,\n\t\t\t),\n\t\t\tchangeEnricher,\n\t\t);\n\t\tthis._events = createEmitter<CheckoutEvents>();\n\t\tconst localBranch = this.getLocalBranch();\n\t\tthis.checkout = createTreeCheckout(\n\t\t\truntime.idCompressor,\n\t\t\tthis.mintRevisionTag,\n\t\t\trevisionTagCodec,\n\t\t\t{\n\t\t\t\tbranch: localBranch,\n\t\t\t\tchangeFamily,\n\t\t\t\tschema,\n\t\t\t\tforest,\n\t\t\t\tfieldBatchCodec,\n\t\t\t\tevents: this._events,\n\t\t\t\tremovedRoots,\n\t\t\t\tchunkCompressionStrategy: options.treeEncodeType,\n\t\t\t},\n\t\t);\n\t}\n\n\tpublic contentSnapshot(): SharedTreeContentSnapshot {\n\t\tconst cursor = this.checkout.forest.allocateCursor(\"contentSnapshot\");\n\t\ttry {\n\t\t\tmoveToDetachedField(this.checkout.forest, cursor);\n\t\t\treturn {\n\t\t\t\tschema: this.storedSchema.clone(),\n\t\t\t\ttree: jsonableTreeFromFieldCursor(cursor),\n\t\t\t\tremoved: this.checkout.getRemovedRoots(),\n\t\t\t};\n\t\t} finally {\n\t\t\tcursor.free();\n\t\t}\n\t}\n\n\tpublic schematizeFlexTree<TRoot extends FlexFieldSchema>(\n\t\tconfig: InitializeAndSchematizeConfiguration<TRoot>,\n\t\tonDispose: () => void,\n\t): CheckoutFlexTreeView<TRoot> | undefined {\n\t\tconst viewSchema = new ViewSchema(defaultSchemaPolicy, {}, config.schema);\n\t\tif (!ensureSchema(viewSchema, config.allowedSchemaModifications, this.checkout, config)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn requireSchema(\n\t\t\tthis.checkout,\n\t\t\tviewSchema,\n\t\t\tonDispose,\n\t\t\tcreateNodeKeyManager(this.runtime.idCompressor),\n\t\t);\n\t}\n\n\tpublic schematize<TRoot extends ImplicitFieldSchema>(\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tconfig: TreeConfiguration<TRoot>,\n\t): TreeView<TRoot> {\n\t\tconst view = new SchematizingSimpleTreeView(\n\t\t\tthis.checkout,\n\t\t\tconfig,\n\t\t\tcreateNodeKeyManager(this.runtime.idCompressor),\n\t\t);\n\t\t// As a subjective API design choice, we initialize the tree here if it is not already initialized.\n\t\tif (view.compatibility.canInitialize === true) {\n\t\t\tview.initialize(config.initialTree());\n\t\t}\n\t\treturn view;\n\t}\n\n\tpublic viewWith<TRoot extends ImplicitFieldSchema>(\n\t\tconfig: TreeViewConfiguration<TRoot>,\n\t): TreeView<TRoot> {\n\t\treturn new SchematizingSimpleTreeView(\n\t\t\tthis.checkout,\n\t\t\tconfig,\n\t\t\tcreateNodeKeyManager(this.runtime.idCompressor),\n\t\t);\n\t}\n\n\tprotected override async loadCore(services: IChannelStorageService): Promise<void> {\n\t\tawait super.loadCore(services);\n\t\tthis._events.emit(\"afterBatch\");\n\t}\n}\n\n/**\n * Format versions supported by SharedTree.\n *\n * Each version documents a required minimum version of the \\@fluidframework/tree package.\n * @internal\n */\nexport const SharedTreeFormatVersion = {\n\t/**\n\t * Requires \\@fluidframework/tree \\>= 2.0.0.\n\t *\n\t * @deprecated - FF does not currently plan on supporting this format long-term.\n\t * Do not write production documents using this format, as they may not be loadable in the future.\n\t */\n\tv1: 1,\n\n\t/**\n\t * Requires \\@fluidframework/tree \\>= 2.0.0.\n\t */\n\tv2: 2,\n\n\t/**\n\t * Requires \\@fluidframework/tree \\>= 2.0.0.\n\t */\n\tv3: 3,\n} as const;\n\n/**\n * Format versions supported by SharedTree.\n *\n * Each version documents a required minimum version of the \\@fluidframework/tree package.\n * @internal\n * @privateRemarks\n * See packages/dds/tree/docs/main/compatibility.md for information on how to add support for a new format.\n */\nexport type SharedTreeFormatVersion = typeof SharedTreeFormatVersion;\n\n/**\n * @internal\n */\nexport type SharedTreeOptions = Partial<ICodecOptions> &\n\tPartial<SharedTreeFormatOptions> & {\n\t\t/**\n\t\t * The {@link ForestType} indicating which forest type should be created for the SharedTree.\n\t\t */\n\t\tforest?: ForestType;\n\t};\n\n/**\n * Options for configuring the persisted format SharedTree uses.\n * @internal\n */\nexport interface SharedTreeFormatOptions {\n\t/**\n\t * See {@link TreeCompressionStrategy}.\n\t * default: TreeCompressionStrategy.Compressed\n\t */\n\ttreeEncodeType: TreeCompressionStrategy;\n\t/**\n\t * The format version SharedTree should use to persist documents.\n\t *\n\t * This option has compatibility implications for applications using SharedTree.\n\t * Each version documents a required minimum version of \\@fluidframework/tree.\n\t * If this minimum version fails to be met, the SharedTree may fail to load.\n\t * To be safe, application authors should verify that they have saturated this version\n\t * of \\@fluidframework/tree in their ecosystem before changing the format version.\n\t *\n\t * This option defaults to SharedTreeFormatVersion.v2.\n\t */\n\tformatVersion: SharedTreeFormatVersion[keyof SharedTreeFormatVersion];\n}\n\n/**\n * Used to distinguish between different forest types.\n * @internal\n */\nexport enum ForestType {\n\t/**\n\t * The \"ObjectForest\" forest type.\n\t */\n\tReference = 0,\n\t/**\n\t * The \"ChunkedForest\" forest type.\n\t */\n\tOptimized = 1,\n}\n\nexport const defaultSharedTreeOptions: Required<SharedTreeOptions> = {\n\tjsonValidator: noopValidator,\n\tforest: ForestType.Reference,\n\ttreeEncodeType: TreeCompressionStrategy.Compressed,\n\tformatVersion: SharedTreeFormatVersion.v3,\n};\n\n/**\n * A channel factory that creates {@link ISharedTree}s.\n */\nexport class SharedTreeFactory implements IChannelFactory<ISharedTree> {\n\tpublic readonly type: string = \"https://graph.microsoft.com/types/tree\";\n\n\tpublic readonly attributes: IChannelAttributes = {\n\t\ttype: this.type,\n\t\tsnapshotFormatVersion: \"0.0.0\",\n\t\tpackageVersion: \"0.0.0\",\n\t};\n\n\tpublic constructor(private readonly options: SharedTreeOptions = {}) {}\n\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tchannelAttributes: Readonly<IChannelAttributes>,\n\t): Promise<SharedTree> {\n\t\tconst tree = new SharedTree(id, runtime, channelAttributes, this.options);\n\t\tawait tree.load(services);\n\t\treturn tree;\n\t}\n\n\tpublic create(runtime: IFluidDataStoreRuntime, id: string): SharedTree {\n\t\tconst tree = new SharedTree(id, runtime, this.attributes, this.options);\n\t\ttree.initializeLocal();\n\t\treturn tree;\n\t}\n}\n"]}
|