@fluidframework/tree 2.51.0 → 2.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +0 -1
- package/CHANGELOG.md +43 -0
- package/api-report/tree.alpha.api.md +3 -2
- package/dist/codec/codec.d.ts +2 -1
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +4 -3
- package/dist/codec/codec.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/index.d.ts +1 -1
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js +2 -1
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +3 -1
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +2 -1
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +1 -23
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +2 -2
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +2 -3
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +17 -0
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -0
- package/dist/core/tree/detachedFieldIndexCodecCommon.js +68 -0
- package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -0
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts +11 -0
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -0
- package/dist/core/tree/detachedFieldIndexCodecV1.js +55 -0
- package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -0
- package/dist/core/tree/detachedFieldIndexCodecV2.d.ts +11 -0
- package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -0
- package/dist/core/tree/detachedFieldIndexCodecV2.js +49 -0
- package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -0
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts +11 -0
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -0
- package/dist/core/tree/detachedFieldIndexCodecs.js +26 -0
- package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -0
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +37 -0
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -0
- package/dist/core/tree/{detachedFieldIndexFormat.js → detachedFieldIndexFormatCommon.js} +18 -13
- package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -0
- package/dist/core/tree/detachedFieldIndexFormatV1.d.ts +13 -0
- package/dist/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -0
- package/dist/core/tree/detachedFieldIndexFormatV1.js +12 -0
- package/dist/core/tree/detachedFieldIndexFormatV1.js.map +1 -0
- package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +14 -0
- package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -0
- package/dist/core/tree/detachedFieldIndexFormatV2.js +14 -0
- package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +9 -9
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +21 -21
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +4 -2
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +4 -4
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +50 -31
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +74 -61
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts +20 -14
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.js +18 -12
- package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/{lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts → dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts} +20 -14
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -0
- package/dist/feature-libraries/chunked-forest/codec/{nodeShape.js → nodeEncoder.js} +23 -17
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +7 -7
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +22 -22
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +2 -2
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +5 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +14 -2
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultSchema.js +0 -2
- package/dist/feature-libraries/default-schema/defaultSchema.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js +2 -2
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts +14 -4
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js +31 -26
- package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +1 -2
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +2 -4
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.d.ts +5 -6
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +15 -16
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -3
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +2 -3
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -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/shared-tree/independentView.d.ts +8 -0
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +23 -11
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/schematizeTree.js +1 -1
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +0 -1
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +7 -10
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +1 -29
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +20 -6
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +9 -4
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +2 -1
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +32 -0
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +1 -1
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/simple-tree/api/conciseTree.d.ts +2 -2
- package/dist/simple-tree/api/conciseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/conciseTree.js +6 -6
- package/dist/simple-tree/api/conciseTree.js.map +1 -1
- package/dist/simple-tree/api/configuration.d.ts +8 -2
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/create.d.ts +8 -7
- package/dist/simple-tree/api/create.d.ts.map +1 -1
- package/dist/simple-tree/api/create.js +35 -22
- package/dist/simple-tree/api/create.js.map +1 -1
- package/dist/simple-tree/api/customTree.d.ts +25 -4
- package/dist/simple-tree/api/customTree.d.ts.map +1 -1
- package/dist/simple-tree/api/customTree.js +42 -16
- package/dist/simple-tree/api/customTree.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts +98 -0
- package/dist/simple-tree/api/discrepancies.d.ts.map +1 -0
- package/dist/simple-tree/api/discrepancies.js +255 -0
- package/dist/simple-tree/api/discrepancies.js.map +1 -0
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +9 -7
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js +18 -117
- package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +7 -4
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +5 -1
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/treeBeta.d.ts +2 -2
- package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/treeBeta.js +10 -4
- package/dist/simple-tree/api/treeBeta.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.d.ts +2 -2
- package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +15 -15
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.d.ts +20 -4
- package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
- package/dist/simple-tree/core/allowedTypes.js +45 -13
- package/dist/simple-tree/core/allowedTypes.js.map +1 -1
- package/dist/simple-tree/core/context.d.ts +13 -2
- package/dist/simple-tree/core/context.d.ts.map +1 -1
- package/dist/simple-tree/core/context.js +22 -9
- package/dist/simple-tree/core/context.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +2 -2
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +3 -1
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.d.ts +1 -1
- package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.js +8 -1
- package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
- package/dist/simple-tree/core/walkSchema.d.ts +3 -0
- package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/walkSchema.js +2 -0
- package/dist/simple-tree/core/walkSchema.js.map +1 -1
- package/dist/simple-tree/createContext.d.ts +2 -0
- package/dist/simple-tree/createContext.d.ts.map +1 -1
- package/dist/simple-tree/createContext.js +3 -1
- package/dist/simple-tree/createContext.js.map +1 -1
- package/dist/simple-tree/fieldSchema.d.ts +1 -0
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/fieldSchema.js +1 -0
- package/dist/simple-tree/fieldSchema.js.map +1 -1
- package/dist/simple-tree/index.d.ts +4 -4
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +7 -8
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/index.d.ts +1 -1
- package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/index.js +1 -2
- package/dist/simple-tree/node-kinds/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/index.d.ts +1 -1
- package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/index.js +1 -2
- package/dist/simple-tree/node-kinds/object/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts +2 -7
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +4 -18
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/prepareForInsertion.d.ts +5 -5
- package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/dist/simple-tree/prepareForInsertion.js +9 -3
- package/dist/simple-tree/prepareForInsertion.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts +3 -0
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +3 -0
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +2 -2
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/dist/simple-tree/walkFieldSchema.d.ts +1 -0
- package/dist/simple-tree/walkFieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/walkFieldSchema.js +1 -0
- package/dist/simple-tree/walkFieldSchema.js.map +1 -1
- package/lib/codec/codec.d.ts +2 -1
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +4 -3
- package/lib/codec/codec.js.map +1 -1
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/index.d.ts +1 -1
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +3 -1
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +1 -0
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +1 -23
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +2 -2
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +2 -3
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +17 -0
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -0
- package/lib/core/tree/detachedFieldIndexCodecCommon.js +64 -0
- package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -0
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts +11 -0
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -0
- package/lib/core/tree/detachedFieldIndexCodecV1.js +51 -0
- package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -0
- package/lib/core/tree/detachedFieldIndexCodecV2.d.ts +11 -0
- package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -0
- package/lib/core/tree/detachedFieldIndexCodecV2.js +45 -0
- package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -0
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts +11 -0
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -0
- package/lib/core/tree/detachedFieldIndexCodecs.js +21 -0
- package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -0
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +37 -0
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -0
- package/lib/core/tree/{detachedFieldIndexFormat.js → detachedFieldIndexFormatCommon.js} +13 -10
- package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -0
- package/lib/core/tree/detachedFieldIndexFormatV1.d.ts +13 -0
- package/lib/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -0
- package/lib/core/tree/detachedFieldIndexFormatV1.js +9 -0
- package/lib/core/tree/detachedFieldIndexFormatV1.js.map +1 -0
- package/lib/core/tree/detachedFieldIndexFormatV2.d.ts +14 -0
- package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -0
- package/lib/core/tree/detachedFieldIndexFormatV2.js +11 -0
- package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +9 -9
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +19 -19
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +4 -2
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +4 -4
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +50 -31
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +70 -57
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts +20 -14
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.js +17 -11
- package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/{dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts → lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts} +20 -14
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -0
- package/lib/feature-libraries/chunked-forest/codec/{nodeShape.js → nodeEncoder.js} +21 -15
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +7 -7
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +19 -19
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +2 -2
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +5 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +14 -2
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultSchema.js +0 -2
- package/lib/feature-libraries/default-schema/defaultSchema.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js +1 -1
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts +14 -4
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js +29 -24
- package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +1 -2
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +1 -2
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.d.ts +5 -6
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +14 -14
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -3
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +3 -4
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/independentView.d.ts +8 -0
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +21 -10
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/schematizeTree.js +1 -1
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +0 -1
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +8 -11
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +2 -30
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +20 -6
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +10 -5
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +2 -1
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +33 -1
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +1 -1
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/simple-tree/api/conciseTree.d.ts +2 -2
- package/lib/simple-tree/api/conciseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/conciseTree.js +6 -6
- package/lib/simple-tree/api/conciseTree.js.map +1 -1
- package/lib/simple-tree/api/configuration.d.ts +8 -2
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/create.d.ts +8 -7
- package/lib/simple-tree/api/create.d.ts.map +1 -1
- package/lib/simple-tree/api/create.js +38 -25
- package/lib/simple-tree/api/create.js.map +1 -1
- package/lib/simple-tree/api/customTree.d.ts +25 -4
- package/lib/simple-tree/api/customTree.d.ts.map +1 -1
- package/lib/simple-tree/api/customTree.js +43 -17
- package/lib/simple-tree/api/customTree.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts +98 -0
- package/lib/simple-tree/api/discrepancies.d.ts.map +1 -0
- package/lib/simple-tree/{discrepancies.js → api/discrepancies.js} +80 -206
- package/lib/simple-tree/api/discrepancies.js.map +1 -0
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +9 -7
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.js +19 -118
- package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +7 -4
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +6 -2
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/treeBeta.d.ts +2 -2
- package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/treeBeta.js +8 -2
- package/lib/simple-tree/api/treeBeta.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.d.ts +2 -2
- package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +9 -9
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.d.ts +20 -4
- package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
- package/lib/simple-tree/core/allowedTypes.js +42 -12
- package/lib/simple-tree/core/allowedTypes.js.map +1 -1
- package/lib/simple-tree/core/context.d.ts +13 -2
- package/lib/simple-tree/core/context.d.ts.map +1 -1
- package/lib/simple-tree/core/context.js +22 -9
- package/lib/simple-tree/core/context.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +2 -2
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +2 -2
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.d.ts +1 -1
- package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.js +8 -1
- package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
- package/lib/simple-tree/core/walkSchema.d.ts +3 -0
- package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/walkSchema.js +2 -0
- package/lib/simple-tree/core/walkSchema.js.map +1 -1
- package/lib/simple-tree/createContext.d.ts +2 -0
- package/lib/simple-tree/createContext.d.ts.map +1 -1
- package/lib/simple-tree/createContext.js +3 -1
- package/lib/simple-tree/createContext.js.map +1 -1
- package/lib/simple-tree/fieldSchema.d.ts +1 -0
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/fieldSchema.js +1 -0
- package/lib/simple-tree/fieldSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +4 -4
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +4 -4
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/index.d.ts +1 -1
- package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/index.js +1 -1
- package/lib/simple-tree/node-kinds/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/index.d.ts +1 -1
- package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/index.js +1 -1
- package/lib/simple-tree/node-kinds/object/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts +2 -7
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +3 -16
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/prepareForInsertion.d.ts +5 -5
- package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/lib/simple-tree/prepareForInsertion.js +11 -5
- package/lib/simple-tree/prepareForInsertion.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts +3 -0
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +3 -0
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +2 -2
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/lib/simple-tree/walkFieldSchema.d.ts +1 -0
- package/lib/simple-tree/walkFieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/walkFieldSchema.js +1 -0
- package/lib/simple-tree/walkFieldSchema.js.map +1 -1
- package/package.json +23 -23
- package/src/codec/codec.ts +4 -3
- package/src/core/index.ts +2 -0
- package/src/core/rebase/index.ts +2 -0
- package/src/core/rebase/types.ts +4 -0
- package/src/core/schema-stored/schema.ts +2 -26
- package/src/core/tree/detachedFieldIndex.ts +4 -6
- package/src/core/tree/detachedFieldIndexCodecCommon.ts +87 -0
- package/src/core/tree/{detachedFieldIndexCodec.ts → detachedFieldIndexCodecV1.ts} +22 -68
- package/src/core/tree/detachedFieldIndexCodecV2.ts +72 -0
- package/src/core/tree/detachedFieldIndexCodecs.ts +44 -0
- package/src/core/tree/{detachedFieldIndexFormat.ts → detachedFieldIndexFormatCommon.ts} +32 -23
- package/src/core/tree/detachedFieldIndexFormatV1.ts +15 -0
- package/src/core/tree/detachedFieldIndexFormatV2.ts +17 -0
- package/src/feature-libraries/chunked-forest/codec/README.md +1 -1
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +25 -25
- package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +10 -6
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +96 -73
- package/src/feature-libraries/chunked-forest/codec/format.ts +20 -14
- package/src/feature-libraries/chunked-forest/codec/{nodeShape.ts → nodeEncoder.ts} +23 -17
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +34 -34
- package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +5 -5
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +10 -0
- package/src/feature-libraries/default-schema/defaultSchema.ts +0 -2
- package/src/feature-libraries/default-schema/index.ts +1 -1
- package/src/feature-libraries/default-schema/schemaChecker.ts +47 -30
- package/src/feature-libraries/index.ts +1 -3
- package/src/feature-libraries/modular-schema/comparison.ts +14 -29
- package/src/feature-libraries/object-forest/objectForest.ts +10 -6
- package/src/index.ts +5 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +45 -19
- package/src/shared-tree/schematizeTree.ts +1 -1
- package/src/shared-tree/schematizingTreeView.ts +16 -13
- package/src/shared-tree/sharedTree.ts +2 -42
- package/src/shared-tree/treeAlpha.ts +30 -18
- package/src/shared-tree/treeCheckout.ts +54 -10
- package/src/shared-tree-core/branch.ts +1 -6
- package/src/simple-tree/api/conciseTree.ts +9 -7
- package/src/simple-tree/api/configuration.ts +8 -2
- package/src/simple-tree/api/create.ts +49 -36
- package/src/simple-tree/api/customTree.ts +59 -20
- package/src/simple-tree/{discrepancies.ts → api/discrepancies.ts} +128 -303
- package/src/simple-tree/api/schemaCompatibilityTester.ts +27 -151
- package/src/simple-tree/api/schemaFactory.ts +7 -4
- package/src/simple-tree/api/storedSchema.ts +6 -9
- package/src/simple-tree/api/treeBeta.ts +17 -4
- package/src/simple-tree/api/verboseTree.ts +17 -8
- package/src/simple-tree/core/allowedTypes.ts +54 -21
- package/src/simple-tree/core/context.ts +24 -22
- package/src/simple-tree/core/index.ts +2 -1
- package/src/simple-tree/core/treeNodeKernel.ts +1 -1
- package/src/simple-tree/core/treeNodeValid.ts +9 -2
- package/src/simple-tree/core/walkSchema.ts +3 -0
- package/src/simple-tree/createContext.ts +6 -1
- package/src/simple-tree/fieldSchema.ts +1 -0
- package/src/simple-tree/index.ts +5 -10
- package/src/simple-tree/node-kinds/array/arrayNode.ts +32 -19
- package/src/simple-tree/node-kinds/index.ts +0 -1
- package/src/simple-tree/node-kinds/object/index.ts +0 -1
- package/src/simple-tree/node-kinds/object/objectNode.ts +9 -27
- package/src/simple-tree/prepareForInsertion.ts +17 -9
- package/src/simple-tree/toStoredSchema.ts +3 -0
- package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +6 -2
- package/src/simple-tree/walkFieldSchema.ts +1 -0
- package/dist/core/tree/detachedFieldIndexCodec.d.ts +0 -11
- package/dist/core/tree/detachedFieldIndexCodec.d.ts.map +0 -1
- package/dist/core/tree/detachedFieldIndexCodec.js +0 -100
- package/dist/core/tree/detachedFieldIndexCodec.js.map +0 -1
- package/dist/core/tree/detachedFieldIndexFormat.d.ts +0 -33
- package/dist/core/tree/detachedFieldIndexFormat.d.ts.map +0 -1
- package/dist/core/tree/detachedFieldIndexFormat.js.map +0 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +0 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +0 -1
- package/dist/feature-libraries/initializeForest.d.ts +0 -18
- package/dist/feature-libraries/initializeForest.d.ts.map +0 -1
- package/dist/feature-libraries/initializeForest.js +0 -35
- package/dist/feature-libraries/initializeForest.js.map +0 -1
- package/dist/simple-tree/discrepancies.d.ts +0 -167
- package/dist/simple-tree/discrepancies.d.ts.map +0 -1
- package/dist/simple-tree/discrepancies.js +0 -382
- package/dist/simple-tree/discrepancies.js.map +0 -1
- package/lib/core/tree/detachedFieldIndexCodec.d.ts +0 -11
- package/lib/core/tree/detachedFieldIndexCodec.d.ts.map +0 -1
- package/lib/core/tree/detachedFieldIndexCodec.js +0 -96
- package/lib/core/tree/detachedFieldIndexCodec.js.map +0 -1
- package/lib/core/tree/detachedFieldIndexFormat.d.ts +0 -33
- package/lib/core/tree/detachedFieldIndexFormat.d.ts.map +0 -1
- package/lib/core/tree/detachedFieldIndexFormat.js.map +0 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +0 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +0 -1
- package/lib/feature-libraries/initializeForest.d.ts +0 -18
- package/lib/feature-libraries/initializeForest.d.ts.map +0 -1
- package/lib/feature-libraries/initializeForest.js +0 -31
- package/lib/feature-libraries/initializeForest.js.map +0 -1
- package/lib/simple-tree/discrepancies.d.ts +0 -167
- package/lib/simple-tree/discrepancies.d.ts.map +0 -1
- package/lib/simple-tree/discrepancies.js.map +0 -1
- package/src/feature-libraries/initializeForest.ts +0 -55
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modularChangeFormat.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAsB,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAE1E,OAAO,EAAE,KAAK,gBAAgB,EAAqB,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EACN,KAAK,sBAAsB,EAG3B,MAAM,qBAAqB,CAAC;AAK7B,eAAO,MAAM,sBAAsB,uDAEjC,CAAC;AAEH,eAAO,MAAM,mBAAmB,2aAG9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAErE,QAAA,MAAM,kBAAkB;;;;EAUvB,CAAC;AAEF,MAAM,WAA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OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectForest.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/object-forest/objectForest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAGlE,OAAO,EACN,KAAK,MAAM,EACX,SAAS,EACT,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EAEvB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,eAAe,EAEpB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,4BAA4B,EAC5B,KAAK,OAAO,EACZ,KAAK,cAAc,EAGnB,KAAK,SAAS,EAEd,oBAAoB,EACpB,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,MAAM,EACX,KAAK,KAAK,EAKV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAMN,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,cAAc,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAQ/E,sCAAsC;AACtC,UAAU,cAAe,SAAQ,OAAO;IACvC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,EAAE,cAAc,EAAE,CAAC,CAAC;CACjD;AAcD;;;;;GAKG;AACH,qBAAa,YAAa,YAAW,eAAe,EAAE,aAAa;;aAgBjD,OAAO,EAAE,SAAS;IAClC;;OAEG;aACa,MAAM,EAAE,4BAA4B,GAAG,SAAS;aAChD,OAAO,EAAE,SAAS;aAClB,iBAAiB,EAAE,OAAO;IArB3C,OAAO,CAAC,aAAa,CAAC,CAAe;IAGrC,SAAgB,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAa;IACxD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA0C;IAGxE,SAAgB,MAAM,EAAE,UAAU,CAAC,YAAY,CAAC,CAAgB;IAGhE,IAAW,KAAK,IAAI,OAAO,CAE1B;gBAGgB,OAAO,EAAE,SAAS;IAClC;;OAEG;IACa,MAAM,EAAE,4BAA4B,GAAG,SAAS,EAChD,OAAO,GAAE,SAA2B,EACpC,iBAAiB,GAAE,OAAe,EAClD,KAAK,CAAC,EAAE,OAAO;IAehB,IAAW,OAAO,IAAI,OAAO,CAE5B;IAEM,KAAK,CAAC,MAAM,EAAE,4BAA4B,EAAE,OAAO,EAAE,SAAS,GAAG,YAAY;IAI7E,UAAU,CAAC,MAAM,EAAE,sBAAsB,GAAG,SAAS;IAIrD,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAIzC;;OAEG;IAEI,WAAW,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"objectForest.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/object-forest/objectForest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAGlE,OAAO,EACN,KAAK,MAAM,EACX,SAAS,EACT,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EAEvB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,eAAe,EAEpB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,4BAA4B,EAC5B,KAAK,OAAO,EACZ,KAAK,cAAc,EAGnB,KAAK,SAAS,EAEd,oBAAoB,EACpB,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,MAAM,EACX,KAAK,KAAK,EAKV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAMN,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,MAAM,qBAAqB,CAAC;AAG7B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,MAAM,GAAG,OAAO;IAIlC,QAAQ,IAAI,OAAO;IAInB,QAAQ,IAAI,IAAI;IAIhB,UAAU,IAAI,OAAO;IAIrB,UAAU,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI;IAItC,IAAW,IAAI,IAAI,wBAAwB,CAG1C;IACD,IAAW,KAAK,IAAI,KAAK,CAGxB;IAGM,KAAK,IAAI,IAAI;IAUpB;;;OAGG;IACI,2BAA2B,IAAI,IAAI;IAcnC,OAAO,IAAI,cAAc;IAKzB,SAAS,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC;IAUvC,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,uBAAuB;IAK9C,IAAI,IAAI,IAAI;IASZ,WAAW,IAAI,MAAM;CAO5B;AAKD;;;;;GAKG;AACH,wBAAgB,WAAW,CAC1B,OAAO,EAAE,SAAS,EAClB,MAAM,CAAC,EAAE,4BAA4B,EACrC,OAAO,CAAC,EAAE,SAAS,EACnB,iBAAiB,GAAE,OAAe,GAChC,YAAY,CAEd"}
|
|
@@ -54,7 +54,7 @@ import { assertNonNegativeSafeInteger, assertValidIndex, assertValidRange, brand
|
|
|
54
54
|
import { chunkFieldSingle, defaultChunkPolicy } from "../chunked-forest/index.js";
|
|
55
55
|
import { cursorForMapTreeNode, mapTreeFromCursor } from "../mapTreeCursor.js";
|
|
56
56
|
import { SynchronousCursor } from "../treeCursorUtils.js";
|
|
57
|
-
import { defaultSchemaPolicy, FieldKinds,
|
|
57
|
+
import { defaultSchemaPolicy, FieldKinds, isFieldInSchema, throwOutOfSchema, } from "../default-schema/index.js";
|
|
58
58
|
/** Get a field from a `MutableMapTree`, optionally modifying the tree to create it if missing. */
|
|
59
59
|
function getOrCreateField(mapTree, key) {
|
|
60
60
|
const field = mapTree.fields.get(key);
|
|
@@ -136,11 +136,10 @@ let ObjectForest = (() => {
|
|
|
136
136
|
// Metadata is not used for schema checks
|
|
137
137
|
persistedMetadata: undefined,
|
|
138
138
|
};
|
|
139
|
-
|
|
139
|
+
isFieldInSchema(documentRoot, fieldSchema, {
|
|
140
140
|
schema,
|
|
141
141
|
policy: defaultSchemaPolicy,
|
|
142
|
-
});
|
|
143
|
-
inSchemaOrThrow(maybeError);
|
|
142
|
+
}, throwOutOfSchema);
|
|
144
143
|
}
|
|
145
144
|
}
|
|
146
145
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectForest.js","sourceRoot":"","sources":["../../../src/feature-libraries/object-forest/objectForest.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAEnE,OAAO,EAEN,SAAS,EAcT,4BAA4B,EAY5B,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,YAAY,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,4BAA4B,EAC5B,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,EACL,cAAc,GAGd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAuB,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EACN,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,eAAe,GACf,MAAM,4BAA4B,CAAC;AAOpC,kGAAkG;AAClG,SAAS,gBAAgB,CAAC,OAAuB,EAAE,GAAa;IAC/D,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACtC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC;IACd,CAAC;IAED,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,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,KAAK,GAAG,4BAA4B,CAAC,KAAK,CAAC;IACjD,CAAC;IAEM,WAAW;QACjB,MAAM,CACL,IAAI,CAAC,KAAK,KAAK,4BAA4B,CAAC,OAAO,EACnD,KAAK,CAAC,uCAAuC,CAC7C,CAAC;QACF,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAClD,CAAC;CACD;AAED,qGAAqG;AACrG,sEAAsE;AACtE,yFAAyF;AACzF;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAC1B,OAAkB,EAClB,MAAqC,EACrC,OAAmB,EACnB,oBAA6B,KAAK;IAElC,OAAO,IAAI,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC;AACtE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { createEmitter } from \"@fluid-internal/client-utils\";\nimport type { Listenable } from \"@fluidframework/core-interfaces\";\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype Anchor,\n\tAnchorSet,\n\ttype AnnouncedVisitor,\n\ttype CursorLocationType,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaVisitor,\n\ttype DetachedField,\n\ttype FieldAnchor,\n\ttype FieldKey,\n\ttype FieldUpPath,\n\ttype ForestEvents,\n\ttype IEditableForest,\n\ttype ITreeCursor,\n\ttype ITreeCursorSynchronous,\n\ttype ITreeSubscriptionCursor,\n\tITreeSubscriptionCursorState,\n\ttype MapTree,\n\ttype PathRootPrefix,\n\ttype PlaceIndex,\n\ttype Range,\n\ttype TreeChunk,\n\ttype TreeFieldStoredSchema,\n\tTreeNavigationResult,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeStoredSchemaSubscription,\n\ttype UpPath,\n\ttype Value,\n\taboveRootPlaceholder,\n\tcombineVisitors,\n\tdeepCopyMapTree,\n\trootFieldKey,\n} from \"../../core/index.js\";\nimport {\n\tassertNonNegativeSafeInteger,\n\tassertValidIndex,\n\tassertValidRange,\n\tbrand,\n\tbreakingMethod,\n\ttype Breakable,\n\ttype WithBreakable,\n} from \"../../util/index.js\";\nimport { chunkFieldSingle, defaultChunkPolicy } from \"../chunked-forest/index.js\";\nimport { cursorForMapTreeNode, mapTreeFromCursor } from \"../mapTreeCursor.js\";\nimport { type CursorWithNode, SynchronousCursor } from \"../treeCursorUtils.js\";\nimport {\n\tdefaultSchemaPolicy,\n\tFieldKinds,\n\tinSchemaOrThrow,\n\tisFieldInSchema,\n} from \"../default-schema/index.js\";\n\n/** A `MapTree` with mutable fields */\ninterface MutableMapTree extends MapTree {\n\treadonly fields: Map<FieldKey, MutableMapTree[]>;\n}\n\n/** Get a field from a `MutableMapTree`, optionally modifying the tree to create it if missing. */\nfunction getOrCreateField(mapTree: MutableMapTree, key: FieldKey): MutableMapTree[] {\n\tconst field = mapTree.fields.get(key);\n\tif (field !== undefined) {\n\t\treturn field;\n\t}\n\n\tconst newField: MutableMapTree[] = [];\n\tmapTree.fields.set(key, newField);\n\treturn newField;\n}\n\n/**\n * Reference implementation of IEditableForest.\n *\n * This implementation focuses on correctness and simplicity, not performance.\n * It does not use compressed chunks: instead nodes are implemented using objects.\n */\nexport class ObjectForest implements IEditableForest, WithBreakable {\n\tprivate activeVisitor?: DeltaVisitor;\n\n\t// All cursors that are in the \"Current\" state. Must be empty when editing.\n\tpublic readonly currentCursors: Set<Cursor> = new Set();\n\tprivate readonly deltaVisitors: Set<() => AnnouncedVisitor> = new Set();\n\n\treadonly #events = createEmitter<ForestEvents>();\n\tpublic readonly events: Listenable<ForestEvents> = this.#events;\n\n\treadonly #roots: MutableMapTree;\n\tpublic get roots(): MapTree {\n\t\treturn this.#roots;\n\t}\n\n\tpublic constructor(\n\t\tpublic readonly breaker: Breakable,\n\t\t/**\n\t\t * If provided, may be used for validation, but otherwise unused.\n\t\t */\n\t\tpublic readonly schema: TreeStoredSchemaSubscription | undefined,\n\t\tpublic readonly anchors: AnchorSet = new AnchorSet(),\n\t\tpublic readonly additionalAsserts: boolean = false,\n\t\troots?: MapTree,\n\t) {\n\t\tthis.#roots =\n\t\t\troots !== undefined\n\t\t\t\t? deepCopyMapTree(roots)\n\t\t\t\t: {\n\t\t\t\t\t\ttype: aboveRootPlaceholder,\n\t\t\t\t\t\tfields: new Map(),\n\t\t\t\t\t};\n\n\t\tif (additionalAsserts) {\n\t\t\tthis.checkSchema();\n\t\t}\n\t}\n\n\tpublic get isEmpty(): boolean {\n\t\treturn this.roots.fields.size === 0;\n\t}\n\n\tpublic clone(schema: TreeStoredSchemaSubscription, anchors: AnchorSet): ObjectForest {\n\t\treturn new ObjectForest(this.breaker, schema, anchors, this.additionalAsserts, this.roots);\n\t}\n\n\tpublic chunkField(cursor: ITreeCursorSynchronous): TreeChunk {\n\t\treturn chunkFieldSingle(cursor, { idCompressor: undefined, policy: defaultChunkPolicy });\n\t}\n\n\tpublic forgetAnchor(anchor: Anchor): void {\n\t\tthis.anchors.forget(anchor);\n\t}\n\n\t/**\n\t * Throw (and break) if content does not match schema.\n\t */\n\t@breakingMethod\n\tpublic checkSchema(): void {\n\t\tconst schema = this.schema;\n\t\tif (schema !== undefined) {\n\t\t\tconst roots = new Set([...this.roots.fields.keys(), rootFieldKey]);\n\t\t\tfor (const key of roots) {\n\t\t\t\tconst documentRoot = this.roots.fields.get(key) ?? [];\n\t\t\t\tconst fieldSchema: TreeFieldStoredSchema =\n\t\t\t\t\tkey === rootFieldKey\n\t\t\t\t\t\t? schema.rootFieldSchema\n\t\t\t\t\t\t: // TODO: someday we should have schema for detached fields, and use that instead of generating one here.\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Some detached fields may have multiple nodes, so we must treat them as sequences:\n\t\t\t\t\t\t\t\tkind: FieldKinds.sequence.identifier,\n\t\t\t\t\t\t\t\ttypes: new Set(documentRoot.map((node) => node.type)),\n\n\t\t\t\t\t\t\t\t// Metadata is not used for schema checks\n\t\t\t\t\t\t\t\tpersistedMetadata: undefined,\n\t\t\t\t\t\t\t};\n\t\t\t\tconst maybeError = isFieldInSchema(documentRoot, fieldSchema, {\n\t\t\t\t\tschema,\n\t\t\t\t\tpolicy: defaultSchemaPolicy,\n\t\t\t\t});\n\t\t\t\tinSchemaOrThrow(maybeError);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic acquireVisitor(): DeltaVisitor {\n\t\tassert(\n\t\t\tthis.activeVisitor === undefined,\n\t\t\t0x76c /* Must release existing visitor before acquiring another */,\n\t\t);\n\n\t\t// Note: This code uses cursors, however it also modifies the tree.\n\t\t// In general this is not safe, but this code happens to only modify the tree below the current cursor location,\n\t\t// which happens to work.\n\t\t// This pattern could be generalized/formalized with a concept of an exclusive cursor,\n\t\t// which can edit, but is the only cursor allowed at the time.\n\n\t\tconst cursor: Cursor = this.allocateCursor(\"acquireVisitor\");\n\t\tcursor.setToAboveDetachedSequences();\n\n\t\t/**\n\t\t * Called before each edit to allow cursor cleanup to happen and ensure that there are no unexpected cursors.\n\t\t * This is required for each change since there may be app facing change event handlers which create cursors.\n\t\t */\n\t\tconst preEdit = (): void => {\n\t\t\tthis.#events.emit(\"beforeChange\");\n\t\t\tassert(\n\t\t\t\tthis.currentCursors.has(cursor),\n\t\t\t\t0x995 /* missing visitor cursor while editing */,\n\t\t\t);\n\t\t\tif (this.currentCursors.size > 1) {\n\t\t\t\tconst unexpectedSources = [...this.currentCursors].flatMap((c) =>\n\t\t\t\t\tc === cursor ? [] : (c.source ?? null),\n\t\t\t\t);\n\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Found unexpected cursors when editing with the following annotations: ${JSON.stringify(\n\t\t\t\t\t\tunexpectedSources,\n\t\t\t\t\t)}`,\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\n\t\tclass Visitor implements DeltaVisitor {\n\t\t\tpublic constructor(private readonly forest: ObjectForest) {}\n\t\t\tpublic free(): void {\n\t\t\t\tcursor.free();\n\t\t\t\tassert(\n\t\t\t\t\tthis.forest.activeVisitor !== undefined,\n\t\t\t\t\t0x76d /* Multiple free calls for same visitor */,\n\t\t\t\t);\n\t\t\t\tthis.forest.activeVisitor = undefined;\n\t\t\t\tif (this.forest.additionalAsserts) {\n\t\t\t\t\t// Schema validation:\n\t\t\t\t\t// When doing \"additionalAsserts\", validate the content against the schema after every batch of edits.\n\t\t\t\t\tthis.forest.checkSchema();\n\t\t\t\t}\n\t\t\t}\n\t\t\tpublic destroy(detachedField: FieldKey, count: number): void {\n\t\t\t\tpreEdit();\n\t\t\t\tthis.forest.delete(detachedField);\n\t\t\t}\n\t\t\tpublic create(content: readonly ITreeCursorSynchronous[], destination: FieldKey): void {\n\t\t\t\tpreEdit();\n\t\t\t\tthis.forest.add(content, destination);\n\t\t\t\tthis.forest.#events.emit(\"afterRootFieldCreated\", destination);\n\t\t\t}\n\t\t\tpublic attach(source: FieldKey, count: number, destination: PlaceIndex): void {\n\t\t\t\tpreEdit();\n\t\t\t\tthis.attachEdit(source, count, destination);\n\t\t\t}\n\t\t\tpublic detach(source: Range, destination: FieldKey, id: DeltaDetachedNodeId): void {\n\t\t\t\tpreEdit();\n\t\t\t\tthis.detachEdit(source, destination);\n\t\t\t}\n\t\t\t/**\n\t\t\t * Attaches the nodes from the given source field into the current field.\n\t\t\t * Does not invalidate dependents.\n\t\t\t * @param source - The the range to be attached.\n\t\t\t * @param count - The number of nodes being attached.\n\t\t\t * Expected to match the number of nodes in the source detached field.\n\t\t\t * @param destination - The index in the current field at which to attach the content.\n\t\t\t */\n\t\t\tprivate attachEdit(source: FieldKey, count: number, destination: PlaceIndex): void {\n\t\t\t\tassertNonNegativeSafeInteger(count);\n\t\t\t\tif (count === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst [parent, key] = cursor.getParent();\n\t\t\t\tassert(\n\t\t\t\t\tparent !== this.forest.roots || key !== source,\n\t\t\t\t\t0x7b6 /* Attach source field must be different from current field */,\n\t\t\t\t);\n\t\t\t\tconst currentField = getOrCreateField(parent, key);\n\t\t\t\tassertValidIndex(destination, currentField, true);\n\t\t\t\tconst sourceField = this.forest.#roots.fields.get(source) ?? [];\n\t\t\t\tassert(sourceField !== undefined, 0x7b7 /* Attach source field must exist */);\n\t\t\t\tassert(\n\t\t\t\t\tsourceField.length === count,\n\t\t\t\t\t0x7b8 /* Attach must consume all nodes in source field */,\n\t\t\t\t);\n\t\t\t\t// TODO: this will fail for very large insertions due to argument limits.\n\t\t\t\tcurrentField.splice(destination, 0, ...sourceField);\n\t\t\t\tthis.forest.delete(source);\n\t\t\t}\n\t\t\t/**\n\t\t\t * Detaches the range from the current field and transfers it to the given destination if any.\n\t\t\t * Does not invalidate dependents.\n\t\t\t * @param source - The bounds of the range to be detached from the current field.\n\t\t\t * @param destination - If specified, the destination to transfer the detached range to.\n\t\t\t * If not specified, the detached range is destroyed.\n\t\t\t */\n\t\t\tprivate detachEdit(source: Range, destination: FieldKey | undefined): void {\n\t\t\t\tconst [parent, key] = cursor.getParent();\n\t\t\t\tassert(\n\t\t\t\t\tdestination === undefined || parent !== this.forest.roots || key !== destination,\n\t\t\t\t\t0x7b9 /* Detach destination field must be different from current field */,\n\t\t\t\t);\n\t\t\t\tconst currentField = getOrCreateField(parent, key);\n\t\t\t\tassertValidRange(source, currentField);\n\t\t\t\tconst content = currentField.splice(source.start, source.end - source.start);\n\t\t\t\tif (destination !== undefined) {\n\t\t\t\t\tthis.forest.addFieldAsDetached(content, destination);\n\t\t\t\t}\n\t\t\t\t// This check is performed after the transfer to ensure that the field is not removed in scenarios\n\t\t\t\t// where the source and destination are the same.\n\t\t\t\tif (currentField.length === 0) {\n\t\t\t\t\tparent.fields.delete(key);\n\t\t\t\t}\n\t\t\t}\n\t\t\tpublic enterNode(index: number): void {\n\t\t\t\tcursor.enterNode(index);\n\t\t\t}\n\t\t\tpublic exitNode(index: number): void {\n\t\t\t\tcursor.exitNode();\n\t\t\t}\n\t\t\tpublic enterField(key: FieldKey): void {\n\t\t\t\tcursor.enterField(key);\n\t\t\t}\n\t\t\tpublic exitField(key: FieldKey): void {\n\t\t\t\tcursor.exitField();\n\t\t\t}\n\t\t}\n\n\t\tconst forestVisitor = new Visitor(this);\n\t\tconst announcedVisitors: AnnouncedVisitor[] = [];\n\t\tthis.deltaVisitors.forEach((getVisitor) => announcedVisitors.push(getVisitor()));\n\t\tconst combinedVisitor = combineVisitors([forestVisitor, ...announcedVisitors]);\n\t\tthis.activeVisitor = combinedVisitor;\n\t\treturn combinedVisitor;\n\t}\n\n\tpublic registerAnnouncedVisitor(visitor: () => AnnouncedVisitor): void {\n\t\tthis.deltaVisitors.add(visitor);\n\t}\n\n\tpublic deregisterAnnouncedVisitor(visitor: () => AnnouncedVisitor): void {\n\t\tthis.deltaVisitors.delete(visitor);\n\t}\n\n\tprivate nextRange = 0;\n\tpublic newDetachedField(): DetachedField {\n\t\tconst range: DetachedField = brand(String(this.nextRange));\n\t\tthis.nextRange += 1;\n\t\treturn range;\n\t}\n\n\tprivate add(nodes: Iterable<ITreeCursor>, key: FieldKey): void {\n\t\tconst field = Array.from(nodes, mapTreeFromCursor) as MutableMapTree[];\n\t\tthis.addFieldAsDetached(field, key);\n\t}\n\n\tprivate addFieldAsDetached(field: MutableMapTree[], key: FieldKey): void {\n\t\tassert(!this.roots.fields.has(key), 0x370 /* new range must not already exist */);\n\t\tif (field.length > 0) {\n\t\t\tthis.#roots.fields.set(key, field);\n\t\t}\n\t}\n\n\tprivate delete(field: FieldKey): void {\n\t\tthis.#roots.fields.delete(field);\n\t}\n\n\tpublic allocateCursor(source?: string): Cursor {\n\t\treturn new Cursor(this, source);\n\t}\n\n\tpublic tryMoveCursorToNode(\n\t\tdestination: Anchor,\n\t\tcursorToMove: ITreeSubscriptionCursor,\n\t): TreeNavigationResult {\n\t\tconst path = this.anchors.locate(destination);\n\t\tif (path === undefined) {\n\t\t\treturn TreeNavigationResult.NotFound;\n\t\t}\n\t\tthis.moveCursorToPath(path, cursorToMove);\n\t\treturn TreeNavigationResult.Ok;\n\t}\n\n\tpublic tryMoveCursorToField(\n\t\tdestination: FieldAnchor,\n\t\tcursorToMove: ITreeSubscriptionCursor,\n\t): TreeNavigationResult {\n\t\tif (destination.parent === undefined) {\n\t\t\tthis.moveCursorToPath(undefined, cursorToMove);\n\t\t} else {\n\t\t\tconst result = this.tryMoveCursorToNode(destination.parent, cursorToMove);\n\t\t\tif (result !== TreeNavigationResult.Ok) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\tcursorToMove.enterField(destination.fieldKey);\n\t\treturn TreeNavigationResult.Ok;\n\t}\n\n\tpublic moveCursorToPath(\n\t\tdestination: UpPath | undefined,\n\t\tcursorToMove: ITreeSubscriptionCursor,\n\t): void {\n\t\tassert(\n\t\t\tcursorToMove instanceof Cursor,\n\t\t\t0x337 /* ObjectForest must only be given its own Cursor type */,\n\t\t);\n\t\tassert(\n\t\t\tcursorToMove.forest === this,\n\t\t\t0x338 /* ObjectForest must only be given its own Cursor */,\n\t\t);\n\n\t\tconst indexStack: number[] = [];\n\t\tconst keyStack: FieldKey[] = [];\n\n\t\tlet path: UpPath | undefined = destination;\n\t\twhile (path !== undefined) {\n\t\t\tindexStack.push(path.parentIndex);\n\t\t\tkeyStack.push(path.parentField);\n\t\t\tpath = path.parent;\n\t\t}\n\t\tcursorToMove.setToAboveDetachedSequences();\n\t\twhile (keyStack.length > 0) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tcursorToMove.enterField(keyStack.pop()!);\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tcursorToMove.enterNode(indexStack.pop()!);\n\t\t}\n\n\t\treturn;\n\t}\n\n\tpublic getCursorAboveDetachedFields(): ITreeCursorSynchronous {\n\t\treturn cursorForMapTreeNode(this.roots);\n\t}\n}\n\n/**\n * Cursor implementation for ObjectForest.\n */\nclass Cursor extends SynchronousCursor implements ITreeSubscriptionCursor {\n\tpublic state: ITreeSubscriptionCursorState;\n\n\t/**\n\t * @param forest - forest this cursor navigates\n\t * @param innerCursor - underlying cursor implementation this wraps. `undefined` when state is not `Current`\n\t */\n\tpublic constructor(\n\t\tpublic readonly forest: ObjectForest,\n\t\tpublic readonly source: string | undefined,\n\t\tprivate innerCursor?: CursorWithNode<MutableMapTree>,\n\t) {\n\t\tsuper();\n\t\tif (innerCursor === undefined) {\n\t\t\tthis.state = ITreeSubscriptionCursorState.Cleared;\n\t\t} else {\n\t\t\tthis.state = ITreeSubscriptionCursorState.Current;\n\t\t\tthis.forest.currentCursors.add(this);\n\t\t}\n\t}\n\n\tpublic buildFieldAnchor(): FieldAnchor {\n\t\tconst path = this.getFieldPath();\n\t\tconst anchor =\n\t\t\tpath.parent === undefined ? undefined : this.forest.anchors.track(path.parent);\n\t\treturn { parent: anchor, fieldKey: path.field };\n\t}\n\tpublic getFieldPath(prefix?: PathRootPrefix): FieldUpPath {\n\t\tassert(this.innerCursor !== undefined, 0x45f /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.getFieldPath(prefix);\n\t}\n\tpublic get mode(): CursorLocationType {\n\t\tassert(this.innerCursor !== undefined, 0x42e /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.mode;\n\t}\n\n\tpublic nextField(): boolean {\n\t\tassert(this.innerCursor !== undefined, 0x42f /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.nextField();\n\t}\n\tpublic exitField(): void {\n\t\tassert(this.innerCursor !== undefined, 0x430 /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.exitField();\n\t}\n\tpublic override skipPendingFields(): boolean {\n\t\tassert(this.innerCursor !== undefined, 0x431 /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.skipPendingFields();\n\t}\n\tpublic getFieldKey(): FieldKey {\n\t\tassert(this.innerCursor !== undefined, 0x432 /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.getFieldKey();\n\t}\n\tpublic getFieldLength(): number {\n\t\tassert(this.innerCursor !== undefined, 0x433 /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.getFieldLength();\n\t}\n\tpublic firstNode(): boolean {\n\t\tassert(this.innerCursor !== undefined, 0x434 /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.firstNode();\n\t}\n\tpublic enterNode(childIndex: number): void {\n\t\tassert(this.innerCursor !== undefined, 0x435 /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.enterNode(childIndex);\n\t}\n\tpublic getPath(prefix?: PathRootPrefix): UpPath {\n\t\tassert(this.innerCursor !== undefined, 0x436 /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.getPath(prefix) ?? fail(0xb27 /* no path when at root */);\n\t}\n\tpublic get fieldIndex(): number {\n\t\tassert(this.innerCursor !== undefined, 0x437 /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.fieldIndex;\n\t}\n\tpublic get chunkStart(): number {\n\t\tassert(this.innerCursor !== undefined, 0x438 /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.chunkStart;\n\t}\n\tpublic get chunkLength(): number {\n\t\tassert(this.innerCursor !== undefined, 0x439 /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.chunkLength;\n\t}\n\tpublic seekNodes(offset: number): boolean {\n\t\tassert(this.innerCursor !== undefined, 0x43a /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.seekNodes(offset);\n\t}\n\tpublic nextNode(): boolean {\n\t\tassert(this.innerCursor !== undefined, 0x43b /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.nextNode();\n\t}\n\tpublic exitNode(): void {\n\t\tassert(this.innerCursor !== undefined, 0x43c /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.exitNode();\n\t}\n\tpublic firstField(): boolean {\n\t\tassert(this.innerCursor !== undefined, 0x43d /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.firstField();\n\t}\n\tpublic enterField(key: FieldKey): void {\n\t\tassert(this.innerCursor !== undefined, 0x43e /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.enterField(key);\n\t}\n\tpublic get type(): TreeNodeSchemaIdentifier {\n\t\tassert(this.innerCursor !== undefined, 0x43f /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.type;\n\t}\n\tpublic get value(): Value {\n\t\tassert(this.innerCursor !== undefined, 0x440 /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.value;\n\t}\n\n\t// TODO: tests for clear when not at root.\n\tpublic clear(): void {\n\t\tassert(\n\t\t\tthis.state !== ITreeSubscriptionCursorState.Freed,\n\t\t\t0x33b /* Cursor must not be freed */,\n\t\t);\n\t\tthis.state = ITreeSubscriptionCursorState.Cleared;\n\t\tthis.innerCursor = undefined;\n\t\tthis.forest.currentCursors.delete(this);\n\t}\n\n\t/**\n\t * Move this cursor to the special dummy node above the detached sequences.\n\t * Can be used when cleared (but not freed).\n\t */\n\tpublic setToAboveDetachedSequences(): void {\n\t\tassert(\n\t\t\tthis.state !== ITreeSubscriptionCursorState.Freed,\n\t\t\t0x33c /* Cursor must not be freed */,\n\t\t);\n\t\tthis.clear();\n\t\tthis.state = ITreeSubscriptionCursorState.Current;\n\t\t// Cast to a cursor of _mutable_ trees to allow direct manipulation of the tree data which is more efficient than doing immutable copies.\n\t\tthis.innerCursor = cursorForMapTreeNode(\n\t\t\tthis.forest.roots,\n\t\t) as CursorWithNode<MutableMapTree>;\n\t\tthis.forest.currentCursors.add(this);\n\t}\n\n\tpublic getNode(): MutableMapTree {\n\t\tassert(this.innerCursor !== undefined, 0x33e /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.getNode();\n\t}\n\n\tpublic getParent(): [MutableMapTree, FieldKey] {\n\t\tassert(this.innerCursor !== undefined, 0x441 /* Cursor must be current to be used */);\n\t\t// This could be optimized to skip moving it accessing internals of cursor.\n\t\tconst key = this.innerCursor.getFieldKey();\n\t\tthis.innerCursor.exitField();\n\t\tconst node = this.innerCursor.getNode();\n\t\tthis.innerCursor.enterField(key);\n\t\treturn [node, key];\n\t}\n\n\tpublic fork(source?: string): ITreeSubscriptionCursor {\n\t\tassert(this.innerCursor !== undefined, 0x460 /* Cursor must be current to be used */);\n\t\treturn new Cursor(this.forest, source ?? `fork: ${this.source}`, this.innerCursor.fork());\n\t}\n\n\tpublic free(): void {\n\t\tassert(\n\t\t\tthis.state !== ITreeSubscriptionCursorState.Freed,\n\t\t\t0x33f /* Cursor must not be double freed */,\n\t\t);\n\t\tthis.forest.currentCursors.delete(this);\n\t\tthis.state = ITreeSubscriptionCursorState.Freed;\n\t}\n\n\tpublic buildAnchor(): Anchor {\n\t\tassert(\n\t\t\tthis.state === ITreeSubscriptionCursorState.Current,\n\t\t\t0x37a /* Cursor must be current to be used */,\n\t\t);\n\t\treturn this.forest.anchors.track(this.getPath());\n\t}\n}\n\n// This function is the folder level export for objectForest, and hides all the implementation types.\n// When other forest implementations are created (ex: optimized ones),\n// this function should likely be moved and updated to (at least conditionally) use them.\n/**\n * Returns an implementation of {@link IEditableForest} with no content.\n * @privateRemarks\n * TODO:\n * refactor to remove this function, and instead place `ForestTypeReference` and `ForestTypeExpensiveDebug` here as a better way to encapsulate ObjectForest.\n */\nexport function buildForest(\n\tbreaker: Breakable,\n\tschema?: TreeStoredSchemaSubscription,\n\tanchors?: AnchorSet,\n\tadditionalAsserts: boolean = false,\n): ObjectForest {\n\treturn new ObjectForest(breaker, schema, anchors, additionalAsserts);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"objectForest.js","sourceRoot":"","sources":["../../../src/feature-libraries/object-forest/objectForest.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAEnE,OAAO,EAEN,SAAS,EAcT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tE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { createEmitter } from \"@fluid-internal/client-utils\";\nimport type { Listenable } from \"@fluidframework/core-interfaces\";\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype Anchor,\n\tAnchorSet,\n\ttype AnnouncedVisitor,\n\ttype CursorLocationType,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaVisitor,\n\ttype DetachedField,\n\ttype FieldAnchor,\n\ttype FieldKey,\n\ttype FieldUpPath,\n\ttype ForestEvents,\n\ttype IEditableForest,\n\ttype ITreeCursor,\n\ttype ITreeCursorSynchronous,\n\ttype ITreeSubscriptionCursor,\n\tITreeSubscriptionCursorState,\n\ttype MapTree,\n\ttype PathRootPrefix,\n\ttype PlaceIndex,\n\ttype Range,\n\ttype TreeChunk,\n\ttype TreeFieldStoredSchema,\n\tTreeNavigationResult,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeStoredSchemaSubscription,\n\ttype UpPath,\n\ttype Value,\n\taboveRootPlaceholder,\n\tcombineVisitors,\n\tdeepCopyMapTree,\n\trootFieldKey,\n} from \"../../core/index.js\";\nimport {\n\tassertNonNegativeSafeInteger,\n\tassertValidIndex,\n\tassertValidRange,\n\tbrand,\n\tbreakingMethod,\n\ttype Breakable,\n\ttype WithBreakable,\n} from \"../../util/index.js\";\nimport { chunkFieldSingle, defaultChunkPolicy } from \"../chunked-forest/index.js\";\nimport { cursorForMapTreeNode, mapTreeFromCursor } from \"../mapTreeCursor.js\";\nimport { type CursorWithNode, SynchronousCursor } from \"../treeCursorUtils.js\";\nimport {\n\tdefaultSchemaPolicy,\n\tFieldKinds,\n\tisFieldInSchema,\n\tthrowOutOfSchema,\n} from \"../default-schema/index.js\";\n\n/** A `MapTree` with mutable fields */\ninterface MutableMapTree extends MapTree {\n\treadonly fields: Map<FieldKey, MutableMapTree[]>;\n}\n\n/** Get a field from a `MutableMapTree`, optionally modifying the tree to create it if missing. */\nfunction getOrCreateField(mapTree: MutableMapTree, key: FieldKey): MutableMapTree[] {\n\tconst field = mapTree.fields.get(key);\n\tif (field !== undefined) {\n\t\treturn field;\n\t}\n\n\tconst newField: MutableMapTree[] = [];\n\tmapTree.fields.set(key, newField);\n\treturn newField;\n}\n\n/**\n * Reference implementation of IEditableForest.\n *\n * This implementation focuses on correctness and simplicity, not performance.\n * It does not use compressed chunks: instead nodes are implemented using objects.\n */\nexport class ObjectForest implements IEditableForest, WithBreakable {\n\tprivate activeVisitor?: DeltaVisitor;\n\n\t// All cursors that are in the \"Current\" state. Must be empty when editing.\n\tpublic readonly currentCursors: Set<Cursor> = new Set();\n\tprivate readonly deltaVisitors: Set<() => AnnouncedVisitor> = new Set();\n\n\treadonly #events = createEmitter<ForestEvents>();\n\tpublic readonly events: Listenable<ForestEvents> = this.#events;\n\n\treadonly #roots: MutableMapTree;\n\tpublic get roots(): MapTree {\n\t\treturn this.#roots;\n\t}\n\n\tpublic constructor(\n\t\tpublic readonly breaker: Breakable,\n\t\t/**\n\t\t * If provided, may be used for validation, but otherwise unused.\n\t\t */\n\t\tpublic readonly schema: TreeStoredSchemaSubscription | undefined,\n\t\tpublic readonly anchors: AnchorSet = new AnchorSet(),\n\t\tpublic readonly additionalAsserts: boolean = false,\n\t\troots?: MapTree,\n\t) {\n\t\tthis.#roots =\n\t\t\troots !== undefined\n\t\t\t\t? deepCopyMapTree(roots)\n\t\t\t\t: {\n\t\t\t\t\t\ttype: aboveRootPlaceholder,\n\t\t\t\t\t\tfields: new Map(),\n\t\t\t\t\t};\n\n\t\tif (additionalAsserts) {\n\t\t\tthis.checkSchema();\n\t\t}\n\t}\n\n\tpublic get isEmpty(): boolean {\n\t\treturn this.roots.fields.size === 0;\n\t}\n\n\tpublic clone(schema: TreeStoredSchemaSubscription, anchors: AnchorSet): ObjectForest {\n\t\treturn new ObjectForest(this.breaker, schema, anchors, this.additionalAsserts, this.roots);\n\t}\n\n\tpublic chunkField(cursor: ITreeCursorSynchronous): TreeChunk {\n\t\treturn chunkFieldSingle(cursor, { idCompressor: undefined, policy: defaultChunkPolicy });\n\t}\n\n\tpublic forgetAnchor(anchor: Anchor): void {\n\t\tthis.anchors.forget(anchor);\n\t}\n\n\t/**\n\t * Throw (and break) if content does not match schema.\n\t */\n\t@breakingMethod\n\tpublic checkSchema(): void {\n\t\tconst schema = this.schema;\n\t\tif (schema !== undefined) {\n\t\t\tconst roots = new Set([...this.roots.fields.keys(), rootFieldKey]);\n\t\t\tfor (const key of roots) {\n\t\t\t\tconst documentRoot = this.roots.fields.get(key) ?? [];\n\t\t\t\tconst fieldSchema: TreeFieldStoredSchema =\n\t\t\t\t\tkey === rootFieldKey\n\t\t\t\t\t\t? schema.rootFieldSchema\n\t\t\t\t\t\t: // TODO: someday we should have schema for detached fields, and use that instead of generating one here.\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Some detached fields may have multiple nodes, so we must treat them as sequences:\n\t\t\t\t\t\t\t\tkind: FieldKinds.sequence.identifier,\n\t\t\t\t\t\t\t\ttypes: new Set(documentRoot.map((node) => node.type)),\n\n\t\t\t\t\t\t\t\t// Metadata is not used for schema checks\n\t\t\t\t\t\t\t\tpersistedMetadata: undefined,\n\t\t\t\t\t\t\t};\n\t\t\t\tisFieldInSchema(\n\t\t\t\t\tdocumentRoot,\n\t\t\t\t\tfieldSchema,\n\t\t\t\t\t{\n\t\t\t\t\t\tschema,\n\t\t\t\t\t\tpolicy: defaultSchemaPolicy,\n\t\t\t\t\t},\n\t\t\t\t\tthrowOutOfSchema,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic acquireVisitor(): DeltaVisitor {\n\t\tassert(\n\t\t\tthis.activeVisitor === undefined,\n\t\t\t0x76c /* Must release existing visitor before acquiring another */,\n\t\t);\n\n\t\t// Note: This code uses cursors, however it also modifies the tree.\n\t\t// In general this is not safe, but this code happens to only modify the tree below the current cursor location,\n\t\t// which happens to work.\n\t\t// This pattern could be generalized/formalized with a concept of an exclusive cursor,\n\t\t// which can edit, but is the only cursor allowed at the time.\n\n\t\tconst cursor: Cursor = this.allocateCursor(\"acquireVisitor\");\n\t\tcursor.setToAboveDetachedSequences();\n\n\t\t/**\n\t\t * Called before each edit to allow cursor cleanup to happen and ensure that there are no unexpected cursors.\n\t\t * This is required for each change since there may be app facing change event handlers which create cursors.\n\t\t */\n\t\tconst preEdit = (): void => {\n\t\t\tthis.#events.emit(\"beforeChange\");\n\t\t\tassert(\n\t\t\t\tthis.currentCursors.has(cursor),\n\t\t\t\t0x995 /* missing visitor cursor while editing */,\n\t\t\t);\n\t\t\tif (this.currentCursors.size > 1) {\n\t\t\t\tconst unexpectedSources = [...this.currentCursors].flatMap((c) =>\n\t\t\t\t\tc === cursor ? [] : (c.source ?? null),\n\t\t\t\t);\n\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Found unexpected cursors when editing with the following annotations: ${JSON.stringify(\n\t\t\t\t\t\tunexpectedSources,\n\t\t\t\t\t)}`,\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\n\t\tclass Visitor implements DeltaVisitor {\n\t\t\tpublic constructor(private readonly forest: ObjectForest) {}\n\t\t\tpublic free(): void {\n\t\t\t\tcursor.free();\n\t\t\t\tassert(\n\t\t\t\t\tthis.forest.activeVisitor !== undefined,\n\t\t\t\t\t0x76d /* Multiple free calls for same visitor */,\n\t\t\t\t);\n\t\t\t\tthis.forest.activeVisitor = undefined;\n\t\t\t\tif (this.forest.additionalAsserts) {\n\t\t\t\t\t// Schema validation:\n\t\t\t\t\t// When doing \"additionalAsserts\", validate the content against the schema after every batch of edits.\n\t\t\t\t\tthis.forest.checkSchema();\n\t\t\t\t}\n\t\t\t}\n\t\t\tpublic destroy(detachedField: FieldKey, count: number): void {\n\t\t\t\tpreEdit();\n\t\t\t\tthis.forest.delete(detachedField);\n\t\t\t}\n\t\t\tpublic create(content: readonly ITreeCursorSynchronous[], destination: FieldKey): void {\n\t\t\t\tpreEdit();\n\t\t\t\tthis.forest.add(content, destination);\n\t\t\t\tthis.forest.#events.emit(\"afterRootFieldCreated\", destination);\n\t\t\t}\n\t\t\tpublic attach(source: FieldKey, count: number, destination: PlaceIndex): void {\n\t\t\t\tpreEdit();\n\t\t\t\tthis.attachEdit(source, count, destination);\n\t\t\t}\n\t\t\tpublic detach(source: Range, destination: FieldKey, id: DeltaDetachedNodeId): void {\n\t\t\t\tpreEdit();\n\t\t\t\tthis.detachEdit(source, destination);\n\t\t\t}\n\t\t\t/**\n\t\t\t * Attaches the nodes from the given source field into the current field.\n\t\t\t * Does not invalidate dependents.\n\t\t\t * @param source - The the range to be attached.\n\t\t\t * @param count - The number of nodes being attached.\n\t\t\t * Expected to match the number of nodes in the source detached field.\n\t\t\t * @param destination - The index in the current field at which to attach the content.\n\t\t\t */\n\t\t\tprivate attachEdit(source: FieldKey, count: number, destination: PlaceIndex): void {\n\t\t\t\tassertNonNegativeSafeInteger(count);\n\t\t\t\tif (count === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst [parent, key] = cursor.getParent();\n\t\t\t\tassert(\n\t\t\t\t\tparent !== this.forest.roots || key !== source,\n\t\t\t\t\t0x7b6 /* Attach source field must be different from current field */,\n\t\t\t\t);\n\t\t\t\tconst currentField = getOrCreateField(parent, key);\n\t\t\t\tassertValidIndex(destination, currentField, true);\n\t\t\t\tconst sourceField = this.forest.#roots.fields.get(source) ?? [];\n\t\t\t\tassert(sourceField !== undefined, 0x7b7 /* Attach source field must exist */);\n\t\t\t\tassert(\n\t\t\t\t\tsourceField.length === count,\n\t\t\t\t\t0x7b8 /* Attach must consume all nodes in source field */,\n\t\t\t\t);\n\t\t\t\t// TODO: this will fail for very large insertions due to argument limits.\n\t\t\t\tcurrentField.splice(destination, 0, ...sourceField);\n\t\t\t\tthis.forest.delete(source);\n\t\t\t}\n\t\t\t/**\n\t\t\t * Detaches the range from the current field and transfers it to the given destination if any.\n\t\t\t * Does not invalidate dependents.\n\t\t\t * @param source - The bounds of the range to be detached from the current field.\n\t\t\t * @param destination - If specified, the destination to transfer the detached range to.\n\t\t\t * If not specified, the detached range is destroyed.\n\t\t\t */\n\t\t\tprivate detachEdit(source: Range, destination: FieldKey | undefined): void {\n\t\t\t\tconst [parent, key] = cursor.getParent();\n\t\t\t\tassert(\n\t\t\t\t\tdestination === undefined || parent !== this.forest.roots || key !== destination,\n\t\t\t\t\t0x7b9 /* Detach destination field must be different from current field */,\n\t\t\t\t);\n\t\t\t\tconst currentField = getOrCreateField(parent, key);\n\t\t\t\tassertValidRange(source, currentField);\n\t\t\t\tconst content = currentField.splice(source.start, source.end - source.start);\n\t\t\t\tif (destination !== undefined) {\n\t\t\t\t\tthis.forest.addFieldAsDetached(content, destination);\n\t\t\t\t}\n\t\t\t\t// This check is performed after the transfer to ensure that the field is not removed in scenarios\n\t\t\t\t// where the source and destination are the same.\n\t\t\t\tif (currentField.length === 0) {\n\t\t\t\t\tparent.fields.delete(key);\n\t\t\t\t}\n\t\t\t}\n\t\t\tpublic enterNode(index: number): void {\n\t\t\t\tcursor.enterNode(index);\n\t\t\t}\n\t\t\tpublic exitNode(index: number): void {\n\t\t\t\tcursor.exitNode();\n\t\t\t}\n\t\t\tpublic enterField(key: FieldKey): void {\n\t\t\t\tcursor.enterField(key);\n\t\t\t}\n\t\t\tpublic exitField(key: FieldKey): void {\n\t\t\t\tcursor.exitField();\n\t\t\t}\n\t\t}\n\n\t\tconst forestVisitor = new Visitor(this);\n\t\tconst announcedVisitors: AnnouncedVisitor[] = [];\n\t\tthis.deltaVisitors.forEach((getVisitor) => announcedVisitors.push(getVisitor()));\n\t\tconst combinedVisitor = combineVisitors([forestVisitor, ...announcedVisitors]);\n\t\tthis.activeVisitor = combinedVisitor;\n\t\treturn combinedVisitor;\n\t}\n\n\tpublic registerAnnouncedVisitor(visitor: () => AnnouncedVisitor): void {\n\t\tthis.deltaVisitors.add(visitor);\n\t}\n\n\tpublic deregisterAnnouncedVisitor(visitor: () => AnnouncedVisitor): void {\n\t\tthis.deltaVisitors.delete(visitor);\n\t}\n\n\tprivate nextRange = 0;\n\tpublic newDetachedField(): DetachedField {\n\t\tconst range: DetachedField = brand(String(this.nextRange));\n\t\tthis.nextRange += 1;\n\t\treturn range;\n\t}\n\n\tprivate add(nodes: Iterable<ITreeCursor>, key: FieldKey): void {\n\t\tconst field = Array.from(nodes, mapTreeFromCursor) as MutableMapTree[];\n\t\tthis.addFieldAsDetached(field, key);\n\t}\n\n\tprivate addFieldAsDetached(field: MutableMapTree[], key: FieldKey): void {\n\t\tassert(!this.roots.fields.has(key), 0x370 /* new range must not already exist */);\n\t\tif (field.length > 0) {\n\t\t\tthis.#roots.fields.set(key, field);\n\t\t}\n\t}\n\n\tprivate delete(field: FieldKey): void {\n\t\tthis.#roots.fields.delete(field);\n\t}\n\n\tpublic allocateCursor(source?: string): Cursor {\n\t\treturn new Cursor(this, source);\n\t}\n\n\tpublic tryMoveCursorToNode(\n\t\tdestination: Anchor,\n\t\tcursorToMove: ITreeSubscriptionCursor,\n\t): TreeNavigationResult {\n\t\tconst path = this.anchors.locate(destination);\n\t\tif (path === undefined) {\n\t\t\treturn TreeNavigationResult.NotFound;\n\t\t}\n\t\tthis.moveCursorToPath(path, cursorToMove);\n\t\treturn TreeNavigationResult.Ok;\n\t}\n\n\tpublic tryMoveCursorToField(\n\t\tdestination: FieldAnchor,\n\t\tcursorToMove: ITreeSubscriptionCursor,\n\t): TreeNavigationResult {\n\t\tif (destination.parent === undefined) {\n\t\t\tthis.moveCursorToPath(undefined, cursorToMove);\n\t\t} else {\n\t\t\tconst result = this.tryMoveCursorToNode(destination.parent, cursorToMove);\n\t\t\tif (result !== TreeNavigationResult.Ok) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\tcursorToMove.enterField(destination.fieldKey);\n\t\treturn TreeNavigationResult.Ok;\n\t}\n\n\tpublic moveCursorToPath(\n\t\tdestination: UpPath | undefined,\n\t\tcursorToMove: ITreeSubscriptionCursor,\n\t): void {\n\t\tassert(\n\t\t\tcursorToMove instanceof Cursor,\n\t\t\t0x337 /* ObjectForest must only be given its own Cursor type */,\n\t\t);\n\t\tassert(\n\t\t\tcursorToMove.forest === this,\n\t\t\t0x338 /* ObjectForest must only be given its own Cursor */,\n\t\t);\n\n\t\tconst indexStack: number[] = [];\n\t\tconst keyStack: FieldKey[] = [];\n\n\t\tlet path: UpPath | undefined = destination;\n\t\twhile (path !== undefined) {\n\t\t\tindexStack.push(path.parentIndex);\n\t\t\tkeyStack.push(path.parentField);\n\t\t\tpath = path.parent;\n\t\t}\n\t\tcursorToMove.setToAboveDetachedSequences();\n\t\twhile (keyStack.length > 0) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tcursorToMove.enterField(keyStack.pop()!);\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tcursorToMove.enterNode(indexStack.pop()!);\n\t\t}\n\n\t\treturn;\n\t}\n\n\tpublic getCursorAboveDetachedFields(): ITreeCursorSynchronous {\n\t\treturn cursorForMapTreeNode(this.roots);\n\t}\n}\n\n/**\n * Cursor implementation for ObjectForest.\n */\nclass Cursor extends SynchronousCursor implements ITreeSubscriptionCursor {\n\tpublic state: ITreeSubscriptionCursorState;\n\n\t/**\n\t * @param forest - forest this cursor navigates\n\t * @param innerCursor - underlying cursor implementation this wraps. `undefined` when state is not `Current`\n\t */\n\tpublic constructor(\n\t\tpublic readonly forest: ObjectForest,\n\t\tpublic readonly source: string | undefined,\n\t\tprivate innerCursor?: CursorWithNode<MutableMapTree>,\n\t) {\n\t\tsuper();\n\t\tif (innerCursor === undefined) {\n\t\t\tthis.state = ITreeSubscriptionCursorState.Cleared;\n\t\t} else {\n\t\t\tthis.state = ITreeSubscriptionCursorState.Current;\n\t\t\tthis.forest.currentCursors.add(this);\n\t\t}\n\t}\n\n\tpublic buildFieldAnchor(): FieldAnchor {\n\t\tconst path = this.getFieldPath();\n\t\tconst anchor =\n\t\t\tpath.parent === undefined ? undefined : this.forest.anchors.track(path.parent);\n\t\treturn { parent: anchor, fieldKey: path.field };\n\t}\n\tpublic getFieldPath(prefix?: PathRootPrefix): FieldUpPath {\n\t\tassert(this.innerCursor !== undefined, 0x45f /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.getFieldPath(prefix);\n\t}\n\tpublic get mode(): CursorLocationType {\n\t\tassert(this.innerCursor !== undefined, 0x42e /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.mode;\n\t}\n\n\tpublic nextField(): boolean {\n\t\tassert(this.innerCursor !== undefined, 0x42f /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.nextField();\n\t}\n\tpublic exitField(): void {\n\t\tassert(this.innerCursor !== undefined, 0x430 /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.exitField();\n\t}\n\tpublic override skipPendingFields(): boolean {\n\t\tassert(this.innerCursor !== undefined, 0x431 /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.skipPendingFields();\n\t}\n\tpublic getFieldKey(): FieldKey {\n\t\tassert(this.innerCursor !== undefined, 0x432 /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.getFieldKey();\n\t}\n\tpublic getFieldLength(): number {\n\t\tassert(this.innerCursor !== undefined, 0x433 /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.getFieldLength();\n\t}\n\tpublic firstNode(): boolean {\n\t\tassert(this.innerCursor !== undefined, 0x434 /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.firstNode();\n\t}\n\tpublic enterNode(childIndex: number): void {\n\t\tassert(this.innerCursor !== undefined, 0x435 /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.enterNode(childIndex);\n\t}\n\tpublic getPath(prefix?: PathRootPrefix): UpPath {\n\t\tassert(this.innerCursor !== undefined, 0x436 /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.getPath(prefix) ?? fail(0xb27 /* no path when at root */);\n\t}\n\tpublic get fieldIndex(): number {\n\t\tassert(this.innerCursor !== undefined, 0x437 /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.fieldIndex;\n\t}\n\tpublic get chunkStart(): number {\n\t\tassert(this.innerCursor !== undefined, 0x438 /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.chunkStart;\n\t}\n\tpublic get chunkLength(): number {\n\t\tassert(this.innerCursor !== undefined, 0x439 /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.chunkLength;\n\t}\n\tpublic seekNodes(offset: number): boolean {\n\t\tassert(this.innerCursor !== undefined, 0x43a /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.seekNodes(offset);\n\t}\n\tpublic nextNode(): boolean {\n\t\tassert(this.innerCursor !== undefined, 0x43b /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.nextNode();\n\t}\n\tpublic exitNode(): void {\n\t\tassert(this.innerCursor !== undefined, 0x43c /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.exitNode();\n\t}\n\tpublic firstField(): boolean {\n\t\tassert(this.innerCursor !== undefined, 0x43d /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.firstField();\n\t}\n\tpublic enterField(key: FieldKey): void {\n\t\tassert(this.innerCursor !== undefined, 0x43e /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.enterField(key);\n\t}\n\tpublic get type(): TreeNodeSchemaIdentifier {\n\t\tassert(this.innerCursor !== undefined, 0x43f /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.type;\n\t}\n\tpublic get value(): Value {\n\t\tassert(this.innerCursor !== undefined, 0x440 /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.value;\n\t}\n\n\t// TODO: tests for clear when not at root.\n\tpublic clear(): void {\n\t\tassert(\n\t\t\tthis.state !== ITreeSubscriptionCursorState.Freed,\n\t\t\t0x33b /* Cursor must not be freed */,\n\t\t);\n\t\tthis.state = ITreeSubscriptionCursorState.Cleared;\n\t\tthis.innerCursor = undefined;\n\t\tthis.forest.currentCursors.delete(this);\n\t}\n\n\t/**\n\t * Move this cursor to the special dummy node above the detached sequences.\n\t * Can be used when cleared (but not freed).\n\t */\n\tpublic setToAboveDetachedSequences(): void {\n\t\tassert(\n\t\t\tthis.state !== ITreeSubscriptionCursorState.Freed,\n\t\t\t0x33c /* Cursor must not be freed */,\n\t\t);\n\t\tthis.clear();\n\t\tthis.state = ITreeSubscriptionCursorState.Current;\n\t\t// Cast to a cursor of _mutable_ trees to allow direct manipulation of the tree data which is more efficient than doing immutable copies.\n\t\tthis.innerCursor = cursorForMapTreeNode(\n\t\t\tthis.forest.roots,\n\t\t) as CursorWithNode<MutableMapTree>;\n\t\tthis.forest.currentCursors.add(this);\n\t}\n\n\tpublic getNode(): MutableMapTree {\n\t\tassert(this.innerCursor !== undefined, 0x33e /* Cursor must be current to be used */);\n\t\treturn this.innerCursor.getNode();\n\t}\n\n\tpublic getParent(): [MutableMapTree, FieldKey] {\n\t\tassert(this.innerCursor !== undefined, 0x441 /* Cursor must be current to be used */);\n\t\t// This could be optimized to skip moving it accessing internals of cursor.\n\t\tconst key = this.innerCursor.getFieldKey();\n\t\tthis.innerCursor.exitField();\n\t\tconst node = this.innerCursor.getNode();\n\t\tthis.innerCursor.enterField(key);\n\t\treturn [node, key];\n\t}\n\n\tpublic fork(source?: string): ITreeSubscriptionCursor {\n\t\tassert(this.innerCursor !== undefined, 0x460 /* Cursor must be current to be used */);\n\t\treturn new Cursor(this.forest, source ?? `fork: ${this.source}`, this.innerCursor.fork());\n\t}\n\n\tpublic free(): void {\n\t\tassert(\n\t\t\tthis.state !== ITreeSubscriptionCursorState.Freed,\n\t\t\t0x33f /* Cursor must not be double freed */,\n\t\t);\n\t\tthis.forest.currentCursors.delete(this);\n\t\tthis.state = ITreeSubscriptionCursorState.Freed;\n\t}\n\n\tpublic buildAnchor(): Anchor {\n\t\tassert(\n\t\t\tthis.state === ITreeSubscriptionCursorState.Current,\n\t\t\t0x37a /* Cursor must be current to be used */,\n\t\t);\n\t\treturn this.forest.anchors.track(this.getPath());\n\t}\n}\n\n// This function is the folder level export for objectForest, and hides all the implementation types.\n// When other forest implementations are created (ex: optimized ones),\n// this function should likely be moved and updated to (at least conditionally) use them.\n/**\n * Returns an implementation of {@link IEditableForest} with no content.\n * @privateRemarks\n * TODO:\n * refactor to remove this function, and instead place `ForestTypeReference` and `ForestTypeExpensiveDebug` here as a better way to encapsulate ObjectForest.\n */\nexport function buildForest(\n\tbreaker: Breakable,\n\tschema?: TreeStoredSchemaSubscription,\n\tanchors?: AnchorSet,\n\tadditionalAsserts: boolean = false,\n): ObjectForest {\n\treturn new ObjectForest(breaker, schema, anchors, additionalAsserts);\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export type Listenable<T extends object> = EventListenable<T>;
|
|
|
30
30
|
export type Off = EventOff;
|
|
31
31
|
export { TreeStatus, TreeCompressionStrategy, type TreeIndex, type TreeIndexKey, type TreeIndexNodes, } from "./feature-libraries/index.js";
|
|
32
32
|
export { type ITreeInternal, type SharedTreeOptions, type ForestType, type SharedTreeFormatOptions, SharedTreeFormatVersion, Tree, type RunTransaction, type ForestOptions, getBranch, type BranchableTree, type TreeBranchFork, independentInitializedView, type ViewContent, TreeAlpha, type TreeIdentifierUtils, independentView, ForestTypeOptimized, ForestTypeExpensiveDebug, ForestTypeReference, } from "./shared-tree/index.js";
|
|
33
|
-
export { TreeArrayNode, type Unhydrated, IterableTreeArrayContent, TreeNode, type ViewableTree, type ITree, type TreeNodeSchema, TreeViewConfiguration, type ITreeViewConfiguration, type ITreeConfigurationOptions, type TreeView, type TreeViewEvents, SchemaFactory, SchemaFactoryAlpha, type SchemaFactoryObjectOptions, type ImplicitFieldSchema, type TreeFieldFromImplicitField, type TreeChangeEvents, type NodeFromSchema, type TreeMapNode, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, FieldKind, FieldSchema, type FieldSchemaAlpha, type FieldSchemaMetadata, type ImplicitAllowedTypes, type InsertableTreeFieldFromImplicitField, type InsertableTypedNode, NodeKind, type TreeObjectNode, ObjectNodeSchema, type TreeNodeFromImplicitAllowedTypes, type TreeNodeSchemaClass, type SchemaCompatibilityStatus, type FieldProps, type FieldPropsAlpha, type InternalTreeNode, type WithType, type NodeChangedData, type TreeNodeApi, type TreeNodeSchemaCore, type AllowedTypes, type System_Unsafe, type FieldSchemaAlphaUnsafe, type ArrayNodeCustomizableSchemaUnsafe, type MapNodeCustomizableSchemaUnsafe, type TreeRecordNodeUnsafe, type typeSchemaSymbol, type TreeNodeSchemaNonClass, type ValidateRecursiveSchema, type FixRecursiveArraySchema, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, adaptEnum, enumFromStrings, singletonSchema, type UnsafeUnknownSchema, type TreeViewAlpha, type InsertableField, type Insertable, type InsertableContent, type FactoryContent, type FactoryContentObject, type ReadableField, type ReadSchema, type ImplicitAnnotatedAllowedTypes, type ImplicitAnnotatedFieldSchema, type AnnotatedAllowedType, type AnnotatedAllowedTypes, type NormalizedAnnotatedAllowedTypes, type AllowedTypeMetadata, type AllowedTypesMetadata, type InsertableObjectFromAnnotatedSchemaRecord, type UnannotateImplicitAllowedTypes, type UnannotateAllowedTypes, type UnannotateAllowedType, type UnannotateAllowedTypesList, type UnannotateAllowedTypeOrLazyItem, type UnannotateImplicitFieldSchema, type UnannotateSchemaRecord, TreeBeta, type TreeChangeEventsBeta, type VerboseTreeNode, type TreeEncodingOptions, type TreeSchemaEncodingOptions, type TreeSchema, TreeViewConfigurationAlpha, type VerboseTree, extractPersistedSchema, comparePersistedSchema, type ConciseTree, type JsonTreeSchema, type JsonSchemaId, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonLeafNodeSchema, type JsonMapNodeSchema, type JsonArrayNodeSchema, type JsonObjectNodeSchema, type JsonFieldSchema, type JsonSchemaRef, type JsonRefPath, type JsonSchemaType, type JsonLeafSchemaType, type JsonRecordNodeSchema, type JsonStringKeyPatternProperties, getJsonSchema, type LazyItem, type Unenforced, type SimpleNodeSchemaBase, type SimpleNodeSchemaBaseAlpha, type SimpleTreeSchema, type SimpleNodeSchema, type SimpleFieldSchema, type SimpleLeafNodeSchema, type SimpleMapNodeSchema, type SimpleArrayNodeSchema, type SimpleObjectNodeSchema, type SimpleObjectFieldSchema, type SimpleRecordNodeSchema, normalizeAllowedTypes, getSimpleSchema, type ReadonlyArrayNode, type InsertableTreeNodeFromAllowedTypes, type Input, type TreeBranch, type TreeBranchEvents, asTreeViewAlpha, type NodeSchemaOptions, type NodeSchemaOptionsAlpha, type NodeSchemaMetadata, type SchemaStatics, type ITreeAlpha, type TransactionConstraint, type NodeInDocumentConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, generateSchemaFromSimpleSchema, evaluateLazySchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, type HandleConverter, allowUnused, type LeafSchema, type ArrayNodeCustomizableSchema, type ArrayNodePojoEmulationSchema, ArrayNodeSchema, type MapNodeCustomizableSchema, type MapNodePojoEmulationSchema, MapNodeSchema, type ObjectFromSchemaRecord, type ValidateRecursiveSchemaTemplate, type FixRecursiveRecursionLimit, RecordNodeSchema, type RecordNodeCustomizableSchema, type RecordNodeInsertableData, type RecordNodePojoEmulationSchema, type TreeRecordNode, } from "./simple-tree/index.js";
|
|
33
|
+
export { TreeArrayNode, type Unhydrated, IterableTreeArrayContent, TreeNode, type ViewableTree, type ITree, type TreeNodeSchema, TreeViewConfiguration, type ITreeViewConfiguration, type ITreeConfigurationOptions, type TreeView, type TreeViewEvents, SchemaFactory, SchemaFactoryAlpha, type SchemaFactoryObjectOptions, type ImplicitFieldSchema, type TreeFieldFromImplicitField, type TreeChangeEvents, type NodeFromSchema, type TreeMapNode, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, FieldKind, FieldSchema, type FieldSchemaAlpha, type FieldSchemaMetadata, type ImplicitAllowedTypes, type InsertableTreeFieldFromImplicitField, type InsertableTypedNode, NodeKind, type TreeObjectNode, ObjectNodeSchema, type TreeNodeFromImplicitAllowedTypes, type TreeNodeSchemaClass, type SchemaCompatibilityStatus, type FieldProps, type FieldPropsAlpha, normalizeFieldSchema, type InternalTreeNode, type WithType, type NodeChangedData, type TreeNodeApi, type TreeNodeSchemaCore, type AllowedTypes, type System_Unsafe, type FieldSchemaAlphaUnsafe, type ArrayNodeCustomizableSchemaUnsafe, type MapNodeCustomizableSchemaUnsafe, type TreeRecordNodeUnsafe, type typeSchemaSymbol, type TreeNodeSchemaNonClass, type ValidateRecursiveSchema, type FixRecursiveArraySchema, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, adaptEnum, enumFromStrings, singletonSchema, type UnsafeUnknownSchema, type TreeViewAlpha, type InsertableField, type Insertable, type InsertableContent, type FactoryContent, type FactoryContentObject, type ReadableField, type ReadSchema, type ImplicitAnnotatedAllowedTypes, type ImplicitAnnotatedFieldSchema, type AnnotatedAllowedType, type AnnotatedAllowedTypes, type NormalizedAnnotatedAllowedTypes, type AllowedTypeMetadata, type AllowedTypesMetadata, type InsertableObjectFromAnnotatedSchemaRecord, type UnannotateImplicitAllowedTypes, type UnannotateAllowedTypes, type UnannotateAllowedType, type UnannotateAllowedTypesList, type UnannotateAllowedTypeOrLazyItem, type UnannotateImplicitFieldSchema, type UnannotateSchemaRecord, TreeBeta, type TreeChangeEventsBeta, type VerboseTreeNode, type TreeEncodingOptions, type TreeSchemaEncodingOptions, type TreeSchema, TreeViewConfigurationAlpha, type VerboseTree, extractPersistedSchema, comparePersistedSchema, type ConciseTree, type JsonTreeSchema, type JsonSchemaId, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonLeafNodeSchema, type JsonMapNodeSchema, type JsonArrayNodeSchema, type JsonObjectNodeSchema, type JsonFieldSchema, type JsonSchemaRef, type JsonRefPath, type JsonSchemaType, type JsonLeafSchemaType, type JsonRecordNodeSchema, type JsonStringKeyPatternProperties, getJsonSchema, type LazyItem, type Unenforced, type SimpleNodeSchemaBase, type SimpleNodeSchemaBaseAlpha, type SimpleTreeSchema, type SimpleNodeSchema, type SimpleFieldSchema, type SimpleLeafNodeSchema, type SimpleMapNodeSchema, type SimpleArrayNodeSchema, type SimpleObjectNodeSchema, type SimpleObjectFieldSchema, type SimpleRecordNodeSchema, normalizeAllowedTypes, walkFieldSchema, walkNodeSchema, walkAllowedTypes, type SchemaVisitor, getSimpleSchema, type ReadonlyArrayNode, type InsertableTreeNodeFromAllowedTypes, type Input, type TreeBranch, type TreeBranchEvents, asTreeViewAlpha, type NodeSchemaOptions, type NodeSchemaOptionsAlpha, type NodeSchemaMetadata, type SchemaStatics, type ITreeAlpha, type TransactionConstraint, type NodeInDocumentConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, generateSchemaFromSimpleSchema, evaluateLazySchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, type HandleConverter, allowUnused, type LeafSchema, type ArrayNodeCustomizableSchema, type ArrayNodePojoEmulationSchema, ArrayNodeSchema, type MapNodeCustomizableSchema, type MapNodePojoEmulationSchema, MapNodeSchema, type ObjectFromSchemaRecord, type ValidateRecursiveSchemaTemplate, type FixRecursiveRecursionLimit, RecordNodeSchema, type RecordNodeCustomizableSchema, type RecordNodeInsertableData, type RecordNodePojoEmulationSchema, type TreeRecordNode, } from "./simple-tree/index.js";
|
|
34
34
|
export { SharedTree, configuredSharedTree, } from "./treeFactory.js";
|
|
35
35
|
export { SharedTreeAttributes, SharedTreeFactoryType } from "./sharedTreeAttributes.js";
|
|
36
36
|
export { persistedToSimpleSchema } from "./shared-tree/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,O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BAA2B,CAAC;AACxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,kBAAkB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,YAAY,EAEX,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,KAAK,EACL,WAAW,EAEX,yBAAyB,EACzB,uBAAuB,EACvB,WAAW,EACX,OAAO,EACP,mBAAmB,EACnB,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,4BAA4B,GAC5B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO;AACN;;;GAGG;AACH,aAAa,GACb,CAAC;AAKF,YAAY,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
export { ValueSchema, CommitKind, RevertibleStatus, } from "./core/index.js";
|
|
6
6
|
export { TreeStatus, TreeCompressionStrategy, } from "./feature-libraries/index.js";
|
|
7
7
|
export { SharedTreeFormatVersion, Tree, getBranch, independentInitializedView, TreeAlpha, independentView, ForestTypeOptimized, ForestTypeExpensiveDebug, ForestTypeReference, } from "./shared-tree/index.js";
|
|
8
|
-
export { TreeArrayNode, IterableTreeArrayContent, TreeViewConfiguration, SchemaFactory, SchemaFactoryAlpha, FieldKind, FieldSchema, NodeKind, ObjectNodeSchema, createSimpleTreeIndex, createIdentifierIndex,
|
|
8
|
+
export { TreeArrayNode, IterableTreeArrayContent, TreeViewConfiguration, SchemaFactory, SchemaFactoryAlpha, FieldKind, FieldSchema, NodeKind, ObjectNodeSchema, normalizeFieldSchema, createSimpleTreeIndex, createIdentifierIndex,
|
|
9
9
|
// experimental @alpha APIs:
|
|
10
10
|
adaptEnum, enumFromStrings, singletonSchema,
|
|
11
11
|
// Beta APIs
|
|
12
|
-
TreeBeta, TreeViewConfigurationAlpha, extractPersistedSchema, comparePersistedSchema, getJsonSchema, normalizeAllowedTypes, getSimpleSchema, asTreeViewAlpha, rollback, generateSchemaFromSimpleSchema, evaluateLazySchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, allowUnused, ArrayNodeSchema, MapNodeSchema, RecordNodeSchema, } from "./simple-tree/index.js";
|
|
12
|
+
TreeBeta, TreeViewConfigurationAlpha, extractPersistedSchema, comparePersistedSchema, getJsonSchema, normalizeAllowedTypes, walkFieldSchema, walkNodeSchema, walkAllowedTypes, getSimpleSchema, asTreeViewAlpha, rollback, generateSchemaFromSimpleSchema, evaluateLazySchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, allowUnused, ArrayNodeSchema, MapNodeSchema, RecordNodeSchema, } from "./simple-tree/index.js";
|
|
13
13
|
export { SharedTree, configuredSharedTree, } from "./treeFactory.js";
|
|
14
14
|
export { SharedTreeAttributes, SharedTreeFactoryType } from "./sharedTreeAttributes.js";
|
|
15
15
|
export { persistedToSimpleSchema } from "./shared-tree/index.js";
|
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,WAAW,EAEX,UAAU,EAC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AAa,GACb,CAAC;AAOF,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,WAAW,EAA2B,MAAM,kBAAkB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tValueSchema,\n\ttype Revertible,\n\tCommitKind,\n\tRevertibleStatus,\n\ttype CommitMetadata,\n\ttype RevertibleFactory,\n\ttype RevertibleAlphaFactory,\n\ttype RevertibleAlpha,\n} from \"./core/index.js\";\n\nimport type {\n\tListeners as EventListeners,\n\tIsListener as EventIsListener,\n\tListenable as EventListenable,\n\tOff as EventOff,\n} from \"@fluidframework/core-interfaces\";\n\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Listeners}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Listeners<T extends object> = EventListeners<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#IsListener}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type IsListener<T> = EventIsListener<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Listenable}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Listenable<T extends object> = EventListenable<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Off}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Off = EventOff;\n\nexport {\n\tTreeStatus,\n\tTreeCompressionStrategy,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n} from \"./feature-libraries/index.js\";\n\nexport {\n\ttype ITreeInternal,\n\ttype SharedTreeOptions,\n\ttype ForestType,\n\ttype SharedTreeFormatOptions,\n\tSharedTreeFormatVersion,\n\tTree,\n\ttype RunTransaction,\n\ttype ForestOptions,\n\tgetBranch,\n\ttype BranchableTree,\n\ttype TreeBranchFork,\n\tindependentInitializedView,\n\ttype ViewContent,\n\tTreeAlpha,\n\ttype TreeIdentifierUtils,\n\tindependentView,\n\tForestTypeOptimized,\n\tForestTypeExpensiveDebug,\n\tForestTypeReference,\n} from \"./shared-tree/index.js\";\n\nexport {\n\tTreeArrayNode,\n\ttype Unhydrated,\n\tIterableTreeArrayContent,\n\tTreeNode,\n\ttype ViewableTree,\n\ttype ITree,\n\ttype TreeNodeSchema,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype ITreeConfigurationOptions,\n\ttype TreeView,\n\ttype TreeViewEvents,\n\tSchemaFactory,\n\tSchemaFactoryAlpha,\n\ttype SchemaFactoryObjectOptions,\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\ttype TreeChangeEvents,\n\ttype NodeFromSchema,\n\ttype TreeMapNode,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\tFieldKind,\n\tFieldSchema,\n\ttype FieldSchemaAlpha,\n\ttype FieldSchemaMetadata,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InsertableTypedNode,\n\tNodeKind,\n\ttype TreeObjectNode,\n\tObjectNodeSchema,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype TreeNodeSchemaClass,\n\ttype SchemaCompatibilityStatus,\n\ttype FieldProps,\n\ttype FieldPropsAlpha,\n\ttype InternalTreeNode,\n\ttype WithType,\n\ttype NodeChangedData,\n\t// Types not really intended for public use, but used in links.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// Error: src/simple-tree/objectNode.ts:72:1 - (ae-unresolved-link) The @link reference could not be resolved: The package \"@fluidframework/tree\" does not have an export \"TreeNodeApi\"\n\ttype TreeNodeApi,\n\ttype TreeNodeSchemaCore,\n\t// Types not really intended for public use, but used in inferred types exposed in the public API.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// error TS2742: The inferred type of 'Inventory' cannot be named without a reference to '../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\n\ttype AllowedTypes,\n\ttype System_Unsafe,\n\ttype FieldSchemaAlphaUnsafe,\n\ttype ArrayNodeCustomizableSchemaUnsafe,\n\ttype MapNodeCustomizableSchemaUnsafe,\n\ttype TreeRecordNodeUnsafe,\n\t// System types (not in Internal types for various reasons, like doc links or cannot be named errors).\n\ttype typeSchemaSymbol,\n\ttype TreeNodeSchemaNonClass,\n\t// Recursive Schema APIs\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\t// Index APIs\n\ttype SimpleTreeIndex,\n\ttype IdentifierIndex,\n\tcreateSimpleTreeIndex,\n\tcreateIdentifierIndex,\n\t// experimental @alpha APIs:\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttype UnsafeUnknownSchema,\n\ttype TreeViewAlpha,\n\ttype InsertableField,\n\ttype Insertable,\n\ttype InsertableContent,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n\ttype ReadableField,\n\ttype ReadSchema,\n\ttype ImplicitAnnotatedAllowedTypes,\n\ttype ImplicitAnnotatedFieldSchema,\n\ttype AnnotatedAllowedType,\n\ttype AnnotatedAllowedTypes,\n\ttype NormalizedAnnotatedAllowedTypes,\n\ttype AllowedTypeMetadata,\n\ttype AllowedTypesMetadata,\n\ttype InsertableObjectFromAnnotatedSchemaRecord,\n\ttype UnannotateImplicitAllowedTypes,\n\ttype UnannotateAllowedTypes,\n\ttype UnannotateAllowedType,\n\ttype UnannotateAllowedTypesList,\n\ttype UnannotateAllowedTypeOrLazyItem,\n\ttype UnannotateImplicitFieldSchema,\n\ttype UnannotateSchemaRecord,\n\t// Beta APIs\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\t// Other\n\ttype VerboseTreeNode,\n\ttype TreeEncodingOptions,\n\ttype TreeSchemaEncodingOptions,\n\ttype TreeSchema,\n\tTreeViewConfigurationAlpha,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n\ttype ConciseTree,\n\t// Back to normal types\n\ttype JsonTreeSchema,\n\ttype JsonSchemaId,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonLeafNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonObjectNodeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonSchemaType,\n\ttype JsonLeafSchemaType,\n\ttype JsonRecordNodeSchema,\n\ttype JsonStringKeyPatternProperties,\n\tgetJsonSchema,\n\ttype LazyItem,\n\ttype Unenforced,\n\ttype SimpleNodeSchemaBase,\n\ttype SimpleNodeSchemaBaseAlpha,\n\ttype SimpleTreeSchema,\n\ttype SimpleNodeSchema,\n\ttype SimpleFieldSchema,\n\ttype SimpleLeafNodeSchema,\n\ttype SimpleMapNodeSchema,\n\ttype SimpleArrayNodeSchema,\n\ttype SimpleObjectNodeSchema,\n\ttype SimpleObjectFieldSchema,\n\ttype SimpleRecordNodeSchema,\n\tnormalizeAllowedTypes,\n\tgetSimpleSchema,\n\ttype ReadonlyArrayNode,\n\ttype InsertableTreeNodeFromAllowedTypes,\n\ttype Input,\n\ttype TreeBranch,\n\ttype TreeBranchEvents,\n\tasTreeViewAlpha,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaOptionsAlpha,\n\ttype NodeSchemaMetadata,\n\ttype SchemaStatics,\n\ttype ITreeAlpha,\n\ttype TransactionConstraint,\n\ttype NodeInDocumentConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n\tgenerateSchemaFromSimpleSchema,\n\tevaluateLazySchema,\n\treplaceConciseTreeHandles,\n\treplaceHandles,\n\treplaceVerboseTreeHandles,\n\ttype HandleConverter,\n\tallowUnused,\n\ttype LeafSchema,\n\ttype ArrayNodeCustomizableSchema,\n\ttype ArrayNodePojoEmulationSchema,\n\tArrayNodeSchema,\n\ttype MapNodeCustomizableSchema,\n\ttype MapNodePojoEmulationSchema,\n\tMapNodeSchema,\n\ttype ObjectFromSchemaRecord,\n\ttype ValidateRecursiveSchemaTemplate,\n\ttype FixRecursiveRecursionLimit,\n\tRecordNodeSchema,\n\ttype RecordNodeCustomizableSchema,\n\ttype RecordNodeInsertableData,\n\ttype RecordNodePojoEmulationSchema,\n\ttype TreeRecordNode,\n} from \"./simple-tree/index.js\";\nexport {\n\tSharedTree,\n\tconfiguredSharedTree,\n} from \"./treeFactory.js\";\nexport { SharedTreeAttributes, SharedTreeFactoryType } from \"./sharedTreeAttributes.js\";\nexport { persistedToSimpleSchema } from \"./shared-tree/index.js\";\n\nexport {\n\ttype ICodecOptions,\n\ttype CodecWriteOptions,\n\ttype JsonValidator,\n\ttype SchemaValidationFunction,\n\tFluidClientVersion,\n} from \"./codec/index.js\";\nexport { noopValidator } from \"./codec/index.js\";\nexport { typeboxValidator } from \"./external-utilities/index.js\";\n\nexport type {\n\t// Type Testing\n\trequireTrue,\n\trequireFalse,\n\trequireAssignableTo,\n\tareSafelyAssignable,\n\tisAssignableTo,\n\tisAny,\n\teitherIsAny,\n\t// Other\n\tRestrictiveReadonlyRecord,\n\tRestrictiveStringRecord,\n\tMakeNominal,\n\tIsUnion,\n\tUnionToIntersection,\n\tUnionToTuple,\n\tPopUnion,\n\tJsonCompatible,\n\tJsonCompatibleObject,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnlyObject,\n} from \"./util/index.js\";\nexport { cloneWithReplacements } from \"./util/index.js\";\n\nimport * as InternalTypes from \"./internalTypes.js\";\nexport {\n\t/**\n\t * Contains types used by the API, but which serve mechanical purposes and do not represent semantic concepts.\n\t * They are used internally to implement API aspects, but are not intended for use by external consumers.\n\t */\n\tInternalTypes,\n};\n\n// Internal/System types:\n// These would be put in `internalTypes` except doing so tents to cause errors like:\n// The inferred type of 'NodeMap' cannot be named without a reference to '../../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\nexport type { MapNodeInsertableData } from \"./simple-tree/index.js\";\n\nexport { JsonAsTree } from \"./jsonDomainSchema.js\";\nexport { FluidSerializableAsTree } from \"./serializableDomainSchema.js\";\nexport { TableSchema, type System_TableSchema } from \"./tableSchema.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,WAAW,EAEX,UAAU,EACV,gBAAgB,GAKhB,MAAM,iBAAiB,CAAC;AAkCzB,OAAO,EACN,UAAU,EACV,uBAAuB,GAIvB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAKN,uBAAuB,EACvB,IAAI,EAGJ,SAAS,EAGT,0BAA0B,EAE1B,SAAS,EAET,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,GACnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACN,aAAa,EAEb,wBAAwB,EAKxB,qBAAqB,EAKrB,aAAa,EACb,kBAAkB,EASlB,SAAS,EACT,WAAW,EAMX,QAAQ,EAER,gBAAgB,EAMhB,oBAAoB,EA2BpB,qBAAqB,EACrB,qBAAqB;AACrB,4BAA4B;AAC5B,SAAS,EACT,eAAe,EACf,eAAe;AAyBf,YAAY;AACZ,QAAQ,EAOR,0BAA0B,EAE1B,sBAAsB,EACtB,sBAAsB,EAkBtB,aAAa,EAcb,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,gBAAgB,EAEhB,eAAe,EAMf,eAAe,EAef,QAAQ,EACR,8BAA8B,EAC9B,kBAAkB,EAClB,yBAAyB,EACzB,cAAc,EACd,yBAAyB,EAEzB,WAAW,EAIX,eAAe,EAGf,aAAa,EAIb,gBAAgB,GAKhB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,UAAU,EACV,oBAAoB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EAKN,kBAAkB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAwBjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO;AACN;;;GAGG;AACH,aAAa,GACb,CAAC;AAOF,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,WAAW,EAA2B,MAAM,kBAAkB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tValueSchema,\n\ttype Revertible,\n\tCommitKind,\n\tRevertibleStatus,\n\ttype CommitMetadata,\n\ttype RevertibleFactory,\n\ttype RevertibleAlphaFactory,\n\ttype RevertibleAlpha,\n} from \"./core/index.js\";\n\nimport type {\n\tListeners as EventListeners,\n\tIsListener as EventIsListener,\n\tListenable as EventListenable,\n\tOff as EventOff,\n} from \"@fluidframework/core-interfaces\";\n\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Listeners}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Listeners<T extends object> = EventListeners<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#IsListener}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type IsListener<T> = EventIsListener<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Listenable}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Listenable<T extends object> = EventListenable<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Off}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Off = EventOff;\n\nexport {\n\tTreeStatus,\n\tTreeCompressionStrategy,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n} from \"./feature-libraries/index.js\";\n\nexport {\n\ttype ITreeInternal,\n\ttype SharedTreeOptions,\n\ttype ForestType,\n\ttype SharedTreeFormatOptions,\n\tSharedTreeFormatVersion,\n\tTree,\n\ttype RunTransaction,\n\ttype ForestOptions,\n\tgetBranch,\n\ttype BranchableTree,\n\ttype TreeBranchFork,\n\tindependentInitializedView,\n\ttype ViewContent,\n\tTreeAlpha,\n\ttype TreeIdentifierUtils,\n\tindependentView,\n\tForestTypeOptimized,\n\tForestTypeExpensiveDebug,\n\tForestTypeReference,\n} from \"./shared-tree/index.js\";\n\nexport {\n\tTreeArrayNode,\n\ttype Unhydrated,\n\tIterableTreeArrayContent,\n\tTreeNode,\n\ttype ViewableTree,\n\ttype ITree,\n\ttype TreeNodeSchema,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype ITreeConfigurationOptions,\n\ttype TreeView,\n\ttype TreeViewEvents,\n\tSchemaFactory,\n\tSchemaFactoryAlpha,\n\ttype SchemaFactoryObjectOptions,\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\ttype TreeChangeEvents,\n\ttype NodeFromSchema,\n\ttype TreeMapNode,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\tFieldKind,\n\tFieldSchema,\n\ttype FieldSchemaAlpha,\n\ttype FieldSchemaMetadata,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InsertableTypedNode,\n\tNodeKind,\n\ttype TreeObjectNode,\n\tObjectNodeSchema,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype TreeNodeSchemaClass,\n\ttype SchemaCompatibilityStatus,\n\ttype FieldProps,\n\ttype FieldPropsAlpha,\n\tnormalizeFieldSchema,\n\ttype InternalTreeNode,\n\ttype WithType,\n\ttype NodeChangedData,\n\t// Types not really intended for public use, but used in links.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// Error: src/simple-tree/objectNode.ts:72:1 - (ae-unresolved-link) The @link reference could not be resolved: The package \"@fluidframework/tree\" does not have an export \"TreeNodeApi\"\n\ttype TreeNodeApi,\n\ttype TreeNodeSchemaCore,\n\t// Types not really intended for public use, but used in inferred types exposed in the public API.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// error TS2742: The inferred type of 'Inventory' cannot be named without a reference to '../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\n\ttype AllowedTypes,\n\ttype System_Unsafe,\n\ttype FieldSchemaAlphaUnsafe,\n\ttype ArrayNodeCustomizableSchemaUnsafe,\n\ttype MapNodeCustomizableSchemaUnsafe,\n\ttype TreeRecordNodeUnsafe,\n\t// System types (not in Internal types for various reasons, like doc links or cannot be named errors).\n\ttype typeSchemaSymbol,\n\ttype TreeNodeSchemaNonClass,\n\t// Recursive Schema APIs\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\t// Index APIs\n\ttype SimpleTreeIndex,\n\ttype IdentifierIndex,\n\tcreateSimpleTreeIndex,\n\tcreateIdentifierIndex,\n\t// experimental @alpha APIs:\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttype UnsafeUnknownSchema,\n\ttype TreeViewAlpha,\n\ttype InsertableField,\n\ttype Insertable,\n\ttype InsertableContent,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n\ttype ReadableField,\n\ttype ReadSchema,\n\ttype ImplicitAnnotatedAllowedTypes,\n\ttype ImplicitAnnotatedFieldSchema,\n\ttype AnnotatedAllowedType,\n\ttype AnnotatedAllowedTypes,\n\ttype NormalizedAnnotatedAllowedTypes,\n\ttype AllowedTypeMetadata,\n\ttype AllowedTypesMetadata,\n\ttype InsertableObjectFromAnnotatedSchemaRecord,\n\ttype UnannotateImplicitAllowedTypes,\n\ttype UnannotateAllowedTypes,\n\ttype UnannotateAllowedType,\n\ttype UnannotateAllowedTypesList,\n\ttype UnannotateAllowedTypeOrLazyItem,\n\ttype UnannotateImplicitFieldSchema,\n\ttype UnannotateSchemaRecord,\n\t// Beta APIs\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\t// Other\n\ttype VerboseTreeNode,\n\ttype TreeEncodingOptions,\n\ttype TreeSchemaEncodingOptions,\n\ttype TreeSchema,\n\tTreeViewConfigurationAlpha,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n\ttype ConciseTree,\n\t// Back to normal types\n\ttype JsonTreeSchema,\n\ttype JsonSchemaId,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonLeafNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonObjectNodeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonSchemaType,\n\ttype JsonLeafSchemaType,\n\ttype JsonRecordNodeSchema,\n\ttype JsonStringKeyPatternProperties,\n\tgetJsonSchema,\n\ttype LazyItem,\n\ttype Unenforced,\n\ttype SimpleNodeSchemaBase,\n\ttype SimpleNodeSchemaBaseAlpha,\n\ttype SimpleTreeSchema,\n\ttype SimpleNodeSchema,\n\ttype SimpleFieldSchema,\n\ttype SimpleLeafNodeSchema,\n\ttype SimpleMapNodeSchema,\n\ttype SimpleArrayNodeSchema,\n\ttype SimpleObjectNodeSchema,\n\ttype SimpleObjectFieldSchema,\n\ttype SimpleRecordNodeSchema,\n\tnormalizeAllowedTypes,\n\twalkFieldSchema,\n\twalkNodeSchema,\n\twalkAllowedTypes,\n\ttype SchemaVisitor,\n\tgetSimpleSchema,\n\ttype ReadonlyArrayNode,\n\ttype InsertableTreeNodeFromAllowedTypes,\n\ttype Input,\n\ttype TreeBranch,\n\ttype TreeBranchEvents,\n\tasTreeViewAlpha,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaOptionsAlpha,\n\ttype NodeSchemaMetadata,\n\ttype SchemaStatics,\n\ttype ITreeAlpha,\n\ttype TransactionConstraint,\n\ttype NodeInDocumentConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n\tgenerateSchemaFromSimpleSchema,\n\tevaluateLazySchema,\n\treplaceConciseTreeHandles,\n\treplaceHandles,\n\treplaceVerboseTreeHandles,\n\ttype HandleConverter,\n\tallowUnused,\n\ttype LeafSchema,\n\ttype ArrayNodeCustomizableSchema,\n\ttype ArrayNodePojoEmulationSchema,\n\tArrayNodeSchema,\n\ttype MapNodeCustomizableSchema,\n\ttype MapNodePojoEmulationSchema,\n\tMapNodeSchema,\n\ttype ObjectFromSchemaRecord,\n\ttype ValidateRecursiveSchemaTemplate,\n\ttype FixRecursiveRecursionLimit,\n\tRecordNodeSchema,\n\ttype RecordNodeCustomizableSchema,\n\ttype RecordNodeInsertableData,\n\ttype RecordNodePojoEmulationSchema,\n\ttype TreeRecordNode,\n} from \"./simple-tree/index.js\";\nexport {\n\tSharedTree,\n\tconfiguredSharedTree,\n} from \"./treeFactory.js\";\nexport { SharedTreeAttributes, SharedTreeFactoryType } from \"./sharedTreeAttributes.js\";\nexport { persistedToSimpleSchema } from \"./shared-tree/index.js\";\n\nexport {\n\ttype ICodecOptions,\n\ttype CodecWriteOptions,\n\ttype JsonValidator,\n\ttype SchemaValidationFunction,\n\tFluidClientVersion,\n} from \"./codec/index.js\";\nexport { noopValidator } from \"./codec/index.js\";\nexport { typeboxValidator } from \"./external-utilities/index.js\";\n\nexport type {\n\t// Type Testing\n\trequireTrue,\n\trequireFalse,\n\trequireAssignableTo,\n\tareSafelyAssignable,\n\tisAssignableTo,\n\tisAny,\n\teitherIsAny,\n\t// Other\n\tRestrictiveReadonlyRecord,\n\tRestrictiveStringRecord,\n\tMakeNominal,\n\tIsUnion,\n\tUnionToIntersection,\n\tUnionToTuple,\n\tPopUnion,\n\tJsonCompatible,\n\tJsonCompatibleObject,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnlyObject,\n} from \"./util/index.js\";\nexport { cloneWithReplacements } from \"./util/index.js\";\n\nimport * as InternalTypes from \"./internalTypes.js\";\nexport {\n\t/**\n\t * Contains types used by the API, but which serve mechanical purposes and do not represent semantic concepts.\n\t * They are used internally to implement API aspects, but are not intended for use by external consumers.\n\t */\n\tInternalTypes,\n};\n\n// Internal/System types:\n// These would be put in `internalTypes` except doing so tents to cause errors like:\n// The inferred type of 'NodeMap' cannot be named without a reference to '../../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\nexport type { MapNodeInsertableData } from \"./simple-tree/index.js\";\n\nexport { JsonAsTree } from \"./jsonDomainSchema.js\";\nexport { FluidSerializableAsTree } from \"./serializableDomainSchema.js\";\nexport { TableSchema, type System_TableSchema } from \"./tableSchema.js\";\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
package/lib/packageVersion.js
CHANGED
|
@@ -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,QAAQ,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.
|
|
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,QAAQ,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.52.0\";\n"]}
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
import type { IFluidHandle } from "@fluidframework/core-interfaces";
|
|
6
6
|
import { type IIdCompressor } from "@fluidframework/id-compressor/internal";
|
|
7
7
|
import type { ICodecOptions } from "../codec/index.js";
|
|
8
|
+
import { type ITreeCursorSynchronous, type TreeStoredSchema } from "../core/index.js";
|
|
8
9
|
import type { TreeViewConfiguration, ImplicitFieldSchema, TreeViewAlpha } from "../simple-tree/index.js";
|
|
9
10
|
import { type JsonCompatible } from "../util/index.js";
|
|
10
11
|
import { type ForestOptions } from "./sharedTree.js";
|
|
12
|
+
import { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
|
|
11
13
|
/**
|
|
12
14
|
* Create an uninitialized {@link TreeView} that is not tied to any {@link ITree} instance.
|
|
13
15
|
*
|
|
@@ -27,9 +29,15 @@ export declare function independentView<const TSchema extends ImplicitFieldSchem
|
|
|
27
29
|
* Such a view can never experience collaboration or be persisted to to a Fluid Container.
|
|
28
30
|
*
|
|
29
31
|
* This can be useful for testing, as well as use-cases like working on local files instead of documents stored in some Fluid service.
|
|
32
|
+
* @privateRemarks
|
|
33
|
+
* TODO: Providing an API which generates a {@link ViewableTree} extended with export options from {@link ITreeAlpha} and maybe even branching APIs would likely be better that just exposing a {@link TreeViewAlpha}.
|
|
30
34
|
* @alpha
|
|
31
35
|
*/
|
|
32
36
|
export declare function independentInitializedView<const TSchema extends ImplicitFieldSchema>(config: TreeViewConfiguration<TSchema>, options: ForestOptions & ICodecOptions, content: ViewContent): TreeViewAlpha<TSchema>;
|
|
37
|
+
/**
|
|
38
|
+
* {@link independentInitializedView} but using internal types instead of persisted data formats.
|
|
39
|
+
*/
|
|
40
|
+
export declare function independentInitializedViewInternal<const TSchema extends ImplicitFieldSchema>(config: TreeViewConfiguration<TSchema>, options: ForestOptions & ICodecOptions, schema: TreeStoredSchema, rootFieldCursor: ITreeCursorSynchronous, idCompressor: IIdCompressor): SchematizingSimpleTreeView<TSchema>;
|
|
33
41
|
/**
|
|
34
42
|
* The portion of SharedTree data typically persisted by the container.
|
|
35
43
|
* Usable with {@link independentInitializedView} to create a {@link TreeView}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"independentView.d.ts","sourceRoot":"","sources":["../../src/shared-tree/independentView.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,EACN,KAAK,aAAa,EAElB,MAAM,wCAAwC,CAAC;AAEhD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"independentView.d.ts","sourceRoot":"","sources":["../../src/shared-tree/independentView.ts"],"names":[],"mappings":"AA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,CAAC,OAAO,CAAC,CA2BrC;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;IAC5C;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC;CACrC"}
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
6
6
|
import { createIdCompressor, } from "@fluidframework/id-compressor/internal";
|
|
7
7
|
import { RevisionTagCodec, SchemaVersion, TreeStoredSchemaRepository, } from "../core/index.js";
|
|
8
|
-
import { createNodeIdentifierManager, makeFieldBatchCodec, makeSchemaCodec, defaultSchemaPolicy, TreeCompressionStrategy,
|
|
8
|
+
import { createNodeIdentifierManager, makeFieldBatchCodec, makeSchemaCodec, defaultSchemaPolicy, TreeCompressionStrategy, } from "../feature-libraries/index.js";
|
|
9
9
|
import { Breakable } from "../util/index.js";
|
|
10
10
|
import { buildConfiguredForest, defaultSharedTreeOptions, } from "./sharedTree.js";
|
|
11
11
|
import { createTreeCheckout } from "./treeCheckout.js";
|
|
12
12
|
import { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
|
|
13
|
+
import { initialize } from "./schematizeTree.js";
|
|
13
14
|
/**
|
|
14
15
|
* Create an uninitialized {@link TreeView} that is not tied to any {@link ITree} instance.
|
|
15
16
|
*
|
|
@@ -41,17 +42,15 @@ export function independentView(config, options) {
|
|
|
41
42
|
* Such a view can never experience collaboration or be persisted to to a Fluid Container.
|
|
42
43
|
*
|
|
43
44
|
* This can be useful for testing, as well as use-cases like working on local files instead of documents stored in some Fluid service.
|
|
45
|
+
* @privateRemarks
|
|
46
|
+
* TODO: Providing an API which generates a {@link ViewableTree} extended with export options from {@link ITreeAlpha} and maybe even branching APIs would likely be better that just exposing a {@link TreeViewAlpha}.
|
|
44
47
|
* @alpha
|
|
45
48
|
*/
|
|
46
49
|
export function independentInitializedView(config, options, content) {
|
|
47
|
-
const breaker = new Breakable("independentInitializedView");
|
|
48
50
|
const idCompressor = content.idCompressor;
|
|
49
|
-
const mintRevisionTag = () => idCompressor.generateCompressedId();
|
|
50
|
-
const revisionTagCodec = new RevisionTagCodec(idCompressor);
|
|
51
51
|
const fieldBatchCodec = makeFieldBatchCodec(options, 1);
|
|
52
52
|
const schemaCodec = makeSchemaCodec(options, SchemaVersion.v1);
|
|
53
|
-
const schema =
|
|
54
|
-
const forest = buildConfiguredForest(breaker, options.forest ?? defaultSharedTreeOptions.forest, schema, idCompressor);
|
|
53
|
+
const schema = schemaCodec.decode(content.schema);
|
|
55
54
|
const context = {
|
|
56
55
|
encodeType: TreeCompressionStrategy.Compressed,
|
|
57
56
|
idCompressor,
|
|
@@ -60,15 +59,27 @@ export function independentInitializedView(config, options, content) {
|
|
|
60
59
|
};
|
|
61
60
|
const fieldCursors = fieldBatchCodec.decode(content.tree, context);
|
|
62
61
|
assert(fieldCursors.length === 1, 0xa5b /* must have exactly 1 field in batch */);
|
|
62
|
+
return independentInitializedViewInternal(config, options, schema,
|
|
63
63
|
// Checked above.
|
|
64
64
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
65
|
-
|
|
65
|
+
fieldCursors[0], idCompressor);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* {@link independentInitializedView} but using internal types instead of persisted data formats.
|
|
69
|
+
*/
|
|
70
|
+
export function independentInitializedViewInternal(config, options, schema, rootFieldCursor, idCompressor) {
|
|
71
|
+
const breaker = new Breakable("independentInitializedView");
|
|
72
|
+
const revisionTagCodec = new RevisionTagCodec(idCompressor);
|
|
73
|
+
const mintRevisionTag = () => idCompressor.generateCompressedId();
|
|
74
|
+
// To ensure the forest is in schema when constructed, start it with an empty schema and set the schema repository content later.
|
|
75
|
+
const schemaRepository = new TreeStoredSchemaRepository();
|
|
76
|
+
const forest = buildConfiguredForest(breaker, options.forest ?? defaultSharedTreeOptions.forest, schemaRepository, idCompressor);
|
|
66
77
|
const checkout = createTreeCheckout(idCompressor, mintRevisionTag, revisionTagCodec, {
|
|
67
78
|
forest,
|
|
68
|
-
schema,
|
|
79
|
+
schema: schemaRepository,
|
|
69
80
|
breaker,
|
|
70
81
|
});
|
|
71
|
-
|
|
72
|
-
return
|
|
82
|
+
initialize(checkout, { schema, initialTree: rootFieldCursor });
|
|
83
|
+
return new SchematizingSimpleTreeView(checkout, config, createNodeIdentifierManager(idCompressor));
|
|
73
84
|
}
|
|
74
85
|
//# sourceMappingURL=independentView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"independentView.js","sourceRoot":"","sources":["../../src/shared-tree/independentView.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAEN,kBAAkB,GAClB,MAAM,wCAAwC,CAAC;AAGhD,OAAO,
|
|
1
|
+
{"version":3,"file":"independentView.js","sourceRoot":"","sources":["../../src/shared-tree/independentView.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAEN,kBAAkB,GAClB,MAAM,wCAAwC,CAAC;AAGhD,OAAO,EAGN,gBAAgB,EAChB,aAAa,EAEb,0BAA0B,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,2BAA2B,EAC3B,mBAAmB,EACnB,eAAe,EAEf,mBAAmB,EACnB,uBAAuB,GACvB,MAAM,+BAA+B,CAAC;AAQvC,OAAO,EAAoD,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EACN,qBAAqB,EACrB,wBAAwB,GAExB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2B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W,EAAE,eAAe,EAAE,CAAC,CAAC;IAC/D,OAAO,IAAI,0BAA0B,CACpC,QAAQ,EACR,MAAM,EACN,2BAA2B,CAAC,YAAY,CAAC,CACzC,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\ttype IIdCompressor,\n\tcreateIdCompressor,\n} from \"@fluidframework/id-compressor/internal\";\n\nimport type { ICodecOptions } from \"../codec/index.js\";\nimport {\n\ttype ITreeCursorSynchronous,\n\ttype RevisionTag,\n\tRevisionTagCodec,\n\tSchemaVersion,\n\ttype TreeStoredSchema,\n\tTreeStoredSchemaRepository,\n} from \"../core/index.js\";\nimport {\n\tcreateNodeIdentifierManager,\n\tmakeFieldBatchCodec,\n\tmakeSchemaCodec,\n\ttype FieldBatchEncodingContext,\n\tdefaultSchemaPolicy,\n\tTreeCompressionStrategy,\n} from \"../feature-libraries/index.js\";\n// eslint-disable-next-line import/no-internal-modules\nimport type { Format } from \"../feature-libraries/schema-index/formatV1.js\";\nimport type {\n\tTreeViewConfiguration,\n\tImplicitFieldSchema,\n\tTreeViewAlpha,\n} from \"../simple-tree/index.js\";\nimport { type JsonCompatibleReadOnly, type JsonCompatible, Breakable } from \"../util/index.js\";\nimport {\n\tbuildConfiguredForest,\n\tdefaultSharedTreeOptions,\n\ttype ForestOptions,\n} from \"./sharedTree.js\";\nimport { createTreeCheckout } from \"./treeCheckout.js\";\nimport { SchematizingSimpleTreeView } from \"./schematizingTreeView.js\";\nimport { initialize } from \"./schematizeTree.js\";\n\n/**\n * Create an uninitialized {@link TreeView} that is not tied to any {@link ITree} instance.\n *\n * @remarks\n * Such a view can never experience collaboration or be persisted to to a Fluid Container.\n *\n * This can be useful for testing, as well as use-cases like working on local files instead of documents stored in some Fluid service.\n * @alpha\n */\nexport function independentView<const TSchema extends ImplicitFieldSchema>(\n\tconfig: TreeViewConfiguration<TSchema>,\n\toptions: ForestOptions & { idCompressor?: IIdCompressor | undefined },\n): TreeViewAlpha<TSchema> {\n\tconst breaker = new Breakable(\"independentView\");\n\tconst idCompressor: IIdCompressor = options.idCompressor ?? createIdCompressor();\n\tconst mintRevisionTag = (): RevisionTag => idCompressor.generateCompressedId();\n\tconst revisionTagCodec = new RevisionTagCodec(idCompressor);\n\tconst schema = new TreeStoredSchemaRepository();\n\tconst forest = buildConfiguredForest(\n\t\tbreaker,\n\t\toptions.forest ?? defaultSharedTreeOptions.forest,\n\t\tschema,\n\t\tidCompressor,\n\t);\n\tconst checkout = createTreeCheckout(idCompressor, mintRevisionTag, revisionTagCodec, {\n\t\tforest,\n\t\tschema,\n\t\tbreaker,\n\t});\n\tconst out: TreeViewAlpha<TSchema> = new SchematizingSimpleTreeView<TSchema>(\n\t\tcheckout,\n\t\tconfig,\n\t\tcreateNodeIdentifierManager(idCompressor),\n\t);\n\treturn out;\n}\n/**\n * Create an initialized {@link TreeView} that is not tied to any {@link ITree} instance.\n *\n * @remarks\n * Such a view can never experience collaboration or be persisted to to a Fluid Container.\n *\n * This can be useful for testing, as well as use-cases like working on local files instead of documents stored in some Fluid service.\n * @privateRemarks\n * TODO: Providing an API which generates a {@link ViewableTree} extended with export options from {@link ITreeAlpha} and maybe even branching APIs would likely be better that just exposing a {@link TreeViewAlpha}.\n * @alpha\n */\nexport function independentInitializedView<const TSchema extends ImplicitFieldSchema>(\n\tconfig: TreeViewConfiguration<TSchema>,\n\toptions: ForestOptions & ICodecOptions,\n\tcontent: ViewContent,\n): TreeViewAlpha<TSchema> {\n\tconst idCompressor: IIdCompressor = content.idCompressor;\n\tconst fieldBatchCodec = makeFieldBatchCodec(options, 1);\n\tconst schemaCodec = makeSchemaCodec(options, SchemaVersion.v1);\n\n\tconst schema = schemaCodec.decode(content.schema as Format);\n\tconst context: FieldBatchEncodingContext = {\n\t\tencodeType: TreeCompressionStrategy.Compressed,\n\t\tidCompressor,\n\t\toriginatorId: idCompressor.localSessionId, // Is this right? If so, why is is needed?\n\t\tschema: { schema, policy: defaultSchemaPolicy },\n\t};\n\n\tconst fieldCursors = fieldBatchCodec.decode(content.tree as JsonCompatibleReadOnly, context);\n\tassert(fieldCursors.length === 1, 0xa5b /* must have exactly 1 field in batch */);\n\n\treturn independentInitializedViewInternal(\n\t\tconfig,\n\t\toptions,\n\t\tschema,\n\t\t// Checked above.\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\tfieldCursors[0]!,\n\t\tidCompressor,\n\t);\n}\n\n/**\n * {@link independentInitializedView} but using internal types instead of persisted data formats.\n */\nexport function independentInitializedViewInternal<const TSchema extends ImplicitFieldSchema>(\n\tconfig: TreeViewConfiguration<TSchema>,\n\toptions: ForestOptions & ICodecOptions,\n\tschema: TreeStoredSchema,\n\trootFieldCursor: ITreeCursorSynchronous,\n\tidCompressor: IIdCompressor,\n): SchematizingSimpleTreeView<TSchema> {\n\tconst breaker = new Breakable(\"independentInitializedView\");\n\tconst revisionTagCodec = new RevisionTagCodec(idCompressor);\n\tconst mintRevisionTag = (): RevisionTag => idCompressor.generateCompressedId();\n\n\t// To ensure the forest is in schema when constructed, start it with an empty schema and set the schema repository content later.\n\tconst schemaRepository = new TreeStoredSchemaRepository();\n\n\tconst forest = buildConfiguredForest(\n\t\tbreaker,\n\t\toptions.forest ?? defaultSharedTreeOptions.forest,\n\t\tschemaRepository,\n\t\tidCompressor,\n\t);\n\n\tconst checkout = createTreeCheckout(idCompressor, mintRevisionTag, revisionTagCodec, {\n\t\tforest,\n\t\tschema: schemaRepository,\n\t\tbreaker,\n\t});\n\n\tinitialize(checkout, { schema, initialTree: rootFieldCursor });\n\treturn new SchematizingSimpleTreeView<TSchema>(\n\t\tcheckout,\n\t\tconfig,\n\t\tcreateNodeIdentifierManager(idCompressor),\n\t);\n}\n\n/**\n * The portion of SharedTree data typically persisted by the container.\n * Usable with {@link independentInitializedView} to create a {@link TreeView}\n * without loading a container.\n * @alpha\n */\nexport interface ViewContent {\n\t/**\n\t * Compressed tree from {@link (TreeAlpha:interface).exportCompressed}.\n\t * @remarks\n\t * This is an owning reference:\n\t * consumers of this content might modify this data in place (for example when applying edits) to avoid copying.\n\t */\n\treadonly tree: JsonCompatible<IFluidHandle>;\n\t/**\n\t * Persisted schema from {@link extractPersistedSchema}.\n\t */\n\treadonly schema: JsonCompatible;\n\t/**\n\t * IIdCompressor which will be used to decompress any compressed identifiers in `tree`\n\t * as well as for any other identifiers added to the view.\n\t */\n\treadonly idCompressor: IIdCompressor;\n}\n"]}
|
|
@@ -161,7 +161,7 @@ export function ensureSchema(viewSchema, checkout) {
|
|
|
161
161
|
return false;
|
|
162
162
|
}
|
|
163
163
|
case UpdateType.SchemaCompatible: {
|
|
164
|
-
checkout.updateSchema(toStoredSchema(viewSchema.
|
|
164
|
+
checkout.updateSchema(toStoredSchema(viewSchema.viewSchema.root));
|
|
165
165
|
return true;
|
|
166
166
|
}
|
|
167
167
|
default: {
|