@fluidframework/tree 2.21.0 → 2.23.0-323641
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/CHANGELOG.md +10 -0
- package/README.md +1 -0
- package/api-report/tree.alpha.api.md +29 -4
- package/api-report/tree.beta.api.md +29 -4
- package/api-report/tree.legacy.alpha.api.md +29 -4
- package/api-report/tree.legacy.public.api.md +29 -4
- package/api-report/tree.public.api.md +29 -4
- package/dist/alpha.d.ts +1 -0
- package/dist/beta.d.ts +1 -0
- package/dist/core/forest/editableForest.js +1 -1
- package/dist/core/forest/editableForest.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts +2 -5
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +16 -162
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/index.d.ts +1 -2
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js.map +1 -1
- package/dist/core/tree/pathTree.d.ts +0 -11
- package/dist/core/tree/pathTree.d.ts.map +1 -1
- package/dist/core/tree/pathTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +1 -2
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js +0 -9
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/dist/feature-libraries/flex-tree/treeEvents.d.ts +2 -4
- package/dist/feature-libraries/flex-tree/treeEvents.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/treeEvents.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +1 -2
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +0 -9
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +6 -2
- 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/genericFieldKind.d.ts +2 -4
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +4 -19
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +16 -18
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/node-key/mockNodeKeyManager.js +1 -1
- package/dist/feature-libraries/node-key/mockNodeKeyManager.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.js +7 -3
- package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +3 -5
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +1 -11
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +13 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +1 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/public.d.ts +1 -0
- package/dist/shared-tree/index.d.ts +1 -3
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +1 -7
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +4 -5
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +9 -10
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +40 -39
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +84 -52
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/treeApi.d.ts +2 -2
- package/dist/shared-tree/treeApi.d.ts.map +1 -1
- package/dist/shared-tree/treeApi.js +9 -3
- package/dist/shared-tree/treeApi.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +3 -3
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +3 -2
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts +11 -2
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +64 -29
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.d.ts +1 -2
- package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +0 -9
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/resubmitMachine.d.ts +2 -0
- package/dist/shared-tree-core/resubmitMachine.d.ts.map +1 -1
- package/dist/shared-tree-core/resubmitMachine.js.map +1 -1
- package/dist/shared-tree-core/sequenceIdUtils.d.ts +12 -1
- package/dist/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
- package/dist/shared-tree-core/sequenceIdUtils.js +25 -7
- package/dist/shared-tree-core/sequenceIdUtils.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +33 -30
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +62 -56
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +3 -2
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +3 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +156 -63
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +179 -86
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/{shared-tree → simple-tree/api}/transactionTypes.d.ts +1 -1
- package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -0
- package/dist/{shared-tree → simple-tree/api}/transactionTypes.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +23 -2
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/index.d.ts +1 -1
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +3 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +2 -2
- package/dist/simple-tree/schemaTypes.js +1 -1
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/treeNodeValid.js +1 -2
- package/dist/simple-tree/treeNodeValid.js.map +1 -1
- package/dist/treeFactory.d.ts +16 -5
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +21 -12
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/breakable.d.ts +1 -1
- package/dist/util/breakable.d.ts.map +1 -1
- package/dist/util/breakable.js.map +1 -1
- package/dist/util/index.d.ts +1 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +3 -2
- package/dist/util/index.js.map +1 -1
- package/dist/util/rangeMap.d.ts +1 -1
- package/dist/util/rangeMap.js +1 -1
- package/dist/util/rangeMap.js.map +1 -1
- package/dist/util/utils.d.ts +16 -0
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +29 -1
- package/dist/util/utils.js.map +1 -1
- package/lib/alpha.d.ts +1 -0
- package/lib/beta.d.ts +1 -0
- package/lib/core/forest/editableForest.js +1 -1
- package/lib/core/forest/editableForest.js.map +1 -1
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/tree/anchorSet.d.ts +2 -5
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +17 -163
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/index.d.ts +1 -2
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js.map +1 -1
- package/lib/core/tree/pathTree.d.ts +0 -11
- package/lib/core/tree/pathTree.d.ts.map +1 -1
- package/lib/core/tree/pathTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +1 -2
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js +0 -9
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/lib/feature-libraries/flex-tree/treeEvents.d.ts +2 -4
- package/lib/feature-libraries/flex-tree/treeEvents.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/treeEvents.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +1 -2
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +0 -9
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +6 -2
- 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/genericFieldKind.d.ts +2 -4
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +4 -19
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +17 -19
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/node-key/mockNodeKeyManager.js +1 -1
- package/lib/feature-libraries/node-key/mockNodeKeyManager.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.js +7 -3
- package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +3 -5
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +1 -11
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +13 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +1 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +1 -0
- package/lib/shared-tree/index.d.ts +1 -3
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -3
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +4 -5
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +4 -5
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +40 -39
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +82 -50
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/treeApi.d.ts +2 -2
- package/lib/shared-tree/treeApi.d.ts.map +1 -1
- package/lib/shared-tree/treeApi.js +8 -2
- package/lib/shared-tree/treeApi.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +3 -3
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +4 -3
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts +11 -2
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +65 -30
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.d.ts +1 -2
- package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +0 -9
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/resubmitMachine.d.ts +2 -0
- package/lib/shared-tree-core/resubmitMachine.d.ts.map +1 -1
- package/lib/shared-tree-core/resubmitMachine.js.map +1 -1
- package/lib/shared-tree-core/sequenceIdUtils.d.ts +12 -1
- package/lib/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
- package/lib/shared-tree-core/sequenceIdUtils.js +23 -5
- package/lib/shared-tree-core/sequenceIdUtils.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +33 -30
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +61 -55
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +3 -2
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -0
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +156 -63
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +178 -85
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/{shared-tree → simple-tree/api}/transactionTypes.d.ts +1 -1
- package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -0
- package/lib/{shared-tree → simple-tree/api}/transactionTypes.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +23 -2
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/index.d.ts +1 -1
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +1 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +2 -2
- package/lib/simple-tree/schemaTypes.js +1 -1
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/treeNodeValid.js +1 -2
- package/lib/simple-tree/treeNodeValid.js.map +1 -1
- package/lib/treeFactory.d.ts +16 -5
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +20 -11
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/breakable.d.ts +1 -1
- package/lib/util/breakable.d.ts.map +1 -1
- package/lib/util/breakable.js.map +1 -1
- package/lib/util/index.d.ts +1 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +1 -1
- package/lib/util/index.js.map +1 -1
- package/lib/util/rangeMap.d.ts +1 -1
- package/lib/util/rangeMap.js +1 -1
- package/lib/util/rangeMap.js.map +1 -1
- package/lib/util/utils.d.ts +16 -0
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js +27 -0
- package/lib/util/utils.js.map +1 -1
- package/package.json +23 -23
- package/src/core/forest/editableForest.ts +1 -1
- package/src/core/index.ts +0 -3
- package/src/core/tree/anchorSet.ts +38 -221
- package/src/core/tree/index.ts +0 -3
- package/src/core/tree/pathTree.ts +0 -13
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +1 -1
- package/src/feature-libraries/detachedFieldIndexSummarizer.ts +0 -11
- package/src/feature-libraries/flex-tree/treeEvents.ts +2 -4
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +0 -11
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +6 -2
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +3 -35
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +18 -48
- package/src/feature-libraries/optional-field/optionalField.ts +10 -3
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +1 -16
- package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +13 -2
- package/src/index.ts +15 -12
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/index.ts +3 -19
- package/src/shared-tree/schematizingTreeView.ts +18 -16
- package/src/shared-tree/sharedTree.ts +208 -100
- package/src/shared-tree/treeApi.ts +10 -1
- package/src/shared-tree/treeCheckout.ts +11 -8
- package/src/shared-tree-core/editManager.ts +80 -43
- package/src/shared-tree-core/editManagerSummarizer.ts +0 -11
- package/src/shared-tree-core/resubmitMachine.ts +2 -0
- package/src/shared-tree-core/sequenceIdUtils.ts +26 -5
- package/src/shared-tree-core/sharedTreeCore.ts +88 -99
- package/src/simple-tree/api/index.ts +15 -0
- package/src/simple-tree/api/schemaFactory.ts +203 -89
- package/src/{shared-tree → simple-tree/api}/transactionTypes.ts +1 -1
- package/src/simple-tree/api/tree.ts +31 -6
- package/src/simple-tree/index.ts +12 -0
- package/src/simple-tree/schemaTypes.ts +2 -2
- package/src/treeFactory.ts +29 -11
- package/src/util/breakable.ts +1 -1
- package/src/util/index.ts +1 -0
- package/src/util/rangeMap.ts +1 -1
- package/src/util/utils.ts +32 -0
- package/dist/core/tree/visitPath.d.ts +0 -101
- package/dist/core/tree/visitPath.d.ts.map +0 -1
- package/dist/core/tree/visitPath.js +0 -7
- package/dist/core/tree/visitPath.js.map +0 -1
- package/dist/shared-tree/publicContracts.d.ts +0 -18
- package/dist/shared-tree/publicContracts.d.ts.map +0 -1
- package/dist/shared-tree/publicContracts.js +0 -24
- package/dist/shared-tree/publicContracts.js.map +0 -1
- package/dist/shared-tree/transactionTypes.d.ts.map +0 -1
- package/lib/core/tree/visitPath.d.ts +0 -101
- package/lib/core/tree/visitPath.d.ts.map +0 -1
- package/lib/core/tree/visitPath.js +0 -6
- package/lib/core/tree/visitPath.js.map +0 -1
- package/lib/shared-tree/publicContracts.d.ts +0 -18
- package/lib/shared-tree/publicContracts.d.ts.map +0 -1
- package/lib/shared-tree/publicContracts.js +0 -21
- package/lib/shared-tree/publicContracts.js.map +0 -1
- package/lib/shared-tree/transactionTypes.d.ts.map +0 -1
- package/src/core/tree/visitPath.ts +0 -124
- package/src/shared-tree/publicContracts.ts +0 -24
- /package/dist/{shared-tree → simple-tree/api}/transactionTypes.js +0 -0
- /package/lib/{shared-tree → simple-tree/api}/transactionTypes.js +0 -0
|
@@ -18,23 +18,15 @@ import {
|
|
|
18
18
|
brand,
|
|
19
19
|
brandedSlot,
|
|
20
20
|
fail,
|
|
21
|
+
getOrAddEmptyToMap,
|
|
22
|
+
getOrCreate,
|
|
21
23
|
} from "../../util/index.js";
|
|
22
24
|
import type { FieldKey } from "../schema-stored/index.js";
|
|
23
25
|
|
|
24
26
|
import type * as Delta from "./delta.js";
|
|
25
|
-
import type {
|
|
26
|
-
DetachedPlaceUpPath,
|
|
27
|
-
DetachedRangeUpPath,
|
|
28
|
-
PlaceIndex,
|
|
29
|
-
PlaceUpPath,
|
|
30
|
-
Range,
|
|
31
|
-
RangeUpPath,
|
|
32
|
-
UpPath,
|
|
33
|
-
} from "./pathTree.js";
|
|
27
|
+
import type { PlaceIndex, Range, UpPath } from "./pathTree.js";
|
|
34
28
|
import { EmptyKey } from "./types.js";
|
|
35
29
|
import type { DeltaVisitor } from "./visitDelta.js";
|
|
36
|
-
import type { PathVisitor } from "./visitPath.js";
|
|
37
|
-
import type { AnnouncedVisitor } from "./visitorUtils.js";
|
|
38
30
|
|
|
39
31
|
/**
|
|
40
32
|
* A way to refer to a particular tree location within an {@link AnchorSet}.
|
|
@@ -137,10 +129,9 @@ export interface AnchorEvents {
|
|
|
137
129
|
* rooted at `anchor` _may_ be about to change due to updates from the batch.
|
|
138
130
|
*
|
|
139
131
|
* @remarks
|
|
140
|
-
* The event can optionally return a {@link PathVisitor} to traverse the subtree.
|
|
141
132
|
* Called on every parent (transitively) when a change is occurring.
|
|
142
133
|
*/
|
|
143
|
-
subtreeChanging(anchor: AnchorNode):
|
|
134
|
+
subtreeChanging(anchor: AnchorNode): void;
|
|
144
135
|
|
|
145
136
|
/**
|
|
146
137
|
* Emitted in the middle of applying a batch of changes (i.e. during a delta a visit), if something in the subtree
|
|
@@ -689,7 +680,7 @@ export class AnchorSet implements AnchorLocator {
|
|
|
689
680
|
* It is invalid to acquire a visitor without releasing the previous one,
|
|
690
681
|
* and this method will throw an error if this is attempted.
|
|
691
682
|
*/
|
|
692
|
-
public acquireVisitor():
|
|
683
|
+
public acquireVisitor(): DeltaVisitor {
|
|
693
684
|
assert(
|
|
694
685
|
this.activeVisitor === undefined,
|
|
695
686
|
0x767 /* Must release existing visitor before acquiring another */,
|
|
@@ -716,25 +707,13 @@ export class AnchorSet implements AnchorLocator {
|
|
|
716
707
|
}
|
|
717
708
|
}
|
|
718
709
|
},
|
|
719
|
-
// Lookup table for path visitors collected from {@link AnchorEvents.visitSubtreeChanging} emitted events.
|
|
720
|
-
// The key is the path of the node that the visitor is registered on. The code ensures that the path visitor visits only the appropriate subtrees
|
|
721
|
-
// by maintaining the mapping only during time between the {@link DeltaVisitor.enterNode} and {@link DeltaVisitor.exitNode} calls for a given anchorNode.
|
|
722
|
-
pathVisitors: new Map<PathNode, Set<PathVisitor>>(),
|
|
723
710
|
parentField: undefined as FieldKey | undefined,
|
|
724
711
|
parent: undefined as UpPath | undefined,
|
|
725
712
|
|
|
726
713
|
/**
|
|
727
714
|
* Events collected during the visit which get sent as a batch during "free".
|
|
728
715
|
*/
|
|
729
|
-
bufferedEvents: [] as
|
|
730
|
-
node: PathNode;
|
|
731
|
-
event: keyof AnchorEvents;
|
|
732
|
-
/**
|
|
733
|
-
* The key for the impacted field, if the event is associated with a key.
|
|
734
|
-
* Some events, such as afterDestroy, do not involve a key, and thus leave this undefined.
|
|
735
|
-
*/
|
|
736
|
-
changedField?: FieldKey;
|
|
737
|
-
}[],
|
|
716
|
+
bufferedEvents: [] as BufferedEvent[],
|
|
738
717
|
|
|
739
718
|
// 'currentDepth' and 'depthThresholdForSubtreeChanged' serve to keep track of when do we need to emit
|
|
740
719
|
// subtreeChangedAfterBatch events.
|
|
@@ -766,25 +745,31 @@ export class AnchorSet implements AnchorLocator {
|
|
|
766
745
|
node.removeRef();
|
|
767
746
|
}
|
|
768
747
|
this.anchorSet.activeVisitor = undefined;
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
748
|
+
|
|
749
|
+
// Aggregate changedFields by node.
|
|
750
|
+
const eventsByNode: Map<PathNode, Set<FieldKey>> = new Map();
|
|
751
|
+
for (const { node, event, changedField } of this.bufferedEvents) {
|
|
752
|
+
if (event === "childrenChangedAfterBatch") {
|
|
753
|
+
const keys = getOrCreate(eventsByNode, node, () => new Set());
|
|
754
|
+
keys.add(
|
|
755
|
+
changedField ??
|
|
756
|
+
fail("childrenChangedAfterBatch events should have a changedField"),
|
|
757
|
+
);
|
|
773
758
|
}
|
|
774
|
-
|
|
775
|
-
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
const alreadyEmitted = new Map<PathNode, (keyof AnchorEvents)[]>();
|
|
762
|
+
for (const { node, event } of this.bufferedEvents) {
|
|
763
|
+
const emittedEvents = getOrAddEmptyToMap(alreadyEmitted, node);
|
|
764
|
+
if (emittedEvents.includes(event)) {
|
|
776
765
|
continue;
|
|
777
766
|
}
|
|
778
|
-
emittedEvents
|
|
767
|
+
emittedEvents.push(event);
|
|
779
768
|
if (event === "childrenChangedAfterBatch") {
|
|
780
|
-
const
|
|
781
|
-
.
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
e.changedField ??
|
|
785
|
-
fail("childrenChangedAfterBatch events should have a changedField"),
|
|
786
|
-
);
|
|
787
|
-
node.events.emit(event, { changedFields: new Set(fieldKeys) });
|
|
769
|
+
const changedFields =
|
|
770
|
+
eventsByNode.get(node) ??
|
|
771
|
+
fail("childrenChangedAfterBatch events should have changedFields");
|
|
772
|
+
node.events.emit(event, { changedFields });
|
|
788
773
|
} else {
|
|
789
774
|
node.events.emit(event);
|
|
790
775
|
}
|
|
@@ -813,47 +798,6 @@ export class AnchorSet implements AnchorLocator {
|
|
|
813
798
|
() => {},
|
|
814
799
|
);
|
|
815
800
|
},
|
|
816
|
-
beforeAttach(source: FieldKey, count: number, destination: PlaceIndex): void {
|
|
817
|
-
assert(
|
|
818
|
-
this.parentField !== undefined,
|
|
819
|
-
0x7a0 /* Must be in a field in order to attach */,
|
|
820
|
-
);
|
|
821
|
-
const destinationPath: PlaceUpPath = {
|
|
822
|
-
parent: this.parent,
|
|
823
|
-
field: this.parentField,
|
|
824
|
-
index: destination,
|
|
825
|
-
};
|
|
826
|
-
const sourcePath: DetachedRangeUpPath = brand({
|
|
827
|
-
field: source,
|
|
828
|
-
start: 0,
|
|
829
|
-
end: count,
|
|
830
|
-
});
|
|
831
|
-
for (const visitors of this.pathVisitors.values()) {
|
|
832
|
-
for (const pathVisitor of visitors) {
|
|
833
|
-
pathVisitor.beforeAttach(sourcePath, destinationPath);
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
},
|
|
837
|
-
afterAttach(source: FieldKey, destination: Range): void {
|
|
838
|
-
assert(
|
|
839
|
-
this.parentField !== undefined,
|
|
840
|
-
0x7a1 /* Must be in a field in order to attach */,
|
|
841
|
-
);
|
|
842
|
-
const sourcePath: DetachedPlaceUpPath = brand({
|
|
843
|
-
field: source,
|
|
844
|
-
index: 0,
|
|
845
|
-
});
|
|
846
|
-
const destinationPath: RangeUpPath = {
|
|
847
|
-
parent: this.parent,
|
|
848
|
-
field: this.parentField,
|
|
849
|
-
...destination,
|
|
850
|
-
};
|
|
851
|
-
for (const visitors of this.pathVisitors.values()) {
|
|
852
|
-
for (const pathVisitor of visitors) {
|
|
853
|
-
pathVisitor.afterAttach(sourcePath, destinationPath);
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
},
|
|
857
801
|
attach(source: FieldKey, count: number, destination: PlaceIndex): void {
|
|
858
802
|
this.notifyChildrenChanging();
|
|
859
803
|
this.attachEdit(source, count, destination);
|
|
@@ -877,47 +821,6 @@ export class AnchorSet implements AnchorLocator {
|
|
|
877
821
|
this.anchorSet.moveChildren(sourcePath, destinationPath, count);
|
|
878
822
|
this.depthThresholdForSubtreeChanged = this.currentDepth;
|
|
879
823
|
},
|
|
880
|
-
beforeDetach(source: Range, destination: FieldKey): void {
|
|
881
|
-
assert(
|
|
882
|
-
this.parentField !== undefined,
|
|
883
|
-
0x7a3 /* Must be in a field in order to attach */,
|
|
884
|
-
);
|
|
885
|
-
const sourcePath: RangeUpPath = {
|
|
886
|
-
parent: this.parent,
|
|
887
|
-
field: this.parentField,
|
|
888
|
-
...source,
|
|
889
|
-
};
|
|
890
|
-
const destinationPath: DetachedPlaceUpPath = brand({
|
|
891
|
-
field: destination,
|
|
892
|
-
index: 0,
|
|
893
|
-
});
|
|
894
|
-
for (const visitors of this.pathVisitors.values()) {
|
|
895
|
-
for (const pathVisitor of visitors) {
|
|
896
|
-
pathVisitor.beforeDetach(sourcePath, destinationPath);
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
},
|
|
900
|
-
afterDetach(source: PlaceIndex, count: number, destination: FieldKey): void {
|
|
901
|
-
assert(
|
|
902
|
-
this.parentField !== undefined,
|
|
903
|
-
0x7a4 /* Must be in a field in order to attach */,
|
|
904
|
-
);
|
|
905
|
-
const sourcePath: PlaceUpPath = {
|
|
906
|
-
parent: this.parent,
|
|
907
|
-
field: this.parentField,
|
|
908
|
-
index: source,
|
|
909
|
-
};
|
|
910
|
-
const destinationPath: DetachedRangeUpPath = brand({
|
|
911
|
-
field: destination,
|
|
912
|
-
start: 0,
|
|
913
|
-
end: count,
|
|
914
|
-
});
|
|
915
|
-
for (const visitors of this.pathVisitors.values()) {
|
|
916
|
-
for (const pathVisitor of visitors) {
|
|
917
|
-
pathVisitor.afterDetach(sourcePath, destinationPath);
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
},
|
|
921
824
|
detach(source: Range, destination: FieldKey): void {
|
|
922
825
|
this.notifyChildrenChanging();
|
|
923
826
|
this.detachEdit(source, destination);
|
|
@@ -941,64 +844,6 @@ export class AnchorSet implements AnchorLocator {
|
|
|
941
844
|
this.anchorSet.moveChildren(sourcePath, destinationPath, source.end - source.start);
|
|
942
845
|
this.depthThresholdForSubtreeChanged = this.currentDepth;
|
|
943
846
|
},
|
|
944
|
-
beforeReplace(newContent: FieldKey, oldContent: Range, destination: FieldKey): void {
|
|
945
|
-
assert(
|
|
946
|
-
this.parentField !== undefined,
|
|
947
|
-
0x7a6 /* Must be in a field in order to replace */,
|
|
948
|
-
);
|
|
949
|
-
const oldContentPath: RangeUpPath = {
|
|
950
|
-
parent: this.parent,
|
|
951
|
-
field: this.parentField,
|
|
952
|
-
...oldContent,
|
|
953
|
-
};
|
|
954
|
-
const newNodesSourcePath: DetachedRangeUpPath = brand({
|
|
955
|
-
field: newContent,
|
|
956
|
-
start: 0,
|
|
957
|
-
end: oldContent.end - oldContent.start,
|
|
958
|
-
});
|
|
959
|
-
const oldNodesDestinationPath: DetachedPlaceUpPath = brand({
|
|
960
|
-
field: destination,
|
|
961
|
-
index: 0,
|
|
962
|
-
});
|
|
963
|
-
for (const visitors of this.pathVisitors.values()) {
|
|
964
|
-
for (const pathVisitor of visitors) {
|
|
965
|
-
pathVisitor.beforeReplace(
|
|
966
|
-
newNodesSourcePath,
|
|
967
|
-
oldContentPath,
|
|
968
|
-
oldNodesDestinationPath,
|
|
969
|
-
);
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
},
|
|
973
|
-
afterReplace(newContentSource: FieldKey, newContent: Range, oldContent: FieldKey): void {
|
|
974
|
-
assert(
|
|
975
|
-
this.parentField !== undefined,
|
|
976
|
-
0x7a7 /* Must be in a field in order to replace */,
|
|
977
|
-
);
|
|
978
|
-
const newContentPath: RangeUpPath = {
|
|
979
|
-
parent: this.parent,
|
|
980
|
-
field: this.parentField,
|
|
981
|
-
...newContent,
|
|
982
|
-
};
|
|
983
|
-
const newNodesSourcePath: DetachedPlaceUpPath = brand({
|
|
984
|
-
field: newContentSource,
|
|
985
|
-
index: 0,
|
|
986
|
-
});
|
|
987
|
-
const oldNodesDestinationPath: DetachedRangeUpPath = brand({
|
|
988
|
-
field: oldContent,
|
|
989
|
-
start: 0,
|
|
990
|
-
end: newContent.end - newContent.start,
|
|
991
|
-
});
|
|
992
|
-
for (const visitors of this.pathVisitors.values()) {
|
|
993
|
-
for (const pathVisitor of visitors) {
|
|
994
|
-
pathVisitor.afterReplace(
|
|
995
|
-
newNodesSourcePath,
|
|
996
|
-
newContentPath,
|
|
997
|
-
oldNodesDestinationPath,
|
|
998
|
-
);
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
|
-
},
|
|
1002
847
|
replace(
|
|
1003
848
|
newContentSource: FieldKey,
|
|
1004
849
|
range: Range,
|
|
@@ -1019,34 +864,10 @@ export class AnchorSet implements AnchorLocator {
|
|
|
1019
864
|
count,
|
|
1020
865
|
);
|
|
1021
866
|
},
|
|
1022
|
-
beforeDestroy(detachedField: FieldKey, count: number): void {
|
|
1023
|
-
const range: DetachedRangeUpPath = brand({
|
|
1024
|
-
field: detachedField,
|
|
1025
|
-
start: 0,
|
|
1026
|
-
end: count,
|
|
1027
|
-
});
|
|
1028
|
-
for (const visitors of this.pathVisitors.values()) {
|
|
1029
|
-
for (const pathVisitor of visitors) {
|
|
1030
|
-
pathVisitor.beforeDestroy(range);
|
|
1031
|
-
}
|
|
1032
|
-
}
|
|
1033
|
-
},
|
|
1034
867
|
create(content: Delta.ProtoNodes, destination: FieldKey): void {
|
|
1035
868
|
// Nothing to do since content can only be created in a new detached field,
|
|
1036
869
|
// which cannot contain any anchors.
|
|
1037
870
|
},
|
|
1038
|
-
afterCreate(content: Delta.ProtoNodes, destination: FieldKey): void {
|
|
1039
|
-
for (const visitors of this.pathVisitors.values()) {
|
|
1040
|
-
for (const pathVisitor of visitors) {
|
|
1041
|
-
const rangePath: DetachedRangeUpPath = brand({
|
|
1042
|
-
field: destination,
|
|
1043
|
-
start: 0,
|
|
1044
|
-
end: content.length,
|
|
1045
|
-
});
|
|
1046
|
-
pathVisitor.afterCreate(rangePath);
|
|
1047
|
-
}
|
|
1048
|
-
}
|
|
1049
|
-
},
|
|
1050
871
|
enterNode(index: number): void {
|
|
1051
872
|
assert(this.parentField !== undefined, 0x3ab /* Must be in a field to enter node */);
|
|
1052
873
|
|
|
@@ -1057,19 +878,7 @@ export class AnchorSet implements AnchorLocator {
|
|
|
1057
878
|
};
|
|
1058
879
|
this.parentField = undefined;
|
|
1059
880
|
this.maybeWithNode((p) => {
|
|
1060
|
-
|
|
1061
|
-
if (!this.pathVisitors.has(p)) {
|
|
1062
|
-
const visitors: (PathVisitor | void)[] = p.events.emitAndCollect(
|
|
1063
|
-
"subtreeChanging",
|
|
1064
|
-
p,
|
|
1065
|
-
);
|
|
1066
|
-
if (visitors.length > 0) {
|
|
1067
|
-
this.pathVisitors.set(
|
|
1068
|
-
p,
|
|
1069
|
-
new Set(visitors.filter((v): v is PathVisitor => v !== undefined)),
|
|
1070
|
-
);
|
|
1071
|
-
}
|
|
1072
|
-
}
|
|
881
|
+
p.events.emit("subtreeChanging", p);
|
|
1073
882
|
});
|
|
1074
883
|
this.currentDepth++;
|
|
1075
884
|
},
|
|
@@ -1084,8 +893,6 @@ export class AnchorSet implements AnchorLocator {
|
|
|
1084
893
|
});
|
|
1085
894
|
this.depthThresholdForSubtreeChanged--;
|
|
1086
895
|
}
|
|
1087
|
-
// Remove subtree path visitors added at this node if there are any
|
|
1088
|
-
this.pathVisitors.delete(p);
|
|
1089
896
|
});
|
|
1090
897
|
const parent = this.parent;
|
|
1091
898
|
this.parentField = parent.parentField;
|
|
@@ -1387,3 +1194,13 @@ function binaryFind(sorted: readonly PathNode[], index: number): PathNode | unde
|
|
|
1387
1194
|
}
|
|
1388
1195
|
return undefined; // If we reach here, target is not in array (or array was not sorted)
|
|
1389
1196
|
}
|
|
1197
|
+
|
|
1198
|
+
interface BufferedEvent {
|
|
1199
|
+
node: PathNode;
|
|
1200
|
+
event: keyof AnchorEvents;
|
|
1201
|
+
/**
|
|
1202
|
+
* The key for the impacted field, if the event is associated with a key.
|
|
1203
|
+
* Some events, such as afterDestroy, do not involve a key, and thus leave this undefined.
|
|
1204
|
+
*/
|
|
1205
|
+
changedField?: FieldKey;
|
|
1206
|
+
}
|
package/src/core/tree/index.ts
CHANGED
|
@@ -55,8 +55,6 @@ export {
|
|
|
55
55
|
type PlaceUpPath,
|
|
56
56
|
type PlaceIndex,
|
|
57
57
|
type NodeIndex,
|
|
58
|
-
type DetachedPlaceUpPath,
|
|
59
|
-
type DetachedRangeUpPath,
|
|
60
58
|
compareUpPaths,
|
|
61
59
|
compareFieldUpPaths,
|
|
62
60
|
getDetachedFieldContainingPath,
|
|
@@ -98,7 +96,6 @@ export {
|
|
|
98
96
|
combineVisitors,
|
|
99
97
|
makeDetachedFieldIndex,
|
|
100
98
|
} from "./visitorUtils.js";
|
|
101
|
-
export type { PathVisitor } from "./visitPath.js";
|
|
102
99
|
|
|
103
100
|
export { SparseNode, getDescendant } from "./sparseTree.js";
|
|
104
101
|
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { Brand } from "../../util/index.js";
|
|
7
6
|
import type { FieldKey } from "../schema-stored/index.js";
|
|
8
7
|
|
|
9
8
|
import { type DetachedField, keyAsDetachedField } from "./types.js";
|
|
@@ -60,13 +59,6 @@ export interface FieldUpPath<TUpPath extends UpPath = UpPath> {
|
|
|
60
59
|
readonly field: FieldKey; // TODO: Type information, including when in DetachedField.
|
|
61
60
|
}
|
|
62
61
|
|
|
63
|
-
/**
|
|
64
|
-
* A range of nodes in a detached field.
|
|
65
|
-
* Unlike RangeUpPath, such ranges are generated by create and detach operations,
|
|
66
|
-
* as well as consumed by destroy and attach operations.
|
|
67
|
-
*/
|
|
68
|
-
export type DetachedRangeUpPath = Brand<Omit<RangeUpPath, "parent">, "DetachedRangeUpPath">;
|
|
69
|
-
|
|
70
62
|
/**
|
|
71
63
|
* Delimits the extend of a range.
|
|
72
64
|
*/
|
|
@@ -101,11 +93,6 @@ export interface PlaceUpPath<TUpPath extends UpPath = UpPath> extends FieldUpPat
|
|
|
101
93
|
readonly index: PlaceIndex;
|
|
102
94
|
}
|
|
103
95
|
|
|
104
|
-
/**
|
|
105
|
-
* A place in a detached field.
|
|
106
|
-
*/
|
|
107
|
-
export type DetachedPlaceUpPath = Brand<Omit<PlaceUpPath, "parent">, "DetachedRangeUpPath">;
|
|
108
|
-
|
|
109
96
|
/**
|
|
110
97
|
* Indicates the index of a node in a field.
|
|
111
98
|
* Zero indicates the first node in a field.
|
|
@@ -42,7 +42,7 @@ export const noChangeHandler: FieldChangeHandler<0> = {
|
|
|
42
42
|
rebase: (change: 0, over: 0) => 0,
|
|
43
43
|
}),
|
|
44
44
|
codecsFactory: () => noChangeCodecFamily,
|
|
45
|
-
editor: {
|
|
45
|
+
editor: { buildChildChanges: () => fail("Child changes not supported") },
|
|
46
46
|
intoDelta: (change, deltaFromChild: ToDelta): FieldChangeDelta => ({}),
|
|
47
47
|
relevantRemovedRoots: (change): Iterable<DeltaDetachedNodeId> => [],
|
|
48
48
|
isEmpty: (change: 0) => true,
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import { bufferToString } from "@fluid-internal/client-utils";
|
|
7
7
|
import type { IChannelStorageService } from "@fluidframework/datastore-definitions/internal";
|
|
8
8
|
import type {
|
|
9
|
-
IGarbageCollectionData,
|
|
10
9
|
ISummaryTreeWithStats,
|
|
11
10
|
ITelemetryContext,
|
|
12
11
|
} from "@fluidframework/runtime-definitions/internal";
|
|
@@ -52,16 +51,6 @@ export class DetachedFieldIndexSummarizer implements Summarizable {
|
|
|
52
51
|
return this.getAttachSummary(stringify, fullTree, trackState, telemetryContext);
|
|
53
52
|
}
|
|
54
53
|
|
|
55
|
-
public getGCData(fullGC?: boolean): IGarbageCollectionData {
|
|
56
|
-
// TODO: Properly implement garbage collection. Right now, garbage collection is performed automatically
|
|
57
|
-
// by the code in SharedObject (from which SharedTreeCore extends). The `runtime.uploadBlob` API delegates
|
|
58
|
-
// to the `BlobManager`, which automatically populates the summary with ISummaryAttachment entries for each
|
|
59
|
-
// blob.
|
|
60
|
-
return {
|
|
61
|
-
gcNodes: {},
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
54
|
public async load(
|
|
66
55
|
services: IChannelStorageService,
|
|
67
56
|
parse: SummaryElementParser,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type {
|
|
6
|
+
import type { UpPath } from "../../core/index.js";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* This file provides an API for working with trees which is type safe even when schema is not known.
|
|
@@ -39,13 +39,11 @@ export interface FlexTreeNodeEvents {
|
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* Raised when something in the tree is changing, including this node and its descendants.
|
|
42
|
-
* The event can optionally return a {@link PathVisitor} to traverse the subtree
|
|
43
42
|
* This event is called on every parent (transitively) when a change is occurring.
|
|
44
43
|
* Includes changes to this node itself.
|
|
45
44
|
* @param upPath - the path corresponding to the location of the node being changed, upward.
|
|
46
|
-
* @returns a visitor to traverse the subtree or `void`.
|
|
47
45
|
*/
|
|
48
|
-
subtreeChanging(upPath: UpPath):
|
|
46
|
+
subtreeChanging(upPath: UpPath): void;
|
|
49
47
|
|
|
50
48
|
/**
|
|
51
49
|
* This has the same contract as {@link TreeChangeEvents.nodeChanged}
|
|
@@ -7,7 +7,6 @@ import { bufferToString } from "@fluid-internal/client-utils";
|
|
|
7
7
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
8
8
|
import type { IChannelStorageService } from "@fluidframework/datastore-definitions/internal";
|
|
9
9
|
import type {
|
|
10
|
-
IGarbageCollectionData,
|
|
11
10
|
ISummaryTreeWithStats,
|
|
12
11
|
ITelemetryContext,
|
|
13
12
|
} from "@fluidframework/runtime-definitions/internal";
|
|
@@ -114,16 +113,6 @@ export class ForestSummarizer implements Summarizable {
|
|
|
114
113
|
return createSingleBlobSummary(treeBlobKey, this.getTreeString(stringify));
|
|
115
114
|
}
|
|
116
115
|
|
|
117
|
-
public getGCData(fullGC?: boolean): IGarbageCollectionData {
|
|
118
|
-
// TODO: Properly implement garbage collection. Right now, garbage collection is performed automatically
|
|
119
|
-
// by the code in SharedObject (from which SharedTreeCore extends). The `runtime.uploadBlob` API delegates
|
|
120
|
-
// to the `BlobManager`, which automatically populates the summary with ISummaryAttachment entries for each
|
|
121
|
-
// blob.
|
|
122
|
-
return {
|
|
123
|
-
gcNodes: {},
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
|
|
127
116
|
public async load(
|
|
128
117
|
services: IChannelStorageService,
|
|
129
118
|
parse: SummaryElementParser,
|
|
@@ -201,9 +201,13 @@ export function isolatedFieldChangeRebaser<TChangeset>(data: {
|
|
|
201
201
|
|
|
202
202
|
export interface FieldEditor<TChangeset> {
|
|
203
203
|
/**
|
|
204
|
-
* Creates a changeset which represents the given
|
|
204
|
+
* Creates a changeset which represents the given changes to the children of this editor's field.
|
|
205
|
+
* For each element in the given iterable
|
|
206
|
+
* - The number represents the index of the child node in the field.
|
|
207
|
+
* - The `NodeId` represents the nested changes for that child node.
|
|
208
|
+
* Note: The indices in the iterable must be ordered from smallest to largest (with no duplicates).
|
|
205
209
|
*/
|
|
206
|
-
|
|
210
|
+
buildChildChanges(changes: Iterable<[index: number, change: NodeId]>): TChangeset;
|
|
207
211
|
}
|
|
208
212
|
|
|
209
213
|
/**
|
|
@@ -6,14 +6,11 @@
|
|
|
6
6
|
import {
|
|
7
7
|
type DeltaDetachedNodeId,
|
|
8
8
|
type DeltaMark,
|
|
9
|
-
type RevisionMetadataSource,
|
|
10
9
|
Multiplicity,
|
|
11
10
|
type RevisionTag,
|
|
12
11
|
replaceAtomRevisions,
|
|
13
12
|
} from "../../core/index.js";
|
|
14
|
-
import { type IdAllocator, fail } from "../../util/index.js";
|
|
15
13
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
16
|
-
import type { CrossFieldManager } from "./crossFieldQueries.js";
|
|
17
14
|
import type {
|
|
18
15
|
FieldChangeDelta,
|
|
19
16
|
FieldChangeHandler,
|
|
@@ -43,8 +40,8 @@ export const genericChangeHandler: FieldChangeHandler<GenericChangeset> = {
|
|
|
43
40
|
},
|
|
44
41
|
codecsFactory: makeGenericChangeCodec,
|
|
45
42
|
editor: {
|
|
46
|
-
|
|
47
|
-
return newGenericChangeset(
|
|
43
|
+
buildChildChanges(changes: Iterable<[number, NodeId]>): GenericChangeset {
|
|
44
|
+
return newGenericChangeset(Array.from(changes));
|
|
48
45
|
},
|
|
49
46
|
},
|
|
50
47
|
intoDelta: (change: GenericChangeset, deltaFromChild: ToDelta): FieldChangeDelta => {
|
|
@@ -182,39 +179,10 @@ export const genericFieldKind: FieldKindWithEditor = new FieldKindWithEditor(
|
|
|
182
179
|
export function convertGenericChange<TChange>(
|
|
183
180
|
changeset: GenericChangeset,
|
|
184
181
|
target: FieldChangeHandler<TChange>,
|
|
185
|
-
composeChild: NodeChangeComposer,
|
|
186
|
-
genId: IdAllocator,
|
|
187
|
-
revisionMetadata: RevisionMetadataSource,
|
|
188
182
|
): TChange {
|
|
189
|
-
|
|
190
|
-
for (const [index, nodeChange] of changeset.entries()) {
|
|
191
|
-
perIndex.push(target.editor.buildChildChange(index, nodeChange));
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
if (perIndex.length === 0) {
|
|
195
|
-
return target.createEmpty();
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
return perIndex.reduce((a, b) =>
|
|
199
|
-
target.rebaser.compose(
|
|
200
|
-
a,
|
|
201
|
-
b,
|
|
202
|
-
composeChild,
|
|
203
|
-
genId,
|
|
204
|
-
invalidCrossFieldManager,
|
|
205
|
-
revisionMetadata,
|
|
206
|
-
),
|
|
207
|
-
);
|
|
183
|
+
return target.editor.buildChildChanges(changeset.entries());
|
|
208
184
|
}
|
|
209
185
|
|
|
210
|
-
const invalidFunc = (): never => fail("Should not be called when converting generic changes");
|
|
211
|
-
const invalidCrossFieldManager: CrossFieldManager = {
|
|
212
|
-
set: invalidFunc,
|
|
213
|
-
get: invalidFunc,
|
|
214
|
-
onMoveIn: invalidFunc,
|
|
215
|
-
moveKey: invalidFunc,
|
|
216
|
-
};
|
|
217
|
-
|
|
218
186
|
function* relevantRemovedRoots(
|
|
219
187
|
change: GenericChangeset,
|
|
220
188
|
relevantRemovedRootsFromChild: RelevantRemovedRootsFromChild,
|