@fluidframework/tree 2.74.0-365691 → 2.74.0-370705
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +2 -2
- package/api-report/tree.alpha.api.md +119 -85
- package/api-report/tree.beta.api.md +0 -1
- package/api-report/tree.legacy.beta.api.md +0 -1
- package/api-report/tree.legacy.public.api.md +0 -1
- package/api-report/tree.public.api.md +0 -1
- package/dist/alpha.d.ts +3 -2
- package/dist/codec/codec.d.ts +14 -1
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +11 -0
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/versioned/codec.d.ts +1 -1
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js.map +1 -1
- package/dist/codec/versioned/format.d.ts +4 -1
- package/dist/codec/versioned/format.d.ts.map +1 -1
- package/dist/codec/versioned/format.js +4 -1
- package/dist/codec/versioned/format.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 -4
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/changeRebaser.d.ts +6 -1
- 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 +1 -1
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js +2 -1
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +2 -1
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +5 -1
- 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 +25 -7
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts +40 -13
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +21 -12
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/index.d.ts +4 -3
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js +6 -2
- package/dist/core/tree/index.js.map +1 -1
- package/dist/core/tree/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/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js +7 -0
- 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/codec/incrementalEncodingPolicy.d.ts +14 -6
- package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +91 -42
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +238 -69
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +4 -4
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +33 -28
- 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 +36 -0
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js +126 -0
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
- package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +7 -6
- package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js +15 -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/detachedFieldIndexSummarizer.d.ts +30 -8
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js +41 -11
- package/dist/feature-libraries/detachedFieldIndexSummarizer.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 +37 -8
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts +2 -2
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js +4 -4
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +9 -13
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +21 -26
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/format.d.ts +41 -5
- package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/format.js +7 -7
- package/dist/feature-libraries/forest-summary/format.js.map +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +11 -9
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +16 -29
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/dist/feature-libraries/forest-summary/index.d.ts +2 -1
- package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/index.js +3 -2
- package/dist/feature-libraries/forest-summary/index.js.map +1 -1
- package/dist/feature-libraries/forest-summary/summaryTypes.d.ts +47 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.js +57 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
- package/dist/feature-libraries/index.d.ts +4 -4
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +8 -3
- package/dist/feature-libraries/index.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 +2 -2
- package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.d.ts +18 -2
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +54 -3
- 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/fieldChangeHandler.d.ts +20 -52
- 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/fieldKind.d.ts +25 -13
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.js +0 -21
- package/dist/feature-libraries/modular-schema/fieldKind.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 -10
- 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 +6 -6
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +13 -8
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +17 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +388 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +17 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +413 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.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 +8 -284
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +49 -15
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1306 -465
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/{modularChangeFormat.d.ts → modularChangeFormatV1.d.ts} +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +5 -5
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +146 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +32 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +50 -10
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js +24 -3
- package/dist/feature-libraries/modular-schema/modularChangeTypes.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 +217 -451
- 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-index/schemaSummarizer.d.ts +27 -8
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +42 -16
- package/dist/feature-libraries/schema-index/schemaSummarizer.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 +80 -256
- 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 +65 -167
- 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 +7 -86
- 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 +106 -112
- package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.js +16 -33
- 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 +358 -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 +14 -109
- 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 +111 -299
- package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/independentView.d.ts +1 -1
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js.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 +1 -5
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +32 -33
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +11 -5
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +14 -4
- 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 +1 -0
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js +26 -12
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +5 -5
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +10 -4
- 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.map +1 -1
- package/dist/shared-tree/treeAlpha.js +1 -1
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +12 -10
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +66 -17
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +3 -2
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +4 -3
- package/dist/shared-tree-core/branch.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 +9 -9
- 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 +16 -6
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/{lib/shared-tree-core/editManagerCodecsV5.d.ts → dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +7 -7
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +20 -6
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +22 -7
- 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 +1 -0
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/editManagerSummarizer.d.ts +29 -9
- package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +41 -13
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +5 -3
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +8 -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/{lib/shared-tree-core/messageCodecV5.d.ts → dist/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
- package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +6 -6
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
- 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 +16 -6
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +20 -6
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormat.js +22 -7
- 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 +8 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/{messageFormatV5.d.ts → messageFormatVSharedBranches.d.ts} +5 -7
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
- package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/sharedTreeCore.d.ts +14 -47
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +30 -18
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/summaryTypes.d.ts +94 -0
- package/dist/shared-tree-core/summaryTypes.d.ts.map +1 -0
- package/dist/shared-tree-core/summaryTypes.js +47 -0
- package/dist/shared-tree-core/summaryTypes.js.map +1 -0
- package/dist/shared-tree-core/versionedSummarizer.d.ts +67 -0
- package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
- package/dist/shared-tree-core/versionedSummarizer.js +63 -0
- package/dist/shared-tree-core/versionedSummarizer.js.map +1 -0
- package/dist/simple-tree/api/configuration.d.ts +3 -26
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js +10 -21
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/dirtyIndex.d.ts +11 -0
- package/dist/simple-tree/api/dirtyIndex.d.ts.map +1 -1
- package/dist/simple-tree/api/dirtyIndex.js +7 -0
- package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/dist/simple-tree/api/discrepancies.js.map +1 -1
- package/dist/simple-tree/api/getSimpleSchema.d.ts +3 -3
- package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/getSimpleSchema.js +9 -3
- package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.js +7 -0
- package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +3 -4
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +4 -5
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js +0 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts +6 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +5 -0
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/schemaStatics.d.ts +12 -12
- package/dist/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
- package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.js +18 -6
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +13 -8
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +3 -3
- package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.d.ts +2 -2
- package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
- package/dist/simple-tree/core/allowedTypes.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +1 -1
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +2 -3
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/toStored.d.ts +17 -15
- package/dist/simple-tree/core/toStored.d.ts.map +1 -1
- package/dist/simple-tree/core/toStored.js +5 -40
- package/dist/simple-tree/core/toStored.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 +59 -8
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/walkSchema.js +4 -0
- package/dist/simple-tree/core/walkSchema.js.map +1 -1
- package/dist/simple-tree/createContext.d.ts.map +1 -1
- package/dist/simple-tree/createContext.js +20 -5
- package/dist/simple-tree/createContext.js.map +1 -1
- package/dist/simple-tree/fieldSchema.d.ts +7 -7
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/fieldSchema.js.map +1 -1
- package/dist/simple-tree/index.d.ts +8 -7
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +15 -12
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +5 -5
- package/dist/simple-tree/leafNodeSchema.d.ts.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 +5 -3
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/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.d.ts.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/map/mapNodeTypes.d.ts +3 -3
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.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 +18 -18
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.js +4 -2
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.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 +183 -125
- package/dist/simple-tree/prepareForInsertion.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +55 -23
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchema.js +17 -0
- package/dist/simple-tree/simpleSchema.js.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.js +8 -1
- package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts +58 -11
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +205 -30
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/treeSchema.d.ts +23 -0
- package/dist/simple-tree/treeSchema.d.ts.map +1 -0
- package/dist/simple-tree/treeSchema.js +25 -0
- package/dist/simple-tree/treeSchema.js.map +1 -0
- 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 +29 -11
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/dist/tableSchema.d.ts +117 -63
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +159 -58
- package/dist/tableSchema.js.map +1 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +17 -3
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/index.d.ts +2 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +4 -1
- package/dist/util/index.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/readSnapshotBlob.d.ts +13 -0
- package/dist/util/readSnapshotBlob.d.ts.map +1 -0
- package/dist/util/readSnapshotBlob.js +18 -0
- package/dist/util/readSnapshotBlob.js.map +1 -0
- package/lib/alpha.d.ts +3 -2
- package/lib/codec/codec.d.ts +14 -1
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +11 -0
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/versioned/codec.d.ts +1 -1
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js.map +1 -1
- package/lib/codec/versioned/format.d.ts +4 -1
- package/lib/codec/versioned/format.d.ts.map +1 -1
- package/lib/codec/versioned/format.js +4 -1
- package/lib/codec/versioned/format.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 +6 -1
- 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 +1 -1
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +2 -1
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +3 -0
- 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 +25 -7
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts +40 -13
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +22 -13
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/index.d.ts +4 -3
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +3 -2
- package/lib/core/tree/index.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/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js +8 -1
- 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/codec/incrementalEncodingPolicy.d.ts +14 -6
- package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +91 -42
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +236 -70
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +4 -4
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +34 -29
- 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 +36 -0
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js +122 -0
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
- package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +7 -6
- package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js +15 -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/detachedFieldIndexSummarizer.d.ts +30 -8
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js +38 -8
- package/lib/feature-libraries/detachedFieldIndexSummarizer.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 +38 -9
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts +2 -2
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js +5 -5
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +9 -13
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +17 -22
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/format.d.ts +41 -5
- package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/format.js +3 -3
- package/lib/feature-libraries/forest-summary/format.js.map +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +11 -9
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +13 -26
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/lib/feature-libraries/forest-summary/index.d.ts +2 -1
- package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/index.js +2 -1
- package/lib/feature-libraries/forest-summary/index.js.map +1 -1
- package/lib/feature-libraries/forest-summary/summaryTypes.d.ts +47 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.js +53 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
- package/lib/feature-libraries/index.d.ts +4 -4
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +3 -3
- package/lib/feature-libraries/index.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 +2 -2
- package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.d.ts +18 -2
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +55 -5
- 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/fieldChangeHandler.d.ts +20 -52
- 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/fieldKind.d.ts +25 -13
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.js +0 -21
- package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +7 -10
- 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 +6 -6
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +5 -4
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +17 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +384 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +17 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +409 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.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 +9 -285
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +49 -15
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1291 -458
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/{modularChangeFormat.d.ts → modularChangeFormatV1.d.ts} +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +146 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +29 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +50 -10
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.js +20 -2
- package/lib/feature-libraries/modular-schema/modularChangeTypes.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 +217 -449
- 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-index/schemaSummarizer.d.ts +27 -8
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +38 -12
- package/lib/feature-libraries/schema-index/schemaSummarizer.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 +82 -258
- 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 +67 -169
- 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 +6 -80
- 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 +108 -114
- package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.js +16 -33
- 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 +350 -175
- 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 +14 -109
- 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 +107 -292
- package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/independentView.d.ts +1 -1
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js.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 +1 -5
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +35 -36
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +11 -5
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +14 -4
- 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 +1 -0
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js +27 -13
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +5 -5
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +11 -5
- 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.map +1 -1
- package/lib/shared-tree/treeAlpha.js +2 -2
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +12 -10
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +69 -20
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +3 -2
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +4 -3
- package/lib/shared-tree-core/branch.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 +9 -9
- 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 +14 -5
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/{dist/shared-tree-core/editManagerCodecsV5.d.ts → lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +4 -4
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +20 -6
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +22 -7
- 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 +1 -0
- package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/lib/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/editManagerSummarizer.d.ts +29 -9
- package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +39 -11
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +5 -3
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +4 -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/{dist/shared-tree-core/messageCodecV5.d.ts → lib/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
- package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +3 -3
- package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
- 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 +14 -5
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +20 -6
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormat.js +22 -7
- 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 +8 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/{messageFormatV5.d.ts → messageFormatVSharedBranches.d.ts} +5 -7
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
- package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/sharedTreeCore.d.ts +14 -47
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +28 -16
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/summaryTypes.d.ts +94 -0
- package/lib/shared-tree-core/summaryTypes.d.ts.map +1 -0
- package/lib/shared-tree-core/summaryTypes.js +43 -0
- package/lib/shared-tree-core/summaryTypes.js.map +1 -0
- package/lib/shared-tree-core/versionedSummarizer.d.ts +67 -0
- package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
- package/lib/shared-tree-core/versionedSummarizer.js +59 -0
- package/lib/shared-tree-core/versionedSummarizer.js.map +1 -0
- package/lib/simple-tree/api/configuration.d.ts +3 -26
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js +14 -25
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/dirtyIndex.d.ts +11 -0
- package/lib/simple-tree/api/dirtyIndex.d.ts.map +1 -1
- package/lib/simple-tree/api/dirtyIndex.js +7 -0
- package/lib/simple-tree/api/dirtyIndex.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/lib/simple-tree/api/discrepancies.js.map +1 -1
- package/lib/simple-tree/api/getSimpleSchema.d.ts +3 -3
- package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/getSimpleSchema.js +9 -3
- package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js +8 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +3 -4
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +2 -3
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js +0 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts +6 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +5 -0
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/schemaStatics.d.ts +12 -12
- package/lib/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
- package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaCodec.js +15 -3
- package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js +15 -10
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +3 -3
- package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.d.ts +2 -2
- package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
- package/lib/simple-tree/core/allowedTypes.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +1 -1
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +1 -1
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/toStored.d.ts +17 -15
- package/lib/simple-tree/core/toStored.d.ts.map +1 -1
- package/lib/simple-tree/core/toStored.js +4 -37
- package/lib/simple-tree/core/toStored.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 +58 -8
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/walkSchema.js +5 -1
- package/lib/simple-tree/core/walkSchema.js.map +1 -1
- package/lib/simple-tree/createContext.d.ts.map +1 -1
- package/lib/simple-tree/createContext.js +20 -5
- package/lib/simple-tree/createContext.js.map +1 -1
- package/lib/simple-tree/fieldSchema.d.ts +7 -7
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/fieldSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +8 -7
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +6 -5
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts +5 -5
- package/lib/simple-tree/leafNodeSchema.d.ts.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 +6 -4
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
- package/lib/simple-tree/node-kinds/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.d.ts.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/map/mapNodeTypes.d.ts +3 -3
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.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 +19 -19
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.js +4 -2
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.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 +183 -124
- package/lib/simple-tree/prepareForInsertion.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +55 -23
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchema.js +16 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.js +8 -1
- package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts +58 -11
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +204 -31
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/treeSchema.d.ts +23 -0
- package/lib/simple-tree/treeSchema.d.ts.map +1 -0
- package/lib/simple-tree/treeSchema.js +21 -0
- package/lib/simple-tree/treeSchema.js.map +1 -0
- 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 +26 -9
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/lib/tableSchema.d.ts +117 -63
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +160 -59
- package/lib/tableSchema.js.map +1 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +18 -4
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/index.d.ts +2 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -1
- package/lib/util/index.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/readSnapshotBlob.d.ts +13 -0
- package/lib/util/readSnapshotBlob.d.ts.map +1 -0
- package/lib/util/readSnapshotBlob.js +14 -0
- package/lib/util/readSnapshotBlob.js.map +1 -0
- package/package.json +21 -21
- package/src/codec/codec.ts +15 -1
- package/src/codec/versioned/codec.ts +1 -1
- package/src/codec/versioned/format.ts +4 -1
- package/src/core/change-family/changeFamily.ts +5 -0
- package/src/core/change-family/index.ts +1 -0
- package/src/core/index.ts +7 -2
- package/src/core/rebase/changeRebaser.ts +6 -1
- package/src/core/rebase/index.ts +1 -0
- package/src/core/rebase/types.ts +8 -1
- package/src/core/rebase/utils.ts +31 -7
- package/src/core/tree/detachedFieldIndex.ts +71 -14
- package/src/core/tree/index.ts +9 -3
- package/src/core/tree/pathTree.ts +16 -4
- package/src/feature-libraries/chunked-forest/basicChunk.ts +7 -1
- package/src/feature-libraries/chunked-forest/chunkTree.ts +6 -1
- package/src/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.ts +15 -7
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -9
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +398 -127
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +35 -38
- package/src/feature-libraries/default-schema/index.ts +17 -5
- package/src/feature-libraries/default-schema/locationBasedEditBuilder.ts +180 -0
- package/src/feature-libraries/default-schema/mappedEditBuilder.ts +35 -9
- package/src/feature-libraries/deltaUtils.ts +6 -1
- package/src/feature-libraries/detachedFieldIndexSummarizer.ts +62 -15
- 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 +66 -24
- package/src/feature-libraries/forest-summary/codec.ts +8 -8
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +45 -37
- package/src/feature-libraries/forest-summary/format.ts +4 -4
- package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +23 -39
- package/src/feature-libraries/forest-summary/index.ts +2 -1
- package/src/feature-libraries/forest-summary/summaryTypes.ts +61 -0
- package/src/feature-libraries/index.ts +23 -9
- package/src/feature-libraries/mapTreeCursor.ts +2 -1
- package/src/feature-libraries/mitigatedChangeFamily.ts +3 -1
- package/src/feature-libraries/modular-schema/comparison.ts +63 -5
- package/src/feature-libraries/modular-schema/crossFieldQueries.ts +142 -44
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +36 -57
- package/src/feature-libraries/modular-schema/fieldKind.ts +24 -40
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +10 -19
- package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +1 -1
- package/src/feature-libraries/modular-schema/index.ts +22 -15
- package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +732 -0
- package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +790 -0
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +29 -499
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +2547 -739
- package/src/feature-libraries/modular-schema/{modularChangeFormat.ts → modularChangeFormatV1.ts} +2 -1
- package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +62 -0
- package/src/feature-libraries/modular-schema/modularChangeTypes.ts +98 -10
- package/src/feature-libraries/optional-field/index.ts +1 -3
- package/src/feature-libraries/optional-field/optionalField.ts +317 -574
- 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-index/schemaSummarizer.ts +59 -18
- package/src/feature-libraries/sequence-field/compose.ts +134 -519
- 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 -228
- package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
- package/src/feature-libraries/sequence-field/moveEffectTable.ts +8 -191
- package/src/feature-libraries/sequence-field/rebase.ts +168 -203
- package/src/feature-libraries/sequence-field/replaceRevisions.ts +31 -52
- package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +0 -2
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +643 -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 +19 -129
- package/src/feature-libraries/sequence-field/types.ts +34 -64
- package/src/feature-libraries/sequence-field/utils.ts +133 -346
- package/src/index.ts +3 -2
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.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 +50 -68
- package/src/shared-tree/sharedTree.ts +39 -12
- package/src/shared-tree/sharedTreeChangeCodecs.ts +5 -1
- package/src/shared-tree/sharedTreeChangeEnricher.ts +33 -11
- package/src/shared-tree/sharedTreeChangeFamily.ts +15 -5
- package/src/shared-tree/sharedTreeEditBuilder.ts +47 -13
- package/src/shared-tree/treeAlpha.ts +2 -3
- package/src/shared-tree/treeCheckout.ts +104 -31
- package/src/shared-tree-core/branch.ts +8 -2
- package/src/shared-tree-core/editManager.ts +16 -2
- package/src/shared-tree-core/editManagerCodecs.ts +17 -5
- package/src/shared-tree-core/{editManagerCodecsV5.ts → editManagerCodecsVSharedBranches.ts} +3 -3
- package/src/shared-tree-core/editManagerFormatCommons.ts +22 -7
- package/src/shared-tree-core/editManagerFormatV1toV4.ts +3 -1
- package/src/shared-tree-core/{editManagerFormatV5.ts → editManagerFormatVSharedBranches.ts} +2 -2
- package/src/shared-tree-core/editManagerSummarizer.ts +58 -16
- package/src/shared-tree-core/index.ts +11 -3
- package/src/shared-tree-core/messageCodecV1ToV4.ts +2 -1
- package/src/shared-tree-core/{messageCodecV5.ts → messageCodecVSharedBranches.ts} +3 -3
- package/src/shared-tree-core/messageCodecs.ts +17 -5
- package/src/shared-tree-core/messageFormat.ts +22 -7
- package/src/shared-tree-core/messageFormatV1ToV4.ts +16 -2
- package/src/shared-tree-core/{messageFormatV5.ts → messageFormatVSharedBranches.ts} +4 -6
- package/src/shared-tree-core/sharedTreeCore.ts +67 -76
- package/src/shared-tree-core/summaryTypes.ts +122 -0
- package/src/shared-tree-core/versionedSummarizer.ts +107 -0
- package/src/simple-tree/api/configuration.ts +21 -68
- package/src/simple-tree/api/dirtyIndex.ts +11 -0
- package/src/simple-tree/api/discrepancies.ts +1 -1
- package/src/simple-tree/api/getSimpleSchema.ts +13 -6
- package/src/simple-tree/api/incrementalAllowedTypes.ts +15 -3
- package/src/simple-tree/api/index.ts +3 -4
- package/src/simple-tree/api/schemaCompatibilityTester.ts +1 -1
- package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -2
- package/src/simple-tree/api/schemaFactoryRecursive.ts +0 -2
- package/src/simple-tree/api/schemaFromSimple.ts +11 -5
- package/src/simple-tree/api/simpleSchemaCodec.ts +17 -3
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -1
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +18 -10
- package/src/simple-tree/api/typesUnsafe.ts +7 -3
- package/src/simple-tree/core/allowedTypes.ts +3 -3
- package/src/simple-tree/core/index.ts +2 -2
- package/src/simple-tree/core/toStored.ts +22 -55
- package/src/simple-tree/core/unhydratedFlexTree.ts +87 -36
- package/src/simple-tree/core/walkSchema.ts +6 -0
- package/src/simple-tree/createContext.ts +26 -11
- package/src/simple-tree/fieldSchema.ts +16 -7
- package/src/simple-tree/index.ts +12 -11
- package/src/simple-tree/node-kinds/array/arrayNode.ts +12 -7
- package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +3 -3
- package/src/simple-tree/node-kinds/common.ts +2 -5
- package/src/simple-tree/node-kinds/map/mapNode.ts +9 -6
- package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +3 -3
- package/src/simple-tree/node-kinds/object/objectNode.ts +26 -26
- package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +6 -2
- package/src/simple-tree/node-kinds/record/recordNode.ts +15 -11
- package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +3 -3
- package/src/simple-tree/prepareForInsertion.ts +343 -200
- package/src/simple-tree/simpleSchema.ts +79 -32
- package/src/simple-tree/simpleSchemaFormatV1.ts +9 -1
- package/src/simple-tree/toStoredSchema.ts +319 -61
- package/src/simple-tree/treeSchema.ts +54 -0
- package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +42 -14
- package/src/tableSchema.ts +485 -166
- package/src/treeFactory.ts +19 -5
- package/src/util/index.ts +5 -0
- package/src/util/rangeMap.ts +72 -18
- package/src/util/readSnapshotBlob.ts +23 -0
- 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/dist/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
- package/dist/shared-tree-core/editManagerCodecsV5.js.map +0 -1
- package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
- package/dist/shared-tree-core/editManagerFormatV5.js.map +0 -1
- package/dist/shared-tree-core/messageCodecV5.d.ts.map +0 -1
- package/dist/shared-tree-core/messageCodecV5.js.map +0 -1
- package/dist/shared-tree-core/messageFormatV5.d.ts.map +0 -1
- package/dist/shared-tree-core/messageFormatV5.js.map +0 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +0 -177
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.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/lib/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
- package/lib/shared-tree-core/editManagerCodecsV5.js.map +0 -1
- package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
- package/lib/shared-tree-core/editManagerFormatV5.js.map +0 -1
- package/lib/shared-tree-core/messageCodecV5.d.ts.map +0 -1
- package/lib/shared-tree-core/messageCodecV5.js.map +0 -1
- package/lib/shared-tree-core/messageFormatV5.d.ts.map +0 -1
- package/lib/shared-tree-core/messageFormatV5.js.map +0 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +0 -171
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
- package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +0 -57
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +0 -209
|
@@ -7,11 +7,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.ComposeQueue = exports.compose = void 0;
|
|
8
8
|
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
9
9
|
const index_js_1 = require("../../core/index.js");
|
|
10
|
-
const index_js_2 = require("../modular-schema/index.js");
|
|
11
10
|
const markListFactory_js_1 = require("./markListFactory.js");
|
|
12
11
|
const markQueue_js_1 = require("./markQueue.js");
|
|
13
|
-
const moveEffectTable_js_1 = require("./moveEffectTable.js");
|
|
14
|
-
const types_js_1 = require("./types.js");
|
|
15
12
|
const utils_js_1 = require("./utils.js");
|
|
16
13
|
/**
|
|
17
14
|
* Composes a sequence of changesets into a single changeset.
|
|
@@ -34,26 +31,8 @@ function composeMarkLists(baseMarkList, newMarkList, composeChild, moveEffects,
|
|
|
34
31
|
const queue = new ComposeQueue(baseMarkList, newMarkList, moveEffects, revisionMetadata);
|
|
35
32
|
while (!queue.isEmpty()) {
|
|
36
33
|
const { baseMark, newMark } = queue.pop();
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
factory.push(composeMark(baseMark, moveEffects, (node) => composeChildChanges(node, undefined, composeChild)));
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
// We only compose changesets that will not be further rebased.
|
|
43
|
-
// It is therefore safe to remove any intentions that have no impact in the context they apply to.
|
|
44
|
-
const settledNewMark = (0, utils_js_1.settleMark)(newMark);
|
|
45
|
-
if (baseMark === undefined) {
|
|
46
|
-
factory.push(composeMark(settledNewMark, moveEffects, (node) => composeChildChanges(undefined, node, composeChild)));
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
// Past this point, we are guaranteed that `settledNewMark` and `baseMark` have the same length and
|
|
50
|
-
// start at the same location in the revision after the base changes.
|
|
51
|
-
// They therefore refer to the same range for that revision.
|
|
52
|
-
const settledBaseMark = (0, utils_js_1.settleMark)(baseMark);
|
|
53
|
-
const composedMark = composeMarks(settledBaseMark, settledNewMark, composeChild, moveEffects);
|
|
54
|
-
factory.push(composedMark);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
34
|
+
const composedMark = composeMarks(baseMark, newMark, composeChild, moveEffects);
|
|
35
|
+
factory.push(composedMark);
|
|
57
36
|
}
|
|
58
37
|
return factory.list;
|
|
59
38
|
}
|
|
@@ -68,128 +47,64 @@ function composeMarkLists(baseMarkList, newMarkList, composeChild, moveEffects,
|
|
|
68
47
|
*/
|
|
69
48
|
function composeMarks(baseMark, newMark, composeChild, moveEffects) {
|
|
70
49
|
const nodeChange = handleNodeChanges(baseMark, newMark, composeChild, moveEffects);
|
|
71
|
-
return
|
|
50
|
+
return (0, utils_js_1.withNodeChange)(composeMarksIgnoreChild(baseMark, newMark, moveEffects), nodeChange);
|
|
72
51
|
}
|
|
73
52
|
function composeMarksIgnoreChild(baseMark, newMark, moveEffects) {
|
|
74
53
|
if ((0, utils_js_1.isNoopMark)(baseMark)) {
|
|
75
54
|
return newMark;
|
|
76
55
|
}
|
|
77
56
|
else if ((0, utils_js_1.isNoopMark)(newMark)) {
|
|
78
|
-
return baseMark;
|
|
57
|
+
return updateBaseMarkId(moveEffects, baseMark);
|
|
79
58
|
}
|
|
80
59
|
if ((0, utils_js_1.isRename)(baseMark) && (0, utils_js_1.isRename)(newMark)) {
|
|
60
|
+
if ((0, index_js_1.areEqualChangeAtomIdOpts)(baseMark.cellId, newMark.idOverride)) {
|
|
61
|
+
return createNoopMark(baseMark.count, undefined, baseMark.cellId);
|
|
62
|
+
}
|
|
81
63
|
return { ...baseMark, idOverride: newMark.idOverride };
|
|
82
64
|
}
|
|
83
65
|
else if ((0, utils_js_1.isRename)(baseMark)) {
|
|
84
|
-
(0, internal_1.assert)((0, utils_js_1.isAttach)(newMark)
|
|
66
|
+
(0, internal_1.assert)((0, utils_js_1.isAttach)(newMark), 0x9f1 /* Unexpected mark type */);
|
|
67
|
+
(0, internal_1.assert)(baseMark.cellId !== undefined && newMark.cellId !== undefined, "Expected marks to target an empty cell");
|
|
85
68
|
return { ...newMark, cellId: baseMark.cellId };
|
|
86
69
|
}
|
|
87
70
|
else if ((0, utils_js_1.isRename)(newMark)) {
|
|
88
|
-
(0, internal_1.assert)((0, utils_js_1.isDetach)(baseMark)
|
|
89
|
-
return (
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
(0,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
(0, internal_1.assert)((0, moveEffectTable_js_1.isMoveOut)(baseMark), 0x808 /* Unexpected mark type */);
|
|
106
|
-
// The base changeset and new changeset both move these nodes.
|
|
107
|
-
// Call the original position of the nodes A, the position after the base changeset is applied B,
|
|
108
|
-
// and the position after the new changeset is applied C.
|
|
109
|
-
// The new changeset moves the nodes from B, temporarily returns them to A, and then moves them to C.
|
|
110
|
-
// The composition of the base and new changesets will be a move directly from A to C,
|
|
111
|
-
// since the move from A to B cancels out with the return from B to A.
|
|
112
|
-
// This if-block is handling marks at A.
|
|
113
|
-
// When we compose the marks at B we will link the start of the base move (A to B)
|
|
114
|
-
// with the end of the new move (B to C).
|
|
115
|
-
// Because we are replacing the mark representing the start of the move with the new changeset's
|
|
116
|
-
// move-out from A, we update the base move-in at B to consider that its start point.
|
|
117
|
-
const newDetachId = {
|
|
118
|
-
revision: newDetachRevision,
|
|
119
|
-
localId: newAttachAndDetach.detach.id,
|
|
120
|
-
};
|
|
121
|
-
setTruncatedEndpointForInner(moveEffects, index_js_2.CrossFieldTarget.Destination, (0, utils_js_1.getEndpoint)(baseMark), baseMark.count, newDetachId);
|
|
122
|
-
const newEndpoint = getComposedEndpoint(moveEffects, index_js_2.CrossFieldTarget.Source, baseMark.revision, baseMark.id, baseMark.count);
|
|
123
|
-
if (newEndpoint !== undefined) {
|
|
124
|
-
changeFinalEndpoint(newDetach, newEndpoint);
|
|
125
|
-
setTruncatedEndpoint(moveEffects, index_js_2.CrossFieldTarget.Destination, newEndpoint, baseMark.count, newDetachId);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return newDetach;
|
|
129
|
-
}
|
|
130
|
-
if ((0, utils_js_1.isImpactfulCellRename)(baseMark)) {
|
|
131
|
-
(0, internal_1.assert)(baseMark.cellId !== undefined, 0x9f4 /* Impactful cell rename must target empty cell */);
|
|
132
|
-
const baseAttachAndDetach = (0, utils_js_1.asAttachAndDetach)(baseMark);
|
|
133
|
-
const newOutputId = (0, utils_js_1.getOutputCellId)(newAttachAndDetach);
|
|
134
|
-
const originalAttach = { ...baseAttachAndDetach.attach };
|
|
135
|
-
const finalDetach = { ...newAttachAndDetach.detach };
|
|
136
|
-
handleMovePivot(baseMark.count, originalAttach, finalDetach, moveEffects);
|
|
137
|
-
if ((0, utils_js_1.areEqualCellIds)(newOutputId, baseAttachAndDetach.cellId)) {
|
|
138
|
-
return { count: baseAttachAndDetach.count, cellId: baseAttachAndDetach.cellId };
|
|
71
|
+
(0, internal_1.assert)((0, utils_js_1.isDetach)(baseMark), 0x9f2 /* Unexpected mark type */);
|
|
72
|
+
return updateBaseMarkId(moveEffects, { ...baseMark, cellRename: newMark.idOverride });
|
|
73
|
+
}
|
|
74
|
+
if (!(0, utils_js_1.markHasCellEffect)(baseMark)) {
|
|
75
|
+
(0, internal_1.assert)(baseMark.type === "Insert", "Expected baseMark to be a pin");
|
|
76
|
+
// `newMark` can be either a remove or another pin.
|
|
77
|
+
// A pin is treated as a detach and attach, so we call `composeAttachDetach` in either case.
|
|
78
|
+
moveEffects.composeAttachDetach((0, utils_js_1.getAttachedRootId)(baseMark), {
|
|
79
|
+
revision: newMark.revision,
|
|
80
|
+
localId: newMark.id,
|
|
81
|
+
}, baseMark.count);
|
|
82
|
+
const pinId = (0, utils_js_1.getAttachedRootId)(baseMark);
|
|
83
|
+
return newMark.type === "Remove"
|
|
84
|
+
? {
|
|
85
|
+
...newMark,
|
|
86
|
+
detachCellId: baseMark.detachCellId ?? pinId,
|
|
87
|
+
cellRename: (0, utils_js_1.getDetachOutputCellId)(newMark),
|
|
139
88
|
}
|
|
140
|
-
|
|
141
|
-
const detachRevision = finalDetach.revision;
|
|
142
|
-
if (detachRevision !== undefined) {
|
|
143
|
-
finalDetach.revision = detachRevision;
|
|
144
|
-
}
|
|
145
|
-
return (0, utils_js_1.normalizeCellRename)(baseMark.cellId, baseMark.count, originalAttach, finalDetach);
|
|
146
|
-
}
|
|
147
|
-
return (0, utils_js_1.normalizeCellRename)(newAttachAndDetach.cellId, newAttachAndDetach.count, newAttachAndDetach.attach, newAttachAndDetach.detach);
|
|
148
|
-
}
|
|
149
|
-
if ((0, utils_js_1.isImpactfulCellRename)(baseMark)) {
|
|
150
|
-
const baseAttachAndDetach = (0, utils_js_1.asAttachAndDetach)(baseMark);
|
|
151
|
-
if ((0, utils_js_1.markFillsCells)(newMark)) {
|
|
152
|
-
const originalAttach = (0, utils_js_1.withRevision)({
|
|
153
|
-
...baseAttachAndDetach.attach,
|
|
154
|
-
cellId: baseAttachAndDetach.cellId,
|
|
155
|
-
count: baseAttachAndDetach.count,
|
|
156
|
-
}, baseAttachAndDetach.attach.revision);
|
|
157
|
-
if ((0, moveEffectTable_js_1.isMoveIn)(baseAttachAndDetach.attach) && (0, moveEffectTable_js_1.isMoveOut)(baseAttachAndDetach.detach)) {
|
|
158
|
-
(0, internal_1.assert)((0, moveEffectTable_js_1.isMoveIn)(newMark), 0x809 /* Unexpected mark type */);
|
|
159
|
-
const originalAttachId = {
|
|
160
|
-
revision: baseAttachAndDetach.attach.revision,
|
|
161
|
-
localId: baseAttachAndDetach.attach.id,
|
|
162
|
-
};
|
|
163
|
-
setTruncatedEndpointForInner(moveEffects, index_js_2.CrossFieldTarget.Source, (0, utils_js_1.getEndpoint)(newMark), baseAttachAndDetach.count, originalAttachId);
|
|
164
|
-
const newEndpoint = getComposedEndpoint(moveEffects, index_js_2.CrossFieldTarget.Destination, newMark.revision, newMark.id, newMark.count);
|
|
165
|
-
if (newEndpoint !== undefined) {
|
|
166
|
-
changeFinalEndpoint(originalAttach, newEndpoint);
|
|
167
|
-
setTruncatedEndpoint(moveEffects, index_js_2.CrossFieldTarget.Source, newEndpoint, baseMark.count, originalAttachId);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
return originalAttach;
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
// Other mark types have been handled by previous conditional branches.
|
|
174
|
-
(0, internal_1.assert)(newMark.type === types_js_1.NoopMarkType, 0x80a /* Unexpected mark type */);
|
|
175
|
-
return baseMark;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
if (!(0, utils_js_1.markHasCellEffect)(baseMark) && !(0, utils_js_1.markHasCellEffect)(newMark)) {
|
|
179
|
-
return createNoopMark(newMark.count, undefined, (0, utils_js_1.getInputCellId)(baseMark));
|
|
180
|
-
}
|
|
181
|
-
else if (!(0, utils_js_1.markHasCellEffect)(baseMark)) {
|
|
182
|
-
return newMark;
|
|
89
|
+
: newMark;
|
|
183
90
|
}
|
|
184
91
|
else if (!(0, utils_js_1.markHasCellEffect)(newMark)) {
|
|
185
|
-
|
|
92
|
+
if ((0, utils_js_1.isAttach)(newMark) && (0, utils_js_1.isAttach)(baseMark)) {
|
|
93
|
+
// When composing two inserts, the second insert (which is a pin) should take precedence.
|
|
94
|
+
// We treat the pin as a detach and reattach.
|
|
95
|
+
moveEffects.composeAttachDetach((0, utils_js_1.getAttachedRootId)(baseMark), (0, utils_js_1.getAttachedRootId)(newMark), baseMark.count);
|
|
96
|
+
const composed = { cellId: baseMark.cellId, ...newMark };
|
|
97
|
+
delete composed.detachCellId;
|
|
98
|
+
return composed;
|
|
99
|
+
}
|
|
100
|
+
return updateBaseMarkId(moveEffects, baseMark);
|
|
186
101
|
}
|
|
187
102
|
else if ((0, utils_js_1.areInputCellsEmpty)(baseMark)) {
|
|
188
103
|
(0, internal_1.assert)((0, utils_js_1.isDetach)(newMark), 0x71c /* Unexpected mark type */);
|
|
189
104
|
(0, internal_1.assert)((0, utils_js_1.isAttach)(baseMark), 0x71d /* Expected generative mark */);
|
|
190
105
|
const attach = (0, utils_js_1.extractMarkEffect)(baseMark);
|
|
191
106
|
const detach = (0, utils_js_1.extractMarkEffect)(newMark);
|
|
192
|
-
|
|
107
|
+
moveEffects.composeAttachDetach((0, utils_js_1.getAttachedRootId)(baseMark), (0, utils_js_1.getDetachedRootId)(newMark), baseMark.count);
|
|
193
108
|
if ((0, utils_js_1.areEqualCellIds)((0, utils_js_1.getOutputCellId)(newMark), baseMark.cellId)) {
|
|
194
109
|
// The output and input cell IDs are the same, so this mark has no effect.
|
|
195
110
|
return { count: baseMark.count, cellId: baseMark.cellId };
|
|
@@ -197,37 +112,38 @@ function composeMarksIgnoreChild(baseMark, newMark, moveEffects) {
|
|
|
197
112
|
return (0, utils_js_1.normalizeCellRename)(baseMark.cellId, baseMark.count, attach, detach);
|
|
198
113
|
}
|
|
199
114
|
else {
|
|
200
|
-
|
|
201
|
-
|
|
115
|
+
(0, internal_1.assert)(baseMark.type === "Remove", "Unexpected mark type");
|
|
116
|
+
(0, internal_1.assert)(newMark.type === "Insert", "Unexpected mark type");
|
|
117
|
+
const detachId = (0, utils_js_1.getDetachedRootId)(baseMark);
|
|
118
|
+
const attachId = (0, utils_js_1.getAttachedRootId)(newMark);
|
|
119
|
+
// Note that we cannot assert that this returns true,
|
|
120
|
+
// as it may not be until a second pass that MCF can tell that this is a reattach of the same node.
|
|
121
|
+
moveEffects.composeDetachAttach(detachId, attachId, baseMark.count, true);
|
|
122
|
+
// The composition has no net effect but we preserve the second change's intention to pin the nodes here.
|
|
123
|
+
const composedMark = { ...newMark };
|
|
124
|
+
delete composedMark.cellId;
|
|
125
|
+
const baseDetachCellId = baseMark.detachCellId ?? detachId;
|
|
126
|
+
if (!(0, index_js_1.areEqualChangeAtomIds)(baseDetachCellId, attachId)) {
|
|
127
|
+
composedMark.detachCellId = baseDetachCellId;
|
|
128
|
+
}
|
|
129
|
+
return composedMark;
|
|
202
130
|
}
|
|
203
131
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
setEndpoint(moveEffects, index_js_2.CrossFieldTarget.Source, finalSource, count, finalDest);
|
|
217
|
-
const truncatedEndpoint1 = getTruncatedEndpointForInner(moveEffects, index_js_2.CrossFieldTarget.Destination, baseAttach.revision, baseAttach.id, count);
|
|
218
|
-
if (truncatedEndpoint1 !== undefined) {
|
|
219
|
-
setTruncatedEndpoint(moveEffects, index_js_2.CrossFieldTarget.Destination, finalDest, count, truncatedEndpoint1);
|
|
220
|
-
}
|
|
221
|
-
setEndpoint(moveEffects, index_js_2.CrossFieldTarget.Destination, finalDest, count, finalSource);
|
|
222
|
-
const truncatedEndpoint2 = getTruncatedEndpointForInner(moveEffects, index_js_2.CrossFieldTarget.Source, newDetach.revision, newDetach.id, count);
|
|
223
|
-
if (truncatedEndpoint2 !== undefined) {
|
|
224
|
-
setTruncatedEndpoint(moveEffects, index_js_2.CrossFieldTarget.Source, finalSource, count, truncatedEndpoint2);
|
|
132
|
+
function updateBaseMarkId(moveEffects, baseMark) {
|
|
133
|
+
if ((0, utils_js_1.isDetach)(baseMark)) {
|
|
134
|
+
const baseDetachId = (0, utils_js_1.getDetachedRootId)(baseMark);
|
|
135
|
+
const updatedDetachId = getUpdatedDetachId(moveEffects, baseMark);
|
|
136
|
+
if (updatedDetachId !== undefined &&
|
|
137
|
+
!(0, index_js_1.areEqualChangeAtomIds)(updatedDetachId, baseDetachId)) {
|
|
138
|
+
return {
|
|
139
|
+
...baseMark,
|
|
140
|
+
revision: updatedDetachId.revision,
|
|
141
|
+
id: updatedDetachId.localId,
|
|
142
|
+
detachCellId: baseMark.detachCellId ?? baseDetachId,
|
|
143
|
+
};
|
|
225
144
|
}
|
|
226
|
-
// The `finalEndpoint` field of AttachAndDetach move effect pairs is not used,
|
|
227
|
-
// so we remove it as a normalization.
|
|
228
|
-
delete baseAttach.finalEndpoint;
|
|
229
|
-
delete newDetach.finalEndpoint;
|
|
230
145
|
}
|
|
146
|
+
return baseMark;
|
|
231
147
|
}
|
|
232
148
|
function createNoopMark(length, nodeChange, cellId) {
|
|
233
149
|
const mark = { count: length };
|
|
@@ -242,13 +158,12 @@ function createNoopMark(length, nodeChange, cellId) {
|
|
|
242
158
|
}
|
|
243
159
|
function handleNodeChanges(baseMark, newMark, composeChild, moveEffects) {
|
|
244
160
|
if (newMark.changes !== undefined) {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
if (baseSource !== undefined) {
|
|
248
|
-
setModifyAfter(moveEffects, (0, utils_js_1.getEndpoint)(baseSource), newMark.changes);
|
|
161
|
+
if (baseMark.type === "Insert" && baseMark.cellId !== undefined) {
|
|
162
|
+
moveEffects.sendNewChangesToBaseSourceLocation((0, utils_js_1.getAttachedRootId)(baseMark), newMark.changes);
|
|
249
163
|
return undefined;
|
|
250
164
|
}
|
|
251
165
|
}
|
|
166
|
+
// TODO: Make sure composeChild is not called twice on the node changes.
|
|
252
167
|
return composeChildChanges(baseMark.changes, newMark.changes, composeChild);
|
|
253
168
|
}
|
|
254
169
|
function composeChildChanges(baseChange, newChange, composeChild) {
|
|
@@ -257,17 +172,15 @@ function composeChildChanges(baseChange, newChange, composeChild) {
|
|
|
257
172
|
}
|
|
258
173
|
return composeChild(baseChange, newChange);
|
|
259
174
|
}
|
|
260
|
-
function composeMark(mark, moveEffects, composeChild) {
|
|
261
|
-
const nodeChanges = mark.changes !== undefined ? composeChild(mark.changes) : undefined;
|
|
262
|
-
const updatedMark = withUpdatedEndpoint(mark, mark.count, moveEffects);
|
|
263
|
-
return (0, utils_js_1.withNodeChange)(updatedMark, nodeChanges);
|
|
264
|
-
}
|
|
265
175
|
class ComposeQueue {
|
|
266
176
|
constructor(baseMarks, newMarks, moveEffects, revisionMetadata) {
|
|
267
177
|
this.moveEffects = moveEffects;
|
|
268
178
|
this.revisionMetadata = revisionMetadata;
|
|
269
|
-
|
|
270
|
-
|
|
179
|
+
const queryFunc = (mark) => (0, utils_js_1.isDetach)(mark) || (0, utils_js_1.isPin)(mark)
|
|
180
|
+
? moveEffects.getNewChangesForBaseDetach((0, utils_js_1.getMovedNodeId)(mark), mark.count).length
|
|
181
|
+
: mark.count;
|
|
182
|
+
this.baseMarks = new markQueue_js_1.MarkQueue(baseMarks, queryFunc);
|
|
183
|
+
this.newMarks = new markQueue_js_1.MarkQueue(newMarks, (mark) => mark.count);
|
|
271
184
|
this.baseMarksCellSources = (0, utils_js_1.cellSourcesFromMarks)(baseMarks, utils_js_1.getOutputCellId);
|
|
272
185
|
this.newMarksCellSources = (0, utils_js_1.cellSourcesFromMarks)(newMarks, utils_js_1.getInputCellId);
|
|
273
186
|
}
|
|
@@ -278,7 +191,7 @@ class ComposeQueue {
|
|
|
278
191
|
const baseMark = this.baseMarks.peek();
|
|
279
192
|
const newMark = this.newMarks.peek();
|
|
280
193
|
if (baseMark === undefined && newMark === undefined) {
|
|
281
|
-
|
|
194
|
+
(0, internal_1.fail)("Should not pop when queue is empty");
|
|
282
195
|
}
|
|
283
196
|
else if (baseMark === undefined) {
|
|
284
197
|
return this.dequeueNew();
|
|
@@ -323,9 +236,6 @@ class ComposeQueue {
|
|
|
323
236
|
dequeueBase(length = Number.POSITIVE_INFINITY) {
|
|
324
237
|
const baseMark = this.baseMarks.dequeueUpTo(length);
|
|
325
238
|
const movedChanges = getMovedChangesFromMark(this.moveEffects, baseMark);
|
|
326
|
-
if (movedChanges !== undefined) {
|
|
327
|
-
this.moveEffects.onMoveIn(movedChanges);
|
|
328
|
-
}
|
|
329
239
|
const newMark = createNoopMark(baseMark.count, movedChanges, (0, utils_js_1.getOutputCellId)(baseMark));
|
|
330
240
|
return { baseMark, newMark };
|
|
331
241
|
}
|
|
@@ -360,100 +270,14 @@ class ComposeQueue {
|
|
|
360
270
|
}
|
|
361
271
|
exports.ComposeQueue = ComposeQueue;
|
|
362
272
|
function getMovedChangesFromMark(moveEffects, markEffect) {
|
|
363
|
-
if ((0, utils_js_1.
|
|
364
|
-
return getMovedChangesFromMark(moveEffects, markEffect.detach);
|
|
365
|
-
}
|
|
366
|
-
if (!(0, moveEffectTable_js_1.isMoveOut)(markEffect)) {
|
|
273
|
+
if (!(0, utils_js_1.isDetach)(markEffect)) {
|
|
367
274
|
return undefined;
|
|
368
275
|
}
|
|
369
|
-
return
|
|
370
|
-
|
|
371
|
-
// It is expected that the range from `id` to `id + count - 1` has the same move effect.
|
|
372
|
-
// The call sites to this function are making queries about a mark which has already been split by a `MarkQueue`
|
|
373
|
-
// to match the ranges in `moveEffects`.
|
|
374
|
-
// TODO: Reduce the duplication between this and other MoveEffect helpers
|
|
375
|
-
function getModifyAfter(moveEffects, revision, id) {
|
|
376
|
-
const target = index_js_2.CrossFieldTarget.Source;
|
|
377
|
-
const effect = (0, moveEffectTable_js_1.getMoveEffect)(moveEffects, target, revision, id, 1);
|
|
378
|
-
if (effect.value?.modifyAfter !== undefined) {
|
|
379
|
-
return effect.value.modifyAfter;
|
|
380
|
-
}
|
|
381
|
-
return undefined;
|
|
382
|
-
}
|
|
383
|
-
// TODO: Reduce the duplication between this and other MoveEffect helpers
|
|
384
|
-
function setModifyAfter(moveEffects, { revision, localId: id }, modifyAfter) {
|
|
385
|
-
const target = index_js_2.CrossFieldTarget.Source;
|
|
386
|
-
const count = 1;
|
|
387
|
-
const effect = (0, moveEffectTable_js_1.getMoveEffect)(moveEffects, target, revision, id, count, false);
|
|
388
|
-
const newEffect = effect.value !== undefined ? { ...effect.value, modifyAfter } : { modifyAfter };
|
|
389
|
-
(0, moveEffectTable_js_1.setMoveEffect)(moveEffects, target, revision, id, count, newEffect);
|
|
390
|
-
}
|
|
391
|
-
function setEndpoint(moveEffects, target, id, count, endpoint) {
|
|
392
|
-
const effect = (0, moveEffectTable_js_1.getMoveEffect)(moveEffects, target, id.revision, id.localId, count, false);
|
|
393
|
-
const newEffect = effect.value !== undefined ? { ...effect.value, endpoint } : { endpoint };
|
|
394
|
-
(0, moveEffectTable_js_1.setMoveEffect)(moveEffects, target, id.revision, id.localId, effect.length, newEffect);
|
|
395
|
-
const remainingCount = count - effect.length;
|
|
396
|
-
if (remainingCount > 0) {
|
|
397
|
-
setEndpoint(moveEffects, target, (0, index_js_1.offsetChangeAtomId)(id, effect.length), remainingCount, (0, index_js_1.offsetChangeAtomId)(endpoint, effect.length));
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
function setTruncatedEndpoint(moveEffects, target, id, count, truncatedEndpoint) {
|
|
401
|
-
const effect = (0, moveEffectTable_js_1.getMoveEffect)(moveEffects, target, id.revision, id.localId, count);
|
|
402
|
-
const newEffect = effect.value !== undefined
|
|
403
|
-
? { ...effect.value, truncatedEndpoint }
|
|
404
|
-
: { truncatedEndpoint };
|
|
405
|
-
(0, moveEffectTable_js_1.setMoveEffect)(moveEffects, target, id.revision, id.localId, effect.length, newEffect);
|
|
406
|
-
const remainingCount = count - effect.length;
|
|
407
|
-
if (remainingCount > 0) {
|
|
408
|
-
setTruncatedEndpoint(moveEffects, target, (0, index_js_1.offsetChangeAtomId)(id, effect.length), remainingCount, (0, index_js_1.offsetChangeAtomId)(truncatedEndpoint, effect.length));
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
function setTruncatedEndpointForInner(moveEffects, target, id, count, truncatedEndpointForInner) {
|
|
412
|
-
const effect = (0, moveEffectTable_js_1.getMoveEffect)(moveEffects, target, id.revision, id.localId, count);
|
|
413
|
-
const newEffect = effect.value !== undefined
|
|
414
|
-
? { ...effect.value, truncatedEndpointForInner }
|
|
415
|
-
: { truncatedEndpointForInner };
|
|
416
|
-
(0, moveEffectTable_js_1.setMoveEffect)(moveEffects, target, id.revision, id.localId, effect.length, newEffect);
|
|
417
|
-
const remainingCount = count - effect.length;
|
|
418
|
-
if (remainingCount > 0) {
|
|
419
|
-
setTruncatedEndpointForInner(moveEffects, target, (0, index_js_1.offsetChangeAtomId)(id, effect.length), remainingCount, (0, index_js_1.offsetChangeAtomId)(truncatedEndpointForInner, effect.length));
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
function withUpdatedEndpoint(mark, count, effects) {
|
|
423
|
-
if ((0, utils_js_1.isAttachAndDetachEffect)(mark)) {
|
|
424
|
-
return {
|
|
425
|
-
...mark,
|
|
426
|
-
attach: withUpdatedEndpoint(mark.attach, count, effects),
|
|
427
|
-
detach: withUpdatedEndpoint(mark.detach, count, effects),
|
|
428
|
-
};
|
|
429
|
-
}
|
|
430
|
-
if (!(0, moveEffectTable_js_1.isMoveMark)(mark)) {
|
|
431
|
-
return mark;
|
|
432
|
-
}
|
|
433
|
-
const finalDest = getComposedEndpoint(effects, (0, moveEffectTable_js_1.getCrossFieldTargetFromMove)(mark), mark.revision, mark.id, count);
|
|
434
|
-
if (finalDest === undefined) {
|
|
435
|
-
return mark;
|
|
436
|
-
}
|
|
437
|
-
const output = { ...mark };
|
|
438
|
-
changeFinalEndpoint(output, finalDest);
|
|
439
|
-
return output;
|
|
440
|
-
}
|
|
441
|
-
function changeFinalEndpoint(mark, endpoint) {
|
|
442
|
-
if ((0, utils_js_1.areEqualCellIds)(endpoint, { revision: mark.revision, localId: mark.id })) {
|
|
443
|
-
delete mark.finalEndpoint;
|
|
444
|
-
}
|
|
445
|
-
else {
|
|
446
|
-
mark.finalEndpoint = endpoint;
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
function getComposedEndpoint(moveEffects, target, revision, id, count) {
|
|
450
|
-
const effect = (0, moveEffectTable_js_1.getMoveEffect)(moveEffects, target, revision, id, count);
|
|
451
|
-
(0, internal_1.assert)(effect.length === count, 0x815 /* Expected effect to cover entire mark */);
|
|
452
|
-
return effect.value?.truncatedEndpoint ?? effect.value?.endpoint;
|
|
276
|
+
return moveEffects.getNewChangesForBaseDetach((0, utils_js_1.getDetachedRootId)(markEffect), 1).value
|
|
277
|
+
?.nodeChange;
|
|
453
278
|
}
|
|
454
|
-
function
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
return effect.value?.truncatedEndpointForInner;
|
|
279
|
+
function getUpdatedDetachId(manager, mark) {
|
|
280
|
+
return manager.getNewChangesForBaseDetach((0, utils_js_1.getDetachedRootId)(mark), mark.count).value
|
|
281
|
+
?.detachId;
|
|
458
282
|
}
|
|
459
283
|
//# sourceMappingURL=compose.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/compose.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAEpF,kDAK6B;AAE7B,yDAKoC;AAGpC,6DAAuD;AACvD,iDAA2C;AAC3C,6DAU8B;AAC9B,yCAWoB;AACpB,yCA0BoB;AAEpB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,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IACvE,IAAA,iBAAM,EAAC,MAAM,CAAC,MAAM,KAAK,KAAK,EAAE,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAClF,OAAO,MAAM,CAAC,KAAK,EAAE,iBAAiB,IAAI,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC;AAClE,CAAC;AAED,SAAS,4BAA4B,CACpC,WAA4B,EAC5B,MAAwB,EACxB,QAAiC,EACjC,EAAU,EACV,KAAa;IAEb,MAAM,MAAM,GAAG,IAAA,kCAAa,EAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IACvE,IAAA,iBAAM,EAAC,MAAM,CAAC,MAAM,KAAK,KAAK,EAAE,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAClF,OAAO,MAAM,CAAC,KAAK,EAAE,yBAAyB,CAAC;AAChD,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 RevisionMetadataSource,\n\ttype RevisionTag,\n\toffsetChangeAtomId,\n} from \"../../core/index.js\";\nimport type { IdAllocator } from \"../../util/index.js\";\nimport {\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\ttype NodeChangeComposer,\n\ttype NodeId,\n} from \"../modular-schema/index.js\";\n\nimport type { MoveMarkEffect } from \"./helperTypes.js\";\nimport { MarkListFactory } from \"./markListFactory.js\";\nimport { MarkQueue } from \"./markQueue.js\";\nimport {\n\ttype MoveEffect,\n\ttype MoveEffectTable,\n\tgetCrossFieldTargetFromMove,\n\tgetMoveEffect,\n\tgetMoveIn,\n\tisMoveIn,\n\tisMoveMark,\n\tisMoveOut,\n\tsetMoveEffect,\n} from \"./moveEffectTable.js\";\nimport {\n\ttype Attach,\n\ttype CellMark,\n\ttype Changeset,\n\ttype Detach,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype MarkList,\n\ttype MoveId,\n\ttype NoopMark,\n\tNoopMarkType,\n} from \"./types.js\";\nimport {\n\tCellOrder,\n\tareEqualCellIds,\n\tareInputCellsEmpty,\n\tareOutputCellsEmpty,\n\tasAttachAndDetach,\n\tcellSourcesFromMarks,\n\tcompareCellPositionsUsingTombstones,\n\textractMarkEffect,\n\tgetEndpoint,\n\tgetInputCellId,\n\tgetOutputCellId,\n\tisAttach,\n\tisAttachAndDetachEffect,\n\tisDetach,\n\tisImpactfulCellRename,\n\tisNewAttach,\n\tisNoopMark,\n\tisRename,\n\tmarkEmptiesCells,\n\tmarkFillsCells,\n\tmarkHasCellEffect,\n\tnormalizeCellRename,\n\tsettleMark,\n\twithNodeChange,\n\twithRevision,\n} from \"./utils.js\";\n\n/**\n * Composes a sequence of changesets into a single changeset.\n * @param changes - The changesets to be applied.\n * Parts of the input may be reused in the output, but the input is not mutated.\n * Each changeset in the list is assumed to be applicable after the previous one.\n * @returns A changeset that is equivalent to applying each of the given `changes` in order.\n *\n * WARNING! This implementation is incomplete:\n * - Tombstone information is ignored.\n * - Support for moves is not implemented.\n * - Support for slices is not implemented.\n */\nexport function compose(\n\tchange1: Changeset,\n\tchange2: Changeset,\n\tcomposeChild: NodeChangeComposer,\n\t_genId: IdAllocator,\n\tmanager: CrossFieldManager,\n\trevisionMetadata: RevisionMetadataSource,\n): Changeset {\n\treturn composeMarkLists(\n\t\tchange1,\n\t\tchange2,\n\t\tcomposeChild,\n\t\tmanager as MoveEffectTable,\n\t\trevisionMetadata,\n\t);\n}\n\nfunction composeMarkLists(\n\tbaseMarkList: MarkList,\n\tnewMarkList: MarkList,\n\tcomposeChild: NodeChangeComposer,\n\tmoveEffects: MoveEffectTable,\n\trevisionMetadata: RevisionMetadataSource,\n): MarkList {\n\tconst factory = new MarkListFactory();\n\tconst queue = new ComposeQueue(baseMarkList, newMarkList, moveEffects, revisionMetadata);\n\twhile (!queue.isEmpty()) {\n\t\tconst { baseMark, newMark } = queue.pop();\n\t\tif (newMark === undefined) {\n\t\t\tassert(\n\t\t\t\tbaseMark !== undefined,\n\t\t\t\t0x4db /* Non-empty queue should not return two undefined marks */,\n\t\t\t);\n\t\t\tfactory.push(\n\t\t\t\tcomposeMark(baseMark, moveEffects, (node: NodeId) =>\n\t\t\t\t\tcomposeChildChanges(node, undefined, composeChild),\n\t\t\t\t),\n\t\t\t);\n\t\t} else {\n\t\t\t// We only compose changesets that will not be further rebased.\n\t\t\t// It is therefore safe to remove any intentions that have no impact in the context they apply to.\n\t\t\tconst settledNewMark = settleMark(newMark);\n\t\t\tif (baseMark === undefined) {\n\t\t\t\tfactory.push(\n\t\t\t\t\tcomposeMark(settledNewMark, moveEffects, (node: NodeId) =>\n\t\t\t\t\t\tcomposeChildChanges(undefined, node, composeChild),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// Past this point, we are guaranteed that `settledNewMark` and `baseMark` have the same length and\n\t\t\t\t// start at the same location in the revision after the base changes.\n\t\t\t\t// They therefore refer to the same range for that revision.\n\t\t\t\tconst settledBaseMark = settleMark(baseMark);\n\t\t\t\tconst composedMark = composeMarks(\n\t\t\t\t\tsettledBaseMark,\n\t\t\t\t\tsettledNewMark,\n\t\t\t\t\tcomposeChild,\n\t\t\t\t\tmoveEffects,\n\t\t\t\t);\n\t\t\t\tfactory.push(composedMark);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn factory.list;\n}\n\n/**\n * Composes two marks where `newMark` is based on the state produced by `baseMark`.\n * @param baseMark - The mark to compose with `newMark`.\n * Its output range should be the same as `newMark`'s input range.\n * @param newRev - The revision the new mark is part of.\n * @param newMark - The mark to compose with `baseMark`.\n * Its input range should be the same as `baseMark`'s output range.\n * @returns A mark that is equivalent to applying both `baseMark` and `newMark` successively.\n */\nfunction composeMarks(\n\tbaseMark: Mark,\n\tnewMark: Mark,\n\tcomposeChild: NodeChangeComposer,\n\tmoveEffects: MoveEffectTable,\n): Mark {\n\tconst nodeChange = handleNodeChanges(baseMark, newMark, composeChild, moveEffects);\n\n\treturn withUpdatedEndpoint(\n\t\twithNodeChange(composeMarksIgnoreChild(baseMark, newMark, moveEffects), nodeChange),\n\t\tbaseMark.count,\n\t\tmoveEffects,\n\t);\n}\n\nfunction composeMarksIgnoreChild(\n\tbaseMark: Mark,\n\tnewMark: Mark,\n\tmoveEffects: MoveEffectTable,\n): Mark {\n\tif (isNoopMark(baseMark)) {\n\t\treturn newMark;\n\t} else if (isNoopMark(newMark)) {\n\t\treturn baseMark;\n\t}\n\n\tif (isRename(baseMark) && isRename(newMark)) {\n\t\treturn { ...baseMark, idOverride: newMark.idOverride };\n\t} else if (isRename(baseMark)) {\n\t\tassert(\n\t\t\tisAttach(newMark) || isAttachAndDetachEffect(newMark),\n\t\t\t0x9f1 /* Unexpected mark type */,\n\t\t);\n\t\treturn { ...newMark, cellId: baseMark.cellId };\n\t} else if (isRename(newMark)) {\n\t\tassert(\n\t\t\tisDetach(baseMark) || isAttachAndDetachEffect(baseMark),\n\t\t\t0x9f2 /* Unexpected mark type */,\n\t\t);\n\t\treturn isDetach(baseMark)\n\t\t\t? { ...baseMark, idOverride: newMark.idOverride }\n\t\t\t: { ...baseMark, detach: { ...baseMark.detach, idOverride: newMark.idOverride } };\n\t}\n\n\tif (isImpactfulCellRename(newMark)) {\n\t\tconst newAttachAndDetach = asAttachAndDetach(newMark);\n\t\tassert(\n\t\t\tnewAttachAndDetach.cellId !== undefined,\n\t\t\t0x9f3 /* Impactful cell rename must target empty cell */,\n\t\t);\n\t\tconst newDetachRevision = newAttachAndDetach.detach.revision;\n\t\tif (markEmptiesCells(baseMark)) {\n\t\t\t// baseMark is a detach which cancels with the attach portion of the AttachAndDetach,\n\t\t\t// so we are just left with the detach portion of the AttachAndDetach.\n\t\t\tconst newDetach: CellMark<Detach> = {\n\t\t\t\t...newAttachAndDetach.detach,\n\t\t\t\tcount: baseMark.count,\n\t\t\t};\n\n\t\t\tif (isMoveIn(newAttachAndDetach.attach) && isMoveOut(newAttachAndDetach.detach)) {\n\t\t\t\tassert(isMoveOut(baseMark), 0x808 /* Unexpected mark type */);\n\n\t\t\t\t// The base changeset and new changeset both move these nodes.\n\t\t\t\t// Call the original position of the nodes A, the position after the base changeset is applied B,\n\t\t\t\t// and the position after the new changeset is applied C.\n\t\t\t\t// The new changeset moves the nodes from B, temporarily returns them to A, and then moves them to C.\n\t\t\t\t// The composition of the base and new changesets will be a move directly from A to C,\n\t\t\t\t// since the move from A to B cancels out with the return from B to A.\n\t\t\t\t// This if-block is handling marks at A.\n\t\t\t\t// When we compose the marks at B we will link the start of the base move (A to B)\n\t\t\t\t// with the end of the new move (B to C).\n\t\t\t\t// Because we are replacing the mark representing the start of the move with the new changeset's\n\t\t\t\t// move-out from A, we update the base move-in at B to consider that its start point.\n\t\t\t\tconst newDetachId = {\n\t\t\t\t\trevision: newDetachRevision,\n\t\t\t\t\tlocalId: newAttachAndDetach.detach.id,\n\t\t\t\t};\n\n\t\t\t\tsetTruncatedEndpointForInner(\n\t\t\t\t\tmoveEffects,\n\t\t\t\t\tCrossFieldTarget.Destination,\n\t\t\t\t\tgetEndpoint(baseMark),\n\t\t\t\t\tbaseMark.count,\n\t\t\t\t\tnewDetachId,\n\t\t\t\t);\n\n\t\t\t\tconst newEndpoint = getComposedEndpoint(\n\t\t\t\t\tmoveEffects,\n\t\t\t\t\tCrossFieldTarget.Source,\n\t\t\t\t\tbaseMark.revision,\n\t\t\t\t\tbaseMark.id,\n\t\t\t\t\tbaseMark.count,\n\t\t\t\t);\n\n\t\t\t\tif (newEndpoint !== undefined) {\n\t\t\t\t\tchangeFinalEndpoint(newDetach as MoveMarkEffect, newEndpoint);\n\t\t\t\t\tsetTruncatedEndpoint(\n\t\t\t\t\t\tmoveEffects,\n\t\t\t\t\t\tCrossFieldTarget.Destination,\n\t\t\t\t\t\tnewEndpoint,\n\t\t\t\t\t\tbaseMark.count,\n\t\t\t\t\t\tnewDetachId,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn newDetach;\n\t\t}\n\n\t\tif (isImpactfulCellRename(baseMark)) {\n\t\t\tassert(\n\t\t\t\tbaseMark.cellId !== undefined,\n\t\t\t\t0x9f4 /* Impactful cell rename must target empty cell */,\n\t\t\t);\n\t\t\tconst baseAttachAndDetach = asAttachAndDetach(baseMark);\n\t\t\tconst newOutputId = getOutputCellId(newAttachAndDetach);\n\n\t\t\tconst originalAttach = { ...baseAttachAndDetach.attach };\n\t\t\tconst finalDetach = { ...newAttachAndDetach.detach };\n\n\t\t\thandleMovePivot(baseMark.count, originalAttach, finalDetach, moveEffects);\n\n\t\t\tif (areEqualCellIds(newOutputId, baseAttachAndDetach.cellId)) {\n\t\t\t\treturn { count: baseAttachAndDetach.count, cellId: baseAttachAndDetach.cellId };\n\t\t\t}\n\n\t\t\t// `newMark`'s attach portion cancels with `baseMark`'s detach portion.\n\t\t\tconst detachRevision = finalDetach.revision;\n\t\t\tif (detachRevision !== undefined) {\n\t\t\t\tfinalDetach.revision = detachRevision;\n\t\t\t}\n\n\t\t\treturn normalizeCellRename(baseMark.cellId, baseMark.count, originalAttach, finalDetach);\n\t\t}\n\n\t\treturn normalizeCellRename(\n\t\t\tnewAttachAndDetach.cellId,\n\t\t\tnewAttachAndDetach.count,\n\t\t\tnewAttachAndDetach.attach,\n\t\t\tnewAttachAndDetach.detach,\n\t\t);\n\t}\n\tif (isImpactfulCellRename(baseMark)) {\n\t\tconst baseAttachAndDetach = asAttachAndDetach(baseMark);\n\t\tif (markFillsCells(newMark)) {\n\t\t\tconst originalAttach = withRevision(\n\t\t\t\t{\n\t\t\t\t\t...baseAttachAndDetach.attach,\n\t\t\t\t\tcellId: baseAttachAndDetach.cellId,\n\t\t\t\t\tcount: baseAttachAndDetach.count,\n\t\t\t\t},\n\t\t\t\tbaseAttachAndDetach.attach.revision,\n\t\t\t);\n\n\t\t\tif (isMoveIn(baseAttachAndDetach.attach) && isMoveOut(baseAttachAndDetach.detach)) {\n\t\t\t\tassert(isMoveIn(newMark), 0x809 /* Unexpected mark type */);\n\n\t\t\t\tconst originalAttachId = {\n\t\t\t\t\trevision: baseAttachAndDetach.attach.revision,\n\t\t\t\t\tlocalId: baseAttachAndDetach.attach.id,\n\t\t\t\t};\n\n\t\t\t\tsetTruncatedEndpointForInner(\n\t\t\t\t\tmoveEffects,\n\t\t\t\t\tCrossFieldTarget.Source,\n\t\t\t\t\tgetEndpoint(newMark),\n\t\t\t\t\tbaseAttachAndDetach.count,\n\t\t\t\t\toriginalAttachId,\n\t\t\t\t);\n\n\t\t\t\tconst newEndpoint = getComposedEndpoint(\n\t\t\t\t\tmoveEffects,\n\t\t\t\t\tCrossFieldTarget.Destination,\n\t\t\t\t\tnewMark.revision,\n\t\t\t\t\tnewMark.id,\n\t\t\t\t\tnewMark.count,\n\t\t\t\t);\n\n\t\t\t\tif (newEndpoint !== undefined) {\n\t\t\t\t\tchangeFinalEndpoint(originalAttach as MoveMarkEffect, newEndpoint);\n\t\t\t\t\tsetTruncatedEndpoint(\n\t\t\t\t\t\tmoveEffects,\n\t\t\t\t\t\tCrossFieldTarget.Source,\n\t\t\t\t\t\tnewEndpoint,\n\t\t\t\t\t\tbaseMark.count,\n\t\t\t\t\t\toriginalAttachId,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn originalAttach;\n\t\t} else {\n\t\t\t// Other mark types have been handled by previous conditional branches.\n\t\t\tassert(newMark.type === NoopMarkType, 0x80a /* Unexpected mark type */);\n\t\t\treturn baseMark;\n\t\t}\n\t}\n\n\tif (!markHasCellEffect(baseMark) && !markHasCellEffect(newMark)) {\n\t\treturn createNoopMark(newMark.count, undefined, getInputCellId(baseMark));\n\t} else if (!markHasCellEffect(baseMark)) {\n\t\treturn newMark;\n\t} else if (!markHasCellEffect(newMark)) {\n\t\treturn baseMark;\n\t} else if (areInputCellsEmpty(baseMark)) {\n\t\tassert(isDetach(newMark), 0x71c /* Unexpected mark type */);\n\t\tassert(isAttach(baseMark), 0x71d /* Expected generative mark */);\n\n\t\tconst attach = extractMarkEffect(baseMark);\n\t\tconst detach = extractMarkEffect(newMark);\n\n\t\thandleMovePivot(baseMark.count, attach, detach, moveEffects);\n\n\t\tif (areEqualCellIds(getOutputCellId(newMark), baseMark.cellId)) {\n\t\t\t// The output and input cell IDs are the same, so this mark has no effect.\n\t\t\treturn { count: baseMark.count, cellId: baseMark.cellId };\n\t\t}\n\t\treturn normalizeCellRename(baseMark.cellId, baseMark.count, attach, detach);\n\t} else {\n\t\tconst length = baseMark.count;\n\t\treturn createNoopMark(length, undefined);\n\t}\n}\n\n/**\n * Checks if `baseAttach` and `newDetach` are both moves, and if so updates their move endpoints as appropriate,\n * and removes their `finalEndpoint` endpoint fields. Note that can mutate `baseAttach` and `newDetach`.\n * If the effects are not both moves this function does nothing.\n * @param count - The number of cells targeted\n * @param baseAttach - The base attach effect at this location\n * @param newDetach - The new detach effect at this location\n */\nfunction handleMovePivot(\n\tcount: number,\n\tbaseAttach: Attach,\n\tnewDetach: Detach,\n\tmoveEffects: MoveEffectTable,\n): void {\n\tif (isMoveIn(baseAttach) && isMoveOut(newDetach)) {\n\t\tconst finalSource = getEndpoint(baseAttach);\n\t\tconst finalDest = getEndpoint(newDetach);\n\n\t\tsetEndpoint(moveEffects, CrossFieldTarget.Source, finalSource, count, finalDest);\n\n\t\tconst truncatedEndpoint1 = getTruncatedEndpointForInner(\n\t\t\tmoveEffects,\n\t\t\tCrossFieldTarget.Destination,\n\t\t\tbaseAttach.revision,\n\t\t\tbaseAttach.id,\n\t\t\tcount,\n\t\t);\n\n\t\tif (truncatedEndpoint1 !== undefined) {\n\t\t\tsetTruncatedEndpoint(\n\t\t\t\tmoveEffects,\n\t\t\t\tCrossFieldTarget.Destination,\n\t\t\t\tfinalDest,\n\t\t\t\tcount,\n\t\t\t\ttruncatedEndpoint1,\n\t\t\t);\n\t\t}\n\n\t\tsetEndpoint(moveEffects, CrossFieldTarget.Destination, finalDest, count, finalSource);\n\n\t\tconst truncatedEndpoint2 = getTruncatedEndpointForInner(\n\t\t\tmoveEffects,\n\t\t\tCrossFieldTarget.Source,\n\t\t\tnewDetach.revision,\n\t\t\tnewDetach.id,\n\t\t\tcount,\n\t\t);\n\n\t\tif (truncatedEndpoint2 !== undefined) {\n\t\t\tsetTruncatedEndpoint(\n\t\t\t\tmoveEffects,\n\t\t\t\tCrossFieldTarget.Source,\n\t\t\t\tfinalSource,\n\t\t\t\tcount,\n\t\t\t\ttruncatedEndpoint2,\n\t\t\t);\n\t\t}\n\n\t\t// The `finalEndpoint` field of AttachAndDetach move effect pairs is not used,\n\t\t// so we remove it as a normalization.\n\t\tdelete baseAttach.finalEndpoint;\n\t\tdelete newDetach.finalEndpoint;\n\t}\n}\n\nfunction createNoopMark(\n\tlength: number,\n\tnodeChange: NodeId | undefined,\n\tcellId?: ChangeAtomId,\n): Mark {\n\tconst mark: CellMark<NoopMark> = { count: length };\n\tif (nodeChange !== undefined) {\n\t\tassert(length === 1, 0x692 /* A mark with a node change must have length one */);\n\t\tmark.changes = nodeChange;\n\t}\n\tif (cellId !== undefined) {\n\t\tmark.cellId = cellId;\n\t}\n\treturn mark;\n}\n\nfunction handleNodeChanges(\n\tbaseMark: Mark,\n\tnewMark: Mark,\n\tcomposeChild: NodeChangeComposer,\n\tmoveEffects: MoveEffectTable,\n): NodeId | undefined {\n\tif (newMark.changes !== undefined) {\n\t\tconst baseSource = getMoveIn(baseMark);\n\n\t\t// TODO: Make sure composeChild is not called twice on the node changes.\n\t\tif (baseSource !== undefined) {\n\t\t\tsetModifyAfter(moveEffects, getEndpoint(baseSource), newMark.changes);\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\treturn composeChildChanges(baseMark.changes, newMark.changes, composeChild);\n}\n\nfunction composeChildChanges(\n\tbaseChange: NodeId | undefined,\n\tnewChange: NodeId | undefined,\n\tcomposeChild: NodeChangeComposer,\n): NodeId | undefined {\n\tif (baseChange === undefined && newChange === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn composeChild(baseChange, newChange);\n}\n\nfunction composeMark<TMark extends Mark>(\n\tmark: TMark,\n\tmoveEffects: MoveEffectTable,\n\tcomposeChild: (node: NodeId) => NodeId | undefined,\n): TMark {\n\tconst nodeChanges = mark.changes !== undefined ? composeChild(mark.changes) : undefined;\n\tconst updatedMark = withUpdatedEndpoint(mark, mark.count, moveEffects);\n\treturn withNodeChange(updatedMark, nodeChanges);\n}\n\nexport class ComposeQueue {\n\tprivate readonly baseMarks: MarkQueue;\n\tprivate readonly newMarks: MarkQueue;\n\tprivate readonly baseMarksCellSources: ReadonlySet<RevisionTag | undefined>;\n\tprivate readonly newMarksCellSources: ReadonlySet<RevisionTag | undefined>;\n\n\tpublic constructor(\n\t\tbaseMarks: Changeset,\n\t\tnewMarks: Changeset,\n\t\tprivate readonly moveEffects: MoveEffectTable,\n\t\tprivate readonly revisionMetadata: RevisionMetadataSource,\n\t) {\n\t\tthis.baseMarks = new MarkQueue(baseMarks, moveEffects);\n\t\tthis.newMarks = new MarkQueue(newMarks, moveEffects);\n\t\tthis.baseMarksCellSources = cellSourcesFromMarks(baseMarks, getOutputCellId);\n\t\tthis.newMarksCellSources = cellSourcesFromMarks(newMarks, getInputCellId);\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn this.baseMarks.isEmpty() && this.newMarks.isEmpty();\n\t}\n\n\tpublic pop(): ComposeMarks {\n\t\tconst baseMark = this.baseMarks.peek();\n\t\tconst newMark = this.newMarks.peek();\n\t\tif (baseMark === undefined && newMark === undefined) {\n\t\t\treturn {};\n\t\t} else if (baseMark === undefined) {\n\t\t\treturn this.dequeueNew();\n\t\t} else if (newMark === undefined) {\n\t\t\treturn this.dequeueBase();\n\t\t} else if (areOutputCellsEmpty(baseMark) && areInputCellsEmpty(newMark)) {\n\t\t\tconst baseCellId: ChangeAtomId =\n\t\t\t\tgetOutputCellId(baseMark) ?? fail(0xb29 /* Expected defined output ID */);\n\n\t\t\tif (markEmptiesCells(baseMark) && baseCellId.revision === undefined) {\n\t\t\t\t// The base revision should always be defined except when squashing changes into a transaction.\n\t\t\t\t// In the future, we want to support reattaches in the new change here.\n\t\t\t\t// We will need to be able to order the base mark relative to the new mark\n\t\t\t\t// (which requires the local changes to have a revision tag))\n\t\t\t\tassert(\n\t\t\t\t\tisNewAttach(newMark),\n\t\t\t\t\t0x695 /* TODO: Assign revision tags to each change in a transaction */,\n\t\t\t\t);\n\t\t\t\treturn this.dequeueNew();\n\t\t\t}\n\n\t\t\tconst newCellId = getInputCellId(newMark);\n\t\t\tassert(newCellId !== undefined, 0x89d /* Both marks should have cell IDs */);\n\t\t\tconst comparison = compareCellPositionsUsingTombstones(\n\t\t\t\tbaseCellId,\n\t\t\t\tnewCellId,\n\t\t\t\tthis.baseMarksCellSources,\n\t\t\t\tthis.newMarksCellSources,\n\t\t\t\tthis.revisionMetadata,\n\t\t\t);\n\t\t\tswitch (comparison) {\n\t\t\t\tcase CellOrder.SameCell:\n\t\t\t\t\treturn this.dequeueBoth();\n\t\t\t\tcase CellOrder.OldThenNew:\n\t\t\t\t\treturn this.dequeueBase();\n\t\t\t\tcase CellOrder.NewThenOld:\n\t\t\t\t\treturn this.dequeueNew();\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(comparison);\n\t\t\t}\n\t\t} else if (areOutputCellsEmpty(baseMark)) {\n\t\t\treturn this.dequeueBase();\n\t\t} else if (areInputCellsEmpty(newMark)) {\n\t\t\treturn this.dequeueNew();\n\t\t} else {\n\t\t\treturn this.dequeueBoth();\n\t\t}\n\t}\n\n\tprivate dequeueBase(length: number = Number.POSITIVE_INFINITY): ComposeMarks {\n\t\tconst baseMark = this.baseMarks.dequeueUpTo(length);\n\t\tconst movedChanges = getMovedChangesFromMark(this.moveEffects, baseMark);\n\t\tif (movedChanges !== undefined) {\n\t\t\tthis.moveEffects.onMoveIn(movedChanges);\n\t\t}\n\n\t\tconst newMark = createNoopMark(baseMark.count, movedChanges, getOutputCellId(baseMark));\n\t\treturn { baseMark, newMark };\n\t}\n\n\tprivate dequeueNew(length: number = Number.POSITIVE_INFINITY): ComposeMarks {\n\t\tconst newMark = this.newMarks.dequeueUpTo(length);\n\t\tconst baseMark = createNoopMark(newMark.count, undefined, getInputCellId(newMark));\n\n\t\treturn {\n\t\t\tbaseMark,\n\t\t\tnewMark,\n\t\t};\n\t}\n\n\tprivate dequeueBoth(): ComposeMarks {\n\t\tconst length = this.peekMinLength();\n\t\tconst baseMark = this.baseMarks.dequeueUpTo(length);\n\t\tlet newMark = this.newMarks.dequeueUpTo(length);\n\t\tconst movedChanges = getMovedChangesFromMark(this.moveEffects, baseMark);\n\n\t\tif (movedChanges !== undefined) {\n\t\t\tassert(newMark.changes === undefined, 0x8da /* Unexpected node changeset collision */);\n\t\t\tnewMark = withNodeChange(newMark, movedChanges);\n\t\t}\n\n\t\treturn {\n\t\t\tbaseMark,\n\t\t\tnewMark,\n\t\t};\n\t}\n\n\tprivate peekMinLength(): number {\n\t\tconst baseMark = this.baseMarks.peek();\n\t\tconst newMark = this.newMarks.peek();\n\t\tassert(\n\t\t\tbaseMark !== undefined && newMark !== undefined,\n\t\t\t0x8db /* Cannot peek length unless both mark queues are non-empty */,\n\t\t);\n\n\t\treturn Math.min(newMark.count, baseMark.count);\n\t}\n}\n\ninterface ComposeMarks {\n\tbaseMark?: Mark;\n\tnewMark?: Mark;\n}\n\nfunction getMovedChangesFromMark(\n\tmoveEffects: MoveEffectTable,\n\tmarkEffect: MarkEffect,\n): NodeId | undefined {\n\tif (isAttachAndDetachEffect(markEffect)) {\n\t\treturn getMovedChangesFromMark(moveEffects, markEffect.detach);\n\t}\n\tif (!isMoveOut(markEffect)) {\n\t\treturn undefined;\n\t}\n\n\treturn getModifyAfter(moveEffects, markEffect.revision, markEffect.id);\n}\n\n// It is expected that the range from `id` to `id + count - 1` has the same move effect.\n// The call sites to this function are making queries about a mark which has already been split by a `MarkQueue`\n// to match the ranges in `moveEffects`.\n// TODO: Reduce the duplication between this and other MoveEffect helpers\nfunction getModifyAfter(\n\tmoveEffects: MoveEffectTable,\n\trevision: RevisionTag | undefined,\n\tid: MoveId,\n): NodeId | undefined {\n\tconst target = CrossFieldTarget.Source;\n\tconst effect = getMoveEffect(moveEffects, target, revision, id, 1);\n\n\tif (effect.value?.modifyAfter !== undefined) {\n\t\treturn effect.value.modifyAfter;\n\t}\n\n\treturn undefined;\n}\n\n// TODO: Reduce the duplication between this and other MoveEffect helpers\nfunction setModifyAfter(\n\tmoveEffects: MoveEffectTable,\n\t{ revision, localId: id }: ChangeAtomId,\n\tmodifyAfter: NodeId,\n): void {\n\tconst target = CrossFieldTarget.Source;\n\tconst count = 1;\n\tconst effect = getMoveEffect(moveEffects, target, revision, id, count, false);\n\tconst newEffect: MoveEffect =\n\t\teffect.value !== undefined ? { ...effect.value, modifyAfter } : { modifyAfter };\n\tsetMoveEffect(moveEffects, target, revision, id, count, newEffect);\n}\n\nfunction setEndpoint(\n\tmoveEffects: MoveEffectTable,\n\ttarget: CrossFieldTarget,\n\tid: ChangeAtomId,\n\tcount: number,\n\tendpoint: ChangeAtomId,\n): void {\n\tconst effect = getMoveEffect(moveEffects, target, id.revision, id.localId, count, false);\n\tconst newEffect = effect.value !== undefined ? { ...effect.value, endpoint } : { endpoint };\n\tsetMoveEffect(moveEffects, target, id.revision, id.localId, effect.length, newEffect);\n\n\tconst remainingCount = count - effect.length;\n\tif (remainingCount > 0) {\n\t\tsetEndpoint(\n\t\t\tmoveEffects,\n\t\t\ttarget,\n\t\t\toffsetChangeAtomId(id, effect.length),\n\t\t\tremainingCount,\n\t\t\toffsetChangeAtomId(endpoint, effect.length),\n\t\t);\n\t}\n}\n\nfunction setTruncatedEndpoint(\n\tmoveEffects: MoveEffectTable,\n\ttarget: CrossFieldTarget,\n\tid: ChangeAtomId,\n\tcount: number,\n\ttruncatedEndpoint: ChangeAtomId,\n): void {\n\tconst effect = getMoveEffect(moveEffects, target, id.revision, id.localId, count);\n\tconst newEffect =\n\t\teffect.value !== undefined\n\t\t\t? { ...effect.value, truncatedEndpoint }\n\t\t\t: { truncatedEndpoint };\n\n\tsetMoveEffect(moveEffects, target, id.revision, id.localId, effect.length, newEffect);\n\n\tconst remainingCount = count - effect.length;\n\tif (remainingCount > 0) {\n\t\tsetTruncatedEndpoint(\n\t\t\tmoveEffects,\n\t\t\ttarget,\n\t\t\toffsetChangeAtomId(id, effect.length),\n\t\t\tremainingCount,\n\t\t\toffsetChangeAtomId(truncatedEndpoint, effect.length),\n\t\t);\n\t}\n}\n\nfunction setTruncatedEndpointForInner(\n\tmoveEffects: MoveEffectTable,\n\ttarget: CrossFieldTarget,\n\tid: ChangeAtomId,\n\tcount: number,\n\ttruncatedEndpointForInner: ChangeAtomId,\n): void {\n\tconst effect = getMoveEffect(moveEffects, target, id.revision, id.localId, count);\n\tconst newEffect =\n\t\teffect.value !== undefined\n\t\t\t? { ...effect.value, truncatedEndpointForInner }\n\t\t\t: { truncatedEndpointForInner };\n\tsetMoveEffect(moveEffects, target, id.revision, id.localId, effect.length, newEffect);\n\n\tconst remainingCount = count - effect.length;\n\tif (remainingCount > 0) {\n\t\tsetTruncatedEndpointForInner(\n\t\t\tmoveEffects,\n\t\t\ttarget,\n\t\t\toffsetChangeAtomId(id, effect.length),\n\t\t\tremainingCount,\n\t\t\toffsetChangeAtomId(truncatedEndpointForInner, effect.length),\n\t\t);\n\t}\n}\n\nfunction withUpdatedEndpoint<TMark extends MarkEffect>(\n\tmark: TMark,\n\tcount: number,\n\teffects: MoveEffectTable,\n): TMark {\n\tif (isAttachAndDetachEffect(mark)) {\n\t\treturn {\n\t\t\t...mark,\n\t\t\tattach: withUpdatedEndpoint(mark.attach, count, effects),\n\t\t\tdetach: withUpdatedEndpoint(mark.detach, count, effects),\n\t\t};\n\t}\n\n\tif (!isMoveMark(mark)) {\n\t\treturn mark;\n\t}\n\tconst finalDest = getComposedEndpoint(\n\t\teffects,\n\t\tgetCrossFieldTargetFromMove(mark),\n\t\tmark.revision,\n\t\tmark.id,\n\t\tcount,\n\t);\n\n\tif (finalDest === undefined) {\n\t\treturn mark;\n\t}\n\n\tconst output = { ...mark };\n\tchangeFinalEndpoint(output, finalDest);\n\n\treturn output;\n}\n\nfunction changeFinalEndpoint(mark: MoveMarkEffect, endpoint: ChangeAtomId): void {\n\tif (areEqualCellIds(endpoint, { revision: mark.revision, localId: mark.id })) {\n\t\tdelete mark.finalEndpoint;\n\t} else {\n\t\tmark.finalEndpoint = endpoint;\n\t}\n}\n\nfunction getComposedEndpoint(\n\tmoveEffects: MoveEffectTable,\n\ttarget: CrossFieldTarget,\n\trevision: RevisionTag | undefined,\n\tid: MoveId,\n\tcount: number,\n): ChangeAtomId | undefined {\n\tconst effect = getMoveEffect(moveEffects, target, revision, id, count);\n\tassert(effect.length === count, 0x815 /* Expected effect to cover entire mark */);\n\treturn effect.value?.truncatedEndpoint ?? effect.value?.endpoint;\n}\n\nfunction getTruncatedEndpointForInner(\n\tmoveEffects: MoveEffectTable,\n\ttarget: CrossFieldTarget,\n\trevision: RevisionTag | undefined,\n\tid: MoveId,\n\tcount: number,\n): ChangeAtomId | undefined {\n\tconst effect = getMoveEffect(moveEffects, target, revision, id, count);\n\tassert(effect.length === count, 0x934 /* Expected effect to cover entire mark */);\n\treturn effect.value?.truncatedEndpointForInner;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/compose.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAEpF,kDAM6B;AAQ7B,6DAAuD;AACvD,iDAA2C;AAW3C,yCAwBoB;AAEpB;;;;;;;;;;;GAWG;AACH,SAAgB,OAAO,CACtB,OAAkB,EAClB,OAAkB,EAClB,YAAgC,EAChC,MAAmB,EACnB,OAA2B,EAC3B,gBAAwC;IAExC,OAAO,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAA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G,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACrC,IAAA,iBAAM,EACL,QAAQ,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,EAC/C,KAAK,CAAC,8DAA8D,CACpE,CAAC;QAEF,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;CACD;AA5HD,oCA4HC;AAOD,SAAS,uBAAuB,CAC/B,WAA+B,EAC/B,UAAsB;IAEtB,IAAI,CAAC,IAAA,mBAAQ,EAAC,UAAU,CAAC,EAAE,CAAC;QAC3B,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,OAAO,WAAW,CAAC,0BAA0B,CAAC,IAAA,4BAAiB,EAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK;QACpF,EAAE,UAAU,CAAC;AACf,CAAC;AAED,SAAS,kBAAkB,CAC1B,OAA2B,EAC3B,IAAsB;IAEtB,OAAO,OAAO,CAAC,0BAA0B,CAAC,IAAA,4BAAiB,EAAC,IAAI,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK;QACnF,EAAE,QAAQ,CAAC;AACb,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\tareEqualChangeAtomIdOpts,\n\tareEqualChangeAtomIds,\n\ttype ChangeAtomId,\n\ttype RevisionMetadataSource,\n\ttype RevisionTag,\n} from \"../../core/index.js\";\nimport type { IdAllocator } from \"../../util/index.js\";\nimport type {\n\tComposeNodeManager,\n\tNodeChangeComposer,\n\tNodeId,\n} from \"../modular-schema/index.js\";\n\nimport { MarkListFactory } from \"./markListFactory.js\";\nimport { MarkQueue } from \"./markQueue.js\";\nimport type { NodeRangeQueryFunc } from \"./moveEffectTable.js\";\nimport type {\n\tCellMark,\n\tChangeset,\n\tDetach,\n\tMark,\n\tMarkEffect,\n\tMarkList,\n\tNoopMark,\n} from \"./types.js\";\nimport {\n\tCellOrder,\n\tareEqualCellIds,\n\tareInputCellsEmpty,\n\tareOutputCellsEmpty,\n\tcellSourcesFromMarks,\n\tcompareCellPositionsUsingTombstones,\n\textractMarkEffect,\n\tgetAttachedRootId,\n\tgetDetachOutputCellId,\n\tgetDetachedRootId,\n\tgetInputCellId,\n\tgetMovedNodeId,\n\tgetOutputCellId,\n\tisAttach,\n\tisDetach,\n\tisNewAttach,\n\tisNoopMark,\n\tisPin,\n\tisRename,\n\tmarkEmptiesCells,\n\tmarkHasCellEffect,\n\tnormalizeCellRename,\n\twithNodeChange,\n} from \"./utils.js\";\n\n/**\n * Composes a sequence of changesets into a single changeset.\n * @param changes - The changesets to be applied.\n * Parts of the input may be reused in the output, but the input is not mutated.\n * Each changeset in the list is assumed to be applicable after the previous one.\n * @returns A changeset that is equivalent to applying each of the given `changes` in order.\n *\n * WARNING! This implementation is incomplete:\n * - Tombstone information is ignored.\n * - Support for moves is not implemented.\n * - Support for slices is not implemented.\n */\nexport function compose(\n\tchange1: Changeset,\n\tchange2: Changeset,\n\tcomposeChild: NodeChangeComposer,\n\t_genId: IdAllocator,\n\tmanager: ComposeNodeManager,\n\trevisionMetadata: RevisionMetadataSource,\n): Changeset {\n\treturn composeMarkLists(change1, change2, composeChild, manager, revisionMetadata);\n}\n\nfunction composeMarkLists(\n\tbaseMarkList: MarkList,\n\tnewMarkList: MarkList,\n\tcomposeChild: NodeChangeComposer,\n\tmoveEffects: ComposeNodeManager,\n\trevisionMetadata: RevisionMetadataSource,\n): MarkList {\n\tconst factory = new MarkListFactory();\n\tconst queue = new ComposeQueue(baseMarkList, newMarkList, moveEffects, revisionMetadata);\n\twhile (!queue.isEmpty()) {\n\t\tconst { baseMark, newMark } = queue.pop();\n\t\tconst composedMark = composeMarks(baseMark, newMark, composeChild, moveEffects);\n\t\tfactory.push(composedMark);\n\t}\n\n\treturn factory.list;\n}\n\n/**\n * Composes two marks where `newMark` is based on the state produced by `baseMark`.\n * @param baseMark - The mark to compose with `newMark`.\n * Its output range should be the same as `newMark`'s input range.\n * @param newRev - The revision the new mark is part of.\n * @param newMark - The mark to compose with `baseMark`.\n * Its input range should be the same as `baseMark`'s output range.\n * @returns A mark that is equivalent to applying both `baseMark` and `newMark` successively.\n */\nfunction composeMarks(\n\tbaseMark: Mark,\n\tnewMark: Mark,\n\tcomposeChild: NodeChangeComposer,\n\tmoveEffects: ComposeNodeManager,\n): Mark {\n\tconst nodeChange = handleNodeChanges(baseMark, newMark, composeChild, moveEffects);\n\treturn withNodeChange(composeMarksIgnoreChild(baseMark, newMark, moveEffects), nodeChange);\n}\n\nfunction composeMarksIgnoreChild(\n\tbaseMark: Mark,\n\tnewMark: Mark,\n\tmoveEffects: ComposeNodeManager,\n): Mark {\n\tif (isNoopMark(baseMark)) {\n\t\treturn newMark;\n\t} else if (isNoopMark(newMark)) {\n\t\treturn updateBaseMarkId(moveEffects, baseMark);\n\t}\n\n\tif (isRename(baseMark) && isRename(newMark)) {\n\t\tif (areEqualChangeAtomIdOpts(baseMark.cellId, newMark.idOverride)) {\n\t\t\treturn createNoopMark(baseMark.count, undefined, baseMark.cellId);\n\t\t}\n\t\treturn { ...baseMark, idOverride: newMark.idOverride };\n\t} else if (isRename(baseMark)) {\n\t\tassert(isAttach(newMark), 0x9f1 /* Unexpected mark type */);\n\t\tassert(\n\t\t\tbaseMark.cellId !== undefined && newMark.cellId !== undefined,\n\t\t\t\"Expected marks to target an empty cell\",\n\t\t);\n\t\treturn { ...newMark, cellId: baseMark.cellId };\n\t} else if (isRename(newMark)) {\n\t\tassert(isDetach(baseMark), 0x9f2 /* Unexpected mark type */);\n\t\treturn updateBaseMarkId(moveEffects, { ...baseMark, cellRename: newMark.idOverride });\n\t}\n\n\tif (!markHasCellEffect(baseMark)) {\n\t\tassert(baseMark.type === \"Insert\", \"Expected baseMark to be a pin\");\n\n\t\t// `newMark` can be either a remove or another pin.\n\t\t// A pin is treated as a detach and attach, so we call `composeAttachDetach` in either case.\n\t\tmoveEffects.composeAttachDetach(\n\t\t\tgetAttachedRootId(baseMark),\n\t\t\t{\n\t\t\t\trevision: newMark.revision,\n\t\t\t\tlocalId: newMark.id,\n\t\t\t},\n\t\t\tbaseMark.count,\n\t\t);\n\n\t\tconst pinId = getAttachedRootId(baseMark);\n\t\treturn newMark.type === \"Remove\"\n\t\t\t? {\n\t\t\t\t\t...newMark,\n\t\t\t\t\tdetachCellId: baseMark.detachCellId ?? pinId,\n\t\t\t\t\tcellRename: getDetachOutputCellId(newMark),\n\t\t\t\t}\n\t\t\t: newMark;\n\t} else if (!markHasCellEffect(newMark)) {\n\t\tif (isAttach(newMark) && isAttach(baseMark)) {\n\t\t\t// When composing two inserts, the second insert (which is a pin) should take precedence.\n\t\t\t// We treat the pin as a detach and reattach.\n\t\t\tmoveEffects.composeAttachDetach(\n\t\t\t\tgetAttachedRootId(baseMark),\n\t\t\t\tgetAttachedRootId(newMark),\n\t\t\t\tbaseMark.count,\n\t\t\t);\n\n\t\t\tconst composed = { cellId: baseMark.cellId, ...newMark };\n\t\t\tdelete composed.detachCellId;\n\t\t\treturn composed;\n\t\t}\n\t\treturn updateBaseMarkId(moveEffects, baseMark);\n\t} else if (areInputCellsEmpty(baseMark)) {\n\t\tassert(isDetach(newMark), 0x71c /* Unexpected mark type */);\n\t\tassert(isAttach(baseMark), 0x71d /* Expected generative mark */);\n\n\t\tconst attach = extractMarkEffect(baseMark);\n\t\tconst detach = extractMarkEffect(newMark);\n\n\t\tmoveEffects.composeAttachDetach(\n\t\t\tgetAttachedRootId(baseMark),\n\t\t\tgetDetachedRootId(newMark),\n\t\t\tbaseMark.count,\n\t\t);\n\n\t\tif (areEqualCellIds(getOutputCellId(newMark), baseMark.cellId)) {\n\t\t\t// The output and input cell IDs are the same, so this mark has no effect.\n\t\t\treturn { count: baseMark.count, cellId: baseMark.cellId };\n\t\t}\n\t\treturn normalizeCellRename(baseMark.cellId, baseMark.count, attach, detach);\n\t} else {\n\t\tassert(baseMark.type === \"Remove\", \"Unexpected mark type\");\n\t\tassert(newMark.type === \"Insert\", \"Unexpected mark type\");\n\t\tconst detachId = getDetachedRootId(baseMark);\n\t\tconst attachId = getAttachedRootId(newMark);\n\n\t\t// Note that we cannot assert that this returns true,\n\t\t// as it may not be until a second pass that MCF can tell that this is a reattach of the same node.\n\t\tmoveEffects.composeDetachAttach(detachId, attachId, baseMark.count, true);\n\n\t\t// The composition has no net effect but we preserve the second change's intention to pin the nodes here.\n\t\tconst composedMark = { ...newMark };\n\t\tdelete composedMark.cellId;\n\t\tconst baseDetachCellId = baseMark.detachCellId ?? detachId;\n\t\tif (!areEqualChangeAtomIds(baseDetachCellId, attachId)) {\n\t\t\tcomposedMark.detachCellId = baseDetachCellId;\n\t\t}\n\n\t\treturn composedMark;\n\t}\n}\n\nfunction updateBaseMarkId(moveEffects: ComposeNodeManager, baseMark: Mark): Mark {\n\tif (isDetach(baseMark)) {\n\t\tconst baseDetachId = getDetachedRootId(baseMark);\n\t\tconst updatedDetachId = getUpdatedDetachId(moveEffects, baseMark);\n\t\tif (\n\t\t\tupdatedDetachId !== undefined &&\n\t\t\t!areEqualChangeAtomIds(updatedDetachId, baseDetachId)\n\t\t) {\n\t\t\treturn {\n\t\t\t\t...baseMark,\n\t\t\t\trevision: updatedDetachId.revision,\n\t\t\t\tid: updatedDetachId.localId,\n\t\t\t\tdetachCellId: baseMark.detachCellId ?? baseDetachId,\n\t\t\t};\n\t\t}\n\t}\n\n\treturn baseMark;\n}\n\nfunction createNoopMark(\n\tlength: number,\n\tnodeChange: NodeId | undefined,\n\tcellId?: ChangeAtomId,\n): Mark {\n\tconst mark: CellMark<NoopMark> = { count: length };\n\tif (nodeChange !== undefined) {\n\t\tassert(length === 1, 0x692 /* A mark with a node change must have length one */);\n\t\tmark.changes = nodeChange;\n\t}\n\tif (cellId !== undefined) {\n\t\tmark.cellId = cellId;\n\t}\n\treturn mark;\n}\n\nfunction handleNodeChanges(\n\tbaseMark: Mark,\n\tnewMark: Mark,\n\tcomposeChild: NodeChangeComposer,\n\tmoveEffects: ComposeNodeManager,\n): NodeId | undefined {\n\tif (newMark.changes !== undefined) {\n\t\tif (baseMark.type === \"Insert\" && baseMark.cellId !== undefined) {\n\t\t\tmoveEffects.sendNewChangesToBaseSourceLocation(\n\t\t\t\tgetAttachedRootId(baseMark),\n\t\t\t\tnewMark.changes,\n\t\t\t);\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\t// TODO: Make sure composeChild is not called twice on the node changes.\n\treturn composeChildChanges(baseMark.changes, newMark.changes, composeChild);\n}\n\nfunction composeChildChanges(\n\tbaseChange: NodeId | undefined,\n\tnewChange: NodeId | undefined,\n\tcomposeChild: NodeChangeComposer,\n): NodeId | undefined {\n\tif (baseChange === undefined && newChange === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn composeChild(baseChange, newChange);\n}\n\nexport class ComposeQueue {\n\tprivate readonly baseMarks: MarkQueue;\n\tprivate readonly newMarks: MarkQueue;\n\tprivate readonly baseMarksCellSources: ReadonlySet<RevisionTag | undefined>;\n\tprivate readonly newMarksCellSources: ReadonlySet<RevisionTag | undefined>;\n\n\tpublic constructor(\n\t\tbaseMarks: Changeset,\n\t\tnewMarks: Changeset,\n\t\tprivate readonly moveEffects: ComposeNodeManager,\n\t\tprivate readonly revisionMetadata: RevisionMetadataSource,\n\t) {\n\t\tconst queryFunc: NodeRangeQueryFunc = (mark) =>\n\t\t\tisDetach(mark) || isPin(mark)\n\t\t\t\t? moveEffects.getNewChangesForBaseDetach(getMovedNodeId(mark), mark.count).length\n\t\t\t\t: mark.count;\n\n\t\tthis.baseMarks = new MarkQueue(baseMarks, queryFunc);\n\t\tthis.newMarks = new MarkQueue(newMarks, (mark) => mark.count);\n\t\tthis.baseMarksCellSources = cellSourcesFromMarks(baseMarks, getOutputCellId);\n\t\tthis.newMarksCellSources = cellSourcesFromMarks(newMarks, getInputCellId);\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn this.baseMarks.isEmpty() && this.newMarks.isEmpty();\n\t}\n\n\tpublic pop(): ComposeMarks {\n\t\tconst baseMark = this.baseMarks.peek();\n\t\tconst newMark = this.newMarks.peek();\n\t\tif (baseMark === undefined && newMark === undefined) {\n\t\t\tfail(\"Should not pop when queue is empty\");\n\t\t} else if (baseMark === undefined) {\n\t\t\treturn this.dequeueNew();\n\t\t} else if (newMark === undefined) {\n\t\t\treturn this.dequeueBase();\n\t\t} else if (areOutputCellsEmpty(baseMark) && areInputCellsEmpty(newMark)) {\n\t\t\tconst baseCellId: ChangeAtomId =\n\t\t\t\tgetOutputCellId(baseMark) ?? fail(0xb29 /* Expected defined output ID */);\n\n\t\t\tif (markEmptiesCells(baseMark) && baseCellId.revision === undefined) {\n\t\t\t\t// The base revision should always be defined except when squashing changes into a transaction.\n\t\t\t\t// In the future, we want to support reattaches in the new change here.\n\t\t\t\t// We will need to be able to order the base mark relative to the new mark\n\t\t\t\t// (which requires the local changes to have a revision tag))\n\t\t\t\tassert(\n\t\t\t\t\tisNewAttach(newMark),\n\t\t\t\t\t0x695 /* TODO: Assign revision tags to each change in a transaction */,\n\t\t\t\t);\n\t\t\t\treturn this.dequeueNew();\n\t\t\t}\n\n\t\t\tconst newCellId = getInputCellId(newMark);\n\t\t\tassert(newCellId !== undefined, 0x89d /* Both marks should have cell IDs */);\n\t\t\tconst comparison = compareCellPositionsUsingTombstones(\n\t\t\t\tbaseCellId,\n\t\t\t\tnewCellId,\n\t\t\t\tthis.baseMarksCellSources,\n\t\t\t\tthis.newMarksCellSources,\n\t\t\t\tthis.revisionMetadata,\n\t\t\t);\n\t\t\tswitch (comparison) {\n\t\t\t\tcase CellOrder.SameCell:\n\t\t\t\t\treturn this.dequeueBoth();\n\t\t\t\tcase CellOrder.OldThenNew:\n\t\t\t\t\treturn this.dequeueBase();\n\t\t\t\tcase CellOrder.NewThenOld:\n\t\t\t\t\treturn this.dequeueNew();\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(comparison);\n\t\t\t}\n\t\t} else if (areOutputCellsEmpty(baseMark)) {\n\t\t\treturn this.dequeueBase();\n\t\t} else if (areInputCellsEmpty(newMark)) {\n\t\t\treturn this.dequeueNew();\n\t\t} else {\n\t\t\treturn this.dequeueBoth();\n\t\t}\n\t}\n\n\tprivate dequeueBase(length: number = Number.POSITIVE_INFINITY): ComposeMarks {\n\t\tconst baseMark = this.baseMarks.dequeueUpTo(length);\n\t\tconst movedChanges = getMovedChangesFromMark(this.moveEffects, baseMark);\n\t\tconst newMark = createNoopMark(baseMark.count, movedChanges, getOutputCellId(baseMark));\n\t\treturn { baseMark, newMark };\n\t}\n\n\tprivate dequeueNew(length: number = Number.POSITIVE_INFINITY): ComposeMarks {\n\t\tconst newMark = this.newMarks.dequeueUpTo(length);\n\t\tconst baseMark = createNoopMark(newMark.count, undefined, getInputCellId(newMark));\n\n\t\treturn {\n\t\t\tbaseMark,\n\t\t\tnewMark,\n\t\t};\n\t}\n\n\tprivate dequeueBoth(): ComposeMarks {\n\t\tconst length = this.peekMinLength();\n\t\tconst baseMark = this.baseMarks.dequeueUpTo(length);\n\t\tlet newMark = this.newMarks.dequeueUpTo(length);\n\t\tconst movedChanges = getMovedChangesFromMark(this.moveEffects, baseMark);\n\n\t\tif (movedChanges !== undefined) {\n\t\t\tassert(newMark.changes === undefined, 0x8da /* Unexpected node changeset collision */);\n\t\t\tnewMark = withNodeChange(newMark, movedChanges);\n\t\t}\n\n\t\treturn {\n\t\t\tbaseMark,\n\t\t\tnewMark,\n\t\t};\n\t}\n\n\tprivate peekMinLength(): number {\n\t\tconst baseMark = this.baseMarks.peek();\n\t\tconst newMark = this.newMarks.peek();\n\t\tassert(\n\t\t\tbaseMark !== undefined && newMark !== undefined,\n\t\t\t0x8db /* Cannot peek length unless both mark queues are non-empty */,\n\t\t);\n\n\t\treturn Math.min(newMark.count, baseMark.count);\n\t}\n}\n\ninterface ComposeMarks {\n\tbaseMark: Mark;\n\tnewMark: Mark;\n}\n\nfunction getMovedChangesFromMark(\n\tmoveEffects: ComposeNodeManager,\n\tmarkEffect: MarkEffect,\n): NodeId | undefined {\n\tif (!isDetach(markEffect)) {\n\t\treturn undefined;\n\t}\n\n\treturn moveEffects.getNewChangesForBaseDetach(getDetachedRootId(markEffect), 1).value\n\t\t?.nodeChange;\n}\n\nfunction getUpdatedDetachId(\n\tmanager: ComposeNodeManager,\n\tmark: CellMark<Detach>,\n): ChangeAtomId | undefined {\n\treturn manager.getNewChangesForBaseDetach(getDetachedRootId(mark), mark.count).value\n\t\t?.detachId;\n}\n"]}
|