@fluidframework/tree 2.73.0 → 2.74.0-368706
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 +133 -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 +7 -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/codecs.d.ts +2 -2
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +15 -7
- 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 +90 -42
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +234 -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 +4 -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 +22 -27
- 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 +5 -5
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +7 -4
- 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 +5 -5
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +12 -8
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +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 +4 -4
- 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 +48 -15
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1298 -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/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/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/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.js +1 -0
- package/dist/feature-libraries/sequence-field/formatV2.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/feature-libraries/treeCompressionUtils.d.ts +2 -12
- package/dist/feature-libraries/treeCompressionUtils.d.ts.map +1 -1
- package/dist/feature-libraries/treeCompressionUtils.js +4 -14
- package/dist/feature-libraries/treeCompressionUtils.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/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 +18 -15
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +15 -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 +25 -11
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +6 -6
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +2 -2
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js +13 -6
- 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 +14 -12
- 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 +16 -13
- package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.js +24 -14
- package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +4 -5
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +5 -6
- 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/tree.d.ts +1 -1
- package/dist/simple-tree/api/tree.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/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +1 -0
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +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 +16 -13
- 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 +6 -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 +19 -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 +5 -0
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +29 -8
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/breakable.js +3 -3
- package/dist/util/breakable.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/dist/util/typeCheckTests.d.ts.map +1 -1
- package/dist/util/typeCheckTests.js.map +1 -1
- package/lib/alpha.d.ts +7 -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/codecs.d.ts +2 -2
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +2 -2
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +15 -7
- 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 +90 -42
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +232 -69
- 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 +19 -24
- 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 +5 -5
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +4 -4
- 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 +5 -5
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +4 -3
- 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 +4 -4
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +10 -286
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +48 -15
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1284 -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/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/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/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV2.js +1 -0
- package/lib/feature-libraries/sequence-field/formatV2.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/feature-libraries/treeCompressionUtils.d.ts +2 -12
- package/lib/feature-libraries/treeCompressionUtils.d.ts.map +1 -1
- package/lib/feature-libraries/treeCompressionUtils.js +3 -13
- package/lib/feature-libraries/treeCompressionUtils.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +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 +18 -15
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +15 -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 +25 -11
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +6 -6
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +3 -3
- 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 +11 -5
- 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 +14 -12
- 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 +16 -13
- package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js +23 -13
- package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +4 -5
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +3 -4
- 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/tree.d.ts +1 -1
- package/lib/simple-tree/api/tree.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/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +1 -0
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +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 +7 -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 +20 -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 +5 -0
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +28 -8
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/breakable.js +3 -3
- package/lib/util/breakable.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/lib/util/typeCheckTests.d.ts.map +1 -1
- package/lib/util/typeCheckTests.js.map +1 -1
- package/package.json +22 -22
- 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/codecs.ts +3 -7
- package/src/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.ts +18 -11
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -9
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +393 -127
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +35 -38
- package/src/feature-libraries/default-schema/index.ts +16 -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 +47 -39
- 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 -14
- 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 +21 -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 +32 -505
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +2542 -742
- 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/optionalFieldChangeTypes.ts +24 -38
- package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +89 -35
- 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/formatV2.ts +1 -0
- 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/feature-libraries/treeCompressionUtils.ts +1 -15
- package/src/index.ts +7 -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 +51 -30
- package/src/shared-tree/sharedTreeChangeCodecs.ts +5 -1
- package/src/shared-tree/sharedTreeChangeEnricher.ts +31 -11
- package/src/shared-tree/sharedTreeChangeFamily.ts +9 -6
- package/src/shared-tree/sharedTreeEditBuilder.ts +46 -12
- package/src/shared-tree/treeAlpha.ts +2 -3
- package/src/shared-tree/treeCheckout.ts +106 -33
- 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 +34 -20
- package/src/simple-tree/api/index.ts +4 -5
- 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/tree.ts +1 -1
- 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/treeNodeKernel.ts +1 -0
- 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 +13 -12
- package/src/simple-tree/node-kinds/array/arrayNode.ts +14 -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 +28 -27
- 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 +32 -9
- package/src/util/breakable.ts +4 -4
- package/src/util/index.ts +5 -0
- package/src/util/rangeMap.ts +72 -18
- package/src/util/readSnapshotBlob.ts +23 -0
- package/src/util/typeCheckTests.ts +0 -1
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequenceFieldCodecV2.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAGpF,mDAI8B;AAO9B,kDAAuF;AACvF,kEAAgE;AAChE,yDAGoC;AAEpC,+CAA2E;AAE3E,yCAaoB;AACpB,yCAA6D;AAE7D,SAAgB,kBAAkB,CACjC,gBAKC;IAED,MAAM,iBAAiB,GAAG,IAAA,4CAAqB,EAAC,gBAAgB,CAAC,CAAC;IAClE,MAAM,eAAe,GAKjB;QACH,MAAM,CAAC,MAAkB,EAAE,OAA8B;YACxD,SAAS,cAAc,CACtB,QAAiC;gBAEjC,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,OAAO,CAAC,QAAQ,EAAE,CAAC;oBAC7D,OAAO,SAAS,CAAC;gBAClB,CAAC;gBAED,OAAO,gBAAgB,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACnD,CAAC;YAED,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;YACzB,QAAQ,IAAI,EAAE,CAAC;gBACd,KAAK,QAAQ;oBACZ,OAAO;wBACN,MAAM,EAAE;4BACP,QAAQ,EAAE,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC;4BACzC,aAAa,EACZ,MAAM,CAAC,aAAa,KAAK,SAAS;gCACjC,CAAC,CAAC,SAAS;gCACX,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC;4BAC3D,EAAE,EAAE,MAAM,CAAC,EAAE;yBACb;qBACD,CAAC;gBACH,KAAK,QAAQ;oBACZ,OAAO;wBACN,MAAM,EAAE;4BACP,QAAQ,EAAE,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC;4B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AI,YAAY,GAAG,WAAmB,CAAC;gBACvC,IAAI,YAAY,CAAC,MAAM,KAAK,SAAS,IAAI,YAAY,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;oBAClF,uHAAuH;oBACvH,+GAA+G;oBAC/G,4FAA4F;oBAC5F,YAAY,GAAG,IAAA,8BAAmB,EACjC,YAAY,CAAC,MAAM,EACnB,YAAY,CAAC,KAAK,EAClB,YAAY,CAAC,MAAM,EACnB,YAAY,CAAC,MAAM,CACnB,CAAC;gBACH,CAAC;gBACD,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;oBAChC,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACzD,CAAC;gBACD,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAC1B,CAAC;YACD,OAAO,KAAK,CAAC;QACd,CAAC;QACD,aAAa,EAAE,IAAA,uBAAe,EAAC,+BAAoB,CAAC;KACpD,CAAC;AACH,CAAC;AAlFD,kCAkFC;AAED;;GAEG;AACH,MAAM,aAAa,GAAqB,IAAA,gBAAK,EAAC,CAAC,CAAC,CAAC,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\";\nimport type { TAnySchema } from \"@sinclair/typebox\";\n\nimport {\n\tDiscriminatedUnionDispatcher,\n\ttype DiscriminatedUnionLibrary,\n\ttype IJsonCodec,\n} from \"../../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tChangesetLocalId,\n\tEncodedRevisionTag,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport { type JsonCompatibleReadOnly, type Mutable, brand } from \"../../util/index.js\";\nimport { makeChangeAtomIdCodec } from \"../changeAtomIdCodec.js\";\nimport {\n\tEncodedNodeChangeset,\n\ttype FieldChangeEncodingContext,\n} from \"../modular-schema/index.js\";\n\nimport { Changeset as ChangesetSchema, type Encoded } from \"./formatV2.js\";\nimport type { SequenceCodecHelpers } from \"./helperTypes.js\";\nimport {\n\ttype Attach,\n\ttype AttachAndDetach,\n\ttype Changeset,\n\ttype Detach,\n\ttype Insert,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype MoveIn,\n\ttype MoveOut,\n\tNoopMarkType,\n\ttype Remove,\n\ttype Rename,\n} from \"./types.js\";\nimport { isNoopMark, normalizeCellRename } from \"./utils.js\";\n\nexport function makeV2CodecHelpers(\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): SequenceCodecHelpers<MarkEffect, Encoded.MarkEffect> {\n\tconst changeAtomIdCodec = makeChangeAtomIdCodec(revisionTagCodec);\n\tconst markEffectCodec: IJsonCodec<\n\t\tMarkEffect,\n\t\tEncoded.MarkEffect,\n\t\tEncoded.MarkEffect,\n\t\tChangeEncodingContext\n\t> = {\n\t\tencode(effect: MarkEffect, context: ChangeEncodingContext): Encoded.MarkEffect {\n\t\t\tfunction encodeRevision(\n\t\t\t\trevision: RevisionTag | undefined,\n\t\t\t): EncodedRevisionTag | undefined {\n\t\t\t\tif (revision === undefined || revision === context.revision) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn revisionTagCodec.encode(revision, context);\n\t\t\t}\n\n\t\t\tconst type = effect.type;\n\t\t\tswitch (type) {\n\t\t\t\tcase \"MoveIn\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmoveIn: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tfinalEndpoint:\n\t\t\t\t\t\t\t\teffect.finalEndpoint === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.finalEndpoint, context),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Insert\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tinsert: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Remove\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tremove: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tidOverride:\n\t\t\t\t\t\t\t\teffect.idOverride === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.idOverride, context),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"MoveOut\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmoveOut: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tfinalEndpoint:\n\t\t\t\t\t\t\t\teffect.finalEndpoint === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.finalEndpoint, context),\n\t\t\t\t\t\t\tidOverride:\n\t\t\t\t\t\t\t\teffect.idOverride === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.idOverride, context),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"AttachAndDetach\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tattachAndDetach: {\n\t\t\t\t\t\t\tattach: markEffectCodec.encode(effect.attach, context) as Encoded.Attach,\n\t\t\t\t\t\t\tdetach: markEffectCodec.encode(effect.detach, context) as Encoded.Detach,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Rename\":\n\t\t\t\t\t// In documents generated by clients on release >=2.2 (i.e., running the code from the PR that added this comment),\n\t\t\t\t\t// renames are encoded as AttachAndDetach with a special id.\n\t\t\t\t\t// This ensures forward-compatibility of clients on release <=2.1 with documents/ops generated by clients on release >=2.2.\n\t\t\t\t\treturn markEffectCodec.encode(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: \"AttachAndDetach\",\n\t\t\t\t\t\t\tattach: { type: \"MoveIn\", id: renameLocalId },\n\t\t\t\t\t\t\tdetach: { type: \"MoveOut\", id: renameLocalId, idOverride: effect.idOverride },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t);\n\t\t\t\tcase NoopMarkType:\n\t\t\t\t\tfail(0xb2c /* Mark type: NoopMarkType should not be encoded. */);\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(type);\n\t\t\t}\n\t\t},\n\t\tdecode(encoded: Encoded.MarkEffect, context: ChangeEncodingContext): MarkEffect {\n\t\t\treturn decoderDispatcher.dispatch(encoded, context);\n\t\t},\n\t};\n\n\tfunction decodeRevision(\n\t\tencodedRevision: EncodedRevisionTag | undefined,\n\t\tcontext: ChangeEncodingContext,\n\t): RevisionTag {\n\t\tif (encodedRevision === undefined) {\n\t\t\tassert(context.revision !== undefined, 0x996 /* Implicit revision should be provided */);\n\t\t\treturn context.revision;\n\t\t}\n\n\t\treturn revisionTagCodec.decode(encodedRevision, context);\n\t}\n\n\tconst decoderLibrary: DiscriminatedUnionLibrary<\n\t\tEncoded.MarkEffect,\n\t\t/* args */ [context: ChangeEncodingContext],\n\t\tMarkEffect\n\t> = {\n\t\tmoveIn(encoded: Encoded.MoveIn, context: ChangeEncodingContext): MoveIn {\n\t\t\tconst { id, finalEndpoint, revision } = encoded;\n\t\t\tconst mark: MoveIn = {\n\t\t\t\ttype: \"MoveIn\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (finalEndpoint !== undefined) {\n\t\t\t\tmark.finalEndpoint = changeAtomIdCodec.decode(finalEndpoint, context);\n\t\t\t}\n\t\t\treturn mark;\n\t\t},\n\t\tinsert(encoded: Encoded.Insert, context: ChangeEncodingContext): Insert {\n\t\t\tconst { id, revision } = encoded;\n\t\t\tconst mark: Insert = {\n\t\t\t\ttype: \"Insert\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\treturn mark;\n\t\t},\n\t\tremove(encoded: Encoded.Remove, context: ChangeEncodingContext): Remove {\n\t\t\tconst { id, revision, idOverride } = encoded;\n\t\t\tconst mark: Mutable<Remove> = {\n\t\t\t\ttype: \"Remove\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (idOverride !== undefined) {\n\t\t\t\tmark.idOverride = changeAtomIdCodec.decode(idOverride, context);\n\t\t\t}\n\t\t\treturn mark;\n\t\t},\n\t\tmoveOut(encoded: Encoded.MoveOut, context: ChangeEncodingContext): MoveOut {\n\t\t\tconst { id, finalEndpoint, idOverride, revision } = encoded;\n\t\t\tconst mark: Mutable<MoveOut> = {\n\t\t\t\ttype: \"MoveOut\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (finalEndpoint !== undefined) {\n\t\t\t\tmark.finalEndpoint = changeAtomIdCodec.decode(finalEndpoint, context);\n\t\t\t}\n\t\t\tif (idOverride !== undefined) {\n\t\t\t\tmark.idOverride = changeAtomIdCodec.decode(idOverride, context);\n\t\t\t}\n\n\t\t\treturn mark;\n\t\t},\n\t\tattachAndDetach(\n\t\t\tencoded: Encoded.AttachAndDetach,\n\t\t\tcontext: ChangeEncodingContext,\n\t\t): AttachAndDetach | Rename {\n\t\t\tconst attach = decoderDispatcher.dispatch(encoded.attach, context) as Attach;\n\t\t\tconst detach = decoderDispatcher.dispatch(encoded.detach, context) as Detach;\n\t\t\t// In documents generated by clients on release >=2.2 (i.e., running the code from the PR that added this comment),\n\t\t\t// renames are encoded as AttachAndDetach with a special id.\n\t\t\t// This ensures forward-compatibility of clients on release <=2.1 with documents/ops generated by clients on release >=2.2.\n\t\t\tif (attach.id === renameLocalId) {\n\t\t\t\tassert(detach.idOverride !== undefined, 0x9f8 /* Rename must have idOverride */);\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"Rename\",\n\t\t\t\t\tidOverride: detach.idOverride,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttype: \"AttachAndDetach\",\n\t\t\t\tattach,\n\t\t\t\tdetach,\n\t\t\t};\n\t\t},\n\t};\n\n\tconst decoderDispatcher = new DiscriminatedUnionDispatcher<\n\t\tEncoded.MarkEffect,\n\t\t/* args */ [context: ChangeEncodingContext],\n\t\tMarkEffect\n\t>(decoderLibrary);\n\n\treturn {\n\t\tchangeAtomIdCodec,\n\t\tmarkEffectCodec,\n\t\tdecoderLibrary,\n\t\tdecodeRevision,\n\t};\n}\n\nexport function makeV2Codec(\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): IJsonCodec<\n\tChangeset,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tFieldChangeEncodingContext\n> {\n\tconst { markEffectCodec, changeAtomIdCodec } = makeV2CodecHelpers(revisionTagCodec);\n\t/**\n\t * If we want to make the node change aspect of this codec more type-safe, we could adjust generics\n\t * to be in terms of the schema rather than the concrete type of the node change.\n\t */\n\ttype NodeChangeSchema = TAnySchema;\n\n\treturn {\n\t\tencode: (\n\t\t\tchangeset: Changeset,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): JsonCompatibleReadOnly & Encoded.Changeset<NodeChangeSchema> => {\n\t\t\tconst jsonMarks: Encoded.Changeset<NodeChangeSchema> = [];\n\t\t\tfor (const mark of changeset) {\n\t\t\t\tconst encodedMark: Encoded.Mark<NodeChangeSchema> = {\n\t\t\t\t\tcount: mark.count,\n\t\t\t\t};\n\t\t\t\tif (!isNoopMark(mark)) {\n\t\t\t\t\tencodedMark.effect = markEffectCodec.encode(mark, context.baseContext);\n\t\t\t\t}\n\t\t\t\tif (mark.cellId !== undefined) {\n\t\t\t\t\tencodedMark.cellId = changeAtomIdCodec.encode(mark.cellId, context.baseContext);\n\t\t\t\t}\n\t\t\t\tif (mark.changes !== undefined) {\n\t\t\t\t\tencodedMark.changes = context.encodeNode(mark.changes);\n\t\t\t\t}\n\t\t\t\tjsonMarks.push(encodedMark);\n\t\t\t}\n\t\t\treturn jsonMarks;\n\t\t},\n\t\tdecode: (\n\t\t\tchangeset: Encoded.Changeset<NodeChangeSchema>,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): Changeset => {\n\t\t\tconst marks: Changeset = [];\n\t\t\tfor (const mark of changeset) {\n\t\t\t\tconst decodedMark: Mark = {\n\t\t\t\t\tcount: mark.count,\n\t\t\t\t};\n\n\t\t\t\tif (mark.effect !== undefined) {\n\t\t\t\t\tObject.assign(decodedMark, markEffectCodec.decode(mark.effect, context.baseContext));\n\t\t\t\t}\n\t\t\t\tif (mark.cellId !== undefined) {\n\t\t\t\t\tdecodedMark.cellId = changeAtomIdCodec.decode(mark.cellId, context.baseContext);\n\t\t\t\t}\n\t\t\t\t// Type deduction wrongly narrows the type of `decodedMark` to `NoopMark & HasMarkFields`.\n\t\t\t\t// We declare a new casted copy of `decodedMark` to recover the correct type.\n\t\t\t\tlet decodedMark2 = decodedMark as Mark;\n\t\t\t\tif (decodedMark2.cellId !== undefined && decodedMark2.type === \"AttachAndDetach\") {\n\t\t\t\t\t// In documents generated by clients on release <=2.1 (i.e., not running the code from the PR that added this comment),\n\t\t\t\t\t// rename-like AttachAndDetach marks are not normalized to Rename marks thus requiring this normalization step.\n\t\t\t\t\t// This ensures backward compatibility with documents generated by clients on release <=2.1.\n\t\t\t\t\tdecodedMark2 = normalizeCellRename(\n\t\t\t\t\t\tdecodedMark2.cellId,\n\t\t\t\t\t\tdecodedMark2.count,\n\t\t\t\t\t\tdecodedMark2.attach,\n\t\t\t\t\t\tdecodedMark2.detach,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (mark.changes !== undefined) {\n\t\t\t\t\tdecodedMark2.changes = context.decodeNode(mark.changes);\n\t\t\t\t}\n\t\t\t\tmarks.push(decodedMark2);\n\t\t\t}\n\t\t\treturn marks;\n\t\t},\n\t\tencodedSchema: ChangesetSchema(EncodedNodeChangeset),\n\t};\n}\n\n/**\n * Arbitrary ID that is used to indicate a Rename effect.\n */\nconst renameLocalId: ChangesetLocalId = brand(-1);\n"]}
|
|
1
|
+
{"version":3,"file":"sequenceFieldCodecV2.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAGpF,mDAI8B;AAC9B,kDAO6B;AAC7B,kDAAuF;AACvF,kEAAgE;AAChE,yDAMoC;AAEpC,+CAA2E;AAE3E,yCASoB;AACpB,yCAAyF;AAEzF,SAAgB,kBAAkB,CACjC,gBAKC;IAED,MAAM,iBAAiB,GAAG,IAAA,4CAAqB,EAAC,gBAAgB,CAAC,CAAC;IAElE,SAAS,cAAc,CACtB,eAA+C,EAC/C,OAA8B;QAE9B,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;YACnC,IAAA,iBAAM,EAAC,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE,KAAK,CAAC,0CAA0C,CAAC,CAAC;YACzF,OAAO,OAAO,CAAC,QAAQ,CAAC;QACzB,CAAC;QAED,OAAO,gBAAgB,CAAC,MAAM,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED,MAAM,cAAc,GAAG,qBAAqB,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC;IAEhF,MAAM,iBAAiB,GAAG,IAAI,uCAA4B,CAQxD,cAAc,CAAC,CAAC;IAElB,OAAO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CAAC;IAClB,CAAC;AACF,CAAC;AAPD,0DAOC;AAED,SAAS,0CAA0C,CAClD,OAAgC;IAEhC,mHAAmH;IACnH,4DAA4D;IAC5D,2HAA2H;IAC3H,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,KAAK,aAAa,EAAE,CAAC;QACjD,IAAA,iBAAM,EACL,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,KAAK,SAAS,EAC/C,KAAK,CAAC,iCAAiC,CACvC,CAAC;QACF,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;IACzC,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\nimport type { TAnySchema } from \"@sinclair/typebox\";\n\nimport {\n\tDiscriminatedUnionDispatcher,\n\ttype DiscriminatedUnionLibrary,\n\ttype IJsonCodec,\n} from \"../../codec/index.js\";\nimport {\n\tareEqualChangeAtomIds,\n\ttype ChangeAtomId,\n\ttype ChangeEncodingContext,\n\ttype ChangesetLocalId,\n\ttype EncodedRevisionTag,\n\ttype RevisionTag,\n} from \"../../core/index.js\";\nimport { type JsonCompatibleReadOnly, type Mutable, brand } from \"../../util/index.js\";\nimport { makeChangeAtomIdCodec } from \"../changeAtomIdCodec.js\";\nimport {\n\tEncodedNodeChangeset,\n\tgetFromChangeAtomIdMap,\n\trangeQueryChangeAtomIdMap,\n\ttype EncodedChangeAtomId,\n\ttype FieldChangeEncodingContext,\n} from \"../modular-schema/index.js\";\n\nimport { Changeset as ChangesetSchema, type Encoded } from \"./formatV2.js\";\nimport type { SequenceCodecHelpers } from \"./helperTypes.js\";\nimport {\n\ttype Attach,\n\ttype CellMark,\n\ttype Changeset,\n\ttype Detach,\n\ttype Mark,\n\ttype MarkEffect,\n\tNoopMarkType,\n\ttype Rename,\n} from \"./types.js\";\nimport { getAttachedRootId, getDetachedRootId, isNoopMark, splitMark } from \"./utils.js\";\n\nexport function makeV2CodecHelpers(\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): SequenceCodecHelpers {\n\tconst changeAtomIdCodec = makeChangeAtomIdCodec(revisionTagCodec);\n\n\tfunction decodeRevision(\n\t\tencodedRevision: EncodedRevisionTag | undefined,\n\t\tcontext: ChangeEncodingContext,\n\t): RevisionTag {\n\t\tif (encodedRevision === undefined) {\n\t\t\tassert(context.revision !== undefined, 0x996 /* Implicit revision should be provided */);\n\t\t\treturn context.revision;\n\t\t}\n\n\t\treturn revisionTagCodec.decode(encodedRevision, context);\n\t}\n\n\tconst decoderLibrary = makeMarkEffectDecoder(changeAtomIdCodec, decodeRevision);\n\n\tconst decoderDispatcher = new DiscriminatedUnionDispatcher<\n\t\tEncoded.MarkEffect,\n\t\t/* args */ [\n\t\t\tcount: number,\n\t\t\tcellId: ChangeAtomId | undefined,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t],\n\t\tMarkEffect\n\t>(decoderLibrary);\n\n\treturn {\n\t\tchangeAtomIdCodec,\n\t\tdecoderLibrary,\n\n\t\tencodeMarkEffect(mark: Mark, context: FieldChangeEncodingContext): Encoded.MarkEffect {\n\t\t\treturn encodeMarkEffectV2(\n\t\t\t\tmark,\n\t\t\t\tcontext,\n\t\t\t\t(revision) =>\n\t\t\t\t\tencodeRevisionWithContext(revision, context.baseContext, revisionTagCodec),\n\t\t\t\tchangeAtomIdCodec,\n\t\t\t);\n\t\t},\n\n\t\tdecodeRevision: (\n\t\t\tencoded: EncodedRevisionTag | undefined,\n\t\t\tcontext: ChangeEncodingContext,\n\t\t): RevisionTag =>\n\t\t\tencoded !== undefined\n\t\t\t\t? revisionTagCodec.decode(encoded, context)\n\t\t\t\t: (context.revision ?? fail(\"Expected a default revision\")),\n\n\t\tdecodeMarkEffect: (\n\t\t\tencoded: Encoded.MarkEffect,\n\t\t\tcount: number,\n\t\t\tcellId: ChangeAtomId | undefined,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): MarkEffect => {\n\t\t\treturn decoderDispatcher.dispatch(encoded, count, cellId, context);\n\t\t},\n\t};\n}\n\nexport type DecodeMarkEffect = (\n\tencoded: Encoded.MarkEffect,\n\tcount: number,\n\tcellId: ChangeAtomId | undefined,\n\tcontext: FieldChangeEncodingContext,\n) => MarkEffect;\n\nexport function decodeSequenceChangeset(\n\tchangeset: Encoded.Changeset<NodeChangeSchema>,\n\tcontext: FieldChangeEncodingContext,\n\tchangeAtomIdCodec: IJsonCodec<\n\t\tChangeAtomId,\n\t\tEncodedChangeAtomId,\n\t\tEncodedChangeAtomId,\n\t\tChangeEncodingContext\n\t>,\n\tdecodeMarkEffect: DecodeMarkEffect,\n): Changeset {\n\tconst marks: Changeset = [];\n\tfor (const mark of changeset) {\n\t\tconst decodedMark: Mark = {\n\t\t\tcount: mark.count,\n\t\t};\n\n\t\tif (mark.cellId !== undefined) {\n\t\t\tdecodedMark.cellId = changeAtomIdCodec.decode(mark.cellId, context.baseContext);\n\t\t}\n\n\t\tif (mark.effect !== undefined) {\n\t\t\tObject.assign(\n\t\t\t\tdecodedMark,\n\t\t\t\tdecodeMarkEffect(mark.effect, mark.count, decodedMark.cellId, context),\n\t\t\t);\n\t\t}\n\n\t\tif (mark.changes !== undefined) {\n\t\t\tif (decodedMark.cellId !== undefined) {\n\t\t\t\tcontext.decodeRootNodeChange(decodedMark.cellId, mark.changes);\n\t\t\t} else {\n\t\t\t\tdecodedMark.changes = context.decodeNode(mark.changes);\n\t\t\t}\n\t\t}\n\n\t\tmarks.push(decodedMark);\n\t}\n\treturn marks;\n}\n\nfunction makeMarkEffectDecoder(\n\tchangeAtomIdCodec: IJsonCodec<\n\t\tChangeAtomId,\n\t\tEncodedChangeAtomId,\n\t\tEncodedChangeAtomId,\n\t\tChangeEncodingContext\n\t>,\n\tdecodeRevision: (\n\t\trevision: EncodedRevisionTag | undefined,\n\t\tcontext: ChangeEncodingContext,\n\t) => RevisionTag,\n): DiscriminatedUnionLibrary<\n\tEncoded.MarkEffect,\n\t/* args */ [\n\t\tcount: number,\n\t\tcellId: ChangeAtomId | undefined,\n\t\tcontext: FieldChangeEncodingContext,\n\t],\n\tMarkEffect\n> {\n\tfunction decodeMoveIn(encoded: Encoded.MoveIn, context: FieldChangeEncodingContext): Attach {\n\t\tconst { id, revision } = encoded;\n\t\tconst endpoint =\n\t\t\tencoded.finalEndpoint !== undefined\n\t\t\t\t? changeAtomIdCodec.decode(encoded.finalEndpoint, context.baseContext)\n\t\t\t\t: undefined;\n\n\t\tconst mark: Attach = {\n\t\t\ttype: \"Insert\",\n\t\t\tid: endpoint?.localId ?? id,\n\t\t\trevision: endpoint?.revision ?? decodeRevision(revision, context.baseContext),\n\t\t};\n\n\t\treturn mark;\n\t}\n\n\tconst decoderLibrary: DiscriminatedUnionLibrary<\n\t\tEncoded.MarkEffect,\n\t\t/* args */ [\n\t\t\tcount: number,\n\t\t\tcellId: ChangeAtomId | undefined,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t],\n\t\tMarkEffect\n\t> = {\n\t\tmoveIn(\n\t\t\tencoded: Encoded.MoveIn,\n\t\t\tcount: number,\n\t\t\tcellId: ChangeAtomId | undefined,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): Attach {\n\t\t\treturn decodeMoveIn(encoded, context);\n\t\t},\n\t\tinsert(\n\t\t\tencoded: Encoded.Insert,\n\t\t\tcount: number,\n\t\t\tcellId: ChangeAtomId | undefined,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): Attach {\n\t\t\tconst { id, revision } = encoded;\n\t\t\tconst mark: Attach = {\n\t\t\t\ttype: \"Insert\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context.baseContext);\n\n\t\t\tconst attachId = getAttachedRootId(mark);\n\t\t\tif (cellId !== undefined && !areEqualChangeAtomIds(cellId, attachId)) {\n\t\t\t\tcontext.decodeRootRename(cellId, attachId, count);\n\t\t\t}\n\n\t\t\treturn mark;\n\t\t},\n\t\tremove(\n\t\t\tencoded: Encoded.Remove,\n\t\t\tcount: number,\n\t\t\tcellId: ChangeAtomId | undefined,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): Detach | Rename {\n\t\t\tconst { id, revision, idOverride } = encoded;\n\n\t\t\tconst cellRename =\n\t\t\t\tidOverride !== undefined\n\t\t\t\t\t? changeAtomIdCodec.decode(idOverride, context.baseContext)\n\t\t\t\t\t: undefined;\n\n\t\t\treturn decodeDetach(\n\t\t\t\tcellId,\n\t\t\t\tcount,\n\t\t\t\tdecodeRevision(revision, context.baseContext),\n\t\t\t\tid,\n\t\t\t\tcellRename,\n\t\t\t\tundefined,\n\t\t\t\tcontext,\n\t\t\t);\n\t\t},\n\t\tmoveOut(\n\t\t\tencoded: Encoded.MoveOut,\n\t\t\tcount: number,\n\t\t\tcellId: ChangeAtomId | undefined,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): Detach | Rename {\n\t\t\tconst { id, idOverride, revision, finalEndpoint } = encoded;\n\t\t\tconst cellRename =\n\t\t\t\tidOverride !== undefined\n\t\t\t\t\t? changeAtomIdCodec.decode(idOverride, context.baseContext)\n\t\t\t\t\t: undefined;\n\n\t\t\tconst decodedRevision = decodeRevision(revision, context.baseContext);\n\t\t\tif (finalEndpoint !== undefined) {\n\t\t\t\tconst decodedEndpoint = changeAtomIdCodec.decode(finalEndpoint, context.baseContext);\n\t\t\t\treturn decodeDetach(\n\t\t\t\t\tcellId,\n\t\t\t\t\tcount,\n\t\t\t\t\tdecodedEndpoint.revision ?? fail(\"Revision should be defined\"),\n\t\t\t\t\tdecodedEndpoint.localId,\n\t\t\t\t\tcellRename,\n\t\t\t\t\t{ revision: decodedRevision, localId: id },\n\t\t\t\t\tcontext,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn decodeDetach(cellId, count, decodedRevision, id, cellRename, undefined, context);\n\t\t},\n\t\tattachAndDetach(\n\t\t\tencoded: Encoded.AttachAndDetach,\n\t\t\tcount: number,\n\t\t\tcellId: ChangeAtomId | undefined,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): Rename {\n\t\t\t// In documents generated by clients on release >=2.2 (i.e., running the code from the PR that added this comment),\n\t\t\t// renames are encoded as AttachAndDetach with a special id.\n\t\t\t// This ensures forward-compatibility of clients on release <=2.1 with documents/ops generated by clients on release >=2.2.\n\t\t\tconst encodedRenameId = tryGetEncodedCellRenameFromAttachAndDetach(encoded);\n\t\t\tif (encodedRenameId !== undefined) {\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"Rename\",\n\t\t\t\t\tidOverride: changeAtomIdCodec.decode(encodedRenameId, context.baseContext),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tassert(\n\t\t\t\tencoded.detach.remove !== undefined,\n\t\t\t\t\"Attach and detach should always contains a remove\",\n\t\t\t);\n\n\t\t\tconst detachId: ChangeAtomId =\n\t\t\t\tencoded.detach.remove.idOverride !== undefined\n\t\t\t\t\t? changeAtomIdCodec.decode(encoded.detach.remove.idOverride, context.baseContext)\n\t\t\t\t\t: {\n\t\t\t\t\t\t\trevision: decodeRevision(encoded.detach.remove.revision, context.baseContext),\n\t\t\t\t\t\t\tlocalId: encoded.detach.remove.id,\n\t\t\t\t\t\t};\n\n\t\t\tassert(cellId !== undefined, \"Attach and detach should target an empty cell\");\n\t\t\tif (encoded.attach.moveIn !== undefined) {\n\t\t\t\tcontext.decodeMoveAndDetach(detachId, count);\n\t\t\t} else {\n\t\t\t\tcontext.decodeRootRename(cellId, detachId, count);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttype: \"Rename\",\n\t\t\t\tidOverride: detachId,\n\t\t\t};\n\t\t},\n\t};\n\n\treturn decoderLibrary;\n}\n\nfunction decodeDetach(\n\tcellId: ChangeAtomId | undefined,\n\tcount: number,\n\trevision: RevisionTag,\n\tlocalId: ChangesetLocalId,\n\tcellRename: ChangeAtomId | undefined,\n\tdetachCellId: ChangeAtomId | undefined,\n\tcontext: FieldChangeEncodingContext,\n): Detach | Rename {\n\tconst detachId: ChangeAtomId = { revision, localId };\n\tif (cellId !== undefined) {\n\t\tcontext.decodeRootRename(cellId, detachId, count);\n\t\treturn {\n\t\t\ttype: \"Rename\",\n\t\t\tidOverride: cellRename ?? detachId,\n\t\t};\n\t}\n\n\tconst mark: Mutable<Detach> = {\n\t\ttype: \"Remove\",\n\t\trevision,\n\t\tid: localId,\n\t};\n\n\tif (cellRename !== undefined) {\n\t\tmark.cellRename = cellRename;\n\t}\n\n\tif (detachCellId !== undefined) {\n\t\tmark.detachCellId = detachCellId;\n\t}\n\n\treturn mark;\n}\n\n/**\n * If we want to make the node change aspect of this codec more type-safe, we could adjust generics\n * to be in terms of the schema rather than the concrete type of the node change.\n */\ntype NodeChangeSchema = TAnySchema;\n\nexport function makeV2Codec(\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): IJsonCodec<\n\tChangeset,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tFieldChangeEncodingContext\n> {\n\tconst { decodeMarkEffect, changeAtomIdCodec } = makeV2CodecHelpers(revisionTagCodec);\n\n\treturn {\n\t\tencode: (\n\t\t\tchangeset: Changeset,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): JsonCompatibleReadOnly & Encoded.Changeset<NodeChangeSchema> =>\n\t\t\tencodeSequenceChangeset(\n\t\t\t\tchangeset,\n\t\t\t\tcontext,\n\t\t\t\t(revision) =>\n\t\t\t\t\tencodeRevisionWithContext(revision, context.baseContext, revisionTagCodec),\n\t\t\t\tchangeAtomIdCodec,\n\t\t\t\tencodeMarkEffectV2,\n\t\t\t),\n\t\tdecode: (\n\t\t\tchangeset: Encoded.Changeset<NodeChangeSchema>,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): Changeset =>\n\t\t\tdecodeSequenceChangeset(changeset, context, changeAtomIdCodec, decodeMarkEffect),\n\t\tencodedSchema: ChangesetSchema(EncodedNodeChangeset),\n\t};\n}\n\nexport function encodeSequenceChangeset(\n\tchangeset: Changeset,\n\tcontext: FieldChangeEncodingContext,\n\tencodeRevision: (revision: RevisionTag | undefined) => EncodedRevisionTag | undefined,\n\tchangeAtomIdCodec: IJsonCodec<\n\t\tChangeAtomId,\n\t\tEncodedChangeAtomId,\n\t\tEncodedChangeAtomId,\n\t\tChangeEncodingContext\n\t>,\n\tencodeMarkEffect: EncodeMarkEffect,\n): JsonCompatibleReadOnly & Encoded.Changeset<NodeChangeSchema> {\n\tconst jsonMarks: Encoded.Changeset<NodeChangeSchema> = [];\n\tfor (const mark of changeset) {\n\t\tjsonMarks.push(\n\t\t\t...encodeMark(mark, context, encodeRevision, changeAtomIdCodec, encodeMarkEffect),\n\t\t);\n\t}\n\treturn jsonMarks;\n}\n\nfunction encodeMark(\n\tmark: Mark,\n\tcontext: FieldChangeEncodingContext,\n\tencodeRevision: (revision: RevisionTag | undefined) => EncodedRevisionTag | undefined,\n\tchangeAtomIdCodec: IJsonCodec<\n\t\tChangeAtomId,\n\t\tEncodedChangeAtomId,\n\t\tEncodedChangeAtomId,\n\t\tChangeEncodingContext\n\t>,\n\tencodeMarkEffect: EncodeMarkEffect,\n): Encoded.Mark<TAnySchema>[] {\n\tconst splitLength = getLengthToSplitMark(mark, context);\n\tif (splitLength < mark.count) {\n\t\tconst [mark1, mark2] = splitMark(mark, splitLength);\n\t\treturn [\n\t\t\tencodeSplitMark(mark1, context, encodeRevision, changeAtomIdCodec, encodeMarkEffect),\n\t\t\t...encodeMark(mark2, context, encodeRevision, changeAtomIdCodec, encodeMarkEffect),\n\t\t];\n\t}\n\n\treturn [encodeSplitMark(mark, context, encodeRevision, changeAtomIdCodec, encodeMarkEffect)];\n}\n\nfunction encodeRename(\n\tmark: CellMark<Rename>,\n\tcontext: FieldChangeEncodingContext,\n\tchangeAtomIdCodec: IJsonCodec<\n\t\tChangeAtomId,\n\t\tEncodedChangeAtomId,\n\t\tEncodedChangeAtomId,\n\t\tChangeEncodingContext\n\t>,\n\tencodeRevision: (revision: RevisionTag | undefined) => EncodedRevisionTag | undefined,\n): Encoded.MarkEffect {\n\tassert(mark.cellId !== undefined, \"Rename should target empty cell\");\n\n\tconst inputDetachId = context.getInputRootId(mark.idOverride, mark.count).value;\n\tconst isMoveInAndDetach =\n\t\t!context.isAttachId(mark.idOverride, mark.count).value &&\n\t\t(context.isDetachId(mark.idOverride, mark.count).value ||\n\t\t\t(inputDetachId !== undefined && !areEqualChangeAtomIds(inputDetachId, mark.cellId)));\n\n\tif (isMoveInAndDetach) {\n\t\t// These cells are the final detach location of moved nodes.\n\t\tconst encodedRevision = encodeRevision(mark.idOverride.revision);\n\n\t\t// XXX: Use finalEndpoint if there is an associated cellDetachId.\n\t\treturn {\n\t\t\tattachAndDetach: {\n\t\t\t\tattach: {\n\t\t\t\t\tmoveIn: {\n\t\t\t\t\t\trevision: encodedRevision,\n\t\t\t\t\t\tid: mark.idOverride.localId,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdetach: {\n\t\t\t\t\tremove: {\n\t\t\t\t\t\trevision: encodedRevision,\n\t\t\t\t\t\tid: mark.idOverride.localId,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\n\tconst renamedRootId = context.rootRenames.getFirst(mark.cellId, mark.count).value;\n\n\tconst outputRootId = renamedRootId ?? mark.cellId;\n\tconst isMoveOutAndAttach = context.isAttachId(outputRootId, mark.count).value;\n\tconst isMoveOutAndDetach =\n\t\trenamedRootId !== undefined && !areEqualChangeAtomIds(renamedRootId, mark.idOverride);\n\n\tif (isMoveOutAndAttach || isMoveOutAndDetach) {\n\t\t// Detached nodes which were last at this cell location have been moved.\n\t\t// XXX: mark.idOverride represents detachCellId, so we should represent it using the moveOut's ID and use outputRootId as the finalDetachId.\n\t\t// Is that always true?\n\t\treturn {\n\t\t\tmoveOut: {\n\t\t\t\trevision: encodeRevision(outputRootId.revision),\n\t\t\t\tid: outputRootId.localId,\n\t\t\t\tidOverride: changeAtomIdCodec.encode(mark.idOverride, context.baseContext),\n\t\t\t},\n\t\t};\n\t}\n\n\tif (renamedRootId !== undefined) {\n\t\treturn {\n\t\t\tremove: {\n\t\t\t\trevision: encodeRevision(outputRootId.revision),\n\t\t\t\tid: outputRootId.localId,\n\t\t\t},\n\t\t};\n\t}\n\n\t// In documents generated by clients on release >=2.2 (i.e., running the code from the PR that added this comment),\n\t// renames are encoded as AttachAndDetach with a special id.\n\t// This ensures forward-compatibility of clients on release <=2.1 with documents/ops generated by clients on release >=2.2.\n\treturn {\n\t\tattachAndDetach: {\n\t\t\tattach: { insert: { id: renameLocalId } },\n\t\t\tdetach: {\n\t\t\t\tremove: {\n\t\t\t\t\tid: renameLocalId,\n\t\t\t\t\tidOverride: changeAtomIdCodec.encode(mark.idOverride, context.baseContext),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t};\n}\n\nfunction getLengthToSplitMark(mark: Mark, context: FieldChangeEncodingContext): number {\n\tlet count =\n\t\tmark.cellId !== undefined\n\t\t\t? rangeQueryChangeAtomIdMap(context.rootNodeChanges, mark.cellId, mark.count).length\n\t\t\t: mark.count;\n\n\tif (mark.cellId !== undefined) {\n\t\tcount = context.getInputRootId(mark.cellId, count).length;\n\t}\n\n\tswitch (mark.type) {\n\t\tcase \"Insert\":\n\t\t\tcount = context.isDetachId(getAttachedRootId(mark), count).length;\n\t\t\tbreak;\n\t\tcase \"Remove\":\n\t\t\tcount = context.isAttachId(getDetachedRootId(mark), count).length;\n\t\t\tbreak;\n\t\tcase \"Rename\": {\n\t\t\tcount = context.getInputRootId(mark.idOverride, count).length;\n\t\t\tcount = context.isAttachId(mark.idOverride, count).length;\n\t\t\tcount = context.isDetachId(mark.idOverride, count).length;\n\t\t\tconst cellId = mark.cellId ?? fail(\"Rename should have cell ID\");\n\t\t\tconst renameEntry = context.rootRenames.getFirst(cellId, count);\n\t\t\tcount = renameEntry.length;\n\t\t\tcount = context.isAttachId(renameEntry.value ?? cellId, count).length;\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\n\treturn count;\n}\n\nfunction encodeSplitMark(\n\tmark: Mark,\n\tcontext: FieldChangeEncodingContext,\n\tencodeRevision: (revision: RevisionTag | undefined) => EncodedRevisionTag | undefined,\n\tchangeAtomIdCodec: IJsonCodec<\n\t\tChangeAtomId,\n\t\tEncodedChangeAtomId,\n\t\tEncodedChangeAtomId,\n\t\tChangeEncodingContext\n\t>,\n\tencodeMarkEffect: EncodeMarkEffect,\n): Encoded.Mark<TAnySchema> {\n\tconst encodedMark: Encoded.Mark<TAnySchema> = {\n\t\tcount: mark.count,\n\t};\n\tif (!isNoopMark(mark)) {\n\t\tencodedMark.effect = encodeMarkEffect(mark, context, encodeRevision, changeAtomIdCodec);\n\t}\n\tif (mark.cellId !== undefined) {\n\t\tassert(mark.changes === undefined, \"Empty cells should not have node changes\");\n\t\tencodedMark.cellId = changeAtomIdCodec.encode(mark.cellId, context.baseContext);\n\t\tconst nodeId = getFromChangeAtomIdMap(context.rootNodeChanges, mark.cellId);\n\t\tif (nodeId !== undefined) {\n\t\t\tencodedMark.changes = context.encodeNode(nodeId);\n\t\t}\n\t} else if (mark.changes !== undefined) {\n\t\tencodedMark.changes = context.encodeNode(mark.changes);\n\t}\n\n\treturn encodedMark;\n}\n\ntype EncodeMarkEffect = (\n\tmark: Mark,\n\tcontext: FieldChangeEncodingContext,\n\tencodeRevision: (revision: RevisionTag | undefined) => EncodedRevisionTag | undefined,\n\tchangeAtomIdCodec: IJsonCodec<\n\t\tChangeAtomId,\n\t\tEncodedChangeAtomId,\n\t\tEncodedChangeAtomId,\n\t\tChangeEncodingContext\n\t>,\n) => Encoded.MarkEffect;\n\nfunction encodeMarkEffectV2(\n\tmark: Mark,\n\tcontext: FieldChangeEncodingContext,\n\tencodeRevision: (revision: RevisionTag | undefined) => EncodedRevisionTag | undefined,\n\tchangeAtomIdCodec: IJsonCodec<\n\t\tChangeAtomId,\n\t\tEncodedChangeAtomId,\n\t\tEncodedChangeAtomId,\n\t\tChangeEncodingContext\n\t>,\n): Encoded.MarkEffect {\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase \"Insert\": {\n\t\t\tconst attachId = getAttachedRootId(mark);\n\t\t\tconst isMove = context.isDetachId(attachId, 1).value;\n\n\t\t\t// If the input context ID for these nodes is not the cell ID,\n\t\t\t// then these nodes are being moved from the location at which they were last detached.\n\t\t\tconst inputId = context.getInputRootId(attachId, mark.count).value ?? attachId;\n\t\t\tconst isInitialAttachLocation =\n\t\t\t\tmark.cellId === undefined || areEqualChangeAtomIds(mark.cellId, inputId);\n\n\t\t\treturn isMove || !isInitialAttachLocation\n\t\t\t\t? {\n\t\t\t\t\t\tmoveIn: { revision: encodeRevision(mark.revision), id: mark.id },\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tinsert: {\n\t\t\t\t\t\t\trevision: encodeRevision(mark.revision),\n\t\t\t\t\t\t\tid: mark.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t}\n\t\tcase \"Remove\": {\n\t\t\tconst encodedIdOverride =\n\t\t\t\tmark.cellRename !== undefined\n\t\t\t\t\t? changeAtomIdCodec.encode(mark.cellRename, context.baseContext)\n\t\t\t\t\t: undefined;\n\n\t\t\tconst detachId = getDetachedRootId(mark);\n\t\t\tconst isMove = context.isAttachId(detachId, 1).value;\n\n\t\t\tconst outputCellId = mark.cellRename ?? mark.detachCellId ?? detachId;\n\n\t\t\t// If the final detach location for the nodes were here,\n\t\t\t// then the output cell ID would be the same as the detach ID.\n\t\t\t// So if the cell ID is different from the detach ID, the nodes must have been moved.\n\t\t\tconst isFinalDetachLocation = areEqualChangeAtomIds(detachId, outputCellId);\n\n\t\t\tconst isMoveOrDetachedMove = isMove || !isFinalDetachLocation;\n\t\t\tif (mark.detachCellId !== undefined) {\n\t\t\t\tassert(\n\t\t\t\t\tisMoveOrDetachedMove,\n\t\t\t\t\t\"Only detaches representing a move out should specify a detach cell ID\",\n\t\t\t\t);\n\n\t\t\t\t// XXX: Set final endpoint on the move in.\n\t\t\t\treturn {\n\t\t\t\t\tmoveOut: {\n\t\t\t\t\t\trevision: encodeRevision(mark.detachCellId.revision),\n\t\t\t\t\t\tid: mark.detachCellId.localId,\n\t\t\t\t\t\tidOverride: encodedIdOverride,\n\t\t\t\t\t\tfinalEndpoint: changeAtomIdCodec.encode(\n\t\t\t\t\t\t\t{ revision: mark.revision, localId: mark.id },\n\t\t\t\t\t\t\tcontext.baseContext,\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst encodedRevision = encodeRevision(mark.revision);\n\t\t\treturn isMoveOrDetachedMove\n\t\t\t\t? {\n\t\t\t\t\t\tmoveOut: {\n\t\t\t\t\t\t\trevision: encodedRevision,\n\t\t\t\t\t\t\tid: mark.id,\n\t\t\t\t\t\t\tidOverride: encodedIdOverride,\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tremove: {\n\t\t\t\t\t\t\trevision: encodedRevision,\n\t\t\t\t\t\t\tidOverride: encodedIdOverride,\n\t\t\t\t\t\t\tid: mark.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t}\n\t\tcase \"Rename\":\n\t\t\treturn encodeRename(mark, context, changeAtomIdCodec, encodeRevision);\n\t\tcase NoopMarkType:\n\t\t\tfail(0xb2c /* Mark type: NoopMarkType should not be encoded. */);\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\nexport function encodeRevisionWithContext(\n\trevision: RevisionTag | undefined,\n\tcontext: ChangeEncodingContext,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): EncodedRevisionTag | undefined {\n\treturn revision === undefined || revision === context.revision\n\t\t? undefined\n\t\t: revisionTagCodec.encode(revision, context);\n}\n\n/**\n * Arbitrary ID that is used to indicate a Rename effect.\n */\nconst renameLocalId: ChangesetLocalId = brand(-1);\n\n/**\n * If the encoded mark effect represents a simple cell rename (with no effect on root nodes),\n * returns the encoded form of the ID the cell is being renamed to,\n * and otherwise returns undefined.\n */\nexport function tryGetEncodedCellRename(\n\tencoded: Encoded.MarkEffect,\n): EncodedChangeAtomId | undefined {\n\tconst attachAndDetach = encoded.attachAndDetach;\n\tif (attachAndDetach === undefined) {\n\t\treturn undefined;\n\t}\n}\n\nfunction tryGetEncodedCellRenameFromAttachAndDetach(\n\tencoded: Encoded.AttachAndDetach,\n): EncodedChangeAtomId | undefined {\n\t// In documents generated by clients on release >=2.2 (i.e., running the code from the PR that added this comment),\n\t// renames are encoded as AttachAndDetach with a special id.\n\t// This ensures forward-compatibility of clients on release <=2.1 with documents/ops generated by clients on release >=2.2.\n\tif (encoded.attach.insert?.id === renameLocalId) {\n\t\tassert(\n\t\t\tencoded.detach.remove?.idOverride !== undefined,\n\t\t\t0x9f8 /* Rename must have idOverride */,\n\t\t);\n\t\treturn encoded.detach.remove.idOverride;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequenceFieldCodecV3.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"sequenceFieldCodecV3.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,KAAK,EAEX,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAEN,KAAK,0BAA0B,EAC/B,MAAM,4BAA4B,CAAC;AAUpC,OAAO,KAAK,EAAE,SAAS,EAA4B,MAAM,YAAY,CAAC;AAEtE,wBAAgB,WAAW,CAC1B,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,GACC,UAAU,CACZ,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,CAC1B,CAiFA"}
|
|
@@ -9,75 +9,35 @@ const index_js_1 = require("../../codec/index.js");
|
|
|
9
9
|
const index_js_2 = require("../modular-schema/index.js");
|
|
10
10
|
const formatV3_js_1 = require("./formatV3.js");
|
|
11
11
|
const sequenceFieldCodecV2_js_1 = require("./sequenceFieldCodecV2.js");
|
|
12
|
-
const utils_js_1 = require("./utils.js");
|
|
13
12
|
function makeV3Codec(revisionTagCodec) {
|
|
14
|
-
const { changeAtomIdCodec: atomIdCodec,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return decoderLibrary.dispatch(encoded, context);
|
|
31
|
-
},
|
|
32
|
-
};
|
|
13
|
+
const { changeAtomIdCodec: atomIdCodec, encodeMarkEffect: encodeV2MarkEffect, decoderLibrary: decoderLibraryV2, } = (0, sequenceFieldCodecV2_js_1.makeV2CodecHelpers)(revisionTagCodec);
|
|
14
|
+
function encodeMarkEffect(mark, context) {
|
|
15
|
+
const encoded = encodeV2MarkEffect(mark, context);
|
|
16
|
+
const encodedRenameId = (0, sequenceFieldCodecV2_js_1.tryGetEncodedCellRename)(encoded);
|
|
17
|
+
if (encodedRenameId !== undefined) {
|
|
18
|
+
return {
|
|
19
|
+
rename: {
|
|
20
|
+
idOverride: encodedRenameId,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return encoded;
|
|
25
|
+
}
|
|
26
|
+
function decodeMarkEffect(encoded, count, cellId, context) {
|
|
27
|
+
return decoderLibrary.dispatch(encoded, count, cellId, context);
|
|
28
|
+
}
|
|
33
29
|
const decoderLibrary = new index_js_1.DiscriminatedUnionDispatcher({
|
|
34
30
|
...decoderLibraryV2,
|
|
35
|
-
rename(encoded, context) {
|
|
31
|
+
rename(encoded, count, cellId, context) {
|
|
36
32
|
return {
|
|
37
33
|
type: "Rename",
|
|
38
|
-
idOverride: atomIdCodec.decode(encoded.idOverride, context),
|
|
34
|
+
idOverride: atomIdCodec.decode(encoded.idOverride, context.baseContext),
|
|
39
35
|
};
|
|
40
36
|
},
|
|
41
37
|
});
|
|
42
38
|
return {
|
|
43
|
-
encode: (changeset, context) =>
|
|
44
|
-
|
|
45
|
-
for (const mark of changeset) {
|
|
46
|
-
const encodedMark = {
|
|
47
|
-
count: mark.count,
|
|
48
|
-
};
|
|
49
|
-
if (!(0, utils_js_1.isNoopMark)(mark)) {
|
|
50
|
-
encodedMark.effect = markEffectCodec.encode(mark, context.baseContext);
|
|
51
|
-
}
|
|
52
|
-
if (mark.cellId !== undefined) {
|
|
53
|
-
encodedMark.cellId = atomIdCodec.encode(mark.cellId, context.baseContext);
|
|
54
|
-
}
|
|
55
|
-
if (mark.changes !== undefined) {
|
|
56
|
-
encodedMark.changes = context.encodeNode(mark.changes);
|
|
57
|
-
}
|
|
58
|
-
jsonMarks.push(encodedMark);
|
|
59
|
-
}
|
|
60
|
-
return jsonMarks;
|
|
61
|
-
},
|
|
62
|
-
decode: (changeset, context) => {
|
|
63
|
-
const marks = [];
|
|
64
|
-
for (const mark of changeset) {
|
|
65
|
-
const decodedMark = {
|
|
66
|
-
count: mark.count,
|
|
67
|
-
};
|
|
68
|
-
if (mark.effect !== undefined) {
|
|
69
|
-
Object.assign(decodedMark, markEffectCodec.decode(mark.effect, context.baseContext));
|
|
70
|
-
}
|
|
71
|
-
if (mark.cellId !== undefined) {
|
|
72
|
-
decodedMark.cellId = atomIdCodec.decode(mark.cellId, context.baseContext);
|
|
73
|
-
}
|
|
74
|
-
if (mark.changes !== undefined) {
|
|
75
|
-
decodedMark.changes = context.decodeNode(mark.changes);
|
|
76
|
-
}
|
|
77
|
-
marks.push(decodedMark);
|
|
78
|
-
}
|
|
79
|
-
return marks;
|
|
80
|
-
},
|
|
39
|
+
encode: (changeset, context) => (0, sequenceFieldCodecV2_js_1.encodeSequenceChangeset)(changeset, context, (revision) => (0, sequenceFieldCodecV2_js_1.encodeRevisionWithContext)(revision, context.baseContext, revisionTagCodec), atomIdCodec, encodeMarkEffect),
|
|
40
|
+
decode: (changeset, context) => (0, sequenceFieldCodecV2_js_1.decodeSequenceChangeset)(changeset, context, atomIdCodec, decodeMarkEffect),
|
|
81
41
|
encodedSchema: (0, formatV3_js_1.Changeset)(index_js_2.EncodedNodeChangeset),
|
|
82
42
|
};
|
|
83
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequenceFieldCodecV3.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,mDAAqF;
|
|
1
|
+
{"version":3,"file":"sequenceFieldCodecV3.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,mDAAqF;AAQrF,yDAGoC;AAEpC,+CAA2E;AAC3E,uEAMmC;AAGnC,SAAgB,WAAW,CAC1B,gBAKC;IAOD,MAAM,EACL,iBAAiB,EAAE,WAAW,EAC9B,gB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uB,EAAC,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,gBAAgB,CAAC;QAC1F,aAAa,EAAE,IAAA,uBAAe,EAAC,+BAAoB,CAAC;KACpD,CAAC;AACH,CAAC;AA7FD,kCA6FC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { TAnySchema } from \"@sinclair/typebox\";\n\nimport { DiscriminatedUnionDispatcher, type IJsonCodec } from \"../../codec/index.js\";\nimport type {\n\tChangeAtomId,\n\tChangeEncodingContext,\n\tEncodedRevisionTag,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport type { JsonCompatibleReadOnly } from \"../../util/index.js\";\nimport {\n\tEncodedNodeChangeset,\n\ttype FieldChangeEncodingContext,\n} from \"../modular-schema/index.js\";\n\nimport { Changeset as ChangesetSchema, type Encoded } from \"./formatV3.js\";\nimport {\n\tdecodeSequenceChangeset,\n\tencodeRevisionWithContext,\n\tencodeSequenceChangeset,\n\tmakeV2CodecHelpers,\n\ttryGetEncodedCellRename,\n} from \"./sequenceFieldCodecV2.js\";\nimport type { Changeset, Mark, MarkEffect, Rename } from \"./types.js\";\n\nexport function makeV3Codec(\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): IJsonCodec<\n\tChangeset,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tFieldChangeEncodingContext\n> {\n\tconst {\n\t\tchangeAtomIdCodec: atomIdCodec,\n\t\tencodeMarkEffect: encodeV2MarkEffect,\n\t\tdecoderLibrary: decoderLibraryV2,\n\t} = makeV2CodecHelpers(revisionTagCodec);\n\n\tfunction encodeMarkEffect(\n\t\tmark: Mark,\n\t\tcontext: FieldChangeEncodingContext,\n\t): Encoded.MarkEffect {\n\t\tconst encoded = encodeV2MarkEffect(mark, context);\n\t\tconst encodedRenameId = tryGetEncodedCellRename(encoded);\n\t\tif (encodedRenameId !== undefined) {\n\t\t\treturn {\n\t\t\t\trename: {\n\t\t\t\t\tidOverride: encodedRenameId,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\treturn encoded;\n\t}\n\n\tfunction decodeMarkEffect(\n\t\tencoded: Encoded.MarkEffect,\n\t\tcount: number,\n\t\tcellId: ChangeAtomId | undefined,\n\t\tcontext: FieldChangeEncodingContext,\n\t): MarkEffect {\n\t\treturn decoderLibrary.dispatch(encoded, count, cellId, context);\n\t}\n\n\tconst decoderLibrary = new DiscriminatedUnionDispatcher<\n\t\tEncoded.MarkEffect,\n\t\t/* args */ [\n\t\t\tcount: number,\n\t\t\tcellId: ChangeAtomId | undefined,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t],\n\t\tMarkEffect\n\t>({\n\t\t...decoderLibraryV2,\n\t\trename(\n\t\t\tencoded: Encoded.Rename,\n\t\t\tcount: number,\n\t\t\tcellId: ChangeAtomId | undefined,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): Rename {\n\t\t\treturn {\n\t\t\t\ttype: \"Rename\",\n\t\t\t\tidOverride: atomIdCodec.decode(encoded.idOverride, context.baseContext),\n\t\t\t};\n\t\t},\n\t});\n\n\t/**\n\t * If we want to make the node change aspect of this codec more type-safe, we could adjust generics\n\t * to be in terms of the schema rather than the concrete type of the node change.\n\t */\n\ttype NodeChangeSchema = TAnySchema;\n\n\treturn {\n\t\tencode: (\n\t\t\tchangeset: Changeset,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): JsonCompatibleReadOnly & Encoded.Changeset<NodeChangeSchema> =>\n\t\t\tencodeSequenceChangeset(\n\t\t\t\tchangeset,\n\t\t\t\tcontext,\n\t\t\t\t(revision) =>\n\t\t\t\t\tencodeRevisionWithContext(revision, context.baseContext, revisionTagCodec),\n\t\t\t\tatomIdCodec,\n\t\t\t\tencodeMarkEffect,\n\t\t\t),\n\t\tdecode: (\n\t\t\tchangeset: Encoded.Changeset<NodeChangeSchema>,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): Changeset => decodeSequenceChangeset(changeset, context, atomIdCodec, decodeMarkEffect),\n\t\tencodedSchema: ChangesetSchema(EncodedNodeChangeset),\n\t};\n}\n"]}
|
|
@@ -6,7 +6,7 @@ import type { ChangesetLocalId, RevisionTag } from "../../core/index.js";
|
|
|
6
6
|
import type { FieldEditor, NodeId } from "../modular-schema/index.js";
|
|
7
7
|
import type { CellId, Changeset, MarkList } from "./types.js";
|
|
8
8
|
export interface SequenceFieldEditor extends FieldEditor<Changeset> {
|
|
9
|
-
insert(index: number, count: number,
|
|
9
|
+
insert(index: number, count: number, cellId: CellId, revision: RevisionTag, moveId: ChangesetLocalId): Changeset;
|
|
10
10
|
remove(index: number, count: number, id: ChangesetLocalId, revision: RevisionTag): Changeset;
|
|
11
11
|
revive(index: number, count: number, detachEvent: CellId, revision: RevisionTag, isIntention?: true): Changeset;
|
|
12
12
|
/**
|
|
@@ -25,7 +25,7 @@ export interface SequenceFieldEditor extends FieldEditor<Changeset> {
|
|
|
25
25
|
}
|
|
26
26
|
export declare const sequenceFieldEditor: {
|
|
27
27
|
buildChildChanges: (changes: Iterable<[number, NodeId]>) => MarkList;
|
|
28
|
-
insert: (index: number, count: number,
|
|
28
|
+
insert: (index: number, count: number, cellId: CellId, revision: RevisionTag | undefined, moveId: ChangesetLocalId) => MarkList;
|
|
29
29
|
remove: (index: number, count: number, id: ChangesetLocalId, revision: RevisionTag | undefined) => MarkList;
|
|
30
30
|
revive: (index: number, count: number, detachEvent: CellId, revision: RevisionTag | undefined) => MarkList;
|
|
31
31
|
move(sourceIndex: number, count: number, destIndex: number, detachCellId: ChangesetLocalId, attachCellId: CellId, revision: RevisionTag | undefined): MarkList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequenceFieldEditor.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldEditor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAGtE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"sequenceFieldEditor.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldEditor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAGtE,OAAO,KAAK,EAAU,MAAM,EAAY,SAAS,EAAgB,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG9F,MAAM,WAAW,mBAAoB,SAAQ,WAAW,CAAC,SAAS,CAAC;IAClE,MAAM,CACL,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,WAAW,EACrB,MAAM,EAAE,gBAAgB,GACtB,SAAS,CAAC;IACb,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,gBAAgB,EAAE,QAAQ,EAAE,WAAW,GAAG,SAAS,CAAC;IAC7F,MAAM,CACL,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,WAAW,EACrB,WAAW,CAAC,EAAE,IAAI,GAChB,SAAS,CAAC;IAEb;;;;;;;;OAQG;IACH,IAAI,CACH,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,gBAAgB,EAC9B,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,WAAW,GACnB,SAAS,CAAC;IAEb,OAAO,CACN,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,EAAE,EAAE,gBAAgB,EACpB,QAAQ,EAAE,WAAW,GACnB,SAAS,CAAC;IACb,MAAM,CACL,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,WAAW,GACnB,SAAS,CAAC;IAEb,MAAM,CACL,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,WAAW,GACnB,SAAS,CAAC;CACb;AAED,eAAO,MAAM,mBAAmB;iCACF,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;oBAc/C,MAAM,SACN,MAAM,UACL,MAAM,YACJ,WAAW,GAAG,SAAS,UACzB,gBAAgB;oBAYjB,MAAM,SACN,MAAM,MACT,gBAAgB,YACV,WAAW,GAAG,SAAS;oBAK1B,MAAM,SACN,MAAM,eACA,MAAM,YACT,WAAW,GAAG,SAAS;sBAcpB,MAAM,SACZ,MAAM,aACF,MAAM,gBACH,gBAAgB,gBAChB,MAAM,YACV,WAAW,GAAG,SAAS;yBAmBpB,MAAM,SACZ,MAAM,gBACC,gBAAgB,YACpB,WAAW;sBAYV,MAAM,SACV,MAAM,UACL,gBAAgB,gBACV,MAAM,YACV,WAAW;wBAaR,MAAM,SACZ,MAAM,aACF,MAAM,gBACH,MAAM,gBACN,MAAM,YACV,WAAW,GAAG,SAAS;CAoBJ,CAAC"}
|
|
@@ -22,12 +22,12 @@ exports.sequenceFieldEditor = {
|
|
|
22
22
|
}
|
|
23
23
|
return changeset;
|
|
24
24
|
},
|
|
25
|
-
insert: (index, count,
|
|
25
|
+
insert: (index, count, cellId, revision, moveId) => {
|
|
26
26
|
const mark = {
|
|
27
27
|
type: "Insert",
|
|
28
|
-
id:
|
|
28
|
+
id: moveId,
|
|
29
29
|
count,
|
|
30
|
-
cellId
|
|
30
|
+
cellId,
|
|
31
31
|
revision,
|
|
32
32
|
};
|
|
33
33
|
return markAtIndex(index, mark);
|
|
@@ -46,14 +46,14 @@ exports.sequenceFieldEditor = {
|
|
|
46
46
|
},
|
|
47
47
|
move(sourceIndex, count, destIndex, detachCellId, attachCellId, revision) {
|
|
48
48
|
const moveIn = {
|
|
49
|
-
type: "
|
|
49
|
+
type: "Insert",
|
|
50
50
|
id: detachCellId,
|
|
51
51
|
count,
|
|
52
52
|
cellId: attachCellId,
|
|
53
53
|
revision,
|
|
54
54
|
};
|
|
55
55
|
const moveOut = {
|
|
56
|
-
type: "
|
|
56
|
+
type: "Remove",
|
|
57
57
|
id: detachCellId,
|
|
58
58
|
count,
|
|
59
59
|
revision,
|
|
@@ -62,7 +62,7 @@ exports.sequenceFieldEditor = {
|
|
|
62
62
|
},
|
|
63
63
|
moveOut(sourceIndex, count, detachCellId, revision) {
|
|
64
64
|
const moveOut = {
|
|
65
|
-
type: "
|
|
65
|
+
type: "Remove",
|
|
66
66
|
id: detachCellId,
|
|
67
67
|
count,
|
|
68
68
|
revision,
|
|
@@ -71,7 +71,7 @@ exports.sequenceFieldEditor = {
|
|
|
71
71
|
},
|
|
72
72
|
moveIn(destIndex, count, moveId, attachCellId, revision) {
|
|
73
73
|
const moveIn = {
|
|
74
|
-
type: "
|
|
74
|
+
type: "Insert",
|
|
75
75
|
id: moveId,
|
|
76
76
|
count,
|
|
77
77
|
cellId: attachCellId,
|
|
@@ -81,14 +81,14 @@ exports.sequenceFieldEditor = {
|
|
|
81
81
|
},
|
|
82
82
|
return(sourceIndex, count, destIndex, detachCellId, attachCellId, revision) {
|
|
83
83
|
const moveOut = {
|
|
84
|
-
type: "
|
|
84
|
+
type: "Remove",
|
|
85
85
|
id: attachCellId.localId,
|
|
86
|
-
|
|
86
|
+
cellRename: detachCellId,
|
|
87
87
|
count,
|
|
88
88
|
revision,
|
|
89
89
|
};
|
|
90
90
|
const returnTo = {
|
|
91
|
-
type: "
|
|
91
|
+
type: "Insert",
|
|
92
92
|
id: attachCellId.localId,
|
|
93
93
|
count,
|
|
94
94
|
cellId: attachCellId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequenceFieldEditor.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldEditor.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAK7D,6DAAuD;AAWvD,yCAAuC;AAuD1B,QAAA,mBAAmB,GAAG;IAClC,iBAAiB,EAAE,CAAC,OAAmC,EAAa,EAAE;QACrE,MAAM,SAAS,GAAc,EAAE,CAAC;QAChC,IAAI,YAAY,GAAG,CAAC,CAAC;QACrB,KAAK,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;YACvC,IAAA,iBAAM,EAAC,KAAK,IAAI,YAAY,EAAE,KAAK,CAAC,qCAAqC,CAAC,CAAC;YAC3E,IAAI,KAAK,GAAG,YAAY,EAAE,CAAC;gBAC1B,SAAS,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,YAAY,EAAE,CAAC,CAAC;YACjD,CAAC;YACD,SAAS,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;YAC9C,YAAY,GAAG,KAAK,GAAG,CAAC,CAAC;QAC1B,CAAC;QACD,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,MAAM,EAAE,CACP,KAAa,EACb,KAAa,EACb,OAAe,EACf,QAAiC,EACrB,EAAE;QACd,MAAM,IAAI,GAAqB;YAC9B,IAAI,EAAE,QAAQ;YACd,EAAE,EAAE,OAAO,CAAC,OAAO;YACnB,KAAK;YACL,MAAM,EAAE,OAAO;YACf,QAAQ;SACR,CAAC;QACF,OAAO,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACjC,CAAC;IACD,MAAM,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,SAAS,IAAI,WAAW,EAAE,CAAC;QAC9B,6CAA6C;QAC7C,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC1B,KAAK,CAAC,UAAU,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;QAC1C,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;SAAM,IAAI,uBAAuB,IAAI,SAAS,EAAE,CAAC;QACjD,4CAA4C;QAC5C,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC1B,KAAK,CAAC,UAAU,CAAC,SAAS,GAAG,uBAAuB,CAAC,CAAC;QACtD,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;SAAM,CAAC;QACP,MAAM,kBAAkB,GAAG,SAAS,GAAG,WAAW,CAAC;QACnD,iDAAiD;QACjD,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,IAAA,oBAAS,EAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;QACjE,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC3B,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC1B,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC;AACnB,CAAC;AAED,SAAS,WAAW,CAAC,KAAa,EAAE,IAAU;IAC7C,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,CAAC,CAAC;AACxD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport type { ChangesetLocalId, RevisionTag } from \"../../core/index.js\";\nimport type { FieldEditor, NodeId } from \"../modular-schema/index.js\";\n\nimport { MarkListFactory } from \"./markListFactory.js\";\nimport type {\n\tCellId,\n\tCellMark,\n\tChangeset,\n\tInsert,\n\tMark,\n\tMarkList,\n\tMoveIn,\n\tMoveOut,\n} from \"./types.js\";\nimport { splitMark } from \"./utils.js\";\n\nexport interface SequenceFieldEditor extends FieldEditor<Changeset> {\n\tinsert(index: number, count: number, firstId: CellId, revision: RevisionTag): Changeset;\n\tremove(index: number, count: number, id: ChangesetLocalId, revision: RevisionTag): Changeset;\n\trevive(\n\t\tindex: number,\n\t\tcount: number,\n\t\tdetachEvent: CellId,\n\t\trevision: RevisionTag,\n\t\tisIntention?: true,\n\t): Changeset;\n\n\t/**\n\t *\n\t * @param sourceIndex - The index of the first node move\n\t * @param count - The number of nodes to move\n\t * @param destIndex - The index the nodes should be moved to, interpreted before detaching the moved nodes\n\t * @param detachCellId - The local ID to assign to the first cell being emptied by the move\n\t * @param attachCellId - The ID to assign to the first cell being filled by the move\n\t * @param revision - The revision to assign to the move marks\n\t */\n\tmove(\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestIndex: number,\n\t\tdetachCellId: ChangesetLocalId,\n\t\tattachCellId: CellId,\n\t\trevision: RevisionTag,\n\t): Changeset;\n\n\tmoveOut(\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tid: ChangesetLocalId,\n\t\trevision: RevisionTag,\n\t): Changeset;\n\tmoveIn(\n\t\tdestIndex: number,\n\t\tcount: number,\n\t\tmoveId: ChangesetLocalId,\n\t\tattachCellId: CellId,\n\t\trevision: RevisionTag,\n\t): Changeset;\n\n\treturn(\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestIndex: number,\n\t\tdetachCellId: CellId,\n\t\tattachCellId: CellId,\n\t\trevision: RevisionTag,\n\t): Changeset;\n}\n\nexport const sequenceFieldEditor = {\n\tbuildChildChanges: (changes: Iterable<[number, NodeId]>): Changeset => {\n\t\tconst changeset: Changeset = [];\n\t\tlet currentIndex = 0;\n\t\tfor (const [index, change] of changes) {\n\t\t\tassert(index >= currentIndex, 0xabe /* Child changes must be in order. */);\n\t\t\tif (index > currentIndex) {\n\t\t\t\tchangeset.push({ count: index - currentIndex });\n\t\t\t}\n\t\t\tchangeset.push({ count: 1, changes: change });\n\t\t\tcurrentIndex = index + 1;\n\t\t}\n\t\treturn changeset;\n\t},\n\tinsert: (\n\t\tindex: number,\n\t\tcount: number,\n\t\tfirstId: CellId,\n\t\trevision: RevisionTag | undefined,\n\t): Changeset => {\n\t\tconst mark: CellMark<Insert> = {\n\t\t\ttype: \"Insert\",\n\t\t\tid: firstId.localId,\n\t\t\tcount,\n\t\t\tcellId: firstId,\n\t\t\trevision,\n\t\t};\n\t\treturn markAtIndex(index, mark);\n\t},\n\tremove: (\n\t\tindex: number,\n\t\tcount: number,\n\t\tid: ChangesetLocalId,\n\t\trevision: RevisionTag | undefined,\n\t): Changeset =>\n\t\tcount === 0 ? [] : markAtIndex(index, { type: \"Remove\", count, id, revision }),\n\n\trevive: (\n\t\tindex: number,\n\t\tcount: number,\n\t\tdetachEvent: CellId,\n\t\trevision: RevisionTag | undefined,\n\t): Changeset => {\n\t\tassert(detachEvent.revision !== undefined, 0x724 /* Detach event must have a revision */);\n\t\tconst mark: CellMark<Insert> = {\n\t\t\ttype: \"Insert\",\n\t\t\tid: detachEvent.localId,\n\t\t\tcount,\n\t\t\tcellId: detachEvent,\n\t\t\trevision,\n\t\t};\n\t\treturn count === 0 ? [] : markAtIndex(index, mark);\n\t},\n\n\tmove(\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestIndex: number,\n\t\tdetachCellId: ChangesetLocalId,\n\t\tattachCellId: CellId,\n\t\trevision: RevisionTag | undefined,\n\t): Changeset {\n\t\tconst moveIn: Mark = {\n\t\t\ttype: \"MoveIn\",\n\t\t\tid: detachCellId,\n\t\t\tcount,\n\t\t\tcellId: attachCellId,\n\t\t\trevision,\n\t\t};\n\t\tconst moveOut: Mark = {\n\t\t\ttype: \"MoveOut\",\n\t\t\tid: detachCellId,\n\t\t\tcount,\n\t\t\trevision,\n\t\t};\n\t\treturn moveMarksToMarkList(sourceIndex, count, destIndex, moveOut, moveIn);\n\t},\n\n\tmoveOut(\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdetachCellId: ChangesetLocalId,\n\t\trevision: RevisionTag,\n\t): Changeset {\n\t\tconst moveOut: Mark = {\n\t\t\ttype: \"MoveOut\",\n\t\t\tid: detachCellId,\n\t\t\tcount,\n\t\t\trevision,\n\t\t};\n\t\treturn markAtIndex(sourceIndex, moveOut);\n\t},\n\n\tmoveIn(\n\t\tdestIndex: number,\n\t\tcount: number,\n\t\tmoveId: ChangesetLocalId,\n\t\tattachCellId: CellId,\n\t\trevision: RevisionTag,\n\t): Changeset {\n\t\tconst moveIn: Mark = {\n\t\t\ttype: \"MoveIn\",\n\t\t\tid: moveId,\n\t\t\tcount,\n\t\t\tcellId: attachCellId,\n\t\t\trevision,\n\t\t};\n\t\treturn markAtIndex(destIndex, moveIn);\n\t},\n\n\treturn(\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestIndex: number,\n\t\tdetachCellId: CellId,\n\t\tattachCellId: CellId,\n\t\trevision: RevisionTag | undefined,\n\t): Changeset {\n\t\tconst moveOut: CellMark<MoveOut> = {\n\t\t\ttype: \"MoveOut\",\n\t\t\tid: attachCellId.localId,\n\t\t\tidOverride: detachCellId,\n\t\t\tcount,\n\t\t\trevision,\n\t\t};\n\n\t\tconst returnTo: CellMark<MoveIn> = {\n\t\t\ttype: \"MoveIn\",\n\t\t\tid: attachCellId.localId,\n\t\t\tcount,\n\t\t\tcellId: attachCellId,\n\t\t\trevision,\n\t\t};\n\n\t\treturn moveMarksToMarkList(sourceIndex, count, destIndex, moveOut, returnTo);\n\t},\n} satisfies SequenceFieldEditor;\n\nfunction moveMarksToMarkList(\n\tsourceIndex: number,\n\tcount: number,\n\tdestIndex: number,\n\tdetach: CellMark<MoveOut>,\n\tattach: CellMark<MoveIn>,\n): MarkList {\n\tif (count === 0) {\n\t\treturn [];\n\t}\n\tconst firstIndexBeyondMoveOut = sourceIndex + count;\n\tconst marks = new MarkListFactory();\n\tmarks.pushOffset(Math.min(sourceIndex, destIndex));\n\tif (destIndex <= sourceIndex) {\n\t\t// The destination is fully before the source\n\t\tmarks.pushContent(attach);\n\t\tmarks.pushOffset(sourceIndex - destIndex);\n\t\tmarks.pushContent(detach);\n\t} else if (firstIndexBeyondMoveOut <= destIndex) {\n\t\t// The destination is fully after the source\n\t\tmarks.pushContent(detach);\n\t\tmarks.pushOffset(destIndex - firstIndexBeyondMoveOut);\n\t\tmarks.pushContent(attach);\n\t} else {\n\t\tconst firstSectionLength = destIndex - sourceIndex;\n\t\t// The destination is in the middle of the source\n\t\tconst [detach1, detach2] = splitMark(detach, firstSectionLength);\n\t\tmarks.pushContent(detach1);\n\t\tmarks.pushContent(attach);\n\t\tmarks.pushContent(detach2);\n\t}\n\treturn marks.list;\n}\n\nfunction markAtIndex(index: number, mark: Mark): Changeset {\n\treturn index === 0 ? [mark] : [{ count: index }, mark];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sequenceFieldEditor.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldEditor.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAK7D,6DAAuD;AAEvD,yCAAuC;AA6D1B,QAAA,mBAAmB,GAAG;IAClC,iBAAiB,EAAE,CAAC,OAAmC,EAAa,EAAE;QACrE,MAAM,SAAS,GAAc,EAAE,CAAC;QAChC,IAAI,YAAY,GAAG,CAAC,CAAC;QACrB,KAAK,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;YACvC,IAAA,iBAAM,EAAC,KAAK,IAAI,YAAY,EAAE,KAAK,CAAC,qCAAqC,CAAC,CAAC;YAC3E,IAAI,KAAK,GAAG,YAAY,EAAE,CAAC;gBAC1B,SAAS,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,GAA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AC;QAC1B,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC;AACnB,CAAC;AAED,SAAS,WAAW,CAAC,KAAa,EAAE,IAAU;IAC7C,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,CAAC,CAAC;AACxD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport type { ChangesetLocalId, RevisionTag } from \"../../core/index.js\";\nimport type { FieldEditor, NodeId } from \"../modular-schema/index.js\";\n\nimport { MarkListFactory } from \"./markListFactory.js\";\nimport type { Attach, CellId, CellMark, Changeset, Detach, Mark, MarkList } from \"./types.js\";\nimport { splitMark } from \"./utils.js\";\n\nexport interface SequenceFieldEditor extends FieldEditor<Changeset> {\n\tinsert(\n\t\tindex: number,\n\t\tcount: number,\n\t\tcellId: CellId,\n\t\trevision: RevisionTag,\n\t\tmoveId: ChangesetLocalId,\n\t): Changeset;\n\tremove(index: number, count: number, id: ChangesetLocalId, revision: RevisionTag): Changeset;\n\trevive(\n\t\tindex: number,\n\t\tcount: number,\n\t\tdetachEvent: CellId,\n\t\trevision: RevisionTag,\n\t\tisIntention?: true,\n\t): Changeset;\n\n\t/**\n\t *\n\t * @param sourceIndex - The index of the first node move\n\t * @param count - The number of nodes to move\n\t * @param destIndex - The index the nodes should be moved to, interpreted before detaching the moved nodes\n\t * @param detachCellId - The local ID to assign to the first cell being emptied by the move\n\t * @param attachCellId - The ID to assign to the first cell being filled by the move\n\t * @param revision - The revision to assign to the move marks\n\t */\n\tmove(\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestIndex: number,\n\t\tdetachCellId: ChangesetLocalId,\n\t\tattachCellId: CellId,\n\t\trevision: RevisionTag,\n\t): Changeset;\n\n\tmoveOut(\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tid: ChangesetLocalId,\n\t\trevision: RevisionTag,\n\t): Changeset;\n\tmoveIn(\n\t\tdestIndex: number,\n\t\tcount: number,\n\t\tmoveId: ChangesetLocalId,\n\t\tattachCellId: CellId,\n\t\trevision: RevisionTag,\n\t): Changeset;\n\n\treturn(\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestIndex: number,\n\t\tdetachCellId: CellId,\n\t\tattachCellId: CellId,\n\t\trevision: RevisionTag,\n\t): Changeset;\n}\n\nexport const sequenceFieldEditor = {\n\tbuildChildChanges: (changes: Iterable<[number, NodeId]>): Changeset => {\n\t\tconst changeset: Changeset = [];\n\t\tlet currentIndex = 0;\n\t\tfor (const [index, change] of changes) {\n\t\t\tassert(index >= currentIndex, 0xabe /* Child changes must be in order. */);\n\t\t\tif (index > currentIndex) {\n\t\t\t\tchangeset.push({ count: index - currentIndex });\n\t\t\t}\n\t\t\tchangeset.push({ count: 1, changes: change });\n\t\t\tcurrentIndex = index + 1;\n\t\t}\n\t\treturn changeset;\n\t},\n\tinsert: (\n\t\tindex: number,\n\t\tcount: number,\n\t\tcellId: CellId,\n\t\trevision: RevisionTag | undefined,\n\t\tmoveId: ChangesetLocalId,\n\t): Changeset => {\n\t\tconst mark: CellMark<Attach> = {\n\t\t\ttype: \"Insert\",\n\t\t\tid: moveId,\n\t\t\tcount,\n\t\t\tcellId,\n\t\t\trevision,\n\t\t};\n\t\treturn markAtIndex(index, mark);\n\t},\n\tremove: (\n\t\tindex: number,\n\t\tcount: number,\n\t\tid: ChangesetLocalId,\n\t\trevision: RevisionTag | undefined,\n\t): Changeset =>\n\t\tcount === 0 ? [] : markAtIndex(index, { type: \"Remove\", count, id, revision }),\n\n\trevive: (\n\t\tindex: number,\n\t\tcount: number,\n\t\tdetachEvent: CellId,\n\t\trevision: RevisionTag | undefined,\n\t): Changeset => {\n\t\tassert(detachEvent.revision !== undefined, 0x724 /* Detach event must have a revision */);\n\t\tconst mark: CellMark<Attach> = {\n\t\t\ttype: \"Insert\",\n\t\t\tid: detachEvent.localId,\n\t\t\tcount,\n\t\t\tcellId: detachEvent,\n\t\t\trevision,\n\t\t};\n\t\treturn count === 0 ? [] : markAtIndex(index, mark);\n\t},\n\n\tmove(\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestIndex: number,\n\t\tdetachCellId: ChangesetLocalId,\n\t\tattachCellId: CellId,\n\t\trevision: RevisionTag | undefined,\n\t): Changeset {\n\t\tconst moveIn: Mark = {\n\t\t\ttype: \"Insert\",\n\t\t\tid: detachCellId,\n\t\t\tcount,\n\t\t\tcellId: attachCellId,\n\t\t\trevision,\n\t\t};\n\t\tconst moveOut: Mark = {\n\t\t\ttype: \"Remove\",\n\t\t\tid: detachCellId,\n\t\t\tcount,\n\t\t\trevision,\n\t\t};\n\t\treturn moveMarksToMarkList(sourceIndex, count, destIndex, moveOut, moveIn);\n\t},\n\n\tmoveOut(\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdetachCellId: ChangesetLocalId,\n\t\trevision: RevisionTag,\n\t): Changeset {\n\t\tconst moveOut: Mark = {\n\t\t\ttype: \"Remove\",\n\t\t\tid: detachCellId,\n\t\t\tcount,\n\t\t\trevision,\n\t\t};\n\t\treturn markAtIndex(sourceIndex, moveOut);\n\t},\n\n\tmoveIn(\n\t\tdestIndex: number,\n\t\tcount: number,\n\t\tmoveId: ChangesetLocalId,\n\t\tattachCellId: CellId,\n\t\trevision: RevisionTag,\n\t): Changeset {\n\t\tconst moveIn: Mark = {\n\t\t\ttype: \"Insert\",\n\t\t\tid: moveId,\n\t\t\tcount,\n\t\t\tcellId: attachCellId,\n\t\t\trevision,\n\t\t};\n\t\treturn markAtIndex(destIndex, moveIn);\n\t},\n\n\treturn(\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestIndex: number,\n\t\tdetachCellId: CellId,\n\t\tattachCellId: CellId,\n\t\trevision: RevisionTag | undefined,\n\t): Changeset {\n\t\tconst moveOut: CellMark<Detach> = {\n\t\t\ttype: \"Remove\",\n\t\t\tid: attachCellId.localId,\n\t\t\tcellRename: detachCellId,\n\t\t\tcount,\n\t\t\trevision,\n\t\t};\n\n\t\tconst returnTo: CellMark<Attach> = {\n\t\t\ttype: \"Insert\",\n\t\t\tid: attachCellId.localId,\n\t\t\tcount,\n\t\t\tcellId: attachCellId,\n\t\t\trevision,\n\t\t};\n\n\t\treturn moveMarksToMarkList(sourceIndex, count, destIndex, moveOut, returnTo);\n\t},\n} satisfies SequenceFieldEditor;\n\nfunction moveMarksToMarkList(\n\tsourceIndex: number,\n\tcount: number,\n\tdestIndex: number,\n\tdetach: CellMark<Detach>,\n\tattach: CellMark<Attach>,\n): MarkList {\n\tif (count === 0) {\n\t\treturn [];\n\t}\n\tconst firstIndexBeyondMoveOut = sourceIndex + count;\n\tconst marks = new MarkListFactory();\n\tmarks.pushOffset(Math.min(sourceIndex, destIndex));\n\tif (destIndex <= sourceIndex) {\n\t\t// The destination is fully before the source\n\t\tmarks.pushContent(attach);\n\t\tmarks.pushOffset(sourceIndex - destIndex);\n\t\tmarks.pushContent(detach);\n\t} else if (firstIndexBeyondMoveOut <= destIndex) {\n\t\t// The destination is fully after the source\n\t\tmarks.pushContent(detach);\n\t\tmarks.pushOffset(destIndex - firstIndexBeyondMoveOut);\n\t\tmarks.pushContent(attach);\n\t} else {\n\t\tconst firstSectionLength = destIndex - sourceIndex;\n\t\t// The destination is in the middle of the source\n\t\tconst [detach1, detach2] = splitMark(detach, firstSectionLength);\n\t\tmarks.pushContent(detach1);\n\t\tmarks.pushContent(attach);\n\t\tmarks.pushContent(detach2);\n\t}\n\treturn marks.list;\n}\n\nfunction markAtIndex(index: number, mark: Mark): Changeset {\n\treturn index === 0 ? [mark] : [{ count: index }, mark];\n}\n"]}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import type {
|
|
5
|
+
import type { DeltaFieldChanges } from "../../core/index.js";
|
|
6
|
+
import type { ToDelta } from "../modular-schema/index.js";
|
|
6
7
|
import { type MarkList } from "./types.js";
|
|
7
|
-
export declare function sequenceFieldToDelta(change: MarkList, deltaFromChild: ToDelta):
|
|
8
|
+
export declare function sequenceFieldToDelta(change: MarkList, deltaFromChild: ToDelta): DeltaFieldChanges;
|
|
8
9
|
//# sourceMappingURL=sequenceFieldToDelta.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequenceFieldToDelta.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldToDelta.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"sequenceFieldToDelta.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldToDelta.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAa,MAAM,qBAAqB,CAAC;AAGxE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,KAAK,QAAQ,EAAgB,MAAM,YAAY,CAAC;AASzD,wBAAgB,oBAAoB,CACnC,MAAM,EAAE,QAAQ,EAChB,cAAc,EAAE,OAAO,GACrB,iBAAiB,CAiEnB"}
|