@fluidframework/tree 2.74.0 → 2.81.0-374083
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 +18 -0
- package/api-report/tree.alpha.api.md +63 -9
- package/dist/alpha.d.ts +9 -0
- package/dist/codec/codec.d.ts +31 -3
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +10 -0
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/index.d.ts +2 -2
- package/dist/codec/index.d.ts.map +1 -1
- package/dist/codec/index.js +2 -2
- package/dist/codec/index.js.map +1 -1
- package/dist/codec/versioned/codec.d.ts +80 -22
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js +137 -15
- package/dist/codec/versioned/codec.js.map +1 -1
- package/dist/codec/versioned/index.d.ts +1 -1
- package/dist/codec/versioned/index.d.ts.map +1 -1
- package/dist/codec/versioned/index.js +2 -2
- package/dist/codec/versioned/index.js.map +1 -1
- package/dist/core/change-family/changeFamily.d.ts +4 -1
- package/dist/core/change-family/changeFamily.d.ts.map +1 -1
- package/dist/core/change-family/changeFamily.js.map +1 -1
- package/dist/core/change-family/index.d.ts +1 -1
- package/dist/core/change-family/index.d.ts.map +1 -1
- package/dist/core/change-family/index.js.map +1 -1
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +7 -6
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/changeRebaser.d.ts +42 -3
- package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
- package/dist/core/rebase/changeRebaser.js.map +1 -1
- package/dist/core/rebase/index.d.ts +2 -2
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js +2 -2
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +52 -10
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +5 -12
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/rebase/utils.d.ts.map +1 -1
- package/dist/core/rebase/utils.js +33 -11
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/schema-stored/schema.js +3 -3
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +4 -4
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts +7 -2
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +21 -56
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +18 -10
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.js +6 -6
- package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts +2 -3
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.js +4 -5
- package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.d.ts +2 -3
- package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.js +4 -6
- package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts +5 -6
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.js +11 -41
- package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/dist/core/tree/index.d.ts +2 -2
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js +5 -4
- package/dist/core/tree/index.js.map +1 -1
- package/dist/core/tree/mapTree.js +1 -1
- package/dist/core/tree/mapTree.js.map +1 -1
- package/dist/core/tree/pathTree.d.ts +11 -3
- package/dist/core/tree/pathTree.d.ts.map +1 -1
- package/dist/core/tree/pathTree.js +14 -2
- package/dist/core/tree/pathTree.js.map +1 -1
- package/dist/core/tree/sparseTree.d.ts.map +1 -1
- package/dist/core/tree/sparseTree.js +1 -0
- package/dist/core/tree/sparseTree.js.map +1 -1
- package/dist/core/tree/treeTextFormat.d.ts.map +1 -1
- package/dist/core/tree/treeTextFormat.js +5 -9
- package/dist/core/tree/treeTextFormat.js.map +1 -1
- package/dist/core/tree/visitDelta.d.ts.map +1 -1
- package/dist/core/tree/visitDelta.js +3 -2
- package/dist/core/tree/visitDelta.js.map +1 -1
- package/dist/core/tree/visitorUtils.d.ts.map +1 -1
- package/dist/core/tree/visitorUtils.js +58 -18
- package/dist/core/tree/visitorUtils.js.map +1 -1
- package/dist/feature-libraries/changeAtomIdBTree.d.ts +16 -0
- package/dist/feature-libraries/changeAtomIdBTree.d.ts.map +1 -0
- package/dist/feature-libraries/changeAtomIdBTree.js +30 -0
- package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js +8 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +4 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +9 -7
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +7 -4
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +19 -11
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -3
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +9 -5
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +103 -44
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +251 -77
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +22 -3
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +2 -1
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js +5 -2
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +38 -0
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js +132 -0
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
- package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +9 -6
- package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js +21 -0
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
- package/dist/feature-libraries/deltaUtils.d.ts +1 -0
- package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
- package/dist/feature-libraries/deltaUtils.js +6 -1
- package/dist/feature-libraries/deltaUtils.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +9 -0
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +6 -0
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +8 -7
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +44 -15
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +3 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +5 -4
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +15 -8
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.js +6 -6
- package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.js +1 -0
- package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.js +12 -3
- package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +12 -9
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js +4 -7
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +25 -0
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js +59 -0
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -0
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +22 -53
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +7 -13
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js +2 -2
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +7 -5
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +12 -8
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +32 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +409 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +15 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +31 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV3.d.ts +15 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV3.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV3.js +393 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV3.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +32 -288
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +60 -26
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1519 -615
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/{lib/feature-libraries/modular-schema/modularChangeFormat.d.ts → dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts} +5 -6
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +7 -7
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +112 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +21 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV3.d.ts +146 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV3.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV3.js +32 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV3.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +59 -13
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js +3 -3
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -1
- package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +7 -5
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/optional-field/index.d.ts +2 -2
- package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/index.js +1 -2
- package/dist/feature-libraries/optional-field/index.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.d.ts +5 -26
- package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.js +223 -450
- package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +23 -0
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +1 -0
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +31 -0
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +1 -0
- package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
- package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +57 -28
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +12 -0
- package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +1 -0
- package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js +57 -0
- package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js.map +1 -0
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +5 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +14 -2
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts +7 -21
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +28 -70
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/index.d.ts +2 -2
- package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/index.js +2 -5
- package/dist/feature-libraries/schema-index/index.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +1 -9
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +1 -12
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/schemaChecker.js +11 -6
- package/dist/feature-libraries/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.d.ts +6 -7
- package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +91 -263
- package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
- package/dist/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
- package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
- package/dist/feature-libraries/sequence-field/index.d.ts +2 -3
- package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/index.js +1 -3
- package/dist/feature-libraries/sequence-field/index.js.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.d.ts +3 -3
- package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.js +67 -168
- package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
- package/dist/feature-libraries/sequence-field/markQueue.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
- package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/moveEffectTable.js +10 -87
- package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -3
- package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.js +120 -119
- package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.js +35 -43
- package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +0 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +365 -179
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +20 -60
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +20 -112
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/dist/feature-libraries/sequence-field/types.d.ts +30 -59
- package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/types.js.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.d.ts +15 -24
- package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.js +148 -318
- package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.js +7 -7
- package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
- package/dist/feature-libraries/treeTextCursor.js +2 -2
- package/dist/feature-libraries/treeTextCursor.js.map +1 -1
- package/dist/feature-libraries/valueUtilities.d.ts.map +1 -1
- package/dist/feature-libraries/valueUtilities.js +16 -8
- package/dist/feature-libraries/valueUtilities.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/index.d.ts +1 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts +4 -4
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +2 -1
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +3 -8
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +58 -44
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +9 -3
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +72 -44
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +10 -8
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js +5 -3
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +7 -6
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +29 -18
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js +14 -7
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +35 -29
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +21 -23
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +11 -10
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +93 -25
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +6 -3
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +13 -6
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.js +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts +2 -2
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +21 -15
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts +4 -0
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +18 -5
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +2 -0
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +12 -0
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.js +2 -0
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +3 -3
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +2 -2
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +3 -1
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js +2 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts +4 -0
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +17 -5
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +2 -0
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormat.js +12 -0
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js +9 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
- package/dist/shared-tree-core/sequenceIdUtils.js +4 -4
- package/dist/shared-tree-core/sequenceIdUtils.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +1 -0
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +13 -9
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts +25 -8
- package/dist/shared-tree-core/transaction.d.ts.map +1 -1
- package/dist/shared-tree-core/transaction.js +65 -30
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.d.ts +2 -2
- package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.js +3 -3
- package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
- package/dist/simple-tree/api/configuration.js +1 -1
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/customTree.d.ts.map +1 -1
- package/dist/simple-tree/api/customTree.js +13 -9
- package/dist/simple-tree/api/customTree.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/dist/simple-tree/api/discrepancies.js +21 -17
- package/dist/simple-tree/api/discrepancies.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +2 -2
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +2 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +12 -8
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.js +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +18 -9
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.js +10 -5
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +19 -15
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.js +10 -10
- package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +244 -0
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +297 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +2 -3
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/transactionTypes.d.ts +17 -4
- package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/transactionTypes.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +3 -1
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +21 -13
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +14 -9
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +12 -5
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +79 -23
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/fieldSchema.d.ts +4 -4
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/fieldSchema.js.map +1 -1
- package/dist/simple-tree/getTreeNodeForField.d.ts.map +1 -1
- package/dist/simple-tree/getTreeNodeForField.js +2 -1
- package/dist/simple-tree/getTreeNodeForField.js.map +1 -1
- package/dist/simple-tree/index.d.ts +3 -3
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +4 -3
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +9 -6
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +22 -20
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/common.js +1 -1
- package/dist/simple-tree/node-kinds/common.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +2 -2
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +21 -22
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.js +6 -5
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/prepareForInsertion.d.ts +54 -47
- package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/dist/simple-tree/prepareForInsertion.js +184 -126
- package/dist/simple-tree/prepareForInsertion.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +9 -5
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +31 -13
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/dist/text/index.d.ts +6 -0
- package/dist/text/index.d.ts.map +1 -0
- package/dist/text/index.js +10 -0
- package/dist/text/index.js.map +1 -0
- package/dist/text/textDomain.d.ts +138 -0
- package/dist/text/textDomain.d.ts.map +1 -0
- package/dist/text/textDomain.js +121 -0
- package/dist/text/textDomain.js.map +1 -0
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +17 -3
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/bTreeUtils.d.ts +12 -4
- package/dist/util/bTreeUtils.d.ts.map +1 -1
- package/dist/util/bTreeUtils.js +15 -19
- package/dist/util/bTreeUtils.js.map +1 -1
- package/dist/util/breakable.js +7 -9
- package/dist/util/breakable.js.map +1 -1
- package/dist/util/idAllocator.d.ts.map +1 -1
- package/dist/util/idAllocator.js +1 -2
- package/dist/util/idAllocator.js.map +1 -1
- package/dist/util/index.d.ts +1 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +2 -1
- package/dist/util/index.js.map +1 -1
- package/dist/util/nestedMap.d.ts.map +1 -1
- package/dist/util/nestedMap.js +13 -13
- package/dist/util/nestedMap.js.map +1 -1
- package/dist/util/rangeMap.d.ts +24 -12
- package/dist/util/rangeMap.d.ts.map +1 -1
- package/dist/util/rangeMap.js +46 -6
- package/dist/util/rangeMap.js.map +1 -1
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +16 -15
- package/dist/util/utils.js.map +1 -1
- package/docs/user-facing/merge-semantics.md +3 -2
- package/eslint.config.mts +5 -48
- package/lib/alpha.d.ts +9 -0
- package/lib/codec/codec.d.ts +31 -3
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +10 -0
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/index.d.ts +2 -2
- package/lib/codec/index.d.ts.map +1 -1
- package/lib/codec/index.js +1 -1
- package/lib/codec/index.js.map +1 -1
- package/lib/codec/versioned/codec.d.ts +80 -22
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js +138 -15
- package/lib/codec/versioned/codec.js.map +1 -1
- package/lib/codec/versioned/index.d.ts +1 -1
- package/lib/codec/versioned/index.d.ts.map +1 -1
- package/lib/codec/versioned/index.js +1 -1
- package/lib/codec/versioned/index.js.map +1 -1
- package/lib/core/change-family/changeFamily.d.ts +4 -1
- package/lib/core/change-family/changeFamily.d.ts.map +1 -1
- package/lib/core/change-family/changeFamily.js.map +1 -1
- package/lib/core/change-family/index.d.ts +1 -1
- package/lib/core/change-family/index.d.ts.map +1 -1
- package/lib/core/change-family/index.js.map +1 -1
- package/lib/core/index.d.ts +3 -3
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +2 -2
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/changeRebaser.d.ts +42 -3
- package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
- package/lib/core/rebase/changeRebaser.js.map +1 -1
- package/lib/core/rebase/index.d.ts +2 -2
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +52 -10
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +3 -10
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/rebase/utils.d.ts.map +1 -1
- package/lib/core/rebase/utils.js +33 -11
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/schema-stored/schema.js +3 -3
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +4 -4
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts +7 -2
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +23 -58
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +18 -10
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.js +4 -4
- package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts +2 -3
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.js +4 -5
- package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV2.d.ts +2 -3
- package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV2.js +4 -6
- package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts +5 -6
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.js +12 -39
- package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/lib/core/tree/index.d.ts +2 -2
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +2 -2
- package/lib/core/tree/index.js.map +1 -1
- package/lib/core/tree/mapTree.js +1 -1
- package/lib/core/tree/mapTree.js.map +1 -1
- package/lib/core/tree/pathTree.d.ts +11 -3
- package/lib/core/tree/pathTree.d.ts.map +1 -1
- package/lib/core/tree/pathTree.js +12 -1
- package/lib/core/tree/pathTree.js.map +1 -1
- package/lib/core/tree/sparseTree.d.ts.map +1 -1
- package/lib/core/tree/sparseTree.js +1 -0
- package/lib/core/tree/sparseTree.js.map +1 -1
- package/lib/core/tree/treeTextFormat.d.ts.map +1 -1
- package/lib/core/tree/treeTextFormat.js +5 -9
- package/lib/core/tree/treeTextFormat.js.map +1 -1
- package/lib/core/tree/visitDelta.d.ts.map +1 -1
- package/lib/core/tree/visitDelta.js +3 -2
- package/lib/core/tree/visitDelta.js.map +1 -1
- package/lib/core/tree/visitorUtils.d.ts.map +1 -1
- package/lib/core/tree/visitorUtils.js +58 -18
- package/lib/core/tree/visitorUtils.js.map +1 -1
- package/lib/feature-libraries/changeAtomIdBTree.d.ts +16 -0
- package/lib/feature-libraries/changeAtomIdBTree.d.ts.map +1 -0
- package/lib/feature-libraries/changeAtomIdBTree.js +24 -0
- package/lib/feature-libraries/changeAtomIdBTree.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js +9 -2
- package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +4 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +9 -7
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +7 -4
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +19 -11
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -3
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +9 -5
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +103 -44
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +249 -78
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +22 -3
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +2 -1
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js +2 -1
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +38 -0
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js +128 -0
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
- package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +9 -6
- package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js +21 -0
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
- package/lib/feature-libraries/deltaUtils.d.ts +1 -0
- package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
- package/lib/feature-libraries/deltaUtils.js +5 -1
- package/lib/feature-libraries/deltaUtils.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +9 -0
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +6 -0
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +8 -7
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +45 -16
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +3 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +5 -4
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +5 -4
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.js +6 -6
- package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.js +2 -1
- package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.js +12 -3
- package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +12 -9
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js +3 -5
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +25 -0
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js +55 -0
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -0
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +22 -53
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +8 -14
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +7 -5
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +5 -3
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +32 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +402 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +15 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +27 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV3.d.ts +15 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV3.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV3.js +389 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV3.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +34 -290
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +60 -26
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1441 -546
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/{dist/feature-libraries/modular-schema/modularChangeFormat.d.ts → lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts} +5 -6
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +4 -4
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +112 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +18 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV3.d.ts +146 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV3.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV3.js +29 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV3.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +59 -13
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.js +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -1
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +7 -5
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/optional-field/index.d.ts +2 -2
- package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/index.js +1 -1
- package/lib/feature-libraries/optional-field/index.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.d.ts +5 -26
- package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.js +223 -448
- package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +23 -0
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +1 -0
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +27 -0
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +1 -0
- package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
- package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +55 -26
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +12 -0
- package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +1 -0
- package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js +53 -0
- package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js.map +1 -0
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +5 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +15 -3
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts +7 -21
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +30 -68
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/index.d.ts +2 -2
- package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/index.js +2 -2
- package/lib/feature-libraries/schema-index/index.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +1 -9
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +0 -10
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/schemaChecker.js +11 -6
- package/lib/feature-libraries/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.d.ts +6 -7
- package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +93 -265
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
- package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
- package/lib/feature-libraries/sequence-field/index.d.ts +2 -3
- package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/index.js +0 -1
- package/lib/feature-libraries/sequence-field/index.js.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.js +69 -170
- package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
- package/lib/feature-libraries/sequence-field/markQueue.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
- package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/moveEffectTable.js +9 -81
- package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.js +122 -121
- package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.js +36 -44
- package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +0 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +356 -174
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +21 -61
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +20 -112
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/lib/feature-libraries/sequence-field/types.d.ts +30 -59
- package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/types.js.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.d.ts +15 -24
- package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.js +144 -311
- package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.js +7 -7
- package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
- package/lib/feature-libraries/treeTextCursor.js +2 -2
- package/lib/feature-libraries/treeTextCursor.js.map +1 -1
- package/lib/feature-libraries/valueUtilities.d.ts.map +1 -1
- package/lib/feature-libraries/valueUtilities.js +16 -8
- package/lib/feature-libraries/valueUtilities.js.map +1 -1
- package/lib/index.d.ts +4 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/index.d.ts +1 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts +4 -4
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +3 -2
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +3 -8
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +61 -47
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +9 -3
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +41 -13
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +10 -8
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js +6 -4
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +7 -6
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +30 -19
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js +12 -6
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +35 -29
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +21 -23
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +11 -10
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +97 -29
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +6 -3
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +13 -6
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.js +2 -2
- package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts +2 -2
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +21 -15
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts +4 -0
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +16 -4
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +2 -0
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +12 -0
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.js +2 -0
- package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +3 -3
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +2 -2
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +2 -2
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.js +2 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts +4 -0
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +15 -4
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +2 -0
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormat.js +12 -0
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js +9 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
- package/lib/shared-tree-core/sequenceIdUtils.js +4 -4
- package/lib/shared-tree-core/sequenceIdUtils.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +1 -0
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +13 -9
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts +25 -8
- package/lib/shared-tree-core/transaction.d.ts.map +1 -1
- package/lib/shared-tree-core/transaction.js +67 -32
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.d.ts +2 -2
- package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.js +3 -3
- package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
- package/lib/simple-tree/api/configuration.js +1 -1
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/customTree.d.ts.map +1 -1
- package/lib/simple-tree/api/customTree.js +13 -9
- package/lib/simple-tree/api/customTree.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/lib/simple-tree/api/discrepancies.js +21 -17
- package/lib/simple-tree/api/discrepancies.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +2 -2
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +12 -8
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.js +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +18 -9
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaCodec.js +10 -5
- package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +19 -15
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/simpleTreeIndex.js +10 -10
- package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +244 -0
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js +270 -0
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +4 -7
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/transactionTypes.d.ts +17 -4
- package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/transactionTypes.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +3 -1
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +21 -13
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +14 -9
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +12 -5
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +78 -23
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/fieldSchema.d.ts +4 -4
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/fieldSchema.js.map +1 -1
- package/lib/simple-tree/getTreeNodeForField.d.ts.map +1 -1
- package/lib/simple-tree/getTreeNodeForField.js +2 -1
- package/lib/simple-tree/getTreeNodeForField.js.map +1 -1
- package/lib/simple-tree/index.d.ts +3 -3
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +2 -2
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +9 -6
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +23 -21
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/common.js +2 -2
- package/lib/simple-tree/node-kinds/common.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +22 -23
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.js +6 -5
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/prepareForInsertion.d.ts +54 -47
- package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/lib/simple-tree/prepareForInsertion.js +184 -125
- package/lib/simple-tree/prepareForInsertion.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +9 -5
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +28 -11
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/lib/text/index.d.ts +6 -0
- package/lib/text/index.d.ts.map +1 -0
- package/lib/text/index.js +6 -0
- package/lib/text/index.js.map +1 -0
- package/lib/text/textDomain.d.ts +138 -0
- package/lib/text/textDomain.d.ts.map +1 -0
- package/lib/text/textDomain.js +118 -0
- package/lib/text/textDomain.js.map +1 -0
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +18 -4
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/bTreeUtils.d.ts +12 -4
- package/lib/util/bTreeUtils.d.ts.map +1 -1
- package/lib/util/bTreeUtils.js +16 -20
- package/lib/util/bTreeUtils.js.map +1 -1
- package/lib/util/breakable.js +7 -9
- package/lib/util/breakable.js.map +1 -1
- package/lib/util/idAllocator.d.ts.map +1 -1
- package/lib/util/idAllocator.js +1 -2
- package/lib/util/idAllocator.js.map +1 -1
- package/lib/util/index.d.ts +1 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +1 -1
- package/lib/util/index.js.map +1 -1
- package/lib/util/nestedMap.d.ts.map +1 -1
- package/lib/util/nestedMap.js +13 -13
- package/lib/util/nestedMap.js.map +1 -1
- package/lib/util/rangeMap.d.ts +24 -12
- package/lib/util/rangeMap.d.ts.map +1 -1
- package/lib/util/rangeMap.js +44 -5
- package/lib/util/rangeMap.js.map +1 -1
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js +16 -15
- package/lib/util/utils.js.map +1 -1
- package/package.json +33 -33
- package/src/codec/codec.ts +48 -8
- package/src/codec/index.ts +4 -1
- package/src/codec/versioned/codec.ts +340 -22
- package/src/codec/versioned/index.ts +3 -1
- package/src/core/change-family/changeFamily.ts +5 -0
- package/src/core/change-family/index.ts +1 -0
- package/src/core/index.ts +8 -3
- package/src/core/rebase/changeRebaser.ts +46 -7
- package/src/core/rebase/index.ts +4 -1
- package/src/core/rebase/types.ts +71 -39
- package/src/core/rebase/utils.ts +42 -14
- package/src/core/schema-stored/schema.ts +3 -3
- package/src/core/tree/anchorSet.ts +4 -4
- package/src/core/tree/detachedFieldIndex.ts +29 -74
- package/src/core/tree/detachedFieldIndexCodecCommon.ts +4 -8
- package/src/core/tree/detachedFieldIndexCodecV1.ts +3 -7
- package/src/core/tree/detachedFieldIndexCodecV2.ts +5 -9
- package/src/core/tree/detachedFieldIndexCodecs.ts +21 -64
- package/src/core/tree/index.ts +3 -2
- package/src/core/tree/mapTree.ts +1 -1
- package/src/core/tree/pathTree.ts +16 -4
- package/src/core/tree/sparseTree.ts +1 -0
- package/src/core/tree/treeTextFormat.ts +5 -9
- package/src/core/tree/visitDelta.ts +6 -2
- package/src/core/tree/visitorUtils.ts +55 -19
- package/src/feature-libraries/changeAtomIdBTree.ts +56 -0
- package/src/feature-libraries/chunked-forest/basicChunk.ts +8 -2
- package/src/feature-libraries/chunked-forest/chunkTree.ts +6 -1
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +8 -6
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +7 -4
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +19 -11
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +4 -3
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -5
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +1 -1
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +442 -139
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +24 -6
- package/src/feature-libraries/default-schema/index.ts +17 -5
- package/src/feature-libraries/default-schema/locationBasedEditBuilder.ts +188 -0
- package/src/feature-libraries/default-schema/mappedEditBuilder.ts +41 -9
- package/src/feature-libraries/deltaUtils.ts +6 -1
- package/src/feature-libraries/flex-tree/context.ts +17 -0
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +7 -8
- package/src/feature-libraries/flex-tree/lazyField.ts +72 -30
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +3 -1
- package/src/feature-libraries/index.ts +32 -13
- package/src/feature-libraries/indexing/anchorTreeIndex.ts +5 -5
- package/src/feature-libraries/mapTreeCursor.ts +2 -1
- package/src/feature-libraries/mitigatedChangeFamily.ts +14 -7
- package/src/feature-libraries/modular-schema/comparison.ts +12 -9
- package/src/feature-libraries/modular-schema/crossFieldQueries.ts +142 -44
- package/src/feature-libraries/modular-schema/defaultRevisionReplacer.ts +70 -0
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +35 -64
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +11 -25
- package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +1 -1
- package/src/feature-libraries/modular-schema/index.ts +20 -16
- package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +912 -0
- package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +89 -0
- package/src/feature-libraries/modular-schema/modularChangeCodecV3.ts +760 -0
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +52 -523
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +2756 -884
- package/src/feature-libraries/modular-schema/{modularChangeFormat.ts → modularChangeFormatV1.ts} +5 -4
- package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +34 -0
- package/src/feature-libraries/modular-schema/modularChangeFormatV3.ts +62 -0
- package/src/feature-libraries/modular-schema/modularChangeTypes.ts +70 -14
- package/src/feature-libraries/node-identifier/mockNodeIdentifierManager.ts +1 -1
- package/src/feature-libraries/object-forest/objectForest.ts +7 -5
- package/src/feature-libraries/optional-field/index.ts +1 -3
- package/src/feature-libraries/optional-field/optionalField.ts +320 -576
- package/src/feature-libraries/optional-field/optionalFieldChangeFormatV3.ts +45 -0
- package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +24 -38
- package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +89 -35
- package/src/feature-libraries/optional-field/optionalFieldCodecV3.ts +94 -0
- package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +5 -1
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +18 -3
- package/src/feature-libraries/schema-index/codec.ts +30 -90
- package/src/feature-libraries/schema-index/index.ts +2 -4
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +0 -17
- package/src/feature-libraries/schemaChecker.ts +11 -6
- package/src/feature-libraries/sequence-field/compose.ts +147 -526
- package/src/feature-libraries/sequence-field/helperTypes.ts +34 -19
- package/src/feature-libraries/sequence-field/index.ts +0 -9
- package/src/feature-libraries/sequence-field/invert.ts +103 -227
- package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
- package/src/feature-libraries/sequence-field/moveEffectTable.ts +11 -192
- package/src/feature-libraries/sequence-field/rebase.ts +182 -210
- package/src/feature-libraries/sequence-field/replaceRevisions.ts +54 -80
- package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +0 -2
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +648 -220
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +56 -68
- package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +25 -27
- package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +25 -132
- package/src/feature-libraries/sequence-field/types.ts +34 -64
- package/src/feature-libraries/sequence-field/utils.ts +171 -366
- package/src/feature-libraries/treeCursorUtils.ts +7 -7
- package/src/feature-libraries/treeTextCursor.ts +2 -2
- package/src/feature-libraries/valueUtilities.ts +16 -8
- package/src/index.ts +11 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/index.ts +3 -2
- package/src/shared-tree/schematizeTree.ts +21 -8
- package/src/shared-tree/schematizingTreeView.ts +79 -83
- package/src/shared-tree/sharedTree.ts +50 -17
- package/src/shared-tree/sharedTreeChangeCodecs.ts +14 -9
- package/src/shared-tree/sharedTreeChangeEnricher.ts +6 -2
- package/src/shared-tree/sharedTreeChangeFamily.ts +44 -24
- package/src/shared-tree/sharedTreeEditBuilder.ts +48 -13
- package/src/shared-tree/treeAlpha.ts +60 -51
- package/src/shared-tree/treeCheckout.ts +160 -73
- package/src/shared-tree-core/branch.ts +21 -6
- package/src/shared-tree-core/branchCommitEnricher.ts +3 -8
- package/src/shared-tree-core/editManager.ts +43 -29
- package/src/shared-tree-core/editManagerCodecs.ts +19 -4
- package/src/shared-tree-core/editManagerFormatCommons.ts +12 -0
- package/src/shared-tree-core/editManagerFormatV1toV4.ts +5 -1
- package/src/shared-tree-core/editManagerSummarizer.ts +3 -3
- package/src/shared-tree-core/index.ts +2 -0
- package/src/shared-tree-core/messageCodecV1ToV4.ts +3 -1
- package/src/shared-tree-core/messageCodecVSharedBranches.ts +2 -1
- package/src/shared-tree-core/messageCodecs.ts +18 -4
- package/src/shared-tree-core/messageFormat.ts +12 -1
- package/src/shared-tree-core/messageFormatV1ToV4.ts +18 -2
- package/src/shared-tree-core/sequenceIdUtils.ts +4 -4
- package/src/shared-tree-core/sharedTreeCore.ts +15 -8
- package/src/shared-tree-core/transaction.ts +115 -56
- package/src/shared-tree-core/transactionEnricher.ts +5 -6
- package/src/simple-tree/api/configuration.ts +1 -1
- package/src/simple-tree/api/customTree.ts +14 -10
- package/src/simple-tree/api/discrepancies.ts +23 -17
- package/src/simple-tree/api/index.ts +5 -0
- package/src/simple-tree/api/schemaFactory.ts +11 -7
- package/src/simple-tree/api/schemaFactoryAlpha.ts +1 -1
- package/src/simple-tree/api/schemaFactoryBeta.ts +1 -1
- package/src/simple-tree/api/schemaFromSimple.ts +18 -9
- package/src/simple-tree/api/simpleSchemaCodec.ts +10 -5
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +21 -17
- package/src/simple-tree/api/simpleTreeIndex.ts +8 -8
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +501 -0
- package/src/simple-tree/api/storedSchema.ts +10 -7
- package/src/simple-tree/api/transactionTypes.ts +19 -4
- package/src/simple-tree/api/tree.ts +3 -1
- package/src/simple-tree/api/treeNodeApi.ts +21 -13
- package/src/simple-tree/api/verboseTree.ts +14 -9
- package/src/simple-tree/core/treeNodeKernel.ts +12 -5
- package/src/simple-tree/core/unhydratedFlexTree.ts +109 -53
- package/src/simple-tree/fieldSchema.ts +6 -4
- package/src/simple-tree/getTreeNodeForField.ts +2 -1
- package/src/simple-tree/index.ts +7 -1
- package/src/simple-tree/leafNodeSchema.ts +8 -5
- package/src/simple-tree/node-kinds/array/arrayNode.ts +32 -30
- package/src/simple-tree/node-kinds/common.ts +2 -5
- package/src/simple-tree/node-kinds/map/mapNode.ts +4 -4
- package/src/simple-tree/node-kinds/object/objectNode.ts +29 -30
- package/src/simple-tree/node-kinds/record/recordNode.ts +12 -12
- package/src/simple-tree/prepareForInsertion.ts +343 -201
- package/src/simple-tree/toStoredSchema.ts +9 -5
- package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +43 -15
- package/src/text/README.md +8 -0
- package/src/text/index.ts +6 -0
- package/src/text/textDomain.ts +199 -0
- package/src/treeFactory.ts +20 -5
- package/src/util/bTreeUtils.ts +34 -23
- package/src/util/breakable.ts +9 -9
- package/src/util/idAllocator.ts +1 -2
- package/src/util/index.ts +3 -0
- package/src/util/nestedMap.ts +13 -15
- package/src/util/rangeMap.ts +72 -18
- package/src/util/utils.ts +14 -13
- package/.eslintrc.cjs +0 -140
- package/assertTagging.config.mjs +0 -14
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -50
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
- package/docs/main/sequence-field/move-composition.md +0 -46
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -46
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
- package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +0 -57
package/lib/util/utils.js
CHANGED
|
@@ -88,30 +88,31 @@ export function hasSingle(array) {
|
|
|
88
88
|
*/
|
|
89
89
|
export function compareSets({ a, b, aExtra, bExtra, same, }) {
|
|
90
90
|
for (const item of a.keys()) {
|
|
91
|
-
if (
|
|
92
|
-
if (
|
|
93
|
-
if (!aExtra(item)) {
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
91
|
+
if (b.has(item)) {
|
|
92
|
+
if (same !== undefined && !same(item)) {
|
|
98
93
|
return false;
|
|
99
94
|
}
|
|
100
95
|
}
|
|
101
96
|
else {
|
|
102
|
-
if (
|
|
97
|
+
if (aExtra === undefined) {
|
|
103
98
|
return false;
|
|
104
99
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
for (const item of b.keys()) {
|
|
108
|
-
if (!a.has(item)) {
|
|
109
|
-
if (bExtra !== undefined) {
|
|
110
|
-
if (!bExtra(item)) {
|
|
100
|
+
else {
|
|
101
|
+
if (!aExtra(item)) {
|
|
111
102
|
return false;
|
|
112
103
|
}
|
|
113
104
|
}
|
|
114
|
-
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
for (const item of b.keys()) {
|
|
108
|
+
if (a.has(item)) {
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
if (bExtra === undefined) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
if (!bExtra(item)) {
|
|
115
116
|
return false;
|
|
116
117
|
}
|
|
117
118
|
}
|
package/lib/util/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/util/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,eAAe,MAAM,yBAAyB,CAAC;AA8BtD;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAI,QAAW;IACvC,OAAO,QAAsB,CAAC;AAC/B,CAAC;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,eAAe,CAAC;AAErC;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAI,CAAyB;IAC3D,+EAA+E;IAC/E,wEAAwE;IACxE,oEAAoE;IACpE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACzB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAA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B,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,SAAS,EAAE,CAAC;IACpB,CAAC;IACD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACzC,MAAM,IAAI,GAAG,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;IACxE,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;IACtE,OAAO,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAChC,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\";\nimport { Type } from \"@sinclair/typebox\";\nimport structuredClone from \"@ungap/structured-clone\";\n\n/**\n * Subset of Map interface.\n */\nexport interface MapGetSet<K, V> {\n\tget(key: K): V | undefined;\n\tset(key: K, value: V): void;\n}\n\n/**\n * Make all transitive properties in `T` readonly\n */\nexport type RecursiveReadonly<T> = {\n\treadonly [P in keyof T]: RecursiveReadonly<T[P]>;\n};\n\n/**\n * Remove `readonly` from all fields.\n */\nexport type Mutable<T> = { -readonly [P in keyof T]: T[P] };\n\n/**\n * Make all field required and omits fields whose ony valid value would be `undefined`.\n * This is analogous to `Required<T>` except it tolerates 'optional undefined'.\n */\nexport type Populated<T> = {\n\t[P in keyof T as Exclude<P, T[P] extends undefined ? P : never>]-?: T[P];\n};\n\n/**\n * Casts a readonly object to a mutable one.\n * Better than casting to `Mutable<Foo>` because it doesn't risk casting a non-`Foo` to a `Mutable<Foo>`.\n * @param readonly - The object with readonly fields.\n * @returns The same object but with a type that makes all fields mutable.\n */\nexport function asMutable<T>(readonly: T): Mutable<T> {\n\treturn readonly as Mutable<T>;\n}\n\nexport const clone = structuredClone;\n\n/**\n * Checks whether or not the given object is a `readonly` array.\n *\n * Note that this does NOT indicate if a given array should be treated as readonly.\n * This instead indicates if an object is an Array, and is typed to tolerate the readonly case.\n */\nexport function isReadonlyArray<T>(x: readonly T[] | unknown): x is readonly T[] {\n\t// `Array.isArray()` does not properly narrow `readonly` array types by itself,\n\t// so we wrap it in this type guard. This may become unnecessary if/when\n\t// https://github.com/microsoft/TypeScript/issues/17002 is resolved.\n\treturn Array.isArray(x);\n}\n\n/**\n * Creates and populates a new array.\n * @param size - The size of the array to be created.\n * @param filler - Callback for populating the array with a value for a given index\n */\nexport function makeArray<T>(size: number, filler: (index: number) => T): T[] {\n\tconst array = [];\n\tfor (let i = 0; i < size; ++i) {\n\t\tarray.push(filler(i));\n\t}\n\treturn array;\n}\n\n/**\n * Returns the last element of an array, or `undefined` if the array has no elements.\n * @param array - The array to get the last element from.\n * @remarks\n * If the type of the array has been narrowed by e.g. {@link hasSome | hasSome(array)} or {@link hasSingle | hasOne(array)} then the return type will be `T` rather than `T | undefined`.\n */\nexport function getLast<T>(array: readonly [T, ...T[]]): T;\nexport function getLast<T>(array: { [index: number]: T; length: number }): T | undefined;\nexport function getLast<T>(array: { [index: number]: T; length: number }): T | undefined {\n\treturn array[array.length - 1];\n}\n\n/**\n * Returns true if and only if the given array has at least one element.\n * @param array - The array to check.\n * @remarks\n * If `array` contains at least one element, its type will be narrowed and can benefit from improved typing from e.g. `array[0]` and {@link getLast | getLast(array)}.\n * This is especially useful when \"noUncheckedIndexedAccess\" is enabled in the TypeScript compiler options, since the return type of `array[0]` will be `T` rather than `T | undefined`.\n */\nexport function hasSome<T>(array: T[]): array is [T, ...T[]];\nexport function hasSome<T>(array: readonly T[]): array is readonly [T, ...T[]];\nexport function hasSome<T>(array: readonly T[]): array is [T, ...T[]] {\n\treturn array.length > 0;\n}\n\n/**\n * Returns true if and only if the given iterable has at least one element.\n */\nexport function iterableHasSome<T>(iterable: Iterable<T>): boolean {\n\treturn iterable[Symbol.iterator]().next().done === false;\n}\n\n/**\n * Returns the value from the given iterable if it contains exactly one item, otherwise `undefined`.\n * @remarks\n * Note that if the iterable itself may contain `undefined` values,\n * it is not possible to use this to distinguish between an iterable that contains exactly one `undefined` value and an iterable that contains zero or multiple values.\n */\nexport function oneFromIterable<T>(items: Iterable<T>): T | undefined {\n\tconst iterator = items[Symbol.iterator]();\n\tconst first = iterator.next();\n\tif (first.done === true) {\n\t\t// Empty iterable case.\n\t\treturn undefined;\n\t}\n\tconst second = iterator.next();\n\tif (second.done === true) {\n\t\t// Single item iterable case.\n\t\treturn first.value;\n\t}\n\t// Multiple item iterable case.\n\treturn undefined;\n}\n\n/**\n * Returns true if and only if the given array has exactly one element.\n * @param array - The array to check.\n * @remarks\n * If `array` contains exactly one element, its type will be narrowed and can benefit from improved typing from e.g. `array[0]` and {@link getLast | getLast(array)}.\n * This is especially useful when \"noUncheckedIndexedAccess\" is enabled in the TypeScript compiler options, since the return type of `array[0]` will be `T` rather than `T | undefined`.\n */\nexport function hasSingle<T>(array: T[]): array is [T];\nexport function hasSingle<T>(array: readonly T[]): array is readonly [T];\nexport function hasSingle<T>(array: readonly T[]): array is [T] {\n\treturn array.length === 1;\n}\n\n/**\n * Compares two sets using callbacks.\n * Early returns on first false comparison.\n *\n * @param a - One Set.\n * @param b - The other Set.\n * @param aExtra - Called for items in `a` but not `b`.\n * @param bExtra - Called for items in `b` but not `a`.\n * @param same - Called for items in `a` and `b`.\n * @returns false iff any of the call backs returned false.\n */\nexport function compareSets<T>({\n\ta,\n\tb,\n\taExtra,\n\tbExtra,\n\tsame,\n}: {\n\ta: ReadonlySet<T> | ReadonlyMap<T, unknown>;\n\tb: ReadonlySet<T> | ReadonlyMap<T, unknown>;\n\taExtra?: (t: T) => boolean;\n\tbExtra?: (t: T) => boolean;\n\tsame?: (t: T) => boolean;\n}): boolean {\n\tfor (const item of a.keys()) {\n\t\tif (!b.has(item)) {\n\t\t\tif (aExtra !== undefined) {\n\t\t\t\tif (!aExtra(item)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tif (same !== undefined && !same(item)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\tfor (const item of b.keys()) {\n\t\tif (!a.has(item)) {\n\t\t\tif (bExtra !== undefined) {\n\t\t\t\tif (!bExtra(item)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * Sets the value at `key` in map to value if not already present.\n * Returns the value at `key` after setting it.\n * This is equivalent to a get or default that adds the default to the map.\n */\nexport function getOrAddInMap<Key, Value>(\n\tmap: MapGetSet<Key, Value>,\n\tkey: Key,\n\tvalue: Value,\n): Value {\n\tconst currentValue = map.get(key);\n\tif (currentValue !== undefined) {\n\t\treturn currentValue;\n\t}\n\tmap.set(key, value);\n\treturn value;\n}\n\n/**\n * Retrieve a value from a map with the given key, or create a new entry if the key is not in the map.\n * @param map - The map to query/update\n * @param key - The key to lookup in the map\n * @param defaultValue - a function which returns a default value. This is called and used to set an initial value for the given key in the map if none exists\n * @returns either the existing value for the given key, or the newly-created value (the result of `defaultValue`)\n */\nexport function getOrCreate<K, V>(\n\tmap: MapGetSet<K, V>,\n\tkey: K,\n\tdefaultValue: (key: K) => V,\n): V {\n\tlet value = map.get(key);\n\tif (value === undefined) {\n\t\tvalue = defaultValue(key);\n\t\tmap.set(key, value);\n\t}\n\treturn value;\n}\n\n/**\n * Utility for dictionaries whose values are lists.\n * Gets the list associated with the provided key, if it exists.\n * Otherwise, creates an entry with an empty list, and returns that list.\n */\nexport function getOrAddEmptyToMap<K, V>(map: MapGetSet<K, V[]>, key: K): V[] {\n\tlet collection = map.get(key);\n\tif (collection === undefined) {\n\t\tcollection = [];\n\t\tmap.set(key, collection);\n\t}\n\treturn collection;\n}\n\n/**\n * Map one iterable to another by transforming each element one at a time\n * @param iterable - the iterable to transform\n * @param map - the transformation function to run on each element of the iterable\n * @returns a new iterable of elements which have been transformed by the `map` function\n */\nexport function* mapIterable<T, U>(\n\titerable: Iterable<T>,\n\tmap: (t: T) => U,\n): IterableIterator<U> {\n\tfor (const t of iterable) {\n\t\tyield map(t);\n\t}\n}\n\n/**\n * Filter one iterable into another\n * @param iterable - the iterable to filter\n * @param filter - the predicate function to run on each element of the iterable\n * @returns a new iterable including only the elements that passed the filter predicate\n */\nexport function* filterIterable<T>(\n\titerable: Iterable<T>,\n\tfilter: (t: T) => boolean,\n): IterableIterator<T> {\n\tfor (const t of iterable) {\n\t\tif (filter(t)) {\n\t\t\tyield t;\n\t\t}\n\t}\n}\n\n/**\n * Finds the first element in the given iterable that satisfies a predicate.\n * @param iterable - The iterable to search for an eligible element\n * @param predicate - The predicate to run against each element\n * @returns The first element in the iterable that satisfies the predicate, or undefined if the iterable contains no such element\n */\nexport function find<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): T | undefined {\n\tfor (const t of iterable) {\n\t\tif (predicate(t)) {\n\t\t\treturn t;\n\t\t}\n\t}\n}\n\n/**\n * Counts the number of elements in the given iterable.\n * @param iterable - the iterable to enumerate\n * @returns the number of elements that were iterated after exhausting the iterable\n */\nexport function count(iterable: Iterable<unknown>): number {\n\tlet n = 0;\n\tfor (const _ of iterable) {\n\t\tn += 1;\n\t}\n\treturn n;\n}\n\n/**\n * Use for Json compatible data.\n *\n * @typeparam TExtra - Type permitted in addition to the normal JSON types.\n * Commonly used for to allow {@link @fluidframework/core-interfaces#IFluidHandle} within the otherwise JSON compatible content.\n *\n * @remarks\n * This does not robustly forbid non json comparable data via type checking,\n * but instead mostly restricts access to it.\n *\n * @privateRemarks\n * TODO (before promoting to public): consider moving this to a more general location - this isn't SharedTree-specific.\n *\n * @beta\n */\nexport type JsonCompatible<TExtra = never> =\n\t| string\n\t| number\n\t| boolean\n\t// eslint-disable-next-line @rushstack/no-new-null\n\t| null\n\t| JsonCompatible<TExtra>[]\n\t| JsonCompatibleObject<TExtra>\n\t| TExtra;\n\n/**\n * Use for Json object compatible data.\n *\n * @remarks\n * This does not robustly forbid non json comparable data via type checking,\n * but instead mostly restricts access to it.\n *\n * @privateRemarks\n * TODO (before promoting to public): consider moving this to a more general location - this isn't SharedTree-specific.\n *\n * @beta\n */\nexport type JsonCompatibleObject<TExtra = never> = { [P in string]?: JsonCompatible<TExtra> };\n\n/**\n * Use for readonly view of Json compatible data.\n * @remarks\n * This does not robustly forbid non json comparable data via type checking,\n * but instead mostly restricts access to it.\n * @alpha\n */\nexport type JsonCompatibleReadOnly =\n\t| string\n\t| number\n\t| boolean\n\t// eslint-disable-next-line @rushstack/no-new-null\n\t| null\n\t| readonly JsonCompatibleReadOnly[]\n\t| JsonCompatibleReadOnlyObject;\n\n/**\n * Use for readonly view of Json compatible data.\n * @remarks\n * This does not robustly forbid non json comparable data via type checking,\n * but instead mostly restricts access to it.\n * @alpha\n */\nexport type JsonCompatibleReadOnlyObject = { readonly [P in string]?: JsonCompatibleReadOnly };\n\n/**\n * @remarks TODO: Audit usage of this type in schemas, evaluating whether it is necessary and performance\n * of alternatives.\n *\n * True \"arbitrary serializable data\" is probably fine, but some persisted types declarations might be better\n * expressed using composition of schemas for runtime validation, even if we don't think making the types\n * generic is worth the maintenance cost.\n */\nexport const JsonCompatibleReadOnlySchema = Type.Any();\n\n/**\n * Returns if a particular json compatible value is an object.\n * Does not include `null` or arrays.\n */\nexport function isJsonObject(\n\tvalue: JsonCompatibleReadOnly,\n): value is { readonly [P in string]?: JsonCompatibleReadOnly } {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/**\n * Verifies that the supplied indices are valid within the supplied array.\n * @param startIndex - The starting index in the range. Must be in [0, length).\n * @param endIndex - The ending index in the range. Must be within (start, length].\n * @param array - The array the indices refer to\n */\nexport function assertValidRangeIndices(\n\tstartIndex: number,\n\tendIndex: number,\n\tarray: { readonly length: number },\n): void {\n\tassert(endIndex >= startIndex, 0x79c /* Range indices are malformed. */);\n\tassertValidIndex(startIndex, array, false);\n\tassertValidIndex(endIndex, array, true);\n}\n\nexport function assertValidIndex(\n\tindex: number,\n\tarray: { readonly length: number },\n\tallowOnePastEnd: boolean = false,\n): void {\n\tassertNonNegativeSafeInteger(index);\n\tif (allowOnePastEnd) {\n\t\tassert(index <= array.length, 0x378 /* index must be less than or equal to length */);\n\t} else {\n\t\tassert(index < array.length, 0x379 /* index must be less than length */);\n\t}\n}\n\nexport function assertValidRange(\n\t{ start, end }: { start: number; end: number },\n\tarray: { readonly length: number },\n): void {\n\tassertNonNegativeSafeInteger(start);\n\tassertNonNegativeSafeInteger(end);\n\tassert(end <= array.length, 0x79d /* Range end must be less than or equal to length */);\n\tassert(start <= end, 0x79e /* Range start must be less than or equal to range start */);\n}\n\nexport function assertNonNegativeSafeInteger(index: number): void {\n\tassert(Number.isSafeInteger(index), 0x376 /* index must be an integer */);\n\tassert(index >= 0, 0x377 /* index must be non-negative */);\n}\n\n/**\n * Convert an object into a Map.\n *\n * This function must only be used with objects specifically intended to encode map like information.\n * The only time such objects should be used is for encoding maps as object literals to allow for developer ergonomics or JSON compatibility.\n * Even those two use-cases need to be carefully considered as using objects as maps can have a lot of issues\n * (including but not limited to unintended access to __proto__ and other non-owned keys).\n * This function helps these few cases get into using an actual map in as safe of was as is practical.\n */\nexport function objectToMap<MapKey extends string | number | symbol, MapValue>(\n\tobjectMap: Record<MapKey, MapValue>,\n): Map<MapKey, MapValue> {\n\tconst map = new Map<MapKey, MapValue>();\n\t// This function must only be used with objects specifically intended to encode map like information.\n\tfor (const key of Object.keys(objectMap)) {\n\t\tconst element = objectMap[key as MapKey];\n\t\tmap.set(key as MapKey, element);\n\t}\n\treturn map;\n}\n\n/**\n * Convert an object used as a map into a new object used like a map.\n *\n * @remarks\n * This function must only be used with objects specifically intended to encode map like information.\n * The only time such objects should be used is for encoding maps as object literals to allow for developer ergonomics or JSON compatibility.\n * Even those two use-cases need to be carefully considered as using objects as maps can have a lot of issues\n * (including but not limited to unintended access to __proto__ and other non-owned keys).\n * {@link objectToMap} helps these few cases get into using an actual map in as safe of a way as is practical.\n */\nexport function transformObjectMap<\n\tMapKey extends string | number | symbol,\n\tMapValue,\n\tNewMapValue,\n>(\n\tobjectMap: Record<MapKey, MapValue>,\n\ttransformer: (value: MapValue, key: MapKey) => NewMapValue,\n): Record<MapKey, MapValue> {\n\tconst output: Record<MapKey, MapValue> = Object.create(null);\n\t// This function must only be used with objects specifically intended to encode map like information.\n\tfor (const key of Object.keys(objectMap)) {\n\t\tconst element = objectMap[key as MapKey];\n\t\tObject.defineProperty(output, key, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\twritable: true,\n\t\t\tvalue: transformer(element, key as MapKey),\n\t\t});\n\t}\n\treturn output;\n}\n\n/**\n * Make an inverted copy of a map.\n *\n * @returns a map which can look up the keys from the values of the original map.\n */\nexport function invertMap<Key, Value>(input: Map<Key, Value>): Map<Value, Key> {\n\tconst result = new Map<Value, Key>(mapIterable(input, ([key, value]) => [value, key]));\n\tassert(\n\t\tresult.size === input.size,\n\t\t0x88a /* all values in a map must be unique to invert it */,\n\t);\n\treturn result;\n}\n\n/**\n * Type with a name describing what it is.\n * Typically used with values (like schema) that can be stored in a map, but in some representations have their name/key as a field.\n */\nexport interface Named<TName> {\n\treadonly name: TName;\n}\n\n/**\n * Order {@link Named} objects by their name.\n */\nexport function compareNamed(a: Named<string>, b: Named<string>): -1 | 0 | 1 {\n\tif (a.name < b.name) {\n\t\treturn -1;\n\t}\n\tif (a.name > b.name) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\n/**\n * Placeholder for `Symbol.dispose`.\n * @privateRemarks\n * TODO: replace this with `Symbol.dispose` when it is available or make it a valid polyfill.\n */\nexport const disposeSymbol: unique symbol = Symbol(\"Symbol.dispose placeholder\");\n\n/**\n * An object with an explicit lifetime that can be ended.\n * @privateRemarks\n * Simpler alternative to core-utils/IDisposable for internal use in this package.\n * This avoids adding a named \"dispose\" method, and will eventually be replaced with\n * {@link https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html#using-declarations-and-explicit-resource-management| TypeScript's Disposable}.\n *\n * Once this is replaced with TypeScript's Disposable, core-utils/IDisposable can extend it, bringing the APIs into a reasonable alignment.\n */\nexport interface IDisposable {\n\t/**\n\t * Call to end the lifetime of this object.\n\t *\n\t * It is invalid to use this object after this,\n\t * except for operations which explicitly document they are valid after disposal.\n\t *\n\t * @remarks\n\t * May cleanup resources retained by this object.\n\t * Often includes un-registering from events and thus preventing other objects from retaining a reference to this indefinably.\n\t *\n\t * Usually the only operations allowed after disposal are querying if an object is already disposed,\n\t * but this can vary between implementations.\n\t */\n\t[disposeSymbol](): void;\n}\n\n/**\n * Capitalize a string.\n */\nexport function capitalize<S extends string>(s: S): Capitalize<S> {\n\t// To avoid splitting characters which are made of multiple UTF-16 code units,\n\t// use iteration instead of indexing to separate the first character.\n\tconst iterated = s[Symbol.iterator]().next();\n\tif (iterated.done === true) {\n\t\t// Empty string case.\n\t\treturn \"\" as Capitalize<S>;\n\t}\n\n\treturn (iterated.value.toUpperCase() + s.slice(iterated.value.length)) as Capitalize<S>;\n}\n\n/**\n * Compares strings lexically to form a strict partial ordering.\n */\nexport function compareStrings<T extends string>(a: T, b: T): number {\n\treturn a > b ? 1 : a === b ? 0 : -1;\n}\n\n/**\n * Defines a property on an object that is lazily initialized and cached.\n * @remarks This is useful for properties that are expensive to compute and it is not guaranteed that they will be accessed.\n * This function initially defines a getter on the object, but after first read it replaces the getter with a value property.\n * @param obj - The object on which to define the property.\n * @param key - The key of the property to define.\n * @param get - The function (called either once or not at all) to compute the value of the property.\n * @returns `obj`, typed such that it has the new property.\n * This allows for the new property to be read off of `obj` in a type-safe manner after calling this function.\n */\nexport function defineLazyCachedProperty<\n\tT extends object,\n\tK extends string | number | symbol,\n\tV,\n>(obj: T, key: K, get: () => V): typeof obj & { [P in K]: V } {\n\tReflect.defineProperty(obj, key, {\n\t\tget() {\n\t\t\tconst value = get();\n\t\t\tReflect.defineProperty(obj, key, { value });\n\t\t\treturn value;\n\t\t},\n\t\tconfigurable: true,\n\t});\n\treturn obj as typeof obj & { [P in K]: V };\n}\n\n/**\n * Copies a given property from one object to another if and only if the property is defined.\n * @param source - The object to copy the property from.\n * If `source` is undefined or does not have the property defined, then this function will do nothing.\n * @param property - The property to copy.\n * @param destination - The object to copy the property to.\n * @remarks This function is useful for copying properties from one object to another while minimizing the presence of `undefined` values.\n * If `property` is not present on `source` - or if `property` is present, but has a value of `undefined` - then this function will not modify `destination`.\n * This is different from doing `destination.foo = source.foo`, which would define a `\"foo\"` property on `destination` with the value `undefined`.\n *\n * If the type of `source` is known to have `property`, then this function asserts that the type of `destination` has `property` as well after the call.\n *\n * This function first reads the property value (if present) from `source` and then sets it on `destination`, as opposed to e.g. directly copying the property descriptor.\n * @privateRemarks The first overload of this function allows auto-complete to suggest property names from `source`, but by having the second overload we still allow for arbitrary property names.\n */\nexport function copyPropertyIfDefined<S extends object, K extends keyof S, D extends object>(\n\tsource: S | undefined,\n\tproperty: K,\n\tdestination: D,\n): asserts destination is K extends keyof S ? D & { [P in K]: S[K] } : D;\nexport function copyPropertyIfDefined<\n\tS extends object,\n\tK extends string | number | symbol,\n\tD extends object,\n>(\n\tsource: S | undefined,\n\tproperty: K,\n\tdestination: D,\n): asserts destination is K extends keyof S ? D & { [P in K]: S[K] } : D;\nexport function copyPropertyIfDefined<\n\tS extends object,\n\tK extends string | number | symbol,\n\tD extends object,\n>(\n\tsource: S | undefined,\n\tproperty: K,\n\tdestination: D,\n): asserts destination is K extends keyof S ? D & { [P in K]: S[K] } : D {\n\tif (source !== undefined) {\n\t\tconst value = (source as { [P in K]?: unknown })[property];\n\t\tif (value !== undefined) {\n\t\t\t(destination as { [P in K]: unknown })[property] = value;\n\t\t}\n\t}\n}\n\n/**\n * Reduces an array of values into a single value.\n * This is similar to `Array.prototype.reduce`,\n * except that it recursively reduces the left and right halves of the input before reducing their respective reductions.\n *\n * When compared with an approach like reducing all the values left-to-right,\n * this balanced approach is beneficial when the cost of invoking `callbackFn` is proportional to the number reduced values that its parameters collectively represent.\n * For example, if `T` is an array, and `callbackFn` concatenates its inputs,\n * then `balancedReduce` will have O(N*log(N)) time complexity instead of `Array.prototype.reduce`'s O(N²).\n * However, if `callbackFn` is O(1) then both `balancedReduce` and `Array.prototype.reduce` will have O(N) complexity.\n *\n * @param array - The array to reduce.\n * @param callbackFn - The function to execute for each pairwise reduction.\n * @param emptyCase - A factory function that provides the value to return if the input array is empty.\n */\nexport function balancedReduce<T>(\n\tarray: readonly T[],\n\tcallbackFn: (left: T, right: T) => T,\n\temptyCase: () => T,\n): T {\n\tif (hasSingle(array)) {\n\t\treturn array[0];\n\t}\n\tif (!hasSome(array)) {\n\t\treturn emptyCase();\n\t}\n\tconst mid = Math.floor(array.length / 2);\n\tconst left = balancedReduce(array.slice(0, mid), callbackFn, emptyCase);\n\tconst right = balancedReduce(array.slice(mid), callbackFn, emptyCase);\n\treturn callbackFn(left, right);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/util/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,eAAe,MAAM,yBAAyB,CAAC;AA8BtD;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAI,QAAW;IACvC,OAAO,QAAsB,CAAC;AAC/B,CAAC;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,eAAe,CAAC;AAErC;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAI,CAAyB;IAC3D,+EAA+E;IAC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IACF,CAAC;AACF,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,cAAc,CAC7B,KAAmB,EACnB,UAAoC,EACpC,SAAkB;IAElB,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,SAAS,EAAE,CAAC;IACpB,CAAC;IACD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACzC,MAAM,IAAI,GAAG,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;IACxE,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;IACtE,OAAO,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAChC,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\";\nimport { Type } from \"@sinclair/typebox\";\nimport structuredClone from \"@ungap/structured-clone\";\n\n/**\n * Subset of Map interface.\n */\nexport interface MapGetSet<K, V> {\n\tget(key: K): V | undefined;\n\tset(key: K, value: V): void;\n}\n\n/**\n * Make all transitive properties in `T` readonly\n */\nexport type RecursiveReadonly<T> = {\n\treadonly [P in keyof T]: RecursiveReadonly<T[P]>;\n};\n\n/**\n * Remove `readonly` from all fields.\n */\nexport type Mutable<T> = { -readonly [P in keyof T]: T[P] };\n\n/**\n * Make all field required and omits fields whose ony valid value would be `undefined`.\n * This is analogous to `Required<T>` except it tolerates 'optional undefined'.\n */\nexport type Populated<T> = {\n\t[P in keyof T as Exclude<P, T[P] extends undefined ? P : never>]-?: T[P];\n};\n\n/**\n * Casts a readonly object to a mutable one.\n * Better than casting to `Mutable<Foo>` because it doesn't risk casting a non-`Foo` to a `Mutable<Foo>`.\n * @param readonly - The object with readonly fields.\n * @returns The same object but with a type that makes all fields mutable.\n */\nexport function asMutable<T>(readonly: T): Mutable<T> {\n\treturn readonly as Mutable<T>;\n}\n\nexport const clone = structuredClone;\n\n/**\n * Checks whether or not the given object is a `readonly` array.\n *\n * Note that this does NOT indicate if a given array should be treated as readonly.\n * This instead indicates if an object is an Array, and is typed to tolerate the readonly case.\n */\nexport function isReadonlyArray<T>(x: readonly T[] | unknown): x is readonly T[] {\n\t// `Array.isArray()` does not properly narrow `readonly` array types by itself,\n\t// so we wrap it in this type guard. This may become unnecessary if/when\n\t// https://github.com/microsoft/TypeScript/issues/17002 is resolved.\n\treturn Array.isArray(x);\n}\n\n/**\n * Creates and populates a new array.\n * @param size - The size of the array to be created.\n * @param filler - Callback for populating the array with a value for a given index\n */\nexport function makeArray<T>(size: number, filler: (index: number) => T): T[] {\n\tconst array = [];\n\tfor (let i = 0; i < size; ++i) {\n\t\tarray.push(filler(i));\n\t}\n\treturn array;\n}\n\n/**\n * Returns the last element of an array, or `undefined` if the array has no elements.\n * @param array - The array to get the last element from.\n * @remarks\n * If the type of the array has been narrowed by e.g. {@link hasSome | hasSome(array)} or {@link hasSingle | hasOne(array)} then the return type will be `T` rather than `T | undefined`.\n */\nexport function getLast<T>(array: readonly [T, ...T[]]): T;\nexport function getLast<T>(array: { [index: number]: T; length: number }): T | undefined;\nexport function getLast<T>(array: { [index: number]: T; length: number }): T | undefined {\n\treturn array[array.length - 1];\n}\n\n/**\n * Returns true if and only if the given array has at least one element.\n * @param array - The array to check.\n * @remarks\n * If `array` contains at least one element, its type will be narrowed and can benefit from improved typing from e.g. `array[0]` and {@link getLast | getLast(array)}.\n * This is especially useful when \"noUncheckedIndexedAccess\" is enabled in the TypeScript compiler options, since the return type of `array[0]` will be `T` rather than `T | undefined`.\n */\nexport function hasSome<T>(array: T[]): array is [T, ...T[]];\nexport function hasSome<T>(array: readonly T[]): array is readonly [T, ...T[]];\nexport function hasSome<T>(array: readonly T[]): array is [T, ...T[]] {\n\treturn array.length > 0;\n}\n\n/**\n * Returns true if and only if the given iterable has at least one element.\n */\nexport function iterableHasSome<T>(iterable: Iterable<T>): boolean {\n\treturn iterable[Symbol.iterator]().next().done === false;\n}\n\n/**\n * Returns the value from the given iterable if it contains exactly one item, otherwise `undefined`.\n * @remarks\n * Note that if the iterable itself may contain `undefined` values,\n * it is not possible to use this to distinguish between an iterable that contains exactly one `undefined` value and an iterable that contains zero or multiple values.\n */\nexport function oneFromIterable<T>(items: Iterable<T>): T | undefined {\n\tconst iterator = items[Symbol.iterator]();\n\tconst first = iterator.next();\n\tif (first.done === true) {\n\t\t// Empty iterable case.\n\t\treturn undefined;\n\t}\n\tconst second = iterator.next();\n\tif (second.done === true) {\n\t\t// Single item iterable case.\n\t\treturn first.value;\n\t}\n\t// Multiple item iterable case.\n\treturn undefined;\n}\n\n/**\n * Returns true if and only if the given array has exactly one element.\n * @param array - The array to check.\n * @remarks\n * If `array` contains exactly one element, its type will be narrowed and can benefit from improved typing from e.g. `array[0]` and {@link getLast | getLast(array)}.\n * This is especially useful when \"noUncheckedIndexedAccess\" is enabled in the TypeScript compiler options, since the return type of `array[0]` will be `T` rather than `T | undefined`.\n */\nexport function hasSingle<T>(array: T[]): array is [T];\nexport function hasSingle<T>(array: readonly T[]): array is readonly [T];\nexport function hasSingle<T>(array: readonly T[]): array is [T] {\n\treturn array.length === 1;\n}\n\n/**\n * Compares two sets using callbacks.\n * Early returns on first false comparison.\n *\n * @param a - One Set.\n * @param b - The other Set.\n * @param aExtra - Called for items in `a` but not `b`.\n * @param bExtra - Called for items in `b` but not `a`.\n * @param same - Called for items in `a` and `b`.\n * @returns false iff any of the call backs returned false.\n */\nexport function compareSets<T>({\n\ta,\n\tb,\n\taExtra,\n\tbExtra,\n\tsame,\n}: {\n\ta: ReadonlySet<T> | ReadonlyMap<T, unknown>;\n\tb: ReadonlySet<T> | ReadonlyMap<T, unknown>;\n\taExtra?: (t: T) => boolean;\n\tbExtra?: (t: T) => boolean;\n\tsame?: (t: T) => boolean;\n}): boolean {\n\tfor (const item of a.keys()) {\n\t\tif (b.has(item)) {\n\t\t\tif (same !== undefined && !same(item)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tif (aExtra === undefined) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\tif (!aExtra(item)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfor (const item of b.keys()) {\n\t\tif (a.has(item)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (bExtra === undefined) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tif (!bExtra(item)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * Sets the value at `key` in map to value if not already present.\n * Returns the value at `key` after setting it.\n * This is equivalent to a get or default that adds the default to the map.\n */\nexport function getOrAddInMap<Key, Value>(\n\tmap: MapGetSet<Key, Value>,\n\tkey: Key,\n\tvalue: Value,\n): Value {\n\tconst currentValue = map.get(key);\n\tif (currentValue !== undefined) {\n\t\treturn currentValue;\n\t}\n\tmap.set(key, value);\n\treturn value;\n}\n\n/**\n * Retrieve a value from a map with the given key, or create a new entry if the key is not in the map.\n * @param map - The map to query/update\n * @param key - The key to lookup in the map\n * @param defaultValue - a function which returns a default value. This is called and used to set an initial value for the given key in the map if none exists\n * @returns either the existing value for the given key, or the newly-created value (the result of `defaultValue`)\n */\nexport function getOrCreate<K, V>(\n\tmap: MapGetSet<K, V>,\n\tkey: K,\n\tdefaultValue: (key: K) => V,\n): V {\n\tlet value = map.get(key);\n\tif (value === undefined) {\n\t\tvalue = defaultValue(key);\n\t\tmap.set(key, value);\n\t}\n\treturn value;\n}\n\n/**\n * Utility for dictionaries whose values are lists.\n * Gets the list associated with the provided key, if it exists.\n * Otherwise, creates an entry with an empty list, and returns that list.\n */\nexport function getOrAddEmptyToMap<K, V>(map: MapGetSet<K, V[]>, key: K): V[] {\n\tlet collection = map.get(key);\n\tif (collection === undefined) {\n\t\tcollection = [];\n\t\tmap.set(key, collection);\n\t}\n\treturn collection;\n}\n\n/**\n * Map one iterable to another by transforming each element one at a time\n * @param iterable - the iterable to transform\n * @param map - the transformation function to run on each element of the iterable\n * @returns a new iterable of elements which have been transformed by the `map` function\n */\nexport function* mapIterable<T, U>(\n\titerable: Iterable<T>,\n\tmap: (t: T) => U,\n): IterableIterator<U> {\n\tfor (const t of iterable) {\n\t\tyield map(t);\n\t}\n}\n\n/**\n * Filter one iterable into another\n * @param iterable - the iterable to filter\n * @param filter - the predicate function to run on each element of the iterable\n * @returns a new iterable including only the elements that passed the filter predicate\n */\nexport function* filterIterable<T>(\n\titerable: Iterable<T>,\n\tfilter: (t: T) => boolean,\n): IterableIterator<T> {\n\tfor (const t of iterable) {\n\t\tif (filter(t)) {\n\t\t\tyield t;\n\t\t}\n\t}\n}\n\n/**\n * Finds the first element in the given iterable that satisfies a predicate.\n * @param iterable - The iterable to search for an eligible element\n * @param predicate - The predicate to run against each element\n * @returns The first element in the iterable that satisfies the predicate, or undefined if the iterable contains no such element\n */\nexport function find<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): T | undefined {\n\tfor (const t of iterable) {\n\t\tif (predicate(t)) {\n\t\t\treturn t;\n\t\t}\n\t}\n}\n\n/**\n * Counts the number of elements in the given iterable.\n * @param iterable - the iterable to enumerate\n * @returns the number of elements that were iterated after exhausting the iterable\n */\nexport function count(iterable: Iterable<unknown>): number {\n\tlet n = 0;\n\tfor (const _ of iterable) {\n\t\tn += 1;\n\t}\n\treturn n;\n}\n\n/**\n * Use for Json compatible data.\n *\n * @typeparam TExtra - Type permitted in addition to the normal JSON types.\n * Commonly used for to allow {@link @fluidframework/core-interfaces#IFluidHandle} within the otherwise JSON compatible content.\n *\n * @remarks\n * This does not robustly forbid non json comparable data via type checking,\n * but instead mostly restricts access to it.\n *\n * @privateRemarks\n * TODO (before promoting to public): consider moving this to a more general location - this isn't SharedTree-specific.\n *\n * @beta\n */\nexport type JsonCompatible<TExtra = never> =\n\t| string\n\t| number\n\t| boolean\n\t// eslint-disable-next-line @rushstack/no-new-null\n\t| null\n\t| JsonCompatible<TExtra>[]\n\t| JsonCompatibleObject<TExtra>\n\t| TExtra;\n\n/**\n * Use for Json object compatible data.\n *\n * @remarks\n * This does not robustly forbid non json comparable data via type checking,\n * but instead mostly restricts access to it.\n *\n * @privateRemarks\n * TODO (before promoting to public): consider moving this to a more general location - this isn't SharedTree-specific.\n *\n * @beta\n */\nexport type JsonCompatibleObject<TExtra = never> = { [P in string]?: JsonCompatible<TExtra> };\n\n/**\n * Use for readonly view of Json compatible data.\n * @remarks\n * This does not robustly forbid non json comparable data via type checking,\n * but instead mostly restricts access to it.\n * @alpha\n */\nexport type JsonCompatibleReadOnly =\n\t| string\n\t| number\n\t| boolean\n\t// eslint-disable-next-line @rushstack/no-new-null\n\t| null\n\t| readonly JsonCompatibleReadOnly[]\n\t| JsonCompatibleReadOnlyObject;\n\n/**\n * Use for readonly view of Json compatible data.\n * @remarks\n * This does not robustly forbid non json comparable data via type checking,\n * but instead mostly restricts access to it.\n * @alpha\n */\nexport type JsonCompatibleReadOnlyObject = { readonly [P in string]?: JsonCompatibleReadOnly };\n\n/**\n * @remarks TODO: Audit usage of this type in schemas, evaluating whether it is necessary and performance\n * of alternatives.\n *\n * True \"arbitrary serializable data\" is probably fine, but some persisted types declarations might be better\n * expressed using composition of schemas for runtime validation, even if we don't think making the types\n * generic is worth the maintenance cost.\n */\nexport const JsonCompatibleReadOnlySchema = Type.Any();\n\n/**\n * Returns if a particular json compatible value is an object.\n * Does not include `null` or arrays.\n */\nexport function isJsonObject(\n\tvalue: JsonCompatibleReadOnly,\n): value is { readonly [P in string]?: JsonCompatibleReadOnly } {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/**\n * Verifies that the supplied indices are valid within the supplied array.\n * @param startIndex - The starting index in the range. Must be in [0, length).\n * @param endIndex - The ending index in the range. Must be within (start, length].\n * @param array - The array the indices refer to\n */\nexport function assertValidRangeIndices(\n\tstartIndex: number,\n\tendIndex: number,\n\tarray: { readonly length: number },\n): void {\n\tassert(endIndex >= startIndex, 0x79c /* Range indices are malformed. */);\n\tassertValidIndex(startIndex, array, false);\n\tassertValidIndex(endIndex, array, true);\n}\n\nexport function assertValidIndex(\n\tindex: number,\n\tarray: { readonly length: number },\n\tallowOnePastEnd: boolean = false,\n): void {\n\tassertNonNegativeSafeInteger(index);\n\tif (allowOnePastEnd) {\n\t\tassert(index <= array.length, 0x378 /* index must be less than or equal to length */);\n\t} else {\n\t\tassert(index < array.length, 0x379 /* index must be less than length */);\n\t}\n}\n\nexport function assertValidRange(\n\t{ start, end }: { start: number; end: number },\n\tarray: { readonly length: number },\n): void {\n\tassertNonNegativeSafeInteger(start);\n\tassertNonNegativeSafeInteger(end);\n\tassert(end <= array.length, 0x79d /* Range end must be less than or equal to length */);\n\tassert(start <= end, 0x79e /* Range start must be less than or equal to range start */);\n}\n\nexport function assertNonNegativeSafeInteger(index: number): void {\n\tassert(Number.isSafeInteger(index), 0x376 /* index must be an integer */);\n\tassert(index >= 0, 0x377 /* index must be non-negative */);\n}\n\n/**\n * Convert an object into a Map.\n *\n * This function must only be used with objects specifically intended to encode map like information.\n * The only time such objects should be used is for encoding maps as object literals to allow for developer ergonomics or JSON compatibility.\n * Even those two use-cases need to be carefully considered as using objects as maps can have a lot of issues\n * (including but not limited to unintended access to __proto__ and other non-owned keys).\n * This function helps these few cases get into using an actual map in as safe of was as is practical.\n */\nexport function objectToMap<MapKey extends string | number | symbol, MapValue>(\n\tobjectMap: Record<MapKey, MapValue>,\n): Map<MapKey, MapValue> {\n\tconst map = new Map<MapKey, MapValue>();\n\t// This function must only be used with objects specifically intended to encode map like information.\n\tfor (const key of Object.keys(objectMap)) {\n\t\tconst element = objectMap[key as MapKey];\n\t\tmap.set(key as MapKey, element);\n\t}\n\treturn map;\n}\n\n/**\n * Convert an object used as a map into a new object used like a map.\n *\n * @remarks\n * This function must only be used with objects specifically intended to encode map like information.\n * The only time such objects should be used is for encoding maps as object literals to allow for developer ergonomics or JSON compatibility.\n * Even those two use-cases need to be carefully considered as using objects as maps can have a lot of issues\n * (including but not limited to unintended access to __proto__ and other non-owned keys).\n * {@link objectToMap} helps these few cases get into using an actual map in as safe of a way as is practical.\n */\nexport function transformObjectMap<\n\tMapKey extends string | number | symbol,\n\tMapValue,\n\tNewMapValue,\n>(\n\tobjectMap: Record<MapKey, MapValue>,\n\ttransformer: (value: MapValue, key: MapKey) => NewMapValue,\n): Record<MapKey, MapValue> {\n\tconst output: Record<MapKey, MapValue> = Object.create(null);\n\t// This function must only be used with objects specifically intended to encode map like information.\n\tfor (const key of Object.keys(objectMap)) {\n\t\tconst element = objectMap[key as MapKey];\n\t\tObject.defineProperty(output, key, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\twritable: true,\n\t\t\tvalue: transformer(element, key as MapKey),\n\t\t});\n\t}\n\treturn output;\n}\n\n/**\n * Make an inverted copy of a map.\n *\n * @returns a map which can look up the keys from the values of the original map.\n */\nexport function invertMap<Key, Value>(input: Map<Key, Value>): Map<Value, Key> {\n\tconst result = new Map<Value, Key>(mapIterable(input, ([key, value]) => [value, key]));\n\tassert(\n\t\tresult.size === input.size,\n\t\t0x88a /* all values in a map must be unique to invert it */,\n\t);\n\treturn result;\n}\n\n/**\n * Type with a name describing what it is.\n * Typically used with values (like schema) that can be stored in a map, but in some representations have their name/key as a field.\n */\nexport interface Named<TName> {\n\treadonly name: TName;\n}\n\n/**\n * Order {@link Named} objects by their name.\n */\nexport function compareNamed(a: Named<string>, b: Named<string>): -1 | 0 | 1 {\n\tif (a.name < b.name) {\n\t\treturn -1;\n\t}\n\tif (a.name > b.name) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\n/**\n * Placeholder for `Symbol.dispose`.\n * @privateRemarks\n * TODO: replace this with `Symbol.dispose` when it is available or make it a valid polyfill.\n */\nexport const disposeSymbol: unique symbol = Symbol(\"Symbol.dispose placeholder\");\n\n/**\n * An object with an explicit lifetime that can be ended.\n * @privateRemarks\n * Simpler alternative to core-utils/IDisposable for internal use in this package.\n * This avoids adding a named \"dispose\" method, and will eventually be replaced with\n * {@link https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html#using-declarations-and-explicit-resource-management| TypeScript's Disposable}.\n *\n * Once this is replaced with TypeScript's Disposable, core-utils/IDisposable can extend it, bringing the APIs into a reasonable alignment.\n */\nexport interface IDisposable {\n\t/**\n\t * Call to end the lifetime of this object.\n\t *\n\t * It is invalid to use this object after this,\n\t * except for operations which explicitly document they are valid after disposal.\n\t *\n\t * @remarks\n\t * May cleanup resources retained by this object.\n\t * Often includes un-registering from events and thus preventing other objects from retaining a reference to this indefinably.\n\t *\n\t * Usually the only operations allowed after disposal are querying if an object is already disposed,\n\t * but this can vary between implementations.\n\t */\n\t[disposeSymbol](): void;\n}\n\n/**\n * Capitalize a string.\n */\nexport function capitalize<S extends string>(s: S): Capitalize<S> {\n\t// To avoid splitting characters which are made of multiple UTF-16 code units,\n\t// use iteration instead of indexing to separate the first character.\n\tconst iterated = s[Symbol.iterator]().next();\n\tif (iterated.done === true) {\n\t\t// Empty string case.\n\t\treturn \"\" as Capitalize<S>;\n\t}\n\n\treturn (iterated.value.toUpperCase() + s.slice(iterated.value.length)) as Capitalize<S>;\n}\n\n/**\n * Compares strings lexically to form a strict partial ordering.\n */\nexport function compareStrings<T extends string>(a: T, b: T): number {\n\treturn a > b ? 1 : a === b ? 0 : -1;\n}\n\n/**\n * Defines a property on an object that is lazily initialized and cached.\n * @remarks This is useful for properties that are expensive to compute and it is not guaranteed that they will be accessed.\n * This function initially defines a getter on the object, but after first read it replaces the getter with a value property.\n * @param obj - The object on which to define the property.\n * @param key - The key of the property to define.\n * @param get - The function (called either once or not at all) to compute the value of the property.\n * @returns `obj`, typed such that it has the new property.\n * This allows for the new property to be read off of `obj` in a type-safe manner after calling this function.\n */\nexport function defineLazyCachedProperty<\n\tT extends object,\n\tK extends string | number | symbol,\n\tV,\n>(obj: T, key: K, get: () => V): typeof obj & { [P in K]: V } {\n\tReflect.defineProperty(obj, key, {\n\t\tget() {\n\t\t\tconst value = get();\n\t\t\tReflect.defineProperty(obj, key, { value });\n\t\t\treturn value;\n\t\t},\n\t\tconfigurable: true,\n\t});\n\treturn obj as typeof obj & { [P in K]: V };\n}\n\n/**\n * Copies a given property from one object to another if and only if the property is defined.\n * @param source - The object to copy the property from.\n * If `source` is undefined or does not have the property defined, then this function will do nothing.\n * @param property - The property to copy.\n * @param destination - The object to copy the property to.\n * @remarks This function is useful for copying properties from one object to another while minimizing the presence of `undefined` values.\n * If `property` is not present on `source` - or if `property` is present, but has a value of `undefined` - then this function will not modify `destination`.\n * This is different from doing `destination.foo = source.foo`, which would define a `\"foo\"` property on `destination` with the value `undefined`.\n *\n * If the type of `source` is known to have `property`, then this function asserts that the type of `destination` has `property` as well after the call.\n *\n * This function first reads the property value (if present) from `source` and then sets it on `destination`, as opposed to e.g. directly copying the property descriptor.\n * @privateRemarks The first overload of this function allows auto-complete to suggest property names from `source`, but by having the second overload we still allow for arbitrary property names.\n */\nexport function copyPropertyIfDefined<S extends object, K extends keyof S, D extends object>(\n\tsource: S | undefined,\n\tproperty: K,\n\tdestination: D,\n): asserts destination is K extends keyof S ? D & { [P in K]: S[K] } : D;\nexport function copyPropertyIfDefined<\n\tS extends object,\n\tK extends string | number | symbol,\n\tD extends object,\n>(\n\tsource: S | undefined,\n\tproperty: K,\n\tdestination: D,\n): asserts destination is K extends keyof S ? D & { [P in K]: S[K] } : D;\nexport function copyPropertyIfDefined<\n\tS extends object,\n\tK extends string | number | symbol,\n\tD extends object,\n>(\n\tsource: S | undefined,\n\tproperty: K,\n\tdestination: D,\n): asserts destination is K extends keyof S ? D & { [P in K]: S[K] } : D {\n\tif (source !== undefined) {\n\t\tconst value = (source as { [P in K]?: unknown })[property];\n\t\tif (value !== undefined) {\n\t\t\t(destination as { [P in K]: unknown })[property] = value;\n\t\t}\n\t}\n}\n\n/**\n * Reduces an array of values into a single value.\n * This is similar to `Array.prototype.reduce`,\n * except that it recursively reduces the left and right halves of the input before reducing their respective reductions.\n *\n * When compared with an approach like reducing all the values left-to-right,\n * this balanced approach is beneficial when the cost of invoking `callbackFn` is proportional to the number reduced values that its parameters collectively represent.\n * For example, if `T` is an array, and `callbackFn` concatenates its inputs,\n * then `balancedReduce` will have O(N*log(N)) time complexity instead of `Array.prototype.reduce`'s O(N²).\n * However, if `callbackFn` is O(1) then both `balancedReduce` and `Array.prototype.reduce` will have O(N) complexity.\n *\n * @param array - The array to reduce.\n * @param callbackFn - The function to execute for each pairwise reduction.\n * @param emptyCase - A factory function that provides the value to return if the input array is empty.\n */\nexport function balancedReduce<T>(\n\tarray: readonly T[],\n\tcallbackFn: (left: T, right: T) => T,\n\temptyCase: () => T,\n): T {\n\tif (hasSingle(array)) {\n\t\treturn array[0];\n\t}\n\tif (!hasSome(array)) {\n\t\treturn emptyCase();\n\t}\n\tconst mid = Math.floor(array.length / 2);\n\tconst left = balancedReduce(array.slice(0, mid), callbackFn, emptyCase);\n\tconst right = balancedReduce(array.slice(mid), callbackFn, emptyCase);\n\treturn callbackFn(left, right);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/tree",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.81.0-374083",
|
|
4
4
|
"description": "Distributed tree",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -101,17 +101,17 @@
|
|
|
101
101
|
"temp-directory": "nyc/.nyc_output"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
|
-
"@fluid-internal/client-utils": "
|
|
105
|
-
"@fluidframework/container-runtime": "
|
|
106
|
-
"@fluidframework/core-interfaces": "
|
|
107
|
-
"@fluidframework/core-utils": "
|
|
108
|
-
"@fluidframework/datastore-definitions": "
|
|
109
|
-
"@fluidframework/driver-definitions": "
|
|
110
|
-
"@fluidframework/id-compressor": "
|
|
111
|
-
"@fluidframework/runtime-definitions": "
|
|
112
|
-
"@fluidframework/runtime-utils": "
|
|
113
|
-
"@fluidframework/shared-object-base": "
|
|
114
|
-
"@fluidframework/telemetry-utils": "
|
|
104
|
+
"@fluid-internal/client-utils": "2.81.0-374083",
|
|
105
|
+
"@fluidframework/container-runtime": "2.81.0-374083",
|
|
106
|
+
"@fluidframework/core-interfaces": "2.81.0-374083",
|
|
107
|
+
"@fluidframework/core-utils": "2.81.0-374083",
|
|
108
|
+
"@fluidframework/datastore-definitions": "2.81.0-374083",
|
|
109
|
+
"@fluidframework/driver-definitions": "2.81.0-374083",
|
|
110
|
+
"@fluidframework/id-compressor": "2.81.0-374083",
|
|
111
|
+
"@fluidframework/runtime-definitions": "2.81.0-374083",
|
|
112
|
+
"@fluidframework/runtime-utils": "2.81.0-374083",
|
|
113
|
+
"@fluidframework/shared-object-base": "2.81.0-374083",
|
|
114
|
+
"@fluidframework/telemetry-utils": "2.81.0-374083",
|
|
115
115
|
"@sinclair/typebox": "^0.34.13",
|
|
116
116
|
"@tylerbu/sorted-btree-es6": "^1.8.0",
|
|
117
117
|
"@types/ungap__structured-clone": "^1.2.0",
|
|
@@ -120,42 +120,42 @@
|
|
|
120
120
|
"uuid": "^11.1.0"
|
|
121
121
|
},
|
|
122
122
|
"devDependencies": {
|
|
123
|
-
"@arethetypeswrong/cli": "^0.
|
|
123
|
+
"@arethetypeswrong/cli": "^0.18.2",
|
|
124
124
|
"@biomejs/biome": "~1.9.3",
|
|
125
|
-
"@fluid-internal/mocha-test-setup": "
|
|
126
|
-
"@fluid-private/stochastic-test-utils": "
|
|
127
|
-
"@fluid-private/test-dds-utils": "
|
|
128
|
-
"@fluid-private/test-drivers": "
|
|
129
|
-
"@fluid-tools/benchmark": "^0.
|
|
130
|
-
"@fluid-tools/build-cli": "^0.
|
|
125
|
+
"@fluid-internal/mocha-test-setup": "2.81.0-374083",
|
|
126
|
+
"@fluid-private/stochastic-test-utils": "2.81.0-374083",
|
|
127
|
+
"@fluid-private/test-dds-utils": "2.81.0-374083",
|
|
128
|
+
"@fluid-private/test-drivers": "2.81.0-374083",
|
|
129
|
+
"@fluid-tools/benchmark": "^0.52.0",
|
|
130
|
+
"@fluid-tools/build-cli": "^0.63.0",
|
|
131
131
|
"@fluidframework/build-common": "^2.0.3",
|
|
132
|
-
"@fluidframework/build-tools": "^0.
|
|
133
|
-
"@fluidframework/container-definitions": "
|
|
134
|
-
"@fluidframework/container-loader": "
|
|
135
|
-
"@fluidframework/eslint-config-fluid": "
|
|
136
|
-
"@fluidframework/test-runtime-utils": "
|
|
137
|
-
"@fluidframework/test-utils": "
|
|
138
|
-
"@fluidframework/tree-previous": "npm:@fluidframework/tree@2.
|
|
132
|
+
"@fluidframework/build-tools": "^0.63.0",
|
|
133
|
+
"@fluidframework/container-definitions": "2.81.0-374083",
|
|
134
|
+
"@fluidframework/container-loader": "2.81.0-374083",
|
|
135
|
+
"@fluidframework/eslint-config-fluid": "2.81.0-374083",
|
|
136
|
+
"@fluidframework/test-runtime-utils": "2.81.0-374083",
|
|
137
|
+
"@fluidframework/test-utils": "2.81.0-374083",
|
|
138
|
+
"@fluidframework/tree-previous": "npm:@fluidframework/tree@2.80.0",
|
|
139
139
|
"@microsoft/api-extractor": "7.52.11",
|
|
140
140
|
"@types/diff": "^3.5.1",
|
|
141
141
|
"@types/easy-table": "^0.0.32",
|
|
142
142
|
"@types/mocha": "^10.0.10",
|
|
143
143
|
"@types/node": "^18.19.0",
|
|
144
|
-
"ajv": "^8.
|
|
144
|
+
"ajv": "^8.17.1",
|
|
145
145
|
"ajv-formats": "^3.0.1",
|
|
146
146
|
"c8": "^10.1.3",
|
|
147
|
-
"concurrently": "^
|
|
147
|
+
"concurrently": "^9.2.1",
|
|
148
148
|
"copyfiles": "^2.4.1",
|
|
149
|
-
"cross-env": "^
|
|
150
|
-
"dependency-cruiser": "^17.
|
|
149
|
+
"cross-env": "^10.1.0",
|
|
150
|
+
"dependency-cruiser": "^17.3.2",
|
|
151
151
|
"diff": "^3.5.0",
|
|
152
|
-
"easy-table": "^1.
|
|
153
|
-
"eslint": "~
|
|
152
|
+
"easy-table": "^1.2.0",
|
|
153
|
+
"eslint": "~9.39.1",
|
|
154
154
|
"eslint-config-prettier": "~10.1.8",
|
|
155
155
|
"jiti": "^2.6.1",
|
|
156
156
|
"mocha": "^10.8.2",
|
|
157
157
|
"mocha-multi-reporters": "^1.5.1",
|
|
158
|
-
"rimraf": "^
|
|
158
|
+
"rimraf": "^6.1.2",
|
|
159
159
|
"typescript": "~5.4.5"
|
|
160
160
|
},
|
|
161
161
|
"fluidBuild": {
|
package/src/codec/codec.ts
CHANGED
|
@@ -154,6 +154,18 @@ export interface CodecWriteOptions extends ICodecOptions {
|
|
|
154
154
|
* the data's format should be versioned and if they can't handle the format they should error.
|
|
155
155
|
*/
|
|
156
156
|
readonly minVersionForCollab: MinimumVersionForCollab;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Overrides the version of the codec to use for encoding.
|
|
160
|
+
* @remarks
|
|
161
|
+
* Without an override, the selected version will be based on {@link CodecWriteOptions.minVersionForCollab}.
|
|
162
|
+
*/
|
|
163
|
+
readonly writeVersionOverrides?: ReadonlyMap<CodecName, FormatVersion>;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* If true, suppress errors when `writeVersionOverrides` selects a version which may not be compatible with the {@link CodecWriteOptions.minVersionForCollab}.
|
|
167
|
+
*/
|
|
168
|
+
readonly allowPossiblyIncompatibleWriteVersionOverrides?: boolean;
|
|
157
169
|
}
|
|
158
170
|
|
|
159
171
|
/**
|
|
@@ -252,13 +264,22 @@ export interface ICodecFamily<TDecoded, TContext = void> {
|
|
|
252
264
|
|
|
253
265
|
/**
|
|
254
266
|
* A version stamp for encoded data.
|
|
255
|
-
*
|
|
267
|
+
* @remarks
|
|
256
268
|
* Strings are used for formats that are not yet officially supported.
|
|
257
269
|
* When such formats become officially supported/stable, they will be switched to using a number.
|
|
258
270
|
* Undefined is tolerated to enable the scenario where data was not initially versioned.
|
|
271
|
+
* @alpha
|
|
259
272
|
*/
|
|
260
273
|
export type FormatVersion = number | string | undefined;
|
|
261
274
|
|
|
275
|
+
/**
|
|
276
|
+
* A unique name given to this codec family.
|
|
277
|
+
* @remarks
|
|
278
|
+
* This is not persisted: it is only used to specify version overrides and in errors.
|
|
279
|
+
* @alpha
|
|
280
|
+
*/
|
|
281
|
+
export type CodecName = string;
|
|
282
|
+
|
|
262
283
|
/**
|
|
263
284
|
* A format version which is dependent on some parent format version.
|
|
264
285
|
*/
|
|
@@ -374,9 +395,13 @@ function isJsonCodec<TDecoded, TContext>(
|
|
|
374
395
|
* Constructs a {@link IMultiFormatCodec} from a `IJsonCodec` using a generic binary encoding that simply writes
|
|
375
396
|
* the json representation of the object to a buffer.
|
|
376
397
|
*/
|
|
377
|
-
export function withDefaultBinaryEncoding<
|
|
378
|
-
|
|
379
|
-
|
|
398
|
+
export function withDefaultBinaryEncoding<
|
|
399
|
+
TDecoded,
|
|
400
|
+
TContext,
|
|
401
|
+
TEncoded extends JsonCompatibleReadOnly = JsonCompatibleReadOnly,
|
|
402
|
+
>(
|
|
403
|
+
jsonCodec: IJsonCodec<TDecoded, TEncoded, JsonCompatibleReadOnly, TContext>,
|
|
404
|
+
): IMultiFormatCodec<TDecoded, TEncoded, JsonCompatibleReadOnly, TContext> {
|
|
380
405
|
return {
|
|
381
406
|
json: jsonCodec,
|
|
382
407
|
binary: new DefaultBinaryCodec(jsonCodec),
|
|
@@ -387,11 +412,15 @@ export function withDefaultBinaryEncoding<TDecoded, TContext>(
|
|
|
387
412
|
* Ensures that the provided single or multi-format codec has a binary encoding.
|
|
388
413
|
* Adapts the json encoding using {@link withDefaultBinaryEncoding} if necessary.
|
|
389
414
|
*/
|
|
390
|
-
export function ensureBinaryEncoding<
|
|
415
|
+
export function ensureBinaryEncoding<
|
|
416
|
+
TDecoded,
|
|
417
|
+
TContext,
|
|
418
|
+
TEncoded extends JsonCompatibleReadOnly = JsonCompatibleReadOnly,
|
|
419
|
+
>(
|
|
391
420
|
codec:
|
|
392
|
-
| IMultiFormatCodec<TDecoded,
|
|
393
|
-
| IJsonCodec<TDecoded,
|
|
394
|
-
): IMultiFormatCodec<TDecoded,
|
|
421
|
+
| IMultiFormatCodec<TDecoded, TEncoded, JsonCompatibleReadOnly, TContext>
|
|
422
|
+
| IJsonCodec<TDecoded, TEncoded, JsonCompatibleReadOnly, TContext>,
|
|
423
|
+
): IMultiFormatCodec<TDecoded, TEncoded, JsonCompatibleReadOnly, TContext> {
|
|
395
424
|
return isJsonCodec(codec) ? withDefaultBinaryEncoding(codec) : codec;
|
|
396
425
|
}
|
|
397
426
|
|
|
@@ -548,6 +577,17 @@ export const FluidClientVersion = {
|
|
|
548
577
|
* - ForestSummaryFormatVersion.v3 - written when minVersionForCollab \>= 2.74
|
|
549
578
|
*/
|
|
550
579
|
v2_74: "2.74.0",
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* Fluid Framework Client 2.80 and newer.
|
|
583
|
+
* @remarks
|
|
584
|
+
* New formats introduced in 2.80:
|
|
585
|
+
* - MessageFormatVersion.v6 - written when minVersionForCollab \>= 2.80
|
|
586
|
+
* - EditManagerFormatVersion.v6 - written when minVersionForCollab \>= 2.80
|
|
587
|
+
* - SharedTreeChangeFormatVersion.v5 - written when minVersionForCollab \>= 2.80
|
|
588
|
+
* - ModularChangeFormatVersion.v5 - written when minVersionForCollab \>= 2.80
|
|
589
|
+
*/
|
|
590
|
+
v2_80: "2.80.0",
|
|
551
591
|
} as const satisfies Record<string, MinimumVersionForCollab>;
|
|
552
592
|
|
|
553
593
|
/**
|
package/src/codec/index.ts
CHANGED
|
@@ -28,6 +28,7 @@ export {
|
|
|
28
28
|
type CodecTree,
|
|
29
29
|
jsonableCodecTree,
|
|
30
30
|
extractJsonValidator,
|
|
31
|
+
type CodecName,
|
|
31
32
|
} from "./codec.js";
|
|
32
33
|
export {
|
|
33
34
|
DiscriminatedUnionDispatcher,
|
|
@@ -36,8 +37,10 @@ export {
|
|
|
36
37
|
} from "./discriminatedUnions.js";
|
|
37
38
|
export {
|
|
38
39
|
Versioned,
|
|
39
|
-
makeVersionedCodec,
|
|
40
40
|
makeVersionedValidatedCodec,
|
|
41
41
|
makeVersionDispatchingCodec,
|
|
42
42
|
makeDiscontinuedCodecVersion,
|
|
43
|
+
ClientVersionDispatchingCodecBuilder,
|
|
44
|
+
type CodecVersion,
|
|
45
|
+
type CodecAndSchema,
|
|
43
46
|
} from "./versioned/index.js";
|