@fluidframework/tree 2.32.0 → 2.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/api-report/tree.alpha.api.md +169 -192
- package/api-report/tree.beta.api.md +135 -164
- package/api-report/tree.legacy.alpha.api.md +138 -167
- package/api-report/tree.legacy.public.api.md +135 -164
- package/api-report/tree.public.api.md +135 -164
- package/dist/alpha.d.ts +3 -11
- package/dist/beta.d.ts +2 -11
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/schema-stored/index.d.ts +1 -1
- package/dist/core/schema-stored/index.d.ts.map +1 -1
- package/dist/core/schema-stored/index.js +1 -2
- package/dist/core/schema-stored/index.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +4 -11
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +7 -14
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +31 -24
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/deltaUtil.d.ts +1 -4
- package/dist/core/tree/deltaUtil.d.ts.map +1 -1
- package/dist/core/tree/deltaUtil.js +1 -13
- package/dist/core/tree/deltaUtil.js.map +1 -1
- package/dist/core/tree/visitDelta.d.ts +6 -29
- package/dist/core/tree/visitDelta.d.ts.map +1 -1
- package/dist/core/tree/visitDelta.js +11 -50
- package/dist/core/tree/visitDelta.js.map +1 -1
- package/dist/core/tree/visitorUtils.d.ts +12 -9
- package/dist/core/tree/visitorUtils.d.ts.map +1 -1
- package/dist/core/tree/visitorUtils.js +19 -32
- package/dist/core/tree/visitorUtils.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +6 -11
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts +41 -5
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js +43 -26
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +5 -0
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +4 -0
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +8 -0
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js +8 -0
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.js +15 -22
- package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/dist/feature-libraries/node-identifier/nodeIdentifierManager.d.ts.map +1 -1
- package/dist/feature-libraries/node-identifier/nodeIdentifierManager.js +29 -25
- package/dist/feature-libraries/node-identifier/nodeIdentifierManager.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +1 -7
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +1 -1
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/internalTypes.d.ts +1 -1
- package/dist/internalTypes.d.ts.map +1 -1
- package/dist/internalTypes.js.map +1 -1
- package/dist/jsonDomainSchema.d.ts +6 -6
- package/dist/jsonDomainSchema.d.ts.map +1 -1
- package/dist/jsonDomainSchema.js.map +1 -1
- package/dist/legacy.d.ts +2 -11
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/public.d.ts +2 -11
- package/dist/serializableDomainSchema.d.ts +5 -5
- package/dist/shared-tree/checkoutFlexTreeView.d.ts +1 -0
- package/dist/shared-tree/checkoutFlexTreeView.d.ts.map +1 -1
- package/dist/shared-tree/checkoutFlexTreeView.js +4 -0
- package/dist/shared-tree/checkoutFlexTreeView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +3 -2
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +2 -2
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +4 -35
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +4 -54
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +2 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +3 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +28 -28
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +11 -11
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +6 -7
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +24 -5
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js +14 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/testRecursiveDomain.d.ts +10 -10
- package/dist/simple-tree/api/tree.d.ts +1 -14
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +237 -220
- package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts +2 -2
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts +9 -2
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +39 -24
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/types.d.ts +14 -4
- package/dist/simple-tree/core/types.d.ts.map +1 -1
- package/dist/simple-tree/core/types.js +14 -4
- package/dist/simple-tree/core/types.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts +2 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +3 -0
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/index.d.ts +1 -1
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +3 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/objectNode.d.ts +9 -2
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +3 -0
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +10 -5
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js +5 -2
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/tableSchema.d.ts +78 -26
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +53 -24
- package/dist/tableSchema.js.map +1 -1
- package/dist/treeFactory.d.ts +6 -12
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +56 -5
- package/dist/treeFactory.js.map +1 -1
- package/lib/alpha.d.ts +3 -11
- package/lib/beta.d.ts +2 -11
- 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/schema-stored/index.d.ts +1 -1
- package/lib/core/schema-stored/index.d.ts.map +1 -1
- package/lib/core/schema-stored/index.js +1 -1
- package/lib/core/schema-stored/index.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +4 -11
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +6 -12
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +31 -24
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/deltaUtil.d.ts +1 -4
- package/lib/core/tree/deltaUtil.d.ts.map +1 -1
- package/lib/core/tree/deltaUtil.js +0 -9
- package/lib/core/tree/deltaUtil.js.map +1 -1
- package/lib/core/tree/visitDelta.d.ts +6 -29
- package/lib/core/tree/visitDelta.d.ts.map +1 -1
- package/lib/core/tree/visitDelta.js +12 -51
- package/lib/core/tree/visitDelta.js.map +1 -1
- package/lib/core/tree/visitorUtils.d.ts +12 -9
- package/lib/core/tree/visitorUtils.d.ts.map +1 -1
- package/lib/core/tree/visitorUtils.js +19 -32
- package/lib/core/tree/visitorUtils.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +6 -11
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts +41 -5
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js +43 -26
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +5 -0
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +5 -1
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +8 -0
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js +8 -0
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.js +15 -22
- package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/lib/feature-libraries/node-identifier/nodeIdentifierManager.d.ts.map +1 -1
- package/lib/feature-libraries/node-identifier/nodeIdentifierManager.js +28 -24
- package/lib/feature-libraries/node-identifier/nodeIdentifierManager.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +1 -7
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +2 -2
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/internalTypes.d.ts +1 -1
- package/lib/internalTypes.d.ts.map +1 -1
- package/lib/internalTypes.js.map +1 -1
- package/lib/jsonDomainSchema.d.ts +6 -6
- package/lib/jsonDomainSchema.d.ts.map +1 -1
- package/lib/jsonDomainSchema.js.map +1 -1
- package/lib/legacy.d.ts +2 -11
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +2 -11
- package/lib/serializableDomainSchema.d.ts +5 -5
- package/lib/shared-tree/checkoutFlexTreeView.d.ts +1 -0
- package/lib/shared-tree/checkoutFlexTreeView.d.ts.map +1 -1
- package/lib/shared-tree/checkoutFlexTreeView.js +4 -0
- package/lib/shared-tree/checkoutFlexTreeView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +3 -2
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +4 -35
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +2 -51
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +2 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -0
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +28 -28
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +11 -11
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +6 -7
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +24 -5
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js +12 -0
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/api/testRecursiveDomain.d.ts +10 -10
- package/lib/simple-tree/api/tree.d.ts +1 -14
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +237 -220
- package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/arrayNode.d.ts +2 -2
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts +9 -2
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +40 -25
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/types.d.ts +14 -4
- package/lib/simple-tree/core/types.d.ts.map +1 -1
- package/lib/simple-tree/core/types.js +14 -4
- package/lib/simple-tree/core/types.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts +2 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +3 -0
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/index.d.ts +1 -1
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +1 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/objectNode.d.ts +9 -2
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +4 -1
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +10 -5
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js +5 -2
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/tableSchema.d.ts +78 -26
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +53 -24
- package/lib/tableSchema.js.map +1 -1
- package/lib/treeFactory.d.ts +6 -12
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +55 -3
- package/lib/treeFactory.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/package.json +22 -23
- package/src/core/index.ts +0 -2
- package/src/core/schema-stored/index.ts +0 -2
- package/src/core/schema-stored/schema.ts +10 -29
- package/src/core/tree/anchorSet.ts +32 -24
- package/src/core/tree/deltaUtil.ts +1 -13
- package/src/core/tree/visitDelta.ts +24 -81
- package/src/core/tree/visitorUtils.ts +43 -53
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +7 -22
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +1 -1
- package/src/feature-libraries/chunked-forest/codec/nodeShape.ts +45 -27
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +1 -1
- package/src/feature-libraries/flex-tree/context.ts +11 -1
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +8 -0
- package/src/feature-libraries/indexing/anchorTreeIndex.ts +17 -28
- package/src/feature-libraries/node-identifier/nodeIdentifierManager.ts +39 -38
- package/src/feature-libraries/object-forest/objectForest.ts +1 -18
- package/src/feature-libraries/schema-index/codec.ts +1 -2
- package/src/index.ts +3 -11
- package/src/internalTypes.ts +0 -19
- package/src/jsonDomainSchema.ts +1 -3
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/checkoutFlexTreeView.ts +6 -0
- package/src/shared-tree/index.ts +8 -3
- package/src/shared-tree/sharedTree.ts +5 -133
- package/src/simple-tree/api/index.ts +2 -22
- package/src/simple-tree/api/schemaFactory.ts +40 -54
- package/src/simple-tree/api/schemaFactoryAlpha.ts +9 -14
- package/src/simple-tree/api/schemaFactoryRecursive.ts +25 -5
- package/src/simple-tree/api/tree.ts +1 -14
- package/src/simple-tree/api/typesUnsafe.ts +359 -341
- package/src/simple-tree/arrayNode.ts +2 -2
- package/src/simple-tree/core/treeNodeKernel.ts +46 -28
- package/src/simple-tree/core/types.ts +14 -4
- package/src/simple-tree/core/unhydratedFlexTree.ts +5 -1
- package/src/simple-tree/index.ts +2 -22
- package/src/simple-tree/objectNode.ts +13 -4
- package/src/simple-tree/schemaTypes.ts +11 -7
- package/src/tableSchema.ts +190 -63
- package/src/treeFactory.ts +151 -8
|
@@ -27,17 +27,35 @@ import type { EncodedChunkShape, EncodedFieldShape, EncodedValueShape } from "./
|
|
|
27
27
|
import { isStableId } from "@fluidframework/id-compressor/internal";
|
|
28
28
|
|
|
29
29
|
export class NodeShape extends Shape<EncodedChunkShape> implements NodeEncoder {
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Set of keys for fields that are encoded using {@link NodeShape.specializedFieldEncoders}.
|
|
32
|
+
* TODO: Ensure uniform chunks, encoding and identifier generation sort fields the same.
|
|
33
|
+
*/
|
|
34
|
+
private readonly specializedFieldKeys: Set<FieldKey>;
|
|
32
35
|
|
|
33
36
|
public constructor(
|
|
34
37
|
public readonly type: undefined | TreeNodeSchemaIdentifier,
|
|
35
38
|
public readonly value: EncodedValueShape,
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Encoders for a specific set of fields, by key, in the order they will be encoded.
|
|
41
|
+
* These are fields for which specialized encoding is provided as an optimization.
|
|
42
|
+
* Using these for a given field instead of falling back to {@link NodeShape.specializedFieldEncoders} is often more efficient:
|
|
43
|
+
* this avoids the need to explicitly include the key and shape in the encoded data for each node instance.
|
|
44
|
+
* Instead, this information is here, and thus is encoded only once as part of the node shape.
|
|
45
|
+
* These encoders will be used, even if the field they apply to is empty (which can add overhead for fields which are usually empty).
|
|
46
|
+
*
|
|
47
|
+
* Any fields not included here will be encoded using {@link NodeShape.otherFieldsEncoder}.
|
|
48
|
+
* If {@link NodeShape.otherFieldsEncoder} is undefined, then this must handle all non-empty fields.
|
|
49
|
+
*/
|
|
50
|
+
public readonly specializedFieldEncoders: readonly KeyedFieldEncoder[],
|
|
51
|
+
/**
|
|
52
|
+
* Encoder for all other fields that are not in {@link NodeShape.specializedFieldEncoders}. These fields must
|
|
53
|
+
* be encoded after the specialized fields.
|
|
54
|
+
*/
|
|
55
|
+
public readonly otherFieldsEncoder: undefined | FieldEncoder,
|
|
38
56
|
) {
|
|
39
57
|
super();
|
|
40
|
-
this.
|
|
58
|
+
this.specializedFieldKeys = new Set(this.specializedFieldEncoders.map((f) => f.key));
|
|
41
59
|
}
|
|
42
60
|
|
|
43
61
|
private getValueToEncode(cursor: ITreeCursorSynchronous, cache: EncoderCache): Value {
|
|
@@ -64,28 +82,28 @@ export class NodeShape extends Shape<EncodedChunkShape> implements NodeEncoder {
|
|
|
64
82
|
assert(cursor.type === this.type, 0x741 /* type must match shape */);
|
|
65
83
|
}
|
|
66
84
|
encodeValue(this.getValueToEncode(cursor, cache), this.value, outputBuffer);
|
|
67
|
-
for (const
|
|
68
|
-
cursor.enterField(brand(
|
|
69
|
-
|
|
85
|
+
for (const fieldEncoder of this.specializedFieldEncoders) {
|
|
86
|
+
cursor.enterField(brand(fieldEncoder.key));
|
|
87
|
+
fieldEncoder.encoder.encodeField(cursor, cache, outputBuffer);
|
|
70
88
|
cursor.exitField();
|
|
71
89
|
}
|
|
72
90
|
|
|
73
|
-
const
|
|
91
|
+
const otherFieldsBuffer: BufferFormat<EncodedChunkShape> = [];
|
|
74
92
|
|
|
75
93
|
forEachField(cursor, () => {
|
|
76
94
|
const key = cursor.getFieldKey();
|
|
77
|
-
if (!this.
|
|
95
|
+
if (!this.specializedFieldKeys.has(key)) {
|
|
78
96
|
assert(
|
|
79
|
-
this.
|
|
97
|
+
this.otherFieldsEncoder !== undefined,
|
|
80
98
|
0x742 /* had extra local fields when shape does not support them */,
|
|
81
99
|
);
|
|
82
|
-
|
|
83
|
-
this.
|
|
100
|
+
otherFieldsBuffer.push(new IdentifierToken(key));
|
|
101
|
+
this.otherFieldsEncoder.encodeField(cursor, cache, otherFieldsBuffer);
|
|
84
102
|
}
|
|
85
103
|
});
|
|
86
104
|
|
|
87
|
-
if (this.
|
|
88
|
-
outputBuffer.push(
|
|
105
|
+
if (this.otherFieldsEncoder !== undefined) {
|
|
106
|
+
outputBuffer.push(otherFieldsBuffer);
|
|
89
107
|
}
|
|
90
108
|
}
|
|
91
109
|
|
|
@@ -97,8 +115,8 @@ export class NodeShape extends Shape<EncodedChunkShape> implements NodeEncoder {
|
|
|
97
115
|
c: {
|
|
98
116
|
type: encodeOptionalIdentifier(this.type, identifiers),
|
|
99
117
|
value: this.value,
|
|
100
|
-
fields: encodeFieldShapes(this.
|
|
101
|
-
extraFields: encodeOptionalFieldShape(this.
|
|
118
|
+
fields: encodeFieldShapes(this.specializedFieldEncoders, identifiers, shapes),
|
|
119
|
+
extraFields: encodeOptionalFieldShape(this.otherFieldsEncoder, shapes),
|
|
102
120
|
},
|
|
103
121
|
};
|
|
104
122
|
}
|
|
@@ -111,13 +129,13 @@ export class NodeShape extends Shape<EncodedChunkShape> implements NodeEncoder {
|
|
|
111
129
|
identifiers.add(this.type);
|
|
112
130
|
}
|
|
113
131
|
|
|
114
|
-
for (const
|
|
115
|
-
identifiers.add(
|
|
116
|
-
shapes(
|
|
132
|
+
for (const fieldEncoder of this.specializedFieldEncoders) {
|
|
133
|
+
identifiers.add(fieldEncoder.key);
|
|
134
|
+
shapes(fieldEncoder.encoder.shape);
|
|
117
135
|
}
|
|
118
136
|
|
|
119
|
-
if (this.
|
|
120
|
-
shapes(this.
|
|
137
|
+
if (this.otherFieldsEncoder !== undefined) {
|
|
138
|
+
shapes(this.otherFieldsEncoder.shape);
|
|
121
139
|
}
|
|
122
140
|
}
|
|
123
141
|
|
|
@@ -127,18 +145,18 @@ export class NodeShape extends Shape<EncodedChunkShape> implements NodeEncoder {
|
|
|
127
145
|
}
|
|
128
146
|
|
|
129
147
|
export function encodeFieldShapes(
|
|
130
|
-
|
|
148
|
+
fieldEncoders: readonly KeyedFieldEncoder[],
|
|
131
149
|
identifiers: DeduplicationTable<string>,
|
|
132
150
|
shapes: DeduplicationTable<Shape<EncodedChunkShape>>,
|
|
133
151
|
): EncodedFieldShape[] | undefined {
|
|
134
|
-
if (
|
|
152
|
+
if (fieldEncoders.length === 0) {
|
|
135
153
|
return undefined;
|
|
136
154
|
}
|
|
137
|
-
return
|
|
155
|
+
return fieldEncoders.map((fieldEncoder) => [
|
|
138
156
|
// key
|
|
139
|
-
encodeIdentifier(
|
|
157
|
+
encodeIdentifier(fieldEncoder.key, identifiers),
|
|
140
158
|
// shape
|
|
141
|
-
shapes.valueToIndex.get(
|
|
159
|
+
shapes.valueToIndex.get(fieldEncoder.encoder.shape) ?? fail(0xb50 /* missing shape */),
|
|
142
160
|
]);
|
|
143
161
|
}
|
|
144
162
|
|
|
@@ -122,7 +122,7 @@ export function treeShaper(
|
|
|
122
122
|
|
|
123
123
|
const objectNodeFields: KeyedFieldEncoder[] = [];
|
|
124
124
|
for (const [key, field] of schema.objectNodeFields ?? []) {
|
|
125
|
-
objectNodeFields.push({ key,
|
|
125
|
+
objectNodeFields.push({ key, encoder: fieldHandler.shapeFromField(field) });
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
const shape = new NodeShape(schemaName, false, objectNodeFields, undefined);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { assert } from "@fluidframework/core-utils/internal";
|
|
6
|
+
import { assert, debugAssert } from "@fluidframework/core-utils/internal";
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
9
|
type ForestEvents,
|
|
@@ -43,6 +43,11 @@ export interface FlexTreeContext {
|
|
|
43
43
|
* If false, this context was created for use in a unhydrated tree, and the full document schema is unknown.
|
|
44
44
|
*/
|
|
45
45
|
isHydrated(): this is FlexTreeHydratedContext;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* If true, none of the nodes in this context can be used.
|
|
49
|
+
*/
|
|
50
|
+
isDisposed(): boolean;
|
|
46
51
|
}
|
|
47
52
|
|
|
48
53
|
/**
|
|
@@ -106,9 +111,14 @@ export class Context implements FlexTreeHydratedContext, IDisposable {
|
|
|
106
111
|
}
|
|
107
112
|
|
|
108
113
|
public isHydrated(): this is FlexTreeHydratedContext {
|
|
114
|
+
debugAssert(() => !this.disposed || "Disposed");
|
|
109
115
|
return true;
|
|
110
116
|
}
|
|
111
117
|
|
|
118
|
+
public isDisposed(): boolean {
|
|
119
|
+
return this.disposed;
|
|
120
|
+
}
|
|
121
|
+
|
|
112
122
|
public get schema(): TreeStoredSchema {
|
|
113
123
|
return this.checkout.storedSchema;
|
|
114
124
|
}
|
|
@@ -94,6 +94,14 @@ export enum TreeStatus {
|
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
96
|
* Is removed and cannot be added back to the original document tree.
|
|
97
|
+
* @remarks
|
|
98
|
+
* Nodes can enter this state for multiple reasons:
|
|
99
|
+
* - The node was removed and nothing (e.g. undo/redo history) kept it from being cleaned up.
|
|
100
|
+
* - The {@link TreeView} was disposed or had a schema change which made the tree incompatible.
|
|
101
|
+
* @privateRemarks
|
|
102
|
+
* There was planned work (AB#17948) to make the first reason a node could become "Deleted" impossible,
|
|
103
|
+
* at least as an opt in feature,
|
|
104
|
+
* by lifetime extending all nodes which are still possible to reach automatically.
|
|
97
105
|
*/
|
|
98
106
|
Deleted = 2,
|
|
99
107
|
|
|
@@ -139,27 +139,14 @@ export class AnchorTreeIndex<TKey extends TreeIndexKey, TValue>
|
|
|
139
139
|
assert(parent !== undefined, 0xa99 /* must have a parent */);
|
|
140
140
|
this.reIndexSpine(parent);
|
|
141
141
|
},
|
|
142
|
-
afterDetach: () => {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
const cursor = this.forest.allocateCursor();
|
|
150
|
-
this.forest.moveCursorToPath(parent, cursor);
|
|
151
|
-
assert(
|
|
152
|
-
cursor.mode === CursorLocationType.Nodes,
|
|
153
|
-
0xa8c /* replace should happen in a node */,
|
|
154
|
-
);
|
|
155
|
-
cursor.exitNode();
|
|
156
|
-
this.indexField(cursor);
|
|
157
|
-
if (!this.isShallowIndex) {
|
|
158
|
-
// we must also re-index the spine if the key finders allow for any value under a subtree to be the key
|
|
159
|
-
// this means that a replace can cause the key for any node up its spine to be changed
|
|
160
|
-
this.indexSpine(cursor);
|
|
142
|
+
afterDetach: (_source, _count_, _destination, isReplaced) => {
|
|
143
|
+
if (isReplaced) {
|
|
144
|
+
// If the node will be replaced, we defer re-indexing until the corresponding attach event.
|
|
145
|
+
// This has performance benefits but is also required to avoid experiencing the error case where the field that is used as the indexing key is empty.
|
|
146
|
+
} else {
|
|
147
|
+
assert(parent !== undefined, 0xa9a /* must have a parent */);
|
|
148
|
+
this.reIndexSpine(parent);
|
|
161
149
|
}
|
|
162
|
-
cursor.clear();
|
|
163
150
|
},
|
|
164
151
|
// the methods below are used to keep track of the path that has been traversed by the visitor
|
|
165
152
|
// this is required so that cursors can be moved to the correct location when index updates are required
|
|
@@ -315,17 +302,19 @@ export class AnchorTreeIndex<TKey extends TreeIndexKey, TValue>
|
|
|
315
302
|
* Checks if the spine needs to be re-indexed and if so, re-indexes it starting from the given path.
|
|
316
303
|
*/
|
|
317
304
|
private reIndexSpine(path: UpPath): void {
|
|
305
|
+
const cursor = this.forest.allocateCursor();
|
|
306
|
+
this.forest.moveCursorToPath(path, cursor);
|
|
307
|
+
assert(
|
|
308
|
+
cursor.mode === CursorLocationType.Nodes,
|
|
309
|
+
0xa9b /* attach should happen in a node */,
|
|
310
|
+
);
|
|
311
|
+
cursor.exitNode();
|
|
312
|
+
// TODO ADO:36390 avoid re-indexing the whole field when not necessary
|
|
313
|
+
this.indexField(cursor);
|
|
318
314
|
if (!this.isShallowIndex) {
|
|
319
|
-
const cursor = this.forest.allocateCursor();
|
|
320
|
-
this.forest.moveCursorToPath(path, cursor);
|
|
321
|
-
assert(
|
|
322
|
-
cursor.mode === CursorLocationType.Nodes,
|
|
323
|
-
0xa9b /* attach should happen in a node */,
|
|
324
|
-
);
|
|
325
|
-
cursor.exitNode();
|
|
326
315
|
this.indexSpine(cursor);
|
|
327
|
-
cursor.clear();
|
|
328
316
|
}
|
|
317
|
+
cursor.clear();
|
|
329
318
|
}
|
|
330
319
|
|
|
331
320
|
private checkNotDisposed(errorMessage?: string): void {
|
|
@@ -46,46 +46,47 @@ export interface NodeIdentifierManager {
|
|
|
46
46
|
export function createNodeIdentifierManager(
|
|
47
47
|
idCompressor?: IIdCompressor | undefined,
|
|
48
48
|
): NodeIdentifierManager {
|
|
49
|
-
return
|
|
50
|
-
|
|
51
|
-
assert(
|
|
52
|
-
idCompressor !== undefined,
|
|
53
|
-
0x6e4 /* Runtime IdCompressor must be available to generate local node identifiers */,
|
|
54
|
-
);
|
|
55
|
-
return brand(idCompressor.generateCompressedId());
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
localizeNodeIdentifier: (identifier: StableNodeIdentifier) => {
|
|
59
|
-
assert(
|
|
60
|
-
idCompressor !== undefined,
|
|
61
|
-
0x6e5 /* Runtime IdCompressor must be available to convert node identifiers */,
|
|
62
|
-
);
|
|
63
|
-
return brand(idCompressor.recompress(identifier));
|
|
64
|
-
},
|
|
49
|
+
return new DefaultNodeIdentifierManager(idCompressor);
|
|
50
|
+
}
|
|
65
51
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
52
|
+
class DefaultNodeIdentifierManager implements NodeIdentifierManager {
|
|
53
|
+
public constructor(private readonly idCompressor: IIdCompressor | undefined) {}
|
|
54
|
+
public generateLocalNodeIdentifier(): LocalNodeIdentifier {
|
|
55
|
+
assert(
|
|
56
|
+
this.idCompressor !== undefined,
|
|
57
|
+
0x6e4 /* Runtime IdCompressor must be available to generate local node identifiers */,
|
|
58
|
+
);
|
|
59
|
+
return brand(this.idCompressor.generateCompressedId());
|
|
60
|
+
}
|
|
61
|
+
public localizeNodeIdentifier(identifier: StableNodeIdentifier): LocalNodeIdentifier {
|
|
62
|
+
assert(
|
|
63
|
+
this.idCompressor !== undefined,
|
|
64
|
+
0x6e5 /* Runtime IdCompressor must be available to convert node identifiers */,
|
|
65
|
+
);
|
|
66
|
+
return brand(this.idCompressor.recompress(identifier));
|
|
67
|
+
}
|
|
68
|
+
public stabilizeNodeIdentifier(identifier: LocalNodeIdentifier): StableNodeIdentifier {
|
|
69
|
+
assert(
|
|
70
|
+
this.idCompressor !== undefined,
|
|
71
|
+
0x6e6 /* Runtime IdCompressor must be available to convert node identifiers */,
|
|
72
|
+
);
|
|
73
|
+
return brand(
|
|
74
|
+
// TODO: The assert below is required for type safety but is maybe slow
|
|
75
|
+
assertIsStableId(this.idCompressor.decompress(extractFromOpaque(identifier))),
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
public tryLocalizeNodeIdentifier(identifier: string): LocalNodeIdentifier | undefined {
|
|
79
|
+
assert(
|
|
80
|
+
this.idCompressor !== undefined,
|
|
81
|
+
0x6e9 /* Runtime IdCompressor must be available to convert node identifiers */,
|
|
82
|
+
);
|
|
83
|
+
if (isStableNodeIdentifier(identifier)) {
|
|
84
|
+
const compressedIdentifier = this.idCompressor.tryRecompress(identifier);
|
|
85
|
+
if (compressedIdentifier !== undefined) {
|
|
86
|
+
return brand(compressedIdentifier);
|
|
86
87
|
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
export function isStableNodeIdentifier(
|
|
@@ -236,20 +236,6 @@ export class ObjectForest implements IEditableForest {
|
|
|
236
236
|
parent.fields.delete(key);
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
|
-
public replace(
|
|
240
|
-
newContentSource: FieldKey,
|
|
241
|
-
range: Range,
|
|
242
|
-
oldContentDestination: FieldKey,
|
|
243
|
-
oldContentId: DeltaDetachedNodeId,
|
|
244
|
-
): void {
|
|
245
|
-
preEdit();
|
|
246
|
-
assert(
|
|
247
|
-
newContentSource !== oldContentDestination,
|
|
248
|
-
0x7ba /* Replace detached source field and detached destination field must be different */,
|
|
249
|
-
);
|
|
250
|
-
this.detachEdit(range, oldContentDestination);
|
|
251
|
-
this.attachEdit(newContentSource, range.end - range.start, range.start);
|
|
252
|
-
}
|
|
253
239
|
public enterNode(index: number): void {
|
|
254
240
|
cursor.enterNode(index);
|
|
255
241
|
}
|
|
@@ -267,10 +253,7 @@ export class ObjectForest implements IEditableForest {
|
|
|
267
253
|
const forestVisitor = new Visitor(this);
|
|
268
254
|
const announcedVisitors: AnnouncedVisitor[] = [];
|
|
269
255
|
this.deltaVisitors.forEach((getVisitor) => announcedVisitors.push(getVisitor()));
|
|
270
|
-
const combinedVisitor = combineVisitors(
|
|
271
|
-
[forestVisitor, ...announcedVisitors],
|
|
272
|
-
announcedVisitors,
|
|
273
|
-
);
|
|
256
|
+
const combinedVisitor = combineVisitors([forestVisitor, ...announcedVisitors]);
|
|
274
257
|
this.activeVisitor = combinedVisitor;
|
|
275
258
|
return combinedVisitor;
|
|
276
259
|
}
|
|
@@ -17,7 +17,6 @@ import {
|
|
|
17
17
|
encodeFieldSchema,
|
|
18
18
|
schemaFormat,
|
|
19
19
|
storedSchemaDecodeDispatcher,
|
|
20
|
-
toTreeNodeSchemaDataFormat,
|
|
21
20
|
} from "../../core/index.js";
|
|
22
21
|
import { brand } from "../../util/index.js";
|
|
23
22
|
|
|
@@ -33,7 +32,7 @@ export function encodeRepo(repo: TreeStoredSchema): Format {
|
|
|
33
32
|
enumerable: true,
|
|
34
33
|
configurable: true,
|
|
35
34
|
writable: true,
|
|
36
|
-
value:
|
|
35
|
+
value: schema.encode(),
|
|
37
36
|
});
|
|
38
37
|
}
|
|
39
38
|
return {
|
package/src/index.ts
CHANGED
|
@@ -124,17 +124,7 @@ export {
|
|
|
124
124
|
// Can not be moved to internalTypes since doing so causes app code to throw errors like:
|
|
125
125
|
// 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.
|
|
126
126
|
type AllowedTypes,
|
|
127
|
-
type
|
|
128
|
-
type ImplicitFieldSchemaUnsafe,
|
|
129
|
-
type TreeObjectNodeUnsafe,
|
|
130
|
-
type InsertableTreeNodeFromImplicitAllowedTypesUnsafe,
|
|
131
|
-
type TreeArrayNodeUnsafe,
|
|
132
|
-
type TreeMapNodeUnsafe,
|
|
133
|
-
type InsertableObjectFromSchemaRecordUnsafe,
|
|
134
|
-
type InsertableTreeFieldFromImplicitFieldUnsafe,
|
|
135
|
-
type FieldSchemaUnsafe,
|
|
136
|
-
type TreeNodeSchemaClassUnsafe,
|
|
137
|
-
type InsertableTreeNodeFromAllowedTypesUnsafe,
|
|
127
|
+
type System_Unsafe,
|
|
138
128
|
type FieldSchemaAlphaUnsafe,
|
|
139
129
|
type ArrayNodeCustomizableSchemaUnsafe,
|
|
140
130
|
type MapNodeCustomizableSchemaUnsafe,
|
|
@@ -233,6 +223,7 @@ export {
|
|
|
233
223
|
replaceHandles,
|
|
234
224
|
replaceVerboseTreeHandles,
|
|
235
225
|
type HandleConverter,
|
|
226
|
+
allowUnused,
|
|
236
227
|
type LeafSchema,
|
|
237
228
|
type ArrayNodeCustomizableSchema,
|
|
238
229
|
type ArrayNodePojoEmulationSchema,
|
|
@@ -240,6 +231,7 @@ export {
|
|
|
240
231
|
type MapNodeCustomizableSchema,
|
|
241
232
|
type MapNodePojoEmulationSchema,
|
|
242
233
|
MapNodeSchema,
|
|
234
|
+
type ObjectFromSchemaRecord,
|
|
243
235
|
} from "./simple-tree/index.js";
|
|
244
236
|
export {
|
|
245
237
|
SharedTree,
|
package/src/internalTypes.ts
CHANGED
|
@@ -17,25 +17,6 @@ export type {
|
|
|
17
17
|
DefaultProvider,
|
|
18
18
|
typeNameSymbol,
|
|
19
19
|
InsertableObjectFromSchemaRecord,
|
|
20
|
-
ObjectFromSchemaRecord,
|
|
21
|
-
// Recursive Schema APIs
|
|
22
|
-
FieldHasDefaultUnsafe,
|
|
23
|
-
ObjectFromSchemaRecordUnsafe,
|
|
24
|
-
TreeObjectNodeUnsafe,
|
|
25
|
-
TreeFieldFromImplicitFieldUnsafe,
|
|
26
|
-
TreeNodeFromImplicitAllowedTypesUnsafe,
|
|
27
|
-
InsertableTreeNodeFromImplicitAllowedTypesUnsafe,
|
|
28
|
-
TreeArrayNodeUnsafe,
|
|
29
|
-
TreeMapNodeUnsafe,
|
|
30
|
-
InsertableObjectFromSchemaRecordUnsafe,
|
|
31
|
-
InsertableTreeFieldFromImplicitFieldUnsafe,
|
|
32
|
-
InsertableTypedNodeUnsafe,
|
|
33
|
-
NodeBuilderDataUnsafe,
|
|
34
|
-
NodeFromSchemaUnsafe,
|
|
35
|
-
ReadonlyMapInlined,
|
|
36
|
-
TreeNodeSchemaUnsafe,
|
|
37
|
-
AllowedTypesUnsafe,
|
|
38
|
-
TreeNodeSchemaNonClassUnsafe,
|
|
39
20
|
} from "./simple-tree/index.js";
|
|
40
21
|
export type { FlexList, FlexListToUnion, ExtractItemType } from "./simple-tree/index.js";
|
|
41
22
|
|
package/src/jsonDomainSchema.ts
CHANGED
|
@@ -12,14 +12,12 @@ import type {
|
|
|
12
12
|
ValidateRecursiveSchema,
|
|
13
13
|
// #region Unused imports to make d.ts cleaner
|
|
14
14
|
/* eslint-disable unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars */
|
|
15
|
-
|
|
15
|
+
System_Unsafe,
|
|
16
16
|
TreeNodeSchemaNonClass,
|
|
17
17
|
TreeNodeSchemaClass,
|
|
18
|
-
TreeMapNodeUnsafe,
|
|
19
18
|
NodeKind,
|
|
20
19
|
TreeNodeSchemaCore,
|
|
21
20
|
WithType,
|
|
22
|
-
TreeArrayNodeUnsafe,
|
|
23
21
|
LeafSchema,
|
|
24
22
|
/* eslint-enable unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars */
|
|
25
23
|
// #endregion
|
package/src/packageVersion.ts
CHANGED
|
@@ -34,6 +34,8 @@ export class CheckoutFlexTreeView<out TCheckout extends ITreeCheckout = ITreeChe
|
|
|
34
34
|
*/
|
|
35
35
|
public readonly flexTree: FlexTreeField;
|
|
36
36
|
|
|
37
|
+
private disposed = false;
|
|
38
|
+
|
|
37
39
|
public constructor(
|
|
38
40
|
/**
|
|
39
41
|
* Access non-view schema specific aspects of this branch.
|
|
@@ -52,6 +54,9 @@ export class CheckoutFlexTreeView<out TCheckout extends ITreeCheckout = ITreeChe
|
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
public [disposeSymbol](): void {
|
|
57
|
+
assert(!this.disposed, 0xb80 /* Double disposed */);
|
|
58
|
+
this.disposed = true;
|
|
59
|
+
|
|
55
60
|
for (const anchorNode of this.checkout.forest.anchors) {
|
|
56
61
|
tryDisposeTreeNode(anchorNode);
|
|
57
62
|
}
|
|
@@ -65,6 +70,7 @@ export class CheckoutFlexTreeView<out TCheckout extends ITreeCheckout = ITreeChe
|
|
|
65
70
|
* Any mutations of the new view will not apply to this view until the new view is merged back into this view via `merge()`.
|
|
66
71
|
*/
|
|
67
72
|
public fork(): CheckoutFlexTreeView<ITreeCheckout & ITreeCheckoutFork> {
|
|
73
|
+
assert(!this.disposed, 0xb81 /* disposed */);
|
|
68
74
|
const branch = this.checkout.branch();
|
|
69
75
|
return new CheckoutFlexTreeView(branch, this.schema, this.nodeKeyManager);
|
|
70
76
|
}
|
package/src/shared-tree/index.ts
CHANGED
|
@@ -4,11 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export {
|
|
7
|
-
type ISharedTree,
|
|
8
7
|
type ITreePrivate,
|
|
9
8
|
type SharedTreeOptionsInternal,
|
|
10
9
|
type SharedTreeOptions,
|
|
11
|
-
|
|
10
|
+
SharedTreeKernel,
|
|
12
11
|
getBranch,
|
|
13
12
|
type ForestType,
|
|
14
13
|
type SharedTreeContentSnapshot,
|
|
@@ -40,7 +39,11 @@ export { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
|
|
|
40
39
|
|
|
41
40
|
export { CheckoutFlexTreeView } from "./checkoutFlexTreeView.js";
|
|
42
41
|
|
|
43
|
-
export type {
|
|
42
|
+
export type {
|
|
43
|
+
ISharedTreeEditor,
|
|
44
|
+
ISchemaEditor,
|
|
45
|
+
SharedTreeEditBuilder,
|
|
46
|
+
} from "./sharedTreeEditBuilder.js";
|
|
44
47
|
|
|
45
48
|
export {
|
|
46
49
|
treeApi as Tree,
|
|
@@ -55,3 +58,5 @@ export {
|
|
|
55
58
|
type ViewContent,
|
|
56
59
|
independentView,
|
|
57
60
|
} from "./independentView.js";
|
|
61
|
+
|
|
62
|
+
export type { SharedTreeChange } from "./sharedTreeChangeTypes.js";
|