@fluidframework/tree 2.41.0-338186 → 2.41.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 +341 -0
- package/api-report/tree.alpha.api.md +174 -4
- package/dist/alpha.d.ts +3 -0
- package/dist/codec/codec.d.ts +52 -7
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +60 -8
- package/dist/codec/codec.js.map +1 -1
- package/dist/core/change-family/editBuilder.d.ts.map +1 -1
- package/dist/core/change-family/editBuilder.js.map +1 -1
- package/dist/core/forest/forest.d.ts.map +1 -1
- package/dist/core/forest/forest.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +2 -2
- package/dist/core/rebase/types.js +2 -2
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/rebase/utils.d.ts +0 -2
- package/dist/core/rebase/utils.d.ts.map +1 -1
- package/dist/core/rebase/utils.js +6 -10
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/schema-stored/formatV1.d.ts +0 -1
- package/dist/core/schema-stored/formatV1.d.ts.map +1 -1
- package/dist/core/schema-stored/formatV1.js +1 -2
- package/dist/core/schema-stored/formatV1.js.map +1 -1
- package/dist/core/schema-stored/index.d.ts +1 -1
- package/dist/core/schema-stored/index.d.ts.map +1 -1
- package/dist/core/schema-stored/index.js +2 -1
- package/dist/core/schema-stored/index.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +6 -0
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +8 -1
- 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 +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts +2 -1
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +4 -3
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/chunk.d.ts.map +1 -1
- package/dist/core/tree/chunk.js.map +1 -1
- package/dist/core/tree/delta.d.ts.map +1 -1
- package/dist/core/tree/delta.js.map +1 -1
- package/dist/core/tree/deltaUtil.d.ts.map +1 -1
- package/dist/core/tree/deltaUtil.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodec.d.ts +1 -1
- package/dist/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodec.js +1 -1
- package/dist/core/tree/detachedFieldIndexCodec.js.map +1 -1
- package/dist/core/tree/pathTree.d.ts +12 -11
- package/dist/core/tree/pathTree.d.ts.map +1 -1
- package/dist/core/tree/pathTree.js +8 -7
- package/dist/core/tree/pathTree.js.map +1 -1
- package/dist/core/tree/treeTextFormat.d.ts +1 -1
- package/dist/core/tree/treeTextFormat.d.ts.map +1 -1
- package/dist/core/tree/treeTextFormat.js +1 -1
- package/dist/core/tree/treeTextFormat.js.map +1 -1
- package/dist/core/tree/visitDelta.d.ts +1 -1
- package/dist/core/tree/visitDelta.d.ts.map +1 -1
- package/dist/core/tree/visitDelta.js.map +1 -1
- package/dist/core/tree/visitorUtils.d.ts +2 -2
- package/dist/core/tree/visitorUtils.d.ts.map +1 -1
- package/dist/core/tree/visitorUtils.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +2 -2
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +2 -2
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +2 -2
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +8 -2
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +12 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js +2 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.js +2 -1
- package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.js +4 -4
- package/dist/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js +3 -2
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts +18 -14
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js +78 -54
- package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +18 -2
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +22 -6
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +3 -2
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js +3 -2
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +3 -3
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +5 -4
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +2 -2
- package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.js +15 -15
- package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/dist/feature-libraries/initializeForest.d.ts.map +1 -1
- package/dist/feature-libraries/initializeForest.js.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +2 -2
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindTypes.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.d.ts +0 -2
- package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.js +0 -2
- package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -0
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +2 -0
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.d.ts.map +1 -1
- package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js +8 -3
- package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts +22 -5
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +296 -207
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +2 -2
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +3 -2
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
- package/dist/feature-libraries/schema-index/codec.d.ts +6 -12
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +8 -15
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.d.ts +2 -2
- package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.js +1 -1
- package/dist/feature-libraries/schema-index/formatV1.js.map +1 -1
- package/dist/feature-libraries/schema-index/index.d.ts +1 -1
- package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/index.js +1 -2
- package/dist/feature-libraries/schema-index/index.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV3.js.map +1 -1
- package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/dist/feature-libraries/sequence-field/prune.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/prune.js.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.js +1 -1
- package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +1 -1
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +2 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.d.ts +7 -5
- package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.js +7 -5
- package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.d.ts.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.js +3 -3
- package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
- package/dist/feature-libraries/treeTextCursor.d.ts +1 -1
- package/dist/feature-libraries/treeTextCursor.js +1 -1
- package/dist/feature-libraries/treeTextCursor.js.map +1 -1
- package/dist/feature-libraries/valueUtilities.d.ts.map +1 -1
- package/dist/feature-libraries/valueUtilities.js +6 -6
- package/dist/feature-libraries/valueUtilities.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -6
- package/dist/index.js.map +1 -1
- package/dist/jsonDomainSchema.d.ts.map +1 -1
- package/dist/jsonDomainSchema.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.map +1 -1
- package/dist/serializableDomainSchema.js.map +1 -1
- package/dist/shared-tree/checkoutFlexTreeView.d.ts.map +1 -1
- package/dist/shared-tree/checkoutFlexTreeView.js.map +1 -1
- package/dist/shared-tree/independentView.d.ts +1 -1
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +8 -3
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +1 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts +1 -1
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +1 -1
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +3 -3
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +8 -8
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/tree.js +1 -1
- package/dist/shared-tree/tree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +84 -2
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +75 -22
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +3 -2
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +2 -2
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +2 -2
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.d.ts +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts +3 -1
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +4 -2
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.d.ts +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts +1 -1
- package/dist/shared-tree-core/messageCodecs.js +1 -1
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
- package/dist/shared-tree-core/sequenceIdUtils.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +2 -2
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +4 -4
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts.map +1 -1
- package/dist/shared-tree-core/transaction.js +1 -1
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
- package/dist/sharedTreeAttributes.d.ts.map +1 -1
- package/dist/sharedTreeAttributes.js.map +1 -1
- package/dist/simple-tree/api/conciseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/conciseTree.js +1 -1
- package/dist/simple-tree/api/conciseTree.js.map +1 -1
- package/dist/simple-tree/api/configuration.js +4 -4
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/create.d.ts +2 -26
- package/dist/simple-tree/api/create.d.ts.map +1 -1
- package/dist/simple-tree/api/create.js +5 -42
- package/dist/simple-tree/api/create.js.map +1 -1
- package/dist/simple-tree/api/customTree.d.ts +1 -1
- package/dist/simple-tree/api/customTree.d.ts.map +1 -1
- package/dist/simple-tree/api/customTree.js +24 -24
- package/dist/simple-tree/api/customTree.js.map +1 -1
- package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/dist/simple-tree/api/identifierIndex.js +2 -2
- package/dist/simple-tree/api/identifierIndex.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +2 -3
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +4 -9
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +5 -5
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +8 -8
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +1 -3
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +4 -6
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +2 -2
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +4 -6
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +7 -6
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +2 -2
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/treeBeta.js +1 -1
- package/dist/simple-tree/api/treeBeta.js.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.d.ts +38 -3
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +42 -28
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +1 -1
- 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 +3 -3
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +4 -6
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/dist/simple-tree/core/context.d.ts.map +1 -1
- package/dist/simple-tree/core/context.js.map +1 -1
- package/dist/simple-tree/core/getOrCreateNode.d.ts +1 -1
- package/dist/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
- package/dist/simple-tree/core/getOrCreateNode.js +1 -1
- package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
- package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNode.js +1 -1
- package/dist/simple-tree/core/treeNode.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts +8 -20
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +19 -50
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/types.d.ts.map +1 -1
- package/dist/simple-tree/core/types.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +21 -21
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/core/withType.d.ts +1 -1
- package/dist/simple-tree/core/withType.d.ts.map +1 -1
- package/dist/simple-tree/core/withType.js.map +1 -1
- package/dist/simple-tree/createContext.d.ts.map +1 -1
- package/dist/simple-tree/createContext.js.map +1 -1
- package/{lib/simple-tree/proxies.d.ts → dist/simple-tree/getTreeNodeForField.d.ts} +1 -1
- package/dist/simple-tree/getTreeNodeForField.d.ts.map +1 -0
- package/dist/simple-tree/{proxies.js → getTreeNodeForField.js} +1 -1
- package/dist/simple-tree/getTreeNodeForField.js.map +1 -0
- package/dist/simple-tree/index.d.ts +3 -10
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +17 -23
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/{arrayNode.d.ts → node-kinds/array/arrayNode.d.ts} +3 -3
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -0
- package/dist/simple-tree/{arrayNode.js → node-kinds/array/arrayNode.js} +10 -10
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -0
- package/dist/simple-tree/{arrayNodeTypes.d.ts → node-kinds/array/arrayNodeTypes.d.ts} +3 -3
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -0
- package/dist/simple-tree/{arrayNodeTypes.js → node-kinds/array/arrayNodeTypes.js} +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -0
- package/dist/simple-tree/node-kinds/array/index.d.ts +7 -0
- package/dist/simple-tree/node-kinds/array/index.d.ts.map +1 -0
- package/dist/simple-tree/node-kinds/array/index.js +16 -0
- package/dist/simple-tree/node-kinds/array/index.js.map +1 -0
- package/dist/simple-tree/node-kinds/index.d.ts +8 -0
- package/dist/simple-tree/node-kinds/index.d.ts.map +1 -0
- package/dist/simple-tree/node-kinds/index.js +26 -0
- package/dist/simple-tree/node-kinds/index.js.map +1 -0
- package/dist/simple-tree/node-kinds/map/index.d.ts +7 -0
- package/dist/simple-tree/node-kinds/map/index.d.ts.map +1 -0
- package/dist/simple-tree/node-kinds/map/index.js +13 -0
- package/dist/simple-tree/node-kinds/map/index.js.map +1 -0
- package/{lib/simple-tree → dist/simple-tree/node-kinds/map}/mapNode.d.ts +3 -3
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -0
- package/dist/simple-tree/{mapNode.js → node-kinds/map/mapNode.js} +11 -11
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -0
- package/dist/simple-tree/{mapNodeTypes.d.ts → node-kinds/map/mapNodeTypes.d.ts} +3 -3
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -0
- package/dist/simple-tree/{mapNodeTypes.js → node-kinds/map/mapNodeTypes.js} +1 -1
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -0
- package/dist/simple-tree/node-kinds/object/index.d.ts +7 -0
- package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -0
- package/dist/simple-tree/node-kinds/object/index.js +16 -0
- package/dist/simple-tree/node-kinds/object/index.js.map +1 -0
- package/{lib/simple-tree → dist/simple-tree/node-kinds/object}/objectNode.d.ts +17 -6
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -0
- package/dist/simple-tree/{objectNode.js → node-kinds/object/objectNode.js} +49 -26
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -0
- package/{lib/simple-tree → dist/simple-tree/node-kinds/object}/objectNodeTypes.d.ts +5 -5
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -0
- package/dist/simple-tree/{objectNodeTypes.js → node-kinds/object/objectNodeTypes.js} +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -0
- package/dist/simple-tree/prepareForInsertion.d.ts +18 -6
- package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/dist/simple-tree/prepareForInsertion.js +51 -22
- package/dist/simple-tree/prepareForInsertion.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +2 -2
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchema.js.map +1 -1
- package/dist/simple-tree/toMapTree.d.ts +2 -22
- package/dist/simple-tree/toMapTree.d.ts.map +1 -1
- package/dist/simple-tree/toMapTree.js +44 -23
- package/dist/simple-tree/toMapTree.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +1 -1
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/treeNodeValid.d.ts +1 -1
- package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/treeNodeValid.js +10 -10
- package/dist/simple-tree/treeNodeValid.js.map +1 -1
- package/dist/simple-tree/walkFieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/walkFieldSchema.js.map +1 -1
- package/dist/tableSchema.d.ts +119 -72
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +83 -36
- package/dist/tableSchema.js.map +1 -1
- package/dist/treeFactory.d.ts +1 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +3 -3
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/bTreeUtils.d.ts.map +1 -1
- package/dist/util/bTreeUtils.js.map +1 -1
- package/dist/util/breakable.d.ts +23 -4
- package/dist/util/breakable.d.ts.map +1 -1
- package/dist/util/breakable.js +12 -3
- package/dist/util/breakable.js.map +1 -1
- package/docs/SharedTree Philosophy.md +5 -5
- package/lib/alpha.d.ts +3 -0
- package/lib/codec/codec.d.ts +52 -7
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +60 -8
- package/lib/codec/codec.js.map +1 -1
- package/lib/core/change-family/editBuilder.d.ts.map +1 -1
- package/lib/core/change-family/editBuilder.js.map +1 -1
- package/lib/core/forest/forest.d.ts.map +1 -1
- package/lib/core/forest/forest.js.map +1 -1
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +2 -2
- package/lib/core/rebase/types.js +2 -2
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/rebase/utils.d.ts +0 -2
- package/lib/core/rebase/utils.d.ts.map +1 -1
- package/lib/core/rebase/utils.js +6 -10
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/schema-stored/formatV1.d.ts +0 -1
- package/lib/core/schema-stored/formatV1.d.ts.map +1 -1
- package/lib/core/schema-stored/formatV1.js +0 -1
- package/lib/core/schema-stored/formatV1.js.map +1 -1
- package/lib/core/schema-stored/index.d.ts +1 -1
- package/lib/core/schema-stored/index.d.ts.map +1 -1
- package/lib/core/schema-stored/index.js +1 -1
- package/lib/core/schema-stored/index.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +6 -0
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +7 -0
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.js +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/lib/core/tree/anchorSet.d.ts +2 -1
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +4 -3
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/chunk.d.ts.map +1 -1
- package/lib/core/tree/chunk.js.map +1 -1
- package/lib/core/tree/delta.d.ts.map +1 -1
- package/lib/core/tree/delta.js.map +1 -1
- package/lib/core/tree/deltaUtil.d.ts.map +1 -1
- package/lib/core/tree/deltaUtil.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodec.d.ts +1 -1
- package/lib/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodec.js +1 -1
- package/lib/core/tree/detachedFieldIndexCodec.js.map +1 -1
- package/lib/core/tree/pathTree.d.ts +12 -11
- package/lib/core/tree/pathTree.d.ts.map +1 -1
- package/lib/core/tree/pathTree.js +8 -7
- package/lib/core/tree/pathTree.js.map +1 -1
- package/lib/core/tree/treeTextFormat.d.ts +1 -1
- package/lib/core/tree/treeTextFormat.d.ts.map +1 -1
- package/lib/core/tree/treeTextFormat.js +1 -1
- package/lib/core/tree/treeTextFormat.js.map +1 -1
- package/lib/core/tree/visitDelta.d.ts +1 -1
- package/lib/core/tree/visitDelta.d.ts.map +1 -1
- package/lib/core/tree/visitDelta.js.map +1 -1
- package/lib/core/tree/visitorUtils.d.ts +2 -2
- package/lib/core/tree/visitorUtils.d.ts.map +1 -1
- package/lib/core/tree/visitorUtils.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +2 -2
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +2 -2
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +2 -2
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +8 -2
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +10 -0
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.js +1 -1
- package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.js +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js +1 -1
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts +18 -14
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js +76 -53
- package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +18 -2
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +23 -7
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +3 -2
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js +3 -2
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +3 -3
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +3 -3
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts +2 -2
- package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.js +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/lib/feature-libraries/initializeForest.d.ts.map +1 -1
- package/lib/feature-libraries/initializeForest.js.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +1 -1
- 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/fieldKindWithEditor.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +2 -2
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindTypes.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.d.ts +0 -2
- package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.js +0 -2
- package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -0
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +2 -0
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.d.ts.map +1 -1
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js +8 -3
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts +22 -5
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +299 -209
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +2 -2
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +4 -3
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
- package/lib/feature-libraries/schema-index/codec.d.ts +6 -12
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +8 -15
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.d.ts +2 -2
- package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.js +2 -2
- package/lib/feature-libraries/schema-index/formatV1.js.map +1 -1
- package/lib/feature-libraries/schema-index/index.d.ts +1 -1
- package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/index.js +1 -1
- package/lib/feature-libraries/schema-index/index.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV3.js.map +1 -1
- package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/lib/feature-libraries/sequence-field/prune.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/prune.js.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.js +1 -1
- package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +1 -1
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +2 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.d.ts +7 -5
- package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.js +7 -5
- package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.d.ts.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.js +3 -3
- package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
- package/lib/feature-libraries/treeTextCursor.d.ts +1 -1
- package/lib/feature-libraries/treeTextCursor.js +1 -1
- package/lib/feature-libraries/treeTextCursor.js.map +1 -1
- package/lib/feature-libraries/valueUtilities.d.ts.map +1 -1
- package/lib/feature-libraries/valueUtilities.js +1 -1
- package/lib/feature-libraries/valueUtilities.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -2
- package/lib/index.js.map +1 -1
- package/lib/jsonDomainSchema.d.ts.map +1 -1
- package/lib/jsonDomainSchema.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.map +1 -1
- package/lib/serializableDomainSchema.js.map +1 -1
- package/lib/shared-tree/checkoutFlexTreeView.d.ts.map +1 -1
- package/lib/shared-tree/checkoutFlexTreeView.js.map +1 -1
- package/lib/shared-tree/independentView.d.ts +1 -1
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +10 -5
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +1 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts +1 -1
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +1 -1
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +3 -3
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +10 -10
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/tree.js +1 -1
- package/lib/shared-tree/tree.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +84 -2
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +65 -12
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +3 -2
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +2 -2
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +2 -2
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.d.ts +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts +3 -1
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +4 -2
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.d.ts +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts +1 -1
- package/lib/shared-tree-core/messageCodecs.js +1 -1
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
- package/lib/shared-tree-core/sequenceIdUtils.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +2 -2
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +4 -4
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts.map +1 -1
- package/lib/shared-tree-core/transaction.js +1 -1
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
- package/lib/sharedTreeAttributes.d.ts.map +1 -1
- package/lib/sharedTreeAttributes.js.map +1 -1
- package/lib/simple-tree/api/conciseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/conciseTree.js +1 -1
- package/lib/simple-tree/api/conciseTree.js.map +1 -1
- package/lib/simple-tree/api/configuration.js +1 -1
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/create.d.ts +2 -26
- package/lib/simple-tree/api/create.d.ts.map +1 -1
- package/lib/simple-tree/api/create.js +2 -37
- package/lib/simple-tree/api/create.js.map +1 -1
- package/lib/simple-tree/api/customTree.d.ts +1 -1
- package/lib/simple-tree/api/customTree.d.ts.map +1 -1
- package/lib/simple-tree/api/customTree.js +3 -3
- package/lib/simple-tree/api/customTree.js.map +1 -1
- package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/lib/simple-tree/api/identifierIndex.js +1 -1
- package/lib/simple-tree/api/identifierIndex.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +2 -3
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +2 -5
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +5 -5
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +5 -5
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +1 -3
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +1 -3
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +2 -2
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +1 -3
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +3 -2
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +2 -2
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/treeBeta.js +1 -1
- package/lib/simple-tree/api/treeBeta.js.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.d.ts +38 -3
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +39 -28
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +1 -1
- 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/api/verboseTree.js +1 -1
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +1 -3
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/lib/simple-tree/core/context.d.ts.map +1 -1
- package/lib/simple-tree/core/context.js.map +1 -1
- package/lib/simple-tree/core/getOrCreateNode.d.ts +1 -1
- package/lib/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
- package/lib/simple-tree/core/getOrCreateNode.js +2 -2
- package/lib/simple-tree/core/getOrCreateNode.js.map +1 -1
- package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNode.js +1 -1
- package/lib/simple-tree/core/treeNode.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts +8 -20
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +18 -49
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/core/types.d.ts.map +1 -1
- package/lib/simple-tree/core/types.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +3 -3
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/core/withType.d.ts +1 -1
- package/lib/simple-tree/core/withType.d.ts.map +1 -1
- package/lib/simple-tree/core/withType.js.map +1 -1
- package/lib/simple-tree/createContext.d.ts.map +1 -1
- package/lib/simple-tree/createContext.js.map +1 -1
- package/{dist/simple-tree/proxies.d.ts → lib/simple-tree/getTreeNodeForField.d.ts} +1 -1
- package/lib/simple-tree/getTreeNodeForField.d.ts.map +1 -0
- package/lib/simple-tree/{proxies.js → getTreeNodeForField.js} +1 -1
- package/lib/simple-tree/getTreeNodeForField.js.map +1 -0
- package/lib/simple-tree/index.d.ts +3 -10
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +3 -7
- 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.map +1 -1
- package/lib/simple-tree/{arrayNode.d.ts → node-kinds/array/arrayNode.d.ts} +3 -3
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -0
- package/lib/simple-tree/{arrayNode.js → node-kinds/array/arrayNode.js} +10 -10
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -0
- package/lib/simple-tree/{arrayNodeTypes.d.ts → node-kinds/array/arrayNodeTypes.d.ts} +3 -3
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -0
- package/lib/simple-tree/{arrayNodeTypes.js → node-kinds/array/arrayNodeTypes.js} +1 -1
- package/{dist/simple-tree → lib/simple-tree/node-kinds/array}/arrayNodeTypes.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/index.d.ts +7 -0
- package/lib/simple-tree/node-kinds/array/index.d.ts.map +1 -0
- package/lib/simple-tree/node-kinds/array/index.js +7 -0
- package/lib/simple-tree/node-kinds/array/index.js.map +1 -0
- package/lib/simple-tree/node-kinds/index.d.ts +8 -0
- package/lib/simple-tree/node-kinds/index.d.ts.map +1 -0
- package/lib/simple-tree/node-kinds/index.js +8 -0
- package/lib/simple-tree/node-kinds/index.js.map +1 -0
- package/lib/simple-tree/node-kinds/map/index.d.ts +7 -0
- package/lib/simple-tree/node-kinds/map/index.d.ts.map +1 -0
- package/lib/simple-tree/node-kinds/map/index.js +7 -0
- package/lib/simple-tree/node-kinds/map/index.js.map +1 -0
- package/{dist/simple-tree → lib/simple-tree/node-kinds/map}/mapNode.d.ts +3 -3
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -0
- package/lib/simple-tree/{mapNode.js → node-kinds/map/mapNode.js} +8 -8
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -0
- package/lib/simple-tree/{mapNodeTypes.d.ts → node-kinds/map/mapNodeTypes.d.ts} +3 -3
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -0
- package/lib/simple-tree/{mapNodeTypes.js → node-kinds/map/mapNodeTypes.js} +1 -1
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -0
- package/lib/simple-tree/node-kinds/object/index.d.ts +7 -0
- package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -0
- package/lib/simple-tree/node-kinds/object/index.js +7 -0
- package/lib/simple-tree/node-kinds/object/index.js.map +1 -0
- package/{dist/simple-tree → lib/simple-tree/node-kinds/object}/objectNode.d.ts +17 -6
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -0
- package/lib/simple-tree/{objectNode.js → node-kinds/object/objectNode.js} +35 -13
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -0
- package/{dist/simple-tree → lib/simple-tree/node-kinds/object}/objectNodeTypes.d.ts +5 -5
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -0
- package/lib/simple-tree/{objectNodeTypes.js → node-kinds/object/objectNodeTypes.js} +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -0
- package/lib/simple-tree/prepareForInsertion.d.ts +18 -6
- package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/lib/simple-tree/prepareForInsertion.js +51 -22
- package/lib/simple-tree/prepareForInsertion.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +2 -2
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -1
- package/lib/simple-tree/toMapTree.d.ts +2 -22
- package/lib/simple-tree/toMapTree.d.ts.map +1 -1
- package/lib/simple-tree/toMapTree.js +44 -22
- package/lib/simple-tree/toMapTree.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +1 -1
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/treeNodeValid.d.ts +1 -1
- package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/treeNodeValid.js +2 -2
- package/lib/simple-tree/treeNodeValid.js.map +1 -1
- package/lib/simple-tree/walkFieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/walkFieldSchema.js.map +1 -1
- package/lib/tableSchema.d.ts +119 -72
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +83 -36
- package/lib/tableSchema.js.map +1 -1
- package/lib/treeFactory.d.ts +1 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +3 -3
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/bTreeUtils.d.ts.map +1 -1
- package/lib/util/bTreeUtils.js.map +1 -1
- package/lib/util/breakable.d.ts +23 -4
- package/lib/util/breakable.d.ts.map +1 -1
- package/lib/util/breakable.js +12 -3
- package/lib/util/breakable.js.map +1 -1
- package/package.json +21 -21
- package/src/codec/codec.ts +64 -8
- package/src/core/change-family/editBuilder.ts +1 -0
- package/src/core/forest/forest.ts +1 -1
- package/src/core/index.ts +1 -0
- package/src/core/rebase/types.ts +2 -2
- package/src/core/rebase/utils.ts +10 -10
- package/src/core/schema-stored/formatV1.ts +0 -2
- package/src/core/schema-stored/index.ts +1 -0
- package/src/core/schema-stored/schema.ts +9 -0
- package/src/core/schema-stored/storedSchemaRepository.ts +2 -2
- package/src/core/tree/anchorSet.ts +6 -5
- package/src/core/tree/chunk.ts +2 -1
- package/src/core/tree/delta.ts +1 -0
- package/src/core/tree/deltaUtil.ts +1 -1
- package/src/core/tree/detachedFieldIndex.ts +1 -1
- package/src/core/tree/detachedFieldIndexCodec.ts +2 -2
- package/src/core/tree/pathTree.ts +13 -12
- package/src/core/tree/treeTextFormat.ts +2 -1
- package/src/core/tree/visitDelta.ts +1 -1
- package/src/core/tree/visitorUtils.ts +3 -2
- package/src/feature-libraries/chunked-forest/chunkTree.ts +2 -2
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +4 -4
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +5 -5
- package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +2 -2
- package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +1 -0
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +15 -1
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +1 -1
- package/src/feature-libraries/chunked-forest/codec/index.ts +1 -0
- package/src/feature-libraries/chunked-forest/codec/nodeShape.ts +1 -1
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +1 -1
- package/src/feature-libraries/chunked-forest/emptyChunk.ts +1 -0
- package/src/feature-libraries/chunked-forest/index.ts +1 -0
- package/src/feature-libraries/chunked-forest/sequenceChunk.ts +1 -1
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +2 -3
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +2 -2
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +1 -0
- package/src/feature-libraries/default-schema/index.ts +6 -1
- package/src/feature-libraries/default-schema/mappedEditBuilder.ts +1 -0
- package/src/feature-libraries/default-schema/schemaChecker.ts +74 -48
- package/src/feature-libraries/flex-tree/context.ts +29 -8
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +3 -2
- package/src/feature-libraries/flex-tree/lazyField.ts +1 -1
- package/src/feature-libraries/flex-tree/utilities.ts +1 -1
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -1
- package/src/feature-libraries/index.ts +3 -2
- package/src/feature-libraries/indexing/anchorTreeIndex.ts +4 -2
- package/src/feature-libraries/initializeForest.ts +1 -1
- package/src/feature-libraries/modular-schema/crossFieldQueries.ts +1 -0
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +1 -1
- package/src/feature-libraries/modular-schema/fieldKindWithEditor.ts +1 -1
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +4 -2
- package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +1 -0
- package/src/feature-libraries/modular-schema/genericFieldKindTypes.ts +1 -0
- package/src/feature-libraries/modular-schema/isNeverTree.ts +0 -2
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +1 -1
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +2 -0
- package/src/feature-libraries/modular-schema/modularChangeTypes.ts +1 -0
- package/src/feature-libraries/node-identifier/mockNodeIdentifierManager.ts +11 -5
- package/src/feature-libraries/object-forest/objectForest.ts +65 -7
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +5 -8
- package/src/feature-libraries/schema-index/codec.ts +13 -21
- package/src/feature-libraries/schema-index/formatV1.ts +2 -2
- package/src/feature-libraries/schema-index/index.ts +0 -1
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +1 -1
- package/src/feature-libraries/sequence-field/formatV3.ts +1 -0
- package/src/feature-libraries/sequence-field/markQueue.ts +1 -0
- package/src/feature-libraries/sequence-field/prune.ts +1 -0
- package/src/feature-libraries/sequence-field/rebase.ts +1 -1
- package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +1 -1
- package/src/feature-libraries/sequence-field/replaceRevisions.ts +3 -1
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +2 -2
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +3 -3
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +3 -3
- package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +2 -2
- package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +1 -1
- package/src/feature-libraries/sequence-field/utils.ts +7 -5
- package/src/feature-libraries/treeCursorUtils.ts +3 -3
- package/src/feature-libraries/treeTextCursor.ts +1 -1
- package/src/feature-libraries/valueUtilities.ts +1 -1
- package/src/index.ts +1 -4
- package/src/jsonDomainSchema.ts +0 -1
- package/src/packageVersion.ts +1 -1
- package/src/serializableDomainSchema.ts +1 -0
- package/src/shared-tree/checkoutFlexTreeView.ts +1 -0
- package/src/shared-tree/independentView.ts +10 -3
- package/src/shared-tree/index.ts +4 -1
- package/src/shared-tree/schematizeTree.ts +2 -1
- package/src/shared-tree/schematizingTreeView.ts +2 -2
- package/src/shared-tree/sharedTree.ts +26 -19
- package/src/shared-tree/sharedTreeChangeFamily.ts +1 -1
- package/src/shared-tree/tree.ts +1 -1
- package/src/shared-tree/treeAlpha.ts +171 -26
- package/src/shared-tree/treeCheckout.ts +3 -2
- package/src/shared-tree-core/branch.ts +3 -4
- package/src/shared-tree-core/branchCommitEnricher.ts +3 -1
- package/src/shared-tree-core/defaultResubmitMachine.ts +2 -0
- package/src/shared-tree-core/editManager.ts +4 -2
- package/src/shared-tree-core/editManagerCodecs.ts +1 -0
- package/src/shared-tree-core/editManagerSummarizer.ts +1 -1
- package/src/shared-tree-core/messageCodecs.ts +1 -1
- package/src/shared-tree-core/sequenceIdUtils.ts +1 -0
- package/src/shared-tree-core/sharedTreeCore.ts +5 -5
- package/src/shared-tree-core/transaction.ts +4 -2
- package/src/shared-tree-core/transactionEnricher.ts +2 -0
- package/src/sharedTreeAttributes.ts +1 -0
- package/src/simple-tree/api/conciseTree.ts +3 -2
- package/src/simple-tree/api/configuration.ts +1 -1
- package/src/simple-tree/api/create.ts +4 -80
- package/src/simple-tree/api/customTree.ts +4 -4
- package/src/simple-tree/api/getSimpleSchema.ts +1 -0
- package/src/simple-tree/api/identifierIndex.ts +1 -1
- package/src/simple-tree/api/index.ts +8 -11
- package/src/simple-tree/api/schemaCompatibilityTester.ts +2 -0
- package/src/simple-tree/api/schemaFactory.ts +28 -23
- package/src/simple-tree/api/schemaFactoryAlpha.ts +8 -6
- package/src/simple-tree/api/schemaFactoryRecursive.ts +3 -3
- package/src/simple-tree/api/schemaFromSimple.ts +3 -1
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -3
- package/src/simple-tree/api/storedSchema.ts +5 -4
- package/src/simple-tree/api/tree.ts +3 -4
- package/src/simple-tree/api/treeBeta.ts +3 -2
- package/src/simple-tree/api/treeNodeApi.ts +91 -42
- package/src/simple-tree/api/typesUnsafe.ts +1 -1
- package/src/simple-tree/api/verboseTree.ts +1 -1
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +1 -3
- package/src/simple-tree/core/context.ts +1 -0
- package/src/simple-tree/core/getOrCreateNode.ts +4 -3
- package/src/simple-tree/core/treeNode.ts +1 -1
- package/src/simple-tree/core/treeNodeKernel.ts +32 -61
- package/src/simple-tree/core/treeNodeSchema.ts +1 -0
- package/src/simple-tree/core/types.ts +1 -1
- package/src/simple-tree/core/unhydratedFlexTree.ts +4 -3
- package/src/simple-tree/core/withType.ts +1 -1
- package/src/simple-tree/createContext.ts +1 -0
- package/src/simple-tree/{proxies.ts → getTreeNodeForField.ts} +2 -0
- package/src/simple-tree/index.ts +17 -22
- package/src/simple-tree/leafNodeSchema.ts +1 -0
- package/src/simple-tree/{arrayNode.ts → node-kinds/array/arrayNode.ts} +11 -11
- package/src/simple-tree/{arrayNodeTypes.ts → node-kinds/array/arrayNodeTypes.ts} +3 -3
- package/src/simple-tree/node-kinds/array/index.ts +18 -0
- package/src/simple-tree/node-kinds/index.ts +40 -0
- package/src/simple-tree/node-kinds/map/index.ts +16 -0
- package/src/simple-tree/{mapNode.ts → node-kinds/map/mapNode.ts} +10 -10
- package/src/simple-tree/{mapNodeTypes.ts → node-kinds/map/mapNodeTypes.ts} +3 -3
- package/src/simple-tree/node-kinds/object/index.ts +17 -0
- package/src/simple-tree/{objectNode.ts → node-kinds/object/objectNode.ts} +63 -34
- package/src/simple-tree/{objectNodeTypes.ts → node-kinds/object/objectNodeTypes.ts} +5 -5
- package/src/simple-tree/prepareForInsertion.ts +68 -28
- package/src/simple-tree/schemaTypes.ts +4 -3
- package/src/simple-tree/simpleSchema.ts +1 -0
- package/src/simple-tree/toMapTree.ts +13 -56
- package/src/simple-tree/toStoredSchema.ts +3 -2
- package/src/simple-tree/treeNodeValid.ts +3 -3
- package/src/simple-tree/walkFieldSchema.ts +0 -1
- package/src/tableSchema.ts +109 -62
- package/src/treeFactory.ts +3 -5
- package/src/util/bTreeUtils.ts +1 -0
- package/src/util/breakable.ts +19 -4
- package/dist/simple-tree/api/testRecursiveDomain.d.ts +0 -62
- package/dist/simple-tree/api/testRecursiveDomain.d.ts.map +0 -1
- package/dist/simple-tree/api/testRecursiveDomain.js +0 -45
- package/dist/simple-tree/api/testRecursiveDomain.js.map +0 -1
- package/dist/simple-tree/arrayNode.d.ts.map +0 -1
- package/dist/simple-tree/arrayNode.js.map +0 -1
- package/dist/simple-tree/arrayNodeTypes.d.ts.map +0 -1
- package/dist/simple-tree/mapNode.d.ts.map +0 -1
- package/dist/simple-tree/mapNode.js.map +0 -1
- package/dist/simple-tree/mapNodeTypes.d.ts.map +0 -1
- package/dist/simple-tree/mapNodeTypes.js.map +0 -1
- package/dist/simple-tree/objectNode.d.ts.map +0 -1
- package/dist/simple-tree/objectNode.js.map +0 -1
- package/dist/simple-tree/objectNodeTypes.d.ts.map +0 -1
- package/dist/simple-tree/objectNodeTypes.js.map +0 -1
- package/dist/simple-tree/proxies.d.ts.map +0 -1
- package/dist/simple-tree/proxies.js.map +0 -1
- package/lib/simple-tree/api/testRecursiveDomain.d.ts +0 -62
- package/lib/simple-tree/api/testRecursiveDomain.d.ts.map +0 -1
- package/lib/simple-tree/api/testRecursiveDomain.js +0 -41
- package/lib/simple-tree/api/testRecursiveDomain.js.map +0 -1
- package/lib/simple-tree/arrayNode.d.ts.map +0 -1
- package/lib/simple-tree/arrayNode.js.map +0 -1
- package/lib/simple-tree/arrayNodeTypes.d.ts.map +0 -1
- package/lib/simple-tree/arrayNodeTypes.js.map +0 -1
- package/lib/simple-tree/mapNode.d.ts.map +0 -1
- package/lib/simple-tree/mapNode.js.map +0 -1
- package/lib/simple-tree/mapNodeTypes.d.ts.map +0 -1
- package/lib/simple-tree/mapNodeTypes.js.map +0 -1
- package/lib/simple-tree/objectNode.d.ts.map +0 -1
- package/lib/simple-tree/objectNode.js.map +0 -1
- package/lib/simple-tree/objectNodeTypes.d.ts.map +0 -1
- package/lib/simple-tree/objectNodeTypes.js.map +0 -1
- package/lib/simple-tree/proxies.d.ts.map +0 -1
- package/lib/simple-tree/proxies.js.map +0 -1
- package/src/simple-tree/api/testRecursiveDomain.ts +0 -53
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markQueue.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/markQueue.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"markQueue.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/markQueue.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,eAAe,EAA2B,MAAM,sBAAsB,CAAC;AACrF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,qBAAa,SAAS;IAKpB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAL7B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,OAAO,CAAC,KAAK,CAAK;gBAGA,IAAI,EAAE,SAAS,IAAI,EAAE,EACrB,WAAW,EAAE,eAAe;IAKvC,OAAO,IAAI,OAAO;IAIlB,OAAO,IAAI,IAAI;IAMf,UAAU,IAAI,IAAI,GAAG,SAAS;IAarC;;;;OAIG;IACI,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAWjC,IAAI,IAAI,IAAI,GAAG,SAAS;CAO/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markQueue.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/markQueue.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"markQueue.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/markQueue.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,qCAAqC,CAAC;AAElE,OAAO,EAAwB,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAErF,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,OAAO,SAAS;IAIrB,YACkB,IAAqB,EACrB,WAA4B;QAD5B,SAAI,GAAJ,IAAI,CAAiB;QACrB,gBAAW,GAAX,WAAW,CAAiB;QAL7B,UAAK,GAAW,EAAE,CAAC;QAC5B,UAAK,GAAG,CAAC,CAAC;QAMjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;IAEM,OAAO;QACb,OAAO,IAAI,CAAC,IAAI,EAAE,KAAK,SAAS,CAAC;IAClC,CAAC;IAEM,OAAO;QACb,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QACjC,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACvE,OAAO,MAAM,CAAC;IACf,CAAC;IAEM,UAAU;QAChB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QAChF,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,SAAS,CAAC;QAClB,CAAC;QAED,MAAM,UAAU,GAAG,uBAAuB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACnE,KAAK,IAAI,CAAC,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAChD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACI,WAAW,CAAC,MAAc;QAChC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC5B,IAAI,IAAI,CAAC,KAAK,IAAI,MAAM,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC;QACb,CAAC;QAED,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvB,OAAO,KAAK,CAAC;IACd,CAAC;IAEM,IAAI;QACV,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAC/B,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACxB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob } from \"@fluidframework/core-utils/internal\";\n\nimport { type MoveEffectTable, splitMarkForMoveEffects } from \"./moveEffectTable.js\";\nimport type { Mark } from \"./types.js\";\nimport { splitMark } from \"./utils.js\";\n\nexport class MarkQueue {\n\tprivate readonly stack: Mark[] = [];\n\tprivate index = 0;\n\n\tpublic constructor(\n\t\tprivate readonly list: readonly Mark[],\n\t\tprivate readonly moveEffects: MoveEffectTable,\n\t) {\n\t\tthis.list = list;\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn this.peek() === undefined;\n\t}\n\n\tpublic dequeue(): Mark {\n\t\tconst output = this.tryDequeue();\n\t\tassert(output !== undefined, 0x4e2 /* Unexpected end of mark queue */);\n\t\treturn output;\n\t}\n\n\tpublic tryDequeue(): Mark | undefined {\n\t\tconst mark = this.stack.length > 0 ? this.stack.pop() : this.list[this.index++];\n\t\tif (mark === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst splitMarks = splitMarkForMoveEffects(mark, this.moveEffects);\n\t\tfor (let i = splitMarks.length - 1; i > 0; i--) {\n\t\t\tthis.stack.push(splitMarks[i] ?? oob());\n\t\t}\n\t\treturn splitMarks[0];\n\t}\n\n\t/**\n\t * Dequeues the first `length` sized portion of the next mark,\n\t * or the entire next mark if `length` is longer than the mark's length.\n\t * @param length - The length to dequeue, measured in the input context.\n\t */\n\tpublic dequeueUpTo(length: number): Mark {\n\t\tconst mark = this.dequeue();\n\t\tif (mark.count <= length) {\n\t\t\treturn mark;\n\t\t}\n\n\t\tconst [mark1, mark2] = splitMark(mark, length);\n\t\tthis.stack.push(mark2);\n\t\treturn mark1;\n\t}\n\n\tpublic peek(): Mark | undefined {\n\t\tconst mark = this.tryDequeue();\n\t\tif (mark !== undefined) {\n\t\t\tthis.stack.push(mark);\n\t\t}\n\t\treturn mark;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prune.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/prune.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"prune.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/prune.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,wBAAgB,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,GAAG,SAAS,CASlF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prune.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/prune.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"prune.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/prune.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,UAAU,KAAK,CAAC,SAAoB,EAAE,SAA2B;IACtE,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;IACrC,KAAK,IAAI,IAAI,IAAI,SAAS,EAAE,CAAC;QAC5B,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAChC,IAAI,GAAG,cAAc,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QACtD,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACpB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { NodeChangePruner } from \"../modular-schema/index.js\";\n\nimport { MarkListFactory } from \"./markListFactory.js\";\nimport type { Changeset } from \"./types.js\";\nimport { withNodeChange } from \"./utils.js\";\n\nexport function prune(changeset: Changeset, pruneNode: NodeChangePruner): Changeset {\n\tconst pruned = new MarkListFactory();\n\tfor (let mark of changeset) {\n\t\tif (mark.changes !== undefined) {\n\t\t\tmark = withNodeChange(mark, pruneNode(mark.changes));\n\t\t}\n\t\tpruned.push(mark);\n\t}\n\treturn pruned.list;\n}\n"]}
|
|
@@ -198,7 +198,7 @@ function rebaseMarkIgnoreChild(currMark, baseMark, moveEffects) {
|
|
|
198
198
|
return rebasedMark;
|
|
199
199
|
}
|
|
200
200
|
/**
|
|
201
|
-
*
|
|
201
|
+
* Returns a pair of marks that represent the effects which should remain in place in the face of concurrent move,
|
|
202
202
|
* and the effects that should be sent to the move destination.
|
|
203
203
|
*/
|
|
204
204
|
function separateEffectsForMove(mark) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rebase.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/rebase.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAG9E,OAAO,EAAkC,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAEN,gBAAgB,EAEhB,eAAe,GAGf,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAGN,aAAa,EACb,QAAQ,EACR,UAAU,EACV,SAAS,EACT,aAAa,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAYN,YAAY,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,SAAS,EACT,kBAAkB,EAClB,oBAAoB,EACpB,WAAW,EACX,SAAS,EACT,mCAAmC,EACnC,iBAAiB,EACjB,qBAAqB,EACrB,WAAW,EACX,cAAc,EACd,uB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,KAAK,CACd,CAAC;IACH,CAAC;SAAM,CAAC;QACP,OAAO,SAAS,CAAC;IAClB,CAAC;AACF,CAAC;AAED,SAAS,mBAAmB,CAC3B,WAA4B,EAC5B,QAAiC,EACjC,EAAU,EACV,KAAa;IAEb,OAAO,aAAa,CAAC,WAAW,EAAE,gBAAgB,CAAC,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC,KAAK;QACzF,EAAE,cAAc,CAAC;AACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport type { ChangeAtomId, RevisionMetadataSource, RevisionTag } from \"../../core/index.js\";\nimport { type IdAllocator, type Mutable, brand } from \"../../util/index.js\";\nimport {\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\ttype NodeChangeRebaser,\n\tNodeAttachState,\n\ttype NodeId,\n\ttype RebaseRevisionMetadata,\n} from \"../modular-schema/index.js\";\n\nimport { MarkListFactory } from \"./markListFactory.js\";\nimport { MarkQueue } from \"./markQueue.js\";\nimport {\n\ttype MoveEffect,\n\ttype MoveEffectTable,\n\tgetMoveEffect,\n\tisMoveIn,\n\tisMoveMark,\n\tisMoveOut,\n\tsetMoveEffect,\n} from \"./moveEffectTable.js\";\nimport {\n\ttype CellId,\n\ttype CellMark,\n\ttype Changeset,\n\ttype Detach,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype MarkList,\n\ttype MoveId,\n\ttype MoveIn,\n\ttype MoveOut,\n\ttype NoopMark,\n\tNoopMarkType,\n} from \"./types.js\";\nimport {\n\tCellOrder,\n\tareInputCellsEmpty,\n\tcellSourcesFromMarks,\n\tcloneCellId,\n\tcloneMark,\n\tcompareCellPositionsUsingTombstones,\n\textractMarkEffect,\n\tgetDetachOutputCellId,\n\tgetEndpoint,\n\tgetInputCellId,\n\tisAttachAndDetachEffect,\n\tisDetach,\n\tisNewAttach,\n\tisRename,\n\tisTombstone,\n\tmarkEmptiesCells,\n\tmarkFillsCells,\n\tsplitMarkEffect,\n\twithNodeChange,\n} from \"./utils.js\";\n\n/**\n * Rebases `change` over `base` assuming they both apply to the same initial state.\n * @param change - The changeset to rebase.\n * @param base - The changeset to rebase over.\n * @returns A changeset that performs the changes in `change` but does so assuming `base` has been applied first.\n */\nexport function rebase(\n\tchange: Changeset,\n\tbase: Changeset,\n\trebaseChild: NodeChangeRebaser,\n\tgenId: IdAllocator,\n\tmanager: CrossFieldManager,\n\trevisionMetadata: RebaseRevisionMetadata,\n): Changeset {\n\treturn rebaseMarkList(\n\t\tchange,\n\t\tbase,\n\t\trevisionMetadata,\n\t\trebaseChild,\n\t\tgenId,\n\t\tmanager as MoveEffectTable,\n\t);\n}\n\nfunction rebaseMarkList(\n\tcurrMarkList: MarkList,\n\tbaseMarkList: MarkList,\n\tmetadata: RebaseRevisionMetadata,\n\trebaseChild: NodeChangeRebaser,\n\tgenId: IdAllocator,\n\tmoveEffects: CrossFieldManager<MoveEffect>,\n): MarkList {\n\tconst factory = new MarkListFactory();\n\tconst queue = new RebaseQueue(baseMarkList, currMarkList, metadata, moveEffects);\n\n\twhile (!queue.isEmpty()) {\n\t\tconst { baseMark, newMark: currMark } = queue.pop();\n\t\tconst rebasedMark = rebaseMark(currMark, baseMark, rebaseChild, moveEffects);\n\t\tfactory.push(rebasedMark);\n\t}\n\n\treturn factory.list;\n}\n\n/**\n * Generates a NoOp mark that targets the same cells as the input mark.\n * @param mark - The mark the NoOp should target.\n * @param revision - The revision, if available.\n * @returns A NoOp mark that targets the same cells as the input mark.\n */\nfunction generateNoOpWithCellId(mark: Mark): CellMark<NoopMark> {\n\tconst length = mark.count;\n\tconst cellId = getInputCellId(mark);\n\treturn cellId === undefined ? { count: length } : { count: length, cellId };\n}\n\nclass RebaseQueue {\n\tprivate readonly baseMarks: MarkQueue;\n\tprivate readonly newMarks: MarkQueue;\n\tprivate readonly baseMarksCellSources: ReadonlySet<RevisionTag | undefined>;\n\tprivate readonly newMarksCellSources: ReadonlySet<RevisionTag | undefined>;\n\n\tpublic constructor(\n\t\tbaseMarks: Changeset,\n\t\tnewMarks: Changeset,\n\t\tprivate readonly metadata: RevisionMetadataSource,\n\t\tprivate readonly moveEffects: MoveEffectTable,\n\t) {\n\t\tthis.baseMarks = new MarkQueue(baseMarks, moveEffects);\n\t\tthis.newMarks = new MarkQueue(newMarks, moveEffects);\n\t\tthis.baseMarksCellSources = cellSourcesFromMarks(baseMarks, getInputCellId);\n\t\tthis.newMarksCellSources = cellSourcesFromMarks(newMarks, getInputCellId);\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn this.baseMarks.isEmpty() && this.newMarks.isEmpty();\n\t}\n\n\tpublic pop(): RebaseMarks {\n\t\tconst baseMark = this.baseMarks.peek();\n\t\tconst newMark = this.newMarks.peek();\n\t\tassert(\n\t\t\t!(baseMark === undefined && newMark === undefined),\n\t\t\t0x722 /* Cannot pop from empty queue */,\n\t\t);\n\n\t\tif (baseMark === undefined) {\n\t\t\tconst dequeuedNewMark = this.newMarks.dequeue();\n\t\t\treturn {\n\t\t\t\tbaseMark: generateNoOpWithCellId(dequeuedNewMark),\n\t\t\t\tnewMark: dequeuedNewMark,\n\t\t\t};\n\t\t} else if (newMark === undefined) {\n\t\t\treturn this.dequeueBase();\n\t\t} else if (areInputCellsEmpty(baseMark) && areInputCellsEmpty(newMark)) {\n\t\t\tconst baseId = getInputCellId(baseMark);\n\t\t\tconst newId = getInputCellId(newMark);\n\t\t\tassert(\n\t\t\t\tbaseId !== undefined && newId !== undefined,\n\t\t\t\t0x89f /* Both marks should have cell IDs */,\n\t\t\t);\n\t\t\tconst comparison = compareCellPositionsUsingTombstones(\n\t\t\t\tbaseId,\n\t\t\t\tnewId,\n\t\t\t\tthis.baseMarksCellSources,\n\t\t\t\tthis.newMarksCellSources,\n\t\t\t\tthis.metadata,\n\t\t\t);\n\t\t\tswitch (comparison) {\n\t\t\t\tcase CellOrder.SameCell:\n\t\t\t\t\treturn this.dequeueBoth();\n\t\t\t\tcase CellOrder.OldThenNew:\n\t\t\t\t\treturn this.dequeueBase();\n\t\t\t\tcase CellOrder.NewThenOld:\n\t\t\t\t\treturn this.dequeueNew();\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(comparison);\n\t\t\t}\n\t\t} else if (areInputCellsEmpty(newMark)) {\n\t\t\treturn this.dequeueNew();\n\t\t} else if (areInputCellsEmpty(baseMark)) {\n\t\t\treturn this.dequeueBase();\n\t\t} else {\n\t\t\treturn this.dequeueBoth();\n\t\t}\n\t}\n\n\tprivate dequeueBase(length?: number): RebaseMarks {\n\t\tconst baseMark =\n\t\t\tlength !== undefined ? this.baseMarks.dequeueUpTo(length) : this.baseMarks.dequeue();\n\n\t\tlet newMark: Mark = generateNoOpWithCellId(baseMark);\n\n\t\tconst movedEffect = getMovedEffectFromBaseMark(this.moveEffects, baseMark);\n\n\t\tif (movedEffect !== undefined) {\n\t\t\tnewMark = addMovedMarkEffect(newMark, movedEffect);\n\t\t}\n\n\t\treturn {\n\t\t\tbaseMark,\n\t\t\tnewMark,\n\t\t};\n\t}\n\n\tprivate dequeueNew(): RebaseMarks {\n\t\tconst newMark = this.newMarks.dequeue();\n\t\treturn { newMark, baseMark: generateNoOpWithCellId(newMark) };\n\t}\n\n\tprivate dequeueBoth(): RebaseMarks {\n\t\tconst baseMark = this.baseMarks.peek();\n\t\tconst newMark = this.newMarks.peek();\n\t\tassert(\n\t\t\tbaseMark !== undefined && newMark !== undefined,\n\t\t\t0x69c /* Cannot dequeue both unless both mark queues are non-empty */,\n\t\t);\n\t\tconst length = Math.min(newMark.count, baseMark.count);\n\t\tconst sizedBaseMark = this.baseMarks.dequeueUpTo(length);\n\t\tconst sizedNewMark = this.newMarks.dequeueUpTo(length);\n\t\tconst movedMark = getMovedEffectFromBaseMark(this.moveEffects, sizedBaseMark);\n\t\treturn {\n\t\t\tbaseMark: sizedBaseMark,\n\t\t\tnewMark:\n\t\t\t\tmovedMark === undefined ? sizedNewMark : addMovedMarkEffect(sizedNewMark, movedMark),\n\t\t};\n\t}\n}\n\n/**\n * Combines `mark` and `effect` into a single mark.\n * This function is only intended to handle cases where `mark` is part of a changeset being rebased\n * and `effect` is an effect from the same changeset whose target has been moved by the base changeset.\n * @returns a mark which has the composite effect of `mark` and `effect`.\n */\nfunction addMovedMarkEffect(mark: Mark, effect: Detach): Mark {\n\tif (isMoveIn(mark) && isMoveOut(effect)) {\n\t\treturn { ...mark, type: \"Insert\" };\n\t} else if (isRename(mark) && isMoveOut(effect)) {\n\t\treturn { ...effect, count: mark.count, idOverride: mark.idOverride };\n\t} else if (isAttachAndDetachEffect(mark) && isMoveIn(mark.attach) && isMoveOut(effect)) {\n\t\treturn { ...mark.detach, count: mark.count };\n\t} else if (isTombstone(mark)) {\n\t\treturn { ...mark, ...effect };\n\t}\n\tassert(false, 0x818 /* Unexpected combination of mark effects at source and destination */);\n}\n\n/**\n * Represents the marks rebasing should process next.\n * If `baseMark` and `newMark` are both defined, then they are `SizedMark`s covering the same range of nodes.\n */\ninterface RebaseMarks {\n\tbaseMark: Mark;\n\tnewMark: Mark;\n}\n\nfunction rebaseMark(\n\tcurrMark: Mark,\n\tbaseMark: Mark,\n\trebaseChild: NodeChangeRebaser,\n\tmoveEffects: MoveEffectTable,\n): Mark {\n\tconst rebasedMark = rebaseNodeChange(cloneMark(currMark), baseMark, rebaseChild);\n\tconst movedNodeChanges = getMovedChangesFromBaseMark(moveEffects, baseMark);\n\tif (movedNodeChanges !== undefined) {\n\t\tassert(\n\t\t\trebasedMark.changes === undefined,\n\t\t\t0x8dc /* Unexpected collision of new node changes */,\n\t\t);\n\t\trebasedMark.changes = movedNodeChanges;\n\t\tmoveEffects.onMoveIn(movedNodeChanges);\n\t}\n\n\treturn rebaseMarkIgnoreChild(rebasedMark, baseMark, moveEffects);\n}\n\nfunction rebaseMarkIgnoreChild(\n\tcurrMark: Mark,\n\tbaseMark: Mark,\n\tmoveEffects: MoveEffectTable,\n): Mark {\n\tlet rebasedMark: Mark;\n\tif (isDetach(baseMark)) {\n\t\tif (baseMark.cellId !== undefined) {\n\t\t\t// Detaches on empty cells have an implicit revive effect.\n\t\t\tdelete currMark.cellId;\n\t\t}\n\t\tassert(\n\t\t\t!isNewAttach(currMark),\n\t\t\t0x69d /* A new attach should not be rebased over its cell being emptied */,\n\t\t);\n\t\tconst baseCellId = getDetachOutputCellId(baseMark);\n\n\t\tif (isMoveOut(baseMark)) {\n\t\t\tassert(isMoveMark(baseMark), 0x6f0 /* Only move marks have move IDs */);\n\t\t\tassert(\n\t\t\t\t!isNewAttach(currMark),\n\t\t\t\t0x819 /* New attaches should not be rebased over moves */,\n\t\t\t);\n\t\t\tconst { remains, follows } = separateEffectsForMove(extractMarkEffect(currMark));\n\t\t\tif (follows !== undefined) {\n\t\t\t\tsendEffectToDest(follows, moveEffects, getEndpoint(baseMark), baseMark.count);\n\t\t\t}\n\n\t\t\tif (currMark.changes !== undefined) {\n\t\t\t\tmoveRebasedChanges(currMark.changes, moveEffects, getEndpoint(baseMark));\n\t\t\t}\n\t\t\trebasedMark = { ...(remains ?? {}), count: baseMark.count };\n\t\t} else {\n\t\t\trebasedMark = currMark;\n\t\t}\n\t\trebasedMark = makeDetachedMark(rebasedMark, cloneCellId(baseCellId));\n\t} else if (markFillsCells(baseMark)) {\n\t\trebasedMark = isAttachAndDetachEffect(currMark)\n\t\t\t? withNodeChange({ ...currMark.detach, count: currMark.count }, currMark.changes)\n\t\t\t: withCellId(currMark, undefined);\n\t} else if (isAttachAndDetachEffect(baseMark)) {\n\t\tassert(\n\t\t\tbaseMark.cellId !== undefined,\n\t\t\t0x81a /* AttachAndDetach mark should target an empty cell */,\n\t\t);\n\t\tconst halfRebasedMark = rebaseMarkIgnoreChild(\n\t\t\tcurrMark,\n\t\t\t{ ...baseMark.attach, cellId: cloneCellId(baseMark.cellId), count: baseMark.count },\n\t\t\tmoveEffects,\n\t\t);\n\t\trebasedMark = rebaseMarkIgnoreChild(\n\t\t\thalfRebasedMark,\n\t\t\t{ ...baseMark.detach, count: baseMark.count },\n\t\t\tmoveEffects,\n\t\t);\n\t} else if (isRename(baseMark)) {\n\t\treturn withCellId(currMark, getDetachOutputCellId(baseMark));\n\t} else {\n\t\trebasedMark = currMark;\n\t}\n\treturn rebasedMark;\n}\n\n/**\n * @returns A pair of marks that represent the effects which should remain in place in the face of concurrent move,\n * and the effects that should be sent to the move destination.\n */\nfunction separateEffectsForMove(mark: MarkEffect): {\n\tremains?: MarkEffect;\n\tfollows?: Detach;\n} {\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase \"Remove\":\n\t\tcase \"MoveOut\": {\n\t\t\t// There are two scenarios that lead to a Detach mark having an idOverride:\n\t\t\t// 1. The detach is a rollback (the idOverride the original id that the cell had in the input context of the attach being rolled back).\n\t\t\t// 2. The detach has been composed with a Rename (the idOverride is the cell id in the output context of the rename).\n\t\t\t// Since rollbacks are never rebased, we can safely assume that the idOverride is due to a Rename (scenario #2).\n\t\t\t// While the detach must follow the node that it targets, the rename must remain in place because it targets the cell.\n\t\t\tif (mark.idOverride !== undefined) {\n\t\t\t\tconst remains: MarkEffect = { type: \"Rename\", idOverride: mark.idOverride };\n\t\t\t\tconst follows: Mutable<MarkEffect> = { ...mark };\n\t\t\t\tdelete follows.idOverride;\n\t\t\t\treturn { remains, follows };\n\t\t\t}\n\t\t\treturn { follows: mark };\n\t\t}\n\t\tcase \"AttachAndDetach\":\n\t\t\treturn { follows: mark.detach, remains: mark.attach };\n\t\tcase \"MoveIn\":\n\t\tcase \"Rename\":\n\t\t\treturn { remains: mark };\n\t\tcase NoopMarkType:\n\t\t\treturn {};\n\t\tcase \"Insert\": {\n\t\t\tconst follows: MoveOut = {\n\t\t\t\ttype: \"MoveOut\",\n\t\t\t\tid: mark.id,\n\t\t\t};\n\t\t\tconst remains: MoveIn = {\n\t\t\t\ttype: \"MoveIn\",\n\t\t\t\tid: mark.id,\n\t\t\t};\n\t\t\tif (mark.revision !== undefined) {\n\t\t\t\tfollows.revision = mark.revision;\n\t\t\t\tremains.revision = mark.revision;\n\t\t\t}\n\t\t\treturn { remains, follows };\n\t\t}\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\n// TODO: Reduce the duplication between this and other MoveEffect helpers\nfunction sendEffectToDest(\n\tmarkEffect: Detach,\n\tmoveEffects: MoveEffectTable,\n\t{ revision, localId: id }: ChangeAtomId,\n\tcount: number,\n): void {\n\tconst effect = getMoveEffect(\n\t\tmoveEffects,\n\t\tCrossFieldTarget.Destination,\n\t\trevision,\n\t\tid,\n\t\tcount,\n\t\tfalse,\n\t);\n\tif (effect.length < count) {\n\t\tconst [markEffect1, markEffect2] = splitMarkEffect(markEffect, effect.length);\n\t\tconst newEffect =\n\t\t\teffect.value !== undefined\n\t\t\t\t? { ...effect.value, movedMark: markEffect1 }\n\t\t\t\t: { movedMark: markEffect1 };\n\t\tsetMoveEffect(\n\t\t\tmoveEffects,\n\t\t\tCrossFieldTarget.Destination,\n\t\t\trevision,\n\t\t\tid,\n\t\t\teffect.length,\n\t\t\tnewEffect,\n\t\t);\n\t\tsendEffectToDest(\n\t\t\tmarkEffect2,\n\t\t\tmoveEffects,\n\t\t\t{ revision, localId: brand(id + effect.length) },\n\t\t\tcount - effect.length,\n\t\t);\n\t} else {\n\t\tconst newEffect: MoveEffect =\n\t\t\teffect.value !== undefined\n\t\t\t\t? { ...effect.value, movedEffect: markEffect }\n\t\t\t\t: { movedEffect: markEffect };\n\t\tsetMoveEffect(moveEffects, CrossFieldTarget.Destination, revision, id, count, newEffect);\n\t}\n}\n\nfunction moveRebasedChanges(\n\tnodeChange: NodeId,\n\tmoveEffects: MoveEffectTable,\n\t{ revision, localId: id }: ChangeAtomId,\n): void {\n\tconst effect = getMoveEffect(\n\t\tmoveEffects,\n\t\tCrossFieldTarget.Destination,\n\t\trevision,\n\t\tid,\n\t\t1,\n\t\tfalse,\n\t).value;\n\n\tconst newEffect =\n\t\teffect !== undefined\n\t\t\t? { ...effect, rebasedChanges: nodeChange }\n\t\t\t: { rebasedChanges: nodeChange };\n\n\tsetMoveEffect(moveEffects, CrossFieldTarget.Destination, revision, id, 1, newEffect);\n}\n\nfunction rebaseNodeChange(\n\tcurrMark: Mark,\n\tbaseMark: Mark,\n\tnodeRebaser: NodeChangeRebaser,\n): Mark {\n\tconst baseChange = baseMark.changes;\n\tconst currChange = currMark.changes;\n\n\tif (baseChange === undefined && currChange === undefined) {\n\t\treturn currMark;\n\t}\n\n\tconst nodeState = nodeStateAfterMark(baseMark);\n\treturn withNodeChange(currMark, nodeRebaser(currChange, baseChange, nodeState));\n}\n\nfunction nodeStateAfterMark(mark: Mark): NodeAttachState {\n\tif (markEmptiesCells(mark)) {\n\t\treturn NodeAttachState.Detached;\n\t} else if (markFillsCells(mark)) {\n\t\treturn NodeAttachState.Attached;\n\t} else {\n\t\treturn mark.cellId === undefined ? NodeAttachState.Attached : NodeAttachState.Detached;\n\t}\n}\n\nfunction makeDetachedMark(mark: Mark, cellId: ChangeAtomId): Mark {\n\tassert(mark.cellId === undefined, 0x69f /* Expected mark to be attached */);\n\treturn { ...mark, cellId };\n}\n\nfunction withCellId<TMark extends Mark>(mark: TMark, cellId: CellId | undefined): TMark {\n\tconst newMark = { ...mark, cellId };\n\tif (cellId === undefined) {\n\t\tdelete newMark.cellId;\n\t}\n\treturn newMark;\n}\n\nfunction getMovedEffectFromBaseMark(\n\tmoveEffects: MoveEffectTable,\n\tbaseMark: Mark,\n): Detach | undefined {\n\tif (isMoveIn(baseMark)) {\n\t\treturn getMovedEffect(moveEffects, baseMark.revision, baseMark.id, baseMark.count);\n\t} else if (isAttachAndDetachEffect(baseMark) && isMoveIn(baseMark.attach)) {\n\t\treturn getMovedEffect(\n\t\t\tmoveEffects,\n\t\t\tbaseMark.attach.revision,\n\t\t\tbaseMark.attach.id,\n\t\t\tbaseMark.count,\n\t\t);\n\t} else {\n\t\treturn undefined;\n\t}\n}\n\n// It is expected that the range from `id` to `id + count - 1` has the same move effect.\n// The call sites to this function are making queries about a mark which has already been split by a `MarkQueue`\n// to match the ranges in `moveEffects`.\n// TODO: Reduce the duplication between this and other MoveEffect helpers\nfunction getMovedEffect(\n\tmoveEffects: MoveEffectTable,\n\trevision: RevisionTag | undefined,\n\tid: MoveId,\n\tcount: number,\n): Detach | undefined {\n\tconst effect = getMoveEffect(moveEffects, CrossFieldTarget.Destination, revision, id, count);\n\tassert(effect.length === count, 0x6f3 /* Expected effect to cover entire mark */);\n\tconst movedEffect = effect.value?.movedEffect;\n\tif (movedEffect === undefined) {\n\t\treturn undefined;\n\t}\n\tif (isMoveOut(movedEffect)) {\n\t\tmoveEffects.moveKey(CrossFieldTarget.Source, movedEffect.revision, movedEffect.id, count);\n\t}\n\treturn movedEffect;\n}\n\nfunction getMovedChangesFromBaseMark(\n\tmoveEffects: MoveEffectTable,\n\tbaseMark: Mark,\n): NodeId | undefined {\n\tif (isMoveIn(baseMark)) {\n\t\treturn getMovedNodeChanges(moveEffects, baseMark.revision, baseMark.id, baseMark.count);\n\t} else if (isAttachAndDetachEffect(baseMark) && isMoveIn(baseMark.attach)) {\n\t\treturn getMovedNodeChanges(\n\t\t\tmoveEffects,\n\t\t\tbaseMark.attach.revision,\n\t\t\tbaseMark.attach.id,\n\t\t\tbaseMark.count,\n\t\t);\n\t} else {\n\t\treturn undefined;\n\t}\n}\n\nfunction getMovedNodeChanges(\n\tmoveEffects: MoveEffectTable,\n\trevision: RevisionTag | undefined,\n\tid: MoveId,\n\tcount: number,\n): NodeId | undefined {\n\treturn getMoveEffect(moveEffects, CrossFieldTarget.Destination, revision, id, count).value\n\t\t?.rebasedChanges;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"rebase.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/rebase.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAG9E,O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AC;IAC3F,CAAC;IACD,OAAO,WAAW,CAAC;AACpB,CAAC;AAED,SAAS,2BAA2B,CACnC,WAA4B,EAC5B,QAAc;IAEd,IAAI,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxB,OAAO,mBAAmB,CAAC,WAAW,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzF,CAAC;SAAM,IAAI,uBAAuB,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3E,OAAO,mBAAmB,CACzB,WAAW,EACX,QAAQ,CAAC,MAAM,CAAC,QAAQ,EACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,EAClB,QAAQ,CAAC,KAAK,CACd,CAAC;IACH,CAAC;SAAM,CAAC;QACP,OAAO,SAAS,CAAC;IAClB,CAAC;AACF,CAAC;AAED,SAAS,mBAAmB,CAC3B,WAA4B,EAC5B,QAAiC,EACjC,EAAU,EACV,KAAa;IAEb,OAAO,aAAa,CAAC,WAAW,EAAE,gBAAgB,CAAC,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC,KAAK;QACzF,EAAE,cAAc,CAAC;AACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport type { ChangeAtomId, RevisionMetadataSource, RevisionTag } from \"../../core/index.js\";\nimport { type IdAllocator, type Mutable, brand } from \"../../util/index.js\";\nimport {\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\ttype NodeChangeRebaser,\n\tNodeAttachState,\n\ttype NodeId,\n\ttype RebaseRevisionMetadata,\n} from \"../modular-schema/index.js\";\n\nimport { MarkListFactory } from \"./markListFactory.js\";\nimport { MarkQueue } from \"./markQueue.js\";\nimport {\n\ttype MoveEffect,\n\ttype MoveEffectTable,\n\tgetMoveEffect,\n\tisMoveIn,\n\tisMoveMark,\n\tisMoveOut,\n\tsetMoveEffect,\n} from \"./moveEffectTable.js\";\nimport {\n\ttype CellId,\n\ttype CellMark,\n\ttype Changeset,\n\ttype Detach,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype MarkList,\n\ttype MoveId,\n\ttype MoveIn,\n\ttype MoveOut,\n\ttype NoopMark,\n\tNoopMarkType,\n} from \"./types.js\";\nimport {\n\tCellOrder,\n\tareInputCellsEmpty,\n\tcellSourcesFromMarks,\n\tcloneCellId,\n\tcloneMark,\n\tcompareCellPositionsUsingTombstones,\n\textractMarkEffect,\n\tgetDetachOutputCellId,\n\tgetEndpoint,\n\tgetInputCellId,\n\tisAttachAndDetachEffect,\n\tisDetach,\n\tisNewAttach,\n\tisRename,\n\tisTombstone,\n\tmarkEmptiesCells,\n\tmarkFillsCells,\n\tsplitMarkEffect,\n\twithNodeChange,\n} from \"./utils.js\";\n\n/**\n * Rebases `change` over `base` assuming they both apply to the same initial state.\n * @param change - The changeset to rebase.\n * @param base - The changeset to rebase over.\n * @returns A changeset that performs the changes in `change` but does so assuming `base` has been applied first.\n */\nexport function rebase(\n\tchange: Changeset,\n\tbase: Changeset,\n\trebaseChild: NodeChangeRebaser,\n\tgenId: IdAllocator,\n\tmanager: CrossFieldManager,\n\trevisionMetadata: RebaseRevisionMetadata,\n): Changeset {\n\treturn rebaseMarkList(\n\t\tchange,\n\t\tbase,\n\t\trevisionMetadata,\n\t\trebaseChild,\n\t\tgenId,\n\t\tmanager as MoveEffectTable,\n\t);\n}\n\nfunction rebaseMarkList(\n\tcurrMarkList: MarkList,\n\tbaseMarkList: MarkList,\n\tmetadata: RebaseRevisionMetadata,\n\trebaseChild: NodeChangeRebaser,\n\tgenId: IdAllocator,\n\tmoveEffects: CrossFieldManager<MoveEffect>,\n): MarkList {\n\tconst factory = new MarkListFactory();\n\tconst queue = new RebaseQueue(baseMarkList, currMarkList, metadata, moveEffects);\n\n\twhile (!queue.isEmpty()) {\n\t\tconst { baseMark, newMark: currMark } = queue.pop();\n\t\tconst rebasedMark = rebaseMark(currMark, baseMark, rebaseChild, moveEffects);\n\t\tfactory.push(rebasedMark);\n\t}\n\n\treturn factory.list;\n}\n\n/**\n * Generates a NoOp mark that targets the same cells as the input mark.\n * @param mark - The mark the NoOp should target.\n * @param revision - The revision, if available.\n * @returns A NoOp mark that targets the same cells as the input mark.\n */\nfunction generateNoOpWithCellId(mark: Mark): CellMark<NoopMark> {\n\tconst length = mark.count;\n\tconst cellId = getInputCellId(mark);\n\treturn cellId === undefined ? { count: length } : { count: length, cellId };\n}\n\nclass RebaseQueue {\n\tprivate readonly baseMarks: MarkQueue;\n\tprivate readonly newMarks: MarkQueue;\n\tprivate readonly baseMarksCellSources: ReadonlySet<RevisionTag | undefined>;\n\tprivate readonly newMarksCellSources: ReadonlySet<RevisionTag | undefined>;\n\n\tpublic constructor(\n\t\tbaseMarks: Changeset,\n\t\tnewMarks: Changeset,\n\t\tprivate readonly metadata: RevisionMetadataSource,\n\t\tprivate readonly moveEffects: MoveEffectTable,\n\t) {\n\t\tthis.baseMarks = new MarkQueue(baseMarks, moveEffects);\n\t\tthis.newMarks = new MarkQueue(newMarks, moveEffects);\n\t\tthis.baseMarksCellSources = cellSourcesFromMarks(baseMarks, getInputCellId);\n\t\tthis.newMarksCellSources = cellSourcesFromMarks(newMarks, getInputCellId);\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn this.baseMarks.isEmpty() && this.newMarks.isEmpty();\n\t}\n\n\tpublic pop(): RebaseMarks {\n\t\tconst baseMark = this.baseMarks.peek();\n\t\tconst newMark = this.newMarks.peek();\n\t\tassert(\n\t\t\t!(baseMark === undefined && newMark === undefined),\n\t\t\t0x722 /* Cannot pop from empty queue */,\n\t\t);\n\n\t\tif (baseMark === undefined) {\n\t\t\tconst dequeuedNewMark = this.newMarks.dequeue();\n\t\t\treturn {\n\t\t\t\tbaseMark: generateNoOpWithCellId(dequeuedNewMark),\n\t\t\t\tnewMark: dequeuedNewMark,\n\t\t\t};\n\t\t} else if (newMark === undefined) {\n\t\t\treturn this.dequeueBase();\n\t\t} else if (areInputCellsEmpty(baseMark) && areInputCellsEmpty(newMark)) {\n\t\t\tconst baseId = getInputCellId(baseMark);\n\t\t\tconst newId = getInputCellId(newMark);\n\t\t\tassert(\n\t\t\t\tbaseId !== undefined && newId !== undefined,\n\t\t\t\t0x89f /* Both marks should have cell IDs */,\n\t\t\t);\n\t\t\tconst comparison = compareCellPositionsUsingTombstones(\n\t\t\t\tbaseId,\n\t\t\t\tnewId,\n\t\t\t\tthis.baseMarksCellSources,\n\t\t\t\tthis.newMarksCellSources,\n\t\t\t\tthis.metadata,\n\t\t\t);\n\t\t\tswitch (comparison) {\n\t\t\t\tcase CellOrder.SameCell:\n\t\t\t\t\treturn this.dequeueBoth();\n\t\t\t\tcase CellOrder.OldThenNew:\n\t\t\t\t\treturn this.dequeueBase();\n\t\t\t\tcase CellOrder.NewThenOld:\n\t\t\t\t\treturn this.dequeueNew();\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(comparison);\n\t\t\t}\n\t\t} else if (areInputCellsEmpty(newMark)) {\n\t\t\treturn this.dequeueNew();\n\t\t} else if (areInputCellsEmpty(baseMark)) {\n\t\t\treturn this.dequeueBase();\n\t\t} else {\n\t\t\treturn this.dequeueBoth();\n\t\t}\n\t}\n\n\tprivate dequeueBase(length?: number): RebaseMarks {\n\t\tconst baseMark =\n\t\t\tlength !== undefined ? this.baseMarks.dequeueUpTo(length) : this.baseMarks.dequeue();\n\n\t\tlet newMark: Mark = generateNoOpWithCellId(baseMark);\n\n\t\tconst movedEffect = getMovedEffectFromBaseMark(this.moveEffects, baseMark);\n\n\t\tif (movedEffect !== undefined) {\n\t\t\tnewMark = addMovedMarkEffect(newMark, movedEffect);\n\t\t}\n\n\t\treturn {\n\t\t\tbaseMark,\n\t\t\tnewMark,\n\t\t};\n\t}\n\n\tprivate dequeueNew(): RebaseMarks {\n\t\tconst newMark = this.newMarks.dequeue();\n\t\treturn { newMark, baseMark: generateNoOpWithCellId(newMark) };\n\t}\n\n\tprivate dequeueBoth(): RebaseMarks {\n\t\tconst baseMark = this.baseMarks.peek();\n\t\tconst newMark = this.newMarks.peek();\n\t\tassert(\n\t\t\tbaseMark !== undefined && newMark !== undefined,\n\t\t\t0x69c /* Cannot dequeue both unless both mark queues are non-empty */,\n\t\t);\n\t\tconst length = Math.min(newMark.count, baseMark.count);\n\t\tconst sizedBaseMark = this.baseMarks.dequeueUpTo(length);\n\t\tconst sizedNewMark = this.newMarks.dequeueUpTo(length);\n\t\tconst movedMark = getMovedEffectFromBaseMark(this.moveEffects, sizedBaseMark);\n\t\treturn {\n\t\t\tbaseMark: sizedBaseMark,\n\t\t\tnewMark:\n\t\t\t\tmovedMark === undefined ? sizedNewMark : addMovedMarkEffect(sizedNewMark, movedMark),\n\t\t};\n\t}\n}\n\n/**\n * Combines `mark` and `effect` into a single mark.\n * This function is only intended to handle cases where `mark` is part of a changeset being rebased\n * and `effect` is an effect from the same changeset whose target has been moved by the base changeset.\n * @returns a mark which has the composite effect of `mark` and `effect`.\n */\nfunction addMovedMarkEffect(mark: Mark, effect: Detach): Mark {\n\tif (isMoveIn(mark) && isMoveOut(effect)) {\n\t\treturn { ...mark, type: \"Insert\" };\n\t} else if (isRename(mark) && isMoveOut(effect)) {\n\t\treturn { ...effect, count: mark.count, idOverride: mark.idOverride };\n\t} else if (isAttachAndDetachEffect(mark) && isMoveIn(mark.attach) && isMoveOut(effect)) {\n\t\treturn { ...mark.detach, count: mark.count };\n\t} else if (isTombstone(mark)) {\n\t\treturn { ...mark, ...effect };\n\t}\n\tassert(false, 0x818 /* Unexpected combination of mark effects at source and destination */);\n}\n\n/**\n * Represents the marks rebasing should process next.\n * If `baseMark` and `newMark` are both defined, then they are `SizedMark`s covering the same range of nodes.\n */\ninterface RebaseMarks {\n\tbaseMark: Mark;\n\tnewMark: Mark;\n}\n\nfunction rebaseMark(\n\tcurrMark: Mark,\n\tbaseMark: Mark,\n\trebaseChild: NodeChangeRebaser,\n\tmoveEffects: MoveEffectTable,\n): Mark {\n\tconst rebasedMark = rebaseNodeChange(cloneMark(currMark), baseMark, rebaseChild);\n\tconst movedNodeChanges = getMovedChangesFromBaseMark(moveEffects, baseMark);\n\tif (movedNodeChanges !== undefined) {\n\t\tassert(\n\t\t\trebasedMark.changes === undefined,\n\t\t\t0x8dc /* Unexpected collision of new node changes */,\n\t\t);\n\t\trebasedMark.changes = movedNodeChanges;\n\t\tmoveEffects.onMoveIn(movedNodeChanges);\n\t}\n\n\treturn rebaseMarkIgnoreChild(rebasedMark, baseMark, moveEffects);\n}\n\nfunction rebaseMarkIgnoreChild(\n\tcurrMark: Mark,\n\tbaseMark: Mark,\n\tmoveEffects: MoveEffectTable,\n): Mark {\n\tlet rebasedMark: Mark;\n\tif (isDetach(baseMark)) {\n\t\tif (baseMark.cellId !== undefined) {\n\t\t\t// Detaches on empty cells have an implicit revive effect.\n\t\t\tdelete currMark.cellId;\n\t\t}\n\t\tassert(\n\t\t\t!isNewAttach(currMark),\n\t\t\t0x69d /* A new attach should not be rebased over its cell being emptied */,\n\t\t);\n\t\tconst baseCellId = getDetachOutputCellId(baseMark);\n\n\t\tif (isMoveOut(baseMark)) {\n\t\t\tassert(isMoveMark(baseMark), 0x6f0 /* Only move marks have move IDs */);\n\t\t\tassert(\n\t\t\t\t!isNewAttach(currMark),\n\t\t\t\t0x819 /* New attaches should not be rebased over moves */,\n\t\t\t);\n\t\t\tconst { remains, follows } = separateEffectsForMove(extractMarkEffect(currMark));\n\t\t\tif (follows !== undefined) {\n\t\t\t\tsendEffectToDest(follows, moveEffects, getEndpoint(baseMark), baseMark.count);\n\t\t\t}\n\n\t\t\tif (currMark.changes !== undefined) {\n\t\t\t\tmoveRebasedChanges(currMark.changes, moveEffects, getEndpoint(baseMark));\n\t\t\t}\n\t\t\trebasedMark = { ...(remains ?? {}), count: baseMark.count };\n\t\t} else {\n\t\t\trebasedMark = currMark;\n\t\t}\n\t\trebasedMark = makeDetachedMark(rebasedMark, cloneCellId(baseCellId));\n\t} else if (markFillsCells(baseMark)) {\n\t\trebasedMark = isAttachAndDetachEffect(currMark)\n\t\t\t? withNodeChange({ ...currMark.detach, count: currMark.count }, currMark.changes)\n\t\t\t: withCellId(currMark, undefined);\n\t} else if (isAttachAndDetachEffect(baseMark)) {\n\t\tassert(\n\t\t\tbaseMark.cellId !== undefined,\n\t\t\t0x81a /* AttachAndDetach mark should target an empty cell */,\n\t\t);\n\t\tconst halfRebasedMark = rebaseMarkIgnoreChild(\n\t\t\tcurrMark,\n\t\t\t{ ...baseMark.attach, cellId: cloneCellId(baseMark.cellId), count: baseMark.count },\n\t\t\tmoveEffects,\n\t\t);\n\t\trebasedMark = rebaseMarkIgnoreChild(\n\t\t\thalfRebasedMark,\n\t\t\t{ ...baseMark.detach, count: baseMark.count },\n\t\t\tmoveEffects,\n\t\t);\n\t} else if (isRename(baseMark)) {\n\t\treturn withCellId(currMark, getDetachOutputCellId(baseMark));\n\t} else {\n\t\trebasedMark = currMark;\n\t}\n\treturn rebasedMark;\n}\n\n/**\n * Returns a pair of marks that represent the effects which should remain in place in the face of concurrent move,\n * and the effects that should be sent to the move destination.\n */\nfunction separateEffectsForMove(mark: MarkEffect): {\n\tremains?: MarkEffect;\n\tfollows?: Detach;\n} {\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase \"Remove\":\n\t\tcase \"MoveOut\": {\n\t\t\t// There are two scenarios that lead to a Detach mark having an idOverride:\n\t\t\t// 1. The detach is a rollback (the idOverride the original id that the cell had in the input context of the attach being rolled back).\n\t\t\t// 2. The detach has been composed with a Rename (the idOverride is the cell id in the output context of the rename).\n\t\t\t// Since rollbacks are never rebased, we can safely assume that the idOverride is due to a Rename (scenario #2).\n\t\t\t// While the detach must follow the node that it targets, the rename must remain in place because it targets the cell.\n\t\t\tif (mark.idOverride !== undefined) {\n\t\t\t\tconst remains: MarkEffect = { type: \"Rename\", idOverride: mark.idOverride };\n\t\t\t\tconst follows: Mutable<MarkEffect> = { ...mark };\n\t\t\t\tdelete follows.idOverride;\n\t\t\t\treturn { remains, follows };\n\t\t\t}\n\t\t\treturn { follows: mark };\n\t\t}\n\t\tcase \"AttachAndDetach\":\n\t\t\treturn { follows: mark.detach, remains: mark.attach };\n\t\tcase \"MoveIn\":\n\t\tcase \"Rename\":\n\t\t\treturn { remains: mark };\n\t\tcase NoopMarkType:\n\t\t\treturn {};\n\t\tcase \"Insert\": {\n\t\t\tconst follows: MoveOut = {\n\t\t\t\ttype: \"MoveOut\",\n\t\t\t\tid: mark.id,\n\t\t\t};\n\t\t\tconst remains: MoveIn = {\n\t\t\t\ttype: \"MoveIn\",\n\t\t\t\tid: mark.id,\n\t\t\t};\n\t\t\tif (mark.revision !== undefined) {\n\t\t\t\tfollows.revision = mark.revision;\n\t\t\t\tremains.revision = mark.revision;\n\t\t\t}\n\t\t\treturn { remains, follows };\n\t\t}\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\n// TODO: Reduce the duplication between this and other MoveEffect helpers\nfunction sendEffectToDest(\n\tmarkEffect: Detach,\n\tmoveEffects: MoveEffectTable,\n\t{ revision, localId: id }: ChangeAtomId,\n\tcount: number,\n): void {\n\tconst effect = getMoveEffect(\n\t\tmoveEffects,\n\t\tCrossFieldTarget.Destination,\n\t\trevision,\n\t\tid,\n\t\tcount,\n\t\tfalse,\n\t);\n\tif (effect.length < count) {\n\t\tconst [markEffect1, markEffect2] = splitMarkEffect(markEffect, effect.length);\n\t\tconst newEffect =\n\t\t\teffect.value !== undefined\n\t\t\t\t? { ...effect.value, movedMark: markEffect1 }\n\t\t\t\t: { movedMark: markEffect1 };\n\t\tsetMoveEffect(\n\t\t\tmoveEffects,\n\t\t\tCrossFieldTarget.Destination,\n\t\t\trevision,\n\t\t\tid,\n\t\t\teffect.length,\n\t\t\tnewEffect,\n\t\t);\n\t\tsendEffectToDest(\n\t\t\tmarkEffect2,\n\t\t\tmoveEffects,\n\t\t\t{ revision, localId: brand(id + effect.length) },\n\t\t\tcount - effect.length,\n\t\t);\n\t} else {\n\t\tconst newEffect: MoveEffect =\n\t\t\teffect.value !== undefined\n\t\t\t\t? { ...effect.value, movedEffect: markEffect }\n\t\t\t\t: { movedEffect: markEffect };\n\t\tsetMoveEffect(moveEffects, CrossFieldTarget.Destination, revision, id, count, newEffect);\n\t}\n}\n\nfunction moveRebasedChanges(\n\tnodeChange: NodeId,\n\tmoveEffects: MoveEffectTable,\n\t{ revision, localId: id }: ChangeAtomId,\n): void {\n\tconst effect = getMoveEffect(\n\t\tmoveEffects,\n\t\tCrossFieldTarget.Destination,\n\t\trevision,\n\t\tid,\n\t\t1,\n\t\tfalse,\n\t).value;\n\n\tconst newEffect =\n\t\teffect !== undefined\n\t\t\t? { ...effect, rebasedChanges: nodeChange }\n\t\t\t: { rebasedChanges: nodeChange };\n\n\tsetMoveEffect(moveEffects, CrossFieldTarget.Destination, revision, id, 1, newEffect);\n}\n\nfunction rebaseNodeChange(\n\tcurrMark: Mark,\n\tbaseMark: Mark,\n\tnodeRebaser: NodeChangeRebaser,\n): Mark {\n\tconst baseChange = baseMark.changes;\n\tconst currChange = currMark.changes;\n\n\tif (baseChange === undefined && currChange === undefined) {\n\t\treturn currMark;\n\t}\n\n\tconst nodeState = nodeStateAfterMark(baseMark);\n\treturn withNodeChange(currMark, nodeRebaser(currChange, baseChange, nodeState));\n}\n\nfunction nodeStateAfterMark(mark: Mark): NodeAttachState {\n\tif (markEmptiesCells(mark)) {\n\t\treturn NodeAttachState.Detached;\n\t} else if (markFillsCells(mark)) {\n\t\treturn NodeAttachState.Attached;\n\t} else {\n\t\treturn mark.cellId === undefined ? NodeAttachState.Attached : NodeAttachState.Detached;\n\t}\n}\n\nfunction makeDetachedMark(mark: Mark, cellId: ChangeAtomId): Mark {\n\tassert(mark.cellId === undefined, 0x69f /* Expected mark to be attached */);\n\treturn { ...mark, cellId };\n}\n\nfunction withCellId<TMark extends Mark>(mark: TMark, cellId: CellId | undefined): TMark {\n\tconst newMark = { ...mark, cellId };\n\tif (cellId === undefined) {\n\t\tdelete newMark.cellId;\n\t}\n\treturn newMark;\n}\n\nfunction getMovedEffectFromBaseMark(\n\tmoveEffects: MoveEffectTable,\n\tbaseMark: Mark,\n): Detach | undefined {\n\tif (isMoveIn(baseMark)) {\n\t\treturn getMovedEffect(moveEffects, baseMark.revision, baseMark.id, baseMark.count);\n\t} else if (isAttachAndDetachEffect(baseMark) && isMoveIn(baseMark.attach)) {\n\t\treturn getMovedEffect(\n\t\t\tmoveEffects,\n\t\t\tbaseMark.attach.revision,\n\t\t\tbaseMark.attach.id,\n\t\t\tbaseMark.count,\n\t\t);\n\t} else {\n\t\treturn undefined;\n\t}\n}\n\n// It is expected that the range from `id` to `id + count - 1` has the same move effect.\n// The call sites to this function are making queries about a mark which has already been split by a `MarkQueue`\n// to match the ranges in `moveEffects`.\n// TODO: Reduce the duplication between this and other MoveEffect helpers\nfunction getMovedEffect(\n\tmoveEffects: MoveEffectTable,\n\trevision: RevisionTag | undefined,\n\tid: MoveId,\n\tcount: number,\n): Detach | undefined {\n\tconst effect = getMoveEffect(moveEffects, CrossFieldTarget.Destination, revision, id, count);\n\tassert(effect.length === count, 0x6f3 /* Expected effect to cover entire mark */);\n\tconst movedEffect = effect.value?.movedEffect;\n\tif (movedEffect === undefined) {\n\t\treturn undefined;\n\t}\n\tif (isMoveOut(movedEffect)) {\n\t\tmoveEffects.moveKey(CrossFieldTarget.Source, movedEffect.revision, movedEffect.id, count);\n\t}\n\treturn movedEffect;\n}\n\nfunction getMovedChangesFromBaseMark(\n\tmoveEffects: MoveEffectTable,\n\tbaseMark: Mark,\n): NodeId | undefined {\n\tif (isMoveIn(baseMark)) {\n\t\treturn getMovedNodeChanges(moveEffects, baseMark.revision, baseMark.id, baseMark.count);\n\t} else if (isAttachAndDetachEffect(baseMark) && isMoveIn(baseMark.attach)) {\n\t\treturn getMovedNodeChanges(\n\t\t\tmoveEffects,\n\t\t\tbaseMark.attach.revision,\n\t\t\tbaseMark.attach.id,\n\t\t\tbaseMark.count,\n\t\t);\n\t} else {\n\t\treturn undefined;\n\t}\n}\n\nfunction getMovedNodeChanges(\n\tmoveEffects: MoveEffectTable,\n\trevision: RevisionTag | undefined,\n\tid: MoveId,\n\tcount: number,\n): NodeId | undefined {\n\treturn getMoveEffect(moveEffects, CrossFieldTarget.Destination, revision, id, count).value\n\t\t?.rebasedChanges;\n}\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { type DeltaDetachedNodeId } from "../../core/index.js";
|
|
6
|
-
import type { Changeset } from "./types.js";
|
|
7
6
|
import type { RelevantRemovedRootsFromChild } from "../modular-schema/index.js";
|
|
7
|
+
import type { Changeset } from "./types.js";
|
|
8
8
|
export declare function relevantRemovedRoots(change: Changeset, relevantRemovedRootsFromChild: RelevantRemovedRootsFromChild): Iterable<DeltaDetachedNodeId>;
|
|
9
9
|
//# sourceMappingURL=relevantRemovedRoots.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relevantRemovedRoots.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/relevantRemovedRoots.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,mBAAmB,EAAkB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"relevantRemovedRoots.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/relevantRemovedRoots.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,mBAAmB,EAAkB,MAAM,qBAAqB,CAAC;AAE/E,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAEhF,OAAO,KAAK,EAAE,SAAS,EAAQ,MAAM,YAAY,CAAC;AAGlD,wBAAiB,oBAAoB,CACpC,MAAM,EAAE,SAAS,EACjB,6BAA6B,EAAE,6BAA6B,GAC1D,QAAQ,CAAC,mBAAmB,CAAC,CAgB/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relevantRemovedRoots.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/relevantRemovedRoots.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EAA4B,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"relevantRemovedRoots.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/relevantRemovedRoots.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EAA4B,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAIxD,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEvF,MAAM,SAAS,CAAC,CAAC,oBAAoB,CACpC,MAAiB,EACjB,6BAA4D;IAE5D,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,4BAA4B,CAAC,IAAI,CAAC,EAAE,CAAC;YACxC,MAAM,CACL,IAAI,CAAC,MAAM,KAAK,SAAS,EACzB,KAAK,CAAC,oEAAoE,CAC1E,CAAC;YACF,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxC,MAAM,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YACjC,CAAC;QACF,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAChC,KAAK,CAAC,CAAC,6BAA6B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpD,CAAC;IACF,CAAC;AACF,CAAC;AAED,SAAS,4BAA4B,CAAC,IAAU;IAC/C,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC/B,MAAM,MAAM,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;QAClE,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACtB,2CAA2C;YAC3C,OAAO,IAAI,CAAC;QACb,CAAC;aAAM,IAAI,sBAAsB,CAAC,IAAI,CAAC,EAAE,CAAC;YACzC,2DAA2D;YAC3D,OAAO,IAAI,CAAC;QACb,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAChC,qCAAqC;YACrC,uFAAuF;YACvF,kGAAkG;YAClG,8DAA8D;YAC9D,8FAA8F;YAC9F,+FAA+F;YAC/F,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { type DeltaDetachedNodeId, offsetDetachId } from \"../../core/index.js\";\nimport { nodeIdFromChangeAtom } from \"../deltaUtils.js\";\nimport type { RelevantRemovedRootsFromChild } from \"../modular-schema/index.js\";\n\nimport type { Changeset, Mark } from \"./types.js\";\nimport { isAttachAndDetachEffect, isDetachOfRemovedNodes, isInsert } from \"./utils.js\";\n\nexport function* relevantRemovedRoots(\n\tchange: Changeset,\n\trelevantRemovedRootsFromChild: RelevantRemovedRootsFromChild,\n): Iterable<DeltaDetachedNodeId> {\n\tfor (const mark of change) {\n\t\tif (refersToRelevantRemovedRoots(mark)) {\n\t\t\tassert(\n\t\t\t\tmark.cellId !== undefined,\n\t\t\t\t0x81d /* marks referring to removed trees must have an assigned cell ID */,\n\t\t\t);\n\t\t\tconst nodeId = nodeIdFromChangeAtom(mark.cellId);\n\t\t\tfor (let i = 0; i < mark.count; i += 1) {\n\t\t\t\tyield offsetDetachId(nodeId, i);\n\t\t\t}\n\t\t}\n\t\tif (mark.changes !== undefined) {\n\t\t\tyield* relevantRemovedRootsFromChild(mark.changes);\n\t\t}\n\t}\n}\n\nfunction refersToRelevantRemovedRoots(mark: Mark): boolean {\n\tif (mark.cellId !== undefined) {\n\t\tconst effect = isAttachAndDetachEffect(mark) ? mark.attach : mark;\n\t\tif (isInsert(effect)) {\n\t\t\t// This tree is being inserted or restored.\n\t\t\treturn true;\n\t\t} else if (isDetachOfRemovedNodes(mark)) {\n\t\t\t// This removed tree is being restored as part of a detach.\n\t\t\treturn true;\n\t\t}\n\t\tif (mark.changes !== undefined) {\n\t\t\t// This removed tree is being edited.\n\t\t\t// Note: there is a possibility that the child changes only affect a distant descendant\n\t\t\t// which may have been removed from this (removed) subtree. In such a case, this tree is not truly\n\t\t\t// relevant, but including it is the conservative thing to do.\n\t\t\t// In the future, we may represent changes to removed trees using the ID of the lowest removed\n\t\t\t// ancestor, which would allow us to avoid including such trees when they truly are not needed.\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replaceRevisions.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/replaceRevisions.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"replaceRevisions.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/replaceRevisions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,WAAW,EAAwB,MAAM,qBAAqB,CAAC;AAI7E,OAAO,EACN,KAAK,SAAS,EAQd,MAAM,YAAY,CAAC;AAGpB,wBAAgB,gBAAgB,CAC/B,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,EAChD,WAAW,EAAE,WAAW,GAAG,SAAS,GAClC,SAAS,CAQX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replaceRevisions.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/replaceRevisions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"replaceRevisions.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/replaceRevisions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,OAAO,EAAoB,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAG7E,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAON,YAAY,GAEZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,UAAU,gBAAgB,CAC/B,SAAoB,EACpB,kBAAgD,EAChD,WAAoC;IAEpC,MAAM,YAAY,GAAG,IAAI,eAAe,EAAE,CAAC;IAC3C,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC9B,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAAC;QACtE,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,YAAY,CAAC,IAAI,CAAC;AAC1B,CAAC;AAED,SAAS,UAAU,CAClB,IAAU,EACV,kBAAgD,EAChD,WAAoC;I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AC;IACzB,CAAC;IAED,OAAO,OAAO,CAAC;AAChB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport { type RevisionTag, replaceAtomRevisions } from \"../../core/index.js\";\n\nimport type { MoveMarkEffect } from \"./helperTypes.js\";\nimport { MarkListFactory } from \"./markListFactory.js\";\nimport {\n\ttype Changeset,\n\ttype Detach,\n\ttype HasMoveFields,\n\ttype HasRevisionTag,\n\ttype Mark,\n\ttype MarkEffect,\n\tNoopMarkType,\n\ttype Rename,\n} from \"./types.js\";\nimport { isDetach, isRename } from \"./utils.js\";\n\nexport function replaceRevisions(\n\tchangeset: Changeset,\n\trevisionsToReplace: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): Changeset {\n\tconst updatedMarks = new MarkListFactory();\n\tfor (const mark of changeset) {\n\t\tconst updatedMark = updateMark(mark, revisionsToReplace, newRevision);\n\t\tupdatedMarks.push(updatedMark);\n\t}\n\n\treturn updatedMarks.list;\n}\n\nfunction updateMark(\n\tmark: Mark,\n\trevisionsToReplace: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): Mark {\n\tconst updatedMark = { ...updateEffect(mark, revisionsToReplace, newRevision) };\n\tif (mark.cellId !== undefined) {\n\t\tupdatedMark.cellId = replaceAtomRevisions(mark.cellId, revisionsToReplace, newRevision);\n\t}\n\n\tif (mark.changes !== undefined) {\n\t\tupdatedMark.changes = replaceAtomRevisions(mark.changes, revisionsToReplace, newRevision);\n\t}\n\n\treturn updatedMark;\n}\n\nfunction updateEffect<TMark extends MarkEffect>(\n\tinput: TMark,\n\trevisionsToReplace: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): TMark {\n\tconst mark =\n\t\tisDetach(input) || isRename(input)\n\t\t\t? updateIdOverride(input, revisionsToReplace, newRevision)\n\t\t\t: input;\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase \"Rename\":\n\t\tcase NoopMarkType:\n\t\t\treturn mark;\n\t\tcase \"AttachAndDetach\":\n\t\t\treturn {\n\t\t\t\t...mark,\n\t\t\t\tattach: updateEffect(mark.attach, revisionsToReplace, newRevision),\n\t\t\t\tdetach: updateEffect(mark.detach, revisionsToReplace, newRevision),\n\t\t\t};\n\t\tcase \"MoveIn\":\n\t\tcase \"MoveOut\":\n\t\t\treturn updateMoveEffect<TMark & MoveMarkEffect>(\n\t\t\t\t// For some reason, TypeScript is not able to infer that `mark` cannot be a `NoopMark` here.\n\t\t\t\tmark as MoveMarkEffect,\n\t\t\t\trevisionsToReplace,\n\t\t\t\tnewRevision,\n\t\t\t);\n\t\tcase \"Insert\":\n\t\tcase \"Remove\":\n\t\t\treturn updateRevision<TMark & HasRevisionTag>(mark, revisionsToReplace, newRevision);\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\nfunction updateIdOverride<TEffect extends Detach | Rename>(\n\teffect: TEffect,\n\trevisionsToReplace: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): TEffect {\n\tif (effect.idOverride !== undefined) {\n\t\tconst idOverride = replaceAtomRevisions(\n\t\t\teffect.idOverride,\n\t\t\trevisionsToReplace,\n\t\t\tnewRevision,\n\t\t);\n\t\treturn { ...effect, idOverride };\n\t} else {\n\t\treturn effect;\n\t}\n}\n\nfunction updateMoveEffect<TEffect extends HasMoveFields>(\n\teffect: TEffect,\n\trevisionsToReplace: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): TEffect {\n\treturn effect.finalEndpoint !== undefined\n\t\t? updateRevision(\n\t\t\t\t{\n\t\t\t\t\t...effect,\n\t\t\t\t\tfinalEndpoint: updateRevision(effect.finalEndpoint, revisionsToReplace, newRevision),\n\t\t\t\t},\n\t\t\t\trevisionsToReplace,\n\t\t\t\tnewRevision,\n\t\t\t)\n\t\t: updateRevision(effect, revisionsToReplace, newRevision);\n}\n\nfunction updateRevision<T extends HasRevisionTag>(\n\tinput: T,\n\trevisionsToReplace: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): T {\n\treturn revisionsToReplace.has(input.revision) ? withRevision(input, newRevision) : input;\n}\n\nfunction withRevision<T extends HasRevisionTag>(\n\tinput: T,\n\trevision: RevisionTag | undefined,\n): T {\n\tconst updated = { ...input, revision };\n\tif (revision === undefined) {\n\t\tdelete updated.revision;\n\t}\n\n\treturn updated;\n}\n"]}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { type IJsonCodec } from "../../codec/index.js";
|
|
6
6
|
import type { ChangeEncodingContext, EncodedRevisionTag, RevisionTag } from "../../core/index.js";
|
|
7
7
|
import { type JsonCompatibleReadOnly } from "../../util/index.js";
|
|
8
|
-
import { type Changeset } from "./types.js";
|
|
9
8
|
import type { FieldChangeEncodingContext } from "../index.js";
|
|
9
|
+
import { type Changeset } from "./types.js";
|
|
10
10
|
export declare function makeV1Codec(revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>): IJsonCodec<Changeset, JsonCompatibleReadOnly, JsonCompatibleReadOnly, FieldChangeEncodingContext>;
|
|
11
11
|
//# sourceMappingURL=sequenceFieldCodecV1.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequenceFieldCodecV1.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,KAAK,EACX,qBAAqB,EAErB,kBAAkB,EAClB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,sBAAsB,EAAuB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"sequenceFieldCodecV1.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,KAAK,EACX,qBAAqB,EAErB,kBAAkB,EAClB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,sBAAsB,EAAuB,MAAM,qBAAqB,CAAC;AAEvF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAQ9D,OAAO,EAIN,KAAK,SAAS,EAUd,MAAM,YAAY,CAAC;AAGpB,wBAAgB,WAAW,CAC1B,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,GACC,UAAU,CACZ,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,CAC1B,CA0RA"}
|
|
@@ -6,10 +6,10 @@ import { assert, unreachableCase, fail } from "@fluidframework/core-utils/intern
|
|
|
6
6
|
import { DiscriminatedUnionDispatcher } from "../../codec/index.js";
|
|
7
7
|
import { brand } from "../../util/index.js";
|
|
8
8
|
import { makeChangeAtomIdCodec } from "../changeAtomIdCodec.js";
|
|
9
|
+
import { EncodedNodeChangeset } from "../modular-schema/index.js";
|
|
9
10
|
import { Changeset as ChangesetSchema, DetachIdOverrideType, } from "./formatV1.js";
|
|
10
11
|
import { NoopMarkType, } from "./types.js";
|
|
11
12
|
import { isNoopMark, normalizeCellRename } from "./utils.js";
|
|
12
|
-
import { EncodedNodeChangeset } from "../modular-schema/index.js";
|
|
13
13
|
export function makeV1Codec(revisionTagCodec) {
|
|
14
14
|
const changeAtomIdCodec = makeChangeAtomIdCodec(revisionTagCodec);
|
|
15
15
|
const markEffectCodec = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequenceFieldCodecV1.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCod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EAAE,IAAI,CAAC,KAAK;iBACjB,CAAC;gBAEF,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;oBAC/B,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;gBACtF,CAAC;gBACD,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;oBAC/B,WAAW,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;gBAC3E,CAAC;gBACD,0FAA0F;gBAC1F,6EAA6E;gBAC7E,IAAI,YAAY,GAAG,WAAmB,CAAC;gBACvC,IAAI,YAAY,CAAC,MAAM,KAAK,SAAS,IAAI,YAAY,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;oBAClF,uHAAuH;oBACvH,+GAA+G;oBAC/G,4FAA4F;oBAC5F,YAAY,GAAG,mBAAmB,CACjC,YAAY,CAAC,MAAM,EACnB,YAAY,CAAC,KAAK,EAClB,YAAY,CAAC,MAAM,EACnB,YAAY,CAAC,MAAM,CACnB,CAAC;gBACH,CAAC;gBACD,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;oBAChC,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACzD,CAAC;gBACD,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAC1B,CAAC;YACD,OAAO,KAAK,CAAC;QACd,CAAC;QACD,aAAa,EAAE,eAAe,CAAC,oBAAoB,CAAC;KACpD,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,aAAa,GAAqB,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\nimport type { TAnySchema } from \"@sinclair/typebox\";\n\nimport { DiscriminatedUnionDispatcher, type IJsonCodec } from \"../../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tChangesetLocalId,\n\tEncodedRevisionTag,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport { type JsonCompatibleReadOnly, type Mutable, brand } from \"../../util/index.js\";\nimport { makeChangeAtomIdCodec } from \"../changeAtomIdCodec.js\";\n\nimport {\n\tChangeset as ChangesetSchema,\n\tDetachIdOverrideType,\n\ttype Encoded,\n} from \"./formatV1.js\";\nimport {\n\ttype Attach,\n\ttype AttachAndDetach,\n\ttype CellId,\n\ttype Changeset,\n\ttype Detach,\n\ttype Insert,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype MoveIn,\n\ttype MoveOut,\n\tNoopMarkType,\n\ttype Remove,\n\ttype Rename,\n} from \"./types.js\";\nimport { isNoopMark, normalizeCellRename } from \"./utils.js\";\nimport type { FieldChangeEncodingContext } from \"../index.js\";\nimport { EncodedNodeChangeset } from \"../modular-schema/index.js\";\n\nexport function makeV1Codec(\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): IJsonCodec<\n\tChangeset,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tFieldChangeEncodingContext\n> {\n\tconst changeAtomIdCodec = makeChangeAtomIdCodec(revisionTagCodec);\n\tconst markEffectCodec: IJsonCodec<\n\t\tMarkEffect,\n\t\tEncoded.MarkEffect,\n\t\tEncoded.MarkEffect,\n\t\tChangeEncodingContext\n\t> = {\n\t\tencode(effect: MarkEffect, context: ChangeEncodingContext): Encoded.MarkEffect {\n\t\t\tfunction encodeRevision(\n\t\t\t\trevision: RevisionTag | undefined,\n\t\t\t): EncodedRevisionTag | undefined {\n\t\t\t\tif (revision === undefined || revision === context.revision) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn revisionTagCodec.encode(revision, context);\n\t\t\t}\n\n\t\t\tconst type = effect.type;\n\t\t\tswitch (type) {\n\t\t\t\tcase \"MoveIn\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmoveIn: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tfinalEndpoint:\n\t\t\t\t\t\t\t\teffect.finalEndpoint === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.finalEndpoint, context),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Insert\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tinsert: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Remove\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdelete: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tidOverride:\n\t\t\t\t\t\t\t\teffect.idOverride === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\t\t\t// An arbitrary override type is chosen here. It only had an impact on lineage logic which was not enabled in V1.\n\t\t\t\t\t\t\t\t\t\t\ttype: DetachIdOverrideType.Unattach,\n\t\t\t\t\t\t\t\t\t\t\tid: cellIdCodec.encode(effect.idOverride, context),\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"MoveOut\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmoveOut: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tfinalEndpoint:\n\t\t\t\t\t\t\t\teffect.finalEndpoint === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.finalEndpoint, context),\n\t\t\t\t\t\t\tidOverride:\n\t\t\t\t\t\t\t\teffect.idOverride === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\t\t\t// An arbitrary override type is chosen here. It only had an impact on lineage logic which was not enabled in V1.\n\t\t\t\t\t\t\t\t\t\t\ttype: DetachIdOverrideType.Unattach,\n\t\t\t\t\t\t\t\t\t\t\tid: cellIdCodec.encode(effect.idOverride, context),\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"AttachAndDetach\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tattachAndDetach: {\n\t\t\t\t\t\t\tattach: markEffectCodec.encode(effect.attach, context) as Encoded.Attach,\n\t\t\t\t\t\t\tdetach: markEffectCodec.encode(effect.detach, context) as Encoded.Detach,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Rename\":\n\t\t\t\t\t// In documents generated by clients on release >=2.2 (i.e., running the code from the PR that added this comment),\n\t\t\t\t\t// renames are encoded as AttachAndDetach with a special id.\n\t\t\t\t\t// This ensures forward-compatibility of clients on release <=2.1 with documents/ops generated by clients on release >=2.2.\n\t\t\t\t\treturn markEffectCodec.encode(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: \"AttachAndDetach\",\n\t\t\t\t\t\t\tattach: { type: \"MoveIn\", id: renameLocalId },\n\t\t\t\t\t\t\tdetach: { type: \"MoveOut\", id: renameLocalId, idOverride: effect.idOverride },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t);\n\t\t\t\tcase NoopMarkType:\n\t\t\t\t\tfail(0xb2b /* Mark type: NoopMarkType should not be encoded. */);\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(type);\n\t\t\t}\n\t\t},\n\t\tdecode(encoded: Encoded.MarkEffect, context: ChangeEncodingContext): MarkEffect {\n\t\t\treturn decoderLibrary.dispatch(encoded, context);\n\t\t},\n\t};\n\n\tfunction decodeRevision(\n\t\tencodedRevision: EncodedRevisionTag | undefined,\n\t\tcontext: ChangeEncodingContext,\n\t): RevisionTag {\n\t\tif (encodedRevision === undefined) {\n\t\t\tassert(context.revision !== undefined, 0x965 /* Implicit revision should be provided */);\n\t\t\treturn context.revision;\n\t\t}\n\n\t\treturn revisionTagCodec.decode(encodedRevision, context);\n\t}\n\n\tconst decoderLibrary = new DiscriminatedUnionDispatcher<\n\t\tEncoded.MarkEffect,\n\t\t/* args */ [context: ChangeEncodingContext],\n\t\tMarkEffect\n\t>({\n\t\tmoveIn(encoded: Encoded.MoveIn, context: ChangeEncodingContext): MoveIn {\n\t\t\tconst { id, finalEndpoint, revision } = encoded;\n\t\t\tconst mark: MoveIn = {\n\t\t\t\ttype: \"MoveIn\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (finalEndpoint !== undefined) {\n\t\t\t\tmark.finalEndpoint = changeAtomIdCodec.decode(finalEndpoint, context);\n\t\t\t}\n\t\t\treturn mark;\n\t\t},\n\t\tinsert(encoded: Encoded.Insert, context: ChangeEncodingContext): Insert {\n\t\t\tconst { id, revision } = encoded;\n\t\t\tconst mark: Insert = {\n\t\t\t\ttype: \"Insert\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\treturn mark;\n\t\t},\n\t\tdelete(encoded: Encoded.Remove, context: ChangeEncodingContext): Remove {\n\t\t\tconst { id, revision, idOverride } = encoded;\n\t\t\tconst mark: Mutable<Remove> = {\n\t\t\t\ttype: \"Remove\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (idOverride !== undefined) {\n\t\t\t\tmark.idOverride = cellIdCodec.decode(idOverride.id, context);\n\t\t\t}\n\t\t\treturn mark;\n\t\t},\n\t\tmoveOut(encoded: Encoded.MoveOut, context: ChangeEncodingContext): MoveOut {\n\t\t\tconst { id, finalEndpoint, idOverride, revision } = encoded;\n\t\t\tconst mark: Mutable<MoveOut> = {\n\t\t\t\ttype: \"MoveOut\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (finalEndpoint !== undefined) {\n\t\t\t\tmark.finalEndpoint = changeAtomIdCodec.decode(finalEndpoint, context);\n\t\t\t}\n\t\t\tif (idOverride !== undefined) {\n\t\t\t\tmark.idOverride = cellIdCodec.decode(idOverride.id, context);\n\t\t\t}\n\n\t\t\treturn mark;\n\t\t},\n\t\tattachAndDetach(\n\t\t\tencoded: Encoded.AttachAndDetach,\n\t\t\tcontext: ChangeEncodingContext,\n\t\t): AttachAndDetach | Rename {\n\t\t\tconst attach = decoderLibrary.dispatch(encoded.attach, context) as Attach;\n\t\t\tconst detach = decoderLibrary.dispatch(encoded.detach, context) as Detach;\n\t\t\t// In documents generated by clients on release >=2.2 (i.e., running the code from the PR that added this comment),\n\t\t\t// renames are encoded as AttachAndDetach with a special id.\n\t\t\t// This ensures forward-compatibility of clients on release <=2.1 with documents/ops generated by clients on release >=2.2.\n\t\t\tif (attach.id === renameLocalId) {\n\t\t\t\tassert(detach.idOverride !== undefined, 0x9f7 /* Rename must have idOverride */);\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"Rename\",\n\t\t\t\t\tidOverride: detach.idOverride,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttype: \"AttachAndDetach\",\n\t\t\t\tattach,\n\t\t\t\tdetach,\n\t\t\t};\n\t\t},\n\t});\n\n\tconst cellIdCodec: IJsonCodec<\n\t\tCellId,\n\t\tEncoded.CellId,\n\t\tEncoded.CellId,\n\t\tChangeEncodingContext\n\t> = {\n\t\tencode: (cellId: CellId, context: ChangeEncodingContext): Encoded.CellId => {\n\t\t\tconst encoded: Encoded.CellId = {\n\t\t\t\tatom: changeAtomIdCodec.encode(cellId, context),\n\t\t\t};\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: ({ atom }: Encoded.CellId, context: ChangeEncodingContext): CellId => {\n\t\t\treturn changeAtomIdCodec.decode(atom, context);\n\t\t},\n\t};\n\n\t/**\n\t * If we want to make the node change aspect of this codec more type-safe, we could adjust generics\n\t * to be in terms of the schema rather than the concrete type of the node change.\n\t */\n\ttype NodeChangeSchema = TAnySchema;\n\n\treturn {\n\t\tencode: (\n\t\t\tchangeset: Changeset,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): JsonCompatibleReadOnly & Encoded.Changeset<NodeChangeSchema> => {\n\t\t\tconst jsonMarks: Encoded.Changeset<NodeChangeSchema> = [];\n\t\t\tfor (const mark of changeset) {\n\t\t\t\tconst encodedMark: Encoded.Mark<NodeChangeSchema> = {\n\t\t\t\t\tcount: mark.count,\n\t\t\t\t};\n\t\t\t\tif (!isNoopMark(mark)) {\n\t\t\t\t\tencodedMark.effect = markEffectCodec.encode(mark, context.baseContext);\n\t\t\t\t}\n\t\t\t\tif (mark.cellId !== undefined) {\n\t\t\t\t\tencodedMark.cellId = cellIdCodec.encode(mark.cellId, context.baseContext);\n\t\t\t\t}\n\t\t\t\tif (mark.changes !== undefined) {\n\t\t\t\t\tencodedMark.changes = context.encodeNode(mark.changes);\n\t\t\t\t}\n\t\t\t\tjsonMarks.push(encodedMark);\n\t\t\t}\n\t\t\treturn jsonMarks;\n\t\t},\n\t\tdecode: (\n\t\t\tchangeset: Encoded.Changeset<NodeChangeSchema>,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): Changeset => {\n\t\t\tconst marks: Changeset = [];\n\t\t\tfor (const mark of changeset) {\n\t\t\t\tconst decodedMark: Mark = {\n\t\t\t\t\tcount: mark.count,\n\t\t\t\t};\n\n\t\t\t\tif (mark.effect !== undefined) {\n\t\t\t\t\tObject.assign(decodedMark, markEffectCodec.decode(mark.effect, context.baseContext));\n\t\t\t\t}\n\t\t\t\tif (mark.cellId !== undefined) {\n\t\t\t\t\tdecodedMark.cellId = cellIdCodec.decode(mark.cellId, context.baseContext);\n\t\t\t\t}\n\t\t\t\t// Type deduction wrongly narrows the type of `decodedMark` to `NoopMark & HasMarkFields`.\n\t\t\t\t// We declare a new casted copy of `decodedMark` to recover the correct type.\n\t\t\t\tlet decodedMark2 = decodedMark as Mark;\n\t\t\t\tif (decodedMark2.cellId !== undefined && decodedMark2.type === \"AttachAndDetach\") {\n\t\t\t\t\t// In documents generated by clients on release <=2.1 (i.e., not running the code from the PR that added this comment),\n\t\t\t\t\t// rename-like AttachAndDetach marks are not normalized to Rename marks thus requiring this normalization step.\n\t\t\t\t\t// This ensures backward compatibility with documents generated by clients on release <=2.1.\n\t\t\t\t\tdecodedMark2 = normalizeCellRename(\n\t\t\t\t\t\tdecodedMark2.cellId,\n\t\t\t\t\t\tdecodedMark2.count,\n\t\t\t\t\t\tdecodedMark2.attach,\n\t\t\t\t\t\tdecodedMark2.detach,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (mark.changes !== undefined) {\n\t\t\t\t\tdecodedMark2.changes = context.decodeNode(mark.changes);\n\t\t\t\t}\n\t\t\t\tmarks.push(decodedMark2);\n\t\t\t}\n\t\t\treturn marks;\n\t\t},\n\t\tencodedSchema: ChangesetSchema(EncodedNodeChangeset),\n\t};\n}\n\n/**\n * Arbitrary ID that is used to indicate a Rename effect.\n */\nconst renameLocalId: ChangesetLocalId = brand(-1);\n"]}
|
|
1
|
+
{"version":3,"file":"sequenceFieldCodecV1.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,IAA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AE,CAAC;oBAC/B,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;gBACtF,CAAC;gBACD,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;oBAC/B,WAAW,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;gBAC3E,CAAC;gBACD,0FAA0F;gBAC1F,6EAA6E;gBAC7E,IAAI,YAAY,GAAG,WAAmB,CAAC;gBACvC,IAAI,YAAY,CAAC,MAAM,KAAK,SAAS,IAAI,YAAY,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;oBAClF,uHAAuH;oBACvH,+GAA+G;oBAC/G,4FAA4F;oBAC5F,YAAY,GAAG,mBAAmB,CACjC,YAAY,CAAC,MAAM,EACnB,YAAY,CAAC,KAAK,EAClB,YAAY,CAAC,MAAM,EACnB,YAAY,CAAC,MAAM,CACnB,CAAC;gBACH,CAAC;gBACD,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;oBAChC,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACzD,CAAC;gBACD,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAC1B,CAAC;YACD,OAAO,KAAK,CAAC;QACd,CAAC;QACD,aAAa,EAAE,eAAe,CAAC,oBAAoB,CAAC;KACpD,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,aAAa,GAAqB,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\nimport type { TAnySchema } from \"@sinclair/typebox\";\n\nimport { DiscriminatedUnionDispatcher, type IJsonCodec } from \"../../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tChangesetLocalId,\n\tEncodedRevisionTag,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport { type JsonCompatibleReadOnly, type Mutable, brand } from \"../../util/index.js\";\nimport { makeChangeAtomIdCodec } from \"../changeAtomIdCodec.js\";\nimport type { FieldChangeEncodingContext } from \"../index.js\";\nimport { EncodedNodeChangeset } from \"../modular-schema/index.js\";\n\nimport {\n\tChangeset as ChangesetSchema,\n\tDetachIdOverrideType,\n\ttype Encoded,\n} from \"./formatV1.js\";\nimport {\n\ttype Attach,\n\ttype AttachAndDetach,\n\ttype CellId,\n\ttype Changeset,\n\ttype Detach,\n\ttype Insert,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype MoveIn,\n\ttype MoveOut,\n\tNoopMarkType,\n\ttype Remove,\n\ttype Rename,\n} from \"./types.js\";\nimport { isNoopMark, normalizeCellRename } from \"./utils.js\";\n\nexport function makeV1Codec(\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): IJsonCodec<\n\tChangeset,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tFieldChangeEncodingContext\n> {\n\tconst changeAtomIdCodec = makeChangeAtomIdCodec(revisionTagCodec);\n\tconst markEffectCodec: IJsonCodec<\n\t\tMarkEffect,\n\t\tEncoded.MarkEffect,\n\t\tEncoded.MarkEffect,\n\t\tChangeEncodingContext\n\t> = {\n\t\tencode(effect: MarkEffect, context: ChangeEncodingContext): Encoded.MarkEffect {\n\t\t\tfunction encodeRevision(\n\t\t\t\trevision: RevisionTag | undefined,\n\t\t\t): EncodedRevisionTag | undefined {\n\t\t\t\tif (revision === undefined || revision === context.revision) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn revisionTagCodec.encode(revision, context);\n\t\t\t}\n\n\t\t\tconst type = effect.type;\n\t\t\tswitch (type) {\n\t\t\t\tcase \"MoveIn\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmoveIn: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tfinalEndpoint:\n\t\t\t\t\t\t\t\teffect.finalEndpoint === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.finalEndpoint, context),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Insert\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tinsert: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Remove\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdelete: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tidOverride:\n\t\t\t\t\t\t\t\teffect.idOverride === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\t\t\t// An arbitrary override type is chosen here. It only had an impact on lineage logic which was not enabled in V1.\n\t\t\t\t\t\t\t\t\t\t\ttype: DetachIdOverrideType.Unattach,\n\t\t\t\t\t\t\t\t\t\t\tid: cellIdCodec.encode(effect.idOverride, context),\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"MoveOut\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmoveOut: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tfinalEndpoint:\n\t\t\t\t\t\t\t\teffect.finalEndpoint === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.finalEndpoint, context),\n\t\t\t\t\t\t\tidOverride:\n\t\t\t\t\t\t\t\teffect.idOverride === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\t\t\t// An arbitrary override type is chosen here. It only had an impact on lineage logic which was not enabled in V1.\n\t\t\t\t\t\t\t\t\t\t\ttype: DetachIdOverrideType.Unattach,\n\t\t\t\t\t\t\t\t\t\t\tid: cellIdCodec.encode(effect.idOverride, context),\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"AttachAndDetach\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tattachAndDetach: {\n\t\t\t\t\t\t\tattach: markEffectCodec.encode(effect.attach, context) as Encoded.Attach,\n\t\t\t\t\t\t\tdetach: markEffectCodec.encode(effect.detach, context) as Encoded.Detach,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Rename\":\n\t\t\t\t\t// In documents generated by clients on release >=2.2 (i.e., running the code from the PR that added this comment),\n\t\t\t\t\t// renames are encoded as AttachAndDetach with a special id.\n\t\t\t\t\t// This ensures forward-compatibility of clients on release <=2.1 with documents/ops generated by clients on release >=2.2.\n\t\t\t\t\treturn markEffectCodec.encode(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: \"AttachAndDetach\",\n\t\t\t\t\t\t\tattach: { type: \"MoveIn\", id: renameLocalId },\n\t\t\t\t\t\t\tdetach: { type: \"MoveOut\", id: renameLocalId, idOverride: effect.idOverride },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t);\n\t\t\t\tcase NoopMarkType:\n\t\t\t\t\tfail(0xb2b /* Mark type: NoopMarkType should not be encoded. */);\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(type);\n\t\t\t}\n\t\t},\n\t\tdecode(encoded: Encoded.MarkEffect, context: ChangeEncodingContext): MarkEffect {\n\t\t\treturn decoderLibrary.dispatch(encoded, context);\n\t\t},\n\t};\n\n\tfunction decodeRevision(\n\t\tencodedRevision: EncodedRevisionTag | undefined,\n\t\tcontext: ChangeEncodingContext,\n\t): RevisionTag {\n\t\tif (encodedRevision === undefined) {\n\t\t\tassert(context.revision !== undefined, 0x965 /* Implicit revision should be provided */);\n\t\t\treturn context.revision;\n\t\t}\n\n\t\treturn revisionTagCodec.decode(encodedRevision, context);\n\t}\n\n\tconst decoderLibrary = new DiscriminatedUnionDispatcher<\n\t\tEncoded.MarkEffect,\n\t\t/* args */ [context: ChangeEncodingContext],\n\t\tMarkEffect\n\t>({\n\t\tmoveIn(encoded: Encoded.MoveIn, context: ChangeEncodingContext): MoveIn {\n\t\t\tconst { id, finalEndpoint, revision } = encoded;\n\t\t\tconst mark: MoveIn = {\n\t\t\t\ttype: \"MoveIn\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (finalEndpoint !== undefined) {\n\t\t\t\tmark.finalEndpoint = changeAtomIdCodec.decode(finalEndpoint, context);\n\t\t\t}\n\t\t\treturn mark;\n\t\t},\n\t\tinsert(encoded: Encoded.Insert, context: ChangeEncodingContext): Insert {\n\t\t\tconst { id, revision } = encoded;\n\t\t\tconst mark: Insert = {\n\t\t\t\ttype: \"Insert\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\treturn mark;\n\t\t},\n\t\tdelete(encoded: Encoded.Remove, context: ChangeEncodingContext): Remove {\n\t\t\tconst { id, revision, idOverride } = encoded;\n\t\t\tconst mark: Mutable<Remove> = {\n\t\t\t\ttype: \"Remove\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (idOverride !== undefined) {\n\t\t\t\tmark.idOverride = cellIdCodec.decode(idOverride.id, context);\n\t\t\t}\n\t\t\treturn mark;\n\t\t},\n\t\tmoveOut(encoded: Encoded.MoveOut, context: ChangeEncodingContext): MoveOut {\n\t\t\tconst { id, finalEndpoint, idOverride, revision } = encoded;\n\t\t\tconst mark: Mutable<MoveOut> = {\n\t\t\t\ttype: \"MoveOut\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (finalEndpoint !== undefined) {\n\t\t\t\tmark.finalEndpoint = changeAtomIdCodec.decode(finalEndpoint, context);\n\t\t\t}\n\t\t\tif (idOverride !== undefined) {\n\t\t\t\tmark.idOverride = cellIdCodec.decode(idOverride.id, context);\n\t\t\t}\n\n\t\t\treturn mark;\n\t\t},\n\t\tattachAndDetach(\n\t\t\tencoded: Encoded.AttachAndDetach,\n\t\t\tcontext: ChangeEncodingContext,\n\t\t): AttachAndDetach | Rename {\n\t\t\tconst attach = decoderLibrary.dispatch(encoded.attach, context) as Attach;\n\t\t\tconst detach = decoderLibrary.dispatch(encoded.detach, context) as Detach;\n\t\t\t// In documents generated by clients on release >=2.2 (i.e., running the code from the PR that added this comment),\n\t\t\t// renames are encoded as AttachAndDetach with a special id.\n\t\t\t// This ensures forward-compatibility of clients on release <=2.1 with documents/ops generated by clients on release >=2.2.\n\t\t\tif (attach.id === renameLocalId) {\n\t\t\t\tassert(detach.idOverride !== undefined, 0x9f7 /* Rename must have idOverride */);\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"Rename\",\n\t\t\t\t\tidOverride: detach.idOverride,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttype: \"AttachAndDetach\",\n\t\t\t\tattach,\n\t\t\t\tdetach,\n\t\t\t};\n\t\t},\n\t});\n\n\tconst cellIdCodec: IJsonCodec<\n\t\tCellId,\n\t\tEncoded.CellId,\n\t\tEncoded.CellId,\n\t\tChangeEncodingContext\n\t> = {\n\t\tencode: (cellId: CellId, context: ChangeEncodingContext): Encoded.CellId => {\n\t\t\tconst encoded: Encoded.CellId = {\n\t\t\t\tatom: changeAtomIdCodec.encode(cellId, context),\n\t\t\t};\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: ({ atom }: Encoded.CellId, context: ChangeEncodingContext): CellId => {\n\t\t\treturn changeAtomIdCodec.decode(atom, context);\n\t\t},\n\t};\n\n\t/**\n\t * If we want to make the node change aspect of this codec more type-safe, we could adjust generics\n\t * to be in terms of the schema rather than the concrete type of the node change.\n\t */\n\ttype NodeChangeSchema = TAnySchema;\n\n\treturn {\n\t\tencode: (\n\t\t\tchangeset: Changeset,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): JsonCompatibleReadOnly & Encoded.Changeset<NodeChangeSchema> => {\n\t\t\tconst jsonMarks: Encoded.Changeset<NodeChangeSchema> = [];\n\t\t\tfor (const mark of changeset) {\n\t\t\t\tconst encodedMark: Encoded.Mark<NodeChangeSchema> = {\n\t\t\t\t\tcount: mark.count,\n\t\t\t\t};\n\t\t\t\tif (!isNoopMark(mark)) {\n\t\t\t\t\tencodedMark.effect = markEffectCodec.encode(mark, context.baseContext);\n\t\t\t\t}\n\t\t\t\tif (mark.cellId !== undefined) {\n\t\t\t\t\tencodedMark.cellId = cellIdCodec.encode(mark.cellId, context.baseContext);\n\t\t\t\t}\n\t\t\t\tif (mark.changes !== undefined) {\n\t\t\t\t\tencodedMark.changes = context.encodeNode(mark.changes);\n\t\t\t\t}\n\t\t\t\tjsonMarks.push(encodedMark);\n\t\t\t}\n\t\t\treturn jsonMarks;\n\t\t},\n\t\tdecode: (\n\t\t\tchangeset: Encoded.Changeset<NodeChangeSchema>,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): Changeset => {\n\t\t\tconst marks: Changeset = [];\n\t\t\tfor (const mark of changeset) {\n\t\t\t\tconst decodedMark: Mark = {\n\t\t\t\t\tcount: mark.count,\n\t\t\t\t};\n\n\t\t\t\tif (mark.effect !== undefined) {\n\t\t\t\t\tObject.assign(decodedMark, markEffectCodec.decode(mark.effect, context.baseContext));\n\t\t\t\t}\n\t\t\t\tif (mark.cellId !== undefined) {\n\t\t\t\t\tdecodedMark.cellId = cellIdCodec.decode(mark.cellId, context.baseContext);\n\t\t\t\t}\n\t\t\t\t// Type deduction wrongly narrows the type of `decodedMark` to `NoopMark & HasMarkFields`.\n\t\t\t\t// We declare a new casted copy of `decodedMark` to recover the correct type.\n\t\t\t\tlet decodedMark2 = decodedMark as Mark;\n\t\t\t\tif (decodedMark2.cellId !== undefined && decodedMark2.type === \"AttachAndDetach\") {\n\t\t\t\t\t// In documents generated by clients on release <=2.1 (i.e., not running the code from the PR that added this comment),\n\t\t\t\t\t// rename-like AttachAndDetach marks are not normalized to Rename marks thus requiring this normalization step.\n\t\t\t\t\t// This ensures backward compatibility with documents generated by clients on release <=2.1.\n\t\t\t\t\tdecodedMark2 = normalizeCellRename(\n\t\t\t\t\t\tdecodedMark2.cellId,\n\t\t\t\t\t\tdecodedMark2.count,\n\t\t\t\t\t\tdecodedMark2.attach,\n\t\t\t\t\t\tdecodedMark2.detach,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (mark.changes !== undefined) {\n\t\t\t\t\tdecodedMark2.changes = context.decodeNode(mark.changes);\n\t\t\t\t}\n\t\t\t\tmarks.push(decodedMark2);\n\t\t\t}\n\t\t\treturn marks;\n\t\t},\n\t\tencodedSchema: ChangesetSchema(EncodedNodeChangeset),\n\t};\n}\n\n/**\n * Arbitrary ID that is used to indicate a Rename effect.\n */\nconst renameLocalId: ChangesetLocalId = brand(-1);\n"]}
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
import { type IJsonCodec } from "../../codec/index.js";
|
|
6
6
|
import type { ChangeEncodingContext, EncodedRevisionTag, RevisionTag } from "../../core/index.js";
|
|
7
7
|
import { type JsonCompatibleReadOnly } from "../../util/index.js";
|
|
8
|
-
import { type Encoded } from "./formatV2.js";
|
|
9
|
-
import { type Changeset, type MarkEffect } from "./types.js";
|
|
10
8
|
import type { FieldChangeEncodingContext } from "../index.js";
|
|
9
|
+
import { type Encoded } from "./formatV2.js";
|
|
11
10
|
import type { SequenceCodecHelpers } from "./helperTypes.js";
|
|
11
|
+
import { type Changeset, type MarkEffect } from "./types.js";
|
|
12
12
|
export declare function makeV2CodecHelpers(revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>): SequenceCodecHelpers<MarkEffect, Encoded.MarkEffect>;
|
|
13
13
|
export declare function makeV2Codec(revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>): IJsonCodec<Changeset, JsonCompatibleReadOnly, JsonCompatibleReadOnly, FieldChangeEncodingContext>;
|
|
14
14
|
//# sourceMappingURL=sequenceFieldCodecV2.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequenceFieldCodecV2.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAGN,KAAK,UAAU,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACX,qBAAqB,EAErB,kBAAkB,EAClB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,sBAAsB,EAAuB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"sequenceFieldCodecV2.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAGN,KAAK,UAAU,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACX,qBAAqB,EAErB,kBAAkB,EAClB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,sBAAsB,EAAuB,MAAM,qBAAqB,CAAC;AAEvF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAG9D,OAAO,EAAgC,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAGN,KAAK,SAAS,EAId,KAAK,UAAU,EAMf,MAAM,YAAY,CAAC;AAGpB,wBAAgB,kBAAkB,CACjC,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,GACC,oBAAoB,CAAC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,CAyMtD;AAED,wBAAgB,WAAW,CAC1B,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,GACC,UAAU,CACZ,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,CAC1B,CAsEA"}
|
|
@@ -6,10 +6,10 @@ import { assert, unreachableCase, fail } from "@fluidframework/core-utils/intern
|
|
|
6
6
|
import { DiscriminatedUnionDispatcher, } from "../../codec/index.js";
|
|
7
7
|
import { brand } from "../../util/index.js";
|
|
8
8
|
import { makeChangeAtomIdCodec } from "../changeAtomIdCodec.js";
|
|
9
|
+
import { EncodedNodeChangeset } from "../modular-schema/index.js";
|
|
9
10
|
import { Changeset as ChangesetSchema } from "./formatV2.js";
|
|
10
11
|
import { NoopMarkType, } from "./types.js";
|
|
11
12
|
import { isNoopMark, normalizeCellRename } from "./utils.js";
|
|
12
|
-
import { EncodedNodeChangeset } from "../modular-schema/index.js";
|
|
13
13
|
export function makeV2CodecHelpers(revisionTagCodec) {
|
|
14
14
|
const changeAtomIdCodec = makeChangeAtomIdCodec(revisionTagCodec);
|
|
15
15
|
const markEffectCodec = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequenceFieldCodecV2.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts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C,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;gBACjF,CAAC;gBACD,0FAA0F;gBAC1F,6EAA6E;gBAC7E,IAAI,YAAY,GAAG,WAAmB,CAAC;gBACvC,IAAI,YAAY,CAAC,MAAM,KAAK,SAAS,IAAI,YAAY,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;oBAClF,uHAAuH;oBACvH,+GAA+G;oBAC/G,4FAA4F;oBAC5F,YAAY,GAAG,mBAAmB,CACjC,YAAY,CAAC,MAAM,EACnB,YAAY,CAAC,KAAK,EAClB,YAAY,CAAC,MAAM,EACnB,YAAY,CAAC,MAAM,CACnB,CAAC;gBACH,CAAC;gBACD,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;oBAChC,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACzD,CAAC;gBACD,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAC1B,CAAC;YACD,OAAO,KAAK,CAAC;QACd,CAAC;QACD,aAAa,EAAE,eAAe,CAAC,oBAAoB,CAAC;KACpD,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,aAAa,GAAqB,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\nimport type { TAnySchema } from \"@sinclair/typebox\";\n\nimport {\n\tDiscriminatedUnionDispatcher,\n\ttype DiscriminatedUnionLibrary,\n\ttype IJsonCodec,\n} from \"../../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tChangesetLocalId,\n\tEncodedRevisionTag,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport { type JsonCompatibleReadOnly, type Mutable, brand } from \"../../util/index.js\";\nimport { makeChangeAtomIdCodec } from \"../changeAtomIdCodec.js\";\n\nimport { Changeset as ChangesetSchema, type Encoded } from \"./formatV2.js\";\nimport {\n\ttype Attach,\n\ttype AttachAndDetach,\n\ttype Changeset,\n\ttype Detach,\n\ttype Insert,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype MoveIn,\n\ttype MoveOut,\n\tNoopMarkType,\n\ttype Remove,\n\ttype Rename,\n} from \"./types.js\";\nimport { isNoopMark, normalizeCellRename } from \"./utils.js\";\nimport type { FieldChangeEncodingContext } from \"../index.js\";\nimport { EncodedNodeChangeset } from \"../modular-schema/index.js\";\nimport type { SequenceCodecHelpers } from \"./helperTypes.js\";\n\nexport function makeV2CodecHelpers(\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): SequenceCodecHelpers<MarkEffect, Encoded.MarkEffect> {\n\tconst changeAtomIdCodec = makeChangeAtomIdCodec(revisionTagCodec);\n\tconst markEffectCodec: IJsonCodec<\n\t\tMarkEffect,\n\t\tEncoded.MarkEffect,\n\t\tEncoded.MarkEffect,\n\t\tChangeEncodingContext\n\t> = {\n\t\tencode(effect: MarkEffect, context: ChangeEncodingContext): Encoded.MarkEffect {\n\t\t\tfunction encodeRevision(\n\t\t\t\trevision: RevisionTag | undefined,\n\t\t\t): EncodedRevisionTag | undefined {\n\t\t\t\tif (revision === undefined || revision === context.revision) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn revisionTagCodec.encode(revision, context);\n\t\t\t}\n\n\t\t\tconst type = effect.type;\n\t\t\tswitch (type) {\n\t\t\t\tcase \"MoveIn\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmoveIn: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tfinalEndpoint:\n\t\t\t\t\t\t\t\teffect.finalEndpoint === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.finalEndpoint, context),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Insert\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tinsert: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Remove\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tremove: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tidOverride:\n\t\t\t\t\t\t\t\teffect.idOverride === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.idOverride, context),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"MoveOut\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmoveOut: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tfinalEndpoint:\n\t\t\t\t\t\t\t\teffect.finalEndpoint === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.finalEndpoint, context),\n\t\t\t\t\t\t\tidOverride:\n\t\t\t\t\t\t\t\teffect.idOverride === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.idOverride, context),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"AttachAndDetach\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tattachAndDetach: {\n\t\t\t\t\t\t\tattach: markEffectCodec.encode(effect.attach, context) as Encoded.Attach,\n\t\t\t\t\t\t\tdetach: markEffectCodec.encode(effect.detach, context) as Encoded.Detach,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Rename\":\n\t\t\t\t\t// In documents generated by clients on release >=2.2 (i.e., running the code from the PR that added this comment),\n\t\t\t\t\t// renames are encoded as AttachAndDetach with a special id.\n\t\t\t\t\t// This ensures forward-compatibility of clients on release <=2.1 with documents/ops generated by clients on release >=2.2.\n\t\t\t\t\treturn markEffectCodec.encode(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: \"AttachAndDetach\",\n\t\t\t\t\t\t\tattach: { type: \"MoveIn\", id: renameLocalId },\n\t\t\t\t\t\t\tdetach: { type: \"MoveOut\", id: renameLocalId, idOverride: effect.idOverride },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t);\n\t\t\t\tcase NoopMarkType:\n\t\t\t\t\tfail(0xb2c /* Mark type: NoopMarkType should not be encoded. */);\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(type);\n\t\t\t}\n\t\t},\n\t\tdecode(encoded: Encoded.MarkEffect, context: ChangeEncodingContext): MarkEffect {\n\t\t\treturn decoderDispatcher.dispatch(encoded, context);\n\t\t},\n\t};\n\n\tfunction decodeRevision(\n\t\tencodedRevision: EncodedRevisionTag | undefined,\n\t\tcontext: ChangeEncodingContext,\n\t): RevisionTag {\n\t\tif (encodedRevision === undefined) {\n\t\t\tassert(context.revision !== undefined, 0x996 /* Implicit revision should be provided */);\n\t\t\treturn context.revision;\n\t\t}\n\n\t\treturn revisionTagCodec.decode(encodedRevision, context);\n\t}\n\n\tconst decoderLibrary: DiscriminatedUnionLibrary<\n\t\tEncoded.MarkEffect,\n\t\t/* args */ [context: ChangeEncodingContext],\n\t\tMarkEffect\n\t> = {\n\t\tmoveIn(encoded: Encoded.MoveIn, context: ChangeEncodingContext): MoveIn {\n\t\t\tconst { id, finalEndpoint, revision } = encoded;\n\t\t\tconst mark: MoveIn = {\n\t\t\t\ttype: \"MoveIn\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (finalEndpoint !== undefined) {\n\t\t\t\tmark.finalEndpoint = changeAtomIdCodec.decode(finalEndpoint, context);\n\t\t\t}\n\t\t\treturn mark;\n\t\t},\n\t\tinsert(encoded: Encoded.Insert, context: ChangeEncodingContext): Insert {\n\t\t\tconst { id, revision } = encoded;\n\t\t\tconst mark: Insert = {\n\t\t\t\ttype: \"Insert\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\treturn mark;\n\t\t},\n\t\tremove(encoded: Encoded.Remove, context: ChangeEncodingContext): Remove {\n\t\t\tconst { id, revision, idOverride } = encoded;\n\t\t\tconst mark: Mutable<Remove> = {\n\t\t\t\ttype: \"Remove\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (idOverride !== undefined) {\n\t\t\t\tmark.idOverride = changeAtomIdCodec.decode(idOverride, context);\n\t\t\t}\n\t\t\treturn mark;\n\t\t},\n\t\tmoveOut(encoded: Encoded.MoveOut, context: ChangeEncodingContext): MoveOut {\n\t\t\tconst { id, finalEndpoint, idOverride, revision } = encoded;\n\t\t\tconst mark: Mutable<MoveOut> = {\n\t\t\t\ttype: \"MoveOut\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (finalEndpoint !== undefined) {\n\t\t\t\tmark.finalEndpoint = changeAtomIdCodec.decode(finalEndpoint, context);\n\t\t\t}\n\t\t\tif (idOverride !== undefined) {\n\t\t\t\tmark.idOverride = changeAtomIdCodec.decode(idOverride, context);\n\t\t\t}\n\n\t\t\treturn mark;\n\t\t},\n\t\tattachAndDetach(\n\t\t\tencoded: Encoded.AttachAndDetach,\n\t\t\tcontext: ChangeEncodingContext,\n\t\t): AttachAndDetach | Rename {\n\t\t\tconst attach = decoderDispatcher.dispatch(encoded.attach, context) as Attach;\n\t\t\tconst detach = decoderDispatcher.dispatch(encoded.detach, context) as Detach;\n\t\t\t// In documents generated by clients on release >=2.2 (i.e., running the code from the PR that added this comment),\n\t\t\t// renames are encoded as AttachAndDetach with a special id.\n\t\t\t// This ensures forward-compatibility of clients on release <=2.1 with documents/ops generated by clients on release >=2.2.\n\t\t\tif (attach.id === renameLocalId) {\n\t\t\t\tassert(detach.idOverride !== undefined, 0x9f8 /* Rename must have idOverride */);\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"Rename\",\n\t\t\t\t\tidOverride: detach.idOverride,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttype: \"AttachAndDetach\",\n\t\t\t\tattach,\n\t\t\t\tdetach,\n\t\t\t};\n\t\t},\n\t};\n\n\tconst decoderDispatcher = new DiscriminatedUnionDispatcher<\n\t\tEncoded.MarkEffect,\n\t\t/* args */ [context: ChangeEncodingContext],\n\t\tMarkEffect\n\t>(decoderLibrary);\n\n\treturn {\n\t\tchangeAtomIdCodec,\n\t\tmarkEffectCodec,\n\t\tdecoderLibrary,\n\t\tdecodeRevision,\n\t};\n}\n\nexport function makeV2Codec(\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): IJsonCodec<\n\tChangeset,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tFieldChangeEncodingContext\n> {\n\tconst { markEffectCodec, changeAtomIdCodec } = makeV2CodecHelpers(revisionTagCodec);\n\t/**\n\t * If we want to make the node change aspect of this codec more type-safe, we could adjust generics\n\t * to be in terms of the schema rather than the concrete type of the node change.\n\t */\n\ttype NodeChangeSchema = TAnySchema;\n\n\treturn {\n\t\tencode: (\n\t\t\tchangeset: Changeset,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): JsonCompatibleReadOnly & Encoded.Changeset<NodeChangeSchema> => {\n\t\t\tconst jsonMarks: Encoded.Changeset<NodeChangeSchema> = [];\n\t\t\tfor (const mark of changeset) {\n\t\t\t\tconst encodedMark: Encoded.Mark<NodeChangeSchema> = {\n\t\t\t\t\tcount: mark.count,\n\t\t\t\t};\n\t\t\t\tif (!isNoopMark(mark)) {\n\t\t\t\t\tencodedMark.effect = markEffectCodec.encode(mark, context.baseContext);\n\t\t\t\t}\n\t\t\t\tif (mark.cellId !== undefined) {\n\t\t\t\t\tencodedMark.cellId = changeAtomIdCodec.encode(mark.cellId, context.baseContext);\n\t\t\t\t}\n\t\t\t\tif (mark.changes !== undefined) {\n\t\t\t\t\tencodedMark.changes = context.encodeNode(mark.changes);\n\t\t\t\t}\n\t\t\t\tjsonMarks.push(encodedMark);\n\t\t\t}\n\t\t\treturn jsonMarks;\n\t\t},\n\t\tdecode: (\n\t\t\tchangeset: Encoded.Changeset<NodeChangeSchema>,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): Changeset => {\n\t\t\tconst marks: Changeset = [];\n\t\t\tfor (const mark of changeset) {\n\t\t\t\tconst decodedMark: Mark = {\n\t\t\t\t\tcount: mark.count,\n\t\t\t\t};\n\n\t\t\t\tif (mark.effect !== undefined) {\n\t\t\t\t\tObject.assign(decodedMark, markEffectCodec.decode(mark.effect, context.baseContext));\n\t\t\t\t}\n\t\t\t\tif (mark.cellId !== undefined) {\n\t\t\t\t\tdecodedMark.cellId = changeAtomIdCodec.decode(mark.cellId, context.baseContext);\n\t\t\t\t}\n\t\t\t\t// Type deduction wrongly narrows the type of `decodedMark` to `NoopMark & HasMarkFields`.\n\t\t\t\t// We declare a new casted copy of `decodedMark` to recover the correct type.\n\t\t\t\tlet decodedMark2 = decodedMark as Mark;\n\t\t\t\tif (decodedMark2.cellId !== undefined && decodedMark2.type === \"AttachAndDetach\") {\n\t\t\t\t\t// In documents generated by clients on release <=2.1 (i.e., not running the code from the PR that added this comment),\n\t\t\t\t\t// rename-like AttachAndDetach marks are not normalized to Rename marks thus requiring this normalization step.\n\t\t\t\t\t// This ensures backward compatibility with documents generated by clients on release <=2.1.\n\t\t\t\t\tdecodedMark2 = normalizeCellRename(\n\t\t\t\t\t\tdecodedMark2.cellId,\n\t\t\t\t\t\tdecodedMark2.count,\n\t\t\t\t\t\tdecodedMark2.attach,\n\t\t\t\t\t\tdecodedMark2.detach,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (mark.changes !== undefined) {\n\t\t\t\t\tdecodedMark2.changes = context.decodeNode(mark.changes);\n\t\t\t\t}\n\t\t\t\tmarks.push(decodedMark2);\n\t\t\t}\n\t\t\treturn marks;\n\t\t},\n\t\tencodedSchema: ChangesetSchema(EncodedNodeChangeset),\n\t};\n}\n\n/**\n * Arbitrary ID that is used to indicate a Rename effect.\n */\nconst renameLocalId: ChangesetLocalId = brand(-1);\n"]}
|
|
1
|
+
{"version":3,"file":"sequenceFieldCodecV2.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAGpF,OAAO,EACN,4BAA4B,GAG5B,MAAM,sBAAsB,CAAC;AAO9B,OAAO,EAA6C,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,SAAS,IAAI,eAAe,EAAgB,MAAM,eAAe,CAAC;AAE3E,OAAO,EAUN,YAAY,GAGZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE7D,MAAM,UAAU,kBAAkB,CACjC,gBAKC;IAED,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;IAClE,MAAM,eAAe,GAKjB;QACH,MAAM,CAAC,MAAk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C;YAC1B,CAAC;YACD,OAAO,KAAK,CAAC;QACd,CAAC;QACD,aAAa,EAAE,eAAe,CAAC,oBAAoB,CAAC;KACpD,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,aAAa,GAAqB,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\nimport type { TAnySchema } from \"@sinclair/typebox\";\n\nimport {\n\tDiscriminatedUnionDispatcher,\n\ttype DiscriminatedUnionLibrary,\n\ttype IJsonCodec,\n} from \"../../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tChangesetLocalId,\n\tEncodedRevisionTag,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport { type JsonCompatibleReadOnly, type Mutable, brand } from \"../../util/index.js\";\nimport { makeChangeAtomIdCodec } from \"../changeAtomIdCodec.js\";\nimport type { FieldChangeEncodingContext } from \"../index.js\";\nimport { EncodedNodeChangeset } from \"../modular-schema/index.js\";\n\nimport { Changeset as ChangesetSchema, type Encoded } from \"./formatV2.js\";\nimport type { SequenceCodecHelpers } from \"./helperTypes.js\";\nimport {\n\ttype Attach,\n\ttype AttachAndDetach,\n\ttype Changeset,\n\ttype Detach,\n\ttype Insert,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype MoveIn,\n\ttype MoveOut,\n\tNoopMarkType,\n\ttype Remove,\n\ttype Rename,\n} from \"./types.js\";\nimport { isNoopMark, normalizeCellRename } from \"./utils.js\";\n\nexport function makeV2CodecHelpers(\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): SequenceCodecHelpers<MarkEffect, Encoded.MarkEffect> {\n\tconst changeAtomIdCodec = makeChangeAtomIdCodec(revisionTagCodec);\n\tconst markEffectCodec: IJsonCodec<\n\t\tMarkEffect,\n\t\tEncoded.MarkEffect,\n\t\tEncoded.MarkEffect,\n\t\tChangeEncodingContext\n\t> = {\n\t\tencode(effect: MarkEffect, context: ChangeEncodingContext): Encoded.MarkEffect {\n\t\t\tfunction encodeRevision(\n\t\t\t\trevision: RevisionTag | undefined,\n\t\t\t): EncodedRevisionTag | undefined {\n\t\t\t\tif (revision === undefined || revision === context.revision) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn revisionTagCodec.encode(revision, context);\n\t\t\t}\n\n\t\t\tconst type = effect.type;\n\t\t\tswitch (type) {\n\t\t\t\tcase \"MoveIn\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmoveIn: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tfinalEndpoint:\n\t\t\t\t\t\t\t\teffect.finalEndpoint === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.finalEndpoint, context),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Insert\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tinsert: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Remove\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tremove: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tidOverride:\n\t\t\t\t\t\t\t\teffect.idOverride === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.idOverride, context),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"MoveOut\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmoveOut: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tfinalEndpoint:\n\t\t\t\t\t\t\t\teffect.finalEndpoint === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.finalEndpoint, context),\n\t\t\t\t\t\t\tidOverride:\n\t\t\t\t\t\t\t\teffect.idOverride === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.idOverride, context),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"AttachAndDetach\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tattachAndDetach: {\n\t\t\t\t\t\t\tattach: markEffectCodec.encode(effect.attach, context) as Encoded.Attach,\n\t\t\t\t\t\t\tdetach: markEffectCodec.encode(effect.detach, context) as Encoded.Detach,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Rename\":\n\t\t\t\t\t// In documents generated by clients on release >=2.2 (i.e., running the code from the PR that added this comment),\n\t\t\t\t\t// renames are encoded as AttachAndDetach with a special id.\n\t\t\t\t\t// This ensures forward-compatibility of clients on release <=2.1 with documents/ops generated by clients on release >=2.2.\n\t\t\t\t\treturn markEffectCodec.encode(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: \"AttachAndDetach\",\n\t\t\t\t\t\t\tattach: { type: \"MoveIn\", id: renameLocalId },\n\t\t\t\t\t\t\tdetach: { type: \"MoveOut\", id: renameLocalId, idOverride: effect.idOverride },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t);\n\t\t\t\tcase NoopMarkType:\n\t\t\t\t\tfail(0xb2c /* Mark type: NoopMarkType should not be encoded. */);\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(type);\n\t\t\t}\n\t\t},\n\t\tdecode(encoded: Encoded.MarkEffect, context: ChangeEncodingContext): MarkEffect {\n\t\t\treturn decoderDispatcher.dispatch(encoded, context);\n\t\t},\n\t};\n\n\tfunction decodeRevision(\n\t\tencodedRevision: EncodedRevisionTag | undefined,\n\t\tcontext: ChangeEncodingContext,\n\t): RevisionTag {\n\t\tif (encodedRevision === undefined) {\n\t\t\tassert(context.revision !== undefined, 0x996 /* Implicit revision should be provided */);\n\t\t\treturn context.revision;\n\t\t}\n\n\t\treturn revisionTagCodec.decode(encodedRevision, context);\n\t}\n\n\tconst decoderLibrary: DiscriminatedUnionLibrary<\n\t\tEncoded.MarkEffect,\n\t\t/* args */ [context: ChangeEncodingContext],\n\t\tMarkEffect\n\t> = {\n\t\tmoveIn(encoded: Encoded.MoveIn, context: ChangeEncodingContext): MoveIn {\n\t\t\tconst { id, finalEndpoint, revision } = encoded;\n\t\t\tconst mark: MoveIn = {\n\t\t\t\ttype: \"MoveIn\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (finalEndpoint !== undefined) {\n\t\t\t\tmark.finalEndpoint = changeAtomIdCodec.decode(finalEndpoint, context);\n\t\t\t}\n\t\t\treturn mark;\n\t\t},\n\t\tinsert(encoded: Encoded.Insert, context: ChangeEncodingContext): Insert {\n\t\t\tconst { id, revision } = encoded;\n\t\t\tconst mark: Insert = {\n\t\t\t\ttype: \"Insert\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\treturn mark;\n\t\t},\n\t\tremove(encoded: Encoded.Remove, context: ChangeEncodingContext): Remove {\n\t\t\tconst { id, revision, idOverride } = encoded;\n\t\t\tconst mark: Mutable<Remove> = {\n\t\t\t\ttype: \"Remove\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (idOverride !== undefined) {\n\t\t\t\tmark.idOverride = changeAtomIdCodec.decode(idOverride, context);\n\t\t\t}\n\t\t\treturn mark;\n\t\t},\n\t\tmoveOut(encoded: Encoded.MoveOut, context: ChangeEncodingContext): MoveOut {\n\t\t\tconst { id, finalEndpoint, idOverride, revision } = encoded;\n\t\t\tconst mark: Mutable<MoveOut> = {\n\t\t\t\ttype: \"MoveOut\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (finalEndpoint !== undefined) {\n\t\t\t\tmark.finalEndpoint = changeAtomIdCodec.decode(finalEndpoint, context);\n\t\t\t}\n\t\t\tif (idOverride !== undefined) {\n\t\t\t\tmark.idOverride = changeAtomIdCodec.decode(idOverride, context);\n\t\t\t}\n\n\t\t\treturn mark;\n\t\t},\n\t\tattachAndDetach(\n\t\t\tencoded: Encoded.AttachAndDetach,\n\t\t\tcontext: ChangeEncodingContext,\n\t\t): AttachAndDetach | Rename {\n\t\t\tconst attach = decoderDispatcher.dispatch(encoded.attach, context) as Attach;\n\t\t\tconst detach = decoderDispatcher.dispatch(encoded.detach, context) as Detach;\n\t\t\t// In documents generated by clients on release >=2.2 (i.e., running the code from the PR that added this comment),\n\t\t\t// renames are encoded as AttachAndDetach with a special id.\n\t\t\t// This ensures forward-compatibility of clients on release <=2.1 with documents/ops generated by clients on release >=2.2.\n\t\t\tif (attach.id === renameLocalId) {\n\t\t\t\tassert(detach.idOverride !== undefined, 0x9f8 /* Rename must have idOverride */);\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"Rename\",\n\t\t\t\t\tidOverride: detach.idOverride,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttype: \"AttachAndDetach\",\n\t\t\t\tattach,\n\t\t\t\tdetach,\n\t\t\t};\n\t\t},\n\t};\n\n\tconst decoderDispatcher = new DiscriminatedUnionDispatcher<\n\t\tEncoded.MarkEffect,\n\t\t/* args */ [context: ChangeEncodingContext],\n\t\tMarkEffect\n\t>(decoderLibrary);\n\n\treturn {\n\t\tchangeAtomIdCodec,\n\t\tmarkEffectCodec,\n\t\tdecoderLibrary,\n\t\tdecodeRevision,\n\t};\n}\n\nexport function makeV2Codec(\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): IJsonCodec<\n\tChangeset,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tFieldChangeEncodingContext\n> {\n\tconst { markEffectCodec, changeAtomIdCodec } = makeV2CodecHelpers(revisionTagCodec);\n\t/**\n\t * If we want to make the node change aspect of this codec more type-safe, we could adjust generics\n\t * to be in terms of the schema rather than the concrete type of the node change.\n\t */\n\ttype NodeChangeSchema = TAnySchema;\n\n\treturn {\n\t\tencode: (\n\t\t\tchangeset: Changeset,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): JsonCompatibleReadOnly & Encoded.Changeset<NodeChangeSchema> => {\n\t\t\tconst jsonMarks: Encoded.Changeset<NodeChangeSchema> = [];\n\t\t\tfor (const mark of changeset) {\n\t\t\t\tconst encodedMark: Encoded.Mark<NodeChangeSchema> = {\n\t\t\t\t\tcount: mark.count,\n\t\t\t\t};\n\t\t\t\tif (!isNoopMark(mark)) {\n\t\t\t\t\tencodedMark.effect = markEffectCodec.encode(mark, context.baseContext);\n\t\t\t\t}\n\t\t\t\tif (mark.cellId !== undefined) {\n\t\t\t\t\tencodedMark.cellId = changeAtomIdCodec.encode(mark.cellId, context.baseContext);\n\t\t\t\t}\n\t\t\t\tif (mark.changes !== undefined) {\n\t\t\t\t\tencodedMark.changes = context.encodeNode(mark.changes);\n\t\t\t\t}\n\t\t\t\tjsonMarks.push(encodedMark);\n\t\t\t}\n\t\t\treturn jsonMarks;\n\t\t},\n\t\tdecode: (\n\t\t\tchangeset: Encoded.Changeset<NodeChangeSchema>,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): Changeset => {\n\t\t\tconst marks: Changeset = [];\n\t\t\tfor (const mark of changeset) {\n\t\t\t\tconst decodedMark: Mark = {\n\t\t\t\t\tcount: mark.count,\n\t\t\t\t};\n\n\t\t\t\tif (mark.effect !== undefined) {\n\t\t\t\t\tObject.assign(decodedMark, markEffectCodec.decode(mark.effect, context.baseContext));\n\t\t\t\t}\n\t\t\t\tif (mark.cellId !== undefined) {\n\t\t\t\t\tdecodedMark.cellId = changeAtomIdCodec.decode(mark.cellId, context.baseContext);\n\t\t\t\t}\n\t\t\t\t// Type deduction wrongly narrows the type of `decodedMark` to `NoopMark & HasMarkFields`.\n\t\t\t\t// We declare a new casted copy of `decodedMark` to recover the correct type.\n\t\t\t\tlet decodedMark2 = decodedMark as Mark;\n\t\t\t\tif (decodedMark2.cellId !== undefined && decodedMark2.type === \"AttachAndDetach\") {\n\t\t\t\t\t// In documents generated by clients on release <=2.1 (i.e., not running the code from the PR that added this comment),\n\t\t\t\t\t// rename-like AttachAndDetach marks are not normalized to Rename marks thus requiring this normalization step.\n\t\t\t\t\t// This ensures backward compatibility with documents generated by clients on release <=2.1.\n\t\t\t\t\tdecodedMark2 = normalizeCellRename(\n\t\t\t\t\t\tdecodedMark2.cellId,\n\t\t\t\t\t\tdecodedMark2.count,\n\t\t\t\t\t\tdecodedMark2.attach,\n\t\t\t\t\t\tdecodedMark2.detach,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (mark.changes !== undefined) {\n\t\t\t\t\tdecodedMark2.changes = context.decodeNode(mark.changes);\n\t\t\t\t}\n\t\t\t\tmarks.push(decodedMark2);\n\t\t\t}\n\t\t\treturn marks;\n\t\t},\n\t\tencodedSchema: ChangesetSchema(EncodedNodeChangeset),\n\t};\n}\n\n/**\n * Arbitrary ID that is used to indicate a Rename effect.\n */\nconst renameLocalId: ChangesetLocalId = brand(-1);\n"]}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { type IJsonCodec } from "../../codec/index.js";
|
|
6
6
|
import type { ChangeEncodingContext, EncodedRevisionTag, RevisionTag } from "../../core/index.js";
|
|
7
7
|
import type { JsonCompatibleReadOnly } from "../../util/index.js";
|
|
8
|
-
import type { Changeset } from "./types.js";
|
|
9
8
|
import type { FieldChangeEncodingContext } from "../index.js";
|
|
9
|
+
import type { Changeset } from "./types.js";
|
|
10
10
|
export declare function makeV3Codec(revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>): IJsonCodec<Changeset, JsonCompatibleReadOnly, JsonCompatibleReadOnly, FieldChangeEncodingContext>;
|
|
11
11
|
//# sourceMappingURL=sequenceFieldCodecV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequenceFieldCodecV3.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,KAAK,EACX,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"sequenceFieldCodecV3.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,KAAK,EACX,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAK9D,OAAO,KAAK,EAAE,SAAS,EAA4B,MAAM,YAAY,CAAC;AAGtE,wBAAgB,WAAW,CAC1B,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,GACC,UAAU,CACZ,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,CAC1B,CAmGA"}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { DiscriminatedUnionDispatcher } from "../../codec/index.js";
|
|
6
|
-
import { Changeset as ChangesetSchema } from "./formatV3.js";
|
|
7
|
-
import { isNoopMark } from "./utils.js";
|
|
8
6
|
import { EncodedNodeChangeset } from "../modular-schema/index.js";
|
|
7
|
+
import { Changeset as ChangesetSchema } from "./formatV3.js";
|
|
9
8
|
import { makeV2CodecHelpers } from "./sequenceFieldCodecV2.js";
|
|
9
|
+
import { isNoopMark } from "./utils.js";
|
|
10
10
|
export function makeV3Codec(revisionTagCodec) {
|
|
11
11
|
const { changeAtomIdCodec: atomIdCodec, markEffectCodec: markEffectV2Codec, decoderLibrary: decoderLibraryV2, } = makeV2CodecHelpers(revisionTagCodec);
|
|
12
12
|
const markEffectCodec = {
|