@fluidframework/tree 2.20.0 → 2.22.0
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 +14 -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 +35 -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 +1 -151
- 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 +11 -12
- 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/feature-libraries/treeCursorUtils.d.ts.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.js +1 -1
- package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +4 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/public.d.ts +1 -0
- package/dist/shared-tree/index.d.ts +1 -2
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +1 -4
- 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 +39 -39
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +81 -55
- 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.js +1 -1
- 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/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 +25 -30
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +20 -49
- 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 +158 -63
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +181 -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 +27 -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/core/getOrCreateNode.d.ts.map +1 -1
- package/dist/simple-tree/core/getOrCreateNode.js +1 -1
- package/dist/simple-tree/core/getOrCreateNode.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 -2
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts +2 -6
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +10 -13
- package/dist/simple-tree/core/treeNodeKernel.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/proxies.js +1 -1
- package/dist/simple-tree/proxies.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/rangeMap.d.ts +11 -2
- package/dist/util/rangeMap.d.ts.map +1 -1
- package/dist/util/rangeMap.js +36 -8
- package/dist/util/rangeMap.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 +1 -151
- 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 +11 -12
- 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/feature-libraries/treeCursorUtils.d.ts.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.js +2 -2
- package/lib/feature-libraries/treeCursorUtils.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 +4 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +1 -0
- package/lib/shared-tree/index.d.ts +1 -2
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -2
- 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 +39 -39
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +79 -53
- 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.js +2 -2
- 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/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 +25 -30
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +19 -48
- 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 +158 -63
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +180 -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 +27 -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/core/getOrCreateNode.d.ts.map +1 -1
- package/lib/simple-tree/core/getOrCreateNode.js +2 -2
- package/lib/simple-tree/core/getOrCreateNode.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/treeNodeKernel.d.ts +2 -6
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +9 -11
- package/lib/simple-tree/core/treeNodeKernel.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/proxies.js +2 -2
- package/lib/simple-tree/proxies.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/rangeMap.d.ts +11 -2
- package/lib/util/rangeMap.d.ts.map +1 -1
- package/lib/util/rangeMap.js +36 -8
- package/lib/util/rangeMap.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 +4 -197
- 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 +9 -42
- 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/feature-libraries/treeCursorUtils.ts +4 -2
- package/src/index.ts +15 -10
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/index.ts +3 -14
- package/src/shared-tree/schematizingTreeView.ts +18 -16
- package/src/shared-tree/sharedTree.ts +203 -103
- package/src/shared-tree/treeApi.ts +10 -1
- package/src/shared-tree/treeCheckout.ts +11 -8
- package/src/shared-tree-core/editManager.ts +2 -2
- package/src/shared-tree-core/editManagerSummarizer.ts +0 -11
- package/src/shared-tree-core/sequenceIdUtils.ts +26 -5
- package/src/shared-tree-core/sharedTreeCore.ts +30 -87
- package/src/simple-tree/api/index.ts +15 -0
- package/src/simple-tree/api/schemaFactory.ts +205 -89
- package/src/{shared-tree → simple-tree/api}/transactionTypes.ts +1 -1
- package/src/simple-tree/api/tree.ts +35 -6
- package/src/simple-tree/core/getOrCreateNode.ts +6 -2
- package/src/simple-tree/core/index.ts +1 -1
- package/src/simple-tree/core/treeNodeKernel.ts +16 -14
- package/src/simple-tree/index.ts +12 -0
- package/src/simple-tree/proxies.ts +2 -2
- package/src/simple-tree/schemaTypes.ts +2 -2
- package/src/treeFactory.ts +29 -11
- package/src/util/breakable.ts +1 -1
- package/src/util/rangeMap.ts +36 -7
- 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/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/transactionTypes.d.ts.map +0 -1
- package/src/core/tree/visitPath.ts +0 -124
- /package/dist/{shared-tree → simple-tree/api}/transactionTypes.js +0 -0
- /package/lib/{shared-tree → simple-tree/api}/transactionTypes.js +0 -0
|
@@ -22,19 +22,9 @@ import {
|
|
|
22
22
|
import type { FieldKey } from "../schema-stored/index.js";
|
|
23
23
|
|
|
24
24
|
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";
|
|
25
|
+
import type { PlaceIndex, Range, UpPath } from "./pathTree.js";
|
|
34
26
|
import { EmptyKey } from "./types.js";
|
|
35
27
|
import type { DeltaVisitor } from "./visitDelta.js";
|
|
36
|
-
import type { PathVisitor } from "./visitPath.js";
|
|
37
|
-
import type { AnnouncedVisitor } from "./visitorUtils.js";
|
|
38
28
|
|
|
39
29
|
/**
|
|
40
30
|
* A way to refer to a particular tree location within an {@link AnchorSet}.
|
|
@@ -137,10 +127,9 @@ export interface AnchorEvents {
|
|
|
137
127
|
* rooted at `anchor` _may_ be about to change due to updates from the batch.
|
|
138
128
|
*
|
|
139
129
|
* @remarks
|
|
140
|
-
* The event can optionally return a {@link PathVisitor} to traverse the subtree.
|
|
141
130
|
* Called on every parent (transitively) when a change is occurring.
|
|
142
131
|
*/
|
|
143
|
-
subtreeChanging(anchor: AnchorNode):
|
|
132
|
+
subtreeChanging(anchor: AnchorNode): void;
|
|
144
133
|
|
|
145
134
|
/**
|
|
146
135
|
* Emitted in the middle of applying a batch of changes (i.e. during a delta a visit), if something in the subtree
|
|
@@ -689,7 +678,7 @@ export class AnchorSet implements AnchorLocator {
|
|
|
689
678
|
* It is invalid to acquire a visitor without releasing the previous one,
|
|
690
679
|
* and this method will throw an error if this is attempted.
|
|
691
680
|
*/
|
|
692
|
-
public acquireVisitor():
|
|
681
|
+
public acquireVisitor(): DeltaVisitor {
|
|
693
682
|
assert(
|
|
694
683
|
this.activeVisitor === undefined,
|
|
695
684
|
0x767 /* Must release existing visitor before acquiring another */,
|
|
@@ -716,10 +705,6 @@ export class AnchorSet implements AnchorLocator {
|
|
|
716
705
|
}
|
|
717
706
|
}
|
|
718
707
|
},
|
|
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
708
|
parentField: undefined as FieldKey | undefined,
|
|
724
709
|
parent: undefined as UpPath | undefined,
|
|
725
710
|
|
|
@@ -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;
|
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,
|
|
@@ -131,8 +131,6 @@ export class ModularChangeFamily
|
|
|
131
131
|
private normalizeFieldChanges(
|
|
132
132
|
change1: FieldChange,
|
|
133
133
|
change2: FieldChange,
|
|
134
|
-
genId: IdAllocator,
|
|
135
|
-
revisionMetadata: RevisionMetadataSource,
|
|
136
134
|
): {
|
|
137
135
|
fieldKind: FieldKindIdentifier;
|
|
138
136
|
changeHandler: FieldChangeHandler<unknown>;
|
|
@@ -156,18 +154,8 @@ export class ModularChangeFamily
|
|
|
156
154
|
}
|
|
157
155
|
const fieldKind = getFieldKind(this.fieldKinds, kind);
|
|
158
156
|
const changeHandler = fieldKind.changeHandler;
|
|
159
|
-
const normalizedChange1 = this.normalizeFieldChange(
|
|
160
|
-
|
|
161
|
-
changeHandler,
|
|
162
|
-
genId,
|
|
163
|
-
revisionMetadata,
|
|
164
|
-
);
|
|
165
|
-
const normalizedChange2 = this.normalizeFieldChange(
|
|
166
|
-
change2,
|
|
167
|
-
changeHandler,
|
|
168
|
-
genId,
|
|
169
|
-
revisionMetadata,
|
|
170
|
-
);
|
|
157
|
+
const normalizedChange1 = this.normalizeFieldChange(change1, changeHandler);
|
|
158
|
+
const normalizedChange2 = this.normalizeFieldChange(change2, changeHandler);
|
|
171
159
|
return {
|
|
172
160
|
fieldKind: kind,
|
|
173
161
|
changeHandler,
|
|
@@ -179,8 +167,6 @@ export class ModularChangeFamily
|
|
|
179
167
|
private normalizeFieldChange<T>(
|
|
180
168
|
fieldChange: FieldChange,
|
|
181
169
|
handler: FieldChangeHandler<T>,
|
|
182
|
-
genId: IdAllocator,
|
|
183
|
-
revisionMetadata: RevisionMetadataSource,
|
|
184
170
|
): FieldChangeset {
|
|
185
171
|
if (fieldChange.fieldKind !== genericFieldKind.identifier) {
|
|
186
172
|
return fieldChange.change;
|
|
@@ -188,20 +174,7 @@ export class ModularChangeFamily
|
|
|
188
174
|
|
|
189
175
|
// The cast is based on the `fieldKind` check above
|
|
190
176
|
const genericChange = fieldChange.change as unknown as GenericChangeset;
|
|
191
|
-
const convertedChange = convertGenericChange(
|
|
192
|
-
genericChange,
|
|
193
|
-
handler,
|
|
194
|
-
(child1, child2) => {
|
|
195
|
-
assert(
|
|
196
|
-
child1 === undefined || child2 === undefined,
|
|
197
|
-
0x92f /* Should not have two changesets to compose */,
|
|
198
|
-
);
|
|
199
|
-
|
|
200
|
-
return child1 ?? child2 ?? fail("Should not compose two undefined node IDs");
|
|
201
|
-
},
|
|
202
|
-
genId,
|
|
203
|
-
revisionMetadata,
|
|
204
|
-
) as FieldChangeset;
|
|
177
|
+
const convertedChange = convertGenericChange(genericChange, handler) as FieldChangeset;
|
|
205
178
|
|
|
206
179
|
return convertedChange;
|
|
207
180
|
}
|
|
@@ -578,7 +551,7 @@ export class ModularChangeFamily
|
|
|
578
551
|
changeHandler,
|
|
579
552
|
change1: change1Normalized,
|
|
580
553
|
change2: change2Normalized,
|
|
581
|
-
} = this.normalizeFieldChanges(change1, change2
|
|
554
|
+
} = this.normalizeFieldChanges(change1, change2);
|
|
582
555
|
|
|
583
556
|
const manager = new ComposeManager(crossFieldTable, change1, fieldId);
|
|
584
557
|
|
|
@@ -1155,12 +1128,7 @@ export class ModularChangeFamily
|
|
|
1155
1128
|
changeHandler,
|
|
1156
1129
|
change1: fieldChangeset,
|
|
1157
1130
|
change2: baseChangeset,
|
|
1158
|
-
} = this.normalizeFieldChanges(
|
|
1159
|
-
context.newChange,
|
|
1160
|
-
context.baseChange,
|
|
1161
|
-
genId,
|
|
1162
|
-
rebaseMetadata,
|
|
1163
|
-
);
|
|
1131
|
+
} = this.normalizeFieldChanges(context.newChange, context.baseChange);
|
|
1164
1132
|
|
|
1165
1133
|
const rebaseChild = (
|
|
1166
1134
|
curr: NodeId | undefined,
|
|
@@ -1338,7 +1306,7 @@ export class ModularChangeFamily
|
|
|
1338
1306
|
changeHandler,
|
|
1339
1307
|
change1: fieldChangeset,
|
|
1340
1308
|
change2: baseChangeset,
|
|
1341
|
-
} = this.normalizeFieldChanges(fieldChange, baseChange
|
|
1309
|
+
} = this.normalizeFieldChanges(fieldChange, baseChange);
|
|
1342
1310
|
|
|
1343
1311
|
const manager = new RebaseManager(crossFieldTable, baseChange, fieldId);
|
|
1344
1312
|
|
|
@@ -2938,10 +2906,9 @@ function buildModularChangesetFromNode(props: {
|
|
|
2938
2906
|
nodeId = { localId: brand(props.idAllocator.allocate()), revision: props.revision },
|
|
2939
2907
|
} = props;
|
|
2940
2908
|
setInChangeAtomIdMap(props.nodeChanges, nodeId, props.nodeChange);
|
|
2941
|
-
const fieldChangeset = genericFieldKind.changeHandler.editor.
|
|
2942
|
-
path.parentIndex,
|
|
2943
|
-
|
|
2944
|
-
);
|
|
2909
|
+
const fieldChangeset = genericFieldKind.changeHandler.editor.buildChildChanges([
|
|
2910
|
+
[path.parentIndex, nodeId],
|
|
2911
|
+
]);
|
|
2945
2912
|
|
|
2946
2913
|
const fieldChange: FieldChange = {
|
|
2947
2914
|
fieldKind: genericFieldKind.identifier,
|
|
@@ -645,11 +645,18 @@ export const optionalFieldEditor: OptionalFieldEditor = {
|
|
|
645
645
|
},
|
|
646
646
|
}),
|
|
647
647
|
|
|
648
|
-
|
|
649
|
-
|
|
648
|
+
buildChildChanges: (changes: Iterable<[number, NodeId]>): OptionalChangeset => {
|
|
649
|
+
const childChanges: ChildChange[] = Array.from(changes, ([index, childChange]) => {
|
|
650
|
+
assert(index === 0, 0x404 /* Optional fields only support a single child node */);
|
|
651
|
+
return ["self", childChange];
|
|
652
|
+
});
|
|
653
|
+
assert(
|
|
654
|
+
childChanges.length <= 1,
|
|
655
|
+
0xabd /* Optional fields only support a single child node */,
|
|
656
|
+
);
|
|
650
657
|
return {
|
|
651
658
|
moves: [],
|
|
652
|
-
childChanges
|
|
659
|
+
childChanges,
|
|
653
660
|
};
|
|
654
661
|
},
|
|
655
662
|
};
|
|
@@ -5,14 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
import { bufferToString } from "@fluid-internal/client-utils";
|
|
7
7
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
8
|
-
import type {
|
|
9
|
-
IFluidDataStoreRuntime,
|
|
10
|
-
IChannelStorageService,
|
|
11
|
-
} from "@fluidframework/datastore-definitions/internal";
|
|
8
|
+
import type { IChannelStorageService } from "@fluidframework/datastore-definitions/internal";
|
|
12
9
|
import { SummaryType } from "@fluidframework/driver-definitions";
|
|
13
10
|
import type {
|
|
14
11
|
IExperimentalIncrementalSummaryContext,
|
|
15
|
-
IGarbageCollectionData,
|
|
16
12
|
ISummaryTreeWithStats,
|
|
17
13
|
ITelemetryContext,
|
|
18
14
|
} from "@fluidframework/runtime-definitions/internal";
|
|
@@ -46,7 +42,6 @@ export class SchemaSummarizer implements Summarizable {
|
|
|
46
42
|
private schemaIndexLastChangedSeq: number | undefined;
|
|
47
43
|
|
|
48
44
|
public constructor(
|
|
49
|
-
private readonly runtime: IFluidDataStoreRuntime,
|
|
50
45
|
private readonly schema: MutableTreeStoredSchema,
|
|
51
46
|
options: ICodecOptions,
|
|
52
47
|
collabWindow: CollabWindow,
|
|
@@ -94,16 +89,6 @@ export class SchemaSummarizer implements Summarizable {
|
|
|
94
89
|
throw new Error("Method not implemented.");
|
|
95
90
|
}
|
|
96
91
|
|
|
97
|
-
public getGCData(fullGC?: boolean): IGarbageCollectionData {
|
|
98
|
-
// TODO: Properly implement garbage collection. Right now, garbage collection is performed automatically
|
|
99
|
-
// by the code in SharedObject (from which SharedTreeCore extends). The `runtime.uploadBlob` API delegates
|
|
100
|
-
// to the `BlobManager`, which automatically populates the summary with ISummaryAttachment entries for each
|
|
101
|
-
// blob.
|
|
102
|
-
return {
|
|
103
|
-
gcNodes: {},
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
|
|
107
92
|
public async load(
|
|
108
93
|
services: IChannelStorageService,
|
|
109
94
|
parse: SummaryElementParser,
|
|
@@ -75,8 +75,19 @@ export interface SequenceFieldEditor extends FieldEditor<Changeset> {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
export const sequenceFieldEditor = {
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
buildChildChanges: (changes: Iterable<[number, NodeId]>): Changeset => {
|
|
79
|
+
const changeset: Changeset = [];
|
|
80
|
+
let currentIndex = 0;
|
|
81
|
+
for (const [index, change] of changes) {
|
|
82
|
+
assert(index >= currentIndex, 0xabe /* Child changes must be in order. */);
|
|
83
|
+
if (index > currentIndex) {
|
|
84
|
+
changeset.push({ count: index - currentIndex });
|
|
85
|
+
}
|
|
86
|
+
changeset.push({ count: 1, changes: change });
|
|
87
|
+
currentIndex = index + 1;
|
|
88
|
+
}
|
|
89
|
+
return changeset;
|
|
90
|
+
},
|
|
80
91
|
insert: (
|
|
81
92
|
index: number,
|
|
82
93
|
count: number,
|