@fluidframework/tree 2.1.1 → 2.2.1
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 +119 -25
- package/api-report/tree.beta.api.md +51 -25
- package/api-report/tree.public.api.md +51 -25
- package/dist/beta.d.ts +3 -1
- package/dist/codec/discriminatedUnions.d.ts +11 -5
- package/dist/codec/discriminatedUnions.d.ts.map +1 -1
- package/dist/codec/discriminatedUnions.js.map +1 -1
- package/dist/codec/index.d.ts +1 -1
- package/dist/codec/index.d.ts.map +1 -1
- package/dist/codec/index.js.map +1 -1
- package/dist/core/forest/editableForest.d.ts +1 -5
- package/dist/core/forest/editableForest.d.ts.map +1 -1
- package/dist/core/forest/editableForest.js.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 +0 -10
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +1 -4
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/cursor.d.ts +1 -6
- package/dist/core/tree/cursor.d.ts.map +1 -1
- package/dist/core/tree/cursor.js +0 -2
- package/dist/core/tree/cursor.js.map +1 -1
- package/dist/core/tree/delta.d.ts +0 -11
- package/dist/core/tree/delta.d.ts.map +1 -1
- package/dist/core/tree/delta.js.map +1 -1
- package/dist/core/tree/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 +0 -4
- package/dist/events/events.d.ts.map +1 -1
- package/dist/events/events.js +0 -1
- package/dist/events/events.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js +8 -3
- package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunk.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/chunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +3 -3
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +7 -5
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +8 -5
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +5 -3
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +12 -24
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +9 -19
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +0 -6
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +11 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultSchema.d.ts +0 -1
- package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultSchema.js +0 -1
- package/dist/feature-libraries/default-schema/defaultSchema.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js +2 -1
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts +6 -0
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js +6 -0
- package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/editableTreeBinder.d.ts +0 -67
- package/dist/feature-libraries/editableTreeBinder.d.ts.map +1 -1
- package/dist/feature-libraries/editableTreeBinder.js +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 -49
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +171 -168
- 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 -282
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js +0 -4
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/index.d.ts +1 -1
- package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +9 -26
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +26 -99
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts +2 -10
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +3 -42
- 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 -18
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.d.ts +6 -2
- package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.js +9 -1
- package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
- package/dist/feature-libraries/memoizedIdRangeAllocator.d.ts +0 -4
- package/dist/feature-libraries/memoizedIdRangeAllocator.d.ts.map +1 -1
- package/dist/feature-libraries/memoizedIdRangeAllocator.js +0 -1
- package/dist/feature-libraries/memoizedIdRangeAllocator.js.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +0 -2
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js +0 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/dist/feature-libraries/modular-schema/discrepancies.d.ts +18 -0
- package/dist/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/discrepancies.js +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 +31 -90
- package/dist/index.js.map +1 -1
- package/dist/internalTypes.d.ts +1 -1
- package/dist/internalTypes.d.ts.map +1 -1
- package/dist/internalTypes.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/public.d.ts +3 -1
- package/dist/shared-tree/schematizeTree.d.ts +2 -11
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +13 -2
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +4 -4
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +2 -2
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +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} +6 -5
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -0
- package/dist/simple-tree/{treeNodeApi.js → api/treeNodeApi.js} +28 -20
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -0
- package/dist/simple-tree/api/verboseTree.d.ts +136 -0
- package/dist/simple-tree/api/verboseTree.d.ts.map +1 -0
- package/dist/simple-tree/api/verboseTree.js +220 -0
- package/dist/simple-tree/api/verboseTree.js.map +1 -0
- package/dist/simple-tree/arrayNode.d.ts +3 -3
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js +70 -69
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +10 -0
- package/dist/simple-tree/core/index.d.ts.map +1 -0
- package/dist/simple-tree/core/index.js +27 -0
- package/dist/simple-tree/core/index.js.map +1 -0
- package/{lib/simple-tree → dist/simple-tree/core}/schemaCaching.d.ts +2 -9
- package/dist/simple-tree/core/schemaCaching.d.ts.map +1 -0
- package/dist/simple-tree/{schemaCaching.js → core/schemaCaching.js} +2 -23
- package/dist/simple-tree/core/schemaCaching.js.map +1 -0
- package/dist/simple-tree/core/treeNodeKernel.d.ts +57 -0
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -0
- package/dist/simple-tree/{treeNodeKernel.js → core/treeNodeKernel.js} +49 -4
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -0
- package/dist/simple-tree/core/treeNodeSchema.d.ts +149 -0
- package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -0
- package/dist/simple-tree/core/treeNodeSchema.js +35 -0
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -0
- package/dist/simple-tree/{types.d.ts → core/types.d.ts} +23 -70
- 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 +3 -1
- package/lib/codec/discriminatedUnions.d.ts +11 -5
- package/lib/codec/discriminatedUnions.d.ts.map +1 -1
- package/lib/codec/discriminatedUnions.js.map +1 -1
- package/lib/codec/index.d.ts +1 -1
- package/lib/codec/index.d.ts.map +1 -1
- package/lib/codec/index.js +1 -1
- package/lib/codec/index.js.map +1 -1
- package/lib/core/forest/editableForest.d.ts +1 -5
- package/lib/core/forest/editableForest.d.ts.map +1 -1
- package/lib/core/forest/editableForest.js.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 +0 -10
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +1 -4
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/cursor.d.ts +1 -6
- package/lib/core/tree/cursor.d.ts.map +1 -1
- package/lib/core/tree/cursor.js +0 -2
- package/lib/core/tree/cursor.js.map +1 -1
- package/lib/core/tree/delta.d.ts +0 -11
- package/lib/core/tree/delta.d.ts.map +1 -1
- package/lib/core/tree/delta.js.map +1 -1
- package/lib/core/tree/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 +0 -4
- package/lib/events/events.d.ts.map +1 -1
- package/lib/events/events.js +0 -1
- package/lib/events/events.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js +9 -4
- package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunk.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/chunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +4 -4
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +8 -6
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +2 -2
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +9 -6
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +6 -4
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +12 -24
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +6 -16
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +0 -6
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +11 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultSchema.d.ts +0 -1
- package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultSchema.js +0 -1
- package/lib/feature-libraries/default-schema/defaultSchema.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js +1 -1
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts +6 -0
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js +6 -0
- package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/editableTreeBinder.d.ts +0 -67
- package/lib/feature-libraries/editableTreeBinder.d.ts.map +1 -1
- package/lib/feature-libraries/editableTreeBinder.js +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 -49
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js +172 -168
- 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 -282
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js +0 -4
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/flex-tree/index.d.ts +1 -1
- package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +9 -26
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +28 -101
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts +2 -10
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +4 -42
- 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 +5 -6
- 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 +4 -9
- package/lib/index.js.map +1 -1
- package/lib/internalTypes.d.ts +1 -1
- package/lib/internalTypes.d.ts.map +1 -1
- package/lib/internalTypes.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +3 -1
- package/lib/shared-tree/schematizeTree.d.ts +2 -11
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +15 -4
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +4 -4
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +3 -3
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +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} +6 -5
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -0
- package/lib/simple-tree/{treeNodeApi.js → api/treeNodeApi.js} +25 -17
- 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 +56 -53
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +10 -0
- package/lib/simple-tree/core/index.d.ts.map +1 -0
- package/lib/simple-tree/core/index.js +10 -0
- package/lib/simple-tree/core/index.js.map +1 -0
- package/{dist/simple-tree → lib/simple-tree/core}/schemaCaching.d.ts +2 -9
- package/lib/simple-tree/core/schemaCaching.d.ts.map +1 -0
- package/lib/simple-tree/{schemaCaching.js → core/schemaCaching.js} +1 -21
- package/lib/simple-tree/core/schemaCaching.js.map +1 -0
- package/lib/simple-tree/core/treeNodeKernel.d.ts +57 -0
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -0
- package/lib/simple-tree/{treeNodeKernel.js → core/treeNodeKernel.js} +45 -3
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -0
- package/lib/simple-tree/core/treeNodeSchema.d.ts +149 -0
- package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -0
- package/lib/simple-tree/core/treeNodeSchema.js +32 -0
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -0
- package/lib/simple-tree/{types.d.ts → core/types.d.ts} +23 -70
- 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 +7 -17
- 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 +0 -4
- package/src/feature-libraries/chunked-forest/README.md +9 -1
- package/src/feature-libraries/chunked-forest/basicChunk.ts +14 -9
- package/src/feature-libraries/chunked-forest/chunk.ts +1 -1
- package/src/feature-libraries/chunked-forest/chunkTree.ts +4 -4
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +8 -6
- package/src/feature-libraries/chunked-forest/codec/chunkCodecUtilities.ts +2 -2
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +9 -6
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +6 -4
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +18 -46
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +11 -6
- package/src/feature-libraries/default-schema/defaultSchema.ts +0 -1
- package/src/feature-libraries/default-schema/index.ts +1 -1
- package/src/feature-libraries/default-schema/schemaChecker.ts +6 -0
- package/src/feature-libraries/editableTreeBinder.ts +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 -267
- package/src/feature-libraries/flex-tree/context.ts +0 -1
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +27 -357
- package/src/feature-libraries/flex-tree/index.ts +0 -1
- package/src/feature-libraries/flex-tree/lazyField.ts +38 -208
- package/src/feature-libraries/flex-tree/lazyNode.ts +5 -66
- 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 -35
- package/src/feature-libraries/mapTreeCursor.ts +13 -4
- package/src/feature-libraries/memoizedIdRangeAllocator.ts +0 -4
- package/src/feature-libraries/modular-schema/crossFieldQueries.ts +0 -2
- package/src/feature-libraries/modular-schema/discrepancies.ts +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 +27 -245
- package/src/internalTypes.ts +1 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/schematizeTree.ts +25 -21
- package/src/shared-tree/schematizingTreeView.ts +6 -6
- package/src/shared-tree/sharedTree.ts +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} +47 -36
- package/src/simple-tree/api/verboseTree.ts +415 -0
- package/src/simple-tree/arrayNode.ts +100 -98
- package/src/simple-tree/core/README.md +11 -0
- package/src/simple-tree/core/index.ts +33 -0
- package/src/simple-tree/{schemaCaching.ts → core/schemaCaching.ts} +3 -37
- package/src/simple-tree/{treeNodeKernel.ts → core/treeNodeKernel.ts} +55 -5
- package/src/simple-tree/core/treeNodeSchema.ts +184 -0
- package/src/simple-tree/core/types.ts +255 -0
- package/src/simple-tree/core/withType.ts +89 -0
- package/src/simple-tree/getJsonSchema.ts +70 -0
- package/src/simple-tree/getSimpleFieldSchema.ts +36 -0
- package/src/simple-tree/getSimpleSchema.ts +69 -0
- package/src/simple-tree/index.ts +58 -33
- package/src/simple-tree/jsonSchema.ts +230 -0
- package/src/simple-tree/leafNodeSchema.ts +6 -3
- package/src/simple-tree/mapNode.ts +56 -55
- package/src/simple-tree/objectNode.ts +66 -90
- package/src/simple-tree/objectNodeTypes.ts +68 -0
- package/src/simple-tree/proxies.ts +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.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.map +0 -1
- package/lib/simple-tree/types.d.ts.map +0 -1
- package/lib/simple-tree/types.js.map +0 -1
- package/src/feature-libraries/contextuallyTyped.ts +0 -582
- package/src/feature-libraries/schema-aware/README.md +0 -19
- package/src/feature-libraries/schema-aware/index.ts +0 -16
- package/src/feature-libraries/schema-aware/schemaAware.ts +0 -135
- package/src/simple-tree/nodeKeys.ts +0 -42
- /package/dist/simple-tree/{testRecursiveDomain.js → api/testRecursiveDomain.js} +0 -0
- /package/lib/simple-tree/{testRecursiveDomain.js → api/testRecursiveDomain.js} +0 -0
|
@@ -7,7 +7,6 @@ import type { Listeners, Listenable } from "../events/index.js";
|
|
|
7
7
|
import type { FlexTreeNode } from "./flex-tree/index.js";
|
|
8
8
|
/**
|
|
9
9
|
* Binder events reflecting atomic data operations
|
|
10
|
-
* @internal
|
|
11
10
|
*/
|
|
12
11
|
export interface OperationBinderEvents {
|
|
13
12
|
remove(context: RemoveBindingContext): void;
|
|
@@ -16,27 +15,20 @@ export interface OperationBinderEvents {
|
|
|
16
15
|
}
|
|
17
16
|
/**
|
|
18
17
|
* Binder events signaling state invalidation
|
|
19
|
-
* @internal
|
|
20
18
|
*/
|
|
21
19
|
export interface InvalidationBinderEvents {
|
|
22
20
|
invalidation(context: InvalidationBindingContext): void;
|
|
23
21
|
}
|
|
24
22
|
/**
|
|
25
23
|
* Compare function, generic.
|
|
26
|
-
*
|
|
27
|
-
* @internal
|
|
28
24
|
*/
|
|
29
25
|
export type CompareFunction<T> = (a: T, b: T) => number;
|
|
30
26
|
/**
|
|
31
27
|
* Compare function for binder events.
|
|
32
|
-
*
|
|
33
|
-
* @internal
|
|
34
28
|
*/
|
|
35
29
|
export type BinderEventsCompare = CompareFunction<VisitorBindingContext>;
|
|
36
30
|
/**
|
|
37
31
|
* Compare function for anchors.
|
|
38
|
-
*
|
|
39
|
-
* @internal
|
|
40
32
|
*/
|
|
41
33
|
export type AnchorsCompare = CompareFunction<UpPath>;
|
|
42
34
|
/**
|
|
@@ -45,15 +37,12 @@ export type AnchorsCompare = CompareFunction<UpPath>;
|
|
|
45
37
|
* TODO: add more options:
|
|
46
38
|
* `filterFn?: (context: BindingContext) => boolean;`
|
|
47
39
|
* `pathPolicy?: "relative" | "absolute";`
|
|
48
|
-
* @internal
|
|
49
40
|
*/
|
|
50
41
|
export interface BinderOptions {
|
|
51
42
|
sortFn?: BinderEventsCompare;
|
|
52
43
|
}
|
|
53
44
|
/**
|
|
54
45
|
* Specialized binder options for flushable binders.
|
|
55
|
-
*
|
|
56
|
-
* @internal
|
|
57
46
|
*/
|
|
58
47
|
export interface FlushableBinderOptions<E extends Listeners<E>> extends BinderOptions {
|
|
59
48
|
autoFlush: boolean;
|
|
@@ -70,22 +59,16 @@ export interface FlushableBinderOptions<E extends Listeners<E>> extends BinderOp
|
|
|
70
59
|
* - `path` match policy means that path filtering would return events matching the _exact_ path only. In this case
|
|
71
60
|
* _exact_ semantics include interpreting an `undefined` _index_ field in the {@link PathStep} as a wildcard.
|
|
72
61
|
*
|
|
73
|
-
*
|
|
74
|
-
* @internal
|
|
75
62
|
*/
|
|
76
63
|
export type MatchPolicy = SubtreePolicy | "subtree" | "path";
|
|
77
64
|
/**
|
|
78
65
|
* Subtree match policy where max depth can be specified.
|
|
79
|
-
*
|
|
80
|
-
* @internal
|
|
81
66
|
*/
|
|
82
67
|
export interface SubtreePolicy {
|
|
83
68
|
maxDepth: number;
|
|
84
69
|
}
|
|
85
70
|
/**
|
|
86
71
|
* The data binder interface
|
|
87
|
-
*
|
|
88
|
-
* @internal
|
|
89
72
|
*/
|
|
90
73
|
export interface DataBinder<B extends OperationBinderEvents | InvalidationBinderEvents> {
|
|
91
74
|
/**
|
|
@@ -104,23 +87,17 @@ export interface DataBinder<B extends OperationBinderEvents | InvalidationBinder
|
|
|
104
87
|
}
|
|
105
88
|
/**
|
|
106
89
|
* An interface describing the ability to flush.
|
|
107
|
-
*
|
|
108
|
-
* @internal
|
|
109
90
|
*/
|
|
110
91
|
export interface Flushable<T> {
|
|
111
92
|
flush(): T;
|
|
112
93
|
}
|
|
113
94
|
/**
|
|
114
95
|
* An interface describing a flushable data binder.
|
|
115
|
-
*
|
|
116
|
-
* @internal
|
|
117
96
|
*/
|
|
118
97
|
export interface FlushableDataBinder<B extends OperationBinderEvents | InvalidationBinderEvents> extends DataBinder<B>, Flushable<FlushableDataBinder<B>> {
|
|
119
98
|
}
|
|
120
99
|
/**
|
|
121
100
|
* A step in a bind path
|
|
122
|
-
*
|
|
123
|
-
* @internal
|
|
124
101
|
*/
|
|
125
102
|
export interface PathStep {
|
|
126
103
|
/**
|
|
@@ -134,22 +111,16 @@ export interface PathStep {
|
|
|
134
111
|
}
|
|
135
112
|
/**
|
|
136
113
|
* The default type for a bind tree
|
|
137
|
-
*
|
|
138
|
-
* @internal
|
|
139
114
|
*/
|
|
140
115
|
export type BindTreeDefault = BindTree;
|
|
141
116
|
/**
|
|
142
117
|
* A bind tree is a compact representation of related {@link BindPath}s.
|
|
143
|
-
*
|
|
144
|
-
* @internal
|
|
145
118
|
*/
|
|
146
119
|
export interface BindTree<T = BindTreeDefault> extends PathStep {
|
|
147
120
|
readonly children: Map<FieldKey, T>;
|
|
148
121
|
}
|
|
149
122
|
/**
|
|
150
123
|
* A bind policy is a combination of a {@link BindTree} and a {@link MatchPolicy}.
|
|
151
|
-
*
|
|
152
|
-
* @internal
|
|
153
124
|
*/
|
|
154
125
|
export interface BindPolicy {
|
|
155
126
|
readonly bindTree: BindTree;
|
|
@@ -157,8 +128,6 @@ export interface BindPolicy {
|
|
|
157
128
|
}
|
|
158
129
|
/**
|
|
159
130
|
* Index symbol for syntax tree
|
|
160
|
-
*
|
|
161
|
-
* @internal
|
|
162
131
|
*/
|
|
163
132
|
export declare const indexSymbol: unique symbol;
|
|
164
133
|
/**
|
|
@@ -169,8 +138,6 @@ export declare const indexSymbol: unique symbol;
|
|
|
169
138
|
*
|
|
170
139
|
* see {@link BindTree}
|
|
171
140
|
* see {@link compileSyntaxTree}
|
|
172
|
-
*
|
|
173
|
-
* @internal
|
|
174
141
|
*/
|
|
175
142
|
export interface BindSyntaxTree {
|
|
176
143
|
readonly [indexSymbol]?: number;
|
|
@@ -181,26 +148,18 @@ export interface BindSyntaxTree {
|
|
|
181
148
|
*
|
|
182
149
|
* see {@link BindTree}
|
|
183
150
|
* see {@link UpPath}
|
|
184
|
-
*
|
|
185
|
-
* @internal
|
|
186
151
|
*/
|
|
187
152
|
export type DownPath = PathStep[];
|
|
188
153
|
/**
|
|
189
154
|
* A bind path is a top down path in a bind tree
|
|
190
|
-
*
|
|
191
|
-
* @internal
|
|
192
155
|
*/
|
|
193
156
|
export type BindPath = DownPath;
|
|
194
157
|
/**
|
|
195
158
|
* A binding context specialized for {@link PathVisitor} triggered binding events.
|
|
196
|
-
*
|
|
197
|
-
* @internal
|
|
198
159
|
*/
|
|
199
160
|
export type VisitorBindingContext = RemoveBindingContext | InsertBindingContext;
|
|
200
161
|
/**
|
|
201
162
|
* Enumeration of binding categories
|
|
202
|
-
*
|
|
203
|
-
* @internal
|
|
204
163
|
*/
|
|
205
164
|
export declare const BindingType: {
|
|
206
165
|
readonly Remove: "remove";
|
|
@@ -210,22 +169,16 @@ export declare const BindingType: {
|
|
|
210
169
|
};
|
|
211
170
|
/**
|
|
212
171
|
* The type of a binding context
|
|
213
|
-
*
|
|
214
|
-
* @internal
|
|
215
172
|
*/
|
|
216
173
|
export type BindingContextType = (typeof BindingType)[keyof typeof BindingType];
|
|
217
174
|
/**
|
|
218
175
|
* The binding context attribution common to all binding events
|
|
219
|
-
*
|
|
220
|
-
* @internal
|
|
221
176
|
*/
|
|
222
177
|
export interface BindingContext {
|
|
223
178
|
readonly type: BindingContextType;
|
|
224
179
|
}
|
|
225
180
|
/**
|
|
226
181
|
* The binding context for a remove event
|
|
227
|
-
*
|
|
228
|
-
* @internal
|
|
229
182
|
*/
|
|
230
183
|
export interface RemoveBindingContext extends BindingContext {
|
|
231
184
|
readonly type: typeof BindingType.Remove;
|
|
@@ -234,8 +187,6 @@ export interface RemoveBindingContext extends BindingContext {
|
|
|
234
187
|
}
|
|
235
188
|
/**
|
|
236
189
|
* The binding context for an insert event
|
|
237
|
-
*
|
|
238
|
-
* @internal
|
|
239
190
|
*/
|
|
240
191
|
export interface InsertBindingContext extends BindingContext {
|
|
241
192
|
readonly type: typeof BindingType.Insert;
|
|
@@ -244,16 +195,12 @@ export interface InsertBindingContext extends BindingContext {
|
|
|
244
195
|
}
|
|
245
196
|
/**
|
|
246
197
|
* The binding context for an invalidation event
|
|
247
|
-
*
|
|
248
|
-
* @internal
|
|
249
198
|
*/
|
|
250
199
|
export interface InvalidationBindingContext extends BindingContext {
|
|
251
200
|
readonly type: typeof BindingType.Invalidation;
|
|
252
201
|
}
|
|
253
202
|
/**
|
|
254
203
|
* The binding context for a batch event
|
|
255
|
-
*
|
|
256
|
-
* @internal
|
|
257
204
|
*/
|
|
258
205
|
export interface BatchBindingContext extends BindingContext {
|
|
259
206
|
readonly type: typeof BindingType.Batch;
|
|
@@ -261,33 +208,23 @@ export interface BatchBindingContext extends BindingContext {
|
|
|
261
208
|
}
|
|
262
209
|
/**
|
|
263
210
|
* Compute a top-town {@link DownPath} from an {@link UpPath}.
|
|
264
|
-
*
|
|
265
|
-
* @internal
|
|
266
211
|
*/
|
|
267
212
|
export declare function toDownPath(upPath: UpPath): DownPath;
|
|
268
213
|
/**
|
|
269
214
|
* Create a buffering data binder.
|
|
270
|
-
*
|
|
271
|
-
* @internal
|
|
272
215
|
*/
|
|
273
216
|
export declare function createDataBinderBuffering<E extends Listeners<E>>(view: Listenable<E>, options: FlushableBinderOptions<E>): FlushableDataBinder<OperationBinderEvents>;
|
|
274
217
|
/**
|
|
275
218
|
* Create a direct data binder.
|
|
276
|
-
*
|
|
277
|
-
* @internal
|
|
278
219
|
*/
|
|
279
220
|
export declare function createDataBinderDirect<E extends Listeners<E>>(view: Listenable<E>, options: BinderOptions): DataBinder<OperationBinderEvents>;
|
|
280
221
|
/**
|
|
281
222
|
* Create an invalidating data binder.
|
|
282
|
-
*
|
|
283
|
-
* @internal
|
|
284
223
|
*/
|
|
285
224
|
export declare function createDataBinderInvalidating<E extends Listeners<E>>(view: Listenable<E>, options: FlushableBinderOptions<E>): FlushableDataBinder<InvalidationBinderEvents>;
|
|
286
225
|
/**
|
|
287
226
|
* Create binder options. If not specified, the default values are:
|
|
288
227
|
* - sortFn: no sorting
|
|
289
|
-
*
|
|
290
|
-
* @internal
|
|
291
228
|
*/
|
|
292
229
|
export declare function createBinderOptions({ sortFn, }: {
|
|
293
230
|
sortFn?: BinderEventsCompare;
|
|
@@ -297,8 +234,6 @@ export declare function createBinderOptions({ sortFn, }: {
|
|
|
297
234
|
* - sortFn: no sorting
|
|
298
235
|
* - sortAnchorsFn: no sorting
|
|
299
236
|
* - autoFlush: true
|
|
300
|
-
*
|
|
301
|
-
* @internal
|
|
302
237
|
*/
|
|
303
238
|
export declare function createFlushableBinderOptions<E extends Listeners<E>>({ sortFn, sortAnchorsFn, autoFlush, autoFlushPolicy, }: {
|
|
304
239
|
sortFn?: BinderEventsCompare;
|
|
@@ -311,7 +246,6 @@ export declare function createFlushableBinderOptions<E extends Listeners<E>>({ s
|
|
|
311
246
|
*
|
|
312
247
|
* @param fns - a list of compare functions
|
|
313
248
|
* @returns a compare function that can be used for sorting
|
|
314
|
-
* @internal
|
|
315
249
|
*/
|
|
316
250
|
export declare function comparePipeline<T>(...fns: CompareFunction<T>[]): CompareFunction<T>;
|
|
317
251
|
/**
|
|
@@ -319,7 +253,6 @@ export declare function comparePipeline<T>(...fns: CompareFunction<T>[]): Compar
|
|
|
319
253
|
* The syntax tree is a compact representation of related {@link BindPath}s.
|
|
320
254
|
* The match policy can be specified. If not specified, the default value is "path".
|
|
321
255
|
* @returns a {@link BindPolicy} object
|
|
322
|
-
* @internal
|
|
323
256
|
*/
|
|
324
257
|
export declare function compileSyntaxTree(syntaxTree: BindSyntaxTree, matchPolicy?: MatchPolicy): BindPolicy;
|
|
325
258
|
//# sourceMappingURL=editableTreeBinder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editableTreeBinder.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/editableTreeBinder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAGN,KAAK,QAAQ,EAGb,KAAK,UAAU,EAEf,KAAK,MAAM,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CAAC,EAAE,EACpE,MAAM,EACN,aAAa,EACb,SAAgB,EAChB,eAAe,GACf,EAAE;IACF,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,MAAM,SAAS,CAAC,CAAC,CAAC,CAAC;CACpC,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAO5B;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,GAAG,eAAe,CAAC,CAAC,CAAC,CAUnF;AAaD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAChC,UAAU,EAAE,cAAc,EAC1B,WAAW,CAAC,EAAE,WAAW,GACvB,UAAU,CAQZ"}
|
|
@@ -2,19 +2,15 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { assert } from "@fluidframework/core-utils/internal";
|
|
5
|
+
import { assert, oob } from "@fluidframework/core-utils/internal";
|
|
6
6
|
import { topDownPath, } from "../core/index.js";
|
|
7
7
|
import { brand, getOrCreate } from "../util/index.js";
|
|
8
8
|
/**
|
|
9
9
|
* Index symbol for syntax tree
|
|
10
|
-
*
|
|
11
|
-
* @internal
|
|
12
10
|
*/
|
|
13
11
|
export const indexSymbol = Symbol("flex-tree-binder:index");
|
|
14
12
|
/**
|
|
15
13
|
* Enumeration of binding categories
|
|
16
|
-
*
|
|
17
|
-
* @internal
|
|
18
14
|
*/
|
|
19
15
|
export const BindingType = {
|
|
20
16
|
Remove: "remove",
|
|
@@ -133,7 +129,8 @@ class AbstractPathVisitor {
|
|
|
133
129
|
}
|
|
134
130
|
}
|
|
135
131
|
getListeners(contextType, downPath) {
|
|
136
|
-
const
|
|
132
|
+
const firstDownPath = downPath[0] ?? oob();
|
|
133
|
+
const foundRoot = this.findRoot(contextType, firstDownPath.field);
|
|
137
134
|
if (foundRoot === undefined) {
|
|
138
135
|
return undefined;
|
|
139
136
|
}
|
|
@@ -295,8 +292,7 @@ class BufferingPathVisitor extends AbstractPathVisitor {
|
|
|
295
292
|
const batchEvents = [];
|
|
296
293
|
const collected = new Set();
|
|
297
294
|
if (this.hasRegisteredContextType(BindingType.Batch)) {
|
|
298
|
-
for (
|
|
299
|
-
const event = sortedQueue[i];
|
|
295
|
+
for (const [i, event] of sortedQueue.entries()) {
|
|
300
296
|
const current = toDownPath(event.path);
|
|
301
297
|
const listeners = this.getListeners(BindingType.Batch, current);
|
|
302
298
|
if (listeners !== undefined && listeners.size > 0) {
|
|
@@ -314,11 +310,10 @@ class BufferingPathVisitor extends AbstractPathVisitor {
|
|
|
314
310
|
events: batchEvents,
|
|
315
311
|
});
|
|
316
312
|
}
|
|
317
|
-
for (
|
|
313
|
+
for (const [i, { listeners, ...context }] of sortedQueue.entries()) {
|
|
318
314
|
if (batchEventIndices.has(i)) {
|
|
319
315
|
continue;
|
|
320
316
|
}
|
|
321
|
-
const { listeners, ...context } = sortedQueue[i];
|
|
322
317
|
for (const listener of listeners) {
|
|
323
318
|
listener({ ...context });
|
|
324
319
|
}
|
|
@@ -441,8 +436,6 @@ class InvalidateDataBinder extends AbstractDataBinder {
|
|
|
441
436
|
}
|
|
442
437
|
/**
|
|
443
438
|
* Compute a top-town {@link DownPath} from an {@link UpPath}.
|
|
444
|
-
*
|
|
445
|
-
* @internal
|
|
446
439
|
*/
|
|
447
440
|
export function toDownPath(upPath) {
|
|
448
441
|
const downPath = topDownPath(upPath);
|
|
@@ -454,24 +447,18 @@ export function toDownPath(upPath) {
|
|
|
454
447
|
}
|
|
455
448
|
/**
|
|
456
449
|
* Create a buffering data binder.
|
|
457
|
-
*
|
|
458
|
-
* @internal
|
|
459
450
|
*/
|
|
460
451
|
export function createDataBinderBuffering(view, options) {
|
|
461
452
|
return new BufferingDataBinder(view, options);
|
|
462
453
|
}
|
|
463
454
|
/**
|
|
464
455
|
* Create a direct data binder.
|
|
465
|
-
*
|
|
466
|
-
* @internal
|
|
467
456
|
*/
|
|
468
457
|
export function createDataBinderDirect(view, options) {
|
|
469
458
|
return new DirectDataBinder(view, options);
|
|
470
459
|
}
|
|
471
460
|
/**
|
|
472
461
|
* Create an invalidating data binder.
|
|
473
|
-
*
|
|
474
|
-
* @internal
|
|
475
462
|
*/
|
|
476
463
|
export function createDataBinderInvalidating(view, options) {
|
|
477
464
|
return new InvalidateDataBinder(view, options);
|
|
@@ -479,8 +466,6 @@ export function createDataBinderInvalidating(view, options) {
|
|
|
479
466
|
/**
|
|
480
467
|
* Create binder options. If not specified, the default values are:
|
|
481
468
|
* - sortFn: no sorting
|
|
482
|
-
*
|
|
483
|
-
* @internal
|
|
484
469
|
*/
|
|
485
470
|
export function createBinderOptions({ sortFn, }) {
|
|
486
471
|
return { sortFn };
|
|
@@ -490,8 +475,6 @@ export function createBinderOptions({ sortFn, }) {
|
|
|
490
475
|
* - sortFn: no sorting
|
|
491
476
|
* - sortAnchorsFn: no sorting
|
|
492
477
|
* - autoFlush: true
|
|
493
|
-
*
|
|
494
|
-
* @internal
|
|
495
478
|
*/
|
|
496
479
|
export function createFlushableBinderOptions({ sortFn, sortAnchorsFn, autoFlush = true, autoFlushPolicy, }) {
|
|
497
480
|
return {
|
|
@@ -506,7 +489,6 @@ export function createFlushableBinderOptions({ sortFn, sortAnchorsFn, autoFlush
|
|
|
506
489
|
*
|
|
507
490
|
* @param fns - a list of compare functions
|
|
508
491
|
* @returns a compare function that can be used for sorting
|
|
509
|
-
* @internal
|
|
510
492
|
*/
|
|
511
493
|
export function comparePipeline(...fns) {
|
|
512
494
|
return (a, b) => {
|
|
@@ -534,12 +516,11 @@ function nativeSort(arr, compareFn) {
|
|
|
534
516
|
* The syntax tree is a compact representation of related {@link BindPath}s.
|
|
535
517
|
* The match policy can be specified. If not specified, the default value is "path".
|
|
536
518
|
* @returns a {@link BindPolicy} object
|
|
537
|
-
* @internal
|
|
538
519
|
*/
|
|
539
520
|
export function compileSyntaxTree(syntaxTree, matchPolicy) {
|
|
540
521
|
const entries = Object.entries(syntaxTree);
|
|
541
522
|
if (entries.length === 1) {
|
|
542
|
-
const [fieldName, childNode] = entries[0];
|
|
523
|
+
const [fieldName, childNode] = entries[0] ?? oob();
|
|
543
524
|
const fieldKey = brand(fieldName);
|
|
544
525
|
const bindTree = compileSyntaxTreeNode(childNode, fieldKey);
|
|
545
526
|
return { matchPolicy: matchPolicy ?? "path", bindTree };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editableTreeBinder.js","sourceRoot":"","sources":["../../src/feature-libraries/editableTreeBinder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EASN,WAAW,GACX,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAuLtD;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;AA0C5D;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IAC1B,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,cAAc;IAC5B,KAAK,EAAE,OAAO;CACL,CAAC;AAyEX;;;GAGG;AACH,MAAe,mBAAmB;IAGjC,YAAsC,OAAsB;QAAtB,YAAO,GAAP,OAAO,CAAe;QAFzC,wBAAmB,GACrC,IAAI,GAAG,EAAE,CAAC;IACoD,CAAC;IAEhE,gGAAgG;IACzF,WAAW,CAAC,OAA4B,IAAS,CAAC;IAClD,aAAa,CAAC,OAA4B,IAAS,CAAC;IACpD,YAAY,CAAC,MAA2B,EAAE,WAAwB,IAAS,CAAC;IAC5E,WAAW,CAAC,MAA2B,EAAE,WAAwB;QACvE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;IAC/C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACjD,MAAM,QAAQ,GAAa,KAAK,CAAC,GAAG,CAAC,CAAC;QACtC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,qBAAqB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;IAChE,CAAC;IACD,OAAO;QACN,GAAG,QAAQ;QACX,QAAQ;KACR,CAAC;AACH,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 DetachedPlaceUpPath,\n\ttype DetachedRangeUpPath,\n\ttype FieldKey,\n\ttype PathVisitor,\n\ttype PlaceUpPath,\n\ttype ProtoNodes,\n\ttype RangeUpPath,\n\ttype UpPath,\n\ttopDownPath,\n} from \"../core/index.js\";\nimport type { Listeners, Listenable } from \"../events/index.js\";\nimport { brand, getOrCreate } from \"../util/index.js\";\n\nimport type { FlexTreeNode } from \"./flex-tree/index.js\";\n\n// TODO:\n// Tests for this file were removed along with the old editable-tree implementation in the commit that includes this note.\n// They were a bit heavily tied to the testing patterns specific to the old editable-tree and will need significant changes to be restored.\n\n/**\n * Binder events reflecting atomic data operations\n * @internal\n */\nexport interface OperationBinderEvents {\n\tremove(context: RemoveBindingContext): void;\n\tinsert(context: InsertBindingContext): void;\n\tbatch(context: BatchBindingContext): void;\n}\n\n/**\n * Binder events signaling state invalidation\n * @internal\n */\nexport interface InvalidationBinderEvents {\n\tinvalidation(context: InvalidationBindingContext): void;\n}\n\n/**\n * Compare function, generic.\n *\n * @internal\n */\nexport type CompareFunction<T> = (a: T, b: T) => number;\n\n/**\n * Compare function for binder events.\n *\n * @internal\n */\nexport type BinderEventsCompare = CompareFunction<VisitorBindingContext>;\n\n/**\n * Compare function for anchors.\n *\n * @internal\n */\nexport type AnchorsCompare = CompareFunction<UpPath>;\n\n/**\n * Options to configure binder behavior.\n *\n * TODO: add more options:\n * `filterFn?: (context: BindingContext) => boolean;`\n * `pathPolicy?: \"relative\" | \"absolute\";`\n * @internal\n */\nexport interface BinderOptions {\n\tsortFn?: BinderEventsCompare;\n}\n\n/**\n * Specialized binder options for flushable binders.\n *\n * @internal\n */\nexport interface FlushableBinderOptions<E extends Listeners<E>> extends BinderOptions {\n\tautoFlush: boolean;\n\tautoFlushPolicy: keyof Listeners<E>;\n\tsortAnchorsFn?: AnchorsCompare;\n}\n\n/**\n * Match policy for binding: subtree or path.\n *\n * - `subtree` match policy means that path filtering would return events matching the exact path and its subpaths,\n * ie. changes to (nested) children would be allowed to bubble up to parent listeners.\n * - {@link SubtreePolicy} match policy is equivalent with `subtree` match policy, while allowing to specify a maximum\n * depth for the subtree.\n * - `path` match policy means that path filtering would return events matching the _exact_ path only. In this case\n * _exact_ semantics include interpreting an `undefined` _index_ field in the {@link PathStep} as a wildcard.\n *\n *\n * @internal\n */\nexport type MatchPolicy = SubtreePolicy | \"subtree\" | \"path\";\n\n/**\n * Subtree match policy where max depth can be specified.\n *\n * @internal\n */\nexport interface SubtreePolicy {\n\tmaxDepth: number;\n}\n\n/**\n * The data binder interface\n *\n * @internal\n */\nexport interface DataBinder<B extends OperationBinderEvents | InvalidationBinderEvents> {\n\t/**\n\t * Register an event listener\n\t *\n\t * @param anchor - The anchor to register the listener on\n\t * @param eventType - The {@link BindingType} to listen for.\n\t * @param eventTrees - The {@link BindPolicy}s to filter on.\n\t * @param listener - The listener to register\n\t */\n\tregister<K extends keyof Listeners<B>>(\n\t\tanchor: FlexTreeNode,\n\t\teventType: K,\n\t\teventTrees: BindPolicy[],\n\t\tlistener?: B[K],\n\t): void;\n\n\t/**\n\t * Unregister all listeners.\n\t */\n\tunregisterAll(): void;\n}\n\n/**\n * An interface describing the ability to flush.\n *\n * @internal\n */\nexport interface Flushable<T> {\n\tflush(): T;\n}\n\n/**\n * An interface describing a flushable data binder.\n *\n * @internal\n */\nexport interface FlushableDataBinder<\n\tB extends OperationBinderEvents | InvalidationBinderEvents,\n> extends DataBinder<B>,\n\t\tFlushable<FlushableDataBinder<B>> {}\n\n/**\n * A step in a bind path\n *\n * @internal\n */\nexport interface PathStep {\n\t/**\n\t * The field being traversed\n\t */\n\treadonly field: FieldKey;\n\n\t/**\n\t * The index of the element being navigated to\n\t */\n\treadonly index?: number;\n}\n\n/**\n * The default type for a bind tree\n *\n * @internal\n */\nexport type BindTreeDefault = BindTree;\n\n/**\n * A bind tree is a compact representation of related {@link BindPath}s.\n *\n * @internal\n */\nexport interface BindTree<T = BindTreeDefault> extends PathStep {\n\treadonly children: Map<FieldKey, T>;\n}\n\n/**\n * A bind policy is a combination of a {@link BindTree} and a {@link MatchPolicy}.\n *\n * @internal\n */\nexport interface BindPolicy {\n\treadonly bindTree: BindTree;\n\treadonly matchPolicy: MatchPolicy;\n}\n\n/**\n * Index symbol for syntax tree\n *\n * @internal\n */\nexport const indexSymbol = Symbol(\"flex-tree-binder:index\");\n\n/**\n * A syntax node for the bind language\n *\n * The bind language is a compact representation of related {@link BindPath}s. It can be used to\n * simplify usage and construction of {@link BindTree}s.\n *\n * see {@link BindTree}\n * see {@link compileSyntaxTree}\n *\n * @internal\n */\nexport interface BindSyntaxTree {\n\treadonly [indexSymbol]?: number;\n\treadonly [key: string]: true | BindSyntaxTree;\n}\n\n/**\n * A top down path in a bind or path tree is a collection of {@link PathStep}s\n *\n * see {@link BindTree}\n * see {@link UpPath}\n *\n * @internal\n */\nexport type DownPath = PathStep[];\n\n/**\n * A bind path is a top down path in a bind tree\n *\n * @internal\n */\nexport type BindPath = DownPath;\n\n/**\n * A binding context specialized for {@link PathVisitor} triggered binding events.\n *\n * @internal\n */\nexport type VisitorBindingContext = RemoveBindingContext | InsertBindingContext;\n\n/**\n * Enumeration of binding categories\n *\n * @internal\n */\nexport const BindingType = {\n\tRemove: \"remove\",\n\tInsert: \"insert\",\n\tInvalidation: \"invalidation\",\n\tBatch: \"batch\",\n} as const;\n\n/**\n * The type of a binding context\n *\n * @internal\n */\nexport type BindingContextType = (typeof BindingType)[keyof typeof BindingType];\n\n/**\n * The binding context attribution common to all binding events\n *\n * @internal\n */\nexport interface BindingContext {\n\treadonly type: BindingContextType;\n}\n\n/**\n * The binding context for a remove event\n *\n * @internal\n */\nexport interface RemoveBindingContext extends BindingContext {\n\treadonly type: typeof BindingType.Remove;\n\treadonly path: UpPath;\n\treadonly count: number;\n}\n\n/**\n * The binding context for an insert event\n *\n * @internal\n */\nexport interface InsertBindingContext extends BindingContext {\n\treadonly type: typeof BindingType.Insert;\n\treadonly path: UpPath;\n\treadonly content: ProtoNodes;\n}\n\n/**\n * The binding context for an invalidation event\n *\n * @internal\n */\nexport interface InvalidationBindingContext extends BindingContext {\n\treadonly type: typeof BindingType.Invalidation;\n}\n\n/**\n * The binding context for a batch event\n *\n * @internal\n */\nexport interface BatchBindingContext extends BindingContext {\n\treadonly type: typeof BindingType.Batch;\n\treadonly events: VisitorBindingContext[];\n}\n\n/**\n * The listener interface. Internal.\n *\n * @internal\n */\ntype Listener = (...args: unknown[]) => void;\n\n/**\n * A call tree is a {@link BindTree} augmented with listeners. Internal.\n *\n * @internal\n */\ntype CallTree = BindTree<CallTree> & { listeners: Set<Listener>; matchPolicy?: MatchPolicy };\n\n/**\n * A generic implementation of a {@link PathVisitor} enabling the registration of listeners\n * categorized by {@link BindingContextType} and {@link BindPolicy}.\n */\nabstract class AbstractPathVisitor implements PathVisitor {\n\tprotected readonly registeredListeners: Map<BindingContextType, Map<FieldKey, CallTree>> =\n\t\tnew Map();\n\tpublic constructor(protected readonly options: BinderOptions) {}\n\n\t// TODO: make these methods abstract and make AbstractPathVisitor implementations implement them\n\tpublic afterCreate(content: DetachedRangeUpPath): void {}\n\tpublic beforeDestroy(content: DetachedRangeUpPath): void {}\n\tpublic beforeAttach(source: DetachedRangeUpPath, destination: PlaceUpPath): void {}\n\tpublic afterAttach(source: DetachedPlaceUpPath, destination: RangeUpPath): void {\n\t\tthis.onInsert(\n\t\t\t{\n\t\t\t\tparent: destination.parent,\n\t\t\t\tparentField: destination.field,\n\t\t\t\tparentIndex: destination.start,\n\t\t\t},\n\t\t\tthis.getContent(destination),\n\t\t);\n\t}\n\tpublic beforeDetach(source: RangeUpPath, destination: DetachedPlaceUpPath): void {}\n\tpublic afterDetach(source: PlaceUpPath, destination: DetachedRangeUpPath): void {\n\t\tthis.onRemove(\n\t\t\t{\n\t\t\t\tparent: source.parent,\n\t\t\t\tparentField: source.field,\n\t\t\t\tparentIndex: source.index,\n\t\t\t},\n\t\t\tdestination.end - destination.start,\n\t\t);\n\t}\n\tpublic beforeReplace(\n\t\tnewContent: DetachedRangeUpPath,\n\t\toldContent: RangeUpPath,\n\t\toldContentDestination: DetachedPlaceUpPath,\n\t): void {}\n\tpublic afterReplace(\n\t\tnewContentSource: DetachedPlaceUpPath,\n\t\tnewContent: RangeUpPath,\n\t\toldContent: DetachedRangeUpPath,\n\t): void {\n\t\tthis.onRemove(\n\t\t\t{\n\t\t\t\tparent: newContent.parent,\n\t\t\t\tparentField: newContent.field,\n\t\t\t\tparentIndex: newContent.start,\n\t\t\t},\n\t\t\toldContent.end - oldContent.start,\n\t\t);\n\t\tthis.onInsert(\n\t\t\t{\n\t\t\t\tparent: newContent.parent,\n\t\t\t\tparentField: newContent.field,\n\t\t\t\tparentIndex: newContent.start,\n\t\t\t},\n\t\t\tthis.getContent(newContent),\n\t\t);\n\t}\n\tprotected getContent(range: RangeUpPath): ProtoNodes {\n\t\t// TODO: either lookup the content in the forest or stop providing the content in the events\n\t\treturn [];\n\t}\n\n\tpublic abstract onRemove(path: UpPath, count: number): void;\n\tpublic abstract onInsert(path: UpPath, content: ProtoNodes): void;\n\tpublic registerListener(\n\t\tcontextType: BindingContextType,\n\t\tpolicies: BindPolicy[],\n\t\tlistener: Listener,\n\t): () => void {\n\t\tconst contextRoots = getOrCreate(this.registeredListeners, contextType, () => new Map());\n\t\tpolicies.forEach((policy) => {\n\t\t\tconst tree = policy.bindTree;\n\t\t\tconst currentRoot = this.findRoot(contextType, tree.field);\n\t\t\tif (currentRoot === undefined) {\n\t\t\t\tconst newRoot: CallTree = {\n\t\t\t\t\tfield: tree.field,\n\t\t\t\t\tindex: tree.index,\n\t\t\t\t\tlisteners: new Set(),\n\t\t\t\t\tchildren: new Map(),\n\t\t\t\t\tmatchPolicy: policy.matchPolicy,\n\t\t\t\t};\n\t\t\t\tassert(contextRoots !== undefined, 0x6da /* expected contextRoots to be defined */);\n\t\t\t\tcontextRoots.set(tree.field, newRoot);\n\t\t\t\tthis.bindTree(contextType, tree, listener, newRoot);\n\t\t\t} else {\n\t\t\t\tthis.bindTree(contextType, tree, listener, currentRoot);\n\t\t\t}\n\t\t});\n\t\treturn () => {\n\t\t\tpolicies.forEach((policy) =>\n\t\t\t\tthis.unregisterListener(contextType, policy.bindTree, listener),\n\t\t\t);\n\t\t};\n\t}\n\n\tprivate bindTree(\n\t\tcontextType: BindingContextType,\n\t\ttree: BindTree,\n\t\tlistener: Listener,\n\t\tcallTree: CallTree,\n\t): void {\n\t\tif (tree.children.size === 0) {\n\t\t\tcallTree.listeners.add(listener);\n\t\t} else {\n\t\t\ttree.children.forEach((childTree, fieldKey) => {\n\t\t\t\tconst childCallTree = getOrCreate(callTree.children, fieldKey, () => {\n\t\t\t\t\tconst newChildCallTree: CallTree = {\n\t\t\t\t\t\tfield: fieldKey,\n\t\t\t\t\t\tindex: childTree.index,\n\t\t\t\t\t\tlisteners: new Set(),\n\t\t\t\t\t\tchildren: new Map(),\n\t\t\t\t\t};\n\t\t\t\t\tcallTree.children.set(fieldKey, newChildCallTree);\n\t\t\t\t\treturn newChildCallTree;\n\t\t\t\t});\n\t\t\t\tthis.bindTree(contextType, childTree, listener, childCallTree);\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate findRoot(contextType: BindingContextType, field: FieldKey): CallTree | undefined {\n\t\treturn this.registeredListeners.get(contextType)?.get(field);\n\t}\n\n\tprivate unregisterListener(\n\t\tcontextType: BindingContextType,\n\t\ttree: BindTree,\n\t\tlistener: Listener,\n\t\tcallTree?: CallTree,\n\t): void {\n\t\tconst foundTree = callTree ?? this.findRoot(contextType, tree.field);\n\t\tif (foundTree !== undefined) {\n\t\t\tif (tree.children.size === 0) {\n\t\t\t\tfoundTree.listeners.delete(listener);\n\t\t\t} else {\n\t\t\t\ttree.children.forEach((childTree, fieldKey) => {\n\t\t\t\t\tassert(foundTree !== undefined, 0x6db /* expected foundTree to be defined */);\n\t\t\t\t\tconst childCallTree = foundTree.children.get(fieldKey);\n\t\t\t\t\tif (childCallTree !== undefined) {\n\t\t\t\t\t\tthis.unregisterListener(contextType, childTree, listener, childCallTree);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected getListeners(\n\t\tcontextType: BindingContextType,\n\t\tdownPath: DownPath,\n\t): Set<Listener> | undefined {\n\t\tconst foundRoot = this.findRoot(contextType, downPath[0].field);\n\t\tif (foundRoot === undefined) {\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\tconst subtreeMatch = (\n\t\t\t\tsubtreePolicy: SubtreePolicy | undefined,\n\t\t\t\tdepth: number,\n\t\t\t): boolean => {\n\t\t\t\tif (subtreePolicy?.maxDepth !== undefined && depth > subtreePolicy.maxDepth) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t};\n\t\t\tconst accumulateMatching = (\n\t\t\t\ttreeNode: CallTree,\n\t\t\t\tindex: number,\n\t\t\t\tonMatch: (index: number, treeNode: CallTree) => void,\n\t\t\t): void => {\n\t\t\t\tconst step = downPath[index];\n\t\t\t\tif (\n\t\t\t\t\tstep === undefined ||\n\t\t\t\t\ttreeNode.field !== step.field ||\n\t\t\t\t\t(treeNode.index !== undefined && step.index !== treeNode.index)\n\t\t\t\t) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tfor (const child of treeNode.children.values()) {\n\t\t\t\t\taccumulateMatching(child, index + 1, onMatch);\n\t\t\t\t}\n\t\t\t\tonMatch(index, treeNode);\n\t\t\t};\n\t\t\tconst matchedNodes: Set<Listener> = new Set();\n\t\t\tif (foundRoot.matchPolicy === \"path\") {\n\t\t\t\taccumulateMatching(foundRoot, 0, (index: number, treeNode: CallTree): void => {\n\t\t\t\t\tif (index === downPath.length - 1) {\n\t\t\t\t\t\ttreeNode.listeners.forEach((listener) => matchedNodes.add(listener));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else if (foundRoot.matchPolicy === \"subtree\") {\n\t\t\t\taccumulateMatching(foundRoot, 0, (index: number, treeNode: CallTree): void => {\n\t\t\t\t\ttreeNode.listeners.forEach((listener) => matchedNodes.add(listener));\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst matchPolicy: SubtreePolicy | undefined = foundRoot.matchPolicy;\n\t\t\t\taccumulateMatching(foundRoot, 0, (index: number, treeNode: CallTree): void => {\n\t\t\t\t\tif (subtreeMatch(matchPolicy, downPath.length - 1)) {\n\t\t\t\t\t\ttreeNode.listeners.forEach((listener) => matchedNodes.add(listener));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn matchedNodes.size > 0 ? matchedNodes : undefined;\n\t\t}\n\t}\n\n\tpublic hasRegisteredContextType(contextType: BindingContextType): boolean {\n\t\treturn this.registeredListeners.has(contextType);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.registeredListeners.clear();\n\t}\n}\n\n/**\n * A visitor that invokes listeners immediately when a path is traversed.\n */\nclass DirectPathVisitor extends AbstractPathVisitor {\n\tprivate processListeners(path: UpPath, listeners: Set<Listener>, otherArgs: object): void {\n\t\tfor (const listener of listeners) {\n\t\t\tlistener({\n\t\t\t\tpath,\n\t\t\t\t...otherArgs,\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate processRegisteredPaths(\n\t\tpath: UpPath,\n\t\ttype: BindingContextType,\n\t\totherArgs: object,\n\t): void {\n\t\tconst current = toDownPath(path);\n\t\tconst listeners = this.getListeners(type, current);\n\t\tif (listeners !== undefined) {\n\t\t\tthis.processListeners(path, listeners, otherArgs);\n\t\t}\n\t}\n\n\tpublic onRemove(path: UpPath, count: number): void {\n\t\tthis.processRegisteredPaths(path, BindingType.Remove, {\n\t\t\tcount,\n\t\t\ttype: BindingType.Remove,\n\t\t});\n\t}\n\n\tpublic onInsert(path: UpPath, content: ProtoNodes): void {\n\t\tthis.processRegisteredPaths(path, BindingType.Insert, {\n\t\t\tcontent,\n\t\t\ttype: BindingType.Insert,\n\t\t});\n\t}\n}\n\n/**\n * A visitor that invokes listeners only once when flushed if any modifications detected on the registered paths.\n */\nclass InvalidatingPathVisitor\n\textends AbstractPathVisitor\n\timplements Flushable<InvalidatingPathVisitor>\n{\n\tprivate readonly listeners: Set<Listener> = new Set();\n\n\tprivate processRegisteredPaths(path: UpPath): void {\n\t\tconst current = toDownPath(path);\n\t\tconst listeners = this.getListeners(BindingType.Invalidation, current);\n\t\tif (listeners !== undefined) {\n\t\t\tfor (const listener of listeners) {\n\t\t\t\tthis.listeners.add(listener);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic onRemove(path: UpPath, count: number): void {\n\t\tthis.processRegisteredPaths(path);\n\t}\n\n\tpublic onInsert(path: UpPath, content: ProtoNodes): void {\n\t\tthis.processRegisteredPaths(path);\n\t}\n\n\tpublic flush(): InvalidatingPathVisitor {\n\t\tfor (const listener of this.listeners) {\n\t\t\tlistener({\n\t\t\t\ttype: BindingType.Invalidation,\n\t\t\t});\n\t\t}\n\t\tthis.listeners.clear();\n\t\treturn this;\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis.flush();\n\t\tsuper.dispose();\n\t}\n}\n\ntype CallableBindingContext = VisitorBindingContext & {\n\tlisteners: Set<Listener>;\n};\n\n/**\n * A visitor that buffers all events which match the registered event categories and corresponding paths.\n * Listeners are invoked when flushed. Flushing has also the ability to sort and batch the events.\n */\nclass BufferingPathVisitor\n\textends AbstractPathVisitor\n\timplements Flushable<BufferingPathVisitor>\n{\n\tprivate readonly eventQueue: CallableBindingContext[] = [];\n\n\tpublic onRemove(path: UpPath, count: number): void {\n\t\tconst current = toDownPath(path);\n\t\tconst listeners = this.getListeners(BindingType.Remove, current);\n\t\tif (listeners !== undefined) {\n\t\t\tthis.eventQueue.push({\n\t\t\t\tpath,\n\t\t\t\tcount,\n\t\t\t\ttype: BindingType.Remove,\n\t\t\t\tlisteners,\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic onInsert(path: UpPath, content: ProtoNodes): void {\n\t\tconst current = toDownPath(path);\n\t\tconst listeners = this.getListeners(BindingType.Insert, current);\n\t\tif (listeners !== undefined) {\n\t\t\tthis.eventQueue.push({\n\t\t\t\tpath,\n\t\t\t\tcontent,\n\t\t\t\ttype: BindingType.Insert,\n\t\t\t\tlisteners,\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic flush(): BufferingPathVisitor {\n\t\tconst sortedQueue: CallableBindingContext[] = nativeSort(\n\t\t\tthis.eventQueue,\n\t\t\tthis.options.sortFn ?? (() => 0),\n\t\t);\n\t\tconst batchEventIndices = new Set<number>();\n\t\tconst batchEvents: CallableBindingContext[] = [];\n\t\tconst collected = new Set<Listener>();\n\t\tif (this.hasRegisteredContextType(BindingType.Batch)) {\n\t\t\tfor (let i = 0; i < sortedQueue.length; i++) {\n\t\t\t\tconst event = sortedQueue[i];\n\t\t\t\tconst current = toDownPath(event.path);\n\t\t\t\tconst listeners = this.getListeners(BindingType.Batch, current);\n\t\t\t\tif (listeners !== undefined && listeners.size > 0) {\n\t\t\t\t\tfor (const listener of listeners) {\n\t\t\t\t\t\tcollected.add(listener);\n\t\t\t\t\t}\n\t\t\t\t\tbatchEvents.push(event);\n\t\t\t\t\tbatchEventIndices.add(i);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (const listener of collected) {\n\t\t\tlistener({\n\t\t\t\ttype: BindingType.Batch,\n\t\t\t\tevents: batchEvents,\n\t\t\t});\n\t\t}\n\t\tfor (let i = 0; i < sortedQueue.length; i++) {\n\t\t\tif (batchEventIndices.has(i)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst { listeners, ...context } = sortedQueue[i];\n\t\t\tfor (const listener of listeners) {\n\t\t\t\tlistener({ ...context });\n\t\t\t}\n\t\t}\n\t\tthis.eventQueue.length = 0;\n\t\treturn this;\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis.flush();\n\t\tsuper.dispose();\n\t}\n}\n\nclass AbstractDataBinder<\n\tB extends OperationBinderEvents | InvalidationBinderEvents,\n\tV extends AbstractPathVisitor,\n\tO extends BinderOptions,\n> implements DataBinder<B>\n{\n\tprotected readonly visitors = new Map<FlexTreeNode, V>();\n\tprotected readonly visitorLocations = new Map<V, UpPath>();\n\tprotected readonly unregisterHandles = new Set<() => void>();\n\tpublic constructor(\n\t\tprotected readonly options: O,\n\t\tprotected readonly visitorFactory: (anchor: FlexTreeNode) => V,\n\t) {}\n\n\tpublic register<K extends keyof Listeners<B>>(\n\t\tanchor: FlexTreeNode,\n\t\teventType: K,\n\t\teventTrees: BindPolicy[],\n\t\tlistener: B[K],\n\t): void {\n\t\t// TODO: validate BindPath semantics against the schema\n\t\tconst visitor = getOrCreate(this.visitors, anchor, () => {\n\t\t\tconst newVisitor = this.visitorFactory(anchor);\n\t\t\tthis.unregisterHandles.add(\n\t\t\t\tanchor.anchorNode.on(\"subtreeChanging\", (upPath: UpPath) => {\n\t\t\t\t\tassert(newVisitor !== undefined, 0x6dc /* visitor expected to be defined */);\n\t\t\t\t\tif (!this.visitorLocations.has(newVisitor)) {\n\t\t\t\t\t\tthis.visitorLocations.set(newVisitor, upPath);\n\t\t\t\t\t}\n\t\t\t\t\treturn newVisitor;\n\t\t\t\t}),\n\t\t\t);\n\t\t\treturn newVisitor;\n\t\t});\n\t\tconst contextType: BindingContextType = eventType as BindingContextType;\n\t\tthis.unregisterHandles.add(\n\t\t\tvisitor.registerListener(contextType, eventTrees, listener as unknown as Listener),\n\t\t);\n\t}\n\tpublic unregisterAll(): void {\n\t\tthis.unregisterHandles.forEach((h) => h());\n\t\tthis.unregisterHandles.clear();\n\t\tthis.visitors.forEach((v) => v.dispose());\n\t\tthis.visitors.clear();\n\t}\n\n\tpublic extractBindPaths(root: BindTree): BindPath[] {\n\t\tconst result: BindPath[] = [];\n\t\tconst depthFirst = (node: BindTree, path: PathStep[] = [root]): void => {\n\t\t\tif (node.children.size === 0) {\n\t\t\t\tresult.push(path);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (const [field, childNode] of node.children.entries()) {\n\t\t\t\tdepthFirst(childNode, [...path, { field, index: childNode.index }]);\n\t\t\t}\n\t\t};\n\t\tdepthFirst(root);\n\t\treturn result;\n\t}\n}\n\nclass BufferingDataBinder<E extends Listeners<E>>\n\textends AbstractDataBinder<\n\t\tOperationBinderEvents,\n\t\tBufferingPathVisitor,\n\t\tFlushableBinderOptions<E>\n\t>\n\timplements FlushableDataBinder<OperationBinderEvents>\n{\n\tprotected readonly view: Listenable<E>;\n\tprotected readonly autoFlushPolicy: keyof Listeners<E>;\n\tpublic constructor(view: Listenable<E>, options: FlushableBinderOptions<E>) {\n\t\tsuper(options, (anchor: FlexTreeNode) => new BufferingPathVisitor(options));\n\t\tthis.view = view;\n\t\tthis.autoFlushPolicy = options.autoFlushPolicy;\n\t\tif (options.autoFlush) {\n\t\t\tthis.enableAutoFlush();\n\t\t}\n\t}\n\n\tpublic flush(): FlushableDataBinder<OperationBinderEvents> {\n\t\tconst unsortedVisitors: BufferingPathVisitor[] = Array.from(this.visitorLocations.keys());\n\t\tconst sortFn = this.options.sortAnchorsFn ?? (() => 0);\n\t\tconst compareFn = (a: BufferingPathVisitor, b: BufferingPathVisitor): number => {\n\t\t\tconst pathA = this.visitorLocations.get(a);\n\t\t\tconst pathB = this.visitorLocations.get(b);\n\t\t\tassert(pathA !== undefined, 0x6dd /* pathA expected to be defined */);\n\t\t\tassert(pathB !== undefined, 0x6de /* pathB expected to be defined */);\n\t\t\treturn sortFn(pathA, pathB);\n\t\t};\n\t\tconst sortedVisitors: BufferingPathVisitor[] = nativeSort(unsortedVisitors, compareFn);\n\t\tfor (const visitor of sortedVisitors) {\n\t\t\tvisitor.flush();\n\t\t}\n\t\treturn this;\n\t}\n\n\tprivate enableAutoFlush(): FlushableDataBinder<OperationBinderEvents> {\n\t\tconst callbackFn = (() => {\n\t\t\tthis.flush();\n\t\t}) as E[keyof Listeners<E>];\n\t\tconst unregisterFlushing = this.view.on(this.autoFlushPolicy, callbackFn);\n\t\tthis.unregisterHandles.add(unregisterFlushing);\n\t\treturn this;\n\t}\n}\n\nclass DirectDataBinder<E extends Listeners<E>> extends AbstractDataBinder<\n\tOperationBinderEvents,\n\tDirectPathVisitor,\n\tBinderOptions\n> {\n\tpublic constructor(view: Listenable<E>, options: BinderOptions) {\n\t\tsuper(options, (anchor: FlexTreeNode) => new DirectPathVisitor(options));\n\t}\n}\n\nclass InvalidateDataBinder<E extends Listeners<E>>\n\textends AbstractDataBinder<\n\t\tInvalidationBinderEvents,\n\t\tInvalidatingPathVisitor,\n\t\tFlushableBinderOptions<E>\n\t>\n\timplements FlushableDataBinder<InvalidationBinderEvents>\n{\n\tprotected readonly view: Listenable<E>;\n\tprotected readonly autoFlushPolicy: keyof Listeners<E>;\n\tpublic constructor(view: Listenable<E>, options: FlushableBinderOptions<E>) {\n\t\tsuper(options, (anchor: FlexTreeNode) => new InvalidatingPathVisitor(options));\n\t\tthis.view = view;\n\t\tthis.autoFlushPolicy = options.autoFlushPolicy;\n\t\tif (options.autoFlush) {\n\t\t\tthis.enableAutoFlush();\n\t\t}\n\t}\n\tpublic flush(): FlushableDataBinder<InvalidationBinderEvents> {\n\t\tfor (const visitor of this.visitors.values()) {\n\t\t\tvisitor.flush();\n\t\t}\n\t\treturn this;\n\t}\n\tprivate enableAutoFlush(): FlushableDataBinder<InvalidationBinderEvents> {\n\t\tconst callbackFn = (() => {\n\t\t\tthis.flush();\n\t\t}) as E[keyof Listeners<E>];\n\t\tconst unregisterFlushing = this.view.on(this.autoFlushPolicy, callbackFn);\n\t\tthis.unregisterHandles.add(unregisterFlushing);\n\t\treturn this;\n\t}\n}\n\n/**\n * Compute a top-town {@link DownPath} from an {@link UpPath}.\n *\n * @internal\n */\nexport function toDownPath(upPath: UpPath): DownPath {\n\tconst downPath: UpPath[] = topDownPath(upPath);\n\tconst stepDownPath: PathStep[] = downPath.map((u) => {\n\t\treturn { field: u.parentField, index: u.parentIndex };\n\t});\n\tstepDownPath.shift(); // remove last step to the root node\n\treturn stepDownPath;\n}\n\n/**\n * Create a buffering data binder.\n *\n * @internal\n */\nexport function createDataBinderBuffering<E extends Listeners<E>>(\n\tview: Listenable<E>,\n\toptions: FlushableBinderOptions<E>,\n): FlushableDataBinder<OperationBinderEvents> {\n\treturn new BufferingDataBinder(view, options);\n}\n\n/**\n * Create a direct data binder.\n *\n * @internal\n */\nexport function createDataBinderDirect<E extends Listeners<E>>(\n\tview: Listenable<E>,\n\toptions: BinderOptions,\n): DataBinder<OperationBinderEvents> {\n\treturn new DirectDataBinder(view, options);\n}\n\n/**\n * Create an invalidating data binder.\n *\n * @internal\n */\nexport function createDataBinderInvalidating<E extends Listeners<E>>(\n\tview: Listenable<E>,\n\toptions: FlushableBinderOptions<E>,\n): FlushableDataBinder<InvalidationBinderEvents> {\n\treturn new InvalidateDataBinder(view, options);\n}\n\n/**\n * Create binder options. If not specified, the default values are:\n * - sortFn: no sorting\n *\n * @internal\n */\nexport function createBinderOptions({\n\tsortFn,\n}: { sortFn?: BinderEventsCompare }): BinderOptions {\n\treturn { sortFn };\n}\n\n/**\n * Create flushable binder options. If not specified, the default values are:\n * - sortFn: no sorting\n * - sortAnchorsFn: no sorting\n * - autoFlush: true\n *\n * @internal\n */\nexport function createFlushableBinderOptions<E extends Listeners<E>>({\n\tsortFn,\n\tsortAnchorsFn,\n\tautoFlush = true,\n\tautoFlushPolicy,\n}: {\n\tsortFn?: BinderEventsCompare;\n\tsortAnchorsFn?: AnchorsCompare;\n\tautoFlush?: boolean;\n\tautoFlushPolicy: keyof Listeners<E>;\n}): FlushableBinderOptions<E> {\n\treturn {\n\t\tsortFn,\n\t\tsortAnchorsFn,\n\t\tautoFlush,\n\t\tautoFlushPolicy,\n\t};\n}\n\n/**\n * Utility to create a compare function from a list of compare functions.\n *\n * @param fns - a list of compare functions\n * @returns a compare function that can be used for sorting\n * @internal\n */\nexport function comparePipeline<T>(...fns: CompareFunction<T>[]): CompareFunction<T> {\n\treturn (a: T, b: T): number => {\n\t\tfor (const fn of fns) {\n\t\t\tconst result = fn(a, b);\n\t\t\tif (result !== 0) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t};\n}\n\n/**\n * Native sorting algorithm.\n *\n * @param arr - the array to sort\n * @param compareFn - the compare function\n * @returns the sorted array\n */\nfunction nativeSort<T>(arr: T[], compareFn: CompareFunction<T>): T[] {\n\treturn [...arr].sort(compareFn);\n}\n\n/**\n * Compiles a (user friendly) syntax tree into the internal binding structure.\n * The syntax tree is a compact representation of related {@link BindPath}s.\n * The match policy can be specified. If not specified, the default value is \"path\".\n * @returns a {@link BindPolicy} object\n * @internal\n */\nexport function compileSyntaxTree(\n\tsyntaxTree: BindSyntaxTree,\n\tmatchPolicy?: MatchPolicy,\n): BindPolicy {\n\tconst entries = Object.entries(syntaxTree);\n\tif (entries.length === 1) {\n\t\tconst [fieldName, childNode] = entries[0];\n\t\tconst fieldKey: FieldKey = brand(fieldName);\n\t\tconst bindTree = compileSyntaxTreeNode(childNode as BindSyntaxTree, fieldKey);\n\t\treturn { matchPolicy: matchPolicy ?? \"path\", bindTree };\n\t} else throw new Error(\"Invalid BindSyntaxTree structure\");\n}\n\nfunction compileSyntaxTreeNode(node: BindSyntaxTree | true, parentField: FieldKey): BindTree {\n\tif (node === true) return { field: parentField, children: new Map() };\n\tconst pathStep: PathStep = {\n\t\tfield: parentField,\n\t\tindex: node[indexSymbol],\n\t};\n\tconst children = new Map<FieldKey, BindTree>();\n\tfor (const [key, value] of Object.entries(node)) {\n\t\tconst fieldKey: FieldKey = brand(key);\n\t\tchildren.set(fieldKey, compileSyntaxTreeNode(value, fieldKey));\n\t}\n\treturn {\n\t\t...pathStep,\n\t\tchildren,\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"editableTreeBinder.js","sourceRoot":"","sources":["../../src/feature-libraries/editableTreeBinder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,qCAAqC,CAAC;AAElE,OAAO,EASN,WAAW,GACX,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AA0JtD;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAkC5D;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IAC1B,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,cAAc;IAC5B,KAAK,EAAE,OAAO;CACL,CAAC;AAyDX;;;GAGG;AACH,MAAe,mBAAmB;IAGjC,YAAsC,OAAsB;QAAtB,YAAO,GAAP,OAAO,CAAe;QAFzC,wBAAmB,GACrC,IAAI,GAAG,EAAE,CAAC;IACoD,CAAC;IAEhE,gGAAgG;IACzF,WAAW,CAAC,OAA4B,IAAS,CAAC;IAClD,aAAa,CAAC,OAA4B,IAAS,CAAC;IACpD,YAAY,CAAC,MAA2B,EAAE,WAAwB,IAAS,CAAC;IAC5E,WAAW,CAAC,MAA2B,EAAE,WAAwB;QACvE,IAAI,CAAC,QAAQ,CACZ;YACC,MAAM,EAAE,WAAW,CAAC,MAAM;YAC1B,WAAW,EAAE,WAAW,CAAC,KAAK;YAC9B,WAAW,EAAE,WAAW,CAAC,KAAK;SAC9B,EACD,IAAI,CAAC,UAAU,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,CAAC;IAChE,CAAC;IACD,OAAO;QACN,GAAG,QAAQ;QACX,QAAQ;KACR,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype DetachedPlaceUpPath,\n\ttype DetachedRangeUpPath,\n\ttype FieldKey,\n\ttype PathVisitor,\n\ttype PlaceUpPath,\n\ttype ProtoNodes,\n\ttype RangeUpPath,\n\ttype UpPath,\n\ttopDownPath,\n} from \"../core/index.js\";\nimport type { Listeners, Listenable } from \"../events/index.js\";\nimport { brand, getOrCreate } from \"../util/index.js\";\n\nimport type { FlexTreeNode } from \"./flex-tree/index.js\";\n\n// TODO:\n// Tests for this file were removed along with the old editable-tree implementation in the commit that includes this note.\n// They were a bit heavily tied to the testing patterns specific to the old editable-tree and will need significant changes to be restored.\n\n/**\n * Binder events reflecting atomic data operations\n */\nexport interface OperationBinderEvents {\n\tremove(context: RemoveBindingContext): void;\n\tinsert(context: InsertBindingContext): void;\n\tbatch(context: BatchBindingContext): void;\n}\n\n/**\n * Binder events signaling state invalidation\n */\nexport interface InvalidationBinderEvents {\n\tinvalidation(context: InvalidationBindingContext): void;\n}\n\n/**\n * Compare function, generic.\n */\nexport type CompareFunction<T> = (a: T, b: T) => number;\n\n/**\n * Compare function for binder events.\n */\nexport type BinderEventsCompare = CompareFunction<VisitorBindingContext>;\n\n/**\n * Compare function for anchors.\n */\nexport type AnchorsCompare = CompareFunction<UpPath>;\n\n/**\n * Options to configure binder behavior.\n *\n * TODO: add more options:\n * `filterFn?: (context: BindingContext) => boolean;`\n * `pathPolicy?: \"relative\" | \"absolute\";`\n */\nexport interface BinderOptions {\n\tsortFn?: BinderEventsCompare;\n}\n\n/**\n * Specialized binder options for flushable binders.\n */\nexport interface FlushableBinderOptions<E extends Listeners<E>> extends BinderOptions {\n\tautoFlush: boolean;\n\tautoFlushPolicy: keyof Listeners<E>;\n\tsortAnchorsFn?: AnchorsCompare;\n}\n\n/**\n * Match policy for binding: subtree or path.\n *\n * - `subtree` match policy means that path filtering would return events matching the exact path and its subpaths,\n * ie. changes to (nested) children would be allowed to bubble up to parent listeners.\n * - {@link SubtreePolicy} match policy is equivalent with `subtree` match policy, while allowing to specify a maximum\n * depth for the subtree.\n * - `path` match policy means that path filtering would return events matching the _exact_ path only. In this case\n * _exact_ semantics include interpreting an `undefined` _index_ field in the {@link PathStep} as a wildcard.\n *\n */\nexport type MatchPolicy = SubtreePolicy | \"subtree\" | \"path\";\n\n/**\n * Subtree match policy where max depth can be specified.\n */\nexport interface SubtreePolicy {\n\tmaxDepth: number;\n}\n\n/**\n * The data binder interface\n */\nexport interface DataBinder<B extends OperationBinderEvents | InvalidationBinderEvents> {\n\t/**\n\t * Register an event listener\n\t *\n\t * @param anchor - The anchor to register the listener on\n\t * @param eventType - The {@link BindingType} to listen for.\n\t * @param eventTrees - The {@link BindPolicy}s to filter on.\n\t * @param listener - The listener to register\n\t */\n\tregister<K extends keyof Listeners<B>>(\n\t\tanchor: FlexTreeNode,\n\t\teventType: K,\n\t\teventTrees: BindPolicy[],\n\t\tlistener?: B[K],\n\t): void;\n\n\t/**\n\t * Unregister all listeners.\n\t */\n\tunregisterAll(): void;\n}\n\n/**\n * An interface describing the ability to flush.\n */\nexport interface Flushable<T> {\n\tflush(): T;\n}\n\n/**\n * An interface describing a flushable data binder.\n */\nexport interface FlushableDataBinder<\n\tB extends OperationBinderEvents | InvalidationBinderEvents,\n> extends DataBinder<B>,\n\t\tFlushable<FlushableDataBinder<B>> {}\n\n/**\n * A step in a bind path\n */\nexport interface PathStep {\n\t/**\n\t * The field being traversed\n\t */\n\treadonly field: FieldKey;\n\n\t/**\n\t * The index of the element being navigated to\n\t */\n\treadonly index?: number;\n}\n\n/**\n * The default type for a bind tree\n */\nexport type BindTreeDefault = BindTree;\n\n/**\n * A bind tree is a compact representation of related {@link BindPath}s.\n */\nexport interface BindTree<T = BindTreeDefault> extends PathStep {\n\treadonly children: Map<FieldKey, T>;\n}\n\n/**\n * A bind policy is a combination of a {@link BindTree} and a {@link MatchPolicy}.\n */\nexport interface BindPolicy {\n\treadonly bindTree: BindTree;\n\treadonly matchPolicy: MatchPolicy;\n}\n\n/**\n * Index symbol for syntax tree\n */\nexport const indexSymbol = Symbol(\"flex-tree-binder:index\");\n\n/**\n * A syntax node for the bind language\n *\n * The bind language is a compact representation of related {@link BindPath}s. It can be used to\n * simplify usage and construction of {@link BindTree}s.\n *\n * see {@link BindTree}\n * see {@link compileSyntaxTree}\n */\nexport interface BindSyntaxTree {\n\treadonly [indexSymbol]?: number;\n\treadonly [key: string]: true | BindSyntaxTree;\n}\n\n/**\n * A top down path in a bind or path tree is a collection of {@link PathStep}s\n *\n * see {@link BindTree}\n * see {@link UpPath}\n */\nexport type DownPath = PathStep[];\n\n/**\n * A bind path is a top down path in a bind tree\n */\nexport type BindPath = DownPath;\n\n/**\n * A binding context specialized for {@link PathVisitor} triggered binding events.\n */\nexport type VisitorBindingContext = RemoveBindingContext | InsertBindingContext;\n\n/**\n * Enumeration of binding categories\n */\nexport const BindingType = {\n\tRemove: \"remove\",\n\tInsert: \"insert\",\n\tInvalidation: \"invalidation\",\n\tBatch: \"batch\",\n} as const;\n\n/**\n * The type of a binding context\n */\nexport type BindingContextType = (typeof BindingType)[keyof typeof BindingType];\n\n/**\n * The binding context attribution common to all binding events\n */\nexport interface BindingContext {\n\treadonly type: BindingContextType;\n}\n\n/**\n * The binding context for a remove event\n */\nexport interface RemoveBindingContext extends BindingContext {\n\treadonly type: typeof BindingType.Remove;\n\treadonly path: UpPath;\n\treadonly count: number;\n}\n\n/**\n * The binding context for an insert event\n */\nexport interface InsertBindingContext extends BindingContext {\n\treadonly type: typeof BindingType.Insert;\n\treadonly path: UpPath;\n\treadonly content: ProtoNodes;\n}\n\n/**\n * The binding context for an invalidation event\n */\nexport interface InvalidationBindingContext extends BindingContext {\n\treadonly type: typeof BindingType.Invalidation;\n}\n\n/**\n * The binding context for a batch event\n */\nexport interface BatchBindingContext extends BindingContext {\n\treadonly type: typeof BindingType.Batch;\n\treadonly events: VisitorBindingContext[];\n}\n\n/**\n * The listener interface. Internal.\n */\ntype Listener = (...args: unknown[]) => void;\n\n/**\n * A call tree is a {@link BindTree} augmented with listeners. Internal.\n */\ntype CallTree = BindTree<CallTree> & { listeners: Set<Listener>; matchPolicy?: MatchPolicy };\n\n/**\n * A generic implementation of a {@link PathVisitor} enabling the registration of listeners\n * categorized by {@link BindingContextType} and {@link BindPolicy}.\n */\nabstract class AbstractPathVisitor implements PathVisitor {\n\tprotected readonly registeredListeners: Map<BindingContextType, Map<FieldKey, CallTree>> =\n\t\tnew Map();\n\tpublic constructor(protected readonly options: BinderOptions) {}\n\n\t// TODO: make these methods abstract and make AbstractPathVisitor implementations implement them\n\tpublic afterCreate(content: DetachedRangeUpPath): void {}\n\tpublic beforeDestroy(content: DetachedRangeUpPath): void {}\n\tpublic beforeAttach(source: DetachedRangeUpPath, destination: PlaceUpPath): void {}\n\tpublic afterAttach(source: DetachedPlaceUpPath, destination: RangeUpPath): void {\n\t\tthis.onInsert(\n\t\t\t{\n\t\t\t\tparent: destination.parent,\n\t\t\t\tparentField: destination.field,\n\t\t\t\tparentIndex: destination.start,\n\t\t\t},\n\t\t\tthis.getContent(destination),\n\t\t);\n\t}\n\tpublic beforeDetach(source: RangeUpPath, destination: DetachedPlaceUpPath): void {}\n\tpublic afterDetach(source: PlaceUpPath, destination: DetachedRangeUpPath): void {\n\t\tthis.onRemove(\n\t\t\t{\n\t\t\t\tparent: source.parent,\n\t\t\t\tparentField: source.field,\n\t\t\t\tparentIndex: source.index,\n\t\t\t},\n\t\t\tdestination.end - destination.start,\n\t\t);\n\t}\n\tpublic beforeReplace(\n\t\tnewContent: DetachedRangeUpPath,\n\t\toldContent: RangeUpPath,\n\t\toldContentDestination: DetachedPlaceUpPath,\n\t): void {}\n\tpublic afterReplace(\n\t\tnewContentSource: DetachedPlaceUpPath,\n\t\tnewContent: RangeUpPath,\n\t\toldContent: DetachedRangeUpPath,\n\t): void {\n\t\tthis.onRemove(\n\t\t\t{\n\t\t\t\tparent: newContent.parent,\n\t\t\t\tparentField: newContent.field,\n\t\t\t\tparentIndex: newContent.start,\n\t\t\t},\n\t\t\toldContent.end - oldContent.start,\n\t\t);\n\t\tthis.onInsert(\n\t\t\t{\n\t\t\t\tparent: newContent.parent,\n\t\t\t\tparentField: newContent.field,\n\t\t\t\tparentIndex: newContent.start,\n\t\t\t},\n\t\t\tthis.getContent(newContent),\n\t\t);\n\t}\n\tprotected getContent(range: RangeUpPath): ProtoNodes {\n\t\t// TODO: either lookup the content in the forest or stop providing the content in the events\n\t\treturn [];\n\t}\n\n\tpublic abstract onRemove(path: UpPath, count: number): void;\n\tpublic abstract onInsert(path: UpPath, content: ProtoNodes): void;\n\tpublic registerListener(\n\t\tcontextType: BindingContextType,\n\t\tpolicies: BindPolicy[],\n\t\tlistener: Listener,\n\t): () => void {\n\t\tconst contextRoots = getOrCreate(this.registeredListeners, contextType, () => new Map());\n\t\tpolicies.forEach((policy) => {\n\t\t\tconst tree = policy.bindTree;\n\t\t\tconst currentRoot = this.findRoot(contextType, tree.field);\n\t\t\tif (currentRoot === undefined) {\n\t\t\t\tconst newRoot: CallTree = {\n\t\t\t\t\tfield: tree.field,\n\t\t\t\t\tindex: tree.index,\n\t\t\t\t\tlisteners: new Set(),\n\t\t\t\t\tchildren: new Map(),\n\t\t\t\t\tmatchPolicy: policy.matchPolicy,\n\t\t\t\t};\n\t\t\t\tassert(contextRoots !== undefined, 0x6da /* expected contextRoots to be defined */);\n\t\t\t\tcontextRoots.set(tree.field, newRoot);\n\t\t\t\tthis.bindTree(contextType, tree, listener, newRoot);\n\t\t\t} else {\n\t\t\t\tthis.bindTree(contextType, tree, listener, currentRoot);\n\t\t\t}\n\t\t});\n\t\treturn () => {\n\t\t\tpolicies.forEach((policy) =>\n\t\t\t\tthis.unregisterListener(contextType, policy.bindTree, listener),\n\t\t\t);\n\t\t};\n\t}\n\n\tprivate bindTree(\n\t\tcontextType: BindingContextType,\n\t\ttree: BindTree,\n\t\tlistener: Listener,\n\t\tcallTree: CallTree,\n\t): void {\n\t\tif (tree.children.size === 0) {\n\t\t\tcallTree.listeners.add(listener);\n\t\t} else {\n\t\t\ttree.children.forEach((childTree, fieldKey) => {\n\t\t\t\tconst childCallTree = getOrCreate(callTree.children, fieldKey, () => {\n\t\t\t\t\tconst newChildCallTree: CallTree = {\n\t\t\t\t\t\tfield: fieldKey,\n\t\t\t\t\t\tindex: childTree.index,\n\t\t\t\t\t\tlisteners: new Set(),\n\t\t\t\t\t\tchildren: new Map(),\n\t\t\t\t\t};\n\t\t\t\t\tcallTree.children.set(fieldKey, newChildCallTree);\n\t\t\t\t\treturn newChildCallTree;\n\t\t\t\t});\n\t\t\t\tthis.bindTree(contextType, childTree, listener, childCallTree);\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate findRoot(contextType: BindingContextType, field: FieldKey): CallTree | undefined {\n\t\treturn this.registeredListeners.get(contextType)?.get(field);\n\t}\n\n\tprivate unregisterListener(\n\t\tcontextType: BindingContextType,\n\t\ttree: BindTree,\n\t\tlistener: Listener,\n\t\tcallTree?: CallTree,\n\t): void {\n\t\tconst foundTree = callTree ?? this.findRoot(contextType, tree.field);\n\t\tif (foundTree !== undefined) {\n\t\t\tif (tree.children.size === 0) {\n\t\t\t\tfoundTree.listeners.delete(listener);\n\t\t\t} else {\n\t\t\t\ttree.children.forEach((childTree, fieldKey) => {\n\t\t\t\t\tassert(foundTree !== undefined, 0x6db /* expected foundTree to be defined */);\n\t\t\t\t\tconst childCallTree = foundTree.children.get(fieldKey);\n\t\t\t\t\tif (childCallTree !== undefined) {\n\t\t\t\t\t\tthis.unregisterListener(contextType, childTree, listener, childCallTree);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected getListeners(\n\t\tcontextType: BindingContextType,\n\t\tdownPath: DownPath,\n\t): Set<Listener> | undefined {\n\t\tconst firstDownPath = downPath[0] ?? oob();\n\t\tconst foundRoot = this.findRoot(contextType, firstDownPath.field);\n\t\tif (foundRoot === undefined) {\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\tconst subtreeMatch = (\n\t\t\t\tsubtreePolicy: SubtreePolicy | undefined,\n\t\t\t\tdepth: number,\n\t\t\t): boolean => {\n\t\t\t\tif (subtreePolicy?.maxDepth !== undefined && depth > subtreePolicy.maxDepth) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t};\n\t\t\tconst accumulateMatching = (\n\t\t\t\ttreeNode: CallTree,\n\t\t\t\tindex: number,\n\t\t\t\tonMatch: (index: number, treeNode: CallTree) => void,\n\t\t\t): void => {\n\t\t\t\tconst step = downPath[index];\n\t\t\t\tif (\n\t\t\t\t\tstep === undefined ||\n\t\t\t\t\ttreeNode.field !== step.field ||\n\t\t\t\t\t(treeNode.index !== undefined && step.index !== treeNode.index)\n\t\t\t\t) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tfor (const child of treeNode.children.values()) {\n\t\t\t\t\taccumulateMatching(child, index + 1, onMatch);\n\t\t\t\t}\n\t\t\t\tonMatch(index, treeNode);\n\t\t\t};\n\t\t\tconst matchedNodes: Set<Listener> = new Set();\n\t\t\tif (foundRoot.matchPolicy === \"path\") {\n\t\t\t\taccumulateMatching(foundRoot, 0, (index: number, treeNode: CallTree): void => {\n\t\t\t\t\tif (index === downPath.length - 1) {\n\t\t\t\t\t\ttreeNode.listeners.forEach((listener) => matchedNodes.add(listener));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else if (foundRoot.matchPolicy === \"subtree\") {\n\t\t\t\taccumulateMatching(foundRoot, 0, (index: number, treeNode: CallTree): void => {\n\t\t\t\t\ttreeNode.listeners.forEach((listener) => matchedNodes.add(listener));\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst matchPolicy: SubtreePolicy | undefined = foundRoot.matchPolicy;\n\t\t\t\taccumulateMatching(foundRoot, 0, (index: number, treeNode: CallTree): void => {\n\t\t\t\t\tif (subtreeMatch(matchPolicy, downPath.length - 1)) {\n\t\t\t\t\t\ttreeNode.listeners.forEach((listener) => matchedNodes.add(listener));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn matchedNodes.size > 0 ? matchedNodes : undefined;\n\t\t}\n\t}\n\n\tpublic hasRegisteredContextType(contextType: BindingContextType): boolean {\n\t\treturn this.registeredListeners.has(contextType);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.registeredListeners.clear();\n\t}\n}\n\n/**\n * A visitor that invokes listeners immediately when a path is traversed.\n */\nclass DirectPathVisitor extends AbstractPathVisitor {\n\tprivate processListeners(path: UpPath, listeners: Set<Listener>, otherArgs: object): void {\n\t\tfor (const listener of listeners) {\n\t\t\tlistener({\n\t\t\t\tpath,\n\t\t\t\t...otherArgs,\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate processRegisteredPaths(\n\t\tpath: UpPath,\n\t\ttype: BindingContextType,\n\t\totherArgs: object,\n\t): void {\n\t\tconst current = toDownPath(path);\n\t\tconst listeners = this.getListeners(type, current);\n\t\tif (listeners !== undefined) {\n\t\t\tthis.processListeners(path, listeners, otherArgs);\n\t\t}\n\t}\n\n\tpublic onRemove(path: UpPath, count: number): void {\n\t\tthis.processRegisteredPaths(path, BindingType.Remove, {\n\t\t\tcount,\n\t\t\ttype: BindingType.Remove,\n\t\t});\n\t}\n\n\tpublic onInsert(path: UpPath, content: ProtoNodes): void {\n\t\tthis.processRegisteredPaths(path, BindingType.Insert, {\n\t\t\tcontent,\n\t\t\ttype: BindingType.Insert,\n\t\t});\n\t}\n}\n\n/**\n * A visitor that invokes listeners only once when flushed if any modifications detected on the registered paths.\n */\nclass InvalidatingPathVisitor\n\textends AbstractPathVisitor\n\timplements Flushable<InvalidatingPathVisitor>\n{\n\tprivate readonly listeners: Set<Listener> = new Set();\n\n\tprivate processRegisteredPaths(path: UpPath): void {\n\t\tconst current = toDownPath(path);\n\t\tconst listeners = this.getListeners(BindingType.Invalidation, current);\n\t\tif (listeners !== undefined) {\n\t\t\tfor (const listener of listeners) {\n\t\t\t\tthis.listeners.add(listener);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic onRemove(path: UpPath, count: number): void {\n\t\tthis.processRegisteredPaths(path);\n\t}\n\n\tpublic onInsert(path: UpPath, content: ProtoNodes): void {\n\t\tthis.processRegisteredPaths(path);\n\t}\n\n\tpublic flush(): InvalidatingPathVisitor {\n\t\tfor (const listener of this.listeners) {\n\t\t\tlistener({\n\t\t\t\ttype: BindingType.Invalidation,\n\t\t\t});\n\t\t}\n\t\tthis.listeners.clear();\n\t\treturn this;\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis.flush();\n\t\tsuper.dispose();\n\t}\n}\n\ntype CallableBindingContext = VisitorBindingContext & {\n\tlisteners: Set<Listener>;\n};\n\n/**\n * A visitor that buffers all events which match the registered event categories and corresponding paths.\n * Listeners are invoked when flushed. Flushing has also the ability to sort and batch the events.\n */\nclass BufferingPathVisitor\n\textends AbstractPathVisitor\n\timplements Flushable<BufferingPathVisitor>\n{\n\tprivate readonly eventQueue: CallableBindingContext[] = [];\n\n\tpublic onRemove(path: UpPath, count: number): void {\n\t\tconst current = toDownPath(path);\n\t\tconst listeners = this.getListeners(BindingType.Remove, current);\n\t\tif (listeners !== undefined) {\n\t\t\tthis.eventQueue.push({\n\t\t\t\tpath,\n\t\t\t\tcount,\n\t\t\t\ttype: BindingType.Remove,\n\t\t\t\tlisteners,\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic onInsert(path: UpPath, content: ProtoNodes): void {\n\t\tconst current = toDownPath(path);\n\t\tconst listeners = this.getListeners(BindingType.Insert, current);\n\t\tif (listeners !== undefined) {\n\t\t\tthis.eventQueue.push({\n\t\t\t\tpath,\n\t\t\t\tcontent,\n\t\t\t\ttype: BindingType.Insert,\n\t\t\t\tlisteners,\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic flush(): BufferingPathVisitor {\n\t\tconst sortedQueue: CallableBindingContext[] = nativeSort(\n\t\t\tthis.eventQueue,\n\t\t\tthis.options.sortFn ?? (() => 0),\n\t\t);\n\t\tconst batchEventIndices = new Set<number>();\n\t\tconst batchEvents: CallableBindingContext[] = [];\n\t\tconst collected = new Set<Listener>();\n\t\tif (this.hasRegisteredContextType(BindingType.Batch)) {\n\t\t\tfor (const [i, event] of sortedQueue.entries()) {\n\t\t\t\tconst current = toDownPath(event.path);\n\t\t\t\tconst listeners = this.getListeners(BindingType.Batch, current);\n\t\t\t\tif (listeners !== undefined && listeners.size > 0) {\n\t\t\t\t\tfor (const listener of listeners) {\n\t\t\t\t\t\tcollected.add(listener);\n\t\t\t\t\t}\n\t\t\t\t\tbatchEvents.push(event);\n\t\t\t\t\tbatchEventIndices.add(i);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (const listener of collected) {\n\t\t\tlistener({\n\t\t\t\ttype: BindingType.Batch,\n\t\t\t\tevents: batchEvents,\n\t\t\t});\n\t\t}\n\t\tfor (const [i, { listeners, ...context }] of sortedQueue.entries()) {\n\t\t\tif (batchEventIndices.has(i)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfor (const listener of listeners) {\n\t\t\t\tlistener({ ...context });\n\t\t\t}\n\t\t}\n\t\tthis.eventQueue.length = 0;\n\t\treturn this;\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis.flush();\n\t\tsuper.dispose();\n\t}\n}\n\nclass AbstractDataBinder<\n\tB extends OperationBinderEvents | InvalidationBinderEvents,\n\tV extends AbstractPathVisitor,\n\tO extends BinderOptions,\n> implements DataBinder<B>\n{\n\tprotected readonly visitors = new Map<FlexTreeNode, V>();\n\tprotected readonly visitorLocations = new Map<V, UpPath>();\n\tprotected readonly unregisterHandles = new Set<() => void>();\n\tpublic constructor(\n\t\tprotected readonly options: O,\n\t\tprotected readonly visitorFactory: (anchor: FlexTreeNode) => V,\n\t) {}\n\n\tpublic register<K extends keyof Listeners<B>>(\n\t\tanchor: FlexTreeNode,\n\t\teventType: K,\n\t\teventTrees: BindPolicy[],\n\t\tlistener: B[K],\n\t): void {\n\t\t// TODO: validate BindPath semantics against the schema\n\t\tconst visitor = getOrCreate(this.visitors, anchor, () => {\n\t\t\tconst newVisitor = this.visitorFactory(anchor);\n\t\t\tthis.unregisterHandles.add(\n\t\t\t\tanchor.anchorNode.on(\"subtreeChanging\", (upPath: UpPath) => {\n\t\t\t\t\tassert(newVisitor !== undefined, 0x6dc /* visitor expected to be defined */);\n\t\t\t\t\tif (!this.visitorLocations.has(newVisitor)) {\n\t\t\t\t\t\tthis.visitorLocations.set(newVisitor, upPath);\n\t\t\t\t\t}\n\t\t\t\t\treturn newVisitor;\n\t\t\t\t}),\n\t\t\t);\n\t\t\treturn newVisitor;\n\t\t});\n\t\tconst contextType: BindingContextType = eventType as BindingContextType;\n\t\tthis.unregisterHandles.add(\n\t\t\tvisitor.registerListener(contextType, eventTrees, listener as unknown as Listener),\n\t\t);\n\t}\n\tpublic unregisterAll(): void {\n\t\tthis.unregisterHandles.forEach((h) => h());\n\t\tthis.unregisterHandles.clear();\n\t\tthis.visitors.forEach((v) => v.dispose());\n\t\tthis.visitors.clear();\n\t}\n\n\tpublic extractBindPaths(root: BindTree): BindPath[] {\n\t\tconst result: BindPath[] = [];\n\t\tconst depthFirst = (node: BindTree, path: PathStep[] = [root]): void => {\n\t\t\tif (node.children.size === 0) {\n\t\t\t\tresult.push(path);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (const [field, childNode] of node.children.entries()) {\n\t\t\t\tdepthFirst(childNode, [...path, { field, index: childNode.index }]);\n\t\t\t}\n\t\t};\n\t\tdepthFirst(root);\n\t\treturn result;\n\t}\n}\n\nclass BufferingDataBinder<E extends Listeners<E>>\n\textends AbstractDataBinder<\n\t\tOperationBinderEvents,\n\t\tBufferingPathVisitor,\n\t\tFlushableBinderOptions<E>\n\t>\n\timplements FlushableDataBinder<OperationBinderEvents>\n{\n\tprotected readonly view: Listenable<E>;\n\tprotected readonly autoFlushPolicy: keyof Listeners<E>;\n\tpublic constructor(view: Listenable<E>, options: FlushableBinderOptions<E>) {\n\t\tsuper(options, (anchor: FlexTreeNode) => new BufferingPathVisitor(options));\n\t\tthis.view = view;\n\t\tthis.autoFlushPolicy = options.autoFlushPolicy;\n\t\tif (options.autoFlush) {\n\t\t\tthis.enableAutoFlush();\n\t\t}\n\t}\n\n\tpublic flush(): FlushableDataBinder<OperationBinderEvents> {\n\t\tconst unsortedVisitors: BufferingPathVisitor[] = Array.from(this.visitorLocations.keys());\n\t\tconst sortFn = this.options.sortAnchorsFn ?? (() => 0);\n\t\tconst compareFn = (a: BufferingPathVisitor, b: BufferingPathVisitor): number => {\n\t\t\tconst pathA = this.visitorLocations.get(a);\n\t\t\tconst pathB = this.visitorLocations.get(b);\n\t\t\tassert(pathA !== undefined, 0x6dd /* pathA expected to be defined */);\n\t\t\tassert(pathB !== undefined, 0x6de /* pathB expected to be defined */);\n\t\t\treturn sortFn(pathA, pathB);\n\t\t};\n\t\tconst sortedVisitors: BufferingPathVisitor[] = nativeSort(unsortedVisitors, compareFn);\n\t\tfor (const visitor of sortedVisitors) {\n\t\t\tvisitor.flush();\n\t\t}\n\t\treturn this;\n\t}\n\n\tprivate enableAutoFlush(): FlushableDataBinder<OperationBinderEvents> {\n\t\tconst callbackFn = (() => {\n\t\t\tthis.flush();\n\t\t}) as E[keyof Listeners<E>];\n\t\tconst unregisterFlushing = this.view.on(this.autoFlushPolicy, callbackFn);\n\t\tthis.unregisterHandles.add(unregisterFlushing);\n\t\treturn this;\n\t}\n}\n\nclass DirectDataBinder<E extends Listeners<E>> extends AbstractDataBinder<\n\tOperationBinderEvents,\n\tDirectPathVisitor,\n\tBinderOptions\n> {\n\tpublic constructor(view: Listenable<E>, options: BinderOptions) {\n\t\tsuper(options, (anchor: FlexTreeNode) => new DirectPathVisitor(options));\n\t}\n}\n\nclass InvalidateDataBinder<E extends Listeners<E>>\n\textends AbstractDataBinder<\n\t\tInvalidationBinderEvents,\n\t\tInvalidatingPathVisitor,\n\t\tFlushableBinderOptions<E>\n\t>\n\timplements FlushableDataBinder<InvalidationBinderEvents>\n{\n\tprotected readonly view: Listenable<E>;\n\tprotected readonly autoFlushPolicy: keyof Listeners<E>;\n\tpublic constructor(view: Listenable<E>, options: FlushableBinderOptions<E>) {\n\t\tsuper(options, (anchor: FlexTreeNode) => new InvalidatingPathVisitor(options));\n\t\tthis.view = view;\n\t\tthis.autoFlushPolicy = options.autoFlushPolicy;\n\t\tif (options.autoFlush) {\n\t\t\tthis.enableAutoFlush();\n\t\t}\n\t}\n\tpublic flush(): FlushableDataBinder<InvalidationBinderEvents> {\n\t\tfor (const visitor of this.visitors.values()) {\n\t\t\tvisitor.flush();\n\t\t}\n\t\treturn this;\n\t}\n\tprivate enableAutoFlush(): FlushableDataBinder<InvalidationBinderEvents> {\n\t\tconst callbackFn = (() => {\n\t\t\tthis.flush();\n\t\t}) as E[keyof Listeners<E>];\n\t\tconst unregisterFlushing = this.view.on(this.autoFlushPolicy, callbackFn);\n\t\tthis.unregisterHandles.add(unregisterFlushing);\n\t\treturn this;\n\t}\n}\n\n/**\n * Compute a top-town {@link DownPath} from an {@link UpPath}.\n */\nexport function toDownPath(upPath: UpPath): DownPath {\n\tconst downPath: UpPath[] = topDownPath(upPath);\n\tconst stepDownPath: PathStep[] = downPath.map((u) => {\n\t\treturn { field: u.parentField, index: u.parentIndex };\n\t});\n\tstepDownPath.shift(); // remove last step to the root node\n\treturn stepDownPath;\n}\n\n/**\n * Create a buffering data binder.\n */\nexport function createDataBinderBuffering<E extends Listeners<E>>(\n\tview: Listenable<E>,\n\toptions: FlushableBinderOptions<E>,\n): FlushableDataBinder<OperationBinderEvents> {\n\treturn new BufferingDataBinder(view, options);\n}\n\n/**\n * Create a direct data binder.\n */\nexport function createDataBinderDirect<E extends Listeners<E>>(\n\tview: Listenable<E>,\n\toptions: BinderOptions,\n): DataBinder<OperationBinderEvents> {\n\treturn new DirectDataBinder(view, options);\n}\n\n/**\n * Create an invalidating data binder.\n */\nexport function createDataBinderInvalidating<E extends Listeners<E>>(\n\tview: Listenable<E>,\n\toptions: FlushableBinderOptions<E>,\n): FlushableDataBinder<InvalidationBinderEvents> {\n\treturn new InvalidateDataBinder(view, options);\n}\n\n/**\n * Create binder options. If not specified, the default values are:\n * - sortFn: no sorting\n */\nexport function createBinderOptions({\n\tsortFn,\n}: { sortFn?: BinderEventsCompare }): BinderOptions {\n\treturn { sortFn };\n}\n\n/**\n * Create flushable binder options. If not specified, the default values are:\n * - sortFn: no sorting\n * - sortAnchorsFn: no sorting\n * - autoFlush: true\n */\nexport function createFlushableBinderOptions<E extends Listeners<E>>({\n\tsortFn,\n\tsortAnchorsFn,\n\tautoFlush = true,\n\tautoFlushPolicy,\n}: {\n\tsortFn?: BinderEventsCompare;\n\tsortAnchorsFn?: AnchorsCompare;\n\tautoFlush?: boolean;\n\tautoFlushPolicy: keyof Listeners<E>;\n}): FlushableBinderOptions<E> {\n\treturn {\n\t\tsortFn,\n\t\tsortAnchorsFn,\n\t\tautoFlush,\n\t\tautoFlushPolicy,\n\t};\n}\n\n/**\n * Utility to create a compare function from a list of compare functions.\n *\n * @param fns - a list of compare functions\n * @returns a compare function that can be used for sorting\n */\nexport function comparePipeline<T>(...fns: CompareFunction<T>[]): CompareFunction<T> {\n\treturn (a: T, b: T): number => {\n\t\tfor (const fn of fns) {\n\t\t\tconst result = fn(a, b);\n\t\t\tif (result !== 0) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t};\n}\n\n/**\n * Native sorting algorithm.\n *\n * @param arr - the array to sort\n * @param compareFn - the compare function\n * @returns the sorted array\n */\nfunction nativeSort<T>(arr: T[], compareFn: CompareFunction<T>): T[] {\n\treturn [...arr].sort(compareFn);\n}\n\n/**\n * Compiles a (user friendly) syntax tree into the internal binding structure.\n * The syntax tree is a compact representation of related {@link BindPath}s.\n * The match policy can be specified. If not specified, the default value is \"path\".\n * @returns a {@link BindPolicy} object\n */\nexport function compileSyntaxTree(\n\tsyntaxTree: BindSyntaxTree,\n\tmatchPolicy?: MatchPolicy,\n): BindPolicy {\n\tconst entries = Object.entries(syntaxTree);\n\tif (entries.length === 1) {\n\t\tconst [fieldName, childNode] = entries[0] ?? oob();\n\t\tconst fieldKey: FieldKey = brand(fieldName);\n\t\tconst bindTree = compileSyntaxTreeNode(childNode as BindSyntaxTree, fieldKey);\n\t\treturn { matchPolicy: matchPolicy ?? \"path\", bindTree };\n\t} else throw new Error(\"Invalid BindSyntaxTree structure\");\n}\n\nfunction compileSyntaxTreeNode(node: BindSyntaxTree | true, parentField: FieldKey): BindTree {\n\tif (node === true) return { field: parentField, children: new Map() };\n\tconst pathStep: PathStep = {\n\t\tfield: parentField,\n\t\tindex: node[indexSymbol],\n\t};\n\tconst children = new Map<FieldKey, BindTree>();\n\tfor (const [key, value] of Object.entries(node)) {\n\t\tconst fieldKey: FieldKey = brand(key);\n\t\tchildren.set(fieldKey, compileSyntaxTreeNode(value, fieldKey));\n\t}\n\treturn {\n\t\t...pathStep,\n\t\tchildren,\n\t};\n}\n"]}
|