@fluidframework/tree 2.74.0-370705 → 2.80.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +1 -16
- package/.vscode/settings.json +2 -0
- package/CHANGELOG.md +29 -0
- package/api-report/tree.alpha.api.md +39 -17
- package/assertTagging.config.mjs +1 -1
- package/dist/alpha.d.ts +7 -0
- package/dist/codec/codec.d.ts +63 -20
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +50 -24
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/index.d.ts +2 -2
- package/dist/codec/index.d.ts.map +1 -1
- package/dist/codec/index.js +2 -2
- package/dist/codec/index.js.map +1 -1
- package/dist/codec/versioned/codec.d.ts +80 -22
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js +137 -15
- package/dist/codec/versioned/codec.js.map +1 -1
- package/dist/codec/versioned/index.d.ts +1 -1
- package/dist/codec/versioned/index.d.ts.map +1 -1
- package/dist/codec/versioned/index.js +2 -2
- package/dist/codec/versioned/index.js.map +1 -1
- package/dist/core/change-family/changeFamily.d.ts +1 -4
- 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 +5 -8
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/changeRebaser.d.ts +37 -8
- package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
- package/dist/core/rebase/changeRebaser.js.map +1 -1
- package/dist/core/rebase/index.d.ts +2 -2
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js +1 -3
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +27 -5
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +1 -16
- 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 +10 -28
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +4 -7
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +5 -5
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +3 -4
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts +1 -8
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +12 -65
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +18 -10
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.js +6 -6
- package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts +2 -3
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.js +4 -5
- package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.d.ts +2 -3
- package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.js +4 -6
- package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts +5 -6
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.js +11 -41
- package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +4 -4
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.js +2 -2
- package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/dist/core/tree/index.d.ts +2 -2
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js +4 -5
- package/dist/core/tree/index.js.map +1 -1
- package/dist/core/tree/mapTree.js +1 -1
- package/dist/core/tree/mapTree.js.map +1 -1
- package/dist/core/tree/pathTree.d.ts +3 -11
- package/dist/core/tree/pathTree.d.ts.map +1 -1
- package/dist/core/tree/pathTree.js +2 -14
- package/dist/core/tree/pathTree.js.map +1 -1
- package/dist/core/tree/sparseTree.d.ts.map +1 -1
- package/dist/core/tree/sparseTree.js +1 -0
- package/dist/core/tree/sparseTree.js.map +1 -1
- package/dist/core/tree/treeTextFormat.d.ts.map +1 -1
- package/dist/core/tree/treeTextFormat.js +5 -9
- package/dist/core/tree/treeTextFormat.js.map +1 -1
- package/dist/feature-libraries/changeAtomIdBTree.d.ts +10 -0
- package/dist/feature-libraries/changeAtomIdBTree.d.ts.map +1 -0
- package/dist/feature-libraries/changeAtomIdBTree.js +16 -0
- package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js +1 -8
- 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 +1 -4
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +6 -6
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +7 -4
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +19 -11
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +3 -3
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts +5 -5
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.js +4 -4
- package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +9 -5
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +54 -93
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +81 -245
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +6 -5
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +1 -2
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js +2 -5
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +8 -7
- package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js +6 -15
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
- package/dist/feature-libraries/deltaUtils.d.ts +0 -1
- package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
- package/dist/feature-libraries/deltaUtils.js +1 -6
- package/dist/feature-libraries/deltaUtils.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +0 -9
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +0 -6
- 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 +7 -8
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +16 -47
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts +8 -2
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js +13 -11
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -2
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +18 -9
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts +61 -0
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/{format.js → formatCommon.js} +9 -6
- package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -0
- package/dist/feature-libraries/forest-summary/{format.d.ts → formatV1.d.ts} +6 -14
- package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/formatV1.js +11 -0
- package/dist/feature-libraries/forest-summary/formatV1.js.map +1 -0
- package/dist/feature-libraries/forest-summary/formatV2.d.ts +51 -0
- package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/formatV2.js +11 -0
- package/dist/feature-libraries/forest-summary/formatV2.js.map +1 -0
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +7 -15
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +11 -20
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/dist/feature-libraries/forest-summary/index.d.ts +1 -2
- package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/index.js +3 -5
- package/dist/feature-libraries/forest-summary/index.js.map +1 -1
- package/dist/feature-libraries/forest-summary/summaryFormatCommon.d.ts +35 -0
- package/dist/feature-libraries/forest-summary/summaryFormatCommon.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatCommon.js +43 -0
- package/dist/feature-libraries/forest-summary/summaryFormatCommon.js.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts +11 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.js +14 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.js.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV3.d.ts +18 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV3.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV3.js +21 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV3.js.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.d.ts +7 -37
- package/dist/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/summaryTypes.js +23 -45
- package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +5 -4
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +10 -12
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.js +6 -6
- package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.js +0 -1
- package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.js +12 -3
- package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +13 -10
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +21 -97
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js +7 -4
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +25 -0
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js +59 -0
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -0
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +52 -20
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +13 -7
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +7 -5
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +7 -7
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +41 -9
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +263 -336
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +7 -9
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +8 -390
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +24 -11
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +27 -55
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +622 -1433
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +3 -4
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js +4 -4
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +14 -48
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +10 -21
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +18 -48
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js +3 -24
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -1
- package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +4 -4
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/optional-field/index.d.ts +2 -2
- package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/index.js +2 -1
- package/dist/feature-libraries/optional-field/index.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.d.ts +26 -5
- package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.js +447 -218
- package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +33 -24
- 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 +28 -57
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +15 -4
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts +7 -21
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +28 -70
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.d.ts +1 -1
- package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -1
- package/dist/feature-libraries/schema-index/index.d.ts +2 -2
- package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/index.js +2 -5
- package/dist/feature-libraries/schema-index/index.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +1 -9
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +1 -12
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/schemaChecker.js +11 -6
- package/dist/feature-libraries/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.d.ts +7 -6
- package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +264 -84
- package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
- package/dist/feature-libraries/sequence-field/helperTypes.d.ts +10 -14
- 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 +3 -2
- package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/index.js +3 -1
- 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 +169 -66
- 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 +56 -4
- package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/moveEffectTable.js +93 -8
- 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 +127 -113
- package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +9 -0
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -0
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +50 -0
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -0
- package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.js +49 -27
- 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 +2 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -22
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +187 -358
- 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 +62 -20
- 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 +2 -3
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +115 -17
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/dist/feature-libraries/sequence-field/types.d.ts +59 -30
- 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 +24 -15
- package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.js +334 -127
- package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.js +7 -7
- package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
- package/dist/feature-libraries/treeTextCursor.js +2 -2
- package/dist/feature-libraries/treeTextCursor.js.map +1 -1
- package/dist/feature-libraries/valueUtilities.d.ts.map +1 -1
- package/dist/feature-libraries/valueUtilities.js +16 -8
- package/dist/feature-libraries/valueUtilities.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +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 +1 -2
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +9 -5
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +56 -41
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +3 -9
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +57 -50
- 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 +11 -11
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js +5 -3
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +7 -6
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +23 -24
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts +6 -16
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js +7 -14
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +35 -29
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +21 -23
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +17 -12
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +85 -66
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +5 -4
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +7 -6
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.js +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts +2 -2
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +10 -10
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts +0 -4
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +13 -16
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +9 -44
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +8 -8
- 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 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +3 -3
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +3 -2
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +2 -3
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js +2 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts +0 -4
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +15 -19
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +10 -50
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormat.js +9 -8
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +2 -2
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts +1 -1
- package/dist/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
- package/dist/shared-tree-core/sequenceIdUtils.js +4 -4
- package/dist/shared-tree-core/sequenceIdUtils.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +0 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +13 -9
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts +25 -8
- package/dist/shared-tree-core/transaction.d.ts.map +1 -1
- package/dist/shared-tree-core/transaction.js +65 -30
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.d.ts +2 -2
- package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.js +3 -3
- package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
- package/dist/shared-tree-core/versionedSummarizer.d.ts +6 -1
- package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/versionedSummarizer.js +4 -3
- package/dist/shared-tree-core/versionedSummarizer.js.map +1 -1
- package/dist/simple-tree/api/configuration.js +1 -1
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/customTree.d.ts.map +1 -1
- package/dist/simple-tree/api/customTree.js +13 -9
- package/dist/simple-tree/api/customTree.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/dist/simple-tree/api/discrepancies.js +21 -17
- package/dist/simple-tree/api/discrepancies.js.map +1 -1
- package/dist/simple-tree/api/eraseSchemaDetails.d.ts +89 -0
- package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -0
- package/dist/simple-tree/api/eraseSchemaDetails.js +97 -0
- package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -0
- package/dist/simple-tree/api/index.d.ts +2 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +5 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +12 -8
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +18 -9
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.js +10 -5
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +15 -11
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.js +10 -10
- package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +3 -5
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/transactionTypes.d.ts +17 -4
- package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/transactionTypes.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +15 -2
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +21 -13
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +14 -9
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNode.js +1 -0
- package/dist/simple-tree/core/treeNode.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +6 -3
- 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 +28 -74
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/createContext.d.ts.map +1 -1
- package/dist/simple-tree/createContext.js +1 -1
- package/dist/simple-tree/createContext.js.map +1 -1
- package/dist/simple-tree/fieldSchema.d.ts +4 -4
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/fieldSchema.js.map +1 -1
- package/dist/simple-tree/getTreeNodeForField.d.ts.map +1 -1
- package/dist/simple-tree/getTreeNodeForField.js +2 -1
- package/dist/simple-tree/getTreeNodeForField.js.map +1 -1
- package/dist/simple-tree/index.d.ts +3 -3
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +5 -3
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +9 -6
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +18 -20
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/common.js +1 -1
- package/dist/simple-tree/node-kinds/common.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +2 -2
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +21 -22
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.js +4 -7
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/prepareForInsertion.d.ts +47 -54
- package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/dist/simple-tree/prepareForInsertion.js +125 -183
- package/dist/simple-tree/prepareForInsertion.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +12 -8
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +4 -13
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +11 -29
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/dist/tableSchema.d.ts +3 -14
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +2 -2
- package/dist/tableSchema.js.map +1 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +2 -12
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/bTreeUtils.js +1 -1
- package/dist/util/bTreeUtils.js.map +1 -1
- package/dist/util/brand.d.ts +49 -0
- package/dist/util/brand.d.ts.map +1 -1
- package/dist/util/brand.js +47 -1
- package/dist/util/brand.js.map +1 -1
- package/dist/util/breakable.js +7 -9
- package/dist/util/breakable.js.map +1 -1
- package/dist/util/idAllocator.d.ts.map +1 -1
- package/dist/util/idAllocator.js +1 -2
- package/dist/util/idAllocator.js.map +1 -1
- package/dist/util/index.d.ts +2 -2
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +4 -3
- package/dist/util/index.js.map +1 -1
- package/dist/util/nestedMap.d.ts.map +1 -1
- package/dist/util/nestedMap.js +1 -1
- package/dist/util/nestedMap.js.map +1 -1
- package/dist/util/rangeMap.d.ts +12 -24
- package/dist/util/rangeMap.d.ts.map +1 -1
- package/dist/util/rangeMap.js +6 -46
- package/dist/util/rangeMap.js.map +1 -1
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +16 -15
- package/dist/util/utils.js.map +1 -1
- package/docs/main/sequence-field/move-composition.md +46 -0
- package/eslint.config.mts +83 -0
- package/lib/alpha.d.ts +7 -0
- package/lib/codec/codec.d.ts +63 -20
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +44 -18
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/index.d.ts +2 -2
- package/lib/codec/index.d.ts.map +1 -1
- package/lib/codec/index.js +1 -1
- package/lib/codec/index.js.map +1 -1
- package/lib/codec/versioned/codec.d.ts +80 -22
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js +138 -15
- package/lib/codec/versioned/codec.js.map +1 -1
- package/lib/codec/versioned/index.d.ts +1 -1
- package/lib/codec/versioned/index.d.ts.map +1 -1
- package/lib/codec/versioned/index.js +1 -1
- package/lib/codec/versioned/index.js.map +1 -1
- package/lib/core/change-family/changeFamily.d.ts +1 -4
- 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 +37 -8
- package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
- package/lib/core/rebase/changeRebaser.js.map +1 -1
- package/lib/core/rebase/index.d.ts +2 -2
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +27 -5
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +0 -13
- 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 +10 -28
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +4 -7
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +6 -6
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +3 -4
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts +1 -8
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +14 -67
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +18 -10
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.js +4 -4
- package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts +2 -3
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.js +4 -5
- package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV2.d.ts +2 -3
- package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV2.js +4 -6
- package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts +5 -6
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.js +12 -39
- package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +4 -4
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.js +3 -3
- package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/lib/core/tree/index.d.ts +2 -2
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +2 -2
- package/lib/core/tree/index.js.map +1 -1
- package/lib/core/tree/mapTree.js +1 -1
- package/lib/core/tree/mapTree.js.map +1 -1
- package/lib/core/tree/pathTree.d.ts +3 -11
- package/lib/core/tree/pathTree.d.ts.map +1 -1
- package/lib/core/tree/pathTree.js +1 -12
- package/lib/core/tree/pathTree.js.map +1 -1
- package/lib/core/tree/sparseTree.d.ts.map +1 -1
- package/lib/core/tree/sparseTree.js +1 -0
- package/lib/core/tree/sparseTree.js.map +1 -1
- package/lib/core/tree/treeTextFormat.d.ts.map +1 -1
- package/lib/core/tree/treeTextFormat.js +5 -9
- package/lib/core/tree/treeTextFormat.js.map +1 -1
- package/lib/feature-libraries/changeAtomIdBTree.d.ts +10 -0
- package/lib/feature-libraries/changeAtomIdBTree.d.ts.map +1 -0
- package/lib/feature-libraries/changeAtomIdBTree.js +11 -0
- package/lib/feature-libraries/changeAtomIdBTree.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js +2 -9
- 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 +1 -4
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +6 -6
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +7 -4
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +20 -12
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +3 -3
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts +5 -5
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.js +5 -5
- package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +9 -5
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +54 -93
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +82 -243
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +6 -5
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +1 -2
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js +1 -2
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +8 -7
- package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js +6 -15
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
- package/lib/feature-libraries/deltaUtils.d.ts +0 -1
- package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
- package/lib/feature-libraries/deltaUtils.js +1 -5
- package/lib/feature-libraries/deltaUtils.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +0 -9
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +0 -6
- 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 +7 -8
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +17 -48
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts +8 -2
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js +12 -11
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -2
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +19 -10
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts +61 -0
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/{format.js → formatCommon.js} +8 -6
- package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -0
- package/lib/feature-libraries/forest-summary/{format.d.ts → formatV1.d.ts} +6 -14
- package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/formatV1.js +8 -0
- package/lib/feature-libraries/forest-summary/formatV1.js.map +1 -0
- package/lib/feature-libraries/forest-summary/formatV2.d.ts +51 -0
- package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/formatV2.js +8 -0
- package/lib/feature-libraries/forest-summary/formatV2.js.map +1 -0
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +7 -15
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +11 -20
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/lib/feature-libraries/forest-summary/index.d.ts +1 -2
- package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/index.js +1 -2
- package/lib/feature-libraries/forest-summary/index.js.map +1 -1
- package/lib/feature-libraries/forest-summary/summaryFormatCommon.d.ts +35 -0
- package/lib/feature-libraries/forest-summary/summaryFormatCommon.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatCommon.js +40 -0
- package/lib/feature-libraries/forest-summary/summaryFormatCommon.js.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts +11 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.js +11 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.js.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV3.d.ts +18 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV3.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV3.js +18 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV3.js.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.d.ts +7 -37
- package/lib/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/summaryTypes.js +20 -43
- package/lib/feature-libraries/forest-summary/summaryTypes.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +5 -4
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +5 -4
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.js +6 -6
- package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.js +1 -2
- package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.js +12 -3
- package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +13 -10
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +21 -97
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js +5 -3
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +25 -0
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js +55 -0
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -0
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +52 -20
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +14 -8
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +7 -5
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +5 -4
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +41 -9
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +248 -334
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +7 -9
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +10 -392
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +24 -11
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +27 -55
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +549 -1352
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +3 -4
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +14 -48
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +10 -21
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +18 -48
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.js +2 -20
- package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -1
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +4 -4
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/optional-field/index.d.ts +2 -2
- package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/index.js +1 -1
- package/lib/feature-libraries/optional-field/index.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.d.ts +26 -5
- package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.js +445 -218
- package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +33 -24
- 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 +26 -55
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +16 -5
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts +7 -21
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +29 -67
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.d.ts +1 -1
- package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -1
- package/lib/feature-libraries/schema-index/index.d.ts +2 -2
- package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/index.js +2 -2
- package/lib/feature-libraries/schema-index/index.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +1 -9
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +0 -10
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/schemaChecker.js +11 -6
- package/lib/feature-libraries/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.d.ts +7 -6
- package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +266 -86
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/helperTypes.d.ts +10 -14
- 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 +3 -2
- package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/index.js +1 -0
- 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 +171 -68
- 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 +56 -4
- package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/moveEffectTable.js +87 -7
- 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 +129 -115
- package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +9 -0
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -0
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js +46 -0
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -0
- package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.js +50 -28
- 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 +2 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -22
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +183 -350
- 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 +63 -21
- 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 +2 -3
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +115 -17
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/lib/feature-libraries/sequence-field/types.d.ts +59 -30
- 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 +24 -15
- package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.js +327 -123
- package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.js +7 -7
- package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
- package/lib/feature-libraries/treeTextCursor.js +2 -2
- package/lib/feature-libraries/treeTextCursor.js.map +1 -1
- package/lib/feature-libraries/valueUtilities.d.ts.map +1 -1
- package/lib/feature-libraries/valueUtilities.js +16 -8
- package/lib/feature-libraries/valueUtilities.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.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.map +1 -1
- package/lib/shared-tree/independentView.js +2 -2
- 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 +2 -3
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +9 -5
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +59 -44
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +3 -9
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +26 -19
- 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 +11 -11
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js +6 -4
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +7 -6
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +24 -25
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts +6 -16
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js +6 -12
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +35 -29
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +21 -23
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +17 -12
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +89 -70
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +5 -4
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +7 -6
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.js +2 -2
- package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts +2 -2
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +10 -10
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts +0 -4
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +13 -15
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +9 -44
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +9 -9
- 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 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +3 -3
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +3 -2
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +2 -2
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.js +2 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts +0 -4
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +15 -18
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +10 -50
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormat.js +9 -8
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +2 -2
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts +1 -1
- package/lib/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
- package/lib/shared-tree-core/sequenceIdUtils.js +4 -4
- package/lib/shared-tree-core/sequenceIdUtils.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +0 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +13 -9
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts +25 -8
- package/lib/shared-tree-core/transaction.d.ts.map +1 -1
- package/lib/shared-tree-core/transaction.js +67 -32
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.d.ts +2 -2
- package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.js +3 -3
- package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
- package/lib/shared-tree-core/versionedSummarizer.d.ts +6 -1
- package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/versionedSummarizer.js +4 -3
- package/lib/shared-tree-core/versionedSummarizer.js.map +1 -1
- package/lib/simple-tree/api/configuration.js +1 -1
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/customTree.d.ts.map +1 -1
- package/lib/simple-tree/api/customTree.js +13 -9
- package/lib/simple-tree/api/customTree.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/lib/simple-tree/api/discrepancies.js +21 -17
- package/lib/simple-tree/api/discrepancies.js.map +1 -1
- package/lib/simple-tree/api/eraseSchemaDetails.d.ts +89 -0
- package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -0
- package/lib/simple-tree/api/eraseSchemaDetails.js +92 -0
- package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -0
- package/lib/simple-tree/api/index.d.ts +2 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -0
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +12 -8
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +18 -9
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaCodec.js +10 -5
- package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +15 -11
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/simpleTreeIndex.js +10 -10
- package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +5 -9
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/transactionTypes.d.ts +17 -4
- package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/transactionTypes.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +15 -2
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +21 -13
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +14 -9
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNode.js +1 -0
- package/lib/simple-tree/core/treeNode.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +6 -3
- 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 +28 -73
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/createContext.d.ts.map +1 -1
- package/lib/simple-tree/createContext.js +1 -1
- package/lib/simple-tree/createContext.js.map +1 -1
- package/lib/simple-tree/fieldSchema.d.ts +4 -4
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/fieldSchema.js.map +1 -1
- package/lib/simple-tree/getTreeNodeForField.d.ts.map +1 -1
- package/lib/simple-tree/getTreeNodeForField.js +2 -1
- package/lib/simple-tree/getTreeNodeForField.js.map +1 -1
- package/lib/simple-tree/index.d.ts +3 -3
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +2 -2
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +9 -6
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +19 -21
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/common.js +2 -2
- package/lib/simple-tree/node-kinds/common.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +22 -23
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.js +4 -7
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/prepareForInsertion.d.ts +47 -54
- package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/lib/simple-tree/prepareForInsertion.js +124 -183
- package/lib/simple-tree/prepareForInsertion.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +12 -8
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +4 -13
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +9 -26
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/lib/tableSchema.d.ts +3 -14
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +3 -3
- package/lib/tableSchema.js.map +1 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +3 -13
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/bTreeUtils.js +1 -1
- package/lib/util/bTreeUtils.js.map +1 -1
- package/lib/util/brand.d.ts +49 -0
- package/lib/util/brand.d.ts.map +1 -1
- package/lib/util/brand.js +44 -0
- package/lib/util/brand.js.map +1 -1
- package/lib/util/breakable.js +7 -9
- package/lib/util/breakable.js.map +1 -1
- package/lib/util/idAllocator.d.ts.map +1 -1
- package/lib/util/idAllocator.js +1 -2
- package/lib/util/idAllocator.js.map +1 -1
- package/lib/util/index.d.ts +2 -2
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -2
- package/lib/util/index.js.map +1 -1
- package/lib/util/nestedMap.d.ts.map +1 -1
- package/lib/util/nestedMap.js +1 -1
- package/lib/util/nestedMap.js.map +1 -1
- package/lib/util/rangeMap.d.ts +12 -24
- package/lib/util/rangeMap.d.ts.map +1 -1
- package/lib/util/rangeMap.js +5 -44
- package/lib/util/rangeMap.js.map +1 -1
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js +16 -15
- package/lib/util/utils.js.map +1 -1
- package/package.json +33 -32
- package/src/codec/codec.ts +82 -26
- package/src/codec/index.ts +4 -1
- package/src/codec/versioned/codec.ts +340 -22
- package/src/codec/versioned/index.ts +3 -1
- package/src/core/change-family/changeFamily.ts +0 -5
- package/src/core/change-family/index.ts +0 -1
- package/src/core/index.ts +4 -6
- package/src/core/rebase/changeRebaser.ts +41 -12
- package/src/core/rebase/index.ts +2 -2
- package/src/core/rebase/types.ts +32 -26
- package/src/core/rebase/utils.ts +10 -34
- package/src/core/schema-stored/schema.ts +8 -10
- package/src/core/tree/anchorSet.ts +3 -4
- package/src/core/tree/detachedFieldIndex.ts +14 -91
- package/src/core/tree/detachedFieldIndexCodecCommon.ts +4 -8
- package/src/core/tree/detachedFieldIndexCodecV1.ts +3 -7
- package/src/core/tree/detachedFieldIndexCodecV2.ts +5 -9
- package/src/core/tree/detachedFieldIndexCodecs.ts +21 -64
- package/src/core/tree/detachedFieldIndexFormatCommon.ts +4 -7
- package/src/core/tree/index.ts +2 -3
- package/src/core/tree/mapTree.ts +1 -1
- package/src/core/tree/pathTree.ts +4 -16
- package/src/core/tree/sparseTree.ts +1 -0
- package/src/core/tree/treeTextFormat.ts +5 -9
- package/src/feature-libraries/changeAtomIdBTree.ts +24 -0
- package/src/feature-libraries/chunked-forest/basicChunk.ts +2 -8
- package/src/feature-libraries/chunked-forest/chunkTree.ts +1 -6
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +5 -5
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +7 -4
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +20 -11
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +3 -3
- package/src/feature-libraries/chunked-forest/codec/format.ts +6 -9
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -5
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +1 -1
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +163 -403
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +9 -7
- package/src/feature-libraries/default-schema/index.ts +5 -17
- package/src/feature-libraries/default-schema/mappedEditBuilder.ts +15 -35
- package/src/feature-libraries/deltaUtils.ts +1 -6
- package/src/feature-libraries/flex-tree/context.ts +0 -17
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +8 -7
- package/src/feature-libraries/flex-tree/lazyField.ts +31 -74
- package/src/feature-libraries/forest-summary/codec.ts +25 -13
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +37 -12
- package/src/feature-libraries/forest-summary/{format.ts → formatCommon.ts} +10 -11
- package/src/feature-libraries/forest-summary/formatV1.ts +12 -0
- package/src/feature-libraries/forest-summary/formatV2.ts +12 -0
- package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +18 -21
- package/src/feature-libraries/forest-summary/index.ts +1 -2
- package/src/feature-libraries/forest-summary/summaryFormatCommon.ts +41 -0
- package/src/feature-libraries/forest-summary/summaryFormatV1ToV2.ts +11 -0
- package/src/feature-libraries/forest-summary/summaryFormatV3.ts +18 -0
- package/src/feature-libraries/forest-summary/summaryTypes.ts +26 -46
- package/src/feature-libraries/index.ts +18 -27
- package/src/feature-libraries/indexing/anchorTreeIndex.ts +5 -5
- package/src/feature-libraries/mapTreeCursor.ts +1 -2
- package/src/feature-libraries/mitigatedChangeFamily.ts +12 -9
- package/src/feature-libraries/modular-schema/comparison.ts +14 -10
- package/src/feature-libraries/modular-schema/crossFieldQueries.ts +44 -142
- package/src/feature-libraries/modular-schema/defaultRevisionReplacer.ts +70 -0
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +58 -40
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +23 -13
- package/src/feature-libraries/modular-schema/index.ts +18 -21
- package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +543 -572
- package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +44 -745
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +37 -51
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +862 -2636
- package/src/feature-libraries/modular-schema/modularChangeFormatV1.ts +3 -4
- package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +17 -45
- package/src/feature-libraries/modular-schema/modularChangeTypes.ts +18 -97
- package/src/feature-libraries/node-identifier/mockNodeIdentifierManager.ts +1 -1
- package/src/feature-libraries/object-forest/objectForest.ts +4 -4
- package/src/feature-libraries/optional-field/index.ts +3 -1
- package/src/feature-libraries/optional-field/optionalField.ts +566 -321
- package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +38 -24
- package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +35 -89
- package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +1 -5
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +19 -5
- package/src/feature-libraries/schema-index/codec.ts +30 -92
- package/src/feature-libraries/schema-index/index.ts +2 -4
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +0 -17
- package/src/feature-libraries/schemaChecker.ts +11 -6
- package/src/feature-libraries/sequence-field/compose.ts +527 -138
- package/src/feature-libraries/sequence-field/helperTypes.ts +19 -34
- package/src/feature-libraries/sequence-field/index.ts +9 -0
- package/src/feature-libraries/sequence-field/invert.ts +229 -103
- package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
- package/src/feature-libraries/sequence-field/moveEffectTable.ts +198 -9
- package/src/feature-libraries/sequence-field/rebase.ts +218 -175
- package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +57 -0
- package/src/feature-libraries/sequence-field/replaceRevisions.ts +76 -59
- package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +2 -0
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +228 -643
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +70 -56
- package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +27 -25
- package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +135 -22
- package/src/feature-libraries/sequence-field/types.ts +64 -34
- package/src/feature-libraries/sequence-field/utils.ts +382 -150
- package/src/feature-libraries/treeCursorUtils.ts +7 -7
- package/src/feature-libraries/treeTextCursor.ts +2 -2
- package/src/feature-libraries/valueUtilities.ts +16 -8
- package/src/index.ts +7 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +1 -2
- package/src/shared-tree/index.ts +2 -3
- package/src/shared-tree/schematizeTree.ts +8 -21
- package/src/shared-tree/schematizingTreeView.ts +96 -63
- package/src/shared-tree/sharedTree.ts +29 -29
- package/src/shared-tree/sharedTreeChangeCodecs.ts +12 -15
- package/src/shared-tree/sharedTreeChangeEnricher.ts +4 -4
- package/src/shared-tree/sharedTreeChangeFamily.ts +34 -34
- package/src/shared-tree/sharedTreeEditBuilder.ts +9 -39
- package/src/shared-tree/treeAlpha.ts +60 -51
- package/src/shared-tree/treeCheckout.ts +158 -132
- package/src/shared-tree-core/branch.ts +10 -11
- package/src/shared-tree-core/branchCommitEnricher.ts +3 -8
- package/src/shared-tree-core/editManager.ts +3 -17
- package/src/shared-tree-core/editManagerCodecs.ts +13 -18
- package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +1 -1
- package/src/shared-tree-core/editManagerFormatCommons.ts +12 -15
- package/src/shared-tree-core/editManagerFormatV1toV4.ts +2 -2
- package/src/shared-tree-core/editManagerSummarizer.ts +3 -3
- package/src/shared-tree-core/index.ts +3 -2
- package/src/shared-tree-core/messageCodecV1ToV4.ts +1 -1
- package/src/shared-tree-core/messageCodecVSharedBranches.ts +2 -1
- package/src/shared-tree-core/messageCodecs.ts +15 -21
- package/src/shared-tree-core/messageFormat.ts +12 -15
- package/src/shared-tree-core/messageFormatV1ToV4.ts +2 -2
- package/src/shared-tree-core/sequenceIdUtils.ts +4 -4
- package/src/shared-tree-core/sharedTreeCore.ts +12 -11
- package/src/shared-tree-core/transaction.ts +115 -56
- package/src/shared-tree-core/transactionEnricher.ts +5 -6
- package/src/shared-tree-core/versionedSummarizer.ts +10 -3
- package/src/simple-tree/api/configuration.ts +1 -1
- package/src/simple-tree/api/customTree.ts +14 -10
- package/src/simple-tree/api/discrepancies.ts +23 -17
- package/src/simple-tree/api/eraseSchemaDetails.ts +123 -0
- package/src/simple-tree/api/index.ts +6 -0
- package/src/simple-tree/api/schemaFactory.ts +11 -7
- package/src/simple-tree/api/schemaFromSimple.ts +18 -9
- package/src/simple-tree/api/simpleSchemaCodec.ts +10 -5
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +17 -13
- package/src/simple-tree/api/simpleTreeIndex.ts +8 -8
- package/src/simple-tree/api/storedSchema.ts +12 -9
- package/src/simple-tree/api/transactionTypes.ts +19 -4
- package/src/simple-tree/api/tree.ts +16 -1
- package/src/simple-tree/api/treeNodeApi.ts +21 -13
- package/src/simple-tree/api/verboseTree.ts +14 -9
- package/src/simple-tree/core/treeNode.ts +1 -0
- package/src/simple-tree/core/treeNodeKernel.ts +6 -3
- package/src/simple-tree/core/unhydratedFlexTree.ts +58 -104
- package/src/simple-tree/createContext.ts +4 -1
- package/src/simple-tree/fieldSchema.ts +4 -6
- package/src/simple-tree/getTreeNodeForField.ts +2 -1
- package/src/simple-tree/index.ts +5 -2
- package/src/simple-tree/leafNodeSchema.ts +8 -5
- package/src/simple-tree/node-kinds/array/arrayNode.ts +28 -30
- package/src/simple-tree/node-kinds/common.ts +5 -2
- package/src/simple-tree/node-kinds/map/mapNode.ts +4 -4
- package/src/simple-tree/node-kinds/object/objectNode.ts +28 -29
- package/src/simple-tree/node-kinds/record/recordNode.ts +11 -13
- package/src/simple-tree/prepareForInsertion.ts +200 -343
- package/src/simple-tree/toStoredSchema.ts +12 -8
- package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +14 -42
- package/src/tableSchema.ts +13 -18
- package/src/treeFactory.ts +5 -14
- package/src/util/bTreeUtils.ts +1 -1
- package/src/util/brand.ts +61 -0
- package/src/util/breakable.ts +9 -9
- package/src/util/idAllocator.ts +1 -2
- package/src/util/index.ts +3 -3
- package/src/util/nestedMap.ts +1 -3
- package/src/util/rangeMap.ts +18 -72
- package/src/util/utils.ts +14 -13
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +0 -36
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +0 -1
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js +0 -126
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js.map +0 -1
- package/dist/feature-libraries/forest-summary/format.d.ts.map +0 -1
- package/dist/feature-libraries/forest-summary/format.js.map +0 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +0 -23
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +0 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +0 -31
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +0 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +0 -12
- package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +0 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js +0 -57
- package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js.map +0 -1
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +0 -36
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +0 -1
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js +0 -122
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js.map +0 -1
- package/lib/feature-libraries/forest-summary/format.d.ts.map +0 -1
- package/lib/feature-libraries/forest-summary/format.js.map +0 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +0 -23
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +0 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +0 -27
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +0 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +0 -12
- package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +0 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js +0 -53
- package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js.map +0 -1
- package/src/feature-libraries/default-schema/locationBasedEditBuilder.ts +0 -180
- package/src/feature-libraries/optional-field/optionalFieldChangeFormatV3.ts +0 -45
- package/src/feature-libraries/optional-field/optionalFieldCodecV3.ts +0 -94
|
@@ -4,28 +4,24 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { DiscriminatedUnionLibrary, IJsonCodec } from "../../codec/index.js";
|
|
6
6
|
import type { ChangeAtomId, ChangeEncodingContext, EncodedRevisionTag, RevisionTag } from "../../core/index.js";
|
|
7
|
-
import type { EncodedChangeAtomId
|
|
8
|
-
import type {
|
|
9
|
-
import type { Attach, CellId, CellMark, Detach, HasMarkFields, Mark, MarkEffect } from "./types.js";
|
|
7
|
+
import type { EncodedChangeAtomId } from "../modular-schema/index.js";
|
|
8
|
+
import type { AttachAndDetach, CellId, CellMark, Detach, HasMarkFields, Mark, MoveIn, MoveOut } from "./types.js";
|
|
10
9
|
export type EmptyInputCellMark = Mark & DetachedCellMark;
|
|
11
10
|
export interface DetachedCellMark extends HasMarkFields {
|
|
12
11
|
cellId: CellId;
|
|
13
12
|
}
|
|
14
|
-
export type EmptyOutputCellMark = CellMark<Detach>;
|
|
15
|
-
export type MoveMarkEffect =
|
|
13
|
+
export type EmptyOutputCellMark = CellMark<Detach | AttachAndDetach>;
|
|
14
|
+
export type MoveMarkEffect = MoveOut | MoveIn;
|
|
16
15
|
export type DetachOfRemovedNodes = Detach & {
|
|
17
16
|
cellId: CellId;
|
|
18
17
|
};
|
|
19
|
-
export type CellRename = DetachOfRemovedNodes;
|
|
20
|
-
export interface SequenceCodecHelpers {
|
|
18
|
+
export type CellRename = AttachAndDetach | DetachOfRemovedNodes;
|
|
19
|
+
export interface SequenceCodecHelpers<TDecodedMarkEffect, TEncodedMarkEffect extends object> {
|
|
21
20
|
readonly changeAtomIdCodec: IJsonCodec<ChangeAtomId, EncodedChangeAtomId, EncodedChangeAtomId, ChangeEncodingContext>;
|
|
22
|
-
readonly
|
|
23
|
-
readonly
|
|
21
|
+
readonly markEffectCodec: IJsonCodec<TDecodedMarkEffect, TEncodedMarkEffect, TEncodedMarkEffect, ChangeEncodingContext>;
|
|
22
|
+
readonly decoderLibrary: DiscriminatedUnionLibrary<TEncodedMarkEffect, [
|
|
23
|
+
context: ChangeEncodingContext
|
|
24
|
+
], TDecodedMarkEffect>;
|
|
24
25
|
readonly decodeRevision: (encodedRevision: EncodedRevisionTag | undefined, context: ChangeEncodingContext) => RevisionTag;
|
|
25
|
-
readonly decoderLibrary: DiscriminatedUnionLibrary<Encoded.MarkEffect, [
|
|
26
|
-
count: number,
|
|
27
|
-
cellId: ChangeAtomId | undefined,
|
|
28
|
-
context: FieldChangeEncodingContext
|
|
29
|
-
], MarkEffect>;
|
|
30
26
|
}
|
|
31
27
|
//# sourceMappingURL=helperTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helperTypes.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/helperTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,KAAK,EACX,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"helperTypes.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/helperTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,KAAK,EACX,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,KAAK,EACX,eAAe,EACf,MAAM,EACN,QAAQ,EACR,MAAM,EACN,aAAa,EACb,IAAI,EACJ,MAAM,EACN,OAAO,EACP,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG,gBAAgB,CAAC;AAEzD,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACtD,MAAM,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,GAAG,eAAe,CAAC,CAAC;AAErE,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,CAAC;AAC9C,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAC/D,MAAM,MAAM,UAAU,GAAG,eAAe,GAAG,oBAAoB,CAAC;AAEhE,MAAM,WAAW,oBAAoB,CAAC,kBAAkB,EAAE,kBAAkB,SAAS,MAAM;IAC1F,QAAQ,CAAC,iBAAiB,EAAE,UAAU,CACrC,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,CACrB,CAAC;IACF,QAAQ,CAAC,eAAe,EAAE,UAAU,CACnC,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,CAAC;IACF,QAAQ,CAAC,cAAc,EAAE,yBAAyB,CACjD,kBAAkB,EACP;QAAC,OAAO,EAAE,qBAAqB;KAAC,EAC3C,kBAAkB,CAClB,CAAC;IACF,QAAQ,CAAC,cAAc,EAAE,CACxB,eAAe,EAAE,kBAAkB,GAAG,SAAS,EAC/C,OAAO,EAAE,qBAAqB,KAC1B,WAAW,CAAC;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helperTypes.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/helperTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { DiscriminatedUnionLibrary, IJsonCodec } from \"../../codec/index.js\";\nimport type {\n\tChangeAtomId,\n\tChangeEncodingContext,\n\tEncodedRevisionTag,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport type {
|
|
1
|
+
{"version":3,"file":"helperTypes.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/helperTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { DiscriminatedUnionLibrary, IJsonCodec } from \"../../codec/index.js\";\nimport type {\n\tChangeAtomId,\n\tChangeEncodingContext,\n\tEncodedRevisionTag,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport type { EncodedChangeAtomId } from \"../modular-schema/index.js\";\n\nimport type {\n\tAttachAndDetach,\n\tCellId,\n\tCellMark,\n\tDetach,\n\tHasMarkFields,\n\tMark,\n\tMoveIn,\n\tMoveOut,\n} from \"./types.js\";\n\nexport type EmptyInputCellMark = Mark & DetachedCellMark;\n\nexport interface DetachedCellMark extends HasMarkFields {\n\tcellId: CellId;\n}\n\nexport type EmptyOutputCellMark = CellMark<Detach | AttachAndDetach>;\n\nexport type MoveMarkEffect = MoveOut | MoveIn;\nexport type DetachOfRemovedNodes = Detach & { cellId: CellId };\nexport type CellRename = AttachAndDetach | DetachOfRemovedNodes;\n\nexport interface SequenceCodecHelpers<TDecodedMarkEffect, TEncodedMarkEffect extends object> {\n\treadonly changeAtomIdCodec: IJsonCodec<\n\t\tChangeAtomId,\n\t\tEncodedChangeAtomId,\n\t\tEncodedChangeAtomId,\n\t\tChangeEncodingContext\n\t>;\n\treadonly markEffectCodec: IJsonCodec<\n\t\tTDecodedMarkEffect,\n\t\tTEncodedMarkEffect,\n\t\tTEncodedMarkEffect,\n\t\tChangeEncodingContext\n\t>;\n\treadonly decoderLibrary: DiscriminatedUnionLibrary<\n\t\tTEncodedMarkEffect,\n\t\t/* args */ [context: ChangeEncodingContext],\n\t\tTDecodedMarkEffect\n\t>;\n\treadonly decodeRevision: (\n\t\tencodedRevision: EncodedRevisionTag | undefined,\n\t\tcontext: ChangeEncodingContext,\n\t) => RevisionTag;\n}\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export type { Changeset, Detach, HasMoveId, HasRevisionTag, Mark, MarkList, CellCount as NodeCount, MoveId, Attach, NoopMark, CellId, HasMarkFields, CellMark, Rename, } from "./types.js";
|
|
5
|
+
export type { Changeset, Remove, Detach, HasMoveId, HasRevisionTag, Insert, Mark, MarkList, MoveIn, MoveOut, CellCount as NodeCount, MoveId, Attach, NoopMark, CellId, HasMarkFields, CellMark, AttachAndDetach, Rename, } from "./types.js";
|
|
6
6
|
export { DetachIdOverrideType } from "./formatV1.js";
|
|
7
7
|
export { type SequenceFieldChangeHandler, sequenceFieldChangeHandler, } from "./sequenceFieldChangeHandler.js";
|
|
8
8
|
export { type SequenceChangeRebaser, sequenceFieldChangeRebaser, } from "./sequenceFieldChangeRebaser.js";
|
|
@@ -14,5 +14,6 @@ export { rebase } from "./rebase.js";
|
|
|
14
14
|
export { invert } from "./invert.js";
|
|
15
15
|
export { compose } from "./compose.js";
|
|
16
16
|
export { getInputLength, isDetach, cloneMark, extractMarkEffect, } from "./utils.js";
|
|
17
|
-
export { isMoveMark, type MoveMark, } from "./moveEffectTable.js";
|
|
17
|
+
export { isMoveMark, type MoveMark, type MoveEffectTable, type MoveEffect, } from "./moveEffectTable.js";
|
|
18
|
+
export { relevantRemovedRoots } from "./relevantRemovedRoots.js";
|
|
18
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,SAAS,EACT,MAAM,EACN,SAAS,EACT,cAAc,EACd,IAAI,EACJ,QAAQ,EACR,SAAS,IAAI,SAAS,EACtB,MAAM,EACN,MAAM,EACN,QAAQ,EACR,MAAM,EACN,aAAa,EACb,QAAQ,EACR,MAAM,GACN,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EACN,KAAK,0BAA0B,EAC/B,0BAA0B,GAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACN,KAAK,qBAAqB,EAC1B,0BAA0B,GAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,KAAK,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACN,cAAc,EACd,QAAQ,EACR,SAAS,EACT,iBAAiB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,UAAU,EACV,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,SAAS,EACT,MAAM,EACN,MAAM,EACN,SAAS,EACT,cAAc,EACd,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,OAAO,EACP,SAAS,IAAI,SAAS,EACtB,MAAM,EACN,MAAM,EACN,QAAQ,EACR,MAAM,EACN,aAAa,EACb,QAAQ,EACR,eAAe,EACf,MAAM,GACN,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EACN,KAAK,0BAA0B,EAC/B,0BAA0B,GAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACN,KAAK,qBAAqB,EAC1B,0BAA0B,GAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,KAAK,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACN,cAAc,EACd,QAAQ,EACR,SAAS,EACT,iBAAiB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,UAAU,EACV,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,UAAU,GACf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -14,4 +14,5 @@ export { invert } from "./invert.js";
|
|
|
14
14
|
export { compose } from "./compose.js";
|
|
15
15
|
export { getInputLength, isDetach, cloneMark, extractMarkEffect, } from "./utils.js";
|
|
16
16
|
export { isMoveMark, } from "./moveEffectTable.js";
|
|
17
|
+
export { relevantRemovedRoots } from "./relevantRemovedRoots.js";
|
|
17
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuBH,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAEN,0BAA0B,GAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAEN,0BAA0B,GAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAA4B,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACN,cAAc,EACd,QAAQ,EACR,SAAS,EACT,iBAAiB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,UAAU,GAIV,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tChangeset,\n\tRemove,\n\tDetach,\n\tHasMoveId,\n\tHasRevisionTag,\n\tInsert,\n\tMark,\n\tMarkList,\n\tMoveIn,\n\tMoveOut,\n\tCellCount as NodeCount,\n\tMoveId,\n\tAttach,\n\tNoopMark,\n\tCellId,\n\tHasMarkFields,\n\tCellMark,\n\tAttachAndDetach,\n\tRename,\n} from \"./types.js\";\nexport { DetachIdOverrideType } from \"./formatV1.js\";\nexport {\n\ttype SequenceFieldChangeHandler,\n\tsequenceFieldChangeHandler,\n} from \"./sequenceFieldChangeHandler.js\";\nexport {\n\ttype SequenceChangeRebaser,\n\tsequenceFieldChangeRebaser,\n} from \"./sequenceFieldChangeRebaser.js\";\nexport { sequenceFieldChangeCodecFactory } from \"./sequenceFieldCodecs.js\";\nexport { sequenceFieldToDelta } from \"./sequenceFieldToDelta.js\";\nexport { type SequenceFieldEditor, sequenceFieldEditor } from \"./sequenceFieldEditor.js\";\nexport { MarkListFactory } from \"./markListFactory.js\";\nexport { rebase } from \"./rebase.js\";\nexport { invert } from \"./invert.js\";\nexport { compose } from \"./compose.js\";\nexport {\n\tgetInputLength,\n\tisDetach,\n\tcloneMark,\n\textractMarkEffect,\n} from \"./utils.js\";\nexport {\n\tisMoveMark,\n\ttype MoveMark,\n\ttype MoveEffectTable,\n\ttype MoveEffect,\n} from \"./moveEffectTable.js\";\n\nexport { relevantRemovedRoots } from \"./relevantRemovedRoots.js\";\n"]}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import type { RevisionTag } from "../../core/index.js";
|
|
6
|
-
import type
|
|
7
|
-
import type
|
|
6
|
+
import { type IdAllocator } from "../../util/index.js";
|
|
7
|
+
import { type CrossFieldManager } from "../modular-schema/index.js";
|
|
8
8
|
import { type Changeset } from "./types.js";
|
|
9
9
|
/**
|
|
10
10
|
* Inverts a given changeset.
|
|
@@ -18,5 +18,5 @@ import { type Changeset } from "./types.js";
|
|
|
18
18
|
* WARNING! This implementation is incomplete:
|
|
19
19
|
* - Support for slices is not implemented.
|
|
20
20
|
*/
|
|
21
|
-
export declare function invert(change: Changeset, isRollback: boolean, genId: IdAllocator, revision: RevisionTag | undefined, crossFieldManager:
|
|
21
|
+
export declare function invert(change: Changeset, isRollback: boolean, genId: IdAllocator, revision: RevisionTag | undefined, crossFieldManager: CrossFieldManager): Changeset;
|
|
22
22
|
//# sourceMappingURL=invert.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invert.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/invert.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"invert.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/invert.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,WAAW,EAA2B,MAAM,qBAAqB,CAAC;AAChF,OAAO,EACN,KAAK,iBAAiB,EAGtB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAGN,KAAK,SAAS,EAWd,MAAM,YAAY,CAAC;AAepB;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CACrB,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,OAAO,EACnB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,WAAW,GAAG,SAAS,EACjC,iBAAiB,EAAE,iBAAiB,GAClC,SAAS,CAOX"}
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
5
|
+
import { assert, unreachableCase, fail } from "@fluidframework/core-utils/internal";
|
|
6
|
+
import { hasSingle } from "../../util/index.js";
|
|
7
|
+
import { CrossFieldTarget, } from "../modular-schema/index.js";
|
|
6
8
|
import { MarkListFactory } from "./markListFactory.js";
|
|
7
9
|
import { NoopMarkType, } from "./types.js";
|
|
8
|
-
import {
|
|
10
|
+
import { extractMarkEffect, getDetachOutputCellId, getEndpoint, getInputCellId, getOutputCellId, isAttach, isDetach, isImpactful, normalizeCellRename, splitMark, withNodeChange, } from "./utils.js";
|
|
9
11
|
/**
|
|
10
12
|
* Inverts a given changeset.
|
|
11
13
|
* @param change - The changeset to produce the inverse of.
|
|
@@ -42,91 +44,192 @@ function invertMark(mark, isRollback, crossFieldManager, revision) {
|
|
|
42
44
|
case "Rename": {
|
|
43
45
|
const inputId = getInputCellId(mark);
|
|
44
46
|
assert(inputId !== undefined, 0x9f5 /* Rename mark must have cell ID */);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
const inverse = {
|
|
48
|
+
type: "Rename",
|
|
49
|
+
count: mark.count,
|
|
50
|
+
cellId: mark.idOverride,
|
|
51
|
+
// Unlike a remove or move-out, which follow a node, there is no way for this mark to assign the original input cell ID to another cell.
|
|
52
|
+
// This means it should be safe to always restore the input cell ID (as opposed to only doing it on rollbacks).
|
|
53
|
+
// Despite that, we still only do it on rollback for the sake of consistency: once a cell has been assigned an ID,
|
|
54
|
+
// the only way for that cell to be assigned that ID again is if it is rolled back to that state.
|
|
55
|
+
idOverride: isRollback ? inputId : { localId: inputId.localId },
|
|
56
|
+
};
|
|
57
|
+
return [withNodeChange(inverse, mark.changes)];
|
|
58
|
+
}
|
|
59
|
+
case "Remove": {
|
|
60
|
+
assert(mark.revision !== undefined, 0x5a1 /* Unable to revert to undefined revision */);
|
|
61
|
+
const outputId = getOutputCellId(mark);
|
|
62
|
+
const inputId = getInputCellId(mark);
|
|
63
|
+
let inverse;
|
|
64
|
+
if (inputId === undefined) {
|
|
65
|
+
inverse = {
|
|
66
|
+
type: "Insert",
|
|
67
|
+
id: mark.id,
|
|
68
|
+
cellId: outputId,
|
|
52
69
|
count: mark.count,
|
|
53
|
-
|
|
54
|
-
// Unlike a remove or move-out, which follow a node, there is no way for this mark to assign the original input cell ID to another cell.
|
|
55
|
-
// This means it should be safe to always restore the input cell ID (as opposed to only doing it on rollbacks).
|
|
56
|
-
// Despite that, we still only do it on rollback for the sake of consistency: once a cell has been assigned an ID,
|
|
57
|
-
// the only way for that cell to be assigned that ID again is if it is rolled back to that state.
|
|
58
|
-
idOverride: inputId,
|
|
70
|
+
revision,
|
|
59
71
|
};
|
|
60
|
-
return [withNodeChange(inverse, mark.changes)];
|
|
61
72
|
}
|
|
62
73
|
else {
|
|
63
|
-
|
|
64
|
-
|
|
74
|
+
inverse = {
|
|
75
|
+
type: "Remove",
|
|
76
|
+
id: mark.id,
|
|
77
|
+
cellId: outputId,
|
|
78
|
+
count: mark.count,
|
|
79
|
+
revision,
|
|
80
|
+
};
|
|
81
|
+
if (isRollback) {
|
|
82
|
+
inverse.idOverride = inputId;
|
|
83
|
+
}
|
|
65
84
|
}
|
|
85
|
+
return [withNodeChange(inverse, mark.changes)];
|
|
66
86
|
}
|
|
67
|
-
case "
|
|
68
|
-
assert(mark.revision !== undefined, 0x5a1 /* Unable to revert to undefined revision */);
|
|
69
|
-
const outputId = getOutputCellId(mark);
|
|
87
|
+
case "Insert": {
|
|
70
88
|
const inputId = getInputCellId(mark);
|
|
71
|
-
assert(inputId
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
const inverse = {
|
|
75
|
-
type: "Insert",
|
|
76
|
-
id: mark.id,
|
|
77
|
-
cellId: outputId,
|
|
89
|
+
assert(inputId !== undefined, 0x80c /* Active inserts should target empty cells */);
|
|
90
|
+
const removeMark = {
|
|
91
|
+
type: "Remove",
|
|
78
92
|
count: mark.count,
|
|
79
|
-
|
|
93
|
+
id: inputId.localId,
|
|
94
|
+
revision,
|
|
80
95
|
};
|
|
96
|
+
if (isRollback) {
|
|
97
|
+
removeMark.idOverride = inputId;
|
|
98
|
+
}
|
|
99
|
+
const inverse = withNodeChange(removeMark, mark.changes);
|
|
81
100
|
return [inverse];
|
|
82
101
|
}
|
|
83
|
-
case "
|
|
84
|
-
|
|
102
|
+
case "MoveOut": {
|
|
103
|
+
if (mark.changes !== undefined) {
|
|
104
|
+
assert(mark.count === 1, 0x6ed /* Mark with changes can only target a single cell */);
|
|
105
|
+
const endpoint = getEndpoint(mark);
|
|
106
|
+
crossFieldManager.set(CrossFieldTarget.Destination, endpoint.revision, endpoint.localId, mark.count, mark.changes, true);
|
|
107
|
+
}
|
|
108
|
+
const cellId = getDetachOutputCellId(mark) ?? {
|
|
109
|
+
revision: mark.revision ?? fail(0xb2a /* Revision must be defined */),
|
|
110
|
+
localId: mark.id,
|
|
111
|
+
};
|
|
112
|
+
const moveIn = {
|
|
113
|
+
type: "MoveIn",
|
|
114
|
+
id: mark.id,
|
|
115
|
+
revision,
|
|
116
|
+
};
|
|
117
|
+
if (mark.finalEndpoint !== undefined) {
|
|
118
|
+
moveIn.finalEndpoint = {
|
|
119
|
+
localId: mark.finalEndpoint.localId,
|
|
120
|
+
revision: mark.revision,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
let effect = moveIn;
|
|
124
|
+
const inputId = getInputCellId(mark);
|
|
125
|
+
if (inputId !== undefined) {
|
|
126
|
+
const detach = {
|
|
127
|
+
type: "Remove",
|
|
128
|
+
id: mark.id,
|
|
129
|
+
revision,
|
|
130
|
+
};
|
|
131
|
+
if (isRollback) {
|
|
132
|
+
detach.idOverride = inputId;
|
|
133
|
+
}
|
|
134
|
+
effect = {
|
|
135
|
+
type: "AttachAndDetach",
|
|
136
|
+
attach: moveIn,
|
|
137
|
+
detach,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
return [{ ...effect, count: mark.count, cellId }];
|
|
141
|
+
}
|
|
142
|
+
case "MoveIn": {
|
|
143
|
+
const inputId = getInputCellId(mark);
|
|
144
|
+
assert(inputId !== undefined, 0x89e /* Active move-ins should target empty cells */);
|
|
145
|
+
const invertedMark = {
|
|
146
|
+
type: "MoveOut",
|
|
147
|
+
id: mark.id,
|
|
148
|
+
count: mark.count,
|
|
149
|
+
revision,
|
|
150
|
+
};
|
|
151
|
+
if (isRollback) {
|
|
152
|
+
invertedMark.idOverride = inputId;
|
|
153
|
+
}
|
|
154
|
+
if (mark.finalEndpoint) {
|
|
155
|
+
invertedMark.finalEndpoint = {
|
|
156
|
+
localId: mark.finalEndpoint.localId,
|
|
157
|
+
revision: mark.revision,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
return applyMovedChanges(invertedMark, mark.revision, crossFieldManager);
|
|
161
|
+
}
|
|
162
|
+
case "AttachAndDetach": {
|
|
163
|
+
const attach = {
|
|
164
|
+
count: mark.count,
|
|
165
|
+
cellId: mark.cellId,
|
|
166
|
+
...mark.attach,
|
|
167
|
+
};
|
|
168
|
+
const idAfterAttach = getOutputCellId(attach);
|
|
169
|
+
// We put `mark.changes` on the detach so that if it is a move source
|
|
170
|
+
// the changes can be sent to the endpoint.
|
|
171
|
+
const detach = {
|
|
172
|
+
count: mark.count,
|
|
173
|
+
cellId: idAfterAttach,
|
|
174
|
+
changes: mark.changes,
|
|
175
|
+
...mark.detach,
|
|
176
|
+
};
|
|
177
|
+
const attachInverses = invertMark(attach, isRollback, crossFieldManager, revision);
|
|
178
|
+
const detachInverses = invertMark(detach, isRollback, crossFieldManager, revision);
|
|
179
|
+
if (detachInverses.length === 0) {
|
|
180
|
+
return attachInverses;
|
|
181
|
+
}
|
|
182
|
+
assert(hasSingle(detachInverses), 0x80d /* Only expected MoveIn marks to be split when inverting */);
|
|
183
|
+
let detachInverse = detachInverses[0];
|
|
184
|
+
assert(isAttach(detachInverse), 0x80e /* Inverse of a detach should be an attach */);
|
|
185
|
+
const inverses = [];
|
|
186
|
+
for (const attachInverse of attachInverses) {
|
|
187
|
+
let detachInverseCurr = detachInverse;
|
|
188
|
+
if (attachInverse.count !== detachInverse.count) {
|
|
189
|
+
[detachInverseCurr, detachInverse] = splitMark(detachInverse, attachInverse.count);
|
|
190
|
+
}
|
|
191
|
+
if (attachInverse.type === NoopMarkType) {
|
|
192
|
+
if (attachInverse.changes !== undefined) {
|
|
193
|
+
assert(detachInverseCurr.changes === undefined, 0x80f /* Unexpected node changes */);
|
|
194
|
+
detachInverseCurr.changes = attachInverse.changes;
|
|
195
|
+
}
|
|
196
|
+
inverses.push(detachInverseCurr);
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
assert(isDetach(attachInverse), 0x810 /* Inverse of an attach should be a detach */);
|
|
200
|
+
assert(detachInverseCurr.cellId !== undefined, 0x9f6 /* Expected empty cell */);
|
|
201
|
+
const inverted = normalizeCellRename(detachInverseCurr.cellId, attachInverse.count, extractMarkEffect(detachInverseCurr), extractMarkEffect(attachInverse));
|
|
202
|
+
if (detachInverse.changes !== undefined) {
|
|
203
|
+
inverted.changes = detachInverse.changes;
|
|
204
|
+
}
|
|
205
|
+
if (attachInverse.changes !== undefined) {
|
|
206
|
+
assert(inverted.changes === undefined, 0x811 /* Unexpected node changes */);
|
|
207
|
+
inverted.changes = attachInverse.changes;
|
|
208
|
+
}
|
|
209
|
+
inverses.push(inverted);
|
|
210
|
+
}
|
|
211
|
+
return inverses;
|
|
85
212
|
}
|
|
86
|
-
default:
|
|
213
|
+
default: {
|
|
87
214
|
unreachableCase(type);
|
|
215
|
+
}
|
|
88
216
|
}
|
|
89
217
|
}
|
|
90
|
-
function
|
|
91
|
-
|
|
218
|
+
function applyMovedChanges(mark, revision, manager) {
|
|
219
|
+
// Although this is a source mark, we query the destination because this was a destination mark during the original invert pass.
|
|
220
|
+
const entry = manager.get(CrossFieldTarget.Destination, revision, mark.id, mark.count, true);
|
|
92
221
|
if (entry.length < mark.count) {
|
|
93
222
|
const [mark1, mark2] = splitMark(mark, entry.length);
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
];
|
|
98
|
-
}
|
|
99
|
-
return [invertInsertSegment(mark, revision, isRollback, entry.value)];
|
|
100
|
-
}
|
|
101
|
-
function invertInsertSegment(mark, revision, isRollback, detachEntry) {
|
|
102
|
-
const inputId = getInputCellId(mark);
|
|
103
|
-
assert(inputId !== undefined, 0x80c /* Active inserts should target empty cells */);
|
|
104
|
-
const detachId = invertAttachId(getAttachedRootId(mark), revision, isRollback, detachEntry);
|
|
105
|
-
const removeMark = {
|
|
106
|
-
type: "Remove",
|
|
107
|
-
count: mark.count,
|
|
108
|
-
id: detachId.localId,
|
|
109
|
-
revision: detachId.revision,
|
|
110
|
-
};
|
|
111
|
-
if (isRollback && !areEqualCellIds(inputId, detachId)) {
|
|
112
|
-
removeMark.cellRename = inputId;
|
|
113
|
-
}
|
|
114
|
-
if (detachEntry?.nodeChange !== undefined) {
|
|
115
|
-
removeMark.changes = detachEntry.nodeChange;
|
|
116
|
-
}
|
|
117
|
-
return removeMark;
|
|
118
|
-
}
|
|
119
|
-
function invertAttachId(attachId, revision, isRollback, detachEntry) {
|
|
120
|
-
if (!isRollback) {
|
|
121
|
-
return {
|
|
122
|
-
revision,
|
|
123
|
-
localId: attachId.localId,
|
|
124
|
-
};
|
|
223
|
+
const mark1WithChanges = entry.value === undefined
|
|
224
|
+
? mark1
|
|
225
|
+
: withNodeChange(mark1, entry.value);
|
|
226
|
+
return [mark1WithChanges, ...applyMovedChanges(mark2, revision, manager)];
|
|
125
227
|
}
|
|
126
|
-
if (
|
|
127
|
-
|
|
228
|
+
if (entry.value !== undefined) {
|
|
229
|
+
manager.onMoveIn(entry.value);
|
|
230
|
+
return [withNodeChange(mark, entry.value)];
|
|
128
231
|
}
|
|
129
|
-
return
|
|
232
|
+
return [mark];
|
|
130
233
|
}
|
|
131
234
|
function invertNodeChangeOrSkip(count, changes, cellId) {
|
|
132
235
|
if (changes !== undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invert.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/invert.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAM9E,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EASN,YAAY,GAEZ,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,WAAW,EACX,SAAS,EACT,cAAc,GACd,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,MAAM,CACrB,MAAiB,EACjB,UAAmB,EACnB,KAAkB,EAClB,QAAiC,EACjC,iBAAoC;IAEpC,OAAO,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,iBAAiB,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E,CAAC;IAC1B,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,CAAC;AAClB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport type { ChangeAtomId, RevisionTag } from \"../../core/index.js\";\nimport type { IdAllocator, Mutable } from \"../../util/index.js\";\nimport type { DetachedNodeEntry, InvertNodeManager, NodeId } from \"../modular-schema/index.js\";\n\nimport { MarkListFactory } from \"./markListFactory.js\";\nimport {\n\ttype Attach,\n\ttype CellId,\n\ttype CellMark,\n\ttype Changeset,\n\ttype Detach,\n\ttype Mark,\n\ttype MarkList,\n\ttype NoopMark,\n\tNoopMarkType,\n\ttype Rename,\n} from \"./types.js\";\nimport {\n\tareEqualCellIds,\n\tgetAttachedRootId,\n\tgetInputCellId,\n\tgetOutputCellId,\n\tisImpactful,\n\tsplitMark,\n\twithNodeChange,\n} from \"./utils.js\";\n\n/**\n * Inverts a given changeset.\n * @param change - The changeset to produce the inverse of.\n * @param isRollback - Whether the inverse is being produced for a rollback.\n * @param genId - The ID allocator to use for generating new IDs.\n * @param revision - The revision to use for the inverse changeset.\n * @param crossFieldManager - The cross-field manager to use for tracking cross-field changes.\n * @returns The inverse of the given `change` such that the inverse can be applied after `change`.\n *\n * WARNING! This implementation is incomplete:\n * - Support for slices is not implemented.\n */\nexport function invert(\n\tchange: Changeset,\n\tisRollback: boolean,\n\tgenId: IdAllocator,\n\trevision: RevisionTag | undefined,\n\tcrossFieldManager: InvertNodeManager,\n): Changeset {\n\treturn invertMarkList(change, isRollback, crossFieldManager, revision);\n}\n\nfunction invertMarkList(\n\tmarkList: MarkList,\n\tisRollback: boolean,\n\tcrossFieldManager: InvertNodeManager,\n\trevision: RevisionTag | undefined,\n): MarkList {\n\tconst inverseMarkList = new MarkListFactory();\n\n\tfor (const mark of markList) {\n\t\tconst inverseMarks = invertMark(mark, isRollback, crossFieldManager, revision);\n\t\tinverseMarkList.push(...inverseMarks);\n\t}\n\n\treturn inverseMarkList.list;\n}\n\nfunction invertMark(\n\tmark: Mark,\n\tisRollback: boolean,\n\tcrossFieldManager: InvertNodeManager,\n\trevision: RevisionTag | undefined,\n): Mark[] {\n\tif (!isImpactful(mark)) {\n\t\tconst inputId = getInputCellId(mark);\n\t\treturn [invertNodeChangeOrSkip(mark.count, mark.changes, inputId)];\n\t}\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase NoopMarkType: {\n\t\t\treturn [mark];\n\t\t}\n\t\tcase \"Rename\": {\n\t\t\tconst inputId = getInputCellId(mark);\n\t\t\tassert(inputId !== undefined, 0x9f5 /* Rename mark must have cell ID */);\n\n\t\t\t// In older client versions, the ID of a detached root was the same as the ID of the cell it was last detached from.\n\t\t\t// To preserve compatibility with those versions, we must make sure that we do not rename the cell if we are not also\n\t\t\t// renaming the associated detached root, if there is one.\n\t\t\tif (isRollback) {\n\t\t\t\t// A rollback inverse inverts any associated root rename, so we should also invert the cell rename.\n\t\t\t\tconst inverse: Mutable<CellMark<Rename>> = {\n\t\t\t\t\ttype: \"Rename\",\n\t\t\t\t\tcount: mark.count,\n\t\t\t\t\tcellId: mark.idOverride,\n\t\t\t\t\t// Unlike a remove or move-out, which follow a node, there is no way for this mark to assign the original input cell ID to another cell.\n\t\t\t\t\t// This means it should be safe to always restore the input cell ID (as opposed to only doing it on rollbacks).\n\t\t\t\t\t// Despite that, we still only do it on rollback for the sake of consistency: once a cell has been assigned an ID,\n\t\t\t\t\t// the only way for that cell to be assigned that ID again is if it is rolled back to that state.\n\t\t\t\t\tidOverride: inputId,\n\t\t\t\t};\n\t\t\t\treturn [withNodeChange(inverse, mark.changes)];\n\t\t\t} else {\n\t\t\t\t// An undo does not invert root renames, so we should not invert cell renames.\n\t\t\t\treturn [invertNodeChangeOrSkip(mark.count, mark.changes, mark.idOverride)];\n\t\t\t}\n\t\t}\n\t\tcase \"Remove\": {\n\t\t\tassert(mark.revision !== undefined, 0x5a1 /* Unable to revert to undefined revision */);\n\t\t\tconst outputId = getOutputCellId(mark);\n\t\t\tconst inputId = getInputCellId(mark);\n\t\t\tassert(inputId === undefined, \"Unexpected remove of detached node\");\n\n\t\t\tconst attachId = { revision: isRollback ? mark.revision : revision, localId: mark.id };\n\t\t\tcrossFieldManager.invertDetach(\n\t\t\t\t{ revision: mark.revision, localId: mark.id },\n\t\t\t\tmark.count,\n\t\t\t\tmark.changes,\n\t\t\t\tattachId,\n\t\t\t);\n\n\t\t\tconst inverse: Mark = {\n\t\t\t\ttype: \"Insert\",\n\t\t\t\tid: mark.id,\n\t\t\t\tcellId: outputId,\n\t\t\t\tcount: mark.count,\n\t\t\t\trevision: attachId.revision,\n\t\t\t};\n\t\t\treturn [inverse];\n\t\t}\n\t\tcase \"Insert\": {\n\t\t\treturn invertInsert(mark, revision, crossFieldManager, isRollback);\n\t\t}\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\nfunction invertInsert(\n\tmark: CellMark<Attach>,\n\trevision: RevisionTag | undefined,\n\tmanager: InvertNodeManager,\n\tisRollback: boolean,\n): Mark[] {\n\tconst entry = manager.invertAttach(getAttachedRootId(mark), mark.count);\n\n\tif (entry.length < mark.count) {\n\t\tconst [mark1, mark2] = splitMark(mark, entry.length);\n\t\treturn [\n\t\t\tinvertInsertSegment(mark1, revision, isRollback, entry.value),\n\t\t\t...invertInsert(mark2, revision, manager, isRollback),\n\t\t];\n\t}\n\n\treturn [invertInsertSegment(mark, revision, isRollback, entry.value)];\n}\n\nfunction invertInsertSegment(\n\tmark: CellMark<Attach>,\n\trevision: RevisionTag | undefined,\n\tisRollback: boolean,\n\tdetachEntry: DetachedNodeEntry | undefined,\n): Mark {\n\tconst inputId = getInputCellId(mark);\n\tassert(inputId !== undefined, 0x80c /* Active inserts should target empty cells */);\n\n\tconst detachId = invertAttachId(getAttachedRootId(mark), revision, isRollback, detachEntry);\n\n\tconst removeMark: Mutable<CellMark<Detach>> = {\n\t\ttype: \"Remove\",\n\t\tcount: mark.count,\n\t\tid: detachId.localId,\n\t\trevision: detachId.revision,\n\t};\n\n\tif (isRollback && !areEqualCellIds(inputId, detachId)) {\n\t\tremoveMark.cellRename = inputId;\n\t}\n\n\tif (detachEntry?.nodeChange !== undefined) {\n\t\tremoveMark.changes = detachEntry.nodeChange;\n\t}\n\n\treturn removeMark;\n}\n\nfunction invertAttachId(\n\tattachId: ChangeAtomId,\n\trevision: RevisionTag | undefined,\n\tisRollback: boolean,\n\tdetachEntry: DetachedNodeEntry | undefined,\n): ChangeAtomId {\n\tif (!isRollback) {\n\t\treturn {\n\t\t\trevision,\n\t\t\tlocalId: attachId.localId,\n\t\t};\n\t}\n\n\tif (detachEntry?.detachId !== undefined) {\n\t\treturn detachEntry.detachId;\n\t}\n\n\treturn attachId;\n}\n\nfunction invertNodeChangeOrSkip(\n\tcount: number,\n\tchanges: NodeId | undefined,\n\tcellId?: CellId,\n): Mark {\n\tif (changes !== undefined) {\n\t\tassert(count === 1, 0x66c /* A modify mark must have length equal to one */);\n\t\tconst noop: CellMark<NoopMark> = {\n\t\t\tcount,\n\t\t\tchanges,\n\t\t};\n\t\tif (cellId !== undefined) {\n\t\t\tnoop.cellId = cellId;\n\t\t}\n\t\treturn noop;\n\t}\n\n\tif (cellId !== undefined) {\n\t\treturn { count, cellId };\n\t}\n\treturn { count };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"invert.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/invert.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAGpF,OAAO,EAAkC,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAEN,gBAAgB,GAEhB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAWN,YAAY,GAGZ,MA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AAC,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,SAAS,sBAAsB,CAC9B,KAAa,EACb,OAA2B,EAC3B,MAAe;IAEf,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,CAAC,KAAK,KAAK,CAAC,EAAE,KAAK,CAAC,iDAAiD,CAAC,CAAC;QAC7E,MAAM,IAAI,GAAuB;YAChC,KAAK;YACL,OAAO;SACP,CAAC;QACF,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACtB,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAC1B,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,CAAC;AAClB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\n\nimport type { RevisionTag } from \"../../core/index.js\";\nimport { type IdAllocator, type Mutable, hasSingle } from \"../../util/index.js\";\nimport {\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\ttype NodeId,\n} from \"../modular-schema/index.js\";\n\nimport { MarkListFactory } from \"./markListFactory.js\";\nimport {\n\ttype CellId,\n\ttype CellMark,\n\ttype Changeset,\n\ttype Detach,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype MarkList,\n\ttype MoveIn,\n\ttype MoveOut,\n\ttype NoopMark,\n\tNoopMarkType,\n\ttype Remove,\n\ttype Rename,\n} from \"./types.js\";\nimport {\n\textractMarkEffect,\n\tgetDetachOutputCellId,\n\tgetEndpoint,\n\tgetInputCellId,\n\tgetOutputCellId,\n\tisAttach,\n\tisDetach,\n\tisImpactful,\n\tnormalizeCellRename,\n\tsplitMark,\n\twithNodeChange,\n} from \"./utils.js\";\n\n/**\n * Inverts a given changeset.\n * @param change - The changeset to produce the inverse of.\n * @param isRollback - Whether the inverse is being produced for a rollback.\n * @param genId - The ID allocator to use for generating new IDs.\n * @param revision - The revision to use for the inverse changeset.\n * @param crossFieldManager - The cross-field manager to use for tracking cross-field changes.\n * @returns The inverse of the given `change` such that the inverse can be applied after `change`.\n *\n * WARNING! This implementation is incomplete:\n * - Support for slices is not implemented.\n */\nexport function invert(\n\tchange: Changeset,\n\tisRollback: boolean,\n\tgenId: IdAllocator,\n\trevision: RevisionTag | undefined,\n\tcrossFieldManager: CrossFieldManager,\n): Changeset {\n\treturn invertMarkList(\n\t\tchange,\n\t\tisRollback,\n\t\tcrossFieldManager as CrossFieldManager<NodeId>,\n\t\trevision,\n\t);\n}\n\nfunction invertMarkList(\n\tmarkList: MarkList,\n\tisRollback: boolean,\n\tcrossFieldManager: CrossFieldManager<NodeId>,\n\trevision: RevisionTag | undefined,\n): MarkList {\n\tconst inverseMarkList = new MarkListFactory();\n\n\tfor (const mark of markList) {\n\t\tconst inverseMarks = invertMark(mark, isRollback, crossFieldManager, revision);\n\t\tinverseMarkList.push(...inverseMarks);\n\t}\n\n\treturn inverseMarkList.list;\n}\n\nfunction invertMark(\n\tmark: Mark,\n\tisRollback: boolean,\n\tcrossFieldManager: CrossFieldManager<NodeId>,\n\trevision: RevisionTag | undefined,\n): Mark[] {\n\tif (!isImpactful(mark)) {\n\t\tconst inputId = getInputCellId(mark);\n\t\treturn [invertNodeChangeOrSkip(mark.count, mark.changes, inputId)];\n\t}\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase NoopMarkType: {\n\t\t\treturn [mark];\n\t\t}\n\t\tcase \"Rename\": {\n\t\t\tconst inputId = getInputCellId(mark);\n\t\t\tassert(inputId !== undefined, 0x9f5 /* Rename mark must have cell ID */);\n\t\t\tconst inverse: Mutable<CellMark<Rename>> = {\n\t\t\t\ttype: \"Rename\",\n\t\t\t\tcount: mark.count,\n\t\t\t\tcellId: mark.idOverride,\n\t\t\t\t// Unlike a remove or move-out, which follow a node, there is no way for this mark to assign the original input cell ID to another cell.\n\t\t\t\t// This means it should be safe to always restore the input cell ID (as opposed to only doing it on rollbacks).\n\t\t\t\t// Despite that, we still only do it on rollback for the sake of consistency: once a cell has been assigned an ID,\n\t\t\t\t// the only way for that cell to be assigned that ID again is if it is rolled back to that state.\n\t\t\t\tidOverride: isRollback ? inputId : { localId: inputId.localId },\n\t\t\t};\n\t\t\treturn [withNodeChange(inverse, mark.changes)];\n\t\t}\n\t\tcase \"Remove\": {\n\t\t\tassert(mark.revision !== undefined, 0x5a1 /* Unable to revert to undefined revision */);\n\t\t\tconst outputId = getOutputCellId(mark);\n\t\t\tconst inputId = getInputCellId(mark);\n\t\t\tlet inverse: Mutable<Mark>;\n\t\t\tif (inputId === undefined) {\n\t\t\t\tinverse = {\n\t\t\t\t\ttype: \"Insert\",\n\t\t\t\t\tid: mark.id,\n\t\t\t\t\tcellId: outputId,\n\t\t\t\t\tcount: mark.count,\n\t\t\t\t\trevision,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tinverse = {\n\t\t\t\t\ttype: \"Remove\",\n\t\t\t\t\tid: mark.id,\n\t\t\t\t\tcellId: outputId,\n\t\t\t\t\tcount: mark.count,\n\t\t\t\t\trevision,\n\t\t\t\t};\n\t\t\t\tif (isRollback) {\n\t\t\t\t\tinverse.idOverride = inputId;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn [withNodeChange(inverse, mark.changes)];\n\t\t}\n\t\tcase \"Insert\": {\n\t\t\tconst inputId = getInputCellId(mark);\n\t\t\tassert(inputId !== undefined, 0x80c /* Active inserts should target empty cells */);\n\t\t\tconst removeMark: Mutable<CellMark<Remove>> = {\n\t\t\t\ttype: \"Remove\",\n\t\t\t\tcount: mark.count,\n\t\t\t\tid: inputId.localId,\n\t\t\t\trevision,\n\t\t\t};\n\n\t\t\tif (isRollback) {\n\t\t\t\tremoveMark.idOverride = inputId;\n\t\t\t}\n\n\t\t\tconst inverse = withNodeChange(removeMark, mark.changes);\n\t\t\treturn [inverse];\n\t\t}\n\t\tcase \"MoveOut\": {\n\t\t\tif (mark.changes !== undefined) {\n\t\t\t\tassert(mark.count === 1, 0x6ed /* Mark with changes can only target a single cell */);\n\n\t\t\t\tconst endpoint = getEndpoint(mark);\n\t\t\t\tcrossFieldManager.set(\n\t\t\t\t\tCrossFieldTarget.Destination,\n\t\t\t\t\tendpoint.revision,\n\t\t\t\t\tendpoint.localId,\n\t\t\t\t\tmark.count,\n\t\t\t\t\tmark.changes,\n\t\t\t\t\ttrue,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst cellId = getDetachOutputCellId(mark) ?? {\n\t\t\t\trevision: mark.revision ?? fail(0xb2a /* Revision must be defined */),\n\t\t\t\tlocalId: mark.id,\n\t\t\t};\n\n\t\t\tconst moveIn: MoveIn = {\n\t\t\t\ttype: \"MoveIn\",\n\t\t\t\tid: mark.id,\n\t\t\t\trevision,\n\t\t\t};\n\n\t\t\tif (mark.finalEndpoint !== undefined) {\n\t\t\t\tmoveIn.finalEndpoint = {\n\t\t\t\t\tlocalId: mark.finalEndpoint.localId,\n\t\t\t\t\trevision: mark.revision,\n\t\t\t\t};\n\t\t\t}\n\t\t\tlet effect: MarkEffect = moveIn;\n\t\t\tconst inputId = getInputCellId(mark);\n\t\t\tif (inputId !== undefined) {\n\t\t\t\tconst detach: Mutable<Detach> = {\n\t\t\t\t\ttype: \"Remove\",\n\t\t\t\t\tid: mark.id,\n\t\t\t\t\trevision,\n\t\t\t\t};\n\t\t\t\tif (isRollback) {\n\t\t\t\t\tdetach.idOverride = inputId;\n\t\t\t\t}\n\t\t\t\teffect = {\n\t\t\t\t\ttype: \"AttachAndDetach\",\n\t\t\t\t\tattach: moveIn,\n\t\t\t\t\tdetach,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn [{ ...effect, count: mark.count, cellId }];\n\t\t}\n\t\tcase \"MoveIn\": {\n\t\t\tconst inputId = getInputCellId(mark);\n\t\t\tassert(inputId !== undefined, 0x89e /* Active move-ins should target empty cells */);\n\t\t\tconst invertedMark: Mutable<CellMark<MoveOut>> = {\n\t\t\t\ttype: \"MoveOut\",\n\t\t\t\tid: mark.id,\n\t\t\t\tcount: mark.count,\n\t\t\t\trevision,\n\t\t\t};\n\n\t\t\tif (isRollback) {\n\t\t\t\tinvertedMark.idOverride = inputId;\n\t\t\t}\n\n\t\t\tif (mark.finalEndpoint) {\n\t\t\t\tinvertedMark.finalEndpoint = {\n\t\t\t\t\tlocalId: mark.finalEndpoint.localId,\n\t\t\t\t\trevision: mark.revision,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn applyMovedChanges(invertedMark, mark.revision, crossFieldManager);\n\t\t}\n\t\tcase \"AttachAndDetach\": {\n\t\t\tconst attach: Mark = {\n\t\t\t\tcount: mark.count,\n\t\t\t\tcellId: mark.cellId,\n\t\t\t\t...mark.attach,\n\t\t\t};\n\t\t\tconst idAfterAttach = getOutputCellId(attach);\n\n\t\t\t// We put `mark.changes` on the detach so that if it is a move source\n\t\t\t// the changes can be sent to the endpoint.\n\t\t\tconst detach: Mark = {\n\t\t\t\tcount: mark.count,\n\t\t\t\tcellId: idAfterAttach,\n\t\t\t\tchanges: mark.changes,\n\t\t\t\t...mark.detach,\n\t\t\t};\n\t\t\tconst attachInverses = invertMark(attach, isRollback, crossFieldManager, revision);\n\t\t\tconst detachInverses = invertMark(detach, isRollback, crossFieldManager, revision);\n\n\t\t\tif (detachInverses.length === 0) {\n\t\t\t\treturn attachInverses;\n\t\t\t}\n\n\t\t\tassert(\n\t\t\t\thasSingle(detachInverses),\n\t\t\t\t0x80d /* Only expected MoveIn marks to be split when inverting */,\n\t\t\t);\n\n\t\t\tlet detachInverse = detachInverses[0];\n\t\t\tassert(isAttach(detachInverse), 0x80e /* Inverse of a detach should be an attach */);\n\n\t\t\tconst inverses: Mark[] = [];\n\t\t\tfor (const attachInverse of attachInverses) {\n\t\t\t\tlet detachInverseCurr: Mark = detachInverse;\n\t\t\t\tif (attachInverse.count !== detachInverse.count) {\n\t\t\t\t\t[detachInverseCurr, detachInverse] = splitMark(detachInverse, attachInverse.count);\n\t\t\t\t}\n\n\t\t\t\tif (attachInverse.type === NoopMarkType) {\n\t\t\t\t\tif (attachInverse.changes !== undefined) {\n\t\t\t\t\t\tassert(\n\t\t\t\t\t\t\tdetachInverseCurr.changes === undefined,\n\t\t\t\t\t\t\t0x80f /* Unexpected node changes */,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tdetachInverseCurr.changes = attachInverse.changes;\n\t\t\t\t\t}\n\t\t\t\t\tinverses.push(detachInverseCurr);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tassert(isDetach(attachInverse), 0x810 /* Inverse of an attach should be a detach */);\n\t\t\t\tassert(detachInverseCurr.cellId !== undefined, 0x9f6 /* Expected empty cell */);\n\t\t\t\tconst inverted = normalizeCellRename(\n\t\t\t\t\tdetachInverseCurr.cellId,\n\t\t\t\t\tattachInverse.count,\n\t\t\t\t\textractMarkEffect(detachInverseCurr),\n\t\t\t\t\textractMarkEffect(attachInverse),\n\t\t\t\t);\n\t\t\t\tif (detachInverse.changes !== undefined) {\n\t\t\t\t\tinverted.changes = detachInverse.changes;\n\t\t\t\t}\n\n\t\t\t\tif (attachInverse.changes !== undefined) {\n\t\t\t\t\tassert(inverted.changes === undefined, 0x811 /* Unexpected node changes */);\n\t\t\t\t\tinverted.changes = attachInverse.changes;\n\t\t\t\t}\n\t\t\t\tinverses.push(inverted);\n\t\t\t}\n\n\t\t\treturn inverses;\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(type);\n\t\t}\n\t}\n}\n\nfunction applyMovedChanges(\n\tmark: CellMark<MoveOut>,\n\trevision: RevisionTag | undefined,\n\tmanager: CrossFieldManager<NodeId>,\n): Mark[] {\n\t// Although this is a source mark, we query the destination because this was a destination mark during the original invert pass.\n\tconst entry = manager.get(CrossFieldTarget.Destination, revision, mark.id, mark.count, true);\n\n\tif (entry.length < mark.count) {\n\t\tconst [mark1, mark2] = splitMark(mark, entry.length);\n\t\tconst mark1WithChanges =\n\t\t\tentry.value === undefined\n\t\t\t\t? mark1\n\t\t\t\t: withNodeChange<CellMark<MoveOut>, MoveOut>(mark1, entry.value);\n\n\t\treturn [mark1WithChanges, ...applyMovedChanges(mark2, revision, manager)];\n\t}\n\n\tif (entry.value !== undefined) {\n\t\tmanager.onMoveIn(entry.value);\n\t\treturn [withNodeChange<CellMark<MoveOut>, MoveOut>(mark, entry.value)];\n\t}\n\n\treturn [mark];\n}\n\nfunction invertNodeChangeOrSkip(\n\tcount: number,\n\tchanges: NodeId | undefined,\n\tcellId?: CellId,\n): Mark {\n\tif (changes !== undefined) {\n\t\tassert(count === 1, 0x66c /* A modify mark must have length equal to one */);\n\t\tconst noop: CellMark<NoopMark> = {\n\t\t\tcount,\n\t\t\tchanges,\n\t\t};\n\t\tif (cellId !== undefined) {\n\t\t\tnoop.cellId = cellId;\n\t\t}\n\t\treturn noop;\n\t}\n\n\tif (cellId !== undefined) {\n\t\treturn { count, cellId };\n\t}\n\treturn { count };\n}\n"]}
|
|
@@ -2,14 +2,14 @@
|
|
|
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 MoveEffectTable } from "./moveEffectTable.js";
|
|
6
6
|
import type { Mark } from "./types.js";
|
|
7
7
|
export declare class MarkQueue {
|
|
8
8
|
private readonly list;
|
|
9
9
|
private readonly moveEffects;
|
|
10
10
|
private readonly stack;
|
|
11
11
|
private index;
|
|
12
|
-
constructor(list: readonly Mark[], moveEffects:
|
|
12
|
+
constructor(list: readonly Mark[], moveEffects: MoveEffectTable);
|
|
13
13
|
isEmpty(): boolean;
|
|
14
14
|
dequeue(): Mark;
|
|
15
15
|
tryDequeue(): Mark | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markQueue.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/markQueue.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"markQueue.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/markQueue.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,eAAe,EAA2B,MAAM,sBAAsB,CAAC;AACrF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,qBAAa,SAAS;IAKpB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAL7B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,OAAO,CAAC,KAAK,CAAK;gBAGA,IAAI,EAAE,SAAS,IAAI,EAAE,EACrB,WAAW,EAAE,eAAe;IAKvC,OAAO,IAAI,OAAO;IAIlB,OAAO,IAAI,IAAI;IAMf,UAAU,IAAI,IAAI,GAAG,SAAS;IAarC;;;;OAIG;IACI,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAWjC,IAAI,IAAI,IAAI,GAAG,SAAS;CAO/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markQueue.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/markQueue.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,qCAAqC,CAAC;AAElE,OAAO,
|
|
1
|
+
{"version":3,"file":"markQueue.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/markQueue.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,qCAAqC,CAAC;AAElE,OAAO,EAAwB,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEr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IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC5B,IAAI,IAAI,CAAC,KAAK,IAAI,MAAM,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC;QACb,CAAC;QAED,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvB,OAAO,KAAK,CAAC;IACd,CAAC;IAEM,IAAI;QACV,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAC/B,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACxB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob } from \"@fluidframework/core-utils/internal\";\n\nimport { type MoveEffectTable, splitMarkForMoveEffects } from \"./moveEffectTable.js\";\nimport type { Mark } from \"./types.js\";\nimport { splitMark } from \"./utils.js\";\n\nexport class MarkQueue {\n\tprivate readonly stack: Mark[] = [];\n\tprivate index = 0;\n\n\tpublic constructor(\n\t\tprivate readonly list: readonly Mark[],\n\t\tprivate readonly moveEffects: MoveEffectTable,\n\t) {\n\t\tthis.list = list;\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn this.peek() === undefined;\n\t}\n\n\tpublic dequeue(): Mark {\n\t\tconst output = this.tryDequeue();\n\t\tassert(output !== undefined, 0x4e2 /* Unexpected end of mark queue */);\n\t\treturn output;\n\t}\n\n\tpublic tryDequeue(): Mark | undefined {\n\t\tconst mark = this.stack.length > 0 ? this.stack.pop() : this.list[this.index++];\n\t\tif (mark === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst splitMarks = splitMarkForMoveEffects(mark, this.moveEffects);\n\t\tfor (let i = splitMarks.length - 1; i > 0; i--) {\n\t\t\tthis.stack.push(splitMarks[i] ?? oob());\n\t\t}\n\t\treturn splitMarks[0];\n\t}\n\n\t/**\n\t * Dequeues the first `length` sized portion of the next mark,\n\t * or the entire next mark if `length` is longer than the mark's length.\n\t * @param length - The length to dequeue, measured in the input context.\n\t */\n\tpublic dequeueUpTo(length: number): Mark {\n\t\tconst mark = this.dequeue();\n\t\tif (mark.count <= length) {\n\t\t\treturn mark;\n\t\t}\n\n\t\tconst [mark1, mark2] = splitMark(mark, length);\n\t\tthis.stack.push(mark2);\n\t\treturn mark1;\n\t}\n\n\tpublic peek(): Mark | undefined {\n\t\tconst mark = this.tryDequeue();\n\t\tif (mark !== undefined) {\n\t\t\tthis.stack.push(mark);\n\t\t}\n\t\treturn mark;\n\t}\n}\n"]}
|
|
@@ -2,11 +2,63 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
import type { ChangeAtomId, RevisionTag, TaggedChange } from "../../core/index.js";
|
|
6
|
+
import { type RangeQueryResult } from "../../util/index.js";
|
|
7
|
+
import { type CrossFieldManager, CrossFieldTarget, type NodeId } from "../modular-schema/index.js";
|
|
5
8
|
import type { MoveMarkEffect } from "./helperTypes.js";
|
|
6
|
-
import type {
|
|
9
|
+
import type { CellMark, Detach, Mark, MarkEffect, MoveId, MoveIn, MoveOut } from "./types.js";
|
|
10
|
+
export type MoveEffectTable = CrossFieldManager<MoveEffect>;
|
|
11
|
+
/**
|
|
12
|
+
* Changes to be applied to a move mark.
|
|
13
|
+
*/
|
|
14
|
+
export interface MoveEffect {
|
|
15
|
+
/**
|
|
16
|
+
* Node changes which should be applied to this mark.
|
|
17
|
+
* If this mark already has node changes, `modifyAfter` should be composed as later changes.
|
|
18
|
+
*/
|
|
19
|
+
modifyAfter?: NodeId;
|
|
20
|
+
/**
|
|
21
|
+
* Only used during rebasing.
|
|
22
|
+
* An effect from changeset being rebased which should be moved to the same position as this mark.
|
|
23
|
+
*/
|
|
24
|
+
movedEffect?: Detach;
|
|
25
|
+
/**
|
|
26
|
+
* Rebased changes for a node which has been moved to the position of this mark.
|
|
27
|
+
*/
|
|
28
|
+
rebasedChanges?: NodeId;
|
|
29
|
+
/**
|
|
30
|
+
* The ID of the other outer endpoint.
|
|
31
|
+
* Used when this is the outer endpoint in a move chain which is being composed with another move chain.
|
|
32
|
+
*/
|
|
33
|
+
endpoint?: ChangeAtomId;
|
|
34
|
+
/**
|
|
35
|
+
* The ID of the truncated endpoint.
|
|
36
|
+
* Used when this mark is the outer endpoint of a chain being composed with a redundant move chain.
|
|
37
|
+
*/
|
|
38
|
+
truncatedEndpoint?: ChangeAtomId;
|
|
39
|
+
/**
|
|
40
|
+
* The ID of the truncated endpoint.
|
|
41
|
+
* Used when this mark is the inner endpoint of a redundant move chain.
|
|
42
|
+
*/
|
|
43
|
+
truncatedEndpointForInner?: ChangeAtomId;
|
|
44
|
+
}
|
|
45
|
+
export declare enum MoveEnd {
|
|
46
|
+
Source = 0,
|
|
47
|
+
Dest = 1
|
|
48
|
+
}
|
|
49
|
+
export interface MovePartition {
|
|
50
|
+
id: MoveId;
|
|
51
|
+
count?: number;
|
|
52
|
+
replaceWith?: Mark[];
|
|
53
|
+
modifyAfter?: TaggedChange<NodeId>;
|
|
54
|
+
}
|
|
55
|
+
export declare function setMoveEffect(moveEffects: MoveEffectTable, target: CrossFieldTarget, revision: RevisionTag | undefined, id: MoveId, count: number, effect: MoveEffect, invalidate?: boolean): void;
|
|
56
|
+
export declare function getMoveEffect(moveEffects: MoveEffectTable, target: CrossFieldTarget, revision: RevisionTag | undefined, id: MoveId, count: number, addDependency?: boolean): RangeQueryResult<ChangeAtomId, MoveEffect>;
|
|
7
57
|
export type MoveMark = CellMark<MoveMarkEffect>;
|
|
8
58
|
export declare function isMoveMark(effect: MarkEffect): effect is MoveMarkEffect;
|
|
9
|
-
export declare function
|
|
10
|
-
export
|
|
11
|
-
export declare function
|
|
59
|
+
export declare function isMoveOut(effect: MarkEffect): effect is MoveOut;
|
|
60
|
+
export declare function isMoveIn(effect: MarkEffect): effect is MoveIn;
|
|
61
|
+
export declare function getMoveIn(effect: MarkEffect): MoveIn | undefined;
|
|
62
|
+
export declare function splitMarkForMoveEffects(mark: Mark, effects: MoveEffectTable): Mark[];
|
|
63
|
+
export declare function getCrossFieldTargetFromMove(mark: MoveMarkEffect): CrossFieldTarget;
|
|
12
64
|
//# sourceMappingURL=moveEffectTable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moveEffectTable.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/moveEffectTable.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"moveEffectTable.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/moveEffectTable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAAE,KAAK,gBAAgB,EAAS,MAAM,qBAAqB,CAAC;AACnE,OAAO,EACN,KAAK,iBAAiB,EACtB,gBAAgB,EAChB,KAAK,MAAM,EACX,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG9F,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM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