@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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.getAllowedContentIncompatibilities = void 0;
|
|
7
|
+
exports.isRepoSuperset = exports.getAllowedContentIncompatibilities = void 0;
|
|
8
8
|
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
9
9
|
const index_js_1 = require("../../core/index.js");
|
|
10
10
|
/**
|
|
@@ -183,7 +183,7 @@ exports.getAllowedContentIncompatibilities = getAllowedContentIncompatibilities;
|
|
|
183
183
|
*/
|
|
184
184
|
function trackFieldDiscrepancies(view, stored, keyOrRoot) {
|
|
185
185
|
const differences = [];
|
|
186
|
-
// Only track the
|
|
186
|
+
// Only track the symmetric differences of two sets.
|
|
187
187
|
const findSetDiscrepancies = (a, b) => {
|
|
188
188
|
if (a === undefined && b === undefined) {
|
|
189
189
|
return [[], []];
|
|
@@ -258,6 +258,109 @@ function trackObjectNodeDiscrepancies(view, stored) {
|
|
|
258
258
|
}
|
|
259
259
|
return differences;
|
|
260
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* @remarks
|
|
263
|
+
*
|
|
264
|
+
* This function uses incompatibilities to determine if changes to a document schema are backward-compatible, i.e., it determines
|
|
265
|
+
* whether the `view` schema allows a superset of the documents that the `stored` schema allows.
|
|
266
|
+
* According to the policy of schema evolution, `isRepoSuperset` supports three types of changes:
|
|
267
|
+
* 1. Adding an optional field to an object node.
|
|
268
|
+
* 2. Expanding the set of allowed types for a field.
|
|
269
|
+
* 3. Relaxing a field kind to a more general field kind.
|
|
270
|
+
*
|
|
271
|
+
* Notes: We expect isRepoSuperset to return consistent results with allowsRepoSuperset. However, currently there are some scenarios
|
|
272
|
+
* where the inconsistency will occur:
|
|
273
|
+
*
|
|
274
|
+
* - Different Node Kinds: If a and b have different node kinds (e.g., a is an objectNodeSchema and b is a mapNodeSchema),
|
|
275
|
+
* `isRepoSuperset` will determine that a can never be the superset of b. In contrast, `allowsRepoSuperset` will continue
|
|
276
|
+
* validating internal fields.
|
|
277
|
+
*/
|
|
278
|
+
function isRepoSuperset(view, stored) {
|
|
279
|
+
const incompatibilities = getAllowedContentIncompatibilities(view, stored);
|
|
280
|
+
for (const incompatibility of incompatibilities) {
|
|
281
|
+
switch (incompatibility.mismatch) {
|
|
282
|
+
case "nodeKind": {
|
|
283
|
+
return false;
|
|
284
|
+
}
|
|
285
|
+
case "valueSchema":
|
|
286
|
+
case "allowedTypes":
|
|
287
|
+
case "fieldKind": {
|
|
288
|
+
if (!validateFieldIncompatibility(incompatibility)) {
|
|
289
|
+
return false;
|
|
290
|
+
}
|
|
291
|
+
break;
|
|
292
|
+
}
|
|
293
|
+
case "fields": {
|
|
294
|
+
if (incompatibility.differences.some((difference) => !validateFieldIncompatibility(difference))) {
|
|
295
|
+
return false;
|
|
296
|
+
}
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
299
|
+
// No default
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
return true;
|
|
303
|
+
}
|
|
304
|
+
exports.isRepoSuperset = isRepoSuperset;
|
|
305
|
+
function validateFieldIncompatibility(incompatibility) {
|
|
306
|
+
switch (incompatibility.mismatch) {
|
|
307
|
+
case "allowedTypes": {
|
|
308
|
+
// Since we only track the symmetric difference between the allowed types in the view and
|
|
309
|
+
// stored schemas, it's sufficient to check if any extra allowed types still exist in the
|
|
310
|
+
// stored schema.
|
|
311
|
+
return incompatibility.stored.length === 0;
|
|
312
|
+
}
|
|
313
|
+
case "fieldKind": {
|
|
314
|
+
if (incompatibility.stored === undefined) {
|
|
315
|
+
// Add an optional field
|
|
316
|
+
if (incompatibility.view === "Optional") {
|
|
317
|
+
return true;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
// Relax the field to make it more general
|
|
322
|
+
return compareFieldKind(incompatibility.stored, incompatibility.view);
|
|
323
|
+
}
|
|
324
|
+
break;
|
|
325
|
+
}
|
|
326
|
+
case "valueSchema": {
|
|
327
|
+
return false;
|
|
328
|
+
}
|
|
329
|
+
// No default
|
|
330
|
+
}
|
|
331
|
+
return false;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* A mapping that defines the order of field kinds for comparison purposes.
|
|
335
|
+
* The numeric values indicate the hierarchy or "strength" of each field kind, where lower numbers are more restrictive.
|
|
336
|
+
* This is used to determine if one field kind can be considered a superset of another.
|
|
337
|
+
*
|
|
338
|
+
* - "Forbidden": The most restrictive, represented by 1. Indicates a forbidden field.
|
|
339
|
+
* - "Value": Represented by 2. Indicates a required field with a specific value.
|
|
340
|
+
* - "Optional": Represented by 3. Indicates an optional field.
|
|
341
|
+
*
|
|
342
|
+
* Note:
|
|
343
|
+
* - "Sequence": (Currently commented out) was intended to represent a sequence field kind with a value of 4.
|
|
344
|
+
* Relaxing non-sequence fields to sequences is not currently supported but may be considered in the future.
|
|
345
|
+
*
|
|
346
|
+
* TODO: We may need more coverage in realm to prove the correctness of the Forbidden -\> Value transaction
|
|
347
|
+
*/
|
|
348
|
+
const fieldKindOrder = {
|
|
349
|
+
"Forbidden": 1,
|
|
350
|
+
"Value": 2,
|
|
351
|
+
"Optional": 3,
|
|
352
|
+
// "Sequence": 4, // Relaxing non-sequence fields to sequences is not currently supported, though we could consider doing so in the future.
|
|
353
|
+
};
|
|
354
|
+
function compareFieldKind(aKind, bKind) {
|
|
355
|
+
if (aKind === undefined || bKind === undefined) {
|
|
356
|
+
return false;
|
|
357
|
+
}
|
|
358
|
+
if (!(aKind in fieldKindOrder) || !(bKind in fieldKindOrder)) {
|
|
359
|
+
return false;
|
|
360
|
+
}
|
|
361
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
362
|
+
return fieldKindOrder[aKind] <= fieldKindOrder[bKind];
|
|
363
|
+
}
|
|
261
364
|
function throwUnsupportedNodeType(type) {
|
|
262
365
|
throw new TypeError(`Unsupported node stored schema type: ${type}`);
|
|
263
366
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discrepancies.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/discrepancies.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,kDAW6B;AAqF7B;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,kCAAkC,CACjD,IAAsB,EACtB,MAAwB;IAExB,MAAM,iBAAiB,GAAsB,EAAE,CAAC;IAEhD,kCAAkC;IAClC,iBAAiB,CAAC,IAAI,CACrB,GAAG,uBAAuB,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,eAAe,CAAC,CACxE,CAAC;IAEF,+FAA+F;IAC/F,qCAAqC;IACrC,MAAM,YAAY,GAAG,IAAI,GAAG,EAA4B,CAAC;IACzD,KAAK,MAAM,CAAC,GAAG,EAAE,cAAc,CAAC,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;QACrD,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAEtB,IAAI,cAAc,YAAY,iCAAsB,EAAE,CAAC;YACtD,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBACjC,iBAAiB,CAAC,IAAI,CAAC;oBACtB,UAAU,EAAE,GAAG;oBACf,QAAQ,EAAE,UAAU;oBACpB,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE,SAAS;iBACjB,CAAC,CAAC;YACJ,CAAC;iBAAM,CAAC;g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,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5C,WAAW,CAAC,IAAI,CAAC;gBAChB,UAAU,EAAE,QAAQ;gBACpB,QAAQ,EAAE,WAAW;gBACrB,IAAI,EAAE,iBAAiB,CAAC,IAAI;gBAC5B,MAAM,EAAE,SAAS;aACkB,CAAC,CAAC;QACvC,CAAC;aAAM,CAAC;YACP,WAAW,CAAC,IAAI,CACf,GAAG,uBAAuB,CACzB,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAA0B,EAC5D,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAA0B,EAC9D,QAAQ,CACR,CACD,CAAC;QACH,CAAC;IACF,CAAC;IAED,KAAK,MAAM,CAAC,QAAQ,EAAE,iBAAiB,CAAC,IAAI,MAAM,CAAC,gBAAgB,EAAE,CAAC;QACrE,IAAI,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YACjC,SAAS;QACV,CAAC;QACD,WAAW,CAAC,IAAI,CAAC;YAChB,UAAU,EAAE,QAAQ;YACpB,QAAQ,EAAE,WAAW;YACrB,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,iBAAiB,CAAC,IAAI;SACK,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,WAAW,CAAC;AACpB,CAAC;AAED,SAAS,wBAAwB,CAAC,IAAY;IAC7C,MAAM,IAAI,SAAS,CAAC,wCAAwC,IAAI,EAAE,CAAC,CAAC;AACrE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n} from \"../../core/index.js\";\n\n/**\n * @remarks\n *\n * 1. FieldIncompatibility\n *\n * `FieldIncompatibility` represents the differences between two `TreeFieldStoredSchema` objects. It consists of\n * three types of incompatibilities:\n *\n * - FieldKindIncompatibility: Indicates the differences in `FieldKindIdentifier` between two `TreeFieldStoredSchema`\n * objects (e.g., optional, required, sequence, etc.).\n * - AllowedTypesIncompatibility: Indicates the differences in the allowed child types between the two schemas.\n * - ValueSchemaIncompatibility: Specifically indicates the differences in the `ValueSchema` of two\n * `LeafNodeStoredSchema` objects.\n *\n * 2. NodeIncompatibility\n *\n * `NodeIncompatibility` represents the differences between two `TreeNodeStoredSchema` objects and includes:\n *\n * - NodeKindIncompatibility: Indicates the differences in the types of `TreeNodeStoredSchema` (currently supports\n * `ObjectNodeStoredSchema`, `MapNodeStoredSchema`, and `LeafNodeStoredSchema`).\n * - NodeFieldsIncompatibility: Indicates the `FieldIncompatibility` of `TreeFieldStoredSchema` within two\n * `TreeNodeStoredSchema`. It includes an array of `FieldIncompatibility` instances in the `differences` field.\n *\n * When comparing two nodes for compatibility, it only makes sense to compare their fields if the nodes are of\n * the same kind (map, object, leaf).\n *\n * 3. Incompatibility\n *\n * Incompatibility consists of both `NodeIncompatibility` and `FieldIncompatibility`, representing any kind of\n * schema differences. See {@link getAllowedContentIncompatibilities} for more details about how we process it\n * and the ordering.\n */\nexport type Incompatibility = FieldIncompatibility | NodeIncompatibility;\n\nexport type NodeIncompatibility = NodeKindIncompatibility | NodeFieldsIncompatibility;\n\nexport type FieldIncompatibility =\n\t| AllowedTypeIncompatibility\n\t| FieldKindIncompatibility\n\t| ValueSchemaIncompatibility;\n\nexport interface AllowedTypeIncompatibility {\n\tidentifier: string | undefined; // undefined indicates root field schema\n\tmismatch: \"allowedTypes\";\n\t/**\n\t * List of allowed type identifiers in viewed schema\n\t */\n\tview: string[];\n\t/**\n\t * List of allowed type identifiers in stored schema\n\t */\n\tstored: string[];\n}\n\nexport interface FieldKindIncompatibility {\n\tidentifier: string | undefined; // undefined indicates root field schema\n\tmismatch: \"fieldKind\";\n\tview: FieldKindIdentifier | undefined;\n\tstored: FieldKindIdentifier | undefined;\n}\n\nexport interface ValueSchemaIncompatibility {\n\tidentifier: string;\n\tmismatch: \"valueSchema\";\n\tview: ValueSchema | undefined;\n\tstored: ValueSchema | undefined;\n}\n\nexport interface NodeKindIncompatibility {\n\tidentifier: string;\n\tmismatch: \"nodeKind\";\n\tview: SchemaFactoryNodeKind | undefined;\n\tstored: SchemaFactoryNodeKind | undefined;\n}\n\nexport interface NodeFieldsIncompatibility {\n\tidentifier: string;\n\tmismatch: \"fields\";\n\tdifferences: FieldIncompatibility[];\n}\n\ntype SchemaFactoryNodeKind = \"object\" | \"leaf\" | \"map\";\n\n/**\n * @remarks\n *\n * The workflow for finding schema incompatibilities:\n * 1. Compare the two root schemas to identify any `FieldIncompatibility`.\n *\n * 2. For each node schema in the `view`:\n * - Verify if the node schema exists in the stored. If it does, ensure that the `SchemaFactoryNodeKind` are\n * consistent. Otherwise this difference is treated as `NodeKindIncompatibility`\n * - If a node schema with the same identifier exists in both view and stored, and their `SchemaFactoryNodeKind`\n * are consistent, perform a exhaustive validation to identify all `FieldIncompatibility`.\n *\n * 3. For each node schema in the stored, verify if it exists in the view. The overlapping parts were already\n * addressed in the previous step.\n *\n * @returns the discrepancies between two TreeStoredSchema objects\n */\nexport function getAllowedContentIncompatibilities(\n\tview: TreeStoredSchema,\n\tstored: TreeStoredSchema,\n): Incompatibility[] {\n\tconst incompatibilities: Incompatibility[] = [];\n\n\t// check root schema discrepancies\n\tincompatibilities.push(\n\t\t...trackFieldDiscrepancies(view.rootFieldSchema, stored.rootFieldSchema),\n\t);\n\n\t// Verify the existence and type of a node schema given its identifier (key), then determine if\n\t// an exhaustive search is necessary.\n\tconst viewNodeKeys = new Set<TreeNodeSchemaIdentifier>();\n\tfor (const [key, viewNodeSchema] of view.nodeSchema) {\n\t\tviewNodeKeys.add(key);\n\n\t\tif (viewNodeSchema instanceof ObjectNodeStoredSchema) {\n\t\t\tif (!stored.nodeSchema.has(key)) {\n\t\t\t\tincompatibilities.push({\n\t\t\t\t\tidentifier: key,\n\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\tview: \"object\",\n\t\t\t\t\tstored: undefined,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst storedNodeSchema = stored.nodeSchema.get(key);\n\t\t\t\tassert(\n\t\t\t\t\tstoredNodeSchema !== undefined,\n\t\t\t\t\t0x9be /* The storedNodeSchema in stored.nodeSchema should not be undefined */,\n\t\t\t\t);\n\t\t\t\tif (storedNodeSchema instanceof MapNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"object\",\n\t\t\t\t\t\tstored: \"map\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof LeafNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"object\",\n\t\t\t\t\t\tstored: \"leaf\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof ObjectNodeStoredSchema) {\n\t\t\t\t\tconst differences = trackObjectNodeDiscrepancies(viewNodeSchema, storedNodeSchema);\n\t\t\t\t\tif (differences.length > 0) {\n\t\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\t\tmismatch: \"fields\",\n\t\t\t\t\t\t\tdifferences,\n\t\t\t\t\t\t} satisfies NodeFieldsIncompatibility);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrowUnsupportedNodeType(storedNodeSchema.constructor.name);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (viewNodeSchema instanceof MapNodeStoredSchema) {\n\t\t\tif (!stored.nodeSchema.has(key)) {\n\t\t\t\tincompatibilities.push({\n\t\t\t\t\tidentifier: key,\n\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\tview: \"map\",\n\t\t\t\t\tstored: undefined,\n\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t} else {\n\t\t\t\tconst storedNodeSchema = stored.nodeSchema.get(key);\n\t\t\t\tassert(\n\t\t\t\t\tstoredNodeSchema !== undefined,\n\t\t\t\t\t0x9bf /* The storedNodeSchema in stored.nodeSchema should not be undefined */,\n\t\t\t\t);\n\t\t\t\tif (storedNodeSchema instanceof ObjectNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"map\",\n\t\t\t\t\t\tstored: \"object\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof LeafNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"map\",\n\t\t\t\t\t\tstored: \"leaf\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof MapNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push(\n\t\t\t\t\t\t...trackFieldDiscrepancies(\n\t\t\t\t\t\t\tviewNodeSchema.mapFields,\n\t\t\t\t\t\t\tstoredNodeSchema.mapFields,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tthrowUnsupportedNodeType(storedNodeSchema.constructor.name);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (viewNodeSchema instanceof LeafNodeStoredSchema) {\n\t\t\tif (!stored.nodeSchema.has(key)) {\n\t\t\t\tincompatibilities.push({\n\t\t\t\t\tidentifier: key,\n\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\tview: \"leaf\",\n\t\t\t\t\tstored: undefined,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst storedNodeSchema = stored.nodeSchema.get(key);\n\t\t\t\tassert(\n\t\t\t\t\tstoredNodeSchema !== undefined,\n\t\t\t\t\t0x9c0 /* The storedNodeSchema in stored.nodeSchema should not be undefined */,\n\t\t\t\t);\n\t\t\t\tif (storedNodeSchema instanceof MapNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"leaf\",\n\t\t\t\t\t\tstored: \"map\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof ObjectNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"leaf\",\n\t\t\t\t\t\tstored: \"object\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof LeafNodeStoredSchema) {\n\t\t\t\t\tif (viewNodeSchema.leafValue !== storedNodeSchema.leafValue) {\n\t\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\t\tmismatch: \"valueSchema\",\n\t\t\t\t\t\t\tview: viewNodeSchema.leafValue,\n\t\t\t\t\t\t\tstored: storedNodeSchema.leafValue,\n\t\t\t\t\t\t} satisfies ValueSchemaIncompatibility);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrowUnsupportedNodeType(storedNodeSchema.constructor.name);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrowUnsupportedNodeType(viewNodeSchema.constructor.name);\n\t\t}\n\t}\n\n\tfor (const [key, storedNodeSchema] of stored.nodeSchema) {\n\t\tif (!viewNodeKeys.has(key)) {\n\t\t\tincompatibilities.push({\n\t\t\t\tidentifier: key,\n\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\tview: undefined,\n\t\t\t\tstored:\n\t\t\t\t\tstoredNodeSchema instanceof MapNodeStoredSchema\n\t\t\t\t\t\t? \"map\"\n\t\t\t\t\t\t: storedNodeSchema instanceof ObjectNodeStoredSchema\n\t\t\t\t\t\t\t? \"object\"\n\t\t\t\t\t\t\t: \"leaf\",\n\t\t\t} satisfies NodeKindIncompatibility);\n\t\t}\n\t}\n\n\treturn incompatibilities;\n}\n\n/**\n * The function to track the discrepancies between two field stored schemas.\n *\n * @param keyOrRoot - If the key is missing, it indicates that this is the root field schema.\n */\nfunction trackFieldDiscrepancies(\n\tview: TreeFieldStoredSchema,\n\tstored: TreeFieldStoredSchema,\n\tkeyOrRoot?: string,\n): FieldIncompatibility[] {\n\tconst differences: FieldIncompatibility[] = [];\n\n\t// Only track the intersection of the two sets.\n\tconst findSetDiscrepancies = (\n\t\ta: TreeTypeSet,\n\t\tb: TreeTypeSet,\n\t): [TreeNodeSchemaIdentifier[], TreeNodeSchemaIdentifier[]] => {\n\t\tif (a === undefined && b === undefined) {\n\t\t\treturn [[], []];\n\t\t}\n\n\t\tif (a !== undefined && b !== undefined) {\n\t\t\tconst aDiff = [...a].filter((value) => !b.has(value));\n\t\t\tconst bDiff = [...b].filter((value) => !a.has(value));\n\t\t\treturn [aDiff, bDiff];\n\t\t}\n\n\t\tif (a !== undefined) {\n\t\t\treturn [[...a], []];\n\t\t}\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn [[], [...b!]];\n\t};\n\n\tconst allowedTypesDiscrepancies = findSetDiscrepancies(view.types, stored.types);\n\tif (allowedTypesDiscrepancies[0].length > 0 || allowedTypesDiscrepancies[1].length > 0) {\n\t\tdifferences.push({\n\t\t\tidentifier: keyOrRoot,\n\t\t\tmismatch: \"allowedTypes\",\n\t\t\tview: allowedTypesDiscrepancies[0],\n\t\t\tstored: allowedTypesDiscrepancies[1],\n\t\t} satisfies AllowedTypeIncompatibility);\n\t}\n\n\tif (view.kind !== stored.kind) {\n\t\tdifferences.push({\n\t\t\tidentifier: keyOrRoot,\n\t\t\tmismatch: \"fieldKind\",\n\t\t\tview: view.kind,\n\t\t\tstored: stored.kind,\n\t\t} satisfies FieldKindIncompatibility);\n\t}\n\n\treturn differences;\n}\n\nfunction trackObjectNodeDiscrepancies(\n\tview: ObjectNodeStoredSchema,\n\tstored: ObjectNodeStoredSchema,\n): FieldIncompatibility[] {\n\tconst differences: FieldIncompatibility[] = [];\n\tconst viewFieldKeys = new Set<FieldKey>();\n\t/**\n\t * Similar to the logic used for tracking discrepancies between two node schemas, we will identify\n\t * three types of differences:\n\t * 1. Fields that exist in the view schema but not in the stored schema.\n\t * 2. Fields that exist in both schemas but have different contents.\n\t * 3. Fields that exist in the stored schema but not in the view schema.\n\t *\n\t * First, the view schema is iterated to track the first two types of differences.\n\t * Then, the stored schema is iterated to find the third type.\n\t */\n\n\tfor (const [fieldKey, fieldStoredSchema] of view.objectNodeFields) {\n\t\tviewFieldKeys.add(fieldKey);\n\t\tif (!stored.objectNodeFields.has(fieldKey)) {\n\t\t\tdifferences.push({\n\t\t\t\tidentifier: fieldKey,\n\t\t\t\tmismatch: \"fieldKind\",\n\t\t\t\tview: fieldStoredSchema.kind,\n\t\t\t\tstored: undefined,\n\t\t\t} satisfies FieldKindIncompatibility);\n\t\t} else {\n\t\t\tdifferences.push(\n\t\t\t\t...trackFieldDiscrepancies(\n\t\t\t\t\tview.objectNodeFields.get(fieldKey) as TreeFieldStoredSchema,\n\t\t\t\t\tstored.objectNodeFields.get(fieldKey) as TreeFieldStoredSchema,\n\t\t\t\t\tfieldKey,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t}\n\n\tfor (const [fieldKey, fieldStoredSchema] of stored.objectNodeFields) {\n\t\tif (viewFieldKeys.has(fieldKey)) {\n\t\t\tcontinue;\n\t\t}\n\t\tdifferences.push({\n\t\t\tidentifier: fieldKey,\n\t\t\tmismatch: \"fieldKind\",\n\t\t\tview: undefined,\n\t\t\tstored: fieldStoredSchema.kind,\n\t\t} satisfies FieldKindIncompatibility);\n\t}\n\n\treturn differences;\n}\n\nfunction throwUnsupportedNodeType(type: string): never {\n\tthrow new TypeError(`Unsupported node stored schema type: ${type}`);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"discrepancies.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/discrepancies.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,kDAW6B;AAqF7B;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,kCAAkC,CACjD,IAAsB,EACtB,MAAwB;IAExB,MAAM,iBAAiB,GAAsB,EAAE,CAAC;IAEhD,kCAAkC;IAClC,iBAAiB,CAAC,IAAI,CACrB,GAAG,uBAAuB,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,eAAe,CAAC,CACxE,CAAC;IAEF,+FAA+F;IAC/F,qCAAqC;IACrC,MAAM,YAAY,GAAG,IAAI,GAAG,EAA4B,CAAC;IACzD,KAAK,MAAM,CAAC,GAAG,EAAE,cAAc,CAAC,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;QACrD,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAEtB,IAAI,cAAc,YAAY,iCAAsB,EAAE,CAAC;YACtD,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBACjC,iBAAiB,CAAC,IAAI,CAAC;oBACtB,UAAU,EAAE,GAAG;oBACf,QAAQ,EAAE,UAAU;oBACpB,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE,SAAS;iBACjB,CAAC,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACP,MAAM,gB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AE,CAAC;IACV,UAAU,EAAE,CAAC;IACb,4IAA4I;CAC5I,CAAC;AAEF,SAAS,gBAAgB,CACxB,KAAsC,EACtC,KAAsC;IAEtC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACd,CAAC;IAED,IAAI,CAAC,CAAC,KAAK,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,cAAc,CAAC,EAAE,CAAC;QAC9D,OAAO,KAAK,CAAC;IACd,CAAC;IAED,oEAAoE;IACpE,OAAO,cAAc,CAAC,KAAK,CAAE,IAAI,cAAc,CAAC,KAAK,CAAE,CAAC;AACzD,CAAC;AAED,SAAS,wBAAwB,CAAC,IAAY;IAC7C,MAAM,IAAI,SAAS,CAAC,wCAAwC,IAAI,EAAE,CAAC,CAAC;AACrE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n} from \"../../core/index.js\";\n\n/**\n * @remarks\n *\n * 1. FieldIncompatibility\n *\n * `FieldIncompatibility` represents the differences between two `TreeFieldStoredSchema` objects. It consists of\n * three types of incompatibilities:\n *\n * - FieldKindIncompatibility: Indicates the differences in `FieldKindIdentifier` between two `TreeFieldStoredSchema`\n * objects (e.g., optional, required, sequence, etc.).\n * - AllowedTypesIncompatibility: Indicates the differences in the allowed child types between the two schemas.\n * - ValueSchemaIncompatibility: Specifically indicates the differences in the `ValueSchema` of two\n * `LeafNodeStoredSchema` objects.\n *\n * 2. NodeIncompatibility\n *\n * `NodeIncompatibility` represents the differences between two `TreeNodeStoredSchema` objects and includes:\n *\n * - NodeKindIncompatibility: Indicates the differences in the types of `TreeNodeStoredSchema` (currently supports\n * `ObjectNodeStoredSchema`, `MapNodeStoredSchema`, and `LeafNodeStoredSchema`).\n * - NodeFieldsIncompatibility: Indicates the `FieldIncompatibility` of `TreeFieldStoredSchema` within two\n * `TreeNodeStoredSchema`. It includes an array of `FieldIncompatibility` instances in the `differences` field.\n *\n * When comparing two nodes for compatibility, it only makes sense to compare their fields if the nodes are of\n * the same kind (map, object, leaf).\n *\n * 3. Incompatibility\n *\n * Incompatibility consists of both `NodeIncompatibility` and `FieldIncompatibility`, representing any kind of\n * schema differences. See {@link getAllowedContentIncompatibilities} for more details about how we process it\n * and the ordering.\n */\nexport type Incompatibility = FieldIncompatibility | NodeIncompatibility;\n\nexport type NodeIncompatibility = NodeKindIncompatibility | NodeFieldsIncompatibility;\n\nexport type FieldIncompatibility =\n\t| AllowedTypeIncompatibility\n\t| FieldKindIncompatibility\n\t| ValueSchemaIncompatibility;\n\nexport interface AllowedTypeIncompatibility {\n\tidentifier: string | undefined; // undefined indicates root field schema\n\tmismatch: \"allowedTypes\";\n\t/**\n\t * List of allowed type identifiers in viewed schema\n\t */\n\tview: string[];\n\t/**\n\t * List of allowed type identifiers in stored schema\n\t */\n\tstored: string[];\n}\n\nexport interface FieldKindIncompatibility {\n\tidentifier: string | undefined; // undefined indicates root field schema\n\tmismatch: \"fieldKind\";\n\tview: FieldKindIdentifier | undefined;\n\tstored: FieldKindIdentifier | undefined;\n}\n\nexport interface ValueSchemaIncompatibility {\n\tidentifier: string;\n\tmismatch: \"valueSchema\";\n\tview: ValueSchema | undefined;\n\tstored: ValueSchema | undefined;\n}\n\nexport interface NodeKindIncompatibility {\n\tidentifier: string;\n\tmismatch: \"nodeKind\";\n\tview: SchemaFactoryNodeKind | undefined;\n\tstored: SchemaFactoryNodeKind | undefined;\n}\n\nexport interface NodeFieldsIncompatibility {\n\tidentifier: string;\n\tmismatch: \"fields\";\n\tdifferences: FieldIncompatibility[];\n}\n\ntype SchemaFactoryNodeKind = \"object\" | \"leaf\" | \"map\";\n\n/**\n * @remarks\n *\n * The workflow for finding schema incompatibilities:\n * 1. Compare the two root schemas to identify any `FieldIncompatibility`.\n *\n * 2. For each node schema in the `view`:\n * - Verify if the node schema exists in the stored. If it does, ensure that the `SchemaFactoryNodeKind` are\n * consistent. Otherwise this difference is treated as `NodeKindIncompatibility`\n * - If a node schema with the same identifier exists in both view and stored, and their `SchemaFactoryNodeKind`\n * are consistent, perform a exhaustive validation to identify all `FieldIncompatibility`.\n *\n * 3. For each node schema in the stored, verify if it exists in the view. The overlapping parts were already\n * addressed in the previous step.\n *\n * @returns the discrepancies between two TreeStoredSchema objects\n */\nexport function getAllowedContentIncompatibilities(\n\tview: TreeStoredSchema,\n\tstored: TreeStoredSchema,\n): Incompatibility[] {\n\tconst incompatibilities: Incompatibility[] = [];\n\n\t// check root schema discrepancies\n\tincompatibilities.push(\n\t\t...trackFieldDiscrepancies(view.rootFieldSchema, stored.rootFieldSchema),\n\t);\n\n\t// Verify the existence and type of a node schema given its identifier (key), then determine if\n\t// an exhaustive search is necessary.\n\tconst viewNodeKeys = new Set<TreeNodeSchemaIdentifier>();\n\tfor (const [key, viewNodeSchema] of view.nodeSchema) {\n\t\tviewNodeKeys.add(key);\n\n\t\tif (viewNodeSchema instanceof ObjectNodeStoredSchema) {\n\t\t\tif (!stored.nodeSchema.has(key)) {\n\t\t\t\tincompatibilities.push({\n\t\t\t\t\tidentifier: key,\n\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\tview: \"object\",\n\t\t\t\t\tstored: undefined,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst storedNodeSchema = stored.nodeSchema.get(key);\n\t\t\t\tassert(\n\t\t\t\t\tstoredNodeSchema !== undefined,\n\t\t\t\t\t0x9be /* The storedNodeSchema in stored.nodeSchema should not be undefined */,\n\t\t\t\t);\n\t\t\t\tif (storedNodeSchema instanceof MapNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"object\",\n\t\t\t\t\t\tstored: \"map\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof LeafNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"object\",\n\t\t\t\t\t\tstored: \"leaf\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof ObjectNodeStoredSchema) {\n\t\t\t\t\tconst differences = trackObjectNodeDiscrepancies(viewNodeSchema, storedNodeSchema);\n\t\t\t\t\tif (differences.length > 0) {\n\t\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\t\tmismatch: \"fields\",\n\t\t\t\t\t\t\tdifferences,\n\t\t\t\t\t\t} satisfies NodeFieldsIncompatibility);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrowUnsupportedNodeType(storedNodeSchema.constructor.name);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (viewNodeSchema instanceof MapNodeStoredSchema) {\n\t\t\tif (!stored.nodeSchema.has(key)) {\n\t\t\t\tincompatibilities.push({\n\t\t\t\t\tidentifier: key,\n\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\tview: \"map\",\n\t\t\t\t\tstored: undefined,\n\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t} else {\n\t\t\t\tconst storedNodeSchema = stored.nodeSchema.get(key);\n\t\t\t\tassert(\n\t\t\t\t\tstoredNodeSchema !== undefined,\n\t\t\t\t\t0x9bf /* The storedNodeSchema in stored.nodeSchema should not be undefined */,\n\t\t\t\t);\n\t\t\t\tif (storedNodeSchema instanceof ObjectNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"map\",\n\t\t\t\t\t\tstored: \"object\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof LeafNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"map\",\n\t\t\t\t\t\tstored: \"leaf\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof MapNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push(\n\t\t\t\t\t\t...trackFieldDiscrepancies(\n\t\t\t\t\t\t\tviewNodeSchema.mapFields,\n\t\t\t\t\t\t\tstoredNodeSchema.mapFields,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tthrowUnsupportedNodeType(storedNodeSchema.constructor.name);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (viewNodeSchema instanceof LeafNodeStoredSchema) {\n\t\t\tif (!stored.nodeSchema.has(key)) {\n\t\t\t\tincompatibilities.push({\n\t\t\t\t\tidentifier: key,\n\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\tview: \"leaf\",\n\t\t\t\t\tstored: undefined,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst storedNodeSchema = stored.nodeSchema.get(key);\n\t\t\t\tassert(\n\t\t\t\t\tstoredNodeSchema !== undefined,\n\t\t\t\t\t0x9c0 /* The storedNodeSchema in stored.nodeSchema should not be undefined */,\n\t\t\t\t);\n\t\t\t\tif (storedNodeSchema instanceof MapNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"leaf\",\n\t\t\t\t\t\tstored: \"map\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof ObjectNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"leaf\",\n\t\t\t\t\t\tstored: \"object\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof LeafNodeStoredSchema) {\n\t\t\t\t\tif (viewNodeSchema.leafValue !== storedNodeSchema.leafValue) {\n\t\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\t\tmismatch: \"valueSchema\",\n\t\t\t\t\t\t\tview: viewNodeSchema.leafValue,\n\t\t\t\t\t\t\tstored: storedNodeSchema.leafValue,\n\t\t\t\t\t\t} satisfies ValueSchemaIncompatibility);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrowUnsupportedNodeType(storedNodeSchema.constructor.name);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrowUnsupportedNodeType(viewNodeSchema.constructor.name);\n\t\t}\n\t}\n\n\tfor (const [key, storedNodeSchema] of stored.nodeSchema) {\n\t\tif (!viewNodeKeys.has(key)) {\n\t\t\tincompatibilities.push({\n\t\t\t\tidentifier: key,\n\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\tview: undefined,\n\t\t\t\tstored:\n\t\t\t\t\tstoredNodeSchema instanceof MapNodeStoredSchema\n\t\t\t\t\t\t? \"map\"\n\t\t\t\t\t\t: storedNodeSchema instanceof ObjectNodeStoredSchema\n\t\t\t\t\t\t\t? \"object\"\n\t\t\t\t\t\t\t: \"leaf\",\n\t\t\t} satisfies NodeKindIncompatibility);\n\t\t}\n\t}\n\n\treturn incompatibilities;\n}\n\n/**\n * The function to track the discrepancies between two field stored schemas.\n *\n * @param keyOrRoot - If the key is missing, it indicates that this is the root field schema.\n */\nfunction trackFieldDiscrepancies(\n\tview: TreeFieldStoredSchema,\n\tstored: TreeFieldStoredSchema,\n\tkeyOrRoot?: string,\n): FieldIncompatibility[] {\n\tconst differences: FieldIncompatibility[] = [];\n\n\t// Only track the symmetric differences of two sets.\n\tconst findSetDiscrepancies = (\n\t\ta: TreeTypeSet,\n\t\tb: TreeTypeSet,\n\t): [TreeNodeSchemaIdentifier[], TreeNodeSchemaIdentifier[]] => {\n\t\tif (a === undefined && b === undefined) {\n\t\t\treturn [[], []];\n\t\t}\n\n\t\tif (a !== undefined && b !== undefined) {\n\t\t\tconst aDiff = [...a].filter((value) => !b.has(value));\n\t\t\tconst bDiff = [...b].filter((value) => !a.has(value));\n\t\t\treturn [aDiff, bDiff];\n\t\t}\n\n\t\tif (a !== undefined) {\n\t\t\treturn [[...a], []];\n\t\t}\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn [[], [...b!]];\n\t};\n\n\tconst allowedTypesDiscrepancies = findSetDiscrepancies(view.types, stored.types);\n\tif (allowedTypesDiscrepancies[0].length > 0 || allowedTypesDiscrepancies[1].length > 0) {\n\t\tdifferences.push({\n\t\t\tidentifier: keyOrRoot,\n\t\t\tmismatch: \"allowedTypes\",\n\t\t\tview: allowedTypesDiscrepancies[0],\n\t\t\tstored: allowedTypesDiscrepancies[1],\n\t\t} satisfies AllowedTypeIncompatibility);\n\t}\n\n\tif (view.kind !== stored.kind) {\n\t\tdifferences.push({\n\t\t\tidentifier: keyOrRoot,\n\t\t\tmismatch: \"fieldKind\",\n\t\t\tview: view.kind,\n\t\t\tstored: stored.kind,\n\t\t} satisfies FieldKindIncompatibility);\n\t}\n\n\treturn differences;\n}\n\nfunction trackObjectNodeDiscrepancies(\n\tview: ObjectNodeStoredSchema,\n\tstored: ObjectNodeStoredSchema,\n): FieldIncompatibility[] {\n\tconst differences: FieldIncompatibility[] = [];\n\tconst viewFieldKeys = new Set<FieldKey>();\n\t/**\n\t * Similar to the logic used for tracking discrepancies between two node schemas, we will identify\n\t * three types of differences:\n\t * 1. Fields that exist in the view schema but not in the stored schema.\n\t * 2. Fields that exist in both schemas but have different contents.\n\t * 3. Fields that exist in the stored schema but not in the view schema.\n\t *\n\t * First, the view schema is iterated to track the first two types of differences.\n\t * Then, the stored schema is iterated to find the third type.\n\t */\n\n\tfor (const [fieldKey, fieldStoredSchema] of view.objectNodeFields) {\n\t\tviewFieldKeys.add(fieldKey);\n\t\tif (!stored.objectNodeFields.has(fieldKey)) {\n\t\t\tdifferences.push({\n\t\t\t\tidentifier: fieldKey,\n\t\t\t\tmismatch: \"fieldKind\",\n\t\t\t\tview: fieldStoredSchema.kind,\n\t\t\t\tstored: undefined,\n\t\t\t} satisfies FieldKindIncompatibility);\n\t\t} else {\n\t\t\tdifferences.push(\n\t\t\t\t...trackFieldDiscrepancies(\n\t\t\t\t\tview.objectNodeFields.get(fieldKey) as TreeFieldStoredSchema,\n\t\t\t\t\tstored.objectNodeFields.get(fieldKey) as TreeFieldStoredSchema,\n\t\t\t\t\tfieldKey,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t}\n\n\tfor (const [fieldKey, fieldStoredSchema] of stored.objectNodeFields) {\n\t\tif (viewFieldKeys.has(fieldKey)) {\n\t\t\tcontinue;\n\t\t}\n\t\tdifferences.push({\n\t\t\tidentifier: fieldKey,\n\t\t\tmismatch: \"fieldKind\",\n\t\t\tview: undefined,\n\t\t\tstored: fieldStoredSchema.kind,\n\t\t} satisfies FieldKindIncompatibility);\n\t}\n\n\treturn differences;\n}\n\n/**\n * @remarks\n *\n * This function uses incompatibilities to determine if changes to a document schema are backward-compatible, i.e., it determines\n * whether the `view` schema allows a superset of the documents that the `stored` schema allows.\n * According to the policy of schema evolution, `isRepoSuperset` supports three types of changes:\n * 1. Adding an optional field to an object node.\n * 2. Expanding the set of allowed types for a field.\n * 3. Relaxing a field kind to a more general field kind.\n *\n * Notes: We expect isRepoSuperset to return consistent results with allowsRepoSuperset. However, currently there are some scenarios\n * where the inconsistency will occur:\n *\n * - Different Node Kinds: If a and b have different node kinds (e.g., a is an objectNodeSchema and b is a mapNodeSchema),\n * `isRepoSuperset` will determine that a can never be the superset of b. In contrast, `allowsRepoSuperset` will continue\n * validating internal fields.\n */\nexport function isRepoSuperset(view: TreeStoredSchema, stored: TreeStoredSchema): boolean {\n\tconst incompatibilities = getAllowedContentIncompatibilities(view, stored);\n\n\tfor (const incompatibility of incompatibilities) {\n\t\tswitch (incompatibility.mismatch) {\n\t\t\tcase \"nodeKind\": {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tcase \"valueSchema\":\n\t\t\tcase \"allowedTypes\":\n\t\t\tcase \"fieldKind\": {\n\t\t\t\tif (!validateFieldIncompatibility(incompatibility)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"fields\": {\n\t\t\t\tif (\n\t\t\t\t\tincompatibility.differences.some(\n\t\t\t\t\t\t(difference) => !validateFieldIncompatibility(difference),\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// No default\n\t\t}\n\t}\n\treturn true;\n}\n\nfunction validateFieldIncompatibility(incompatibility: FieldIncompatibility): boolean {\n\tswitch (incompatibility.mismatch) {\n\t\tcase \"allowedTypes\": {\n\t\t\t// Since we only track the symmetric difference between the allowed types in the view and\n\t\t\t// stored schemas, it's sufficient to check if any extra allowed types still exist in the\n\t\t\t// stored schema.\n\t\t\treturn incompatibility.stored.length === 0;\n\t\t}\n\t\tcase \"fieldKind\": {\n\t\t\tif (incompatibility.stored === undefined) {\n\t\t\t\t// Add an optional field\n\t\t\t\tif (incompatibility.view === \"Optional\") {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Relax the field to make it more general\n\t\t\t\treturn compareFieldKind(incompatibility.stored, incompatibility.view);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\t\tcase \"valueSchema\": {\n\t\t\treturn false;\n\t\t}\n\t\t// No default\n\t}\n\treturn false;\n}\n\n/**\n * A mapping that defines the order of field kinds for comparison purposes.\n * The numeric values indicate the hierarchy or \"strength\" of each field kind, where lower numbers are more restrictive.\n * This is used to determine if one field kind can be considered a superset of another.\n *\n * - \"Forbidden\": The most restrictive, represented by 1. Indicates a forbidden field.\n * - \"Value\": Represented by 2. Indicates a required field with a specific value.\n * - \"Optional\": Represented by 3. Indicates an optional field.\n *\n * Note:\n * - \"Sequence\": (Currently commented out) was intended to represent a sequence field kind with a value of 4.\n * Relaxing non-sequence fields to sequences is not currently supported but may be considered in the future.\n *\n * TODO: We may need more coverage in realm to prove the correctness of the Forbidden -\\> Value transaction\n */\nconst fieldKindOrder: { [key: string]: number } = {\n\t\"Forbidden\": 1,\n\t\"Value\": 2,\n\t\"Optional\": 3,\n\t// \"Sequence\": 4, // Relaxing non-sequence fields to sequences is not currently supported, though we could consider doing so in the future.\n};\n\nfunction compareFieldKind(\n\taKind: FieldKindIdentifier | undefined,\n\tbKind: FieldKindIdentifier | undefined,\n): boolean {\n\tif (aKind === undefined || bKind === undefined) {\n\t\treturn false;\n\t}\n\n\tif (!(aKind in fieldKindOrder) || !(bKind in fieldKindOrder)) {\n\t\treturn false;\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\treturn fieldKindOrder[aKind]! <= fieldKindOrder[bKind]!;\n}\n\nfunction throwUnsupportedNodeType(type: string): never {\n\tthrow new TypeError(`Unsupported node stored schema type: ${type}`);\n}\n"]}
|
|
@@ -107,22 +107,18 @@ export interface FieldEditor<TChangeset> {
|
|
|
107
107
|
/**
|
|
108
108
|
* The `index` represents the index of the child node in the input context.
|
|
109
109
|
* The `index` should be `undefined` iff the child node does not exist in the input context (e.g., an inserted node).
|
|
110
|
-
* @internal
|
|
111
110
|
*/
|
|
112
111
|
export type ToDelta = (child: NodeId) => DeltaFieldMap;
|
|
113
112
|
/**
|
|
114
|
-
* @internal
|
|
115
113
|
*/
|
|
116
114
|
export type NodeChangeInverter = (change: NodeId) => NodeId;
|
|
117
115
|
/**
|
|
118
|
-
* @internal
|
|
119
116
|
*/
|
|
120
117
|
export declare enum NodeAttachState {
|
|
121
118
|
Attached = 0,
|
|
122
119
|
Detached = 1
|
|
123
120
|
}
|
|
124
121
|
/**
|
|
125
|
-
* @internal
|
|
126
122
|
*/
|
|
127
123
|
export type NodeChangeRebaser = (change: NodeId | undefined, baseChange: NodeId | undefined,
|
|
128
124
|
/**
|
|
@@ -131,17 +127,13 @@ export type NodeChangeRebaser = (change: NodeId | undefined, baseChange: NodeId
|
|
|
131
127
|
*/
|
|
132
128
|
state?: NodeAttachState) => NodeId | undefined;
|
|
133
129
|
/**
|
|
134
|
-
* @internal
|
|
135
130
|
*/
|
|
136
131
|
export type NodeChangeComposer = (change1: NodeId | undefined, change2: NodeId | undefined) => NodeId;
|
|
137
132
|
/**
|
|
138
|
-
* @internal
|
|
139
133
|
*/
|
|
140
134
|
export type NodeChangePruner = (change: NodeId) => NodeId | undefined;
|
|
141
135
|
/**
|
|
142
136
|
* A function that returns the set of removed roots that should be in memory for a given node changeset to be applied.
|
|
143
|
-
*
|
|
144
|
-
* @internal
|
|
145
137
|
*/
|
|
146
138
|
export type RelevantRemovedRootsFromChild = (child: NodeId) => Iterable<DeltaDetachedNodeId>;
|
|
147
139
|
export interface RebaseRevisionMetadata extends RevisionMetadataSource {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldChangeHandler.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldChangeHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAA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AC;IAClE,MAAM,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,UAAU,CAAC;IAC3C,MAAM,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,KAAK,UAAU,CAAC;CAC7D,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAMjC;AAED,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,IAAI,EAAE;IAC5D,OAAO,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC;IACnD,MAAM,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC;IACjD,MAAM,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC;CACjD,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAMjC;AAED,MAAM,WAAW,WAAW,CAAC,UAAU;IACtC;;OAEG;IACH,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC;CACjE;AAED
|
|
1
|
+
{"version":3,"file":"fieldChangeHandler.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldChangeHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,EACX,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;A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,QAAQ,CAAC,WAAW,EAAE,qBAAqB,CAAC;IAC5C,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,CAAC;IACjD,UAAU,CAAC,WAAW,EAAE,oBAAoB,GAAG,MAAM,CAAC;CACtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldChangeHandler.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldChangeHandler.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAiJH;;;GAGG;AACH,SAAgB,+BAA+B,CAAa,IAI3D;IACA,OAAO,0BAA0B,CAAC;QACjC,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC;QACpF,MAAM,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QAC7D,MAAM,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC;KACzE,CAAC,CAAC;AACJ,CAAC;AAVD,0EAUC;AAED,SAAgB,0BAA0B,CAAa,IAItD;IACA,OAAO;QACN,GAAG,IAAI;QACP,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM;QACzB,gBAAgB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM;KACpC,CAAC;AACH,CAAC;AAVD,gEAUC;
|
|
1
|
+
{"version":3,"file":"fieldChangeHandler.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldChangeHandler.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAiJH;;;GAGG;AACH,SAAgB,+BAA+B,CAAa,IAI3D;IACA,OAAO,0BAA0B,CAAC;QACjC,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC;QACpF,MAAM,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QAC7D,MAAM,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC;KACzE,CAAC,CAAC;AACJ,CAAC;AAVD,0EAUC;AAED,SAAgB,0BAA0B,CAAa,IAItD;IACA,OAAO;QACN,GAAG,IAAI;QACP,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM;QACzB,gBAAgB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM;KACpC,CAAC;AACH,CAAC;AAVD,gEAUC;AAmBD;GACG;AACH,IAAY,eAGX;AAHD,WAAY,eAAe;IAC1B,6DAAQ,CAAA;IACR,6DAAQ,CAAA;AACT,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ICodecFamily, IJsonCodec } from \"../../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tDeltaDetachedNodeId,\n\tDeltaFieldChanges,\n\tDeltaFieldMap,\n\tEncodedRevisionTag,\n\tRevisionMetadataSource,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport type { IdAllocator, Invariant } from \"../../util/index.js\";\nimport type { MemoizedIdRangeAllocator } from \"../memoizedIdRangeAllocator.js\";\n\nimport type { CrossFieldManager } from \"./crossFieldQueries.js\";\nimport type { CrossFieldKeyRange, NodeId } from \"./modularChangeTypes.js\";\nimport type { EncodedNodeChangeset } from \"./modularChangeFormat.js\";\n\n/**\n * Functionality provided by a field kind which will be composed with other `FieldChangeHandler`s to\n * implement a unified ChangeFamily supporting documents with multiple field kinds.\n */\nexport interface FieldChangeHandler<\n\tTChangeset,\n\tTEditor extends FieldEditor<TChangeset> = FieldEditor<TChangeset>,\n> {\n\t_typeCheck?: Invariant<TChangeset>;\n\treadonly rebaser: FieldChangeRebaser<TChangeset>;\n\treadonly codecsFactory: (\n\t\trevisionTagCodec: IJsonCodec<\n\t\t\tRevisionTag,\n\t\t\tEncodedRevisionTag,\n\t\t\tEncodedRevisionTag,\n\t\t\tChangeEncodingContext\n\t\t>,\n\t) => ICodecFamily<TChangeset, FieldChangeEncodingContext>;\n\treadonly editor: TEditor;\n\tintoDelta(\n\t\tchange: TChangeset,\n\t\tdeltaFromChild: ToDelta,\n\t\tidAllocator: MemoizedIdRangeAllocator,\n\t): DeltaFieldChanges;\n\t/**\n\t * Returns the set of removed roots that should be in memory for the given change to be applied.\n\t * A removed root is relevant if any of the following is true:\n\t * - It is being inserted\n\t * - It is being restored\n\t * - It is being edited\n\t * - The ID it is associated with is being changed\n\t *\n\t * Implementations are allowed to be conservative by returning more removed roots than strictly necessary\n\t * (though they should, for the sake of performance, try to avoid doing so).\n\t *\n\t * Implementations are not allowed to return IDs for non-root trees, even if they are removed.\n\t *\n\t * @param change - The change to be applied.\n\t * @param relevantRemovedRootsFromChild - Delegate for collecting relevant removed roots from child changes.\n\t */\n\treadonly relevantRemovedRoots: (\n\t\tchange: TChangeset,\n\t\trelevantRemovedRootsFromChild: RelevantRemovedRootsFromChild,\n\t) => Iterable<DeltaDetachedNodeId>;\n\n\t/**\n\t * Returns whether this change is empty, meaning that it represents no modifications to the field\n\t * and could be removed from the ModularChangeset tree without changing its behavior.\n\t */\n\tisEmpty(change: TChangeset): boolean;\n\n\t/**\n\t * @param change - The field change to get the child changes from.\n\t *\n\t * @returns The set of `NodeId`s that correspond to nested changes in the given `change`.\n\t * Each `NodeId` is associated with the index of the node in the field in the input context of the changeset\n\t * (or `undefined` if the node is not attached in the input context).\n\t * For all returned entries where the index is defined,\n\t * the indices are are ordered from smallest to largest (with no duplicates).\n\t * The returned array is owned by the caller.\n\t */\n\tgetNestedChanges(change: TChangeset): [NodeId, number | undefined][];\n\n\t/**\n\t * @returns A list of all cross-field keys contained in the change.\n\t * This should not include cross-field keys in descendant fields.\n\t */\n\tgetCrossFieldKeys(change: TChangeset): CrossFieldKeyRange[];\n\n\tcreateEmpty(): TChangeset;\n}\n\nexport interface FieldChangeRebaser<TChangeset> {\n\t/**\n\t * Compose a collection of changesets into a single one.\n\t * For each node which has a change in both changesets, `composeChild` must be called\n\t * and the result used as the composite node change.\n\t * Calling `composeChild` when one of the changesets has no node change is unnecessary but tolerated.\n\t * See `ChangeRebaser` for more details.\n\t */\n\tcompose(\n\t\tchange1: TChangeset,\n\t\tchange2: TChangeset,\n\t\tcomposeChild: NodeChangeComposer,\n\t\tgenId: IdAllocator,\n\t\tcrossFieldManager: CrossFieldManager,\n\t\trevisionMetadata: RevisionMetadataSource,\n\t): TChangeset;\n\n\t/**\n\t * @returns the inverse of `changes`.\n\t * See `ChangeRebaser` for details.\n\t */\n\tinvert(\n\t\tchange: TChangeset,\n\t\tisRollback: boolean,\n\t\tgenId: IdAllocator,\n\t\tcrossFieldManager: CrossFieldManager,\n\t\trevisionMetadata: RevisionMetadataSource,\n\t): TChangeset;\n\n\t/**\n\t * Rebase `change` over `over`.\n\t * See `ChangeRebaser` for details.\n\t */\n\trebase(\n\t\tchange: TChangeset,\n\t\tover: TChangeset,\n\t\trebaseChild: NodeChangeRebaser,\n\t\tgenId: IdAllocator,\n\t\tcrossFieldManager: CrossFieldManager,\n\t\trevisionMetadata: RebaseRevisionMetadata,\n\t): TChangeset;\n\n\t/**\n\t * @returns `change` with any empty child node changesets removed.\n\t */\n\tprune(change: TChangeset, pruneChild: NodeChangePruner): TChangeset;\n\n\treplaceRevisions(\n\t\tchange: TChangeset,\n\t\toldRevisions: Set<RevisionTag | undefined>,\n\t\tnewRevisions: RevisionTag | undefined,\n\t): TChangeset;\n}\n\n/**\n * Helper for creating a {@link FieldChangeRebaser} which does not need access to revision tags.\n * This should only be used for fields where the child nodes cannot be edited.\n */\nexport function referenceFreeFieldChangeRebaser<TChangeset>(data: {\n\tcompose: (change1: TChangeset, change2: TChangeset) => TChangeset;\n\tinvert: (change: TChangeset) => TChangeset;\n\trebase: (change: TChangeset, over: TChangeset) => TChangeset;\n}): FieldChangeRebaser<TChangeset> {\n\treturn isolatedFieldChangeRebaser({\n\t\tcompose: (change1, change2, _composeChild, _genId) => data.compose(change1, change2),\n\t\tinvert: (change, _invertChild, _genId) => data.invert(change),\n\t\trebase: (change, over, _rebaseChild, _genId) => data.rebase(change, over),\n\t});\n}\n\nexport function isolatedFieldChangeRebaser<TChangeset>(data: {\n\tcompose: FieldChangeRebaser<TChangeset>[\"compose\"];\n\tinvert: FieldChangeRebaser<TChangeset>[\"invert\"];\n\trebase: FieldChangeRebaser<TChangeset>[\"rebase\"];\n}): FieldChangeRebaser<TChangeset> {\n\treturn {\n\t\t...data,\n\t\tprune: (change) => change,\n\t\treplaceRevisions: (change) => change,\n\t};\n}\n\nexport interface FieldEditor<TChangeset> {\n\t/**\n\t * Creates a changeset which represents the given `change` to the child at `childIndex` of this editor's field.\n\t */\n\tbuildChildChange(childIndex: number, change: NodeId): TChangeset;\n}\n\n/**\n * The `index` represents the index of the child node in the input context.\n * The `index` should be `undefined` iff the child node does not exist in the input context (e.g., an inserted node).\n */\nexport type ToDelta = (child: NodeId) => DeltaFieldMap;\n\n/**\n */\nexport type NodeChangeInverter = (change: NodeId) => NodeId;\n\n/**\n */\nexport enum NodeAttachState {\n\tAttached,\n\tDetached,\n}\n\n/**\n */\nexport type NodeChangeRebaser = (\n\tchange: NodeId | undefined,\n\tbaseChange: NodeId | undefined,\n\t/**\n\t * Whether the node is attached to this field in the output context of the base change.\n\t * Defaults to attached if undefined.\n\t */\n\tstate?: NodeAttachState,\n) => NodeId | undefined;\n\n/**\n */\nexport type NodeChangeComposer = (\n\tchange1: NodeId | undefined,\n\tchange2: NodeId | undefined,\n) => NodeId;\n\n/**\n */\nexport type NodeChangePruner = (change: NodeId) => NodeId | undefined;\n\n/**\n * A function that returns the set of removed roots that should be in memory for a given node changeset to be applied.\n */\nexport type RelevantRemovedRootsFromChild = (child: NodeId) => Iterable<DeltaDetachedNodeId>;\n\nexport interface RebaseRevisionMetadata extends RevisionMetadataSource {\n\treadonly getRevisionToRebase: () => RevisionTag | undefined;\n\treadonly getBaseRevisions: () => RevisionTag[];\n}\n\nexport interface FieldChangeEncodingContext {\n\treadonly baseContext: ChangeEncodingContext;\n\tencodeNode(nodeId: NodeId): EncodedNodeChangeset;\n\tdecodeNode(encodedNode: EncodedNodeChangeset): NodeId;\n}\n"]}
|
|
@@ -15,8 +15,7 @@ import type { FieldKindIdentifier, FieldKindData, Multiplicity, SchemaPolicy } f
|
|
|
15
15
|
*
|
|
16
16
|
* These policies include the data encoding, change encoding, change rebase and change application.
|
|
17
17
|
*
|
|
18
|
-
* @sealed @
|
|
19
|
-
* @privateRemarks
|
|
18
|
+
* @sealed * @privateRemarks
|
|
20
19
|
* This being @sealed is for users of this package.
|
|
21
20
|
* This package itself may provide implementations.
|
|
22
21
|
* This pattern was picked instead of an interface since we do not have a convention for how to mark interfaces as only allowed to be implemented by the package declaring them,
|
|
@@ -35,7 +34,6 @@ export declare abstract class FlexFieldKind<TName extends string = string, TMult
|
|
|
35
34
|
/**
|
|
36
35
|
* Policy from the app for interpreting the stored schema.
|
|
37
36
|
* The app must ensure consistency for all users of the document.
|
|
38
|
-
* @internal
|
|
39
37
|
*/
|
|
40
38
|
export interface FullSchemaPolicy extends SchemaPolicy {
|
|
41
39
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldKind.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldKind.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,MAAM,qBAAqB,CAAC;AAE7B
|
|
1
|
+
{"version":3,"file":"fieldKind.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldKind.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;;;;;;;;;;;GAiBG;AACH,8BAAsB,aAAa,CAClC,KAAK,SAAS,MAAM,GAAG,MAAM,EAC7B,aAAa,SAAS,YAAY,GAAG,YAAY,CAChD,YAAW,aAAa;aAQR,UAAU,EAAE,KAAK,GAAG,mBAAmB;aACvC,YAAY,EAAE,aAAa;IAP5C;;;;OAIG;IACH,SAAS,aACQ,UAAU,EAAE,KAAK,GAAG,mBAAmB,EACvC,YAAY,EAAE,aAAa;CAE5C;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACrD;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,mBAAmB,EAAE,aAAa,CAAC,CAAC;CACrE"}
|
|
@@ -17,8 +17,7 @@ exports.FlexFieldKind = void 0;
|
|
|
17
17
|
*
|
|
18
18
|
* These policies include the data encoding, change encoding, change rebase and change application.
|
|
19
19
|
*
|
|
20
|
-
* @sealed @
|
|
21
|
-
* @privateRemarks
|
|
20
|
+
* @sealed * @privateRemarks
|
|
22
21
|
* This being @sealed is for users of this package.
|
|
23
22
|
* This package itself may provide implementations.
|
|
24
23
|
* This pattern was picked instead of an interface since we do not have a convention for how to mark interfaces as only allowed to be implemented by the package declaring them,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldKind.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldKind.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH
|
|
1
|
+
{"version":3,"file":"fieldKind.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldKind.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAsB,aAAa;IAKlC;;;;OAIG;IACH,YACiB,UAAuC,EACvC,YAA2B;QAD3B,eAAU,GAAV,UAAU,CAA6B;QACvC,iBAAY,GAAZ,YAAY,CAAe;IACzC,CAAC;CACJ;AAdD,sCAcC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tFieldKindIdentifier,\n\tFieldKindData,\n\tMultiplicity,\n\tSchemaPolicy,\n} from \"../../core/index.js\";\n\n/**\n * Functionality for FieldKinds that is stable,\n * meaning that it can not change in any measurable way without providing a new identifier.\n *\n * It is assumed that this information and policy is available on all clients interacting with a document\n * using the identifier.\n *\n * This must contain enough information to process remote edits to this FieldKind consistently with all clients.\n * All behavior must be deterministic, and not change across versions of the app/library.\n *\n * These policies include the data encoding, change encoding, change rebase and change application.\n *\n * @sealed * @privateRemarks\n * This being @sealed is for users of this package.\n * This package itself may provide implementations.\n * This pattern was picked instead of an interface since we do not have a convention for how to mark interfaces as only allowed to be implemented by the package declaring them,\n * and using a class also gets stronger (nominal) typing for objects which will be down cast.\n */\nexport abstract class FlexFieldKind<\n\tTName extends string = string,\n\tTMultiplicity extends Multiplicity = Multiplicity,\n> implements FieldKindData\n{\n\t/**\n\t * @param identifier - Globally scoped identifier.\n\t * @param multiplicity - bound on the number of children that fields of this kind may have.\n\t * TODO: consider replacing with numeric upper and lower bounds.\n\t */\n\tprotected constructor(\n\t\tpublic readonly identifier: TName & FieldKindIdentifier,\n\t\tpublic readonly multiplicity: TMultiplicity,\n\t) {}\n}\n\n/**\n * Policy from the app for interpreting the stored schema.\n * The app must ensure consistency for all users of the document.\n */\nexport interface FullSchemaPolicy extends SchemaPolicy {\n\t/**\n\t * Policy information about FieldKinds:\n\t * This is typically stored as code, not in documents, and defines how to handles fields based on their kind.\n\t * It is assumed that all users of a document will have exactly the same FieldKind policies,\n\t * though older applications might be missing some,\n\t * and will be unable to process any changes that use those FieldKinds.\n\t */\n\treadonly fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>;\n}\n"]}
|
|
@@ -6,7 +6,7 @@ import { type RevisionMetadataSource } from "../../core/index.js";
|
|
|
6
6
|
import { type IdAllocator } from "../../util/index.js";
|
|
7
7
|
import type { FieldChangeHandler, NodeChangeComposer } from "./fieldChangeHandler.js";
|
|
8
8
|
import { FieldKindWithEditor } from "./fieldKindWithEditor.js";
|
|
9
|
-
import type
|
|
9
|
+
import { type GenericChangeset } from "./genericFieldKindTypes.js";
|
|
10
10
|
/**
|
|
11
11
|
* {@link FieldChangeHandler} implementation for {@link GenericChangeset}.
|
|
12
12
|
*/
|
|
@@ -23,5 +23,4 @@ export declare const genericFieldKind: FieldKindWithEditor;
|
|
|
23
23
|
* @returns An equivalent changeset as represented by the `target` field-kind.
|
|
24
24
|
*/
|
|
25
25
|
export declare function convertGenericChange<TChange>(changeset: GenericChangeset, target: FieldChangeHandler<TChange>, composeChild: NodeChangeComposer, genId: IdAllocator, revisionMetadata: RevisionMetadataSource): TChange;
|
|
26
|
-
export declare function newGenericChangeset(): GenericChangeset;
|
|
27
26
|
//# sourceMappingURL=genericFieldKind.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genericFieldKind.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/genericFieldKind.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAIN,KAAK,sBAAsB,EAI3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,WAAW,EAAQ,MAAM,qBAAqB,CAAC;AAG7D,OAAO,KAAK,EACX,kBAAkB,EAClB,kBAAkB,EAKlB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"genericFieldKind.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/genericFieldKind.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAIN,KAAK,sBAAsB,EAI3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,WAAW,EAAQ,MAAM,qBAAqB,CAAC;AAG7D,OAAO,KAAK,EACX,kBAAkB,EAClB,kBAAkB,EAKlB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAIxF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,kBAAkB,CAAC,gBAAgB,CAiCrE,CAAC;AA8FF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,mBAM9B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAC3C,SAAS,EAAE,gBAAgB,EAC3B,MAAM,EAAE,kBAAkB,CAAC,OAAO,CAAC,EACnC,YAAY,EAAE,kBAAkB,EAChC,KAAK,EAAE,WAAW,EAClB,gBAAgB,EAAE,sBAAsB,GACtC,OAAO,CAoBT"}
|