@fluidframework/tree 2.1.0-281041 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mocharc.customBenchmarks.cjs +33 -0
- package/.vscode/Tree.code-workspace +2 -1
- package/CHANGELOG.md +335 -0
- package/README.md +40 -10
- package/api-extractor.json +17 -0
- package/api-report/tree.alpha.api.md +120 -26
- package/api-report/tree.beta.api.md +52 -26
- package/api-report/tree.public.api.md +52 -26
- package/dist/beta.d.ts +3 -1
- package/dist/codec/discriminatedUnions.d.ts +11 -5
- package/dist/codec/discriminatedUnions.d.ts.map +1 -1
- package/dist/codec/discriminatedUnions.js.map +1 -1
- package/dist/codec/index.d.ts +1 -1
- package/dist/codec/index.d.ts.map +1 -1
- package/dist/codec/index.js.map +1 -1
- package/dist/core/forest/editableForest.d.ts +1 -5
- package/dist/core/forest/editableForest.d.ts.map +1 -1
- package/dist/core/forest/editableForest.js +4 -2
- package/dist/core/forest/editableForest.js.map +1 -1
- package/dist/core/forest/forest.d.ts +0 -6
- package/dist/core/forest/forest.d.ts.map +1 -1
- package/dist/core/forest/forest.js +0 -2
- package/dist/core/forest/forest.js.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -4
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/changeRebaser.d.ts +0 -4
- 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 +1 -1
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js +1 -3
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +1 -8
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +1 -9
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/rebase/utils.d.ts +0 -1
- package/dist/core/rebase/utils.d.ts.map +1 -1
- package/dist/core/rebase/utils.js +12 -7
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/schema-stored/multiplicity.d.ts +0 -1
- package/dist/core/schema-stored/multiplicity.d.ts.map +1 -1
- package/dist/core/schema-stored/multiplicity.js +0 -1
- package/dist/core/schema-stored/multiplicity.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +0 -7
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +0 -4
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts +0 -3
- package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/dist/core/schema-view/view.d.ts +0 -3
- package/dist/core/schema-view/view.d.ts.map +1 -1
- package/dist/core/schema-view/view.js +0 -1
- package/dist/core/schema-view/view.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts +1 -10
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +14 -4
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/cursor.d.ts +1 -6
- package/dist/core/tree/cursor.d.ts.map +1 -1
- package/dist/core/tree/cursor.js +0 -2
- package/dist/core/tree/cursor.js.map +1 -1
- package/dist/core/tree/delta.d.ts +0 -11
- package/dist/core/tree/delta.d.ts.map +1 -1
- package/dist/core/tree/delta.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts +48 -11
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +144 -20
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodec.js +16 -6
- package/dist/core/tree/detachedFieldIndexCodec.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormat.d.ts +1 -1
- package/dist/core/tree/detachedFieldIndexFormat.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormat.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexTypes.d.ts +38 -4
- package/dist/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexTypes.js.map +1 -1
- package/dist/core/tree/index.d.ts +3 -2
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js +3 -1
- package/dist/core/tree/index.js.map +1 -1
- package/dist/core/tree/mapTree.d.ts +20 -4
- package/dist/core/tree/mapTree.d.ts.map +1 -1
- package/dist/core/tree/mapTree.js +29 -0
- package/dist/core/tree/mapTree.js.map +1 -1
- package/dist/core/tree/pathTree.d.ts +0 -11
- package/dist/core/tree/pathTree.d.ts.map +1 -1
- package/dist/core/tree/pathTree.js.map +1 -1
- package/dist/core/tree/treeTextFormat.d.ts.map +1 -1
- package/dist/core/tree/treeTextFormat.js +3 -2
- package/dist/core/tree/treeTextFormat.js.map +1 -1
- package/dist/core/tree/types.d.ts +0 -11
- package/dist/core/tree/types.d.ts.map +1 -1
- package/dist/core/tree/types.js +0 -4
- package/dist/core/tree/types.js.map +1 -1
- package/dist/core/tree/visitDelta.d.ts +3 -2
- package/dist/core/tree/visitDelta.d.ts.map +1 -1
- package/dist/core/tree/visitDelta.js +33 -17
- package/dist/core/tree/visitDelta.js.map +1 -1
- package/dist/core/tree/visitPath.d.ts +0 -2
- package/dist/core/tree/visitPath.d.ts.map +1 -1
- package/dist/core/tree/visitPath.js.map +1 -1
- package/dist/core/tree/visitorUtils.d.ts +3 -4
- package/dist/core/tree/visitorUtils.d.ts.map +1 -1
- package/dist/core/tree/visitorUtils.js +4 -4
- package/dist/core/tree/visitorUtils.js.map +1 -1
- package/dist/domains/index.d.ts +1 -1
- package/dist/domains/index.d.ts.map +1 -1
- package/dist/domains/index.js +2 -1
- package/dist/domains/index.js.map +1 -1
- package/dist/domains/json/index.d.ts +1 -1
- package/dist/domains/json/index.d.ts.map +1 -1
- package/dist/domains/json/index.js +2 -1
- package/dist/domains/json/index.js.map +1 -1
- package/dist/domains/json/jsonCursor.d.ts +36 -2
- package/dist/domains/json/jsonCursor.d.ts.map +1 -1
- package/dist/domains/json/jsonCursor.js +76 -5
- package/dist/domains/json/jsonCursor.js.map +1 -1
- package/dist/domains/json/jsonDomainSchema.d.ts +13 -3
- package/dist/domains/json/jsonDomainSchema.d.ts.map +1 -1
- package/dist/domains/json/jsonDomainSchema.js +12 -4
- package/dist/domains/json/jsonDomainSchema.js.map +1 -1
- package/dist/domains/leafDomain.d.ts +0 -1
- package/dist/domains/leafDomain.d.ts.map +1 -1
- package/dist/domains/leafDomain.js +0 -1
- package/dist/domains/leafDomain.js.map +1 -1
- package/dist/domains/schemaBuilder.d.ts +1 -7
- package/dist/domains/schemaBuilder.d.ts.map +1 -1
- package/dist/domains/schemaBuilder.js +0 -10
- package/dist/domains/schemaBuilder.js.map +1 -1
- package/dist/events/events.d.ts +0 -4
- package/dist/events/events.d.ts.map +1 -1
- package/dist/events/events.js +0 -1
- package/dist/events/events.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js +8 -3
- package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunk.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/chunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +3 -3
- 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 +7 -5
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.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 +8 -5
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +5 -3
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +12 -24
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +9 -19
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +0 -6
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +11 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultSchema.d.ts +0 -1
- package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultSchema.js +0 -1
- package/dist/feature-libraries/default-schema/defaultSchema.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js +2 -1
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts +6 -0
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js +6 -0
- package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/editableTreeBinder.d.ts +0 -67
- package/dist/feature-libraries/editableTreeBinder.d.ts.map +1 -1
- package/dist/feature-libraries/editableTreeBinder.js +6 -25
- package/dist/feature-libraries/editableTreeBinder.js.map +1 -1
- package/dist/feature-libraries/fieldGenerator.d.ts +0 -3
- package/dist/feature-libraries/fieldGenerator.d.ts.map +1 -1
- package/dist/feature-libraries/fieldGenerator.js +0 -1
- package/dist/feature-libraries/fieldGenerator.js.map +1 -1
- package/dist/feature-libraries/flex-map-tree/index.d.ts +1 -1
- package/dist/feature-libraries/flex-map-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-map-tree/index.js +2 -2
- package/dist/feature-libraries/flex-map-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts +57 -56
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +168 -217
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +0 -1
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +18 -295
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js +0 -6
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/index.d.ts +3 -2
- package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/index.js +5 -1
- package/dist/feature-libraries/flex-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +1 -2
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +9 -27
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +36 -117
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts +2 -13
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +3 -69
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/treeEvents.d.ts +0 -2
- package/dist/feature-libraries/flex-tree/treeEvents.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/treeEvents.js.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.d.ts +2 -1
- package/dist/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.js +4 -0
- package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js +2 -2
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +6 -8
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +10 -18
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.d.ts +6 -2
- package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.js +9 -1
- package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
- package/dist/feature-libraries/memoizedIdRangeAllocator.d.ts +0 -4
- package/dist/feature-libraries/memoizedIdRangeAllocator.d.ts.map +1 -1
- package/dist/feature-libraries/memoizedIdRangeAllocator.js +0 -1
- package/dist/feature-libraries/memoizedIdRangeAllocator.js.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +0 -2
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js +0 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/dist/feature-libraries/modular-schema/discrepancies.d.ts +18 -0
- package/dist/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/discrepancies.js +108 -5
- package/dist/feature-libraries/modular-schema/discrepancies.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +0 -8
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js +0 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts +1 -3
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.js +1 -2
- package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts +1 -2
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +57 -85
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js +5 -8
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindTypes.d.ts +3 -14
- package/dist/feature-libraries/modular-schema/genericFieldKindTypes.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js +6 -0
- package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +2 -1
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +40 -23
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +9 -8
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +205 -244
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +8 -14
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/dist/feature-libraries/node-key/nodeKey.d.ts +0 -4
- package/dist/feature-libraries/node-key/nodeKey.d.ts.map +1 -1
- package/dist/feature-libraries/node-key/nodeKey.js +0 -2
- package/dist/feature-libraries/node-key/nodeKey.js.map +1 -1
- package/dist/feature-libraries/node-key/nodeKeyManager.d.ts +0 -1
- package/dist/feature-libraries/node-key/nodeKeyManager.d.ts.map +1 -1
- package/dist/feature-libraries/node-key/nodeKeyManager.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts +3 -2
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +6 -14
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +6 -6
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +7 -7
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
- package/dist/feature-libraries/schemaBuilderBase.d.ts +2 -28
- package/dist/feature-libraries/schemaBuilderBase.d.ts.map +1 -1
- package/dist/feature-libraries/schemaBuilderBase.js +1 -27
- package/dist/feature-libraries/schemaBuilderBase.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +24 -21
- package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.d.ts +3 -3
- package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.js +7 -6
- package/dist/feature-libraries/sequence-field/formatV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV3.d.ts +195 -0
- package/dist/feature-libraries/sequence-field/formatV3.d.ts.map +1 -0
- package/dist/feature-libraries/sequence-field/formatV3.js +23 -0
- package/dist/feature-libraries/sequence-field/formatV3.js.map +1 -0
- package/dist/feature-libraries/sequence-field/helperTypes.d.ts +11 -0
- 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 +1 -1
- package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/index.js.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.js +21 -13
- package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
- package/dist/feature-libraries/sequence-field/markQueue.js +1 -1
- package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.js +24 -6
- package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.js +16 -3
- package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js +38 -4
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +54 -9
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +11 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +85 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js +2 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +4 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/dist/feature-libraries/sequence-field/types.d.ts +23 -4
- 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 +5 -4
- package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.js +70 -42
- package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
- package/dist/feature-libraries/storedToViewSchema.d.ts +0 -1
- package/dist/feature-libraries/storedToViewSchema.d.ts.map +1 -1
- package/dist/feature-libraries/storedToViewSchema.js +0 -1
- package/dist/feature-libraries/storedToViewSchema.js.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.d.ts +0 -6
- package/dist/feature-libraries/treeCursorUtils.d.ts.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.js +8 -6
- package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
- package/dist/feature-libraries/treeTextCursor.d.ts +0 -2
- package/dist/feature-libraries/treeTextCursor.d.ts.map +1 -1
- package/dist/feature-libraries/treeTextCursor.js +0 -2
- package/dist/feature-libraries/treeTextCursor.js.map +1 -1
- package/dist/feature-libraries/typed-schema/flexList.d.ts +0 -3
- package/dist/feature-libraries/typed-schema/flexList.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/flexList.js.map +1 -1
- package/dist/feature-libraries/typed-schema/index.d.ts +1 -1
- package/dist/feature-libraries/typed-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/index.js +1 -3
- package/dist/feature-libraries/typed-schema/index.js.map +1 -1
- package/dist/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/schemaCollection.js +0 -4
- package/dist/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +2 -41
- package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js +1 -40
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/dist/feature-libraries/typed-schema/view.d.ts +0 -1
- package/dist/feature-libraries/typed-schema/view.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/view.js.map +1 -1
- package/dist/index.d.ts +8 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -90
- package/dist/index.js.map +1 -1
- package/dist/internalTypes.d.ts +1 -1
- package/dist/internalTypes.d.ts.map +1 -1
- package/dist/internalTypes.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/public.d.ts +3 -1
- package/dist/shared-tree/schematizeTree.d.ts +2 -11
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +13 -2
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +4 -4
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +2 -2
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +9 -18
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +12 -9
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +4 -0
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +2 -2
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts +0 -2
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/treeApi.js +3 -3
- package/dist/shared-tree/treeApi.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +10 -6
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +51 -6
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree/treeView.d.ts +3 -6
- package/dist/shared-tree/treeView.d.ts.map +1 -1
- package/dist/shared-tree/treeView.js +7 -3
- package/dist/shared-tree/treeView.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +6 -0
- 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/defaultResubmitMachine.js +3 -3
- package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +1 -0
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormat.d.ts +2 -2
- package/dist/shared-tree-core/editManagerFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormat.js +6 -1
- package/dist/shared-tree-core/editManagerFormat.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +1 -0
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +4 -0
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +9 -1
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/simple-tree/api/create.d.ts +54 -0
- package/dist/simple-tree/api/create.d.ts.map +1 -0
- package/dist/simple-tree/api/create.js +99 -0
- package/dist/simple-tree/api/create.js.map +1 -0
- package/dist/simple-tree/api/index.d.ts +12 -0
- package/dist/simple-tree/api/index.d.ts.map +1 -0
- package/dist/simple-tree/api/index.js +28 -0
- package/dist/simple-tree/api/index.js.map +1 -0
- package/{lib/simple-tree → dist/simple-tree/api}/schemaCreationUtilities.d.ts +7 -4
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -0
- package/dist/simple-tree/{schemaCreationUtilities.js → api/schemaCreationUtilities.js} +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -0
- package/dist/simple-tree/{schemaFactory.d.ts → api/schemaFactory.d.ts} +15 -14
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -0
- package/dist/simple-tree/{schemaFactory.js → api/schemaFactory.js} +10 -9
- package/dist/simple-tree/api/schemaFactory.js.map +1 -0
- package/{lib/simple-tree → dist/simple-tree/api}/schemaFactoryRecursive.d.ts +40 -7
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -0
- package/dist/simple-tree/{schemaFactoryRecursive.js → api/schemaFactoryRecursive.js} +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -0
- package/dist/simple-tree/api/testRecursiveDomain.d.ts +62 -0
- package/dist/simple-tree/api/testRecursiveDomain.d.ts.map +1 -0
- package/dist/simple-tree/api/testRecursiveDomain.js.map +1 -0
- package/{lib/simple-tree → dist/simple-tree/api}/tree.d.ts +111 -20
- package/dist/simple-tree/api/tree.d.ts.map +1 -0
- package/dist/simple-tree/api/tree.js +173 -0
- package/dist/simple-tree/api/tree.js.map +1 -0
- package/dist/simple-tree/api/treeNodeApi.d.ts +87 -0
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -0
- package/dist/simple-tree/{treeNodeApi.js → api/treeNodeApi.js} +33 -33
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -0
- package/dist/simple-tree/api/verboseTree.d.ts +136 -0
- package/dist/simple-tree/api/verboseTree.d.ts.map +1 -0
- package/dist/simple-tree/api/verboseTree.js +220 -0
- package/dist/simple-tree/api/verboseTree.js.map +1 -0
- package/dist/simple-tree/arrayNode.d.ts +3 -3
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js +70 -69
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +10 -0
- package/dist/simple-tree/core/index.d.ts.map +1 -0
- package/dist/simple-tree/core/index.js +27 -0
- package/dist/simple-tree/core/index.js.map +1 -0
- package/{lib/simple-tree → dist/simple-tree/core}/schemaCaching.d.ts +2 -9
- package/dist/simple-tree/core/schemaCaching.d.ts.map +1 -0
- package/dist/simple-tree/{schemaCaching.js → core/schemaCaching.js} +2 -23
- package/dist/simple-tree/core/schemaCaching.js.map +1 -0
- package/dist/simple-tree/core/treeNodeKernel.d.ts +57 -0
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -0
- package/dist/simple-tree/core/treeNodeKernel.js +128 -0
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -0
- package/dist/simple-tree/core/treeNodeSchema.d.ts +149 -0
- package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -0
- package/dist/simple-tree/core/treeNodeSchema.js +35 -0
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -0
- package/dist/simple-tree/core/types.d.ts +178 -0
- package/dist/simple-tree/core/types.d.ts.map +1 -0
- package/dist/simple-tree/core/types.js +117 -0
- package/dist/simple-tree/core/types.js.map +1 -0
- package/dist/simple-tree/core/withType.d.ts +82 -0
- package/dist/simple-tree/core/withType.d.ts.map +1 -0
- package/dist/simple-tree/core/withType.js +39 -0
- package/dist/simple-tree/core/withType.js.map +1 -0
- package/dist/simple-tree/getJsonSchema.d.ts +55 -0
- package/dist/simple-tree/getJsonSchema.d.ts.map +1 -0
- package/dist/simple-tree/getJsonSchema.js +69 -0
- package/dist/simple-tree/getJsonSchema.js.map +1 -0
- package/dist/simple-tree/getSimpleFieldSchema.d.ts +14 -0
- package/dist/simple-tree/getSimpleFieldSchema.d.ts.map +1 -0
- package/dist/simple-tree/getSimpleFieldSchema.js +29 -0
- package/dist/simple-tree/getSimpleFieldSchema.js.map +1 -0
- package/dist/simple-tree/getSimpleSchema.d.ts +58 -0
- package/dist/simple-tree/getSimpleSchema.d.ts.map +1 -0
- package/dist/simple-tree/getSimpleSchema.js +68 -0
- package/dist/simple-tree/getSimpleSchema.js.map +1 -0
- package/dist/simple-tree/index.d.ts +12 -13
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +27 -23
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/jsonSchema.d.ts +206 -0
- package/dist/simple-tree/jsonSchema.d.ts.map +1 -0
- package/dist/{feature-libraries/schema-aware/index.js → simple-tree/jsonSchema.js} +1 -1
- package/dist/simple-tree/jsonSchema.js.map +1 -0
- package/dist/simple-tree/leafNodeSchema.d.ts +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +3 -4
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/mapNode.d.ts +9 -3
- package/dist/simple-tree/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/mapNode.js +33 -35
- package/dist/simple-tree/mapNode.js.map +1 -1
- package/dist/simple-tree/objectNode.d.ts +18 -16
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +43 -44
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/objectNodeTypes.d.ts +38 -0
- package/dist/simple-tree/objectNodeTypes.d.ts.map +1 -0
- package/dist/simple-tree/objectNodeTypes.js +19 -0
- package/dist/simple-tree/objectNodeTypes.js.map +1 -0
- package/dist/simple-tree/proxies.d.ts +6 -25
- package/dist/simple-tree/proxies.d.ts.map +1 -1
- package/dist/simple-tree/proxies.js +54 -81
- package/dist/simple-tree/proxies.js.map +1 -1
- package/dist/simple-tree/proxyBinding.d.ts +46 -19
- package/dist/simple-tree/proxyBinding.d.ts.map +1 -1
- package/dist/simple-tree/proxyBinding.js +101 -44
- package/dist/simple-tree/proxyBinding.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +10 -159
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js +11 -42
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +124 -0
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -0
- package/dist/{feature-libraries/schema-aware/schemaAware.js → simple-tree/simpleSchema.js} +1 -1
- package/dist/simple-tree/simpleSchema.js.map +1 -0
- package/dist/simple-tree/simpleSchemaToJsonSchema.d.ts +12 -0
- package/dist/simple-tree/simpleSchemaToJsonSchema.d.ts.map +1 -0
- package/dist/simple-tree/simpleSchemaToJsonSchema.js +146 -0
- package/dist/simple-tree/simpleSchemaToJsonSchema.js.map +1 -0
- package/dist/simple-tree/toFlexSchema.d.ts +4 -12
- package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/dist/simple-tree/toFlexSchema.js +42 -52
- package/dist/simple-tree/toFlexSchema.js.map +1 -1
- package/dist/simple-tree/toMapTree.d.ts +39 -39
- package/dist/simple-tree/toMapTree.d.ts.map +1 -1
- package/dist/simple-tree/toMapTree.js +227 -171
- package/dist/simple-tree/toMapTree.js.map +1 -1
- package/dist/simple-tree/{types.d.ts → treeNodeValid.d.ts} +2 -80
- package/dist/simple-tree/treeNodeValid.d.ts.map +1 -0
- package/dist/simple-tree/{types.js → treeNodeValid.js} +102 -107
- package/dist/simple-tree/treeNodeValid.js.map +1 -0
- package/dist/simple-tree/typesUnsafe.d.ts +35 -4
- package/dist/simple-tree/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/viewSchemaToSimpleSchema.d.ts +11 -0
- package/dist/simple-tree/viewSchemaToSimpleSchema.d.ts.map +1 -0
- package/dist/simple-tree/viewSchemaToSimpleSchema.js +171 -0
- package/dist/simple-tree/viewSchemaToSimpleSchema.js.map +1 -0
- package/dist/util/brand.d.ts +0 -3
- package/dist/util/brand.d.ts.map +1 -1
- package/dist/util/brand.js +1 -2
- package/dist/util/brand.js.map +1 -1
- package/dist/util/brandedMap.d.ts +0 -5
- package/dist/util/brandedMap.d.ts.map +1 -1
- package/dist/util/brandedMap.js +0 -1
- package/dist/util/brandedMap.js.map +1 -1
- package/dist/util/breakable.js +1 -1
- package/dist/util/breakable.js.map +1 -1
- package/dist/util/idAllocator.d.ts +0 -2
- package/dist/util/idAllocator.d.ts.map +1 -1
- package/dist/util/idAllocator.js +0 -1
- package/dist/util/idAllocator.js.map +1 -1
- package/dist/util/index.d.ts +2 -2
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +4 -2
- package/dist/util/index.js.map +1 -1
- package/dist/util/nestedMap.d.ts +5 -19
- package/dist/util/nestedMap.d.ts.map +1 -1
- package/dist/util/nestedMap.js +17 -17
- package/dist/util/nestedMap.js.map +1 -1
- package/dist/util/opaque.d.ts +0 -4
- package/dist/util/opaque.d.ts.map +1 -1
- package/dist/util/opaque.js +0 -2
- package/dist/util/opaque.js.map +1 -1
- package/dist/util/rangeMap.d.ts +0 -2
- package/dist/util/rangeMap.d.ts.map +1 -1
- package/dist/util/rangeMap.js +4 -3
- package/dist/util/rangeMap.js.map +1 -1
- package/dist/util/transactionResult.d.ts +0 -1
- package/dist/util/transactionResult.d.ts.map +1 -1
- package/dist/util/transactionResult.js +0 -1
- package/dist/util/transactionResult.js.map +1 -1
- package/dist/util/typeCheck.d.ts +2 -20
- package/dist/util/typeCheck.d.ts.map +1 -1
- package/dist/util/typeCheck.js.map +1 -1
- package/dist/util/typeCheckTests.d.ts +4 -4
- package/dist/util/typeCheckTests.d.ts.map +1 -1
- package/dist/util/typeCheckTests.js.map +1 -1
- package/dist/util/typeUtils.d.ts +0 -7
- package/dist/util/typeUtils.d.ts.map +1 -1
- package/dist/util/typeUtils.js.map +1 -1
- package/dist/util/utils.d.ts +6 -8
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +14 -5
- package/dist/util/utils.js.map +1 -1
- package/lib/beta.d.ts +3 -1
- package/lib/codec/discriminatedUnions.d.ts +11 -5
- package/lib/codec/discriminatedUnions.d.ts.map +1 -1
- package/lib/codec/discriminatedUnions.js.map +1 -1
- package/lib/codec/index.d.ts +1 -1
- 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/core/forest/editableForest.d.ts +1 -5
- package/lib/core/forest/editableForest.d.ts.map +1 -1
- package/lib/core/forest/editableForest.js +4 -2
- package/lib/core/forest/editableForest.js.map +1 -1
- package/lib/core/forest/forest.d.ts +0 -6
- package/lib/core/forest/forest.d.ts.map +1 -1
- package/lib/core/forest/forest.js +0 -2
- package/lib/core/forest/forest.js.map +1 -1
- package/lib/core/index.d.ts +2 -2
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +2 -2
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/changeRebaser.d.ts +0 -4
- 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 +1 -1
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +1 -8
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +1 -7
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/rebase/utils.d.ts +0 -1
- package/lib/core/rebase/utils.d.ts.map +1 -1
- package/lib/core/rebase/utils.js +13 -8
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/schema-stored/multiplicity.d.ts +0 -1
- package/lib/core/schema-stored/multiplicity.d.ts.map +1 -1
- package/lib/core/schema-stored/multiplicity.js +0 -1
- package/lib/core/schema-stored/multiplicity.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +0 -7
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +0 -4
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts +0 -3
- package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/lib/core/schema-view/view.d.ts +0 -3
- package/lib/core/schema-view/view.d.ts.map +1 -1
- package/lib/core/schema-view/view.js +0 -1
- package/lib/core/schema-view/view.js.map +1 -1
- package/lib/core/tree/anchorSet.d.ts +1 -10
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +14 -4
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/cursor.d.ts +1 -6
- package/lib/core/tree/cursor.d.ts.map +1 -1
- package/lib/core/tree/cursor.js +0 -2
- package/lib/core/tree/cursor.js.map +1 -1
- package/lib/core/tree/delta.d.ts +0 -11
- package/lib/core/tree/delta.d.ts.map +1 -1
- package/lib/core/tree/delta.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts +48 -11
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +145 -21
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodec.js +17 -7
- package/lib/core/tree/detachedFieldIndexCodec.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormat.d.ts +1 -1
- package/lib/core/tree/detachedFieldIndexFormat.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormat.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexTypes.d.ts +38 -4
- package/lib/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexTypes.js.map +1 -1
- package/lib/core/tree/index.d.ts +3 -2
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +1 -0
- package/lib/core/tree/index.js.map +1 -1
- package/lib/core/tree/mapTree.d.ts +20 -4
- package/lib/core/tree/mapTree.d.ts.map +1 -1
- package/lib/core/tree/mapTree.js +27 -1
- package/lib/core/tree/mapTree.js.map +1 -1
- package/lib/core/tree/pathTree.d.ts +0 -11
- package/lib/core/tree/pathTree.d.ts.map +1 -1
- package/lib/core/tree/pathTree.js.map +1 -1
- package/lib/core/tree/treeTextFormat.d.ts.map +1 -1
- package/lib/core/tree/treeTextFormat.js +3 -2
- package/lib/core/tree/treeTextFormat.js.map +1 -1
- package/lib/core/tree/types.d.ts +0 -11
- package/lib/core/tree/types.d.ts.map +1 -1
- package/lib/core/tree/types.js +0 -4
- package/lib/core/tree/types.js.map +1 -1
- package/lib/core/tree/visitDelta.d.ts +3 -2
- package/lib/core/tree/visitDelta.d.ts.map +1 -1
- package/lib/core/tree/visitDelta.js +33 -17
- package/lib/core/tree/visitDelta.js.map +1 -1
- package/lib/core/tree/visitPath.d.ts +0 -2
- package/lib/core/tree/visitPath.d.ts.map +1 -1
- package/lib/core/tree/visitPath.js.map +1 -1
- package/lib/core/tree/visitorUtils.d.ts +3 -4
- package/lib/core/tree/visitorUtils.d.ts.map +1 -1
- package/lib/core/tree/visitorUtils.js +4 -4
- package/lib/core/tree/visitorUtils.js.map +1 -1
- package/lib/domains/index.d.ts +1 -1
- package/lib/domains/index.d.ts.map +1 -1
- package/lib/domains/index.js +1 -1
- package/lib/domains/index.js.map +1 -1
- package/lib/domains/json/index.d.ts +1 -1
- package/lib/domains/json/index.d.ts.map +1 -1
- package/lib/domains/json/index.js +1 -1
- package/lib/domains/json/index.js.map +1 -1
- package/lib/domains/json/jsonCursor.d.ts +36 -2
- package/lib/domains/json/jsonCursor.d.ts.map +1 -1
- package/lib/domains/json/jsonCursor.js +76 -5
- package/lib/domains/json/jsonCursor.js.map +1 -1
- package/lib/domains/json/jsonDomainSchema.d.ts +13 -3
- package/lib/domains/json/jsonDomainSchema.d.ts.map +1 -1
- package/lib/domains/json/jsonDomainSchema.js +9 -1
- package/lib/domains/json/jsonDomainSchema.js.map +1 -1
- package/lib/domains/leafDomain.d.ts +0 -1
- package/lib/domains/leafDomain.d.ts.map +1 -1
- package/lib/domains/leafDomain.js +0 -1
- package/lib/domains/leafDomain.js.map +1 -1
- package/lib/domains/schemaBuilder.d.ts +1 -7
- package/lib/domains/schemaBuilder.d.ts.map +1 -1
- package/lib/domains/schemaBuilder.js +1 -11
- package/lib/domains/schemaBuilder.js.map +1 -1
- package/lib/events/events.d.ts +0 -4
- package/lib/events/events.d.ts.map +1 -1
- package/lib/events/events.js +0 -1
- package/lib/events/events.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js +9 -4
- package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunk.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/chunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +4 -4
- 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 +8 -6
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +2 -2
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.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 +9 -6
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +6 -4
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +12 -24
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +6 -16
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +0 -6
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +11 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultSchema.d.ts +0 -1
- package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultSchema.js +0 -1
- package/lib/feature-libraries/default-schema/defaultSchema.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js +1 -1
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts +6 -0
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js +6 -0
- package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/editableTreeBinder.d.ts +0 -67
- package/lib/feature-libraries/editableTreeBinder.d.ts.map +1 -1
- package/lib/feature-libraries/editableTreeBinder.js +7 -26
- package/lib/feature-libraries/editableTreeBinder.js.map +1 -1
- package/lib/feature-libraries/fieldGenerator.d.ts +0 -3
- package/lib/feature-libraries/fieldGenerator.d.ts.map +1 -1
- package/lib/feature-libraries/fieldGenerator.js +0 -1
- package/lib/feature-libraries/fieldGenerator.js.map +1 -1
- package/lib/feature-libraries/flex-map-tree/index.d.ts +1 -1
- package/lib/feature-libraries/flex-map-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-map-tree/index.js +1 -1
- package/lib/feature-libraries/flex-map-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts +57 -56
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js +169 -217
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +0 -1
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +18 -295
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js +0 -6
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/flex-tree/index.d.ts +3 -2
- package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/index.js +2 -1
- package/lib/feature-libraries/flex-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts +1 -2
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +9 -27
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +39 -120
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts +2 -13
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +7 -72
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/treeEvents.d.ts +0 -2
- package/lib/feature-libraries/flex-tree/treeEvents.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/treeEvents.js.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.d.ts +2 -1
- package/lib/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.js +4 -0
- package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js +3 -3
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +6 -8
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +6 -7
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.d.ts +6 -2
- package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.js +7 -0
- package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
- package/lib/feature-libraries/memoizedIdRangeAllocator.d.ts +0 -4
- package/lib/feature-libraries/memoizedIdRangeAllocator.d.ts.map +1 -1
- package/lib/feature-libraries/memoizedIdRangeAllocator.js +0 -1
- package/lib/feature-libraries/memoizedIdRangeAllocator.js.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +0 -2
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js +0 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/lib/feature-libraries/modular-schema/discrepancies.d.ts +18 -0
- package/lib/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/discrepancies.js +106 -4
- package/lib/feature-libraries/modular-schema/discrepancies.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +0 -8
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js +0 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts +1 -3
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.js +1 -2
- package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts +1 -2
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +56 -83
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js +6 -9
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindTypes.d.ts +3 -14
- package/lib/feature-libraries/modular-schema/genericFieldKindTypes.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindTypes.js +4 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +1 -1
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +43 -26
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +9 -8
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +182 -222
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +8 -14
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/lib/feature-libraries/node-key/nodeKey.d.ts +0 -4
- package/lib/feature-libraries/node-key/nodeKey.d.ts.map +1 -1
- package/lib/feature-libraries/node-key/nodeKey.js +0 -2
- package/lib/feature-libraries/node-key/nodeKey.js.map +1 -1
- package/lib/feature-libraries/node-key/nodeKeyManager.d.ts +0 -1
- package/lib/feature-libraries/node-key/nodeKeyManager.d.ts.map +1 -1
- package/lib/feature-libraries/node-key/nodeKeyManager.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts +3 -2
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +7 -15
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +6 -6
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +7 -7
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
- package/lib/feature-libraries/schemaBuilderBase.d.ts +2 -28
- package/lib/feature-libraries/schemaBuilderBase.d.ts.map +1 -1
- package/lib/feature-libraries/schemaBuilderBase.js +2 -28
- package/lib/feature-libraries/schemaBuilderBase.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +25 -22
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV2.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV2.js +3 -3
- package/lib/feature-libraries/sequence-field/formatV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV3.d.ts +195 -0
- package/lib/feature-libraries/sequence-field/formatV3.d.ts.map +1 -0
- package/lib/feature-libraries/sequence-field/formatV3.js +19 -0
- package/lib/feature-libraries/sequence-field/formatV3.js.map +1 -0
- package/lib/feature-libraries/sequence-field/helperTypes.d.ts +11 -0
- 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 +1 -1
- package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/index.js.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.js +22 -14
- package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
- package/lib/feature-libraries/sequence-field/markQueue.js +2 -2
- package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.js +25 -7
- package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.js +16 -3
- package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +40 -6
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +55 -11
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +11 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +81 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js +2 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +5 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/lib/feature-libraries/sequence-field/types.d.ts +23 -4
- 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 +5 -4
- package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.js +67 -41
- package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
- package/lib/feature-libraries/storedToViewSchema.d.ts +0 -1
- package/lib/feature-libraries/storedToViewSchema.d.ts.map +1 -1
- package/lib/feature-libraries/storedToViewSchema.js +0 -1
- package/lib/feature-libraries/storedToViewSchema.js.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.d.ts +0 -6
- package/lib/feature-libraries/treeCursorUtils.d.ts.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.js +9 -7
- package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
- package/lib/feature-libraries/treeTextCursor.d.ts +0 -2
- package/lib/feature-libraries/treeTextCursor.d.ts.map +1 -1
- package/lib/feature-libraries/treeTextCursor.js +0 -2
- package/lib/feature-libraries/treeTextCursor.js.map +1 -1
- package/lib/feature-libraries/typed-schema/flexList.d.ts +0 -3
- package/lib/feature-libraries/typed-schema/flexList.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/flexList.js.map +1 -1
- package/lib/feature-libraries/typed-schema/index.d.ts +1 -1
- package/lib/feature-libraries/typed-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/index.js +1 -1
- package/lib/feature-libraries/typed-schema/index.js.map +1 -1
- package/lib/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/schemaCollection.js +1 -5
- package/lib/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts +2 -41
- package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js +1 -38
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/lib/feature-libraries/typed-schema/view.d.ts +0 -1
- package/lib/feature-libraries/typed-schema/view.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/view.js.map +1 -1
- package/lib/index.d.ts +8 -9
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -9
- package/lib/index.js.map +1 -1
- package/lib/internalTypes.d.ts +1 -1
- package/lib/internalTypes.d.ts.map +1 -1
- package/lib/internalTypes.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +3 -1
- package/lib/shared-tree/schematizeTree.d.ts +2 -11
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +15 -4
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +4 -4
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +3 -3
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +9 -18
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +14 -11
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +4 -0
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +3 -3
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts +0 -2
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/treeApi.js +4 -4
- package/lib/shared-tree/treeApi.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +10 -6
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +52 -7
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree/treeView.d.ts +3 -6
- package/lib/shared-tree/treeView.d.ts.map +1 -1
- package/lib/shared-tree/treeView.js +4 -0
- package/lib/shared-tree/treeView.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +6 -0
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +14 -7
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.js +4 -4
- package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +1 -0
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormat.d.ts +2 -2
- package/lib/shared-tree-core/editManagerFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormat.js +6 -1
- package/lib/shared-tree-core/editManagerFormat.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +1 -0
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +4 -0
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +10 -2
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/simple-tree/api/create.d.ts +54 -0
- package/lib/simple-tree/api/create.d.ts.map +1 -0
- package/lib/simple-tree/api/create.js +92 -0
- package/lib/simple-tree/api/create.js.map +1 -0
- package/lib/simple-tree/api/index.d.ts +12 -0
- package/lib/simple-tree/api/index.d.ts.map +1 -0
- package/lib/simple-tree/api/index.js +13 -0
- package/lib/simple-tree/api/index.js.map +1 -0
- package/{dist/simple-tree → lib/simple-tree/api}/schemaCreationUtilities.d.ts +7 -4
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -0
- package/lib/simple-tree/{schemaCreationUtilities.js → api/schemaCreationUtilities.js} +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -0
- package/lib/simple-tree/{schemaFactory.d.ts → api/schemaFactory.d.ts} +15 -14
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -0
- package/lib/simple-tree/{schemaFactory.js → api/schemaFactory.js} +9 -8
- package/lib/simple-tree/api/schemaFactory.js.map +1 -0
- package/{dist/simple-tree → lib/simple-tree/api}/schemaFactoryRecursive.d.ts +40 -7
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -0
- package/lib/simple-tree/{schemaFactoryRecursive.js → api/schemaFactoryRecursive.js} +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -0
- package/lib/simple-tree/api/testRecursiveDomain.d.ts +62 -0
- package/lib/simple-tree/api/testRecursiveDomain.d.ts.map +1 -0
- package/lib/simple-tree/api/testRecursiveDomain.js.map +1 -0
- package/{dist/simple-tree → lib/simple-tree/api}/tree.d.ts +111 -20
- package/lib/simple-tree/api/tree.d.ts.map +1 -0
- package/lib/simple-tree/api/tree.js +165 -0
- package/lib/simple-tree/api/tree.js.map +1 -0
- package/lib/simple-tree/api/treeNodeApi.d.ts +87 -0
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -0
- package/lib/simple-tree/{treeNodeApi.js → api/treeNodeApi.js} +32 -32
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -0
- package/lib/simple-tree/api/verboseTree.d.ts +136 -0
- package/lib/simple-tree/api/verboseTree.d.ts.map +1 -0
- package/lib/simple-tree/api/verboseTree.js +213 -0
- package/lib/simple-tree/api/verboseTree.js.map +1 -0
- package/lib/simple-tree/arrayNode.d.ts +3 -3
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js +57 -54
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +10 -0
- package/lib/simple-tree/core/index.d.ts.map +1 -0
- package/lib/simple-tree/core/index.js +10 -0
- package/lib/simple-tree/core/index.js.map +1 -0
- package/{dist/simple-tree → lib/simple-tree/core}/schemaCaching.d.ts +2 -9
- package/lib/simple-tree/core/schemaCaching.d.ts.map +1 -0
- package/lib/simple-tree/{schemaCaching.js → core/schemaCaching.js} +1 -21
- package/lib/simple-tree/core/schemaCaching.js.map +1 -0
- package/lib/simple-tree/core/treeNodeKernel.d.ts +57 -0
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -0
- package/lib/simple-tree/core/treeNodeKernel.js +121 -0
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -0
- package/lib/simple-tree/core/treeNodeSchema.d.ts +149 -0
- package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -0
- package/lib/simple-tree/core/treeNodeSchema.js +32 -0
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -0
- package/lib/simple-tree/core/types.d.ts +178 -0
- package/lib/simple-tree/core/types.d.ts.map +1 -0
- package/lib/simple-tree/core/types.js +111 -0
- package/lib/simple-tree/core/types.js.map +1 -0
- package/lib/simple-tree/core/withType.d.ts +82 -0
- package/lib/simple-tree/core/withType.d.ts.map +1 -0
- package/lib/simple-tree/core/withType.js +36 -0
- package/lib/simple-tree/core/withType.js.map +1 -0
- package/lib/simple-tree/getJsonSchema.d.ts +55 -0
- package/lib/simple-tree/getJsonSchema.d.ts.map +1 -0
- package/lib/simple-tree/getJsonSchema.js +65 -0
- package/lib/simple-tree/getJsonSchema.js.map +1 -0
- package/lib/simple-tree/getSimpleFieldSchema.d.ts +14 -0
- package/lib/simple-tree/getSimpleFieldSchema.d.ts.map +1 -0
- package/lib/simple-tree/getSimpleFieldSchema.js +25 -0
- package/lib/simple-tree/getSimpleFieldSchema.js.map +1 -0
- package/lib/simple-tree/getSimpleSchema.d.ts +58 -0
- package/lib/simple-tree/getSimpleSchema.d.ts.map +1 -0
- package/lib/simple-tree/getSimpleSchema.js +64 -0
- package/lib/simple-tree/getSimpleSchema.js.map +1 -0
- package/lib/simple-tree/index.d.ts +12 -13
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +8 -11
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/jsonSchema.d.ts +206 -0
- package/lib/simple-tree/jsonSchema.d.ts.map +1 -0
- package/lib/simple-tree/{nodeKeys.js → jsonSchema.js} +1 -1
- package/lib/simple-tree/jsonSchema.js.map +1 -0
- package/lib/simple-tree/leafNodeSchema.d.ts +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +1 -2
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/mapNode.d.ts +9 -3
- package/lib/simple-tree/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/mapNode.js +36 -36
- package/lib/simple-tree/mapNode.js.map +1 -1
- package/lib/simple-tree/objectNode.d.ts +18 -16
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +36 -34
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/objectNodeTypes.d.ts +38 -0
- package/lib/simple-tree/objectNodeTypes.d.ts.map +1 -0
- package/lib/simple-tree/objectNodeTypes.js +15 -0
- package/lib/simple-tree/objectNodeTypes.js.map +1 -0
- package/lib/simple-tree/proxies.d.ts +6 -25
- package/lib/simple-tree/proxies.d.ts.map +1 -1
- package/lib/simple-tree/proxies.js +50 -75
- package/lib/simple-tree/proxies.js.map +1 -1
- package/lib/simple-tree/proxyBinding.d.ts +46 -19
- package/lib/simple-tree/proxyBinding.d.ts.map +1 -1
- package/lib/simple-tree/proxyBinding.js +95 -39
- package/lib/simple-tree/proxyBinding.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +10 -159
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js +9 -41
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +124 -0
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -0
- package/lib/{feature-libraries/schema-aware/schemaAware.js → simple-tree/simpleSchema.js} +1 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -0
- package/lib/simple-tree/simpleSchemaToJsonSchema.d.ts +12 -0
- package/lib/simple-tree/simpleSchemaToJsonSchema.d.ts.map +1 -0
- package/lib/simple-tree/simpleSchemaToJsonSchema.js +142 -0
- package/lib/simple-tree/simpleSchemaToJsonSchema.js.map +1 -0
- package/lib/simple-tree/toFlexSchema.d.ts +4 -12
- package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/lib/simple-tree/toFlexSchema.js +9 -18
- package/lib/simple-tree/toFlexSchema.js.map +1 -1
- package/lib/simple-tree/toMapTree.d.ts +39 -39
- package/lib/simple-tree/toMapTree.d.ts.map +1 -1
- package/lib/simple-tree/toMapTree.js +214 -158
- package/lib/simple-tree/toMapTree.js.map +1 -1
- package/lib/simple-tree/{types.d.ts → treeNodeValid.d.ts} +2 -80
- package/lib/simple-tree/treeNodeValid.d.ts.map +1 -0
- package/lib/simple-tree/{types.js → treeNodeValid.js} +94 -96
- package/lib/simple-tree/treeNodeValid.js.map +1 -0
- package/lib/simple-tree/typesUnsafe.d.ts +35 -4
- package/lib/simple-tree/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/viewSchemaToSimpleSchema.d.ts +11 -0
- package/lib/simple-tree/viewSchemaToSimpleSchema.d.ts.map +1 -0
- package/lib/simple-tree/viewSchemaToSimpleSchema.js +167 -0
- package/lib/simple-tree/viewSchemaToSimpleSchema.js.map +1 -0
- package/lib/util/brand.d.ts +0 -3
- package/lib/util/brand.d.ts.map +1 -1
- package/lib/util/brand.js +1 -2
- package/lib/util/brand.js.map +1 -1
- package/lib/util/brandedMap.d.ts +0 -5
- package/lib/util/brandedMap.d.ts.map +1 -1
- package/lib/util/brandedMap.js +0 -1
- package/lib/util/brandedMap.js.map +1 -1
- package/lib/util/breakable.js +1 -1
- package/lib/util/breakable.js.map +1 -1
- package/lib/util/idAllocator.d.ts +0 -2
- package/lib/util/idAllocator.d.ts.map +1 -1
- package/lib/util/idAllocator.js +0 -1
- package/lib/util/idAllocator.js.map +1 -1
- package/lib/util/index.d.ts +2 -2
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -2
- package/lib/util/index.js.map +1 -1
- package/lib/util/nestedMap.d.ts +5 -19
- package/lib/util/nestedMap.d.ts.map +1 -1
- package/lib/util/nestedMap.js +15 -16
- package/lib/util/nestedMap.js.map +1 -1
- package/lib/util/opaque.d.ts +0 -4
- package/lib/util/opaque.d.ts.map +1 -1
- package/lib/util/opaque.js +0 -2
- package/lib/util/opaque.js.map +1 -1
- package/lib/util/rangeMap.d.ts +0 -2
- package/lib/util/rangeMap.d.ts.map +1 -1
- package/lib/util/rangeMap.js +4 -3
- package/lib/util/rangeMap.js.map +1 -1
- package/lib/util/transactionResult.d.ts +0 -1
- package/lib/util/transactionResult.d.ts.map +1 -1
- package/lib/util/transactionResult.js +0 -1
- package/lib/util/transactionResult.js.map +1 -1
- package/lib/util/typeCheck.d.ts +2 -20
- package/lib/util/typeCheck.d.ts.map +1 -1
- package/lib/util/typeCheck.js.map +1 -1
- package/lib/util/typeCheckTests.d.ts +4 -4
- package/lib/util/typeCheckTests.d.ts.map +1 -1
- package/lib/util/typeCheckTests.js.map +1 -1
- package/lib/util/typeUtils.d.ts +0 -7
- package/lib/util/typeUtils.d.ts.map +1 -1
- package/lib/util/typeUtils.js.map +1 -1
- package/lib/util/utils.d.ts +6 -8
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js +12 -4
- package/lib/util/utils.js.map +1 -1
- package/package.json +36 -25
- package/src/codec/discriminatedUnions.ts +20 -10
- package/src/codec/index.ts +5 -1
- package/src/core/forest/README.md +4 -2
- package/src/core/forest/editableForest.ts +10 -7
- package/src/core/forest/forest.ts +0 -6
- package/src/core/index.ts +2 -2
- package/src/core/rebase/changeRebaser.ts +0 -4
- package/src/core/rebase/index.ts +0 -2
- package/src/core/rebase/types.ts +1 -23
- package/src/core/rebase/utils.ts +13 -11
- package/src/core/schema-stored/multiplicity.ts +0 -1
- package/src/core/schema-stored/schema.ts +0 -7
- package/src/core/schema-stored/storedSchemaRepository.ts +0 -3
- package/src/core/schema-view/view.ts +0 -3
- package/src/core/tree/anchorSet.ts +21 -17
- package/src/core/tree/cursor.ts +1 -6
- package/src/core/tree/delta.ts +0 -11
- package/src/core/tree/detachedFieldIndex.ts +217 -35
- package/src/core/tree/detachedFieldIndexCodec.ts +21 -11
- package/src/core/tree/detachedFieldIndexFormat.ts +1 -1
- package/src/core/tree/detachedFieldIndexTypes.ts +40 -5
- package/src/core/tree/index.ts +3 -2
- package/src/core/tree/mapTree.ts +45 -4
- package/src/core/tree/pathTree.ts +0 -11
- package/src/core/tree/treeTextFormat.ts +3 -2
- package/src/core/tree/types.ts +0 -11
- package/src/core/tree/visitDelta.ts +59 -19
- package/src/core/tree/visitPath.ts +0 -2
- package/src/core/tree/visitorUtils.ts +7 -5
- package/src/domains/index.ts +3 -0
- package/src/domains/json/index.ts +7 -1
- package/src/domains/json/jsonCursor.ts +113 -6
- package/src/domains/json/jsonDomainSchema.ts +4 -5
- package/src/domains/leafDomain.ts +0 -1
- package/src/domains/schemaBuilder.ts +0 -22
- package/src/events/events.ts +0 -4
- package/src/feature-libraries/chunked-forest/README.md +9 -1
- package/src/feature-libraries/chunked-forest/basicChunk.ts +14 -9
- package/src/feature-libraries/chunked-forest/chunk.ts +1 -1
- package/src/feature-libraries/chunked-forest/chunkTree.ts +4 -4
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +8 -6
- package/src/feature-libraries/chunked-forest/codec/chunkCodecUtilities.ts +2 -2
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +9 -6
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +6 -4
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +18 -46
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +11 -6
- package/src/feature-libraries/default-schema/defaultSchema.ts +0 -1
- package/src/feature-libraries/default-schema/index.ts +1 -1
- package/src/feature-libraries/default-schema/schemaChecker.ts +6 -0
- package/src/feature-libraries/editableTreeBinder.ts +7 -79
- package/src/feature-libraries/fieldGenerator.ts +0 -3
- package/src/feature-libraries/flex-map-tree/index.ts +2 -1
- package/src/feature-libraries/flex-map-tree/mapTreeNode.ts +235 -328
- package/src/feature-libraries/flex-tree/context.ts +0 -1
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +27 -376
- package/src/feature-libraries/flex-tree/index.ts +7 -2
- package/src/feature-libraries/flex-tree/lazyEntity.ts +0 -3
- package/src/feature-libraries/flex-tree/lazyField.ts +52 -234
- package/src/feature-libraries/flex-tree/lazyNode.ts +6 -108
- package/src/feature-libraries/flex-tree/treeEvents.ts +0 -2
- package/src/feature-libraries/flex-tree/utilities.ts +6 -1
- package/src/feature-libraries/forest-summary/codec.ts +3 -3
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -0
- package/src/feature-libraries/index.ts +8 -35
- package/src/feature-libraries/mapTreeCursor.ts +13 -4
- package/src/feature-libraries/memoizedIdRangeAllocator.ts +0 -4
- package/src/feature-libraries/modular-schema/crossFieldQueries.ts +0 -2
- package/src/feature-libraries/modular-schema/discrepancies.ts +120 -4
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +0 -8
- package/src/feature-libraries/modular-schema/fieldKind.ts +1 -3
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +69 -92
- package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +7 -14
- package/src/feature-libraries/modular-schema/genericFieldKindTypes.ts +6 -15
- package/src/feature-libraries/modular-schema/index.ts +2 -2
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +69 -35
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +350 -354
- package/src/feature-libraries/modular-schema/modularChangeTypes.ts +7 -14
- package/src/feature-libraries/node-key/nodeKey.ts +0 -4
- package/src/feature-libraries/node-key/nodeKeyManager.ts +0 -1
- package/src/feature-libraries/object-forest/objectForest.ts +8 -16
- package/src/feature-libraries/schemaBuilderBase.ts +1 -49
- package/src/feature-libraries/sequence-field/compose.ts +41 -20
- package/src/feature-libraries/sequence-field/formatV2.ts +3 -3
- package/src/feature-libraries/sequence-field/formatV3.ts +65 -0
- package/src/feature-libraries/sequence-field/helperTypes.ts +33 -0
- package/src/feature-libraries/sequence-field/index.ts +1 -0
- package/src/feature-libraries/sequence-field/invert.ts +28 -18
- package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
- package/src/feature-libraries/sequence-field/moveEffectTable.ts +2 -2
- package/src/feature-libraries/sequence-field/rebase.ts +30 -13
- package/src/feature-libraries/sequence-field/replaceRevisions.ts +27 -3
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +52 -7
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +92 -19
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +134 -0
- package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +2 -0
- package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +8 -2
- package/src/feature-libraries/sequence-field/types.ts +24 -4
- package/src/feature-libraries/sequence-field/utils.ts +78 -50
- package/src/feature-libraries/storedToViewSchema.ts +0 -1
- package/src/feature-libraries/treeCursorUtils.ts +11 -11
- package/src/feature-libraries/treeTextCursor.ts +0 -2
- package/src/feature-libraries/typed-schema/flexList.ts +0 -3
- package/src/feature-libraries/typed-schema/index.ts +0 -2
- package/src/feature-libraries/typed-schema/schemaCollection.ts +0 -5
- package/src/feature-libraries/typed-schema/typedTreeSchema.ts +2 -68
- package/src/feature-libraries/typed-schema/view.ts +0 -1
- package/src/index.ts +27 -245
- package/src/internalTypes.ts +1 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/schematizeTree.ts +25 -21
- package/src/shared-tree/schematizingTreeView.ts +6 -6
- package/src/shared-tree/sharedTree.ts +16 -40
- package/src/shared-tree/sharedTreeChangeCodecs.ts +8 -0
- package/src/shared-tree/sharedTreeChangeEnricher.ts +1 -1
- package/src/shared-tree/sharedTreeChangeFamily.ts +3 -3
- package/src/shared-tree/sharedTreeEditBuilder.ts +0 -2
- package/src/shared-tree/treeApi.ts +4 -4
- package/src/shared-tree/treeCheckout.ts +61 -12
- package/src/shared-tree/treeView.ts +8 -6
- package/src/shared-tree-core/branch.ts +29 -8
- package/src/shared-tree-core/defaultResubmitMachine.ts +4 -4
- package/src/shared-tree-core/editManagerCodecs.ts +1 -0
- package/src/shared-tree-core/editManagerFormat.ts +7 -2
- package/src/shared-tree-core/messageCodecs.ts +2 -1
- package/src/shared-tree-core/sharedTreeCore.ts +12 -3
- package/src/simple-tree/ProxyBinding.md +2 -0
- package/src/simple-tree/api/README.md +7 -0
- package/src/simple-tree/api/create.ts +179 -0
- package/src/simple-tree/api/index.ts +36 -0
- package/src/simple-tree/{schemaCreationUtilities.ts → api/schemaCreationUtilities.ts} +13 -5
- package/src/simple-tree/{schemaFactory.ts → api/schemaFactory.ts} +36 -34
- package/src/simple-tree/{schemaFactoryRecursive.ts → api/schemaFactoryRecursive.ts} +47 -10
- package/src/simple-tree/{testRecursiveDomain.ts → api/testRecursiveDomain.ts} +3 -1
- package/src/simple-tree/{tree.ts → api/tree.ts} +250 -35
- package/src/simple-tree/{treeNodeApi.ts → api/treeNodeApi.ts} +57 -128
- package/src/simple-tree/api/verboseTree.ts +415 -0
- package/src/simple-tree/arrayNode.ts +101 -99
- package/src/simple-tree/core/README.md +11 -0
- package/src/simple-tree/core/index.ts +33 -0
- package/src/simple-tree/{schemaCaching.ts → core/schemaCaching.ts} +3 -37
- package/src/simple-tree/core/treeNodeKernel.ts +141 -0
- package/src/simple-tree/core/treeNodeSchema.ts +184 -0
- package/src/simple-tree/core/types.ts +255 -0
- package/src/simple-tree/core/withType.ts +89 -0
- package/src/simple-tree/getJsonSchema.ts +70 -0
- package/src/simple-tree/getSimpleFieldSchema.ts +36 -0
- package/src/simple-tree/getSimpleSchema.ts +69 -0
- package/src/simple-tree/index.ts +58 -33
- package/src/simple-tree/jsonSchema.ts +230 -0
- package/src/simple-tree/leafNodeSchema.ts +6 -3
- package/src/simple-tree/mapNode.ts +56 -55
- package/src/simple-tree/objectNode.ts +66 -90
- package/src/simple-tree/objectNodeTypes.ts +68 -0
- package/src/simple-tree/proxies.ts +56 -93
- package/src/simple-tree/proxyBinding.ts +134 -56
- package/src/simple-tree/schemaTypes.ts +29 -194
- package/src/simple-tree/simpleSchema.ts +138 -0
- package/src/simple-tree/simpleSchemaToJsonSchema.ts +178 -0
- package/src/simple-tree/toFlexSchema.ts +9 -42
- package/src/simple-tree/toMapTree.ts +270 -296
- package/src/simple-tree/{types.ts → treeNodeValid.ts} +166 -151
- package/src/simple-tree/typesUnsafe.ts +51 -5
- package/src/simple-tree/viewSchemaToSimpleSchema.ts +209 -0
- package/src/util/brand.ts +1 -4
- package/src/util/brandedMap.ts +0 -5
- package/src/util/breakable.ts +1 -1
- package/src/util/idAllocator.ts +0 -2
- package/src/util/index.ts +3 -0
- package/src/util/nestedMap.ts +23 -20
- package/src/util/opaque.ts +0 -4
- package/src/util/rangeMap.ts +5 -5
- package/src/util/transactionResult.ts +0 -1
- package/src/util/typeCheck.ts +2 -20
- package/src/util/typeCheckTests.ts +4 -4
- package/src/util/typeUtils.ts +0 -7
- package/src/util/utils.ts +13 -8
- package/tsconfig.json +0 -1
- package/dist/feature-libraries/contextuallyTyped.d.ts +0 -209
- package/dist/feature-libraries/contextuallyTyped.d.ts.map +0 -1
- package/dist/feature-libraries/contextuallyTyped.js +0 -328
- package/dist/feature-libraries/contextuallyTyped.js.map +0 -1
- package/dist/feature-libraries/schema-aware/index.d.ts +0 -6
- package/dist/feature-libraries/schema-aware/index.d.ts.map +0 -1
- package/dist/feature-libraries/schema-aware/index.js.map +0 -1
- package/dist/feature-libraries/schema-aware/schemaAware.d.ts +0 -76
- package/dist/feature-libraries/schema-aware/schemaAware.d.ts.map +0 -1
- package/dist/feature-libraries/schema-aware/schemaAware.js.map +0 -1
- package/dist/simple-tree/nodeKeys.d.ts +0 -41
- package/dist/simple-tree/nodeKeys.d.ts.map +0 -1
- package/dist/simple-tree/nodeKeys.js +0 -7
- package/dist/simple-tree/nodeKeys.js.map +0 -1
- package/dist/simple-tree/schemaCaching.d.ts.map +0 -1
- package/dist/simple-tree/schemaCaching.js.map +0 -1
- package/dist/simple-tree/schemaCreationUtilities.d.ts.map +0 -1
- package/dist/simple-tree/schemaCreationUtilities.js.map +0 -1
- package/dist/simple-tree/schemaFactory.d.ts.map +0 -1
- package/dist/simple-tree/schemaFactory.js.map +0 -1
- package/dist/simple-tree/schemaFactoryRecursive.d.ts.map +0 -1
- package/dist/simple-tree/schemaFactoryRecursive.js.map +0 -1
- package/dist/simple-tree/testRecursiveDomain.d.ts +0 -61
- package/dist/simple-tree/testRecursiveDomain.d.ts.map +0 -1
- package/dist/simple-tree/testRecursiveDomain.js.map +0 -1
- package/dist/simple-tree/tree.d.ts.map +0 -1
- package/dist/simple-tree/tree.js +0 -73
- package/dist/simple-tree/tree.js.map +0 -1
- package/dist/simple-tree/treeNodeApi.d.ts +0 -159
- package/dist/simple-tree/treeNodeApi.d.ts.map +0 -1
- package/dist/simple-tree/treeNodeApi.js.map +0 -1
- package/dist/simple-tree/types.d.ts.map +0 -1
- package/dist/simple-tree/types.js.map +0 -1
- package/lib/feature-libraries/contextuallyTyped.d.ts +0 -209
- package/lib/feature-libraries/contextuallyTyped.d.ts.map +0 -1
- package/lib/feature-libraries/contextuallyTyped.js +0 -311
- package/lib/feature-libraries/contextuallyTyped.js.map +0 -1
- package/lib/feature-libraries/schema-aware/index.d.ts +0 -6
- package/lib/feature-libraries/schema-aware/index.d.ts.map +0 -1
- package/lib/feature-libraries/schema-aware/index.js +0 -6
- package/lib/feature-libraries/schema-aware/index.js.map +0 -1
- package/lib/feature-libraries/schema-aware/schemaAware.d.ts +0 -76
- package/lib/feature-libraries/schema-aware/schemaAware.d.ts.map +0 -1
- package/lib/feature-libraries/schema-aware/schemaAware.js.map +0 -1
- package/lib/simple-tree/nodeKeys.d.ts +0 -41
- package/lib/simple-tree/nodeKeys.d.ts.map +0 -1
- package/lib/simple-tree/nodeKeys.js.map +0 -1
- package/lib/simple-tree/schemaCaching.d.ts.map +0 -1
- package/lib/simple-tree/schemaCaching.js.map +0 -1
- package/lib/simple-tree/schemaCreationUtilities.d.ts.map +0 -1
- package/lib/simple-tree/schemaCreationUtilities.js.map +0 -1
- package/lib/simple-tree/schemaFactory.d.ts.map +0 -1
- package/lib/simple-tree/schemaFactory.js.map +0 -1
- package/lib/simple-tree/schemaFactoryRecursive.d.ts.map +0 -1
- package/lib/simple-tree/schemaFactoryRecursive.js.map +0 -1
- package/lib/simple-tree/testRecursiveDomain.d.ts +0 -61
- package/lib/simple-tree/testRecursiveDomain.d.ts.map +0 -1
- package/lib/simple-tree/testRecursiveDomain.js.map +0 -1
- package/lib/simple-tree/tree.d.ts.map +0 -1
- package/lib/simple-tree/tree.js +0 -66
- package/lib/simple-tree/tree.js.map +0 -1
- package/lib/simple-tree/treeNodeApi.d.ts +0 -159
- package/lib/simple-tree/treeNodeApi.d.ts.map +0 -1
- package/lib/simple-tree/treeNodeApi.js.map +0 -1
- package/lib/simple-tree/types.d.ts.map +0 -1
- package/lib/simple-tree/types.js.map +0 -1
- package/src/feature-libraries/contextuallyTyped.ts +0 -582
- package/src/feature-libraries/schema-aware/README.md +0 -19
- package/src/feature-libraries/schema-aware/index.ts +0 -16
- package/src/feature-libraries/schema-aware/schemaAware.ts +0 -135
- package/src/simple-tree/nodeKeys.ts +0 -42
- /package/dist/simple-tree/{testRecursiveDomain.js → api/testRecursiveDomain.js} +0 -0
- /package/lib/simple-tree/{testRecursiveDomain.js → api/testRecursiveDomain.js} +0 -0
package/lib/core/tree/cursor.js
CHANGED
|
@@ -7,7 +7,6 @@ import { assert } from "@fluidframework/core-utils/internal";
|
|
|
7
7
|
* A symbol for marking an object as an {@link ITreeCursor}.
|
|
8
8
|
*
|
|
9
9
|
* Useful when APIs want to take in tree data in multiple formats, including cursors.
|
|
10
|
-
* @internal
|
|
11
10
|
*/
|
|
12
11
|
export const CursorMarker = Symbol("CursorMarker");
|
|
13
12
|
/**
|
|
@@ -23,7 +22,6 @@ export function isCursor(data) {
|
|
|
23
22
|
data[CursorMarker] === true);
|
|
24
23
|
}
|
|
25
24
|
/**
|
|
26
|
-
* @internal
|
|
27
25
|
*/
|
|
28
26
|
export var CursorLocationType;
|
|
29
27
|
(function (CursorLocationType) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../src/core/tree/cursor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAO7D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAkB,MAAM,CAAC,cAAc,CAAC,CAAC;AAElE;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAa;IACrC,sFAAsF;IACtF,6FAA6F;IAC7F,OAAO,CACN,IAAI,KAAK,IAAI;QACb,OAAO,IAAI,KAAK,QAAQ;QACvB,IAA6B,CAAC,YAAY,CAAC,KAAK,IAAI,CACrD,CAAC;AACH,CAAC;AA4RD;;GAEG;AACH,MAAM,CAAN,IAAkB,kBAYjB;AAZD,WAAkB,kBAAkB;IACnC;;;OAGG;IACH,6DAAK,CAAA;IAEL;;;OAGG;IACH,+DAAM,CAAA;AACP,CAAC,EAZiB,kBAAkB,KAAlB,kBAAkB,QAYnC;AAUD;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAC9B,MAAe,EACf,CAAyB;IAEzB,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE;QAC1B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAC3B,MAAe,EACf,CAA4B;IAE5B,MAAM,CAAC,MAAM,CAAC,IAAI,qCAA6B,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACjF,KAAK,IAAI,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC;QAC/E,CAAC,CAAC,MAAM,CAAC,CAAC;IACX,CAAC;AACF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC7B,MAAe,EACf,CAAyB;IAEzB,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE;QACzB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;;;;;GAMG;AACH,MAAM,SAAS,CAAC,CAAC,kBAAkB,CAClC,MAAe,EACf,CAAyB;IAEzB,MAAM,CAAC,MAAM,CAAC,IAAI,sCAA8B,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACnF,KAAK,IAAI,OAAO,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;QAC7E,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC;AACF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAC1B,MAAe,EACf,CAA4B;IAE5B,MAAM,CAAC,MAAM,CAAC,IAAI,sCAA8B,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACnF,KAAK,IAAI,OAAO,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;QAC7E,CAAC,CAAC,MAAM,CAAC,CAAC;IACX,CAAC;AACF,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,oBAAoB,CACnC,MAAe,EACf,CAA4B;IAE5B,IAAI,MAAM,CAAC,IAAI,qCAA6B,EAAE,CAAC;QAC9C,CAAC,CAAC,MAAM,CAAC,CAAC;QACV,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC;SAAM,CAAC;QACP,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACxD,CAAC;AACF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAmB;IAC1D,OAAO,MAAgC,CAAC;AACzC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAC5B,MAAe,EACf,KAAe,EACf,CAAyB;IAEzB,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACzB,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;IACzB,MAAM,CAAC,SAAS,EAAE,CAAC;IACnB,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAC3B,MAAe,EACf,KAAa,EACb,CAAyB;IAEzB,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACxB,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;IACzB,MAAM,CAAC,QAAQ,EAAE,CAAC;IAClB,OAAO,MAAM,CAAC;AACf,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport type { FieldKey } from \"../schema-stored/index.js\";\n\nimport type { FieldUpPath, UpPath } from \"./pathTree.js\";\nimport type { TreeType, Value } from \"./types.js\";\n\n/**\n * A symbol for marking an object as an {@link ITreeCursor}.\n *\n * Useful when APIs want to take in tree data in multiple formats, including cursors.\n * @internal\n */\nexport const CursorMarker: unique symbol = Symbol(\"CursorMarker\");\n\n/**\n * Check if something is an {@link ITreeCursor}.\n *\n * Useful when APIs want to take in tree data in multiple formats, including cursors.\n */\nexport function isCursor(data: unknown): data is ITreeCursor {\n\t// Other than on null and undefined, looking up a missing symbol shouldn't type error.\n\t// typeof check deals with undefined while providing an early out for other non-object types.\n\treturn (\n\t\tdata !== null &&\n\t\ttypeof data === \"object\" &&\n\t\t(data as Partial<ITreeCursor>)[CursorMarker] === true\n\t);\n}\n\n/**\n * A stateful low-level interface for reading tree data.\n * @internal\n *\n * @remarks Cursor exists so that specialized data formats can be viewed through\n * a common abstraction. This allows performance optimizations to be done based\n * on data.\n *\n * A tree cursor is similar to a database cursor in that it allows for the efficient\n * traversal over the contents of a tree. Note that unlike a database cursor,\n * tree cursors may be invalidated after any edit to the tree. For a cursor-like\n * structure that also remains valid across edits, see {@link AnchorNode}.\n */\nexport interface ITreeCursor {\n\t/**\n\t * Marks this object as a cursor.\n\t */\n\treadonly [CursorMarker]: true;\n\n\t/**\n\t * What kind of place the cursor is at.\n\t * Determines which operations are allowed.\n\t *\n\t * @remarks\n\t * Users of cursors frequently need to refer to places in trees, both fields and nodes.\n\t * Approaches other than having the cursor have separate modes for these\n\t * cases had issues even worse than having the two modes.\n\t *\n\t * For example, modeling fields as parent + key has issues when there is no\n\t * parent, and doesn't provide a great way to do iteration over fields while\n\t * also having a nice API and making it easy for the implementation to track\n\t * state (like its current location inside a sequence tree of fields) while\n\t * traversing without having to allocate some state management for that.\n\t *\n\t * Another approach, of using arrays of cursors for fields (like we currently\n\t * do for inserting content) is very inefficient and better addressed by a\n\t * dual mode cursor.\n\t *\n\t * Another approach, of using the first node in a field when referring to\n\t * the field gets confusing since it's unclear if a given cursor means that\n\t * node, or that node, and the ones after it, and in the second case, it's\n\t * hard to restore the cursor back to the right state when returning. It also\n\t * doesn't work for empty fields. Overall there just didn't seem to be a way\n\t * that sucked less than the dual mode API.\n\t */\n\treadonly mode: CursorLocationType;\n\n\t/*\n\t * True iff the current field or node (depending on mode) is \"pending\",\n\t * meaning that it has not been downloaded.\n\t */\n\treadonly pending: boolean;\n\n\t// ********** APIs for when mode = Fields ********** //\n\n\t/**\n\t * Moves the \"current field\" forward one in an arbitrary field traversal order,\n\t * skipping any empty fields.\n\t *\n\t * If there is no remaining field to iterate to,\n\t * returns false and navigates up to the parent setting the mode to `Nodes`.\n\t *\n\t * Order of fields is only guaranteed to be consistent through a single iteration.\n\t *\n\t * If skipPending, skip past fields which are currently pending.\n\t * This can be used to skip to the end of a large number of consecutive pending fields.\n\t *\n\t * Allowed when `mode` is `Fields`.\n\t */\n\tnextField(): boolean;\n\n\t/**\n\t * Navigate up to parent node.\n\t * Sets mode to `Nodes`\n\t *\n\t * Only valid when `mode` is `Fields`.\n\t *\n\t * TODO: what to do if at root?\n\t */\n\texitField(): void;\n\n\t/**\n\t * Moves the \"current field\" forward until `pending` is `false`.\n\t *\n\t * If there are no remaining field to iterate to,\n\t * returns false and navigates up to the parent setting the mode to `Nodes`.\n\t *\n\t * Order of fields is only guaranteed to be consistent through a single iteration.\n\t *\n\t * Allowed when `mode` is `Fields`.\n\t */\n\tskipPendingFields(): boolean;\n\n\t// ********** APIs for when mode = Fields, and not pending ********** //\n\n\t/**\n\t * Returns the FieldKey for the current field.\n\t *\n\t * Allowed when `mode` is `Fields`, and not `pending`.\n\t */\n\tgetFieldKey(): FieldKey;\n\n\t/**\n\t * @returns the number of immediate children in the current field.\n\t *\n\t * Allowed when `mode` is `Fields`, and not `pending`.\n\t */\n\tgetFieldLength(): number;\n\n\t/**\n\t * Moves to the first node of the selected field, setting mode to `Nodes`.\n\t *\n\t * If field is empty, returns false instead.\n\t *\n\t * Allowed when `mode` is `Fields`, and not `pending`.\n\t */\n\tfirstNode(): boolean;\n\n\t/**\n\t * Sets current node to the node at the provided `index` of the current field.\n\t *\n\t * Allowed when `mode` is `Fields`, and not `pending`.\n\t * Sets mode to `Nodes`.\n\t */\n\tenterNode(childIndex: number): void;\n\n\t/**\n\t * Returns a path to the current field. See {@link FieldUpPath}.\n\t *\n\t * Only valid when `mode` is `Fields`.\n\t *\n\t * If no prefix is provided, assumes this cursor is treated as if it has a root node where its field keys are actually detached sequences.\n\t * If the cursor is not rooted at such a node, the `prefix` should be used to ensure the path has the correct root.\n\t * This requirement exists because {@link FieldUpPath}s are absolute paths\n\t * and thus must be rooted in a detached sequence.\n\t *\n\t * @param prefix - optional overrides to apply to the root of the returned path.\n\t * See {@link PathRootPrefix}.\n\t * This adjusts the path as if the tree data accessible to this cursor is part of a larger tree.\n\t *\n\t * @returns a path to the current field.\n\t */\n\tgetFieldPath(prefix?: PathRootPrefix): FieldUpPath;\n\n\t// ********** APIs for when mode = Nodes ********** //\n\n\t/**\n\t * Returns a path to the current node. See {@link UpPath}.\n\t *\n\t * Only valid when `mode` is `Nodes`.\n\t *\n\t * If no prefix is provided, assumes this cursor is treated as if it has a root node where its field keys are actually detached sequences.\n\t * If the cursor is not rooted at such a node, the `prefix` should be used to ensure the path has the correct root.\n\t * This requirement exists because {@link UpPath}s are absolute paths\n\t * and thus must be rooted in a detached sequence.\n\t *\n\t * @param prefix - optional overrides to apply to the root of the returned path.\n\t * See {@link PathRootPrefix}.\n\t * This adjusts the path as if the tree data accessible to this cursor is part of a larger tree.\n\t *\n\t * @returns a path to the current node.\n\t */\n\tgetPath(prefix?: PathRootPrefix): UpPath | undefined;\n\n\t/**\n\t * Index (within its parent field) of the current node.\n\t *\n\t * Only valid when `mode` is `Nodes`.\n\t */\n\treadonly fieldIndex: number;\n\n\t/**\n\t * Index (within its parent field) of the first node in the current chunk.\n\t * Always less than or equal to `currentIndexInField`.\n\t *\n\t * Only valid when `mode` is `Nodes`.\n\t */\n\treadonly chunkStart: number;\n\n\t/**\n\t * Length of current chunk.\n\t * Since an entire chunk always has the same `pending` value,\n\t * can be used to help skip over all of a pending chunk at once.\n\t *\n\t * TODO:\n\t * Add optional APIs to access underlying chunks so readers can\n\t * accelerate processing of chunk formats they understand.\n\t *\n\t * Only valid when `mode` is `Nodes`.\n\t */\n\treadonly chunkLength: number;\n\n\t/**\n\t * Moves `offset` nodes in the field.\n\t * If seeking to exactly past either end,\n\t * returns false and navigates up to the parent field (setting mode to `Fields`).\n\t *\n\t * Allowed if mode is `Nodes`.\n\t */\n\tseekNodes(offset: number): boolean;\n\n\t/**\n\t * The same as `seekNodes(1)`, but might be faster.\n\t */\n\tnextNode(): boolean;\n\n\t/**\n\t * Navigate up to parent field.\n\t * Sets mode to `Fields`\n\t *\n\t * Same as seek Number.POSITIVE_INFINITY, but only valid when `mode` is `Nodes`.\n\t *\n\t * TODO: what to do if at root?\n\t * TODO: Maybe merge with upToNode to make a single \"Up\"?\n\t */\n\texitNode(): void;\n\n\t// ********** APIs for when mode = Nodes and not pending ********** //\n\n\t/**\n\t * Enters the first non-empty field (setting mode to `Fields`)\n\t * so fields can be iterated with `nextField` and `skipPendingFields`.\n\t *\n\t * If there are no fields, mode is returned to `Nodes` and false is returned.\n\t *\n\t * Allowed when `mode` is `Nodes` and not `pending`.\n\t */\n\tfirstField(): boolean;\n\n\t/**\n\t * Navigate to the field with the specified `key` and set the mode to `Fields`.\n\t *\n\t * Only valid when `mode` is `Nodes`, and not `pending`.\n\t */\n\tenterField(key: FieldKey): void;\n\n\t/**\n\t * The type of the currently selected node.\n\t *\n\t * Only valid when `mode` is `Nodes`, and not `pending`.\n\t */\n\treadonly type: TreeType;\n\n\t/**\n\t * The value associated with the currently selected node.\n\t *\n\t * Only valid when `mode` is `Nodes`, and not `pending`.\n\t */\n\treadonly value: Value;\n}\n\n/**\n * Prefix to apply as the root of a {@link UpPath} or {@link FieldUpPath}.\n *\n * @remarks This can be used to take a path relative to a subtree, and make it relative to a larger containing tree.\n * For example, if a node is being inserted in the 5th position in a field \"Foo\", you can update a path in that node's subtree to its new path by prefixing it with\n * `{ parent: theNodeAboveTheMovedNode, rootFieldOverride: Foo, indexOffset: 5 }`.\n * See {@link prefixPath} and {@link prefixFieldPath} for how to apply the prefix to the paths.\n * @internal\n */\nexport interface PathRootPrefix {\n\t/**\n\t * The new parent to place above root of the path which is being prefixed.\n\t * This replaces the `undefined` at the root of the path.\n\t *\n\t * @remarks specifying `undefined` here results in no change to the path.\n\t */\n\tparent?: UpPath | undefined;\n\n\t/**\n\t * The field of `parent` that the original path will be included under.\n\t *\n\t * If `undefined` the root field key from the original path will be used.\n\t */\n\trootFieldOverride?: FieldKey;\n\n\t/**\n\t * Offset to add to the uppermost `parentIndex` in the original path.\n\t */\n\tindexOffset?: number;\n}\n\n/**\n * @internal\n */\nexport const enum CursorLocationType {\n\t/**\n\t * Can iterate through nodes in a field.\n\t * At a \"current node\".\n\t */\n\tNodes,\n\n\t/**\n\t * Can iterate through fields of a node.\n\t * At a \"current field\".\n\t */\n\tFields,\n}\n\n/**\n * {@link ITreeCursor} that is never pending.\n * @internal\n */\nexport interface ITreeCursorSynchronous extends ITreeCursor {\n\treadonly pending: false;\n}\n\n/**\n * @param cursor - tree whose fields will be visited.\n * @param f - builds output from field, which will be selected in cursor when cursor is provided.\n * If `f` moves cursor, it must put it back to where it was at the beginning of `f` before returning.\n * @returns array resulting from applying `f` to each field of the current node on `cursor`.\n * Returns an empty array if the node is empty or not present (which are considered the same).\n * Note that order is not specified for field iteration.\n */\nexport function mapCursorFields<T, TCursor extends ITreeCursor = ITreeCursor>(\n\tcursor: TCursor,\n\tf: (cursor: TCursor) => T,\n): T[] {\n\tconst output: T[] = [];\n\tforEachField(cursor, (c) => {\n\t\toutput.push(f(c));\n\t});\n\treturn output;\n}\n\n/**\n * @param cursor - cursor at a node whose fields will be visited.\n * @param f - For on each field.\n * If `f` moves cursor, it must put it back to where it was at the beginning of `f` before returning.\n */\nexport function forEachField<TCursor extends ITreeCursor = ITreeCursor>(\n\tcursor: TCursor,\n\tf: (cursor: TCursor) => void,\n): void {\n\tassert(cursor.mode === CursorLocationType.Nodes, 0x411 /* should be in nodes */);\n\tfor (let inField = cursor.firstField(); inField; inField = cursor.nextField()) {\n\t\tf(cursor);\n\t}\n}\n\n/**\n * @param cursor - tree whose field will be visited.\n * @param f - builds output from field member, which will be selected in cursor when cursor is provided.\n * If `f` moves cursor, it must put it back to where it was at the beginning of `f` before returning.\n * @returns array resulting from applying `f` to each item of the current field on `cursor`.\n * Returns an empty array if the field is empty or not present (which are considered the same).\n */\nexport function mapCursorField<T, TCursor extends ITreeCursor = ITreeCursor>(\n\tcursor: TCursor,\n\tf: (cursor: TCursor) => T,\n): T[] {\n\tconst output: T[] = [];\n\tforEachNode(cursor, (c) => {\n\t\toutput.push(f(c));\n\t});\n\treturn output;\n}\n\n/**\n * @param cursor - The tree whose field will be visited.\n * @param f - Builds output from field member, which will be selected in cursor when cursor is provided.\n * If `f` moves cursor, it must put it back to where it was at the beginning of `f` before returning.\n * @returns An iterable of `T` resulting from applying `f` to each item of the current field on `cursor`.\n * Yields nothing if an empty array if the field is empty or not present (which are considered the same).\n */\nexport function* iterateCursorField<T, TCursor extends ITreeCursor = ITreeCursor>(\n\tcursor: TCursor,\n\tf: (cursor: TCursor) => T,\n): IterableIterator<T> {\n\tassert(cursor.mode === CursorLocationType.Fields, 0x7a8 /* should be in fields */);\n\tfor (let inNodes = cursor.firstNode(); inNodes; inNodes = cursor.nextNode()) {\n\t\tyield f(cursor);\n\t}\n}\n\n/**\n * @param cursor - cursor at a field whose nodes will be visited.\n * @param f - For on each node.\n * If `f` moves cursor, it must put it back to where it was at the beginning of `f` before returning.\n */\nexport function forEachNode<TCursor extends ITreeCursor = ITreeCursor>(\n\tcursor: TCursor,\n\tf: (cursor: TCursor) => void,\n): void {\n\tassert(cursor.mode === CursorLocationType.Fields, 0x3bd /* should be in fields */);\n\tfor (let inNodes = cursor.firstNode(); inNodes; inNodes = cursor.nextNode()) {\n\t\tf(cursor);\n\t}\n}\n\n/**\n * @param cursor - cursor at a field or node.\n * @param f - Function to invoke for each node.\n * If `f` moves the cursor, it must put it back to where it was at the beginning of `f` before returning.\n *\n * Invokes `f` on each node in the subtree rooted at the current field or node.\n * Traversal is pre-order.\n * If the cursor is at a node, `f` will be invoked on that node.\n *\n * Returns the `cursor` to its initial position.\n */\nexport function forEachNodeInSubtree<TCursor extends ITreeCursor = ITreeCursor>(\n\tcursor: TCursor,\n\tf: (cursor: TCursor) => void,\n): void {\n\tif (cursor.mode === CursorLocationType.Nodes) {\n\t\tf(cursor);\n\t\tforEachField(cursor, (c) => forEachNodeInSubtree(c, f));\n\t} else {\n\t\tforEachNode(cursor, (c) => forEachNodeInSubtree(c, f));\n\t}\n}\n\n/**\n * Casts a cursor to an {@link ITreeCursorSynchronous}.\n *\n * TODO: #1404: Handle this properly for partial data loading support.\n */\nexport function castCursorToSynchronous(cursor: ITreeCursor): ITreeCursorSynchronous {\n\treturn cursor as ITreeCursorSynchronous;\n}\n\n/**\n * Runs `f` inside of field `field` on `cursor`.\n * @param cursor - Cursor whose field to enter and exit. Must be in `nodes` mode.\n * @param field - Field to enter.\n * @param f - Callback to run when in field.\n * @returns return value of `f`\n */\nexport function inCursorField<T, TCursor extends ITreeCursor = ITreeCursor>(\n\tcursor: TCursor,\n\tfield: FieldKey,\n\tf: (cursor: TCursor) => T,\n): T {\n\tcursor.enterField(field);\n\tconst result = f(cursor);\n\tcursor.exitField();\n\treturn result;\n}\n\n/**\n * Runs `f` inside of node `index` on `cursor`.\n * @param cursor - Cursor whoso node to enter and exit. Must be in `fields` mode.\n * @param index - Node to enter.\n * @param f - Callback to run when in node.\n * @returns return value of `f`\n */\nexport function inCursorNode<T, TCursor extends ITreeCursor = ITreeCursor>(\n\tcursor: TCursor,\n\tindex: number,\n\tf: (cursor: TCursor) => T,\n): T {\n\tcursor.enterNode(index);\n\tconst result = f(cursor);\n\tcursor.exitNode();\n\treturn result;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../src/core/tree/cursor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAO7D;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAkB,MAAM,CAAC,cAAc,CAAC,CAAC;AAElE;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAa;IACrC,sFAAsF;IACtF,6FAA6F;IAC7F,OAAO,CACN,IAAI,KAAK,IAAI;QACb,OAAO,IAAI,KAAK,QAAQ;QACvB,IAA6B,CAAC,YAAY,CAAC,KAAK,IAAI,CACrD,CAAC;AACH,CAAC;AA0RD;GACG;AACH,MAAM,CAAN,IAAkB,kBAYjB;AAZD,WAAkB,kBAAkB;IACnC;;;OAGG;IACH,6DAAK,CAAA;IAEL;;;OAGG;IACH,+DAAM,CAAA;AACP,CAAC,EAZiB,kBAAkB,KAAlB,kBAAkB,QAYnC;AASD;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAC9B,MAAe,EACf,CAAyB;IAEzB,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE;QAC1B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAC3B,MAAe,EACf,CAA4B;IAE5B,MAAM,CAAC,MAAM,CAAC,IAAI,qCAA6B,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACjF,KAAK,IAAI,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC;QAC/E,CAAC,CAAC,MAAM,CAAC,CAAC;IACX,CAAC;AACF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC7B,MAAe,EACf,CAAyB;IAEzB,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE;QACzB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;;;;;GAMG;AACH,MAAM,SAAS,CAAC,CAAC,kBAAkB,CAClC,MAAe,EACf,CAAyB;IAEzB,MAAM,CAAC,MAAM,CAAC,IAAI,sCAA8B,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACnF,KAAK,IAAI,OAAO,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;QAC7E,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC;AACF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAC1B,MAAe,EACf,CAA4B;IAE5B,MAAM,CAAC,MAAM,CAAC,IAAI,sCAA8B,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACnF,KAAK,IAAI,OAAO,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;QAC7E,CAAC,CAAC,MAAM,CAAC,CAAC;IACX,CAAC;AACF,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,oBAAoB,CACnC,MAAe,EACf,CAA4B;IAE5B,IAAI,MAAM,CAAC,IAAI,qCAA6B,EAAE,CAAC;QAC9C,CAAC,CAAC,MAAM,CAAC,CAAC;QACV,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC;SAAM,CAAC;QACP,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACxD,CAAC;AACF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAmB;IAC1D,OAAO,MAAgC,CAAC;AACzC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAC5B,MAAe,EACf,KAAe,EACf,CAAyB;IAEzB,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACzB,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;IACzB,MAAM,CAAC,SAAS,EAAE,CAAC;IACnB,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAC3B,MAAe,EACf,KAAa,EACb,CAAyB;IAEzB,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACxB,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;IACzB,MAAM,CAAC,QAAQ,EAAE,CAAC;IAClB,OAAO,MAAM,CAAC;AACf,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport type { FieldKey } from \"../schema-stored/index.js\";\n\nimport type { FieldUpPath, UpPath } from \"./pathTree.js\";\nimport type { TreeType, Value } from \"./types.js\";\n\n/**\n * A symbol for marking an object as an {@link ITreeCursor}.\n *\n * Useful when APIs want to take in tree data in multiple formats, including cursors.\n */\nexport const CursorMarker: unique symbol = Symbol(\"CursorMarker\");\n\n/**\n * Check if something is an {@link ITreeCursor}.\n *\n * Useful when APIs want to take in tree data in multiple formats, including cursors.\n */\nexport function isCursor(data: unknown): data is ITreeCursor {\n\t// Other than on null and undefined, looking up a missing symbol shouldn't type error.\n\t// typeof check deals with undefined while providing an early out for other non-object types.\n\treturn (\n\t\tdata !== null &&\n\t\ttypeof data === \"object\" &&\n\t\t(data as Partial<ITreeCursor>)[CursorMarker] === true\n\t);\n}\n\n/**\n * A stateful low-level interface for reading tree data.\n * *\n * @remarks Cursor exists so that specialized data formats can be viewed through\n * a common abstraction. This allows performance optimizations to be done based\n * on data.\n *\n * A tree cursor is similar to a database cursor in that it allows for the efficient\n * traversal over the contents of a tree. Note that unlike a database cursor,\n * tree cursors may be invalidated after any edit to the tree. For a cursor-like\n * structure that also remains valid across edits, see {@link AnchorNode}.\n */\nexport interface ITreeCursor {\n\t/**\n\t * Marks this object as a cursor.\n\t */\n\treadonly [CursorMarker]: true;\n\n\t/**\n\t * What kind of place the cursor is at.\n\t * Determines which operations are allowed.\n\t *\n\t * @remarks\n\t * Users of cursors frequently need to refer to places in trees, both fields and nodes.\n\t * Approaches other than having the cursor have separate modes for these\n\t * cases had issues even worse than having the two modes.\n\t *\n\t * For example, modeling fields as parent + key has issues when there is no\n\t * parent, and doesn't provide a great way to do iteration over fields while\n\t * also having a nice API and making it easy for the implementation to track\n\t * state (like its current location inside a sequence tree of fields) while\n\t * traversing without having to allocate some state management for that.\n\t *\n\t * Another approach, of using arrays of cursors for fields (like we currently\n\t * do for inserting content) is very inefficient and better addressed by a\n\t * dual mode cursor.\n\t *\n\t * Another approach, of using the first node in a field when referring to\n\t * the field gets confusing since it's unclear if a given cursor means that\n\t * node, or that node, and the ones after it, and in the second case, it's\n\t * hard to restore the cursor back to the right state when returning. It also\n\t * doesn't work for empty fields. Overall there just didn't seem to be a way\n\t * that sucked less than the dual mode API.\n\t */\n\treadonly mode: CursorLocationType;\n\n\t/*\n\t * True iff the current field or node (depending on mode) is \"pending\",\n\t * meaning that it has not been downloaded.\n\t */\n\treadonly pending: boolean;\n\n\t// ********** APIs for when mode = Fields ********** //\n\n\t/**\n\t * Moves the \"current field\" forward one in an arbitrary field traversal order,\n\t * skipping any empty fields.\n\t *\n\t * If there is no remaining field to iterate to,\n\t * returns false and navigates up to the parent setting the mode to `Nodes`.\n\t *\n\t * Order of fields is only guaranteed to be consistent through a single iteration.\n\t *\n\t * If skipPending, skip past fields which are currently pending.\n\t * This can be used to skip to the end of a large number of consecutive pending fields.\n\t *\n\t * Allowed when `mode` is `Fields`.\n\t */\n\tnextField(): boolean;\n\n\t/**\n\t * Navigate up to parent node.\n\t * Sets mode to `Nodes`\n\t *\n\t * Only valid when `mode` is `Fields`.\n\t *\n\t * TODO: what to do if at root?\n\t */\n\texitField(): void;\n\n\t/**\n\t * Moves the \"current field\" forward until `pending` is `false`.\n\t *\n\t * If there are no remaining field to iterate to,\n\t * returns false and navigates up to the parent setting the mode to `Nodes`.\n\t *\n\t * Order of fields is only guaranteed to be consistent through a single iteration.\n\t *\n\t * Allowed when `mode` is `Fields`.\n\t */\n\tskipPendingFields(): boolean;\n\n\t// ********** APIs for when mode = Fields, and not pending ********** //\n\n\t/**\n\t * Returns the FieldKey for the current field.\n\t *\n\t * Allowed when `mode` is `Fields`, and not `pending`.\n\t */\n\tgetFieldKey(): FieldKey;\n\n\t/**\n\t * @returns the number of immediate children in the current field.\n\t *\n\t * Allowed when `mode` is `Fields`, and not `pending`.\n\t */\n\tgetFieldLength(): number;\n\n\t/**\n\t * Moves to the first node of the selected field, setting mode to `Nodes`.\n\t *\n\t * If field is empty, returns false instead.\n\t *\n\t * Allowed when `mode` is `Fields`, and not `pending`.\n\t */\n\tfirstNode(): boolean;\n\n\t/**\n\t * Sets current node to the node at the provided `index` of the current field.\n\t *\n\t * Allowed when `mode` is `Fields`, and not `pending`.\n\t * Sets mode to `Nodes`.\n\t */\n\tenterNode(childIndex: number): void;\n\n\t/**\n\t * Returns a path to the current field. See {@link FieldUpPath}.\n\t *\n\t * Only valid when `mode` is `Fields`.\n\t *\n\t * If no prefix is provided, assumes this cursor is treated as if it has a root node where its field keys are actually detached sequences.\n\t * If the cursor is not rooted at such a node, the `prefix` should be used to ensure the path has the correct root.\n\t * This requirement exists because {@link FieldUpPath}s are absolute paths\n\t * and thus must be rooted in a detached sequence.\n\t *\n\t * @param prefix - optional overrides to apply to the root of the returned path.\n\t * See {@link PathRootPrefix}.\n\t * This adjusts the path as if the tree data accessible to this cursor is part of a larger tree.\n\t *\n\t * @returns a path to the current field.\n\t */\n\tgetFieldPath(prefix?: PathRootPrefix): FieldUpPath;\n\n\t// ********** APIs for when mode = Nodes ********** //\n\n\t/**\n\t * Returns a path to the current node. See {@link UpPath}.\n\t *\n\t * Only valid when `mode` is `Nodes`.\n\t *\n\t * If no prefix is provided, assumes this cursor is treated as if it has a root node where its field keys are actually detached sequences.\n\t * If the cursor is not rooted at such a node, the `prefix` should be used to ensure the path has the correct root.\n\t * This requirement exists because {@link UpPath}s are absolute paths\n\t * and thus must be rooted in a detached sequence.\n\t *\n\t * @param prefix - optional overrides to apply to the root of the returned path.\n\t * See {@link PathRootPrefix}.\n\t * This adjusts the path as if the tree data accessible to this cursor is part of a larger tree.\n\t *\n\t * @returns a path to the current node.\n\t */\n\tgetPath(prefix?: PathRootPrefix): UpPath | undefined;\n\n\t/**\n\t * Index (within its parent field) of the current node.\n\t *\n\t * Only valid when `mode` is `Nodes`.\n\t */\n\treadonly fieldIndex: number;\n\n\t/**\n\t * Index (within its parent field) of the first node in the current chunk.\n\t * Always less than or equal to `currentIndexInField`.\n\t *\n\t * Only valid when `mode` is `Nodes`.\n\t */\n\treadonly chunkStart: number;\n\n\t/**\n\t * Length of current chunk.\n\t * Since an entire chunk always has the same `pending` value,\n\t * can be used to help skip over all of a pending chunk at once.\n\t *\n\t * TODO:\n\t * Add optional APIs to access underlying chunks so readers can\n\t * accelerate processing of chunk formats they understand.\n\t *\n\t * Only valid when `mode` is `Nodes`.\n\t */\n\treadonly chunkLength: number;\n\n\t/**\n\t * Moves `offset` nodes in the field.\n\t * If seeking to exactly past either end,\n\t * returns false and navigates up to the parent field (setting mode to `Fields`).\n\t *\n\t * Allowed if mode is `Nodes`.\n\t */\n\tseekNodes(offset: number): boolean;\n\n\t/**\n\t * The same as `seekNodes(1)`, but might be faster.\n\t */\n\tnextNode(): boolean;\n\n\t/**\n\t * Navigate up to parent field.\n\t * Sets mode to `Fields`\n\t *\n\t * Same as seek Number.POSITIVE_INFINITY, but only valid when `mode` is `Nodes`.\n\t *\n\t * TODO: what to do if at root?\n\t * TODO: Maybe merge with upToNode to make a single \"Up\"?\n\t */\n\texitNode(): void;\n\n\t// ********** APIs for when mode = Nodes and not pending ********** //\n\n\t/**\n\t * Enters the first non-empty field (setting mode to `Fields`)\n\t * so fields can be iterated with `nextField` and `skipPendingFields`.\n\t *\n\t * If there are no fields, mode is returned to `Nodes` and false is returned.\n\t *\n\t * Allowed when `mode` is `Nodes` and not `pending`.\n\t */\n\tfirstField(): boolean;\n\n\t/**\n\t * Navigate to the field with the specified `key` and set the mode to `Fields`.\n\t *\n\t * Only valid when `mode` is `Nodes`, and not `pending`.\n\t */\n\tenterField(key: FieldKey): void;\n\n\t/**\n\t * The type of the currently selected node.\n\t *\n\t * Only valid when `mode` is `Nodes`, and not `pending`.\n\t */\n\treadonly type: TreeType;\n\n\t/**\n\t * The value associated with the currently selected node.\n\t *\n\t * Only valid when `mode` is `Nodes`, and not `pending`.\n\t */\n\treadonly value: Value;\n}\n\n/**\n * Prefix to apply as the root of a {@link UpPath} or {@link FieldUpPath}.\n *\n * @remarks This can be used to take a path relative to a subtree, and make it relative to a larger containing tree.\n * For example, if a node is being inserted in the 5th position in a field \"Foo\", you can update a path in that node's subtree to its new path by prefixing it with\n * `{ parent: theNodeAboveTheMovedNode, rootFieldOverride: Foo, indexOffset: 5 }`.\n * See {@link prefixPath} and {@link prefixFieldPath} for how to apply the prefix to the paths.\n */\nexport interface PathRootPrefix {\n\t/**\n\t * The new parent to place above root of the path which is being prefixed.\n\t * This replaces the `undefined` at the root of the path.\n\t *\n\t * @remarks specifying `undefined` here results in no change to the path.\n\t */\n\tparent?: UpPath | undefined;\n\n\t/**\n\t * The field of `parent` that the original path will be included under.\n\t *\n\t * If `undefined` the root field key from the original path will be used.\n\t */\n\trootFieldOverride?: FieldKey;\n\n\t/**\n\t * Offset to add to the uppermost `parentIndex` in the original path.\n\t */\n\tindexOffset?: number;\n}\n\n/**\n */\nexport const enum CursorLocationType {\n\t/**\n\t * Can iterate through nodes in a field.\n\t * At a \"current node\".\n\t */\n\tNodes,\n\n\t/**\n\t * Can iterate through fields of a node.\n\t * At a \"current field\".\n\t */\n\tFields,\n}\n\n/**\n * {@link ITreeCursor} that is never pending.\n */\nexport interface ITreeCursorSynchronous extends ITreeCursor {\n\treadonly pending: false;\n}\n\n/**\n * @param cursor - tree whose fields will be visited.\n * @param f - builds output from field, which will be selected in cursor when cursor is provided.\n * If `f` moves cursor, it must put it back to where it was at the beginning of `f` before returning.\n * @returns array resulting from applying `f` to each field of the current node on `cursor`.\n * Returns an empty array if the node is empty or not present (which are considered the same).\n * Note that order is not specified for field iteration.\n */\nexport function mapCursorFields<T, TCursor extends ITreeCursor = ITreeCursor>(\n\tcursor: TCursor,\n\tf: (cursor: TCursor) => T,\n): T[] {\n\tconst output: T[] = [];\n\tforEachField(cursor, (c) => {\n\t\toutput.push(f(c));\n\t});\n\treturn output;\n}\n\n/**\n * @param cursor - cursor at a node whose fields will be visited.\n * @param f - For on each field.\n * If `f` moves cursor, it must put it back to where it was at the beginning of `f` before returning.\n */\nexport function forEachField<TCursor extends ITreeCursor = ITreeCursor>(\n\tcursor: TCursor,\n\tf: (cursor: TCursor) => void,\n): void {\n\tassert(cursor.mode === CursorLocationType.Nodes, 0x411 /* should be in nodes */);\n\tfor (let inField = cursor.firstField(); inField; inField = cursor.nextField()) {\n\t\tf(cursor);\n\t}\n}\n\n/**\n * @param cursor - tree whose field will be visited.\n * @param f - builds output from field member, which will be selected in cursor when cursor is provided.\n * If `f` moves cursor, it must put it back to where it was at the beginning of `f` before returning.\n * @returns array resulting from applying `f` to each item of the current field on `cursor`.\n * Returns an empty array if the field is empty or not present (which are considered the same).\n */\nexport function mapCursorField<T, TCursor extends ITreeCursor = ITreeCursor>(\n\tcursor: TCursor,\n\tf: (cursor: TCursor) => T,\n): T[] {\n\tconst output: T[] = [];\n\tforEachNode(cursor, (c) => {\n\t\toutput.push(f(c));\n\t});\n\treturn output;\n}\n\n/**\n * @param cursor - The tree whose field will be visited.\n * @param f - Builds output from field member, which will be selected in cursor when cursor is provided.\n * If `f` moves cursor, it must put it back to where it was at the beginning of `f` before returning.\n * @returns An iterable of `T` resulting from applying `f` to each item of the current field on `cursor`.\n * Yields nothing if an empty array if the field is empty or not present (which are considered the same).\n */\nexport function* iterateCursorField<T, TCursor extends ITreeCursor = ITreeCursor>(\n\tcursor: TCursor,\n\tf: (cursor: TCursor) => T,\n): IterableIterator<T> {\n\tassert(cursor.mode === CursorLocationType.Fields, 0x7a8 /* should be in fields */);\n\tfor (let inNodes = cursor.firstNode(); inNodes; inNodes = cursor.nextNode()) {\n\t\tyield f(cursor);\n\t}\n}\n\n/**\n * @param cursor - cursor at a field whose nodes will be visited.\n * @param f - For on each node.\n * If `f` moves cursor, it must put it back to where it was at the beginning of `f` before returning.\n */\nexport function forEachNode<TCursor extends ITreeCursor = ITreeCursor>(\n\tcursor: TCursor,\n\tf: (cursor: TCursor) => void,\n): void {\n\tassert(cursor.mode === CursorLocationType.Fields, 0x3bd /* should be in fields */);\n\tfor (let inNodes = cursor.firstNode(); inNodes; inNodes = cursor.nextNode()) {\n\t\tf(cursor);\n\t}\n}\n\n/**\n * @param cursor - cursor at a field or node.\n * @param f - Function to invoke for each node.\n * If `f` moves the cursor, it must put it back to where it was at the beginning of `f` before returning.\n *\n * Invokes `f` on each node in the subtree rooted at the current field or node.\n * Traversal is pre-order.\n * If the cursor is at a node, `f` will be invoked on that node.\n *\n * Returns the `cursor` to its initial position.\n */\nexport function forEachNodeInSubtree<TCursor extends ITreeCursor = ITreeCursor>(\n\tcursor: TCursor,\n\tf: (cursor: TCursor) => void,\n): void {\n\tif (cursor.mode === CursorLocationType.Nodes) {\n\t\tf(cursor);\n\t\tforEachField(cursor, (c) => forEachNodeInSubtree(c, f));\n\t} else {\n\t\tforEachNode(cursor, (c) => forEachNodeInSubtree(c, f));\n\t}\n}\n\n/**\n * Casts a cursor to an {@link ITreeCursorSynchronous}.\n *\n * TODO: #1404: Handle this properly for partial data loading support.\n */\nexport function castCursorToSynchronous(cursor: ITreeCursor): ITreeCursorSynchronous {\n\treturn cursor as ITreeCursorSynchronous;\n}\n\n/**\n * Runs `f` inside of field `field` on `cursor`.\n * @param cursor - Cursor whose field to enter and exit. Must be in `nodes` mode.\n * @param field - Field to enter.\n * @param f - Callback to run when in field.\n * @returns return value of `f`\n */\nexport function inCursorField<T, TCursor extends ITreeCursor = ITreeCursor>(\n\tcursor: TCursor,\n\tfield: FieldKey,\n\tf: (cursor: TCursor) => T,\n): T {\n\tcursor.enterField(field);\n\tconst result = f(cursor);\n\tcursor.exitField();\n\treturn result;\n}\n\n/**\n * Runs `f` inside of node `index` on `cursor`.\n * @param cursor - Cursor whoso node to enter and exit. Must be in `fields` mode.\n * @param index - Node to enter.\n * @param f - Callback to run when in node.\n * @returns return value of `f`\n */\nexport function inCursorNode<T, TCursor extends ITreeCursor = ITreeCursor>(\n\tcursor: TCursor,\n\tindex: number,\n\tf: (cursor: TCursor) => T,\n): T {\n\tcursor.enterNode(index);\n\tconst result = f(cursor);\n\tcursor.exitNode();\n\treturn result;\n}\n"]}
|
package/lib/core/tree/delta.d.ts
CHANGED
|
@@ -65,7 +65,6 @@ import type { ITreeCursorSynchronous } from "./cursor.js";
|
|
|
65
65
|
/**
|
|
66
66
|
* Represents the change made to a document.
|
|
67
67
|
* Immutable, therefore safe to retain for async processing.
|
|
68
|
-
* @internal
|
|
69
68
|
*/
|
|
70
69
|
export interface Root<TTree = ProtoNode> {
|
|
71
70
|
/**
|
|
@@ -103,7 +102,6 @@ export interface Root<TTree = ProtoNode> {
|
|
|
103
102
|
* Ownership and lifetime of data referenced by this cursor is unclear,
|
|
104
103
|
* so it is a poor abstraction for this use-case which needs to hold onto the data in a non-exclusive (readonly) way.
|
|
105
104
|
* Cursors can be one supported way to input data, but aren't a good storage format.
|
|
106
|
-
* @internal
|
|
107
105
|
*/
|
|
108
106
|
export type ProtoNode = ITreeCursorSynchronous;
|
|
109
107
|
/**
|
|
@@ -114,12 +112,10 @@ export type ProtoNode = ITreeCursorSynchronous;
|
|
|
114
112
|
* Additionally, Cursors support sequences, so if using cursors, there are better ways to handle this than an array of cursors,
|
|
115
113
|
* like using a cursor over all the content (starting in fields mode).
|
|
116
114
|
* Long term something like TreeChunk should probably be used here.
|
|
117
|
-
* @internal
|
|
118
115
|
*/
|
|
119
116
|
export type ProtoNodes = readonly ProtoNode[];
|
|
120
117
|
/**
|
|
121
118
|
* Represents a change being made to a part of the document tree.
|
|
122
|
-
* @internal
|
|
123
119
|
*/
|
|
124
120
|
export interface Mark {
|
|
125
121
|
/**
|
|
@@ -145,19 +141,16 @@ export interface Mark {
|
|
|
145
141
|
}
|
|
146
142
|
/**
|
|
147
143
|
* A globally unique ID for a node in a detached field.
|
|
148
|
-
* @internal
|
|
149
144
|
*/
|
|
150
145
|
export interface DetachedNodeId {
|
|
151
146
|
readonly major?: RevisionTag;
|
|
152
147
|
readonly minor: number;
|
|
153
148
|
}
|
|
154
149
|
/**
|
|
155
|
-
* @internal
|
|
156
150
|
*/
|
|
157
151
|
export type FieldMap = ReadonlyMap<FieldKey, FieldChanges>;
|
|
158
152
|
/**
|
|
159
153
|
* Represents changes made to a detached node
|
|
160
|
-
* @internal
|
|
161
154
|
*/
|
|
162
155
|
export interface DetachedNodeChanges {
|
|
163
156
|
readonly id: DetachedNodeId;
|
|
@@ -168,7 +161,6 @@ export interface DetachedNodeChanges {
|
|
|
168
161
|
*
|
|
169
162
|
* Tree creation is idempotent: if a tree with the same ID already exists,
|
|
170
163
|
* then this build is ignored in favor of the existing tree.
|
|
171
|
-
* @internal
|
|
172
164
|
*/
|
|
173
165
|
export interface DetachedNodeBuild<TTree = ProtoNode> {
|
|
174
166
|
readonly id: DetachedNodeId;
|
|
@@ -176,7 +168,6 @@ export interface DetachedNodeBuild<TTree = ProtoNode> {
|
|
|
176
168
|
}
|
|
177
169
|
/**
|
|
178
170
|
* Represents the destruction of detached nodes
|
|
179
|
-
* @internal
|
|
180
171
|
*/
|
|
181
172
|
export interface DetachedNodeDestruction {
|
|
182
173
|
readonly id: DetachedNodeId;
|
|
@@ -184,7 +175,6 @@ export interface DetachedNodeDestruction {
|
|
|
184
175
|
}
|
|
185
176
|
/**
|
|
186
177
|
* Represents a detached node being assigned a new `DetachedNodeId`.
|
|
187
|
-
* @internal
|
|
188
178
|
*/
|
|
189
179
|
export interface DetachedNodeRename {
|
|
190
180
|
readonly count: number;
|
|
@@ -193,7 +183,6 @@ export interface DetachedNodeRename {
|
|
|
193
183
|
}
|
|
194
184
|
/**
|
|
195
185
|
* Represents the changes to perform on a given field.
|
|
196
|
-
* @internal
|
|
197
186
|
*/
|
|
198
187
|
export interface FieldChanges {
|
|
199
188
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delta.d.ts","sourceRoot":"","sources":["../../../src/core/tree/delta.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH
|
|
1
|
+
{"version":3,"file":"delta.d.ts","sourceRoot":"","sources":["../../../src/core/tree/delta.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH;;;GAGG;AACH,MAAM,WAAW,IAAI,CAAC,KAAK,GAAG,SAAS;IACtC;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC;IAC3B;;;;;;;OAOG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;IACrD;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACtD;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;CAC1D;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GAAG,sBAAsB,CAAC;AAE/C;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,SAAS,EAAE,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,IAAI;IACpB;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC;IAEjC;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED;GACG;AACH,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,EAAE,EAAE,cAAc,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;CAC1B;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB,CAAC,KAAK,GAAG,SAAS;IACnD,QAAQ,CAAC,EAAE,EAAE,cAAc,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,SAAS,KAAK,EAAE,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC,QAAQ,CAAC,EAAE,EAAE,cAAc,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,IAAI,EAAE,CAAC;IACjC;;;;;;;OAOG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACjD;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;CAChD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delta.js","sourceRoot":"","sources":["../../../src/core/tree/delta.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { RevisionTag } from \"../rebase/index.js\";\nimport type { FieldKey } from \"../schema-stored/index.js\";\n\nimport type { ITreeCursorSynchronous } from \"./cursor.js\";\n\n/**\n * This format describes changes that must be applied to a forest in order to update it.\n * Instances of this format are generated based on incoming changesets and consumed by a view layer (e.g., Forest) to\n * update itself.\n *\n * Because this format is only meant for updating document state, it does not fully represent user intentions.\n * For example, if some concurrent edits A and B insert content at the same location, then a Delta that represents\n * represents the state update for edit A would not include information that allows B's insertion to be ordered\n * relative to A's insertion. This format is therefore not fit to be rebased in the face of concurrent changes.\n * Instead this format is used to describe the end product of rebasing user intentions over concurrent edits.\n *\n * This format is self-contained in the following ways:\n *\n * 1. It uses integer indices (offsets, technically) to describe the locations of necessary changes.\n * As such, it does not rely on document nodes being accessible/locatable by ID.\n *\n * 2. This format does not require historical information in order to apply the changes it describes.\n * For example, if a user undoes the deletion of a subtree, then the Delta generated for the undo edit will contain all\n * information necessary to restore that subtree.\n *\n * This format can be generated from any Changeset without having access to the current document state.\n *\n * This format is meant to serve as the lowest common denominator to represent state changes resulting from any kind\n * of operation on any kind of field.\n * This means all such operations must be expressible in terms of this format.\n *\n * Within the above design constrains, this format is designed with the following goals in mind:\n *\n * 1. Make it easy to walk both a document tree and the delta tree to apply the changes described in the delta\n * with a minimum amount of backtracking over the contents of the tree.\n * This a boon for both code simplicity and performance.\n *\n * 2. Make the format terse.\n *\n * 3. Make the format uniform.\n *\n * These goals are reflected in the following design choices (this is very much optional reading for users of this\n * format):\n *\n * 1. All marks that apply to field elements are represented in a single linear structure where marks that affect later\n * elements of the document field appear after marks that affect earlier elements of the document field.\n *\n * If the marks were not ordered in this fashion then a consumer would need to backtrack within the document field.\n *\n * If the marks were represented in multiple such linear structures then it would be necessary to either:\n * - backtrack when iterating over one structure fully, then the next\n * - maintain a pointer within each such linear structure and advance them in lock-step (like in a k-way merge-sort but\n * more fiddly because of the offsets).\n *\n * 2. Nested changes are not inlined within `ProtoNode`s.\n *\n * Inlining them would force the consuming code to detect such changes within the `ProtoNode` and handle them\n * within the context of the content creation.\n * This would be cumbersome because either the code that is responsible for consuming the `ProtoNode` would need to\n * be aware of and have the context to handle such changes, or some caller of that code would need to find and extract such\n * change information ahead to calling that code.\n */\n\n/**\n * Represents the change made to a document.\n * Immutable, therefore safe to retain for async processing.\n
|
|
1
|
+
{"version":3,"file":"delta.js","sourceRoot":"","sources":["../../../src/core/tree/delta.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { RevisionTag } from \"../rebase/index.js\";\nimport type { FieldKey } from \"../schema-stored/index.js\";\n\nimport type { ITreeCursorSynchronous } from \"./cursor.js\";\n\n/**\n * This format describes changes that must be applied to a forest in order to update it.\n * Instances of this format are generated based on incoming changesets and consumed by a view layer (e.g., Forest) to\n * update itself.\n *\n * Because this format is only meant for updating document state, it does not fully represent user intentions.\n * For example, if some concurrent edits A and B insert content at the same location, then a Delta that represents\n * represents the state update for edit A would not include information that allows B's insertion to be ordered\n * relative to A's insertion. This format is therefore not fit to be rebased in the face of concurrent changes.\n * Instead this format is used to describe the end product of rebasing user intentions over concurrent edits.\n *\n * This format is self-contained in the following ways:\n *\n * 1. It uses integer indices (offsets, technically) to describe the locations of necessary changes.\n * As such, it does not rely on document nodes being accessible/locatable by ID.\n *\n * 2. This format does not require historical information in order to apply the changes it describes.\n * For example, if a user undoes the deletion of a subtree, then the Delta generated for the undo edit will contain all\n * information necessary to restore that subtree.\n *\n * This format can be generated from any Changeset without having access to the current document state.\n *\n * This format is meant to serve as the lowest common denominator to represent state changes resulting from any kind\n * of operation on any kind of field.\n * This means all such operations must be expressible in terms of this format.\n *\n * Within the above design constrains, this format is designed with the following goals in mind:\n *\n * 1. Make it easy to walk both a document tree and the delta tree to apply the changes described in the delta\n * with a minimum amount of backtracking over the contents of the tree.\n * This a boon for both code simplicity and performance.\n *\n * 2. Make the format terse.\n *\n * 3. Make the format uniform.\n *\n * These goals are reflected in the following design choices (this is very much optional reading for users of this\n * format):\n *\n * 1. All marks that apply to field elements are represented in a single linear structure where marks that affect later\n * elements of the document field appear after marks that affect earlier elements of the document field.\n *\n * If the marks were not ordered in this fashion then a consumer would need to backtrack within the document field.\n *\n * If the marks were represented in multiple such linear structures then it would be necessary to either:\n * - backtrack when iterating over one structure fully, then the next\n * - maintain a pointer within each such linear structure and advance them in lock-step (like in a k-way merge-sort but\n * more fiddly because of the offsets).\n *\n * 2. Nested changes are not inlined within `ProtoNode`s.\n *\n * Inlining them would force the consuming code to detect such changes within the `ProtoNode` and handle them\n * within the context of the content creation.\n * This would be cumbersome because either the code that is responsible for consuming the `ProtoNode` would need to\n * be aware of and have the context to handle such changes, or some caller of that code would need to find and extract such\n * change information ahead to calling that code.\n */\n\n/**\n * Represents the change made to a document.\n * Immutable, therefore safe to retain for async processing.\n */\nexport interface Root<TTree = ProtoNode> {\n\t/**\n\t * Changes to apply to the root fields.\n\t */\n\treadonly fields?: FieldMap;\n\t/**\n\t * New detached nodes to be constructed.\n\t * The ordering has no significance.\n\t *\n\t * Build instructions for a root that is undergoing a rename should be listed under the starting name.\n\t * For example, if one wishes to build a tree which is being renamed from ID A to ID B,\n\t * then the build should be listed under ID A.\n\t */\n\treadonly build?: readonly DetachedNodeBuild<TTree>[];\n\t/**\n\t * New detached nodes to be destroyed.\n\t * The ordering has no significance.\n\t *\n\t * Destruction instructions for a root that is undergoing a rename should be listed under the final name.\n\t * For example, if one wishes to destroy a tree which is being renamed from ID A to ID B,\n\t * then the destruction should be listed under ID B.\n\t */\n\treadonly destroy?: readonly DetachedNodeDestruction[];\n\t/**\n\t * Refreshers for detached nodes that may need to be recreated.\n\t * The ordering has no significance.\n\t */\n\treadonly refreshers?: readonly DetachedNodeBuild<TTree>[];\n}\n\n/**\n * The default representation for inserted content.\n *\n * TODO:\n * Ownership and lifetime of data referenced by this cursor is unclear,\n * so it is a poor abstraction for this use-case which needs to hold onto the data in a non-exclusive (readonly) way.\n * Cursors can be one supported way to input data, but aren't a good storage format.\n */\nexport type ProtoNode = ITreeCursorSynchronous;\n\n/**\n * The default representation a chunk (sub-sequence) of inserted content.\n *\n * TODO:\n * See issue TODO with ProtoNode.\n * Additionally, Cursors support sequences, so if using cursors, there are better ways to handle this than an array of cursors,\n * like using a cursor over all the content (starting in fields mode).\n * Long term something like TreeChunk should probably be used here.\n */\nexport type ProtoNodes = readonly ProtoNode[];\n\n/**\n * Represents a change being made to a part of the document tree.\n */\nexport interface Mark {\n\t/**\n\t * The number of nodes affected.\n\t * When `isAttachMark(mark)` is true, this is the number of new nodes being attached.\n\t * When `isAttachMark(mark)` is false, this the number of existing nodes affected.\n\t * Must be 1 when `fields` is populated.\n\t */\n\treadonly count: number;\n\n\t/**\n\t * Modifications to the pre-existing content.\n\t * Must be undefined when `attach` is set but `detach` is not.\n\t */\n\treadonly fields?: FieldMap;\n\n\t/**\n\t * When set, indicates that some pre-existing content is being detached and sent to the given detached field.\n\t */\n\treadonly detach?: DetachedNodeId;\n\n\t/**\n\t * When set, indicates that some content is being attached from the given detached field.\n\t */\n\treadonly attach?: DetachedNodeId;\n}\n\n/**\n * A globally unique ID for a node in a detached field.\n */\nexport interface DetachedNodeId {\n\treadonly major?: RevisionTag;\n\treadonly minor: number;\n}\n\n/**\n */\nexport type FieldMap = ReadonlyMap<FieldKey, FieldChanges>;\n\n/**\n * Represents changes made to a detached node\n */\nexport interface DetachedNodeChanges {\n\treadonly id: DetachedNodeId;\n\treadonly fields: FieldMap;\n}\n\n/**\n * Represents the creation of detached nodes.\n *\n * Tree creation is idempotent: if a tree with the same ID already exists,\n * then this build is ignored in favor of the existing tree.\n */\nexport interface DetachedNodeBuild<TTree = ProtoNode> {\n\treadonly id: DetachedNodeId;\n\treadonly trees: readonly TTree[];\n}\n\n/**\n * Represents the destruction of detached nodes\n */\nexport interface DetachedNodeDestruction {\n\treadonly id: DetachedNodeId;\n\treadonly count: number;\n}\n\n/**\n * Represents a detached node being assigned a new `DetachedNodeId`.\n */\nexport interface DetachedNodeRename {\n\treadonly count: number;\n\treadonly oldId: DetachedNodeId;\n\treadonly newId: DetachedNodeId;\n}\n\n/**\n * Represents the changes to perform on a given field.\n */\nexport interface FieldChanges {\n\t/**\n\t * Represents a list of changes to the nodes in the field.\n\t * The index of each mark within the range of nodes, before\n\t * applying any of the changes, is not represented explicitly.\n\t * It corresponds to the sum of `mark.count` values for all previous marks for which `isAttachMark(mark)` is false.\n\t */\n\treadonly local?: readonly Mark[];\n\t/**\n\t * Changes to apply to detached nodes.\n\t * The ordering has no significance.\n\t *\n\t * Nested changes for a root that is undergoing a rename should be listed under the starting name.\n\t * For example, if one wishes to change a tree which is being renamed from ID A to ID B,\n\t * then the changes should be listed under ID A.\n\t */\n\treadonly global?: readonly DetachedNodeChanges[];\n\t/**\n\t * Detached whose associated ID needs to be updated.\n\t * The ordering has no significance.\n\t * Note that the renames may need to be performed in a specific order to avoid collisions.\n\t * This ordering problem is left to the consumer of this format.\n\t */\n\treadonly rename?: readonly DetachedNodeRename[];\n}\n"]}
|
|
@@ -3,19 +3,12 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { type ICodecOptions } from "../../codec/index.js";
|
|
6
|
-
import { type
|
|
7
|
-
import type { RevisionTagCodec } from "../rebase/index.js";
|
|
6
|
+
import { type IdAllocator, type JsonCompatibleReadOnly } from "../../util/index.js";
|
|
7
|
+
import type { RevisionTag, RevisionTagCodec } from "../rebase/index.js";
|
|
8
8
|
import type { FieldKey } from "../schema-stored/index.js";
|
|
9
9
|
import type * as Delta from "./delta.js";
|
|
10
|
-
import type { Major } from "./detachedFieldIndexTypes.js";
|
|
10
|
+
import type { ForestRootId, Major } from "./detachedFieldIndexTypes.js";
|
|
11
11
|
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
12
|
-
/**
|
|
13
|
-
* ID used to create a detached field key for a removed subtree.
|
|
14
|
-
*
|
|
15
|
-
* TODO: Move to Forest once forests can support multiple roots.
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export type ForestRootId = Brand<number, "tree.ForestRootId">;
|
|
19
12
|
/**
|
|
20
13
|
* The tree index records detached field IDs and associates them with a change atom ID.
|
|
21
14
|
*/
|
|
@@ -24,9 +17,29 @@ export declare class DetachedFieldIndex {
|
|
|
24
17
|
private rootIdAllocator;
|
|
25
18
|
private readonly revisionTagCodec;
|
|
26
19
|
private readonly idCompressor;
|
|
20
|
+
/**
|
|
21
|
+
* A mapping from detached node ids to detached fields.
|
|
22
|
+
*/
|
|
27
23
|
private detachedNodeToField;
|
|
24
|
+
/**
|
|
25
|
+
* A map from revisions to all detached fields for which the revision is the latest relevant revision.
|
|
26
|
+
* See {@link DetachedField.latestRelevantRevision}.
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* undefined revisions are tolerated but any roots not associated with a revision must be disposed manually
|
|
30
|
+
*/
|
|
31
|
+
private latestRelevantRevisionToFields;
|
|
28
32
|
private readonly codec;
|
|
29
33
|
private readonly options;
|
|
34
|
+
/**
|
|
35
|
+
* The process for loading `DetachedFieldIndex` data from a summary is split into two steps:
|
|
36
|
+
* 1. Call {@link loadData}
|
|
37
|
+
* 2. Call {@link setRevisionsForLoadedData}
|
|
38
|
+
*
|
|
39
|
+
* This flag is only set to `false` after calling `loadData` and is set back to `true` after calling `setRevisionsForLoadedData`.
|
|
40
|
+
* This helps ensure that `setRevisionsForLoadedData` is only called after `loadData` and only called once.
|
|
41
|
+
*/
|
|
42
|
+
private isFullyLoaded;
|
|
30
43
|
/**
|
|
31
44
|
* @param name - A name for the index, used as a prefix for the generated field keys.
|
|
32
45
|
* @param rootIdAllocator - An ID allocator used to generate unique field keys.
|
|
@@ -35,6 +48,7 @@ export declare class DetachedFieldIndex {
|
|
|
35
48
|
clone(): DetachedFieldIndex;
|
|
36
49
|
entries(): Generator<{
|
|
37
50
|
root: ForestRootId;
|
|
51
|
+
latestRelevantRevision?: RevisionTag;
|
|
38
52
|
} & {
|
|
39
53
|
id: Delta.DetachedNodeId;
|
|
40
54
|
}>;
|
|
@@ -58,15 +72,38 @@ export declare class DetachedFieldIndex {
|
|
|
58
72
|
* Fails if no such id is known to the index.
|
|
59
73
|
*/
|
|
60
74
|
getEntry(id: Delta.DetachedNodeId): ForestRootId;
|
|
75
|
+
/**
|
|
76
|
+
* Returns the detached root IDs for all the trees that were detached or last modified by the given revision.
|
|
77
|
+
*/
|
|
78
|
+
getRootsLastTouchedByRevision(revision: RevisionTag): Iterable<ForestRootId>;
|
|
79
|
+
/**
|
|
80
|
+
* Removes the detached roots for all the trees that were detached or last modified by the given revision.
|
|
81
|
+
*/
|
|
82
|
+
deleteRootsLastTouchedByRevision(revision: RevisionTag): void;
|
|
61
83
|
deleteEntry(nodeId: Delta.DetachedNodeId): void;
|
|
62
84
|
/**
|
|
63
85
|
* Associates the DetachedNodeId with a field key and creates an entry for it in the index.
|
|
86
|
+
* @param nodeId - The ID of the detached node.
|
|
87
|
+
* @param revision - The revision that last detached the root.
|
|
88
|
+
* See {@link DetachedField.latestRelevantRevision} for details.
|
|
89
|
+
* @param count - The number of entries to create. These entries will have consecutive minor IDs.
|
|
90
|
+
* @returns The atomic ID that the `DetachedFieldIndex` uses to uniquely identify the first root.
|
|
64
91
|
*/
|
|
65
|
-
createEntry(nodeId?: Delta.DetachedNodeId, count?: number): ForestRootId;
|
|
92
|
+
createEntry(nodeId?: Delta.DetachedNodeId, revision?: RevisionTag, count?: number): ForestRootId;
|
|
93
|
+
/**
|
|
94
|
+
* Updates the latest revision that is relevant to the provided root
|
|
95
|
+
*/
|
|
96
|
+
updateLatestRevision(id: Delta.DetachedNodeId, revision: RevisionTag | undefined): void;
|
|
66
97
|
encode(): JsonCompatibleReadOnly;
|
|
67
98
|
/**
|
|
68
99
|
* Loads the tree index from the given string, this overrides any existing data.
|
|
69
100
|
*/
|
|
70
101
|
loadData(data: JsonCompatibleReadOnly): void;
|
|
102
|
+
/**
|
|
103
|
+
* Sets the latest relevant revision for any roots that have an undefined latest relevant revision.
|
|
104
|
+
* This occurs when the detached field index is loaded from a summary and can only be called once after
|
|
105
|
+
* the summary has been loaded.
|
|
106
|
+
*/
|
|
107
|
+
setRevisionsForLoadedData(latestRevision: RevisionTag): void;
|
|
71
108
|
}
|
|
72
109
|
//# sourceMappingURL=detachedFieldIndex.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detachedFieldIndex.d.ts","sourceRoot":"","sources":["../../../src/core/tree/detachedFieldIndex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,aAAa,EAAkC,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EACN,KAAK,
|
|
1
|
+
{"version":3,"file":"detachedFieldIndex.d.ts","sourceRoot":"","sources":["../../../src/core/tree/detachedFieldIndex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,aAAa,EAAkC,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EACN,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAS3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAC;AAGzC,OAAO,KAAK,EAGX,YAAY,EACZ,KAAK,EAEL,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE;;GAEG;AACH,qBAAa,kBAAkB;IAoC7B,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAtC9B;;OAEG;IACH,OAAO,CAAC,mBAAmB,CAAqD;IAChF;;;;;;OAMG;IACH,OAAO,CAAC,8BAA8B,CAIxB;IAEd,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA+C;IACrE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IAExC;;;;;;;OAOG;IACH,OAAO,CAAC,aAAa,CAAQ;IAE7B;;;OAGG;gBAEe,IAAI,EAAE,MAAM,EACrB,eAAe,EAAE,WAAW,CAAC,YAAY,CAAC,EACjC,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,aAAa,EAC5C,OAAO,CAAC,EAAE,aAAa;IAMjB,KAAK,IAAI,kBAAkB;IAiB1B,OAAO,IAAI,SAAS,CAC3B;QAAE,IAAI,EAAE,YAAY,CAAC;QAAC,sBAAsB,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG;QAC9D,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC;KACzB,CACD;IAkBD;;OAEG;IACI,KAAK,IAAI,IAAI;IAKb,WAAW,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,GAAG,IAAI;IAyDxD;;;OAGG;IACI,UAAU,CAAC,EAAE,EAAE,YAAY,GAAG,QAAQ;IAI7C;;;OAGG;IACI,WAAW,CAAC,EAAE,EAAE,KAAK,CAAC,cAAc,GAAG,YAAY,GAAG,SAAS;IAItE;;;OAGG;IACI,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,cAAc,GAAG,YAAY;IAMvD;;OAEG;IACK,6BAA6B,CAAC,QAAQ,EAAE,WAAW,GAAG,QAAQ,CAAC,YAAY,CAAC;IAOpF;;OAEG;IACI,gCAAgC,CAAC,QAAQ,EAAE,WAAW,GAAG,IAAI;IAiB7D,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,GAAG,IAAI;IAWtD;;;;;;;OAOG;IACI,WAAW,CACjB,MAAM,CAAC,EAAE,KAAK,CAAC,cAAc,EAC7B,QAAQ,CAAC,EAAE,WAAW,EACtB,KAAK,GAAE,MAAU,GACf,YAAY;IAmBf;;OAEG;IACI,oBAAoB,CAC1B,EAAE,EAAE,KAAK,CAAC,cAAc,EACxB,QAAQ,EAAE,WAAW,GAAG,SAAS,GAC/B,IAAI;IAmBA,MAAM,IAAI,sBAAsB;IAOvC;;OAEG;IACI,QAAQ,CAAC,IAAI,EAAE,sBAAsB,GAAG,IAAI;IAkBnD;;;;OAIG;IACI,yBAAyB,CAAC,cAAc,EAAE,WAAW,GAAG,IAAI;CAkBnE"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
6
6
|
import { noopValidator } from "../../codec/index.js";
|
|
7
|
-
import { brand, deleteFromNestedMap, idAllocatorFromMaxId, populateNestedMap, setInNestedMap, tryGetFromNestedMap, } from "../../util/index.js";
|
|
7
|
+
import { brand, deleteFromNestedMap, forEachInNestedMap, idAllocatorFromMaxId, populateNestedMap, setInNestedMap, tryGetFromNestedMap, } from "../../util/index.js";
|
|
8
8
|
import { makeDetachedNodeToFieldCodec } from "./detachedFieldIndexCodec.js";
|
|
9
9
|
/**
|
|
10
10
|
* The tree index records detached field IDs and associates them with a change atom ID.
|
|
@@ -19,26 +19,50 @@ export class DetachedFieldIndex {
|
|
|
19
19
|
this.rootIdAllocator = rootIdAllocator;
|
|
20
20
|
this.revisionTagCodec = revisionTagCodec;
|
|
21
21
|
this.idCompressor = idCompressor;
|
|
22
|
-
|
|
22
|
+
/**
|
|
23
|
+
* A mapping from detached node ids to detached fields.
|
|
24
|
+
*/
|
|
23
25
|
this.detachedNodeToField = new Map();
|
|
26
|
+
/**
|
|
27
|
+
* A map from revisions to all detached fields for which the revision is the latest relevant revision.
|
|
28
|
+
* See {@link DetachedField.latestRelevantRevision}.
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* undefined revisions are tolerated but any roots not associated with a revision must be disposed manually
|
|
32
|
+
*/
|
|
33
|
+
this.latestRelevantRevisionToFields = new Map();
|
|
34
|
+
/**
|
|
35
|
+
* The process for loading `DetachedFieldIndex` data from a summary is split into two steps:
|
|
36
|
+
* 1. Call {@link loadData}
|
|
37
|
+
* 2. Call {@link setRevisionsForLoadedData}
|
|
38
|
+
*
|
|
39
|
+
* This flag is only set to `false` after calling `loadData` and is set back to `true` after calling `setRevisionsForLoadedData`.
|
|
40
|
+
* This helps ensure that `setRevisionsForLoadedData` is only called after `loadData` and only called once.
|
|
41
|
+
*/
|
|
42
|
+
this.isFullyLoaded = true;
|
|
24
43
|
this.options = options ?? { jsonValidator: noopValidator };
|
|
25
44
|
this.codec = makeDetachedNodeToFieldCodec(revisionTagCodec, this.options, idCompressor);
|
|
26
45
|
}
|
|
27
46
|
clone() {
|
|
28
47
|
const clone = new DetachedFieldIndex(this.name, idAllocatorFromMaxId(this.rootIdAllocator.getMaxId()), this.revisionTagCodec, this.idCompressor, this.options);
|
|
29
48
|
populateNestedMap(this.detachedNodeToField, clone.detachedNodeToField, true);
|
|
49
|
+
populateNestedMap(this.latestRelevantRevisionToFields, clone.latestRelevantRevisionToFields, true);
|
|
30
50
|
return clone;
|
|
31
51
|
}
|
|
32
52
|
*entries() {
|
|
33
53
|
for (const [major, innerMap] of this.detachedNodeToField) {
|
|
34
54
|
if (major !== undefined) {
|
|
35
|
-
for (const [minor,
|
|
36
|
-
yield
|
|
55
|
+
for (const [minor, { root, latestRelevantRevision }] of innerMap) {
|
|
56
|
+
yield latestRelevantRevision !== undefined
|
|
57
|
+
? { id: { major, minor }, root, latestRelevantRevision }
|
|
58
|
+
: { id: { major, minor }, root };
|
|
37
59
|
}
|
|
38
60
|
}
|
|
39
61
|
else {
|
|
40
|
-
for (const [minor,
|
|
41
|
-
yield
|
|
62
|
+
for (const [minor, { root, latestRelevantRevision }] of innerMap) {
|
|
63
|
+
yield latestRelevantRevision !== undefined
|
|
64
|
+
? { id: { minor }, root, latestRelevantRevision }
|
|
65
|
+
: { id: { minor }, root };
|
|
42
66
|
}
|
|
43
67
|
}
|
|
44
68
|
}
|
|
@@ -48,19 +72,44 @@ export class DetachedFieldIndex {
|
|
|
48
72
|
*/
|
|
49
73
|
purge() {
|
|
50
74
|
this.detachedNodeToField.clear();
|
|
75
|
+
this.latestRelevantRevisionToFields.clear();
|
|
51
76
|
}
|
|
52
77
|
updateMajor(current, updated) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
this.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
78
|
+
// Update latestRelevantRevision information corresponding to `current`
|
|
79
|
+
{
|
|
80
|
+
const inner = this.latestRelevantRevisionToFields.get(current);
|
|
81
|
+
if (inner !== undefined) {
|
|
82
|
+
for (const nodeId of inner.values()) {
|
|
83
|
+
const entry = tryGetFromNestedMap(this.detachedNodeToField, nodeId.major, nodeId.minor);
|
|
84
|
+
assert(entry !== undefined, 0x9b8 /* Inconsistent data: missing detached node entry */);
|
|
85
|
+
setInNestedMap(this.detachedNodeToField, nodeId.major, nodeId.minor, {
|
|
86
|
+
...entry,
|
|
87
|
+
latestRelevantRevision: updated,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
this.latestRelevantRevisionToFields.delete(current);
|
|
91
|
+
this.latestRelevantRevisionToFields.set(updated, inner);
|
|
59
92
|
}
|
|
60
|
-
|
|
93
|
+
}
|
|
94
|
+
// Update the major keys corresponding to `current`
|
|
95
|
+
{
|
|
96
|
+
const innerCurrent = this.detachedNodeToField.get(current);
|
|
97
|
+
if (innerCurrent !== undefined) {
|
|
98
|
+
this.detachedNodeToField.delete(current);
|
|
99
|
+
const innerUpdated = this.detachedNodeToField.get(updated);
|
|
100
|
+
if (innerUpdated === undefined) {
|
|
101
|
+
this.detachedNodeToField.set(updated, innerCurrent);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
for (const [minor, entry] of innerCurrent) {
|
|
105
|
+
assert(innerUpdated.get(minor) === undefined, 0x7a9 /* Collision during index update */);
|
|
106
|
+
innerUpdated.set(minor, entry);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
61
109
|
for (const [minor, entry] of innerCurrent) {
|
|
62
|
-
|
|
63
|
-
|
|
110
|
+
const entryInLatest = this.latestRelevantRevisionToFields.get(entry.latestRelevantRevision);
|
|
111
|
+
assert(entryInLatest !== undefined, 0x9b9 /* Inconsistent data: missing node entry in latestRelevantRevision */);
|
|
112
|
+
entryInLatest.set(entry.root, { major: updated, minor });
|
|
64
113
|
}
|
|
65
114
|
}
|
|
66
115
|
}
|
|
@@ -77,7 +126,7 @@ export class DetachedFieldIndex {
|
|
|
77
126
|
* Returns undefined if no such id is known to the index.
|
|
78
127
|
*/
|
|
79
128
|
tryGetEntry(id) {
|
|
80
|
-
return tryGetFromNestedMap(this.detachedNodeToField, id.major, id.minor);
|
|
129
|
+
return tryGetFromNestedMap(this.detachedNodeToField, id.major, id.minor)?.root;
|
|
81
130
|
}
|
|
82
131
|
/**
|
|
83
132
|
* Returns the FieldKey associated with the given id.
|
|
@@ -88,24 +137,74 @@ export class DetachedFieldIndex {
|
|
|
88
137
|
assert(key !== undefined, 0x7aa /* Unknown removed node ID */);
|
|
89
138
|
return key;
|
|
90
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* Returns the detached root IDs for all the trees that were detached or last modified by the given revision.
|
|
142
|
+
*/
|
|
143
|
+
*getRootsLastTouchedByRevision(revision) {
|
|
144
|
+
const roots = this.latestRelevantRevisionToFields.get(revision);
|
|
145
|
+
if (roots !== undefined) {
|
|
146
|
+
yield* roots.keys();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Removes the detached roots for all the trees that were detached or last modified by the given revision.
|
|
151
|
+
*/
|
|
152
|
+
deleteRootsLastTouchedByRevision(revision) {
|
|
153
|
+
const entries = this.latestRelevantRevisionToFields.get(revision);
|
|
154
|
+
if (entries === undefined) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
this.latestRelevantRevisionToFields.delete(revision);
|
|
158
|
+
for (const detachedNodeId of entries.values()) {
|
|
159
|
+
const found = deleteFromNestedMap(this.detachedNodeToField, detachedNodeId.major, detachedNodeId.minor);
|
|
160
|
+
assert(found, 0x9ba /* Unable to delete unknown entry */);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
91
163
|
deleteEntry(nodeId) {
|
|
92
|
-
const
|
|
93
|
-
assert(
|
|
164
|
+
const entry = tryGetFromNestedMap(this.detachedNodeToField, nodeId.major, nodeId.minor);
|
|
165
|
+
assert(entry !== undefined, 0x9bb /* Unable to delete unknown entry */);
|
|
166
|
+
deleteFromNestedMap(this.detachedNodeToField, nodeId.major, nodeId.minor);
|
|
167
|
+
deleteFromNestedMap(this.latestRelevantRevisionToFields, entry.latestRelevantRevision, entry.root);
|
|
94
168
|
}
|
|
95
169
|
/**
|
|
96
170
|
* Associates the DetachedNodeId with a field key and creates an entry for it in the index.
|
|
171
|
+
* @param nodeId - The ID of the detached node.
|
|
172
|
+
* @param revision - The revision that last detached the root.
|
|
173
|
+
* See {@link DetachedField.latestRelevantRevision} for details.
|
|
174
|
+
* @param count - The number of entries to create. These entries will have consecutive minor IDs.
|
|
175
|
+
* @returns The atomic ID that the `DetachedFieldIndex` uses to uniquely identify the first root.
|
|
97
176
|
*/
|
|
98
|
-
createEntry(nodeId, count = 1) {
|
|
177
|
+
createEntry(nodeId, revision, count = 1) {
|
|
99
178
|
const root = this.rootIdAllocator.allocate(count);
|
|
100
179
|
if (nodeId !== undefined) {
|
|
101
180
|
for (let i = 0; i < count; i++) {
|
|
102
181
|
assert(tryGetFromNestedMap(this.detachedNodeToField, nodeId.major, nodeId.minor + i) ===
|
|
103
182
|
undefined, 0x7ce /* Detached node ID already exists in index */);
|
|
104
|
-
setInNestedMap(this.detachedNodeToField, nodeId.major, nodeId.minor + i,
|
|
183
|
+
setInNestedMap(this.detachedNodeToField, nodeId.major, nodeId.minor + i, {
|
|
184
|
+
root: brand(root + i),
|
|
185
|
+
latestRelevantRevision: revision,
|
|
186
|
+
});
|
|
187
|
+
setInNestedMap(this.latestRelevantRevisionToFields, revision, root, nodeId);
|
|
105
188
|
}
|
|
106
189
|
}
|
|
107
190
|
return root;
|
|
108
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* Updates the latest revision that is relevant to the provided root
|
|
194
|
+
*/
|
|
195
|
+
updateLatestRevision(id, revision) {
|
|
196
|
+
const fieldEntry = tryGetFromNestedMap(this.detachedNodeToField, id.major, id.minor);
|
|
197
|
+
assert(fieldEntry !== undefined, 0x9bc /* detached node id does not exist in the detached field index */);
|
|
198
|
+
const { root, latestRelevantRevision: previousRevision } = fieldEntry;
|
|
199
|
+
// remove this root from the set of roots for the previous latest revision
|
|
200
|
+
deleteFromNestedMap(this.latestRelevantRevisionToFields, previousRevision, root);
|
|
201
|
+
// add this root to the set of roots for the new latest revision
|
|
202
|
+
setInNestedMap(this.latestRelevantRevisionToFields, revision, root, id);
|
|
203
|
+
setInNestedMap(this.detachedNodeToField, id.major, id.minor, {
|
|
204
|
+
root,
|
|
205
|
+
latestRelevantRevision: revision,
|
|
206
|
+
});
|
|
207
|
+
}
|
|
109
208
|
encode() {
|
|
110
209
|
return this.codec.encode({
|
|
111
210
|
data: this.detachedNodeToField,
|
|
@@ -118,7 +217,32 @@ export class DetachedFieldIndex {
|
|
|
118
217
|
loadData(data) {
|
|
119
218
|
const detachedFieldIndex = this.codec.decode(data);
|
|
120
219
|
this.rootIdAllocator = idAllocatorFromMaxId(detachedFieldIndex.maxId);
|
|
121
|
-
this.detachedNodeToField =
|
|
220
|
+
this.detachedNodeToField = new Map();
|
|
221
|
+
this.latestRelevantRevisionToFields = new Map();
|
|
222
|
+
this.isFullyLoaded = false;
|
|
223
|
+
const rootMap = new Map();
|
|
224
|
+
forEachInNestedMap(detachedFieldIndex.data, ({ root }, major, minor) => {
|
|
225
|
+
rootMap.set(root, { major, minor });
|
|
226
|
+
});
|
|
227
|
+
this.latestRelevantRevisionToFields.set(undefined, rootMap);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Sets the latest relevant revision for any roots that have an undefined latest relevant revision.
|
|
231
|
+
* This occurs when the detached field index is loaded from a summary and can only be called once after
|
|
232
|
+
* the summary has been loaded.
|
|
233
|
+
*/
|
|
234
|
+
setRevisionsForLoadedData(latestRevision) {
|
|
235
|
+
assert(!this.isFullyLoaded, 0x9bd /* revisions should only be set once using this function after loading data from a summary */);
|
|
236
|
+
const newDetachedNodeToField = new Map();
|
|
237
|
+
const rootMap = new Map();
|
|
238
|
+
forEachInNestedMap(this.detachedNodeToField, ({ root }, major, minor) => {
|
|
239
|
+
setInNestedMap(newDetachedNodeToField, major, minor, { root, latestRevision });
|
|
240
|
+
rootMap.set(root, { major, minor });
|
|
241
|
+
});
|
|
242
|
+
this.detachedNodeToField = newDetachedNodeToField;
|
|
243
|
+
this.latestRelevantRevisionToFields.delete(undefined);
|
|
244
|
+
this.latestRelevantRevisionToFields.set(latestRevision, rootMap);
|
|
245
|
+
this.isFullyLoaded = true;
|
|
122
246
|
}
|
|
123
247
|
}
|
|
124
248
|
//# sourceMappingURL=detachedFieldIndex.js.map
|