@fluidframework/tree 2.117.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +385 -7
- package/README.md +55 -52
- package/{api-extractor.json → api-extractor/api-extractor-model.json} +1 -1
- package/api-report/tree.alpha.api.md +174 -146
- package/api-report/tree.beta.api.md +160 -91
- package/api-report/tree.legacy.beta.api.md +160 -91
- package/api-report/tree.legacy.public.api.md +26 -43
- package/api-report/tree.public.api.md +26 -43
- package/dist/api.d.ts +9 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +2 -3
- package/dist/api.js.map +1 -1
- package/dist/codec/codec.d.ts +2 -2
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +9 -7
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/discriminatedUnions.js +1 -0
- package/dist/codec/discriminatedUnions.js.map +1 -1
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js +4 -2
- package/dist/codec/versioned/codec.js.map +1 -1
- package/dist/componentApi.d.ts.map +1 -1
- package/dist/componentApi.js +20 -17
- package/dist/componentApi.js.map +1 -1
- package/dist/core/change-family/editBuilder.js +1 -0
- package/dist/core/change-family/editBuilder.js.map +1 -1
- package/dist/core/forest/editableForest.js +1 -2
- package/dist/core/forest/editableForest.js.map +1 -1
- package/dist/core/forest/forest.js +3 -3
- package/dist/core/forest/forest.js.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +9 -5
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/changeRebaser.js +5 -5
- package/dist/core/rebase/changeRebaser.js.map +1 -1
- package/dist/core/rebase/index.d.ts +1 -1
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js +2 -1
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/revisionTagCodec.d.ts +1 -1
- package/dist/core/rebase/revisionTagCodec.d.ts.map +1 -1
- package/dist/core/rebase/revisionTagCodec.js +3 -1
- package/dist/core/rebase/revisionTagCodec.js.map +1 -1
- package/dist/core/rebase/types.d.ts +12 -1
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +19 -15
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/rebase/utils.js +9 -10
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/schema-stored/schema.js +9 -4
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.js +6 -4
- package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts +1 -1
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +62 -55
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/chunk.js +2 -2
- package/dist/core/tree/chunk.js.map +1 -1
- package/dist/core/tree/cursor.js +12 -12
- package/dist/core/tree/cursor.js.map +1 -1
- package/dist/core/tree/deltaUtil.d.ts +34 -9
- package/dist/core/tree/deltaUtil.d.ts.map +1 -1
- package/dist/core/tree/deltaUtil.js +51 -17
- package/dist/core/tree/deltaUtil.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +23 -21
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +10 -10
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.js +1 -2
- package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.js +3 -2
- package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.js +3 -2
- package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +3 -3
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV1.d.ts +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
- package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
- package/dist/core/tree/index.d.ts +1 -1
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js +7 -4
- package/dist/core/tree/index.js.map +1 -1
- package/dist/core/tree/mapTree.js +1 -2
- package/dist/core/tree/mapTree.js.map +1 -1
- package/dist/core/tree/pathTree.js +7 -8
- package/dist/core/tree/pathTree.js.map +1 -1
- package/dist/core/tree/persistedTreeTextFormat.d.ts +4 -4
- package/dist/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
- package/dist/core/tree/sparseTree.js +17 -13
- package/dist/core/tree/sparseTree.js.map +1 -1
- package/dist/core/tree/treeTextFormat.js +4 -5
- package/dist/core/tree/treeTextFormat.js.map +1 -1
- package/dist/core/tree/types.js +3 -3
- package/dist/core/tree/types.js.map +1 -1
- package/dist/core/tree/visitDelta.js +1 -2
- package/dist/core/tree/visitDelta.js.map +1 -1
- package/dist/core/tree/visitorUtils.js +5 -6
- package/dist/core/tree/visitorUtils.js.map +1 -1
- package/dist/entrypoints/alpha.d.ts +1 -1
- package/dist/entrypoints/alpha.d.ts.map +1 -1
- package/dist/entrypoints/alpha.js +6 -4
- package/dist/entrypoints/alpha.js.map +1 -1
- package/dist/entrypoints/beta.d.ts +1 -1
- package/dist/entrypoints/beta.d.ts.map +1 -1
- package/dist/entrypoints/beta.js +2 -2
- package/dist/entrypoints/beta.js.map +1 -1
- package/dist/entrypoints/legacy.d.ts +1 -1
- package/dist/entrypoints/legacy.d.ts.map +1 -1
- package/dist/entrypoints/legacy.js +2 -2
- package/dist/entrypoints/legacy.js.map +1 -1
- package/dist/entrypoints/public.d.ts +1 -1
- package/dist/entrypoints/public.d.ts.map +1 -1
- package/dist/entrypoints/public.js +1 -2
- package/dist/entrypoints/public.js.map +1 -1
- package/dist/extensibleUnionNode.d.ts.map +1 -1
- package/dist/extensibleUnionNode.js +1 -1
- package/dist/extensibleUnionNode.js.map +1 -1
- package/dist/feature-libraries/changeAtomIdBTree.js +3 -4
- package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -1
- package/dist/feature-libraries/changeAtomIdCodec.js +1 -2
- package/dist/feature-libraries/changeAtomIdCodec.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js +14 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +28 -20
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +22 -16
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +9 -11
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +15 -7
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +7 -3
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +3 -2
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.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 +2 -0
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +33 -17
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts +2 -2
- package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/versions.js +2 -2
- package/dist/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js +11 -2
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +5 -6
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +2 -3
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.js +1 -0
- package/dist/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +73 -15
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/comparison-forest/comparisonForest.js +79 -79
- package/dist/feature-libraries/comparison-forest/comparisonForest.js.map +1 -1
- package/dist/feature-libraries/cursorComparator.d.ts +8 -0
- package/dist/feature-libraries/cursorComparator.d.ts.map +1 -1
- package/dist/feature-libraries/cursorComparator.js +43 -10
- package/dist/feature-libraries/cursorComparator.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +2 -2
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js +2 -0
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
- package/dist/feature-libraries/deltaUtils.js +2 -3
- package/dist/feature-libraries/deltaUtils.js.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js +2 -0
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/dist/feature-libraries/editableTreeBinder.js +1 -2
- package/dist/feature-libraries/editableTreeBinder.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +19 -3
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js +2 -2
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.js +14 -14
- package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +28 -30
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +24 -23
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/observer.js +2 -2
- package/dist/feature-libraries/flex-tree/observer.js.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.js +5 -5
- package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +122 -117
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +49 -32
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/dist/feature-libraries/forest-summary/summaryTypes.js +2 -3
- package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +1 -1
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.js +35 -31
- package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.js +6 -7
- package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.js +2 -3
- package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +6 -7
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js +4 -4
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js +14 -12
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +63 -10
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js +3 -3
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.js +10 -0
- package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/filterEdits.d.ts +13 -0
- package/dist/feature-libraries/modular-schema/filterEdits.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/filterEdits.js +51 -0
- package/dist/feature-libraries/modular-schema/filterEdits.js.map +1 -0
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +7 -4
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js +1 -2
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js +1 -2
- package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/invert.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/invert.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/invert.js +5 -30
- package/dist/feature-libraries/modular-schema/invert.js.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.js +4 -5
- package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts +5 -7
- package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/minimizeModularChange.js +459 -10
- package/dist/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +14 -15
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -2
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -10
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +30 -97
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +9 -9
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +4 -4
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js +1 -2
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts +13 -1
- package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeUtils.js +115 -12
- package/dist/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -1
- package/dist/feature-libraries/modular-schema/prune.d.ts +2 -3
- package/dist/feature-libraries/modular-schema/prune.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/prune.js +25 -8
- package/dist/feature-libraries/modular-schema/prune.js.map +1 -1
- package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -3
- package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
- package/dist/feature-libraries/node-identifier/nodeIdentifier.js +2 -2
- package/dist/feature-libraries/node-identifier/nodeIdentifier.js.map +1 -1
- package/dist/feature-libraries/node-identifier/nodeIdentifierManager.js +3 -3
- package/dist/feature-libraries/node-identifier/nodeIdentifierManager.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +274 -267
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.js +27 -35
- package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +7 -7
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +8 -8
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +1 -2
- 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/schema-edits/schemaChangeCodecs.js +1 -2
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +3 -0
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/feature-libraries/schemaChecker.d.ts +9 -19
- package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/schemaChecker.js +135 -51
- package/dist/feature-libraries/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +8 -2
- package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
- package/dist/feature-libraries/sequence-field/filterEdits.d.ts +3 -3
- package/dist/feature-libraries/sequence-field/filterEdits.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/filterEdits.js +29 -11
- package/dist/feature-libraries/sequence-field/filterEdits.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV1.d.ts +102 -102
- package/dist/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.d.ts +79 -79
- package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV3.d.ts +56 -56
- package/dist/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.js +1 -2
- package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
- package/dist/feature-libraries/sequence-field/markListFactory.js +3 -4
- package/dist/feature-libraries/sequence-field/markListFactory.js.map +1 -1
- package/dist/feature-libraries/sequence-field/markQueue.js +4 -2
- package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/dist/feature-libraries/sequence-field/moveEffectTable.js +9 -9
- package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
- package/dist/feature-libraries/sequence-field/prune.js +1 -2
- package/dist/feature-libraries/sequence-field/prune.js.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.js +7 -2
- package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +1 -2
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.js +1 -2
- package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +2 -3
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +1 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +9 -9
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +1 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.js +54 -67
- package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.js +19 -15
- package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
- package/dist/feature-libraries/treeTextCursor.js +8 -8
- package/dist/feature-libraries/treeTextCursor.js.map +1 -1
- package/dist/feature-libraries/valueUtilities.js +4 -5
- package/dist/feature-libraries/valueUtilities.js.map +1 -1
- package/dist/index.d.ts +4 -29
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -9
- package/dist/index.js.map +1 -1
- package/dist/internalTypes.d.ts +1 -1
- package/dist/internalTypes.d.ts.map +1 -1
- package/dist/internalTypes.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/serializableDomainSchema.d.ts +1 -1
- package/dist/shared-tree/history.d.ts.map +1 -1
- package/dist/shared-tree/history.js +32 -13
- package/dist/shared-tree/history.js.map +1 -1
- package/dist/shared-tree/independentView.d.ts +27 -3
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +36 -7
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +2 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +6 -2
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/isAuditableFromOutcome.js +1 -2
- package/dist/shared-tree/isAuditableFromOutcome.js.map +1 -1
- package/dist/shared-tree/schematizeTree.js +3 -4
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +14 -4
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +107 -37
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +28 -19
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +3 -3
- 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 +12 -4
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +11 -8
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFormat.js +2 -3
- package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js +2 -0
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/transactionMinimize.d.ts.map +1 -1
- package/dist/shared-tree/transactionMinimize.js +2 -1
- package/dist/shared-tree/transactionMinimize.js.map +1 -1
- package/dist/shared-tree/transactionPostProcessor.js +2 -3
- package/dist/shared-tree/transactionPostProcessor.js.map +1 -1
- package/dist/shared-tree/tree.js +2 -2
- package/dist/shared-tree/tree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +5 -16
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +18 -11
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/{lib/simple-tree/api → dist/shared-tree}/treeBeta.d.ts +8 -65
- package/dist/shared-tree/treeBeta.d.ts.map +1 -0
- package/dist/shared-tree/treeBeta.js +70 -0
- package/dist/shared-tree/treeBeta.js.map +1 -0
- package/dist/shared-tree/treeCheckout.d.ts +5 -0
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +986 -907
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree/unhydratedTreeContext.js +3 -4
- package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +24 -20
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/branchCommitCounter.js +35 -32
- package/dist/shared-tree-core/branchCommitCounter.js.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.js +9 -8
- package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/dist/shared-tree-core/branchIdCodec.js +2 -3
- package/dist/shared-tree-core/branchIdCodec.js.map +1 -1
- package/dist/shared-tree-core/customMetadataCodec.js +2 -3
- package/dist/shared-tree-core/customMetadataCodec.js.map +1 -1
- package/dist/shared-tree-core/customMetadataFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.js +11 -9
- package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +73 -44
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +3 -3
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.js +33 -36
- package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js +1 -2
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -2
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +11 -11
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +5 -4
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +10 -9
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +6 -1
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.js +1 -2
- package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js +1 -2
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +3 -3
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts +3 -2
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +44 -22
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/summaryTypes.js +2 -2
- package/dist/shared-tree-core/summaryTypes.js.map +1 -1
- package/dist/shared-tree-core/transaction.js +36 -39
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/shared-tree-core/versionedSummarizer.js +4 -0
- package/dist/shared-tree-core/versionedSummarizer.js.map +1 -1
- package/dist/simple-tree/api/cloneTree.d.ts +11 -0
- package/dist/simple-tree/api/cloneTree.d.ts.map +1 -0
- package/dist/simple-tree/api/cloneTree.js +31 -0
- package/dist/simple-tree/api/cloneTree.js.map +1 -0
- package/dist/simple-tree/api/conciseTree.js +2 -3
- package/dist/simple-tree/api/conciseTree.js.map +1 -1
- package/dist/simple-tree/api/configuration.d.ts +4 -4
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js +21 -2
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/create.js +2 -3
- package/dist/simple-tree/api/create.js.map +1 -1
- package/dist/simple-tree/api/customTree.js +6 -6
- package/dist/simple-tree/api/customTree.js.map +1 -1
- package/dist/simple-tree/api/dirtyIndex.js +1 -2
- package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts +36 -3
- package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/dist/simple-tree/api/discrepancies.js +42 -17
- package/dist/simple-tree/api/discrepancies.js.map +1 -1
- package/dist/simple-tree/api/eraseSchemaDetails.js +2 -3
- package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -1
- package/dist/simple-tree/api/getJsonSchema.js +1 -2
- package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/getSimpleSchema.js +1 -2
- package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/dist/simple-tree/api/identifierIndex.js +1 -2
- package/dist/simple-tree/api/identifierIndex.js.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.js +2 -2
- package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +5 -4
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +5 -7
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +22 -3
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js +140 -11
- package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts +3 -7
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.js +6 -9
- package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +4 -9
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +13 -12
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +20 -22
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +78 -81
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts +7 -9
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.js +32 -35
- package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js +1 -2
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +1 -2
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/schemaStatics.d.ts +7 -7
- package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.js +2 -3
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +2 -3
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.js +1 -2
- package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +46 -2
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +54 -12
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +2 -3
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/transactionTypes.d.ts +4 -4
- package/dist/simple-tree/api/transactionTypes.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +243 -58
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js +3 -5
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeChangeEvents.d.ts +16 -4
- package/dist/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
- package/dist/simple-tree/api/treeChangeEvents.js.map +1 -1
- package/dist/simple-tree/api/treeChangeEventsBeta.d.ts +209 -0
- package/dist/simple-tree/api/treeChangeEventsBeta.d.ts.map +1 -0
- package/dist/simple-tree/api/{treeAlpha.js → treeChangeEventsBeta.js} +1 -1
- package/dist/simple-tree/api/treeChangeEventsBeta.js.map +1 -0
- package/dist/simple-tree/api/treeNodeApi.d.ts +1 -75
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +7 -7
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +8 -6
- package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +5 -6
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.js +22 -13
- package/dist/simple-tree/core/allowedTypes.js.map +1 -1
- package/dist/simple-tree/core/context.js +3 -0
- package/dist/simple-tree/core/context.js.map +1 -1
- package/dist/simple-tree/core/flexList.js +2 -3
- package/dist/simple-tree/core/flexList.js.map +1 -1
- package/dist/simple-tree/core/getOrCreateNode.js +2 -3
- package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +1 -1
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +2 -2
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/toStored.d.ts +7 -0
- package/dist/simple-tree/core/toStored.d.ts.map +1 -1
- package/dist/simple-tree/core/toStored.js.map +1 -1
- package/dist/simple-tree/core/treeNode.d.ts +3 -4
- package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNode.js +31 -32
- package/dist/simple-tree/core/treeNode.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +194 -192
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js +3 -3
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.js +25 -25
- package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
- package/dist/simple-tree/core/types.js +1 -2
- package/dist/simple-tree/core/types.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +177 -150
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/core/walkSchema.js +2 -3
- package/dist/simple-tree/core/walkSchema.js.map +1 -1
- package/dist/simple-tree/core/withType.d.ts +7 -9
- package/dist/simple-tree/core/withType.d.ts.map +1 -1
- package/dist/simple-tree/core/withType.js +6 -7
- package/dist/simple-tree/core/withType.js.map +1 -1
- package/dist/simple-tree/createContext.js +2 -3
- package/dist/simple-tree/createContext.js.map +1 -1
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/fieldSchema.js +33 -15
- package/dist/simple-tree/fieldSchema.js.map +1 -1
- package/dist/simple-tree/getTreeNodeForField.js +1 -2
- package/dist/simple-tree/getTreeNodeForField.js.map +1 -1
- package/dist/simple-tree/index.d.ts +2 -2
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +6 -8
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +18 -17
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +3 -2
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +31 -33
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js +2 -2
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/common.js +1 -2
- package/dist/simple-tree/node-kinds/common.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts +6 -6
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +10 -16
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.js +2 -2
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +27 -28
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.js +2 -2
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.js +10 -13
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -2
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.js +2 -2
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/dist/simple-tree/prepareForInsertion.js +4 -5
- package/dist/simple-tree/prepareForInsertion.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +11 -11
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/treeSchema.js +1 -2
- package/dist/simple-tree/treeSchema.js.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +3 -4
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/dist/simple-tree/walkFieldSchema.js +1 -2
- package/dist/simple-tree/walkFieldSchema.js.map +1 -1
- package/dist/tableSchema.d.ts +2 -87
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +309 -275
- package/dist/tableSchema.js.map +1 -1
- package/dist/text/codePointUtils.d.ts +16 -3
- package/dist/text/codePointUtils.d.ts.map +1 -1
- package/dist/text/codePointUtils.js +24 -13
- package/dist/text/codePointUtils.js.map +1 -1
- package/dist/text/textDomain.d.ts +7 -1
- package/dist/text/textDomain.d.ts.map +1 -1
- package/dist/text/textDomain.js +32 -28
- package/dist/text/textDomain.js.map +1 -1
- package/dist/text/textDomainFormatted.d.ts.map +1 -1
- package/dist/text/textDomainFormatted.js +45 -34
- package/dist/text/textDomainFormatted.js.map +1 -1
- package/dist/text/textDomainFormattedDefault.js +2 -5
- package/dist/text/textDomainFormattedDefault.js.map +1 -1
- package/dist/treeDataStore.js +2 -3
- package/dist/treeDataStore.js.map +1 -1
- package/dist/treeFactory.js +7 -7
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/arrayUtilities.js +5 -6
- package/dist/util/arrayUtilities.js.map +1 -1
- package/dist/util/bTreeUtils.js +3 -4
- package/dist/util/bTreeUtils.js.map +1 -1
- package/dist/util/brand.js +6 -5
- package/dist/util/brand.js.map +1 -1
- package/dist/util/brandedMap.js +2 -3
- package/dist/util/brandedMap.js.map +1 -1
- package/dist/util/breakable.d.ts.map +1 -1
- package/dist/util/breakable.js +7 -4
- package/dist/util/breakable.js.map +1 -1
- package/dist/util/cloneWithReplacements.js +1 -2
- package/dist/util/cloneWithReplacements.js.map +1 -1
- package/dist/util/compressedIds.js +29 -7
- package/dist/util/compressedIds.js.map +1 -1
- package/dist/util/idAllocator.js +3 -3
- package/dist/util/idAllocator.js.map +1 -1
- package/dist/util/nestedMap.js +15 -17
- package/dist/util/nestedMap.js.map +1 -1
- package/dist/util/nestedSet.js +2 -3
- package/dist/util/nestedSet.js.map +1 -1
- package/dist/util/offsetList.js +2 -4
- package/dist/util/offsetList.js.map +1 -1
- package/dist/util/opaque.js +2 -3
- package/dist/util/opaque.js.map +1 -1
- package/dist/util/rangeMap.js +6 -2
- package/dist/util/rangeMap.js.map +1 -1
- package/dist/util/readSnapshotBlob.d.ts.map +1 -1
- package/dist/util/referenceCounting.js +1 -0
- package/dist/util/referenceCounting.js.map +1 -1
- package/dist/util/stackyIterator.js +3 -2
- package/dist/util/stackyIterator.js.map +1 -1
- package/dist/util/typeUtils.js +1 -2
- package/dist/util/typeUtils.js.map +1 -1
- package/dist/util/typeboxBrand.js +2 -3
- package/dist/util/typeboxBrand.js.map +1 -1
- package/dist/util/utils.d.ts +2 -2
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +32 -32
- package/dist/util/utils.js.map +1 -1
- package/lib/api.d.ts +9 -1
- package/lib/api.d.ts.map +1 -1
- package/lib/api.js.map +1 -1
- package/lib/codec/codec.d.ts +2 -2
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +2 -0
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/discriminatedUnions.js +1 -0
- package/lib/codec/discriminatedUnions.js.map +1 -1
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js +2 -0
- package/lib/codec/versioned/codec.js.map +1 -1
- package/lib/componentApi.d.ts.map +1 -1
- package/lib/componentApi.js +20 -17
- package/lib/componentApi.js.map +1 -1
- package/lib/core/change-family/editBuilder.js +1 -0
- package/lib/core/change-family/editBuilder.js.map +1 -1
- package/lib/core/index.d.ts +2 -2
- 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/index.d.ts +1 -1
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/revisionTagCodec.js +3 -1
- package/lib/core/rebase/revisionTagCodec.js.map +1 -1
- package/lib/core/rebase/types.d.ts +12 -1
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +3 -0
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/schema-stored/schema.js +5 -0
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.js +4 -2
- package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/lib/core/tree/anchorSet.js +61 -54
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/deltaUtil.d.ts +34 -9
- package/lib/core/tree/deltaUtil.d.ts.map +1 -1
- package/lib/core/tree/deltaUtil.js +41 -10
- package/lib/core/tree/deltaUtil.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +23 -21
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +10 -10
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.js +2 -0
- package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV2.js +2 -0
- package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +3 -3
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/lib/core/tree/index.d.ts +1 -1
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +1 -1
- package/lib/core/tree/index.js.map +1 -1
- package/lib/core/tree/persistedTreeTextFormat.d.ts +4 -4
- package/lib/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
- package/lib/core/tree/sparseTree.js +15 -11
- package/lib/core/tree/sparseTree.js.map +1 -1
- package/lib/entrypoints/alpha.d.ts +1 -1
- package/lib/entrypoints/alpha.d.ts.map +1 -1
- package/lib/entrypoints/alpha.js +1 -1
- package/lib/entrypoints/alpha.js.map +1 -1
- package/lib/entrypoints/beta.d.ts +1 -1
- package/lib/entrypoints/beta.d.ts.map +1 -1
- package/lib/entrypoints/beta.js +1 -1
- package/lib/entrypoints/beta.js.map +1 -1
- package/lib/entrypoints/legacy.d.ts +1 -1
- package/lib/entrypoints/legacy.d.ts.map +1 -1
- package/lib/entrypoints/legacy.js +1 -1
- package/lib/entrypoints/legacy.js.map +1 -1
- package/lib/entrypoints/public.d.ts +1 -1
- package/lib/entrypoints/public.d.ts.map +1 -1
- package/lib/entrypoints/public.js +1 -1
- package/lib/entrypoints/public.js.map +1 -1
- package/lib/extensibleUnionNode.d.ts.map +1 -1
- package/lib/extensibleUnionNode.js +2 -2
- package/lib/extensibleUnionNode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js +14 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +14 -6
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +18 -12
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +1 -3
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +8 -0
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +4 -0
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +1 -0
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.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 +2 -0
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +28 -12
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts +2 -2
- package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js +9 -0
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.js +1 -0
- package/lib/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +71 -13
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/comparison-forest/comparisonForest.js +79 -79
- package/lib/feature-libraries/comparison-forest/comparisonForest.js.map +1 -1
- package/lib/feature-libraries/cursorComparator.d.ts +8 -0
- package/lib/feature-libraries/cursorComparator.d.ts.map +1 -1
- package/lib/feature-libraries/cursorComparator.js +43 -9
- package/lib/feature-libraries/cursorComparator.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +3 -0
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js +2 -0
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js +2 -0
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +19 -3
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.js +12 -12
- package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +25 -27
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +22 -21
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +122 -117
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +49 -32
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +1 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.js +33 -29
- package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js +14 -12
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +63 -10
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.js +10 -0
- package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/filterEdits.d.ts +13 -0
- package/lib/feature-libraries/modular-schema/filterEdits.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/filterEdits.js +46 -0
- package/lib/feature-libraries/modular-schema/filterEdits.js.map +1 -0
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +5 -2
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/invert.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/invert.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/invert.js +6 -30
- package/lib/feature-libraries/modular-schema/invert.js.map +1 -1
- package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts +5 -7
- package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/minimizeModularChange.js +458 -8
- package/lib/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -10
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +20 -85
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts +13 -1
- package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeUtils.js +100 -3
- package/lib/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -1
- package/lib/feature-libraries/modular-schema/prune.d.ts +2 -3
- package/lib/feature-libraries/modular-schema/prune.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/prune.js +25 -7
- package/lib/feature-libraries/modular-schema/prune.js.map +1 -1
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -3
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
- package/lib/feature-libraries/node-identifier/nodeIdentifierManager.js +1 -0
- package/lib/feature-libraries/node-identifier/nodeIdentifierManager.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +273 -266
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.js +24 -32
- package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +3 -0
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/feature-libraries/schemaChecker.d.ts +9 -19
- package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/schemaChecker.js +133 -49
- package/lib/feature-libraries/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +6 -0
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/filterEdits.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/filterEdits.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/filterEdits.js +31 -12
- package/lib/feature-libraries/sequence-field/filterEdits.js.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV1.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV2.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV3.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/markListFactory.js +3 -4
- package/lib/feature-libraries/sequence-field/markListFactory.js.map +1 -1
- package/lib/feature-libraries/sequence-field/markQueue.js +4 -2
- package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.js +6 -0
- package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +9 -9
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.js +3 -15
- package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.js +13 -9
- package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
- package/lib/index.d.ts +4 -29
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -17
- package/lib/index.js.map +1 -1
- package/lib/internalTypes.d.ts +1 -1
- package/lib/internalTypes.d.ts.map +1 -1
- package/lib/internalTypes.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/serializableDomainSchema.d.ts +1 -1
- package/lib/shared-tree/history.d.ts.map +1 -1
- package/lib/shared-tree/history.js +32 -13
- package/lib/shared-tree/history.js.map +1 -1
- package/lib/shared-tree/independentView.d.ts +27 -3
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +30 -2
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +2 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +2 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +14 -4
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +109 -39
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +24 -15
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js +12 -4
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +6 -3
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js +2 -0
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/transactionMinimize.d.ts.map +1 -1
- package/lib/shared-tree/transactionMinimize.js +4 -3
- package/lib/shared-tree/transactionMinimize.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +5 -16
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +13 -6
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/{dist/simple-tree/api → lib/shared-tree}/treeBeta.d.ts +8 -65
- package/lib/shared-tree/treeBeta.d.ts.map +1 -0
- package/lib/shared-tree/treeBeta.js +64 -0
- package/lib/shared-tree/treeBeta.js.map +1 -0
- package/lib/shared-tree/treeCheckout.d.ts +5 -0
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +985 -906
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree/unhydratedTreeContext.js +3 -4
- package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +22 -18
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/branchCommitCounter.js +35 -32
- package/lib/shared-tree-core/branchCommitCounter.js.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.js +9 -8
- package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/lib/shared-tree-core/customMetadataFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.js +11 -9
- package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +73 -44
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.js +32 -34
- package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +4 -4
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +2 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +6 -1
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +2 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts +2 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +45 -23
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.js +36 -39
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/shared-tree-core/versionedSummarizer.js +4 -0
- package/lib/shared-tree-core/versionedSummarizer.js.map +1 -1
- package/lib/simple-tree/api/cloneTree.d.ts +11 -0
- package/lib/simple-tree/api/cloneTree.d.ts.map +1 -0
- package/lib/simple-tree/api/cloneTree.js +28 -0
- package/lib/simple-tree/api/cloneTree.js.map +1 -0
- package/lib/simple-tree/api/configuration.d.ts +4 -4
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js +19 -0
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts +36 -3
- package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/lib/simple-tree/api/discrepancies.js +40 -14
- package/lib/simple-tree/api/discrepancies.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +5 -4
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +2 -2
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +22 -3
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.js +136 -7
- package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts +3 -7
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.js +1 -3
- package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +4 -9
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +9 -8
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +18 -20
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +78 -81
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts +7 -9
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.js +32 -35
- package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/lib/simple-tree/api/schemaStatics.d.ts +7 -7
- package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +46 -2
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js +48 -6
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/lib/simple-tree/api/transactionTypes.d.ts +4 -4
- package/lib/simple-tree/api/transactionTypes.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +243 -58
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js +2 -3
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeChangeEvents.d.ts +16 -4
- package/lib/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
- package/lib/simple-tree/api/treeChangeEvents.js.map +1 -1
- package/lib/simple-tree/api/treeChangeEventsBeta.d.ts +209 -0
- package/lib/simple-tree/api/treeChangeEventsBeta.d.ts.map +1 -0
- package/lib/simple-tree/api/{treeAlpha.js → treeChangeEventsBeta.js} +1 -1
- package/lib/simple-tree/api/treeChangeEventsBeta.js.map +1 -0
- package/lib/simple-tree/api/treeNodeApi.d.ts +1 -75
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +1 -1
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +8 -6
- package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.js +12 -3
- package/lib/simple-tree/core/allowedTypes.js.map +1 -1
- package/lib/simple-tree/core/context.js +3 -0
- package/lib/simple-tree/core/context.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +1 -1
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +1 -1
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/toStored.d.ts +7 -0
- package/lib/simple-tree/core/toStored.d.ts.map +1 -1
- package/lib/simple-tree/core/toStored.js.map +1 -1
- package/lib/simple-tree/core/treeNode.d.ts +3 -4
- package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNode.js +29 -30
- package/lib/simple-tree/core/treeNode.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +181 -179
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.js +22 -22
- package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +173 -146
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/core/withType.d.ts +7 -9
- package/lib/simple-tree/core/withType.d.ts.map +1 -1
- package/lib/simple-tree/core/withType.js +5 -6
- package/lib/simple-tree/core/withType.js.map +1 -1
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/fieldSchema.js +23 -5
- package/lib/simple-tree/fieldSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +2 -2
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +2 -2
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +16 -15
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +3 -2
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +28 -32
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts +6 -6
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +10 -17
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.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 +25 -28
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.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 +10 -14
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -2
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/lib/tableSchema.d.ts +2 -87
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +309 -275
- package/lib/tableSchema.js.map +1 -1
- package/lib/text/codePointUtils.d.ts +16 -3
- package/lib/text/codePointUtils.d.ts.map +1 -1
- package/lib/text/codePointUtils.js +22 -10
- package/lib/text/codePointUtils.js.map +1 -1
- package/lib/text/textDomain.d.ts +7 -1
- package/lib/text/textDomain.d.ts.map +1 -1
- package/lib/text/textDomain.js +21 -17
- package/lib/text/textDomain.js.map +1 -1
- package/lib/text/textDomainFormatted.d.ts.map +1 -1
- package/lib/text/textDomainFormatted.js +43 -32
- package/lib/text/textDomainFormatted.js.map +1 -1
- package/lib/text/textDomainFormattedDefault.js +2 -5
- package/lib/text/textDomainFormattedDefault.js.map +1 -1
- package/lib/util/brand.js +1 -0
- package/lib/util/brand.js.map +1 -1
- package/lib/util/breakable.d.ts.map +1 -1
- package/lib/util/breakable.js +3 -0
- package/lib/util/breakable.js.map +1 -1
- package/lib/util/compressedIds.js +22 -0
- package/lib/util/compressedIds.js.map +1 -1
- package/lib/util/nestedMap.js +2 -4
- package/lib/util/nestedMap.js.map +1 -1
- package/lib/util/offsetList.js +2 -4
- package/lib/util/offsetList.js.map +1 -1
- package/lib/util/rangeMap.js +4 -0
- package/lib/util/rangeMap.js.map +1 -1
- package/lib/util/readSnapshotBlob.d.ts.map +1 -1
- package/lib/util/referenceCounting.js +1 -0
- package/lib/util/referenceCounting.js.map +1 -1
- package/lib/util/stackyIterator.js +3 -2
- package/lib/util/stackyIterator.js.map +1 -1
- package/lib/util/utils.d.ts +2 -2
- package/lib/util/utils.d.ts.map +1 -1
- package/package.json +67 -95
- package/src/api.ts +11 -0
- package/src/core/index.ts +6 -2
- package/src/core/rebase/index.ts +1 -0
- package/src/core/rebase/types.ts +16 -1
- package/src/core/tree/anchorSet.ts +2 -2
- package/src/core/tree/deltaUtil.ts +67 -13
- package/src/core/tree/index.ts +5 -2
- package/src/entrypoints/alpha.ts +21 -20
- package/src/entrypoints/beta.ts +14 -5
- package/src/entrypoints/legacy.ts +14 -5
- package/src/entrypoints/public.ts +1 -5
- package/src/extensibleUnionNode.ts +1 -2
- package/src/feature-libraries/cursorComparator.ts +57 -9
- package/src/feature-libraries/index.ts +1 -1
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +77 -12
- package/src/feature-libraries/modular-schema/filterEdits.ts +108 -0
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +7 -4
- package/src/feature-libraries/modular-schema/index.ts +5 -2
- package/src/feature-libraries/modular-schema/invert.ts +16 -61
- package/src/feature-libraries/modular-schema/minimizeModularChange.ts +831 -10
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +10 -124
- package/src/feature-libraries/modular-schema/modularChangeUtils.ts +164 -2
- package/src/feature-libraries/modular-schema/prune.ts +52 -10
- package/src/feature-libraries/optional-field/optionalField.ts +30 -42
- package/src/feature-libraries/schemaChecker.ts +198 -82
- package/src/feature-libraries/sequence-field/filterEdits.ts +62 -26
- package/src/feature-libraries/sequence-field/utils.ts +7 -19
- package/src/index.ts +10 -39
- package/src/internalTypes.ts +1 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/history.ts +41 -19
- package/src/shared-tree/independentView.ts +40 -3
- package/src/shared-tree/index.ts +5 -1
- package/src/shared-tree/schematizingTreeView.ts +77 -23
- package/src/shared-tree/sharedTree.ts +2 -1
- package/src/shared-tree/transactionMinimize.ts +13 -4
- package/src/shared-tree/treeAlpha.ts +17 -31
- package/src/{simple-tree/api → shared-tree}/treeBeta.ts +56 -167
- package/src/shared-tree/treeCheckout.ts +82 -9
- package/src/shared-tree-core/editManager.ts +16 -8
- package/src/shared-tree-core/editManagerCodecsCommons.ts +30 -34
- package/src/shared-tree-core/editManagerCodecsV1toV4.ts +1 -1
- package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +2 -2
- package/src/simple-tree/api/cloneTree.ts +47 -0
- package/src/simple-tree/api/configuration.ts +4 -4
- package/src/simple-tree/api/discrepancies.ts +100 -5
- package/src/simple-tree/api/index.ts +22 -22
- package/src/simple-tree/api/schemaCompatibilityTester.ts +185 -11
- package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -2
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +87 -6
- package/src/simple-tree/api/transactionTypes.ts +4 -4
- package/src/simple-tree/api/tree.ts +318 -87
- package/src/simple-tree/api/treeChangeEvents.ts +16 -4
- package/src/simple-tree/api/treeChangeEventsBeta.ts +245 -0
- package/src/simple-tree/api/treeNodeApi.ts +6 -85
- package/src/simple-tree/api/typesUnsafe.ts +8 -6
- package/src/simple-tree/core/index.ts +1 -1
- package/src/simple-tree/core/toStored.ts +8 -0
- package/src/simple-tree/core/treeNode.ts +3 -10
- package/src/simple-tree/core/treeNodeValid.ts +3 -1
- package/src/simple-tree/core/withType.ts +8 -11
- package/src/simple-tree/index.ts +7 -7
- package/src/simple-tree/node-kinds/array/arrayNode.ts +14 -12
- package/src/simple-tree/node-kinds/map/mapNode.ts +14 -15
- package/src/simple-tree/node-kinds/object/objectNode.ts +3 -6
- package/src/simple-tree/node-kinds/record/recordNode.ts +6 -8
- package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +2 -1
- package/src/tableSchema.ts +8 -187
- package/src/text/codePointUtils.ts +25 -14
- package/src/text/textDomain.ts +15 -2
- package/src/text/textDomainFormatted.ts +9 -4
- package/tsconfig.json +1 -1
- package/alpha.d.ts +0 -11
- package/beta.d.ts +0 -11
- package/dist/simple-tree/api/treeAlpha.d.ts +0 -126
- package/dist/simple-tree/api/treeAlpha.d.ts.map +0 -1
- package/dist/simple-tree/api/treeAlpha.js.map +0 -1
- package/dist/simple-tree/api/treeBeta.d.ts.map +0 -1
- package/dist/simple-tree/api/treeBeta.js +0 -83
- package/dist/simple-tree/api/treeBeta.js.map +0 -1
- package/docs/main/runtime-schema-upgrade.md +0 -208
- package/internal.d.ts +0 -11
- package/legacy.d.ts +0 -11
- package/lib/simple-tree/api/treeAlpha.d.ts +0 -126
- package/lib/simple-tree/api/treeAlpha.d.ts.map +0 -1
- package/lib/simple-tree/api/treeAlpha.js.map +0 -1
- package/lib/simple-tree/api/treeBeta.d.ts.map +0 -1
- package/lib/simple-tree/api/treeBeta.js +0 -77
- package/lib/simple-tree/api/treeBeta.js.map +0 -1
- package/src/simple-tree/api/treeAlpha.ts +0 -153
- /package/api-extractor/{api-extractor.current.json → api-extractor-report.current.json} +0 -0
- /package/api-extractor/{api-extractor.legacy.json → api-extractor-report.legacy.json} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invert.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/invert.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OA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AAC,CAAC;IACnE,CAAC;IAED,IAAY,KAAK;QAChB,OAAO,IAAI,CAAC,eAA8B,CAAC;IAC5C,CAAC;CACD;AAED,SAAS,sBAAsB,CAC9B,MAAsB,EACtB,KAAuC,EACvC,UAA2D;IAE3D,MAAM,IAAI,GAAuB,qBAAqB,EAAE,CAAC;IACzD,qCAAqC,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;IAC3E,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE;QAC/C,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACrC,qCAAqC,CACpC,IAAI,EACJ,IAAI,CAAC,YAAY,EACjB;gBACC,QAAQ;gBACR,OAAO;aACP,EACD,UAAU,CACV,CAAC;QACH,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACb,CAAC;AAED,SAAS,qCAAqC,CAC7C,KAAyB,EACzB,MAAsB,EACtB,MAA0B,EAC1B,UAA2D;IAE3D,KAAK,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,IAAI,MAAM,EAAE,CAAC;QAC9C,MAAM,IAAI,GAAG,gBAAgB,CAAC,UAAU,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC,iBAAiB,CACjF,WAAW,CAAC,MAAM,CAClB,CAAC;QACF,KAAK,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC;YACnC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC5D,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport {\n\trevisionMetadataSourceFromInfo,\n\ttype ChangeAtomId,\n\ttype ChangesetLocalId,\n\ttype FieldKindIdentifier,\n\ttype RevisionInfo,\n\ttype RevisionMetadataSource,\n\ttype RevisionTag,\n\ttype TaggedChange,\n\ttype TreeChunk,\n} from \"../../core/index.js\";\nimport { brand, idAllocatorFromMaxId, type IdAllocator } from \"../../util/index.js\";\nimport {\n\tnewChangeAtomIdBTree,\n\tsetInChangeAtomIdMap,\n\ttype ChangeAtomIdBTree,\n} from \"../changeAtomIdBTree.js\";\nimport {\n\tnewCrossFieldKeyTable,\n\ttype CrossFieldKeyTable,\n\ttype FieldChange,\n\ttype FieldChangeMap,\n\ttype FieldId,\n\ttype ModularChangeset,\n\ttype NodeChangeset,\n\ttype NodeId,\n} from \"./modularChangeTypes.js\";\nimport {\n\tCrossFieldManagerI,\n\tgetChangeHandler,\n\tgetRevInfoFromTaggedChanges,\n\thasConflicts,\n\tmakeModularChangeset,\n\tnewConstraintState,\n\tnewCrossFieldTable,\n\tupdateConstraintsForFields,\n\ttype CrossFieldTable,\n} from \"./modularChangeUtils.js\";\nimport type { CrossFieldTarget } from \"./crossFieldQueries.js\";\nimport type { FlexFieldKind } from \"./fieldKind.js\";\nimport { NodeAttachState } from \"./fieldChangeHandler.js\";\n\n/**\n * @param change - The change to invert.\n * @param isRollback - Whether the inverted change is meant to rollback a change on a branch as is the case when\n * performing a sandwich rebase.\n * @param revisionForInvert - The revision for the invert changeset.\n */\nexport function invertModularChange(\n\tchange: TaggedChange<ModularChangeset>,\n\tisRollback: boolean,\n\trevisionForInvert: RevisionTag,\n\tfieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>,\n): ModularChangeset {\n\t// Rollback changesets destroy the nodes created by the change being rolled back.\n\tconst destroys = isRollback ? invertBuilds(change.change.builds) : undefined;\n\n\t// Destroys only occur in rollback changesets, which are never inverted.\n\tassert(\n\t\tchange.change.destroys === undefined,\n\t\t0x89a /* Unexpected destroys in change to invert */,\n\t);\n\n\tconst revInfos: RevisionInfo[] = isRollback\n\t\t? [{ revision: revisionForInvert, rollbackOf: change.revision }]\n\t\t: [{ revision: revisionForInvert }];\n\n\tconst noChangeConstraint = change.change.noChangeConstraintOnRevert;\n\tconst noChangeConstraintOnRevert = change.change.noChangeConstraint;\n\n\tif (hasConflicts(change.change)) {\n\t\treturn makeModularChangeset({\n\t\t\tmaxId: change.change.maxId as number,\n\t\t\trevisions: revInfos,\n\t\t\tdestroys,\n\t\t});\n\t}\n\n\tconst genId: IdAllocator = idAllocatorFromMaxId(change.change.maxId ?? -1);\n\n\tconst crossFieldTable: InvertTable = {\n\t\t...newCrossFieldTable<FieldChange>(),\n\t\toriginalFieldToContext: new Map(),\n\t\tinvertedNodeToParent: brand(change.change.nodeToParent.clone()),\n\t};\n\tconst { revInfos: oldRevInfos } = getRevInfoFromTaggedChanges([change]);\n\tconst revisionMetadata = revisionMetadataSourceFromInfo(oldRevInfos);\n\n\tconst invertedFields = invertFieldMap(\n\t\tchange.change.fieldChanges,\n\t\tundefined,\n\t\tisRollback,\n\t\tgenId,\n\t\tcrossFieldTable,\n\t\trevisionMetadata,\n\t\trevisionForInvert,\n\t\tfieldKinds,\n\t);\n\n\tconst invertedNodes = newChangeAtomIdBTree<NodeChangeset>();\n\tchange.change.nodeChanges.forEachPair(([revision, localId], nodeChangeset) => {\n\t\tinvertedNodes.set(\n\t\t\t[revision, localId],\n\t\t\tinvertNodeChange(\n\t\t\t\tnodeChangeset,\n\t\t\t\t{ revision, localId },\n\t\t\t\tisRollback,\n\t\t\t\tgenId,\n\t\t\t\tcrossFieldTable,\n\t\t\t\trevisionMetadata,\n\t\t\t\trevisionForInvert,\n\t\t\t\tfieldKinds,\n\t\t\t),\n\t\t);\n\t});\n\n\tif (crossFieldTable.invalidatedFields.size > 0) {\n\t\tconst fieldsToUpdate = crossFieldTable.invalidatedFields;\n\t\tcrossFieldTable.invalidatedFields = new Set();\n\t\tfor (const fieldChange of fieldsToUpdate) {\n\t\t\tconst originalFieldChange = fieldChange.change;\n\t\t\tconst context = crossFieldTable.originalFieldToContext.get(fieldChange);\n\t\t\tassert(\n\t\t\t\tcontext !== undefined,\n\t\t\t\t0x851 /* Should have context for every invalidated field */,\n\t\t\t);\n\t\t\tconst { invertedField, fieldId } = context;\n\n\t\t\tconst amendedChange = getChangeHandler(fieldKinds, fieldChange.fieldKind).rebaser.invert(\n\t\t\t\toriginalFieldChange,\n\t\t\t\tisRollback,\n\t\t\t\tgenId,\n\t\t\t\trevisionForInvert,\n\t\t\t\tnew InvertManager(crossFieldTable, fieldChange, fieldId),\n\t\t\t\trevisionMetadata,\n\t\t\t);\n\t\t\tinvertedField.change = brand(amendedChange);\n\t\t}\n\t}\n\n\tconst crossFieldKeys = makeCrossFieldKeyTable(invertedFields, invertedNodes, fieldKinds);\n\n\tconst constraintState = newConstraintState(0);\n\tupdateConstraintsForFields(\n\t\tinvertedFields,\n\t\tNodeAttachState.Attached,\n\t\tconstraintState,\n\t\tinvertedNodes,\n\t\tfieldKinds,\n\t);\n\n\treturn makeModularChangeset({\n\t\tfieldChanges: invertedFields,\n\t\tnodeChanges: invertedNodes,\n\t\tnodeToParent: crossFieldTable.invertedNodeToParent,\n\t\tnodeAliases: change.change.nodeAliases,\n\t\tcrossFieldKeys,\n\t\tmaxId: genId.getMaxId(),\n\t\trevisions: revInfos,\n\t\tconstraintViolationCount: constraintState.violationCount,\n\t\tnoChangeConstraint,\n\t\tnoChangeConstraintOnRevert,\n\t\tdestroys,\n\t});\n}\n\nfunction invertFieldMap(\n\tchanges: FieldChangeMap,\n\tparentId: NodeId | undefined,\n\tisRollback: boolean,\n\tgenId: IdAllocator,\n\tcrossFieldTable: InvertTable,\n\trevisionMetadata: RevisionMetadataSource,\n\trevisionForInvert: RevisionTag,\n\tfieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>,\n): FieldChangeMap {\n\tconst invertedFields: FieldChangeMap = new Map();\n\n\tfor (const [field, fieldChange] of changes) {\n\t\tconst fieldId = { nodeId: parentId, field };\n\t\tconst manager = new InvertManager(crossFieldTable, fieldChange, fieldId);\n\t\tconst invertedChange = getChangeHandler(fieldKinds, fieldChange.fieldKind).rebaser.invert(\n\t\t\tfieldChange.change,\n\t\t\tisRollback,\n\t\t\tgenId,\n\t\t\trevisionForInvert,\n\t\t\tmanager,\n\t\t\trevisionMetadata,\n\t\t);\n\n\t\tconst invertedFieldChange: FieldChange = {\n\t\t\t...fieldChange,\n\t\t\tchange: brand(invertedChange),\n\t\t};\n\t\tinvertedFields.set(field, invertedFieldChange);\n\n\t\tcrossFieldTable.originalFieldToContext.set(fieldChange, {\n\t\t\tfieldId,\n\t\t\tinvertedField: invertedFieldChange,\n\t\t});\n\t}\n\n\treturn invertedFields;\n}\n\nfunction invertNodeChange(\n\tchange: NodeChangeset,\n\tid: NodeId,\n\tisRollback: boolean,\n\tgenId: IdAllocator,\n\tcrossFieldTable: InvertTable,\n\trevisionMetadata: RevisionMetadataSource,\n\trevisionForInvert: RevisionTag,\n\tfieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>,\n): NodeChangeset {\n\tconst inverse: NodeChangeset = {};\n\n\t// If the node has a constraint, it should be inverted to a node-exist-on-revert constraint. This ensure that if\n\t// the inverse is inverted again, the original input constraint will be restored.\n\tif (change.nodeExistsConstraint !== undefined) {\n\t\tinverse.nodeExistsConstraintOnRevert = change.nodeExistsConstraint;\n\t}\n\n\t// The node-exist-on-revert constraint of a node is the constraint that should apply when the a change is reverted.\n\t// So, it should become the constraint in the inverse. If this constraint is violated when applying the inverse,\n\t// it will be discarded.\n\tif (change.nodeExistsConstraintOnRevert !== undefined) {\n\t\tinverse.nodeExistsConstraint = change.nodeExistsConstraintOnRevert;\n\t}\n\n\tif (change.fieldChanges !== undefined) {\n\t\tinverse.fieldChanges = invertFieldMap(\n\t\t\tchange.fieldChanges,\n\t\t\tid,\n\t\t\tisRollback,\n\t\t\tgenId,\n\t\t\tcrossFieldTable,\n\t\t\trevisionMetadata,\n\t\t\trevisionForInvert,\n\t\t\tfieldKinds,\n\t\t);\n\t}\n\n\treturn inverse;\n}\n\nfunction invertBuilds(\n\tbuilds: ChangeAtomIdBTree<TreeChunk> | undefined,\n): ChangeAtomIdBTree<number> | undefined {\n\tif (builds !== undefined) {\n\t\treturn brand(builds.mapValues((chunk) => chunk.topLevelLength));\n\t}\n\treturn undefined;\n}\n\ninterface InvertTable extends CrossFieldTable<FieldChange> {\n\toriginalFieldToContext: Map<FieldChange, InvertContext>;\n\tinvertedNodeToParent: ChangeAtomIdBTree<FieldId>;\n}\n\ninterface InvertContext {\n\tfieldId: FieldId;\n\tinvertedField: FieldChange;\n}\n\nclass InvertManager extends CrossFieldManagerI<FieldChange> {\n\tpublic constructor(\n\t\ttable: InvertTable,\n\t\tfield: FieldChange,\n\t\tprivate readonly fieldId: FieldId,\n\t\tallowInval = true,\n\t) {\n\t\tsuper(table, field, allowInval);\n\t}\n\n\tpublic override onMoveIn(id: ChangeAtomId): void {\n\t\tsetInChangeAtomIdMap(this.table.invertedNodeToParent, id, this.fieldId);\n\t}\n\n\tpublic override moveKey(\n\t\ttarget: CrossFieldTarget,\n\t\trevision: RevisionTag | undefined,\n\t\tid: ChangesetLocalId,\n\t\tcount: number,\n\t): void {\n\t\tfail(0x9c5 /* Keys should not be moved manually during invert */);\n\t}\n\n\tprivate get table(): InvertTable {\n\t\treturn this.crossFieldTable as InvertTable;\n\t}\n}\n\nfunction makeCrossFieldKeyTable(\n\tfields: FieldChangeMap,\n\tnodes: ChangeAtomIdBTree<NodeChangeset>,\n\tfieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>,\n): CrossFieldKeyTable {\n\tconst keys: CrossFieldKeyTable = newCrossFieldKeyTable();\n\tpopulateCrossFieldKeyTableForFieldMap(keys, fields, undefined, fieldKinds);\n\tnodes.forEachPair(([revision, localId], node) => {\n\t\tif (node.fieldChanges !== undefined) {\n\t\t\tpopulateCrossFieldKeyTableForFieldMap(\n\t\t\t\tkeys,\n\t\t\t\tnode.fieldChanges,\n\t\t\t\t{\n\t\t\t\t\trevision,\n\t\t\t\t\tlocalId,\n\t\t\t\t},\n\t\t\t\tfieldKinds,\n\t\t\t);\n\t\t}\n\t});\n\n\treturn keys;\n}\n\nfunction populateCrossFieldKeyTableForFieldMap(\n\ttable: CrossFieldKeyTable,\n\tfields: FieldChangeMap,\n\tparent: NodeId | undefined,\n\tfieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>,\n): void {\n\tfor (const [fieldKey, fieldChange] of fields) {\n\t\tconst keys = getChangeHandler(fieldKinds, fieldChange.fieldKind).getCrossFieldKeys(\n\t\t\tfieldChange.change,\n\t\t);\n\t\tfor (const { key, count } of keys) {\n\t\t\ttable.set(key, count, { nodeId: parent, field: fieldKey });\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"invert.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/invert.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EACN,8BAA8B,GAS9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,oBAAoB,EAAoB,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAA0B,MAAM,yBAAyB,CAAC;AASvF,OAAO,EACN,kBAAkB,EAClB,gBAAgB,EAChB,2BAA2B,EAC3B,YAAY,EACZ,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,0BAA0B,GAE1B,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAClC,MAAsC,EACtC,UAAmB,EACnB,iBAA8B,EAC9B,UAA2D;IAE3D,iFAAiF;IACjF,MAAM,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAC,YAAY,C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CAAC;AAClB,CAAC;AAWD,MAAM,aAAc,SAAQ,kBAA+B;IAIxC;IAHlB,YACC,KAAkB,EAClB,KAAkB,EACD,OAAgB,EACjC,UAAU,GAAG,IAAI;QAEjB,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;QAHf,YAAO,GAAP,OAAO,CAAS;IAIlC,CAAC;IAEe,QAAQ,CAAC,EAAgB,IAAS,CAAC;IAEnC,OAAO,CACtB,MAAwB,EACxB,QAAiC,EACjC,EAAoB,EACpB,KAAa;QAEb,IAAI,CAAC,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACnE,CAAC;IAED,IAAY,KAAK;QAChB,OAAO,IAAI,CAAC,eAA8B,CAAC;IAC5C,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport {\n\trevisionMetadataSourceFromInfo,\n\ttype ChangeAtomId,\n\ttype ChangesetLocalId,\n\ttype FieldKindIdentifier,\n\ttype RevisionInfo,\n\ttype RevisionMetadataSource,\n\ttype RevisionTag,\n\ttype TaggedChange,\n\ttype TreeChunk,\n} from \"../../core/index.js\";\nimport { brand, idAllocatorFromMaxId, type IdAllocator } from \"../../util/index.js\";\nimport { newChangeAtomIdBTree, type ChangeAtomIdBTree } from \"../changeAtomIdBTree.js\";\nimport type {\n\tFieldChange,\n\tFieldChangeMap,\n\tFieldId,\n\tModularChangeset,\n\tNodeChangeset,\n\tNodeId,\n} from \"./modularChangeTypes.js\";\nimport {\n\tCrossFieldManagerI,\n\tgetChangeHandler,\n\tgetRevInfoFromTaggedChanges,\n\thasConflicts,\n\tmakeChangesetInversions,\n\tmakeModularChangeset,\n\tnewConstraintState,\n\tnewCrossFieldTable,\n\tupdateConstraintsForFields,\n\ttype CrossFieldTable,\n} from \"./modularChangeUtils.js\";\nimport type { CrossFieldTarget } from \"./crossFieldQueries.js\";\nimport type { FlexFieldKind } from \"./fieldKind.js\";\nimport { NodeAttachState } from \"./fieldChangeHandler.js\";\n\n/**\n * @param change - The change to invert.\n * @param isRollback - Whether the inverted change is meant to rollback a change on a branch as is the case when\n * performing a sandwich rebase.\n * @param revisionForInvert - The revision for the invert changeset.\n */\nexport function invertModularChange(\n\tchange: TaggedChange<ModularChangeset>,\n\tisRollback: boolean,\n\trevisionForInvert: RevisionTag,\n\tfieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>,\n): ModularChangeset {\n\t// Rollback changesets destroy the nodes created by the change being rolled back.\n\tconst destroys = isRollback ? invertBuilds(change.change.builds) : undefined;\n\n\t// Destroys only occur in rollback changesets, which are never inverted.\n\tassert(\n\t\tchange.change.destroys === undefined,\n\t\t0x89a /* Unexpected destroys in change to invert */,\n\t);\n\n\tconst revInfos: RevisionInfo[] = isRollback\n\t\t? [{ revision: revisionForInvert, rollbackOf: change.revision }]\n\t\t: [{ revision: revisionForInvert }];\n\n\tconst noChangeConstraint = change.change.noChangeConstraintOnRevert;\n\tconst noChangeConstraintOnRevert = change.change.noChangeConstraint;\n\n\tif (hasConflicts(change.change)) {\n\t\treturn makeModularChangeset({\n\t\t\tmaxId: change.change.maxId as number,\n\t\t\trevisions: revInfos,\n\t\t\tdestroys,\n\t\t});\n\t}\n\n\tconst genId: IdAllocator = idAllocatorFromMaxId(change.change.maxId ?? -1);\n\n\tconst crossFieldTable: InvertTable = {\n\t\t...newCrossFieldTable<FieldChange>(),\n\t\toriginalFieldToContext: new Map(),\n\t};\n\tconst { revInfos: oldRevInfos } = getRevInfoFromTaggedChanges([change]);\n\tconst revisionMetadata = revisionMetadataSourceFromInfo(oldRevInfos);\n\n\tconst invertedFields = invertFieldMap(\n\t\tchange.change.fieldChanges,\n\t\tundefined,\n\t\tisRollback,\n\t\tgenId,\n\t\tcrossFieldTable,\n\t\trevisionMetadata,\n\t\trevisionForInvert,\n\t\tfieldKinds,\n\t);\n\n\tconst invertedNodes = newChangeAtomIdBTree<NodeChangeset>();\n\tchange.change.nodeChanges.forEachPair(([revision, localId], nodeChangeset) => {\n\t\tinvertedNodes.set(\n\t\t\t[revision, localId],\n\t\t\tinvertNodeChange(\n\t\t\t\tnodeChangeset,\n\t\t\t\t{ revision, localId },\n\t\t\t\tisRollback,\n\t\t\t\tgenId,\n\t\t\t\tcrossFieldTable,\n\t\t\t\trevisionMetadata,\n\t\t\t\trevisionForInvert,\n\t\t\t\tfieldKinds,\n\t\t\t),\n\t\t);\n\t});\n\n\tif (crossFieldTable.invalidatedFields.size > 0) {\n\t\tconst fieldsToUpdate = crossFieldTable.invalidatedFields;\n\t\tcrossFieldTable.invalidatedFields = new Set();\n\t\tfor (const fieldChange of fieldsToUpdate) {\n\t\t\tconst originalFieldChange = fieldChange.change;\n\t\t\tconst context = crossFieldTable.originalFieldToContext.get(fieldChange);\n\t\t\tassert(\n\t\t\t\tcontext !== undefined,\n\t\t\t\t0x851 /* Should have context for every invalidated field */,\n\t\t\t);\n\t\t\tconst { invertedField, fieldId } = context;\n\n\t\t\tconst amendedChange = getChangeHandler(fieldKinds, fieldChange.fieldKind).rebaser.invert(\n\t\t\t\toriginalFieldChange,\n\t\t\t\tisRollback,\n\t\t\t\tgenId,\n\t\t\t\trevisionForInvert,\n\t\t\t\tnew InvertManager(crossFieldTable, fieldChange, fieldId),\n\t\t\t\trevisionMetadata,\n\t\t\t);\n\t\t\tinvertedField.change = brand(amendedChange);\n\t\t}\n\t}\n\n\tconst { crossFieldKeys, nodeToParent } = makeChangesetInversions(\n\t\tinvertedFields,\n\t\tinvertedNodes,\n\t\tfieldKinds,\n\t);\n\n\tconst constraintState = newConstraintState(0);\n\tupdateConstraintsForFields(\n\t\tinvertedFields,\n\t\tNodeAttachState.Attached,\n\t\tconstraintState,\n\t\tinvertedNodes,\n\t\tfieldKinds,\n\t);\n\n\treturn makeModularChangeset({\n\t\tfieldChanges: invertedFields,\n\t\tnodeChanges: invertedNodes,\n\t\tnodeToParent,\n\t\tnodeAliases: change.change.nodeAliases,\n\t\tcrossFieldKeys,\n\t\tmaxId: genId.getMaxId(),\n\t\trevisions: revInfos,\n\t\tconstraintViolationCount: constraintState.violationCount,\n\t\tnoChangeConstraint,\n\t\tnoChangeConstraintOnRevert,\n\t\tdestroys,\n\t});\n}\n\nfunction invertFieldMap(\n\tchanges: FieldChangeMap,\n\tparentId: NodeId | undefined,\n\tisRollback: boolean,\n\tgenId: IdAllocator,\n\tcrossFieldTable: InvertTable,\n\trevisionMetadata: RevisionMetadataSource,\n\trevisionForInvert: RevisionTag,\n\tfieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>,\n): FieldChangeMap {\n\tconst invertedFields: FieldChangeMap = new Map();\n\n\tfor (const [field, fieldChange] of changes) {\n\t\tconst fieldId = { nodeId: parentId, field };\n\t\tconst manager = new InvertManager(crossFieldTable, fieldChange, fieldId);\n\t\tconst invertedChange = getChangeHandler(fieldKinds, fieldChange.fieldKind).rebaser.invert(\n\t\t\tfieldChange.change,\n\t\t\tisRollback,\n\t\t\tgenId,\n\t\t\trevisionForInvert,\n\t\t\tmanager,\n\t\t\trevisionMetadata,\n\t\t);\n\n\t\tconst invertedFieldChange: FieldChange = {\n\t\t\t...fieldChange,\n\t\t\tchange: brand(invertedChange),\n\t\t};\n\t\tinvertedFields.set(field, invertedFieldChange);\n\n\t\tcrossFieldTable.originalFieldToContext.set(fieldChange, {\n\t\t\tfieldId,\n\t\t\tinvertedField: invertedFieldChange,\n\t\t});\n\t}\n\n\treturn invertedFields;\n}\n\nfunction invertNodeChange(\n\tchange: NodeChangeset,\n\tid: NodeId,\n\tisRollback: boolean,\n\tgenId: IdAllocator,\n\tcrossFieldTable: InvertTable,\n\trevisionMetadata: RevisionMetadataSource,\n\trevisionForInvert: RevisionTag,\n\tfieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>,\n): NodeChangeset {\n\tconst inverse: NodeChangeset = {};\n\n\t// If the node has a constraint, it should be inverted to a node-exist-on-revert constraint. This ensure that if\n\t// the inverse is inverted again, the original input constraint will be restored.\n\tif (change.nodeExistsConstraint !== undefined) {\n\t\tinverse.nodeExistsConstraintOnRevert = change.nodeExistsConstraint;\n\t}\n\n\t// The node-exist-on-revert constraint of a node is the constraint that should apply when the a change is reverted.\n\t// So, it should become the constraint in the inverse. If this constraint is violated when applying the inverse,\n\t// it will be discarded.\n\tif (change.nodeExistsConstraintOnRevert !== undefined) {\n\t\tinverse.nodeExistsConstraint = change.nodeExistsConstraintOnRevert;\n\t}\n\n\tif (change.fieldChanges !== undefined) {\n\t\tinverse.fieldChanges = invertFieldMap(\n\t\t\tchange.fieldChanges,\n\t\t\tid,\n\t\t\tisRollback,\n\t\t\tgenId,\n\t\t\tcrossFieldTable,\n\t\t\trevisionMetadata,\n\t\t\trevisionForInvert,\n\t\t\tfieldKinds,\n\t\t);\n\t}\n\n\treturn inverse;\n}\n\nfunction invertBuilds(\n\tbuilds: ChangeAtomIdBTree<TreeChunk> | undefined,\n): ChangeAtomIdBTree<number> | undefined {\n\tif (builds !== undefined) {\n\t\treturn brand(builds.mapValues((chunk) => chunk.topLevelLength));\n\t}\n\treturn undefined;\n}\n\ninterface InvertTable extends CrossFieldTable<FieldChange> {\n\toriginalFieldToContext: Map<FieldChange, InvertContext>;\n}\n\ninterface InvertContext {\n\tfieldId: FieldId;\n\tinvertedField: FieldChange;\n}\n\nclass InvertManager extends CrossFieldManagerI<FieldChange> {\n\tpublic constructor(\n\t\ttable: InvertTable,\n\t\tfield: FieldChange,\n\t\tprivate readonly fieldId: FieldId,\n\t\tallowInval = true,\n\t) {\n\t\tsuper(table, field, allowInval);\n\t}\n\n\tpublic override onMoveIn(id: ChangeAtomId): void {}\n\n\tpublic override moveKey(\n\t\ttarget: CrossFieldTarget,\n\t\trevision: RevisionTag | undefined,\n\t\tid: ChangesetLocalId,\n\t\tcount: number,\n\t): void {\n\t\tfail(0x9c5 /* Keys should not be moved manually during invert */);\n\t}\n\n\tprivate get table(): InvertTable {\n\t\treturn this.crossFieldTable as InvertTable;\n\t}\n}\n"]}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import type
|
|
5
|
+
import { type FieldKindIdentifier, type IEditableForest } from "../../core/index.js";
|
|
6
|
+
import type { FlexFieldKind } from "./fieldKind.js";
|
|
6
7
|
import type { ModularChangeset } from "./modularChangeTypes.js";
|
|
7
8
|
/**
|
|
8
9
|
* "Minimizes" a {@link ModularChangeset} so that it contains no extraneous
|
|
@@ -13,12 +14,9 @@ import type { ModularChangeset } from "./modularChangeTypes.js";
|
|
|
13
14
|
* transaction, or changes whose effects cancel out to nothing. Minimizing reduces the size of an edit without altering
|
|
14
15
|
* its observable effect.
|
|
15
16
|
*
|
|
16
|
-
* This is the eventual home of the minimization algorithm, colocated with {@link ModularChangeFamily} so it can use its
|
|
17
|
-
* internals. It is currently a no-op that returns the change unchanged; a real implementation will be provided in a
|
|
18
|
-
* future change.
|
|
19
|
-
*
|
|
20
17
|
* @param change - The change to minimize.
|
|
21
|
-
* @param
|
|
18
|
+
* @param fieldKinds - The field kinds used in the changeset.
|
|
19
|
+
* @param forestFactory - A function that returns a new forest instance.
|
|
22
20
|
*/
|
|
23
|
-
export declare function minimizeModularChangeset(change: ModularChangeset,
|
|
21
|
+
export declare function minimizeModularChangeset(change: ModularChangeset, fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>, forestFactory: () => IEditableForest): ModularChangeset;
|
|
24
22
|
//# sourceMappingURL=minimizeModularChange.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"minimizeModularChange.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/minimizeModularChange.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"minimizeModularChange.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/minimizeModularChange.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAcN,KAAK,mBAAmB,EACxB,KAAK,eAAe,EAEpB,MAAM,qBAAqB,CAAC;AAsB7B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAIpD,OAAO,KAAK,EAIX,gBAAgB,EAGhB,MAAM,yBAAyB,CAAC;AASjC;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,gBAAgB,EACxB,UAAU,EAAE,WAAW,CAAC,mBAAmB,EAAE,aAAa,CAAC,EAC3D,aAAa,EAAE,MAAM,eAAe,GAClC,gBAAgB,CAElB"}
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
import { deltaFieldMapHasChanges, makeAnonChange, makeChangeAtomId, makeDetachedFieldIndex, newChangeAtomIdRangeMap, newChangeAtomIdTransform, offsetChangeAtomId, visitDelta, } from "../../core/index.js";
|
|
6
|
+
import { brand, hasSingle, setInNestedMap, } from "../../util/index.js";
|
|
7
|
+
import { getFromChangeAtomIdMap, newChangeAtomIdBTree, setInChangeAtomIdMap, } from "../changeAtomIdBTree.js";
|
|
8
|
+
import { CrossFieldTarget } from "./crossFieldQueries.js";
|
|
9
|
+
import { EditFilterStatus, NodeAttachState, } from "./fieldChangeHandler.js";
|
|
10
|
+
import { filterEdits } from "./filterEdits.js";
|
|
11
|
+
import { invertModularChange } from "./invert.js";
|
|
12
|
+
import { intoDelta } from "./modularChangeFamily.js";
|
|
13
|
+
import { getChangeHandler, nodeChangeFromId, normalizeNodeId, validateChangeset, } from "./modularChangeUtils.js";
|
|
14
|
+
import { assert, fail } from "@fluidframework/core-utils/internal";
|
|
5
15
|
/**
|
|
6
16
|
* "Minimizes" a {@link ModularChangeset} so that it contains no extraneous
|
|
7
17
|
* information, i.e. no new content that isn't observable from document tree
|
|
@@ -11,15 +21,455 @@
|
|
|
11
21
|
* transaction, or changes whose effects cancel out to nothing. Minimizing reduces the size of an edit without altering
|
|
12
22
|
* its observable effect.
|
|
13
23
|
*
|
|
14
|
-
* This is the eventual home of the minimization algorithm, colocated with {@link ModularChangeFamily} so it can use its
|
|
15
|
-
* internals. It is currently a no-op that returns the change unchanged; a real implementation will be provided in a
|
|
16
|
-
* future change.
|
|
17
|
-
*
|
|
18
24
|
* @param change - The change to minimize.
|
|
19
|
-
* @param
|
|
25
|
+
* @param fieldKinds - The field kinds used in the changeset.
|
|
26
|
+
* @param forestFactory - A function that returns a new forest instance.
|
|
27
|
+
*/
|
|
28
|
+
export function minimizeModularChangeset(change, fieldKinds, forestFactory) {
|
|
29
|
+
return new ModularChangeMinimizer(change, fieldKinds).minimize(forestFactory);
|
|
30
|
+
}
|
|
31
|
+
class ModularChangeMinimizer {
|
|
32
|
+
change;
|
|
33
|
+
fieldKinds;
|
|
34
|
+
builtNodeIds;
|
|
35
|
+
builtRootIds;
|
|
36
|
+
outputAttachStates;
|
|
37
|
+
outputToInputRootId;
|
|
38
|
+
rootIdToNodeId;
|
|
39
|
+
attachedRootIds;
|
|
40
|
+
constructor(change, fieldKinds) {
|
|
41
|
+
this.change = change;
|
|
42
|
+
this.fieldKinds = fieldKinds;
|
|
43
|
+
this.outputAttachStates = getOutputNodeAttachStates(change, fieldKinds);
|
|
44
|
+
const nodeInfo = getNodeInfo(change, fieldKinds);
|
|
45
|
+
this.builtNodeIds = nodeInfo.builtNodeIds;
|
|
46
|
+
this.builtRootIds = nodeInfo.builtRootIds;
|
|
47
|
+
this.rootIdToNodeId = nodeInfo.rootIdToNodeId;
|
|
48
|
+
const delta = intoDelta(makeAnonChange(change), fieldKinds);
|
|
49
|
+
this.outputToInputRootId = outputToInputRootIdFromDelta(delta);
|
|
50
|
+
this.attachedRootIds = collectAttachedRootIds(delta, this.outputToInputRootId);
|
|
51
|
+
}
|
|
52
|
+
minimize(forestFactory) {
|
|
53
|
+
const residualChange = filterEdits(this.change, this.filterEditsForResidualChange.bind(this), this.fieldKinds);
|
|
54
|
+
residualChange.builds = this.squashBuilds(forestFactory);
|
|
55
|
+
validateChangeset(residualChange, this.fieldKinds);
|
|
56
|
+
return residualChange;
|
|
57
|
+
}
|
|
58
|
+
isNodeIdInBuiltTree(nodeId) {
|
|
59
|
+
return (nodeId !== undefined &&
|
|
60
|
+
getFromChangeAtomIdMap(this.builtNodeIds, normalizeNodeId(nodeId, this.change.nodeAliases)) === true);
|
|
61
|
+
}
|
|
62
|
+
isNodeDetachedInOutput(nodeId) {
|
|
63
|
+
return ((getFromChangeAtomIdMap(this.outputAttachStates, normalizeNodeId(nodeId, this.change.nodeAliases)) ?? fail(0xd37 /* Should have attach state for every node ID */)) ===
|
|
64
|
+
NodeAttachState.Detached);
|
|
65
|
+
}
|
|
66
|
+
isFieldDetachedInOutput(fieldId) {
|
|
67
|
+
return fieldId.nodeId !== undefined && this.isNodeDetachedInOutput(fieldId.nodeId);
|
|
68
|
+
}
|
|
69
|
+
shouldSquashDetach(fieldId, inputRootId) {
|
|
70
|
+
// `inputRootId === undefined` indicates that this is a move of a transiently attached built root.
|
|
71
|
+
// In that case, we convert the move to an insert at the final location, discarding the detach portion.
|
|
72
|
+
return this.isNodeIdInBuiltTree(fieldId.nodeId) && inputRootId === undefined;
|
|
73
|
+
}
|
|
74
|
+
shouldSquashAttach(fieldId, rootInputId, count, endpoint) {
|
|
75
|
+
if (!this.isNodeIdInBuiltTree(fieldId.nodeId)) {
|
|
76
|
+
return { value: false, length: count };
|
|
77
|
+
}
|
|
78
|
+
let countProcessed = count;
|
|
79
|
+
const isMoveOfBuiltRootEntry = this.builtRootIds.getFirst(rootInputId, countProcessed);
|
|
80
|
+
countProcessed = isMoveOfBuiltRootEntry.length;
|
|
81
|
+
const isAttachOfBuiltRoot = isMoveOfBuiltRootEntry?.value ?? false;
|
|
82
|
+
const isMoveFromBuiltTree = endpoint?.nodeId !== undefined && this.isNodeIdInBuiltTree(endpoint.nodeId);
|
|
83
|
+
const isAttachOfBuiltNode = isAttachOfBuiltRoot || isMoveFromBuiltTree;
|
|
84
|
+
return { value: isAttachOfBuiltNode, length: countProcessed };
|
|
85
|
+
}
|
|
86
|
+
shouldDropAttach(fieldId, rootInputId, count, endpoint) {
|
|
87
|
+
const isInDetachedTree = this.isFieldDetachedInOutput(fieldId);
|
|
88
|
+
let countProcessed = count;
|
|
89
|
+
const shouldSquashAttachEntry = this.shouldSquashAttach(fieldId, rootInputId, countProcessed, endpoint);
|
|
90
|
+
countProcessed = shouldSquashAttachEntry.length;
|
|
91
|
+
const isBuiltRootEntry = this.builtRootIds.getFirst(rootInputId, countProcessed);
|
|
92
|
+
countProcessed = isBuiltRootEntry.length;
|
|
93
|
+
const isAttachOfBuild = isBuiltRootEntry.value ??
|
|
94
|
+
(endpoint !== undefined && this.isNodeIdInBuiltTree(endpoint.nodeId));
|
|
95
|
+
const isAttachedRootEntry = this.attachedRootIds.getFirst(rootInputId, countProcessed);
|
|
96
|
+
countProcessed = isAttachedRootEntry.length;
|
|
97
|
+
const isTransientAttachOfBuild = isAttachOfBuild && !isAttachedRootEntry.value;
|
|
98
|
+
return {
|
|
99
|
+
value: isInDetachedTree || shouldSquashAttachEntry.value || isTransientAttachOfBuild,
|
|
100
|
+
length: countProcessed,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
shouldDropDetach(fieldId, detachId, rootInputId, count, endpoint) {
|
|
104
|
+
let countProcessed = count;
|
|
105
|
+
if (this.shouldSquashDetach(fieldId, rootInputId)) {
|
|
106
|
+
return { value: true, length: countProcessed };
|
|
107
|
+
}
|
|
108
|
+
if (rootInputId !== undefined) {
|
|
109
|
+
// `inputRootId` is defined when this detach represents the rename of a detached root.
|
|
110
|
+
const isDetachOfBuiltRootEntry = this.builtRootIds.getFirst(rootInputId, countProcessed);
|
|
111
|
+
countProcessed = isDetachOfBuiltRootEntry.length;
|
|
112
|
+
const isDetachOfBuiltRoot = isDetachOfBuiltRootEntry.value !== undefined;
|
|
113
|
+
if (isDetachOfBuiltRoot)
|
|
114
|
+
// If this is a rename of a built node, either it ends detached, or is moved elsewhere.
|
|
115
|
+
// If moved, we squash the detach away, leaving only an attach at the destination.
|
|
116
|
+
// If detached, the build is not used, so we drop the rename.
|
|
117
|
+
return {
|
|
118
|
+
value: true,
|
|
119
|
+
length: countProcessed,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
if (endpoint !== undefined) {
|
|
123
|
+
const shouldDropAttachEntry = this.shouldDropAttach(endpoint, rootInputId ?? detachId, countProcessed, fieldId);
|
|
124
|
+
countProcessed = shouldDropAttachEntry.length;
|
|
125
|
+
if (!shouldDropAttachEntry.value) {
|
|
126
|
+
// This detach is part of a move, and we are not dropping the attach, so we must preserve the detach as well.
|
|
127
|
+
return { value: false, length: countProcessed };
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return { value: this.isFieldDetachedInOutput(fieldId), length: countProcessed };
|
|
131
|
+
}
|
|
132
|
+
filterEditsForBuildChange(fieldChange, fieldId) {
|
|
133
|
+
return {
|
|
134
|
+
...fieldChange,
|
|
135
|
+
change: brand(getChangeHandler(this.fieldKinds, fieldChange.fieldKind).rebaser.filterEdits(fieldChange.change, {
|
|
136
|
+
filterDetach: (detachId, count, inputRootId, endpoint) => this.filterDetachForBuildChange(fieldId, detachId, count, inputRootId, endpoint),
|
|
137
|
+
filterAttach: (id, count, _outputRootId, endpoint) => this.filterAttachForBuildChange(fieldId, id, count, endpoint),
|
|
138
|
+
preserveOtherEdits: false,
|
|
139
|
+
})),
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
filterDetachForBuildChange(fieldId, detachId, count, inputRootId, endpoint) {
|
|
143
|
+
if (!this.shouldSquashDetach(fieldId, inputRootId)) {
|
|
144
|
+
return {
|
|
145
|
+
value: { action: EditFilterStatus.Remove, shouldRemoveChild: false },
|
|
146
|
+
length: count,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
let countProcessed = count;
|
|
150
|
+
const moveEndpointEntry = this.change.crossFieldKeys.getFirst({ ...(endpoint ?? detachId), target: CrossFieldTarget.Destination }, countProcessed);
|
|
151
|
+
countProcessed = moveEndpointEntry.length;
|
|
152
|
+
if (moveEndpointEntry.value !== undefined) {
|
|
153
|
+
const willSquashEndpointEntry = this.shouldSquashAttach(moveEndpointEntry.value, inputRootId ?? detachId, countProcessed, fieldId);
|
|
154
|
+
countProcessed = willSquashEndpointEntry.length;
|
|
155
|
+
const action = willSquashEndpointEntry.value
|
|
156
|
+
? EditFilterStatus.Preserve
|
|
157
|
+
: EditFilterStatus.PreserveWithoutMove;
|
|
158
|
+
return { value: { action }, length: countProcessed };
|
|
159
|
+
}
|
|
160
|
+
return { value: { action: EditFilterStatus.Preserve }, length: countProcessed };
|
|
161
|
+
}
|
|
162
|
+
filterAttachForBuildChange(fieldId, id, count, endpoint) {
|
|
163
|
+
let countProcessed = count;
|
|
164
|
+
const moveId = endpoint ?? id;
|
|
165
|
+
const moveEndpointEntry = this.change.crossFieldKeys.getFirst({ ...moveId, target: CrossFieldTarget.Source }, countProcessed);
|
|
166
|
+
countProcessed = moveEndpointEntry.length;
|
|
167
|
+
const inputIdEntry = this.outputToInputRootId.getFirst(moveId, countProcessed);
|
|
168
|
+
countProcessed = inputIdEntry.length;
|
|
169
|
+
const rootInputId = inputIdEntry.value ?? moveId;
|
|
170
|
+
const shouldSquashEntry = this.shouldSquashAttach(fieldId, rootInputId, countProcessed, moveEndpointEntry.value);
|
|
171
|
+
countProcessed = shouldSquashEntry.length;
|
|
172
|
+
const isMove = moveEndpointEntry.value !== undefined;
|
|
173
|
+
if (!shouldSquashEntry.value) {
|
|
174
|
+
return { value: { action: EditFilterStatus.Remove }, length: countProcessed };
|
|
175
|
+
}
|
|
176
|
+
if (isMove) {
|
|
177
|
+
const movedNodeId = getFromChangeAtomIdMap(this.rootIdToNodeId, moveId);
|
|
178
|
+
return {
|
|
179
|
+
value: {
|
|
180
|
+
action: EditFilterStatus.PreserveWithoutMove,
|
|
181
|
+
nodeId: movedNodeId,
|
|
182
|
+
newAttachId: rootInputId,
|
|
183
|
+
},
|
|
184
|
+
length: countProcessed,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
return {
|
|
188
|
+
value: { action: EditFilterStatus.Preserve },
|
|
189
|
+
length: countProcessed,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Returns a version of `fieldChange` to be used in the final minimized change.
|
|
194
|
+
* The filtered change will have dropped:
|
|
195
|
+
* - Edits which were squashed into the built trees.
|
|
196
|
+
* - Detaches of built roots. If part of a move, these are instead represented as an attach at the final location.
|
|
197
|
+
* - Edits to nodes which are detached in the output, except for detaches of content which does end attached.
|
|
198
|
+
*/
|
|
199
|
+
filterEditsForResidualChange(fieldChange, fieldId) {
|
|
200
|
+
return {
|
|
201
|
+
...fieldChange,
|
|
202
|
+
change: brand(getChangeHandler(this.fieldKinds, fieldChange.fieldKind).rebaser.filterEdits(fieldChange.change, {
|
|
203
|
+
filterDetach: (...args) => this.filterDetachForResidualChange(fieldId, ...args),
|
|
204
|
+
filterAttach: (...args) => this.filterAttachForResidualChange(fieldId, ...args),
|
|
205
|
+
preserveOtherEdits: false,
|
|
206
|
+
})),
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
filterDetachForResidualChange(fieldId, detachId, count, inputRootId, endpoint) {
|
|
210
|
+
let countProcessed = count;
|
|
211
|
+
const moveId = endpoint ?? detachId;
|
|
212
|
+
const moveEndpointEntry = this.change.crossFieldKeys.getFirst({ ...moveId, target: CrossFieldTarget.Destination }, count);
|
|
213
|
+
countProcessed = moveEndpointEntry.length;
|
|
214
|
+
const shouldDropEntry = this.shouldDropDetach(fieldId, detachId, inputRootId, countProcessed, moveEndpointEntry.value);
|
|
215
|
+
countProcessed = shouldDropEntry.length;
|
|
216
|
+
let hasPreservedAttach = false;
|
|
217
|
+
let hasDroppedAttach = false;
|
|
218
|
+
if (moveEndpointEntry.value !== undefined) {
|
|
219
|
+
const willDropAttachEntry = this.shouldDropAttach(moveEndpointEntry.value, inputRootId ?? detachId, countProcessed, fieldId);
|
|
220
|
+
countProcessed = willDropAttachEntry.length;
|
|
221
|
+
hasDroppedAttach = willDropAttachEntry.value;
|
|
222
|
+
hasPreservedAttach = !willDropAttachEntry.value;
|
|
223
|
+
}
|
|
224
|
+
if (shouldDropEntry.value) {
|
|
225
|
+
// If there is a preserved attach, we will represent any child change at that location,
|
|
226
|
+
// so we must remove them from here.
|
|
227
|
+
return {
|
|
228
|
+
value: { action: EditFilterStatus.Remove, shouldRemoveChild: hasPreservedAttach },
|
|
229
|
+
length: countProcessed,
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
return {
|
|
233
|
+
value: {
|
|
234
|
+
action: hasDroppedAttach
|
|
235
|
+
? EditFilterStatus.PreserveWithoutMove
|
|
236
|
+
: EditFilterStatus.Preserve,
|
|
237
|
+
},
|
|
238
|
+
length: countProcessed,
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
filterAttachForResidualChange(fieldId, id, count, outputRootId, endpoint) {
|
|
242
|
+
let countProcessed = count;
|
|
243
|
+
const moveId = endpoint ?? id;
|
|
244
|
+
const moveEndpointEntry = this.change.crossFieldKeys.getFirst({ ...moveId, target: CrossFieldTarget.Source }, countProcessed);
|
|
245
|
+
countProcessed = moveEndpointEntry.length;
|
|
246
|
+
const inputIdEntry = this.outputToInputRootId.getFirst(moveId, countProcessed);
|
|
247
|
+
countProcessed = inputIdEntry.length;
|
|
248
|
+
const rootInputId = inputIdEntry.value ?? moveId;
|
|
249
|
+
const shouldDropEntry = this.shouldDropAttach(fieldId, rootInputId, countProcessed, moveEndpointEntry.value);
|
|
250
|
+
countProcessed = shouldDropEntry.length;
|
|
251
|
+
if (shouldDropEntry.value) {
|
|
252
|
+
return {
|
|
253
|
+
value: { action: EditFilterStatus.Remove },
|
|
254
|
+
length: countProcessed,
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
if (moveEndpointEntry.value !== undefined) {
|
|
258
|
+
const willDropEndpointEntry = this.shouldDropDetach(moveEndpointEntry.value, moveId, inputIdEntry.value, countProcessed, fieldId);
|
|
259
|
+
countProcessed = willDropEndpointEntry.length;
|
|
260
|
+
if (willDropEndpointEntry.value) {
|
|
261
|
+
const movedNodeId = getFromChangeAtomIdMap(this.rootIdToNodeId, moveId);
|
|
262
|
+
return {
|
|
263
|
+
value: {
|
|
264
|
+
action: EditFilterStatus.PreserveWithoutMove,
|
|
265
|
+
nodeId: movedNodeId,
|
|
266
|
+
newAttachId: inputIdEntry.value ?? moveId,
|
|
267
|
+
},
|
|
268
|
+
length: countProcessed,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return {
|
|
273
|
+
value: { action: EditFilterStatus.Preserve },
|
|
274
|
+
length: countProcessed,
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
squashBuilds(forestFactory) {
|
|
278
|
+
const changeForBuilds = filterEdits(this.change, this.filterEditsForBuildChange.bind(this), this.fieldKinds);
|
|
279
|
+
const deltaForBuilds = intoDelta(makeAnonChange(changeForBuilds), this.fieldKinds);
|
|
280
|
+
assert(!deltaFieldMapHasChanges(deltaForBuilds.fields), 0xd38 /* Expected all changes to attached tree to be filtered out */);
|
|
281
|
+
// There may still be paths to existing nodes in the delta, which must be removed before being applied to an empty forest.
|
|
282
|
+
// It is safe to remove these, because there are no edits to them, as asserted above.
|
|
283
|
+
deltaForBuilds.fields = new Map();
|
|
284
|
+
const forest = forestFactory();
|
|
285
|
+
const detachedFieldIndex = makeDetachedFieldIndex();
|
|
286
|
+
visitDelta(deltaForBuilds, forest.acquireVisitor(), detachedFieldIndex, undefined);
|
|
287
|
+
const squashedBuilds = newChangeAtomIdBTree();
|
|
288
|
+
const cursor = forest.getCursorAboveDetachedFields();
|
|
289
|
+
for (const entry of detachedFieldIndex.entries()) {
|
|
290
|
+
cursor.enterField(detachedFieldIndex.toFieldKey(entry.root));
|
|
291
|
+
const chunks = forest.chunkField(cursor);
|
|
292
|
+
// Delta visiting currently splits ranges of nodes into individual elements,
|
|
293
|
+
// so for now we will not have more than one node in a detached field.
|
|
294
|
+
assert(hasSingle(chunks), 0xd39 /* TODO: Handle multiple chunks */);
|
|
295
|
+
const chunk = chunks[0];
|
|
296
|
+
assert(chunk.topLevelLength === 1, 0xd3a /* TODO: Handle chunk with range of nodes */);
|
|
297
|
+
const rootId = {
|
|
298
|
+
revision: entry.id.major,
|
|
299
|
+
localId: brand(entry.id.minor),
|
|
300
|
+
};
|
|
301
|
+
const isAttachedEntry = this.attachedRootIds.getFirst(rootId, chunk.topLevelLength);
|
|
302
|
+
assert(isAttachedEntry.length === chunk.topLevelLength, 0xd3b /* TODO: Handle chunks which are only partially attached */);
|
|
303
|
+
if (isAttachedEntry.value) {
|
|
304
|
+
setInChangeAtomIdMap(squashedBuilds, rootId, chunk);
|
|
305
|
+
}
|
|
306
|
+
cursor.exitField();
|
|
307
|
+
}
|
|
308
|
+
return squashedBuilds;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
function getOutputNodeAttachStates(change, fieldKinds) {
|
|
312
|
+
const inverse = invertModularChange(makeAnonChange(change), true, "root", fieldKinds);
|
|
313
|
+
return getInputNodeAttachStates(inverse, fieldKinds);
|
|
314
|
+
}
|
|
315
|
+
function getInputNodeAttachStates(change, fieldKinds) {
|
|
316
|
+
const nodeAttachStates = newChangeAtomIdBTree();
|
|
317
|
+
addInputNodeAttachStatesForFields(NodeAttachState.Attached, change.fieldChanges, change.nodeChanges, change.nodeAliases, fieldKinds, nodeAttachStates);
|
|
318
|
+
return nodeAttachStates;
|
|
319
|
+
}
|
|
320
|
+
function addInputNodeAttachStatesForFields(parentState, fields, nodes, nodeAliases, fieldKinds, nodeAttachStates) {
|
|
321
|
+
for (const fieldChange of fields.values()) {
|
|
322
|
+
const children = getChangeHandler(fieldKinds, fieldChange.fieldKind).getNestedChanges(fieldChange.change);
|
|
323
|
+
for (const { nodeId, inputRootId: inputId } of children) {
|
|
324
|
+
const normalizedNodeId = normalizeNodeId(nodeId, nodeAliases);
|
|
325
|
+
const attachState = parentState === NodeAttachState.Attached && inputId === undefined
|
|
326
|
+
? NodeAttachState.Attached
|
|
327
|
+
: NodeAttachState.Detached;
|
|
328
|
+
nodeAttachStates.set([normalizedNodeId.revision, normalizedNodeId.localId], attachState);
|
|
329
|
+
const nodeChangeset = nodeChangeFromId(nodes, normalizedNodeId);
|
|
330
|
+
if (nodeChangeset.fieldChanges !== undefined) {
|
|
331
|
+
addInputNodeAttachStatesForFields(attachState, nodeChangeset.fieldChanges, nodes, nodeAliases, fieldKinds, nodeAttachStates);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
function getNodeInfo(change, fieldKinds) {
|
|
337
|
+
const builtRootIds = newChangeAtomIdRangeMap();
|
|
338
|
+
if (change.builds !== undefined) {
|
|
339
|
+
for (const [rootId, chunk] of change.builds.entries()) {
|
|
340
|
+
builtRootIds.set(makeChangeAtomId(rootId[1], rootId[0]), chunk.topLevelLength, true);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
const builtNodeIds = newChangeAtomIdBTree();
|
|
344
|
+
const rootIdToNodeId = newChangeAtomIdBTree();
|
|
345
|
+
addNodeInfoForFields(false, change.fieldChanges, change.nodeChanges, change.nodeAliases, builtRootIds, fieldKinds, builtNodeIds, rootIdToNodeId);
|
|
346
|
+
return { builtRootIds, builtNodeIds, rootIdToNodeId };
|
|
347
|
+
}
|
|
348
|
+
function addNodeInfoForFields(parentIsBuilt, fields, nodes, nodeAliases, buildIds, fieldKinds, builtNodeIds, rootIdToNodeId) {
|
|
349
|
+
for (const fieldChange of fields.values()) {
|
|
350
|
+
const children = getChangeHandler(fieldKinds, fieldChange.fieldKind).getNestedChanges(fieldChange.change);
|
|
351
|
+
for (const { nodeId, inputRootId: inputId, detachId } of children) {
|
|
352
|
+
const normalizedNodeId = normalizeNodeId(nodeId, nodeAliases);
|
|
353
|
+
const isPartOfBuild = parentIsBuilt ||
|
|
354
|
+
(inputId !== undefined && buildIds.getFirst(inputId, 1).value === true);
|
|
355
|
+
if (isPartOfBuild) {
|
|
356
|
+
builtNodeIds.set([normalizedNodeId.revision, normalizedNodeId.localId], true);
|
|
357
|
+
}
|
|
358
|
+
if (inputId !== undefined) {
|
|
359
|
+
setInChangeAtomIdMap(rootIdToNodeId, inputId, normalizedNodeId);
|
|
360
|
+
}
|
|
361
|
+
if (detachId !== undefined) {
|
|
362
|
+
setInChangeAtomIdMap(rootIdToNodeId, detachId, normalizedNodeId);
|
|
363
|
+
}
|
|
364
|
+
const nodeChangeset = nodeChangeFromId(nodes, normalizedNodeId);
|
|
365
|
+
if (nodeChangeset.fieldChanges !== undefined) {
|
|
366
|
+
addNodeInfoForFields(isPartOfBuild, nodeChangeset.fieldChanges, nodes, nodeAliases, buildIds, fieldKinds, builtNodeIds, rootIdToNodeId);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Collects the set of root IDs whose content ends up attached within the live document tree
|
|
373
|
+
* once the given change is applied.
|
|
374
|
+
* There are entries both for nodes which are detached in the input context,
|
|
375
|
+
* and also for nodes which are detached by this delta.
|
|
376
|
+
* The keys are pre-rename IDs.
|
|
377
|
+
*
|
|
378
|
+
* @remarks
|
|
379
|
+
* These are the "used" nodes: any build whose nodes are not in this set has no observable
|
|
380
|
+
* effect on the resulting document and can be dropped.
|
|
20
381
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
382
|
+
function collectAttachedRootIds(delta, outputToInputRootId) {
|
|
383
|
+
const detachIdToNodeChanges = getDeltaNodeChangesByDetachId(delta);
|
|
384
|
+
const attached = newChangeAtomIdRangeMap();
|
|
385
|
+
// Worklist of detached node ID ranges newly discovered to be live, whose own nested content must be visited.
|
|
386
|
+
const worklist = [];
|
|
387
|
+
const markLive = (attachId, count) => {
|
|
388
|
+
for (const inputIdEntry of outputToInputRootId.getAll(attachId, count)) {
|
|
389
|
+
const inputId = inputIdEntry.value ?? offsetChangeAtomId(attachId, inputIdEntry.offset);
|
|
390
|
+
// Only the sub-ranges of `[id, id + count)` that are not already live are newly discovered.
|
|
391
|
+
// Mark each such run live in a single range operation and enqueue it for processing.
|
|
392
|
+
for (const fragment of attached.getAll(inputId, inputIdEntry.length)) {
|
|
393
|
+
if (fragment.value === undefined) {
|
|
394
|
+
const runStart = offsetChangeAtomId(inputId, fragment.offset);
|
|
395
|
+
attached.set(runStart, fragment.length, true);
|
|
396
|
+
worklist.push({ id: runStart, count: fragment.length });
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
const visitLiveFields = (fields) => {
|
|
402
|
+
if (fields === undefined) {
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
for (const field of fields.values()) {
|
|
406
|
+
for (const mark of field.marks) {
|
|
407
|
+
if (mark.attach !== undefined) {
|
|
408
|
+
markLive({ revision: mark.attach.major, localId: brand(mark.attach.minor) }, mark.count);
|
|
409
|
+
}
|
|
410
|
+
// `mark.fields` edits the cell's pre-existing content. Only descend when that content
|
|
411
|
+
// stays in the live tree (i.e. it is not being detached out of the tree).
|
|
412
|
+
if (mark.detach === undefined) {
|
|
413
|
+
visitLiveFields(mark.fields);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
};
|
|
418
|
+
visitLiveFields(delta.fields);
|
|
419
|
+
// Process node ranges discovered to be live: pull in their nested content and propagate
|
|
420
|
+
// liveness backwards across renames (a node attached under its post-rename ID was built under its
|
|
421
|
+
// pre-rename ID). Iterate to a fixed point.
|
|
422
|
+
while (worklist.length > 0) {
|
|
423
|
+
const next = worklist.pop();
|
|
424
|
+
if (next === undefined) {
|
|
425
|
+
break;
|
|
426
|
+
}
|
|
427
|
+
const { id, count } = next;
|
|
428
|
+
// Nested content is keyed per node, so it must be visited one ID at a time.
|
|
429
|
+
for (let offset = 0; offset < count; offset += 1) {
|
|
430
|
+
visitLiveFields(detachIdToNodeChanges.get(id.revision)?.get(brand(id.localId + offset)));
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
return attached;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Returns a mapping from root ID to the field changes for that node.
|
|
437
|
+
* There are entries both for nodes which are detached in the input context,
|
|
438
|
+
* and also for nodes which are detached by this delta.
|
|
439
|
+
* The keys are pre-rename IDs.
|
|
440
|
+
*/
|
|
441
|
+
function getDeltaNodeChangesByDetachId(delta) {
|
|
442
|
+
const detachIdToChanges = new Map();
|
|
443
|
+
const visitFields = (fields) => {
|
|
444
|
+
for (const fieldChange of fields.values()) {
|
|
445
|
+
for (const mark of fieldChange.marks) {
|
|
446
|
+
if (mark.fields !== undefined) {
|
|
447
|
+
visitFields(mark.fields);
|
|
448
|
+
if (mark.detach !== undefined) {
|
|
449
|
+
setInNestedMap(detachIdToChanges, mark.detach.major, mark.detach.minor, mark.fields);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
};
|
|
455
|
+
if (delta.fields !== undefined) {
|
|
456
|
+
visitFields(delta.fields);
|
|
457
|
+
}
|
|
458
|
+
if (delta.global !== undefined) {
|
|
459
|
+
for (const { id, fields } of delta.global) {
|
|
460
|
+
setInNestedMap(detachIdToChanges, id.major, id.minor, fields);
|
|
461
|
+
visitFields(fields);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
return detachIdToChanges;
|
|
465
|
+
}
|
|
466
|
+
function outputToInputRootIdFromDelta(delta) {
|
|
467
|
+
const outputToInputRootId = newChangeAtomIdTransform();
|
|
468
|
+
if (delta.rename !== undefined) {
|
|
469
|
+
for (const { oldId, newId, count } of delta.rename) {
|
|
470
|
+
outputToInputRootId.set(makeChangeAtomId(brand(newId.minor), newId.major), count, makeChangeAtomId(brand(oldId.minor), oldId.major));
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
return outputToInputRootId;
|
|
24
474
|
}
|
|
25
475
|
//# sourceMappingURL=minimizeModularChange.js.map
|