@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
|
@@ -3,8 +3,64 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
|
|
6
|
+
import {
|
|
7
|
+
deltaFieldMapHasChanges,
|
|
8
|
+
makeAnonChange,
|
|
9
|
+
makeChangeAtomId,
|
|
10
|
+
makeDetachedFieldIndex,
|
|
11
|
+
newChangeAtomIdRangeMap,
|
|
12
|
+
newChangeAtomIdTransform,
|
|
13
|
+
offsetChangeAtomId,
|
|
14
|
+
visitDelta,
|
|
15
|
+
type ChangeAtomId,
|
|
16
|
+
type ChangeAtomIdMap,
|
|
17
|
+
type ChangeAtomIdRangeMap,
|
|
18
|
+
type DeltaFieldMap,
|
|
19
|
+
type DeltaRoot,
|
|
20
|
+
type FieldKindIdentifier,
|
|
21
|
+
type IEditableForest,
|
|
22
|
+
type TreeChunk,
|
|
23
|
+
} from "../../core/index.js";
|
|
24
|
+
import {
|
|
25
|
+
brand,
|
|
26
|
+
hasSingle,
|
|
27
|
+
setInNestedMap,
|
|
28
|
+
type Mutable,
|
|
29
|
+
type RangeQueryResult,
|
|
30
|
+
} from "../../util/index.js";
|
|
31
|
+
import {
|
|
32
|
+
getFromChangeAtomIdMap,
|
|
33
|
+
newChangeAtomIdBTree,
|
|
34
|
+
setInChangeAtomIdMap,
|
|
35
|
+
type ChangeAtomIdBTree,
|
|
36
|
+
} from "../changeAtomIdBTree.js";
|
|
37
|
+
import { CrossFieldTarget } from "./crossFieldQueries.js";
|
|
38
|
+
import {
|
|
39
|
+
EditFilterStatus,
|
|
40
|
+
NodeAttachState,
|
|
41
|
+
type FilterAttachResult,
|
|
42
|
+
type FilterDetachResult,
|
|
43
|
+
} from "./fieldChangeHandler.js";
|
|
44
|
+
|
|
45
|
+
import type { FlexFieldKind } from "./fieldKind.js";
|
|
46
|
+
import { filterEdits } from "./filterEdits.js";
|
|
47
|
+
import { invertModularChange } from "./invert.js";
|
|
48
|
+
import { intoDelta } from "./modularChangeFamily.js";
|
|
49
|
+
import type {
|
|
50
|
+
FieldChange,
|
|
51
|
+
FieldChangeMap,
|
|
52
|
+
FieldId,
|
|
53
|
+
ModularChangeset,
|
|
54
|
+
NodeChangeset,
|
|
55
|
+
NodeId,
|
|
56
|
+
} from "./modularChangeTypes.js";
|
|
57
|
+
import {
|
|
58
|
+
getChangeHandler,
|
|
59
|
+
nodeChangeFromId,
|
|
60
|
+
normalizeNodeId,
|
|
61
|
+
validateChangeset,
|
|
62
|
+
} from "./modularChangeUtils.js";
|
|
63
|
+
import { assert, fail } from "@fluidframework/core-utils/internal";
|
|
8
64
|
|
|
9
65
|
/**
|
|
10
66
|
* "Minimizes" a {@link ModularChangeset} so that it contains no extraneous
|
|
@@ -15,17 +71,782 @@ import type { ModularChangeset } from "./modularChangeTypes.js";
|
|
|
15
71
|
* transaction, or changes whose effects cancel out to nothing. Minimizing reduces the size of an edit without altering
|
|
16
72
|
* its observable effect.
|
|
17
73
|
*
|
|
18
|
-
* This is the eventual home of the minimization algorithm, colocated with {@link ModularChangeFamily} so it can use its
|
|
19
|
-
* internals. It is currently a no-op that returns the change unchanged; a real implementation will be provided in a
|
|
20
|
-
* future change.
|
|
21
|
-
*
|
|
22
74
|
* @param change - The change to minimize.
|
|
23
|
-
* @param
|
|
75
|
+
* @param fieldKinds - The field kinds used in the changeset.
|
|
76
|
+
* @param forestFactory - A function that returns a new forest instance.
|
|
24
77
|
*/
|
|
25
78
|
export function minimizeModularChangeset(
|
|
26
79
|
change: ModularChangeset,
|
|
27
|
-
|
|
80
|
+
fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>,
|
|
81
|
+
forestFactory: () => IEditableForest,
|
|
28
82
|
): ModularChangeset {
|
|
29
|
-
|
|
30
|
-
|
|
83
|
+
return new ModularChangeMinimizer(change, fieldKinds).minimize(forestFactory);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
class ModularChangeMinimizer {
|
|
87
|
+
private readonly builtNodeIds: ChangeAtomIdBTree<true>;
|
|
88
|
+
private readonly builtRootIds: ChangeAtomIdRangeMap<true>;
|
|
89
|
+
private readonly outputAttachStates: ChangeAtomIdBTree<NodeAttachState>;
|
|
90
|
+
private readonly outputToInputRootId: ChangeAtomIdRangeMap<ChangeAtomId>;
|
|
91
|
+
private readonly rootIdToNodeId: ChangeAtomIdBTree<NodeId>;
|
|
92
|
+
private readonly attachedRootIds: ChangeAtomIdRangeSet;
|
|
93
|
+
|
|
94
|
+
public constructor(
|
|
95
|
+
private readonly change: ModularChangeset,
|
|
96
|
+
private readonly fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>,
|
|
97
|
+
) {
|
|
98
|
+
this.outputAttachStates = getOutputNodeAttachStates(change, fieldKinds);
|
|
99
|
+
const nodeInfo = getNodeInfo(change, fieldKinds);
|
|
100
|
+
this.builtNodeIds = nodeInfo.builtNodeIds;
|
|
101
|
+
this.builtRootIds = nodeInfo.builtRootIds;
|
|
102
|
+
this.rootIdToNodeId = nodeInfo.rootIdToNodeId;
|
|
103
|
+
|
|
104
|
+
const delta = intoDelta(makeAnonChange(change), fieldKinds);
|
|
105
|
+
this.outputToInputRootId = outputToInputRootIdFromDelta(delta);
|
|
106
|
+
this.attachedRootIds = collectAttachedRootIds(delta, this.outputToInputRootId);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
public minimize(forestFactory: () => IEditableForest): ModularChangeset {
|
|
110
|
+
const residualChange = filterEdits(
|
|
111
|
+
this.change,
|
|
112
|
+
this.filterEditsForResidualChange.bind(this),
|
|
113
|
+
this.fieldKinds,
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
(residualChange as Mutable<ModularChangeset>).builds = this.squashBuilds(forestFactory);
|
|
117
|
+
validateChangeset(residualChange, this.fieldKinds);
|
|
118
|
+
return residualChange;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
private isNodeIdInBuiltTree(nodeId: NodeId | undefined): boolean {
|
|
122
|
+
return (
|
|
123
|
+
nodeId !== undefined &&
|
|
124
|
+
getFromChangeAtomIdMap(
|
|
125
|
+
this.builtNodeIds,
|
|
126
|
+
normalizeNodeId(nodeId, this.change.nodeAliases),
|
|
127
|
+
) === true
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
private isNodeDetachedInOutput(nodeId: NodeId): boolean {
|
|
132
|
+
return (
|
|
133
|
+
(getFromChangeAtomIdMap(
|
|
134
|
+
this.outputAttachStates,
|
|
135
|
+
normalizeNodeId(nodeId, this.change.nodeAliases),
|
|
136
|
+
) ?? fail(0xd37 /* Should have attach state for every node ID */)) ===
|
|
137
|
+
NodeAttachState.Detached
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
private isFieldDetachedInOutput(fieldId: FieldId): boolean {
|
|
142
|
+
return fieldId.nodeId !== undefined && this.isNodeDetachedInOutput(fieldId.nodeId);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
private shouldSquashDetach(
|
|
146
|
+
fieldId: FieldId,
|
|
147
|
+
inputRootId: ChangeAtomId | undefined,
|
|
148
|
+
): boolean {
|
|
149
|
+
// `inputRootId === undefined` indicates that this is a move of a transiently attached built root.
|
|
150
|
+
// In that case, we convert the move to an insert at the final location, discarding the detach portion.
|
|
151
|
+
return this.isNodeIdInBuiltTree(fieldId.nodeId) && inputRootId === undefined;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
private shouldSquashAttach(
|
|
155
|
+
fieldId: FieldId,
|
|
156
|
+
rootInputId: ChangeAtomId,
|
|
157
|
+
count: number,
|
|
158
|
+
endpoint: FieldId | undefined,
|
|
159
|
+
): RangeQueryResult<boolean> {
|
|
160
|
+
if (!this.isNodeIdInBuiltTree(fieldId.nodeId)) {
|
|
161
|
+
return { value: false, length: count };
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
let countProcessed = count;
|
|
165
|
+
const isMoveOfBuiltRootEntry = this.builtRootIds.getFirst(rootInputId, countProcessed);
|
|
166
|
+
countProcessed = isMoveOfBuiltRootEntry.length;
|
|
167
|
+
|
|
168
|
+
const isAttachOfBuiltRoot = isMoveOfBuiltRootEntry?.value ?? false;
|
|
169
|
+
const isMoveFromBuiltTree =
|
|
170
|
+
endpoint?.nodeId !== undefined && this.isNodeIdInBuiltTree(endpoint.nodeId);
|
|
171
|
+
|
|
172
|
+
const isAttachOfBuiltNode = isAttachOfBuiltRoot || isMoveFromBuiltTree;
|
|
173
|
+
return { value: isAttachOfBuiltNode, length: countProcessed };
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
private shouldDropAttach(
|
|
177
|
+
fieldId: FieldId,
|
|
178
|
+
rootInputId: ChangeAtomId,
|
|
179
|
+
count: number,
|
|
180
|
+
endpoint: FieldId | undefined,
|
|
181
|
+
): RangeQueryResult<boolean> {
|
|
182
|
+
const isInDetachedTree = this.isFieldDetachedInOutput(fieldId);
|
|
183
|
+
|
|
184
|
+
let countProcessed = count;
|
|
185
|
+
const shouldSquashAttachEntry = this.shouldSquashAttach(
|
|
186
|
+
fieldId,
|
|
187
|
+
rootInputId,
|
|
188
|
+
countProcessed,
|
|
189
|
+
endpoint,
|
|
190
|
+
);
|
|
191
|
+
countProcessed = shouldSquashAttachEntry.length;
|
|
192
|
+
|
|
193
|
+
const isBuiltRootEntry = this.builtRootIds.getFirst(rootInputId, countProcessed);
|
|
194
|
+
countProcessed = isBuiltRootEntry.length;
|
|
195
|
+
|
|
196
|
+
const isAttachOfBuild =
|
|
197
|
+
isBuiltRootEntry.value ??
|
|
198
|
+
(endpoint !== undefined && this.isNodeIdInBuiltTree(endpoint.nodeId));
|
|
199
|
+
|
|
200
|
+
const isAttachedRootEntry = this.attachedRootIds.getFirst(rootInputId, countProcessed);
|
|
201
|
+
countProcessed = isAttachedRootEntry.length;
|
|
202
|
+
|
|
203
|
+
const isTransientAttachOfBuild = isAttachOfBuild && !isAttachedRootEntry.value;
|
|
204
|
+
return {
|
|
205
|
+
value: isInDetachedTree || shouldSquashAttachEntry.value || isTransientAttachOfBuild,
|
|
206
|
+
length: countProcessed,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
private shouldDropDetach(
|
|
211
|
+
fieldId: FieldId,
|
|
212
|
+
detachId: ChangeAtomId,
|
|
213
|
+
rootInputId: ChangeAtomId | undefined,
|
|
214
|
+
count: number,
|
|
215
|
+
endpoint: FieldId | undefined,
|
|
216
|
+
): RangeQueryResult<boolean> {
|
|
217
|
+
let countProcessed = count;
|
|
218
|
+
if (this.shouldSquashDetach(fieldId, rootInputId)) {
|
|
219
|
+
return { value: true, length: countProcessed };
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
if (rootInputId !== undefined) {
|
|
223
|
+
// `inputRootId` is defined when this detach represents the rename of a detached root.
|
|
224
|
+
const isDetachOfBuiltRootEntry = this.builtRootIds.getFirst(rootInputId, countProcessed);
|
|
225
|
+
countProcessed = isDetachOfBuiltRootEntry.length;
|
|
226
|
+
const isDetachOfBuiltRoot = isDetachOfBuiltRootEntry.value !== undefined;
|
|
227
|
+
if (isDetachOfBuiltRoot)
|
|
228
|
+
// If this is a rename of a built node, either it ends detached, or is moved elsewhere.
|
|
229
|
+
// If moved, we squash the detach away, leaving only an attach at the destination.
|
|
230
|
+
// If detached, the build is not used, so we drop the rename.
|
|
231
|
+
return {
|
|
232
|
+
value: true,
|
|
233
|
+
length: countProcessed,
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (endpoint !== undefined) {
|
|
238
|
+
const shouldDropAttachEntry = this.shouldDropAttach(
|
|
239
|
+
endpoint,
|
|
240
|
+
rootInputId ?? detachId,
|
|
241
|
+
countProcessed,
|
|
242
|
+
fieldId,
|
|
243
|
+
);
|
|
244
|
+
countProcessed = shouldDropAttachEntry.length;
|
|
245
|
+
|
|
246
|
+
if (!shouldDropAttachEntry.value) {
|
|
247
|
+
// This detach is part of a move, and we are not dropping the attach, so we must preserve the detach as well.
|
|
248
|
+
return { value: false, length: countProcessed };
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
return { value: this.isFieldDetachedInOutput(fieldId), length: countProcessed };
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
private filterEditsForBuildChange(fieldChange: FieldChange, fieldId: FieldId): FieldChange {
|
|
256
|
+
return {
|
|
257
|
+
...fieldChange,
|
|
258
|
+
change: brand(
|
|
259
|
+
getChangeHandler(this.fieldKinds, fieldChange.fieldKind).rebaser.filterEdits(
|
|
260
|
+
fieldChange.change,
|
|
261
|
+
{
|
|
262
|
+
filterDetach: (detachId, count, inputRootId, endpoint) =>
|
|
263
|
+
this.filterDetachForBuildChange(fieldId, detachId, count, inputRootId, endpoint),
|
|
264
|
+
filterAttach: (id, count, _outputRootId, endpoint) =>
|
|
265
|
+
this.filterAttachForBuildChange(fieldId, id, count, endpoint),
|
|
266
|
+
preserveOtherEdits: false,
|
|
267
|
+
},
|
|
268
|
+
),
|
|
269
|
+
),
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
private filterDetachForBuildChange(
|
|
274
|
+
fieldId: FieldId,
|
|
275
|
+
detachId: ChangeAtomId,
|
|
276
|
+
count: number,
|
|
277
|
+
inputRootId: ChangeAtomId | undefined,
|
|
278
|
+
endpoint?: ChangeAtomId,
|
|
279
|
+
): RangeQueryResult<FilterDetachResult> {
|
|
280
|
+
if (!this.shouldSquashDetach(fieldId, inputRootId)) {
|
|
281
|
+
return {
|
|
282
|
+
value: { action: EditFilterStatus.Remove, shouldRemoveChild: false },
|
|
283
|
+
length: count,
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
let countProcessed = count;
|
|
288
|
+
const moveEndpointEntry = this.change.crossFieldKeys.getFirst(
|
|
289
|
+
{ ...(endpoint ?? detachId), target: CrossFieldTarget.Destination },
|
|
290
|
+
countProcessed,
|
|
291
|
+
);
|
|
292
|
+
countProcessed = moveEndpointEntry.length;
|
|
293
|
+
|
|
294
|
+
if (moveEndpointEntry.value !== undefined) {
|
|
295
|
+
const willSquashEndpointEntry = this.shouldSquashAttach(
|
|
296
|
+
moveEndpointEntry.value,
|
|
297
|
+
inputRootId ?? detachId,
|
|
298
|
+
countProcessed,
|
|
299
|
+
fieldId,
|
|
300
|
+
);
|
|
301
|
+
countProcessed = willSquashEndpointEntry.length;
|
|
302
|
+
|
|
303
|
+
const action = willSquashEndpointEntry.value
|
|
304
|
+
? EditFilterStatus.Preserve
|
|
305
|
+
: EditFilterStatus.PreserveWithoutMove;
|
|
306
|
+
|
|
307
|
+
return { value: { action }, length: countProcessed };
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
return { value: { action: EditFilterStatus.Preserve }, length: countProcessed };
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
private filterAttachForBuildChange(
|
|
314
|
+
fieldId: FieldId,
|
|
315
|
+
id: ChangeAtomId,
|
|
316
|
+
count: number,
|
|
317
|
+
endpoint?: ChangeAtomId,
|
|
318
|
+
): RangeQueryResult<FilterAttachResult> {
|
|
319
|
+
let countProcessed = count;
|
|
320
|
+
const moveId = endpoint ?? id;
|
|
321
|
+
const moveEndpointEntry = this.change.crossFieldKeys.getFirst(
|
|
322
|
+
{ ...moveId, target: CrossFieldTarget.Source },
|
|
323
|
+
countProcessed,
|
|
324
|
+
);
|
|
325
|
+
countProcessed = moveEndpointEntry.length;
|
|
326
|
+
|
|
327
|
+
const inputIdEntry = this.outputToInputRootId.getFirst(moveId, countProcessed);
|
|
328
|
+
countProcessed = inputIdEntry.length;
|
|
329
|
+
|
|
330
|
+
const rootInputId = inputIdEntry.value ?? moveId;
|
|
331
|
+
const shouldSquashEntry = this.shouldSquashAttach(
|
|
332
|
+
fieldId,
|
|
333
|
+
rootInputId,
|
|
334
|
+
countProcessed,
|
|
335
|
+
moveEndpointEntry.value,
|
|
336
|
+
);
|
|
337
|
+
countProcessed = shouldSquashEntry.length;
|
|
338
|
+
|
|
339
|
+
const isMove = moveEndpointEntry.value !== undefined;
|
|
340
|
+
if (!shouldSquashEntry.value) {
|
|
341
|
+
return { value: { action: EditFilterStatus.Remove }, length: countProcessed };
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
if (isMove) {
|
|
345
|
+
const movedNodeId = getFromChangeAtomIdMap(this.rootIdToNodeId, moveId);
|
|
346
|
+
return {
|
|
347
|
+
value: {
|
|
348
|
+
action: EditFilterStatus.PreserveWithoutMove,
|
|
349
|
+
nodeId: movedNodeId,
|
|
350
|
+
newAttachId: rootInputId,
|
|
351
|
+
},
|
|
352
|
+
length: countProcessed,
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
return {
|
|
357
|
+
value: { action: EditFilterStatus.Preserve },
|
|
358
|
+
length: countProcessed,
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Returns a version of `fieldChange` to be used in the final minimized change.
|
|
364
|
+
* The filtered change will have dropped:
|
|
365
|
+
* - Edits which were squashed into the built trees.
|
|
366
|
+
* - Detaches of built roots. If part of a move, these are instead represented as an attach at the final location.
|
|
367
|
+
* - Edits to nodes which are detached in the output, except for detaches of content which does end attached.
|
|
368
|
+
*/
|
|
369
|
+
private filterEditsForResidualChange(
|
|
370
|
+
fieldChange: FieldChange,
|
|
371
|
+
fieldId: FieldId,
|
|
372
|
+
): FieldChange {
|
|
373
|
+
return {
|
|
374
|
+
...fieldChange,
|
|
375
|
+
change: brand(
|
|
376
|
+
getChangeHandler(this.fieldKinds, fieldChange.fieldKind).rebaser.filterEdits(
|
|
377
|
+
fieldChange.change,
|
|
378
|
+
{
|
|
379
|
+
filterDetach: (...args) => this.filterDetachForResidualChange(fieldId, ...args),
|
|
380
|
+
filterAttach: (...args) => this.filterAttachForResidualChange(fieldId, ...args),
|
|
381
|
+
preserveOtherEdits: false,
|
|
382
|
+
},
|
|
383
|
+
),
|
|
384
|
+
),
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
private filterDetachForResidualChange(
|
|
389
|
+
fieldId: FieldId,
|
|
390
|
+
detachId: ChangeAtomId,
|
|
391
|
+
count: number,
|
|
392
|
+
inputRootId: ChangeAtomId | undefined,
|
|
393
|
+
endpoint?: ChangeAtomId,
|
|
394
|
+
): RangeQueryResult<FilterDetachResult> {
|
|
395
|
+
let countProcessed = count;
|
|
396
|
+
const moveId = endpoint ?? detachId;
|
|
397
|
+
const moveEndpointEntry = this.change.crossFieldKeys.getFirst(
|
|
398
|
+
{ ...moveId, target: CrossFieldTarget.Destination },
|
|
399
|
+
count,
|
|
400
|
+
);
|
|
401
|
+
countProcessed = moveEndpointEntry.length;
|
|
402
|
+
|
|
403
|
+
const shouldDropEntry = this.shouldDropDetach(
|
|
404
|
+
fieldId,
|
|
405
|
+
detachId,
|
|
406
|
+
inputRootId,
|
|
407
|
+
countProcessed,
|
|
408
|
+
moveEndpointEntry.value,
|
|
409
|
+
);
|
|
410
|
+
countProcessed = shouldDropEntry.length;
|
|
411
|
+
|
|
412
|
+
let hasPreservedAttach = false;
|
|
413
|
+
let hasDroppedAttach = false;
|
|
414
|
+
if (moveEndpointEntry.value !== undefined) {
|
|
415
|
+
const willDropAttachEntry = this.shouldDropAttach(
|
|
416
|
+
moveEndpointEntry.value,
|
|
417
|
+
inputRootId ?? detachId,
|
|
418
|
+
countProcessed,
|
|
419
|
+
fieldId,
|
|
420
|
+
);
|
|
421
|
+
countProcessed = willDropAttachEntry.length;
|
|
422
|
+
hasDroppedAttach = willDropAttachEntry.value;
|
|
423
|
+
hasPreservedAttach = !willDropAttachEntry.value;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
if (shouldDropEntry.value) {
|
|
427
|
+
// If there is a preserved attach, we will represent any child change at that location,
|
|
428
|
+
// so we must remove them from here.
|
|
429
|
+
return {
|
|
430
|
+
value: { action: EditFilterStatus.Remove, shouldRemoveChild: hasPreservedAttach },
|
|
431
|
+
length: countProcessed,
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
return {
|
|
436
|
+
value: {
|
|
437
|
+
action: hasDroppedAttach
|
|
438
|
+
? EditFilterStatus.PreserveWithoutMove
|
|
439
|
+
: EditFilterStatus.Preserve,
|
|
440
|
+
},
|
|
441
|
+
length: countProcessed,
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
private filterAttachForResidualChange(
|
|
446
|
+
fieldId: FieldId,
|
|
447
|
+
id: ChangeAtomId,
|
|
448
|
+
count: number,
|
|
449
|
+
outputRootId: ChangeAtomId | undefined,
|
|
450
|
+
endpoint?: ChangeAtomId,
|
|
451
|
+
): RangeQueryResult<FilterAttachResult> {
|
|
452
|
+
let countProcessed = count;
|
|
453
|
+
const moveId = endpoint ?? id;
|
|
454
|
+
const moveEndpointEntry = this.change.crossFieldKeys.getFirst(
|
|
455
|
+
{ ...moveId, target: CrossFieldTarget.Source },
|
|
456
|
+
countProcessed,
|
|
457
|
+
);
|
|
458
|
+
countProcessed = moveEndpointEntry.length;
|
|
459
|
+
|
|
460
|
+
const inputIdEntry = this.outputToInputRootId.getFirst(moveId, countProcessed);
|
|
461
|
+
countProcessed = inputIdEntry.length;
|
|
462
|
+
|
|
463
|
+
const rootInputId = inputIdEntry.value ?? moveId;
|
|
464
|
+
const shouldDropEntry = this.shouldDropAttach(
|
|
465
|
+
fieldId,
|
|
466
|
+
rootInputId,
|
|
467
|
+
countProcessed,
|
|
468
|
+
moveEndpointEntry.value,
|
|
469
|
+
);
|
|
470
|
+
countProcessed = shouldDropEntry.length;
|
|
471
|
+
|
|
472
|
+
if (shouldDropEntry.value) {
|
|
473
|
+
return {
|
|
474
|
+
value: { action: EditFilterStatus.Remove },
|
|
475
|
+
length: countProcessed,
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
if (moveEndpointEntry.value !== undefined) {
|
|
480
|
+
const willDropEndpointEntry = this.shouldDropDetach(
|
|
481
|
+
moveEndpointEntry.value,
|
|
482
|
+
moveId,
|
|
483
|
+
inputIdEntry.value,
|
|
484
|
+
countProcessed,
|
|
485
|
+
fieldId,
|
|
486
|
+
);
|
|
487
|
+
countProcessed = willDropEndpointEntry.length;
|
|
488
|
+
if (willDropEndpointEntry.value) {
|
|
489
|
+
const movedNodeId = getFromChangeAtomIdMap(this.rootIdToNodeId, moveId);
|
|
490
|
+
return {
|
|
491
|
+
value: {
|
|
492
|
+
action: EditFilterStatus.PreserveWithoutMove,
|
|
493
|
+
nodeId: movedNodeId,
|
|
494
|
+
newAttachId: inputIdEntry.value ?? moveId,
|
|
495
|
+
},
|
|
496
|
+
length: countProcessed,
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
return {
|
|
502
|
+
value: { action: EditFilterStatus.Preserve },
|
|
503
|
+
length: countProcessed,
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
private squashBuilds(forestFactory: () => IEditableForest): ChangeAtomIdBTree<TreeChunk> {
|
|
508
|
+
const changeForBuilds = filterEdits(
|
|
509
|
+
this.change,
|
|
510
|
+
this.filterEditsForBuildChange.bind(this),
|
|
511
|
+
this.fieldKinds,
|
|
512
|
+
);
|
|
513
|
+
|
|
514
|
+
const deltaForBuilds = intoDelta(makeAnonChange(changeForBuilds), this.fieldKinds);
|
|
515
|
+
assert(
|
|
516
|
+
!deltaFieldMapHasChanges(deltaForBuilds.fields),
|
|
517
|
+
0xd38 /* Expected all changes to attached tree to be filtered out */,
|
|
518
|
+
);
|
|
519
|
+
|
|
520
|
+
// There may still be paths to existing nodes in the delta, which must be removed before being applied to an empty forest.
|
|
521
|
+
// It is safe to remove these, because there are no edits to them, as asserted above.
|
|
522
|
+
(deltaForBuilds as Mutable<DeltaRoot<unknown>>).fields = new Map();
|
|
523
|
+
|
|
524
|
+
const forest = forestFactory();
|
|
525
|
+
const detachedFieldIndex = makeDetachedFieldIndex();
|
|
526
|
+
|
|
527
|
+
visitDelta(deltaForBuilds, forest.acquireVisitor(), detachedFieldIndex, undefined);
|
|
528
|
+
const squashedBuilds = newChangeAtomIdBTree<TreeChunk>();
|
|
529
|
+
const cursor = forest.getCursorAboveDetachedFields();
|
|
530
|
+
for (const entry of detachedFieldIndex.entries()) {
|
|
531
|
+
cursor.enterField(detachedFieldIndex.toFieldKey(entry.root));
|
|
532
|
+
const chunks = forest.chunkField(cursor);
|
|
533
|
+
|
|
534
|
+
// Delta visiting currently splits ranges of nodes into individual elements,
|
|
535
|
+
// so for now we will not have more than one node in a detached field.
|
|
536
|
+
assert(hasSingle(chunks), 0xd39 /* TODO: Handle multiple chunks */);
|
|
537
|
+
const chunk = chunks[0];
|
|
538
|
+
assert(chunk.topLevelLength === 1, 0xd3a /* TODO: Handle chunk with range of nodes */);
|
|
539
|
+
|
|
540
|
+
const rootId: ChangeAtomId = {
|
|
541
|
+
revision: entry.id.major,
|
|
542
|
+
localId: brand(entry.id.minor),
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
const isAttachedEntry = this.attachedRootIds.getFirst(rootId, chunk.topLevelLength);
|
|
546
|
+
assert(
|
|
547
|
+
isAttachedEntry.length === chunk.topLevelLength,
|
|
548
|
+
0xd3b /* TODO: Handle chunks which are only partially attached */,
|
|
549
|
+
);
|
|
550
|
+
|
|
551
|
+
if (isAttachedEntry.value) {
|
|
552
|
+
setInChangeAtomIdMap(squashedBuilds, rootId, chunk);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
cursor.exitField();
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
return squashedBuilds;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
function getOutputNodeAttachStates(
|
|
563
|
+
change: ModularChangeset,
|
|
564
|
+
fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>,
|
|
565
|
+
): ChangeAtomIdBTree<NodeAttachState> {
|
|
566
|
+
const inverse = invertModularChange(makeAnonChange(change), true, "root", fieldKinds);
|
|
567
|
+
return getInputNodeAttachStates(inverse, fieldKinds);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
function getInputNodeAttachStates(
|
|
571
|
+
change: ModularChangeset,
|
|
572
|
+
fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>,
|
|
573
|
+
): ChangeAtomIdBTree<NodeAttachState> {
|
|
574
|
+
const nodeAttachStates = newChangeAtomIdBTree<NodeAttachState>();
|
|
575
|
+
addInputNodeAttachStatesForFields(
|
|
576
|
+
NodeAttachState.Attached,
|
|
577
|
+
change.fieldChanges,
|
|
578
|
+
change.nodeChanges,
|
|
579
|
+
change.nodeAliases,
|
|
580
|
+
fieldKinds,
|
|
581
|
+
nodeAttachStates,
|
|
582
|
+
);
|
|
583
|
+
return nodeAttachStates;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
function addInputNodeAttachStatesForFields(
|
|
587
|
+
parentState: NodeAttachState,
|
|
588
|
+
fields: FieldChangeMap,
|
|
589
|
+
nodes: ChangeAtomIdBTree<NodeChangeset>,
|
|
590
|
+
nodeAliases: ChangeAtomIdBTree<NodeId>,
|
|
591
|
+
fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>,
|
|
592
|
+
nodeAttachStates: ChangeAtomIdBTree<NodeAttachState>,
|
|
593
|
+
): void {
|
|
594
|
+
for (const fieldChange of fields.values()) {
|
|
595
|
+
const children = getChangeHandler(fieldKinds, fieldChange.fieldKind).getNestedChanges(
|
|
596
|
+
fieldChange.change,
|
|
597
|
+
);
|
|
598
|
+
|
|
599
|
+
for (const { nodeId, inputRootId: inputId } of children) {
|
|
600
|
+
const normalizedNodeId = normalizeNodeId(nodeId, nodeAliases);
|
|
601
|
+
const attachState =
|
|
602
|
+
parentState === NodeAttachState.Attached && inputId === undefined
|
|
603
|
+
? NodeAttachState.Attached
|
|
604
|
+
: NodeAttachState.Detached;
|
|
605
|
+
|
|
606
|
+
nodeAttachStates.set([normalizedNodeId.revision, normalizedNodeId.localId], attachState);
|
|
607
|
+
|
|
608
|
+
const nodeChangeset = nodeChangeFromId(nodes, normalizedNodeId);
|
|
609
|
+
if (nodeChangeset.fieldChanges !== undefined) {
|
|
610
|
+
addInputNodeAttachStatesForFields(
|
|
611
|
+
attachState,
|
|
612
|
+
nodeChangeset.fieldChanges,
|
|
613
|
+
nodes,
|
|
614
|
+
nodeAliases,
|
|
615
|
+
fieldKinds,
|
|
616
|
+
nodeAttachStates,
|
|
617
|
+
);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
function getNodeInfo(
|
|
624
|
+
change: ModularChangeset,
|
|
625
|
+
fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>,
|
|
626
|
+
): {
|
|
627
|
+
readonly builtRootIds: ChangeAtomIdRangeMap<true>;
|
|
628
|
+
readonly builtNodeIds: ChangeAtomIdBTree<true>;
|
|
629
|
+
/**
|
|
630
|
+
* Maps from the input context ID for roots which are already detached,
|
|
631
|
+
* or detach ID for roots which are detached or moved by `change`.
|
|
632
|
+
*/
|
|
633
|
+
readonly rootIdToNodeId: ChangeAtomIdBTree<NodeId>;
|
|
634
|
+
} {
|
|
635
|
+
const builtRootIds = newChangeAtomIdRangeMap<true>();
|
|
636
|
+
if (change.builds !== undefined) {
|
|
637
|
+
for (const [rootId, chunk] of change.builds.entries()) {
|
|
638
|
+
builtRootIds.set(makeChangeAtomId(rootId[1], rootId[0]), chunk.topLevelLength, true);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
const builtNodeIds = newChangeAtomIdBTree<true>();
|
|
643
|
+
const rootIdToNodeId = newChangeAtomIdBTree<NodeId>();
|
|
644
|
+
addNodeInfoForFields(
|
|
645
|
+
false,
|
|
646
|
+
change.fieldChanges,
|
|
647
|
+
change.nodeChanges,
|
|
648
|
+
change.nodeAliases,
|
|
649
|
+
builtRootIds,
|
|
650
|
+
fieldKinds,
|
|
651
|
+
builtNodeIds,
|
|
652
|
+
rootIdToNodeId,
|
|
653
|
+
);
|
|
654
|
+
|
|
655
|
+
return { builtRootIds, builtNodeIds, rootIdToNodeId };
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
function addNodeInfoForFields(
|
|
659
|
+
parentIsBuilt: boolean,
|
|
660
|
+
fields: FieldChangeMap,
|
|
661
|
+
nodes: ChangeAtomIdBTree<NodeChangeset>,
|
|
662
|
+
nodeAliases: ChangeAtomIdBTree<NodeId>,
|
|
663
|
+
buildIds: ChangeAtomIdRangeMap<true>,
|
|
664
|
+
fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>,
|
|
665
|
+
builtNodeIds: ChangeAtomIdBTree<true>,
|
|
666
|
+
rootIdToNodeId: ChangeAtomIdBTree<NodeId>,
|
|
667
|
+
): void {
|
|
668
|
+
for (const fieldChange of fields.values()) {
|
|
669
|
+
const children = getChangeHandler(fieldKinds, fieldChange.fieldKind).getNestedChanges(
|
|
670
|
+
fieldChange.change,
|
|
671
|
+
);
|
|
672
|
+
|
|
673
|
+
for (const { nodeId, inputRootId: inputId, detachId } of children) {
|
|
674
|
+
const normalizedNodeId = normalizeNodeId(nodeId, nodeAliases);
|
|
675
|
+
const isPartOfBuild =
|
|
676
|
+
parentIsBuilt ||
|
|
677
|
+
(inputId !== undefined && buildIds.getFirst(inputId, 1).value === true);
|
|
678
|
+
|
|
679
|
+
if (isPartOfBuild) {
|
|
680
|
+
builtNodeIds.set([normalizedNodeId.revision, normalizedNodeId.localId], true);
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
if (inputId !== undefined) {
|
|
684
|
+
setInChangeAtomIdMap(rootIdToNodeId, inputId, normalizedNodeId);
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
if (detachId !== undefined) {
|
|
688
|
+
setInChangeAtomIdMap(rootIdToNodeId, detachId, normalizedNodeId);
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
const nodeChangeset = nodeChangeFromId(nodes, normalizedNodeId);
|
|
692
|
+
if (nodeChangeset.fieldChanges !== undefined) {
|
|
693
|
+
addNodeInfoForFields(
|
|
694
|
+
isPartOfBuild,
|
|
695
|
+
nodeChangeset.fieldChanges,
|
|
696
|
+
nodes,
|
|
697
|
+
nodeAliases,
|
|
698
|
+
buildIds,
|
|
699
|
+
fieldKinds,
|
|
700
|
+
builtNodeIds,
|
|
701
|
+
rootIdToNodeId,
|
|
702
|
+
);
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
/** A contiguous run of node IDs starting at `id` and spanning `count` consecutive IDs. */
|
|
709
|
+
interface ChangeAtomIdRange {
|
|
710
|
+
readonly id: ChangeAtomId;
|
|
711
|
+
readonly count: number;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
/**
|
|
715
|
+
* A set of node IDs, stored as a {@link ChangeAtomIdRangeMap} so that consecutive runs of IDs are
|
|
716
|
+
* represented (and marked/queried) as ranges rather than one entry per ID.
|
|
717
|
+
*/
|
|
718
|
+
type ChangeAtomIdRangeSet = ChangeAtomIdRangeMap<true>;
|
|
719
|
+
|
|
720
|
+
/**
|
|
721
|
+
* Collects the set of root IDs whose content ends up attached within the live document tree
|
|
722
|
+
* once the given change is applied.
|
|
723
|
+
* There are entries both for nodes which are detached in the input context,
|
|
724
|
+
* and also for nodes which are detached by this delta.
|
|
725
|
+
* The keys are pre-rename IDs.
|
|
726
|
+
*
|
|
727
|
+
* @remarks
|
|
728
|
+
* These are the "used" nodes: any build whose nodes are not in this set has no observable
|
|
729
|
+
* effect on the resulting document and can be dropped.
|
|
730
|
+
*/
|
|
731
|
+
function collectAttachedRootIds(
|
|
732
|
+
delta: DeltaRoot,
|
|
733
|
+
outputToInputRootId: ChangeAtomIdRangeMap<ChangeAtomId>,
|
|
734
|
+
): ChangeAtomIdRangeSet {
|
|
735
|
+
const detachIdToNodeChanges = getDeltaNodeChangesByDetachId(delta);
|
|
736
|
+
const attached: ChangeAtomIdRangeSet = newChangeAtomIdRangeMap<true>();
|
|
737
|
+
|
|
738
|
+
// Worklist of detached node ID ranges newly discovered to be live, whose own nested content must be visited.
|
|
739
|
+
const worklist: ChangeAtomIdRange[] = [];
|
|
740
|
+
const markLive = (attachId: ChangeAtomId, count: number): void => {
|
|
741
|
+
for (const inputIdEntry of outputToInputRootId.getAll(attachId, count)) {
|
|
742
|
+
const inputId = inputIdEntry.value ?? offsetChangeAtomId(attachId, inputIdEntry.offset);
|
|
743
|
+
|
|
744
|
+
// Only the sub-ranges of `[id, id + count)` that are not already live are newly discovered.
|
|
745
|
+
// Mark each such run live in a single range operation and enqueue it for processing.
|
|
746
|
+
for (const fragment of attached.getAll(inputId, inputIdEntry.length)) {
|
|
747
|
+
if (fragment.value === undefined) {
|
|
748
|
+
const runStart = offsetChangeAtomId(inputId, fragment.offset);
|
|
749
|
+
attached.set(runStart, fragment.length, true);
|
|
750
|
+
worklist.push({ id: runStart, count: fragment.length });
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
|
|
756
|
+
const visitLiveFields = (fields: DeltaFieldMap | undefined): void => {
|
|
757
|
+
if (fields === undefined) {
|
|
758
|
+
return;
|
|
759
|
+
}
|
|
760
|
+
for (const field of fields.values()) {
|
|
761
|
+
for (const mark of field.marks) {
|
|
762
|
+
if (mark.attach !== undefined) {
|
|
763
|
+
markLive(
|
|
764
|
+
{ revision: mark.attach.major, localId: brand(mark.attach.minor) },
|
|
765
|
+
mark.count,
|
|
766
|
+
);
|
|
767
|
+
}
|
|
768
|
+
// `mark.fields` edits the cell's pre-existing content. Only descend when that content
|
|
769
|
+
// stays in the live tree (i.e. it is not being detached out of the tree).
|
|
770
|
+
if (mark.detach === undefined) {
|
|
771
|
+
visitLiveFields(mark.fields);
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
};
|
|
776
|
+
|
|
777
|
+
visitLiveFields(delta.fields);
|
|
778
|
+
|
|
779
|
+
// Process node ranges discovered to be live: pull in their nested content and propagate
|
|
780
|
+
// liveness backwards across renames (a node attached under its post-rename ID was built under its
|
|
781
|
+
// pre-rename ID). Iterate to a fixed point.
|
|
782
|
+
while (worklist.length > 0) {
|
|
783
|
+
const next = worklist.pop();
|
|
784
|
+
if (next === undefined) {
|
|
785
|
+
break;
|
|
786
|
+
}
|
|
787
|
+
const { id, count } = next;
|
|
788
|
+
// Nested content is keyed per node, so it must be visited one ID at a time.
|
|
789
|
+
for (let offset = 0; offset < count; offset += 1) {
|
|
790
|
+
visitLiveFields(detachIdToNodeChanges.get(id.revision)?.get(brand(id.localId + offset)));
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
return attached;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* Returns a mapping from root ID to the field changes for that node.
|
|
799
|
+
* There are entries both for nodes which are detached in the input context,
|
|
800
|
+
* and also for nodes which are detached by this delta.
|
|
801
|
+
* The keys are pre-rename IDs.
|
|
802
|
+
*/
|
|
803
|
+
function getDeltaNodeChangesByDetachId(delta: DeltaRoot): ChangeAtomIdMap<DeltaFieldMap> {
|
|
804
|
+
const detachIdToChanges: ChangeAtomIdMap<DeltaFieldMap> = new Map();
|
|
805
|
+
|
|
806
|
+
const visitFields = (fields: DeltaFieldMap): void => {
|
|
807
|
+
for (const fieldChange of fields.values()) {
|
|
808
|
+
for (const mark of fieldChange.marks) {
|
|
809
|
+
if (mark.fields !== undefined) {
|
|
810
|
+
visitFields(mark.fields);
|
|
811
|
+
|
|
812
|
+
if (mark.detach !== undefined) {
|
|
813
|
+
setInNestedMap(
|
|
814
|
+
detachIdToChanges,
|
|
815
|
+
mark.detach.major,
|
|
816
|
+
mark.detach.minor,
|
|
817
|
+
mark.fields,
|
|
818
|
+
);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
};
|
|
824
|
+
|
|
825
|
+
if (delta.fields !== undefined) {
|
|
826
|
+
visitFields(delta.fields);
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
if (delta.global !== undefined) {
|
|
830
|
+
for (const { id, fields } of delta.global) {
|
|
831
|
+
setInNestedMap(detachIdToChanges, id.major, id.minor, fields);
|
|
832
|
+
visitFields(fields);
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
return detachIdToChanges;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
function outputToInputRootIdFromDelta(delta: DeltaRoot): ChangeAtomIdRangeMap<ChangeAtomId> {
|
|
840
|
+
const outputToInputRootId = newChangeAtomIdTransform();
|
|
841
|
+
if (delta.rename !== undefined) {
|
|
842
|
+
for (const { oldId, newId, count } of delta.rename) {
|
|
843
|
+
outputToInputRootId.set(
|
|
844
|
+
makeChangeAtomId(brand(newId.minor), newId.major),
|
|
845
|
+
count,
|
|
846
|
+
makeChangeAtomId(brand(oldId.minor), oldId.major),
|
|
847
|
+
);
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
return outputToInputRootId;
|
|
31
852
|
}
|