@fluidframework/tree 2.1.0 → 2.3.0-288113
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/CHANGELOG.md +297 -0
- package/README.md +34 -4
- package/api-extractor.json +17 -0
- package/api-report/tree.alpha.api.md +158 -28
- package/api-report/tree.beta.api.md +59 -28
- package/api-report/tree.public.api.md +59 -28
- package/dist/beta.d.ts +4 -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.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 +4 -16
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +12 -5
- 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/detachedFieldIndexCodec.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodec.js +3 -2
- package/dist/core/tree/detachedFieldIndexCodec.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexTypes.d.ts +0 -1
- 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 +1 -1
- 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 +0 -1
- package/dist/core/tree/visitDelta.d.ts.map +1 -1
- package/dist/core/tree/visitDelta.js +2 -2
- 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 +0 -1
- package/dist/core/tree/visitorUtils.d.ts.map +1 -1
- 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 +7 -5
- package/dist/events/events.d.ts.map +1 -1
- package/dist/events/events.js +5 -3
- 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 +5 -24
- 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 -51
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +171 -180
- 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 +17 -373
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js +1 -34
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/index.d.ts +2 -2
- package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/index.js +1 -3
- package/dist/feature-libraries/flex-tree/index.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 +26 -102
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts +3 -18
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +2 -126
- 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/index.d.ts +6 -8
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +7 -20
- 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 +105 -2
- 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 +39 -22
- 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 +192 -228
- 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.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +1 -10
- 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 +36 -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 +4 -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 +4 -17
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +4 -8
- 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/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 +2 -2
- package/dist/shared-tree/treeApi.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +0 -5
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +5 -3
- 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.map +1 -1
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +11 -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.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +3 -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/{treeNodeApi.d.ts → api/treeNodeApi.d.ts} +7 -6
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -0
- package/dist/simple-tree/{treeNodeApi.js → api/treeNodeApi.js} +57 -21
- 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 +72 -85
- 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 +70 -0
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -0
- package/dist/simple-tree/core/treeNodeKernel.js +164 -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/{lib/simple-tree → dist/simple-tree/core}/types.d.ts +50 -79
- 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 +26 -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 +50 -63
- package/dist/simple-tree/proxies.js.map +1 -1
- package/dist/simple-tree/proxyBinding.d.ts +45 -22
- package/dist/simple-tree/proxyBinding.d.ts.map +1 -1
- package/dist/simple-tree/proxyBinding.js +94 -59
- 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/treeNodeValid.d.ts +74 -0
- package/dist/simple-tree/treeNodeValid.d.ts.map +1 -0
- package/dist/simple-tree/{types.js → treeNodeValid.js} +18 -111
- 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/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 +4 -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.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 +4 -16
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +12 -5
- 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/detachedFieldIndexCodec.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodec.js +4 -3
- package/lib/core/tree/detachedFieldIndexCodec.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexTypes.d.ts +0 -1
- 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 +1 -1
- 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 +0 -1
- package/lib/core/tree/visitDelta.d.ts.map +1 -1
- package/lib/core/tree/visitDelta.js +2 -2
- 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 +0 -1
- package/lib/core/tree/visitorUtils.d.ts.map +1 -1
- 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 +7 -5
- package/lib/events/events.d.ts.map +1 -1
- package/lib/events/events.js +5 -3
- 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 +6 -25
- 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 -51
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js +172 -180
- 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 +17 -373
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js +0 -33
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/flex-tree/index.d.ts +2 -2
- package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/index.js +1 -1
- package/lib/feature-libraries/flex-tree/index.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 +28 -104
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts +3 -18
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +5 -126
- 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/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 +103 -1
- 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 +42 -25
- 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 +169 -206
- 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.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +2 -11
- 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 +8 -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 +4 -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 +4 -17
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +6 -10
- 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/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 +3 -3
- package/lib/shared-tree/treeApi.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +0 -5
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +6 -4
- 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.map +1 -1
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +12 -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.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +4 -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/{treeNodeApi.d.ts → api/treeNodeApi.d.ts} +7 -6
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -0
- package/lib/simple-tree/{treeNodeApi.js → api/treeNodeApi.js} +55 -19
- 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 +59 -70
- 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 +70 -0
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -0
- package/lib/simple-tree/core/treeNodeKernel.js +157 -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/{dist/simple-tree → lib/simple-tree/core}/types.d.ts +50 -79
- 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 +46 -57
- package/lib/simple-tree/proxies.js.map +1 -1
- package/lib/simple-tree/proxyBinding.d.ts +45 -22
- package/lib/simple-tree/proxyBinding.d.ts.map +1 -1
- package/lib/simple-tree/proxyBinding.js +89 -52
- 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/treeNodeValid.d.ts +74 -0
- package/lib/simple-tree/treeNodeValid.d.ts.map +1 -0
- package/lib/simple-tree/{types.js → treeNodeValid.js} +8 -98
- 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/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 +25 -24
- 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 +1 -6
- 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 +27 -26
- package/src/core/tree/cursor.ts +1 -6
- package/src/core/tree/delta.ts +0 -11
- package/src/core/tree/detachedFieldIndexCodec.ts +4 -3
- package/src/core/tree/detachedFieldIndexTypes.ts +0 -1
- package/src/core/tree/index.ts +1 -1
- 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 +2 -3
- package/src/core/tree/visitPath.ts +0 -2
- package/src/core/tree/visitorUtils.ts +0 -1
- 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 +10 -6
- 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 +6 -78
- 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 +238 -288
- package/src/feature-libraries/flex-tree/context.ts +0 -1
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +27 -524
- package/src/feature-libraries/flex-tree/index.ts +1 -18
- package/src/feature-libraries/flex-tree/lazyField.ts +38 -214
- package/src/feature-libraries/flex-tree/lazyNode.ts +3 -215
- 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/index.ts +5 -49
- 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 +117 -1
- 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 +68 -34
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +330 -336
- 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 +1 -13
- 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 +32 -242
- 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 +8 -39
- package/src/shared-tree/sharedTreeChangeCodecs.ts +8 -0
- package/src/shared-tree/sharedTreeChangeFamily.ts +3 -3
- package/src/shared-tree/sharedTreeEditBuilder.ts +0 -2
- package/src/shared-tree/treeApi.ts +3 -3
- package/src/shared-tree/treeCheckout.ts +6 -8
- package/src/shared-tree/treeView.ts +3 -6
- package/src/shared-tree-core/branch.ts +20 -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 +5 -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} +246 -34
- package/src/simple-tree/{treeNodeApi.ts → api/treeNodeApi.ts} +84 -41
- package/src/simple-tree/api/verboseTree.ts +415 -0
- package/src/simple-tree/arrayNode.ts +103 -110
- package/src/simple-tree/core/README.md +11 -0
- package/src/simple-tree/core/index.ts +34 -0
- package/src/simple-tree/{schemaCaching.ts → core/schemaCaching.ts} +3 -37
- package/src/simple-tree/core/treeNodeKernel.ts +200 -0
- package/src/simple-tree/core/treeNodeSchema.ts +184 -0
- package/src/simple-tree/core/types.ts +281 -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 +59 -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 +52 -68
- package/src/simple-tree/proxyBinding.ts +127 -72
- 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} +16 -232
- 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/idAllocator.ts +0 -2
- package/src/util/index.ts +2 -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.map +0 -1
- package/dist/simple-tree/treeNodeApi.js.map +0 -1
- package/dist/simple-tree/treeNodeKernel.d.ts +0 -26
- package/dist/simple-tree/treeNodeKernel.d.ts.map +0 -1
- package/dist/simple-tree/treeNodeKernel.js +0 -83
- package/dist/simple-tree/treeNodeKernel.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.map +0 -1
- package/lib/simple-tree/treeNodeApi.js.map +0 -1
- package/lib/simple-tree/treeNodeKernel.d.ts +0 -26
- package/lib/simple-tree/treeNodeKernel.d.ts.map +0 -1
- package/lib/simple-tree/treeNodeKernel.js +0 -79
- package/lib/simple-tree/treeNodeKernel.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/src/simple-tree/treeNodeKernel.ts +0 -91
- /package/dist/simple-tree/{testRecursiveDomain.js → api/testRecursiveDomain.js} +0 -0
- /package/lib/simple-tree/{testRecursiveDomain.js → api/testRecursiveDomain.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/types.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA4CU,QAAA,YAAY,GAAG,SAAS,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ChangeAtomId, ChangesetLocalId, RevisionTag } from \"../../core/index.js\";\nimport type { NodeId } from \"../index.js\";\n\nexport type CellCount = number;\n\n/**\n * A monotonically increasing positive integer assigned to an individual mark within the changeset.\n * MoveIds are scoped to a single changeset, so referring to MoveIds across changesets requires\n * qualifying them by change tag.\n *\n * The uniqueness of IDs is leveraged to uniquely identify the matching move-out for a move-in/return and vice-versa.\n */\nexport type MoveId = ChangesetLocalId;\n\nexport interface HasMoveId {\n\t/**\n\t * The sequential ID assigned to a change within a transaction.\n\t */\n\tid: MoveId;\n}\n\n/**\n * @internal\n */\nexport interface CellId extends ChangeAtomId {}\n\n/**\n * Mark which targets a range of existing cells instead of creating new cells.\n */\nexport interface HasMarkFields {\n\t/**\n\t * Describes the detach which last emptied the target cells,\n\t * or the attach which allocated the cells if the cells have never been filled.\n\t * Undefined if the target cells are not empty in this mark's input context.\n\t */\n\tcellId?: CellId;\n\n\tchanges?: NodeId;\n\n\tcount: CellCount;\n}\n\nexport const NoopMarkType = undefined;\nexport interface NoopMark {\n\t/**\n\t * Declared for consistency with other marks.\n\t * Left undefined for terseness.\n\t */\n\ttype?: typeof NoopMarkType;\n}\n\nexport interface HasRevisionTag {\n\t/**\n\t * The revision this mark is part of.\n\t * Only set for marks in fields which are a composition of multiple revisions.\n\t */\n\trevision?: RevisionTag;\n}\n\n/**\n * Moves detached roots into cells.\n * The specific content being moved in is determined by the IDs of the cells this mark targets.\n * Always brings about the desired outcome: the content is in the targeted cells.\n *\n * Rebasing this mark never causes it to insert/restore a different set of nodes.\n * Rebasing this mark never causes it to fill a different set of cells\n * (though the way those cells are identified may change).\n *\n * Carries a `MoveId` in case it is rebased over the content being moved out, in which case this mark\n * will transform into a pair of returns which will move the content back into this cell.\n */\nexport interface Insert extends HasMoveId, HasRevisionTag {\n\ttype: \"Insert\";\n}\n\nexport interface HasMoveFields extends HasMoveId, HasRevisionTag {\n\t/**\n\t * Used when this mark represents the beginning or end of a chain of moves within a changeset.\n\t * If this mark is the start of the chain, this is the ID of the end mark of the chain, and vice-versa if this is the end of the chain.\n\t */\n\tfinalEndpoint?: ChangeAtomId;\n}\n\n/**\n * Fills empty cells with content that is moved out from another cell.\n * Always brings about the desired outcome: the nodes being moved are in the target cells.\n * Note that this may not require any changes if these nodes are already in the target cells when this mark is applied.\n *\n * Rebasing this mark never causes it to move-in a different set of nodes.\n * Rebasing this mark never causes it to fill a different set of cells\n * (though the way those cells are identified may change).\n *\n * Only ever targets empty cells. It transforms into a idempotent Insert if the target cells are not empty.\n */\nexport interface MoveIn extends HasMoveFields {\n\ttype: \"MoveIn\";\n}\n\nexport interface DetachFields {\n\t/**\n\t * When set, the detach should use the `CellId` specified in this object to characterize the cell being emptied.\n\t */\n\treadonly idOverride?: CellId;\n}\n\n/**\n * Removes nodes from their cells.\n * Always brings about the desired outcome: the targeted nodes are removed from their cells.\n * Note that this may not require any changes if targeted nodes are already removed when this mark is applied.\n *\n * Rebasing this mark never causes it to target different set of nodes.\n * Rebasing this mark can cause it to clear a different set of cells.\n */\nexport interface Remove extends HasRevisionTag, DetachFields {\n\ttype: \"Remove\";\n\tid: ChangesetLocalId;\n}\n\n/**\n * Removes nodes from their cells so they can be moved into other cells.\n * Always brings about the desired outcome: the targeted nodes are removed from their cells.\n * Note that this may not require any changes if targeted nodes are already removed when this mark is applied.\n *\n * Rebasing this mark never causes it to target different set of nodes.\n * Rebasing this mark can cause it to clear a different set of cells.\n */\nexport interface MoveOut extends HasMoveFields, DetachFields {\n\ttype: \"MoveOut\";\n}\n\nexport type Attach = Insert | MoveIn;\n\nexport type Detach = Remove | MoveOut;\n\n/**\n * Fills then empties cells.\n *\n * Only ever targets empty cells.\n *\n * As a matter of normalization, only use an AttachAndDetach
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/types.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA4CU,QAAA,YAAY,GAAG,SAAS,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ChangeAtomId, ChangesetLocalId, RevisionTag } from \"../../core/index.js\";\nimport type { NodeId } from \"../index.js\";\n\nexport type CellCount = number;\n\n/**\n * A monotonically increasing positive integer assigned to an individual mark within the changeset.\n * MoveIds are scoped to a single changeset, so referring to MoveIds across changesets requires\n * qualifying them by change tag.\n *\n * The uniqueness of IDs is leveraged to uniquely identify the matching move-out for a move-in/return and vice-versa.\n */\nexport type MoveId = ChangesetLocalId;\n\nexport interface HasMoveId {\n\t/**\n\t * The sequential ID assigned to a change within a transaction.\n\t */\n\tid: MoveId;\n}\n\n/**\n * @internal\n */\nexport interface CellId extends ChangeAtomId {}\n\n/**\n * Mark which targets a range of existing cells instead of creating new cells.\n */\nexport interface HasMarkFields {\n\t/**\n\t * Describes the detach which last emptied the target cells,\n\t * or the attach which allocated the cells if the cells have never been filled.\n\t * Undefined if the target cells are not empty in this mark's input context.\n\t */\n\tcellId?: CellId;\n\n\tchanges?: NodeId;\n\n\tcount: CellCount;\n}\n\nexport const NoopMarkType = undefined;\nexport interface NoopMark {\n\t/**\n\t * Declared for consistency with other marks.\n\t * Left undefined for terseness.\n\t */\n\ttype?: typeof NoopMarkType;\n}\n\nexport interface HasRevisionTag {\n\t/**\n\t * The revision this mark is part of.\n\t * Only set for marks in fields which are a composition of multiple revisions.\n\t */\n\trevision?: RevisionTag;\n}\n\n/**\n * Moves detached roots into cells.\n * The specific content being moved in is determined by the IDs of the cells this mark targets.\n * Always brings about the desired outcome: the content is in the targeted cells.\n *\n * Rebasing this mark never causes it to insert/restore a different set of nodes.\n * Rebasing this mark never causes it to fill a different set of cells\n * (though the way those cells are identified may change).\n *\n * Carries a `MoveId` in case it is rebased over the content being moved out, in which case this mark\n * will transform into a pair of returns which will move the content back into this cell.\n */\nexport interface Insert extends HasMoveId, HasRevisionTag {\n\ttype: \"Insert\";\n}\n\nexport interface HasMoveFields extends HasMoveId, HasRevisionTag {\n\t/**\n\t * Used when this mark represents the beginning or end of a chain of moves within a changeset.\n\t * If this mark is the start of the chain, this is the ID of the end mark of the chain, and vice-versa if this is the end of the chain.\n\t */\n\tfinalEndpoint?: ChangeAtomId;\n}\n\n/**\n * Fills empty cells with content that is moved out from another cell.\n * Always brings about the desired outcome: the nodes being moved are in the target cells.\n * Note that this may not require any changes if these nodes are already in the target cells when this mark is applied.\n *\n * Rebasing this mark never causes it to move-in a different set of nodes.\n * Rebasing this mark never causes it to fill a different set of cells\n * (though the way those cells are identified may change).\n *\n * Only ever targets empty cells. It transforms into a idempotent Insert if the target cells are not empty.\n */\nexport interface MoveIn extends HasMoveFields {\n\ttype: \"MoveIn\";\n}\n\nexport interface DetachFields {\n\t/**\n\t * When set, the detach should use the `CellId` specified in this object to characterize the cell being emptied.\n\t *\n\t * This is used in two situations:\n\t * - to restore the prior ID of a cell in a rollback changeset\n\t * - to represent the impact of a detach composed with a rename\n\t */\n\treadonly idOverride?: CellId;\n}\n\n/**\n * Removes nodes from their cells.\n * Always brings about the desired outcome: the targeted nodes are removed from their cells.\n * Note that this may not require any changes if targeted nodes are already removed when this mark is applied.\n *\n * Rebasing this mark never causes it to target different set of nodes.\n * Rebasing this mark can cause it to clear a different set of cells.\n */\nexport interface Remove extends HasRevisionTag, DetachFields {\n\ttype: \"Remove\";\n\tid: ChangesetLocalId;\n}\n\n/**\n * Removes nodes from their cells so they can be moved into other cells.\n * Always brings about the desired outcome: the targeted nodes are removed from their cells.\n * Note that this may not require any changes if targeted nodes are already removed when this mark is applied.\n *\n * Rebasing this mark never causes it to target different set of nodes.\n * Rebasing this mark can cause it to clear a different set of cells.\n */\nexport interface MoveOut extends HasMoveFields, DetachFields {\n\ttype: \"MoveOut\";\n}\n\nexport type Attach = Insert | MoveIn;\n\nexport type Detach = Remove | MoveOut;\n\n/**\n * Fills then empties cells.\n *\n * Only ever targets empty cells.\n *\n * As a matter of normalization, we only use an AttachAndDetach to represent MoveIn ○ Remove.\n *\n * We do NOT use AttachAndDetach to represent the following compositions:\n * - Insert/Revive ○ Remove (represented by a Remove)\n * - Insert/Revive ○ MoveOut (represented by a MoveOut)\n * - MoveIn ○ MoveOut (represented by a Rename)\n */\nexport interface AttachAndDetach {\n\ttype: \"AttachAndDetach\";\n\tattach: Attach;\n\tdetach: Detach;\n}\n\n/**\n * Represents the renaming of an empty cell.\n *\n * Only ever targets empty cells.\n *\n * Occurs when a MoveIn is composed with a MoveOut.\n * TODO: Use Rename when an Insert/Revive is composed with a Remove.\n */\nexport interface Rename {\n\ttype: \"Rename\";\n\treadonly idOverride: CellId;\n}\n\nexport type MarkEffect = NoopMark | Attach | Detach | AttachAndDetach | Rename;\n\nexport type CellMark<TMark> = TMark & HasMarkFields;\n\nexport type Mark = CellMark<MarkEffect>;\n\nexport type MarkList = Mark[];\n\nexport type Changeset = MarkList;\n"]}
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
import { type ChangeAtomId, type ChangesetLocalId, type RevisionMetadataSource, type RevisionTag } from "../../core/index.js";
|
|
6
6
|
import { type NodeId, type CrossFieldKeyRange } from "../modular-schema/index.js";
|
|
7
7
|
import type { CellRename, DetachOfRemovedNodes, EmptyInputCellMark, MoveMarkEffect } from "./helperTypes.js";
|
|
8
|
-
import { type Attach, type AttachAndDetach, type CellId, type CellMark, type Changeset, type Detach, type Insert, type Mark, type MarkEffect, type NoopMark, type Remove } from "./types.js";
|
|
8
|
+
import { type Attach, type AttachAndDetach, type CellId, type CellMark, type Changeset, type Detach, type Insert, type Mark, type MarkEffect, type NoopMark, type Remove, type CellCount, type Rename } from "./types.js";
|
|
9
9
|
export declare function isEmpty(change: Changeset): boolean;
|
|
10
10
|
export declare function createEmpty(): Changeset;
|
|
11
11
|
export declare function getNestedChanges(change: Changeset): [NodeId, number | undefined][];
|
|
12
12
|
export declare function isNewAttach(mark: Mark, revision?: RevisionTag): boolean;
|
|
13
13
|
export declare function isNewAttachEffect(effect: MarkEffect, cellId: CellId | undefined, revision?: RevisionTag): boolean;
|
|
14
|
+
export declare function isRename(mark: MarkEffect): mark is Rename;
|
|
14
15
|
export declare function isInsert(mark: MarkEffect): mark is Insert;
|
|
15
16
|
export declare function isAttach(effect: MarkEffect): effect is Attach;
|
|
16
17
|
export declare function isReattach(mark: Mark): boolean;
|
|
@@ -54,15 +55,15 @@ export declare function compareCellPositionsUsingTombstones(oldMarkCell: ChangeA
|
|
|
54
55
|
/**
|
|
55
56
|
* @returns the ID of the cell in the output context of the given detach `mark`.
|
|
56
57
|
*/
|
|
57
|
-
export declare function getDetachOutputCellId(mark: Detach): ChangeAtomId;
|
|
58
|
+
export declare function getDetachOutputCellId(mark: Detach | Rename): ChangeAtomId;
|
|
58
59
|
/**
|
|
59
60
|
* @returns the ID of the detached node in the output context of the given detach `mark`.
|
|
60
61
|
*/
|
|
61
|
-
export declare function getDetachedNodeId(mark: Detach): ChangeAtomId;
|
|
62
|
+
export declare function getDetachedNodeId(mark: Detach | Rename): ChangeAtomId;
|
|
62
63
|
/**
|
|
63
64
|
* Preserves the semantics of the given `mark` but repackages it into a `DetachOfRemovedNodes` when possible.
|
|
64
65
|
*/
|
|
65
|
-
export declare function normalizeCellRename(
|
|
66
|
+
export declare function normalizeCellRename(cellId: CellId, count: CellCount, attach: Attach, detach: Detach): CellMark<AttachAndDetach | DetachOfRemovedNodes | Rename | NoopMark>;
|
|
66
67
|
/**
|
|
67
68
|
* Preserves the semantics of the given `mark` but repackages it into an `AttachAndDetach` mark if it is not already one.
|
|
68
69
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAGhB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAEN,KAAK,MAAM,EACX,KAAK,kBAAkB,EACvB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EACX,UAAU,EACV,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,KAAK,MAAM,EACX,KAAK,eAAe,EACpB,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,MAAM,EAGX,KAAK,MAAM,EACX,KAAK,IAAI,EACT,KAAK,UAAU,EAGf,KAAK,QAAQ,EAEb,KAAK,MAAM,EACX,MAAM,YAAY,CAAC;AAEpB,wBAAgB,OAAO,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAOlD;AAED,wBAAgB,WAAW,IAAI,SAAS,CAEvC;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EAAE,CAYlF;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,WAAW,GAAG,OAAO,CAEvE;AAED,wBAAgB,iBAAiB,CAChC,MAAM,EAAE,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BAAgB,cAAc,CAAC,KAAK,SAAS,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,SAAS,UAAU,EACrF,IAAI,EAAE,KAAK,EACX,OAAO,EAAE,MAAM,GAAG,SAAS,GACzB,KAAK,CAQP;AAED,wBAAgB,YAAY,CAAC,KAAK,SAAS,IAAI,EAC9C,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,WAAW,GAAG,SAAS,GAC/B,KAAK,CAeP;AAoBD,wBAAgB,WAAW,CAAC,MAAM,EAAE,cAAc,GAAG,YAAY,CAEhE;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,kBAAkB,EAAE,CAOzE"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.getEndpoint = exports.withRevision = exports.withNodeChange = exports.omitMarkEffect = exports.extractMarkEffect = exports.splitMarkEffect = exports.splitMark = exports.tryMergeMarks = exports.isRemoveMark = exports.isDetach = exports.compareCellsFromSameRevision = exports.areOverlappingIdRanges = exports.isNoopMark = exports.isTombstone = exports.isImpactful = exports.settleMark = exports.areOutputCellsEmpty = exports.areInputCellsEmpty = exports.isImpactfulCellRename = exports.isDetachOfRemovedNodes = exports.isAttachAndDetachEffect = exports.markHasCellEffect = exports.markFillsCells = exports.markEmptiesCells = exports.getInputLength = exports.getOutputLength = exports.cloneCellId = exports.cloneMarkEffect = exports.cloneMark = exports.asAttachAndDetach = exports.normalizeCellRename = exports.getDetachedNodeId = exports.getDetachOutputCellId = exports.compareCellPositionsUsingTombstones = exports.CellOrder = exports.cellSourcesFromMarks = exports.getOutputCellId = exports.getInputCellId = exports.areEqualCellIds = exports.isActiveReattach = exports.isReattachEffect = exports.isReattach = exports.isAttach = exports.isInsert = exports.isRename = exports.isNewAttachEffect = exports.isNewAttach = exports.getNestedChanges = exports.createEmpty = exports.isEmpty = void 0;
|
|
8
|
+
exports.getCrossFieldKeys = void 0;
|
|
8
9
|
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
9
10
|
const index_js_1 = require("../../core/index.js");
|
|
10
11
|
const index_js_2 = require("../../util/index.js");
|
|
@@ -48,6 +49,10 @@ function isNewAttachEffect(effect, cellId, revision) {
|
|
|
48
49
|
(isAttachAndDetachEffect(effect) && isNewAttachEffect(effect.attach, cellId, revision)));
|
|
49
50
|
}
|
|
50
51
|
exports.isNewAttachEffect = isNewAttachEffect;
|
|
52
|
+
function isRename(mark) {
|
|
53
|
+
return mark.type === "Rename";
|
|
54
|
+
}
|
|
55
|
+
exports.isRename = isRename;
|
|
51
56
|
function isInsert(mark) {
|
|
52
57
|
return mark.type === "Insert";
|
|
53
58
|
}
|
|
@@ -76,28 +81,11 @@ function areEqualCellIds(a, b) {
|
|
|
76
81
|
}
|
|
77
82
|
exports.areEqualCellIds = areEqualCellIds;
|
|
78
83
|
function getInputCellId(mark) {
|
|
79
|
-
|
|
80
|
-
if (cellId === undefined) {
|
|
81
|
-
return undefined;
|
|
82
|
-
}
|
|
83
|
-
if (cellId.revision !== undefined) {
|
|
84
|
-
return cellId;
|
|
85
|
-
}
|
|
86
|
-
let markRevision;
|
|
87
|
-
if (isAttachAndDetachEffect(mark)) {
|
|
88
|
-
markRevision = mark.attach.revision;
|
|
89
|
-
}
|
|
90
|
-
else if (!isNoopMark(mark)) {
|
|
91
|
-
markRevision = mark.revision;
|
|
92
|
-
}
|
|
93
|
-
return {
|
|
94
|
-
...cellId,
|
|
95
|
-
revision: markRevision,
|
|
96
|
-
};
|
|
84
|
+
return mark.cellId;
|
|
97
85
|
}
|
|
98
86
|
exports.getInputCellId = getInputCellId;
|
|
99
87
|
function getOutputCellId(mark) {
|
|
100
|
-
if (isDetach(mark)) {
|
|
88
|
+
if (isDetach(mark) || isRename(mark)) {
|
|
101
89
|
return getDetachOutputCellId(mark);
|
|
102
90
|
}
|
|
103
91
|
else if (markFillsCells(mark)) {
|
|
@@ -234,7 +222,15 @@ exports.compareCellPositionsUsingTombstones = compareCellPositionsUsingTombstone
|
|
|
234
222
|
* @returns the ID of the cell in the output context of the given detach `mark`.
|
|
235
223
|
*/
|
|
236
224
|
function getDetachOutputCellId(mark) {
|
|
237
|
-
|
|
225
|
+
if (isRename(mark)) {
|
|
226
|
+
return mark.idOverride;
|
|
227
|
+
}
|
|
228
|
+
if (mark.idOverride !== undefined) {
|
|
229
|
+
return mark.idOverride;
|
|
230
|
+
}
|
|
231
|
+
return mark.revision === undefined
|
|
232
|
+
? { localId: mark.id }
|
|
233
|
+
: { revision: mark.revision, localId: mark.id };
|
|
238
234
|
}
|
|
239
235
|
exports.getDetachOutputCellId = getDetachOutputCellId;
|
|
240
236
|
/**
|
|
@@ -242,6 +238,7 @@ exports.getDetachOutputCellId = getDetachOutputCellId;
|
|
|
242
238
|
*/
|
|
243
239
|
function getDetachedNodeId(mark) {
|
|
244
240
|
switch (mark.type) {
|
|
241
|
+
case "Rename":
|
|
245
242
|
case "Remove": {
|
|
246
243
|
return getDetachOutputCellId(mark);
|
|
247
244
|
}
|
|
@@ -256,21 +253,38 @@ exports.getDetachedNodeId = getDetachedNodeId;
|
|
|
256
253
|
/**
|
|
257
254
|
* Preserves the semantics of the given `mark` but repackages it into a `DetachOfRemovedNodes` when possible.
|
|
258
255
|
*/
|
|
259
|
-
function normalizeCellRename(
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
256
|
+
function normalizeCellRename(cellId, count, attach, detach) {
|
|
257
|
+
if (attach.type === "MoveIn") {
|
|
258
|
+
if (detach.type === "MoveOut") {
|
|
259
|
+
const outputId = getDetachOutputCellId(detach);
|
|
260
|
+
// Note that the output ID may be the same as the cellId. In such a scenario,
|
|
261
|
+
// we output an (impact-less) Rename mark anyway (as opposed to a Skip)
|
|
262
|
+
// because the resulting Rename may be rebased over other changes that rename the input cell,
|
|
263
|
+
// eventually leading to an impactful rename.
|
|
264
|
+
return {
|
|
265
|
+
type: "Rename",
|
|
266
|
+
count,
|
|
267
|
+
cellId,
|
|
268
|
+
idOverride: outputId,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
// Normalization: when the attach is an insert/revive, we rely on the implicit reviving semantics of the
|
|
274
|
+
// detach instead of using an explicit revive effect in an AttachAndDetach
|
|
275
|
+
return {
|
|
276
|
+
...detach,
|
|
277
|
+
count,
|
|
278
|
+
cellId,
|
|
279
|
+
};
|
|
266
280
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
count
|
|
272
|
-
cellId
|
|
273
|
-
}
|
|
281
|
+
return {
|
|
282
|
+
type: "AttachAndDetach",
|
|
283
|
+
attach,
|
|
284
|
+
detach,
|
|
285
|
+
count,
|
|
286
|
+
cellId,
|
|
287
|
+
};
|
|
274
288
|
}
|
|
275
289
|
exports.normalizeCellRename = normalizeCellRename;
|
|
276
290
|
/**
|
|
@@ -375,6 +389,7 @@ function areOutputCellsEmpty(mark) {
|
|
|
375
389
|
case types_js_1.NoopMarkType:
|
|
376
390
|
return mark.cellId !== undefined;
|
|
377
391
|
case "Remove":
|
|
392
|
+
case "Rename":
|
|
378
393
|
case "MoveOut":
|
|
379
394
|
case "AttachAndDetach":
|
|
380
395
|
return true;
|
|
@@ -410,6 +425,8 @@ function isImpactful(mark) {
|
|
|
410
425
|
switch (type) {
|
|
411
426
|
case types_js_1.NoopMarkType:
|
|
412
427
|
return false;
|
|
428
|
+
case "Rename":
|
|
429
|
+
return true;
|
|
413
430
|
case "Remove": {
|
|
414
431
|
const inputId = getInputCellId(mark);
|
|
415
432
|
if (inputId === undefined) {
|
|
@@ -548,6 +565,13 @@ function tryMergeEffects(lhs, rhs, lhsCount) {
|
|
|
548
565
|
}
|
|
549
566
|
break;
|
|
550
567
|
}
|
|
568
|
+
case "Rename": {
|
|
569
|
+
const lhsDetach = lhs;
|
|
570
|
+
if (haveMergeableIdOverrides(lhsDetach, lhsCount, rhs)) {
|
|
571
|
+
return lhsDetach;
|
|
572
|
+
}
|
|
573
|
+
break;
|
|
574
|
+
}
|
|
551
575
|
case "MoveOut": {
|
|
552
576
|
const lhsMoveOut = lhs;
|
|
553
577
|
if (lhsMoveOut.id + lhsCount === rhs.id &&
|
|
@@ -629,6 +653,15 @@ function splitMarkEffect(effect, length) {
|
|
|
629
653
|
}
|
|
630
654
|
return [effect1, effect2];
|
|
631
655
|
}
|
|
656
|
+
case "Rename": {
|
|
657
|
+
const effect1 = { ...effect };
|
|
658
|
+
const effect2 = { ...effect };
|
|
659
|
+
const effect2Rename = effect2;
|
|
660
|
+
if (effect2Rename.idOverride !== undefined) {
|
|
661
|
+
effect2Rename.idOverride = splitDetachEvent(effect2Rename.idOverride, length);
|
|
662
|
+
}
|
|
663
|
+
return [effect1, effect2];
|
|
664
|
+
}
|
|
632
665
|
case "MoveOut": {
|
|
633
666
|
const effect2 = {
|
|
634
667
|
...effect,
|
|
@@ -711,7 +744,7 @@ function withRevision(mark, revision) {
|
|
|
711
744
|
}
|
|
712
745
|
exports.withRevision = withRevision;
|
|
713
746
|
function addRevision(effect, revision) {
|
|
714
|
-
if (effect.type === types_js_1.NoopMarkType) {
|
|
747
|
+
if (effect.type === types_js_1.NoopMarkType || isRename(effect)) {
|
|
715
748
|
return;
|
|
716
749
|
}
|
|
717
750
|
if (effect.type === "AttachAndDetach") {
|
|
@@ -723,12 +756,7 @@ function addRevision(effect, revision) {
|
|
|
723
756
|
effect.revision = revision;
|
|
724
757
|
}
|
|
725
758
|
function getEndpoint(effect) {
|
|
726
|
-
return effect.finalEndpoint
|
|
727
|
-
? {
|
|
728
|
-
...effect.finalEndpoint,
|
|
729
|
-
revision: effect.finalEndpoint.revision ?? effect.revision,
|
|
730
|
-
}
|
|
731
|
-
: { revision: effect.revision, localId: effect.id };
|
|
759
|
+
return effect.finalEndpoint ?? { revision: effect.revision, localId: effect.id };
|
|
732
760
|
}
|
|
733
761
|
exports.getEndpoint = getEndpoint;
|
|
734
762
|
function getCrossFieldKeys(change) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA8E;AAE9E,kDAO6B;AAC7B,kDAAgE;AAChE,yDAIoC;AAQpC,yCAiBoB;AAEpB,SAAgB,OAAO,CAAC,MAAiB;IACxC,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC3D,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAPD,0BAOC;AAED,SAAgB,WAAW;IAC1B,OAAO,EAAE,CAAC;AACX,CAAC;AAFD,kCAEC;AAED,SAAgB,gBAAgB,CAAC,MAAiB;IACjD,MAAM,MAAM,GAAmC,EAAE,CAAC;IAClD,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,MAAM,EAAE,CAAC;QACjD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;QAClE,CAAC;QACD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YAC1B,KAAK,IAAI,KAAK,CAAC;QAChB,CAAC;IACF,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAZD,4CAYC;AAED,SAAgB,WAAW,CAAC,IAAU,EAAE,QAAsB;IAC7D,OAAO,iBAAiB,CAAC,IAAI,EAA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AAiB;IAClD,MAAM,IAAI,GAAyB,EAAE,CAAC;IACtC,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,CAAC,IAAI,CAAC,GAAG,8BAA8B,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC;AAPD,8CAOC;AAED,SAAS,8BAA8B,CACtC,MAAkB,EAClB,KAAa;IAEb,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACrB,KAAK,QAAQ;YACZ,2FAA2F;YAC3F,mDAAmD;YACnD,OAAO;gBACN,CAAC,2BAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC;gBAC5D,CAAC,2BAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC;aACjE,CAAC;QACH,KAAK,SAAS;YACb,OAAO,CAAC,CAAC,2BAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;QACvE,KAAK,QAAQ;YACZ,OAAO,CAAC,CAAC,2BAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;QAC5E,KAAK,iBAAiB;YACrB,OAAO;gBACN,GAAG,8BAA8B,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;gBACvD,GAAG,8BAA8B,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;aACvD,CAAC;QACH;YACC,OAAO,EAAE,CAAC;IACZ,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ChangeAtomId,\n\ttype ChangesetLocalId,\n\ttype RevisionMetadataSource,\n\ttype RevisionTag,\n\tareEqualChangeAtomIds,\n\tmakeChangeAtomId,\n} from \"../../core/index.js\";\nimport { type Mutable, brand, fail } from \"../../util/index.js\";\nimport {\n\tCrossFieldTarget,\n\ttype NodeId,\n\ttype CrossFieldKeyRange,\n} from \"../modular-schema/index.js\";\n\nimport type {\n\tCellRename,\n\tDetachOfRemovedNodes,\n\tEmptyInputCellMark,\n\tMoveMarkEffect,\n} from \"./helperTypes.js\";\nimport {\n\ttype Attach,\n\ttype AttachAndDetach,\n\ttype CellId,\n\ttype CellMark,\n\ttype Changeset,\n\ttype Detach,\n\ttype DetachFields,\n\ttype HasRevisionTag,\n\ttype Insert,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype MoveIn,\n\ttype MoveOut,\n\ttype NoopMark,\n\tNoopMarkType,\n\ttype Remove,\n} from \"./types.js\";\n\nexport function isEmpty(change: Changeset): boolean {\n\tfor (const mark of change) {\n\t\tif (mark.changes !== undefined || mark.type !== undefined) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nexport function createEmpty(): Changeset {\n\treturn [];\n}\n\nexport function getNestedChanges(change: Changeset): [NodeId, number | undefined][] {\n\tconst output: [NodeId, number | undefined][] = [];\n\tlet index = 0;\n\tfor (const { changes, cellId, count } of change) {\n\t\tif (changes !== undefined) {\n\t\t\toutput.push([changes, cellId === undefined ? index : undefined]);\n\t\t}\n\t\tif (cellId === undefined) {\n\t\t\tindex += count;\n\t\t}\n\t}\n\treturn output;\n}\n\nexport function isNewAttach(mark: Mark, revision?: RevisionTag): boolean {\n\treturn isNewAttachEffect(mark, mark.cellId, revision);\n}\n\nexport function isNewAttachEffect(\n\teffect: MarkEffect,\n\tcellId: CellId | undefined,\n\trevision?: RevisionTag,\n): boolean {\n\treturn (\n\t\t(isAttach(effect) &&\n\t\t\tcellId !== undefined &&\n\t\t\t(effect.revision ?? revision) === (cellId.revision ?? revision)) ||\n\t\t(isAttachAndDetachEffect(effect) && isNewAttachEffect(effect.attach, cellId, revision))\n\t);\n}\n\nexport function isInsert(mark: MarkEffect): mark is Insert {\n\treturn mark.type === \"Insert\";\n}\n\nexport function isAttach(effect: MarkEffect): effect is Attach {\n\treturn effect.type === \"Insert\" || effect.type === \"MoveIn\";\n}\n\nexport function isReattach(mark: Mark): boolean {\n\treturn isReattachEffect(mark, mark.cellId);\n}\n\nexport function isReattachEffect(effect: MarkEffect, cellId: CellId | undefined): boolean {\n\treturn isAttach(effect) && !isNewAttachEffect(effect, cellId);\n}\n\nexport function isActiveReattach(\n\tmark: Mark,\n): mark is CellMark<Insert> & { conflictsWith?: undefined } {\n\treturn isAttach(mark) && isReattachEffect(mark, mark.cellId) && mark.cellId !== undefined;\n}\n\nexport function areEqualCellIds(a: CellId | undefined, b: CellId | undefined): boolean {\n\tif (a === undefined || b === undefined) {\n\t\treturn a === b;\n\t}\n\treturn areEqualChangeAtomIds(a, b);\n}\n\nexport function getInputCellId(mark: Mark): CellId | undefined {\n\tconst cellId = mark.cellId;\n\tif (cellId === undefined) {\n\t\treturn undefined;\n\t}\n\n\tif (cellId.revision !== undefined) {\n\t\treturn cellId;\n\t}\n\n\tlet markRevision: RevisionTag | undefined;\n\tif (isAttachAndDetachEffect(mark)) {\n\t\tmarkRevision = mark.attach.revision;\n\t} else if (!isNoopMark(mark)) {\n\t\tmarkRevision = mark.revision;\n\t}\n\n\treturn {\n\t\t...cellId,\n\t\trevision: markRevision,\n\t};\n}\n\nexport function getOutputCellId(mark: Mark): CellId | undefined {\n\tif (isDetach(mark)) {\n\t\treturn getDetachOutputCellId(mark);\n\t} else if (markFillsCells(mark)) {\n\t\treturn undefined;\n\t} else if (isAttachAndDetachEffect(mark)) {\n\t\treturn getDetachOutputCellId(mark.detach);\n\t}\n\n\treturn getInputCellId(mark);\n}\n\nexport function cellSourcesFromMarks(\n\tmarks: readonly Mark[],\n\tcontextGetter: typeof getInputCellId | typeof getOutputCellId,\n): Set<RevisionTag | undefined> {\n\tconst set = new Set<RevisionTag | undefined>();\n\tfor (const mark of marks) {\n\t\tconst cell = contextGetter(mark);\n\t\tif (cell !== undefined) {\n\t\t\tset.add(cell.revision);\n\t\t}\n\t}\n\treturn set;\n}\n\nexport enum CellOrder {\n\tSameCell,\n\tOldThenNew,\n\tNewThenOld,\n}\n\n/**\n * Determines the order of two cells from two changesets.\n *\n * This function makes the following assumptions:\n * 1. The cells represent the same context.\n * 2. `oldMarkCell` is from a mark in a changeset that is older than the changeset that contains the mark that\n * `newMarkCell` is from.\n * 3. In terms of sequence index, all cells located before A are also located before B,\n * and all cells located before B are also located before A.\n * 4. If a changeset has a mark/tombstone that describes a cell named in some revision R,\n * then that changeset must contain marks/tombstones for all cells named in R as well as all cells named in later\n * revisions up to its own.\n * 5. If a changeset foo is rebased over a changeset bar, then the rebased version of foo must contain tombstones or\n * marks for all cells referenced or named in bar. It has yet to be determined whether this assumption is necessary\n * for the logic below.\n *\n * @param oldMarkCell - The cell referenced or named by a mark or tombstone from the older changeset.\n * @param newMarkCell - The cell referenced or named by a mark or tombstone from the newer changeset.\n * @param oldChangeKnowledge - The set of revisions that the older changeset has cell representations for.\n * @param newChangeKnowledge - The set of revisions that the newer changeset has cell representations for.\n * @param metadata - Revision metadata for the operation being carried out.\n * @returns a {@link CellOrder} which describes how the cells are ordered relative to one-another.\n */\nexport function compareCellPositionsUsingTombstones(\n\toldMarkCell: ChangeAtomId,\n\tnewMarkCell: ChangeAtomId,\n\toldChangeKnowledge: ReadonlySet<RevisionTag | undefined>,\n\tnewChangeKnowledge: ReadonlySet<RevisionTag | undefined>,\n\tmetadata: RevisionMetadataSource,\n): CellOrder {\n\tif (areEqualChangeAtomIds(oldMarkCell, newMarkCell)) {\n\t\treturn CellOrder.SameCell;\n\t}\n\tconst oldChangeKnowsOfNewMarkCellRevision = oldChangeKnowledge.has(newMarkCell.revision);\n\tconst newChangeKnowsOfOldMarkCellRevision = newChangeKnowledge.has(oldMarkCell.revision);\n\tif (oldChangeKnowsOfNewMarkCellRevision && newChangeKnowsOfOldMarkCellRevision) {\n\t\t// If both changesets know of both cells, but we've been asked to compare different cells,\n\t\t// Then either the changesets they originate from do not represent the same context,\n\t\t// or the ordering of their cells in inconsistent.\n\t\t// The only exception to this is when we're composing anonymous changesets in a transaction.\n\t\tassert(\n\t\t\toldMarkCell.revision === undefined && newMarkCell.revision === undefined,\n\t\t\t0x8a0 /* Inconsistent cell ordering */,\n\t\t);\n\t\t// We are composing anonymous changesets in a transaction. The new changeset is creating a cell in a gap\n\t\t// where the old changeset knows of some now empty cell. We order the new cell relative to the old cell in a\n\t\t// way that is consistent with its tie-breaking behavior should the old cell be concurrently re-filled.\n\t\t// Since only tie-break left is supported at the moment, the new cell comes first.\n\t\treturn CellOrder.NewThenOld;\n\t}\n\tif (newChangeKnowsOfOldMarkCellRevision) {\n\t\t// The changeset that contains `newMarkCell` has tombstones for the revision that created `oldMarkCell`,\n\t\t// so a tombstone/mark matching `oldMarkCell` must occur later in the newer changeset.\n\t\treturn CellOrder.NewThenOld;\n\t} else if (oldChangeKnowsOfNewMarkCellRevision) {\n\t\t// The changeset that contains `oldMarkCell` has tombstones for revision that created `newMarkCell`,\n\t\t// so a tombstone/mark matching `newMarkCell` must occur later in the older changeset.\n\t\treturn CellOrder.OldThenNew;\n\t} else {\n\t\t// These cells are only ordered through tie-breaking.\n\t\t// Since tie-breaking is hard-coded to \"merge left\", the younger cell comes first.\n\n\t\t// In the context of compose, an undefined revision means we are composing anonymous changesets into\n\t\t// a transaction, which means the cell from the newer changeset is younger.\n\t\tif (newMarkCell.revision === undefined) {\n\t\t\treturn CellOrder.NewThenOld;\n\t\t}\n\t\t// The only case where the old mark cell should have no revision is when composing anonymous changesets\n\t\t// into a transaction, in which case the new mark cell should also have no revision, which is handled above.\n\t\t// In all other cases, the old mark cell should have a revision.\n\t\tassert(\n\t\t\toldMarkCell.revision !== undefined,\n\t\t\t0x8a1 /* Old mark cell should have a revision */,\n\t\t);\n\n\t\t// Note that these indices are for ordering the revisions in which the cells were named, not the revisions\n\t\t// of the changesets in which the marks targeting these cells appear.\n\t\tconst oldCellRevisionIndex = metadata.getIndex(oldMarkCell.revision);\n\t\tconst newCellRevisionIndex = metadata.getIndex(newMarkCell.revision);\n\n\t\t// If the metadata defines an ordering for the revisions then the cell from the newer revision comes first.\n\t\tif (newCellRevisionIndex !== undefined && oldCellRevisionIndex !== undefined) {\n\t\t\treturn newCellRevisionIndex > oldCellRevisionIndex\n\t\t\t\t? CellOrder.NewThenOld\n\t\t\t\t: CellOrder.OldThenNew;\n\t\t}\n\n\t\tif (newCellRevisionIndex === undefined && oldCellRevisionIndex === undefined) {\n\t\t\t// While it is possible for both marks to refer to cells that were named in revisions that are outside\n\t\t\t// the scope of the metadata, such a scenario should be handled above due to the fact that one of the two\n\t\t\t// changesets should have tombstones or marks for both cells.\n\t\t\t//\n\t\t\t// To see this in the context of rebase, we must consider the lowest common ancestor (LCA) of each change's\n\t\t\t// original (i.e., unrebased) edit with the head of the branch they will both reside on after the rebase.\n\t\t\t// ...─(Ti)─...─(Tj)─...─(old')─(new') <- branch both change will reside on after rebase\n\t\t\t// | └─...─(new)\n\t\t\t// └─...─(old)\n\t\t\t// In the diagram above we can see that by the time `new` is being rebased over `old`, both changesets have\n\t\t\t// been rebased over, and therefore have cell information for, changes `Tj` onwards. This means that one of\n\t\t\t// The two changesets (the `old` one in the diagram above) will have tombstones or marks for any cells that\n\t\t\t// `new` refers to so long as those cells were not created on `new`'s branch.\n\t\t\t// Note that the change that contains the superset of cells (again, ignoring cells created on the other\n\t\t\t// change's branch) is not always the older change. Consider the following scenario:\n\t\t\t// ...─(Ti)─...─(Tj)─...─(old')─(new')\n\t\t\t// | └─...─(old)\n\t\t\t// └─...─(new)\n\t\t\t//\n\t\t\t// The same scenario can arise in the context of compose (just consider composing `old'` and `new'` from\n\t\t\t// the examples above) with the same resolution.\n\t\t\tassert(false, 0x8a2 /* Invalid cell ordering scenario */);\n\t\t}\n\n\t\t// The absence of metadata for a cell with a defined revision means that the cell is from a revision that\n\t\t// predates the edits that are within the scope of the metadata. Such a cell is therefore older than the one\n\t\t// for which we do have metadata.\n\t\treturn oldCellRevisionIndex === undefined ? CellOrder.NewThenOld : CellOrder.OldThenNew;\n\t}\n}\n\n/**\n * @returns the ID of the cell in the output context of the given detach `mark`.\n */\nexport function getDetachOutputCellId(mark: Detach): ChangeAtomId {\n\treturn mark.idOverride ?? { revision: mark.revision, localId: mark.id };\n}\n\n/**\n * @returns the ID of the detached node in the output context of the given detach `mark`.\n */\nexport function getDetachedNodeId(mark: Detach): ChangeAtomId {\n\tswitch (mark.type) {\n\t\tcase \"Remove\": {\n\t\t\treturn getDetachOutputCellId(mark);\n\t\t}\n\t\tcase \"MoveOut\": {\n\t\t\treturn makeChangeAtomId(mark.id, mark.revision);\n\t\t}\n\t\tdefault:\n\t\t\tunreachableCase(mark);\n\t}\n}\n\n/**\n * Preserves the semantics of the given `mark` but repackages it into a `DetachOfRemovedNodes` when possible.\n */\nexport function normalizeCellRename(\n\tmark: CellMark<AttachAndDetach>,\n): CellMark<AttachAndDetach | DetachOfRemovedNodes> {\n\tassert(mark.cellId !== undefined, 0x823 /* AttachAndDetach marks should have a cell ID */);\n\t// We must keep the attach information when the attach is a move-in because the input-context cell ID may not be\n\t// enough to identify the move ID.\n\t// TODO: revisit if we still need the attach information for new inserts.\n\tif (mark.attach.type !== \"Insert\" || isNewAttachEffect(mark.attach, mark.cellId)) {\n\t\treturn mark;\n\t}\n\t// Normalization: when the attach is a revive, we rely on the implicit reviving semantics of the\n\t// detach instead of using an explicit revive effect in an AttachAndDetach mark.\n\treturn withNodeChange(\n\t\t{\n\t\t\t...mark.detach,\n\t\t\tcount: mark.count,\n\t\t\tcellId: mark.cellId,\n\t\t},\n\t\tmark.changes,\n\t);\n}\n\n/**\n * Preserves the semantics of the given `mark` but repackages it into an `AttachAndDetach` mark if it is not already one.\n */\nexport function asAttachAndDetach(mark: CellMark<CellRename>): CellMark<AttachAndDetach> {\n\tif (mark.type === \"AttachAndDetach\") {\n\t\treturn mark;\n\t}\n\tconst { cellId, count, changes, revision, ...effect } = mark;\n\tconst attachAndDetach: CellMark<AttachAndDetach | Detach> = {\n\t\ttype: \"AttachAndDetach\",\n\t\tcount,\n\t\tcellId,\n\t\tattach: {\n\t\t\ttype: \"Insert\",\n\t\t\tid: mark.id,\n\t\t},\n\t\tdetach: effect,\n\t};\n\tif (changes !== undefined) {\n\t\tattachAndDetach.changes = changes;\n\t}\n\tif (revision !== undefined) {\n\t\tattachAndDetach.attach.revision = revision;\n\t\tattachAndDetach.detach.revision = revision;\n\t}\n\treturn attachAndDetach;\n}\n\nexport function cloneMark<TMark extends Mark>(mark: TMark): TMark {\n\tconst clone: TMark = { ...cloneMarkEffect(mark), count: mark.count };\n\n\tif (mark.cellId !== undefined) {\n\t\tclone.cellId = cloneCellId(mark.cellId);\n\t}\n\treturn clone;\n}\n\nexport function cloneMarkEffect<TEffect extends MarkEffect>(effect: TEffect): TEffect {\n\tconst clone = { ...effect };\n\tif (clone.type === \"AttachAndDetach\") {\n\t\tclone.attach = cloneMarkEffect(clone.attach);\n\t\tclone.detach = cloneMarkEffect(clone.detach);\n\t}\n\treturn clone;\n}\n\nexport function cloneCellId(id: CellId): CellId {\n\tconst cloned = { ...id };\n\treturn cloned;\n}\n\n/**\n * @param mark - The mark to get the length of.\n * @param ignorePairing - When true, the length of a paired mark (e.g. MoveIn/MoveOut) whose matching mark is not active\n * will be treated the same as if the matching mark were active.\n * @returns The number of nodes within the output context of the mark.\n */\nexport function getOutputLength(mark: Mark, ignorePairing: boolean = false): number {\n\treturn areOutputCellsEmpty(mark) ? 0 : mark.count;\n}\n\n/**\n * @param mark - The mark to get the length of.\n * @returns The number of nodes within the input context of the mark.\n */\nexport function getInputLength(mark: Mark): number {\n\treturn areInputCellsEmpty(mark) ? 0 : mark.count;\n}\n\nexport function markEmptiesCells(mark: Mark): boolean {\n\treturn !areInputCellsEmpty(mark) && areOutputCellsEmpty(mark);\n}\n\nexport function markFillsCells(mark: Mark): boolean {\n\treturn areInputCellsEmpty(mark) && !areOutputCellsEmpty(mark);\n}\n\nexport function markHasCellEffect(mark: Mark): boolean {\n\treturn areInputCellsEmpty(mark) !== areOutputCellsEmpty(mark);\n}\n\nexport function isAttachAndDetachEffect(effect: MarkEffect): effect is AttachAndDetach {\n\treturn effect.type === \"AttachAndDetach\";\n}\n\nexport function isDetachOfRemovedNodes(mark: Mark): mark is CellMark<DetachOfRemovedNodes> {\n\treturn isDetach(mark) && mark.cellId !== undefined;\n}\n\nexport function isImpactfulCellRename(mark: Mark): mark is CellMark<CellRename> {\n\treturn (isAttachAndDetachEffect(mark) || isDetachOfRemovedNodes(mark)) && isImpactful(mark);\n}\n\nexport function areInputCellsEmpty(mark: Mark): mark is EmptyInputCellMark {\n\treturn mark.cellId !== undefined;\n}\n\nexport function areOutputCellsEmpty(mark: Mark): boolean {\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase NoopMarkType:\n\t\t\treturn mark.cellId !== undefined;\n\t\tcase \"Remove\":\n\t\tcase \"MoveOut\":\n\t\tcase \"AttachAndDetach\":\n\t\t\treturn true;\n\t\tcase \"MoveIn\":\n\t\tcase \"Insert\":\n\t\t\treturn false;\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\n/**\n * Creates a mark that is equivalent to the given `mark` but with effects removed if those have no impact in the input\n * context of that mark.\n *\n * @param mark - The mark to settle. Never mutated.\n * @returns either the original mark or a shallow clone of it with effects stripped out.\n */\nexport function settleMark(mark: Mark): Mark {\n\tif (isImpactful(mark)) {\n\t\treturn mark;\n\t}\n\treturn omitMarkEffect(mark);\n}\n\n/**\n * @returns true, iff the given `mark` would have impact on the field when applied.\n * Ignores the impact of nested changes.\n * CellRename effects are considered impactful if they actually change the ID of the cells.\n */\nexport function isImpactful(mark: Mark): boolean {\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase NoopMarkType:\n\t\t\treturn false;\n\t\tcase \"Remove\": {\n\t\t\tconst inputId = getInputCellId(mark);\n\t\t\tif (inputId === undefined) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconst outputId = getOutputCellId(mark);\n\t\t\tassert(outputId !== undefined, 0x824 /* Remove marks must have an output cell ID */);\n\t\t\treturn !areEqualChangeAtomIds(inputId, outputId);\n\t\t}\n\t\tcase \"AttachAndDetach\":\n\t\tcase \"MoveOut\":\n\t\t\treturn true;\n\t\tcase \"MoveIn\":\n\t\t\t// MoveIn marks always target an empty cell.\n\t\t\tassert(mark.cellId !== undefined, 0x825 /* MoveIn marks should target empty cells */);\n\t\t\treturn true;\n\t\tcase \"Insert\":\n\t\t\t// A Revive has no impact if the nodes are already in the document.\n\t\t\treturn mark.cellId !== undefined;\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\nexport function isTombstone(mark: Mark): mark is CellMark<NoopMark> & { cellId: CellId } {\n\treturn mark.type === NoopMarkType && mark.cellId !== undefined && mark.changes === undefined;\n}\n\nexport function isNoopMark(mark: Mark): mark is CellMark<NoopMark> {\n\treturn mark.type === NoopMarkType;\n}\n\nexport function areOverlappingIdRanges(\n\tid1: ChangesetLocalId,\n\tcount1: number,\n\tid2: ChangesetLocalId,\n\tcount2: number,\n): boolean {\n\tconst lastId1 = (id1 as number) + count1 - 1;\n\tconst lastId2 = (id2 as number) + count2 - 1;\n\treturn (id2 <= id1 && id1 <= lastId2) || (id1 <= id2 && id2 <= lastId1);\n}\n\nexport function compareCellsFromSameRevision(\n\tcell1: CellId,\n\tcount1: number,\n\tcell2: CellId,\n\tcount2: number,\n): number | undefined {\n\tassert(\n\t\tcell1.revision === cell2.revision,\n\t\t0x85b /* Expected cells to have the same revision */,\n\t);\n\tif (areOverlappingIdRanges(cell1.localId, count1, cell2.localId, count2)) {\n\t\treturn cell1.localId - cell2.localId;\n\t}\n\treturn undefined;\n}\n\nexport function isDetach(mark: MarkEffect | undefined): mark is Detach {\n\tconst type = mark?.type;\n\treturn type === \"Remove\" || type === \"MoveOut\";\n}\n\nexport function isRemoveMark(mark: Mark | undefined): mark is CellMark<Remove> {\n\treturn mark?.type === \"Remove\";\n}\n\nfunction areMergeableChangeAtoms(\n\tlhs: ChangeAtomId | undefined,\n\tlhsCount: number,\n\trhs: ChangeAtomId | undefined,\n): boolean {\n\tif (lhs === undefined || rhs === undefined) {\n\t\treturn lhs === undefined && rhs === undefined;\n\t}\n\n\treturn (\n\t\tlhs.revision === rhs.revision && areAdjacentIdRanges(lhs.localId, lhsCount, rhs.localId)\n\t);\n}\n\nfunction areAdjacentIdRanges(\n\tfirstStart: ChangesetLocalId,\n\tfirstLength: number,\n\tsecondStart: ChangesetLocalId,\n): boolean {\n\treturn (firstStart as number) + firstLength === secondStart;\n}\n\nfunction haveMergeableIdOverrides(\n\tlhs: DetachFields,\n\tlhsCount: number,\n\trhs: DetachFields,\n): boolean {\n\tif (lhs.idOverride !== undefined && rhs.idOverride !== undefined) {\n\t\treturn areMergeableCellIds(lhs.idOverride, lhsCount, rhs.idOverride);\n\t}\n\treturn (lhs.idOverride === undefined) === (rhs.idOverride === undefined);\n}\n\nfunction areMergeableCellIds(\n\tlhs: CellId | undefined,\n\tlhsCount: number,\n\trhs: CellId | undefined,\n): boolean {\n\treturn areMergeableChangeAtoms(lhs, lhsCount, rhs);\n}\n\n/**\n * Attempts to extend `lhs` to include the effects of `rhs`.\n * @param lhs - The mark to extend.\n * @param rhs - The effect so extend `rhs` with.\n * @returns `lhs` iff the function was able to mutate `lhs` to include the effects of `rhs`.\n * When `undefined` is returned, `lhs` is left untouched.\n */\nexport function tryMergeMarks(lhs: Mark, rhs: Readonly<Mark>): Mark | undefined {\n\tif (rhs.type !== lhs.type) {\n\t\treturn undefined;\n\t}\n\n\tif (!areMergeableCellIds(lhs.cellId, lhs.count, rhs.cellId)) {\n\t\treturn undefined;\n\t}\n\n\tif (rhs.changes !== undefined || lhs.changes !== undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst mergedEffect = tryMergeEffects(lhs, rhs, lhs.count);\n\tif (mergedEffect === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn { ...lhs, ...mergedEffect, count: lhs.count + rhs.count };\n}\n\nfunction tryMergeEffects(\n\tlhs: MarkEffect,\n\trhs: MarkEffect,\n\tlhsCount: number,\n): MarkEffect | undefined {\n\tif (lhs.type !== rhs.type) {\n\t\treturn undefined;\n\t}\n\n\tif (rhs.type === NoopMarkType) {\n\t\treturn lhs;\n\t}\n\n\tif (rhs.type === \"AttachAndDetach\") {\n\t\tconst lhsAttachAndDetach = lhs as AttachAndDetach;\n\t\tconst attach = tryMergeEffects(lhsAttachAndDetach.attach, rhs.attach, lhsCount);\n\t\tconst detach = tryMergeEffects(lhsAttachAndDetach.detach, rhs.detach, lhsCount);\n\t\tif (attach === undefined || detach === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tassert(\n\t\t\tisAttach(attach) && isDetach(detach),\n\t\t\t0x826 /* Merged marks should be same type as input marks */,\n\t\t);\n\t\treturn { ...lhsAttachAndDetach, attach, detach };\n\t}\n\n\tif ((lhs as HasRevisionTag).revision !== rhs.revision) {\n\t\treturn undefined;\n\t}\n\n\tif (isDetach(lhs) && isDetach(rhs) && !haveMergeableIdOverrides(lhs, lhsCount, rhs)) {\n\t\treturn undefined;\n\t}\n\n\tconst type = rhs.type;\n\tswitch (type) {\n\t\tcase \"MoveIn\": {\n\t\t\tconst lhsMoveIn = lhs as MoveIn;\n\t\t\tif (\n\t\t\t\t(lhsMoveIn.id as number) + lhsCount === rhs.id &&\n\t\t\t\tareMergeableChangeAtoms(lhsMoveIn.finalEndpoint, lhsCount, rhs.finalEndpoint)\n\t\t\t) {\n\t\t\t\treturn lhsMoveIn;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"Remove\": {\n\t\t\tconst lhsDetach = lhs as Remove;\n\t\t\tif (\n\t\t\t\t(lhsDetach.id as number) + lhsCount === rhs.id &&\n\t\t\t\thaveMergeableIdOverrides(lhsDetach, lhsCount, rhs)\n\t\t\t) {\n\t\t\t\treturn lhsDetach;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"MoveOut\": {\n\t\t\tconst lhsMoveOut = lhs as MoveOut;\n\t\t\tif (\n\t\t\t\t(lhsMoveOut.id as number) + lhsCount === rhs.id &&\n\t\t\t\thaveMergeableIdOverrides(lhsMoveOut, lhsCount, rhs) &&\n\t\t\t\tareMergeableChangeAtoms(lhsMoveOut.finalEndpoint, lhsCount, rhs.finalEndpoint)\n\t\t\t) {\n\t\t\t\treturn lhsMoveOut;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"Insert\": {\n\t\t\tconst lhsInsert = lhs as Insert;\n\t\t\tif ((lhsInsert.id as number) + lhsCount === rhs.id) {\n\t\t\t\treturn lhsInsert;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Splits the `mark` into two marks such that the first returned mark has length `length`.\n * @param mark - The mark to split.\n * @param revision - The revision of the changeset the mark is part of.\n * @param length - The desired length for the first of the two returned marks.\n * @param genId - An ID allocator\n * @param moveEffects - The table in which to record splitting of move marks\n * @param recordMoveEffect - Whether when splitting a move an entry should be added to `moveEffects` indicating that the mark should be split (in case we process this mark again).\n * An entry is always added to `moveEffects` indicating that the opposite end of the move should be split.\n * @returns A pair of marks equivalent to the original `mark`\n * such that the first returned mark has input length `length`.\n */\nexport function splitMark<TMark extends Mark>(mark: TMark, length: number): [TMark, TMark] {\n\tconst markLength = mark.count;\n\tconst remainder = markLength - length;\n\tif (length < 1 || remainder < 1) {\n\t\tfail(\"Unable to split mark due to lengths\");\n\t}\n\n\tconst [effect1, effect2] = splitMarkEffect(mark, length);\n\tconst mark1 = { ...mark, ...effect1, count: length };\n\tconst mark2 = { ...mark, ...effect2, count: remainder };\n\tif (mark2.cellId !== undefined) {\n\t\tmark2.cellId = splitDetachEvent(mark2.cellId, length);\n\t}\n\n\treturn [mark1, mark2];\n}\n\nexport function splitMarkEffect<TEffect extends MarkEffect>(\n\teffect: TEffect,\n\tlength: number,\n): [TEffect, TEffect] {\n\tconst type = effect.type;\n\tswitch (type) {\n\t\tcase NoopMarkType:\n\t\t\treturn [effect, effect];\n\t\tcase \"Insert\": {\n\t\t\tconst effect1: TEffect = {\n\t\t\t\t...effect,\n\t\t\t};\n\t\t\tconst effect2: TEffect = {\n\t\t\t\t...effect,\n\t\t\t\tid: (effect.id as number) + length,\n\t\t\t};\n\t\t\treturn [effect1, effect2];\n\t\t}\n\t\tcase \"MoveIn\": {\n\t\t\tconst effect2: TEffect = { ...effect, id: (effect.id as number) + length };\n\t\t\tconst move2 = effect2 as MoveIn;\n\t\t\tif (move2.finalEndpoint !== undefined) {\n\t\t\t\tmove2.finalEndpoint = splitDetachEvent(move2.finalEndpoint, length);\n\t\t\t}\n\t\t\treturn [effect, effect2];\n\t\t}\n\t\tcase \"Remove\": {\n\t\t\tconst effect1 = { ...effect };\n\t\t\tconst id2: ChangesetLocalId = brand((effect.id as number) + length);\n\t\t\tconst effect2 = { ...effect, id: id2 };\n\t\t\tconst effect2Remove = effect2 as Mutable<Remove>;\n\t\t\tif (effect2Remove.idOverride !== undefined) {\n\t\t\t\teffect2Remove.idOverride = splitDetachEvent(effect2Remove.idOverride, length);\n\t\t\t}\n\t\t\treturn [effect1, effect2];\n\t\t}\n\t\tcase \"MoveOut\": {\n\t\t\tconst effect2 = {\n\t\t\t\t...effect,\n\t\t\t\tid: (effect.id as number) + length,\n\t\t\t};\n\n\t\t\tconst return2 = effect2 as Mutable<MoveOut>;\n\n\t\t\tif (return2.idOverride !== undefined) {\n\t\t\t\treturn2.idOverride = splitDetachEvent(return2.idOverride, length);\n\t\t\t}\n\n\t\t\tif (return2.finalEndpoint !== undefined) {\n\t\t\t\treturn2.finalEndpoint = splitDetachEvent(return2.finalEndpoint, length);\n\t\t\t}\n\t\t\treturn [effect, effect2];\n\t\t}\n\t\tcase \"AttachAndDetach\": {\n\t\t\tconst [attach1, attach2] = splitMarkEffect(effect.attach, length);\n\t\t\tconst [detach1, detach2] = splitMarkEffect(effect.detach, length);\n\t\t\tconst effect1 = {\n\t\t\t\t...effect,\n\t\t\t\tattach: attach1,\n\t\t\t\tdetach: detach1,\n\t\t\t};\n\n\t\t\tconst effect2 = {\n\t\t\t\t...effect,\n\t\t\t\tattach: attach2,\n\t\t\t\tdetach: detach2,\n\t\t\t};\n\n\t\t\treturn [effect1, effect2];\n\t\t}\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\nfunction splitDetachEvent(detachEvent: CellId, length: number): CellId {\n\treturn { ...detachEvent, localId: brand((detachEvent.localId as number) + length) };\n}\n\n// TODO: Refactor MarkEffect into a field of CellMark so this function isn't necessary.\nexport function extractMarkEffect<TEffect extends MarkEffect>(\n\tmark: CellMark<TEffect>,\n): TEffect {\n\tconst { cellId: _cellId, count: _count, changes: _changes, ...effect } = mark;\n\treturn effect as unknown as TEffect;\n}\n\n// TODO: Refactor MarkEffect into a field of CellMark so this function isn't necessary.\nexport function omitMarkEffect(mark: CellMark<unknown>): CellMark<NoopMark> {\n\tconst { cellId, count, changes } = mark;\n\tconst noopMark: CellMark<NoopMark> = { count };\n\tif (cellId !== undefined) {\n\t\tnoopMark.cellId = cellId;\n\t}\n\tif (changes !== undefined) {\n\t\tnoopMark.changes = changes;\n\t}\n\treturn noopMark;\n}\n\nexport function withNodeChange<TMark extends CellMark<TKind>, TKind extends MarkEffect>(\n\tmark: TMark,\n\tchanges: NodeId | undefined,\n): TMark {\n\tconst newMark = { ...mark };\n\tif (changes !== undefined) {\n\t\tnewMark.changes = changes;\n\t} else {\n\t\tdelete newMark.changes;\n\t}\n\treturn newMark;\n}\n\nexport function withRevision<TMark extends Mark>(\n\tmark: TMark,\n\trevision: RevisionTag | undefined,\n): TMark {\n\tif (revision === undefined) {\n\t\treturn mark;\n\t}\n\n\tconst cloned = cloneMark(mark);\n\taddRevision(cloned, revision);\n\tif (\n\t\tcloned.cellId !== undefined &&\n\t\tcloned.cellId.revision === undefined &&\n\t\trevision !== undefined\n\t) {\n\t\t(cloned.cellId as Mutable<CellId>).revision = revision;\n\t}\n\treturn cloned;\n}\n\nfunction addRevision(effect: MarkEffect, revision: RevisionTag): void {\n\tif (effect.type === NoopMarkType) {\n\t\treturn;\n\t}\n\n\tif (effect.type === \"AttachAndDetach\") {\n\t\taddRevision(effect.attach, revision);\n\t\taddRevision(effect.detach, revision);\n\t\treturn;\n\t}\n\n\tassert(\n\t\teffect.revision === undefined || effect.revision === revision,\n\t\t0x829 /* Should not overwrite mark revision */,\n\t);\n\teffect.revision = revision;\n}\n\nexport function getEndpoint(effect: MoveMarkEffect): ChangeAtomId {\n\treturn effect.finalEndpoint !== undefined\n\t\t? {\n\t\t\t\t...effect.finalEndpoint,\n\t\t\t\trevision: effect.finalEndpoint.revision ?? effect.revision,\n\t\t\t}\n\t\t: { revision: effect.revision, localId: effect.id };\n}\n\nexport function getCrossFieldKeys(change: Changeset): CrossFieldKeyRange[] {\n\tconst keys: CrossFieldKeyRange[] = [];\n\tfor (const mark of change) {\n\t\tkeys.push(...getCrossFieldKeysForMarkEffect(mark, mark.count));\n\t}\n\n\treturn keys;\n}\n\nfunction getCrossFieldKeysForMarkEffect(\n\teffect: MarkEffect,\n\tcount: number,\n): CrossFieldKeyRange[] {\n\tswitch (effect.type) {\n\t\tcase \"Insert\":\n\t\t\t// An insert behaves like a move where the source and destination are at the same location.\n\t\t\t// An insert can become a move when after rebasing.\n\t\t\treturn [\n\t\t\t\t[CrossFieldTarget.Source, effect.revision, effect.id, count],\n\t\t\t\t[CrossFieldTarget.Destination, effect.revision, effect.id, count],\n\t\t\t];\n\t\tcase \"MoveOut\":\n\t\t\treturn [[CrossFieldTarget.Source, effect.revision, effect.id, count]];\n\t\tcase \"MoveIn\":\n\t\t\treturn [[CrossFieldTarget.Destination, effect.revision, effect.id, count]];\n\t\tcase \"AttachAndDetach\":\n\t\t\treturn [\n\t\t\t\t...getCrossFieldKeysForMarkEffect(effect.attach, count),\n\t\t\t\t...getCrossFieldKeysForMarkEffect(effect.detach, count),\n\t\t\t];\n\t\tdefault:\n\t\t\treturn [];\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,kEAA8E;AAE9E,kDAO6B;AAC7B,kDAAgE;AAChE,yDAIoC;AAQpC,yCAmBoB;AAEpB,SAAgB,OAAO,CAAC,MAAiB;IACxC,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC3D,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAPD,0BAOC;AAED,SAAgB,WAAW;IAC1B,OAAO,EAAE,CAAC;AACX,CAAC;AAFD,kCAEC;AAED,SAAgB,gBAAgB,CAAC,MAAiB;IACjD,MAAM,MAAM,GAAmC,EAAE,CAAC;IAClD,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,MAAM,EAAE,CAAC;QACjD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;QAClE,CAAC;QACD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YAC1B,KAAK,IAAI,KAAK,CAAC;QAChB,CAAC;IACF,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAZD,4CAYC;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E,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC;aACjE,CAAC;QACH,KAAK,SAAS;YACb,OAAO,CAAC,CAAC,2BAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;QACvE,KAAK,QAAQ;YACZ,OAAO,CAAC,CAAC,2BAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;QAC5E,KAAK,iBAAiB;YACrB,OAAO;gBACN,GAAG,8BAA8B,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;gBACvD,GAAG,8BAA8B,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;aACvD,CAAC;QACH;YACC,OAAO,EAAE,CAAC;IACZ,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ChangeAtomId,\n\ttype ChangesetLocalId,\n\ttype RevisionMetadataSource,\n\ttype RevisionTag,\n\tareEqualChangeAtomIds,\n\tmakeChangeAtomId,\n} from \"../../core/index.js\";\nimport { type Mutable, brand, fail } from \"../../util/index.js\";\nimport {\n\tCrossFieldTarget,\n\ttype NodeId,\n\ttype CrossFieldKeyRange,\n} from \"../modular-schema/index.js\";\n\nimport type {\n\tCellRename,\n\tDetachOfRemovedNodes,\n\tEmptyInputCellMark,\n\tMoveMarkEffect,\n} from \"./helperTypes.js\";\nimport {\n\ttype Attach,\n\ttype AttachAndDetach,\n\ttype CellId,\n\ttype CellMark,\n\ttype Changeset,\n\ttype Detach,\n\ttype DetachFields,\n\ttype HasRevisionTag,\n\ttype Insert,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype MoveIn,\n\ttype MoveOut,\n\ttype NoopMark,\n\tNoopMarkType,\n\ttype Remove,\n\ttype CellCount,\n\ttype Rename,\n} from \"./types.js\";\n\nexport function isEmpty(change: Changeset): boolean {\n\tfor (const mark of change) {\n\t\tif (mark.changes !== undefined || mark.type !== undefined) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nexport function createEmpty(): Changeset {\n\treturn [];\n}\n\nexport function getNestedChanges(change: Changeset): [NodeId, number | undefined][] {\n\tconst output: [NodeId, number | undefined][] = [];\n\tlet index = 0;\n\tfor (const { changes, cellId, count } of change) {\n\t\tif (changes !== undefined) {\n\t\t\toutput.push([changes, cellId === undefined ? index : undefined]);\n\t\t}\n\t\tif (cellId === undefined) {\n\t\t\tindex += count;\n\t\t}\n\t}\n\treturn output;\n}\n\nexport function isNewAttach(mark: Mark, revision?: RevisionTag): boolean {\n\treturn isNewAttachEffect(mark, mark.cellId, revision);\n}\n\nexport function isNewAttachEffect(\n\teffect: MarkEffect,\n\tcellId: CellId | undefined,\n\trevision?: RevisionTag,\n): boolean {\n\treturn (\n\t\t(isAttach(effect) &&\n\t\t\tcellId !== undefined &&\n\t\t\t(effect.revision ?? revision) === (cellId.revision ?? revision)) ||\n\t\t(isAttachAndDetachEffect(effect) && isNewAttachEffect(effect.attach, cellId, revision))\n\t);\n}\n\nexport function isRename(mark: MarkEffect): mark is Rename {\n\treturn mark.type === \"Rename\";\n}\n\nexport function isInsert(mark: MarkEffect): mark is Insert {\n\treturn mark.type === \"Insert\";\n}\n\nexport function isAttach(effect: MarkEffect): effect is Attach {\n\treturn effect.type === \"Insert\" || effect.type === \"MoveIn\";\n}\n\nexport function isReattach(mark: Mark): boolean {\n\treturn isReattachEffect(mark, mark.cellId);\n}\n\nexport function isReattachEffect(effect: MarkEffect, cellId: CellId | undefined): boolean {\n\treturn isAttach(effect) && !isNewAttachEffect(effect, cellId);\n}\n\nexport function isActiveReattach(\n\tmark: Mark,\n): mark is CellMark<Insert> & { conflictsWith?: undefined } {\n\treturn isAttach(mark) && isReattachEffect(mark, mark.cellId) && mark.cellId !== undefined;\n}\n\nexport function areEqualCellIds(a: CellId | undefined, b: CellId | undefined): boolean {\n\tif (a === undefined || b === undefined) {\n\t\treturn a === b;\n\t}\n\treturn areEqualChangeAtomIds(a, b);\n}\n\nexport function getInputCellId(mark: Mark): CellId | undefined {\n\treturn mark.cellId;\n}\n\nexport function getOutputCellId(mark: Mark): CellId | undefined {\n\tif (isDetach(mark) || isRename(mark)) {\n\t\treturn getDetachOutputCellId(mark);\n\t} else if (markFillsCells(mark)) {\n\t\treturn undefined;\n\t} else if (isAttachAndDetachEffect(mark)) {\n\t\treturn getDetachOutputCellId(mark.detach);\n\t}\n\n\treturn getInputCellId(mark);\n}\n\nexport function cellSourcesFromMarks(\n\tmarks: readonly Mark[],\n\tcontextGetter: typeof getInputCellId | typeof getOutputCellId,\n): Set<RevisionTag | undefined> {\n\tconst set = new Set<RevisionTag | undefined>();\n\tfor (const mark of marks) {\n\t\tconst cell = contextGetter(mark);\n\t\tif (cell !== undefined) {\n\t\t\tset.add(cell.revision);\n\t\t}\n\t}\n\treturn set;\n}\n\nexport enum CellOrder {\n\tSameCell,\n\tOldThenNew,\n\tNewThenOld,\n}\n\n/**\n * Determines the order of two cells from two changesets.\n *\n * This function makes the following assumptions:\n * 1. The cells represent the same context.\n * 2. `oldMarkCell` is from a mark in a changeset that is older than the changeset that contains the mark that\n * `newMarkCell` is from.\n * 3. In terms of sequence index, all cells located before A are also located before B,\n * and all cells located before B are also located before A.\n * 4. If a changeset has a mark/tombstone that describes a cell named in some revision R,\n * then that changeset must contain marks/tombstones for all cells named in R as well as all cells named in later\n * revisions up to its own.\n * 5. If a changeset foo is rebased over a changeset bar, then the rebased version of foo must contain tombstones or\n * marks for all cells referenced or named in bar. It has yet to be determined whether this assumption is necessary\n * for the logic below.\n *\n * @param oldMarkCell - The cell referenced or named by a mark or tombstone from the older changeset.\n * @param newMarkCell - The cell referenced or named by a mark or tombstone from the newer changeset.\n * @param oldChangeKnowledge - The set of revisions that the older changeset has cell representations for.\n * @param newChangeKnowledge - The set of revisions that the newer changeset has cell representations for.\n * @param metadata - Revision metadata for the operation being carried out.\n * @returns a {@link CellOrder} which describes how the cells are ordered relative to one-another.\n */\nexport function compareCellPositionsUsingTombstones(\n\toldMarkCell: ChangeAtomId,\n\tnewMarkCell: ChangeAtomId,\n\toldChangeKnowledge: ReadonlySet<RevisionTag | undefined>,\n\tnewChangeKnowledge: ReadonlySet<RevisionTag | undefined>,\n\tmetadata: RevisionMetadataSource,\n): CellOrder {\n\tif (areEqualChangeAtomIds(oldMarkCell, newMarkCell)) {\n\t\treturn CellOrder.SameCell;\n\t}\n\tconst oldChangeKnowsOfNewMarkCellRevision = oldChangeKnowledge.has(newMarkCell.revision);\n\tconst newChangeKnowsOfOldMarkCellRevision = newChangeKnowledge.has(oldMarkCell.revision);\n\tif (oldChangeKnowsOfNewMarkCellRevision && newChangeKnowsOfOldMarkCellRevision) {\n\t\t// If both changesets know of both cells, but we've been asked to compare different cells,\n\t\t// Then either the changesets they originate from do not represent the same context,\n\t\t// or the ordering of their cells in inconsistent.\n\t\t// The only exception to this is when we're composing anonymous changesets in a transaction.\n\t\tassert(\n\t\t\toldMarkCell.revision === undefined && newMarkCell.revision === undefined,\n\t\t\t0x8a0 /* Inconsistent cell ordering */,\n\t\t);\n\t\t// We are composing anonymous changesets in a transaction. The new changeset is creating a cell in a gap\n\t\t// where the old changeset knows of some now empty cell. We order the new cell relative to the old cell in a\n\t\t// way that is consistent with its tie-breaking behavior should the old cell be concurrently re-filled.\n\t\t// Since only tie-break left is supported at the moment, the new cell comes first.\n\t\treturn CellOrder.NewThenOld;\n\t}\n\tif (newChangeKnowsOfOldMarkCellRevision) {\n\t\t// The changeset that contains `newMarkCell` has tombstones for the revision that created `oldMarkCell`,\n\t\t// so a tombstone/mark matching `oldMarkCell` must occur later in the newer changeset.\n\t\treturn CellOrder.NewThenOld;\n\t} else if (oldChangeKnowsOfNewMarkCellRevision) {\n\t\t// The changeset that contains `oldMarkCell` has tombstones for revision that created `newMarkCell`,\n\t\t// so a tombstone/mark matching `newMarkCell` must occur later in the older changeset.\n\t\treturn CellOrder.OldThenNew;\n\t} else {\n\t\t// These cells are only ordered through tie-breaking.\n\t\t// Since tie-breaking is hard-coded to \"merge left\", the younger cell comes first.\n\n\t\t// In the context of compose, an undefined revision means we are composing anonymous changesets into\n\t\t// a transaction, which means the cell from the newer changeset is younger.\n\t\tif (newMarkCell.revision === undefined) {\n\t\t\treturn CellOrder.NewThenOld;\n\t\t}\n\t\t// The only case where the old mark cell should have no revision is when composing anonymous changesets\n\t\t// into a transaction, in which case the new mark cell should also have no revision, which is handled above.\n\t\t// In all other cases, the old mark cell should have a revision.\n\t\tassert(\n\t\t\toldMarkCell.revision !== undefined,\n\t\t\t0x8a1 /* Old mark cell should have a revision */,\n\t\t);\n\n\t\t// Note that these indices are for ordering the revisions in which the cells were named, not the revisions\n\t\t// of the changesets in which the marks targeting these cells appear.\n\t\tconst oldCellRevisionIndex = metadata.getIndex(oldMarkCell.revision);\n\t\tconst newCellRevisionIndex = metadata.getIndex(newMarkCell.revision);\n\n\t\t// If the metadata defines an ordering for the revisions then the cell from the newer revision comes first.\n\t\tif (newCellRevisionIndex !== undefined && oldCellRevisionIndex !== undefined) {\n\t\t\treturn newCellRevisionIndex > oldCellRevisionIndex\n\t\t\t\t? CellOrder.NewThenOld\n\t\t\t\t: CellOrder.OldThenNew;\n\t\t}\n\n\t\tif (newCellRevisionIndex === undefined && oldCellRevisionIndex === undefined) {\n\t\t\t// While it is possible for both marks to refer to cells that were named in revisions that are outside\n\t\t\t// the scope of the metadata, such a scenario should be handled above due to the fact that one of the two\n\t\t\t// changesets should have tombstones or marks for both cells.\n\t\t\t//\n\t\t\t// To see this in the context of rebase, we must consider the lowest common ancestor (LCA) of each change's\n\t\t\t// original (i.e., unrebased) edit with the head of the branch they will both reside on after the rebase.\n\t\t\t// ...─(Ti)─...─(Tj)─...─(old')─(new') <- branch both change will reside on after rebase\n\t\t\t// | └─...─(new)\n\t\t\t// └─...─(old)\n\t\t\t// In the diagram above we can see that by the time `new` is being rebased over `old`, both changesets have\n\t\t\t// been rebased over, and therefore have cell information for, changes `Tj` onwards. This means that one of\n\t\t\t// The two changesets (the `old` one in the diagram above) will have tombstones or marks for any cells that\n\t\t\t// `new` refers to so long as those cells were not created on `new`'s branch.\n\t\t\t// Note that the change that contains the superset of cells (again, ignoring cells created on the other\n\t\t\t// change's branch) is not always the older change. Consider the following scenario:\n\t\t\t// ...─(Ti)─...─(Tj)─...─(old')─(new')\n\t\t\t// | └─...─(old)\n\t\t\t// └─...─(new)\n\t\t\t//\n\t\t\t// The same scenario can arise in the context of compose (just consider composing `old'` and `new'` from\n\t\t\t// the examples above) with the same resolution.\n\t\t\tassert(false, 0x8a2 /* Invalid cell ordering scenario */);\n\t\t}\n\n\t\t// The absence of metadata for a cell with a defined revision means that the cell is from a revision that\n\t\t// predates the edits that are within the scope of the metadata. Such a cell is therefore older than the one\n\t\t// for which we do have metadata.\n\t\treturn oldCellRevisionIndex === undefined ? CellOrder.NewThenOld : CellOrder.OldThenNew;\n\t}\n}\n\n/**\n * @returns the ID of the cell in the output context of the given detach `mark`.\n */\nexport function getDetachOutputCellId(mark: Detach | Rename): ChangeAtomId {\n\tif (isRename(mark)) {\n\t\treturn mark.idOverride;\n\t}\n\tif (mark.idOverride !== undefined) {\n\t\treturn mark.idOverride;\n\t}\n\treturn mark.revision === undefined\n\t\t? { localId: mark.id }\n\t\t: { revision: mark.revision, localId: mark.id };\n}\n\n/**\n * @returns the ID of the detached node in the output context of the given detach `mark`.\n */\nexport function getDetachedNodeId(mark: Detach | Rename): ChangeAtomId {\n\tswitch (mark.type) {\n\t\tcase \"Rename\":\n\t\tcase \"Remove\": {\n\t\t\treturn getDetachOutputCellId(mark);\n\t\t}\n\t\tcase \"MoveOut\": {\n\t\t\treturn makeChangeAtomId(mark.id, mark.revision);\n\t\t}\n\t\tdefault:\n\t\t\tunreachableCase(mark);\n\t}\n}\n\n/**\n * Preserves the semantics of the given `mark` but repackages it into a `DetachOfRemovedNodes` when possible.\n */\nexport function normalizeCellRename(\n\tcellId: CellId,\n\tcount: CellCount,\n\tattach: Attach,\n\tdetach: Detach,\n): CellMark<AttachAndDetach | DetachOfRemovedNodes | Rename | NoopMark> {\n\tif (attach.type === \"MoveIn\") {\n\t\tif (detach.type === \"MoveOut\") {\n\t\t\tconst outputId = getDetachOutputCellId(detach);\n\t\t\t// Note that the output ID may be the same as the cellId. In such a scenario,\n\t\t\t// we output an (impact-less) Rename mark anyway (as opposed to a Skip)\n\t\t\t// because the resulting Rename may be rebased over other changes that rename the input cell,\n\t\t\t// eventually leading to an impactful rename.\n\t\t\treturn {\n\t\t\t\ttype: \"Rename\",\n\t\t\t\tcount,\n\t\t\t\tcellId,\n\t\t\t\tidOverride: outputId,\n\t\t\t};\n\t\t}\n\t} else {\n\t\t// Normalization: when the attach is an insert/revive, we rely on the implicit reviving semantics of the\n\t\t// detach instead of using an explicit revive effect in an AttachAndDetach\n\t\treturn {\n\t\t\t...detach,\n\t\t\tcount,\n\t\t\tcellId,\n\t\t};\n\t}\n\treturn {\n\t\ttype: \"AttachAndDetach\",\n\t\tattach,\n\t\tdetach,\n\t\tcount,\n\t\tcellId,\n\t};\n}\n\n/**\n * Preserves the semantics of the given `mark` but repackages it into an `AttachAndDetach` mark if it is not already one.\n */\nexport function asAttachAndDetach(mark: CellMark<CellRename>): CellMark<AttachAndDetach> {\n\tif (mark.type === \"AttachAndDetach\") {\n\t\treturn mark;\n\t}\n\tconst { cellId, count, changes, revision, ...effect } = mark;\n\tconst attachAndDetach: CellMark<AttachAndDetach | Detach> = {\n\t\ttype: \"AttachAndDetach\",\n\t\tcount,\n\t\tcellId,\n\t\tattach: {\n\t\t\ttype: \"Insert\",\n\t\t\tid: mark.id,\n\t\t},\n\t\tdetach: effect,\n\t};\n\tif (changes !== undefined) {\n\t\tattachAndDetach.changes = changes;\n\t}\n\tif (revision !== undefined) {\n\t\tattachAndDetach.attach.revision = revision;\n\t\tattachAndDetach.detach.revision = revision;\n\t}\n\treturn attachAndDetach;\n}\n\nexport function cloneMark<TMark extends Mark>(mark: TMark): TMark {\n\tconst clone: TMark = { ...cloneMarkEffect(mark), count: mark.count };\n\n\tif (mark.cellId !== undefined) {\n\t\tclone.cellId = cloneCellId(mark.cellId);\n\t}\n\treturn clone;\n}\n\nexport function cloneMarkEffect<TEffect extends MarkEffect>(effect: TEffect): TEffect {\n\tconst clone = { ...effect };\n\tif (clone.type === \"AttachAndDetach\") {\n\t\tclone.attach = cloneMarkEffect(clone.attach);\n\t\tclone.detach = cloneMarkEffect(clone.detach);\n\t}\n\treturn clone;\n}\n\nexport function cloneCellId(id: CellId): CellId {\n\tconst cloned = { ...id };\n\treturn cloned;\n}\n\n/**\n * @param mark - The mark to get the length of.\n * @param ignorePairing - When true, the length of a paired mark (e.g. MoveIn/MoveOut) whose matching mark is not active\n * will be treated the same as if the matching mark were active.\n * @returns The number of nodes within the output context of the mark.\n */\nexport function getOutputLength(mark: Mark, ignorePairing: boolean = false): number {\n\treturn areOutputCellsEmpty(mark) ? 0 : mark.count;\n}\n\n/**\n * @param mark - The mark to get the length of.\n * @returns The number of nodes within the input context of the mark.\n */\nexport function getInputLength(mark: Mark): number {\n\treturn areInputCellsEmpty(mark) ? 0 : mark.count;\n}\n\nexport function markEmptiesCells(mark: Mark): boolean {\n\treturn !areInputCellsEmpty(mark) && areOutputCellsEmpty(mark);\n}\n\nexport function markFillsCells(mark: Mark): boolean {\n\treturn areInputCellsEmpty(mark) && !areOutputCellsEmpty(mark);\n}\n\nexport function markHasCellEffect(mark: Mark): boolean {\n\treturn areInputCellsEmpty(mark) !== areOutputCellsEmpty(mark);\n}\n\nexport function isAttachAndDetachEffect(effect: MarkEffect): effect is AttachAndDetach {\n\treturn effect.type === \"AttachAndDetach\";\n}\n\nexport function isDetachOfRemovedNodes(mark: Mark): mark is CellMark<DetachOfRemovedNodes> {\n\treturn isDetach(mark) && mark.cellId !== undefined;\n}\n\nexport function isImpactfulCellRename(mark: Mark): mark is CellMark<CellRename> {\n\treturn (isAttachAndDetachEffect(mark) || isDetachOfRemovedNodes(mark)) && isImpactful(mark);\n}\n\nexport function areInputCellsEmpty(mark: Mark): mark is EmptyInputCellMark {\n\treturn mark.cellId !== undefined;\n}\n\nexport function areOutputCellsEmpty(mark: Mark): boolean {\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase NoopMarkType:\n\t\t\treturn mark.cellId !== undefined;\n\t\tcase \"Remove\":\n\t\tcase \"Rename\":\n\t\tcase \"MoveOut\":\n\t\tcase \"AttachAndDetach\":\n\t\t\treturn true;\n\t\tcase \"MoveIn\":\n\t\tcase \"Insert\":\n\t\t\treturn false;\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\n/**\n * Creates a mark that is equivalent to the given `mark` but with effects removed if those have no impact in the input\n * context of that mark.\n *\n * @param mark - The mark to settle. Never mutated.\n * @returns either the original mark or a shallow clone of it with effects stripped out.\n */\nexport function settleMark(mark: Mark): Mark {\n\tif (isImpactful(mark)) {\n\t\treturn mark;\n\t}\n\treturn omitMarkEffect(mark);\n}\n\n/**\n * @returns true, iff the given `mark` would have impact on the field when applied.\n * Ignores the impact of nested changes.\n * CellRename effects are considered impactful if they actually change the ID of the cells.\n */\nexport function isImpactful(mark: Mark): boolean {\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase NoopMarkType:\n\t\t\treturn false;\n\t\tcase \"Rename\":\n\t\t\treturn true;\n\t\tcase \"Remove\": {\n\t\t\tconst inputId = getInputCellId(mark);\n\t\t\tif (inputId === undefined) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconst outputId = getOutputCellId(mark);\n\t\t\tassert(outputId !== undefined, 0x824 /* Remove marks must have an output cell ID */);\n\t\t\treturn !areEqualChangeAtomIds(inputId, outputId);\n\t\t}\n\t\tcase \"AttachAndDetach\":\n\t\tcase \"MoveOut\":\n\t\t\treturn true;\n\t\tcase \"MoveIn\":\n\t\t\t// MoveIn marks always target an empty cell.\n\t\t\tassert(mark.cellId !== undefined, 0x825 /* MoveIn marks should target empty cells */);\n\t\t\treturn true;\n\t\tcase \"Insert\":\n\t\t\t// A Revive has no impact if the nodes are already in the document.\n\t\t\treturn mark.cellId !== undefined;\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\nexport function isTombstone(mark: Mark): mark is CellMark<NoopMark> & { cellId: CellId } {\n\treturn mark.type === NoopMarkType && mark.cellId !== undefined && mark.changes === undefined;\n}\n\nexport function isNoopMark(mark: Mark): mark is CellMark<NoopMark> {\n\treturn mark.type === NoopMarkType;\n}\n\nexport function areOverlappingIdRanges(\n\tid1: ChangesetLocalId,\n\tcount1: number,\n\tid2: ChangesetLocalId,\n\tcount2: number,\n): boolean {\n\tconst lastId1 = (id1 as number) + count1 - 1;\n\tconst lastId2 = (id2 as number) + count2 - 1;\n\treturn (id2 <= id1 && id1 <= lastId2) || (id1 <= id2 && id2 <= lastId1);\n}\n\nexport function compareCellsFromSameRevision(\n\tcell1: CellId,\n\tcount1: number,\n\tcell2: CellId,\n\tcount2: number,\n): number | undefined {\n\tassert(\n\t\tcell1.revision === cell2.revision,\n\t\t0x85b /* Expected cells to have the same revision */,\n\t);\n\tif (areOverlappingIdRanges(cell1.localId, count1, cell2.localId, count2)) {\n\t\treturn cell1.localId - cell2.localId;\n\t}\n\treturn undefined;\n}\n\nexport function isDetach(mark: MarkEffect | undefined): mark is Detach {\n\tconst type = mark?.type;\n\treturn type === \"Remove\" || type === \"MoveOut\";\n}\n\nexport function isRemoveMark(mark: Mark | undefined): mark is CellMark<Remove> {\n\treturn mark?.type === \"Remove\";\n}\n\nfunction areMergeableChangeAtoms(\n\tlhs: ChangeAtomId | undefined,\n\tlhsCount: number,\n\trhs: ChangeAtomId | undefined,\n): boolean {\n\tif (lhs === undefined || rhs === undefined) {\n\t\treturn lhs === undefined && rhs === undefined;\n\t}\n\n\treturn (\n\t\tlhs.revision === rhs.revision && areAdjacentIdRanges(lhs.localId, lhsCount, rhs.localId)\n\t);\n}\n\nfunction areAdjacentIdRanges(\n\tfirstStart: ChangesetLocalId,\n\tfirstLength: number,\n\tsecondStart: ChangesetLocalId,\n): boolean {\n\treturn (firstStart as number) + firstLength === secondStart;\n}\n\nfunction haveMergeableIdOverrides(\n\tlhs: DetachFields,\n\tlhsCount: number,\n\trhs: DetachFields,\n): boolean {\n\tif (lhs.idOverride !== undefined && rhs.idOverride !== undefined) {\n\t\treturn areMergeableCellIds(lhs.idOverride, lhsCount, rhs.idOverride);\n\t}\n\treturn (lhs.idOverride === undefined) === (rhs.idOverride === undefined);\n}\n\nfunction areMergeableCellIds(\n\tlhs: CellId | undefined,\n\tlhsCount: number,\n\trhs: CellId | undefined,\n): boolean {\n\treturn areMergeableChangeAtoms(lhs, lhsCount, rhs);\n}\n\n/**\n * Attempts to extend `lhs` to include the effects of `rhs`.\n * @param lhs - The mark to extend.\n * @param rhs - The effect so extend `rhs` with.\n * @returns `lhs` iff the function was able to mutate `lhs` to include the effects of `rhs`.\n * When `undefined` is returned, `lhs` is left untouched.\n */\nexport function tryMergeMarks(lhs: Mark, rhs: Readonly<Mark>): Mark | undefined {\n\tif (rhs.type !== lhs.type) {\n\t\treturn undefined;\n\t}\n\n\tif (!areMergeableCellIds(lhs.cellId, lhs.count, rhs.cellId)) {\n\t\treturn undefined;\n\t}\n\n\tif (rhs.changes !== undefined || lhs.changes !== undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst mergedEffect = tryMergeEffects(lhs, rhs, lhs.count);\n\tif (mergedEffect === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn { ...lhs, ...mergedEffect, count: lhs.count + rhs.count };\n}\n\nfunction tryMergeEffects(\n\tlhs: MarkEffect,\n\trhs: MarkEffect,\n\tlhsCount: number,\n): MarkEffect | undefined {\n\tif (lhs.type !== rhs.type) {\n\t\treturn undefined;\n\t}\n\n\tif (rhs.type === NoopMarkType) {\n\t\treturn lhs;\n\t}\n\n\tif (rhs.type === \"AttachAndDetach\") {\n\t\tconst lhsAttachAndDetach = lhs as AttachAndDetach;\n\t\tconst attach = tryMergeEffects(lhsAttachAndDetach.attach, rhs.attach, lhsCount);\n\t\tconst detach = tryMergeEffects(lhsAttachAndDetach.detach, rhs.detach, lhsCount);\n\t\tif (attach === undefined || detach === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tassert(\n\t\t\tisAttach(attach) && isDetach(detach),\n\t\t\t0x826 /* Merged marks should be same type as input marks */,\n\t\t);\n\t\treturn { ...lhsAttachAndDetach, attach, detach };\n\t}\n\n\tif (\n\t\t(lhs as Partial<HasRevisionTag>).revision !== (rhs as Partial<HasRevisionTag>).revision\n\t) {\n\t\treturn undefined;\n\t}\n\n\tif (isDetach(lhs) && isDetach(rhs) && !haveMergeableIdOverrides(lhs, lhsCount, rhs)) {\n\t\treturn undefined;\n\t}\n\n\tconst type = rhs.type;\n\tswitch (type) {\n\t\tcase \"MoveIn\": {\n\t\t\tconst lhsMoveIn = lhs as MoveIn;\n\t\t\tif (\n\t\t\t\t(lhsMoveIn.id as number) + lhsCount === rhs.id &&\n\t\t\t\tareMergeableChangeAtoms(lhsMoveIn.finalEndpoint, lhsCount, rhs.finalEndpoint)\n\t\t\t) {\n\t\t\t\treturn lhsMoveIn;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"Remove\": {\n\t\t\tconst lhsDetach = lhs as Remove;\n\t\t\tif (\n\t\t\t\t(lhsDetach.id as number) + lhsCount === rhs.id &&\n\t\t\t\thaveMergeableIdOverrides(lhsDetach, lhsCount, rhs)\n\t\t\t) {\n\t\t\t\treturn lhsDetach;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"Rename\": {\n\t\t\tconst lhsDetach = lhs as Rename;\n\t\t\tif (haveMergeableIdOverrides(lhsDetach, lhsCount, rhs)) {\n\t\t\t\treturn lhsDetach;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"MoveOut\": {\n\t\t\tconst lhsMoveOut = lhs as MoveOut;\n\t\t\tif (\n\t\t\t\t(lhsMoveOut.id as number) + lhsCount === rhs.id &&\n\t\t\t\thaveMergeableIdOverrides(lhsMoveOut, lhsCount, rhs) &&\n\t\t\t\tareMergeableChangeAtoms(lhsMoveOut.finalEndpoint, lhsCount, rhs.finalEndpoint)\n\t\t\t) {\n\t\t\t\treturn lhsMoveOut;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"Insert\": {\n\t\t\tconst lhsInsert = lhs as Insert;\n\t\t\tif ((lhsInsert.id as number) + lhsCount === rhs.id) {\n\t\t\t\treturn lhsInsert;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Splits the `mark` into two marks such that the first returned mark has length `length`.\n * @param mark - The mark to split.\n * @param revision - The revision of the changeset the mark is part of.\n * @param length - The desired length for the first of the two returned marks.\n * @param genId - An ID allocator\n * @param moveEffects - The table in which to record splitting of move marks\n * @param recordMoveEffect - Whether when splitting a move an entry should be added to `moveEffects` indicating that the mark should be split (in case we process this mark again).\n * An entry is always added to `moveEffects` indicating that the opposite end of the move should be split.\n * @returns A pair of marks equivalent to the original `mark`\n * such that the first returned mark has input length `length`.\n */\nexport function splitMark<TMark extends Mark>(mark: TMark, length: number): [TMark, TMark] {\n\tconst markLength = mark.count;\n\tconst remainder = markLength - length;\n\tif (length < 1 || remainder < 1) {\n\t\tfail(\"Unable to split mark due to lengths\");\n\t}\n\n\tconst [effect1, effect2] = splitMarkEffect(mark, length);\n\tconst mark1 = { ...mark, ...effect1, count: length };\n\tconst mark2 = { ...mark, ...effect2, count: remainder };\n\tif (mark2.cellId !== undefined) {\n\t\tmark2.cellId = splitDetachEvent(mark2.cellId, length);\n\t}\n\n\treturn [mark1, mark2];\n}\n\nexport function splitMarkEffect<TEffect extends MarkEffect>(\n\teffect: TEffect,\n\tlength: number,\n): [TEffect, TEffect] {\n\tconst type = effect.type;\n\tswitch (type) {\n\t\tcase NoopMarkType:\n\t\t\treturn [effect, effect];\n\t\tcase \"Insert\": {\n\t\t\tconst effect1: TEffect = {\n\t\t\t\t...effect,\n\t\t\t};\n\t\t\tconst effect2: TEffect = {\n\t\t\t\t...effect,\n\t\t\t\tid: (effect.id as number) + length,\n\t\t\t};\n\t\t\treturn [effect1, effect2];\n\t\t}\n\t\tcase \"MoveIn\": {\n\t\t\tconst effect2: TEffect = { ...effect, id: (effect.id as number) + length };\n\t\t\tconst move2 = effect2 as MoveIn;\n\t\t\tif (move2.finalEndpoint !== undefined) {\n\t\t\t\tmove2.finalEndpoint = splitDetachEvent(move2.finalEndpoint, length);\n\t\t\t}\n\t\t\treturn [effect, effect2];\n\t\t}\n\t\tcase \"Remove\": {\n\t\t\tconst effect1 = { ...effect };\n\t\t\tconst id2: ChangesetLocalId = brand((effect.id as number) + length);\n\t\t\tconst effect2 = { ...effect, id: id2 };\n\t\t\tconst effect2Remove = effect2 as Mutable<Remove>;\n\t\t\tif (effect2Remove.idOverride !== undefined) {\n\t\t\t\teffect2Remove.idOverride = splitDetachEvent(effect2Remove.idOverride, length);\n\t\t\t}\n\t\t\treturn [effect1, effect2];\n\t\t}\n\t\tcase \"Rename\": {\n\t\t\tconst effect1 = { ...effect };\n\t\t\tconst effect2 = { ...effect };\n\t\t\tconst effect2Rename = effect2 as Mutable<Rename>;\n\t\t\tif (effect2Rename.idOverride !== undefined) {\n\t\t\t\teffect2Rename.idOverride = splitDetachEvent(effect2Rename.idOverride, length);\n\t\t\t}\n\t\t\treturn [effect1, effect2];\n\t\t}\n\t\tcase \"MoveOut\": {\n\t\t\tconst effect2 = {\n\t\t\t\t...effect,\n\t\t\t\tid: (effect.id as number) + length,\n\t\t\t};\n\n\t\t\tconst return2 = effect2 as Mutable<MoveOut>;\n\n\t\t\tif (return2.idOverride !== undefined) {\n\t\t\t\treturn2.idOverride = splitDetachEvent(return2.idOverride, length);\n\t\t\t}\n\n\t\t\tif (return2.finalEndpoint !== undefined) {\n\t\t\t\treturn2.finalEndpoint = splitDetachEvent(return2.finalEndpoint, length);\n\t\t\t}\n\t\t\treturn [effect, effect2];\n\t\t}\n\t\tcase \"AttachAndDetach\": {\n\t\t\tconst [attach1, attach2] = splitMarkEffect(effect.attach, length);\n\t\t\tconst [detach1, detach2] = splitMarkEffect(effect.detach, length);\n\t\t\tconst effect1 = {\n\t\t\t\t...effect,\n\t\t\t\tattach: attach1,\n\t\t\t\tdetach: detach1,\n\t\t\t};\n\n\t\t\tconst effect2 = {\n\t\t\t\t...effect,\n\t\t\t\tattach: attach2,\n\t\t\t\tdetach: detach2,\n\t\t\t};\n\n\t\t\treturn [effect1, effect2];\n\t\t}\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\nfunction splitDetachEvent(detachEvent: CellId, length: number): CellId {\n\treturn { ...detachEvent, localId: brand((detachEvent.localId as number) + length) };\n}\n\n// TODO: Refactor MarkEffect into a field of CellMark so this function isn't necessary.\nexport function extractMarkEffect<TEffect extends MarkEffect>(\n\tmark: CellMark<TEffect>,\n): TEffect {\n\tconst { cellId: _cellId, count: _count, changes: _changes, ...effect } = mark;\n\treturn effect as unknown as TEffect;\n}\n\n// TODO: Refactor MarkEffect into a field of CellMark so this function isn't necessary.\nexport function omitMarkEffect(mark: CellMark<unknown>): CellMark<NoopMark> {\n\tconst { cellId, count, changes } = mark;\n\tconst noopMark: CellMark<NoopMark> = { count };\n\tif (cellId !== undefined) {\n\t\tnoopMark.cellId = cellId;\n\t}\n\tif (changes !== undefined) {\n\t\tnoopMark.changes = changes;\n\t}\n\treturn noopMark;\n}\n\nexport function withNodeChange<TMark extends CellMark<TKind>, TKind extends MarkEffect>(\n\tmark: TMark,\n\tchanges: NodeId | undefined,\n): TMark {\n\tconst newMark = { ...mark };\n\tif (changes !== undefined) {\n\t\tnewMark.changes = changes;\n\t} else {\n\t\tdelete newMark.changes;\n\t}\n\treturn newMark;\n}\n\nexport function withRevision<TMark extends Mark>(\n\tmark: TMark,\n\trevision: RevisionTag | undefined,\n): TMark {\n\tif (revision === undefined) {\n\t\treturn mark;\n\t}\n\n\tconst cloned = cloneMark(mark);\n\taddRevision(cloned, revision);\n\tif (\n\t\tcloned.cellId !== undefined &&\n\t\tcloned.cellId.revision === undefined &&\n\t\trevision !== undefined\n\t) {\n\t\t(cloned.cellId as Mutable<CellId>).revision = revision;\n\t}\n\treturn cloned;\n}\n\nfunction addRevision(effect: MarkEffect, revision: RevisionTag): void {\n\tif (effect.type === NoopMarkType || isRename(effect)) {\n\t\treturn;\n\t}\n\n\tif (effect.type === \"AttachAndDetach\") {\n\t\taddRevision(effect.attach, revision);\n\t\taddRevision(effect.detach, revision);\n\t\treturn;\n\t}\n\n\tassert(\n\t\teffect.revision === undefined || effect.revision === revision,\n\t\t0x829 /* Should not overwrite mark revision */,\n\t);\n\teffect.revision = revision;\n}\n\nexport function getEndpoint(effect: MoveMarkEffect): ChangeAtomId {\n\treturn effect.finalEndpoint ?? { revision: effect.revision, localId: effect.id };\n}\n\nexport function getCrossFieldKeys(change: Changeset): CrossFieldKeyRange[] {\n\tconst keys: CrossFieldKeyRange[] = [];\n\tfor (const mark of change) {\n\t\tkeys.push(...getCrossFieldKeysForMarkEffect(mark, mark.count));\n\t}\n\n\treturn keys;\n}\n\nfunction getCrossFieldKeysForMarkEffect(\n\teffect: MarkEffect,\n\tcount: number,\n): CrossFieldKeyRange[] {\n\tswitch (effect.type) {\n\t\tcase \"Insert\":\n\t\t\t// An insert behaves like a move where the source and destination are at the same location.\n\t\t\t// An insert can become a move when after rebasing.\n\t\t\treturn [\n\t\t\t\t[CrossFieldTarget.Source, effect.revision, effect.id, count],\n\t\t\t\t[CrossFieldTarget.Destination, effect.revision, effect.id, count],\n\t\t\t];\n\t\tcase \"MoveOut\":\n\t\t\treturn [[CrossFieldTarget.Source, effect.revision, effect.id, count]];\n\t\tcase \"MoveIn\":\n\t\t\treturn [[CrossFieldTarget.Destination, effect.revision, effect.id, count]];\n\t\tcase \"AttachAndDetach\":\n\t\t\treturn [\n\t\t\t\t...getCrossFieldKeysForMarkEffect(effect.attach, count),\n\t\t\t\t...getCrossFieldKeysForMarkEffect(effect.detach, count),\n\t\t\t];\n\t\tdefault:\n\t\t\treturn [];\n\t}\n}\n"]}
|
|
@@ -11,7 +11,6 @@ import { FlexFieldSchema, type FlexTreeNodeSchema, type FlexTreeSchema } from ".
|
|
|
11
11
|
* If the input schema came from a view schema, it will not return the same view schema, and will not be compatible:
|
|
12
12
|
* the returned TreeSchema is simply one which schematize will not object to.
|
|
13
13
|
* Assumes the schema uses the default field kinds.
|
|
14
|
-
* @internal
|
|
15
14
|
*/
|
|
16
15
|
export declare function treeSchemaFromStoredSchema(schema: TreeStoredSchema): FlexTreeSchema;
|
|
17
16
|
export declare function fieldSchemaFromStoredSchema(schema: TreeFieldStoredSchema, map: ReadonlyMap<TreeNodeSchemaIdentifier, FlexTreeNodeSchema>): FlexFieldSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storedToViewSchema.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/storedToViewSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAIN,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAGN,eAAe,EAIf,KAAK,kBAAkB,EACvB,KAAK,cAAc,EAEnB,MAAM,yBAAyB,CAAC;AAEjC
|
|
1
|
+
{"version":3,"file":"storedToViewSchema.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/storedToViewSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAIN,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAGN,eAAe,EAIf,KAAK,kBAAkB,EACvB,KAAK,cAAc,EAEnB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,gBAAgB,GAAG,cAAc,CAoCnF;AAgBD,wBAAgB,2BAA2B,CAC1C,MAAM,EAAE,qBAAqB,EAC7B,GAAG,EAAE,WAAW,CAAC,wBAAwB,EAAE,kBAAkB,CAAC,GAC5D,eAAe,CAOjB"}
|
|
@@ -17,7 +17,6 @@ const index_js_4 = require("./typed-schema/index.js");
|
|
|
17
17
|
* If the input schema came from a view schema, it will not return the same view schema, and will not be compatible:
|
|
18
18
|
* the returned TreeSchema is simply one which schematize will not object to.
|
|
19
19
|
* Assumes the schema uses the default field kinds.
|
|
20
|
-
* @internal
|
|
21
20
|
*/
|
|
22
21
|
function treeSchemaFromStoredSchema(schema) {
|
|
23
22
|
const map = new Map();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storedToViewSchema.js","sourceRoot":"","sources":["../../src/feature-libraries/storedToViewSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,+CAO0B;AAC1B,+CAAwC;AAExC,wDAAgE;AAChE,sDAUiC;AAEjC
|
|
1
|
+
{"version":3,"file":"storedToViewSchema.js","sourceRoot":"","sources":["../../src/feature-libraries/storedToViewSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,+CAO0B;AAC1B,+CAAwC;AAExC,wDAAgE;AAChE,sDAUiC;AAEjC;;;;;;;GAOG;AACH,SAAgB,0BAA0B,CAAC,MAAwB;IAClE,MAAM,GAAG,GAAsD,IAAI,GAAG,EAAE,CAAC;IACzE,KAAK,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QAC3D,IAAI,WAAW,YAAY,+BAAoB,EAAE,CAAC;YACjD,GAAG,CAAC,GAAG,CACN,UAAU,EACV,yBAAc,CAAC,MAAM,CAAC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AAI,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC;QAC1C,yFAAyF;QACzF,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,GAAG,EAAE;YACrC,UAAU,EAAE,IAAI;YAChB,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,KAAK;YACf,KAAK;SACL,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,SAAgB,2BAA2B,CAC1C,MAA6B,EAC7B,GAA8D;IAE9D,MAAM,IAAI,GAAG,8BAAmB,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAA,eAAI,EAAC,oBAAoB,CAAC,CAAC;IAC3F,MAAM,KAAK,GACV,MAAM,CAAC,KAAK,KAAK,SAAS;QACzB,CAAC,CAAC,CAAC,cAAG,CAAC;QACP,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,IAAA,eAAI,EAAC,gBAAgB,CAAC,CAAC,CAAC;IAChF,OAAO,0BAAe,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC;AAVD,kEAUC","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 {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeStoredSchema,\n} from \"../core/index.js\";\nimport { fail } from \"../util/index.js\";\n\nimport { defaultSchemaPolicy } from \"./default-schema/index.js\";\nimport {\n\tAny,\n\ttype FlexAllowedTypes,\n\tFlexFieldSchema,\n\ttype FlexMapFieldSchema,\n\tFlexMapNodeSchema,\n\tFlexObjectNodeSchema,\n\ttype FlexTreeNodeSchema,\n\ttype FlexTreeSchema,\n\tLeafNodeSchema,\n} from \"./typed-schema/index.js\";\n\n/**\n * Creates a new view schema using the stored schema.\n * @remarks\n * This is really only suitable for use with code that happens to need access to things which require a view schema, but isn't actually schema aware.\n * If the input schema came from a view schema, it will not return the same view schema, and will not be compatible:\n * the returned TreeSchema is simply one which schematize will not object to.\n * Assumes the schema uses the default field kinds.\n */\nexport function treeSchemaFromStoredSchema(schema: TreeStoredSchema): FlexTreeSchema {\n\tconst map: Map<TreeNodeSchemaIdentifier, FlexTreeNodeSchema> = new Map();\n\tfor (const [identifier, innerSchema] of schema.nodeSchema) {\n\t\tif (innerSchema instanceof LeafNodeStoredSchema) {\n\t\t\tmap.set(\n\t\t\t\tidentifier,\n\t\t\t\tLeafNodeSchema.create({ name: \"intoTypedSchema\" }, identifier, innerSchema.leafValue),\n\t\t\t);\n\t\t} else if (innerSchema instanceof MapNodeStoredSchema) {\n\t\t\tmap.set(\n\t\t\t\tidentifier,\n\t\t\t\tFlexMapNodeSchema.create(\n\t\t\t\t\t{ name: \"intoTypedSchema\" },\n\t\t\t\t\tidentifier,\n\t\t\t\t\tfieldSchemaFromStoredSchema(innerSchema.mapFields, map) as FlexMapFieldSchema,\n\t\t\t\t),\n\t\t\t);\n\t\t} else {\n\t\t\tassert(innerSchema instanceof ObjectNodeStoredSchema, 0x882 /* unsupported node kind */);\n\t\t\tconst fields = new Map<string, FlexFieldSchema>();\n\t\t\tfor (const [key, field] of innerSchema.objectNodeFields) {\n\t\t\t\tfields.set(key, fieldSchemaFromStoredSchema(field, map));\n\t\t\t}\n\t\t\tconst fieldsObject = mapToObject(fields);\n\t\t\tmap.set(\n\t\t\t\tidentifier,\n\t\t\t\tFlexObjectNodeSchema.create({ name: \"intoTypedSchema\" }, identifier, fieldsObject),\n\t\t\t);\n\t\t}\n\t}\n\treturn {\n\t\tadapters: {},\n\t\tpolicy: defaultSchemaPolicy,\n\t\trootFieldSchema: fieldSchemaFromStoredSchema(schema.rootFieldSchema, map),\n\t\tnodeSchema: map,\n\t};\n}\n\nfunction mapToObject<MapValue>(map: Map<string, MapValue>): Record<string, MapValue> {\n\tconst objectMap: Record<string, MapValue> = Object.create(null);\n\tfor (const [key, value] of map.entries()) {\n\t\t// This code has to be careful to avoid assigned to __proto__ or similar built in fields.\n\t\tObject.defineProperty(objectMap, key, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\twritable: false,\n\t\t\tvalue,\n\t\t});\n\t}\n\treturn objectMap;\n}\n\nexport function fieldSchemaFromStoredSchema(\n\tschema: TreeFieldStoredSchema,\n\tmap: ReadonlyMap<TreeNodeSchemaIdentifier, FlexTreeNodeSchema>,\n): FlexFieldSchema {\n\tconst kind = defaultSchemaPolicy.fieldKinds.get(schema.kind) ?? fail(\"missing field kind\");\n\tconst types: FlexAllowedTypes =\n\t\tschema.types === undefined\n\t\t\t? [Any]\n\t\t\t: Array.from(schema.types, (v) => () => map.get(v) ?? fail(\"missing schema\"));\n\treturn FlexFieldSchema.create(kind, types);\n}\n"]}
|