@fluidframework/tree 2.91.0 → 2.92.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 +118 -0
- package/api-report/tree.alpha.api.md +60 -22
- package/dist/api.d.ts +6 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js.map +1 -1
- package/dist/codec/codec.d.ts +28 -2
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +1 -0
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/index.d.ts +2 -2
- package/dist/codec/index.d.ts.map +1 -1
- package/dist/codec/index.js +2 -4
- package/dist/codec/index.js.map +1 -1
- package/dist/codec/versioned/codec.d.ts +18 -36
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js +46 -59
- 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 -4
- package/dist/codec/versioned/index.js.map +1 -1
- package/dist/core/forest/forest.d.ts +5 -2
- package/dist/core/forest/forest.d.ts.map +1 -1
- package/dist/core/forest/forest.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +6 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/changeRebaser.d.ts +8 -1
- package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
- package/dist/core/rebase/changeRebaser.js.map +1 -1
- package/dist/core/rebase/revisionTagCodec.d.ts +4 -3
- package/dist/core/rebase/revisionTagCodec.d.ts.map +1 -1
- package/dist/core/rebase/revisionTagCodec.js +2 -0
- package/dist/core/rebase/revisionTagCodec.js.map +1 -1
- package/dist/core/rebase/utils.d.ts +2 -2
- package/dist/core/rebase/utils.d.ts.map +1 -1
- package/dist/core/rebase/utils.js +4 -4
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/schema-stored/formatV2.d.ts +1 -1
- package/dist/core/schema-stored/formatV2.js +1 -1
- package/dist/core/schema-stored/formatV2.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts +8 -0
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +42 -7
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/cursor.d.ts +25 -1
- package/dist/core/tree/cursor.d.ts.map +1 -1
- package/dist/core/tree/cursor.js +45 -1
- package/dist/core/tree/cursor.js.map +1 -1
- package/dist/core/tree/deltaUtil.d.ts +13 -1
- package/dist/core/tree/deltaUtil.d.ts.map +1 -1
- package/dist/core/tree/deltaUtil.js +34 -1
- package/dist/core/tree/deltaUtil.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts +5 -5
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/dist/core/tree/index.d.ts +2 -2
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js +6 -2
- package/dist/core/tree/index.js.map +1 -1
- package/dist/core/tree/visitDelta.d.ts +11 -0
- package/dist/core/tree/visitDelta.d.ts.map +1 -1
- package/dist/core/tree/visitDelta.js +1 -1
- package/dist/core/tree/visitDelta.js.map +1 -1
- package/dist/core/tree/visitorUtils.d.ts.map +1 -1
- package/dist/core/tree/visitorUtils.js +5 -0
- package/dist/core/tree/visitorUtils.js.map +1 -1
- package/dist/entrypoints/alpha.d.ts +1 -1
- package/dist/entrypoints/alpha.d.ts.map +1 -1
- package/dist/entrypoints/alpha.js +2 -3
- package/dist/entrypoints/alpha.js.map +1 -1
- package/dist/entrypoints/beta.js +1 -1
- package/dist/entrypoints/beta.js.map +1 -1
- package/dist/entrypoints/legacy.d.ts +1 -1
- package/dist/entrypoints/legacy.d.ts.map +1 -1
- package/dist/entrypoints/legacy.js +1 -1
- package/dist/entrypoints/legacy.js.map +1 -1
- package/dist/entrypoints/public.js +1 -1
- package/dist/entrypoints/public.js.map +1 -1
- package/dist/feature-libraries/changeAtomIdCodec.d.ts +4 -3
- package/dist/feature-libraries/changeAtomIdCodec.d.ts.map +1 -1
- package/dist/feature-libraries/changeAtomIdCodec.js +2 -0
- package/dist/feature-libraries/changeAtomIdCodec.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +2 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +2 -2
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +4 -4
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +6 -6
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -2
- 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 +4 -4
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +6 -6
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +12 -12
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +3 -3
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/{formatGeneric.d.ts → format/formatGeneric.d.ts} +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -0
- package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/codec/format/formatV1.d.ts +187 -0
- package/dist/feature-libraries/chunked-forest/codec/format/formatV1.d.ts.map +1 -0
- package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js +115 -0
- package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/codec/format/formatV2.d.ts +33 -0
- package/dist/feature-libraries/chunked-forest/codec/format/formatV2.d.ts.map +1 -0
- package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js +16 -0
- package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/codec/format/index.d.ts +10 -0
- package/dist/feature-libraries/chunked-forest/codec/format/index.d.ts.map +1 -0
- package/dist/feature-libraries/chunked-forest/codec/format/index.js +18 -0
- package/dist/feature-libraries/chunked-forest/codec/format/index.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/codec/format/versions.d.ts +93 -0
- package/dist/feature-libraries/chunked-forest/codec/format/versions.d.ts.map +1 -0
- package/dist/feature-libraries/chunked-forest/codec/format/versions.js +29 -0
- package/dist/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js +2 -2
- package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +7 -7
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +6 -4
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +3 -3
- 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.map +1 -1
- package/dist/feature-libraries/cursorComparator.d.ts +23 -0
- package/dist/feature-libraries/cursorComparator.d.ts.map +1 -0
- package/dist/feature-libraries/cursorComparator.js +65 -0
- package/dist/feature-libraries/cursorComparator.js.map +1 -0
- package/dist/feature-libraries/forest-summary/codec.d.ts +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +3 -3
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +3 -2
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +5 -5
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +2 -0
- package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.js +12 -7
- package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.js +2 -2
- package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +3 -3
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +0 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +10 -10
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +2 -4
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +3 -3
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +3 -3
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +4 -3
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts +1 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +2 -2
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +4 -4
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts +3 -3
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-edits/index.d.ts +1 -1
- package/dist/feature-libraries/schema-edits/index.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/index.js +2 -3
- package/dist/feature-libraries/schema-edits/index.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -15
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +8 -54
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts +3 -16
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +1 -21
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -1
- package/dist/feature-libraries/schema-index/formatV2.js +1 -1
- package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
- package/dist/feature-libraries/schema-index/index.d.ts +1 -1
- package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/index.js +1 -2
- package/dist/feature-libraries/schema-index/index.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -4
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +3 -3
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +3 -3
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- 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 +2 -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/independentView.d.ts +1 -1
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +14 -21
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +2 -2
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +1 -2
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +2 -36
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +15 -117
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +3 -22
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +10 -27
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +3 -2
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +23 -16
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +2 -2
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFormat.d.ts +8 -7
- package/dist/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFormat.js +13 -5
- package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
- package/dist/shared-tree/tree.d.ts.map +1 -1
- package/dist/shared-tree/tree.js +2 -1
- package/dist/shared-tree/tree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +13 -1
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +3 -0
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +34 -69
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +885 -678
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree/unhydratedTreeContext.js +3 -3
- package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts +23 -12
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +40 -67
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.js +0 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +10 -2
- package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js +18 -13
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +2 -2
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +6 -9
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +3 -3
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +5 -8
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -3
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.js +8 -8
- package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts +2 -3
- package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js +5 -4
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts +15 -14
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +38 -74
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +0 -1
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormat.js +1 -2
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +1 -3
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +12 -2
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/sharedTreeAttributes.d.ts.map +1 -1
- package/dist/sharedTreeAttributes.js +3 -0
- package/dist/sharedTreeAttributes.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.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +2 -2
- 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/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +6 -6
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +7 -19
- 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/treeAlpha.d.ts +69 -0
- package/dist/simple-tree/api/treeAlpha.d.ts.map +1 -0
- package/dist/simple-tree/api/treeAlpha.js +7 -0
- package/dist/simple-tree/api/treeAlpha.js.map +1 -0
- package/dist/simple-tree/api/treeBeta.d.ts +1 -1
- package/dist/simple-tree/api/treeBeta.js.map +1 -1
- package/dist/simple-tree/api/treeChangeEvents.d.ts +3 -0
- package/dist/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
- package/dist/simple-tree/api/treeChangeEvents.js.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.d.ts +49 -0
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +41 -2
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +45 -8
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +5 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/index.d.ts +2 -2
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +16 -0
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +23 -0
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +10 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/index.d.ts +2 -2
- package/dist/simple-tree/node-kinds/array/index.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/index.d.ts +1 -1
- package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/index.js.map +1 -1
- package/dist/text/textDomainFormatted.d.ts +319 -9
- package/dist/text/textDomainFormatted.d.ts.map +1 -1
- package/dist/text/textDomainFormatted.js +100 -25
- package/dist/text/textDomainFormatted.js.map +1 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +5 -2
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/referenceCounting.d.ts.map +1 -1
- package/dist/util/referenceCounting.js +0 -1
- package/dist/util/referenceCounting.js.map +1 -1
- package/legacy.d.ts +2 -3
- package/lib/api.d.ts +6 -1
- package/lib/api.d.ts.map +1 -1
- package/lib/api.js.map +1 -1
- package/lib/codec/codec.d.ts +28 -2
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +1 -0
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/index.d.ts +2 -2
- 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 +18 -36
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js +45 -56
- 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/forest/forest.d.ts +5 -2
- package/lib/core/forest/forest.d.ts.map +1 -1
- package/lib/core/forest/forest.js.map +1 -1
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/changeRebaser.d.ts +8 -1
- package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
- package/lib/core/rebase/changeRebaser.js.map +1 -1
- package/lib/core/rebase/revisionTagCodec.d.ts +4 -3
- package/lib/core/rebase/revisionTagCodec.d.ts.map +1 -1
- package/lib/core/rebase/revisionTagCodec.js +2 -0
- package/lib/core/rebase/revisionTagCodec.js.map +1 -1
- package/lib/core/rebase/utils.d.ts +2 -2
- package/lib/core/rebase/utils.d.ts.map +1 -1
- package/lib/core/rebase/utils.js +4 -4
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/schema-stored/formatV2.d.ts +1 -1
- package/lib/core/schema-stored/formatV2.js +1 -1
- package/lib/core/schema-stored/formatV2.js.map +1 -1
- package/lib/core/tree/anchorSet.d.ts +8 -0
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +42 -7
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/cursor.d.ts +25 -1
- package/lib/core/tree/cursor.d.ts.map +1 -1
- package/lib/core/tree/cursor.js +43 -0
- package/lib/core/tree/cursor.js.map +1 -1
- package/lib/core/tree/deltaUtil.d.ts +13 -1
- package/lib/core/tree/deltaUtil.d.ts.map +1 -1
- package/lib/core/tree/deltaUtil.js +31 -0
- package/lib/core/tree/deltaUtil.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts +5 -5
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/lib/core/tree/index.d.ts +2 -2
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +2 -2
- package/lib/core/tree/index.js.map +1 -1
- package/lib/core/tree/visitDelta.d.ts +11 -0
- package/lib/core/tree/visitDelta.d.ts.map +1 -1
- package/lib/core/tree/visitDelta.js +1 -1
- package/lib/core/tree/visitDelta.js.map +1 -1
- package/lib/core/tree/visitorUtils.d.ts.map +1 -1
- package/lib/core/tree/visitorUtils.js +5 -0
- package/lib/core/tree/visitorUtils.js.map +1 -1
- package/lib/entrypoints/alpha.d.ts +1 -1
- package/lib/entrypoints/alpha.d.ts.map +1 -1
- package/lib/entrypoints/alpha.js +2 -2
- package/lib/entrypoints/alpha.js.map +1 -1
- package/lib/entrypoints/beta.js +1 -1
- package/lib/entrypoints/beta.js.map +1 -1
- package/lib/entrypoints/legacy.d.ts +1 -1
- package/lib/entrypoints/legacy.d.ts.map +1 -1
- package/lib/entrypoints/legacy.js +1 -1
- package/lib/entrypoints/legacy.js.map +1 -1
- package/lib/entrypoints/public.js +1 -1
- package/lib/entrypoints/public.js.map +1 -1
- package/lib/feature-libraries/changeAtomIdCodec.d.ts +4 -3
- package/lib/feature-libraries/changeAtomIdCodec.d.ts.map +1 -1
- package/lib/feature-libraries/changeAtomIdCodec.js +2 -0
- package/lib/feature-libraries/changeAtomIdCodec.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +2 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +2 -2
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +4 -4
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +4 -4
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -2
- 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 +4 -4
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +12 -12
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/{formatGeneric.d.ts → format/formatGeneric.d.ts} +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -0
- package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/codec/format/formatV1.d.ts +187 -0
- package/lib/feature-libraries/chunked-forest/codec/format/formatV1.d.ts.map +1 -0
- package/lib/feature-libraries/chunked-forest/codec/format/formatV1.js +112 -0
- package/lib/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/codec/format/formatV2.d.ts +33 -0
- package/lib/feature-libraries/chunked-forest/codec/format/formatV2.d.ts.map +1 -0
- package/lib/feature-libraries/chunked-forest/codec/format/formatV2.js +13 -0
- package/lib/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/codec/format/index.d.ts +10 -0
- package/lib/feature-libraries/chunked-forest/codec/format/index.d.ts.map +1 -0
- package/lib/feature-libraries/chunked-forest/codec/format/index.js +8 -0
- package/lib/feature-libraries/chunked-forest/codec/format/index.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/codec/format/versions.d.ts +93 -0
- package/lib/feature-libraries/chunked-forest/codec/format/versions.d.ts.map +1 -0
- package/lib/feature-libraries/chunked-forest/codec/format/versions.js +26 -0
- package/lib/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
- 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/nodeEncoder.d.ts +7 -7
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +4 -2
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +1 -1
- 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.map +1 -1
- package/lib/feature-libraries/cursorComparator.d.ts +23 -0
- package/lib/feature-libraries/cursorComparator.d.ts.map +1 -0
- package/lib/feature-libraries/cursorComparator.js +61 -0
- package/lib/feature-libraries/cursorComparator.js.map +1 -0
- package/lib/feature-libraries/forest-summary/codec.d.ts +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +3 -3
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +3 -2
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +3 -2
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts +2 -0
- package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.js +12 -7
- package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.js +2 -2
- package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +3 -3
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +0 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +10 -10
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +2 -4
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +3 -3
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +3 -3
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +4 -3
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +2 -2
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +4 -4
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts +3 -3
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-edits/index.d.ts +1 -1
- package/lib/feature-libraries/schema-edits/index.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/index.js +1 -1
- package/lib/feature-libraries/schema-edits/index.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -15
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +6 -50
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts +3 -16
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +0 -19
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -1
- package/lib/feature-libraries/schema-index/formatV2.js +1 -1
- package/lib/feature-libraries/schema-index/formatV2.js.map +1 -1
- package/lib/feature-libraries/schema-index/index.d.ts +1 -1
- package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/index.js +1 -1
- package/lib/feature-libraries/schema-index/index.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -4
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- 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 +1 -1
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/independentView.d.ts +1 -1
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +4 -11
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +2 -2
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +2 -36
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +17 -116
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +3 -22
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +11 -27
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +3 -2
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +19 -12
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js +2 -2
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +2 -2
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFormat.d.ts +8 -7
- package/lib/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFormat.js +11 -5
- package/lib/shared-tree/sharedTreeChangeFormat.js.map +1 -1
- package/lib/shared-tree/tree.d.ts.map +1 -1
- package/lib/shared-tree/tree.js +2 -1
- package/lib/shared-tree/tree.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +13 -1
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +3 -0
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +34 -69
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +889 -683
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree/unhydratedTreeContext.js +1 -1
- package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts +23 -12
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +41 -65
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.js +0 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +10 -2
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js +16 -11
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +2 -2
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +5 -8
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +3 -3
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +3 -3
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -3
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.js +8 -8
- package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts +2 -3
- package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.js +5 -4
- package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts +15 -14
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +38 -71
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +0 -1
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormat.js +0 -1
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +1 -3
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +14 -4
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/sharedTreeAttributes.d.ts.map +1 -1
- package/lib/sharedTreeAttributes.js +3 -0
- package/lib/sharedTreeAttributes.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.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +2 -2
- 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/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +7 -7
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +7 -19
- 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/treeAlpha.d.ts +69 -0
- package/lib/simple-tree/api/treeAlpha.d.ts.map +1 -0
- package/lib/simple-tree/api/treeAlpha.js +6 -0
- package/lib/simple-tree/api/treeAlpha.js.map +1 -0
- package/lib/simple-tree/api/treeBeta.d.ts +1 -1
- package/lib/simple-tree/api/treeBeta.js.map +1 -1
- package/lib/simple-tree/api/treeChangeEvents.d.ts +3 -0
- package/lib/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
- package/lib/simple-tree/api/treeChangeEvents.js.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.d.ts +49 -0
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +41 -2
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +45 -8
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +5 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/index.d.ts +2 -2
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +16 -0
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +23 -0
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +10 -1
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/index.d.ts +2 -2
- package/lib/simple-tree/node-kinds/array/index.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/index.d.ts +1 -1
- package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/index.js.map +1 -1
- package/lib/text/textDomainFormatted.d.ts +319 -9
- package/lib/text/textDomainFormatted.d.ts.map +1 -1
- package/lib/text/textDomainFormatted.js +103 -28
- package/lib/text/textDomainFormatted.js.map +1 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +6 -3
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/referenceCounting.d.ts.map +1 -1
- package/lib/util/referenceCounting.js +0 -1
- package/lib/util/referenceCounting.js.map +1 -1
- package/package.json +27 -27
- package/scripts/generate-entrypoint-sources.sh +4 -2
- package/src/api.ts +11 -0
- package/src/codec/codec.ts +32 -2
- package/src/codec/index.ts +2 -3
- package/src/codec/versioned/codec.ts +99 -109
- package/src/codec/versioned/index.ts +1 -3
- package/src/core/forest/forest.ts +5 -2
- package/src/core/index.ts +4 -0
- package/src/core/rebase/changeRebaser.ts +8 -0
- package/src/core/rebase/revisionTagCodec.ts +4 -4
- package/src/core/rebase/utils.ts +9 -2
- package/src/core/schema-stored/formatV2.ts +1 -1
- package/src/core/tree/anchorSet.ts +67 -10
- package/src/core/tree/cursor.ts +52 -1
- package/src/core/tree/deltaUtil.ts +37 -1
- package/src/core/tree/detachedFieldIndexCodecs.ts +4 -4
- package/src/core/tree/index.ts +4 -0
- package/src/core/tree/visitDelta.ts +13 -1
- package/src/core/tree/visitorUtils.ts +5 -0
- package/src/entrypoints/alpha.ts +13 -6
- package/src/entrypoints/beta.ts +2 -2
- package/src/entrypoints/legacy.ts +11 -3
- package/src/entrypoints/public.ts +1 -1
- package/src/feature-libraries/changeAtomIdCodec.ts +8 -7
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +3 -2
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +18 -13
- package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +1 -1
- package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +1 -2
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +16 -10
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +16 -14
- package/src/feature-libraries/chunked-forest/codec/{formatGeneric.ts → format/formatGeneric.ts} +1 -1
- package/src/feature-libraries/chunked-forest/codec/{format.ts → format/formatV1.ts} +41 -111
- package/src/feature-libraries/chunked-forest/codec/format/formatV2.ts +31 -0
- package/src/feature-libraries/chunked-forest/codec/format/index.ts +31 -0
- package/src/feature-libraries/chunked-forest/codec/format/versions.ts +81 -0
- package/src/feature-libraries/chunked-forest/codec/index.ts +6 -2
- package/src/feature-libraries/chunked-forest/codec/nodeEncoder.ts +19 -12
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +6 -4
- package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +10 -10
- package/src/feature-libraries/chunked-forest/index.ts +2 -1
- package/src/feature-libraries/cursorComparator.ts +77 -0
- package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +5 -5
- package/src/feature-libraries/index.ts +5 -3
- package/src/feature-libraries/indexing/anchorTreeIndex.ts +20 -10
- package/src/feature-libraries/mitigatedChangeFamily.ts +4 -1
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +4 -5
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +0 -1
- package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +19 -26
- package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +4 -4
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +4 -5
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +6 -2
- package/src/feature-libraries/object-forest/objectForest.ts +8 -2
- package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +11 -13
- package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +4 -5
- package/src/feature-libraries/schema-edits/index.ts +1 -4
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +10 -78
- package/src/feature-libraries/schema-index/codec.ts +0 -25
- package/src/feature-libraries/schema-index/formatV2.ts +1 -1
- package/src/feature-libraries/schema-index/index.ts +1 -4
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +6 -6
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +8 -5
- package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +4 -5
- package/src/index.ts +10 -3
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +5 -18
- package/src/shared-tree/index.ts +0 -4
- package/src/shared-tree/schematizingTreeView.ts +19 -165
- package/src/shared-tree/sharedTree.ts +16 -59
- package/src/shared-tree/sharedTreeChangeCodecs.ts +23 -29
- package/src/shared-tree/sharedTreeChangeEnricher.ts +1 -2
- package/src/shared-tree/sharedTreeChangeFamily.ts +2 -0
- package/src/shared-tree/sharedTreeChangeFormat.ts +23 -8
- package/src/shared-tree/tree.ts +2 -5
- package/src/shared-tree/treeAlpha.ts +26 -0
- package/src/shared-tree/treeCheckout.ts +275 -99
- package/src/shared-tree/unhydratedTreeContext.ts +1 -1
- package/src/shared-tree-core/editManagerCodecs.ts +99 -124
- package/src/shared-tree-core/editManagerCodecsCommons.ts +0 -1
- package/src/shared-tree-core/editManagerCodecsV1toV4.ts +54 -59
- package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +72 -95
- package/src/shared-tree-core/index.ts +4 -8
- package/src/shared-tree-core/messageCodecV1ToV4.ts +56 -71
- package/src/shared-tree-core/messageCodecVSharedBranches.ts +76 -92
- package/src/shared-tree-core/messageCodecs.ts +88 -126
- package/src/shared-tree-core/messageFormat.ts +0 -3
- package/src/shared-tree-core/sharedTreeCore.ts +14 -21
- package/src/sharedTreeAttributes.ts +3 -0
- package/src/simple-tree/api/index.ts +10 -0
- package/src/simple-tree/api/schemaFactory.ts +0 -2
- package/src/simple-tree/api/schemaFactoryAlpha.ts +13 -2
- package/src/simple-tree/api/storedSchema.ts +8 -19
- package/src/simple-tree/api/tree.ts +7 -20
- package/src/simple-tree/api/treeAlpha.ts +90 -0
- package/src/simple-tree/api/treeBeta.ts +1 -1
- package/src/simple-tree/api/treeChangeEvents.ts +3 -0
- package/src/simple-tree/api/treeNodeApi.ts +95 -3
- package/src/simple-tree/core/treeNodeKernel.ts +53 -7
- package/src/simple-tree/core/unhydratedFlexTree.ts +5 -1
- package/src/simple-tree/index.ts +10 -0
- package/src/simple-tree/node-kinds/array/arrayNode.ts +64 -0
- package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +25 -1
- package/src/simple-tree/node-kinds/array/index.ts +2 -0
- package/src/simple-tree/node-kinds/index.ts +2 -0
- package/src/text/textDomainFormatted.ts +113 -11
- package/src/treeFactory.ts +10 -5
- package/src/util/referenceCounting.ts +0 -1
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts +0 -383
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +0 -1
- package/dist/feature-libraries/chunked-forest/codec/format.js +0 -191
- package/dist/feature-libraries/chunked-forest/codec/format.js.map +0 -1
- package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +0 -1
- package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +0 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts +0 -383
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +0 -1
- package/lib/feature-libraries/chunked-forest/codec/format.js +0 -188
- package/lib/feature-libraries/chunked-forest/codec/format.js.map +0 -1
- package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +0 -1
- package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +0 -1
- /package/dist/feature-libraries/chunked-forest/codec/{formatGeneric.js → format/formatGeneric.js} +0 -0
- /package/lib/feature-libraries/chunked-forest/codec/{formatGeneric.js → format/formatGeneric.js} +0 -0
|
@@ -4,90 +4,24 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
7
|
-
import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
|
|
8
7
|
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
type CodecWriteOptions,
|
|
12
|
-
type ICodecFamily,
|
|
13
|
-
type IJsonCodec,
|
|
14
|
-
makeCodecFamily,
|
|
15
|
-
makeVersionDispatchingCodec,
|
|
16
|
-
withSchemaValidation,
|
|
17
|
-
} from "../../codec/index.js";
|
|
18
|
-
import { SchemaFormatVersion } from "../../core/index.js";
|
|
19
|
-
import { makeSchemaCodec, schemaCodecBuilder } from "../schema-index/index.js";
|
|
8
|
+
import type { CodecWriteOptions, JsonCodecPart } from "../../codec/index.js";
|
|
9
|
+
import { schemaCodecBuilder } from "../schema-index/index.js";
|
|
20
10
|
|
|
21
11
|
import { EncodedSchemaChange } from "./schemaChangeFormat.js";
|
|
22
12
|
import type { SchemaChange } from "./schemaChangeTypes.js";
|
|
23
13
|
|
|
24
14
|
/**
|
|
25
|
-
*
|
|
26
|
-
* @param options - Specifies common codec options, including which `validator` to use.
|
|
27
|
-
* @returns The composed codec family.
|
|
28
|
-
*/
|
|
29
|
-
export function makeSchemaChangeCodecs(
|
|
30
|
-
options: CodecWriteOptions,
|
|
31
|
-
): ICodecFamily<SchemaChange> {
|
|
32
|
-
return makeCodecFamily([
|
|
33
|
-
[SchemaFormatVersion.v1, makeSchemaChangeCodecV1(options, SchemaFormatVersion.v1)],
|
|
34
|
-
// This code (makeSchemaChangeCodecs) is constructing a SchemaFormatVersion.v2 codec, regardless of the requested write version.
|
|
35
|
-
// It then trusts the user of the produced makeCodecFamily to only select if when it is valid to do so.
|
|
36
|
-
// This trust is manifests in having to use `allowPossiblyIncompatibleWriteVersionOverrides`
|
|
37
|
-
// here as it needs to build the v2 codec regardless of if its valid to use.
|
|
38
|
-
// TODO: There should not be two separate places selecting the write version for this codec. Such cases should instead adopt one of the following patterns:
|
|
39
|
-
// 1. The outer coded should let the inner one do its own version selection instead of forcing it.
|
|
40
|
-
// 2. The outer codec should fully handle version selection and embed the inner content directly (referencing its format not codec) and not involve the codec at all.
|
|
41
|
-
// TODO: fix this up when migrating SchemaChangeCodec to use ClientVersionDispatchingCodecBuilder.
|
|
42
|
-
// This should probably use pattern 1 above, which will result in this codec having two identical versions.
|
|
43
|
-
[
|
|
44
|
-
SchemaFormatVersion.v2,
|
|
45
|
-
makeSchemaChangeCodecV1(
|
|
46
|
-
{ ...options, allowPossiblyIncompatibleWriteVersionOverrides: true },
|
|
47
|
-
SchemaFormatVersion.v2,
|
|
48
|
-
),
|
|
49
|
-
],
|
|
50
|
-
]);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export function getCodecTreeForSchemaChangeFormat(
|
|
54
|
-
version: SchemaFormatVersion,
|
|
55
|
-
clientVersion: MinimumVersionForCollab,
|
|
56
|
-
): CodecTree {
|
|
57
|
-
return {
|
|
58
|
-
name: "SchemaChange",
|
|
59
|
-
version,
|
|
60
|
-
children: [schemaCodecBuilder.getCodecTree(clientVersion)],
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Create a schema change codec.
|
|
66
|
-
* @param options - Specifies common codec options, including which `validator` to use.
|
|
67
|
-
* @param writeVersion - The schema change write version.
|
|
68
|
-
* @returns The composed codec.
|
|
69
|
-
*/
|
|
70
|
-
export function makeSchemaChangeCodec(
|
|
71
|
-
options: CodecWriteOptions,
|
|
72
|
-
writeVersion: SchemaFormatVersion,
|
|
73
|
-
): IJsonCodec<SchemaChange> {
|
|
74
|
-
const family = makeSchemaChangeCodecs(options);
|
|
75
|
-
return makeVersionDispatchingCodec(family, { ...options, writeVersion });
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Compose the change codec using mostly v1 logic.
|
|
15
|
+
* Creates a codec for schema changes.
|
|
80
16
|
* @param options - The codec options.
|
|
81
|
-
* @
|
|
82
|
-
* @returns The composed schema change codec.
|
|
17
|
+
* @returns The composed schema change codec part.
|
|
83
18
|
*/
|
|
84
|
-
function
|
|
19
|
+
export function makeSchemaChangeCodec(
|
|
85
20
|
options: CodecWriteOptions,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
encode: (schemaChange) => {
|
|
21
|
+
): JsonCodecPart<SchemaChange, typeof EncodedSchemaChange> {
|
|
22
|
+
const schemaCodec = schemaCodecBuilder.build(options);
|
|
23
|
+
return {
|
|
24
|
+
encode: (schemaChange: SchemaChange): EncodedSchemaChange => {
|
|
91
25
|
assert(
|
|
92
26
|
!schemaChange.isInverse,
|
|
93
27
|
0x933 /* Inverse schema changes should never be transmitted */,
|
|
@@ -97,7 +31,7 @@ function makeSchemaChangeCodecV1(
|
|
|
97
31
|
old: schemaCodec.encode(schemaChange.schema.old),
|
|
98
32
|
};
|
|
99
33
|
},
|
|
100
|
-
decode: (encoded) => {
|
|
34
|
+
decode: (encoded: EncodedSchemaChange): SchemaChange => {
|
|
101
35
|
return {
|
|
102
36
|
schema: {
|
|
103
37
|
new: schemaCodec.decode(encoded.new),
|
|
@@ -108,6 +42,4 @@ function makeSchemaChangeCodecV1(
|
|
|
108
42
|
},
|
|
109
43
|
encodedSchema: EncodedSchemaChange,
|
|
110
44
|
};
|
|
111
|
-
|
|
112
|
-
return withSchemaValidation(EncodedSchemaChange, schemaChangeCodec, options.jsonValidator);
|
|
113
45
|
}
|
|
@@ -8,9 +8,7 @@ import { lowestMinVersionForCollab } from "@fluidframework/runtime-utils/interna
|
|
|
8
8
|
|
|
9
9
|
import {
|
|
10
10
|
ClientVersionDispatchingCodecBuilder,
|
|
11
|
-
type CodecWriteOptions,
|
|
12
11
|
FluidClientVersion,
|
|
13
|
-
type IJsonCodec,
|
|
14
12
|
} from "../../codec/index.js";
|
|
15
13
|
import {
|
|
16
14
|
SchemaFormatVersion,
|
|
@@ -27,29 +25,6 @@ import { brand } from "../../util/index.js";
|
|
|
27
25
|
import { Format as FormatV1 } from "./formatV1.js";
|
|
28
26
|
import { Format as FormatV2 } from "./formatV2.js";
|
|
29
27
|
|
|
30
|
-
/**
|
|
31
|
-
* Create a schema codec.
|
|
32
|
-
* @param options - Specifies common codec options, including `minVersionForCollab` and which `validator` to use.
|
|
33
|
-
* @param writeVersionOverride - The schema version to write. If not provided, the version will be derived from `minVersionForCollab`.
|
|
34
|
-
* TODO: Currently this parameter is provided when it probably should not be. Users of it should probably allow the automatic selection to occur and this parameter can be removed.
|
|
35
|
-
* Any case where an override is actually required can use `options` to do so.
|
|
36
|
-
* @returns The composed codec.
|
|
37
|
-
*
|
|
38
|
-
* @privateRemarks We should consider using the Shared Tree format version instead as it may be more valuable for application authors than the schema version.
|
|
39
|
-
*
|
|
40
|
-
* TODO: replace use of this with schemaCodecBuilder.build(...).
|
|
41
|
-
*/
|
|
42
|
-
export function makeSchemaCodec(
|
|
43
|
-
options: CodecWriteOptions,
|
|
44
|
-
writeVersionOverride?: SchemaFormatVersion,
|
|
45
|
-
): IJsonCodec<TreeStoredSchema> {
|
|
46
|
-
const overrides = new Map(options.writeVersionOverrides ?? []);
|
|
47
|
-
if (writeVersionOverride !== undefined) {
|
|
48
|
-
overrides.set(schemaCodecBuilder.name, writeVersionOverride);
|
|
49
|
-
}
|
|
50
|
-
return schemaCodecBuilder.build({ ...options, writeVersionOverrides: overrides });
|
|
51
|
-
}
|
|
52
|
-
|
|
53
28
|
function encodeRepoV1(repo: TreeStoredSchema): FormatV1 {
|
|
54
29
|
const nodeSchema = encodeNodeSchema(repo, (schema) => schema.encodeV1());
|
|
55
30
|
const rootFieldSchema = encodeFieldSchemaV1(repo.rootFieldSchema);
|
|
@@ -17,7 +17,7 @@ const noAdditionalProps: ObjectOptions = { additionalProperties: false };
|
|
|
17
17
|
* This chooses to use lists of named objects instead of maps:
|
|
18
18
|
* this choice is somewhat arbitrary, but avoids user data being used as object keys,
|
|
19
19
|
* which can sometimes be an issue (for example handling that for "__proto__" can require care).
|
|
20
|
-
* It also makes it simpler to
|
|
20
|
+
* It also makes it simpler to deterministically sort by keys.
|
|
21
21
|
*/
|
|
22
22
|
export const Format = Type.Object(
|
|
23
23
|
{
|
|
@@ -4,9 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export { SchemaSummarizer } from "./schemaSummarizer.js";
|
|
7
|
-
export {
|
|
8
|
-
makeSchemaCodec,
|
|
9
|
-
schemaCodecBuilder,
|
|
10
|
-
} from "./codec.js";
|
|
7
|
+
export { schemaCodecBuilder } from "./codec.js";
|
|
11
8
|
export { Format as FormatV1 } from "./formatV1.js";
|
|
12
9
|
export { Format as FormatV2 } from "./formatV2.js";
|
|
@@ -10,12 +10,14 @@ import {
|
|
|
10
10
|
DiscriminatedUnionDispatcher,
|
|
11
11
|
type DiscriminatedUnionLibrary,
|
|
12
12
|
type IJsonCodec,
|
|
13
|
+
type JsonCodecPart,
|
|
13
14
|
} from "../../codec/index.js";
|
|
14
15
|
import type {
|
|
15
16
|
ChangeEncodingContext,
|
|
16
17
|
ChangesetLocalId,
|
|
17
18
|
EncodedRevisionTag,
|
|
18
19
|
RevisionTag,
|
|
20
|
+
RevisionTagSchema,
|
|
19
21
|
} from "../../core/index.js";
|
|
20
22
|
import { type JsonCompatibleReadOnly, type Mutable, brand } from "../../util/index.js";
|
|
21
23
|
import { makeChangeAtomIdCodec } from "../changeAtomIdCodec.js";
|
|
@@ -43,10 +45,9 @@ import {
|
|
|
43
45
|
import { isNoopMark, normalizeCellRename } from "./utils.js";
|
|
44
46
|
|
|
45
47
|
export function makeV2CodecHelpers(
|
|
46
|
-
revisionTagCodec:
|
|
48
|
+
revisionTagCodec: JsonCodecPart<
|
|
47
49
|
RevisionTag,
|
|
48
|
-
|
|
49
|
-
EncodedRevisionTag,
|
|
50
|
+
typeof RevisionTagSchema,
|
|
50
51
|
ChangeEncodingContext
|
|
51
52
|
>,
|
|
52
53
|
): SequenceCodecHelpers<MarkEffect, Encoded.MarkEffect> {
|
|
@@ -261,10 +262,9 @@ export function makeV2CodecHelpers(
|
|
|
261
262
|
}
|
|
262
263
|
|
|
263
264
|
export function makeV2Codec(
|
|
264
|
-
revisionTagCodec:
|
|
265
|
+
revisionTagCodec: JsonCodecPart<
|
|
265
266
|
RevisionTag,
|
|
266
|
-
|
|
267
|
-
EncodedRevisionTag,
|
|
267
|
+
typeof RevisionTagSchema,
|
|
268
268
|
ChangeEncodingContext
|
|
269
269
|
>,
|
|
270
270
|
): IJsonCodec<
|
|
@@ -5,11 +5,15 @@
|
|
|
5
5
|
|
|
6
6
|
import type { TAnySchema } from "@sinclair/typebox";
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
DiscriminatedUnionDispatcher,
|
|
10
|
+
type IJsonCodec,
|
|
11
|
+
type JsonCodecPart,
|
|
12
|
+
} from "../../codec/index.js";
|
|
9
13
|
import type {
|
|
10
14
|
ChangeEncodingContext,
|
|
11
|
-
EncodedRevisionTag,
|
|
12
15
|
RevisionTag,
|
|
16
|
+
RevisionTagSchema,
|
|
13
17
|
} from "../../core/index.js";
|
|
14
18
|
import type { JsonCompatibleReadOnly } from "../../util/index.js";
|
|
15
19
|
import {
|
|
@@ -23,10 +27,9 @@ import type { Changeset, Mark, MarkEffect, Rename } from "./types.js";
|
|
|
23
27
|
import { isNoopMark } from "./utils.js";
|
|
24
28
|
|
|
25
29
|
export function makeV3Codec(
|
|
26
|
-
revisionTagCodec:
|
|
30
|
+
revisionTagCodec: JsonCodecPart<
|
|
27
31
|
RevisionTag,
|
|
28
|
-
|
|
29
|
-
EncodedRevisionTag,
|
|
32
|
+
typeof RevisionTagSchema,
|
|
30
33
|
ChangeEncodingContext
|
|
31
34
|
>,
|
|
32
35
|
): IJsonCodec<
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { type
|
|
6
|
+
import { type JsonCodecPart, makeCodecFamily, type ICodecFamily } from "../../codec/index.js";
|
|
7
7
|
import type {
|
|
8
8
|
ChangeEncodingContext,
|
|
9
|
-
EncodedRevisionTag,
|
|
10
9
|
RevisionTag,
|
|
10
|
+
RevisionTagSchema,
|
|
11
11
|
} from "../../core/index.js";
|
|
12
12
|
import type { FieldChangeEncodingContext } from "../modular-schema/index.js";
|
|
13
13
|
|
|
@@ -16,10 +16,9 @@ import { makeV3Codec } from "./sequenceFieldCodecV3.js";
|
|
|
16
16
|
import type { Changeset, MarkList } from "./types.js";
|
|
17
17
|
|
|
18
18
|
export const sequenceFieldChangeCodecFactory = (
|
|
19
|
-
revisionTagCodec:
|
|
19
|
+
revisionTagCodec: JsonCodecPart<
|
|
20
20
|
RevisionTag,
|
|
21
|
-
|
|
22
|
-
EncodedRevisionTag,
|
|
21
|
+
typeof RevisionTagSchema,
|
|
23
22
|
ChangeEncodingContext
|
|
24
23
|
>,
|
|
25
24
|
): ICodecFamily<MarkList, FieldChangeEncodingContext> =>
|
package/src/index.ts
CHANGED
|
@@ -71,9 +71,6 @@ export {
|
|
|
71
71
|
Tree,
|
|
72
72
|
type RunTransaction,
|
|
73
73
|
type ForestOptions,
|
|
74
|
-
getBranch,
|
|
75
|
-
type BranchableTree,
|
|
76
|
-
type TreeBranchFork,
|
|
77
74
|
independentInitializedView,
|
|
78
75
|
type ViewContent,
|
|
79
76
|
TreeAlpha,
|
|
@@ -91,6 +88,7 @@ export {
|
|
|
91
88
|
|
|
92
89
|
export {
|
|
93
90
|
TreeArrayNode,
|
|
91
|
+
type TreeArrayNodeAlpha,
|
|
94
92
|
type Unhydrated,
|
|
95
93
|
IterableTreeArrayContent,
|
|
96
94
|
TreeNode,
|
|
@@ -134,7 +132,14 @@ export {
|
|
|
134
132
|
normalizeFieldSchema,
|
|
135
133
|
type InternalTreeNode,
|
|
136
134
|
type WithType,
|
|
135
|
+
type ArrayNodeDeltaOp,
|
|
136
|
+
type ArrayNodeInsertOp,
|
|
137
|
+
type ArrayNodeRemoveOp,
|
|
138
|
+
type ArrayNodeRetainOp,
|
|
137
139
|
type NodeChangedData,
|
|
140
|
+
type NodeChangedDataAlpha,
|
|
141
|
+
type NodeChangedDataDelta,
|
|
142
|
+
type NodeChangedDataProperties,
|
|
138
143
|
type SchemaUpgrade,
|
|
139
144
|
contentSchemaSymbol,
|
|
140
145
|
// Types not really intended for public use, but used in links.
|
|
@@ -205,6 +210,7 @@ export {
|
|
|
205
210
|
// Beta APIs
|
|
206
211
|
TreeBeta,
|
|
207
212
|
type TreeChangeEventsBeta,
|
|
213
|
+
type TreeChangeEventsAlpha,
|
|
208
214
|
// Other
|
|
209
215
|
type VerboseTreeNode,
|
|
210
216
|
type TreeEncodingOptions,
|
|
@@ -284,6 +290,7 @@ export {
|
|
|
284
290
|
allowUnused,
|
|
285
291
|
type LeafSchema,
|
|
286
292
|
type ArrayNodeCustomizableSchema,
|
|
293
|
+
type ArrayNodeCustomizableSchemaAlpha,
|
|
287
294
|
type ArrayNodePojoEmulationSchema,
|
|
288
295
|
ArrayNodeSchema,
|
|
289
296
|
type MapNodeCustomizableSchema,
|
package/src/packageVersion.ts
CHANGED
|
@@ -10,29 +10,22 @@ import {
|
|
|
10
10
|
createIdCompressor,
|
|
11
11
|
} from "@fluidframework/id-compressor/internal";
|
|
12
12
|
|
|
13
|
-
import {
|
|
14
|
-
FluidClientVersion,
|
|
15
|
-
type CodecWriteOptions,
|
|
16
|
-
type ICodecOptions,
|
|
17
|
-
} from "../codec/index.js";
|
|
13
|
+
import type { CodecWriteOptions, ICodecOptions } from "../codec/index.js";
|
|
18
14
|
import {
|
|
19
15
|
type RevisionTag,
|
|
20
16
|
RevisionTagCodec,
|
|
21
|
-
SchemaFormatVersion,
|
|
22
17
|
TreeStoredSchemaRepository,
|
|
23
18
|
} from "../core/index.js";
|
|
24
19
|
import {
|
|
25
20
|
createNodeIdentifierManager,
|
|
26
21
|
fieldBatchCodecBuilder,
|
|
27
|
-
makeSchemaCodec,
|
|
28
22
|
type FieldBatchEncodingContext,
|
|
29
23
|
defaultSchemaPolicy,
|
|
30
24
|
TreeCompressionStrategy,
|
|
31
25
|
defaultIncrementalEncodingPolicy,
|
|
26
|
+
schemaCodecBuilder,
|
|
32
27
|
} from "../feature-libraries/index.js";
|
|
33
28
|
import { combineChunks } from "../feature-libraries/index.js";
|
|
34
|
-
// eslint-disable-next-line import-x/no-internal-modules
|
|
35
|
-
import type { Format } from "../feature-libraries/schema-index/formatV1.js";
|
|
36
29
|
import type {
|
|
37
30
|
TreeViewConfiguration,
|
|
38
31
|
ImplicitFieldSchema,
|
|
@@ -236,15 +229,9 @@ export function createIndependentTreeAlpha<const TSchema extends ImplicitFieldSc
|
|
|
236
229
|
});
|
|
237
230
|
|
|
238
231
|
if (options?.content !== undefined) {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
const
|
|
242
|
-
...options,
|
|
243
|
-
minVersionForCollab: FluidClientVersion.v2_0,
|
|
244
|
-
};
|
|
245
|
-
const schemaCodec = makeSchemaCodec(writeOptions, SchemaFormatVersion.v1);
|
|
246
|
-
const fieldBatchCodec = fieldBatchCodecBuilder.build(writeOptions);
|
|
247
|
-
const newSchema = schemaCodec.decode(options.content.schema as Format);
|
|
232
|
+
const schemaCodec = schemaCodecBuilder.buildDecoder(options);
|
|
233
|
+
const fieldBatchCodec = fieldBatchCodecBuilder.buildDecoder(options);
|
|
234
|
+
const newSchema = schemaCodec.decode(options.content.schema);
|
|
248
235
|
|
|
249
236
|
const context: FieldBatchEncodingContext = {
|
|
250
237
|
encodeType: TreeCompressionStrategy.Compressed,
|
package/src/shared-tree/index.ts
CHANGED
|
@@ -9,7 +9,6 @@ export {
|
|
|
9
9
|
type SharedTreeOptions,
|
|
10
10
|
type SharedTreeOptionsBeta,
|
|
11
11
|
SharedTreeKernel,
|
|
12
|
-
getBranch,
|
|
13
12
|
type ForestType,
|
|
14
13
|
type SharedTreeContentSnapshot,
|
|
15
14
|
type SharedTreeFormatOptions,
|
|
@@ -31,9 +30,6 @@ export {
|
|
|
31
30
|
TreeCheckout,
|
|
32
31
|
type ITreeCheckout,
|
|
33
32
|
type CheckoutEvents,
|
|
34
|
-
type ITreeCheckoutFork,
|
|
35
|
-
type BranchableTree,
|
|
36
|
-
type TreeBranchFork,
|
|
37
33
|
} from "./treeCheckout.js";
|
|
38
34
|
|
|
39
35
|
export { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
|
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
IEmitter,
|
|
10
10
|
Listenable,
|
|
11
11
|
} from "@fluidframework/core-interfaces/internal";
|
|
12
|
-
import { assert
|
|
12
|
+
import { assert } from "@fluidframework/core-utils/internal";
|
|
13
13
|
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
14
14
|
|
|
15
15
|
import { anchorSlot, rootFieldKey } from "../core/index.js";
|
|
@@ -17,7 +17,6 @@ import {
|
|
|
17
17
|
type NodeIdentifierManager,
|
|
18
18
|
defaultSchemaPolicy,
|
|
19
19
|
cursorForMapTreeField,
|
|
20
|
-
TreeStatus,
|
|
21
20
|
Context,
|
|
22
21
|
combineChunks,
|
|
23
22
|
type FlexTreeOptionalField,
|
|
@@ -41,16 +40,12 @@ import {
|
|
|
41
40
|
type ReadableField,
|
|
42
41
|
type ReadSchema,
|
|
43
42
|
type UnsafeUnknownSchema,
|
|
44
|
-
type TreeBranch,
|
|
45
43
|
type TreeBranchEvents,
|
|
46
|
-
getInnerNode,
|
|
47
|
-
getKernel,
|
|
48
44
|
type VoidTransactionCallbackStatus,
|
|
49
45
|
type TransactionCallbackStatus,
|
|
50
46
|
type TransactionResult,
|
|
51
47
|
type TransactionResultExt,
|
|
52
48
|
type RunTransactionParams,
|
|
53
|
-
type TransactionConstraintAlpha,
|
|
54
49
|
HydratedContext,
|
|
55
50
|
SimpleContextSlot,
|
|
56
51
|
areImplicitFieldSchemaEqual,
|
|
@@ -72,7 +67,7 @@ import {
|
|
|
72
67
|
} from "../util/index.js";
|
|
73
68
|
|
|
74
69
|
import { canInitialize, initialize, initializerFromChunk } from "./schematizeTree.js";
|
|
75
|
-
import type {
|
|
70
|
+
import type { TreeCheckout } from "./treeCheckout.js";
|
|
76
71
|
|
|
77
72
|
/**
|
|
78
73
|
* Creating multiple tree views from the same checkout is not supported. This slot is used to detect if one already
|
|
@@ -276,16 +271,10 @@ export class SchematizingSimpleTreeView<
|
|
|
276
271
|
return this.flexTreeContext;
|
|
277
272
|
}
|
|
278
273
|
|
|
279
|
-
/**
|
|
280
|
-
* {@inheritDoc @fluidframework/shared-tree#TreeViewAlpha.runTransaction}
|
|
281
|
-
*/
|
|
282
274
|
public runTransaction<TSuccessValue, TFailureValue>(
|
|
283
275
|
transaction: () => TransactionCallbackStatus<TSuccessValue, TFailureValue>,
|
|
284
276
|
params?: RunTransactionParams,
|
|
285
277
|
): TransactionResultExt<TSuccessValue, TFailureValue>;
|
|
286
|
-
/**
|
|
287
|
-
* {@inheritDoc @fluidframework/shared-tree#TreeViewAlpha.runTransaction}
|
|
288
|
-
*/
|
|
289
278
|
public runTransaction(
|
|
290
279
|
transaction: () => VoidTransactionCallbackStatus | void,
|
|
291
280
|
params?: RunTransactionParams,
|
|
@@ -297,21 +286,14 @@ export class SchematizingSimpleTreeView<
|
|
|
297
286
|
| void,
|
|
298
287
|
params?: RunTransactionParams,
|
|
299
288
|
): TransactionResultExt<TSuccessValue, TFailureValue> | TransactionResult {
|
|
300
|
-
this.
|
|
301
|
-
|
|
302
|
-
return this.unmountTransaction(transactionCallbackStatus, params);
|
|
289
|
+
this.ensureUndisposed();
|
|
290
|
+
return this.checkout.runTransaction(transaction, params);
|
|
303
291
|
}
|
|
304
292
|
|
|
305
|
-
/**
|
|
306
|
-
* {@inheritDoc @fluidframework/shared-tree#TreeViewAlpha.runTransactionAsync}
|
|
307
|
-
*/
|
|
308
293
|
public runTransactionAsync<TSuccessValue, TFailureValue>(
|
|
309
294
|
transaction: () => Promise<TransactionCallbackStatus<TSuccessValue, TFailureValue>>,
|
|
310
295
|
params?: RunTransactionParams,
|
|
311
296
|
): Promise<TransactionResultExt<TSuccessValue, TFailureValue>>;
|
|
312
|
-
/**
|
|
313
|
-
* {@inheritDoc @fluidframework/shared-tree#TreeViewAlpha.runTransactionAsync}
|
|
314
|
-
*/
|
|
315
297
|
public runTransactionAsync(
|
|
316
298
|
transaction: () => Promise<VoidTransactionCallbackStatus | void>,
|
|
317
299
|
params?: RunTransactionParams,
|
|
@@ -324,66 +306,21 @@ export class SchematizingSimpleTreeView<
|
|
|
324
306
|
>,
|
|
325
307
|
params: RunTransactionParams | undefined,
|
|
326
308
|
): Promise<TransactionResultExt<TSuccessValue, TFailureValue> | TransactionResult> {
|
|
327
|
-
this.mountTransaction(params, true);
|
|
328
|
-
const transactionCallbackStatus = await transaction();
|
|
329
|
-
return this.unmountTransaction(transactionCallbackStatus, params);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
private mountTransaction(params: RunTransactionParams | undefined, isAsync: boolean): void {
|
|
333
309
|
this.ensureUndisposed();
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
throw
|
|
337
|
-
|
|
310
|
+
if (this.checkout.transaction.size > 0) {
|
|
311
|
+
// breaker.break() sets brokenBy synchronously before throwing.
|
|
312
|
+
// A plain `throw` inside an async function would be captured as a rejected Promise
|
|
313
|
+
// before @breakingClass could set brokenBy. By setting it here first, the
|
|
314
|
+
// subsequent call to unmountTransaction (also @breakingClass-wrapped) will see the
|
|
315
|
+
// broken state and throw synchronously, propagating out of the outer runTransaction
|
|
316
|
+
// to its caller.
|
|
317
|
+
this.breaker.break(
|
|
318
|
+
new UsageError(
|
|
319
|
+
"An asynchronous transaction cannot be started while another transaction is already in progress.",
|
|
320
|
+
),
|
|
338
321
|
);
|
|
339
322
|
}
|
|
340
|
-
checkout.
|
|
341
|
-
checkout.transaction.start();
|
|
342
|
-
|
|
343
|
-
// Validate preconditions before running the transaction callback.
|
|
344
|
-
addConstraintsToTransaction(
|
|
345
|
-
checkout,
|
|
346
|
-
false /* constraintsOnRevert */,
|
|
347
|
-
params?.preconditions,
|
|
348
|
-
);
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
private unmountTransaction<TSuccessValue, TFailureValue>(
|
|
352
|
-
transactionCallbackStatus:
|
|
353
|
-
| TransactionCallbackStatus<TSuccessValue, TFailureValue>
|
|
354
|
-
| VoidTransactionCallbackStatus
|
|
355
|
-
| void,
|
|
356
|
-
params: RunTransactionParams | undefined,
|
|
357
|
-
): TransactionResultExt<TSuccessValue, TFailureValue> | TransactionResult {
|
|
358
|
-
this.ensureUndisposed();
|
|
359
|
-
const { checkout } = this;
|
|
360
|
-
const rollback = transactionCallbackStatus?.rollback;
|
|
361
|
-
const value = (
|
|
362
|
-
transactionCallbackStatus as TransactionCallbackStatus<TSuccessValue, TFailureValue>
|
|
363
|
-
)?.value;
|
|
364
|
-
|
|
365
|
-
if (rollback === true) {
|
|
366
|
-
checkout.popLabelFrame(true);
|
|
367
|
-
checkout.transaction.abort();
|
|
368
|
-
return value === undefined
|
|
369
|
-
? { success: false }
|
|
370
|
-
: { success: false, value: value as TFailureValue };
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
// Validate preconditions on revert after running the transaction callback and was successful.
|
|
374
|
-
addConstraintsToTransaction(
|
|
375
|
-
checkout,
|
|
376
|
-
true /* constraintsOnRevert */,
|
|
377
|
-
transactionCallbackStatus?.preconditionsOnRevert,
|
|
378
|
-
);
|
|
379
|
-
|
|
380
|
-
checkout.popLabelFrame(false);
|
|
381
|
-
checkout.runWithTransactionLabel(() => {
|
|
382
|
-
checkout.transaction.commit();
|
|
383
|
-
}, params?.label);
|
|
384
|
-
return value === undefined
|
|
385
|
-
? { success: true }
|
|
386
|
-
: { success: true, value: value as TSuccessValue };
|
|
323
|
+
return this.checkout.runTransactionAsync(transaction, params);
|
|
387
324
|
}
|
|
388
325
|
|
|
389
326
|
private ensureUndisposed(): void {
|
|
@@ -581,99 +518,16 @@ export class SchematizingSimpleTreeView<
|
|
|
581
518
|
|
|
582
519
|
public fork(): ReturnType<TreeBranchAlpha["fork"]> &
|
|
583
520
|
SchematizingSimpleTreeView<TRootSchema> {
|
|
584
|
-
return this.checkout.
|
|
521
|
+
return this.checkout.fork().viewWith(this.config);
|
|
585
522
|
}
|
|
586
523
|
|
|
587
524
|
public merge(context: TreeBranchAlpha, disposeMerged = true): void {
|
|
588
|
-
this.checkout.merge(
|
|
525
|
+
this.checkout.merge(context, disposeMerged);
|
|
589
526
|
}
|
|
590
527
|
|
|
591
528
|
public rebaseOnto(context: TreeBranchAlpha): void {
|
|
592
|
-
|
|
529
|
+
this.checkout.rebaseOnto(context);
|
|
593
530
|
}
|
|
594
531
|
|
|
595
532
|
// #endregion Branching
|
|
596
533
|
}
|
|
597
|
-
|
|
598
|
-
/**
|
|
599
|
-
* Get the {@link TreeCheckout} associated with a given {@link TreeBranch}.
|
|
600
|
-
* @remarks Currently, all contexts are also {@link SchematizingSimpleTreeView}s.
|
|
601
|
-
* Other checkout implementations (e.g. not associated with a view) may be supported in the future.
|
|
602
|
-
*/
|
|
603
|
-
export function getCheckout(context: TreeBranch): TreeCheckout {
|
|
604
|
-
if (context instanceof SchematizingSimpleTreeView) {
|
|
605
|
-
return context.checkout;
|
|
606
|
-
}
|
|
607
|
-
throw new UsageError("Unsupported context implementation");
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
/**
|
|
611
|
-
* Adds constraints to a `checkout`'s pending transaction.
|
|
612
|
-
*
|
|
613
|
-
* @param checkout - The checkout's who's transaction will have the constraints added to it.
|
|
614
|
-
* @param constraintsOnRevert - If true, use {@link ISharedTreeEditor.addNodeExistsConstraintOnRevert}.
|
|
615
|
-
* @param constraints - The constraints to add to the transaction.
|
|
616
|
-
*
|
|
617
|
-
* @see {@link RunTransactionParams.preconditions}.
|
|
618
|
-
*/
|
|
619
|
-
export function addConstraintsToTransaction(
|
|
620
|
-
checkout: ITreeCheckout,
|
|
621
|
-
constraintsOnRevert: boolean,
|
|
622
|
-
constraints: readonly TransactionConstraintAlpha[] = [],
|
|
623
|
-
): void {
|
|
624
|
-
for (const constraint of constraints) {
|
|
625
|
-
assertValidConstraint(constraint, constraintsOnRevert);
|
|
626
|
-
const constraintType = constraint.type;
|
|
627
|
-
switch (constraintType) {
|
|
628
|
-
case "nodeInDocument": {
|
|
629
|
-
const node = getInnerNode(constraint.node);
|
|
630
|
-
assert(node.isHydrated(), 0xbc2 /* In document node must be hydrated. */);
|
|
631
|
-
if (constraintsOnRevert) {
|
|
632
|
-
checkout.editor.addNodeExistsConstraintOnRevert(node.anchorNode);
|
|
633
|
-
} else {
|
|
634
|
-
checkout.editor.addNodeExistsConstraint(node.anchorNode);
|
|
635
|
-
}
|
|
636
|
-
break;
|
|
637
|
-
}
|
|
638
|
-
case "noChange": {
|
|
639
|
-
if (constraintsOnRevert) {
|
|
640
|
-
checkout.editor.addNoChangeConstraintOnRevert();
|
|
641
|
-
} else {
|
|
642
|
-
checkout.editor.addNoChangeConstraint();
|
|
643
|
-
}
|
|
644
|
-
break;
|
|
645
|
-
}
|
|
646
|
-
default: {
|
|
647
|
-
unreachableCase(constraintType);
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
/**
|
|
654
|
-
* Throws if the given {@link TransactionConstraintAlpha | transaction constraint} is not currently satisfied.
|
|
655
|
-
*/
|
|
656
|
-
export function assertValidConstraint(
|
|
657
|
-
constraint: TransactionConstraintAlpha,
|
|
658
|
-
onRevert: boolean,
|
|
659
|
-
): void {
|
|
660
|
-
switch (constraint.type) {
|
|
661
|
-
case "nodeInDocument": {
|
|
662
|
-
const nodeStatus = getKernel(constraint.node).getStatus();
|
|
663
|
-
if (nodeStatus !== TreeStatus.InDocument) {
|
|
664
|
-
const revertText = onRevert ? " on revert" : "";
|
|
665
|
-
throw new UsageError(
|
|
666
|
-
`Attempted to add a "nodeInDocument" constraint${revertText}, but the node is not currently in the document. Node status: ${nodeStatus}`,
|
|
667
|
-
);
|
|
668
|
-
}
|
|
669
|
-
break;
|
|
670
|
-
}
|
|
671
|
-
case "noChange": {
|
|
672
|
-
// This constraint is always satisfied at the time of checking, since it just requires that no changes have been made since the transaction callback returned.
|
|
673
|
-
break;
|
|
674
|
-
}
|
|
675
|
-
default: {
|
|
676
|
-
unreachableCase(constraint);
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
}
|