@fluidframework/tree 2.2.0 → 2.3.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/.dependency-cruiser-known-violations.json +28 -40
- package/.vscode/Tree.code-workspace +0 -2
- package/CHANGELOG.md +92 -0
- package/README.md +6 -0
- package/alpha.d.ts +11 -0
- package/api-extractor/api-extractor-lint-alpha.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-alpha.esm.json +5 -0
- package/api-extractor/api-extractor-lint-legacy.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-legacy.esm.json +5 -0
- package/api-extractor/api-extractor.current.json +8 -0
- package/api-extractor/api-extractor.legacy.json +4 -0
- package/api-extractor.json +1 -1
- package/api-report/tree.alpha.api.md +21 -6
- package/api-report/tree.beta.api.md +21 -6
- package/api-report/tree.legacy.alpha.api.md +562 -0
- package/api-report/tree.legacy.public.api.md +559 -0
- package/api-report/tree.public.api.md +6 -6
- package/dist/alpha.d.ts +102 -0
- package/dist/beta.d.ts +6 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/{revertible/revertible.d.ts → revertible.d.ts} +12 -0
- package/dist/core/revertible.d.ts.map +1 -0
- package/dist/core/revertible.js.map +1 -0
- package/dist/core/schema-stored/format.d.ts +3 -3
- package/dist/core/schema-stored/format.js +1 -1
- package/dist/core/schema-stored/format.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +2 -7
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +4 -6
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.d.ts +4 -6
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +15 -1
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts +0 -1
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +1 -0
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/visitDelta.d.ts +7 -2
- package/dist/core/tree/visitDelta.d.ts.map +1 -1
- package/dist/core/tree/visitDelta.js.map +1 -1
- package/dist/events/emitter.d.ts +127 -0
- package/dist/events/emitter.d.ts.map +1 -0
- package/dist/events/{events.js → emitter.js} +49 -28
- package/dist/events/emitter.js.map +1 -0
- package/dist/events/index.d.ts +2 -1
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +4 -5
- package/dist/events/index.js.map +1 -1
- package/dist/events/interop.d.ts +36 -0
- package/dist/events/interop.d.ts.map +1 -0
- package/dist/{core/revertible/index.d.ts → events/interop.js} +3 -2
- package/dist/events/interop.js.map +1 -0
- package/dist/events/listeners.d.ts +65 -0
- package/dist/events/listeners.d.ts.map +1 -0
- package/{lib/core/revertible/index.d.ts → dist/events/listeners.js} +3 -2
- package/dist/events/listeners.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +25 -7
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +36 -15
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -2
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +12 -5
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +15 -2
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +28 -2
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +5 -4
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/flex-map-tree/index.d.ts +1 -1
- package/dist/feature-libraries/flex-map-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-map-tree/index.js +2 -1
- package/dist/feature-libraries/flex-map-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts +35 -35
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +82 -115
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +30 -14
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +10 -7
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +57 -281
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js +15 -32
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/index.d.ts +2 -3
- package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/index.js +1 -3
- package/dist/feature-libraries/flex-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +3 -3
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.js +2 -10
- package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +26 -29
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +11 -17
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts +6 -34
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +23 -159
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/unboxed.d.ts +4 -16
- package/dist/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/unboxed.js +7 -41
- package/dist/feature-libraries/flex-tree/unboxed.js.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.d.ts +2 -2
- package/dist/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.js +3 -6
- package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +4 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +3 -5
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +5 -13
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +3 -6
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/discrepancies.js +3 -13
- package/dist/feature-libraries/modular-schema/discrepancies.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +4 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +12 -5
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +6 -6
- package/dist/feature-libraries/schema-index/format.d.ts +3 -3
- package/dist/feature-libraries/storedToViewSchema.d.ts.map +1 -1
- package/dist/feature-libraries/storedToViewSchema.js +2 -4
- package/dist/feature-libraries/storedToViewSchema.js.map +1 -1
- package/dist/feature-libraries/typed-schema/flexList.d.ts +3 -3
- package/dist/feature-libraries/typed-schema/flexList.js.map +1 -1
- package/dist/feature-libraries/typed-schema/index.d.ts +2 -2
- package/dist/feature-libraries/typed-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/index.js +2 -2
- package/dist/feature-libraries/typed-schema/index.js.map +1 -1
- package/dist/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/schemaCollection.js +8 -10
- package/dist/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +17 -48
- package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js +5 -37
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/dist/feature-libraries/typed-schema/view.d.ts +4 -6
- package/dist/feature-libraries/typed-schema/view.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/view.js +5 -4
- package/dist/feature-libraries/typed-schema/view.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +83 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/checkoutFlexTreeView.d.ts +53 -0
- package/dist/shared-tree/checkoutFlexTreeView.d.ts.map +1 -0
- package/dist/shared-tree/{treeView.js → checkoutFlexTreeView.js} +28 -6
- package/dist/shared-tree/checkoutFlexTreeView.js.map +1 -0
- package/dist/shared-tree/index.d.ts +3 -3
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +2 -2
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts +15 -4
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +7 -8
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +9 -4
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +25 -12
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +2 -2
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +3 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js +6 -2
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +3 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +3 -2
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts +2 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js +2 -2
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/treeApi.d.ts +1 -3
- package/dist/shared-tree/treeApi.d.ts.map +1 -1
- package/dist/shared-tree/treeApi.js +6 -4
- package/dist/shared-tree/treeApi.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +2 -13
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +17 -1
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.js +1 -1
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/simple-tree/api/create.d.ts.map +1 -1
- package/dist/simple-tree/api/create.js +1 -1
- package/dist/simple-tree/api/create.js.map +1 -1
- package/{lib/simple-tree → dist/simple-tree/api}/getJsonSchema.d.ts +1 -1
- package/dist/simple-tree/api/getJsonSchema.d.ts.map +1 -0
- package/dist/simple-tree/{getJsonSchema.js → api/getJsonSchema.js} +1 -1
- package/dist/simple-tree/api/getJsonSchema.js.map +1 -0
- package/{lib/simple-tree → dist/simple-tree/api}/getSimpleSchema.d.ts +1 -1
- package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -0
- package/dist/simple-tree/{getSimpleSchema.js → api/getSimpleSchema.js} +1 -1
- package/dist/simple-tree/api/getSimpleSchema.js.map +1 -0
- package/dist/simple-tree/api/index.d.ts +5 -0
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +7 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/{lib/simple-tree → dist/simple-tree/api}/jsonSchema.d.ts +1 -1
- package/dist/simple-tree/api/jsonSchema.d.ts.map +1 -0
- package/dist/simple-tree/api/jsonSchema.js.map +1 -0
- package/dist/simple-tree/api/schemaFactory.d.ts +45 -14
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +43 -12
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/{simpleSchema.d.ts → api/simpleSchema.d.ts} +4 -4
- package/dist/simple-tree/api/simpleSchema.d.ts.map +1 -0
- package/dist/simple-tree/api/simpleSchema.js.map +1 -0
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -0
- package/dist/simple-tree/{simpleSchemaToJsonSchema.js → api/simpleSchemaToJsonSchema.js} +4 -4
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -0
- package/dist/simple-tree/api/tree.d.ts +1 -21
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js +3 -38
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeApiBeta.d.ts +79 -0
- package/dist/simple-tree/api/treeApiBeta.d.ts.map +1 -0
- package/dist/simple-tree/api/treeApiBeta.js +26 -0
- package/dist/simple-tree/api/treeApiBeta.js.map +1 -0
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +51 -21
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +2 -2
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/{viewSchemaToSimpleSchema.d.ts → api/viewSchemaToSimpleSchema.d.ts} +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -0
- package/dist/simple-tree/{viewSchemaToSimpleSchema.js → api/viewSchemaToSimpleSchema.js} +4 -4
- package/{lib/simple-tree → dist/simple-tree/api}/viewSchemaToSimpleSchema.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts +2 -2
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js +33 -38
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +2 -2
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +4 -1
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/schemaCaching.d.ts +5 -0
- package/dist/simple-tree/core/schemaCaching.d.ts.map +1 -1
- package/dist/simple-tree/core/schemaCaching.js +10 -1
- package/dist/simple-tree/core/schemaCaching.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts +78 -7
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +219 -30
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/types.d.ts +23 -8
- package/dist/simple-tree/core/types.d.ts.map +1 -1
- package/dist/simple-tree/core/types.js.map +1 -1
- package/dist/simple-tree/core/withType.d.ts +3 -2
- package/dist/simple-tree/core/withType.d.ts.map +1 -1
- package/dist/simple-tree/core/withType.js.map +1 -1
- package/dist/simple-tree/index.d.ts +7 -9
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +15 -6
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +7 -9
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +13 -11
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/mapNode.d.ts +1 -1
- package/dist/simple-tree/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/mapNode.js +38 -29
- package/dist/simple-tree/mapNode.js.map +1 -1
- package/dist/simple-tree/objectNode.d.ts +9 -7
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +37 -31
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/proxies.d.ts +1 -14
- package/dist/simple-tree/proxies.d.ts.map +1 -1
- package/dist/simple-tree/proxies.js +12 -15
- package/dist/simple-tree/proxies.js.map +1 -1
- package/dist/simple-tree/proxyBinding.d.ts +2 -62
- package/dist/simple-tree/proxyBinding.d.ts.map +1 -1
- package/dist/simple-tree/proxyBinding.js +8 -181
- package/dist/simple-tree/proxyBinding.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +7 -7
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js +4 -4
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/toFlexSchema.d.ts +11 -1
- package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/dist/simple-tree/toFlexSchema.js +54 -31
- package/dist/simple-tree/toFlexSchema.js.map +1 -1
- package/dist/simple-tree/toMapTree.d.ts +25 -37
- package/dist/simple-tree/toMapTree.d.ts.map +1 -1
- package/dist/simple-tree/toMapTree.js +53 -16
- package/dist/simple-tree/toMapTree.js.map +1 -1
- package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/treeNodeValid.js +7 -10
- package/dist/simple-tree/treeNodeValid.js.map +1 -1
- package/dist/simple-tree/typesUnsafe.d.ts +13 -13
- package/dist/simple-tree/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/walkSchema.d.ts +26 -0
- package/dist/simple-tree/walkSchema.d.ts.map +1 -0
- package/dist/simple-tree/walkSchema.js +49 -0
- package/dist/simple-tree/walkSchema.js.map +1 -0
- package/dist/treeFactory.d.ts +2 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +2 -1
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/typeUtils.d.ts +2 -2
- package/dist/util/typeUtils.js.map +1 -1
- package/legacy.d.ts +11 -0
- package/lib/alpha.d.ts +102 -0
- package/lib/beta.d.ts +6 -1
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/{revertible/revertible.d.ts → revertible.d.ts} +12 -0
- package/lib/core/revertible.d.ts.map +1 -0
- package/lib/core/revertible.js.map +1 -0
- package/lib/core/schema-stored/format.d.ts +3 -3
- package/lib/core/schema-stored/format.js +1 -1
- package/lib/core/schema-stored/format.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +2 -7
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +4 -6
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.d.ts +4 -6
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +15 -1
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts +0 -1
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +1 -0
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/visitDelta.d.ts +7 -2
- package/lib/core/tree/visitDelta.d.ts.map +1 -1
- package/lib/core/tree/visitDelta.js.map +1 -1
- package/lib/events/emitter.d.ts +127 -0
- package/lib/events/emitter.d.ts.map +1 -0
- package/lib/events/{events.js → emitter.js} +49 -27
- package/lib/events/emitter.js.map +1 -0
- package/lib/events/index.d.ts +2 -1
- package/lib/events/index.d.ts.map +1 -1
- package/lib/events/index.js +1 -1
- package/lib/events/index.js.map +1 -1
- package/lib/events/interop.d.ts +36 -0
- package/lib/events/interop.d.ts.map +1 -0
- package/{src/core/revertible/index.ts → lib/events/interop.js} +2 -2
- package/lib/events/interop.js.map +1 -0
- package/lib/events/listeners.d.ts +65 -0
- package/lib/events/listeners.d.ts.map +1 -0
- package/lib/{core/revertible/index.js → events/listeners.js} +2 -2
- package/lib/events/listeners.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +25 -7
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +37 -16
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -2
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +12 -5
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +15 -2
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +28 -2
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +5 -4
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/flex-map-tree/index.d.ts +1 -1
- package/lib/feature-libraries/flex-map-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-map-tree/index.js +1 -1
- package/lib/feature-libraries/flex-map-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts +35 -35
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js +83 -116
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +30 -14
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +10 -7
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +57 -281
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js +15 -31
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/flex-tree/index.d.ts +2 -3
- package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/index.js +2 -2
- package/lib/feature-libraries/flex-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts +3 -3
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.js +2 -10
- package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +26 -29
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +11 -16
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts +6 -34
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +24 -156
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/unboxed.d.ts +4 -16
- package/lib/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/unboxed.js +5 -37
- package/lib/feature-libraries/flex-tree/unboxed.js.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.d.ts +2 -2
- package/lib/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.js +3 -6
- package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +4 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +3 -5
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +5 -5
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +3 -6
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/discrepancies.js +3 -13
- package/lib/feature-libraries/modular-schema/discrepancies.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +4 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +12 -5
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +6 -6
- package/lib/feature-libraries/schema-index/format.d.ts +3 -3
- package/lib/feature-libraries/storedToViewSchema.d.ts.map +1 -1
- package/lib/feature-libraries/storedToViewSchema.js +3 -5
- package/lib/feature-libraries/storedToViewSchema.js.map +1 -1
- package/lib/feature-libraries/typed-schema/flexList.d.ts +3 -3
- package/lib/feature-libraries/typed-schema/flexList.js.map +1 -1
- package/lib/feature-libraries/typed-schema/index.d.ts +2 -2
- package/lib/feature-libraries/typed-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/index.js +2 -2
- package/lib/feature-libraries/typed-schema/index.js.map +1 -1
- package/lib/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/schemaCollection.js +9 -11
- package/lib/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts +17 -48
- package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js +5 -36
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/lib/feature-libraries/typed-schema/view.d.ts +4 -6
- package/lib/feature-libraries/typed-schema/view.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/view.js +5 -4
- package/lib/feature-libraries/typed-schema/view.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +83 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/checkoutFlexTreeView.d.ts +53 -0
- package/lib/shared-tree/checkoutFlexTreeView.d.ts.map +1 -0
- package/lib/shared-tree/{treeView.js → checkoutFlexTreeView.js} +26 -5
- package/lib/shared-tree/checkoutFlexTreeView.js.map +1 -0
- package/lib/shared-tree/index.d.ts +3 -3
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts +15 -4
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +8 -9
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +9 -4
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +26 -13
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +2 -2
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +3 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js +6 -2
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +3 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +3 -2
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts +2 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js +2 -2
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/treeApi.d.ts +1 -3
- package/lib/shared-tree/treeApi.d.ts.map +1 -1
- package/lib/shared-tree/treeApi.js +7 -5
- package/lib/shared-tree/treeApi.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +2 -13
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +18 -2
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.js +1 -1
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/simple-tree/api/create.d.ts.map +1 -1
- package/lib/simple-tree/api/create.js +2 -2
- package/lib/simple-tree/api/create.js.map +1 -1
- package/{dist/simple-tree → lib/simple-tree/api}/getJsonSchema.d.ts +1 -1
- package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -0
- package/lib/simple-tree/{getJsonSchema.js → api/getJsonSchema.js} +1 -1
- package/lib/simple-tree/api/getJsonSchema.js.map +1 -0
- package/{dist/simple-tree → lib/simple-tree/api}/getSimpleSchema.d.ts +1 -1
- package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -0
- package/lib/simple-tree/{getSimpleSchema.js → api/getSimpleSchema.js} +1 -1
- package/lib/simple-tree/api/getSimpleSchema.js.map +1 -0
- package/lib/simple-tree/api/index.d.ts +5 -0
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +3 -0
- package/lib/simple-tree/api/index.js.map +1 -1
- package/{dist/simple-tree → lib/simple-tree/api}/jsonSchema.d.ts +1 -1
- package/lib/simple-tree/api/jsonSchema.d.ts.map +1 -0
- package/lib/simple-tree/api/jsonSchema.js.map +1 -0
- package/lib/simple-tree/api/schemaFactory.d.ts +45 -14
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +43 -12
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/{simpleSchema.d.ts → api/simpleSchema.d.ts} +4 -4
- package/lib/simple-tree/api/simpleSchema.d.ts.map +1 -0
- package/lib/simple-tree/api/simpleSchema.js.map +1 -0
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -0
- package/lib/simple-tree/{simpleSchemaToJsonSchema.js → api/simpleSchemaToJsonSchema.js} +4 -4
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -0
- package/lib/simple-tree/api/tree.d.ts +1 -21
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js +2 -34
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeApiBeta.d.ts +79 -0
- package/lib/simple-tree/api/treeApiBeta.d.ts.map +1 -0
- package/lib/simple-tree/api/treeApiBeta.js +23 -0
- package/lib/simple-tree/api/treeApiBeta.js.map +1 -0
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +53 -23
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +1 -1
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/{viewSchemaToSimpleSchema.d.ts → api/viewSchemaToSimpleSchema.d.ts} +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -0
- package/lib/simple-tree/{viewSchemaToSimpleSchema.js → api/viewSchemaToSimpleSchema.js} +4 -4
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -0
- package/lib/simple-tree/arrayNode.d.ts +2 -2
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js +36 -41
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +2 -2
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +2 -2
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/schemaCaching.d.ts +5 -0
- package/lib/simple-tree/core/schemaCaching.d.ts.map +1 -1
- package/lib/simple-tree/core/schemaCaching.js +8 -0
- package/lib/simple-tree/core/schemaCaching.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts +78 -7
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +211 -24
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/core/types.d.ts +23 -8
- package/lib/simple-tree/core/types.d.ts.map +1 -1
- package/lib/simple-tree/core/types.js.map +1 -1
- package/lib/simple-tree/core/withType.d.ts +3 -2
- package/lib/simple-tree/core/withType.d.ts.map +1 -1
- package/lib/simple-tree/core/withType.js.map +1 -1
- package/lib/simple-tree/index.d.ts +7 -9
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +5 -5
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts +7 -9
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +14 -12
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/mapNode.d.ts +1 -1
- package/lib/simple-tree/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/mapNode.js +38 -29
- package/lib/simple-tree/mapNode.js.map +1 -1
- package/lib/simple-tree/objectNode.d.ts +9 -7
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +40 -34
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/proxies.d.ts +1 -14
- package/lib/simple-tree/proxies.d.ts.map +1 -1
- package/lib/simple-tree/proxies.js +11 -14
- package/lib/simple-tree/proxies.js.map +1 -1
- package/lib/simple-tree/proxyBinding.d.ts +2 -62
- package/lib/simple-tree/proxyBinding.d.ts.map +1 -1
- package/lib/simple-tree/proxyBinding.js +6 -174
- package/lib/simple-tree/proxyBinding.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +7 -7
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js +4 -4
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/toFlexSchema.d.ts +11 -1
- package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/lib/simple-tree/toFlexSchema.js +29 -8
- package/lib/simple-tree/toFlexSchema.js.map +1 -1
- package/lib/simple-tree/toMapTree.d.ts +25 -37
- package/lib/simple-tree/toMapTree.d.ts.map +1 -1
- package/lib/simple-tree/toMapTree.js +54 -17
- package/lib/simple-tree/toMapTree.js.map +1 -1
- package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/treeNodeValid.js +8 -11
- package/lib/simple-tree/treeNodeValid.js.map +1 -1
- package/lib/simple-tree/typesUnsafe.d.ts +13 -13
- package/lib/simple-tree/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/walkSchema.d.ts +26 -0
- package/lib/simple-tree/walkSchema.d.ts.map +1 -0
- package/lib/simple-tree/walkSchema.js +43 -0
- package/lib/simple-tree/walkSchema.js.map +1 -0
- package/lib/treeFactory.d.ts +2 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +2 -1
- package/lib/treeFactory.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/util/typeUtils.d.ts +2 -2
- package/lib/util/typeUtils.js.map +1 -1
- package/package.json +58 -36
- package/src/core/index.ts +1 -1
- package/src/core/{revertible/revertible.ts → revertible.ts} +15 -0
- package/src/core/schema-stored/format.ts +1 -1
- package/src/core/schema-stored/schema.ts +6 -13
- package/src/core/tree/anchorSet.ts +35 -9
- package/src/core/tree/detachedFieldIndex.ts +6 -5
- package/src/core/tree/visitDelta.ts +7 -2
- package/src/events/{events.ts → emitter.ts} +55 -134
- package/src/events/index.ts +7 -7
- package/src/events/interop.ts +49 -0
- package/src/events/listeners.ts +68 -0
- package/src/feature-libraries/chunked-forest/chunkTree.ts +63 -18
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +18 -4
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +33 -0
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +5 -3
- package/src/feature-libraries/flex-map-tree/index.ts +1 -0
- package/src/feature-libraries/flex-map-tree/mapTreeNode.ts +135 -231
- package/src/feature-libraries/flex-tree/README.md +4 -75
- package/src/feature-libraries/flex-tree/context.ts +37 -16
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +69 -458
- package/src/feature-libraries/flex-tree/index.ts +7 -29
- package/src/feature-libraries/flex-tree/lazyEntity.ts +2 -11
- package/src/feature-libraries/flex-tree/lazyField.ts +49 -79
- package/src/feature-libraries/flex-tree/lazyNode.ts +26 -306
- package/src/feature-libraries/flex-tree/unboxed.ts +9 -68
- package/src/feature-libraries/flex-tree/utilities.ts +4 -8
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +4 -1
- package/src/feature-libraries/index.ts +2 -41
- package/src/feature-libraries/modular-schema/comparison.ts +4 -6
- package/src/feature-libraries/modular-schema/discrepancies.ts +7 -16
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +4 -1
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +14 -4
- package/src/feature-libraries/storedToViewSchema.ts +5 -6
- package/src/feature-libraries/typed-schema/flexList.ts +3 -3
- package/src/feature-libraries/typed-schema/index.ts +1 -3
- package/src/feature-libraries/typed-schema/schemaCollection.ts +15 -17
- package/src/feature-libraries/typed-schema/typedTreeSchema.ts +35 -127
- package/src/feature-libraries/typed-schema/view.ts +4 -13
- package/src/index.ts +5 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/checkoutFlexTreeView.ts +89 -0
- package/src/shared-tree/index.ts +2 -7
- package/src/shared-tree/schematizeTree.ts +23 -12
- package/src/shared-tree/schematizingTreeView.ts +34 -24
- package/src/shared-tree/sharedTree.ts +6 -1
- package/src/shared-tree/sharedTreeChangeEnricher.ts +6 -1
- package/src/shared-tree/sharedTreeChangeFamily.ts +7 -1
- package/src/shared-tree/sharedTreeEditBuilder.ts +9 -4
- package/src/shared-tree/treeApi.ts +10 -10
- package/src/shared-tree/treeCheckout.ts +26 -15
- package/src/shared-tree-core/branch.ts +1 -1
- package/src/simple-tree/ProxyBinding.md +23 -23
- package/src/simple-tree/api/create.ts +8 -3
- package/src/simple-tree/{getJsonSchema.ts → api/getJsonSchema.ts} +3 -3
- package/src/simple-tree/{getSimpleSchema.ts → api/getSimpleSchema.ts} +3 -3
- package/src/simple-tree/api/index.ts +20 -0
- package/src/simple-tree/{jsonSchema.ts → api/jsonSchema.ts} +1 -1
- package/src/simple-tree/api/schemaFactory.ts +44 -13
- package/src/simple-tree/{simpleSchema.ts → api/simpleSchema.ts} +4 -4
- package/src/simple-tree/{simpleSchemaToJsonSchema.ts → api/simpleSchemaToJsonSchema.ts} +4 -4
- package/src/simple-tree/api/tree.ts +2 -71
- package/src/simple-tree/api/treeApiBeta.ts +101 -0
- package/src/simple-tree/api/treeNodeApi.ts +63 -22
- package/src/simple-tree/api/verboseTree.ts +1 -1
- package/src/simple-tree/{viewSchemaToSimpleSchema.ts → api/viewSchemaToSimpleSchema.ts} +5 -5
- package/src/simple-tree/arrayNode.ts +38 -41
- package/src/simple-tree/core/index.ts +4 -0
- package/src/simple-tree/core/schemaCaching.ts +10 -0
- package/src/simple-tree/core/treeNodeKernel.ts +279 -27
- package/src/simple-tree/core/treeNodeSchema.ts +1 -1
- package/src/simple-tree/core/types.ts +23 -8
- package/src/simple-tree/core/withType.ts +3 -1
- package/src/simple-tree/index.ts +29 -20
- package/src/simple-tree/leafNodeSchema.ts +24 -28
- package/src/simple-tree/mapNode.ts +47 -29
- package/src/simple-tree/objectNode.ts +51 -46
- package/src/simple-tree/proxies.ts +22 -51
- package/src/simple-tree/proxyBinding.ts +3 -254
- package/src/simple-tree/schemaTypes.ts +8 -8
- package/src/simple-tree/toFlexSchema.ts +40 -7
- package/src/simple-tree/toMapTree.ts +113 -79
- package/src/simple-tree/treeNodeValid.ts +10 -13
- package/src/simple-tree/typesUnsafe.ts +13 -13
- package/src/simple-tree/walkSchema.ts +81 -0
- package/src/treeFactory.ts +2 -1
- package/src/util/typeUtils.ts +2 -2
- package/dist/core/revertible/index.d.ts.map +0 -1
- package/dist/core/revertible/index.js +0 -10
- package/dist/core/revertible/index.js.map +0 -1
- package/dist/core/revertible/revertible.d.ts.map +0 -1
- package/dist/core/revertible/revertible.js.map +0 -1
- package/dist/domains/index.d.ts +0 -8
- package/dist/domains/index.d.ts.map +0 -1
- package/dist/domains/index.js +0 -20
- package/dist/domains/index.js.map +0 -1
- package/dist/domains/json/index.d.ts +0 -7
- package/dist/domains/json/index.d.ts.map +0 -1
- package/dist/domains/json/index.js +0 -17
- package/dist/domains/json/index.js.map +0 -1
- package/dist/domains/json/jsonCursor.d.ts +0 -52
- package/dist/domains/json/jsonCursor.d.ts.map +0 -1
- package/dist/domains/json/jsonCursor.js +0 -197
- package/dist/domains/json/jsonCursor.js.map +0 -1
- package/dist/domains/json/jsonDomainSchema.d.ts +0 -24
- package/dist/domains/json/jsonDomainSchema.d.ts.map +0 -1
- package/dist/domains/json/jsonDomainSchema.js +0 -32
- package/dist/domains/json/jsonDomainSchema.js.map +0 -1
- package/dist/domains/leafDomain.d.ts +0 -72
- package/dist/domains/leafDomain.d.ts.map +0 -1
- package/dist/domains/leafDomain.js +0 -88
- package/dist/domains/leafDomain.js.map +0 -1
- package/dist/domains/schemaBuilder.d.ts +0 -103
- package/dist/domains/schemaBuilder.d.ts.map +0 -1
- package/dist/domains/schemaBuilder.js +0 -121
- package/dist/domains/schemaBuilder.js.map +0 -1
- package/dist/domains/testRecursiveDomain.d.ts +0 -17
- package/dist/domains/testRecursiveDomain.d.ts.map +0 -1
- package/dist/domains/testRecursiveDomain.js +0 -35
- package/dist/domains/testRecursiveDomain.js.map +0 -1
- package/dist/events/events.d.ts +0 -201
- package/dist/events/events.d.ts.map +0 -1
- package/dist/events/events.js.map +0 -1
- package/dist/feature-libraries/schemaBuilder.d.ts +0 -31
- package/dist/feature-libraries/schemaBuilder.d.ts.map +0 -1
- package/dist/feature-libraries/schemaBuilder.js +0 -40
- package/dist/feature-libraries/schemaBuilder.js.map +0 -1
- package/dist/feature-libraries/schemaBuilderBase.d.ts +0 -191
- package/dist/feature-libraries/schemaBuilderBase.d.ts.map +0 -1
- package/dist/feature-libraries/schemaBuilderBase.js +0 -201
- package/dist/feature-libraries/schemaBuilderBase.js.map +0 -1
- package/dist/shared-tree/treeView.d.ts +0 -73
- package/dist/shared-tree/treeView.d.ts.map +0 -1
- package/dist/shared-tree/treeView.js.map +0 -1
- package/dist/simple-tree/getJsonSchema.d.ts.map +0 -1
- package/dist/simple-tree/getJsonSchema.js.map +0 -1
- package/dist/simple-tree/getSimpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/getSimpleSchema.js.map +0 -1
- package/dist/simple-tree/jsonSchema.d.ts.map +0 -1
- package/dist/simple-tree/jsonSchema.js.map +0 -1
- package/dist/simple-tree/simpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/simpleSchema.js.map +0 -1
- package/dist/simple-tree/simpleSchemaToJsonSchema.d.ts.map +0 -1
- package/dist/simple-tree/simpleSchemaToJsonSchema.js.map +0 -1
- package/dist/simple-tree/viewSchemaToSimpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/viewSchemaToSimpleSchema.js.map +0 -1
- package/lib/core/revertible/index.d.ts.map +0 -1
- package/lib/core/revertible/index.js.map +0 -1
- package/lib/core/revertible/revertible.d.ts.map +0 -1
- package/lib/core/revertible/revertible.js.map +0 -1
- package/lib/domains/index.d.ts +0 -8
- package/lib/domains/index.d.ts.map +0 -1
- package/lib/domains/index.js +0 -8
- package/lib/domains/index.js.map +0 -1
- package/lib/domains/json/index.d.ts +0 -7
- package/lib/domains/json/index.d.ts.map +0 -1
- package/lib/domains/json/index.js +0 -7
- package/lib/domains/json/index.js.map +0 -1
- package/lib/domains/json/jsonCursor.d.ts +0 -52
- package/lib/domains/json/jsonCursor.d.ts.map +0 -1
- package/lib/domains/json/jsonCursor.js +0 -192
- package/lib/domains/json/jsonCursor.js.map +0 -1
- package/lib/domains/json/jsonDomainSchema.d.ts +0 -24
- package/lib/domains/json/jsonDomainSchema.d.ts.map +0 -1
- package/lib/domains/json/jsonDomainSchema.js +0 -29
- package/lib/domains/json/jsonDomainSchema.js.map +0 -1
- package/lib/domains/leafDomain.d.ts +0 -72
- package/lib/domains/leafDomain.d.ts.map +0 -1
- package/lib/domains/leafDomain.js +0 -85
- package/lib/domains/leafDomain.js.map +0 -1
- package/lib/domains/schemaBuilder.d.ts +0 -103
- package/lib/domains/schemaBuilder.d.ts.map +0 -1
- package/lib/domains/schemaBuilder.js +0 -117
- package/lib/domains/schemaBuilder.js.map +0 -1
- package/lib/domains/testRecursiveDomain.d.ts +0 -17
- package/lib/domains/testRecursiveDomain.d.ts.map +0 -1
- package/lib/domains/testRecursiveDomain.js +0 -32
- package/lib/domains/testRecursiveDomain.js.map +0 -1
- package/lib/events/events.d.ts +0 -201
- package/lib/events/events.d.ts.map +0 -1
- package/lib/events/events.js.map +0 -1
- package/lib/feature-libraries/schemaBuilder.d.ts +0 -31
- package/lib/feature-libraries/schemaBuilder.d.ts.map +0 -1
- package/lib/feature-libraries/schemaBuilder.js +0 -36
- package/lib/feature-libraries/schemaBuilder.js.map +0 -1
- package/lib/feature-libraries/schemaBuilderBase.d.ts +0 -191
- package/lib/feature-libraries/schemaBuilderBase.d.ts.map +0 -1
- package/lib/feature-libraries/schemaBuilderBase.js +0 -195
- package/lib/feature-libraries/schemaBuilderBase.js.map +0 -1
- package/lib/shared-tree/treeView.d.ts +0 -73
- package/lib/shared-tree/treeView.d.ts.map +0 -1
- package/lib/shared-tree/treeView.js.map +0 -1
- package/lib/simple-tree/getJsonSchema.d.ts.map +0 -1
- package/lib/simple-tree/getJsonSchema.js.map +0 -1
- package/lib/simple-tree/getSimpleSchema.d.ts.map +0 -1
- package/lib/simple-tree/getSimpleSchema.js.map +0 -1
- package/lib/simple-tree/jsonSchema.d.ts.map +0 -1
- package/lib/simple-tree/jsonSchema.js.map +0 -1
- package/lib/simple-tree/simpleSchema.d.ts.map +0 -1
- package/lib/simple-tree/simpleSchema.js.map +0 -1
- package/lib/simple-tree/simpleSchemaToJsonSchema.d.ts.map +0 -1
- package/lib/simple-tree/simpleSchemaToJsonSchema.js.map +0 -1
- package/lib/simple-tree/viewSchemaToSimpleSchema.d.ts.map +0 -1
- package/src/domains/README.md +0 -6
- package/src/domains/fence.json +0 -5
- package/src/domains/index.ts +0 -19
- package/src/domains/json/fence.json +0 -5
- package/src/domains/json/index.ts +0 -13
- package/src/domains/json/jsonCursor.ts +0 -247
- package/src/domains/json/jsonDomainSchema.ts +0 -47
- package/src/domains/leafDomain.ts +0 -97
- package/src/domains/schemaBuilder.ts +0 -153
- package/src/domains/testRecursiveDomain.ts +0 -38
- package/src/events/fence.json +0 -5
- package/src/feature-libraries/schemaBuilder.ts +0 -45
- package/src/feature-libraries/schemaBuilderBase.ts +0 -393
- package/src/shared-tree/treeView.ts +0 -113
- /package/dist/core/{revertible/revertible.js → revertible.js} +0 -0
- /package/dist/simple-tree/{jsonSchema.js → api/jsonSchema.js} +0 -0
- /package/dist/simple-tree/{simpleSchema.js → api/simpleSchema.js} +0 -0
- /package/dist/simple-tree/{simpleSchemaToJsonSchema.d.ts → api/simpleSchemaToJsonSchema.d.ts} +0 -0
- /package/lib/core/{revertible/revertible.js → revertible.js} +0 -0
- /package/lib/simple-tree/{jsonSchema.js → api/jsonSchema.js} +0 -0
- /package/lib/simple-tree/{simpleSchema.js → api/simpleSchema.js} +0 -0
- /package/lib/simple-tree/{simpleSchemaToJsonSchema.d.ts → api/simpleSchemaToJsonSchema.d.ts} +0 -0
package/dist/alpha.d.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
+
* Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
// Unrestricted APIs
|
|
13
|
+
InternalTypes,
|
|
14
|
+
|
|
15
|
+
// @public APIs
|
|
16
|
+
AllowedTypes,
|
|
17
|
+
CommitKind,
|
|
18
|
+
CommitMetadata,
|
|
19
|
+
FieldKind,
|
|
20
|
+
FieldProps,
|
|
21
|
+
FieldSchema,
|
|
22
|
+
FieldSchemaUnsafe,
|
|
23
|
+
ITree,
|
|
24
|
+
ITreeConfigurationOptions,
|
|
25
|
+
ITreeViewConfiguration,
|
|
26
|
+
ImplicitAllowedTypes,
|
|
27
|
+
ImplicitFieldSchema,
|
|
28
|
+
InsertableObjectFromSchemaRecordUnsafe,
|
|
29
|
+
InsertableTreeFieldFromImplicitField,
|
|
30
|
+
InsertableTreeFieldFromImplicitFieldUnsafe,
|
|
31
|
+
InsertableTreeNodeFromImplicitAllowedTypes,
|
|
32
|
+
InsertableTreeNodeFromImplicitAllowedTypesUnsafe,
|
|
33
|
+
InsertableTypedNode,
|
|
34
|
+
InternalTreeNode,
|
|
35
|
+
IsListener,
|
|
36
|
+
IterableTreeArrayContent,
|
|
37
|
+
LazyItem,
|
|
38
|
+
Listenable,
|
|
39
|
+
Listeners,
|
|
40
|
+
MakeNominal,
|
|
41
|
+
MapNodeInsertableData,
|
|
42
|
+
NodeFromSchema,
|
|
43
|
+
NodeInDocumentConstraint,
|
|
44
|
+
NodeKind,
|
|
45
|
+
Off,
|
|
46
|
+
RestrictiveReadonlyRecord,
|
|
47
|
+
Revertible,
|
|
48
|
+
RevertibleFactory,
|
|
49
|
+
RevertibleStatus,
|
|
50
|
+
RunTransaction,
|
|
51
|
+
SchemaCompatibilityStatus,
|
|
52
|
+
SchemaFactory,
|
|
53
|
+
TransactionConstraint,
|
|
54
|
+
Tree,
|
|
55
|
+
TreeArrayNode,
|
|
56
|
+
TreeArrayNodeUnsafe,
|
|
57
|
+
TreeChangeEvents,
|
|
58
|
+
TreeFieldFromImplicitField,
|
|
59
|
+
TreeLeafValue,
|
|
60
|
+
TreeMapNode,
|
|
61
|
+
TreeMapNodeUnsafe,
|
|
62
|
+
TreeNode,
|
|
63
|
+
TreeNodeApi,
|
|
64
|
+
TreeNodeFromImplicitAllowedTypes,
|
|
65
|
+
TreeNodeSchema,
|
|
66
|
+
TreeNodeSchemaClass,
|
|
67
|
+
TreeNodeSchemaCore,
|
|
68
|
+
TreeObjectNode,
|
|
69
|
+
TreeObjectNodeUnsafe,
|
|
70
|
+
TreeStatus,
|
|
71
|
+
TreeView,
|
|
72
|
+
TreeViewConfiguration,
|
|
73
|
+
TreeViewEvents,
|
|
74
|
+
Unenforced,
|
|
75
|
+
Unhydrated,
|
|
76
|
+
ValidateRecursiveSchema,
|
|
77
|
+
WithType,
|
|
78
|
+
rollback,
|
|
79
|
+
typeSchemaSymbol,
|
|
80
|
+
|
|
81
|
+
// @beta APIs
|
|
82
|
+
NodeChangedData,
|
|
83
|
+
TreeBeta,
|
|
84
|
+
TreeChangeEventsBeta,
|
|
85
|
+
|
|
86
|
+
// @alpha APIs
|
|
87
|
+
FixRecursiveArraySchema,
|
|
88
|
+
JsonArrayNodeSchema,
|
|
89
|
+
JsonFieldSchema,
|
|
90
|
+
JsonLeafNodeSchema,
|
|
91
|
+
JsonLeafSchemaType,
|
|
92
|
+
JsonMapNodeSchema,
|
|
93
|
+
JsonNodeSchema,
|
|
94
|
+
JsonNodeSchemaBase,
|
|
95
|
+
JsonObjectNodeSchema,
|
|
96
|
+
JsonRefPath,
|
|
97
|
+
JsonSchemaId,
|
|
98
|
+
JsonSchemaRef,
|
|
99
|
+
JsonSchemaType,
|
|
100
|
+
JsonTreeSchema,
|
|
101
|
+
getJsonSchema
|
|
102
|
+
} from "./index.js";
|
package/dist/beta.d.ts
CHANGED
package/dist/core/index.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export { type FieldKey, type TreeNodeSchemaIdentifier, type TreeFieldStoredSchem
|
|
|
8
8
|
export { type ChangeFamily, type ChangeFamilyCodec, type ChangeEncodingContext, type ChangeFamilyEditor, EditBuilder, } from "./change-family/index.js";
|
|
9
9
|
export { areEqualChangeAtomIds, makeChangeAtomId, asChangeAtomId, type ChangeRebaser, findAncestor, findCommonAncestor, type GraphCommit, CommitKind, type CommitMetadata, type RevisionTag, RevisionTagSchema, RevisionTagCodec, type ChangesetLocalId, type ChangeAtomId, type ChangeAtomIdMap, type TaggedChange, makeAnonChange, tagChange, mapTaggedChange, tagRollbackInverse, SessionIdSchema, mintCommit, rebaseBranch, type BranchRebaseResult, rebaseChange, rebaseChangeOverChanges, type RevisionMetadataSource, revisionMetadataSourceFromInfo, type RevisionInfo, type EncodedRevisionTag, type EncodedChangeAtomId, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, replaceAtomRevisions, replaceChange, type RebaseStats, type RebaseStatsWithDuration, } from "./rebase/index.js";
|
|
10
10
|
export { type Adapters, AdaptedViewSchema, Compatibility, type TreeAdapter, AllowedUpdateType, } from "./schema-view/index.js";
|
|
11
|
-
export { type Revertible, RevertibleStatus } from "./revertible
|
|
11
|
+
export { type Revertible, RevertibleStatus, type RevertibleFactory } from "./revertible.js";
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,SAAS,EACd,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,KAAK,WAAW,EAChB,kBAAkB,EAClB,KAAK,sBAAsB,EAC3B,uBAAuB,EACvB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,QAAQ,EACR,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,KAAK,OAAO,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,EACV,eAAe,EACf,aAAa,EACb,UAAU,EACV,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,UAAU,EACV,aAAa,EACb,cAAc,EACd,SAAS,EACT,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,oBAAoB,EACpB,YAAY,EACZ,KAAK,cAAc,EACnB,0BAA0B,EAC1B,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,KAAK,UAAU,EACf,KAAK,UAAU,EACf,UAAU,EACV,KAAK,aAAa,EAClB,aAAa,EACb,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,mBAAm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qB,EAC1B,KAAK,kBAAkB,EACvB,WAAW,GACX,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACN,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,KAAK,aAAa,EAClB,YAAY,EACZ,kBAAkB,EAClB,KAAK,WAAW,EAChB,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,cAAc,EACd,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,KAAK,kBAAkB,EACvB,YAAY,EACZ,uBAAuB,EACvB,KAAK,sBAAsB,EAC3B,8BAA8B,EAC9B,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,uBAAuB,GAC5B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACN,KAAK,QAAQ,EACb,iBAAiB,EACjB,aAAa,EACb,KAAK,WAAW,EAChB,iBAAiB,GACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,KAAK,UAAU,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,SAAS,EACd,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,K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AAe,EACf,UAAU,EACV,YAAY,EACZ,KAAK,kBAAkB,EACvB,YAAY,EACZ,uBAAuB,EACvB,KAAK,sBAAsB,EAC3B,8BAA8B,EAC9B,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,uBAAuB,GAC5B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACN,KAAK,QAAQ,EACb,iBAAiB,EACjB,aAAa,EACb,KAAK,WAAW,EAChB,iBAAiB,GACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,KAAK,UAAU,EAAE,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/core/index.js
CHANGED
|
@@ -105,6 +105,6 @@ var index_js_6 = require("./schema-view/index.js");
|
|
|
105
105
|
Object.defineProperty(exports, "AdaptedViewSchema", { enumerable: true, get: function () { return index_js_6.AdaptedViewSchema; } });
|
|
106
106
|
Object.defineProperty(exports, "Compatibility", { enumerable: true, get: function () { return index_js_6.Compatibility; } });
|
|
107
107
|
Object.defineProperty(exports, "AllowedUpdateType", { enumerable: true, get: function () { return index_js_6.AllowedUpdateType; } });
|
|
108
|
-
var
|
|
109
|
-
Object.defineProperty(exports, "RevertibleStatus", { enumerable: true, get: function () { return
|
|
108
|
+
var revertible_js_1 = require("./revertible.js");
|
|
109
|
+
Object.defineProperty(exports, "RevertibleStatus", { enumerable: true, get: function () { return revertible_js_1.RevertibleStatus; } });
|
|
110
110
|
//# sourceMappingURL=index.js.map
|
package/dist/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,4CA+FyB;AA9FxB,oGAAA,QAAQ,OAAA;AAIR,qGAAA,SAAS,OAA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A,8BAA8B,OAAA;AAI9B,wGAAA,YAAY,OAAA;AACZ,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,gHAAA,oBAAoB,OAAA;AACpB,yGAAA,aAAa,OAAA;AAKd,mDAMgC;AAJ/B,6GAAA,iBAAiB,OAAA;AACjB,yGAAA,aAAa,OAAA;AAEb,6GAAA,iBAAiB,OAAA;AAGlB,iDAA4F;AAAlE,iHAAA,gBAAgB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tEmptyKey,\n\ttype TreeType,\n\ttype Value,\n\ttype TreeValue,\n\tAnchorSet,\n\ttype DetachedField,\n\ttype UpPath,\n\ttype Range,\n\ttype RangeUpPath,\n\ttype PlaceUpPath,\n\ttype PlaceIndex,\n\ttype NodeIndex,\n\ttype DetachedPlaceUpPath,\n\ttype DetachedRangeUpPath,\n\ttype FieldUpPath,\n\ttype Anchor,\n\ttype RootField,\n\ttype ChildCollection,\n\ttype ChildLocation,\n\ttype FieldMapObject,\n\ttype NodeData,\n\ttype GenericTreeNode,\n\ttype JsonableTree,\n\tEncodedJsonableTree,\n\trootFieldKey,\n\trootField,\n\ttype ITreeCursor,\n\tCursorLocationType,\n\ttype ITreeCursorSynchronous,\n\tcastCursorToSynchronous,\n\ttype GenericFieldsNode,\n\ttype AnchorLocator,\n\tgenericTreeKeys,\n\tgetGenericTreeField,\n\tgenericTreeDeleteIfEmpty,\n\tgetDepth,\n\tmapCursorField,\n\tmapCursorFields,\n\titerateCursorField,\n\ttype MapTree,\n\tdetachedFieldAsKey,\n\tkeyAsDetachedField,\n\tvisitDelta,\n\tcombineVisitors,\n\tannounceDelta,\n\tapplyDelta,\n\tmakeDetachedFieldIndex,\n\tsetGenericTreeField,\n\ttype DeltaVisitor,\n\ttype AnnouncedVisitor,\n\ttype PathVisitor,\n\tSparseNode,\n\tgetDescendant,\n\tcompareUpPaths,\n\tclonePath,\n\ttopDownPath,\n\tcompareFieldUpPaths,\n\tforEachNode,\n\tforEachNodeInSubtree,\n\tforEachField,\n\ttype PathRootPrefix,\n\tdeltaForRootInitialization,\n\temptyFieldChanges,\n\tisEmptyFieldChanges,\n\tmakeDetachedNodeId,\n\toffsetDetachId,\n\temptyDelta,\n\ttype AnchorSlot,\n\ttype AnchorNode,\n\tanchorSlot,\n\ttype UpPathDefault,\n\tinCursorField,\n\tinCursorNode,\n\ttype AnchorEvents,\n\ttype AnchorSetRootEvents,\n\ttype ProtoNodes,\n\tCursorMarker,\n\tisCursor,\n\tDetachedFieldIndex,\n\ttype ForestRootId,\n\tgetDetachedFieldContainingPath,\n\taboveRootPlaceholder,\n\ttype DeltaRoot,\n\ttype DeltaProtoNode,\n\ttype DeltaMark,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaFieldMap,\n\ttype DeltaDetachedNodeChanges,\n\ttype DeltaDetachedNodeBuild,\n\ttype DeltaDetachedNodeDestruction,\n\ttype DeltaDetachedNodeRename,\n\ttype DeltaFieldChanges,\n\ttype ExclusiveMapTree,\n\tdeepCopyMapTree,\n} from \"./tree/index.js\";\n\nexport {\n\tTreeNavigationResult,\n\ttype IEditableForest,\n\ttype IForestSubscription,\n\ttype TreeLocation,\n\ttype FieldLocation,\n\ttype ForestLocation,\n\ttype ITreeSubscriptionCursor,\n\tITreeSubscriptionCursorState,\n\tinitializeForest,\n\ttype FieldAnchor,\n\tmoveToDetachedField,\n\ttype ForestEvents,\n} from \"./forest/index.js\";\n\nexport {\n\ttype FieldKey,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeFieldStoredSchema,\n\tValueSchema,\n\tTreeNodeStoredSchema,\n\ttype TreeStoredSchemaSubscription as TreeStoredSchemaSubscription,\n\ttype MutableTreeStoredSchema,\n\ttype FieldKindIdentifier,\n\ttype FieldKindData,\n\ttype TreeTypeSet,\n\ttype TreeStoredSchema,\n\tTreeStoredSchemaRepository,\n\tschemaDataIsEmpty,\n\ttype SchemaEvents,\n\tforbiddenFieldKindIdentifier,\n\tidentifierFieldKindIdentifier,\n\tstoredEmptyFieldSchema,\n\ttype StoredSchemaCollection,\n\tschemaFormat,\n\tLeafNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tMapNodeStoredSchema,\n\ttoTreeNodeSchemaDataFormat,\n\tdecodeFieldSchema,\n\tencodeFieldSchema,\n\tstoredSchemaDecodeDispatcher,\n\ttype ErasedTreeNodeSchemaDataFormat,\n\ttype SchemaAndPolicy,\n\tMultiplicity,\n\ttype SchemaPolicy,\n} from \"./schema-stored/index.js\";\n\nexport {\n\ttype ChangeFamily,\n\ttype ChangeFamilyCodec,\n\ttype ChangeEncodingContext,\n\ttype ChangeFamilyEditor,\n\tEditBuilder,\n} from \"./change-family/index.js\";\n\nexport {\n\tareEqualChangeAtomIds,\n\tmakeChangeAtomId,\n\tasChangeAtomId,\n\ttype ChangeRebaser,\n\tfindAncestor,\n\tfindCommonAncestor,\n\ttype GraphCommit,\n\tCommitKind,\n\ttype CommitMetadata,\n\ttype RevisionTag,\n\tRevisionTagSchema,\n\tRevisionTagCodec,\n\ttype ChangesetLocalId,\n\ttype ChangeAtomId,\n\ttype ChangeAtomIdMap,\n\ttype TaggedChange,\n\tmakeAnonChange,\n\ttagChange,\n\tmapTaggedChange,\n\ttagRollbackInverse,\n\tSessionIdSchema,\n\tmintCommit,\n\trebaseBranch,\n\ttype BranchRebaseResult,\n\trebaseChange,\n\trebaseChangeOverChanges,\n\ttype RevisionMetadataSource,\n\trevisionMetadataSourceFromInfo,\n\ttype RevisionInfo,\n\ttype EncodedRevisionTag,\n\ttype EncodedChangeAtomId,\n\ttaggedAtomId,\n\ttaggedOptAtomId,\n\toffsetChangeAtomId,\n\treplaceAtomRevisions,\n\treplaceChange,\n\ttype RebaseStats,\n\ttype RebaseStatsWithDuration,\n} from \"./rebase/index.js\";\n\nexport {\n\ttype Adapters,\n\tAdaptedViewSchema,\n\tCompatibility,\n\ttype TreeAdapter,\n\tAllowedUpdateType,\n} from \"./schema-view/index.js\";\n\nexport { type Revertible, RevertibleStatus, type RevertibleFactory } from \"./revertible.js\";\n"]}
|
|
@@ -43,4 +43,16 @@ export declare enum RevertibleStatus {
|
|
|
43
43
|
/** The revertible has been disposed. Reverting it will have no effect. */
|
|
44
44
|
Disposed = 1
|
|
45
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Factory for creating a {@link Revertible}.
|
|
48
|
+
* Will error if invoked outside the scope of the `commitApplied` event that provides it, or if invoked multiple times.
|
|
49
|
+
*
|
|
50
|
+
* @param onRevertibleDisposed - A callback that will be invoked when the `Revertible` generated by this factory is disposed.
|
|
51
|
+
* This happens when the `Revertible` is disposed manually, or when the `TreeView` that the `Revertible` belongs to is disposed,
|
|
52
|
+
* whichever happens first.
|
|
53
|
+
* This is typically used to clean up any resources associated with the `Revertible` in the host application.
|
|
54
|
+
*
|
|
55
|
+
* @sealed @public
|
|
56
|
+
*/
|
|
57
|
+
export type RevertibleFactory = (onRevertibleDisposed?: (revertible: Revertible) => void) => Revertible;
|
|
46
58
|
//# sourceMappingURL=revertible.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revertible.d.ts","sourceRoot":"","sources":["../../src/core/revertible.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IAC1B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAElC;;OAEG;IACH,MAAM,IAAI,IAAI,CAAC;IACf;;;;;;OAMG;IACH,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAE/B;;OAEG;IACH,OAAO,IAAI,IAAI,CAAC;CAChB;AAED;;;;GAIG;AACH,oBAAY,gBAAgB;IAC3B,sCAAsC;IACtC,KAAK,IAAA;IACL,0EAA0E;IAC1E,QAAQ,IAAA;CACR;AAED;;;;;;;;;;GAUG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAC/B,oBAAoB,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,KACnD,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revertible.js","sourceRoot":"","sources":["../../src/core/revertible.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAmCH;;;;GAIG;AACH,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC3B,sCAAsC;IACtC,yDAAK,CAAA;IACL,0EAA0E;IAC1E,+DAAQ,CAAA;AACT,CAAC,EALW,gBAAgB,gCAAhB,gBAAgB,QAK3B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Allows reversion of a change made to SharedTree.\n *\n * @remarks\n * Applications wanting to implement undo/redo support might typically maintain two stacks of Revertibles, with optional eviction policy to free up memory.\n *\n * @sealed @public\n */\nexport interface Revertible {\n\t/**\n\t * The current status of the revertible.\n\t */\n\treadonly status: RevertibleStatus;\n\n\t/**\n\t * Reverts the associated change and disposes it.\n\t */\n\trevert(): void;\n\t/**\n\t * Reverts the associated change and optionally disposes it.\n\t *\n\t * @param dispose - If true, the revertible will be disposed after being reverted.\n\t * If false, the revertible will remain valid. This can be useful for scenarios where the revert may be dropped\n\t * due to merge conflicts, and one wants to attempt reverting again.\n\t */\n\trevert(dispose: boolean): void;\n\n\t/**\n\t * Disposes this revertible, allowing associated resources to be released.\n\t */\n\tdispose(): void;\n}\n\n/**\n * The status of a {@link Revertible}.\n *\n * @public\n */\nexport enum RevertibleStatus {\n\t/** The revertible can be reverted. */\n\tValid,\n\t/** The revertible has been disposed. Reverting it will have no effect. */\n\tDisposed,\n}\n\n/**\n * Factory for creating a {@link Revertible}.\n * Will error if invoked outside the scope of the `commitApplied` event that provides it, or if invoked multiple times.\n *\n * @param onRevertibleDisposed - A callback that will be invoked when the `Revertible` generated by this factory is disposed.\n * This happens when the `Revertible` is disposed manually, or when the `TreeView` that the `Revertible` belongs to is disposed,\n * whichever happens first.\n * This is typically used to clean up any resources associated with the `Revertible` in the host application.\n *\n * @sealed @public\n */\nexport type RevertibleFactory = (\n\tonRevertibleDisposed?: (revertible: Revertible) => void,\n) => Revertible;\n"]}
|
|
@@ -39,7 +39,7 @@ export declare const FieldKindIdentifierSchema: import("@sinclair/typebox").TUns
|
|
|
39
39
|
export declare const TreeNodeSchemaIdentifierSchema: import("@sinclair/typebox").TUnsafe<TreeNodeSchemaIdentifier<string>>;
|
|
40
40
|
export declare const FieldSchemaFormat: import("@sinclair/typebox").TObject<{
|
|
41
41
|
kind: import("@sinclair/typebox").TUnsafe<FieldKindIdentifier>;
|
|
42
|
-
types: import("@sinclair/typebox").
|
|
42
|
+
types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<TreeNodeSchemaIdentifier<string>>>;
|
|
43
43
|
}>;
|
|
44
44
|
/**
|
|
45
45
|
* Persisted version of {@link ValueSchema}.
|
|
@@ -62,14 +62,14 @@ export declare const TreeNodeSchemaDataFormat: import("@sinclair/typebox").TObje
|
|
|
62
62
|
*/
|
|
63
63
|
object: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
64
64
|
kind: import("@sinclair/typebox").TUnsafe<FieldKindIdentifier>;
|
|
65
|
-
types: import("@sinclair/typebox").
|
|
65
|
+
types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<TreeNodeSchemaIdentifier<string>>>;
|
|
66
66
|
}>>>;
|
|
67
67
|
/**
|
|
68
68
|
* Map node union member.
|
|
69
69
|
*/
|
|
70
70
|
map: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
71
71
|
kind: import("@sinclair/typebox").TUnsafe<FieldKindIdentifier>;
|
|
72
|
-
types: import("@sinclair/typebox").
|
|
72
|
+
types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<TreeNodeSchemaIdentifier<string>>>;
|
|
73
73
|
}>>;
|
|
74
74
|
/**
|
|
75
75
|
* Leaf node union member.
|
|
@@ -20,7 +20,7 @@ exports.FieldKindIdentifierSchema = (0, index_js_2.brandedStringType)();
|
|
|
20
20
|
exports.TreeNodeSchemaIdentifierSchema = (0, index_js_2.brandedStringType)();
|
|
21
21
|
const FieldSchemaFormatBase = typebox_1.Type.Object({
|
|
22
22
|
kind: exports.FieldKindIdentifierSchema,
|
|
23
|
-
types: typebox_1.Type.
|
|
23
|
+
types: typebox_1.Type.Array(exports.TreeNodeSchemaIdentifierSchema),
|
|
24
24
|
});
|
|
25
25
|
const noAdditionalProps = { additionalProperties: false };
|
|
26
26
|
exports.FieldSchemaFormat = typebox_1.Type.Composite([FieldSchemaFormatBase], noAdditionalProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/core/schema-stored/format.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA0E;AAE1E,mDAAoD;AACpD,kDAAoE;AAEvD,QAAA,OAAO,GAAG,CAAU,CAAC;AAUlC;;GAEG;AACU,QAAA,cAAc,GAAG,IAAA,4BAAiB,GAAY,CAAC;AAsB/C,QAAA,yBAAyB,GAAG,IAAA,4BAAiB,GAAuB,CAAC;AAElF;;GAEG;AACU,QAAA,8BAA8B,GAAG,IAAA,4BAAiB,GAA4B,CAAC;AAE5F,MAAM,qBAAqB,GAAG,cAAI,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,iCAAyB;IAC/B,KAAK,EAAE,cAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/core/schema-stored/format.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA0E;AAE1E,mDAAoD;AACpD,kDAAoE;AAEvD,QAAA,OAAO,GAAG,CAAU,CAAC;AAUlC;;GAEG;AACU,QAAA,cAAc,GAAG,IAAA,4BAAiB,GAAY,CAAC;AAsB/C,QAAA,yBAAyB,GAAG,IAAA,4BAAiB,GAAuB,CAAC;AAElF;;GAEG;AACU,QAAA,8BAA8B,GAAG,IAAA,4BAAiB,GAA4B,CAAC;AAE5F,MAAM,qBAAqB,GAAG,cAAI,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,iCAAyB;IAC/B,KAAK,EAAE,cAAI,CAAC,KAAK,CAAC,sCAA8B,CAAC;CACjD,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAE5D,QAAA,iBAAiB,GAAG,cAAI,CAAC,SAAS,CAAC,CAAC,qBAAqB,CAAC,EAAE,iBAAiB,CAAC,CAAC;AAE5F;;GAEG;AACH,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC/B,mEAAM,CAAA;IACN,mEAAM,CAAA;IACN,qEAAO,CAAA;IACP,6EAAW,CAAA;IACX,+DAAI,CAAA;AACL,CAAC,EANW,oBAAoB,oCAApB,oBAAoB,QAM/B;AAED;;;;GAIG;AACU,QAAA,wBAAwB,GAAG,cAAI,CAAC,MAAM,CAClD;IACC;;OAEG;IACH,MAAM,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,CAAC,cAAI,CAAC,MAAM,EAAE,EAAE,yBAAiB,CAAC,CAAC;IACpE;;OAEG;IACH,GAAG,EAAE,cAAI,CAAC,QAAQ,CAAC,yBAAiB,CAAC;IACrC;;OAEG;IACH,IAAI,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;CACpD,EACD,uBAAY,CACZ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ObjectOptions, type Static, Type } from \"@sinclair/typebox\";\n\nimport { unionOptions } from \"../../codec/index.js\";\nimport { type Brand, brandedStringType } from \"../../util/index.js\";\n\nexport const version = 1 as const;\n\n/**\n * Key (aka Name or Label) for a field which is scoped to a specific TreeNodeStoredSchema.\n *\n * Stable identifier, used when persisting data.\n * @internal\n */\nexport type FieldKey = Brand<string, \"tree.FieldKey\">;\n\n/**\n * TypeBox Schema for encoding {@link FieldKey} in persisted data.\n */\nexport const FieldKeySchema = brandedStringType<FieldKey>();\n\n/**\n * Identifier for a TreeNode schema.\n * Also known as \"Definition\"\n *\n * Stable identifier, used when persisting data.\n * @internal\n */\nexport type TreeNodeSchemaIdentifier<TName extends string = string> = Brand<\n\tTName,\n\t\"tree.TreeNodeSchemaIdentifier\"\n>;\n\n/**\n * Identifier for a FieldKind.\n * Refers to an exact stable policy (ex: specific version of a policy),\n * for how to handle (ex: edit and merge edits to) fields marked with this kind.\n * Persisted in documents as part of stored schema.\n * @internal\n */\nexport type FieldKindIdentifier = Brand<string, \"tree.FieldKindIdentifier\">;\nexport const FieldKindIdentifierSchema = brandedStringType<FieldKindIdentifier>();\n\n/**\n * TypeBox Schema for encoding {@link TreeNodeSchemaIdentifiers} in persisted data.\n */\nexport const TreeNodeSchemaIdentifierSchema = brandedStringType<TreeNodeSchemaIdentifier>();\n\nconst FieldSchemaFormatBase = Type.Object({\n\tkind: FieldKindIdentifierSchema,\n\ttypes: Type.Array(TreeNodeSchemaIdentifierSchema),\n});\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\nexport const FieldSchemaFormat = Type.Composite([FieldSchemaFormatBase], noAdditionalProps);\n\n/**\n * Persisted version of {@link ValueSchema}.\n */\nexport enum PersistedValueSchema {\n\tNumber,\n\tString,\n\tBoolean,\n\tFluidHandle,\n\tNull,\n}\n\n/**\n * Discriminated union content of tree node schema.\n *\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport const TreeNodeSchemaDataFormat = Type.Object(\n\t{\n\t\t/**\n\t\t * Object node union member.\n\t\t */\n\t\tobject: Type.Optional(Type.Record(Type.String(), FieldSchemaFormat)),\n\t\t/**\n\t\t * Map node union member.\n\t\t */\n\t\tmap: Type.Optional(FieldSchemaFormat),\n\t\t/**\n\t\t * Leaf node union member.\n\t\t */\n\t\tleaf: Type.Optional(Type.Enum(PersistedValueSchema)),\n\t},\n\tunionOptions,\n);\n\nexport type TreeNodeSchemaDataFormat = Static<typeof TreeNodeSchemaDataFormat>;\n\nexport type FieldSchemaFormat = Static<typeof FieldSchemaFormat>;\n"]}
|
|
@@ -22,11 +22,6 @@ export declare enum ValueSchema {
|
|
|
22
22
|
* Set of allowed tree types.
|
|
23
23
|
* Providing multiple values here allows polymorphism, tagged union style.
|
|
24
24
|
*
|
|
25
|
-
* If not specified, types are unconstrained
|
|
26
|
-
* (equivalent to the set containing every TreeNodeSchemaIdentifier defined in the document).
|
|
27
|
-
*
|
|
28
|
-
* Note that even when unconstrained, children must still be in-schema for their own type.
|
|
29
|
-
*
|
|
30
25
|
* In the future, this could be extended to allow inlining a TreeNodeStoredSchema here
|
|
31
26
|
* (or some similar structural schema system).
|
|
32
27
|
* For structural types which could go here, there are a few interesting options:
|
|
@@ -48,7 +43,7 @@ export declare enum ValueSchema {
|
|
|
48
43
|
* Care would need to be taken to make sure this is sound for the schema updating mechanisms.
|
|
49
44
|
* @internal
|
|
50
45
|
*/
|
|
51
|
-
export type TreeTypeSet = ReadonlySet<TreeNodeSchemaIdentifier
|
|
46
|
+
export type TreeTypeSet = ReadonlySet<TreeNodeSchemaIdentifier>;
|
|
52
47
|
/**
|
|
53
48
|
* Declarative portion of a Field Kind.
|
|
54
49
|
*
|
|
@@ -94,7 +89,7 @@ export interface TreeFieldStoredSchema {
|
|
|
94
89
|
* The set of allowed child types.
|
|
95
90
|
* If not specified, types are unconstrained.
|
|
96
91
|
*/
|
|
97
|
-
readonly types
|
|
92
|
+
readonly types: TreeTypeSet;
|
|
98
93
|
}
|
|
99
94
|
/**
|
|
100
95
|
* Identifier used for the FieldKind for fields which must be empty.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,KAAK,WAAW,EAA0B,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EACN,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EAEtB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;;GAGG;AACH,oBAAY,WAAW;IACtB,MAAM,IAAA;IACN,MAAM,IAAA;IACN,OAAO,IAAA;IACP,WAAW,IAAA;IACX,IAAI,IAAA;CACJ;AAED
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,KAAK,WAAW,EAA0B,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EACN,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EAEtB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;;GAGG;AACH,oBAAY,WAAW;IACtB,MAAM,IAAA;IACN,MAAM,IAAA;IACN,OAAO,IAAA;IACP,WAAW,IAAA;IACX,IAAI,IAAA;CACJ;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,wBAAwB,CAAC,CAAC;AAEhE;;;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;IAK/D,MAAM,IAAI,8BAA8B;CAgBxD;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,oBAAoB;aASzB,SAAS,EAAE,qBAAqB;IARnE;;;;;;;OAOG;gBACgC,SAAS,EAAE,qBAAqB;IAInD,MAAM,IAAI,8BAA8B;CAKxD;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,oBAAoB;aAa1B,SAAS,EAAE,WAAW;IAZzD;;;;;;;;;;;OAWG;gBACgC,SAAS,EAAE,WAAW;IAIzC,MAAM,IAAI,8BAA8B;CAKxD;AAED,eAAO,MAAM,4BAA4B,EAAE,4BAA4B,CACtE,wBAAwB,EACxB;CAAE,EACF,oBAAoB,CAanB,CAAC;AAoBH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,qBAAqB,GAAG,iBAAiB,CAMlF;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,qBAAqB,CAOlF;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAiB,SAAQ,sBAAsB;IAC/D;;OAEG;IACH,QAAQ,CAAC,eAAe,EAAE,qBAAqB,CAAC;CAChD;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,CAAC;CACjF"}
|
|
@@ -166,20 +166,18 @@ function decodeValueSchema(inMemory) {
|
|
|
166
166
|
return valueSchemaDecode.get(inMemory) ?? (0, index_js_2.fail)("missing ValueSchema");
|
|
167
167
|
}
|
|
168
168
|
function encodeFieldSchema(schema) {
|
|
169
|
-
|
|
169
|
+
return {
|
|
170
170
|
kind: schema.kind,
|
|
171
|
+
// Types are sorted by identifier to improve stability of persisted data to increase chance of schema blob reuse.
|
|
172
|
+
types: [...schema.types].sort(),
|
|
171
173
|
};
|
|
172
|
-
if (schema.types !== undefined) {
|
|
173
|
-
out.types = [...schema.types];
|
|
174
|
-
}
|
|
175
|
-
return out;
|
|
176
174
|
}
|
|
177
175
|
exports.encodeFieldSchema = encodeFieldSchema;
|
|
178
176
|
function decodeFieldSchema(schema) {
|
|
179
177
|
const out = {
|
|
180
178
|
// TODO: maybe provide actual FieldKind objects here, error on unrecognized kinds.
|
|
181
179
|
kind: schema.kind,
|
|
182
|
-
types:
|
|
180
|
+
types: new Set(schema.types),
|
|
183
181
|
};
|
|
184
182
|
return out;
|
|
185
183
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/core/schema-stored/schema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,mDAAoE;AACpE,kDAA+E;AAC/E,2CAOqB;AAGrB;;;GAGG;AACH,IAAY,WAMX;AAND,WAAY,WAAW;IACtB,iDAAM,CAAA;IACN,iDAAM,CAAA;IACN,mDAAO,CAAA;IACP,2DAAW,CAAA;IACX,6CAAI,CAAA;AACL,CAAC,EANW,WAAW,2BAAX,WAAW,QAMtB;AAsFD;;;;;;;GAOG;AACU,QAAA,4BAA4B,GAAG,WAAW,CAAC;AAExD;;;GAGG;AACU,QAAA,sBAAsB,GAA0B;IAC5D,4CAA4C;IAC5C,IAAI,EAAE,IAAA,gBAAK,EAAC,oCAA4B,CAAC;IACzC,qFAAqF;IACrF,KAAK,EAAE,IAAI,GAAG,EAAE;CAChB,CAAC;AAEF;;GAEG;AACU,QAAA,6BAA6B,GAAG,YAAY,CAAC;AAS1D,SAAS,gCAAgC,CACxC,IAA8B;IAE9B,OAAO,IAAiD,CAAC;AAC1D,CAAC;AAED,SAAgB,0BAA0B,CACzC,IAAoC;IAEpC,OAAO,IAA2C,CAAC;AACpD,CAAC;AAJD,gEAIC;AAED;;GAEG;AACH,MAAsB,oBAAoB;CAUzC;AAVD,oDAUC;AAED;;GAEG;AACH,MAAa,sBAAuB,SAAQ,oBAAoB;IAC/D;;;;;;;OAOG;IACH,YACiB,gBAA8D;QAE9E,KAAK,EAAE,CA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CAAC;AAChF,CAAC;AAED,SAAS,iBAAiB,CAAC,QAA8B;IACxD,OAAO,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,IAAA,eAAI,EAAC,qBAAqB,CAAC,CAAC;AACvE,CAAC;AAED,SAAgB,iBAAiB,CAAC,MAA6B;IAC9D,MAAM,GAAG,GAAsB;QAC9B,IAAI,EAAE,MAAM,CAAC,IAAI;KACjB,CAAC;IACF,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAChC,GAAG,CAAC,KAAK,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC;AARD,8CAQC;AAED,SAAgB,iBAAiB,CAAC,MAAyB;IAC1D,MAAM,GAAG,GAA0B;QAClC,kFAAkF;QAClF,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC;KACrE,CAAC;IACF,OAAO,GAAG,CAAC;AACZ,CAAC;AAPD,8CAOC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ErasedType } from \"@fluidframework/core-interfaces\";\nimport { DiscriminatedUnionDispatcher } from \"../../codec/index.js\";\nimport { type MakeNominal, brand, fail, invertMap } from \"../../util/index.js\";\nimport {\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype FieldSchemaFormat,\n\tPersistedValueSchema,\n\ttype TreeNodeSchemaDataFormat,\n\ttype TreeNodeSchemaIdentifier,\n} from \"./format.js\";\nimport type { Multiplicity } from \"./multiplicity.js\";\n\n/**\n * Schema for what {@link TreeValue} is allowed on a Leaf node.\n * @internal\n */\nexport enum ValueSchema {\n\tNumber,\n\tString,\n\tBoolean,\n\tFluidHandle,\n\tNull,\n}\n\n/**\n * Set of allowed tree types.\n * Providing multiple values here allows polymorphism, tagged union style.\n *\n * If not specified, types are unconstrained\n * (equivalent to the set containing every TreeNodeSchemaIdentifier defined in the document).\n *\n * Note that even when unconstrained, children must still be in-schema for their own type.\n *\n * In the future, this could be extended to allow inlining a TreeNodeStoredSchema here\n * (or some similar structural schema system).\n * For structural types which could go here, there are a few interesting options:\n *\n * - Allow replacing the whole set with a structural type for terminal / non-tree data,\n * and use this as a replacement for values on the tree nodes.\n *\n * - Allow expression structural constraints for child trees, for example requiring specific traits\n * (ex: via TreeNodeStoredSchema), instead of by type.\n *\n * There are two ways this could work:\n *\n * - Constrain the child nodes based on their shape:\n * this makes schema safe editing difficult because nodes would incur extra editing constraints to prevent them\n * from going out of schema based on their location in such a field.\n *\n * - Constrain the types allowed based on which types guarantee their data will always meet the constraints.\n *\n * Care would need to be taken to make sure this is sound for the schema updating mechanisms.\n * @internal\n */\nexport type TreeTypeSet = ReadonlySet<TreeNodeSchemaIdentifier> | undefined;\n\n/**\n * Declarative portion of a Field Kind.\n *\n * @remarks\n * Enough info about a field kind to know if a given tree is is schema.\n */\nexport interface FieldKindData {\n\treadonly identifier: FieldKindIdentifier;\n\treadonly multiplicity: Multiplicity;\n}\n\n/**\n * Everything needed to define what it means for a tree to be in schema.\n */\nexport interface SchemaAndPolicy {\n\treadonly schema: StoredSchemaCollection;\n\treadonly policy: SchemaPolicy;\n}\n\n/**\n * Extra data needed to interpret schema.\n */\nexport interface SchemaPolicy {\n\t/**\n\t * Policy information about FieldKinds:\n\t * This is typically stored as code, not in documents, and defines how to handle fields based on their kind.\n\t * It is assumed that all users of a document will have exactly the same FieldKind policies,\n\t * though older applications might be missing some,\n\t * and will be unable to process any changes that use those FieldKinds.\n\t */\n\treadonly fieldKinds: ReadonlyMap<FieldKindIdentifier, FieldKindData>;\n\n\t/**\n\t * If true, new content inserted into the tree should be validated against the stored schema.\n\t */\n\treadonly validateSchema: boolean;\n}\n\n/**\n * Schema for a field.\n * Object implementing this interface should never be modified.\n * @internal\n */\nexport interface TreeFieldStoredSchema {\n\treadonly kind: FieldKindIdentifier;\n\t/**\n\t * The set of allowed child types.\n\t * If not specified, types are unconstrained.\n\t */\n\treadonly types?: TreeTypeSet;\n}\n\n/**\n * Identifier used for the FieldKind for fields which must be empty.\n *\n * @remarks\n * This mainly show up in:\n * 1. The root default field for documents.\n * 2. The schema used for out of schema fields (which thus must be empty/not exist) on object and leaf nodes.\n */\nexport const forbiddenFieldKindIdentifier = \"Forbidden\";\n\n/**\n * A schema for empty fields (fields which must always be empty).\n * There are multiple ways this could be encoded, but this is the most explicit.\n */\nexport const storedEmptyFieldSchema: TreeFieldStoredSchema = {\n\t// This kind requires the field to be empty.\n\tkind: brand(forbiddenFieldKindIdentifier),\n\t// This type set also forces the field to be empty not not allowing any types as all.\n\ttypes: new Set(),\n};\n\n/**\n * Identifier used for the FieldKind for fields of type identifier.\n */\nexport const identifierFieldKindIdentifier = \"Identifier\";\n\n/**\n * Opaque type erased handle to the encoded representation of the contents of a stored schema.\n * @internal\n */\nexport interface ErasedTreeNodeSchemaDataFormat\n\textends ErasedType<\"TreeNodeSchemaDataFormat\"> {}\n\nfunction toErasedTreeNodeSchemaDataFormat(\n\tdata: TreeNodeSchemaDataFormat,\n): ErasedTreeNodeSchemaDataFormat {\n\treturn data as unknown as ErasedTreeNodeSchemaDataFormat;\n}\n\nexport function toTreeNodeSchemaDataFormat(\n\tdata: ErasedTreeNodeSchemaDataFormat,\n): TreeNodeSchemaDataFormat {\n\treturn data as unknown as TreeNodeSchemaDataFormat;\n}\n\n/**\n * @internal\n */\nexport abstract class TreeNodeStoredSchema {\n\tprotected _typeCheck!: MakeNominal;\n\n\t/**\n\t * @privateRemarks\n\t * Returns TreeNodeSchemaDataFormat.\n\t * This is uses an opaque type to avoid leaking these types out of the package,\n\t * and is runtime validated by the codec.\n\t */\n\tpublic abstract encode(): ErasedTreeNodeSchemaDataFormat;\n}\n\n/**\n * @internal\n */\nexport class ObjectNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param objectNodeFields -\n\t * Schema for fields with keys scoped to this TreeNodeStoredSchema.\n\t * This refers to the TreeFieldStoredSchema directly\n\t * (as opposed to just supporting FieldSchemaIdentifier and having a central FieldKey -\\> TreeFieldStoredSchema map).\n\t * This allows us short friendly field keys which can be ergonomically used as field names in code.\n\t * It also interoperates well with mapFields being used as a map with arbitrary data as keys.\n\t */\n\tpublic constructor(\n\t\tpublic readonly objectNodeFields: ReadonlyMap<FieldKey, TreeFieldStoredSchema>,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic override encode(): ErasedTreeNodeSchemaDataFormat {\n\t\tconst fieldsObject: Record<string, FieldSchemaFormat> = Object.create(null);\n\t\t// Sort fields to ensure output is identical for for equivalent schema (since field order is not considered significant).\n\t\t// This makes comparing schema easier, and ensures chunk reuse for schema summaries isn't needlessly broken.\n\t\tfor (const key of [...this.objectNodeFields.keys()].sort()) {\n\t\t\tObject.defineProperty(fieldsObject, key, {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: encodeFieldSchema(this.objectNodeFields.get(key) ?? fail(\"missing field\")),\n\t\t\t});\n\t\t}\n\t\treturn toErasedTreeNodeSchemaDataFormat({\n\t\t\tobject: fieldsObject,\n\t\t});\n\t}\n}\n\n/**\n * @internal\n */\nexport class MapNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param mapFields -\n\t * Allows using the fields as a map, with the keys being\n\t * FieldKeys and the values being constrained by this TreeFieldStoredSchema.\n\t * Usually `FieldKind.Value` should NOT be used here\n\t * since no nodes can ever be in schema if you use `FieldKind.Value` here\n\t * (that would require infinite children).\n\t */\n\tpublic constructor(public readonly mapFields: TreeFieldStoredSchema) {\n\t\tsuper();\n\t}\n\n\tpublic override encode(): ErasedTreeNodeSchemaDataFormat {\n\t\treturn toErasedTreeNodeSchemaDataFormat({\n\t\t\tmap: encodeFieldSchema(this.mapFields),\n\t\t});\n\t}\n}\n\n/**\n * @internal\n */\nexport class LeafNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param leafValue -\n\t * There are several approaches for how to store actual data in the tree\n\t * (special node types, special field contents, data on nodes etc.)\n\t * as well as several options about how the data should be modeled at this level\n\t * (byte sequence? javascript type? json?),\n\t * as well as options for how much of this would be exposed in the schema language\n\t * (ex: would all nodes with values be special built-ins, or could any schema add them?)\n\t * A simple easy to do in javascript approach is taken here:\n\t * this is not intended to be a suggestion of what approach to take, or what to expose in the schema language.\n\t * This is simply one approach that can work for modeling them in the internal schema representation.\n\t */\n\tpublic constructor(public readonly leafValue: ValueSchema) {\n\t\tsuper();\n\t}\n\n\tpublic override encode(): ErasedTreeNodeSchemaDataFormat {\n\t\treturn toErasedTreeNodeSchemaDataFormat({\n\t\t\tleaf: encodeValueSchema(this.leafValue),\n\t\t});\n\t}\n}\n\nexport const storedSchemaDecodeDispatcher: DiscriminatedUnionDispatcher<\n\tTreeNodeSchemaDataFormat,\n\t[],\n\tTreeNodeStoredSchema\n> = new DiscriminatedUnionDispatcher({\n\tleaf: (data: PersistedValueSchema) => new LeafNodeStoredSchema(decodeValueSchema(data)),\n\tobject: (\n\t\tdata: Record<TreeNodeSchemaIdentifier, FieldSchemaFormat>,\n\t): TreeNodeStoredSchema => {\n\t\tconst map = new Map();\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tmap.set(key, decodeFieldSchema(value));\n\t\t}\n\t\treturn new ObjectNodeStoredSchema(map);\n\t},\n\tmap: (data: FieldSchemaFormat) => new MapNodeStoredSchema(decodeFieldSchema(data)),\n});\n\nconst valueSchemaEncode = new Map([\n\t[ValueSchema.Number, PersistedValueSchema.Number],\n\t[ValueSchema.String, PersistedValueSchema.String],\n\t[ValueSchema.Boolean, PersistedValueSchema.Boolean],\n\t[ValueSchema.FluidHandle, PersistedValueSchema.FluidHandle],\n\t[ValueSchema.Null, PersistedValueSchema.Null],\n]);\n\nconst valueSchemaDecode = invertMap(valueSchemaEncode);\n\nfunction encodeValueSchema(inMemory: ValueSchema): PersistedValueSchema {\n\treturn valueSchemaEncode.get(inMemory) ?? fail(\"missing PersistedValueSchema\");\n}\n\nfunction decodeValueSchema(inMemory: PersistedValueSchema): ValueSchema {\n\treturn valueSchemaDecode.get(inMemory) ?? fail(\"missing ValueSchema\");\n}\n\nexport function encodeFieldSchema(schema: TreeFieldStoredSchema): FieldSchemaFormat {\n\tconst out: FieldSchemaFormat = {\n\t\tkind: schema.kind,\n\t};\n\tif (schema.types !== undefined) {\n\t\tout.types = [...schema.types];\n\t}\n\treturn out;\n}\n\nexport function decodeFieldSchema(schema: FieldSchemaFormat): TreeFieldStoredSchema {\n\tconst out: TreeFieldStoredSchema = {\n\t\t// TODO: maybe provide actual FieldKind objects here, error on unrecognized kinds.\n\t\tkind: schema.kind,\n\t\ttypes: schema.types === undefined ? undefined : new Set(schema.types),\n\t};\n\treturn out;\n}\n\n/**\n * Document schema data that can be stored in a document.\n *\n * @remarks\n * Note: the owner of this may modify it over time:\n * thus if needing to hand onto a specific version, make a copy.\n * @internal\n */\nexport interface TreeStoredSchema extends StoredSchemaCollection {\n\t/**\n\t * Schema for the root field which contains the whole tree.\n\t */\n\treadonly rootFieldSchema: TreeFieldStoredSchema;\n}\n\n/**\n * Collection of TreeNodeSchema data that can be stored in a document.\n *\n * @remarks\n * Note: the owner of this may modify it over time:\n * thus if needing to hang onto a specific version, make a copy.\n * @internal\n */\nexport interface StoredSchemaCollection {\n\t/**\n\t * {@inheritdoc StoredSchemaCollection}\n\t */\n\treadonly nodeSchema: ReadonlyMap<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/core/schema-stored/schema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,mDAAoE;AACpE,kDAA+E;AAC/E,2CAOqB;AAGrB;;;GAGG;A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AC,IAAI;QACjB,KAAK,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC;KAC5B,CAAC;IACF,OAAO,GAAG,CAAC;AACZ,CAAC;AAPD,8CAOC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ErasedType } from \"@fluidframework/core-interfaces\";\nimport { DiscriminatedUnionDispatcher } from \"../../codec/index.js\";\nimport { type MakeNominal, brand, fail, invertMap } from \"../../util/index.js\";\nimport {\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype FieldSchemaFormat,\n\tPersistedValueSchema,\n\ttype TreeNodeSchemaDataFormat,\n\ttype TreeNodeSchemaIdentifier,\n} from \"./format.js\";\nimport type { Multiplicity } from \"./multiplicity.js\";\n\n/**\n * Schema for what {@link TreeValue} is allowed on a Leaf node.\n * @internal\n */\nexport enum ValueSchema {\n\tNumber,\n\tString,\n\tBoolean,\n\tFluidHandle,\n\tNull,\n}\n\n/**\n * Set of allowed tree types.\n * Providing multiple values here allows polymorphism, tagged union style.\n *\n * In the future, this could be extended to allow inlining a TreeNodeStoredSchema here\n * (or some similar structural schema system).\n * For structural types which could go here, there are a few interesting options:\n *\n * - Allow replacing the whole set with a structural type for terminal / non-tree data,\n * and use this as a replacement for values on the tree nodes.\n *\n * - Allow expression structural constraints for child trees, for example requiring specific traits\n * (ex: via TreeNodeStoredSchema), instead of by type.\n *\n * There are two ways this could work:\n *\n * - Constrain the child nodes based on their shape:\n * this makes schema safe editing difficult because nodes would incur extra editing constraints to prevent them\n * from going out of schema based on their location in such a field.\n *\n * - Constrain the types allowed based on which types guarantee their data will always meet the constraints.\n *\n * Care would need to be taken to make sure this is sound for the schema updating mechanisms.\n * @internal\n */\nexport type TreeTypeSet = ReadonlySet<TreeNodeSchemaIdentifier>;\n\n/**\n * Declarative portion of a Field Kind.\n *\n * @remarks\n * Enough info about a field kind to know if a given tree is is schema.\n */\nexport interface FieldKindData {\n\treadonly identifier: FieldKindIdentifier;\n\treadonly multiplicity: Multiplicity;\n}\n\n/**\n * Everything needed to define what it means for a tree to be in schema.\n */\nexport interface SchemaAndPolicy {\n\treadonly schema: StoredSchemaCollection;\n\treadonly policy: SchemaPolicy;\n}\n\n/**\n * Extra data needed to interpret schema.\n */\nexport interface SchemaPolicy {\n\t/**\n\t * Policy information about FieldKinds:\n\t * This is typically stored as code, not in documents, and defines how to handle fields based on their kind.\n\t * It is assumed that all users of a document will have exactly the same FieldKind policies,\n\t * though older applications might be missing some,\n\t * and will be unable to process any changes that use those FieldKinds.\n\t */\n\treadonly fieldKinds: ReadonlyMap<FieldKindIdentifier, FieldKindData>;\n\n\t/**\n\t * If true, new content inserted into the tree should be validated against the stored schema.\n\t */\n\treadonly validateSchema: boolean;\n}\n\n/**\n * Schema for a field.\n * Object implementing this interface should never be modified.\n * @internal\n */\nexport interface TreeFieldStoredSchema {\n\treadonly kind: FieldKindIdentifier;\n\t/**\n\t * The set of allowed child types.\n\t * If not specified, types are unconstrained.\n\t */\n\treadonly types: TreeTypeSet;\n}\n\n/**\n * Identifier used for the FieldKind for fields which must be empty.\n *\n * @remarks\n * This mainly show up in:\n * 1. The root default field for documents.\n * 2. The schema used for out of schema fields (which thus must be empty/not exist) on object and leaf nodes.\n */\nexport const forbiddenFieldKindIdentifier = \"Forbidden\";\n\n/**\n * A schema for empty fields (fields which must always be empty).\n * There are multiple ways this could be encoded, but this is the most explicit.\n */\nexport const storedEmptyFieldSchema: TreeFieldStoredSchema = {\n\t// This kind requires the field to be empty.\n\tkind: brand(forbiddenFieldKindIdentifier),\n\t// This type set also forces the field to be empty not not allowing any types as all.\n\ttypes: new Set(),\n};\n\n/**\n * Identifier used for the FieldKind for fields of type identifier.\n */\nexport const identifierFieldKindIdentifier = \"Identifier\";\n\n/**\n * Opaque type erased handle to the encoded representation of the contents of a stored schema.\n * @internal\n */\nexport interface ErasedTreeNodeSchemaDataFormat\n\textends ErasedType<\"TreeNodeSchemaDataFormat\"> {}\n\nfunction toErasedTreeNodeSchemaDataFormat(\n\tdata: TreeNodeSchemaDataFormat,\n): ErasedTreeNodeSchemaDataFormat {\n\treturn data as unknown as ErasedTreeNodeSchemaDataFormat;\n}\n\nexport function toTreeNodeSchemaDataFormat(\n\tdata: ErasedTreeNodeSchemaDataFormat,\n): TreeNodeSchemaDataFormat {\n\treturn data as unknown as TreeNodeSchemaDataFormat;\n}\n\n/**\n * @internal\n */\nexport abstract class TreeNodeStoredSchema {\n\tprotected _typeCheck!: MakeNominal;\n\n\t/**\n\t * @privateRemarks\n\t * Returns TreeNodeSchemaDataFormat.\n\t * This is uses an opaque type to avoid leaking these types out of the package,\n\t * and is runtime validated by the codec.\n\t */\n\tpublic abstract encode(): ErasedTreeNodeSchemaDataFormat;\n}\n\n/**\n * @internal\n */\nexport class ObjectNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param objectNodeFields -\n\t * Schema for fields with keys scoped to this TreeNodeStoredSchema.\n\t * This refers to the TreeFieldStoredSchema directly\n\t * (as opposed to just supporting FieldSchemaIdentifier and having a central FieldKey -\\> TreeFieldStoredSchema map).\n\t * This allows us short friendly field keys which can be ergonomically used as field names in code.\n\t * It also interoperates well with mapFields being used as a map with arbitrary data as keys.\n\t */\n\tpublic constructor(\n\t\tpublic readonly objectNodeFields: ReadonlyMap<FieldKey, TreeFieldStoredSchema>,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic override encode(): ErasedTreeNodeSchemaDataFormat {\n\t\tconst fieldsObject: Record<string, FieldSchemaFormat> = Object.create(null);\n\t\t// Sort fields to ensure output is identical for for equivalent schema (since field order is not considered significant).\n\t\t// This makes comparing schema easier, and ensures chunk reuse for schema summaries isn't needlessly broken.\n\t\tfor (const key of [...this.objectNodeFields.keys()].sort()) {\n\t\t\tObject.defineProperty(fieldsObject, key, {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: encodeFieldSchema(this.objectNodeFields.get(key) ?? fail(\"missing field\")),\n\t\t\t});\n\t\t}\n\t\treturn toErasedTreeNodeSchemaDataFormat({\n\t\t\tobject: fieldsObject,\n\t\t});\n\t}\n}\n\n/**\n * @internal\n */\nexport class MapNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param mapFields -\n\t * Allows using the fields as a map, with the keys being\n\t * FieldKeys and the values being constrained by this TreeFieldStoredSchema.\n\t * Usually `FieldKind.Value` should NOT be used here\n\t * since no nodes can ever be in schema if you use `FieldKind.Value` here\n\t * (that would require infinite children).\n\t */\n\tpublic constructor(public readonly mapFields: TreeFieldStoredSchema) {\n\t\tsuper();\n\t}\n\n\tpublic override encode(): ErasedTreeNodeSchemaDataFormat {\n\t\treturn toErasedTreeNodeSchemaDataFormat({\n\t\t\tmap: encodeFieldSchema(this.mapFields),\n\t\t});\n\t}\n}\n\n/**\n * @internal\n */\nexport class LeafNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param leafValue -\n\t * There are several approaches for how to store actual data in the tree\n\t * (special node types, special field contents, data on nodes etc.)\n\t * as well as several options about how the data should be modeled at this level\n\t * (byte sequence? javascript type? json?),\n\t * as well as options for how much of this would be exposed in the schema language\n\t * (ex: would all nodes with values be special built-ins, or could any schema add them?)\n\t * A simple easy to do in javascript approach is taken here:\n\t * this is not intended to be a suggestion of what approach to take, or what to expose in the schema language.\n\t * This is simply one approach that can work for modeling them in the internal schema representation.\n\t */\n\tpublic constructor(public readonly leafValue: ValueSchema) {\n\t\tsuper();\n\t}\n\n\tpublic override encode(): ErasedTreeNodeSchemaDataFormat {\n\t\treturn toErasedTreeNodeSchemaDataFormat({\n\t\t\tleaf: encodeValueSchema(this.leafValue),\n\t\t});\n\t}\n}\n\nexport const storedSchemaDecodeDispatcher: DiscriminatedUnionDispatcher<\n\tTreeNodeSchemaDataFormat,\n\t[],\n\tTreeNodeStoredSchema\n> = new DiscriminatedUnionDispatcher({\n\tleaf: (data: PersistedValueSchema) => new LeafNodeStoredSchema(decodeValueSchema(data)),\n\tobject: (\n\t\tdata: Record<TreeNodeSchemaIdentifier, FieldSchemaFormat>,\n\t): TreeNodeStoredSchema => {\n\t\tconst map = new Map();\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tmap.set(key, decodeFieldSchema(value));\n\t\t}\n\t\treturn new ObjectNodeStoredSchema(map);\n\t},\n\tmap: (data: FieldSchemaFormat) => new MapNodeStoredSchema(decodeFieldSchema(data)),\n});\n\nconst valueSchemaEncode = new Map([\n\t[ValueSchema.Number, PersistedValueSchema.Number],\n\t[ValueSchema.String, PersistedValueSchema.String],\n\t[ValueSchema.Boolean, PersistedValueSchema.Boolean],\n\t[ValueSchema.FluidHandle, PersistedValueSchema.FluidHandle],\n\t[ValueSchema.Null, PersistedValueSchema.Null],\n]);\n\nconst valueSchemaDecode = invertMap(valueSchemaEncode);\n\nfunction encodeValueSchema(inMemory: ValueSchema): PersistedValueSchema {\n\treturn valueSchemaEncode.get(inMemory) ?? fail(\"missing PersistedValueSchema\");\n}\n\nfunction decodeValueSchema(inMemory: PersistedValueSchema): ValueSchema {\n\treturn valueSchemaDecode.get(inMemory) ?? fail(\"missing ValueSchema\");\n}\n\nexport function encodeFieldSchema(schema: TreeFieldStoredSchema): FieldSchemaFormat {\n\treturn {\n\t\tkind: schema.kind,\n\t\t// Types are sorted by identifier to improve stability of persisted data to increase chance of schema blob reuse.\n\t\ttypes: [...schema.types].sort(),\n\t};\n}\n\nexport function decodeFieldSchema(schema: FieldSchemaFormat): TreeFieldStoredSchema {\n\tconst out: TreeFieldStoredSchema = {\n\t\t// TODO: maybe provide actual FieldKind objects here, error on unrecognized kinds.\n\t\tkind: schema.kind,\n\t\ttypes: new Set(schema.types),\n\t};\n\treturn out;\n}\n\n/**\n * Document schema data that can be stored in a document.\n *\n * @remarks\n * Note: the owner of this may modify it over time:\n * thus if needing to hand onto a specific version, make a copy.\n * @internal\n */\nexport interface TreeStoredSchema extends StoredSchemaCollection {\n\t/**\n\t * Schema for the root field which contains the whole tree.\n\t */\n\treadonly rootFieldSchema: TreeFieldStoredSchema;\n}\n\n/**\n * Collection of TreeNodeSchema data that can be stored in a document.\n *\n * @remarks\n * Note: the owner of this may modify it over time:\n * thus if needing to hang onto a specific version, make a copy.\n * @internal\n */\nexport interface StoredSchemaCollection {\n\t/**\n\t * {@inheritdoc StoredSchemaCollection}\n\t */\n\treadonly nodeSchema: ReadonlyMap<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>;\n}\n"]}
|
|
@@ -43,7 +43,7 @@ export interface MutableTreeStoredSchema extends TreeStoredSchemaSubscription {
|
|
|
43
43
|
export declare class TreeStoredSchemaRepository implements MutableTreeStoredSchema {
|
|
44
44
|
protected nodeSchemaData: BTree<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>;
|
|
45
45
|
protected rootFieldSchemaData: TreeFieldStoredSchema;
|
|
46
|
-
protected readonly events: Listenable<SchemaEvents> & import("../../events/
|
|
46
|
+
protected readonly events: Listenable<SchemaEvents> & import("../../events/emitter.js").IEmitter<SchemaEvents> & import("../../events/emitter.js").HasListeners<SchemaEvents>;
|
|
47
47
|
/**
|
|
48
48
|
* Copies in the provided schema. If `data` is an TreeStoredSchemaRepository, it will be cheap-cloned.
|
|
49
49
|
* Otherwise, it will be deep-cloned.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storedSchemaRepository.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/storedSchemaRepository.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,OAAO,EAAE,KAAK,UAAU,EAAiB,MAAM,uBAAuB,CAAC;AAGvE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAEN,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EAErB,MAAM,aAAa,CAAC;AAErB;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,kBAAkB,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAEtD;;OAEG;IACH,iBAAiB,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,4BAChB,SAAQ,UAAU,CAAC,YAAY,CAAC,EAC/B,gBAAgB;CAAG;AAErB;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,4BAA4B;IAC5E;;;;OAIG;IACH,KAAK,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACzC;AAED;;GAEG;AACH,qBAAa,0BAA2B,YAAW,uBAAuB;IACzE,SAAS,CAAC,cAAc,EAAE,KAAK,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,CAAC;IAChF,SAAS,CAAC,mBAAmB,EAAE,qBAAqB,CAAC;IACrD,SAAS,CAAC,QAAQ,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"storedSchemaRepository.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/storedSchemaRepository.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,OAAO,EAAE,KAAK,UAAU,EAAiB,MAAM,uBAAuB,CAAC;AAGvE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAEN,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EAErB,MAAM,aAAa,CAAC;AAErB;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,kBAAkB,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAEtD;;OAEG;IACH,iBAAiB,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,4BAChB,SAAQ,UAAU,CAAC,YAAY,CAAC,EAC/B,gBAAgB;CAAG;AAErB;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,4BAA4B;IAC5E;;;;OAIG;IACH,KAAK,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACzC;AAED;;GAEG;AACH,qBAAa,0BAA2B,YAAW,uBAAuB;IACzE,SAAS,CAAC,cAAc,EAAE,KAAK,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,CAAC;IAChF,SAAS,CAAC,mBAAmB,EAAE,qBAAqB,CAAC;IACrD,SAAS,CAAC,QAAQ,CAAC,MAAM,qJAAiC;IAE1D;;;;;;;;;;;;OAYG;gBACgB,IAAI,CAAC,EAAE,gBAAgB;IAkBnC,EAAE,CAAC,CAAC,SAAS,MAAM,YAAY,EACrC,SAAS,EAAE,CAAC,EACZ,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,GACvB,MAAM,IAAI;IAIb,IAAW,UAAU,IAAI,WAAW,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,CAMnF;IAED,IAAW,eAAe,IAAI,qBAAqB,CAElD;IAEM,KAAK,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI;IASxC,KAAK,IAAI,0BAA0B;CAG1C;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAEjE"}
|
|
@@ -6,7 +6,6 @@ import { type Listenable } from "../../events/index.js";
|
|
|
6
6
|
import { type Brand, type BrandedKey, type BrandedMapSubset, type Opaque } from "../../util/index.js";
|
|
7
7
|
import type { FieldKey } from "../schema-stored/index.js";
|
|
8
8
|
import type { UpPath } from "./pathTree.js";
|
|
9
|
-
import { type Value } from "./types.js";
|
|
10
9
|
import type { DeltaVisitor } from "./visitDelta.js";
|
|
11
10
|
import type { PathVisitor } from "./visitPath.js";
|
|
12
11
|
import type { AnnouncedVisitor } from "./visitorUtils.js";
|
|
@@ -91,7 +90,10 @@ export interface AnchorEvents {
|
|
|
91
90
|
*
|
|
92
91
|
* Compare to {@link AnchorEvents.childrenChanged} which is emitted in the middle of the batch/delta-visit.
|
|
93
92
|
*/
|
|
94
|
-
childrenChangedAfterBatch(
|
|
93
|
+
childrenChangedAfterBatch(arg: {
|
|
94
|
+
anchor: AnchorNode;
|
|
95
|
+
changedFields: ReadonlySet<FieldKey>;
|
|
96
|
+
}): void;
|
|
95
97
|
/**
|
|
96
98
|
* Emitted in the middle of applying a batch of changes (i.e. during a delta a visit), if something in the subtree
|
|
97
99
|
* rooted at `anchor` _may_ be about to change due to updates from the batch.
|
|
@@ -138,10 +140,6 @@ export interface AnchorEvents {
|
|
|
138
140
|
* fire when something _may_ have changed or _may_ be about to change.
|
|
139
141
|
*/
|
|
140
142
|
subtreeChangedAfterBatch(anchor: AnchorNode): void;
|
|
141
|
-
/**
|
|
142
|
-
* Value on this node is changing.
|
|
143
|
-
*/
|
|
144
|
-
valueChanging(anchor: AnchorNode, value: Value): void;
|
|
145
143
|
}
|
|
146
144
|
/**
|
|
147
145
|
* Events for {@link AnchorSet}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchorSet.d.ts","sourceRoot":"","sources":["../../../src/core/tree/anchorSet.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAE,KAAK,UAAU,EAAiB,MAAM,uBAAuB,CAAC;AACvE,OAAO,EACN,KAAK,KAAK,EACV,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,MAAM,EAKX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAG1D,OAAO,KAAK,EAOX,MAAM,EACN,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"anchorSet.d.ts","sourceRoot":"","sources":["../../../src/core/tree/anchorSet.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAE,KAAK,UAAU,EAAiB,MAAM,uBAAuB,CAAC;AACvE,OAA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
|
|
421
421
|
parentField: undefined,
|
|
422
422
|
parent: undefined,
|
|
423
|
+
/**
|
|
424
|
+
* Events collected during the visit which get sent as a batch during "free".
|
|
425
|
+
*/
|
|
423
426
|
bufferedEvents: [],
|
|
424
427
|
// 'currentDepth' and 'depthThresholdForSubtreeChanged' serve to keep track of when do we need to emit
|
|
425
428
|
// subtreeChangedAfterBatch events.
|
|
@@ -457,7 +460,16 @@ class AnchorSet {
|
|
|
457
460
|
continue;
|
|
458
461
|
}
|
|
459
462
|
emittedEvents?.push(event);
|
|
460
|
-
|
|
463
|
+
if (event === "childrenChangedAfterBatch") {
|
|
464
|
+
const fieldKeys = this.bufferedEvents
|
|
465
|
+
.filter((e) => e.node === node && e.event === event)
|
|
466
|
+
.map((e) => e.changedField ??
|
|
467
|
+
(0, index_js_2.fail)("childrenChangedAfterBatch events should have a changedField"));
|
|
468
|
+
node.events.emit(event, { anchor: node, changedFields: new Set(fieldKeys) });
|
|
469
|
+
}
|
|
470
|
+
else {
|
|
471
|
+
node.events.emit(event, node);
|
|
472
|
+
}
|
|
461
473
|
}
|
|
462
474
|
},
|
|
463
475
|
notifyChildrenChanging() {
|
|
@@ -465,10 +477,12 @@ class AnchorSet {
|
|
|
465
477
|
},
|
|
466
478
|
notifyChildrenChanged() {
|
|
467
479
|
this.maybeWithNode((p) => {
|
|
480
|
+
(0, internal_1.assert)(this.parentField !== undefined, 0xa24 /* Must be in a field to modify its contents */);
|
|
468
481
|
p.events.emit("childrenChanged", p);
|
|
469
482
|
this.bufferedEvents.push({
|
|
470
483
|
node: p,
|
|
471
484
|
event: "childrenChangedAfterBatch",
|
|
485
|
+
changedField: this.parentField,
|
|
472
486
|
});
|
|
473
487
|
}, () => { });
|
|
474
488
|
},
|