@fluidframework/tree 2.72.0 → 2.73.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 +99 -0
- package/api-report/tree.alpha.api.md +17 -30
- package/dist/alpha.d.ts +3 -1
- package/dist/api.d.ts +6 -2
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +2 -11
- package/dist/api.js.map +1 -1
- package/dist/codec/codec.d.ts +9 -2
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +9 -2
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/index.d.ts +1 -1
- package/dist/codec/index.d.ts.map +1 -1
- package/dist/codec/index.js +2 -1
- package/dist/codec/index.js.map +1 -1
- package/dist/codec/versioned/codec.d.ts +7 -2
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js +24 -1
- package/dist/codec/versioned/codec.js.map +1 -1
- package/dist/codec/versioned/index.d.ts +1 -1
- package/dist/codec/versioned/index.d.ts.map +1 -1
- package/dist/codec/versioned/index.js +2 -1
- package/dist/codec/versioned/index.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +12 -1
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.js +5 -3
- package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +4 -5
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +1 -0
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +2 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +31 -17
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +6 -6
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -2
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts +156 -4
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.js +7 -3
- package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +8 -3
- package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js +4 -1
- package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js +2 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +13 -13
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +23 -6
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +9 -8
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +20 -4
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.js +2 -1
- package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +35 -17
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +53 -55
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +1 -3
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js +2 -8
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/forest-summary/format.d.ts +2 -2
- package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/format.js +4 -2
- package/dist/feature-libraries/forest-summary/format.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +4 -3
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +8 -7
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +1 -2
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts +38 -12
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.js +29 -11
- package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +3 -2
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +0 -1
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +1 -3
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.d.ts +5 -6
- package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -8
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1 -2
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +66 -9
- 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 +3 -2
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/optional-field/index.d.ts +1 -1
- package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/index.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +5 -3
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/{default-schema/schemaChecker.d.ts → schemaChecker.d.ts} +2 -2
- package/dist/feature-libraries/schemaChecker.d.ts.map +1 -0
- package/dist/feature-libraries/{default-schema/schemaChecker.js → schemaChecker.js} +3 -3
- package/dist/feature-libraries/schemaChecker.js.map +1 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js +0 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/index.d.ts +1 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +1 -2
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +0 -44
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +1 -52
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +0 -2
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +12 -6
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +3 -4
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +5 -8
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +2 -2
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +3 -2
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +20 -9
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +4 -6
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormat.js +9 -7
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/dist/simple-tree/api/configuration.d.ts +2 -0
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js +10 -0
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +1 -0
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +5 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +7 -1
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.js +4 -6
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +103 -0
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -0
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +128 -0
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -0
- package/dist/simple-tree/api/tree.d.ts +1 -1
- package/dist/simple-tree/api/tree.js +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.js +1 -1
- package/dist/simple-tree/core/allowedTypes.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +3 -3
- 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/toStored.d.ts +12 -5
- package/dist/simple-tree/core/toStored.d.ts.map +1 -1
- package/dist/simple-tree/core/toStored.js +26 -10
- package/dist/simple-tree/core/toStored.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +1 -6
- package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.d.ts +1 -1
- package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.js +1 -2
- package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/fieldSchema.js +1 -8
- package/dist/simple-tree/fieldSchema.js.map +1 -1
- package/dist/simple-tree/index.d.ts +2 -2
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +9 -3
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +0 -1
- package/dist/simple-tree/leafNodeSchema.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 +13 -49
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +1 -5
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +2 -10
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.js +1 -5
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +15 -3
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchema.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts +20 -8
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +27 -22
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +18 -15
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/dist/tableSchema.d.ts +22 -52
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +141 -277
- package/dist/tableSchema.js.map +1 -1
- package/dist/util/arrayUtilities.d.ts +45 -0
- package/dist/util/arrayUtilities.d.ts.map +1 -0
- package/dist/util/arrayUtilities.js +76 -0
- package/dist/util/arrayUtilities.js.map +1 -0
- package/dist/util/index.d.ts +1 -0
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +7 -2
- package/dist/util/index.js.map +1 -1
- package/lib/alpha.d.ts +3 -1
- package/lib/api.d.ts +6 -2
- package/lib/api.d.ts.map +1 -1
- package/lib/api.js +2 -13
- package/lib/api.js.map +1 -1
- package/lib/codec/codec.d.ts +9 -2
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +9 -2
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/index.d.ts +1 -1
- package/lib/codec/index.d.ts.map +1 -1
- package/lib/codec/index.js +1 -1
- package/lib/codec/index.js.map +1 -1
- package/lib/codec/versioned/codec.d.ts +7 -2
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js +22 -0
- package/lib/codec/versioned/codec.js.map +1 -1
- package/lib/codec/versioned/index.d.ts +1 -1
- package/lib/codec/versioned/index.d.ts.map +1 -1
- package/lib/codec/versioned/index.js +1 -1
- package/lib/codec/versioned/index.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +12 -1
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.js +5 -3
- package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +4 -5
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +2 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +2 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +34 -20
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +6 -6
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -2
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts +156 -4
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.js +6 -2
- package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +8 -3
- package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js +4 -1
- package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +13 -13
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +22 -6
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +9 -8
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +17 -2
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.js +1 -1
- package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +35 -17
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +55 -57
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +1 -3
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js +1 -3
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/forest-summary/format.d.ts +2 -2
- package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/format.js +4 -2
- package/lib/feature-libraries/forest-summary/format.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +4 -3
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +4 -3
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +1 -2
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts +38 -12
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.js +29 -11
- package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +3 -2
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +0 -1
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +0 -1
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.d.ts +5 -6
- package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -8
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1 -2
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +66 -9
- 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 +2 -1
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/optional-field/index.d.ts +1 -1
- package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/index.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +5 -3
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/{default-schema/schemaChecker.d.ts → schemaChecker.d.ts} +2 -2
- package/lib/feature-libraries/schemaChecker.d.ts.map +1 -0
- package/lib/feature-libraries/{default-schema/schemaChecker.js → schemaChecker.js} +3 -3
- package/lib/feature-libraries/schemaChecker.js.map +1 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js +0 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/lib/index.d.ts +2 -2
- 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/index.d.ts +1 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +0 -44
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +0 -51
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +0 -2
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +13 -7
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +3 -4
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +4 -7
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +2 -2
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +2 -2
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +21 -10
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +4 -6
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormat.js +8 -6
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/lib/simple-tree/api/configuration.d.ts +2 -0
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js +10 -0
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +1 -0
- 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/schemaFromSimple.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +8 -2
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaCodec.js +5 -7
- package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +103 -0
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -0
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js +122 -0
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -0
- package/lib/simple-tree/api/tree.d.ts +1 -1
- package/lib/simple-tree/api/tree.js +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.js +1 -1
- package/lib/simple-tree/core/allowedTypes.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +3 -3
- 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/toStored.d.ts +12 -5
- package/lib/simple-tree/core/toStored.d.ts.map +1 -1
- package/lib/simple-tree/core/toStored.js +25 -9
- package/lib/simple-tree/core/toStored.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +1 -6
- package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.d.ts +1 -1
- package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.js +1 -2
- package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/fieldSchema.js +2 -9
- package/lib/simple-tree/fieldSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +2 -2
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +2 -2
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +1 -2
- package/lib/simple-tree/leafNodeSchema.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 +15 -51
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +3 -7
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +3 -11
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.js +3 -7
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +15 -3
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts +20 -8
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +28 -24
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +20 -17
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/lib/tableSchema.d.ts +22 -52
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +143 -279
- package/lib/tableSchema.js.map +1 -1
- package/lib/util/arrayUtilities.d.ts +45 -0
- package/lib/util/arrayUtilities.d.ts.map +1 -0
- package/lib/util/arrayUtilities.js +69 -0
- package/lib/util/arrayUtilities.js.map +1 -0
- package/lib/util/index.d.ts +1 -0
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +1 -0
- package/lib/util/index.js.map +1 -1
- package/package.json +21 -21
- package/src/api.ts +22 -11
- package/src/codec/codec.ts +10 -2
- package/src/codec/index.ts +1 -0
- package/src/codec/versioned/codec.ts +40 -2
- package/src/codec/versioned/index.ts +1 -0
- package/src/core/schema-stored/schema.ts +12 -1
- package/src/core/tree/detachedFieldIndexCodecs.ts +10 -3
- package/src/feature-libraries/README.md +1 -1
- package/src/feature-libraries/chunked-forest/chunkTree.ts +3 -3
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +5 -0
- package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +2 -1
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +52 -19
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +8 -3
- package/src/feature-libraries/chunked-forest/codec/format.ts +14 -4
- package/src/feature-libraries/chunked-forest/codec/formatGeneric.ts +7 -2
- package/src/feature-libraries/chunked-forest/codec/index.ts +1 -4
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +62 -9
- package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +24 -2
- package/src/feature-libraries/chunked-forest/index.ts +1 -1
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +86 -74
- package/src/feature-libraries/default-schema/index.ts +1 -9
- package/src/feature-libraries/forest-summary/format.ts +15 -9
- package/src/feature-libraries/index.ts +7 -5
- package/src/feature-libraries/modular-schema/comparison.ts +2 -3
- package/src/feature-libraries/modular-schema/fieldKind.ts +90 -13
- package/src/feature-libraries/modular-schema/fieldKindConfiguration.ts +2 -3
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +6 -6
- package/src/feature-libraries/modular-schema/index.ts +0 -1
- package/src/feature-libraries/modular-schema/isNeverTree.ts +7 -8
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +13 -13
- package/src/feature-libraries/object-forest/objectForest.ts +2 -6
- package/src/feature-libraries/optional-field/index.ts +1 -0
- package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +1 -5
- package/src/feature-libraries/schema-index/codec.ts +10 -3
- package/src/feature-libraries/{default-schema/schemaChecker.ts → schemaChecker.ts} +4 -4
- package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +0 -2
- package/src/index.ts +3 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/index.ts +0 -1
- package/src/shared-tree/sharedTree.ts +0 -70
- package/src/shared-tree/sharedTreeChangeCodecs.ts +1 -6
- package/src/shared-tree-core/editManagerCodecs.ts +19 -7
- package/src/shared-tree-core/editManagerFormatCommons.ts +11 -12
- package/src/shared-tree-core/index.ts +6 -2
- package/src/shared-tree-core/messageCodecs.ts +32 -17
- package/src/shared-tree-core/messageFormat.ts +8 -6
- package/src/simple-tree/api/configuration.ts +17 -4
- package/src/simple-tree/api/index.ts +5 -0
- package/src/simple-tree/api/schemaFromSimple.ts +14 -6
- package/src/simple-tree/api/simpleSchemaCodec.ts +10 -9
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +135 -0
- package/src/simple-tree/api/tree.ts +1 -1
- package/src/simple-tree/core/allowedTypes.ts +1 -1
- package/src/simple-tree/core/index.ts +3 -1
- package/src/simple-tree/core/toStored.ts +42 -18
- package/src/simple-tree/core/treeNodeSchema.ts +1 -7
- package/src/simple-tree/core/treeNodeValid.ts +0 -2
- package/src/simple-tree/fieldSchema.ts +2 -11
- package/src/simple-tree/index.ts +6 -1
- package/src/simple-tree/leafNodeSchema.ts +1 -2
- package/src/simple-tree/node-kinds/array/arrayNode.ts +26 -75
- package/src/simple-tree/node-kinds/map/mapNode.ts +1 -15
- package/src/simple-tree/node-kinds/object/objectNode.ts +2 -17
- package/src/simple-tree/node-kinds/record/recordNode.ts +1 -15
- package/src/simple-tree/simpleSchema.ts +16 -3
- package/src/simple-tree/toStoredSchema.ts +54 -38
- package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +22 -17
- package/src/tableSchema.ts +110 -334
- package/src/util/arrayUtilities.ts +88 -0
- package/src/util/index.ts +6 -0
- package/dist/feature-libraries/default-schema/defaultSchema.d.ts +0 -10
- package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +0 -1
- package/dist/feature-libraries/default-schema/defaultSchema.js +0 -15
- package/dist/feature-libraries/default-schema/defaultSchema.js.map +0 -1
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +0 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js.map +0 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +0 -50
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +0 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -76
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js.map +0 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +0 -12
- package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +0 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js +0 -158
- package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js.map +0 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +0 -11
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +0 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js +0 -245
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +0 -1
- package/lib/feature-libraries/default-schema/defaultSchema.d.ts +0 -10
- package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +0 -1
- package/lib/feature-libraries/default-schema/defaultSchema.js +0 -12
- package/lib/feature-libraries/default-schema/defaultSchema.js.map +0 -1
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +0 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js.map +0 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +0 -50
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +0 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -71
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js.map +0 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +0 -12
- package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +0 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js +0 -154
- package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js.map +0 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +0 -11
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +0 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +0 -241
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +0 -1
- package/src/feature-libraries/default-schema/defaultSchema.ts +0 -15
- package/src/feature-libraries/modular-schema/fieldKindWithEditor.ts +0 -108
- package/src/feature-libraries/optional-field/optionalFieldCodecV1.ts +0 -208
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +0 -344
|
@@ -16,8 +16,8 @@ import {
|
|
|
16
16
|
ValueSchema,
|
|
17
17
|
Multiplicity,
|
|
18
18
|
identifierFieldKindIdentifier,
|
|
19
|
+
type SchemaPolicy,
|
|
19
20
|
} from "../../../core/index.js";
|
|
20
|
-
import type { FullSchemaPolicy } from "../../modular-schema/index.js";
|
|
21
21
|
|
|
22
22
|
import {
|
|
23
23
|
EncoderContext,
|
|
@@ -31,11 +31,61 @@ import {
|
|
|
31
31
|
incrementalFieldEncoder,
|
|
32
32
|
} from "./compressedEncode.js";
|
|
33
33
|
import type { FieldBatch } from "./fieldBatch.js";
|
|
34
|
-
import {
|
|
34
|
+
import {
|
|
35
|
+
type EncodedFieldBatch,
|
|
36
|
+
type EncodedFieldBatchV1,
|
|
37
|
+
type EncodedFieldBatchV2,
|
|
38
|
+
type EncodedValueShape,
|
|
39
|
+
FieldBatchFormatVersion,
|
|
40
|
+
SpecialField,
|
|
41
|
+
} from "./format.js";
|
|
35
42
|
import type { IncrementalEncoder } from "./codecs.js";
|
|
36
43
|
import { NodeShapeBasedEncoder } from "./nodeEncoder.js";
|
|
37
44
|
import { defaultIncrementalEncodingPolicy } from "./incrementalEncodingPolicy.js";
|
|
38
|
-
import { oneFromIterable } from "../../../util/index.js";
|
|
45
|
+
import { brand, oneFromIterable } from "../../../util/index.js";
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Encode data from `fieldBatch` in into an `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.
|
|
49
|
+
* @remarks See {@link schemaCompressedEncode} for more details.
|
|
50
|
+
* This version does not support incremental encoding.
|
|
51
|
+
*/
|
|
52
|
+
export function schemaCompressedEncodeV1(
|
|
53
|
+
schema: StoredSchemaCollection,
|
|
54
|
+
policy: SchemaPolicy,
|
|
55
|
+
fieldBatch: FieldBatch,
|
|
56
|
+
idCompressor: IIdCompressor,
|
|
57
|
+
): EncodedFieldBatchV1 {
|
|
58
|
+
return schemaCompressedEncode(
|
|
59
|
+
schema,
|
|
60
|
+
policy,
|
|
61
|
+
fieldBatch,
|
|
62
|
+
idCompressor,
|
|
63
|
+
undefined /* incrementalEncoder */,
|
|
64
|
+
brand(FieldBatchFormatVersion.v1),
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Encode data from `fieldBatch` in into an `EncodedChunk` using {@link FieldBatchFormatVersion.v2}.
|
|
70
|
+
* @remarks See {@link schemaCompressedEncode} for more details.
|
|
71
|
+
* Incremental encoding is supported from this version onwards.
|
|
72
|
+
*/
|
|
73
|
+
export function schemaCompressedEncodeV2(
|
|
74
|
+
schema: StoredSchemaCollection,
|
|
75
|
+
policy: SchemaPolicy,
|
|
76
|
+
fieldBatch: FieldBatch,
|
|
77
|
+
idCompressor: IIdCompressor,
|
|
78
|
+
incrementalEncoder: IncrementalEncoder | undefined,
|
|
79
|
+
): EncodedFieldBatchV2 {
|
|
80
|
+
return schemaCompressedEncode(
|
|
81
|
+
schema,
|
|
82
|
+
policy,
|
|
83
|
+
fieldBatch,
|
|
84
|
+
idCompressor,
|
|
85
|
+
incrementalEncoder,
|
|
86
|
+
brand(FieldBatchFormatVersion.v2),
|
|
87
|
+
);
|
|
88
|
+
}
|
|
39
89
|
|
|
40
90
|
/**
|
|
41
91
|
* Encode data from `fieldBatch` in into an `EncodedChunk`.
|
|
@@ -47,24 +97,26 @@ import { oneFromIterable } from "../../../util/index.js";
|
|
|
47
97
|
* Optimized for encoded size and encoding performance.
|
|
48
98
|
* TODO: This function should eventually also take in the root FieldSchema to more efficiently compress the nodes.
|
|
49
99
|
*/
|
|
50
|
-
|
|
100
|
+
function schemaCompressedEncode(
|
|
51
101
|
schema: StoredSchemaCollection,
|
|
52
|
-
policy:
|
|
102
|
+
policy: SchemaPolicy,
|
|
53
103
|
fieldBatch: FieldBatch,
|
|
54
104
|
idCompressor: IIdCompressor,
|
|
55
|
-
incrementalEncoder
|
|
105
|
+
incrementalEncoder: IncrementalEncoder | undefined,
|
|
106
|
+
version: FieldBatchFormatVersion,
|
|
56
107
|
): EncodedFieldBatch {
|
|
57
108
|
return compressedEncode(
|
|
58
109
|
fieldBatch,
|
|
59
|
-
buildContext(schema, policy, idCompressor, incrementalEncoder),
|
|
110
|
+
buildContext(schema, policy, idCompressor, incrementalEncoder, version),
|
|
60
111
|
);
|
|
61
112
|
}
|
|
62
113
|
|
|
63
114
|
export function buildContext(
|
|
64
115
|
storedSchema: StoredSchemaCollection,
|
|
65
|
-
policy:
|
|
116
|
+
policy: SchemaPolicy,
|
|
66
117
|
idCompressor: IIdCompressor,
|
|
67
|
-
incrementalEncoder
|
|
118
|
+
incrementalEncoder: IncrementalEncoder | undefined,
|
|
119
|
+
version: FieldBatchFormatVersion,
|
|
68
120
|
): EncoderContext {
|
|
69
121
|
const context: EncoderContext = new EncoderContext(
|
|
70
122
|
(fieldBuilder: FieldEncodeBuilder, schemaName: TreeNodeSchemaIdentifier) =>
|
|
@@ -74,6 +126,7 @@ export function buildContext(
|
|
|
74
126
|
policy.fieldKinds,
|
|
75
127
|
idCompressor,
|
|
76
128
|
incrementalEncoder,
|
|
129
|
+
version,
|
|
77
130
|
);
|
|
78
131
|
return context;
|
|
79
132
|
}
|
|
@@ -8,17 +8,36 @@ import {
|
|
|
8
8
|
forEachField,
|
|
9
9
|
forEachNode,
|
|
10
10
|
} from "../../../core/index.js";
|
|
11
|
+
import { brand } from "../../../util/index.js";
|
|
11
12
|
import type { FluidSerializableReadOnly } from "../../valueUtilities.js";
|
|
12
13
|
|
|
13
14
|
import type { FieldBatch } from "./fieldBatch.js";
|
|
14
15
|
import {
|
|
15
16
|
FieldBatchFormatVersion,
|
|
16
17
|
type EncodedFieldBatch,
|
|
18
|
+
type EncodedFieldBatchV1,
|
|
19
|
+
type EncodedFieldBatchV2,
|
|
17
20
|
type EncodedNestedArrayShape,
|
|
18
21
|
type EncodedNodeShape,
|
|
19
22
|
} from "./format.js";
|
|
20
23
|
import type { ShapeIndex } from "./formatGeneric.js";
|
|
21
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Encode data from `cursor` in the simplest way supported by `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.
|
|
27
|
+
* @remarks See {@link uncompressedEncode} for more details.
|
|
28
|
+
*/
|
|
29
|
+
export function uncompressedEncodeV1(batch: FieldBatch): EncodedFieldBatchV1 {
|
|
30
|
+
return uncompressedEncode(batch, brand(FieldBatchFormatVersion.v1));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Encode data from `cursor` in the simplest way supported by `EncodedChunk` using {@link FieldBatchFormatVersion.v2}.
|
|
35
|
+
* @remarks See {@link uncompressedEncode} for more details.
|
|
36
|
+
*/
|
|
37
|
+
export function uncompressedEncodeV2(batch: FieldBatch): EncodedFieldBatchV2 {
|
|
38
|
+
return uncompressedEncode(batch, brand(FieldBatchFormatVersion.v2));
|
|
39
|
+
}
|
|
40
|
+
|
|
22
41
|
/**
|
|
23
42
|
* Encode data from `cursor` in the simplest way supported by `EncodedChunk`.
|
|
24
43
|
*
|
|
@@ -27,10 +46,13 @@ import type { ShapeIndex } from "./formatGeneric.js";
|
|
|
27
46
|
*
|
|
28
47
|
* This is intended as a simple reference implementation with minimal code and dependencies.
|
|
29
48
|
*/
|
|
30
|
-
|
|
49
|
+
function uncompressedEncode(
|
|
50
|
+
batch: FieldBatch,
|
|
51
|
+
version: FieldBatchFormatVersion,
|
|
52
|
+
): EncodedFieldBatch {
|
|
31
53
|
const rootFields = batch.map(encodeSequence);
|
|
32
54
|
return {
|
|
33
|
-
version
|
|
55
|
+
version,
|
|
34
56
|
identifiers: [],
|
|
35
57
|
// A single shape used to encode all fields.
|
|
36
58
|
shapes: [{ c: anyNodeShape }, { a: anyArray }],
|
|
@@ -18,22 +18,26 @@ import {
|
|
|
18
18
|
type FieldEditor,
|
|
19
19
|
type FieldKindConfiguration,
|
|
20
20
|
type FieldKindConfigurationEntry,
|
|
21
|
-
|
|
22
|
-
type
|
|
21
|
+
FlexFieldKind,
|
|
22
|
+
type FullSchemaPolicy,
|
|
23
23
|
type ToDelta,
|
|
24
24
|
allowsTreeSchemaIdentifierSuperset,
|
|
25
25
|
referenceFreeFieldChangeRebaser,
|
|
26
26
|
} from "../modular-schema/index.js";
|
|
27
27
|
import {
|
|
28
28
|
type OptionalChangeset,
|
|
29
|
+
type OptionalFieldEditor,
|
|
29
30
|
optionalChangeHandler,
|
|
30
31
|
optionalFieldEditor,
|
|
31
32
|
} from "../optional-field/index.js";
|
|
32
|
-
import {
|
|
33
|
+
import {
|
|
34
|
+
sequenceFieldChangeHandler,
|
|
35
|
+
type SequenceFieldEditor,
|
|
36
|
+
} from "../sequence-field/index.js";
|
|
33
37
|
|
|
34
38
|
import { noChangeCodecFamily } from "./noChangeCodecs.js";
|
|
35
39
|
import type { CodecTree } from "../../codec/index.js";
|
|
36
|
-
import { brand, type Brand } from "../../util/index.js";
|
|
40
|
+
import { brand, brandConst, type Brand } from "../../util/index.js";
|
|
37
41
|
|
|
38
42
|
/**
|
|
39
43
|
* ChangeHandler that only handles no-op / identity changes.
|
|
@@ -55,7 +59,15 @@ export const noChangeHandler: FieldChangeHandler<0> = {
|
|
|
55
59
|
getCrossFieldKeys: () => [],
|
|
56
60
|
};
|
|
57
61
|
|
|
58
|
-
|
|
62
|
+
/**
|
|
63
|
+
* {@link FieldEditor} for required fields (always contain exactly 1 child).
|
|
64
|
+
* @remarks
|
|
65
|
+
* This shares code with optional fields, since they are the same edit wise except setting to empty is not allowed,
|
|
66
|
+
* and the content is always assumed to not be empty.
|
|
67
|
+
* This means the actual edits implemented for optional fields are sufficient to support required fields
|
|
68
|
+
* which is why this is defined and implemented in terms of optional fields.
|
|
69
|
+
*/
|
|
70
|
+
export interface RequiredFieldEditor extends FieldEditor<OptionalChangeset> {
|
|
59
71
|
/**
|
|
60
72
|
* Creates a change which replaces the current value of the field with `newValue`.
|
|
61
73
|
* @param ids - The ids for the fill and detach fields.
|
|
@@ -63,21 +75,19 @@ export interface ValueFieldEditor extends FieldEditor<OptionalChangeset> {
|
|
|
63
75
|
set(ids: { fill: ChangeAtomId; detach: ChangeAtomId }): OptionalChangeset;
|
|
64
76
|
}
|
|
65
77
|
|
|
66
|
-
const optionalIdentifier = "Optional";
|
|
78
|
+
const optionalIdentifier = brandConst("Optional")<FieldKindIdentifier>();
|
|
79
|
+
|
|
67
80
|
/**
|
|
68
81
|
* 0 or 1 items.
|
|
69
82
|
*/
|
|
70
|
-
export const optional = new
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
optionalChangeHandler,
|
|
74
|
-
(types, other) =>
|
|
83
|
+
export const optional = new FlexFieldKind(optionalIdentifier, Multiplicity.Optional, {
|
|
84
|
+
changeHandler: optionalChangeHandler,
|
|
85
|
+
allowsTreeSupersetOf: (types, other) =>
|
|
75
86
|
(other.kind === sequence.identifier || other.kind === optionalIdentifier) &&
|
|
76
87
|
allowsTreeSchemaIdentifierSuperset(types, other.types),
|
|
77
|
-
|
|
78
|
-
);
|
|
88
|
+
});
|
|
79
89
|
|
|
80
|
-
export const
|
|
90
|
+
export const requiredFieldEditor: RequiredFieldEditor = {
|
|
81
91
|
...optionalFieldEditor,
|
|
82
92
|
set: (ids: {
|
|
83
93
|
fill: ChangeAtomId;
|
|
@@ -85,21 +95,22 @@ export const valueFieldEditor: ValueFieldEditor = {
|
|
|
85
95
|
}): OptionalChangeset => optionalFieldEditor.set(false, ids),
|
|
86
96
|
};
|
|
87
97
|
|
|
88
|
-
export const
|
|
89
|
-
|
|
90
|
-
|
|
98
|
+
export const requiredFieldChangeHandler: FieldChangeHandler<
|
|
99
|
+
OptionalChangeset,
|
|
100
|
+
RequiredFieldEditor
|
|
101
|
+
> = {
|
|
102
|
+
...optionalChangeHandler,
|
|
103
|
+
editor: requiredFieldEditor,
|
|
91
104
|
};
|
|
92
105
|
|
|
93
|
-
const requiredIdentifier = "Value";
|
|
106
|
+
const requiredIdentifier = brandConst("Value")<FieldKindIdentifier>();
|
|
94
107
|
|
|
95
108
|
/**
|
|
96
109
|
* Exactly one item.
|
|
97
110
|
*/
|
|
98
|
-
export const required = new
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
valueChangeHandler,
|
|
102
|
-
(types, other) =>
|
|
111
|
+
export const required = new FlexFieldKind(requiredIdentifier, Multiplicity.Single, {
|
|
112
|
+
changeHandler: requiredFieldChangeHandler,
|
|
113
|
+
allowsTreeSupersetOf: (types, other) =>
|
|
103
114
|
// By omitting Identifier here,
|
|
104
115
|
// this is making a policy choice that a schema upgrade cannot be done from required to identifier.
|
|
105
116
|
// Since an identifier can be upgraded into a required field,
|
|
@@ -109,43 +120,35 @@ export const required = new FieldKindWithEditor(
|
|
|
109
120
|
other.kind === requiredIdentifier ||
|
|
110
121
|
other.kind === optional.identifier) &&
|
|
111
122
|
allowsTreeSchemaIdentifierSuperset(types, other.types),
|
|
112
|
-
|
|
113
|
-
);
|
|
123
|
+
});
|
|
114
124
|
|
|
115
|
-
const sequenceIdentifier = "Sequence";
|
|
125
|
+
const sequenceIdentifier = brandConst("Sequence")<FieldKindIdentifier>();
|
|
116
126
|
|
|
117
127
|
/**
|
|
118
128
|
* 0 or more items.
|
|
119
129
|
*/
|
|
120
|
-
export const sequence = new
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
sequenceFieldChangeHandler,
|
|
124
|
-
(types, other) =>
|
|
130
|
+
export const sequence = new FlexFieldKind(sequenceIdentifier, Multiplicity.Sequence, {
|
|
131
|
+
changeHandler: sequenceFieldChangeHandler,
|
|
132
|
+
allowsTreeSupersetOf: (types, other) =>
|
|
125
133
|
other.kind === sequenceIdentifier &&
|
|
126
134
|
allowsTreeSchemaIdentifierSuperset(types, other.types),
|
|
127
|
-
|
|
128
|
-
new Set([]),
|
|
129
|
-
);
|
|
135
|
+
});
|
|
130
136
|
|
|
131
|
-
const identifierFieldIdentifier = "Identifier";
|
|
137
|
+
const identifierFieldIdentifier = brandConst("Identifier")<FieldKindIdentifier>();
|
|
132
138
|
|
|
133
139
|
/**
|
|
134
140
|
* Exactly one identifier.
|
|
135
141
|
*/
|
|
136
|
-
export const identifier = new
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
noChangeHandler,
|
|
140
|
-
(types, other) =>
|
|
142
|
+
export const identifier = new FlexFieldKind(identifierFieldIdentifier, Multiplicity.Single, {
|
|
143
|
+
changeHandler: noChangeHandler,
|
|
144
|
+
allowsTreeSupersetOf: (types, other) =>
|
|
141
145
|
// Allows upgrading from identifier to required: which way this upgrade is allowed to go is a subjective policy choice.
|
|
142
146
|
(other.kind === sequence.identifier ||
|
|
143
147
|
other.kind === requiredIdentifier ||
|
|
144
148
|
other.kind === optional.identifier ||
|
|
145
149
|
other.kind === identifierFieldIdentifier) &&
|
|
146
150
|
allowsTreeSchemaIdentifierSuperset(types, other.types),
|
|
147
|
-
|
|
148
|
-
);
|
|
151
|
+
});
|
|
149
152
|
|
|
150
153
|
/**
|
|
151
154
|
* Exactly 0 items.
|
|
@@ -175,39 +178,21 @@ export const identifier = new FieldKindWithEditor(
|
|
|
175
178
|
*
|
|
176
179
|
* See {@link emptyField} for a constant, reusable field using Forbidden.
|
|
177
180
|
*/
|
|
178
|
-
export const forbidden = new
|
|
181
|
+
export const forbidden = new FlexFieldKind(
|
|
179
182
|
forbiddenFieldKindIdentifier,
|
|
180
183
|
Multiplicity.Forbidden,
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
184
|
+
{
|
|
185
|
+
changeHandler: noChangeHandler,
|
|
186
|
+
// All multiplicities other than Value support empty.
|
|
187
|
+
allowsTreeSupersetOf: (types, other) =>
|
|
188
|
+
fieldKinds.get(other.kind)?.multiplicity !== Multiplicity.Single,
|
|
189
|
+
},
|
|
185
190
|
);
|
|
186
191
|
|
|
187
192
|
export const fieldKindConfigurations: ReadonlyMap<
|
|
188
193
|
ModularChangeFormatVersion,
|
|
189
194
|
FieldKindConfiguration
|
|
190
195
|
> = new Map([
|
|
191
|
-
[
|
|
192
|
-
brand(1),
|
|
193
|
-
new Map<FieldKindIdentifier, FieldKindConfigurationEntry>([
|
|
194
|
-
[required.identifier, { kind: required, formatVersion: 1 }],
|
|
195
|
-
[optional.identifier, { kind: optional, formatVersion: 1 }],
|
|
196
|
-
[sequence.identifier, { kind: sequence, formatVersion: 1 }],
|
|
197
|
-
[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],
|
|
198
|
-
[identifier.identifier, { kind: identifier, formatVersion: 1 }],
|
|
199
|
-
]),
|
|
200
|
-
],
|
|
201
|
-
[
|
|
202
|
-
brand(2),
|
|
203
|
-
new Map<FieldKindIdentifier, FieldKindConfigurationEntry>([
|
|
204
|
-
[required.identifier, { kind: required, formatVersion: 2 }],
|
|
205
|
-
[optional.identifier, { kind: optional, formatVersion: 2 }],
|
|
206
|
-
[sequence.identifier, { kind: sequence, formatVersion: 1 }],
|
|
207
|
-
[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],
|
|
208
|
-
[identifier.identifier, { kind: identifier, formatVersion: 1 }],
|
|
209
|
-
]),
|
|
210
|
-
],
|
|
211
196
|
[
|
|
212
197
|
brand(3),
|
|
213
198
|
new Map<FieldKindIdentifier, FieldKindConfigurationEntry>([
|
|
@@ -230,7 +215,7 @@ export const fieldKindConfigurations: ReadonlyMap<
|
|
|
230
215
|
],
|
|
231
216
|
]);
|
|
232
217
|
|
|
233
|
-
export type ModularChangeFormatVersion = Brand<
|
|
218
|
+
export type ModularChangeFormatVersion = Brand<3 | 4, "ModularChangeFormatVersion">;
|
|
234
219
|
export function getCodecTreeForModularChangeFormat(
|
|
235
220
|
version: ModularChangeFormatVersion,
|
|
236
221
|
): CodecTree {
|
|
@@ -256,7 +241,7 @@ export function getCodecTreeForModularChangeFormat(
|
|
|
256
241
|
* Before making a SharedTree format change which impacts which set of field kinds are allowed,
|
|
257
242
|
* code which uses this should be audited for compatibility considerations.
|
|
258
243
|
*/
|
|
259
|
-
export const fieldKinds: ReadonlyMap<FieldKindIdentifier,
|
|
244
|
+
export const fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind> = new Map(
|
|
260
245
|
[required, optional, sequence, identifier, forbidden].map((s) => [s.identifier, s]),
|
|
261
246
|
);
|
|
262
247
|
|
|
@@ -265,12 +250,32 @@ export const fieldKinds: ReadonlyMap<FieldKindIdentifier, FieldKindWithEditor> =
|
|
|
265
250
|
// TODO: Find a way to make docs like {@inheritDoc required} work in vscode.
|
|
266
251
|
// TODO: ensure thy work in generated docs.
|
|
267
252
|
// TODO: add these comments to the rest of the cases below.
|
|
268
|
-
export interface Required
|
|
269
|
-
|
|
270
|
-
export interface
|
|
271
|
-
|
|
253
|
+
export interface Required
|
|
254
|
+
extends FlexFieldKind<RequiredFieldEditor, typeof requiredIdentifier, Multiplicity.Single> {}
|
|
255
|
+
export interface Optional
|
|
256
|
+
extends FlexFieldKind<
|
|
257
|
+
OptionalFieldEditor,
|
|
258
|
+
typeof optionalIdentifier,
|
|
259
|
+
Multiplicity.Optional
|
|
260
|
+
> {}
|
|
261
|
+
export interface Sequence
|
|
262
|
+
extends FlexFieldKind<
|
|
263
|
+
SequenceFieldEditor,
|
|
264
|
+
typeof sequenceIdentifier,
|
|
265
|
+
Multiplicity.Sequence
|
|
266
|
+
> {}
|
|
267
|
+
export interface Identifier
|
|
268
|
+
extends FlexFieldKind<
|
|
269
|
+
FieldEditor<0>,
|
|
270
|
+
typeof identifierFieldIdentifier,
|
|
271
|
+
Multiplicity.Single
|
|
272
|
+
> {}
|
|
272
273
|
export interface Forbidden
|
|
273
|
-
extends FlexFieldKind<
|
|
274
|
+
extends FlexFieldKind<
|
|
275
|
+
FieldEditor<0>,
|
|
276
|
+
typeof forbiddenFieldKindIdentifier,
|
|
277
|
+
Multiplicity.Forbidden
|
|
278
|
+
> {}
|
|
274
279
|
|
|
275
280
|
/**
|
|
276
281
|
* Default FieldKinds with their editor types erased.
|
|
@@ -283,3 +288,10 @@ export const FieldKinds: {
|
|
|
283
288
|
readonly identifier: Identifier;
|
|
284
289
|
readonly forbidden: Forbidden;
|
|
285
290
|
} = { required, optional, sequence, identifier, forbidden };
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* FullSchemaPolicy with the default field kinds.
|
|
294
|
+
*/
|
|
295
|
+
export const defaultSchemaPolicy: FullSchemaPolicy = {
|
|
296
|
+
fieldKinds,
|
|
297
|
+
};
|
|
@@ -14,6 +14,7 @@ export {
|
|
|
14
14
|
fieldKindConfigurations,
|
|
15
15
|
getCodecTreeForModularChangeFormat,
|
|
16
16
|
type ModularChangeFormatVersion,
|
|
17
|
+
defaultSchemaPolicy,
|
|
17
18
|
} from "./defaultFieldKinds.js";
|
|
18
19
|
|
|
19
20
|
export {
|
|
@@ -28,13 +29,4 @@ export {
|
|
|
28
29
|
relevantRemovedRoots,
|
|
29
30
|
} from "./defaultEditBuilder.js";
|
|
30
31
|
|
|
31
|
-
export {
|
|
32
|
-
SchemaValidationError,
|
|
33
|
-
isNodeInSchema,
|
|
34
|
-
isFieldInSchema,
|
|
35
|
-
throwOutOfSchema,
|
|
36
|
-
} from "./schemaChecker.js";
|
|
37
|
-
|
|
38
|
-
export { defaultSchemaPolicy } from "./defaultSchema.js";
|
|
39
|
-
|
|
40
32
|
export { MappedEditBuilder } from "./mappedEditBuilder.js";
|
|
@@ -7,7 +7,7 @@ import { type Static, Type } from "@sinclair/typebox";
|
|
|
7
7
|
|
|
8
8
|
import { Versioned } from "../../codec/index.js";
|
|
9
9
|
import { schemaFormatV1 } from "../../core/index.js";
|
|
10
|
-
import type
|
|
10
|
+
import { brand, type Brand } from "../../util/index.js";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* The format version for the forest.
|
|
@@ -20,13 +20,19 @@ export type ForestFormatVersion = Brand<
|
|
|
20
20
|
"ForestFormatVersion"
|
|
21
21
|
>;
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
)
|
|
23
|
+
const FormatGeneric = (
|
|
24
|
+
version: ForestFormatVersion,
|
|
25
|
+
// Return type is intentionally derived.
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
27
|
+
) =>
|
|
28
|
+
Type.Object(
|
|
29
|
+
{
|
|
30
|
+
version: Type.Literal(version),
|
|
31
|
+
keys: Type.Array(schemaFormatV1.FieldKeySchema),
|
|
32
|
+
fields: Versioned,
|
|
33
|
+
},
|
|
34
|
+
{ additionalProperties: false },
|
|
35
|
+
);
|
|
31
36
|
|
|
37
|
+
export const Format = FormatGeneric(brand<ForestFormatVersion>(ForestFormatVersion.v1));
|
|
32
38
|
export type Format = Static<typeof Format>;
|
|
@@ -81,7 +81,6 @@ export {
|
|
|
81
81
|
genericFieldKind,
|
|
82
82
|
type HasFieldChanges,
|
|
83
83
|
type NodeExistsConstraint,
|
|
84
|
-
FieldKindWithEditor,
|
|
85
84
|
ModularChangeFamily,
|
|
86
85
|
type RelevantRemovedRootsFromChild,
|
|
87
86
|
EncodedModularChangeset,
|
|
@@ -104,7 +103,7 @@ export {
|
|
|
104
103
|
defaultChunkPolicy,
|
|
105
104
|
type FieldBatch,
|
|
106
105
|
type FieldBatchCodec,
|
|
107
|
-
|
|
106
|
+
FieldBatchFormatVersion,
|
|
108
107
|
getCodecTreeForFieldBatchFormat,
|
|
109
108
|
makeTreeChunker,
|
|
110
109
|
makeFieldBatchCodec,
|
|
@@ -145,13 +144,16 @@ export {
|
|
|
145
144
|
fieldKindConfigurations,
|
|
146
145
|
intoDelta,
|
|
147
146
|
relevantRemovedRoots,
|
|
147
|
+
getCodecTreeForModularChangeFormat,
|
|
148
|
+
type ModularChangeFormatVersion,
|
|
149
|
+
} from "./default-schema/index.js";
|
|
150
|
+
|
|
151
|
+
export {
|
|
148
152
|
SchemaValidationError,
|
|
149
153
|
isNodeInSchema,
|
|
150
154
|
isFieldInSchema,
|
|
151
155
|
throwOutOfSchema,
|
|
152
|
-
|
|
153
|
-
type ModularChangeFormatVersion,
|
|
154
|
-
} from "./default-schema/index.js";
|
|
156
|
+
} from "./schemaChecker.js";
|
|
155
157
|
|
|
156
158
|
export {
|
|
157
159
|
type FlexTreeOptionalField,
|
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
import { compareSets } from "../../util/index.js";
|
|
20
20
|
|
|
21
21
|
import type { FullSchemaPolicy } from "./fieldKind.js";
|
|
22
|
-
import { withEditor } from "./fieldKindWithEditor.js";
|
|
23
22
|
import { isNeverTree } from "./isNeverTree.js";
|
|
24
23
|
|
|
25
24
|
/**
|
|
@@ -133,8 +132,8 @@ export function allowsFieldSuperset(
|
|
|
133
132
|
original: TreeFieldStoredSchema,
|
|
134
133
|
superset: TreeFieldStoredSchema,
|
|
135
134
|
): boolean {
|
|
136
|
-
return
|
|
137
|
-
policy.fieldKinds.get(original.kind) ?? fail(0xb1b /* missing kind */)
|
|
135
|
+
return (
|
|
136
|
+
policy.fieldKinds.get(original.kind) ?? fail(0xb1b /* missing kind */)
|
|
138
137
|
).allowsFieldSuperset(policy, originalData, original.types, superset);
|
|
139
138
|
}
|
|
140
139
|
|