@fluidframework/tree 2.74.0-365691 → 2.74.0-368706
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/.vscode/settings.json +2 -2
- package/api-report/tree.alpha.api.md +119 -85
- package/api-report/tree.beta.api.md +0 -1
- package/api-report/tree.legacy.beta.api.md +0 -1
- package/api-report/tree.legacy.public.api.md +0 -1
- package/api-report/tree.public.api.md +0 -1
- package/dist/alpha.d.ts +3 -2
- package/dist/codec/codec.d.ts +14 -1
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +11 -0
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/versioned/codec.d.ts +1 -1
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js.map +1 -1
- package/dist/codec/versioned/format.d.ts +4 -1
- package/dist/codec/versioned/format.d.ts.map +1 -1
- package/dist/codec/versioned/format.js +4 -1
- package/dist/codec/versioned/format.js.map +1 -1
- package/dist/core/change-family/changeFamily.d.ts +4 -1
- package/dist/core/change-family/changeFamily.d.ts.map +1 -1
- package/dist/core/change-family/changeFamily.js.map +1 -1
- package/dist/core/change-family/index.d.ts +1 -1
- package/dist/core/change-family/index.d.ts.map +1 -1
- package/dist/core/change-family/index.js.map +1 -1
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +7 -4
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/changeRebaser.d.ts +6 -1
- 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 +2 -1
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +2 -1
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +5 -1
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/rebase/utils.d.ts.map +1 -1
- package/dist/core/rebase/utils.js +25 -7
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts +40 -13
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +21 -12
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/index.d.ts +4 -3
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js +6 -2
- package/dist/core/tree/index.js.map +1 -1
- package/dist/core/tree/pathTree.d.ts +11 -3
- package/dist/core/tree/pathTree.d.ts.map +1 -1
- package/dist/core/tree/pathTree.js +14 -2
- package/dist/core/tree/pathTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js +7 -0
- package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +4 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
- package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +90 -42
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +234 -69
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +4 -4
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +33 -28
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +2 -1
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js +4 -2
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +36 -0
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js +126 -0
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
- package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +7 -6
- package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js +15 -0
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
- package/dist/feature-libraries/deltaUtils.d.ts +1 -0
- package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
- package/dist/feature-libraries/deltaUtils.js +6 -1
- package/dist/feature-libraries/deltaUtils.js.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js +41 -11
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +9 -0
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +6 -0
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +8 -7
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +37 -8
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts +2 -2
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js +4 -4
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +9 -13
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +21 -26
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/format.d.ts +41 -5
- package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/format.js +7 -7
- package/dist/feature-libraries/forest-summary/format.js.map +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +11 -9
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +16 -29
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/dist/feature-libraries/forest-summary/index.d.ts +2 -1
- package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/index.js +3 -2
- package/dist/feature-libraries/forest-summary/index.js.map +1 -1
- package/dist/feature-libraries/forest-summary/summaryTypes.d.ts +47 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.js +57 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
- package/dist/feature-libraries/index.d.ts +4 -4
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +7 -3
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.js +1 -0
- package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.js +2 -2
- package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.d.ts +18 -2
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +54 -3
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js +4 -7
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +20 -52
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.js +0 -21
- package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +7 -10
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js +2 -2
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +5 -5
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +12 -8
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +17 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +388 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +17 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +413 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +8 -284
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +48 -15
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1298 -465
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/{modularChangeFormat.d.ts → modularChangeFormatV1.d.ts} +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +5 -5
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +146 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +32 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +50 -10
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js +24 -3
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/dist/feature-libraries/optional-field/index.d.ts +2 -2
- package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/index.js +1 -2
- package/dist/feature-libraries/optional-field/index.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.d.ts +5 -26
- package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.js +217 -451
- package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
- package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +57 -28
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +42 -16
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.d.ts +6 -7
- package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +80 -256
- package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
- package/dist/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
- package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
- package/dist/feature-libraries/sequence-field/index.d.ts +2 -3
- package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/index.js +1 -3
- package/dist/feature-libraries/sequence-field/index.js.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.d.ts +3 -3
- package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.js +65 -167
- package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
- package/dist/feature-libraries/sequence-field/markQueue.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
- package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/moveEffectTable.js +7 -86
- package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -3
- package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.js +106 -112
- 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 -33
- package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +0 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +358 -179
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +20 -60
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +14 -109
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/dist/feature-libraries/sequence-field/types.d.ts +30 -59
- package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/types.js.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.d.ts +15 -24
- package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.js +111 -299
- package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.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/shared-tree/independentView.d.ts +1 -1
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +1 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts +4 -4
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +2 -1
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +1 -5
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +32 -33
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +11 -5
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +14 -4
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +1 -0
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js +25 -11
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.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 +16 -6
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js +13 -6
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +1 -1
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +12 -10
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +66 -17
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +3 -2
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +4 -3
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts +2 -2
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +9 -9
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts +4 -0
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +16 -6
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/{lib/shared-tree-core/editManagerCodecsV5.d.ts → dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +7 -7
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +20 -6
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +22 -7
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.js +1 -0
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/editManagerSummarizer.d.ts +29 -9
- package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +41 -13
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +5 -3
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +8 -1
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/{lib/shared-tree-core/messageCodecV5.d.ts → dist/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
- package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +6 -6
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/messageCodecs.d.ts +4 -0
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +16 -6
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +20 -6
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormat.js +22 -7
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js +8 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/{messageFormatV5.d.ts → messageFormatVSharedBranches.d.ts} +5 -7
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
- package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/sharedTreeCore.d.ts +14 -47
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +30 -18
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/summaryTypes.d.ts +94 -0
- package/dist/shared-tree-core/summaryTypes.d.ts.map +1 -0
- package/dist/shared-tree-core/summaryTypes.js +47 -0
- package/dist/shared-tree-core/summaryTypes.js.map +1 -0
- package/dist/shared-tree-core/versionedSummarizer.d.ts +67 -0
- package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
- package/dist/shared-tree-core/versionedSummarizer.js +63 -0
- package/dist/shared-tree-core/versionedSummarizer.js.map +1 -0
- package/dist/simple-tree/api/configuration.d.ts +3 -26
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js +10 -21
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/dirtyIndex.d.ts +11 -0
- package/dist/simple-tree/api/dirtyIndex.d.ts.map +1 -1
- package/dist/simple-tree/api/dirtyIndex.js +7 -0
- package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/dist/simple-tree/api/discrepancies.js.map +1 -1
- package/dist/simple-tree/api/getSimpleSchema.d.ts +3 -3
- package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/getSimpleSchema.js +9 -3
- package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.js +7 -0
- package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +3 -4
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +4 -5
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js +0 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts +6 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +5 -0
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/schemaStatics.d.ts +12 -12
- package/dist/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
- package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.js +18 -6
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +13 -8
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +3 -3
- package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.d.ts +2 -2
- package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
- package/dist/simple-tree/core/allowedTypes.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +1 -1
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +2 -3
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/toStored.d.ts +17 -15
- package/dist/simple-tree/core/toStored.d.ts.map +1 -1
- package/dist/simple-tree/core/toStored.js +5 -40
- package/dist/simple-tree/core/toStored.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +59 -8
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/walkSchema.js +4 -0
- package/dist/simple-tree/core/walkSchema.js.map +1 -1
- package/dist/simple-tree/createContext.d.ts.map +1 -1
- package/dist/simple-tree/createContext.js +20 -5
- package/dist/simple-tree/createContext.js.map +1 -1
- package/dist/simple-tree/fieldSchema.d.ts +7 -7
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/fieldSchema.js.map +1 -1
- package/dist/simple-tree/index.d.ts +8 -7
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +15 -12
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +5 -5
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +5 -3
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/common.js +1 -1
- package/dist/simple-tree/node-kinds/common.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +2 -2
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +18 -18
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.js +4 -2
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/dist/simple-tree/prepareForInsertion.d.ts +54 -47
- package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/dist/simple-tree/prepareForInsertion.js +183 -125
- package/dist/simple-tree/prepareForInsertion.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +55 -23
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchema.js +17 -0
- package/dist/simple-tree/simpleSchema.js.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.js +8 -1
- package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts +58 -11
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +205 -30
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/treeSchema.d.ts +23 -0
- package/dist/simple-tree/treeSchema.d.ts.map +1 -0
- package/dist/simple-tree/treeSchema.js +25 -0
- package/dist/simple-tree/treeSchema.js.map +1 -0
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +29 -11
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/dist/tableSchema.d.ts +117 -63
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +159 -58
- package/dist/tableSchema.js.map +1 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +17 -3
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/index.d.ts +2 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +4 -1
- package/dist/util/index.js.map +1 -1
- package/dist/util/rangeMap.d.ts +24 -12
- package/dist/util/rangeMap.d.ts.map +1 -1
- package/dist/util/rangeMap.js +46 -6
- package/dist/util/rangeMap.js.map +1 -1
- package/dist/util/readSnapshotBlob.d.ts +13 -0
- package/dist/util/readSnapshotBlob.d.ts.map +1 -0
- package/dist/util/readSnapshotBlob.js +18 -0
- package/dist/util/readSnapshotBlob.js.map +1 -0
- package/lib/alpha.d.ts +3 -2
- package/lib/codec/codec.d.ts +14 -1
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +11 -0
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/versioned/codec.d.ts +1 -1
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js.map +1 -1
- package/lib/codec/versioned/format.d.ts +4 -1
- package/lib/codec/versioned/format.d.ts.map +1 -1
- package/lib/codec/versioned/format.js +4 -1
- package/lib/codec/versioned/format.js.map +1 -1
- package/lib/core/change-family/changeFamily.d.ts +4 -1
- package/lib/core/change-family/changeFamily.d.ts.map +1 -1
- package/lib/core/change-family/changeFamily.js.map +1 -1
- package/lib/core/change-family/index.d.ts +1 -1
- package/lib/core/change-family/index.d.ts.map +1 -1
- package/lib/core/change-family/index.js.map +1 -1
- package/lib/core/index.d.ts +3 -3
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +2 -2
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/changeRebaser.d.ts +6 -1
- 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 +2 -1
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +3 -0
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/rebase/utils.d.ts.map +1 -1
- package/lib/core/rebase/utils.js +25 -7
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts +40 -13
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +22 -13
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/index.d.ts +4 -3
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +3 -2
- package/lib/core/tree/index.js.map +1 -1
- package/lib/core/tree/pathTree.d.ts +11 -3
- package/lib/core/tree/pathTree.d.ts.map +1 -1
- package/lib/core/tree/pathTree.js +12 -1
- package/lib/core/tree/pathTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js +8 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +4 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
- package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +90 -42
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +232 -69
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +4 -4
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +34 -29
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +2 -1
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js +2 -1
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +36 -0
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js +122 -0
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
- package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +7 -6
- package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js +15 -0
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
- package/lib/feature-libraries/deltaUtils.d.ts +1 -0
- package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
- package/lib/feature-libraries/deltaUtils.js +5 -1
- package/lib/feature-libraries/deltaUtils.js.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js +38 -8
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +9 -0
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +6 -0
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +8 -7
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +38 -9
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts +2 -2
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js +5 -5
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +9 -13
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +17 -22
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/format.d.ts +41 -5
- package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/format.js +3 -3
- package/lib/feature-libraries/forest-summary/format.js.map +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +11 -9
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +13 -26
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/lib/feature-libraries/forest-summary/index.d.ts +2 -1
- package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/index.js +2 -1
- package/lib/feature-libraries/forest-summary/index.js.map +1 -1
- package/lib/feature-libraries/forest-summary/summaryTypes.d.ts +47 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.js +53 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
- package/lib/feature-libraries/index.d.ts +4 -4
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +3 -3
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.js +2 -1
- package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.js +2 -2
- package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.d.ts +18 -2
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +55 -5
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js +3 -5
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +20 -52
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.js +0 -21
- package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +7 -10
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +5 -5
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +4 -3
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +17 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +384 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +17 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +409 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +9 -285
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +48 -15
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1284 -458
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/{modularChangeFormat.d.ts → modularChangeFormatV1.d.ts} +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +146 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +29 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +50 -10
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.js +20 -2
- package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/lib/feature-libraries/optional-field/index.d.ts +2 -2
- package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/index.js +1 -1
- package/lib/feature-libraries/optional-field/index.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.d.ts +5 -26
- package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.js +217 -449
- package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
- package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +55 -26
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +38 -12
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.d.ts +6 -7
- package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +82 -258
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
- package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
- package/lib/feature-libraries/sequence-field/index.d.ts +2 -3
- package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/index.js +0 -1
- package/lib/feature-libraries/sequence-field/index.js.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.js +67 -169
- package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
- package/lib/feature-libraries/sequence-field/markQueue.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
- package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/moveEffectTable.js +6 -80
- package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.js +108 -114
- 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 -33
- package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +0 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +350 -175
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +21 -61
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +14 -109
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/lib/feature-libraries/sequence-field/types.d.ts +30 -59
- package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/types.js.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.d.ts +15 -24
- package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.js +107 -292
- package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.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/shared-tree/independentView.d.ts +1 -1
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +1 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts +4 -4
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +3 -2
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +1 -5
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +35 -36
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +11 -5
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +14 -4
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +1 -0
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js +25 -11
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.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 +16 -6
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js +11 -5
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +2 -2
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +12 -10
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +69 -20
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +3 -2
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +4 -3
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts +2 -2
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +9 -9
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts +4 -0
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +14 -5
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/{dist/shared-tree-core/editManagerCodecsV5.d.ts → lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +4 -4
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +20 -6
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +22 -7
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.js +1 -0
- package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/lib/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/editManagerSummarizer.d.ts +29 -9
- package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +39 -11
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +5 -3
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +4 -2
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/{dist/shared-tree-core/messageCodecV5.d.ts → lib/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
- package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +3 -3
- package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/messageCodecs.d.ts +4 -0
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +14 -5
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +20 -6
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormat.js +22 -7
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js +8 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/{messageFormatV5.d.ts → messageFormatVSharedBranches.d.ts} +5 -7
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
- package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/sharedTreeCore.d.ts +14 -47
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +28 -16
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/summaryTypes.d.ts +94 -0
- package/lib/shared-tree-core/summaryTypes.d.ts.map +1 -0
- package/lib/shared-tree-core/summaryTypes.js +43 -0
- package/lib/shared-tree-core/summaryTypes.js.map +1 -0
- package/lib/shared-tree-core/versionedSummarizer.d.ts +67 -0
- package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
- package/lib/shared-tree-core/versionedSummarizer.js +59 -0
- package/lib/shared-tree-core/versionedSummarizer.js.map +1 -0
- package/lib/simple-tree/api/configuration.d.ts +3 -26
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js +14 -25
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/dirtyIndex.d.ts +11 -0
- package/lib/simple-tree/api/dirtyIndex.d.ts.map +1 -1
- package/lib/simple-tree/api/dirtyIndex.js +7 -0
- package/lib/simple-tree/api/dirtyIndex.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/lib/simple-tree/api/discrepancies.js.map +1 -1
- package/lib/simple-tree/api/getSimpleSchema.d.ts +3 -3
- package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/getSimpleSchema.js +9 -3
- package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js +8 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +3 -4
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +2 -3
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js +0 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts +6 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +5 -0
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/schemaStatics.d.ts +12 -12
- package/lib/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
- package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaCodec.js +15 -3
- package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js +15 -10
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +3 -3
- package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.d.ts +2 -2
- package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
- package/lib/simple-tree/core/allowedTypes.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +1 -1
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +1 -1
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/toStored.d.ts +17 -15
- package/lib/simple-tree/core/toStored.d.ts.map +1 -1
- package/lib/simple-tree/core/toStored.js +4 -37
- package/lib/simple-tree/core/toStored.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +58 -8
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/walkSchema.js +5 -1
- package/lib/simple-tree/core/walkSchema.js.map +1 -1
- package/lib/simple-tree/createContext.d.ts.map +1 -1
- package/lib/simple-tree/createContext.js +20 -5
- package/lib/simple-tree/createContext.js.map +1 -1
- package/lib/simple-tree/fieldSchema.d.ts +7 -7
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/fieldSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +8 -7
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +6 -5
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts +5 -5
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +6 -4
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
- package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/common.js +2 -2
- package/lib/simple-tree/node-kinds/common.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +19 -19
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.js +4 -2
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/lib/simple-tree/prepareForInsertion.d.ts +54 -47
- package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/lib/simple-tree/prepareForInsertion.js +183 -124
- package/lib/simple-tree/prepareForInsertion.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +55 -23
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchema.js +16 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.js +8 -1
- package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts +58 -11
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +204 -31
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/treeSchema.d.ts +23 -0
- package/lib/simple-tree/treeSchema.d.ts.map +1 -0
- package/lib/simple-tree/treeSchema.js +21 -0
- package/lib/simple-tree/treeSchema.js.map +1 -0
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +26 -9
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/lib/tableSchema.d.ts +117 -63
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +160 -59
- package/lib/tableSchema.js.map +1 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +18 -4
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/index.d.ts +2 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -1
- package/lib/util/index.js.map +1 -1
- package/lib/util/rangeMap.d.ts +24 -12
- package/lib/util/rangeMap.d.ts.map +1 -1
- package/lib/util/rangeMap.js +44 -5
- package/lib/util/rangeMap.js.map +1 -1
- package/lib/util/readSnapshotBlob.d.ts +13 -0
- package/lib/util/readSnapshotBlob.d.ts.map +1 -0
- package/lib/util/readSnapshotBlob.js +14 -0
- package/lib/util/readSnapshotBlob.js.map +1 -0
- package/package.json +21 -21
- package/src/codec/codec.ts +15 -1
- package/src/codec/versioned/codec.ts +1 -1
- package/src/codec/versioned/format.ts +4 -1
- package/src/core/change-family/changeFamily.ts +5 -0
- package/src/core/change-family/index.ts +1 -0
- package/src/core/index.ts +7 -2
- package/src/core/rebase/changeRebaser.ts +6 -1
- package/src/core/rebase/index.ts +1 -0
- package/src/core/rebase/types.ts +8 -1
- package/src/core/rebase/utils.ts +31 -7
- package/src/core/tree/detachedFieldIndex.ts +71 -14
- package/src/core/tree/index.ts +9 -3
- package/src/core/tree/pathTree.ts +16 -4
- package/src/feature-libraries/chunked-forest/basicChunk.ts +7 -1
- package/src/feature-libraries/chunked-forest/chunkTree.ts +6 -1
- package/src/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.ts +15 -7
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -9
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +393 -127
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +35 -38
- package/src/feature-libraries/default-schema/index.ts +16 -5
- package/src/feature-libraries/default-schema/locationBasedEditBuilder.ts +180 -0
- package/src/feature-libraries/default-schema/mappedEditBuilder.ts +35 -9
- package/src/feature-libraries/deltaUtils.ts +6 -1
- package/src/feature-libraries/detachedFieldIndexSummarizer.ts +62 -15
- package/src/feature-libraries/flex-tree/context.ts +17 -0
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +7 -8
- package/src/feature-libraries/flex-tree/lazyField.ts +66 -24
- package/src/feature-libraries/forest-summary/codec.ts +8 -8
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +45 -37
- package/src/feature-libraries/forest-summary/format.ts +4 -4
- package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +23 -39
- package/src/feature-libraries/forest-summary/index.ts +2 -1
- package/src/feature-libraries/forest-summary/summaryTypes.ts +61 -0
- package/src/feature-libraries/index.ts +22 -9
- package/src/feature-libraries/mapTreeCursor.ts +2 -1
- package/src/feature-libraries/mitigatedChangeFamily.ts +3 -1
- package/src/feature-libraries/modular-schema/comparison.ts +63 -5
- package/src/feature-libraries/modular-schema/crossFieldQueries.ts +142 -44
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +36 -57
- package/src/feature-libraries/modular-schema/fieldKind.ts +24 -40
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +10 -19
- package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +1 -1
- package/src/feature-libraries/modular-schema/index.ts +21 -15
- package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +732 -0
- package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +790 -0
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +29 -499
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +2542 -742
- package/src/feature-libraries/modular-schema/{modularChangeFormat.ts → modularChangeFormatV1.ts} +2 -1
- package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +62 -0
- package/src/feature-libraries/modular-schema/modularChangeTypes.ts +98 -10
- package/src/feature-libraries/optional-field/index.ts +1 -3
- package/src/feature-libraries/optional-field/optionalField.ts +317 -574
- package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +24 -38
- package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +89 -35
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +59 -18
- package/src/feature-libraries/sequence-field/compose.ts +134 -519
- package/src/feature-libraries/sequence-field/helperTypes.ts +34 -19
- package/src/feature-libraries/sequence-field/index.ts +0 -9
- package/src/feature-libraries/sequence-field/invert.ts +103 -228
- package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
- package/src/feature-libraries/sequence-field/moveEffectTable.ts +8 -191
- package/src/feature-libraries/sequence-field/rebase.ts +168 -203
- package/src/feature-libraries/sequence-field/replaceRevisions.ts +31 -52
- package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +0 -2
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +643 -220
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +56 -68
- package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +25 -27
- package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +19 -129
- package/src/feature-libraries/sequence-field/types.ts +34 -64
- package/src/feature-libraries/sequence-field/utils.ts +133 -346
- package/src/index.ts +3 -2
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +1 -1
- package/src/shared-tree/index.ts +3 -2
- package/src/shared-tree/schematizeTree.ts +21 -8
- package/src/shared-tree/schematizingTreeView.ts +50 -68
- package/src/shared-tree/sharedTree.ts +39 -12
- package/src/shared-tree/sharedTreeChangeCodecs.ts +5 -1
- package/src/shared-tree/sharedTreeChangeEnricher.ts +31 -11
- package/src/shared-tree/sharedTreeChangeFamily.ts +7 -4
- package/src/shared-tree/sharedTreeEditBuilder.ts +46 -12
- package/src/shared-tree/treeAlpha.ts +2 -3
- package/src/shared-tree/treeCheckout.ts +104 -31
- package/src/shared-tree-core/branch.ts +8 -2
- package/src/shared-tree-core/editManager.ts +16 -2
- package/src/shared-tree-core/editManagerCodecs.ts +17 -5
- package/src/shared-tree-core/{editManagerCodecsV5.ts → editManagerCodecsVSharedBranches.ts} +3 -3
- package/src/shared-tree-core/editManagerFormatCommons.ts +22 -7
- package/src/shared-tree-core/editManagerFormatV1toV4.ts +3 -1
- package/src/shared-tree-core/{editManagerFormatV5.ts → editManagerFormatVSharedBranches.ts} +2 -2
- package/src/shared-tree-core/editManagerSummarizer.ts +58 -16
- package/src/shared-tree-core/index.ts +11 -3
- package/src/shared-tree-core/messageCodecV1ToV4.ts +2 -1
- package/src/shared-tree-core/{messageCodecV5.ts → messageCodecVSharedBranches.ts} +3 -3
- package/src/shared-tree-core/messageCodecs.ts +17 -5
- package/src/shared-tree-core/messageFormat.ts +22 -7
- package/src/shared-tree-core/messageFormatV1ToV4.ts +16 -2
- package/src/shared-tree-core/{messageFormatV5.ts → messageFormatVSharedBranches.ts} +4 -6
- package/src/shared-tree-core/sharedTreeCore.ts +67 -76
- package/src/shared-tree-core/summaryTypes.ts +122 -0
- package/src/shared-tree-core/versionedSummarizer.ts +107 -0
- package/src/simple-tree/api/configuration.ts +21 -68
- package/src/simple-tree/api/dirtyIndex.ts +11 -0
- package/src/simple-tree/api/discrepancies.ts +1 -1
- package/src/simple-tree/api/getSimpleSchema.ts +13 -6
- package/src/simple-tree/api/incrementalAllowedTypes.ts +15 -3
- package/src/simple-tree/api/index.ts +3 -4
- package/src/simple-tree/api/schemaCompatibilityTester.ts +1 -1
- package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -2
- package/src/simple-tree/api/schemaFactoryRecursive.ts +0 -2
- package/src/simple-tree/api/schemaFromSimple.ts +11 -5
- package/src/simple-tree/api/simpleSchemaCodec.ts +17 -3
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -1
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +18 -10
- package/src/simple-tree/api/typesUnsafe.ts +7 -3
- package/src/simple-tree/core/allowedTypes.ts +3 -3
- package/src/simple-tree/core/index.ts +2 -2
- package/src/simple-tree/core/toStored.ts +22 -55
- package/src/simple-tree/core/unhydratedFlexTree.ts +87 -36
- package/src/simple-tree/core/walkSchema.ts +6 -0
- package/src/simple-tree/createContext.ts +26 -11
- package/src/simple-tree/fieldSchema.ts +16 -7
- package/src/simple-tree/index.ts +12 -11
- package/src/simple-tree/node-kinds/array/arrayNode.ts +12 -7
- package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +3 -3
- package/src/simple-tree/node-kinds/common.ts +2 -5
- package/src/simple-tree/node-kinds/map/mapNode.ts +9 -6
- package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +3 -3
- package/src/simple-tree/node-kinds/object/objectNode.ts +26 -26
- package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +6 -2
- package/src/simple-tree/node-kinds/record/recordNode.ts +15 -11
- package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +3 -3
- package/src/simple-tree/prepareForInsertion.ts +343 -200
- package/src/simple-tree/simpleSchema.ts +79 -32
- package/src/simple-tree/simpleSchemaFormatV1.ts +9 -1
- package/src/simple-tree/toStoredSchema.ts +319 -61
- package/src/simple-tree/treeSchema.ts +54 -0
- package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +42 -14
- package/src/tableSchema.ts +485 -166
- package/src/treeFactory.ts +19 -5
- package/src/util/index.ts +5 -0
- package/src/util/rangeMap.ts +72 -18
- package/src/util/readSnapshotBlob.ts +23 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -50
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
- package/dist/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
- package/dist/shared-tree-core/editManagerCodecsV5.js.map +0 -1
- package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
- package/dist/shared-tree-core/editManagerFormatV5.js.map +0 -1
- package/dist/shared-tree-core/messageCodecV5.d.ts.map +0 -1
- package/dist/shared-tree-core/messageCodecV5.js.map +0 -1
- package/dist/shared-tree-core/messageFormatV5.d.ts.map +0 -1
- package/dist/shared-tree-core/messageFormatV5.js.map +0 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +0 -177
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
- package/docs/main/sequence-field/move-composition.md +0 -46
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -46
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
- package/lib/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
- package/lib/shared-tree-core/editManagerCodecsV5.js.map +0 -1
- package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
- package/lib/shared-tree-core/editManagerFormatV5.js.map +0 -1
- package/lib/shared-tree-core/messageCodecV5.d.ts.map +0 -1
- package/lib/shared-tree-core/messageCodecV5.js.map +0 -1
- package/lib/shared-tree-core/messageFormatV5.d.ts.map +0 -1
- package/lib/shared-tree-core/messageFormatV5.js.map +0 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +0 -171
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
- package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +0 -57
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +0 -209
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.minVersionToSharedTreeSummaryFormatVersion = exports.supportedSharedTreeSummaryFormatVersions = exports.SharedTreeSummaryFormatVersion = exports.summarizablesMetadataKey = exports.summarizablesTreeKey = void 0;
|
|
8
|
+
// TODO: Organize this to be adjacent to persisted types.
|
|
9
|
+
/**
|
|
10
|
+
* The storage key for the subtree containing all summarizable indexes in the SharedTree summary.
|
|
11
|
+
*/
|
|
12
|
+
exports.summarizablesTreeKey = "indexes";
|
|
13
|
+
/**
|
|
14
|
+
* The storage key for the blob containing metadata for the summarizable's summary.
|
|
15
|
+
*/
|
|
16
|
+
exports.summarizablesMetadataKey = ".metadata";
|
|
17
|
+
/**
|
|
18
|
+
* The versions for the SharedTree summary format.
|
|
19
|
+
*/
|
|
20
|
+
var SharedTreeSummaryFormatVersion;
|
|
21
|
+
(function (SharedTreeSummaryFormatVersion) {
|
|
22
|
+
/**
|
|
23
|
+
* This version represents summary format before summary versioning was introduced.
|
|
24
|
+
*/
|
|
25
|
+
SharedTreeSummaryFormatVersion[SharedTreeSummaryFormatVersion["v1"] = 1] = "v1";
|
|
26
|
+
/**
|
|
27
|
+
* This version adds metadata to the summary. This is backward compatible with version 1.
|
|
28
|
+
*/
|
|
29
|
+
SharedTreeSummaryFormatVersion[SharedTreeSummaryFormatVersion["v2"] = 2] = "v2";
|
|
30
|
+
/**
|
|
31
|
+
* The latest version of the SharedTree summary. Must be updated when a new version is added.
|
|
32
|
+
*/
|
|
33
|
+
SharedTreeSummaryFormatVersion[SharedTreeSummaryFormatVersion["vLatest"] = 2] = "vLatest";
|
|
34
|
+
})(SharedTreeSummaryFormatVersion || (exports.SharedTreeSummaryFormatVersion = SharedTreeSummaryFormatVersion = {}));
|
|
35
|
+
exports.supportedSharedTreeSummaryFormatVersions = new Set([
|
|
36
|
+
1 /* SharedTreeSummaryFormatVersion.v1 */,
|
|
37
|
+
2 /* SharedTreeSummaryFormatVersion.v2 */,
|
|
38
|
+
]);
|
|
39
|
+
/**
|
|
40
|
+
* Returns the summary version to use as per the given minimum version for collab.
|
|
41
|
+
*/
|
|
42
|
+
function minVersionToSharedTreeSummaryFormatVersion(version) {
|
|
43
|
+
// Currently, version 2 is written which adds metadata blob to the summary.
|
|
44
|
+
return 2 /* SharedTreeSummaryFormatVersion.v2 */;
|
|
45
|
+
}
|
|
46
|
+
exports.minVersionToSharedTreeSummaryFormatVersion = minVersionToSharedTreeSummaryFormatVersion;
|
|
47
|
+
//# sourceMappingURL=summaryTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summaryTypes.js","sourceRoot":"","sources":["../../src/shared-tree-core/summaryTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAUH,yDAAyD;AACzD;;GAEG;AACU,QAAA,oBAAoB,GAAG,SAAS,CAAC;AAE9C;;GAEG;AACU,QAAA,wBAAwB,GAAG,WAAW,CAAC;AAmEpD;;GAEG;AACH,IAAkB,8BAajB;AAbD,WAAkB,8BAA8B;IAC/C;;OAEG;IACH,+EAAM,CAAA;IACN;;OAEG;IACH,+EAAM,CAAA;IACN;;OAEG;IACH,yFAAY,CAAA;AACb,CAAC,EAbiB,8BAA8B,8CAA9B,8BAA8B,QAa/C;AAEY,QAAA,wCAAwC,GACpD,IAAI,GAAG,CAAiC;;;CAGvC,CAAC,CAAC;AAEJ;;GAEG;AACH,SAAgB,0CAA0C,CACzD,OAAgC;IAEhC,2EAA2E;IAC3E,iDAAyC;AAC1C,CAAC;AALD,gGAKC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IChannelStorageService } from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tIExperimentalIncrementalSummaryContext,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tMinimumVersionForCollab,\n} from \"@fluidframework/runtime-definitions/internal\";\n\n// TODO: Organize this to be adjacent to persisted types.\n/**\n * The storage key for the subtree containing all summarizable indexes in the SharedTree summary.\n */\nexport const summarizablesTreeKey = \"indexes\";\n\n/**\n * The storage key for the blob containing metadata for the summarizable's summary.\n */\nexport const summarizablesMetadataKey = \".metadata\";\n\n/**\n * Specifies the behavior of a component that puts data in a summary.\n */\nexport interface Summarizable {\n\t/**\n\t * Field name in summary json under which this element stores its data.\n\t */\n\treadonly key: string;\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#(IChannel:interface).summarize}\n\t * @param stringify - Serializes the contents of the component (including {@link (IFluidHandle:interface)}s) for storage.\n\t * @param fullTree - A flag indicating whether the attempt should generate a full\n\t * summary tree without any handles for unchanged subtrees. It should only be set to true when generating\n\t * a summary from the entire container. The default value is false.\n\t * @param trackState - An optimization for tracking state of objects across summaries. If the state\n\t * of an object did not change since last successful summary, an\n\t * {@link @fluidframework/protocol-definitions#ISummaryHandle} can be used\n\t * instead of re-summarizing it. If this is `false`, the expectation is that you should never\n\t * send an `ISummaryHandle`, since you are not expected to track state. The default value is true.\n\t * @param telemetryContext - See {@link @fluidframework/runtime-definitions#ITelemetryContext}.\n\t * @param incrementalSummaryContext - See {@link @fluidframework/runtime-definitions#IExperimentalIncrementalSummaryContext}.\n\t */\n\tsummarize(props: {\n\t\tstringify: SummaryElementStringifier;\n\t\tfullTree?: boolean;\n\t\ttrackState?: boolean;\n\t\ttelemetryContext?: ITelemetryContext;\n\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext;\n\t}): ISummaryTreeWithStats;\n\n\t/**\n\t * Allows the component to perform custom loading. The storage service is scoped to this component and therefore\n\t * paths in this component will not collide with those in other components, even if they are the same string.\n\t * @param service - Storage used by the component\n\t * @param parse - Parses serialized data from storage into runtime objects for the component\n\t */\n\tload(service: IChannelStorageService, parse: SummaryElementParser): Promise<void>;\n}\n\n/**\n * Serializes the given contents into a string acceptable for storing in summaries, i.e. all\n * Fluid handles have been replaced appropriately by an IFluidSerializer\n */\nexport type SummaryElementStringifier = (contents: unknown) => string;\n\n/**\n * Parses a serialized/summarized string into an object, rehydrating any Fluid handles as necessary\n */\nexport type SummaryElementParser = (contents: string) => unknown;\n\n/**\n * The type for the metadata in the summarizable's summary.\n * The metadata is stored under the {@link summarizablesMetadataKey} key in the summary.\n * @remarks\n * This is common metadata used by all summarizables. If a summarizable needs to add more metadata,\n * it should define its own metadata type that extends this type.\n */\n// Using type definition instead of interface to make this compatible with JsonCompatible.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport type SharedTreeSummarizableMetadata = {\n\t/** The version of the SharedTree summary. */\n\treadonly version: number;\n};\n\n/**\n * The versions for the SharedTree summary format.\n */\nexport const enum SharedTreeSummaryFormatVersion {\n\t/**\n\t * This version represents summary format before summary versioning was introduced.\n\t */\n\tv1 = 1,\n\t/**\n\t * This version adds metadata to the summary. This is backward compatible with version 1.\n\t */\n\tv2 = 2,\n\t/**\n\t * The latest version of the SharedTree summary. Must be updated when a new version is added.\n\t */\n\tvLatest = v2,\n}\n\nexport const supportedSharedTreeSummaryFormatVersions =\n\tnew Set<SharedTreeSummaryFormatVersion>([\n\t\tSharedTreeSummaryFormatVersion.v1,\n\t\tSharedTreeSummaryFormatVersion.v2,\n\t]);\n\n/**\n * Returns the summary version to use as per the given minimum version for collab.\n */\nexport function minVersionToSharedTreeSummaryFormatVersion(\n\tversion: MinimumVersionForCollab,\n): SharedTreeSummaryFormatVersion {\n\t// Currently, version 2 is written which adds metadata blob to the summary.\n\treturn SharedTreeSummaryFormatVersion.v2;\n}\n"]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import type { IChannelStorageService } from "@fluidframework/datastore-definitions/internal";
|
|
6
|
+
import type { IExperimentalIncrementalSummaryContext, ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtime-definitions/internal";
|
|
7
|
+
import { SummaryTreeBuilder } from "@fluidframework/runtime-utils/internal";
|
|
8
|
+
import { type Summarizable, type SummaryElementParser, type SummaryElementStringifier } from "./summaryTypes.js";
|
|
9
|
+
/**
|
|
10
|
+
* Utility for implementing {@link Summarizable}s classes with versioning.
|
|
11
|
+
* It handles versioning of summaries - writing version metadata to summaries
|
|
12
|
+
* and checking version compatibility when loading.
|
|
13
|
+
*/
|
|
14
|
+
export declare abstract class VersionedSummarizer<TVersion extends number> implements Summarizable {
|
|
15
|
+
/** {@link Summarizable.key} */
|
|
16
|
+
readonly key: string;
|
|
17
|
+
/** The format version of the summary to write in the summary metadata. */
|
|
18
|
+
private readonly writeVersion;
|
|
19
|
+
/** The set of supported versions that a summary can have for this summarizer to load it. */
|
|
20
|
+
private readonly supportedVersions;
|
|
21
|
+
/**
|
|
22
|
+
* Whether to support loading summaries before versioning was added, i.e., summaries without metadata blob.
|
|
23
|
+
* @remarks
|
|
24
|
+
* This version may not be supported if the support for the version before metadata blob was dropped.
|
|
25
|
+
* In that case, this will not be present in `supportedVersions` and an error will be thrown during load.
|
|
26
|
+
*/
|
|
27
|
+
private readonly supportPreVersioningFormat;
|
|
28
|
+
constructor(
|
|
29
|
+
/** {@link Summarizable.key} */
|
|
30
|
+
key: string,
|
|
31
|
+
/** The format version of the summary to write in the summary metadata. */
|
|
32
|
+
writeVersion: TVersion,
|
|
33
|
+
/** The set of supported versions that a summary can have for this summarizer to load it. */
|
|
34
|
+
supportedVersions: ReadonlySet<TVersion>,
|
|
35
|
+
/**
|
|
36
|
+
* Whether to support loading summaries before versioning was added, i.e., summaries without metadata blob.
|
|
37
|
+
* @remarks
|
|
38
|
+
* This version may not be supported if the support for the version before metadata blob was dropped.
|
|
39
|
+
* In that case, this will not be present in `supportedVersions` and an error will be thrown during load.
|
|
40
|
+
*/
|
|
41
|
+
supportPreVersioningFormat: boolean);
|
|
42
|
+
/**
|
|
43
|
+
* The summarize function that derived classes must implement. They should use the passed summary tree builder to
|
|
44
|
+
* add their summary data.
|
|
45
|
+
*/
|
|
46
|
+
protected abstract summarizeInternal(props: {
|
|
47
|
+
stringify: SummaryElementStringifier;
|
|
48
|
+
fullTree?: boolean;
|
|
49
|
+
trackState?: boolean;
|
|
50
|
+
telemetryContext?: ITelemetryContext;
|
|
51
|
+
incrementalSummaryContext?: IExperimentalIncrementalSummaryContext;
|
|
52
|
+
builder: SummaryTreeBuilder;
|
|
53
|
+
}): void;
|
|
54
|
+
/**
|
|
55
|
+
* The load function that derived classes must implement to load their summary data.
|
|
56
|
+
*/
|
|
57
|
+
protected abstract loadInternal(services: IChannelStorageService, parse: SummaryElementParser): Promise<void>;
|
|
58
|
+
summarize(props: {
|
|
59
|
+
stringify: SummaryElementStringifier;
|
|
60
|
+
fullTree?: boolean;
|
|
61
|
+
trackState?: boolean;
|
|
62
|
+
telemetryContext?: ITelemetryContext;
|
|
63
|
+
incrementalSummaryContext?: IExperimentalIncrementalSummaryContext;
|
|
64
|
+
}): ISummaryTreeWithStats;
|
|
65
|
+
load(services: IChannelStorageService, parse: SummaryElementParser): Promise<void>;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=versionedSummarizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versionedSummarizer.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/versionedSummarizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,KAAK,EACX,sCAAsC,EACtC,qBAAqB,EACrB,iBAAiB,EACjB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAE5E,OAAO,EAGN,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,MAAM,mBAAmB,CAAC;AAG3B;;;;GAIG;AACH,8BAAsB,mBAAmB,CAAC,QAAQ,SAAS,MAAM,CAAE,YAAW,YAAY;IAExF,+BAA+B;aACf,GAAG,EAAE,MAAM;IAC3B,0EAA0E;IAC1E,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,4FAA4F;IAC5F,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,CAAC,0BAA0B;;IAZ3C,+BAA+B;IACf,GAAG,EAAE,MAAM;IAC3B,0EAA0E;IACzD,YAAY,EAAE,QAAQ;IACvC,4FAA4F;IAC3E,iBAAiB,EAAE,WAAW,CAAC,QAAQ,CAAC;IACzD;;;;;OAKG;IACc,0BAA0B,EAAE,OAAO;IAQrD;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,iBAAiB,CAAC,KAAK,EAAE;QAC3C,SAAS,EAAE,yBAAyB,CAAC;QACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;QACrC,yBAAyB,CAAC,EAAE,sCAAsC,CAAC;QACnE,OAAO,EAAE,kBAAkB,CAAC;KAC5B,GAAG,IAAI;IAER;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,YAAY,CAC9B,QAAQ,EAAE,sBAAsB,EAChC,KAAK,EAAE,oBAAoB,GACzB,OAAO,CAAC,IAAI,CAAC;IAET,SAAS,CAAC,KAAK,EAAE;QACvB,SAAS,EAAE,yBAAyB,CAAC;QACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;QACrC,yBAAyB,CAAC,EAAE,sCAAsC,CAAC;KACnE,GAAG,qBAAqB;IAUZ,IAAI,CAChB,QAAQ,EAAE,sBAAsB,EAChC,KAAK,EAAE,oBAAoB,GACzB,OAAO,CAAC,IAAI,CAAC;CAgBhB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.VersionedSummarizer = void 0;
|
|
8
|
+
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
9
|
+
const internal_2 = require("@fluidframework/runtime-utils/internal");
|
|
10
|
+
const internal_3 = require("@fluidframework/telemetry-utils/internal");
|
|
11
|
+
const summaryTypes_js_1 = require("./summaryTypes.js");
|
|
12
|
+
const index_js_1 = require("../util/index.js");
|
|
13
|
+
/**
|
|
14
|
+
* Utility for implementing {@link Summarizable}s classes with versioning.
|
|
15
|
+
* It handles versioning of summaries - writing version metadata to summaries
|
|
16
|
+
* and checking version compatibility when loading.
|
|
17
|
+
*/
|
|
18
|
+
class VersionedSummarizer {
|
|
19
|
+
constructor(
|
|
20
|
+
/** {@link Summarizable.key} */
|
|
21
|
+
key,
|
|
22
|
+
/** The format version of the summary to write in the summary metadata. */
|
|
23
|
+
writeVersion,
|
|
24
|
+
/** The set of supported versions that a summary can have for this summarizer to load it. */
|
|
25
|
+
supportedVersions,
|
|
26
|
+
/**
|
|
27
|
+
* Whether to support loading summaries before versioning was added, i.e., summaries without metadata blob.
|
|
28
|
+
* @remarks
|
|
29
|
+
* This version may not be supported if the support for the version before metadata blob was dropped.
|
|
30
|
+
* In that case, this will not be present in `supportedVersions` and an error will be thrown during load.
|
|
31
|
+
*/
|
|
32
|
+
supportPreVersioningFormat) {
|
|
33
|
+
this.key = key;
|
|
34
|
+
this.writeVersion = writeVersion;
|
|
35
|
+
this.supportedVersions = supportedVersions;
|
|
36
|
+
this.supportPreVersioningFormat = supportPreVersioningFormat;
|
|
37
|
+
(0, internal_1.assert)(this.supportedVersions.has(this.writeVersion), `Write version ${this.writeVersion} must be supported.`);
|
|
38
|
+
}
|
|
39
|
+
summarize(props) {
|
|
40
|
+
const builder = new internal_2.SummaryTreeBuilder();
|
|
41
|
+
const metadata = {
|
|
42
|
+
version: this.writeVersion,
|
|
43
|
+
};
|
|
44
|
+
builder.addBlob(summaryTypes_js_1.summarizablesMetadataKey, props.stringify(metadata));
|
|
45
|
+
this.summarizeInternal({ ...props, builder });
|
|
46
|
+
return builder.getSummaryTree();
|
|
47
|
+
}
|
|
48
|
+
async load(services, parse) {
|
|
49
|
+
if (await services.contains(summaryTypes_js_1.summarizablesMetadataKey)) {
|
|
50
|
+
const metadata = await (0, index_js_1.readAndParseSnapshotBlob)(summaryTypes_js_1.summarizablesMetadataKey, services, (contents) => parse(contents));
|
|
51
|
+
const version = metadata.version;
|
|
52
|
+
if (!this.supportedVersions.has(version)) {
|
|
53
|
+
throw new internal_3.UsageError(`Cannot read version ${version} of shared tree summary.`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else if (!this.supportPreVersioningFormat) {
|
|
57
|
+
throw new internal_3.UsageError(`Cannot read summary without versioning for shared tree summary.`);
|
|
58
|
+
}
|
|
59
|
+
await this.loadInternal(services, parse);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.VersionedSummarizer = VersionedSummarizer;
|
|
63
|
+
//# sourceMappingURL=versionedSummarizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versionedSummarizer.js","sourceRoot":"","sources":["../../src/shared-tree-core/versionedSummarizer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAO7D,qEAA4E;AAC5E,uEAAsE;AACtE,uDAM2B;AAC3B,+CAA4D;AAE5D;;;;GAIG;AACH,MAAsB,mBAAmB;IACxC;IACC,+BAA+B;IACf,GAAW;IAC3B,0EAA0E;IACzD,YAAsB;IACvC,4FAA4F;IAC3E,iBAAwC;IACzD;;;;;OAKG;IACc,0BAAmC;QAXpC,QAAG,GAAH,GAAG,CAAQ;QAEV,iBAAY,GAAZ,YAAY,CAAU;QAEtB,sBAAiB,GAAjB,iBAAiB,CAAuB;QAOxC,+BAA0B,GAA1B,0BAA0B,CAAS;QAEpD,IAAA,iBAAM,EACL,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,EAC7C,iBAAiB,IAAI,CAAC,YAAY,qBAAqB,CACvD,CAAC;IACH,CAAC;IAuBM,SAAS,CAAC,KAMhB;QACA,MAAM,OAAO,GAAG,IAAI,6BAAkB,EAAE,CAAC;QACzC,MAAM,QAAQ,GAAmC;YAChD,OAAO,EAAE,IAAI,CAAC,YAAY;SAC1B,CAAC;QACF,OAAO,CAAC,OAAO,CAAC,0CAAwB,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;QACrE,IAAI,CAAC,iBAAiB,CAAC,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;QAC9C,OAAO,OAAO,CAAC,cAAc,EAAE,CAAC;IACjC,CAAC;IAEM,KAAK,CAAC,IAAI,CAChB,QAAgC,EAChC,KAA2B;QAE3B,IAAI,MAAM,QAAQ,CAAC,QAAQ,CAAC,0CAAwB,CAAC,EAAE,CAAC;YACvD,MAAM,QAAQ,GAAG,MAAM,IAAA,mCAAwB,EAC9C,0CAAwB,EACxB,QAAQ,EACR,CAAC,QAAQ,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAC7B,CAAC;YACF,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAmB,CAAC;YAC7C,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC1C,MAAM,IAAI,qBAAU,CAAC,uBAAuB,OAAO,0BAA0B,CAAC,CAAC;YAChF,CAAC;QACF,CAAC;aAAM,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE,CAAC;YAC7C,MAAM,IAAI,qBAAU,CAAC,iEAAiE,CAAC,CAAC;QACzF,CAAC;QACD,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;CACD;AA9ED,kDA8EC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IChannelStorageService } from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tIExperimentalIncrementalSummaryContext,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { SummaryTreeBuilder } from \"@fluidframework/runtime-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport {\n\tsummarizablesMetadataKey,\n\ttype SharedTreeSummarizableMetadata,\n\ttype Summarizable,\n\ttype SummaryElementParser,\n\ttype SummaryElementStringifier,\n} from \"./summaryTypes.js\";\nimport { readAndParseSnapshotBlob } from \"../util/index.js\";\n\n/**\n * Utility for implementing {@link Summarizable}s classes with versioning.\n * It handles versioning of summaries - writing version metadata to summaries\n * and checking version compatibility when loading.\n */\nexport abstract class VersionedSummarizer<TVersion extends number> implements Summarizable {\n\tpublic constructor(\n\t\t/** {@link Summarizable.key} */\n\t\tpublic readonly key: string,\n\t\t/** The format version of the summary to write in the summary metadata. */\n\t\tprivate readonly writeVersion: TVersion,\n\t\t/** The set of supported versions that a summary can have for this summarizer to load it. */\n\t\tprivate readonly supportedVersions: ReadonlySet<TVersion>,\n\t\t/**\n\t\t * Whether to support loading summaries before versioning was added, i.e., summaries without metadata blob.\n\t\t * @remarks\n\t\t * This version may not be supported if the support for the version before metadata blob was dropped.\n\t\t * In that case, this will not be present in `supportedVersions` and an error will be thrown during load.\n\t\t */\n\t\tprivate readonly supportPreVersioningFormat: boolean,\n\t) {\n\t\tassert(\n\t\t\tthis.supportedVersions.has(this.writeVersion),\n\t\t\t`Write version ${this.writeVersion} must be supported.`,\n\t\t);\n\t}\n\n\t/**\n\t * The summarize function that derived classes must implement. They should use the passed summary tree builder to\n\t * add their summary data.\n\t */\n\tprotected abstract summarizeInternal(props: {\n\t\tstringify: SummaryElementStringifier;\n\t\tfullTree?: boolean;\n\t\ttrackState?: boolean;\n\t\ttelemetryContext?: ITelemetryContext;\n\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext;\n\t\tbuilder: SummaryTreeBuilder;\n\t}): void;\n\n\t/**\n\t * The load function that derived classes must implement to load their summary data.\n\t */\n\tprotected abstract loadInternal(\n\t\tservices: IChannelStorageService,\n\t\tparse: SummaryElementParser,\n\t): Promise<void>;\n\n\tpublic summarize(props: {\n\t\tstringify: SummaryElementStringifier;\n\t\tfullTree?: boolean;\n\t\ttrackState?: boolean;\n\t\ttelemetryContext?: ITelemetryContext;\n\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext;\n\t}): ISummaryTreeWithStats {\n\t\tconst builder = new SummaryTreeBuilder();\n\t\tconst metadata: SharedTreeSummarizableMetadata = {\n\t\t\tversion: this.writeVersion,\n\t\t};\n\t\tbuilder.addBlob(summarizablesMetadataKey, props.stringify(metadata));\n\t\tthis.summarizeInternal({ ...props, builder });\n\t\treturn builder.getSummaryTree();\n\t}\n\n\tpublic async load(\n\t\tservices: IChannelStorageService,\n\t\tparse: SummaryElementParser,\n\t): Promise<void> {\n\t\tif (await services.contains(summarizablesMetadataKey)) {\n\t\t\tconst metadata = await readAndParseSnapshotBlob<SharedTreeSummarizableMetadata>(\n\t\t\t\tsummarizablesMetadataKey,\n\t\t\t\tservices,\n\t\t\t\t(contents) => parse(contents),\n\t\t\t);\n\t\t\tconst version = metadata.version as TVersion;\n\t\t\tif (!this.supportedVersions.has(version)) {\n\t\t\t\tthrow new UsageError(`Cannot read version ${version} of shared tree summary.`);\n\t\t\t}\n\t\t} else if (!this.supportPreVersioningFormat) {\n\t\t\tthrow new UsageError(`Cannot read summary without versioning for shared tree summary.`);\n\t\t}\n\t\tawait this.loadInternal(services, parse);\n\t}\n}\n"]}
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
import { type FieldSchemaAlpha, type ImplicitFieldSchema } from "../fieldSchema.js";
|
|
6
6
|
import { type TreeNodeSchema } from "../core/index.js";
|
|
7
7
|
import type { MakeNominal } from "../../util/index.js";
|
|
8
|
-
import type {
|
|
8
|
+
import type { SchemaType, SimpleNodeSchema } from "../simpleSchema.js";
|
|
9
|
+
import { type TreeSchema } from "../treeSchema.js";
|
|
9
10
|
/**
|
|
10
11
|
* Options when constructing a tree view.
|
|
11
12
|
* @public
|
|
@@ -132,10 +133,6 @@ export declare class TreeViewConfiguration<const TSchema extends ImplicitFieldSc
|
|
|
132
133
|
* {@inheritDoc ITreeConfigurationOptions.preventAmbiguity}
|
|
133
134
|
*/
|
|
134
135
|
readonly preventAmbiguity: boolean;
|
|
135
|
-
/**
|
|
136
|
-
* {@link TreeSchema.definitions} but with public types.
|
|
137
|
-
*/
|
|
138
|
-
protected readonly definitionsInternal: ReadonlyMap<string, TreeNodeSchema>;
|
|
139
136
|
/**
|
|
140
137
|
* Construct a new {@link TreeViewConfiguration}.
|
|
141
138
|
*
|
|
@@ -158,30 +155,10 @@ export declare class TreeViewConfiguration<const TSchema extends ImplicitFieldSc
|
|
|
158
155
|
* @sealed @alpha
|
|
159
156
|
*/
|
|
160
157
|
export declare class TreeViewConfigurationAlpha<const TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> extends TreeViewConfiguration<TSchema> implements TreeSchema {
|
|
161
|
-
/**
|
|
162
|
-
* {@inheritDoc TreeSchema.root}
|
|
163
|
-
*/
|
|
164
158
|
readonly root: FieldSchemaAlpha;
|
|
165
|
-
|
|
166
|
-
* {@inheritDoc TreeSchema.definitions}
|
|
167
|
-
*/
|
|
168
|
-
get definitions(): ReadonlyMap<string, SimpleNodeSchema & TreeNodeSchema>;
|
|
159
|
+
readonly definitions: ReadonlyMap<string, SimpleNodeSchema<SchemaType.View> & TreeNodeSchema>;
|
|
169
160
|
constructor(props: ITreeViewConfiguration<TSchema>);
|
|
170
161
|
}
|
|
171
|
-
/**
|
|
172
|
-
* {@link TreeViewConfigurationAlpha}
|
|
173
|
-
* @sealed @alpha
|
|
174
|
-
*/
|
|
175
|
-
export interface TreeSchema extends SimpleTreeSchema {
|
|
176
|
-
/**
|
|
177
|
-
* {@inheritDoc SimpleTreeSchema.root}
|
|
178
|
-
*/
|
|
179
|
-
readonly root: FieldSchemaAlpha;
|
|
180
|
-
/**
|
|
181
|
-
* {@inheritDoc SimpleTreeSchema.definitions}
|
|
182
|
-
*/
|
|
183
|
-
readonly definitions: ReadonlyMap<string, SimpleNodeSchema & TreeNodeSchema>;
|
|
184
|
-
}
|
|
185
162
|
/**
|
|
186
163
|
* Check if union contents are valid (shallowly).
|
|
187
164
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/configuration.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/configuration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAa,MAAM,mBAAmB,CAAC;AAC/F,OAAO,EAGN,KAAK,cAAc,EACnB,MAAM,kBAAkB,CAAC;AAiB1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAErE;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACzC;;;;;;;;;;;;;;;OAeG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyEG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACpC;AAOD;;;GAGG;AACH,MAAM,WAAW,sBAAsB,CACtC,OAAO,SAAS,mBAAmB,GAAG,mBAAmB,CACxD,SAAQ,yBAAyB;IAClC;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CACzB;AAED;;;GAGG;AACH,qBAAa,qBAAqB,CACjC,KAAK,CAAC,OAAO,SAAS,mBAAmB,GAAG,mBAAmB,CAC9D,YAAW,QAAQ,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAErD,SAAS,CAAC,UAAU,EAAG,WAAW,CAAC;IAEnC;;OAEG;IACH,SAAgB,MAAM,EAAG,OAAO,CAAC;IAEjC;;OAEG;IACH,SAAgB,sBAAsB,EAAG,OAAO,CAAC;IAEjD;;OAEG;IACH,SAAgB,gBAAgB,EAAG,OAAO,CAAC;IAE3C;;;;;;;;;;;;OAYG;gBACgB,KAAK,EAAE,sBAAsB,CAAC,OAAO,CAAC;CAuCzD;AAED;;;;;GAKG;AACH,qBAAa,0BAA0B,CACrC,KAAK,CAAC,OAAO,SAAS,mBAAmB,GAAG,mBAAmB,CAEhE,SAAQ,qBAAqB,CAAC,OAAO,CACrC,YAAW,UAAU;IAErB,SAAgB,IAAI,EAAE,gBAAgB,CAAC;IACvC,SAAgB,WAAW,EAAE,WAAW,CACvC,MAAM,EACN,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,cAAc,CAClD,CAAC;gBAEiB,KAAK,EAAE,sBAAsB,CAAC,OAAO,CAAC;CAUzD;AAWD;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CACzB,KAAK,EAAE,QAAQ,CAAC,cAAc,CAAC,EAC/B,gBAAgB,EAAE,OAAO,EACzB,eAAe,EAAE,MAAM,EAAE,GACvB,IAAI,CAmIN"}
|
|
@@ -13,6 +13,7 @@ const toStoredSchema_js_1 = require("../toStoredSchema.js");
|
|
|
13
13
|
const index_js_2 = require("../node-kinds/index.js");
|
|
14
14
|
const index_js_3 = require("../../util/index.js");
|
|
15
15
|
const walkFieldSchema_js_1 = require("../walkFieldSchema.js");
|
|
16
|
+
const treeSchema_js_1 = require("../treeSchema.js");
|
|
16
17
|
const defaultTreeConfigurationOptions = {
|
|
17
18
|
enableSchemaValidation: false,
|
|
18
19
|
preventAmbiguity: false,
|
|
@@ -50,25 +51,14 @@ class TreeViewConfiguration {
|
|
|
50
51
|
this.preventAmbiguity = config.preventAmbiguity;
|
|
51
52
|
// Ambiguity errors are lower priority to report than invalid schema errors, so collect these in an array and report them all at once.
|
|
52
53
|
const ambiguityErrors = [];
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
|
|
56
|
-
(0, toStoredSchema_js_1.toStoredSchema)(config.schema, toStoredSchema_js_1.permissiveStoredSchemaGenerationOptions);
|
|
57
|
-
const definitions = new Map();
|
|
54
|
+
// Validate the schema and collect ambiguity errors.
|
|
55
|
+
// This does a lot of validation (throwing usage errors as a side effect) in addition to just collecting ambiguity errors.
|
|
56
|
+
// ambiguityErrors are considered a lower priority, so only thrown if no other errors are found.
|
|
58
57
|
(0, walkFieldSchema_js_1.walkFieldSchema)(config.schema, {
|
|
59
|
-
node: (schema) => {
|
|
60
|
-
// Ensure all reachable schema are marked as most derived.
|
|
61
|
-
// This ensures if multiple schema extending the same schema factory generated class are present (or have had instances of them constructed, or get instances of them constructed in the future),
|
|
62
|
-
// an error is reported.
|
|
63
|
-
(0, index_js_1.markSchemaMostDerived)(schema, true);
|
|
64
|
-
(0, internal_1.debugAssert)(() => !definitions.has(schema.identifier));
|
|
65
|
-
definitions.set(schema.identifier, schema);
|
|
66
|
-
},
|
|
67
58
|
allowedTypes({ types }) {
|
|
68
59
|
checkUnion(types.map((t) => t.type), config.preventAmbiguity, ambiguityErrors);
|
|
69
60
|
},
|
|
70
61
|
});
|
|
71
|
-
this.definitionsInternal = definitions;
|
|
72
62
|
if (ambiguityErrors.length !== 0) {
|
|
73
63
|
// Duplicate errors are common since when two types conflict, both orders error:
|
|
74
64
|
const deduplicated = new Set(ambiguityErrors);
|
|
@@ -84,15 +74,14 @@ exports.TreeViewConfiguration = TreeViewConfiguration;
|
|
|
84
74
|
* @sealed @alpha
|
|
85
75
|
*/
|
|
86
76
|
class TreeViewConfigurationAlpha extends TreeViewConfiguration {
|
|
87
|
-
/**
|
|
88
|
-
* {@inheritDoc TreeSchema.definitions}
|
|
89
|
-
*/
|
|
90
|
-
get definitions() {
|
|
91
|
-
return this.definitionsInternal;
|
|
92
|
-
}
|
|
93
77
|
constructor(props) {
|
|
94
78
|
super(props);
|
|
95
|
-
|
|
79
|
+
const treeSchema = (0, treeSchema_js_1.createTreeSchema)(this.schema);
|
|
80
|
+
this.root = treeSchema.root;
|
|
81
|
+
this.definitions = treeSchema.definitions;
|
|
82
|
+
// Eagerly perform these conversions to surface errors sooner.
|
|
83
|
+
(0, toStoredSchema_js_1.toInitialSchema)(this.root);
|
|
84
|
+
(0, toStoredSchema_js_1.transformSimpleSchema)(treeSchema, toStoredSchema_js_1.toUnhydratedSchema);
|
|
96
85
|
}
|
|
97
86
|
}
|
|
98
87
|
exports.TreeViewConfigurationAlpha = TreeViewConfigurationAlpha;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../src/simple-tree/api/configuration.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAM6C;AAC7C,uEAAsE;AAEtE,sDAK2B;AAC3B,+CAK0B;AAC1B,4DAI8B;AAC9B,qDASgC;AAChC,kDAAkD;AAElD,8DAAwD;AAuGxD,MAAM,+BAA+B,GAAwC;IAC5E,sBAAsB,EAAE,KAAK;IAC7B,gBAAgB,EAAE,KAAK;CACvB,CAAC;AAeF;;;GAGG;AACH,MAAa,qBAAqB;IA0BjC;;;;;;;;;;;;OAYG;IACH,YAAmB,KAAsC;QACxD,IAAI,IAAI,CAAC,WAAW,KAAK,qBAAqB,EAAE,CAAC;YAChD,4HAA4H;YAC5H,kKAAkK;YAClK,OAAO,IAAI,0BAA0B,CAAC,KAAK,CAAC,CAAC;QAC9C,CAAC;QACD,IAAA,iBAAM;QACL,wGAAwG;QACvG,IAAI,CAAC,WAAuB,KAAK,0BAA0B,EAC5D,KAAK,CAAC,8CAA8C,CACpD,CAAC;QAEF,MAAM,MAAM,GAAG,EAAE,GAAG,+BAA+B,EAAE,GAAG,KAAK,EAAE,CAAC;QAChE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,sBAAsB,GAAG,MAAM,CAAC,sBAAsB,CAAC;QAC5D,IAA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C,CAAC;oBACrC,CAAC;gBACF,CAAC;YACF,CAAC;QACF,CAAC;QAED,IAAI,iBAAiB,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YAChC,yCAAyC;YACzC,8EAA8E;YAC9E,kJAAkJ;YAClJ,4MAA4M;YAC5M,mJAAmJ;YAEnJ,eAAe,CAAC,IAAI,CACnB,0BAA0B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,mEAAmE,WAAW,CAAC,iBAAiB,CAAC,oIAAoI,CAChS,CAAC;QACH,CAAC;IACF,CAAC;AACF,CAAC;AAvID,gCAuIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tassert,\n\tdebugAssert,\n\tfail,\n\toob,\n\tunreachableCase,\n} from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype FieldSchemaAlpha,\n\ttype ImplicitFieldSchema,\n\tFieldKind,\n\tnormalizeFieldSchema,\n} from \"../fieldSchema.js\";\nimport {\n\ttype AllowedTypesFullEvaluated,\n\tNodeKind,\n\ttype TreeNodeSchema,\n\tmarkSchemaMostDerived,\n} from \"../core/index.js\";\nimport {\n\tpermissiveStoredSchemaGenerationOptions,\n\trestrictiveStoredSchemaGenerationOptions,\n\ttoStoredSchema,\n} from \"../toStoredSchema.js\";\nimport {\n\tisArrayNodeSchema,\n\tisMapNodeSchema,\n\tisObjectNodeSchema,\n\tisRecordNodeSchema,\n\ttype ArrayNodeSchema,\n\ttype MapNodeSchema,\n\ttype ObjectNodeSchema,\n\ttype RecordNodeSchema,\n} from \"../node-kinds/index.js\";\nimport { getOrCreate } from \"../../util/index.js\";\nimport type { MakeNominal } from \"../../util/index.js\";\nimport { walkFieldSchema } from \"../walkFieldSchema.js\";\nimport type { SimpleNodeSchema, SimpleTreeSchema } from \"../simpleSchema.js\";\n\n/**\n * Options when constructing a tree view.\n * @public\n */\nexport interface ITreeConfigurationOptions {\n\t/**\n\t * If `true`, the tree will perform additional validation of content against its stored schema\n\t * and throw an error if the new content doesn't match the expected schema.\n\t *\n\t * @defaultValue `false`.\n\t *\n\t * @remarks\n\t * Currently most cases already have some schema validation, so this is mainly for additional validation which may be useful when debugging issues,\n\t * working with untyped APIs, or when the small performance overhead is a non-issue.\n\t *\n\t * Enabling schema validation has a performance penalty when inserting new content into the tree because\n\t * additional checks are done. Enable this option only in scenarios where you are ok with that operation being a\n\t * bit slower.\n\t *\n\t * For additional validation in more cases, see {@link ForestTypeExpensiveDebug}.\n\t */\n\tenableSchemaValidation?: boolean;\n\n\t/**\n\t * A flag used to opt into strict rules ensuring that the schema avoids cases which can make the type of nodes ambiguous when importing or exporting data.\n\t * @defaultValue `false`.\n\t *\n\t * @remarks\n\t * When this is true, it ensures that the compile time type safety for data when constructing nodes is sufficient to ensure that the runtime behavior will not give node data ambiguity errors.\n\t *\n\t * This ensures that the canonical JSON-like representation of all unions in the tree are lossless and unambiguous.\n\t * This canonical JSON-like representation consists of arrays, plain old JavaScript objects with string keys, booleans, numbers (excluding NaN, -0 and infinities), strings, null and {@link @fluidframework/core-interfaces#IFluidHandle}s.\n\t * It is compatible with the node creation APIs (such as schema class constructors) and is also compatible with JSON assuming any IFluidHandles get special handling (since they are not JSON compatible).\n\t * Currently these cases can cause ambiguity in a union:\n\t *\n\t * - More than one ArrayNode type: it's impossible to tell which array type is intended in the case of empty arrays (`[]`).\n\t *\n\t * - More than one MapNode type: it's impossible to tell which map type is intended in the case of an empty map (`{}`).\n\t *\n\t * - Both a MapNode and an ArrayNode: this case is not a problem for the canonical JSON representation, but is an issue when constructing from an Iterable, which is supported for both MapNode and ArrayNode.\n\t *\n\t * - Both a MapNode and an ObjectNode: when the input is valid for the ObjectNode, the current parser always considers it ambiguous with being a MapNode.\n\t *\n\t * - ObjectNodes which have fields (required or optional) which include all required fields of another ObjectNode: currently each ObjectNode is differentiated by the presence of its required fields.\n\t *\n\t * This check is conservative: some complex cases may error if the current simple algorithm cannot show no ambiguity is possible.\n\t * This check may become more permissive over time.\n\t *\n\t * @example Ambiguous schema (with `preventAmbiguity: false`), and how to disambiguate it using {@link Unhydrated} nodes:\n\t * ```typescript\n\t * const schemaFactory = new SchemaFactory(\"com.example\");\n\t * class Feet extends schemaFactory.object(\"Feet\", { length: schemaFactory.number }) {}\n\t * class Meters extends schemaFactory.object(\"Meters\", { length: schemaFactory.number }) {}\n\t * const config = new TreeViewConfiguration({\n\t * \t// This combination of schema can lead to ambiguous cases and will error if `preventAmbiguity` is true.\n\t * \tschema: [Feet, Meters],\n\t * \tpreventAmbiguity: false,\n\t * });\n\t * const view = tree.viewWith(config);\n\t * // This is invalid since it is ambiguous which type of node is being constructed:\n\t * // view.initialize({ length: 5 });\n\t * // To work, an explicit type can be provided by using an {@link Unhydrated} Node:\n\t * view.initialize(new Meters({ length: 5 }));\n\t * ```\n\t *\n\t * @example Schema disambiguated by adjusting field names, validated with `preventAmbiguity: true:`\n\t * ```typescript\n\t * const schemaFactory = new SchemaFactory(\"com.example\");\n\t * class Feet extends schemaFactory.object(\"Feet\", { length: schemaFactory.number }) {}\n\t * class Meters extends schemaFactory.object(\"Meters\", {\n\t * \t// To avoid ambiguity when parsing unions of Feet and Meters, this renames the length field to \"meters\".\n\t * \t// To preserve compatibility with existing data from the ambiguous case,\n\t * \t// `{ key: \"length\" }` is set, so when persisted in the tree \"length\" is used as the field name.\n\t * \tmeters: schemaFactory.required(schemaFactory.number, { key: \"length\" }),\n\t * }) {}\n\t * const config = new TreeViewConfiguration({\n\t * \t// This combination of schema is not ambiguous because `Feet` and `Meters` have different required keys.\n\t * \tschema: [Feet, Meters],\n\t * \tpreventAmbiguity: true,\n\t * });\n\t * const view = tree.viewWith(config);\n\t * // This now works, since the field is sufficient to determine this is a `Meters` node.\n\t * view.initialize({ meters: 5 });\n\t * ```\n\t *\n\t * @privateRemarks\n\t * In the future, we can support lossless round tripping via the canonical JSON-like representation above when unambiguous.\n\t * This could be done via methods added to `Tree` to export and import such objects, which would give us a place to explicitly define the type of this representation.\n\t *\n\t * To make this more permissive in the future we can:\n\t *\n\t * - Make unhydratedFlexTreeFromInsertable more permissive (ex: allow disambiguation based on leaf type)\n\t * - Update this check to more tightly match unhydratedFlexTreeFromInsertable\n\t * - Add options to help schema authors disambiguate their types, such as \"constant fields\" which are not persisted, and always have a constant value.\n\t *\n\t * The above examples exist in executable form in this files tests, and should be updated there then copied back here.\n\t */\n\treadonly preventAmbiguity?: boolean;\n}\n\nconst defaultTreeConfigurationOptions: Required<ITreeConfigurationOptions> = {\n\tenableSchemaValidation: false,\n\tpreventAmbiguity: false,\n};\n\n/**\n * Property-bag configuration for {@link TreeViewConfiguration} construction.\n * @public\n */\nexport interface ITreeViewConfiguration<\n\tTSchema extends ImplicitFieldSchema = ImplicitFieldSchema,\n> extends ITreeConfigurationOptions {\n\t/**\n\t * The schema which the application wants to view the tree with.\n\t */\n\treadonly schema: TSchema;\n}\n\n/**\n * Configuration for {@link ViewableTree.viewWith}.\n * @sealed @public\n */\nexport class TreeViewConfiguration<\n\tconst TSchema extends ImplicitFieldSchema = ImplicitFieldSchema,\n> implements Required<ITreeViewConfiguration<TSchema>>\n{\n\tprotected _typeCheck!: MakeNominal;\n\n\t/**\n\t * {@inheritDoc ITreeViewConfiguration.schema}\n\t */\n\tpublic readonly schema!: TSchema;\n\n\t/**\n\t * {@inheritDoc ITreeConfigurationOptions.enableSchemaValidation}\n\t */\n\tpublic readonly enableSchemaValidation!: boolean;\n\n\t/**\n\t * {@inheritDoc ITreeConfigurationOptions.preventAmbiguity}\n\t */\n\tpublic readonly preventAmbiguity!: boolean;\n\n\t/**\n\t * {@link TreeSchema.definitions} but with public types.\n\t */\n\tprotected readonly definitionsInternal!: ReadonlyMap<string, TreeNodeSchema>;\n\n\t/**\n\t * Construct a new {@link TreeViewConfiguration}.\n\t *\n\t * @param props - Property bag of configuration options.\n\t *\n\t * @remarks\n\t * Performing this construction deeply validates the provided schema.\n\t * This means that when this constructor is called, all {@link LazyItem} {@link TreeNodeSchema} references will be evaluated (using {@link evaluateLazySchema}).\n\t * This means that the declarations for all transitively reachable {@link TreeNodeSchema} must be available at this time.\n\t *\n\t * For example, a schema reachable from this configuration cannot reference this configuration during its declaration,\n\t * since this would be a cyclic dependency that will cause an error when constructing this configuration.\n\t */\n\tpublic constructor(props: ITreeViewConfiguration<TSchema>) {\n\t\tif (this.constructor === TreeViewConfiguration) {\n\t\t\t// Ensure all TreeViewConfiguration instances are actually TreeViewConfigurationAlpha, allowing `asAlpha` to work correctly.\n\t\t\t// If everything in TreeViewConfigurationAlpha is stabilized and this is removed, the `!` on the properties above should be removed to restore better type safety.\n\t\t\treturn new TreeViewConfigurationAlpha(props);\n\t\t}\n\t\tassert(\n\t\t\t// The type cast here is needed to avoid this assert narrowing \"this\" to never, breaking the code below.\n\t\t\t(this.constructor as unknown) === TreeViewConfigurationAlpha,\n\t\t\t0xc9e /* Invalid configuration class constructed. */,\n\t\t);\n\n\t\tconst config = { ...defaultTreeConfigurationOptions, ...props };\n\t\tthis.schema = config.schema;\n\t\tthis.enableSchemaValidation = config.enableSchemaValidation;\n\t\tthis.preventAmbiguity = config.preventAmbiguity;\n\n\t\t// Ambiguity errors are lower priority to report than invalid schema errors, so collect these in an array and report them all at once.\n\t\tconst ambiguityErrors: string[] = [];\n\n\t\t// Eagerly perform this conversion to surface errors sooner.\n\t\t// Includes detection of duplicate schema identifiers.\n\t\ttoStoredSchema(config.schema, restrictiveStoredSchemaGenerationOptions);\n\t\ttoStoredSchema(config.schema, permissiveStoredSchemaGenerationOptions);\n\n\t\tconst definitions = new Map<string, SimpleNodeSchema & TreeNodeSchema>();\n\n\t\twalkFieldSchema(config.schema, {\n\t\t\tnode: (schema) => {\n\t\t\t\t// Ensure all reachable schema are marked as most derived.\n\t\t\t\t// This ensures if multiple schema extending the same schema factory generated class are present (or have had instances of them constructed, or get instances of them constructed in the future),\n\t\t\t\t// an error is reported.\n\t\t\t\tmarkSchemaMostDerived(schema, true);\n\n\t\t\t\tdebugAssert(() => !definitions.has(schema.identifier));\n\t\t\t\tdefinitions.set(schema.identifier, schema as SimpleNodeSchema & TreeNodeSchema);\n\t\t\t},\n\t\t\tallowedTypes({ types }: AllowedTypesFullEvaluated): void {\n\t\t\t\tcheckUnion(\n\t\t\t\t\ttypes.map((t) => t.type),\n\t\t\t\t\tconfig.preventAmbiguity,\n\t\t\t\t\tambiguityErrors,\n\t\t\t\t);\n\t\t\t},\n\t\t});\n\n\t\tthis.definitionsInternal = definitions;\n\n\t\tif (ambiguityErrors.length !== 0) {\n\t\t\t// Duplicate errors are common since when two types conflict, both orders error:\n\t\t\tconst deduplicated = new Set(ambiguityErrors);\n\t\t\tthrow new UsageError(`Ambiguous schema found:\\n${[...deduplicated].join(\"\\n\")}`);\n\t\t}\n\t}\n}\n\n/**\n * {@link TreeViewConfiguration} extended with some alpha APIs.\n * @remarks\n * See {@link (asAlpha:2)} for an API to downcast from {@link TreeViewConfiguration} to this type.\n * @sealed @alpha\n */\nexport class TreeViewConfigurationAlpha<\n\t\tconst TSchema extends ImplicitFieldSchema = ImplicitFieldSchema,\n\t>\n\textends TreeViewConfiguration<TSchema>\n\timplements TreeSchema\n{\n\t/**\n\t * {@inheritDoc TreeSchema.root}\n\t */\n\tpublic readonly root: FieldSchemaAlpha;\n\n\t/**\n\t * {@inheritDoc TreeSchema.definitions}\n\t */\n\tpublic get definitions(): ReadonlyMap<string, SimpleNodeSchema & TreeNodeSchema> {\n\t\treturn this.definitionsInternal as ReadonlyMap<string, SimpleNodeSchema & TreeNodeSchema>;\n\t}\n\n\tpublic constructor(props: ITreeViewConfiguration<TSchema>) {\n\t\tsuper(props);\n\t\tthis.root = normalizeFieldSchema(props.schema);\n\t}\n}\n\n/**\n * {@link TreeViewConfigurationAlpha}\n * @sealed @alpha\n */\nexport interface TreeSchema extends SimpleTreeSchema {\n\t/**\n\t * {@inheritDoc SimpleTreeSchema.root}\n\t */\n\treadonly root: FieldSchemaAlpha;\n\n\t/**\n\t * {@inheritDoc SimpleTreeSchema.definitions}\n\t */\n\treadonly definitions: ReadonlyMap<string, SimpleNodeSchema & TreeNodeSchema>;\n}\n\n/**\n * Pretty print a set of types for use in error messages.\n */\nfunction formatTypes(allowed: Iterable<TreeNodeSchema>): string {\n\t// Use JSON.stringify to quote and escape identifiers.\n\t// Don't just use a single array JSON.stringify since that omits spaces between items\n\treturn `[${Array.from(allowed, (s) => JSON.stringify(s.identifier)).join(\", \")}]`;\n}\n\n/**\n * Check if union contents are valid (shallowly).\n *\n * @param union - The union of {@link TreeNodeSchema} to check.\n * @param preventAmbiguity - If true, detect cases documented in {@link ITreeConfigurationOptions.preventAmbiguity}, reporting them to `ambiguityErrors`.\n * @param ambiguityErrors - An array into which this function inserts any ambiguity errors, see {@link ITreeConfigurationOptions.preventAmbiguity}.\n *\n * @remarks\n * Includes checks for non-ambiguity errors as well: such as duplicate schemas in the union.\n * Any non-ambiguity errors are thrown as exceptions: `UsageError`s if causable by incorrect API use, and asserts if violating internal invariants.\n */\nexport function checkUnion(\n\tunion: Iterable<TreeNodeSchema>,\n\tpreventAmbiguity: boolean,\n\tambiguityErrors: string[],\n): void {\n\tconst checked: Set<TreeNodeSchema> = new Set();\n\tconst maps: MapNodeSchema[] = [];\n\tconst arrays: ArrayNodeSchema[] = [];\n\tconst records: RecordNodeSchema[] = [];\n\tconst objects: ObjectNodeSchema[] = [];\n\n\t// Map from key to schema using that key\n\tconst allObjectKeys: Map<string, Set<TreeNodeSchema>> = new Map();\n\n\tfor (const schema of union) {\n\t\tif (checked.has(schema)) {\n\t\t\tthrow new UsageError(`Duplicate schema in allowed types: ${schema.identifier}`);\n\t\t}\n\t\tchecked.add(schema);\n\n\t\tswitch (schema.kind) {\n\t\t\tcase NodeKind.Leaf: {\n\t\t\t\t// nothing to do\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase NodeKind.Object: {\n\t\t\t\tassert(isObjectNodeSchema(schema), 0xbde /* Expected object schema. */);\n\t\t\t\tobjects.push(schema);\n\t\t\t\tfor (const key of schema.fields.keys()) {\n\t\t\t\t\tgetOrCreate(allObjectKeys, key, () => new Set()).add(schema);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase NodeKind.Array: {\n\t\t\t\tassert(isArrayNodeSchema(schema), 0xbdf /* Expected array schema. */);\n\t\t\t\tarrays.push(schema);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase NodeKind.Map: {\n\t\t\t\tassert(isMapNodeSchema(schema), 0xbe0 /* Expected map schema. */);\n\t\t\t\tmaps.push(schema);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase NodeKind.Record: {\n\t\t\t\tassert(isRecordNodeSchema(schema), 0xbe1 /* Expected record schema. */);\n\t\t\t\trecords.push(schema);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(schema.kind);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!preventAmbiguity) {\n\t\t// All remaining checks are for the preventAmbiguity case, so skip them if not enabled.\n\t\treturn;\n\t}\n\n\tif (arrays.length > 1) {\n\t\tambiguityErrors.push(\n\t\t\t`More than one kind of array allowed within union (${formatTypes(arrays)}). This would require type disambiguation which is not supported by arrays during import or export.`,\n\t\t);\n\t}\n\n\tif (maps.length > 1) {\n\t\tambiguityErrors.push(\n\t\t\t`More than one kind of map allowed within union (${formatTypes(maps)}). This would require type disambiguation which is not supported by maps during import or export.`,\n\t\t);\n\t}\n\n\tif (records.length > 1) {\n\t\tambiguityErrors.push(\n\t\t\t`More than one kind of record allowed within union (${formatTypes(records)}). This would require type disambiguation which is not supported by records during import or export.`,\n\t\t);\n\t}\n\n\tif (maps.length > 0 && arrays.length > 0) {\n\t\tambiguityErrors.push(\n\t\t\t`Both a map and an array allowed within union (${formatTypes([...arrays, ...maps])}). Both can be implicitly constructed from iterables like arrays, which are ambiguous when the array is empty.`,\n\t\t);\n\t}\n\n\tconst nodeKindListEntries = [];\n\tif (objects.length > 0) {\n\t\tnodeKindListEntries.push(\"objects\");\n\t}\n\tif (maps.length > 0) {\n\t\tnodeKindListEntries.push(\"maps\");\n\t}\n\tif (records.length > 0) {\n\t\tnodeKindListEntries.push(\"records\");\n\t}\n\tif (nodeKindListEntries.length > 1) {\n\t\tconst nodeKindListString =\n\t\t\tnodeKindListEntries.length === 2\n\t\t\t\t? `${nodeKindListEntries[0] ?? oob()} and ${nodeKindListEntries[1] ?? oob()}`\n\t\t\t\t: `${nodeKindListEntries.slice(0, -1).join(\", \")}, and ${nodeKindListEntries[nodeKindListEntries.length - 1]}`;\n\t\tambiguityErrors.push(\n\t\t\t`A combination of ${nodeKindListString} is allowed within union (${formatTypes([...objects, ...maps, ...records])}). These can be constructed from objects and can be ambiguous.`,\n\t\t);\n\t}\n\n\t// Check for objects which fully overlap:\n\tfor (const schema of objects) {\n\t\t// All objects which might be ambiguous relative to `schema`.\n\t\tconst possiblyAmbiguous = new Set(objects);\n\n\t\t// A schema can't be ambiguous with itself\n\t\tpossiblyAmbiguous.delete(schema);\n\n\t\t// For each field of schema, remove schema from possiblyAmbiguous that do not have that field\n\t\tfor (const [key, field] of schema.fields) {\n\t\t\tif (field.kind === FieldKind.Required) {\n\t\t\t\tconst withKey = allObjectKeys.get(key) ?? fail(0xb35 /* missing schema */);\n\t\t\t\tfor (const candidate of possiblyAmbiguous) {\n\t\t\t\t\tif (!withKey.has(candidate)) {\n\t\t\t\t\t\tpossiblyAmbiguous.delete(candidate);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (possiblyAmbiguous.size > 0) {\n\t\t\t// TODO: make this check more permissive.\n\t\t\t// Allow using the type of the field to disambiguate, at least for leaf types.\n\t\t\t// Add \"constant\" fields which can be used to disambiguate even more cases without adding persisted data: maybe make them optional in constructor?\n\t\t\t// Consider separating unambiguous implicit construction format from constructor arguments at type level, allowing constructor to superset the implicit construction options (ex: optional constant fields).\n\t\t\t// The policy here however must remain at least as conservative as shallowCompatibilityTest in src/simple-tree/unhydratedFlexTreeFromInsertable.ts.\n\n\t\t\tambiguityErrors.push(\n\t\t\t\t`The required fields of ${JSON.stringify(schema.identifier)} are insufficient to differentiate it from the following types: ${formatTypes(possiblyAmbiguous)}. For objects to be considered unambiguous, each must have required fields that do not all occur on any other object in the union.`,\n\t\t\t);\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../src/simple-tree/api/configuration.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAyF;AACzF,uEAAsE;AAEtE,sDAA+F;AAC/F,+CAI0B;AAC1B,4DAI8B;AAC9B,qDASgC;AAChC,kDAAkD;AAElD,8DAAwD;AAExD,oDAAqE;AAsGrE,MAAM,+BAA+B,GAAwC;IAC5E,sBAAsB,EAAE,KAAK;IAC7B,gBAAgB,EAAE,KAAK;CACvB,CAAC;AAeF;;;GAGG;AACH,MAAa,qBAAqB;IAqBjC;;;;;;;;;;;;OAYG;IACH,YAAmB,KAAsC;QACxD,IAAI,IAAI,CAAC,WAAW,KAAK,qBAAqB,EAAE,CAAC;YAChD,4HAA4H;YAC5H,kKAAkK;YAClK,OAAO,IAAI,0BAA0B,CAAC,KAAK,CAAC,CAAC;QAC9C,CAAC;QACD,IAAA,iBAAM;QACL,wGAAwG;QACvG,IAAI,CAAC,WAAuB,KAAK,0BAA0B,EAC5D,KAAK,CAAC,8CAA8C,CACpD,CAAC;QAEF,MAAM,MAAM,GAAG,EAAE,GAAG,+BAA+B,EAAE,GAAG,KAAK,EAAE,CAAC;QAChE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,sBAAsB,GAAG,MAAM,CAAC,sBAAsB,CAAC;QAC5D,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;QAEhD,sIAAsI;QACtI,MAAM,eAAe,GAAa,EAA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AE,GAAG,OAAO,CAAC,CAAC,gEAAgE,CACjL,CAAC;IACH,CAAC;IAED,yCAAyC;IACzC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC9B,6DAA6D;QAC7D,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;QAE3C,0CAA0C;QAC1C,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAEjC,6FAA6F;QAC7F,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAC1C,IAAI,KAAK,CAAC,IAAI,KAAK,0BAAS,CAAC,QAAQ,EAAE,CAAC;gBACvC,MAAM,OAAO,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAA,eAAI,EAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;gBAC3E,KAAK,MAAM,SAAS,IAAI,iBAAiB,EAAE,CAAC;oBAC3C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;wBAC7B,iBAAiB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;oBACrC,CAAC;gBACF,CAAC;YACF,CAAC;QACF,CAAC;QAED,IAAI,iBAAiB,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YAChC,yCAAyC;YACzC,8EAA8E;YAC9E,kJAAkJ;YAClJ,4MAA4M;YAC5M,mJAAmJ;YAEnJ,eAAe,CAAC,IAAI,CACnB,0BAA0B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,mEAAmE,WAAW,CAAC,iBAAiB,CAAC,oIAAoI,CAChS,CAAC;QACH,CAAC;IACF,CAAC;AACF,CAAC;AAvID,gCAuIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail, oob, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { type FieldSchemaAlpha, type ImplicitFieldSchema, FieldKind } from \"../fieldSchema.js\";\nimport {\n\ttype AllowedTypesFullEvaluated,\n\tNodeKind,\n\ttype TreeNodeSchema,\n} from \"../core/index.js\";\nimport {\n\ttoInitialSchema,\n\ttoUnhydratedSchema,\n\ttransformSimpleSchema,\n} from \"../toStoredSchema.js\";\nimport {\n\tisArrayNodeSchema,\n\tisMapNodeSchema,\n\tisObjectNodeSchema,\n\tisRecordNodeSchema,\n\ttype ArrayNodeSchema,\n\ttype MapNodeSchema,\n\ttype ObjectNodeSchema,\n\ttype RecordNodeSchema,\n} from \"../node-kinds/index.js\";\nimport { getOrCreate } from \"../../util/index.js\";\nimport type { MakeNominal } from \"../../util/index.js\";\nimport { walkFieldSchema } from \"../walkFieldSchema.js\";\nimport type { SchemaType, SimpleNodeSchema } from \"../simpleSchema.js\";\nimport { createTreeSchema, type TreeSchema } from \"../treeSchema.js\";\n\n/**\n * Options when constructing a tree view.\n * @public\n */\nexport interface ITreeConfigurationOptions {\n\t/**\n\t * If `true`, the tree will perform additional validation of content against its stored schema\n\t * and throw an error if the new content doesn't match the expected schema.\n\t *\n\t * @defaultValue `false`.\n\t *\n\t * @remarks\n\t * Currently most cases already have some schema validation, so this is mainly for additional validation which may be useful when debugging issues,\n\t * working with untyped APIs, or when the small performance overhead is a non-issue.\n\t *\n\t * Enabling schema validation has a performance penalty when inserting new content into the tree because\n\t * additional checks are done. Enable this option only in scenarios where you are ok with that operation being a\n\t * bit slower.\n\t *\n\t * For additional validation in more cases, see {@link ForestTypeExpensiveDebug}.\n\t */\n\tenableSchemaValidation?: boolean;\n\n\t/**\n\t * A flag used to opt into strict rules ensuring that the schema avoids cases which can make the type of nodes ambiguous when importing or exporting data.\n\t * @defaultValue `false`.\n\t *\n\t * @remarks\n\t * When this is true, it ensures that the compile time type safety for data when constructing nodes is sufficient to ensure that the runtime behavior will not give node data ambiguity errors.\n\t *\n\t * This ensures that the canonical JSON-like representation of all unions in the tree are lossless and unambiguous.\n\t * This canonical JSON-like representation consists of arrays, plain old JavaScript objects with string keys, booleans, numbers (excluding NaN, -0 and infinities), strings, null and {@link @fluidframework/core-interfaces#IFluidHandle}s.\n\t * It is compatible with the node creation APIs (such as schema class constructors) and is also compatible with JSON assuming any IFluidHandles get special handling (since they are not JSON compatible).\n\t * Currently these cases can cause ambiguity in a union:\n\t *\n\t * - More than one ArrayNode type: it's impossible to tell which array type is intended in the case of empty arrays (`[]`).\n\t *\n\t * - More than one MapNode type: it's impossible to tell which map type is intended in the case of an empty map (`{}`).\n\t *\n\t * - Both a MapNode and an ArrayNode: this case is not a problem for the canonical JSON representation, but is an issue when constructing from an Iterable, which is supported for both MapNode and ArrayNode.\n\t *\n\t * - Both a MapNode and an ObjectNode: when the input is valid for the ObjectNode, the current parser always considers it ambiguous with being a MapNode.\n\t *\n\t * - ObjectNodes which have fields (required or optional) which include all required fields of another ObjectNode: currently each ObjectNode is differentiated by the presence of its required fields.\n\t *\n\t * This check is conservative: some complex cases may error if the current simple algorithm cannot show no ambiguity is possible.\n\t * This check may become more permissive over time.\n\t *\n\t * @example Ambiguous schema (with `preventAmbiguity: false`), and how to disambiguate it using {@link Unhydrated} nodes:\n\t * ```typescript\n\t * const schemaFactory = new SchemaFactory(\"com.example\");\n\t * class Feet extends schemaFactory.object(\"Feet\", { length: schemaFactory.number }) {}\n\t * class Meters extends schemaFactory.object(\"Meters\", { length: schemaFactory.number }) {}\n\t * const config = new TreeViewConfiguration({\n\t * \t// This combination of schema can lead to ambiguous cases and will error if `preventAmbiguity` is true.\n\t * \tschema: [Feet, Meters],\n\t * \tpreventAmbiguity: false,\n\t * });\n\t * const view = tree.viewWith(config);\n\t * // This is invalid since it is ambiguous which type of node is being constructed:\n\t * // view.initialize({ length: 5 });\n\t * // To work, an explicit type can be provided by using an {@link Unhydrated} Node:\n\t * view.initialize(new Meters({ length: 5 }));\n\t * ```\n\t *\n\t * @example Schema disambiguated by adjusting field names, validated with `preventAmbiguity: true:`\n\t * ```typescript\n\t * const schemaFactory = new SchemaFactory(\"com.example\");\n\t * class Feet extends schemaFactory.object(\"Feet\", { length: schemaFactory.number }) {}\n\t * class Meters extends schemaFactory.object(\"Meters\", {\n\t * \t// To avoid ambiguity when parsing unions of Feet and Meters, this renames the length field to \"meters\".\n\t * \t// To preserve compatibility with existing data from the ambiguous case,\n\t * \t// `{ key: \"length\" }` is set, so when persisted in the tree \"length\" is used as the field name.\n\t * \tmeters: schemaFactory.required(schemaFactory.number, { key: \"length\" }),\n\t * }) {}\n\t * const config = new TreeViewConfiguration({\n\t * \t// This combination of schema is not ambiguous because `Feet` and `Meters` have different required keys.\n\t * \tschema: [Feet, Meters],\n\t * \tpreventAmbiguity: true,\n\t * });\n\t * const view = tree.viewWith(config);\n\t * // This now works, since the field is sufficient to determine this is a `Meters` node.\n\t * view.initialize({ meters: 5 });\n\t * ```\n\t *\n\t * @privateRemarks\n\t * In the future, we can support lossless round tripping via the canonical JSON-like representation above when unambiguous.\n\t * This could be done via methods added to `Tree` to export and import such objects, which would give us a place to explicitly define the type of this representation.\n\t *\n\t * To make this more permissive in the future we can:\n\t *\n\t * - Make unhydratedFlexTreeFromInsertable more permissive (ex: allow disambiguation based on leaf type)\n\t * - Update this check to more tightly match unhydratedFlexTreeFromInsertable\n\t * - Add options to help schema authors disambiguate their types, such as \"constant fields\" which are not persisted, and always have a constant value.\n\t *\n\t * The above examples exist in executable form in this files tests, and should be updated there then copied back here.\n\t */\n\treadonly preventAmbiguity?: boolean;\n}\n\nconst defaultTreeConfigurationOptions: Required<ITreeConfigurationOptions> = {\n\tenableSchemaValidation: false,\n\tpreventAmbiguity: false,\n};\n\n/**\n * Property-bag configuration for {@link TreeViewConfiguration} construction.\n * @public\n */\nexport interface ITreeViewConfiguration<\n\tTSchema extends ImplicitFieldSchema = ImplicitFieldSchema,\n> extends ITreeConfigurationOptions {\n\t/**\n\t * The schema which the application wants to view the tree with.\n\t */\n\treadonly schema: TSchema;\n}\n\n/**\n * Configuration for {@link ViewableTree.viewWith}.\n * @sealed @public\n */\nexport class TreeViewConfiguration<\n\tconst TSchema extends ImplicitFieldSchema = ImplicitFieldSchema,\n> implements Required<ITreeViewConfiguration<TSchema>>\n{\n\tprotected _typeCheck!: MakeNominal;\n\n\t/**\n\t * {@inheritDoc ITreeViewConfiguration.schema}\n\t */\n\tpublic readonly schema!: TSchema;\n\n\t/**\n\t * {@inheritDoc ITreeConfigurationOptions.enableSchemaValidation}\n\t */\n\tpublic readonly enableSchemaValidation!: boolean;\n\n\t/**\n\t * {@inheritDoc ITreeConfigurationOptions.preventAmbiguity}\n\t */\n\tpublic readonly preventAmbiguity!: boolean;\n\n\t/**\n\t * Construct a new {@link TreeViewConfiguration}.\n\t *\n\t * @param props - Property bag of configuration options.\n\t *\n\t * @remarks\n\t * Performing this construction deeply validates the provided schema.\n\t * This means that when this constructor is called, all {@link LazyItem} {@link TreeNodeSchema} references will be evaluated (using {@link evaluateLazySchema}).\n\t * This means that the declarations for all transitively reachable {@link TreeNodeSchema} must be available at this time.\n\t *\n\t * For example, a schema reachable from this configuration cannot reference this configuration during its declaration,\n\t * since this would be a cyclic dependency that will cause an error when constructing this configuration.\n\t */\n\tpublic constructor(props: ITreeViewConfiguration<TSchema>) {\n\t\tif (this.constructor === TreeViewConfiguration) {\n\t\t\t// Ensure all TreeViewConfiguration instances are actually TreeViewConfigurationAlpha, allowing `asAlpha` to work correctly.\n\t\t\t// If everything in TreeViewConfigurationAlpha is stabilized and this is removed, the `!` on the properties above should be removed to restore better type safety.\n\t\t\treturn new TreeViewConfigurationAlpha(props);\n\t\t}\n\t\tassert(\n\t\t\t// The type cast here is needed to avoid this assert narrowing \"this\" to never, breaking the code below.\n\t\t\t(this.constructor as unknown) === TreeViewConfigurationAlpha,\n\t\t\t0xc9e /* Invalid configuration class constructed. */,\n\t\t);\n\n\t\tconst config = { ...defaultTreeConfigurationOptions, ...props };\n\t\tthis.schema = config.schema;\n\t\tthis.enableSchemaValidation = config.enableSchemaValidation;\n\t\tthis.preventAmbiguity = config.preventAmbiguity;\n\n\t\t// Ambiguity errors are lower priority to report than invalid schema errors, so collect these in an array and report them all at once.\n\t\tconst ambiguityErrors: string[] = [];\n\n\t\t// Validate the schema and collect ambiguity errors.\n\t\t// This does a lot of validation (throwing usage errors as a side effect) in addition to just collecting ambiguity errors.\n\t\t// ambiguityErrors are considered a lower priority, so only thrown if no other errors are found.\n\t\twalkFieldSchema(config.schema, {\n\t\t\tallowedTypes({ types }: AllowedTypesFullEvaluated): void {\n\t\t\t\tcheckUnion(\n\t\t\t\t\ttypes.map((t) => t.type),\n\t\t\t\t\tconfig.preventAmbiguity,\n\t\t\t\t\tambiguityErrors,\n\t\t\t\t);\n\t\t\t},\n\t\t});\n\n\t\tif (ambiguityErrors.length !== 0) {\n\t\t\t// Duplicate errors are common since when two types conflict, both orders error:\n\t\t\tconst deduplicated = new Set(ambiguityErrors);\n\t\t\tthrow new UsageError(`Ambiguous schema found:\\n${[...deduplicated].join(\"\\n\")}`);\n\t\t}\n\t}\n}\n\n/**\n * {@link TreeViewConfiguration} extended with some alpha APIs.\n * @remarks\n * See {@link (asAlpha:2)} for an API to downcast from {@link TreeViewConfiguration} to this type.\n * @sealed @alpha\n */\nexport class TreeViewConfigurationAlpha<\n\t\tconst TSchema extends ImplicitFieldSchema = ImplicitFieldSchema,\n\t>\n\textends TreeViewConfiguration<TSchema>\n\timplements TreeSchema\n{\n\tpublic readonly root: FieldSchemaAlpha;\n\tpublic readonly definitions: ReadonlyMap<\n\t\tstring,\n\t\tSimpleNodeSchema<SchemaType.View> & TreeNodeSchema\n\t>;\n\n\tpublic constructor(props: ITreeViewConfiguration<TSchema>) {\n\t\tsuper(props);\n\t\tconst treeSchema = createTreeSchema(this.schema);\n\t\tthis.root = treeSchema.root;\n\t\tthis.definitions = treeSchema.definitions;\n\n\t\t// Eagerly perform these conversions to surface errors sooner.\n\t\ttoInitialSchema(this.root);\n\t\ttransformSimpleSchema(treeSchema, toUnhydratedSchema);\n\t}\n}\n\n/**\n * Pretty print a set of types for use in error messages.\n */\nfunction formatTypes(allowed: Iterable<TreeNodeSchema>): string {\n\t// Use JSON.stringify to quote and escape identifiers.\n\t// Don't just use a single array JSON.stringify since that omits spaces between items\n\treturn `[${Array.from(allowed, (s) => JSON.stringify(s.identifier)).join(\", \")}]`;\n}\n\n/**\n * Check if union contents are valid (shallowly).\n *\n * @param union - The union of {@link TreeNodeSchema} to check.\n * @param preventAmbiguity - If true, detect cases documented in {@link ITreeConfigurationOptions.preventAmbiguity}, reporting them to `ambiguityErrors`.\n * @param ambiguityErrors - An array into which this function inserts any ambiguity errors, see {@link ITreeConfigurationOptions.preventAmbiguity}.\n *\n * @remarks\n * Includes checks for non-ambiguity errors as well: such as duplicate schemas in the union.\n * Any non-ambiguity errors are thrown as exceptions: `UsageError`s if causable by incorrect API use, and asserts if violating internal invariants.\n */\nexport function checkUnion(\n\tunion: Iterable<TreeNodeSchema>,\n\tpreventAmbiguity: boolean,\n\tambiguityErrors: string[],\n): void {\n\tconst checked: Set<TreeNodeSchema> = new Set();\n\tconst maps: MapNodeSchema[] = [];\n\tconst arrays: ArrayNodeSchema[] = [];\n\tconst records: RecordNodeSchema[] = [];\n\tconst objects: ObjectNodeSchema[] = [];\n\n\t// Map from key to schema using that key\n\tconst allObjectKeys: Map<string, Set<TreeNodeSchema>> = new Map();\n\n\tfor (const schema of union) {\n\t\tif (checked.has(schema)) {\n\t\t\tthrow new UsageError(`Duplicate schema in allowed types: ${schema.identifier}`);\n\t\t}\n\t\tchecked.add(schema);\n\n\t\tswitch (schema.kind) {\n\t\t\tcase NodeKind.Leaf: {\n\t\t\t\t// nothing to do\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase NodeKind.Object: {\n\t\t\t\tassert(isObjectNodeSchema(schema), 0xbde /* Expected object schema. */);\n\t\t\t\tobjects.push(schema);\n\t\t\t\tfor (const key of schema.fields.keys()) {\n\t\t\t\t\tgetOrCreate(allObjectKeys, key, () => new Set()).add(schema);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase NodeKind.Array: {\n\t\t\t\tassert(isArrayNodeSchema(schema), 0xbdf /* Expected array schema. */);\n\t\t\t\tarrays.push(schema);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase NodeKind.Map: {\n\t\t\t\tassert(isMapNodeSchema(schema), 0xbe0 /* Expected map schema. */);\n\t\t\t\tmaps.push(schema);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase NodeKind.Record: {\n\t\t\t\tassert(isRecordNodeSchema(schema), 0xbe1 /* Expected record schema. */);\n\t\t\t\trecords.push(schema);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(schema.kind);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!preventAmbiguity) {\n\t\t// All remaining checks are for the preventAmbiguity case, so skip them if not enabled.\n\t\treturn;\n\t}\n\n\tif (arrays.length > 1) {\n\t\tambiguityErrors.push(\n\t\t\t`More than one kind of array allowed within union (${formatTypes(arrays)}). This would require type disambiguation which is not supported by arrays during import or export.`,\n\t\t);\n\t}\n\n\tif (maps.length > 1) {\n\t\tambiguityErrors.push(\n\t\t\t`More than one kind of map allowed within union (${formatTypes(maps)}). This would require type disambiguation which is not supported by maps during import or export.`,\n\t\t);\n\t}\n\n\tif (records.length > 1) {\n\t\tambiguityErrors.push(\n\t\t\t`More than one kind of record allowed within union (${formatTypes(records)}). This would require type disambiguation which is not supported by records during import or export.`,\n\t\t);\n\t}\n\n\tif (maps.length > 0 && arrays.length > 0) {\n\t\tambiguityErrors.push(\n\t\t\t`Both a map and an array allowed within union (${formatTypes([...arrays, ...maps])}). Both can be implicitly constructed from iterables like arrays, which are ambiguous when the array is empty.`,\n\t\t);\n\t}\n\n\tconst nodeKindListEntries = [];\n\tif (objects.length > 0) {\n\t\tnodeKindListEntries.push(\"objects\");\n\t}\n\tif (maps.length > 0) {\n\t\tnodeKindListEntries.push(\"maps\");\n\t}\n\tif (records.length > 0) {\n\t\tnodeKindListEntries.push(\"records\");\n\t}\n\tif (nodeKindListEntries.length > 1) {\n\t\tconst nodeKindListString =\n\t\t\tnodeKindListEntries.length === 2\n\t\t\t\t? `${nodeKindListEntries[0] ?? oob()} and ${nodeKindListEntries[1] ?? oob()}`\n\t\t\t\t: `${nodeKindListEntries.slice(0, -1).join(\", \")}, and ${nodeKindListEntries[nodeKindListEntries.length - 1]}`;\n\t\tambiguityErrors.push(\n\t\t\t`A combination of ${nodeKindListString} is allowed within union (${formatTypes([...objects, ...maps, ...records])}). These can be constructed from objects and can be ambiguous.`,\n\t\t);\n\t}\n\n\t// Check for objects which fully overlap:\n\tfor (const schema of objects) {\n\t\t// All objects which might be ambiguous relative to `schema`.\n\t\tconst possiblyAmbiguous = new Set(objects);\n\n\t\t// A schema can't be ambiguous with itself\n\t\tpossiblyAmbiguous.delete(schema);\n\n\t\t// For each field of schema, remove schema from possiblyAmbiguous that do not have that field\n\t\tfor (const [key, field] of schema.fields) {\n\t\t\tif (field.kind === FieldKind.Required) {\n\t\t\t\tconst withKey = allObjectKeys.get(key) ?? fail(0xb35 /* missing schema */);\n\t\t\t\tfor (const candidate of possiblyAmbiguous) {\n\t\t\t\t\tif (!withKey.has(candidate)) {\n\t\t\t\t\t\tpossiblyAmbiguous.delete(candidate);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (possiblyAmbiguous.size > 0) {\n\t\t\t// TODO: make this check more permissive.\n\t\t\t// Allow using the type of the field to disambiguate, at least for leaf types.\n\t\t\t// Add \"constant\" fields which can be used to disambiguate even more cases without adding persisted data: maybe make them optional in constructor?\n\t\t\t// Consider separating unambiguous implicit construction format from constructor arguments at type level, allowing constructor to superset the implicit construction options (ex: optional constant fields).\n\t\t\t// The policy here however must remain at least as conservative as shallowCompatibilityTest in src/simple-tree/unhydratedFlexTreeFromInsertable.ts.\n\n\t\t\tambiguityErrors.push(\n\t\t\t\t`The required fields of ${JSON.stringify(schema.identifier)} are insufficient to differentiate it from the following types: ${formatTypes(possiblyAmbiguous)}. For objects to be considered unambiguous, each must have required fields that do not all occur on any other object in the union.`,\n\t\t\t);\n\t\t}\n\t}\n}\n"]}
|
|
@@ -11,6 +11,10 @@ import type { ImplicitFieldSchema } from "../fieldSchema.js";
|
|
|
11
11
|
* * "new": The node was added.
|
|
12
12
|
* * "changed": A direct child was updated, added, removed, or moved (and the node is not "new").
|
|
13
13
|
* * "moved": The node was moved between/within arrays (and the node is not "new" or "changed").
|
|
14
|
+
* @privateRemarks
|
|
15
|
+
* It is unclear how this will handle forward compatibility with other kinds of edits, like moves that are not limited to arrays (attach, detach, swap):
|
|
16
|
+
* this needs to be sorted out before this is stabilized.
|
|
17
|
+
* It is also unclear how this is supposed to handle schema changes (which can result in new TreeNode instance, but I think won't trigger "new" here).
|
|
14
18
|
* @alpha
|
|
15
19
|
*/
|
|
16
20
|
export type DirtyTreeStatus = "new" | "changed" | "moved";
|
|
@@ -37,6 +41,13 @@ export interface DirtyTreeMap {
|
|
|
37
41
|
* console.log(`The root of the tree is ${dirty.get(view.root) ?? "unchanged"}`);
|
|
38
42
|
* stopTracking();
|
|
39
43
|
* ```
|
|
44
|
+
* @privateRemarks
|
|
45
|
+
* This provides an opportunity for user code ("set" on dirty) to run during forest changes, in the middle of processing an edit.
|
|
46
|
+
* We have generally avoided exposing such times to users and instead flush events after the edit has finished and user facing invariants are known to be restored.
|
|
47
|
+
* Before stabilizing, how this event relates to other events time/ordering wise should be clarified, and if any APIs have been provided to defer events, that mentioned as well.
|
|
48
|
+
* Maybe updates should be deferred?
|
|
49
|
+
*
|
|
50
|
+
* This is also documented in terms of "forest" which is not a concept in the public API, and thus needs to be redefined in terms of public concepts.
|
|
40
51
|
* @alpha
|
|
41
52
|
*/
|
|
42
53
|
export declare function trackDirtyNodes(view: TreeViewAlpha<ImplicitFieldSchema>, dirty: DirtyTreeMap): () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dirtyIndex.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/dirtyIndex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,EAAE,QAAQ,EAAsB,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D
|
|
1
|
+
{"version":3,"file":"dirtyIndex.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/dirtyIndex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,EAAE,QAAQ,EAAsB,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,CAAC;AAE1D;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC5B,GAAG,CAAC,IAAI,EAAE,QAAQ,GAAG,eAAe,GAAG,SAAS,CAAC;IACjD,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;CACnD;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,eAAe,CAC9B,IAAI,EAAE,aAAa,CAAC,mBAAmB,CAAC,EACxC,KAAK,EAAE,YAAY,GACjB,MAAM,IAAI,CAOZ"}
|
|
@@ -22,6 +22,13 @@ const index_js_2 = require("../core/index.js");
|
|
|
22
22
|
* console.log(`The root of the tree is ${dirty.get(view.root) ?? "unchanged"}`);
|
|
23
23
|
* stopTracking();
|
|
24
24
|
* ```
|
|
25
|
+
* @privateRemarks
|
|
26
|
+
* This provides an opportunity for user code ("set" on dirty) to run during forest changes, in the middle of processing an edit.
|
|
27
|
+
* We have generally avoided exposing such times to users and instead flush events after the edit has finished and user facing invariants are known to be restored.
|
|
28
|
+
* Before stabilizing, how this event relates to other events time/ordering wise should be clarified, and if any APIs have been provided to defer events, that mentioned as well.
|
|
29
|
+
* Maybe updates should be deferred?
|
|
30
|
+
*
|
|
31
|
+
* This is also documented in terms of "forest" which is not a concept in the public API, and thus needs to be redefined in terms of public concepts.
|
|
25
32
|
* @alpha
|
|
26
33
|
*/
|
|
27
34
|
function trackDirtyNodes(view, dirty) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dirtyIndex.js","sourceRoot":"","sources":["../../../src/simple-tree/api/dirtyIndex.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAC7D,kDAO6B;AAC7B,+CAAgE;AAyBhE;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,eAAe,CAC9B,IAAwC,EACxC,KAAmB;IAEnB,MAAM,MAAM,GAAI,IAAwD,CAAC,QAAQ,CAAC,MAAM,CAAC;IACzF,MAAM,gBAAgB,GAAG,GAAqB,EAAE,CAAC,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACnF,MAAM,CAAC,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;IAClD,OAAO,GAAG,EAAE;QACX,MAAM,CAAC,0BAA0B,CAAC,gBAAgB,CAAC,CAAC;IACrD,CAAC,CAAC;AACH,CAAC;AAVD,0CAUC;AAED,SAAS,kBAAkB,CAAC,MAAuB,EAAE,KAAmB;IACvE,uHAAuH;IACvH,6FAA6F;IAC7F,IAAI,WAAiC,CAAC;IACtC,IAAI,MAA0B,CAAC;IAE/B,OAAO,IAAA,iCAAsB,EAAC;QAC7B,YAAY,EAAE,CAAC,GAAG,EAAE,EAAE;YACrB,IAAA,iBAAM,EAAC,MAAM,KAAK,SAAS,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;YACxD,IAAA,i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MAAM,CAAC,CAAC;IACtC,IAAA,iBAAM,EAAC,MAAM,CAAC,IAAI,qCAA6B,EAAE,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAC7F,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IACpC,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACjD,MAAM,CAAC,IAAI,EAAE,CAAC;IACd,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,IAAA,6BAAkB,EAAC,UAAU,CAAC,CAAC;QAC5C,IAAI,IAAI,YAAY,mBAAQ,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tcreateAnnouncedVisitor,\n\tCursorLocationType,\n\ttype AnnouncedVisitor,\n\ttype FieldKey,\n\ttype IEditableForest,\n\ttype UpPath,\n} from \"../../core/index.js\";\nimport { TreeNode, treeNodeFromAnchor } from \"../core/index.js\";\nimport type { TreeViewAlpha } from \"./tree.js\";\nimport type { SchematizingSimpleTreeView } from \"../../shared-tree/index.js\";\nimport type { ImplicitFieldSchema } from \"../fieldSchema.js\";\n\n/**\n * The status of a node in a that has been {@link trackDirtyNodes | tracked for changes}.\n * @remarks Nodes can be marked \"new\", \"changed\", or \"moved\", with \"new\" taking precedence over \"changed\" and \"changed\" taking precedence over \"moved\".\n * * \"new\": The node was added.\n * * \"changed\": A direct child was updated, added, removed, or moved (and the node is not \"new\").\n * * \"moved\": The node was moved between/within arrays (and the node is not \"new\" or \"changed\").\n * @alpha\n */\nexport type DirtyTreeStatus = \"new\" | \"changed\" | \"moved\";\n\n/**\n * A map-like interface for tracking the {@link DirtyTreeStatus | status} of nodes that have been {@link trackDirtyNodes | tracked for changes}.\n * @privateRemarks TODO: Replace this with `MapGetSet` from `@fluidframework/core-interfaces`.\n * @alpha\n */\nexport interface DirtyTreeMap {\n\tget(node: TreeNode): DirtyTreeStatus | undefined;\n\tset(node: TreeNode, status: DirtyTreeStatus): void;\n}\n\n/**\n * Registers a visitor on the view's forest that tracks which nodes are dirty.\n * @param view - The view to track dirty nodes on\n * @param dirty - A {@link DirtyTreeMap | map} that will be updated over time to reflect the {@link DirtyTreeStatus | status} of nodes as they change.\n * Nodes that have not changed will not be inserted/updated in the map.\n * @returns a cleanup function that should be called when the tracking is no longer needed.\n * @example\n * ```typescript\n * const dirty = new Map<TreeNode, DirtyTreeStatus>();\n * const stopTracking = trackDirtyNodes(view, dirty);\n * // ... make changes to the view ...\n * console.log(`The root of the tree is ${dirty.get(view.root) ?? \"unchanged\"}`);\n * stopTracking();\n * ```\n * @alpha\n */\nexport function trackDirtyNodes(\n\tview: TreeViewAlpha<ImplicitFieldSchema>,\n\tdirty: DirtyTreeMap,\n): () => void {\n\tconst forest = (view as SchematizingSimpleTreeView<ImplicitFieldSchema>).checkout.forest;\n\tconst announcedVisitor = (): AnnouncedVisitor => createDirtyVisitor(forest, dirty);\n\tforest.registerAnnouncedVisitor(announcedVisitor);\n\treturn () => {\n\t\tforest.deregisterAnnouncedVisitor(announcedVisitor);\n\t};\n}\n\nfunction createDirtyVisitor(forest: IEditableForest, dirty: DirtyTreeMap): AnnouncedVisitor {\n\t// When cursor is in Fields mode, `parentField` is the field and `parent` is the parent node above that field (if any).\n\t// When cursor is in Nodes mode, `parent` is the current node and `parentField` is undefined.\n\tlet parentField: FieldKey | undefined;\n\tlet parent: UpPath | undefined;\n\n\treturn createAnnouncedVisitor({\n\t\tbeforeDetach: (src) => {\n\t\t\tassert(parent !== undefined, 0xc48 /* Expected node */);\n\t\t\tassert(parentField !== undefined, 0xc49 /* Expected field */);\n\t\t\tfor (let parentIndex = src.start; parentIndex < src.end; parentIndex++) {\n\t\t\t\tconst path: UpPath = {\n\t\t\t\t\tparent,\n\t\t\t\t\tparentField,\n\t\t\t\t\tparentIndex,\n\t\t\t\t};\n\t\t\t\t// The only way a detached node can be re-attached (and become visible/usable again) is via a move, so mark it as moved ahead of time.\n\t\t\t\tconst node = getNodeAtPath(forest, path);\n\t\t\t\tif (node !== undefined && dirty.get(node) === undefined) {\n\t\t\t\t\t// Only mark the node as moved if it is not already marked as something else.\n\t\t\t\t\tdirty.set(node, \"moved\");\n\t\t\t\t}\n\t\t\t\t// Mark the parent as changed unless it is already marked as new.\n\t\t\t\tconst parentNode = getNodeAtPath(forest, parent);\n\t\t\t\tif (parentNode !== undefined && dirty.get(parentNode) !== \"new\") {\n\t\t\t\t\tdirty.set(parentNode, \"changed\");\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tafterAttach: (_, dst) => {\n\t\t\tassert(parent !== undefined, 0xc4a /* Expected node */);\n\t\t\tassert(parentField !== undefined, 0xc4b /* Expected field */);\n\t\t\tfor (let parentIndex = dst.start; parentIndex < dst.end; parentIndex++) {\n\t\t\t\tconst path: UpPath = {\n\t\t\t\t\tparent,\n\t\t\t\t\tparentField,\n\t\t\t\t\tparentIndex,\n\t\t\t\t};\n\t\t\t\tconst node = getNodeAtPath(forest, path);\n\t\t\t\tif (node !== undefined && dirty.get(node) === undefined) {\n\t\t\t\t\t// Only mark the node as new if it is not already marked as something else - this ensures that a moved node is not marked as new (since nodes are marked move when detached).\n\t\t\t\t\tdirty.set(node, \"new\");\n\t\t\t\t}\n\t\t\t\t// Mark the parent as changed unless it is already marked as new.\n\t\t\t\tconst parentNode = getNodeAtPath(forest, parent);\n\t\t\t\tif (parentNode !== undefined && dirty.get(parentNode) !== \"new\") {\n\t\t\t\t\tdirty.set(parentNode, \"changed\");\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tenterNode(index: number): void {\n\t\t\tassert(parentField !== undefined, 0xc4c /* Expected field */);\n\t\t\tparent = {\n\t\t\t\tparent,\n\t\t\t\tparentField,\n\t\t\t\tparentIndex: index,\n\t\t\t};\n\t\t\tparentField = undefined;\n\t\t},\n\t\texitNode(): void {\n\t\t\tassert(parent !== undefined, 0xc4d /* Expected node */);\n\t\t\tparentField = parent.parentField;\n\t\t\tparent = parent.parent;\n\t\t},\n\t\tenterField: (key: FieldKey) => {\n\t\t\tparentField = key;\n\t\t},\n\t\texitField(): void {\n\t\t\tparentField = undefined;\n\t\t},\n\t});\n}\n\nfunction getNodeAtPath(forest: IEditableForest, path: UpPath): TreeNode | undefined {\n\tconst cursor = forest.allocateCursor();\n\tforest.moveCursorToPath(path, cursor);\n\tassert(cursor.mode === CursorLocationType.Nodes, 0xc4e /* attach should happen in a node */);\n\tconst anchor = cursor.buildAnchor();\n\tconst anchorNode = forest.anchors.locate(anchor);\n\tcursor.free();\n\tif (anchorNode !== undefined) {\n\t\tconst node = treeNodeFromAnchor(anchorNode);\n\t\tif (node instanceof TreeNode) {\n\t\t\treturn node;\n\t\t}\n\t}\n\treturn undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"dirtyIndex.js","sourceRoot":"","sources":["../../../src/simple-tree/api/dirtyIndex.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAC7D,kDAO6B;AAC7B,+CAAgE;AA6BhE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,eAAe,CAC9B,IAAwC,EACxC,KAAmB;IAEnB,MAAM,MAAM,GAAI,IAAwD,CAAC,QAAQ,CAAC,MAAM,CAAC;IACzF,MAAM,gBAAgB,GAAG,GAAqB,EAAE,CAAC,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACnF,MAAM,CAAC,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;IAClD,OAAO,GAAG,EAAE;QACX,MAAM,CAAC,0BAA0B,CAAC,gBAAgB,CAAC,CAAC;IACrD,CAAC,CAAC;AACH,CAAC;AAVD,0CAUC;AAED,SAAS,kBAAkB,C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EAAE,EAAE;YAC7B,WAAW,GAAG,GAAG,CAAC;QACnB,CAAC;QACD,SAAS;YACR,WAAW,GAAG,SAAS,CAAC;QACzB,CAAC;KACD,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,MAAuB,EAAE,IAAY;IAC3D,MAAM,MAAM,GAAG,MAAM,CAAC,cAAc,EAAE,CAAC;IACvC,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACtC,IAAA,iBAAM,EAAC,MAAM,CAAC,IAAI,qCAA6B,EAAE,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAC7F,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IACpC,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACjD,MAAM,CAAC,IAAI,EAAE,CAAC;IACd,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,IAAA,6BAAkB,EAAC,UAAU,CAAC,CAAC;QAC5C,IAAI,IAAI,YAAY,mBAAQ,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tcreateAnnouncedVisitor,\n\tCursorLocationType,\n\ttype AnnouncedVisitor,\n\ttype FieldKey,\n\ttype IEditableForest,\n\ttype UpPath,\n} from \"../../core/index.js\";\nimport { TreeNode, treeNodeFromAnchor } from \"../core/index.js\";\nimport type { TreeViewAlpha } from \"./tree.js\";\nimport type { SchematizingSimpleTreeView } from \"../../shared-tree/index.js\";\nimport type { ImplicitFieldSchema } from \"../fieldSchema.js\";\n\n/**\n * The status of a node in a that has been {@link trackDirtyNodes | tracked for changes}.\n * @remarks Nodes can be marked \"new\", \"changed\", or \"moved\", with \"new\" taking precedence over \"changed\" and \"changed\" taking precedence over \"moved\".\n * * \"new\": The node was added.\n * * \"changed\": A direct child was updated, added, removed, or moved (and the node is not \"new\").\n * * \"moved\": The node was moved between/within arrays (and the node is not \"new\" or \"changed\").\n * @privateRemarks\n * It is unclear how this will handle forward compatibility with other kinds of edits, like moves that are not limited to arrays (attach, detach, swap):\n * this needs to be sorted out before this is stabilized.\n * It is also unclear how this is supposed to handle schema changes (which can result in new TreeNode instance, but I think won't trigger \"new\" here).\n * @alpha\n */\nexport type DirtyTreeStatus = \"new\" | \"changed\" | \"moved\";\n\n/**\n * A map-like interface for tracking the {@link DirtyTreeStatus | status} of nodes that have been {@link trackDirtyNodes | tracked for changes}.\n * @privateRemarks TODO: Replace this with `MapGetSet` from `@fluidframework/core-interfaces`.\n * @alpha\n */\nexport interface DirtyTreeMap {\n\tget(node: TreeNode): DirtyTreeStatus | undefined;\n\tset(node: TreeNode, status: DirtyTreeStatus): void;\n}\n\n/**\n * Registers a visitor on the view's forest that tracks which nodes are dirty.\n * @param view - The view to track dirty nodes on\n * @param dirty - A {@link DirtyTreeMap | map} that will be updated over time to reflect the {@link DirtyTreeStatus | status} of nodes as they change.\n * Nodes that have not changed will not be inserted/updated in the map.\n * @returns a cleanup function that should be called when the tracking is no longer needed.\n * @example\n * ```typescript\n * const dirty = new Map<TreeNode, DirtyTreeStatus>();\n * const stopTracking = trackDirtyNodes(view, dirty);\n * // ... make changes to the view ...\n * console.log(`The root of the tree is ${dirty.get(view.root) ?? \"unchanged\"}`);\n * stopTracking();\n * ```\n * @privateRemarks\n * This provides an opportunity for user code (\"set\" on dirty) to run during forest changes, in the middle of processing an edit.\n * We have generally avoided exposing such times to users and instead flush events after the edit has finished and user facing invariants are known to be restored.\n * Before stabilizing, how this event relates to other events time/ordering wise should be clarified, and if any APIs have been provided to defer events, that mentioned as well.\n * Maybe updates should be deferred?\n *\n * This is also documented in terms of \"forest\" which is not a concept in the public API, and thus needs to be redefined in terms of public concepts.\n * @alpha\n */\nexport function trackDirtyNodes(\n\tview: TreeViewAlpha<ImplicitFieldSchema>,\n\tdirty: DirtyTreeMap,\n): () => void {\n\tconst forest = (view as SchematizingSimpleTreeView<ImplicitFieldSchema>).checkout.forest;\n\tconst announcedVisitor = (): AnnouncedVisitor => createDirtyVisitor(forest, dirty);\n\tforest.registerAnnouncedVisitor(announcedVisitor);\n\treturn () => {\n\t\tforest.deregisterAnnouncedVisitor(announcedVisitor);\n\t};\n}\n\nfunction createDirtyVisitor(forest: IEditableForest, dirty: DirtyTreeMap): AnnouncedVisitor {\n\t// When cursor is in Fields mode, `parentField` is the field and `parent` is the parent node above that field (if any).\n\t// When cursor is in Nodes mode, `parent` is the current node and `parentField` is undefined.\n\tlet parentField: FieldKey | undefined;\n\tlet parent: UpPath | undefined;\n\n\treturn createAnnouncedVisitor({\n\t\tbeforeDetach: (src) => {\n\t\t\tassert(parent !== undefined, 0xc48 /* Expected node */);\n\t\t\tassert(parentField !== undefined, 0xc49 /* Expected field */);\n\t\t\tfor (let parentIndex = src.start; parentIndex < src.end; parentIndex++) {\n\t\t\t\tconst path: UpPath = {\n\t\t\t\t\tparent,\n\t\t\t\t\tparentField,\n\t\t\t\t\tparentIndex,\n\t\t\t\t};\n\t\t\t\t// The only way a detached node can be re-attached (and become visible/usable again) is via a move, so mark it as moved ahead of time.\n\t\t\t\tconst node = getNodeAtPath(forest, path);\n\t\t\t\tif (node !== undefined && dirty.get(node) === undefined) {\n\t\t\t\t\t// Only mark the node as moved if it is not already marked as something else.\n\t\t\t\t\tdirty.set(node, \"moved\");\n\t\t\t\t}\n\t\t\t\t// Mark the parent as changed unless it is already marked as new.\n\t\t\t\tconst parentNode = getNodeAtPath(forest, parent);\n\t\t\t\tif (parentNode !== undefined && dirty.get(parentNode) !== \"new\") {\n\t\t\t\t\tdirty.set(parentNode, \"changed\");\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tafterAttach: (_, dst) => {\n\t\t\tassert(parent !== undefined, 0xc4a /* Expected node */);\n\t\t\tassert(parentField !== undefined, 0xc4b /* Expected field */);\n\t\t\tfor (let parentIndex = dst.start; parentIndex < dst.end; parentIndex++) {\n\t\t\t\tconst path: UpPath = {\n\t\t\t\t\tparent,\n\t\t\t\t\tparentField,\n\t\t\t\t\tparentIndex,\n\t\t\t\t};\n\t\t\t\tconst node = getNodeAtPath(forest, path);\n\t\t\t\tif (node !== undefined && dirty.get(node) === undefined) {\n\t\t\t\t\t// Only mark the node as new if it is not already marked as something else - this ensures that a moved node is not marked as new (since nodes are marked move when detached).\n\t\t\t\t\tdirty.set(node, \"new\");\n\t\t\t\t}\n\t\t\t\t// Mark the parent as changed unless it is already marked as new.\n\t\t\t\tconst parentNode = getNodeAtPath(forest, parent);\n\t\t\t\tif (parentNode !== undefined && dirty.get(parentNode) !== \"new\") {\n\t\t\t\t\tdirty.set(parentNode, \"changed\");\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tenterNode(index: number): void {\n\t\t\tassert(parentField !== undefined, 0xc4c /* Expected field */);\n\t\t\tparent = {\n\t\t\t\tparent,\n\t\t\t\tparentField,\n\t\t\t\tparentIndex: index,\n\t\t\t};\n\t\t\tparentField = undefined;\n\t\t},\n\t\texitNode(): void {\n\t\t\tassert(parent !== undefined, 0xc4d /* Expected node */);\n\t\t\tparentField = parent.parentField;\n\t\t\tparent = parent.parent;\n\t\t},\n\t\tenterField: (key: FieldKey) => {\n\t\t\tparentField = key;\n\t\t},\n\t\texitField(): void {\n\t\t\tparentField = undefined;\n\t\t},\n\t});\n}\n\nfunction getNodeAtPath(forest: IEditableForest, path: UpPath): TreeNode | undefined {\n\tconst cursor = forest.allocateCursor();\n\tforest.moveCursorToPath(path, cursor);\n\tassert(cursor.mode === CursorLocationType.Nodes, 0xc4e /* attach should happen in a node */);\n\tconst anchor = cursor.buildAnchor();\n\tconst anchorNode = forest.anchors.locate(anchor);\n\tcursor.free();\n\tif (anchorNode !== undefined) {\n\t\tconst node = treeNodeFromAnchor(anchorNode);\n\t\tif (node instanceof TreeNode) {\n\t\t\treturn node;\n\t\t}\n\t}\n\treturn undefined;\n}\n"]}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { type FieldKey, type FieldKindIdentifier, LeafNodeStoredSchema, MapNodeStoredSchema, ObjectNodeStoredSchema, type TreeNodeSchemaIdentifier, type TreeStoredSchema, type TreeTypeSet, type ValueSchema } from "../../core/index.js";
|
|
6
6
|
import { NodeKind, type AnnotatedAllowedType, type TreeNodeSchema } from "../core/index.js";
|
|
7
|
-
import type { TreeSchema } from "
|
|
7
|
+
import type { TreeSchema } from "../treeSchema.js";
|
|
8
8
|
/**
|
|
9
9
|
* Discriminated union (keyed on `mismatch`) of discrepancies between a view and stored schema which
|
|
10
10
|
* make it possible for content matching the stored schema to be incompatible with the view schema.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discrepancies.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/discrepancies.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAEN,KAAK,QAAQ,EACb,KAAK,mBAAmB,EAExB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EAGtB,KAAK,wBAAwB,EAE7B,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,QAAQ,EAER,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,MAAM,kBAAkB,CAAC;AAgB1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"discrepancies.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/discrepancies.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAEN,KAAK,QAAQ,EACb,KAAK,mBAAmB,EAExB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EAGtB,KAAK,wBAA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