@fluidframework/tree 2.74.0 → 2.81.0-374083
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 +18 -0
- package/api-report/tree.alpha.api.md +63 -9
- package/dist/alpha.d.ts +9 -0
- package/dist/codec/codec.d.ts +31 -3
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +10 -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 -2
- package/dist/codec/index.js.map +1 -1
- package/dist/codec/versioned/codec.d.ts +80 -22
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js +137 -15
- 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 -2
- package/dist/codec/versioned/index.js.map +1 -1
- package/dist/core/change-family/changeFamily.d.ts +4 -1
- package/dist/core/change-family/changeFamily.d.ts.map +1 -1
- package/dist/core/change-family/changeFamily.js.map +1 -1
- package/dist/core/change-family/index.d.ts +1 -1
- package/dist/core/change-family/index.d.ts.map +1 -1
- package/dist/core/change-family/index.js.map +1 -1
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +7 -6
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/changeRebaser.d.ts +42 -3
- package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
- package/dist/core/rebase/changeRebaser.js.map +1 -1
- package/dist/core/rebase/index.d.ts +2 -2
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js +2 -2
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +52 -10
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +5 -12
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/rebase/utils.d.ts.map +1 -1
- package/dist/core/rebase/utils.js +33 -11
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/schema-stored/schema.js +3 -3
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +4 -4
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts +7 -2
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +21 -56
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +18 -10
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.js +6 -6
- package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts +2 -3
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.js +4 -5
- package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.d.ts +2 -3
- package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.js +4 -6
- package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts +5 -6
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.js +11 -41
- 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 +5 -4
- package/dist/core/tree/index.js.map +1 -1
- package/dist/core/tree/mapTree.js +1 -1
- package/dist/core/tree/mapTree.js.map +1 -1
- package/dist/core/tree/pathTree.d.ts +11 -3
- package/dist/core/tree/pathTree.d.ts.map +1 -1
- package/dist/core/tree/pathTree.js +14 -2
- package/dist/core/tree/pathTree.js.map +1 -1
- package/dist/core/tree/sparseTree.d.ts.map +1 -1
- package/dist/core/tree/sparseTree.js +1 -0
- package/dist/core/tree/sparseTree.js.map +1 -1
- package/dist/core/tree/treeTextFormat.d.ts.map +1 -1
- package/dist/core/tree/treeTextFormat.js +5 -9
- package/dist/core/tree/treeTextFormat.js.map +1 -1
- package/dist/core/tree/visitDelta.d.ts.map +1 -1
- package/dist/core/tree/visitDelta.js +3 -2
- 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 +58 -18
- package/dist/core/tree/visitorUtils.js.map +1 -1
- package/dist/feature-libraries/changeAtomIdBTree.d.ts +16 -0
- package/dist/feature-libraries/changeAtomIdBTree.d.ts.map +1 -0
- package/dist/feature-libraries/changeAtomIdBTree.js +30 -0
- package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js +8 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +4 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +9 -7
- package/dist/feature-libraries/chunked-forest/chunkedForest.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 +7 -4
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +19 -11
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -3
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +9 -5
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +103 -44
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +251 -77
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +22 -3
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +2 -1
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js +5 -2
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +38 -0
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js +132 -0
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
- package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +9 -6
- package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js +21 -0
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
- package/dist/feature-libraries/deltaUtils.d.ts +1 -0
- package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
- package/dist/feature-libraries/deltaUtils.js +6 -1
- package/dist/feature-libraries/deltaUtils.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +9 -0
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +6 -0
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +8 -7
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +44 -15
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +3 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +5 -4
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +15 -8
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.js +6 -6
- package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.js +1 -0
- package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.js +12 -3
- package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +12 -9
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js +4 -7
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +25 -0
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js +59 -0
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -0
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +22 -53
- 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 +7 -13
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js +2 -2
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +7 -5
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +12 -8
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +32 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +409 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +15 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +31 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV3.d.ts +15 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV3.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV3.js +393 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV3.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +32 -288
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +60 -26
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1519 -615
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/{lib/feature-libraries/modular-schema/modularChangeFormat.d.ts → dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts} +5 -6
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +7 -7
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +112 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +21 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV3.d.ts +146 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV3.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV3.js +32 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV3.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +59 -13
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js +3 -3
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -1
- package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +7 -5
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/optional-field/index.d.ts +2 -2
- package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/index.js +1 -2
- package/dist/feature-libraries/optional-field/index.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.d.ts +5 -26
- package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.js +223 -450
- package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +23 -0
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +1 -0
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +31 -0
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +1 -0
- package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
- package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +57 -28
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +12 -0
- package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +1 -0
- package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js +57 -0
- package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js.map +1 -0
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +5 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +14 -2
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts +7 -21
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +28 -70
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/index.d.ts +2 -2
- package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/index.js +2 -5
- package/dist/feature-libraries/schema-index/index.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +1 -9
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +1 -12
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/schemaChecker.js +11 -6
- package/dist/feature-libraries/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.d.ts +6 -7
- package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +91 -263
- package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
- package/dist/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
- package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
- package/dist/feature-libraries/sequence-field/index.d.ts +2 -3
- package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/index.js +1 -3
- package/dist/feature-libraries/sequence-field/index.js.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.d.ts +3 -3
- package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.js +67 -168
- package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
- package/dist/feature-libraries/sequence-field/markQueue.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
- package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/moveEffectTable.js +10 -87
- package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -3
- package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.js +120 -119
- package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.js +35 -43
- package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +0 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +365 -179
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +20 -60
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +20 -112
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/dist/feature-libraries/sequence-field/types.d.ts +30 -59
- package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/types.js.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.d.ts +15 -24
- package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.js +148 -318
- package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.js +7 -7
- package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
- package/dist/feature-libraries/treeTextCursor.js +2 -2
- package/dist/feature-libraries/treeTextCursor.js.map +1 -1
- package/dist/feature-libraries/valueUtilities.d.ts.map +1 -1
- package/dist/feature-libraries/valueUtilities.js +16 -8
- package/dist/feature-libraries/valueUtilities.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +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.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts +4 -4
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +2 -1
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +3 -8
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +58 -44
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +9 -3
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +72 -44
- 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 +10 -8
- 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 +5 -3
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +7 -6
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +29 -18
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js +14 -7
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +35 -29
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +21 -23
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +11 -10
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +93 -25
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +6 -3
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +13 -6
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.js +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts +2 -2
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +21 -15
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts +4 -0
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +18 -5
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +2 -0
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +12 -0
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.js +2 -0
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +3 -3
- package/dist/shared-tree-core/editManagerSummarizer.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 -1
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js +2 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts +4 -0
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +17 -5
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +2 -0
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormat.js +12 -0
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js +9 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
- package/dist/shared-tree-core/sequenceIdUtils.js +4 -4
- package/dist/shared-tree-core/sequenceIdUtils.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +1 -0
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +13 -9
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts +25 -8
- package/dist/shared-tree-core/transaction.d.ts.map +1 -1
- package/dist/shared-tree-core/transaction.js +65 -30
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.d.ts +2 -2
- package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.js +3 -3
- package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
- package/dist/simple-tree/api/configuration.js +1 -1
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/customTree.d.ts.map +1 -1
- package/dist/simple-tree/api/customTree.js +13 -9
- package/dist/simple-tree/api/customTree.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/dist/simple-tree/api/discrepancies.js +21 -17
- package/dist/simple-tree/api/discrepancies.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +2 -2
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +2 -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 +12 -8
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.js +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +18 -9
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.js +10 -5
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +19 -15
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.js +10 -10
- package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +244 -0
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +297 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +2 -3
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/transactionTypes.d.ts +17 -4
- package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/transactionTypes.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +3 -1
- 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/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +21 -13
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +14 -9
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +12 -5
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +79 -23
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/fieldSchema.d.ts +4 -4
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/fieldSchema.js.map +1 -1
- package/dist/simple-tree/getTreeNodeForField.d.ts.map +1 -1
- package/dist/simple-tree/getTreeNodeForField.js +2 -1
- package/dist/simple-tree/getTreeNodeForField.js.map +1 -1
- package/dist/simple-tree/index.d.ts +3 -3
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +4 -3
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +9 -6
- 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 +22 -20
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/common.js +1 -1
- package/dist/simple-tree/node-kinds/common.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +2 -2
- 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 +21 -22
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.js +6 -5
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/prepareForInsertion.d.ts +54 -47
- package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/dist/simple-tree/prepareForInsertion.js +184 -126
- package/dist/simple-tree/prepareForInsertion.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +9 -5
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +31 -13
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/dist/text/index.d.ts +6 -0
- package/dist/text/index.d.ts.map +1 -0
- package/dist/text/index.js +10 -0
- package/dist/text/index.js.map +1 -0
- package/dist/text/textDomain.d.ts +138 -0
- package/dist/text/textDomain.d.ts.map +1 -0
- package/dist/text/textDomain.js +121 -0
- package/dist/text/textDomain.js.map +1 -0
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +17 -3
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/bTreeUtils.d.ts +12 -4
- package/dist/util/bTreeUtils.d.ts.map +1 -1
- package/dist/util/bTreeUtils.js +15 -19
- package/dist/util/bTreeUtils.js.map +1 -1
- package/dist/util/breakable.js +7 -9
- package/dist/util/breakable.js.map +1 -1
- package/dist/util/idAllocator.d.ts.map +1 -1
- package/dist/util/idAllocator.js +1 -2
- package/dist/util/idAllocator.js.map +1 -1
- package/dist/util/index.d.ts +1 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +2 -1
- package/dist/util/index.js.map +1 -1
- package/dist/util/nestedMap.d.ts.map +1 -1
- package/dist/util/nestedMap.js +13 -13
- package/dist/util/nestedMap.js.map +1 -1
- package/dist/util/rangeMap.d.ts +24 -12
- package/dist/util/rangeMap.d.ts.map +1 -1
- package/dist/util/rangeMap.js +46 -6
- package/dist/util/rangeMap.js.map +1 -1
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +16 -15
- package/dist/util/utils.js.map +1 -1
- package/docs/user-facing/merge-semantics.md +3 -2
- package/eslint.config.mts +5 -48
- package/lib/alpha.d.ts +9 -0
- package/lib/codec/codec.d.ts +31 -3
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +10 -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 +80 -22
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js +138 -15
- 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/change-family/changeFamily.d.ts +4 -1
- package/lib/core/change-family/changeFamily.d.ts.map +1 -1
- package/lib/core/change-family/changeFamily.js.map +1 -1
- package/lib/core/change-family/index.d.ts +1 -1
- package/lib/core/change-family/index.d.ts.map +1 -1
- package/lib/core/change-family/index.js.map +1 -1
- package/lib/core/index.d.ts +3 -3
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +2 -2
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/changeRebaser.d.ts +42 -3
- package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
- package/lib/core/rebase/changeRebaser.js.map +1 -1
- package/lib/core/rebase/index.d.ts +2 -2
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +52 -10
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +3 -10
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/rebase/utils.d.ts.map +1 -1
- package/lib/core/rebase/utils.js +33 -11
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/schema-stored/schema.js +3 -3
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +4 -4
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts +7 -2
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +23 -58
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +18 -10
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.js +4 -4
- package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts +2 -3
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.js +4 -5
- package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV2.d.ts +2 -3
- package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV2.js +4 -6
- package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts +5 -6
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.js +12 -39
- 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/mapTree.js +1 -1
- package/lib/core/tree/mapTree.js.map +1 -1
- package/lib/core/tree/pathTree.d.ts +11 -3
- package/lib/core/tree/pathTree.d.ts.map +1 -1
- package/lib/core/tree/pathTree.js +12 -1
- package/lib/core/tree/pathTree.js.map +1 -1
- package/lib/core/tree/sparseTree.d.ts.map +1 -1
- package/lib/core/tree/sparseTree.js +1 -0
- package/lib/core/tree/sparseTree.js.map +1 -1
- package/lib/core/tree/treeTextFormat.d.ts.map +1 -1
- package/lib/core/tree/treeTextFormat.js +5 -9
- package/lib/core/tree/treeTextFormat.js.map +1 -1
- package/lib/core/tree/visitDelta.d.ts.map +1 -1
- package/lib/core/tree/visitDelta.js +3 -2
- 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 +58 -18
- package/lib/core/tree/visitorUtils.js.map +1 -1
- package/lib/feature-libraries/changeAtomIdBTree.d.ts +16 -0
- package/lib/feature-libraries/changeAtomIdBTree.d.ts.map +1 -0
- package/lib/feature-libraries/changeAtomIdBTree.js +24 -0
- package/lib/feature-libraries/changeAtomIdBTree.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js +9 -2
- package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +4 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +9 -7
- package/lib/feature-libraries/chunked-forest/chunkedForest.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 +7 -4
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +19 -11
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -3
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +9 -5
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +103 -44
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +249 -78
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +22 -3
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +2 -1
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js +2 -1
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +38 -0
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js +128 -0
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
- package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +9 -6
- package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js +21 -0
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
- package/lib/feature-libraries/deltaUtils.d.ts +1 -0
- package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
- package/lib/feature-libraries/deltaUtils.js +5 -1
- package/lib/feature-libraries/deltaUtils.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +9 -0
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +6 -0
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +8 -7
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +45 -16
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +3 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +5 -4
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +5 -4
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.js +6 -6
- package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.js +2 -1
- package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.js +12 -3
- package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +12 -9
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js +3 -5
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +25 -0
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js +55 -0
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -0
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +22 -53
- 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 +8 -14
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +7 -5
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +5 -3
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +32 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +402 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +15 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +27 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV3.d.ts +15 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV3.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV3.js +389 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV3.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +34 -290
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +60 -26
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1441 -546
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/{dist/feature-libraries/modular-schema/modularChangeFormat.d.ts → lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts} +5 -6
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +4 -4
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +112 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +18 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV3.d.ts +146 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV3.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV3.js +29 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV3.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +59 -13
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.js +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -1
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +7 -5
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/optional-field/index.d.ts +2 -2
- package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/index.js +1 -1
- package/lib/feature-libraries/optional-field/index.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.d.ts +5 -26
- package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.js +223 -448
- package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +23 -0
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +1 -0
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +27 -0
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +1 -0
- package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
- package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +55 -26
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +12 -0
- package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +1 -0
- package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js +53 -0
- package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js.map +1 -0
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +5 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +15 -3
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts +7 -21
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +30 -68
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/index.d.ts +2 -2
- package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/index.js +2 -2
- package/lib/feature-libraries/schema-index/index.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +1 -9
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +0 -10
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/schemaChecker.js +11 -6
- package/lib/feature-libraries/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.d.ts +6 -7
- package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +93 -265
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
- package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
- package/lib/feature-libraries/sequence-field/index.d.ts +2 -3
- package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/index.js +0 -1
- package/lib/feature-libraries/sequence-field/index.js.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.js +69 -170
- package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
- package/lib/feature-libraries/sequence-field/markQueue.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
- package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/moveEffectTable.js +9 -81
- package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.js +122 -121
- package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.js +36 -44
- package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +0 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +356 -174
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +21 -61
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +20 -112
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/lib/feature-libraries/sequence-field/types.d.ts +30 -59
- package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/types.js.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.d.ts +15 -24
- package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.js +144 -311
- package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.js +7 -7
- package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
- package/lib/feature-libraries/treeTextCursor.js +2 -2
- package/lib/feature-libraries/treeTextCursor.js.map +1 -1
- package/lib/feature-libraries/valueUtilities.d.ts.map +1 -1
- package/lib/feature-libraries/valueUtilities.js +16 -8
- package/lib/feature-libraries/valueUtilities.js.map +1 -1
- package/lib/index.d.ts +4 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +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.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts +4 -4
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +3 -2
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +3 -8
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +61 -47
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +9 -3
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +41 -13
- 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 +10 -8
- 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 +6 -4
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +7 -6
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +30 -19
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js +12 -6
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +35 -29
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +21 -23
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +11 -10
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +97 -29
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +6 -3
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +13 -6
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.js +2 -2
- package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts +2 -2
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +21 -15
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts +4 -0
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +16 -4
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +2 -0
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +12 -0
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.js +2 -0
- package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +3 -3
- package/lib/shared-tree-core/editManagerSummarizer.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/messageCodecV1ToV4.d.ts +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.js +2 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts +4 -0
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +15 -4
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +2 -0
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormat.js +12 -0
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js +9 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
- package/lib/shared-tree-core/sequenceIdUtils.js +4 -4
- package/lib/shared-tree-core/sequenceIdUtils.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +1 -0
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +13 -9
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts +25 -8
- package/lib/shared-tree-core/transaction.d.ts.map +1 -1
- package/lib/shared-tree-core/transaction.js +67 -32
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.d.ts +2 -2
- package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.js +3 -3
- package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
- package/lib/simple-tree/api/configuration.js +1 -1
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/customTree.d.ts.map +1 -1
- package/lib/simple-tree/api/customTree.js +13 -9
- package/lib/simple-tree/api/customTree.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/lib/simple-tree/api/discrepancies.js +21 -17
- package/lib/simple-tree/api/discrepancies.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +2 -2
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +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 +12 -8
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.js +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +18 -9
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaCodec.js +10 -5
- package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +19 -15
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/simpleTreeIndex.js +10 -10
- package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +244 -0
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js +270 -0
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +4 -7
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/transactionTypes.d.ts +17 -4
- package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/transactionTypes.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +3 -1
- 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/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +21 -13
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +14 -9
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +12 -5
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +78 -23
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/fieldSchema.d.ts +4 -4
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/fieldSchema.js.map +1 -1
- package/lib/simple-tree/getTreeNodeForField.d.ts.map +1 -1
- package/lib/simple-tree/getTreeNodeForField.js +2 -1
- package/lib/simple-tree/getTreeNodeForField.js.map +1 -1
- package/lib/simple-tree/index.d.ts +3 -3
- 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.js +9 -6
- 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 +23 -21
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/common.js +2 -2
- package/lib/simple-tree/node-kinds/common.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
- 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 +22 -23
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.js +6 -5
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/prepareForInsertion.d.ts +54 -47
- package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/lib/simple-tree/prepareForInsertion.js +184 -125
- package/lib/simple-tree/prepareForInsertion.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +9 -5
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +28 -11
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/lib/text/index.d.ts +6 -0
- package/lib/text/index.d.ts.map +1 -0
- package/lib/text/index.js +6 -0
- package/lib/text/index.js.map +1 -0
- package/lib/text/textDomain.d.ts +138 -0
- package/lib/text/textDomain.d.ts.map +1 -0
- package/lib/text/textDomain.js +118 -0
- package/lib/text/textDomain.js.map +1 -0
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +18 -4
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/bTreeUtils.d.ts +12 -4
- package/lib/util/bTreeUtils.d.ts.map +1 -1
- package/lib/util/bTreeUtils.js +16 -20
- package/lib/util/bTreeUtils.js.map +1 -1
- package/lib/util/breakable.js +7 -9
- package/lib/util/breakable.js.map +1 -1
- package/lib/util/idAllocator.d.ts.map +1 -1
- package/lib/util/idAllocator.js +1 -2
- package/lib/util/idAllocator.js.map +1 -1
- package/lib/util/index.d.ts +1 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +1 -1
- package/lib/util/index.js.map +1 -1
- package/lib/util/nestedMap.d.ts.map +1 -1
- package/lib/util/nestedMap.js +13 -13
- package/lib/util/nestedMap.js.map +1 -1
- package/lib/util/rangeMap.d.ts +24 -12
- package/lib/util/rangeMap.d.ts.map +1 -1
- package/lib/util/rangeMap.js +44 -5
- package/lib/util/rangeMap.js.map +1 -1
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js +16 -15
- package/lib/util/utils.js.map +1 -1
- package/package.json +33 -33
- package/src/codec/codec.ts +48 -8
- package/src/codec/index.ts +4 -1
- package/src/codec/versioned/codec.ts +340 -22
- package/src/codec/versioned/index.ts +3 -1
- package/src/core/change-family/changeFamily.ts +5 -0
- package/src/core/change-family/index.ts +1 -0
- package/src/core/index.ts +8 -3
- package/src/core/rebase/changeRebaser.ts +46 -7
- package/src/core/rebase/index.ts +4 -1
- package/src/core/rebase/types.ts +71 -39
- package/src/core/rebase/utils.ts +42 -14
- package/src/core/schema-stored/schema.ts +3 -3
- package/src/core/tree/anchorSet.ts +4 -4
- package/src/core/tree/detachedFieldIndex.ts +29 -74
- package/src/core/tree/detachedFieldIndexCodecCommon.ts +4 -8
- package/src/core/tree/detachedFieldIndexCodecV1.ts +3 -7
- package/src/core/tree/detachedFieldIndexCodecV2.ts +5 -9
- package/src/core/tree/detachedFieldIndexCodecs.ts +21 -64
- package/src/core/tree/index.ts +3 -2
- package/src/core/tree/mapTree.ts +1 -1
- package/src/core/tree/pathTree.ts +16 -4
- package/src/core/tree/sparseTree.ts +1 -0
- package/src/core/tree/treeTextFormat.ts +5 -9
- package/src/core/tree/visitDelta.ts +6 -2
- package/src/core/tree/visitorUtils.ts +55 -19
- package/src/feature-libraries/changeAtomIdBTree.ts +56 -0
- package/src/feature-libraries/chunked-forest/basicChunk.ts +8 -2
- package/src/feature-libraries/chunked-forest/chunkTree.ts +6 -1
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +8 -6
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +7 -4
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +19 -11
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +4 -3
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -5
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +1 -1
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +442 -139
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +24 -6
- package/src/feature-libraries/default-schema/index.ts +17 -5
- package/src/feature-libraries/default-schema/locationBasedEditBuilder.ts +188 -0
- package/src/feature-libraries/default-schema/mappedEditBuilder.ts +41 -9
- package/src/feature-libraries/deltaUtils.ts +6 -1
- package/src/feature-libraries/flex-tree/context.ts +17 -0
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +7 -8
- package/src/feature-libraries/flex-tree/lazyField.ts +72 -30
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +3 -1
- package/src/feature-libraries/index.ts +32 -13
- package/src/feature-libraries/indexing/anchorTreeIndex.ts +5 -5
- package/src/feature-libraries/mapTreeCursor.ts +2 -1
- package/src/feature-libraries/mitigatedChangeFamily.ts +14 -7
- package/src/feature-libraries/modular-schema/comparison.ts +12 -9
- package/src/feature-libraries/modular-schema/crossFieldQueries.ts +142 -44
- package/src/feature-libraries/modular-schema/defaultRevisionReplacer.ts +70 -0
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +35 -64
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +11 -25
- package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +1 -1
- package/src/feature-libraries/modular-schema/index.ts +20 -16
- package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +912 -0
- package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +89 -0
- package/src/feature-libraries/modular-schema/modularChangeCodecV3.ts +760 -0
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +52 -523
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +2756 -884
- package/src/feature-libraries/modular-schema/{modularChangeFormat.ts → modularChangeFormatV1.ts} +5 -4
- package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +34 -0
- package/src/feature-libraries/modular-schema/modularChangeFormatV3.ts +62 -0
- package/src/feature-libraries/modular-schema/modularChangeTypes.ts +70 -14
- package/src/feature-libraries/node-identifier/mockNodeIdentifierManager.ts +1 -1
- package/src/feature-libraries/object-forest/objectForest.ts +7 -5
- package/src/feature-libraries/optional-field/index.ts +1 -3
- package/src/feature-libraries/optional-field/optionalField.ts +320 -576
- package/src/feature-libraries/optional-field/optionalFieldChangeFormatV3.ts +45 -0
- package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +24 -38
- package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +89 -35
- package/src/feature-libraries/optional-field/optionalFieldCodecV3.ts +94 -0
- package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +5 -1
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +18 -3
- package/src/feature-libraries/schema-index/codec.ts +30 -90
- package/src/feature-libraries/schema-index/index.ts +2 -4
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +0 -17
- package/src/feature-libraries/schemaChecker.ts +11 -6
- package/src/feature-libraries/sequence-field/compose.ts +147 -526
- package/src/feature-libraries/sequence-field/helperTypes.ts +34 -19
- package/src/feature-libraries/sequence-field/index.ts +0 -9
- package/src/feature-libraries/sequence-field/invert.ts +103 -227
- package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
- package/src/feature-libraries/sequence-field/moveEffectTable.ts +11 -192
- package/src/feature-libraries/sequence-field/rebase.ts +182 -210
- package/src/feature-libraries/sequence-field/replaceRevisions.ts +54 -80
- package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +0 -2
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +648 -220
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +56 -68
- package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +25 -27
- package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +25 -132
- package/src/feature-libraries/sequence-field/types.ts +34 -64
- package/src/feature-libraries/sequence-field/utils.ts +171 -366
- package/src/feature-libraries/treeCursorUtils.ts +7 -7
- package/src/feature-libraries/treeTextCursor.ts +2 -2
- package/src/feature-libraries/valueUtilities.ts +16 -8
- package/src/index.ts +11 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/index.ts +3 -2
- package/src/shared-tree/schematizeTree.ts +21 -8
- package/src/shared-tree/schematizingTreeView.ts +79 -83
- package/src/shared-tree/sharedTree.ts +50 -17
- package/src/shared-tree/sharedTreeChangeCodecs.ts +14 -9
- package/src/shared-tree/sharedTreeChangeEnricher.ts +6 -2
- package/src/shared-tree/sharedTreeChangeFamily.ts +44 -24
- package/src/shared-tree/sharedTreeEditBuilder.ts +48 -13
- package/src/shared-tree/treeAlpha.ts +60 -51
- package/src/shared-tree/treeCheckout.ts +160 -73
- package/src/shared-tree-core/branch.ts +21 -6
- package/src/shared-tree-core/branchCommitEnricher.ts +3 -8
- package/src/shared-tree-core/editManager.ts +43 -29
- package/src/shared-tree-core/editManagerCodecs.ts +19 -4
- package/src/shared-tree-core/editManagerFormatCommons.ts +12 -0
- package/src/shared-tree-core/editManagerFormatV1toV4.ts +5 -1
- package/src/shared-tree-core/editManagerSummarizer.ts +3 -3
- package/src/shared-tree-core/index.ts +2 -0
- package/src/shared-tree-core/messageCodecV1ToV4.ts +3 -1
- package/src/shared-tree-core/messageCodecVSharedBranches.ts +2 -1
- package/src/shared-tree-core/messageCodecs.ts +18 -4
- package/src/shared-tree-core/messageFormat.ts +12 -1
- package/src/shared-tree-core/messageFormatV1ToV4.ts +18 -2
- package/src/shared-tree-core/sequenceIdUtils.ts +4 -4
- package/src/shared-tree-core/sharedTreeCore.ts +15 -8
- package/src/shared-tree-core/transaction.ts +115 -56
- package/src/shared-tree-core/transactionEnricher.ts +5 -6
- package/src/simple-tree/api/configuration.ts +1 -1
- package/src/simple-tree/api/customTree.ts +14 -10
- package/src/simple-tree/api/discrepancies.ts +23 -17
- package/src/simple-tree/api/index.ts +5 -0
- package/src/simple-tree/api/schemaFactory.ts +11 -7
- package/src/simple-tree/api/schemaFactoryAlpha.ts +1 -1
- package/src/simple-tree/api/schemaFactoryBeta.ts +1 -1
- package/src/simple-tree/api/schemaFromSimple.ts +18 -9
- package/src/simple-tree/api/simpleSchemaCodec.ts +10 -5
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +21 -17
- package/src/simple-tree/api/simpleTreeIndex.ts +8 -8
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +501 -0
- package/src/simple-tree/api/storedSchema.ts +10 -7
- package/src/simple-tree/api/transactionTypes.ts +19 -4
- package/src/simple-tree/api/tree.ts +3 -1
- package/src/simple-tree/api/treeNodeApi.ts +21 -13
- package/src/simple-tree/api/verboseTree.ts +14 -9
- package/src/simple-tree/core/treeNodeKernel.ts +12 -5
- package/src/simple-tree/core/unhydratedFlexTree.ts +109 -53
- package/src/simple-tree/fieldSchema.ts +6 -4
- package/src/simple-tree/getTreeNodeForField.ts +2 -1
- package/src/simple-tree/index.ts +7 -1
- package/src/simple-tree/leafNodeSchema.ts +8 -5
- package/src/simple-tree/node-kinds/array/arrayNode.ts +32 -30
- package/src/simple-tree/node-kinds/common.ts +2 -5
- package/src/simple-tree/node-kinds/map/mapNode.ts +4 -4
- package/src/simple-tree/node-kinds/object/objectNode.ts +29 -30
- package/src/simple-tree/node-kinds/record/recordNode.ts +12 -12
- package/src/simple-tree/prepareForInsertion.ts +343 -201
- package/src/simple-tree/toStoredSchema.ts +9 -5
- package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +43 -15
- package/src/text/README.md +8 -0
- package/src/text/index.ts +6 -0
- package/src/text/textDomain.ts +199 -0
- package/src/treeFactory.ts +20 -5
- package/src/util/bTreeUtils.ts +34 -23
- package/src/util/breakable.ts +9 -9
- package/src/util/idAllocator.ts +1 -2
- package/src/util/index.ts +3 -0
- package/src/util/nestedMap.ts +13 -15
- package/src/util/rangeMap.ts +72 -18
- package/src/util/utils.ts +14 -13
- package/.eslintrc.cjs +0 -140
- package/assertTagging.config.mjs +0 -14
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -50
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
- package/docs/main/sequence-field/move-composition.md +0 -46
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -46
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
- package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +0 -57
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAEpF,OAAO,EAKN,wBAAwB,EACxB,qBAAqB,EACrB,gBAAgB,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAgB,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC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A8B,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;gBACvD,GAAG,8BAA8B,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;aACvD,CAAC;QACH;YACC,OAAO,EAAE,CAAC;IACZ,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ChangeAtomId,\n\ttype ChangesetLocalId,\n\ttype RevisionMetadataSource,\n\ttype RevisionTag,\n\tareEqualChangeAtomIdOpts,\n\tareEqualChangeAtomIds,\n\tmakeChangeAtomId,\n} from \"../../core/index.js\";\nimport { type Mutable, brand } from \"../../util/index.js\";\nimport {\n\tCrossFieldTarget,\n\ttype NodeId,\n\ttype CrossFieldKeyRange,\n\ttype NestedChangesIndices,\n} from \"../modular-schema/index.js\";\n\nimport type {\n\tCellRename,\n\tDetachOfRemovedNodes,\n\tEmptyInputCellMark,\n\tMoveMarkEffect,\n} from \"./helperTypes.js\";\nimport {\n\ttype Attach,\n\ttype AttachAndDetach,\n\ttype CellId,\n\ttype CellMark,\n\ttype Changeset,\n\ttype Detach,\n\ttype DetachFields,\n\ttype HasRevisionTag,\n\ttype Insert,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype MoveIn,\n\ttype MoveOut,\n\ttype NoopMark,\n\tNoopMarkType,\n\ttype Remove,\n\ttype CellCount,\n\ttype Rename,\n} from \"./types.js\";\n\nexport function isEmpty(change: Changeset): boolean {\n\tfor (const mark of change) {\n\t\tif (mark.changes !== undefined || mark.type !== undefined) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nexport function createEmpty(): Changeset {\n\treturn [];\n}\n\nexport function getNestedChanges(change: Changeset): NestedChangesIndices {\n\tconst output: NestedChangesIndices = [];\n\tlet inputIndex = 0;\n\tlet outputIndex = 0;\n\tfor (const mark of change) {\n\t\tconst { changes, count } = mark;\n\t\tif (changes !== undefined) {\n\t\t\toutput.push([\n\t\t\t\tchanges,\n\t\t\t\t!areInputCellsEmpty(mark) ? inputIndex : undefined /* inputIndex */,\n\t\t\t\t!areOutputCellsEmpty(mark) ? outputIndex : undefined /* outputIndex */,\n\t\t\t]);\n\t\t}\n\t\tif (!areInputCellsEmpty(mark)) {\n\t\t\tinputIndex += count;\n\t\t}\n\n\t\tif (!areOutputCellsEmpty(mark)) {\n\t\t\toutputIndex += count;\n\t\t}\n\t}\n\treturn output;\n}\n\nexport function isNewAttach(mark: Mark, revision?: RevisionTag): boolean {\n\treturn isNewAttachEffect(mark, mark.cellId, revision);\n}\n\nexport function isNewAttachEffect(\n\teffect: MarkEffect,\n\tcellId: CellId | undefined,\n\trevision?: RevisionTag,\n): boolean {\n\treturn (\n\t\t(isAttach(effect) &&\n\t\t\tcellId !== undefined &&\n\t\t\t(effect.revision ?? revision) === (cellId.revision ?? revision)) ||\n\t\t(isAttachAndDetachEffect(effect) && isNewAttachEffect(effect.attach, cellId, revision))\n\t);\n}\n\nexport function isRename(mark: MarkEffect): mark is Rename {\n\treturn mark.type === \"Rename\";\n}\n\nexport function isInsert(mark: MarkEffect): mark is Insert {\n\treturn mark.type === \"Insert\";\n}\n\nexport function isAttach(effect: MarkEffect): effect is Attach {\n\treturn effect.type === \"Insert\" || effect.type === \"MoveIn\";\n}\n\nexport function isReattach(mark: Mark): boolean {\n\treturn isReattachEffect(mark, mark.cellId);\n}\n\nexport function isReattachEffect(effect: MarkEffect, cellId: CellId | undefined): boolean {\n\treturn isAttach(effect) && !isNewAttachEffect(effect, cellId);\n}\n\nexport function isActiveReattach(\n\tmark: Mark,\n): mark is CellMark<Insert> & { conflictsWith?: undefined } {\n\treturn isAttach(mark) && isReattachEffect(mark, mark.cellId) && mark.cellId !== undefined;\n}\n\nexport function areEqualCellIds(a: CellId | undefined, b: CellId | undefined): boolean {\n\treturn areEqualChangeAtomIdOpts(a, b);\n}\n\nexport function getInputCellId(mark: Mark): CellId | undefined {\n\treturn mark.cellId;\n}\n\nexport function getOutputCellId(mark: Mark): CellId | undefined {\n\tif (isDetach(mark) || isRename(mark)) {\n\t\treturn getDetachOutputCellId(mark);\n\t} else if (markFillsCells(mark)) {\n\t\treturn undefined;\n\t} else if (isAttachAndDetachEffect(mark)) {\n\t\treturn getDetachOutputCellId(mark.detach);\n\t}\n\n\treturn getInputCellId(mark);\n}\n\nexport function cellSourcesFromMarks(\n\tmarks: readonly Mark[],\n\tcontextGetter: typeof getInputCellId | typeof getOutputCellId,\n): Set<RevisionTag | undefined> {\n\tconst set = new Set<RevisionTag | undefined>();\n\tfor (const mark of marks) {\n\t\tconst cell = contextGetter(mark);\n\t\tif (cell !== undefined) {\n\t\t\tset.add(cell.revision);\n\t\t}\n\t}\n\treturn set;\n}\n\nexport enum CellOrder {\n\tSameCell,\n\tOldThenNew,\n\tNewThenOld,\n}\n\n/**\n * Determines the order of two cells from two changesets.\n *\n * This function makes the following assumptions:\n * 1. The cells represent the same context.\n * 2. `oldMarkCell` is from a mark in a changeset that is older than the changeset that contains the mark that\n * `newMarkCell` is from.\n * 3. In terms of sequence index, all cells located before A are also located before B,\n * and all cells located before B are also located before A.\n * 4. If a changeset has a mark/tombstone that describes a cell named in some revision R,\n * then that changeset must contain marks/tombstones for all cells named in R as well as all cells named in later\n * revisions up to its own.\n * 5. If a changeset foo is rebased over a changeset bar, then the rebased version of foo must contain tombstones or\n * marks for all cells referenced or named in bar. It has yet to be determined whether this assumption is necessary\n * for the logic below.\n *\n * @param oldMarkCell - The cell referenced or named by a mark or tombstone from the older changeset.\n * @param newMarkCell - The cell referenced or named by a mark or tombstone from the newer changeset.\n * @param oldChangeKnowledge - The set of revisions that the older changeset has cell representations for.\n * @param newChangeKnowledge - The set of revisions that the newer changeset has cell representations for.\n * @param metadata - Revision metadata for the operation being carried out.\n * @returns a {@link CellOrder} which describes how the cells are ordered relative to one-another.\n */\nexport function compareCellPositionsUsingTombstones(\n\toldMarkCell: ChangeAtomId,\n\tnewMarkCell: ChangeAtomId,\n\toldChangeKnowledge: ReadonlySet<RevisionTag | undefined>,\n\tnewChangeKnowledge: ReadonlySet<RevisionTag | undefined>,\n\tmetadata: RevisionMetadataSource,\n): CellOrder {\n\tif (areEqualChangeAtomIds(oldMarkCell, newMarkCell)) {\n\t\treturn CellOrder.SameCell;\n\t}\n\tconst oldChangeKnowsOfNewMarkCellRevision = oldChangeKnowledge.has(newMarkCell.revision);\n\tconst newChangeKnowsOfOldMarkCellRevision = newChangeKnowledge.has(oldMarkCell.revision);\n\tif (oldChangeKnowsOfNewMarkCellRevision && newChangeKnowsOfOldMarkCellRevision) {\n\t\t// If both changesets know of both cells, but we've been asked to compare different cells,\n\t\t// Then either the changesets they originate from do not represent the same context,\n\t\t// or the ordering of their cells in inconsistent.\n\t\t// The only exception to this is when we're composing anonymous changesets in a transaction.\n\t\tassert(\n\t\t\toldMarkCell.revision === undefined && newMarkCell.revision === undefined,\n\t\t\t0x8a0 /* Inconsistent cell ordering */,\n\t\t);\n\t\t// We are composing anonymous changesets in a transaction. The new changeset is creating a cell in a gap\n\t\t// where the old changeset knows of some now empty cell. We order the new cell relative to the old cell in a\n\t\t// way that is consistent with its tie-breaking behavior should the old cell be concurrently re-filled.\n\t\t// Since only tie-break left is supported at the moment, the new cell comes first.\n\t\treturn CellOrder.NewThenOld;\n\t}\n\tif (newChangeKnowsOfOldMarkCellRevision) {\n\t\t// The changeset that contains `newMarkCell` has tombstones for the revision that created `oldMarkCell`,\n\t\t// so a tombstone/mark matching `oldMarkCell` must occur later in the newer changeset.\n\t\treturn CellOrder.NewThenOld;\n\t} else if (oldChangeKnowsOfNewMarkCellRevision) {\n\t\t// The changeset that contains `oldMarkCell` has tombstones for revision that created `newMarkCell`,\n\t\t// so a tombstone/mark matching `newMarkCell` must occur later in the older changeset.\n\t\treturn CellOrder.OldThenNew;\n\t} else {\n\t\t// These cells are only ordered through tie-breaking.\n\t\t// Since tie-breaking is hard-coded to \"merge left\", the younger cell comes first.\n\n\t\t// In the context of compose, an undefined revision means we are composing anonymous changesets into\n\t\t// a transaction, which means the cell from the newer changeset is younger.\n\t\tif (newMarkCell.revision === undefined) {\n\t\t\treturn CellOrder.NewThenOld;\n\t\t}\n\t\t// The only case where the old mark cell should have no revision is when composing anonymous changesets\n\t\t// into a transaction, in which case the new mark cell should also have no revision, which is handled above.\n\t\t// In all other cases, the old mark cell should have a revision.\n\t\tassert(\n\t\t\toldMarkCell.revision !== undefined,\n\t\t\t0x8a1 /* Old mark cell should have a revision */,\n\t\t);\n\n\t\t// Note that these indices are for ordering the revisions in which the cells were named, not the revisions\n\t\t// of the changesets in which the marks targeting these cells appear.\n\t\tconst oldCellRevisionIndex = metadata.getIndex(oldMarkCell.revision);\n\t\tconst newCellRevisionIndex = metadata.getIndex(newMarkCell.revision);\n\n\t\t// If the metadata defines an ordering for the revisions then the cell from the newer revision comes first.\n\t\tif (newCellRevisionIndex !== undefined && oldCellRevisionIndex !== undefined) {\n\t\t\treturn newCellRevisionIndex > oldCellRevisionIndex\n\t\t\t\t? CellOrder.NewThenOld\n\t\t\t\t: CellOrder.OldThenNew;\n\t\t}\n\n\t\tif (newCellRevisionIndex === undefined && oldCellRevisionIndex === undefined) {\n\t\t\t// While it is possible for both marks to refer to cells that were named in revisions that are outside\n\t\t\t// the scope of the metadata, such a scenario should be handled above due to the fact that one of the two\n\t\t\t// changesets should have tombstones or marks for both cells.\n\t\t\t//\n\t\t\t// To see this in the context of rebase, we must consider the lowest common ancestor (LCA) of each change's\n\t\t\t// original (i.e., unrebased) edit with the head of the branch they will both reside on after the rebase.\n\t\t\t// ...─(Ti)─...─(Tj)─...─(old')─(new') <- branch both change will reside on after rebase\n\t\t\t// | └─...─(new)\n\t\t\t// └─...─(old)\n\t\t\t// In the diagram above we can see that by the time `new` is being rebased over `old`, both changesets have\n\t\t\t// been rebased over, and therefore have cell information for, changes `Tj` onwards. This means that one of\n\t\t\t// The two changesets (the `old` one in the diagram above) will have tombstones or marks for any cells that\n\t\t\t// `new` refers to so long as those cells were not created on `new`'s branch.\n\t\t\t// Note that the change that contains the superset of cells (again, ignoring cells created on the other\n\t\t\t// change's branch) is not always the older change. Consider the following scenario:\n\t\t\t// ...─(Ti)─...─(Tj)─...─(old')─(new')\n\t\t\t// | └─...─(old)\n\t\t\t// └─...─(new)\n\t\t\t//\n\t\t\t// The same scenario can arise in the context of compose (just consider composing `old'` and `new'` from\n\t\t\t// the examples above) with the same resolution.\n\t\t\tassert(false, 0x8a2 /* Invalid cell ordering scenario */);\n\t\t}\n\n\t\t// The absence of metadata for a cell with a defined revision means that the cell is from a revision that\n\t\t// predates the edits that are within the scope of the metadata. Such a cell is therefore older than the one\n\t\t// for which we do have metadata.\n\t\treturn oldCellRevisionIndex === undefined ? CellOrder.NewThenOld : CellOrder.OldThenNew;\n\t}\n}\n\n/**\n * Gets the ID of the cell in the output context of the given detach `mark`.\n */\nexport function getDetachOutputCellId(mark: Detach | Rename): ChangeAtomId {\n\tif (isRename(mark)) {\n\t\treturn mark.idOverride;\n\t}\n\tif (mark.idOverride !== undefined) {\n\t\treturn mark.idOverride;\n\t}\n\treturn mark.revision === undefined\n\t\t? { localId: mark.id }\n\t\t: { revision: mark.revision, localId: mark.id };\n}\n\n/**\n * Gets the ID of the detached node in the output context of the given detach `mark`.\n */\nexport function getDetachedNodeId(mark: Detach | Rename): ChangeAtomId {\n\tswitch (mark.type) {\n\t\tcase \"Rename\":\n\t\tcase \"Remove\": {\n\t\t\treturn getDetachOutputCellId(mark);\n\t\t}\n\t\tcase \"MoveOut\": {\n\t\t\treturn makeChangeAtomId(mark.id, mark.revision);\n\t\t}\n\t\tdefault:\n\t\t\tunreachableCase(mark);\n\t}\n}\n\n/**\n * Preserves the semantics of the given `mark` but repackages it into a `DetachOfRemovedNodes` when possible.\n */\nexport function normalizeCellRename(\n\tcellId: CellId,\n\tcount: CellCount,\n\tattach: Attach,\n\tdetach: Detach,\n): CellMark<AttachAndDetach | DetachOfRemovedNodes | Rename | NoopMark> {\n\tif (attach.type === \"MoveIn\") {\n\t\tif (detach.type === \"MoveOut\") {\n\t\t\tconst outputId = getDetachOutputCellId(detach);\n\t\t\t// Note that the output ID may be the same as the cellId. In such a scenario,\n\t\t\t// we output an (impact-less) Rename mark anyway (as opposed to a Skip)\n\t\t\t// because the resulting Rename may be rebased over other changes that rename the input cell,\n\t\t\t// eventually leading to an impactful rename.\n\t\t\treturn {\n\t\t\t\ttype: \"Rename\",\n\t\t\t\tcount,\n\t\t\t\tcellId,\n\t\t\t\tidOverride: outputId,\n\t\t\t};\n\t\t}\n\t} else {\n\t\t// Normalization: when the attach is an insert/revive, we rely on the implicit reviving semantics of the\n\t\t// detach instead of using an explicit revive effect in an AttachAndDetach\n\t\treturn {\n\t\t\t...detach,\n\t\t\tcount,\n\t\t\tcellId,\n\t\t};\n\t}\n\treturn {\n\t\ttype: \"AttachAndDetach\",\n\t\tattach,\n\t\tdetach,\n\t\tcount,\n\t\tcellId,\n\t};\n}\n\n/**\n * Preserves the semantics of the given `mark` but repackages it into an `AttachAndDetach` mark if it is not already one.\n */\nexport function asAttachAndDetach(mark: CellMark<CellRename>): CellMark<AttachAndDetach> {\n\tif (mark.type === \"AttachAndDetach\") {\n\t\treturn mark;\n\t}\n\tconst { cellId, count, changes, revision, ...effect } = mark;\n\tconst attachAndDetach: CellMark<AttachAndDetach | Detach> = {\n\t\ttype: \"AttachAndDetach\",\n\t\tcount,\n\t\tcellId,\n\t\tattach: {\n\t\t\ttype: \"Insert\",\n\t\t\tid: mark.id,\n\t\t},\n\t\tdetach: effect,\n\t};\n\tif (changes !== undefined) {\n\t\tattachAndDetach.changes = changes;\n\t}\n\tif (revision !== undefined) {\n\t\tattachAndDetach.attach.revision = revision;\n\t\tattachAndDetach.detach.revision = revision;\n\t}\n\treturn attachAndDetach;\n}\n\nexport function cloneMark<TMark extends Mark>(mark: TMark): TMark {\n\tconst clone: TMark = { ...cloneMarkEffect(mark), count: mark.count };\n\n\tif (mark.cellId !== undefined) {\n\t\tclone.cellId = cloneCellId(mark.cellId);\n\t}\n\treturn clone;\n}\n\nexport function cloneMarkEffect<TEffect extends MarkEffect>(effect: TEffect): TEffect {\n\tconst clone = { ...effect };\n\tif (clone.type === \"AttachAndDetach\") {\n\t\tclone.attach = cloneMarkEffect(clone.attach);\n\t\tclone.detach = cloneMarkEffect(clone.detach);\n\t}\n\treturn clone;\n}\n\nexport function cloneCellId(id: CellId): CellId {\n\tconst cloned = { ...id };\n\treturn cloned;\n}\n\n/**\n * Gets the number of nodes within the output context of the mark.\n * @param mark - The mark to get the length of.\n * @param ignorePairing - When true, the length of a paired mark (e.g. MoveIn/MoveOut) whose matching mark is not active\n * will be treated the same as if the matching mark were active.\n */\nexport function getOutputLength(mark: Mark, ignorePairing: boolean = false): number {\n\treturn areOutputCellsEmpty(mark) ? 0 : mark.count;\n}\n\n/**\n * Gets the number of nodes within the input context of the mark.\n * @param mark - The mark to get the length of.\n */\nexport function getInputLength(mark: Mark): number {\n\treturn areInputCellsEmpty(mark) ? 0 : mark.count;\n}\n\nexport function markEmptiesCells(mark: Mark): boolean {\n\treturn !areInputCellsEmpty(mark) && areOutputCellsEmpty(mark);\n}\n\nexport function markFillsCells(mark: Mark): boolean {\n\treturn areInputCellsEmpty(mark) && !areOutputCellsEmpty(mark);\n}\n\nexport function markHasCellEffect(mark: Mark): boolean {\n\treturn areInputCellsEmpty(mark) !== areOutputCellsEmpty(mark);\n}\n\nexport function isAttachAndDetachEffect(effect: MarkEffect): effect is AttachAndDetach {\n\treturn effect.type === \"AttachAndDetach\";\n}\n\nexport function isDetachOfRemovedNodes(mark: Mark): mark is CellMark<DetachOfRemovedNodes> {\n\treturn isDetach(mark) && mark.cellId !== undefined;\n}\n\nexport function isImpactfulCellRename(mark: Mark): mark is CellMark<CellRename> {\n\treturn (isAttachAndDetachEffect(mark) || isDetachOfRemovedNodes(mark)) && isImpactful(mark);\n}\n\nexport function areInputCellsEmpty(mark: Mark): mark is EmptyInputCellMark {\n\treturn mark.cellId !== undefined;\n}\n\nexport function areOutputCellsEmpty(mark: Mark): boolean {\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase NoopMarkType:\n\t\t\treturn mark.cellId !== undefined;\n\t\tcase \"Remove\":\n\t\tcase \"Rename\":\n\t\tcase \"MoveOut\":\n\t\tcase \"AttachAndDetach\":\n\t\t\treturn true;\n\t\tcase \"MoveIn\":\n\t\tcase \"Insert\":\n\t\t\treturn false;\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\n/**\n * Creates a mark that is equivalent to the given `mark` but with effects removed if those have no impact in the input\n * context of that mark.\n *\n * @param mark - The mark to settle. Never mutated.\n * @returns either the original mark or a shallow clone of it with effects stripped out.\n */\nexport function settleMark(mark: Mark): Mark {\n\tif (isImpactful(mark)) {\n\t\treturn mark;\n\t}\n\treturn omitMarkEffect(mark);\n}\n\n/**\n * Returns true if and only iff the given `mark` would have impact on the field when applied.\n *\n * @remarks\n * Ignores the impact of nested changes.\n * CellRename effects are considered impactful if they actually change the ID of the cells.\n */\nexport function isImpactful(mark: Mark): boolean {\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase NoopMarkType:\n\t\t\treturn false;\n\t\tcase \"Rename\":\n\t\t\treturn true;\n\t\tcase \"Remove\": {\n\t\t\tconst inputId = getInputCellId(mark);\n\t\t\tif (inputId === undefined) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconst outputId = getOutputCellId(mark);\n\t\t\tassert(outputId !== undefined, 0x824 /* Remove marks must have an output cell ID */);\n\t\t\treturn !areEqualChangeAtomIds(inputId, outputId);\n\t\t}\n\t\tcase \"AttachAndDetach\":\n\t\tcase \"MoveOut\":\n\t\t\treturn true;\n\t\tcase \"MoveIn\":\n\t\t\t// MoveIn marks always target an empty cell.\n\t\t\tassert(mark.cellId !== undefined, 0x825 /* MoveIn marks should target empty cells */);\n\t\t\treturn true;\n\t\tcase \"Insert\":\n\t\t\t// A Revive has no impact if the nodes are already in the document.\n\t\t\treturn mark.cellId !== undefined;\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\nexport function isTombstone(mark: Mark): mark is CellMark<NoopMark> & { cellId: CellId } {\n\treturn mark.type === NoopMarkType && mark.cellId !== undefined && mark.changes === undefined;\n}\n\nexport function isNoopMark(mark: Mark): mark is CellMark<NoopMark> {\n\treturn mark.type === NoopMarkType;\n}\n\nexport function areOverlappingIdRanges(\n\tid1: ChangesetLocalId,\n\tcount1: number,\n\tid2: ChangesetLocalId,\n\tcount2: number,\n): boolean {\n\tconst lastId1 = (id1 as number) + count1 - 1;\n\tconst lastId2 = (id2 as number) + count2 - 1;\n\treturn (id2 <= id1 && id1 <= lastId2) || (id1 <= id2 && id2 <= lastId1);\n}\n\nexport function compareCellsFromSameRevision(\n\tcell1: CellId,\n\tcount1: number,\n\tcell2: CellId,\n\tcount2: number,\n): number | undefined {\n\tassert(\n\t\tcell1.revision === cell2.revision,\n\t\t0x85b /* Expected cells to have the same revision */,\n\t);\n\tif (areOverlappingIdRanges(cell1.localId, count1, cell2.localId, count2)) {\n\t\treturn cell1.localId - cell2.localId;\n\t}\n\treturn undefined;\n}\n\nexport function isDetach(mark: MarkEffect | undefined): mark is Detach {\n\tconst type = mark?.type;\n\treturn type === \"Remove\" || type === \"MoveOut\";\n}\n\nexport function isRemoveMark(mark: Mark | undefined): mark is CellMark<Remove> {\n\treturn mark?.type === \"Remove\";\n}\n\nfunction areMergeableChangeAtoms(\n\tlhs: ChangeAtomId | undefined,\n\tlhsCount: number,\n\trhs: ChangeAtomId | undefined,\n): boolean {\n\tif (lhs === undefined || rhs === undefined) {\n\t\treturn lhs === undefined && rhs === undefined;\n\t}\n\n\treturn (\n\t\tlhs.revision === rhs.revision && areAdjacentIdRanges(lhs.localId, lhsCount, rhs.localId)\n\t);\n}\n\nfunction areAdjacentIdRanges(\n\tfirstStart: ChangesetLocalId,\n\tfirstLength: number,\n\tsecondStart: ChangesetLocalId,\n): boolean {\n\treturn (firstStart as number) + firstLength === secondStart;\n}\n\nfunction haveMergeableIdOverrides(\n\tlhs: DetachFields,\n\tlhsCount: number,\n\trhs: DetachFields,\n): boolean {\n\tif (lhs.idOverride !== undefined && rhs.idOverride !== undefined) {\n\t\treturn areMergeableCellIds(lhs.idOverride, lhsCount, rhs.idOverride);\n\t}\n\treturn (lhs.idOverride === undefined) === (rhs.idOverride === undefined);\n}\n\nfunction areMergeableCellIds(\n\tlhs: CellId | undefined,\n\tlhsCount: number,\n\trhs: CellId | undefined,\n): boolean {\n\treturn areMergeableChangeAtoms(lhs, lhsCount, rhs);\n}\n\n/**\n * Attempts to extend `lhs` to include the effects of `rhs`.\n * @param lhs - The mark to extend.\n * @param rhs - The effect so extend `rhs` with.\n * @returns `lhs` iff the function was able to mutate `lhs` to include the effects of `rhs`.\n * When `undefined` is returned, `lhs` is left untouched.\n */\nexport function tryMergeMarks(lhs: Mark, rhs: Readonly<Mark>): Mark | undefined {\n\tif (rhs.type !== lhs.type) {\n\t\treturn undefined;\n\t}\n\n\tif (!areMergeableCellIds(lhs.cellId, lhs.count, rhs.cellId)) {\n\t\treturn undefined;\n\t}\n\n\tif (rhs.changes !== undefined || lhs.changes !== undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst mergedEffect = tryMergeEffects(lhs, rhs, lhs.count);\n\tif (mergedEffect === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn { ...lhs, ...mergedEffect, count: lhs.count + rhs.count };\n}\n\nfunction tryMergeEffects(\n\tlhs: MarkEffect,\n\trhs: MarkEffect,\n\tlhsCount: number,\n): MarkEffect | undefined {\n\tif (lhs.type !== rhs.type) {\n\t\treturn undefined;\n\t}\n\n\tif (rhs.type === NoopMarkType) {\n\t\treturn lhs;\n\t}\n\n\tif (rhs.type === \"AttachAndDetach\") {\n\t\tconst lhsAttachAndDetach = lhs as AttachAndDetach;\n\t\tconst attach = tryMergeEffects(lhsAttachAndDetach.attach, rhs.attach, lhsCount);\n\t\tconst detach = tryMergeEffects(lhsAttachAndDetach.detach, rhs.detach, lhsCount);\n\t\tif (attach === undefined || detach === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tassert(\n\t\t\tisAttach(attach) && isDetach(detach),\n\t\t\t0x826 /* Merged marks should be same type as input marks */,\n\t\t);\n\t\treturn { ...lhsAttachAndDetach, attach, detach };\n\t}\n\n\tif (\n\t\t(lhs as Partial<HasRevisionTag>).revision !== (rhs as Partial<HasRevisionTag>).revision\n\t) {\n\t\treturn undefined;\n\t}\n\n\tif (isDetach(lhs) && isDetach(rhs) && !haveMergeableIdOverrides(lhs, lhsCount, rhs)) {\n\t\treturn undefined;\n\t}\n\n\tconst type = rhs.type;\n\tswitch (type) {\n\t\tcase \"MoveIn\": {\n\t\t\tconst lhsMoveIn = lhs as MoveIn;\n\t\t\tif (\n\t\t\t\t(lhsMoveIn.id as number) + lhsCount === rhs.id &&\n\t\t\t\tareMergeableChangeAtoms(lhsMoveIn.finalEndpoint, lhsCount, rhs.finalEndpoint)\n\t\t\t) {\n\t\t\t\treturn lhsMoveIn;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"Remove\": {\n\t\t\tconst lhsDetach = lhs as Remove;\n\t\t\tif (\n\t\t\t\t(lhsDetach.id as number) + lhsCount === rhs.id &&\n\t\t\t\thaveMergeableIdOverrides(lhsDetach, lhsCount, rhs)\n\t\t\t) {\n\t\t\t\treturn lhsDetach;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"Rename\": {\n\t\t\tconst lhsDetach = lhs as Rename;\n\t\t\tif (haveMergeableIdOverrides(lhsDetach, lhsCount, rhs)) {\n\t\t\t\treturn lhsDetach;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"MoveOut\": {\n\t\t\tconst lhsMoveOut = lhs as MoveOut;\n\t\t\tif (\n\t\t\t\t(lhsMoveOut.id as number) + lhsCount === rhs.id &&\n\t\t\t\thaveMergeableIdOverrides(lhsMoveOut, lhsCount, rhs) &&\n\t\t\t\tareMergeableChangeAtoms(lhsMoveOut.finalEndpoint, lhsCount, rhs.finalEndpoint)\n\t\t\t) {\n\t\t\t\treturn lhsMoveOut;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"Insert\": {\n\t\t\tconst lhsInsert = lhs as Insert;\n\t\t\tif ((lhsInsert.id as number) + lhsCount === rhs.id) {\n\t\t\t\treturn lhsInsert;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Splits the `mark` into two marks such that the first returned mark has length `length`.\n * @param mark - The mark to split.\n * @param revision - The revision of the changeset the mark is part of.\n * @param length - The desired length for the first of the two returned marks.\n * @param genId - An ID allocator\n * @param moveEffects - The table in which to record splitting of move marks\n * @param recordMoveEffect - Whether when splitting a move an entry should be added to `moveEffects` indicating that the mark should be split (in case we process this mark again).\n * An entry is always added to `moveEffects` indicating that the opposite end of the move should be split.\n * @returns A pair of marks equivalent to the original `mark`\n * such that the first returned mark has input length `length`.\n */\nexport function splitMark<TMark extends Mark>(mark: TMark, length: number): [TMark, TMark] {\n\tconst markLength = mark.count;\n\tconst remainder = markLength - length;\n\tif (length < 1 || remainder < 1) {\n\t\tfail(0xb2d /* Unable to split mark due to lengths */);\n\t}\n\n\tconst [effect1, effect2] = splitMarkEffect(mark, length);\n\tconst mark1 = { ...mark, ...effect1, count: length };\n\tconst mark2 = { ...mark, ...effect2, count: remainder };\n\tif (mark2.cellId !== undefined) {\n\t\tmark2.cellId = splitDetachEvent(mark2.cellId, length);\n\t}\n\n\treturn [mark1, mark2];\n}\n\nexport function splitMarkEffect<TEffect extends MarkEffect>(\n\teffect: TEffect,\n\tlength: number,\n): [TEffect, TEffect] {\n\tconst type = effect.type;\n\tswitch (type) {\n\t\tcase NoopMarkType:\n\t\t\treturn [effect, effect];\n\t\tcase \"Insert\": {\n\t\t\tconst effect1: TEffect = {\n\t\t\t\t...effect,\n\t\t\t};\n\t\t\tconst effect2: TEffect = {\n\t\t\t\t...effect,\n\t\t\t\tid: (effect.id as number) + length,\n\t\t\t};\n\t\t\treturn [effect1, effect2];\n\t\t}\n\t\tcase \"MoveIn\": {\n\t\t\tconst effect2: TEffect = { ...effect, id: (effect.id as number) + length };\n\t\t\tconst move2 = effect2 as MoveIn;\n\t\t\tif (move2.finalEndpoint !== undefined) {\n\t\t\t\tmove2.finalEndpoint = splitDetachEvent(move2.finalEndpoint, length);\n\t\t\t}\n\t\t\treturn [effect, effect2];\n\t\t}\n\t\tcase \"Remove\": {\n\t\t\tconst effect1 = { ...effect };\n\t\t\tconst id2: ChangesetLocalId = brand((effect.id as number) + length);\n\t\t\tconst effect2 = { ...effect, id: id2 };\n\t\t\tconst effect2Remove = effect2 as Mutable<Remove>;\n\t\t\tif (effect2Remove.idOverride !== undefined) {\n\t\t\t\teffect2Remove.idOverride = splitDetachEvent(effect2Remove.idOverride, length);\n\t\t\t}\n\t\t\treturn [effect1, effect2];\n\t\t}\n\t\tcase \"Rename\": {\n\t\t\tconst effect1 = { ...effect };\n\t\t\tconst effect2 = { ...effect };\n\t\t\tconst effect2Rename = effect2 as Mutable<Rename>;\n\t\t\tif (effect2Rename.idOverride !== undefined) {\n\t\t\t\teffect2Rename.idOverride = splitDetachEvent(effect2Rename.idOverride, length);\n\t\t\t}\n\t\t\treturn [effect1, effect2];\n\t\t}\n\t\tcase \"MoveOut\": {\n\t\t\tconst effect2 = {\n\t\t\t\t...effect,\n\t\t\t\tid: (effect.id as number) + length,\n\t\t\t};\n\n\t\t\tconst return2 = effect2 as Mutable<MoveOut>;\n\n\t\t\tif (return2.idOverride !== undefined) {\n\t\t\t\treturn2.idOverride = splitDetachEvent(return2.idOverride, length);\n\t\t\t}\n\n\t\t\tif (return2.finalEndpoint !== undefined) {\n\t\t\t\treturn2.finalEndpoint = splitDetachEvent(return2.finalEndpoint, length);\n\t\t\t}\n\t\t\treturn [effect, effect2];\n\t\t}\n\t\tcase \"AttachAndDetach\": {\n\t\t\tconst [attach1, attach2] = splitMarkEffect(effect.attach, length);\n\t\t\tconst [detach1, detach2] = splitMarkEffect(effect.detach, length);\n\t\t\tconst effect1 = {\n\t\t\t\t...effect,\n\t\t\t\tattach: attach1,\n\t\t\t\tdetach: detach1,\n\t\t\t};\n\n\t\t\tconst effect2 = {\n\t\t\t\t...effect,\n\t\t\t\tattach: attach2,\n\t\t\t\tdetach: detach2,\n\t\t\t};\n\n\t\t\treturn [effect1, effect2];\n\t\t}\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\nfunction splitDetachEvent(detachEvent: CellId, length: number): CellId {\n\treturn { ...detachEvent, localId: brand((detachEvent.localId as number) + length) };\n}\n\n// TODO: Refactor MarkEffect into a field of CellMark so this function isn't necessary.\nexport function extractMarkEffect<TEffect extends MarkEffect>(\n\tmark: CellMark<TEffect>,\n): TEffect {\n\tconst { cellId: _cellId, count: _count, changes: _changes, ...effect } = mark;\n\treturn effect as unknown as TEffect;\n}\n\n// TODO: Refactor MarkEffect into a field of CellMark so this function isn't necessary.\nexport function omitMarkEffect(mark: CellMark<unknown>): CellMark<NoopMark> {\n\tconst { cellId, count, changes } = mark;\n\tconst noopMark: CellMark<NoopMark> = { count };\n\tif (cellId !== undefined) {\n\t\tnoopMark.cellId = cellId;\n\t}\n\tif (changes !== undefined) {\n\t\tnoopMark.changes = changes;\n\t}\n\treturn noopMark;\n}\n\nexport function withNodeChange<TMark extends CellMark<TKind>, TKind extends MarkEffect>(\n\tmark: TMark,\n\tchanges: NodeId | undefined,\n): TMark {\n\tconst newMark = { ...mark };\n\tif (changes !== undefined) {\n\t\tnewMark.changes = changes;\n\t} else {\n\t\tdelete newMark.changes;\n\t}\n\treturn newMark;\n}\n\nexport function withRevision<TMark extends Mark>(\n\tmark: TMark,\n\trevision: RevisionTag | undefined,\n): TMark {\n\tif (revision === undefined) {\n\t\treturn mark;\n\t}\n\n\tconst cloned = cloneMark(mark);\n\taddRevision(cloned, revision);\n\tif (\n\t\tcloned.cellId !== undefined &&\n\t\tcloned.cellId.revision === undefined &&\n\t\trevision !== undefined\n\t) {\n\t\t(cloned.cellId as Mutable<CellId>).revision = revision;\n\t}\n\treturn cloned;\n}\n\nfunction addRevision(effect: MarkEffect, revision: RevisionTag): void {\n\tif (effect.type === NoopMarkType || isRename(effect)) {\n\t\treturn;\n\t}\n\n\tif (effect.type === \"AttachAndDetach\") {\n\t\taddRevision(effect.attach, revision);\n\t\taddRevision(effect.detach, revision);\n\t\treturn;\n\t}\n\n\tassert(\n\t\teffect.revision === undefined || effect.revision === revision,\n\t\t0x829 /* Should not overwrite mark revision */,\n\t);\n\teffect.revision = revision;\n}\n\nexport function getEndpoint(effect: MoveMarkEffect): ChangeAtomId {\n\treturn effect.finalEndpoint ?? { revision: effect.revision, localId: effect.id };\n}\n\nexport function getCrossFieldKeys(change: Changeset): CrossFieldKeyRange[] {\n\tconst keys: CrossFieldKeyRange[] = [];\n\tfor (const mark of change) {\n\t\tkeys.push(...getCrossFieldKeysForMarkEffect(mark, mark.count));\n\t}\n\n\treturn keys;\n}\n\nfunction getCrossFieldKeysForMarkEffect(\n\teffect: MarkEffect,\n\tcount: number,\n): CrossFieldKeyRange[] {\n\tswitch (effect.type) {\n\t\tcase \"Insert\":\n\t\t\t// An insert behaves like a move where the source and destination are at the same location.\n\t\t\t// An insert can become a move when after rebasing.\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tkey: {\n\t\t\t\t\t\ttarget: CrossFieldTarget.Source,\n\t\t\t\t\t\trevision: effect.revision,\n\t\t\t\t\t\tlocalId: effect.id,\n\t\t\t\t\t},\n\t\t\t\t\tcount,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tkey: {\n\t\t\t\t\t\ttarget: CrossFieldTarget.Destination,\n\t\t\t\t\t\trevision: effect.revision,\n\t\t\t\t\t\tlocalId: effect.id,\n\t\t\t\t\t},\n\t\t\t\t\tcount,\n\t\t\t\t},\n\t\t\t];\n\t\tcase \"MoveOut\":\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tkey: {\n\t\t\t\t\t\ttarget: CrossFieldTarget.Source,\n\t\t\t\t\t\trevision: effect.revision,\n\t\t\t\t\t\tlocalId: effect.id,\n\t\t\t\t\t},\n\t\t\t\t\tcount,\n\t\t\t\t},\n\t\t\t];\n\t\tcase \"MoveIn\":\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tkey: {\n\t\t\t\t\t\ttarget: CrossFieldTarget.Destination,\n\t\t\t\t\t\trevision: effect.revision,\n\t\t\t\t\t\tlocalId: effect.id,\n\t\t\t\t\t},\n\t\t\t\t\tcount,\n\t\t\t\t},\n\t\t\t];\n\t\tcase \"AttachAndDetach\":\n\t\t\treturn [\n\t\t\t\t...getCrossFieldKeysForMarkEffect(effect.attach, count),\n\t\t\t\t...getCrossFieldKeysForMarkEffect(effect.detach, count),\n\t\t\t];\n\t\tdefault:\n\t\t\treturn [];\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAEpF,OAAO,EAKN,wBAAwB,EACxB,qBAAqB,EACrB,gBAAgB,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAgB,wBAAwB,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EACN,gBAAgB,GAIhB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAUN,YAAY,GAIZ,MAAM,YAAY,CAAC;AAEpB,MAAM,UAAU,OAAO,CAAC,MAAiB;IACxC,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,C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,QAAQ,CAAC,CAAC,CAAC;YACf,OAAO;gBACN;oBACC,GAAG,EAAE;wBACJ,QAAQ,EAAE,IAAI,CAAC,QAAQ;wBACvB,OAAO,EAAE,IAAI,CAAC,EAAE;wBAChB,MAAM,EAAE,gBAAgB,CAAC,MAAM;qBAC/B;oBACD,KAAK;iBACL;aACD,CAAC;QACH,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,OAAO,EAAE,CAAC;QACX,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ChangeAtomId,\n\ttype ChangesetLocalId,\n\ttype RevisionMetadataSource,\n\ttype RevisionTag,\n\tareEqualChangeAtomIdOpts,\n\tareEqualChangeAtomIds,\n\tmakeChangeAtomId,\n} from \"../../core/index.js\";\nimport { type Mutable, areAdjacentIntegerRanges, brand } from \"../../util/index.js\";\nimport {\n\tCrossFieldTarget,\n\ttype NodeId,\n\ttype CrossFieldKeyRange,\n\ttype NestedChangesIndices,\n} from \"../modular-schema/index.js\";\n\nimport type { DetachOfRemovedNodes, EmptyInputCellMark } from \"./helperTypes.js\";\nimport {\n\ttype Attach,\n\ttype CellId,\n\ttype CellMark,\n\ttype Changeset,\n\ttype Detach,\n\ttype HasRevisionTag,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype NoopMark,\n\tNoopMarkType,\n\ttype CellCount,\n\ttype Rename,\n\ttype Pin,\n} from \"./types.js\";\n\nexport function isEmpty(change: Changeset): boolean {\n\tfor (const mark of change) {\n\t\tif (mark.changes !== undefined || mark.type !== undefined) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nexport function createEmpty(): Changeset {\n\treturn [];\n}\n\nexport function getNestedChanges(change: Changeset): NestedChangesIndices {\n\tconst output: NestedChangesIndices = [];\n\tlet inputIndex = 0;\n\tfor (const mark of change) {\n\t\tconst { changes, count } = mark;\n\t\tif (changes !== undefined) {\n\t\t\toutput.push([changes, inputIndex]);\n\t\t}\n\t\tif (!areInputCellsEmpty(mark)) {\n\t\t\tinputIndex += count;\n\t\t}\n\t}\n\treturn output;\n}\n\nexport function isNewAttach(mark: Mark, revision?: RevisionTag): boolean {\n\treturn isNewAttachEffect(mark, mark.cellId, revision);\n}\n\nexport function isNewAttachEffect(\n\teffect: MarkEffect,\n\tcellId: CellId | undefined,\n\trevision?: RevisionTag,\n): boolean {\n\treturn (\n\t\tisAttach(effect) &&\n\t\tcellId !== undefined &&\n\t\t(effect.revision ?? revision) === (cellId.revision ?? revision)\n\t);\n}\n\nexport function isRename(mark: MarkEffect): mark is Rename {\n\treturn mark.type === \"Rename\";\n}\n\nexport function isInsert(mark: MarkEffect): mark is Attach {\n\treturn mark.type === \"Insert\";\n}\n\nexport function isAttach(effect: MarkEffect): effect is Attach {\n\treturn effect.type === \"Insert\";\n}\n\nexport function isReattach(mark: Mark): boolean {\n\treturn isReattachEffect(mark, mark.cellId);\n}\n\nexport function isReattachEffect(effect: MarkEffect, cellId: CellId | undefined): boolean {\n\treturn isAttach(effect) && !isNewAttachEffect(effect, cellId);\n}\n\nexport function isActiveReattach(\n\tmark: Mark,\n): mark is CellMark<Attach> & { conflictsWith?: undefined } {\n\treturn isAttach(mark) && isReattachEffect(mark, mark.cellId) && mark.cellId !== undefined;\n}\n\nexport function areEqualCellIds(a: CellId | undefined, b: CellId | undefined): boolean {\n\treturn areEqualChangeAtomIdOpts(a, b);\n}\n\nexport function getInputCellId(mark: Mark): CellId | undefined {\n\treturn mark.cellId;\n}\n\nexport function getOutputCellId(mark: Mark): CellId | undefined {\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase NoopMarkType: {\n\t\t\treturn getInputCellId(mark);\n\t\t}\n\t\tcase \"Insert\": {\n\t\t\treturn undefined;\n\t\t}\n\t\tcase \"Remove\": {\n\t\t\treturn getDetachOutputCellId(mark);\n\t\t}\n\t\tcase \"Rename\": {\n\t\t\treturn mark.idOverride;\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(type);\n\t\t}\n\t}\n}\n\nexport function cellSourcesFromMarks(\n\tmarks: readonly Mark[],\n\tcontextGetter: typeof getInputCellId | typeof getOutputCellId,\n): Set<RevisionTag | undefined> {\n\tconst set = new Set<RevisionTag | undefined>();\n\tfor (const mark of marks) {\n\t\tconst cell = contextGetter(mark);\n\t\tif (cell !== undefined) {\n\t\t\tset.add(cell.revision);\n\t\t}\n\t}\n\treturn set;\n}\n\nexport enum CellOrder {\n\tSameCell,\n\tOldThenNew,\n\tNewThenOld,\n}\n\n/**\n * Determines the order of two cells from two changesets.\n *\n * This function makes the following assumptions:\n * 1. The cells represent the same context.\n * 2. `oldMarkCell` is from a mark in a changeset that is older than the changeset that contains the mark that\n * `newMarkCell` is from.\n * 3. In terms of sequence index, all cells located before A are also located before B,\n * and all cells located before B are also located before A.\n * 4. If a changeset has a mark/tombstone that describes a cell named in some revision R,\n * then that changeset must contain marks/tombstones for all cells named in R as well as all cells named in later\n * revisions up to its own.\n * 5. If a changeset foo is rebased over a changeset bar, then the rebased version of foo must contain tombstones or\n * marks for all cells referenced or named in bar. It has yet to be determined whether this assumption is necessary\n * for the logic below.\n *\n * @param oldMarkCell - The cell referenced or named by a mark or tombstone from the older changeset.\n * @param newMarkCell - The cell referenced or named by a mark or tombstone from the newer changeset.\n * @param oldChangeKnowledge - The set of revisions that the older changeset has cell representations for.\n * @param newChangeKnowledge - The set of revisions that the newer changeset has cell representations for.\n * @param metadata - Revision metadata for the operation being carried out.\n * @returns a {@link CellOrder} which describes how the cells are ordered relative to one-another.\n */\nexport function compareCellPositionsUsingTombstones(\n\toldMarkCell: ChangeAtomId,\n\tnewMarkCell: ChangeAtomId,\n\toldChangeKnowledge: ReadonlySet<RevisionTag | undefined>,\n\tnewChangeKnowledge: ReadonlySet<RevisionTag | undefined>,\n\tmetadata: RevisionMetadataSource,\n): CellOrder {\n\tif (areEqualChangeAtomIds(oldMarkCell, newMarkCell)) {\n\t\treturn CellOrder.SameCell;\n\t}\n\tconst oldChangeKnowsOfNewMarkCellRevision = oldChangeKnowledge.has(newMarkCell.revision);\n\tconst newChangeKnowsOfOldMarkCellRevision = newChangeKnowledge.has(oldMarkCell.revision);\n\tif (oldChangeKnowsOfNewMarkCellRevision && newChangeKnowsOfOldMarkCellRevision) {\n\t\t// If both changesets know of both cells, but we've been asked to compare different cells,\n\t\t// Then either the changesets they originate from do not represent the same context,\n\t\t// or the ordering of their cells in inconsistent.\n\t\t// The only exception to this is when we're composing changesets in a transaction since they have the same revision but different sets of cells.\n\t\tassert(\n\t\t\toldMarkCell.revision === newMarkCell.revision,\n\t\t\t0x8a0 /* Inconsistent cell ordering */,\n\t\t);\n\t\t// We are composing changesets in a transaction. The new changeset is creating a cell in a gap\n\t\t// where the old changeset knows of some now empty cell. We order the new cell relative to the old cell in a\n\t\t// way that is consistent with its tie-breaking behavior should the old cell be concurrently re-filled.\n\t\t// Since only tie-break left is supported at the moment, the new cell comes first.\n\t\treturn CellOrder.NewThenOld;\n\t}\n\tif (newChangeKnowsOfOldMarkCellRevision) {\n\t\t// The changeset that contains `newMarkCell` has tombstones for the revision that created `oldMarkCell`,\n\t\t// so a tombstone/mark matching `oldMarkCell` must occur later in the newer changeset.\n\t\treturn CellOrder.NewThenOld;\n\t} else if (oldChangeKnowsOfNewMarkCellRevision) {\n\t\t// The changeset that contains `oldMarkCell` has tombstones for revision that created `newMarkCell`,\n\t\t// so a tombstone/mark matching `newMarkCell` must occur later in the older changeset.\n\t\treturn CellOrder.OldThenNew;\n\t} else {\n\t\t// These cells are only ordered through tie-breaking.\n\t\t// Since tie-breaking is hard-coded to \"merge left\", the younger cell comes first.\n\n\t\t// In the context of compose, an undefined revision means we are composing anonymous changesets into\n\t\t// a transaction, which means the cell from the newer changeset is younger.\n\t\tif (newMarkCell.revision === undefined) {\n\t\t\treturn CellOrder.NewThenOld;\n\t\t}\n\t\t// The only case where the old mark cell should have no revision is when composing anonymous changesets\n\t\t// into a transaction, in which case the new mark cell should also have no revision, which is handled above.\n\t\t// In all other cases, the old mark cell should have a revision.\n\t\tassert(\n\t\t\toldMarkCell.revision !== undefined,\n\t\t\t0x8a1 /* Old mark cell should have a revision */,\n\t\t);\n\n\t\t// Note that these indices are for ordering the revisions in which the cells were named, not the revisions\n\t\t// of the changesets in which the marks targeting these cells appear.\n\t\tconst revisionComparison = metadata.compareRevisions(\n\t\t\toldMarkCell.revision,\n\t\t\tnewMarkCell.revision,\n\t\t);\n\n\t\t// If the metadata defines an ordering for the revisions then the cell from the newer revision comes first.\n\t\tif (revisionComparison !== 0) {\n\t\t\treturn revisionComparison > 0 ? CellOrder.NewThenOld : CellOrder.OldThenNew;\n\t\t}\n\n\t\t// While it is possible for both marks to refer to cells that were named in revisions that are outside\n\t\t// the scope of the metadata, such a scenario should be handled above due to the fact that one of the two\n\t\t// changesets should have tombstones or marks for both cells.\n\t\t//\n\t\t// To see this in the context of rebase, we must consider the lowest common ancestor (LCA) of each change's\n\t\t// original (i.e., unrebased) edit with the head of the branch they will both reside on after the rebase.\n\t\t// ...─(Ti)─...─(Tj)─...─(old')─(new') <- branch both change will reside on after rebase\n\t\t// | └─...─(new)\n\t\t// └─...─(old)\n\t\t// In the diagram above we can see that by the time `new` is being rebased over `old`, both changesets have\n\t\t// been rebased over, and therefore have cell information for, changes `Tj` onwards. This means that one of\n\t\t// The two changesets (the `old` one in the diagram above) will have tombstones or marks for any cells that\n\t\t// `new` refers to so long as those cells were not created on `new`'s branch.\n\t\t// Note that the change that contains the superset of cells (again, ignoring cells created on the other\n\t\t// change's branch) is not always the older change. Consider the following scenario:\n\t\t// ...─(Ti)─...─(Tj)─...─(old')─(new')\n\t\t// | └─...─(old)\n\t\t// └─...─(new)\n\t\t//\n\t\t// The same scenario can arise in the context of compose (just consider composing `old'` and `new'` from\n\t\t// the examples above) with the same resolution.\n\t\tassert(false, 0x8a2 /* Invalid cell ordering scenario */);\n\t}\n}\n\n/**\n * Gets the ID of the cell in the output context of the given detach `mark`.\n */\nexport function getDetachOutputCellId(mark: Detach): ChangeAtomId {\n\tif (mark.cellRename !== undefined) {\n\t\treturn mark.cellRename;\n\t}\n\n\tif (mark.detachCellId !== undefined) {\n\t\treturn mark.detachCellId;\n\t}\n\n\treturn getDetachedRootId(mark);\n}\n\n/**\n * Gets the ID of the node to be attached in the input context of the given detach `mark`.\n */\nexport function getAttachedRootId(mark: Attach): ChangeAtomId {\n\treturn makeChangeAtomId(mark.id, mark.revision);\n}\n\n/**\n * Gets the ID of the detached node in the output context of the given detach `mark`.\n */\nexport function getDetachedRootId(mark: Detach): ChangeAtomId {\n\treturn makeChangeAtomId(mark.id, mark.revision);\n}\n\nexport function getMovedNodeId(mark: Attach | Detach): ChangeAtomId {\n\treturn makeChangeAtomId(mark.id, mark.revision);\n}\n\n/**\n * Preserves the semantics of the given `mark` but repackages it into a `DetachOfRemovedNodes` when possible.\n */\nexport function normalizeCellRename(\n\tcellId: CellId,\n\tcount: CellCount,\n\tattach: Attach,\n\tdetach: Detach,\n): CellMark<DetachOfRemovedNodes | Rename | NoopMark> {\n\tconst outputId = getDetachOutputCellId(detach);\n\t// Note that the output ID may be the same as the cellId. In such a scenario,\n\t// we output an (impact-less) Rename mark anyway (as opposed to a Skip)\n\t// because the resulting Rename may be rebased over other changes that rename the input cell,\n\t// eventually leading to an impactful rename.\n\treturn {\n\t\ttype: \"Rename\",\n\t\tcount,\n\t\tcellId,\n\t\tidOverride: outputId,\n\t};\n}\n\nexport function cloneMark<TMark extends Mark>(mark: TMark): TMark {\n\tconst clone: TMark = { ...cloneMarkEffect(mark), count: mark.count };\n\n\tif (mark.cellId !== undefined) {\n\t\tclone.cellId = cloneCellId(mark.cellId);\n\t}\n\treturn clone;\n}\n\nexport function cloneMarkEffect<TEffect extends MarkEffect>(effect: TEffect): TEffect {\n\tconst clone = { ...effect };\n\treturn clone;\n}\n\nexport function cloneCellId(id: CellId): CellId {\n\tconst cloned = { ...id };\n\treturn cloned;\n}\n\n/**\n * Gets the number of nodes within the output context of the mark.\n * @param mark - The mark to get the length of.\n * @param ignorePairing - When true, the length of a paired mark (e.g. MoveIn/MoveOut) whose matching mark is not active\n * will be treated the same as if the matching mark were active.\n */\nexport function getOutputLength(mark: Mark, ignorePairing: boolean = false): number {\n\treturn areOutputCellsEmpty(mark) ? 0 : mark.count;\n}\n\n/**\n * Gets the number of nodes within the input context of the mark.\n * @param mark - The mark to get the length of.\n */\nexport function getInputLength(mark: Mark): number {\n\treturn areInputCellsEmpty(mark) ? 0 : mark.count;\n}\n\nexport function markEmptiesCells(mark: Mark): boolean {\n\treturn !areInputCellsEmpty(mark) && areOutputCellsEmpty(mark);\n}\n\nexport function markFillsCells(mark: Mark): boolean {\n\treturn areInputCellsEmpty(mark) && !areOutputCellsEmpty(mark);\n}\n\nexport function markHasCellEffect(mark: Mark): boolean {\n\treturn areInputCellsEmpty(mark) !== areOutputCellsEmpty(mark);\n}\n\nexport function areInputCellsEmpty(mark: Mark): mark is EmptyInputCellMark {\n\treturn mark.cellId !== undefined;\n}\n\nexport function areOutputCellsEmpty(mark: Mark): boolean {\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase NoopMarkType: {\n\t\t\treturn mark.cellId !== undefined;\n\t\t}\n\t\tcase \"Remove\":\n\t\tcase \"Rename\": {\n\t\t\treturn true;\n\t\t}\n\t\tcase \"Insert\": {\n\t\t\treturn false;\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(type);\n\t\t}\n\t}\n}\n\n/**\n * Returns true if and only iff the given `mark` would have impact on the field when applied.\n *\n * @remarks\n * Ignores the impact of nested changes.\n * CellRename effects are considered impactful if they actually change the ID of the cells.\n */\nexport function isImpactful(mark: Mark): boolean {\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase NoopMarkType: {\n\t\t\treturn false;\n\t\t}\n\t\tcase \"Rename\": {\n\t\t\treturn true;\n\t\t}\n\t\tcase \"Remove\": {\n\t\t\tconst inputId = getInputCellId(mark);\n\t\t\tif (inputId === undefined) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconst outputId = getOutputCellId(mark);\n\t\t\tassert(outputId !== undefined, 0x824 /* Remove marks must have an output cell ID */);\n\t\t\treturn !areEqualChangeAtomIds(inputId, outputId);\n\t\t}\n\t\tcase \"Insert\": {\n\t\t\t// A Revive has no impact if the nodes are already in the document.\n\t\t\treturn mark.cellId !== undefined;\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(type);\n\t\t}\n\t}\n}\n\nexport function isTombstone(mark: Mark): mark is CellMark<NoopMark> & { cellId: CellId } {\n\treturn mark.type === NoopMarkType && mark.cellId !== undefined && mark.changes === undefined;\n}\n\nexport function isNoopMark(mark: Mark): mark is CellMark<NoopMark> {\n\treturn mark.type === NoopMarkType;\n}\n\nexport function areOverlappingIdRanges(\n\tid1: ChangesetLocalId,\n\tcount1: number,\n\tid2: ChangesetLocalId,\n\tcount2: number,\n): boolean {\n\tconst lastId1 = (id1 as number) + count1 - 1;\n\tconst lastId2 = (id2 as number) + count2 - 1;\n\treturn (id2 <= id1 && id1 <= lastId2) || (id1 <= id2 && id2 <= lastId1);\n}\n\nexport function compareCellsFromSameRevision(\n\tcell1: CellId,\n\tcount1: number,\n\tcell2: CellId,\n\tcount2: number,\n): number | undefined {\n\tassert(\n\t\tcell1.revision === cell2.revision,\n\t\t0x85b /* Expected cells to have the same revision */,\n\t);\n\tif (areOverlappingIdRanges(cell1.localId, count1, cell2.localId, count2)) {\n\t\treturn cell1.localId - cell2.localId;\n\t}\n\treturn undefined;\n}\n\nexport function isDetach(mark: MarkEffect | undefined): mark is Detach {\n\tconst type = mark?.type;\n\treturn type === \"Remove\";\n}\n\nexport function isPin(mark: Mark): mark is Pin {\n\treturn mark?.type === \"Insert\" && mark.cellId === undefined;\n}\n\nexport function isRemoveMark(mark: Mark | undefined): mark is CellMark<Detach> {\n\treturn mark?.type === \"Remove\";\n}\n\nexport function areMergeableChangeAtoms(\n\tlhs: ChangeAtomId | undefined,\n\tlhsCount: number,\n\trhs: ChangeAtomId | undefined,\n): boolean {\n\tif (lhs === undefined || rhs === undefined) {\n\t\treturn lhs === undefined && rhs === undefined;\n\t}\n\n\treturn (\n\t\tlhs.revision === rhs.revision &&\n\t\tareAdjacentIntegerRanges(lhs.localId, lhsCount, rhs.localId)\n\t);\n}\n\nfunction areMergeableCellIds(\n\tlhs: CellId | undefined,\n\tlhsCount: number,\n\trhs: CellId | undefined,\n): boolean {\n\treturn areMergeableChangeAtoms(lhs, lhsCount, rhs);\n}\n\n/**\n * Attempts to extend `lhs` to include the effects of `rhs`.\n * @param lhs - The mark to extend.\n * @param rhs - The effect so extend `rhs` with.\n * @returns `lhs` iff the function was able to mutate `lhs` to include the effects of `rhs`.\n * When `undefined` is returned, `lhs` is left untouched.\n */\nexport function tryMergeMarks(lhs: Mark, rhs: Readonly<Mark>): Mark | undefined {\n\tif (rhs.type !== lhs.type) {\n\t\treturn undefined;\n\t}\n\n\tif (!areMergeableCellIds(lhs.cellId, lhs.count, rhs.cellId)) {\n\t\treturn undefined;\n\t}\n\n\tif (rhs.changes !== undefined || lhs.changes !== undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst mergedEffect = tryMergeEffects(lhs, rhs, lhs.count);\n\tif (mergedEffect === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn { ...lhs, ...mergedEffect, count: lhs.count + rhs.count };\n}\n\nfunction tryMergeEffects(\n\tlhs: MarkEffect,\n\trhs: MarkEffect,\n\tlhsCount: number,\n): MarkEffect | undefined {\n\tif (lhs.type !== rhs.type) {\n\t\treturn undefined;\n\t}\n\n\tif (rhs.type === NoopMarkType) {\n\t\treturn lhs;\n\t}\n\n\tif (\n\t\t(lhs as Partial<HasRevisionTag>).revision !== (rhs as Partial<HasRevisionTag>).revision\n\t) {\n\t\treturn undefined;\n\t}\n\n\tif (\n\t\tisDetach(lhs) &&\n\t\tisDetach(rhs) &&\n\t\t!areMergeableChangeAtoms(lhs.cellRename, lhsCount, rhs.cellRename)\n\t) {\n\t\treturn undefined;\n\t}\n\n\tconst type = rhs.type;\n\tswitch (type) {\n\t\tcase \"Remove\": {\n\t\t\tconst lhsDetach = lhs as Detach;\n\t\t\tif (\n\t\t\t\t(lhsDetach.id as number) + lhsCount === rhs.id &&\n\t\t\t\tareMergeableChangeAtoms(lhsDetach.cellRename, lhsCount, rhs.cellRename) &&\n\t\t\t\tareMergeableChangeAtoms(lhsDetach.detachCellId, lhsCount, rhs.detachCellId)\n\t\t\t) {\n\t\t\t\treturn lhsDetach;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"Rename\": {\n\t\t\tconst lhsDetach = lhs as Rename;\n\t\t\tif (areMergeableChangeAtoms(lhsDetach.idOverride, lhsCount, rhs.idOverride)) {\n\t\t\t\treturn lhsDetach;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"Insert\": {\n\t\t\tconst lhsInsert = lhs as Attach;\n\t\t\tif (\n\t\t\t\t(lhsInsert.id as number) + lhsCount === rhs.id &&\n\t\t\t\tareMergeableChangeAtoms(lhsInsert.detachCellId, lhsCount, rhs.detachCellId)\n\t\t\t) {\n\t\t\t\treturn lhsInsert;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(type);\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Splits the `mark` into two marks such that the first returned mark has length `length`.\n * @param mark - The mark to split.\n * @param revision - The revision of the changeset the mark is part of.\n * @param length - The desired length for the first of the two returned marks.\n * @param genId - An ID allocator\n * @param moveEffects - The table in which to record splitting of move marks\n * @param recordMoveEffect - Whether when splitting a move an entry should be added to `moveEffects` indicating that the mark should be split (in case we process this mark again).\n * An entry is always added to `moveEffects` indicating that the opposite end of the move should be split.\n * @returns A pair of marks equivalent to the original `mark`\n * such that the first returned mark has input length `length`.\n */\nexport function splitMark<TMark extends Mark>(mark: TMark, length: number): [TMark, TMark] {\n\tconst markLength = mark.count;\n\tconst remainder = markLength - length;\n\tif (length < 1 || remainder < 1) {\n\t\tfail(0xb2d /* Unable to split mark due to lengths */);\n\t}\n\n\tconst [effect1, effect2] = splitMarkEffect(mark, length);\n\tconst mark1 = { ...mark, ...effect1, count: length };\n\tconst mark2 = { ...mark, ...effect2, count: remainder };\n\tif (mark2.cellId !== undefined) {\n\t\tmark2.cellId = splitDetachEvent(mark2.cellId, length);\n\t}\n\n\treturn [mark1, mark2];\n}\n\nexport function splitMarkEffect<TEffect extends MarkEffect>(\n\teffect: TEffect,\n\tlength: number,\n): [TEffect, TEffect] {\n\tconst type = effect.type;\n\tswitch (type) {\n\t\tcase NoopMarkType: {\n\t\t\treturn [effect, effect];\n\t\t}\n\t\tcase \"Insert\": {\n\t\t\tconst effect1: TEffect = {\n\t\t\t\t...effect,\n\t\t\t};\n\t\t\tconst effect2: TEffect = {\n\t\t\t\t...effect,\n\t\t\t\tid: (effect.id as number) + length,\n\t\t\t};\n\n\t\t\tif (effect.detachCellId !== undefined) {\n\t\t\t\t(effect2 as Attach).detachCellId = splitDetachEvent(effect.detachCellId, length);\n\t\t\t}\n\t\t\treturn [effect1, effect2];\n\t\t}\n\t\tcase \"Remove\": {\n\t\t\tconst effect1 = { ...effect };\n\t\t\tconst id2: ChangesetLocalId = brand((effect.id as number) + length);\n\t\t\tconst effect2 = { ...effect, id: id2 };\n\t\t\tconst effect2Remove = effect2 as Mutable<Detach>;\n\t\t\tif (effect2Remove.cellRename !== undefined) {\n\t\t\t\teffect2Remove.cellRename = splitDetachEvent(effect2Remove.cellRename, length);\n\t\t\t}\n\n\t\t\tif (effect2Remove.detachCellId !== undefined) {\n\t\t\t\teffect2Remove.detachCellId = splitDetachEvent(effect2Remove.detachCellId, length);\n\t\t\t}\n\t\t\treturn [effect1, effect2];\n\t\t}\n\t\tcase \"Rename\": {\n\t\t\tconst effect1 = { ...effect };\n\t\t\tconst effect2 = { ...effect };\n\t\t\tconst effect2Rename = effect2 as Mutable<Rename>;\n\t\t\tif (effect2Rename.idOverride !== undefined) {\n\t\t\t\teffect2Rename.idOverride = splitDetachEvent(effect2Rename.idOverride, length);\n\t\t\t}\n\t\t\treturn [effect1, effect2];\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(type);\n\t\t}\n\t}\n}\n\nfunction splitDetachEvent(detachEvent: CellId, length: number): CellId {\n\treturn { ...detachEvent, localId: brand((detachEvent.localId as number) + length) };\n}\n\n// TODO: Refactor MarkEffect into a field of CellMark so this function isn't necessary.\nexport function extractMarkEffect<TEffect extends MarkEffect>(\n\tmark: CellMark<TEffect>,\n): TEffect {\n\tconst { cellId: _cellId, count: _count, changes: _changes, ...effect } = mark;\n\treturn effect as unknown as TEffect;\n}\n\n// TODO: Refactor MarkEffect into a field of CellMark so this function isn't necessary.\nexport function omitMarkEffect(mark: CellMark<unknown>): CellMark<NoopMark> {\n\tconst { cellId, count, changes } = mark;\n\tconst noopMark: CellMark<NoopMark> = { count };\n\tif (cellId !== undefined) {\n\t\tnoopMark.cellId = cellId;\n\t}\n\tif (changes !== undefined) {\n\t\tnoopMark.changes = changes;\n\t}\n\treturn noopMark;\n}\n\nexport function withNodeChange<TMark extends CellMark<TKind>, TKind extends MarkEffect>(\n\tmark: TMark,\n\tchanges: NodeId | undefined,\n): TMark {\n\tconst newMark = { ...mark };\n\tif (changes === undefined) {\n\t\tdelete newMark.changes;\n\t} else {\n\t\tnewMark.changes = changes;\n\t}\n\treturn newMark;\n}\n\nexport function withRevision<TMark extends Mark>(\n\tmark: TMark,\n\trevision: RevisionTag | undefined,\n): TMark {\n\tif (revision === undefined) {\n\t\treturn mark;\n\t}\n\n\tconst cloned = cloneMark(mark);\n\taddRevision(cloned, revision);\n\tif (\n\t\tcloned.cellId !== undefined &&\n\t\tcloned.cellId.revision === undefined &&\n\t\trevision !== undefined\n\t) {\n\t\t(cloned.cellId as Mutable<CellId>).revision = revision;\n\t}\n\treturn cloned;\n}\n\nfunction addRevision(effect: MarkEffect, revision: RevisionTag): void {\n\tif (effect.type === NoopMarkType || isRename(effect)) {\n\t\treturn;\n\t}\n\n\tassert(\n\t\teffect.revision === undefined || effect.revision === revision,\n\t\t0x829 /* Should not overwrite mark revision */,\n\t);\n\teffect.revision = revision;\n}\n\nexport function getCrossFieldKeys(change: Changeset): CrossFieldKeyRange[] {\n\tconst keys: CrossFieldKeyRange[] = [];\n\tfor (const mark of change) {\n\t\tkeys.push(...getCrossFieldKeysForMark(mark, mark.count));\n\t}\n\n\treturn keys;\n}\n\nfunction getCrossFieldKeysForMark(mark: Mark, count: number): CrossFieldKeyRange[] {\n\tswitch (mark.type) {\n\t\tcase \"Insert\": {\n\t\t\tconst keys = [\n\t\t\t\t{\n\t\t\t\t\tkey: {\n\t\t\t\t\t\trevision: mark.revision,\n\t\t\t\t\t\tlocalId: mark.id,\n\t\t\t\t\t\ttarget: CrossFieldTarget.Destination,\n\t\t\t\t\t},\n\t\t\t\t\tcount,\n\t\t\t\t},\n\t\t\t];\n\n\t\t\tif (mark.cellId === undefined) {\n\t\t\t\t// This is a pin, which is treated as a detach and attach.\n\t\t\t\tkeys.push({\n\t\t\t\t\tkey: { revision: mark.revision, localId: mark.id, target: CrossFieldTarget.Source },\n\t\t\t\t\tcount,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn keys;\n\t\t}\n\t\tcase \"Remove\": {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tkey: {\n\t\t\t\t\t\trevision: mark.revision,\n\t\t\t\t\t\tlocalId: mark.id,\n\t\t\t\t\t\ttarget: CrossFieldTarget.Source,\n\t\t\t\t\t},\n\t\t\t\t\tcount,\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\t\tdefault: {\n\t\t\treturn [];\n\t\t}\n\t}\n}\n"]}
|
|
@@ -321,19 +321,19 @@ export function prefixFieldPath(prefix, path) {
|
|
|
321
321
|
* TODO: tests for this.
|
|
322
322
|
*/
|
|
323
323
|
export function prefixPathPrefix(root, inner) {
|
|
324
|
-
if (inner.parent
|
|
324
|
+
if (inner.parent === undefined) {
|
|
325
325
|
const composedPrefix = {
|
|
326
|
-
parent:
|
|
327
|
-
rootFieldOverride: inner.rootFieldOverride,
|
|
328
|
-
indexOffset: inner.indexOffset,
|
|
326
|
+
parent: root.parent,
|
|
327
|
+
rootFieldOverride: root.rootFieldOverride ?? inner.rootFieldOverride,
|
|
328
|
+
indexOffset: (inner.indexOffset ?? 0) + (root.indexOffset ?? 0),
|
|
329
329
|
};
|
|
330
330
|
return composedPrefix;
|
|
331
331
|
}
|
|
332
332
|
else {
|
|
333
333
|
const composedPrefix = {
|
|
334
|
-
parent: root.parent,
|
|
335
|
-
rootFieldOverride:
|
|
336
|
-
indexOffset:
|
|
334
|
+
parent: new PrefixedPath(root, inner.parent),
|
|
335
|
+
rootFieldOverride: inner.rootFieldOverride,
|
|
336
|
+
indexOffset: inner.indexOffset,
|
|
337
337
|
};
|
|
338
338
|
return composedPrefix;
|
|
339
339
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeCursorUtils.js","sourceRoot":"","sources":["../../src/feature-libraries/treeCursorUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EAEN,YAAY,EASZ,kBAAkB,EAClB,SAAS,GACT,MAAM,kBAAkB,CAAC;AAwB1B;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAClC,OAA6B,EAC7B,IAAW;IAEX,OAAO,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AACpD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CACnC,OAA6B,EAC7B,IAAW,EACX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,CAAC;QACpD,CAAC;aAAM,CAAC;YACP,OAAO,IAAI,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACvC,CAAC;IACF,CAAC;AACF,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,YAAY;IAGxB,YACiB,MAAsB,EACtB,IAAY;QADZ,WAAM,GAAN,MAAM,CAAgB;QACtB,SAAI,GAAJ,IAAI,CAAQ;QAE5B,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAC/B,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,iBAAiB,IAAI,IAAI,CAAC,WAAW,CAAC;YAChE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,GAAG,CAAC,MAAM,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC;QACjE,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;YACpC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACrC,CAAC;IACF,CAAC;IACD,IAAW,MAAM;QAChB,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob, debugAssert, fail } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\tCursorLocationType,\n\tCursorMarker,\n\ttype DetachedField,\n\ttype FieldKey,\n\ttype FieldUpPath,\n\ttype ITreeCursorSynchronous,\n\ttype PathRootPrefix,\n\ttype TreeType,\n\ttype UpPath,\n\ttype Value,\n\tdetachedFieldAsKey,\n\trootField,\n} from \"../core/index.js\";\n\n/**\n * {@link ITreeCursorSynchronous} that can return the underlying node objects.\n */\nexport interface CursorWithNode<TNode> extends ITreeCursorSynchronous {\n\t/**\n\t * Gets the underlying object for the current node.\n\t *\n\t * Only valid when `mode` is `Nodes`.\n\t */\n\tgetNode(): TNode;\n\n\t/**\n\t * Create a copy of this cursor which navigates independently,\n\t * and is initially located at the same place as this one.\n\t *\n\t * Depending on the cursor implementation this may be significantly faster\n\t * than other ways to copy the cursor\n\t * (such as creating a new one and walking the path from this one).\n\t */\n\tfork(): CursorWithNode<TNode>;\n}\n\n/**\n * Create a cursor, in `nodes` mode at the root of the provided tree.\n *\n * @returns an {@link ITreeCursorSynchronous} for a single root in `nodes` mode.\n */\nexport function stackTreeNodeCursor<TNode>(\n\tadapter: CursorAdapter<TNode>,\n\troot: TNode,\n): CursorWithNode<TNode> {\n\treturn new StackCursor(adapter, [], [], [root], 0);\n}\n\n/**\n * Create a cursor, in `fields` mode at the `detachedField` under the provided `root`.\n *\n * @returns an {@link ITreeCursorSynchronous} for `detachedField` of `root` in `fields` mode.\n */\nexport function stackTreeFieldCursor<TNode>(\n\tadapter: CursorAdapter<TNode>,\n\troot: TNode,\n\tdetachedField: DetachedField = rootField,\n): CursorWithNode<TNode> {\n\tconst cursor = stackTreeNodeCursor(adapter, root);\n\t// Because the root node in `stackTreeNodeCursor` is treated as the above detached fields node,\n\t// using it then just entering the correct field doesn't mess up the paths reported by the cursor.\n\tcursor.enterField(detachedFieldAsKey(detachedField));\n\treturn cursor;\n}\n\n/**\n * The representation of a field used by {@link CursorAdapter}.\n */\nexport type Field<TNode> = Pick<readonly TNode[], typeof Symbol.iterator | \"length\" | number>;\n\n/**\n * Provides functionality to allow a {@link stackTreeNodeCursor} and {@link stackTreeFieldCursor} to implement cursors.\n */\nexport interface CursorAdapter<TNode> {\n\t/**\n\t * @returns the value of the given node.\n\t */\n\tvalue(node: TNode): Value;\n\t/**\n\t * @returns the type of the given node.\n\t */\n\ttype(node: TNode): TreeType;\n\t/**\n\t * @returns the keys for non-empty fields on the given node.\n\t */\n\tkeysFromNode(node: TNode): readonly FieldKey[];\n\t/**\n\t * @returns the child nodes for the given node and key.\n\t */\n\tgetFieldFromNode(node: TNode, key: FieldKey): Field<TNode>;\n}\n\ntype SiblingsOrKey<TNode> = Field<TNode> | readonly FieldKey[];\n\n/**\n * A class that satisfies part of the ITreeCursorSynchronous implementation.\n */\nexport abstract class SynchronousCursor {\n\tpublic readonly [CursorMarker] = true;\n\tpublic readonly pending = false;\n\n\tpublic skipPendingFields(): boolean {\n\t\treturn true;\n\t}\n}\n\n/**\n * A simple general purpose ITreeCursorSynchronous implementation.\n *\n * As this is a generic implementation, it's ability to optimize is limited.\n *\n * @privateRemarks\n * Note that TNode can be `null` (and we should support `undefined` as well),\n * so be careful using types like `TNode | undefined` and expressions like `TNode ??`.\n *\n * TODO:\n * 1. Unit tests for this.\n * 2. Support for cursors which are field cursors at the root.\n */\nclass StackCursor<TNode> extends SynchronousCursor implements CursorWithNode<TNode> {\n\tpublic override readonly [CursorMarker] = true;\n\t/**\n\t * Might start at special root where fields are detached sequences.\n\t *\n\t * @param adapter - policy logic.\n\t * @param siblingStack - Stack of collections of siblings along the path through the tree:\n\t * does not include current level (which is stored in `siblings`).\n\t * Even levels in the stack (starting from 0) are sequences of nodes and odd levels\n\t * are for fields keys on a node.\n\t * @param indexStack - Stack of indices into the corresponding levels in `siblingStack`.\n\t * @param siblings - Siblings at the current level (not included in `siblingStack`).\n\t * @param index - Index into `siblings`.\n\t */\n\tpublic constructor(\n\t\tprivate readonly adapter: CursorAdapter<TNode>,\n\t\tprivate readonly siblingStack: SiblingsOrKey<TNode>[],\n\t\tprivate readonly indexStack: number[],\n\t\tprivate siblings: SiblingsOrKey<TNode>,\n\t\tprivate index: number,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic getFieldKey(): FieldKey {\n\t\tdebugAssert(() => this.mode === CursorLocationType.Fields || \"must be in fields mode\");\n\t\t// index is kept inbounds as an invariant of the class.\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn (this.siblings as readonly FieldKey[])[this.index]!;\n\t}\n\n\tprivate getStackedFieldKey(height: number): FieldKey {\n\t\tdebugAssert(() => height % 2 === 1 || \"expected odd height when in field\");\n\t\tconst siblingStack = this.siblingStack[height] ?? oob();\n\t\tconst indexStack = this.indexStack[height] ?? oob();\n\t\t// index is kept inbounds as an invariant of the class.\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn (siblingStack as readonly FieldKey[])[indexStack]!;\n\t}\n\n\tprivate getStackedNodeIndex(height: number): number {\n\t\tdebugAssert(() => height % 2 === 0 || \"must be node height\");\n\t\treturn this.indexStack[height] ?? oob();\n\t}\n\n\tprivate getStackedNode(height: number): TNode {\n\t\tconst index = this.getStackedNodeIndex(height);\n\t\t// Can not use `?? oob()` since null and undefined are valid values.\n\t\t// index is kept inbounds as an invariant of the class.\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn (this.siblingStack[height] as Field<TNode>)[index]!;\n\t}\n\n\tpublic getFieldLength(): number {\n\t\tdebugAssert(() => this.mode === CursorLocationType.Fields || \"must be in fields mode\");\n\t\treturn this.getField().length;\n\t}\n\n\tpublic enterNode(index: number): void {\n\t\tdebugAssert(() => this.mode === CursorLocationType.Fields || \"must be in fields mode\");\n\t\tconst siblings = this.getField();\n\t\tif (!(index in siblings)) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`A child does not exist at index '${index}' in field containing ${siblings.length} nodes.`,\n\t\t\t);\n\t\t}\n\t\tthis.siblingStack.push(this.siblings);\n\t\tthis.indexStack.push(this.index);\n\t\tthis.index = index;\n\t\tthis.siblings = siblings;\n\t}\n\n\tpublic getPath(prefix?: PathRootPrefix): UpPath | undefined {\n\t\tassert(this.mode === CursorLocationType.Nodes, 0x3b9 /* must be in nodes mode */);\n\t\treturn this.getOffsetPath(0, prefix);\n\t}\n\n\tpublic getFieldPath(prefix?: PathRootPrefix): FieldUpPath {\n\t\tassert(this.mode === CursorLocationType.Fields, 0x449 /* must be in fields mode */);\n\t\treturn {\n\t\t\tfield:\n\t\t\t\tthis.indexStack.length === 1\n\t\t\t\t\t? (prefix?.rootFieldOverride ?? this.getFieldKey())\n\t\t\t\t\t: this.getFieldKey(),\n\t\t\tparent: this.getOffsetPath(1, prefix),\n\t\t};\n\t}\n\n\tprivate getOffsetPath(\n\t\toffset: number,\n\t\tprefix: PathRootPrefix | undefined,\n\t): UpPath | undefined {\n\t\t// It is more efficient to handle prefix directly in here rather than delegating to PrefixedPath.\n\n\t\tconst length = this.indexStack.length - offset;\n\t\tif (length === 0) {\n\t\t\treturn prefix?.parent; // At root\n\t\t}\n\n\t\tassert(length > 0, 0x44a /* invalid offset to above root */);\n\t\tassert(length % 2 === 0, 0x44b /* offset path must point to node not field */);\n\n\t\tconst getIndex = (height: number): number => {\n\t\t\tlet parentIndex: number =\n\t\t\t\theight === this.indexStack.length ? this.index : this.getStackedNodeIndex(height);\n\t\t\tif (prefix !== undefined && height === 2) {\n\t\t\t\tparentIndex += prefix.indexOffset ?? 0;\n\t\t\t}\n\t\t\treturn parentIndex;\n\t\t};\n\n\t\t// Perf Note:\n\t\t// This is O(depth) in tree.\n\t\t// If many different anchors are created, this could be optimized to amortize the costs.\n\t\t// For example, the cursor could cache UpPaths from the anchorSet when creating an anchor,\n\t\t// then reuse them as a starting point when making another.\n\t\t// Could cache this at one depth, and remember the depth.\n\t\t// When navigating up, adjust cached anchor if present.\n\n\t\tlet path: UpPath | undefined = prefix?.parent;\n\t\t// Skip top level, since root node in path is \"undefined\" and does not have a parent or index.\n\t\tfor (let height = 2; height <= length; height += 2) {\n\t\t\tconst fieldOverride = height === 2 ? prefix?.rootFieldOverride : undefined;\n\t\t\tpath = {\n\t\t\t\tparent: path,\n\t\t\t\tparentIndex: getIndex(height),\n\t\t\t\tparentField: fieldOverride ?? this.getStackedFieldKey(height - 1),\n\t\t\t};\n\t\t}\n\n\t\treturn path;\n\t}\n\n\tpublic fork(): StackCursor<TNode> {\n\t\t// Siblings arrays are not modified during navigation and do not need be be copied.\n\t\t// This allows this copy to be shallow, and `this.siblings` below to not be copied as all.\n\t\treturn new StackCursor<TNode>(\n\t\t\tthis.adapter,\n\t\t\t[...this.siblingStack],\n\t\t\t[...this.indexStack],\n\t\t\tthis.siblings,\n\t\t\tthis.index,\n\t\t);\n\t}\n\n\tpublic enterField(key: FieldKey): void {\n\t\tdebugAssert(() => this.mode === CursorLocationType.Nodes || \"must be in nodes mode\");\n\t\tthis.siblingStack.push(this.siblings);\n\t\tthis.indexStack.push(this.index);\n\n\t\t// For fields, siblings are only used for key lookup and\n\t\t// nextField and which has arbitrary iteration order,\n\t\t// so making a array of just key here works.\n\t\t// This adds an allocation, so it's optimizing code simplicity and for the other use case (enumeration)\n\t\t// at the cost of an allocation here.\n\t\tthis.index = 0;\n\t\tthis.siblings = [key];\n\t}\n\n\tpublic get mode(): CursorLocationType {\n\t\treturn this.siblingStack.length % 2 === 0\n\t\t\t? CursorLocationType.Nodes\n\t\t\t: CursorLocationType.Fields;\n\t}\n\n\tpublic nextField(): boolean {\n\t\tthis.index += 1;\n\t\tif (this.index === (this.siblings as []).length) {\n\t\t\tthis.exitField();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic firstField(): boolean {\n\t\tdebugAssert(() => this.mode === CursorLocationType.Nodes || \"must be in nodes mode\");\n\t\tconst fields = this.adapter.keysFromNode(this.getNode());\n\t\tif (fields.length === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.siblingStack.push(this.siblings);\n\t\tthis.indexStack.push(this.index);\n\t\tthis.index = 0;\n\t\tthis.siblings = fields;\n\t\treturn true;\n\t}\n\n\tpublic seekNodes(offset: number): boolean {\n\t\tdebugAssert(\n\t\t\t() => this.mode === CursorLocationType.Nodes || \"can only seekNodes when in Nodes\",\n\t\t);\n\t\tthis.index += offset;\n\t\tif (this.index in this.siblings) {\n\t\t\treturn true;\n\t\t}\n\t\tthis.exitNode();\n\t\treturn false;\n\t}\n\n\tpublic firstNode(): boolean {\n\t\tdebugAssert(\n\t\t\t() => this.mode === CursorLocationType.Fields || \"firstNode only allowed in fields mode\",\n\t\t);\n\t\tconst nodes = this.getField();\n\t\tif (nodes.length === 0) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.siblingStack.push(this.siblings);\n\t\tthis.indexStack.push(this.index);\n\t\tthis.index = 0;\n\t\tthis.siblings = nodes;\n\t\treturn true;\n\t}\n\n\tpublic nextNode(): boolean {\n\t\tdebugAssert(\n\t\t\t() => this.mode === CursorLocationType.Nodes || \"can only nextNode when in Nodes\",\n\t\t);\n\t\tthis.index++;\n\t\tif (this.index < (this.siblings as []).length) {\n\t\t\treturn true;\n\t\t}\n\t\tthis.exitNode();\n\t\treturn false;\n\t}\n\n\tpublic exitField(): void {\n\t\tdebugAssert(\n\t\t\t() =>\n\t\t\t\tthis.mode === CursorLocationType.Fields ||\n\t\t\t\t\"can only navigate up from field when in field\",\n\t\t);\n\t\tthis.siblings =\n\t\t\tthis.siblingStack.pop() ?? fail(0xac3 /* Unexpected siblingStack.length */);\n\t\tthis.index = this.indexStack.pop() ?? fail(0xac4 /* Unexpected indexStack.length */);\n\t}\n\n\tpublic exitNode(): void {\n\t\tdebugAssert(\n\t\t\t() =>\n\t\t\t\tthis.mode === CursorLocationType.Nodes ||\n\t\t\t\t\"can only navigate up from node when in node\",\n\t\t);\n\t\tthis.siblings =\n\t\t\tthis.siblingStack.pop() ?? fail(0xac5 /* Unexpected siblingStack.length */);\n\t\tthis.index = this.indexStack.pop() ?? fail(0xac6 /* Unexpected indexStack.length */);\n\t}\n\n\tpublic getNode(): TNode {\n\t\tdebugAssert(\n\t\t\t() => this.mode === CursorLocationType.Nodes || \"can only get node when in node\",\n\t\t);\n\t\t// Can not use `?? oob()` since null and undefined are valid values.\n\t\t// index is kept inbounds as an invariant of the class.\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn (this.siblings as Field<TNode>)[this.index]!;\n\t}\n\n\tprivate getField(): Field<TNode> {\n\t\tdebugAssert(\n\t\t\t() => this.mode === CursorLocationType.Fields || \"can only get field when in fields\",\n\t\t);\n\t\tconst parent = this.getStackedNode(this.indexStack.length - 1);\n\t\tconst key: FieldKey = this.getFieldKey();\n\t\tconst field = this.adapter.getFieldFromNode(parent, key);\n\t\treturn field;\n\t}\n\n\t/**\n\t * The value of the current node\n\t */\n\tpublic get value(): Value {\n\t\treturn this.adapter.value(this.getNode());\n\t}\n\n\t/**\n\t * The type of the current node\n\t */\n\tpublic get type(): TreeType {\n\t\treturn this.adapter.type(this.getNode());\n\t}\n\n\tpublic get fieldIndex(): number {\n\t\tdebugAssert(\n\t\t\t() => this.mode === CursorLocationType.Nodes || \"can only node's index when in node\",\n\t\t);\n\t\treturn this.index;\n\t}\n\n\tpublic get chunkStart(): number {\n\t\treturn this.fieldIndex;\n\t}\n\n\tpublic readonly chunkLength = 1;\n}\n\n/**\n * Apply `prefix` to `path`.\n */\nexport function prefixPath(\n\tprefix: PathRootPrefix | undefined,\n\tpath: UpPath | undefined,\n): UpPath | undefined {\n\tif (prefix === undefined) {\n\t\treturn path;\n\t}\n\tif (\n\t\tprefix.parent === undefined &&\n\t\tprefix.rootFieldOverride === undefined &&\n\t\t(prefix.indexOffset ?? 0) === 0\n\t) {\n\t\treturn path;\n\t}\n\treturn applyPrefix(prefix, path);\n}\n\n/**\n * Apply `prefix` to `path`.\n */\nexport function prefixFieldPath(\n\tprefix: PathRootPrefix | undefined,\n\tpath: FieldUpPath,\n): FieldUpPath {\n\tif (prefix === undefined) {\n\t\treturn path;\n\t}\n\tif (\n\t\tprefix.parent === undefined &&\n\t\tprefix.rootFieldOverride === undefined &&\n\t\t(prefix.indexOffset ?? 0) === 0\n\t) {\n\t\treturn path;\n\t}\n\treturn {\n\t\tfield: path.parent === undefined ? (prefix.rootFieldOverride ?? path.field) : path.field,\n\t\tparent: prefixPath(prefix, path.parent),\n\t};\n}\n\n/**\n * Compose two prefixes together.\n * `prefixFieldPath(root, prefixFieldPath(inner, path))` should be the same as `prefixFieldPath(prefixPathPrefix(root, inner), path))`\n *\n * TODO: tests for this.\n */\nexport function prefixPathPrefix(root: PathRootPrefix, inner: PathRootPrefix): PathRootPrefix {\n\tif (inner.parent !== undefined) {\n\t\tconst composedPrefix: PathRootPrefix = {\n\t\t\tparent: new PrefixedPath(root, inner.parent),\n\t\t\trootFieldOverride: inner.rootFieldOverride,\n\t\t\tindexOffset: inner.indexOffset,\n\t\t};\n\t\treturn composedPrefix;\n\t} else {\n\t\tconst composedPrefix: PathRootPrefix = {\n\t\t\tparent: root.parent,\n\t\t\trootFieldOverride: root.rootFieldOverride ?? inner.rootFieldOverride,\n\t\t\tindexOffset: (inner.indexOffset ?? 0) + (root.indexOffset ?? 0),\n\t\t};\n\t\treturn composedPrefix;\n\t}\n}\n\nfunction applyPrefix(prefix: PathRootPrefix, path: UpPath | undefined): UpPath | undefined {\n\tif (path === undefined) {\n\t\treturn prefix.parent;\n\t} else {\n\t\t// As an optimization, avoid double wrapping paths with multiple prefixes\n\t\tif (path instanceof PrefixedPath) {\n\t\t\tconst composedPrefix: PathRootPrefix = prefixPathPrefix(prefix, path.prefix);\n\t\t\treturn new PrefixedPath(composedPrefix, path.path);\n\t\t} else {\n\t\t\treturn new PrefixedPath(prefix, path);\n\t\t}\n\t}\n}\n\n/**\n * Wrapper around a path that adds a prefix to the root.\n *\n * Exported for testing: use `prefixPath` and `prefixFieldPath` to construct.\n */\nexport class PrefixedPath implements UpPath {\n\tpublic readonly parentField: FieldKey;\n\tpublic readonly parentIndex: number;\n\tpublic constructor(\n\t\tpublic readonly prefix: PathRootPrefix,\n\t\tpublic readonly path: UpPath,\n\t) {\n\t\tif (path.parent === undefined) {\n\t\t\tthis.parentField = prefix.rootFieldOverride ?? path.parentField;\n\t\t\tthis.parentIndex = path.parentIndex + (prefix.indexOffset ?? 0);\n\t\t} else {\n\t\t\tthis.parentField = path.parentField;\n\t\t\tthis.parentIndex = path.parentIndex;\n\t\t}\n\t}\n\tpublic get parent(): UpPath | undefined {\n\t\treturn applyPrefix(this.prefix, this.path.parent);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"treeCursorUtils.js","sourceRoot":"","sources":["../../src/feature-libraries/treeCursorUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EAEN,YAAY,EASZ,kBAAkB,EAClB,SAAS,GACT,MAAM,kBAAkB,CAAC;AAwB1B;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAClC,OAA6B,EAC7B,IAAW;IAEX,OAAO,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AACpD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CACnC,OAA6B,EAC7B,IAAW,EACX,gBAA+B,SAAS;IAExC,MAAM,MAAM,GAAG,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAClD,+FAA+F;IAC/F,kGAAkG;IAClG,MAAM,CAAC,UAAU,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC,CAAC;IACrD,OAAO,MAAM,CAAC;AACf,CAAC;AA+BD;;GAEG;AACH,MAAM,OAAgB,iBAAiB;IAAvC;QACiB,QAAc,GAAG,IAAI,CAAC;QACtB,YAAO,GAAG,KAAK,CAAC;IAKjC,CAAC;IAHO,iBAAiB;QACvB,OAAO,IAAI,CAAC;IACb,CAAC;CACD;KANiB,YAAY;AAQ9B;;;;;;;;;;;;GAYG;AACH,MAAM,WAAmB,SAAQ,iBAAiB;IAEjD;;;;;;;;;;;OAWG;IACH,YACkB,OAA6B,EAC7B,YAAoC,EACpC,UAAoB,EAC7B,QAA8B,EAC9B,KAAa;QAErB,KAAK,EAAE,CAAC;QANS,YAAO,GAAP,O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I,CAAC,WAAW,CAAC;QACrC,CAAC;IACF,CAAC;IACD,IAAW,MAAM;QAChB,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob, debugAssert, fail } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\tCursorLocationType,\n\tCursorMarker,\n\ttype DetachedField,\n\ttype FieldKey,\n\ttype FieldUpPath,\n\ttype ITreeCursorSynchronous,\n\ttype PathRootPrefix,\n\ttype TreeType,\n\ttype UpPath,\n\ttype Value,\n\tdetachedFieldAsKey,\n\trootField,\n} from \"../core/index.js\";\n\n/**\n * {@link ITreeCursorSynchronous} that can return the underlying node objects.\n */\nexport interface CursorWithNode<TNode> extends ITreeCursorSynchronous {\n\t/**\n\t * Gets the underlying object for the current node.\n\t *\n\t * Only valid when `mode` is `Nodes`.\n\t */\n\tgetNode(): TNode;\n\n\t/**\n\t * Create a copy of this cursor which navigates independently,\n\t * and is initially located at the same place as this one.\n\t *\n\t * Depending on the cursor implementation this may be significantly faster\n\t * than other ways to copy the cursor\n\t * (such as creating a new one and walking the path from this one).\n\t */\n\tfork(): CursorWithNode<TNode>;\n}\n\n/**\n * Create a cursor, in `nodes` mode at the root of the provided tree.\n *\n * @returns an {@link ITreeCursorSynchronous} for a single root in `nodes` mode.\n */\nexport function stackTreeNodeCursor<TNode>(\n\tadapter: CursorAdapter<TNode>,\n\troot: TNode,\n): CursorWithNode<TNode> {\n\treturn new StackCursor(adapter, [], [], [root], 0);\n}\n\n/**\n * Create a cursor, in `fields` mode at the `detachedField` under the provided `root`.\n *\n * @returns an {@link ITreeCursorSynchronous} for `detachedField` of `root` in `fields` mode.\n */\nexport function stackTreeFieldCursor<TNode>(\n\tadapter: CursorAdapter<TNode>,\n\troot: TNode,\n\tdetachedField: DetachedField = rootField,\n): CursorWithNode<TNode> {\n\tconst cursor = stackTreeNodeCursor(adapter, root);\n\t// Because the root node in `stackTreeNodeCursor` is treated as the above detached fields node,\n\t// using it then just entering the correct field doesn't mess up the paths reported by the cursor.\n\tcursor.enterField(detachedFieldAsKey(detachedField));\n\treturn cursor;\n}\n\n/**\n * The representation of a field used by {@link CursorAdapter}.\n */\nexport type Field<TNode> = Pick<readonly TNode[], typeof Symbol.iterator | \"length\" | number>;\n\n/**\n * Provides functionality to allow a {@link stackTreeNodeCursor} and {@link stackTreeFieldCursor} to implement cursors.\n */\nexport interface CursorAdapter<TNode> {\n\t/**\n\t * @returns the value of the given node.\n\t */\n\tvalue(node: TNode): Value;\n\t/**\n\t * @returns the type of the given node.\n\t */\n\ttype(node: TNode): TreeType;\n\t/**\n\t * @returns the keys for non-empty fields on the given node.\n\t */\n\tkeysFromNode(node: TNode): readonly FieldKey[];\n\t/**\n\t * @returns the child nodes for the given node and key.\n\t */\n\tgetFieldFromNode(node: TNode, key: FieldKey): Field<TNode>;\n}\n\ntype SiblingsOrKey<TNode> = Field<TNode> | readonly FieldKey[];\n\n/**\n * A class that satisfies part of the ITreeCursorSynchronous implementation.\n */\nexport abstract class SynchronousCursor {\n\tpublic readonly [CursorMarker] = true;\n\tpublic readonly pending = false;\n\n\tpublic skipPendingFields(): boolean {\n\t\treturn true;\n\t}\n}\n\n/**\n * A simple general purpose ITreeCursorSynchronous implementation.\n *\n * As this is a generic implementation, it's ability to optimize is limited.\n *\n * @privateRemarks\n * Note that TNode can be `null` (and we should support `undefined` as well),\n * so be careful using types like `TNode | undefined` and expressions like `TNode ??`.\n *\n * TODO:\n * 1. Unit tests for this.\n * 2. Support for cursors which are field cursors at the root.\n */\nclass StackCursor<TNode> extends SynchronousCursor implements CursorWithNode<TNode> {\n\tpublic override readonly [CursorMarker] = true;\n\t/**\n\t * Might start at special root where fields are detached sequences.\n\t *\n\t * @param adapter - policy logic.\n\t * @param siblingStack - Stack of collections of siblings along the path through the tree:\n\t * does not include current level (which is stored in `siblings`).\n\t * Even levels in the stack (starting from 0) are sequences of nodes and odd levels\n\t * are for fields keys on a node.\n\t * @param indexStack - Stack of indices into the corresponding levels in `siblingStack`.\n\t * @param siblings - Siblings at the current level (not included in `siblingStack`).\n\t * @param index - Index into `siblings`.\n\t */\n\tpublic constructor(\n\t\tprivate readonly adapter: CursorAdapter<TNode>,\n\t\tprivate readonly siblingStack: SiblingsOrKey<TNode>[],\n\t\tprivate readonly indexStack: number[],\n\t\tprivate siblings: SiblingsOrKey<TNode>,\n\t\tprivate index: number,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic getFieldKey(): FieldKey {\n\t\tdebugAssert(() => this.mode === CursorLocationType.Fields || \"must be in fields mode\");\n\t\t// index is kept inbounds as an invariant of the class.\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn (this.siblings as readonly FieldKey[])[this.index]!;\n\t}\n\n\tprivate getStackedFieldKey(height: number): FieldKey {\n\t\tdebugAssert(() => height % 2 === 1 || \"expected odd height when in field\");\n\t\tconst siblingStack = this.siblingStack[height] ?? oob();\n\t\tconst indexStack = this.indexStack[height] ?? oob();\n\t\t// index is kept inbounds as an invariant of the class.\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn (siblingStack as readonly FieldKey[])[indexStack]!;\n\t}\n\n\tprivate getStackedNodeIndex(height: number): number {\n\t\tdebugAssert(() => height % 2 === 0 || \"must be node height\");\n\t\treturn this.indexStack[height] ?? oob();\n\t}\n\n\tprivate getStackedNode(height: number): TNode {\n\t\tconst index = this.getStackedNodeIndex(height);\n\t\t// Can not use `?? oob()` since null and undefined are valid values.\n\t\t// index is kept inbounds as an invariant of the class.\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn (this.siblingStack[height] as Field<TNode>)[index]!;\n\t}\n\n\tpublic getFieldLength(): number {\n\t\tdebugAssert(() => this.mode === CursorLocationType.Fields || \"must be in fields mode\");\n\t\treturn this.getField().length;\n\t}\n\n\tpublic enterNode(index: number): void {\n\t\tdebugAssert(() => this.mode === CursorLocationType.Fields || \"must be in fields mode\");\n\t\tconst siblings = this.getField();\n\t\tif (!(index in siblings)) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`A child does not exist at index '${index}' in field containing ${siblings.length} nodes.`,\n\t\t\t);\n\t\t}\n\t\tthis.siblingStack.push(this.siblings);\n\t\tthis.indexStack.push(this.index);\n\t\tthis.index = index;\n\t\tthis.siblings = siblings;\n\t}\n\n\tpublic getPath(prefix?: PathRootPrefix): UpPath | undefined {\n\t\tassert(this.mode === CursorLocationType.Nodes, 0x3b9 /* must be in nodes mode */);\n\t\treturn this.getOffsetPath(0, prefix);\n\t}\n\n\tpublic getFieldPath(prefix?: PathRootPrefix): FieldUpPath {\n\t\tassert(this.mode === CursorLocationType.Fields, 0x449 /* must be in fields mode */);\n\t\treturn {\n\t\t\tfield:\n\t\t\t\tthis.indexStack.length === 1\n\t\t\t\t\t? (prefix?.rootFieldOverride ?? this.getFieldKey())\n\t\t\t\t\t: this.getFieldKey(),\n\t\t\tparent: this.getOffsetPath(1, prefix),\n\t\t};\n\t}\n\n\tprivate getOffsetPath(\n\t\toffset: number,\n\t\tprefix: PathRootPrefix | undefined,\n\t): UpPath | undefined {\n\t\t// It is more efficient to handle prefix directly in here rather than delegating to PrefixedPath.\n\n\t\tconst length = this.indexStack.length - offset;\n\t\tif (length === 0) {\n\t\t\treturn prefix?.parent; // At root\n\t\t}\n\n\t\tassert(length > 0, 0x44a /* invalid offset to above root */);\n\t\tassert(length % 2 === 0, 0x44b /* offset path must point to node not field */);\n\n\t\tconst getIndex = (height: number): number => {\n\t\t\tlet parentIndex: number =\n\t\t\t\theight === this.indexStack.length ? this.index : this.getStackedNodeIndex(height);\n\t\t\tif (prefix !== undefined && height === 2) {\n\t\t\t\tparentIndex += prefix.indexOffset ?? 0;\n\t\t\t}\n\t\t\treturn parentIndex;\n\t\t};\n\n\t\t// Perf Note:\n\t\t// This is O(depth) in tree.\n\t\t// If many different anchors are created, this could be optimized to amortize the costs.\n\t\t// For example, the cursor could cache UpPaths from the anchorSet when creating an anchor,\n\t\t// then reuse them as a starting point when making another.\n\t\t// Could cache this at one depth, and remember the depth.\n\t\t// When navigating up, adjust cached anchor if present.\n\n\t\tlet path: UpPath | undefined = prefix?.parent;\n\t\t// Skip top level, since root node in path is \"undefined\" and does not have a parent or index.\n\t\tfor (let height = 2; height <= length; height += 2) {\n\t\t\tconst fieldOverride = height === 2 ? prefix?.rootFieldOverride : undefined;\n\t\t\tpath = {\n\t\t\t\tparent: path,\n\t\t\t\tparentIndex: getIndex(height),\n\t\t\t\tparentField: fieldOverride ?? this.getStackedFieldKey(height - 1),\n\t\t\t};\n\t\t}\n\n\t\treturn path;\n\t}\n\n\tpublic fork(): StackCursor<TNode> {\n\t\t// Siblings arrays are not modified during navigation and do not need be be copied.\n\t\t// This allows this copy to be shallow, and `this.siblings` below to not be copied as all.\n\t\treturn new StackCursor<TNode>(\n\t\t\tthis.adapter,\n\t\t\t[...this.siblingStack],\n\t\t\t[...this.indexStack],\n\t\t\tthis.siblings,\n\t\t\tthis.index,\n\t\t);\n\t}\n\n\tpublic enterField(key: FieldKey): void {\n\t\tdebugAssert(() => this.mode === CursorLocationType.Nodes || \"must be in nodes mode\");\n\t\tthis.siblingStack.push(this.siblings);\n\t\tthis.indexStack.push(this.index);\n\n\t\t// For fields, siblings are only used for key lookup and\n\t\t// nextField and which has arbitrary iteration order,\n\t\t// so making a array of just key here works.\n\t\t// This adds an allocation, so it's optimizing code simplicity and for the other use case (enumeration)\n\t\t// at the cost of an allocation here.\n\t\tthis.index = 0;\n\t\tthis.siblings = [key];\n\t}\n\n\tpublic get mode(): CursorLocationType {\n\t\treturn this.siblingStack.length % 2 === 0\n\t\t\t? CursorLocationType.Nodes\n\t\t\t: CursorLocationType.Fields;\n\t}\n\n\tpublic nextField(): boolean {\n\t\tthis.index += 1;\n\t\tif (this.index === (this.siblings as []).length) {\n\t\t\tthis.exitField();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic firstField(): boolean {\n\t\tdebugAssert(() => this.mode === CursorLocationType.Nodes || \"must be in nodes mode\");\n\t\tconst fields = this.adapter.keysFromNode(this.getNode());\n\t\tif (fields.length === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.siblingStack.push(this.siblings);\n\t\tthis.indexStack.push(this.index);\n\t\tthis.index = 0;\n\t\tthis.siblings = fields;\n\t\treturn true;\n\t}\n\n\tpublic seekNodes(offset: number): boolean {\n\t\tdebugAssert(\n\t\t\t() => this.mode === CursorLocationType.Nodes || \"can only seekNodes when in Nodes\",\n\t\t);\n\t\tthis.index += offset;\n\t\tif (this.index in this.siblings) {\n\t\t\treturn true;\n\t\t}\n\t\tthis.exitNode();\n\t\treturn false;\n\t}\n\n\tpublic firstNode(): boolean {\n\t\tdebugAssert(\n\t\t\t() => this.mode === CursorLocationType.Fields || \"firstNode only allowed in fields mode\",\n\t\t);\n\t\tconst nodes = this.getField();\n\t\tif (nodes.length === 0) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.siblingStack.push(this.siblings);\n\t\tthis.indexStack.push(this.index);\n\t\tthis.index = 0;\n\t\tthis.siblings = nodes;\n\t\treturn true;\n\t}\n\n\tpublic nextNode(): boolean {\n\t\tdebugAssert(\n\t\t\t() => this.mode === CursorLocationType.Nodes || \"can only nextNode when in Nodes\",\n\t\t);\n\t\tthis.index++;\n\t\tif (this.index < (this.siblings as []).length) {\n\t\t\treturn true;\n\t\t}\n\t\tthis.exitNode();\n\t\treturn false;\n\t}\n\n\tpublic exitField(): void {\n\t\tdebugAssert(\n\t\t\t() =>\n\t\t\t\tthis.mode === CursorLocationType.Fields ||\n\t\t\t\t\"can only navigate up from field when in field\",\n\t\t);\n\t\tthis.siblings =\n\t\t\tthis.siblingStack.pop() ?? fail(0xac3 /* Unexpected siblingStack.length */);\n\t\tthis.index = this.indexStack.pop() ?? fail(0xac4 /* Unexpected indexStack.length */);\n\t}\n\n\tpublic exitNode(): void {\n\t\tdebugAssert(\n\t\t\t() =>\n\t\t\t\tthis.mode === CursorLocationType.Nodes ||\n\t\t\t\t\"can only navigate up from node when in node\",\n\t\t);\n\t\tthis.siblings =\n\t\t\tthis.siblingStack.pop() ?? fail(0xac5 /* Unexpected siblingStack.length */);\n\t\tthis.index = this.indexStack.pop() ?? fail(0xac6 /* Unexpected indexStack.length */);\n\t}\n\n\tpublic getNode(): TNode {\n\t\tdebugAssert(\n\t\t\t() => this.mode === CursorLocationType.Nodes || \"can only get node when in node\",\n\t\t);\n\t\t// Can not use `?? oob()` since null and undefined are valid values.\n\t\t// index is kept inbounds as an invariant of the class.\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn (this.siblings as Field<TNode>)[this.index]!;\n\t}\n\n\tprivate getField(): Field<TNode> {\n\t\tdebugAssert(\n\t\t\t() => this.mode === CursorLocationType.Fields || \"can only get field when in fields\",\n\t\t);\n\t\tconst parent = this.getStackedNode(this.indexStack.length - 1);\n\t\tconst key: FieldKey = this.getFieldKey();\n\t\tconst field = this.adapter.getFieldFromNode(parent, key);\n\t\treturn field;\n\t}\n\n\t/**\n\t * The value of the current node\n\t */\n\tpublic get value(): Value {\n\t\treturn this.adapter.value(this.getNode());\n\t}\n\n\t/**\n\t * The type of the current node\n\t */\n\tpublic get type(): TreeType {\n\t\treturn this.adapter.type(this.getNode());\n\t}\n\n\tpublic get fieldIndex(): number {\n\t\tdebugAssert(\n\t\t\t() => this.mode === CursorLocationType.Nodes || \"can only node's index when in node\",\n\t\t);\n\t\treturn this.index;\n\t}\n\n\tpublic get chunkStart(): number {\n\t\treturn this.fieldIndex;\n\t}\n\n\tpublic readonly chunkLength = 1;\n}\n\n/**\n * Apply `prefix` to `path`.\n */\nexport function prefixPath(\n\tprefix: PathRootPrefix | undefined,\n\tpath: UpPath | undefined,\n): UpPath | undefined {\n\tif (prefix === undefined) {\n\t\treturn path;\n\t}\n\tif (\n\t\tprefix.parent === undefined &&\n\t\tprefix.rootFieldOverride === undefined &&\n\t\t(prefix.indexOffset ?? 0) === 0\n\t) {\n\t\treturn path;\n\t}\n\treturn applyPrefix(prefix, path);\n}\n\n/**\n * Apply `prefix` to `path`.\n */\nexport function prefixFieldPath(\n\tprefix: PathRootPrefix | undefined,\n\tpath: FieldUpPath,\n): FieldUpPath {\n\tif (prefix === undefined) {\n\t\treturn path;\n\t}\n\tif (\n\t\tprefix.parent === undefined &&\n\t\tprefix.rootFieldOverride === undefined &&\n\t\t(prefix.indexOffset ?? 0) === 0\n\t) {\n\t\treturn path;\n\t}\n\treturn {\n\t\tfield: path.parent === undefined ? (prefix.rootFieldOverride ?? path.field) : path.field,\n\t\tparent: prefixPath(prefix, path.parent),\n\t};\n}\n\n/**\n * Compose two prefixes together.\n * `prefixFieldPath(root, prefixFieldPath(inner, path))` should be the same as `prefixFieldPath(prefixPathPrefix(root, inner), path))`\n *\n * TODO: tests for this.\n */\nexport function prefixPathPrefix(root: PathRootPrefix, inner: PathRootPrefix): PathRootPrefix {\n\tif (inner.parent === undefined) {\n\t\tconst composedPrefix: PathRootPrefix = {\n\t\t\tparent: root.parent,\n\t\t\trootFieldOverride: root.rootFieldOverride ?? inner.rootFieldOverride,\n\t\t\tindexOffset: (inner.indexOffset ?? 0) + (root.indexOffset ?? 0),\n\t\t};\n\t\treturn composedPrefix;\n\t} else {\n\t\tconst composedPrefix: PathRootPrefix = {\n\t\t\tparent: new PrefixedPath(root, inner.parent),\n\t\t\trootFieldOverride: inner.rootFieldOverride,\n\t\t\tindexOffset: inner.indexOffset,\n\t\t};\n\t\treturn composedPrefix;\n\t}\n}\n\nfunction applyPrefix(prefix: PathRootPrefix, path: UpPath | undefined): UpPath | undefined {\n\tif (path === undefined) {\n\t\treturn prefix.parent;\n\t} else {\n\t\t// As an optimization, avoid double wrapping paths with multiple prefixes\n\t\tif (path instanceof PrefixedPath) {\n\t\t\tconst composedPrefix: PathRootPrefix = prefixPathPrefix(prefix, path.prefix);\n\t\t\treturn new PrefixedPath(composedPrefix, path.path);\n\t\t} else {\n\t\t\treturn new PrefixedPath(prefix, path);\n\t\t}\n\t}\n}\n\n/**\n * Wrapper around a path that adds a prefix to the root.\n *\n * Exported for testing: use `prefixPath` and `prefixFieldPath` to construct.\n */\nexport class PrefixedPath implements UpPath {\n\tpublic readonly parentField: FieldKey;\n\tpublic readonly parentIndex: number;\n\tpublic constructor(\n\t\tpublic readonly prefix: PathRootPrefix,\n\t\tpublic readonly path: UpPath,\n\t) {\n\t\tif (path.parent === undefined) {\n\t\t\tthis.parentField = prefix.rootFieldOverride ?? path.parentField;\n\t\t\tthis.parentIndex = path.parentIndex + (prefix.indexOffset ?? 0);\n\t\t} else {\n\t\t\tthis.parentField = path.parentField;\n\t\t\tthis.parentIndex = path.parentIndex;\n\t\t}\n\t}\n\tpublic get parent(): UpPath | undefined {\n\t\treturn applyPrefix(this.prefix, this.path.parent);\n\t}\n}\n"]}
|
|
@@ -58,13 +58,13 @@ export const adapter = {
|
|
|
58
58
|
*/
|
|
59
59
|
export function jsonableTreeFromCursor(cursor) {
|
|
60
60
|
assert(cursor.mode === 0 /* CursorLocationType.Nodes */, 0x3ba /* must start at node */);
|
|
61
|
-
const node = cursor.value
|
|
61
|
+
const node = cursor.value === undefined
|
|
62
62
|
? {
|
|
63
63
|
type: cursor.type,
|
|
64
|
-
value: cursor.value,
|
|
65
64
|
}
|
|
66
65
|
: {
|
|
67
66
|
type: cursor.type,
|
|
67
|
+
value: cursor.value,
|
|
68
68
|
};
|
|
69
69
|
// Normalize object by only including fields that are required.
|
|
70
70
|
for (let inFields = cursor.firstField(); inFields; inFields = cursor.nextField()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeTextCursor.js","sourceRoot":"","sources":["../../src/feature-libraries/treeTextCursor.ts"],"names":[],"mappings":"AAAA;;;GAGG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AM,UAAU,sBAAsB,CAAC,MAAmB;IACzD,MAAM,CAAC,MAAM,CAAC,IAAI,qCAA6B,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACjF,MAAM,IAAI,GACT,MAAM,CAAC,KAAK,KAAK,SAAS;QACzB,CAAC,CAAC;YACA,IAAI,EAAE,MAAM,CAAC,IAAI;SACjB;QACF,CAAC,CAAC;YACA,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,KAAK,EAAE,MAAM,CAAC,KAAK;SACnB,CAAC;IAEL,+DAA+D;IAC/D,KAAK,IAAI,QAAQ,GAAG,MAAM,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC;QAClF,MAAM,KAAK,GAAmB,cAAc,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;QAC7E,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,CAAC;IACxD,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,2BAA2B,CAAC,MAAmB;IAC9D,MAAM,CAAC,MAAM,CAAC,IAAI,sCAA8B,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACnF,OAAO,cAAc,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;AACvD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAA2B;IACjE,MAAM,UAAU,GAAG,MAAM,CAAC,cAAc,EAAE,CAAC;IAC3C,mBAAmB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxC,MAAM,QAAQ,GAAG,2BAA2B,CAAC,UAAU,CAAC,CAAC;IACzD,UAAU,CAAC,IAAI,EAAE,CAAC;IAClB,OAAO,QAAQ,CAAC;AACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tCursorLocationType,\n\ttype DetachedField,\n\ttype IForestSubscription,\n\ttype ITreeCursor,\n\ttype ITreeCursorSynchronous,\n\ttype JsonableTree,\n\taboveRootPlaceholder,\n\tdetachedFieldAsKey,\n\tgenericTreeKeys,\n\tgetGenericTreeField,\n\tmapCursorField,\n\tmoveToDetachedField,\n\trootField,\n\tsetGenericTreeField,\n} from \"../core/index.js\";\n\nimport {\n\ttype CursorAdapter,\n\tstackTreeFieldCursor,\n\tstackTreeNodeCursor,\n} from \"./treeCursorUtils.js\";\n\n/**\n * This module provides support for reading and writing a human readable (and\n * editable) tree format.\n *\n * This implementation can handle all trees (so it does not need a fallback for any special cases),\n * and is not optimized.\n *\n * It's suitable for testing and debugging,\n * though it could also reasonably be used as a fallback for edge cases or for small trees.\n *\n * TODO: Use placeholders.\n * build / add operations should be able to include detached ranges instead of children directly.\n * summaries should be able to reference unloaded chunks instead of having children directly.\n * Leverage placeholders in the types below to accomplish this.\n * Determine how this relates to Cursor: should cursor be generic over placeholder values?\n * (Could use them for errors to allow non erroring cursors?)\n *\n * Note:\n * Currently a lot of Tree's codebase is using json for serialization.\n * Because putting json strings inside json works poorly (adds lots of escaping),\n * for now this library actually outputs and inputs the Json compatible type JsonableTree\n * rather than actual strings.\n */\n\n/**\n * Create a cursor, in `nodes` mode at the root of the provided tree.\n *\n * @returns an {@link ITreeCursorSynchronous} in nodes mode for a single {@link JsonableTree}.\n * @remarks\n * Do not confuse this with {@link JsonableTree} with the JSON domain:\n * this takes in data in a specific format that is json compatible (except for FluidHandle values).\n * That is distinct from treating arbitrary JSON data as a tree in the JSON domain.\n */\nexport function cursorForJsonableTreeNode(root: JsonableTree): ITreeCursorSynchronous {\n\treturn stackTreeNodeCursor(adapter, root);\n}\n\n/**\n * Creates an {@link ITreeCursorSynchronous} in fields mode for a JsonableTree field.\n */\nexport function cursorForJsonableTreeField(\n\ttrees: JsonableTree[],\n\tdetachedField: DetachedField = rootField,\n): ITreeCursorSynchronous {\n\tconst key = detachedFieldAsKey(detachedField);\n\treturn stackTreeFieldCursor(\n\t\tadapter,\n\t\t{ type: aboveRootPlaceholder, fields: { [key]: trees } },\n\t\tdetachedField,\n\t);\n}\n\nexport const adapter: CursorAdapter<JsonableTree> = {\n\tvalue: (node) => node.value,\n\ttype: (node) => node.type,\n\tkeysFromNode: genericTreeKeys,\n\tgetFieldFromNode: (node, key): readonly JsonableTree[] =>\n\t\tgetGenericTreeField(node, key, false),\n};\n\n/**\n * Extract a JsonableTree from the contents of the given ITreeCursor's current node.\n */\nexport function jsonableTreeFromCursor(cursor: ITreeCursor): JsonableTree {\n\tassert(cursor.mode === CursorLocationType.Nodes, 0x3ba /* must start at node */);\n\tconst node: JsonableTree =\n\t\tcursor.value === undefined\n\t\t\t? {\n\t\t\t\t\ttype: cursor.type,\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\ttype: cursor.type,\n\t\t\t\t\tvalue: cursor.value,\n\t\t\t\t};\n\n\t// Normalize object by only including fields that are required.\n\tfor (let inFields = cursor.firstField(); inFields; inFields = cursor.nextField()) {\n\t\tconst field: JsonableTree[] = mapCursorField(cursor, jsonableTreeFromCursor);\n\t\tsetGenericTreeField(node, cursor.getFieldKey(), field);\n\t}\n\treturn node;\n}\n\n/**\n * Extract a JsonableTree from the contents of the given ITreeCursor's current node.\n */\nexport function jsonableTreeFromFieldCursor(cursor: ITreeCursor): JsonableTree[] {\n\tassert(cursor.mode === CursorLocationType.Fields, 0x7ca /* must start at field */);\n\treturn mapCursorField(cursor, jsonableTreeFromCursor);\n}\n\n/**\n * Copy forest content into a JsonableTree.\n * @remarks\n * This is not a time or memory efficient way to pass around forest content:\n * its intended for debugging and testing purposes when forest content is needed in a human readable serializable format.\n */\nexport function jsonableTreeFromForest(forest: IForestSubscription): JsonableTree[] {\n\tconst readCursor = forest.allocateCursor();\n\tmoveToDetachedField(forest, readCursor);\n\tconst jsonable = jsonableTreeFromFieldCursor(readCursor);\n\treadCursor.free();\n\treturn jsonable;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valueUtilities.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/valueUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAIpE,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE3E,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,EAAE,SAAS,EAAE,KAAK,GAAG,OAAO,CAKtF;AAED,wBAAgB,iBAAiB,CAAC,OAAO,SAAS,WAAW,EAC5D,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,KAAK,GACd,SAAS,IAAI,SAAS,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"valueUtilities.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/valueUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAIpE,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE3E,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,EAAE,SAAS,EAAE,KAAK,GAAG,OAAO,CAKtF;AAED,wBAAgB,iBAAiB,CAAC,OAAO,SAAS,WAAW,EAC5D,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,KAAK,GACd,SAAS,IAAI,SAAS,CAAC,OAAO,CAAC,CAqBjC;AAED;;;;;GAKG;AACH,MAAM,MAAM,yBAAyB,GAClC,YAAY,GACZ,MAAM,GACN,MAAM,GACN,OAAO,GAEP,IAAI,GACJ,SAAS,yBAAyB,EAAE,GACpC;IACA,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,yBAAyB;CACjD,CAAC;AAEL,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,SAAS,GAAG,yBAAyB,GAC1C,OAAO,CAAC,KAAK,IAAI,SAAS,CAE5B;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,OAAO,GAAG,SAAS,IAAI,SAAS,CAWtE"}
|
|
@@ -13,18 +13,24 @@ export function allowsValue(schema, nodeValue) {
|
|
|
13
13
|
}
|
|
14
14
|
export function valueSchemaAllows(schema, nodeValue) {
|
|
15
15
|
switch (schema) {
|
|
16
|
-
case ValueSchema.String:
|
|
16
|
+
case ValueSchema.String: {
|
|
17
17
|
return typeof nodeValue === "string";
|
|
18
|
-
|
|
18
|
+
}
|
|
19
|
+
case ValueSchema.Number: {
|
|
19
20
|
return typeof nodeValue === "number";
|
|
20
|
-
|
|
21
|
+
}
|
|
22
|
+
case ValueSchema.Boolean: {
|
|
21
23
|
return typeof nodeValue === "boolean";
|
|
22
|
-
|
|
24
|
+
}
|
|
25
|
+
case ValueSchema.FluidHandle: {
|
|
23
26
|
return isFluidHandle(nodeValue);
|
|
24
|
-
|
|
27
|
+
}
|
|
28
|
+
case ValueSchema.Null: {
|
|
25
29
|
return nodeValue === null;
|
|
26
|
-
|
|
30
|
+
}
|
|
31
|
+
default: {
|
|
27
32
|
unreachableCase(schema);
|
|
33
|
+
}
|
|
28
34
|
}
|
|
29
35
|
}
|
|
30
36
|
export function assertAllowedValue(value) {
|
|
@@ -37,10 +43,12 @@ export function isTreeValue(nodeValue) {
|
|
|
37
43
|
switch (typeof nodeValue) {
|
|
38
44
|
case "string":
|
|
39
45
|
case "number":
|
|
40
|
-
case "boolean":
|
|
46
|
+
case "boolean": {
|
|
41
47
|
return true;
|
|
42
|
-
|
|
48
|
+
}
|
|
49
|
+
default: {
|
|
43
50
|
return nodeValue === null || isFluidHandle(nodeValue);
|
|
51
|
+
}
|
|
44
52
|
}
|
|
45
53
|
}
|
|
46
54
|
//# sourceMappingURL=valueUtilities.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valueUtilities.js","sourceRoot":"","sources":["../../src/feature-libraries/valueUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAEvE,OAAO,EAA8B,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE3E,MAAM,UAAU,WAAW,CAAC,MAA+B,EAAE,SAAgB;IAC5E,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,SAAS,KAAK,SAAS,CAAC;IAChC,CAAC;IACD,OAAO,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,iBAAiB,CAChC,MAAe,EACf,SAAgB;IAEhB,QAAQ,MAAM,EAAE,CAAC;QAChB,KAAK,WAAW,CAAC,MAAM;
|
|
1
|
+
{"version":3,"file":"valueUtilities.js","sourceRoot":"","sources":["../../src/feature-libraries/valueUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAEvE,OAAO,EAA8B,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE3E,MAAM,UAAU,WAAW,CAAC,MAA+B,EAAE,SAAgB;IAC5E,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,SAAS,KAAK,SAAS,CAAC;IAChC,CAAC;IACD,OAAO,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,iBAAiB,CAChC,MAAe,EACf,SAAgB;IAEhB,QAAQ,MAAM,EAAE,CAAC;QAChB,KAAK,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;YACzB,OAAO,OAAO,SAAS,KAAK,QAAQ,CAAC;QACtC,CAAC;QACD,KAAK,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;YACzB,OAAO,OAAO,SAAS,KAAK,QAAQ,CAAC;QACtC,CAAC;QACD,KAAK,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;YAC1B,OAAO,OAAO,SAAS,KAAK,SAAS,CAAC;QACvC,CAAC;QACD,KAAK,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC;YAC9B,OAAO,aAAa,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;QACD,KAAK,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;YACvB,OAAO,SAAS,KAAK,IAAI,CAAC;QAC3B,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,eAAe,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC;IACF,CAAC;AACF,CAAC;AAoBD,MAAM,UAAU,kBAAkB,CACjC,KAA4C;IAE5C,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;AACvD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,SAAkB;IAC7C,QAAQ,OAAO,SAAS,EAAE,CAAC;QAC1B,KAAK,QAAQ,CAAC;QACd,KAAK,QAAQ,CAAC;QACd,KAAK,SAAS,CAAC,CAAC,CAAC;YAChB,OAAO,IAAI,CAAC;QACb,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,OAAO,SAAS,KAAK,IAAI,IAAI,aAAa,CAAC,SAAS,CAAC,CAAC;QACvD,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport { isFluidHandle } from \"@fluidframework/runtime-utils/internal\";\n\nimport { type TreeValue, type Value, ValueSchema } from \"../core/index.js\";\n\nexport function allowsValue(schema: ValueSchema | undefined, nodeValue: Value): boolean {\n\tif (schema === undefined) {\n\t\treturn nodeValue === undefined;\n\t}\n\treturn valueSchemaAllows(schema, nodeValue);\n}\n\nexport function valueSchemaAllows<TSchema extends ValueSchema>(\n\tschema: TSchema,\n\tnodeValue: Value,\n): nodeValue is TreeValue<TSchema> {\n\tswitch (schema) {\n\t\tcase ValueSchema.String: {\n\t\t\treturn typeof nodeValue === \"string\";\n\t\t}\n\t\tcase ValueSchema.Number: {\n\t\t\treturn typeof nodeValue === \"number\";\n\t\t}\n\t\tcase ValueSchema.Boolean: {\n\t\t\treturn typeof nodeValue === \"boolean\";\n\t\t}\n\t\tcase ValueSchema.FluidHandle: {\n\t\t\treturn isFluidHandle(nodeValue);\n\t\t}\n\t\tcase ValueSchema.Null: {\n\t\t\treturn nodeValue === null;\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(schema);\n\t\t}\n\t}\n}\n\n/**\n * Use for readonly view of Json compatible data that can also contain IFluidHandles.\n *\n * Note that this does not robustly forbid non json comparable data via type checking,\n * but instead mostly restricts access to it.\n */\nexport type FluidSerializableReadOnly =\n\t| IFluidHandle\n\t| string\n\t| number\n\t| boolean\n\t// eslint-disable-next-line @rushstack/no-new-null\n\t| null\n\t| readonly FluidSerializableReadOnly[]\n\t| {\n\t\t\treadonly [P in string]?: FluidSerializableReadOnly;\n\t };\n\nexport function assertAllowedValue(\n\tvalue: undefined | FluidSerializableReadOnly,\n): asserts value is TreeValue {\n\tassert(isTreeValue(value), 0x843 /* invalid value */);\n}\n\n/**\n * Checks if a value is a {@link TreeValue}.\n */\nexport function isTreeValue(nodeValue: unknown): nodeValue is TreeValue {\n\tswitch (typeof nodeValue) {\n\t\tcase \"string\":\n\t\tcase \"number\":\n\t\tcase \"boolean\": {\n\t\t\treturn true;\n\t\t}\n\t\tdefault: {\n\t\t\treturn nodeValue === null || isFluidHandle(nodeValue);\n\t\t}\n\t}\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { ValueSchema, type Revertible, CommitKind, RevertibleStatus, type CommitMetadata, type ChangeMetadata, type RevertibleFactory, type RevertibleAlphaFactory, type RevertibleAlpha, } from "./core/index.js";
|
|
5
|
+
export { ValueSchema, type Revertible, CommitKind, RevertibleStatus, type CommitMetadata, type LocalChangeMetadata, type RemoteChangeMetadata, type ChangeMetadata, type RevertibleFactory, type RevertibleAlphaFactory, type RevertibleAlpha, } from "./core/index.js";
|
|
6
6
|
import type { Listeners as EventListeners, IsListener as EventIsListener, Listenable as EventListenable, Off as EventOff } from "@fluidframework/core-interfaces";
|
|
7
7
|
/**
|
|
8
8
|
* {@inheritdoc @fluidframework/core-interfaces#Listeners}
|
|
@@ -30,11 +30,11 @@ export type Listenable<T extends object> = EventListenable<T>;
|
|
|
30
30
|
export type Off = EventOff;
|
|
31
31
|
export { TreeStatus, TreeCompressionStrategy, type TreeIndex, type TreeIndexKey, type TreeIndexNodes, type IncrementalEncodingPolicy, } from "./feature-libraries/index.js";
|
|
32
32
|
export { type ITreeInternal, type SharedTreeOptions, type SharedTreeOptionsBeta, type ForestType, type SharedTreeFormatOptions, Tree, type RunTransaction, type ForestOptions, getBranch, type BranchableTree, type TreeBranchFork, independentInitializedView, type ViewContent, TreeAlpha, type ObservationResults, type TreeIdentifierUtils, independentView, createIndependentTreeBeta, createIndependentTreeAlpha, ForestTypeOptimized, ForestTypeExpensiveDebug, ForestTypeReference, } from "./shared-tree/index.js";
|
|
33
|
-
export { TreeArrayNode, type Unhydrated, IterableTreeArrayContent, TreeNode, type ViewableTree, type ITree, type TreeNodeSchema, TreeViewConfiguration, type ITreeViewConfiguration, type ITreeConfigurationOptions, type TreeView, type TreeViewEvents, SchemaFactory, SchemaFactoryBeta, type SchemaStaticsBeta, SchemaFactoryAlpha, type ObjectSchemaOptionsAlpha, type ObjectSchemaOptions, type ImplicitFieldSchema, type TreeFieldFromImplicitField, type TreeChangeEvents, type NodeFromSchema, type TreeMapNode, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, FieldKind, FieldSchema, type FieldSchemaAlpha, type FieldSchemaMetadata, type ImplicitAllowedTypes, type InsertableTreeFieldFromImplicitField, type InsertableTypedNode, NodeKind, type TreeObjectNode, ObjectNodeSchema, type TreeNodeFromImplicitAllowedTypes, type TreeNodeSchemaClass, type SchemaCompatibilityStatus, type FieldProps, type FieldPropsAlpha, normalizeFieldSchema, type InternalTreeNode, type WithType, type NodeChangedData, type SchemaUpgrade, contentSchemaSymbol, type TreeNodeApi, type TreeNodeSchemaCore, type AllowedTypes, type System_Unsafe, type FieldSchemaAlphaUnsafe, type ArrayNodeCustomizableSchemaUnsafe, type MapNodeCustomizableSchemaUnsafe, type TreeRecordNodeUnsafe, type UnannotateAllowedTypeUnsafe, type AnnotatedAllowedTypeUnsafe, type AnnotatedAllowedTypesUnsafe, type AllowedTypesFullUnsafe, type AllowedTypesFullFromMixedUnsafe, type UnannotateAllowedTypesListUnsafe, type AnnotateAllowedTypesListUnsafe, type typeSchemaSymbol, type TreeNodeSchemaNonClass, type ValidateRecursiveSchema, type FixRecursiveArraySchema, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, type DirtyTreeStatus, trackDirtyNodes, type DirtyTreeMap, adaptEnum, enumFromStrings, singletonSchema, type UnsafeUnknownSchema, type TreeViewAlpha, type TreeViewBeta, type InsertableField, type Insertable, type InsertableContent, type FactoryContent, type FactoryContentObject, type ReadableField, type ReadSchema, type AnnotatedAllowedType, type AnnotatedAllowedTypes, type AllowedTypesFullEvaluated, type AllowedTypeMetadata, type AllowedTypesMetadata, type UnannotateAllowedTypesList, type AnnotateAllowedTypesList, type AllowedTypesFull, type AllowedTypesFullFromMixed, type SchemaType, TreeBeta, type TreeChangeEventsBeta, type VerboseTreeNode, type TreeEncodingOptions, type TreeSchemaEncodingOptions, type TreeSchema, TreeViewConfigurationAlpha, type VerboseTree, extractPersistedSchema, comparePersistedSchema, type ConciseTree, type JsonTreeSchema, type JsonSchemaId, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonLeafNodeSchema, type JsonMapNodeSchema, type JsonArrayNodeSchema, type JsonObjectNodeSchema, type JsonFieldSchema, type JsonSchemaRef, type JsonRefPath, type JsonSchemaType, type JsonLeafSchemaType, type JsonRecordNodeSchema, type JsonStringKeyPatternProperties, getJsonSchema, type LazyItem, type Unenforced, type SimpleNodeSchemaBase, type SimpleNodeSchemaBaseAlpha, type SimpleTreeSchema, type SimpleNodeSchema, type SimpleFieldSchema, type SimpleLeafNodeSchema, type SimpleMapNodeSchema, type SimpleArrayNodeSchema, type SimpleObjectNodeSchema, type SimpleObjectFieldSchema, type SimpleRecordNodeSchema, normalizeAllowedTypes, walkFieldSchema, walkNodeSchema, walkAllowedTypes, type SchemaVisitor, getSimpleSchema, type ReadonlyArrayNode, type InsertableTreeNodeFromAllowedTypes, type Input, type TreeBranch, type TreeBranchAlpha, type TreeBranchEvents, asTreeViewAlpha, type NodeSchemaOptions, type NodeSchemaOptionsAlpha, type NodeSchemaMetadata, type SchemaStatics, type ITreeAlpha, type TransactionConstraint, type NodeInDocumentConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, generateSchemaFromSimpleSchema, evaluateLazySchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, type HandleConverter, allowUnused, type LeafSchema, type ArrayNodeCustomizableSchema, type ArrayNodePojoEmulationSchema, ArrayNodeSchema, type MapNodeCustomizableSchema, type MapNodePojoEmulationSchema, MapNodeSchema, type ObjectFromSchemaRecord, type ValidateRecursiveSchemaTemplate, type FixRecursiveRecursionLimit, RecordNodeSchema, type RecordNodeCustomizableSchema, type RecordNodeInsertableData, type RecordNodePojoEmulationSchema, type TreeRecordNode, KeyEncodingOptions, type TreeParsingOptions, type SchemaFactory_base, type NumberKeys, type SimpleAllowedTypeAttributes, encodeSchemaCompatibilitySnapshot, decodeSchemaCompatibilitySnapshot, exportCompatibilitySchemaSnapshot, importCompatibilitySchemaSnapshot, checkCompatibility, incrementalSummaryHint, incrementalEncodingPolicyForAllowedTypes, eraseSchemaDetails, eraseSchemaDetailsSubclassable, } from "./simple-tree/index.js";
|
|
33
|
+
export { TreeArrayNode, type Unhydrated, IterableTreeArrayContent, TreeNode, type ViewableTree, type ITree, type TreeNodeSchema, TreeViewConfiguration, type ITreeViewConfiguration, type ITreeConfigurationOptions, type TreeView, type TreeViewEvents, SchemaFactory, SchemaFactoryBeta, type SchemaStaticsBeta, SchemaFactoryAlpha, type ObjectSchemaOptionsAlpha, type ObjectSchemaOptions, type ImplicitFieldSchema, type TreeFieldFromImplicitField, type TreeChangeEvents, type NodeFromSchema, type TreeMapNode, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, FieldKind, FieldSchema, type FieldSchemaAlpha, type FieldSchemaMetadata, type ImplicitAllowedTypes, type InsertableTreeFieldFromImplicitField, type InsertableTypedNode, NodeKind, type TreeObjectNode, ObjectNodeSchema, type TreeNodeFromImplicitAllowedTypes, type TreeNodeSchemaClass, type SchemaCompatibilityStatus, type FieldProps, type FieldPropsAlpha, normalizeFieldSchema, type InternalTreeNode, type WithType, type NodeChangedData, type SchemaUpgrade, contentSchemaSymbol, type TreeNodeApi, type TreeNodeSchemaCore, type AllowedTypes, type System_Unsafe, type FieldSchemaAlphaUnsafe, type ArrayNodeCustomizableSchemaUnsafe, type MapNodeCustomizableSchemaUnsafe, type TreeRecordNodeUnsafe, type UnannotateAllowedTypeUnsafe, type AnnotatedAllowedTypeUnsafe, type AnnotatedAllowedTypesUnsafe, type AllowedTypesFullUnsafe, type AllowedTypesFullFromMixedUnsafe, type UnannotateAllowedTypesListUnsafe, type AnnotateAllowedTypesListUnsafe, type typeSchemaSymbol, type TreeNodeSchemaNonClass, type ValidateRecursiveSchema, type FixRecursiveArraySchema, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, type DirtyTreeStatus, trackDirtyNodes, type DirtyTreeMap, adaptEnum, enumFromStrings, singletonSchema, type UnsafeUnknownSchema, type TreeViewAlpha, type TreeViewBeta, type InsertableField, type Insertable, type InsertableContent, type FactoryContent, type FactoryContentObject, type ReadableField, type ReadSchema, type AnnotatedAllowedType, type AnnotatedAllowedTypes, type AllowedTypesFullEvaluated, type AllowedTypeMetadata, type AllowedTypesMetadata, type UnannotateAllowedTypesList, type AnnotateAllowedTypesList, type AllowedTypesFull, type AllowedTypesFullFromMixed, type SchemaType, TreeBeta, type TreeChangeEventsBeta, type VerboseTreeNode, type TreeEncodingOptions, type TreeSchemaEncodingOptions, type TreeSchema, TreeViewConfigurationAlpha, type VerboseTree, extractPersistedSchema, comparePersistedSchema, type ConciseTree, type JsonTreeSchema, type JsonSchemaId, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonLeafNodeSchema, type JsonMapNodeSchema, type JsonArrayNodeSchema, type JsonObjectNodeSchema, type JsonFieldSchema, type JsonSchemaRef, type JsonRefPath, type JsonSchemaType, type JsonLeafSchemaType, type JsonRecordNodeSchema, type JsonStringKeyPatternProperties, getJsonSchema, type LazyItem, type Unenforced, type SimpleNodeSchemaBase, type SimpleNodeSchemaBaseAlpha, type SimpleTreeSchema, type SimpleNodeSchema, type SimpleFieldSchema, type SimpleLeafNodeSchema, type SimpleMapNodeSchema, type SimpleArrayNodeSchema, type SimpleObjectNodeSchema, type SimpleObjectFieldSchema, type SimpleRecordNodeSchema, normalizeAllowedTypes, walkFieldSchema, walkNodeSchema, walkAllowedTypes, type SchemaVisitor, getSimpleSchema, type ReadonlyArrayNode, type InsertableTreeNodeFromAllowedTypes, type Input, type TreeBranch, type TreeBranchAlpha, type TreeBranchEvents, asTreeViewAlpha, type NodeSchemaOptions, type NodeSchemaOptionsAlpha, type NodeSchemaMetadata, type SchemaStatics, type ITreeAlpha, type TransactionConstraint, type TransactionConstraintAlpha, type NodeInDocumentConstraint, type NoChangeConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, generateSchemaFromSimpleSchema, evaluateLazySchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, type HandleConverter, allowUnused, type LeafSchema, type ArrayNodeCustomizableSchema, type ArrayNodePojoEmulationSchema, ArrayNodeSchema, type MapNodeCustomizableSchema, type MapNodePojoEmulationSchema, MapNodeSchema, type ObjectFromSchemaRecord, type ValidateRecursiveSchemaTemplate, type FixRecursiveRecursionLimit, RecordNodeSchema, type RecordNodeCustomizableSchema, type RecordNodeInsertableData, type RecordNodePojoEmulationSchema, type TreeRecordNode, KeyEncodingOptions, type TreeParsingOptions, type SchemaFactory_base, type NumberKeys, type SimpleAllowedTypeAttributes, encodeSchemaCompatibilitySnapshot, decodeSchemaCompatibilitySnapshot, exportCompatibilitySchemaSnapshot, importCompatibilitySchemaSnapshot, checkCompatibility, checkSchemaCompatibilitySnapshots, type SnapshotFileSystem, incrementalSummaryHint, incrementalEncodingPolicyForAllowedTypes, eraseSchemaDetails, eraseSchemaDetailsSubclassable, type SchemaCompatibilitySnapshotsOptions, } from "./simple-tree/index.js";
|
|
34
34
|
export { SharedTree, configuredSharedTree, configuredSharedTreeAlpha, configuredSharedTreeBeta, configuredSharedTreeBetaLegacy, } from "./treeFactory.js";
|
|
35
35
|
export { SharedTreeAttributes, SharedTreeFactoryType } from "./sharedTreeAttributes.js";
|
|
36
36
|
export { persistedToSimpleSchema } from "./shared-tree/index.js";
|
|
37
|
-
export { type ICodecOptions, type CodecWriteOptions, FluidClientVersion, type FormatValidator, FormatValidatorNoOp, } from "./codec/index.js";
|
|
37
|
+
export { type ICodecOptions, type CodecWriteOptions, FluidClientVersion, type FormatValidator, FormatValidatorNoOp, type CodecName, type FormatVersion, } from "./codec/index.js";
|
|
38
38
|
export { FormatValidatorBasic } from "./external-utilities/index.js";
|
|
39
39
|
export type { requireTrue, requireFalse, requireAssignableTo, areSafelyAssignable, isAssignableTo, isAny, eitherIsAny, RestrictiveReadonlyRecord, RestrictiveStringRecord, MakeNominal, IsUnion, UnionToIntersection, UnionToTuple, PopUnion, JsonCompatible, JsonCompatibleObject, JsonCompatibleReadOnly, JsonCompatibleReadOnlyObject, } from "./util/index.js";
|
|
40
40
|
export { cloneWithReplacements } from "./util/index.js";
|
|
@@ -50,4 +50,5 @@ export { JsonAsTree } from "./jsonDomainSchema.js";
|
|
|
50
50
|
export { FluidSerializableAsTree } from "./serializableDomainSchema.js";
|
|
51
51
|
export { TableSchema, type System_TableSchema } from "./tableSchema.js";
|
|
52
52
|
export { asAlpha, asBeta } from "./api.js";
|
|
53
|
+
export { TextAsTree } from "./text/index.js";
|
|
53
54
|
//# sourceMappingURL=index.d.ts.map
|