@fluidframework/tree 2.3.1 → 2.4.0-297027
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/api-report/tree.alpha.api.md +77 -38
- package/api-report/tree.beta.api.md +50 -30
- package/api-report/tree.legacy.alpha.api.md +50 -30
- package/api-report/tree.legacy.public.api.md +50 -30
- package/api-report/tree.public.api.md +50 -30
- package/dist/alpha.d.ts +7 -0
- package/dist/beta.d.ts +4 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/index.d.ts +1 -1
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js +2 -1
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +1 -0
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +8 -1
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +7 -0
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +9 -0
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts +1 -2
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +2 -2
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +13 -2
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexTypes.d.ts +1 -1
- package/dist/core/tree/detachedFieldIndexTypes.js.map +1 -1
- package/dist/feature-libraries/editableTreeBinder.d.ts +3 -230
- package/dist/feature-libraries/editableTreeBinder.d.ts.map +1 -1
- package/dist/feature-libraries/editableTreeBinder.js +1 -539
- package/dist/feature-libraries/editableTreeBinder.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +7 -14
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +3 -3
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +2 -16
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +2 -3
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.js +1 -2
- package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +10 -15
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +18 -20
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts +4 -5
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +13 -23
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.js +1 -1
- package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +4 -7
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +5 -31
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +7 -0
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +61 -17
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +3 -0
- package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV1.d.ts +18 -18
- package/dist/feature-libraries/sequence-field/formatV2.d.ts +18 -18
- package/dist/feature-libraries/sequence-field/formatV3.d.ts +27 -27
- package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.js +1 -4
- package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
- package/dist/feature-libraries/typed-schema/flexList.d.ts +1 -46
- package/dist/feature-libraries/typed-schema/flexList.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/flexList.js +1 -13
- package/dist/feature-libraries/typed-schema/flexList.js.map +1 -1
- package/dist/feature-libraries/typed-schema/index.d.ts +2 -4
- package/dist/feature-libraries/typed-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/index.js +1 -19
- package/dist/feature-libraries/typed-schema/index.js.map +1 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +0 -212
- package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js +0 -266
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/internalTypes.d.ts +1 -1
- package/dist/internalTypes.d.ts.map +1 -1
- package/dist/internalTypes.js.map +1 -1
- package/dist/legacy.d.ts +4 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/public.d.ts +4 -0
- package/dist/shared-tree/checkoutFlexTreeView.d.ts +3 -3
- package/dist/shared-tree/checkoutFlexTreeView.d.ts.map +1 -1
- package/dist/shared-tree/checkoutFlexTreeView.js +1 -1
- package/dist/shared-tree/checkoutFlexTreeView.js.map +1 -1
- 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 -3
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts +1 -40
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +2 -11
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +9 -7
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +19 -8
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +19 -2
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +10 -2
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +71 -41
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +116 -84
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +8 -11
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +12 -15
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/simple-tree/api/create.d.ts +1 -1
- package/dist/simple-tree/api/create.d.ts.map +1 -1
- package/dist/simple-tree/api/create.js +11 -13
- package/dist/simple-tree/api/create.js.map +1 -1
- package/dist/simple-tree/api/getJsonSchema.d.ts +3 -3
- package/dist/simple-tree/api/getJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/getJsonSchema.js +1 -1
- package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/getSimpleSchema.d.ts +2 -2
- package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +2 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +3 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/jsonSchema.d.ts +13 -14
- package/dist/simple-tree/api/jsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/jsonSchema.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +14 -8
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +21 -2
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +3 -3
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/simpleSchema.d.ts +18 -10
- package/dist/simple-tree/api/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchema.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +30 -17
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +16 -6
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js +4 -4
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +8 -6
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +6 -10
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/{lib/feature-libraries/typed-schema → dist/simple-tree/api}/view.d.ts +4 -11
- package/dist/simple-tree/api/view.d.ts.map +1 -0
- package/dist/{feature-libraries/typed-schema → simple-tree/api}/view.js +9 -9
- package/dist/simple-tree/api/view.js.map +1 -0
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +2 -2
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +11 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts +147 -14
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js +32 -20
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/core/context.d.ts +55 -0
- package/dist/simple-tree/core/context.d.ts.map +1 -0
- package/dist/simple-tree/core/context.js +60 -0
- package/dist/simple-tree/core/context.js.map +1 -0
- package/dist/simple-tree/core/getOrCreateNode.d.ts +15 -0
- package/dist/simple-tree/core/getOrCreateNode.d.ts.map +1 -0
- package/dist/simple-tree/core/getOrCreateNode.js +36 -0
- package/dist/simple-tree/core/getOrCreateNode.js.map +1 -0
- package/dist/simple-tree/core/index.d.ts +7 -3
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +16 -7
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/schemaCaching.d.ts +5 -13
- package/dist/simple-tree/core/schemaCaching.d.ts.map +1 -1
- package/dist/simple-tree/core/schemaCaching.js +16 -45
- package/dist/simple-tree/core/schemaCaching.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts +29 -7
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +94 -58
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +24 -0
- package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/types.d.ts +0 -5
- 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/unhydratedFlexTree.d.ts +139 -0
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -0
- package/dist/{feature-libraries/flex-map-tree/mapTreeNode.js → simple-tree/core/unhydratedFlexTree.js} +112 -132
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -0
- package/dist/simple-tree/{walkSchema.d.ts → core/walkSchema.d.ts} +8 -4
- package/dist/simple-tree/core/walkSchema.d.ts.map +1 -0
- package/dist/simple-tree/core/walkSchema.js +34 -0
- package/dist/simple-tree/core/walkSchema.js.map +1 -0
- package/dist/simple-tree/createContext.d.ts +11 -0
- package/dist/simple-tree/createContext.d.ts.map +1 -0
- package/dist/simple-tree/createContext.js +25 -0
- package/dist/simple-tree/createContext.js.map +1 -0
- package/dist/simple-tree/index.d.ts +4 -5
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +7 -7
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +1 -0
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +1 -2
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/mapNode.d.ts +4 -4
- package/dist/simple-tree/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/mapNode.js +9 -5
- package/dist/simple-tree/mapNode.js.map +1 -1
- package/dist/simple-tree/objectNode.d.ts +8 -8
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +33 -14
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/objectNodeTypes.d.ts +7 -3
- package/dist/simple-tree/objectNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/objectNodeTypes.js.map +1 -1
- package/dist/simple-tree/proxies.d.ts +1 -2
- package/dist/simple-tree/proxies.d.ts.map +1 -1
- package/dist/simple-tree/proxies.js +6 -22
- package/dist/simple-tree/proxies.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +44 -4
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js +10 -0
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/toFlexSchema.d.ts +6 -36
- package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/dist/simple-tree/toFlexSchema.js +58 -142
- package/dist/simple-tree/toFlexSchema.js.map +1 -1
- package/dist/simple-tree/toMapTree.d.ts.map +1 -1
- package/dist/simple-tree/toMapTree.js +2 -2
- package/dist/simple-tree/toMapTree.js.map +1 -1
- package/dist/simple-tree/treeNodeValid.d.ts +13 -5
- package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/treeNodeValid.js +19 -10
- package/dist/simple-tree/treeNodeValid.js.map +1 -1
- package/dist/simple-tree/typesUnsafe.d.ts +4 -4
- package/dist/simple-tree/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/walkFieldSchema.d.ts +11 -0
- package/dist/simple-tree/walkFieldSchema.d.ts.map +1 -0
- package/dist/simple-tree/walkFieldSchema.js +17 -0
- package/dist/simple-tree/walkFieldSchema.js.map +1 -0
- package/dist/util/index.d.ts +1 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js.map +1 -1
- package/dist/util/typeUtils.d.ts +14 -45
- package/dist/util/typeUtils.d.ts.map +1 -1
- package/dist/util/typeUtils.js.map +1 -1
- package/lib/alpha.d.ts +7 -0
- package/lib/beta.d.ts +4 -0
- 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/rebase/index.d.ts +1 -1
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +1 -0
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +6 -0
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +7 -0
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +9 -0
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/anchorSet.d.ts +1 -2
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +2 -2
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +13 -2
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexTypes.d.ts +1 -1
- package/lib/core/tree/detachedFieldIndexTypes.js.map +1 -1
- package/lib/feature-libraries/editableTreeBinder.d.ts +3 -230
- package/lib/feature-libraries/editableTreeBinder.d.ts.map +1 -1
- package/lib/feature-libraries/editableTreeBinder.js +1 -532
- package/lib/feature-libraries/editableTreeBinder.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +7 -14
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +3 -3
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +2 -16
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts +2 -3
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.js +1 -2
- package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +10 -15
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +18 -20
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts +4 -5
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +13 -23
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.js +1 -1
- package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +4 -7
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +4 -6
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +7 -0
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +62 -18
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +3 -0
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV1.d.ts +18 -18
- package/lib/feature-libraries/sequence-field/formatV2.d.ts +18 -18
- package/lib/feature-libraries/sequence-field/formatV3.d.ts +27 -27
- package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.js +2 -5
- package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
- package/lib/feature-libraries/typed-schema/flexList.d.ts +1 -46
- package/lib/feature-libraries/typed-schema/flexList.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/flexList.js +0 -11
- package/lib/feature-libraries/typed-schema/flexList.js.map +1 -1
- package/lib/feature-libraries/typed-schema/index.d.ts +2 -4
- package/lib/feature-libraries/typed-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/index.js +0 -3
- package/lib/feature-libraries/typed-schema/index.js.map +1 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts +0 -212
- package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js +1 -253
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/internalTypes.d.ts +1 -1
- package/lib/internalTypes.d.ts.map +1 -1
- package/lib/internalTypes.js.map +1 -1
- package/lib/legacy.d.ts +4 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +4 -0
- package/lib/shared-tree/checkoutFlexTreeView.d.ts +3 -3
- package/lib/shared-tree/checkoutFlexTreeView.d.ts.map +1 -1
- package/lib/shared-tree/checkoutFlexTreeView.js +1 -1
- package/lib/shared-tree/checkoutFlexTreeView.js.map +1 -1
- 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 -2
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts +1 -40
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +1 -9
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +9 -7
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +22 -11
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +19 -2
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +10 -3
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +71 -41
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +118 -86
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +8 -11
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +12 -15
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/simple-tree/api/create.d.ts +1 -1
- package/lib/simple-tree/api/create.d.ts.map +1 -1
- package/lib/simple-tree/api/create.js +14 -16
- package/lib/simple-tree/api/create.js.map +1 -1
- package/lib/simple-tree/api/getJsonSchema.d.ts +3 -3
- package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/getJsonSchema.js +1 -1
- package/lib/simple-tree/api/getJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/getSimpleSchema.d.ts +2 -2
- package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +2 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -0
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/jsonSchema.d.ts +13 -14
- package/lib/simple-tree/api/jsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/jsonSchema.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +14 -8
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +21 -2
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +3 -3
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/api/simpleSchema.d.ts +18 -10
- package/lib/simple-tree/api/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchema.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +31 -18
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +16 -6
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js +4 -4
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +10 -8
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +6 -10
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/{dist/feature-libraries/typed-schema → lib/simple-tree/api}/view.d.ts +4 -11
- package/lib/simple-tree/api/view.d.ts.map +1 -0
- package/lib/{feature-libraries/typed-schema → simple-tree/api}/view.js +9 -9
- package/lib/simple-tree/api/view.js.map +1 -0
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +2 -2
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +11 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/lib/simple-tree/arrayNode.d.ts +147 -14
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js +37 -25
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/core/context.d.ts +55 -0
- package/lib/simple-tree/core/context.d.ts.map +1 -0
- package/lib/simple-tree/core/context.js +55 -0
- package/lib/simple-tree/core/context.js.map +1 -0
- package/lib/simple-tree/core/getOrCreateNode.d.ts +15 -0
- package/lib/simple-tree/core/getOrCreateNode.d.ts.map +1 -0
- package/lib/simple-tree/core/getOrCreateNode.js +32 -0
- package/lib/simple-tree/core/getOrCreateNode.js.map +1 -0
- package/lib/simple-tree/core/index.d.ts +7 -3
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +6 -2
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/schemaCaching.d.ts +5 -13
- package/lib/simple-tree/core/schemaCaching.d.ts.map +1 -1
- package/lib/simple-tree/core/schemaCaching.js +13 -39
- package/lib/simple-tree/core/schemaCaching.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts +29 -7
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +89 -54
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +24 -0
- package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/core/types.d.ts +0 -5
- 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/unhydratedFlexTree.d.ts +139 -0
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -0
- package/lib/{feature-libraries/flex-map-tree/mapTreeNode.js → simple-tree/core/unhydratedFlexTree.js} +110 -128
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -0
- package/lib/simple-tree/{walkSchema.d.ts → core/walkSchema.d.ts} +8 -4
- package/lib/simple-tree/core/walkSchema.d.ts.map +1 -0
- package/lib/simple-tree/core/walkSchema.js +29 -0
- package/lib/simple-tree/core/walkSchema.js.map +1 -0
- package/lib/simple-tree/createContext.d.ts +11 -0
- package/lib/simple-tree/createContext.d.ts.map +1 -0
- package/lib/simple-tree/createContext.js +21 -0
- package/lib/simple-tree/createContext.js.map +1 -0
- package/lib/simple-tree/index.d.ts +4 -5
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +3 -4
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts +1 -0
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +3 -4
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/mapNode.d.ts +4 -4
- package/lib/simple-tree/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/mapNode.js +12 -8
- package/lib/simple-tree/mapNode.js.map +1 -1
- package/lib/simple-tree/objectNode.d.ts +8 -8
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +36 -17
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/objectNodeTypes.d.ts +7 -3
- package/lib/simple-tree/objectNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/objectNodeTypes.js.map +1 -1
- package/lib/simple-tree/proxies.d.ts +1 -2
- package/lib/simple-tree/proxies.d.ts.map +1 -1
- package/lib/simple-tree/proxies.js +7 -22
- package/lib/simple-tree/proxies.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +44 -4
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js +10 -0
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/toFlexSchema.d.ts +6 -36
- package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/lib/simple-tree/toFlexSchema.js +61 -142
- package/lib/simple-tree/toFlexSchema.js.map +1 -1
- package/lib/simple-tree/toMapTree.d.ts.map +1 -1
- package/lib/simple-tree/toMapTree.js +4 -4
- package/lib/simple-tree/toMapTree.js.map +1 -1
- package/lib/simple-tree/treeNodeValid.d.ts +13 -5
- package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/treeNodeValid.js +21 -12
- package/lib/simple-tree/treeNodeValid.js.map +1 -1
- package/lib/simple-tree/typesUnsafe.d.ts +4 -4
- package/lib/simple-tree/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/walkFieldSchema.d.ts +11 -0
- package/lib/simple-tree/walkFieldSchema.d.ts.map +1 -0
- package/lib/simple-tree/walkFieldSchema.js +13 -0
- package/lib/simple-tree/walkFieldSchema.js.map +1 -0
- package/lib/util/index.d.ts +1 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js.map +1 -1
- package/lib/util/typeUtils.d.ts +14 -45
- package/lib/util/typeUtils.d.ts.map +1 -1
- package/lib/util/typeUtils.js.map +1 -1
- package/package.json +41 -22
- package/src/core/index.ts +1 -0
- package/src/core/rebase/index.ts +1 -0
- package/src/core/rebase/types.ts +11 -0
- package/src/core/schema-stored/schema.ts +18 -0
- package/src/core/tree/anchorSet.ts +3 -4
- package/src/core/tree/detachedFieldIndex.ts +14 -3
- package/src/core/tree/detachedFieldIndexTypes.ts +1 -1
- package/src/feature-libraries/editableTreeBinder.ts +2 -915
- package/src/feature-libraries/flex-tree/context.ts +7 -20
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +2 -18
- package/src/feature-libraries/flex-tree/lazyEntity.ts +1 -4
- package/src/feature-libraries/flex-tree/lazyField.ts +22 -78
- package/src/feature-libraries/flex-tree/lazyNode.ts +24 -39
- package/src/feature-libraries/flex-tree/utilities.ts +1 -1
- package/src/feature-libraries/index.ts +3 -71
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +97 -10
- package/src/feature-libraries/sequence-field/compose.ts +3 -0
- package/src/feature-libraries/sequence-field/utils.ts +2 -4
- package/src/feature-libraries/typed-schema/flexList.ts +3 -84
- package/src/feature-libraries/typed-schema/index.ts +1 -33
- package/src/feature-libraries/typed-schema/typedTreeSchema.ts +0 -458
- package/src/index.ts +7 -0
- package/src/internalTypes.ts +0 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/checkoutFlexTreeView.ts +3 -3
- package/src/shared-tree/index.ts +4 -8
- package/src/shared-tree/schematizeTree.ts +2 -56
- package/src/shared-tree/schematizingTreeView.ts +38 -15
- package/src/shared-tree/sharedTree.ts +36 -8
- package/src/shared-tree/treeCheckout.ts +225 -128
- package/src/shared-tree-core/branch.ts +15 -26
- package/src/simple-tree/api/create.ts +18 -20
- package/src/simple-tree/api/getJsonSchema.ts +3 -3
- package/src/simple-tree/api/getSimpleSchema.ts +2 -2
- package/src/simple-tree/api/index.ts +2 -0
- package/src/simple-tree/api/jsonSchema.ts +19 -17
- package/src/simple-tree/api/schemaFactory.ts +53 -18
- package/src/simple-tree/api/schemaFactoryRecursive.ts +3 -6
- package/src/simple-tree/api/simpleSchema.ts +20 -10
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +40 -19
- package/src/simple-tree/api/tree.ts +20 -9
- package/src/simple-tree/api/treeNodeApi.ts +12 -10
- package/src/simple-tree/api/verboseTree.ts +6 -12
- package/src/{feature-libraries/typed-schema → simple-tree/api}/view.ts +9 -22
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +18 -4
- package/src/simple-tree/arrayNode.ts +202 -53
- package/src/simple-tree/core/context.ts +78 -0
- package/src/simple-tree/core/getOrCreateNode.ts +38 -0
- package/src/simple-tree/core/index.ts +11 -7
- package/src/simple-tree/core/schemaCaching.ts +13 -50
- package/src/simple-tree/core/treeNodeKernel.ts +117 -78
- package/src/simple-tree/core/treeNodeSchema.ts +35 -1
- package/src/simple-tree/core/types.ts +0 -5
- package/src/{feature-libraries/flex-map-tree/mapTreeNode.ts → simple-tree/core/unhydratedFlexTree.ts} +167 -210
- package/src/simple-tree/{walkSchema.ts → core/walkSchema.ts} +12 -34
- package/src/simple-tree/createContext.ts +24 -0
- package/src/simple-tree/index.ts +6 -2
- package/src/simple-tree/leafNodeSchema.ts +3 -9
- package/src/simple-tree/mapNode.ts +20 -17
- package/src/simple-tree/objectNode.ts +63 -38
- package/src/simple-tree/objectNodeTypes.ts +8 -5
- package/src/simple-tree/proxies.ts +8 -26
- package/src/simple-tree/schemaTypes.ts +55 -5
- package/src/simple-tree/toFlexSchema.ts +71 -204
- package/src/simple-tree/toMapTree.ts +5 -5
- package/src/simple-tree/treeNodeValid.ts +28 -22
- package/src/simple-tree/typesUnsafe.ts +4 -4
- package/src/simple-tree/walkFieldSchema.ts +19 -0
- package/src/util/index.ts +1 -5
- package/src/util/typeUtils.ts +14 -56
- package/dist/feature-libraries/fieldGenerator.d.ts +0 -43
- package/dist/feature-libraries/fieldGenerator.d.ts.map +0 -1
- package/dist/feature-libraries/fieldGenerator.js +0 -13
- package/dist/feature-libraries/fieldGenerator.js.map +0 -1
- package/dist/feature-libraries/flex-map-tree/index.d.ts +0 -6
- package/dist/feature-libraries/flex-map-tree/index.d.ts.map +0 -1
- package/dist/feature-libraries/flex-map-tree/index.js +0 -14
- package/dist/feature-libraries/flex-map-tree/index.js.map +0 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts +0 -157
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +0 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js.map +0 -1
- package/dist/feature-libraries/storedToViewSchema.d.ts +0 -17
- package/dist/feature-libraries/storedToViewSchema.d.ts.map +0 -1
- package/dist/feature-libraries/storedToViewSchema.js +0 -67
- package/dist/feature-libraries/storedToViewSchema.js.map +0 -1
- package/dist/feature-libraries/typed-schema/schemaCollection.d.ts +0 -58
- package/dist/feature-libraries/typed-schema/schemaCollection.d.ts.map +0 -1
- package/dist/feature-libraries/typed-schema/schemaCollection.js +0 -160
- package/dist/feature-libraries/typed-schema/schemaCollection.js.map +0 -1
- package/dist/feature-libraries/typed-schema/typeUtils.d.ts +0 -15
- package/dist/feature-libraries/typed-schema/typeUtils.d.ts.map +0 -1
- package/dist/feature-libraries/typed-schema/typeUtils.js +0 -14
- package/dist/feature-libraries/typed-schema/typeUtils.js.map +0 -1
- package/dist/feature-libraries/typed-schema/view.d.ts.map +0 -1
- package/dist/feature-libraries/typed-schema/view.js.map +0 -1
- package/dist/simple-tree/getSimpleFieldSchema.d.ts +0 -14
- package/dist/simple-tree/getSimpleFieldSchema.d.ts.map +0 -1
- package/dist/simple-tree/getSimpleFieldSchema.js +0 -29
- package/dist/simple-tree/getSimpleFieldSchema.js.map +0 -1
- package/dist/simple-tree/walkSchema.d.ts.map +0 -1
- package/dist/simple-tree/walkSchema.js +0 -49
- package/dist/simple-tree/walkSchema.js.map +0 -1
- package/lib/feature-libraries/fieldGenerator.d.ts +0 -43
- package/lib/feature-libraries/fieldGenerator.d.ts.map +0 -1
- package/lib/feature-libraries/fieldGenerator.js +0 -12
- package/lib/feature-libraries/fieldGenerator.js.map +0 -1
- package/lib/feature-libraries/flex-map-tree/index.d.ts +0 -6
- package/lib/feature-libraries/flex-map-tree/index.d.ts.map +0 -1
- package/lib/feature-libraries/flex-map-tree/index.js +0 -6
- package/lib/feature-libraries/flex-map-tree/index.js.map +0 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts +0 -157
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +0 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js.map +0 -1
- package/lib/feature-libraries/storedToViewSchema.d.ts +0 -17
- package/lib/feature-libraries/storedToViewSchema.d.ts.map +0 -1
- package/lib/feature-libraries/storedToViewSchema.js +0 -62
- package/lib/feature-libraries/storedToViewSchema.js.map +0 -1
- package/lib/feature-libraries/typed-schema/schemaCollection.d.ts +0 -58
- package/lib/feature-libraries/typed-schema/schemaCollection.d.ts.map +0 -1
- package/lib/feature-libraries/typed-schema/schemaCollection.js +0 -153
- package/lib/feature-libraries/typed-schema/schemaCollection.js.map +0 -1
- package/lib/feature-libraries/typed-schema/typeUtils.d.ts +0 -15
- package/lib/feature-libraries/typed-schema/typeUtils.d.ts.map +0 -1
- package/lib/feature-libraries/typed-schema/typeUtils.js +0 -10
- package/lib/feature-libraries/typed-schema/typeUtils.js.map +0 -1
- package/lib/feature-libraries/typed-schema/view.d.ts.map +0 -1
- package/lib/feature-libraries/typed-schema/view.js.map +0 -1
- package/lib/simple-tree/getSimpleFieldSchema.d.ts +0 -14
- package/lib/simple-tree/getSimpleFieldSchema.d.ts.map +0 -1
- package/lib/simple-tree/getSimpleFieldSchema.js +0 -25
- package/lib/simple-tree/getSimpleFieldSchema.js.map +0 -1
- package/lib/simple-tree/walkSchema.d.ts.map +0 -1
- package/lib/simple-tree/walkSchema.js +0 -43
- package/lib/simple-tree/walkSchema.js.map +0 -1
- package/src/feature-libraries/fieldGenerator.ts +0 -47
- package/src/feature-libraries/flex-map-tree/index.ts +0 -14
- package/src/feature-libraries/storedToViewSchema.ts +0 -100
- package/src/feature-libraries/typed-schema/schemaCollection.ts +0 -254
- package/src/feature-libraries/typed-schema/typeUtils.ts +0 -29
- package/src/simple-tree/getSimpleFieldSchema.ts +0 -36
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import type
|
|
6
|
-
import { type WithType, NodeKind, type TreeNode, type
|
|
5
|
+
import { type ImplicitAllowedTypes, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeNodeFromImplicitAllowedTypes } from "./schemaTypes.js";
|
|
6
|
+
import { type WithType, NodeKind, type TreeNode, type TreeNodeSchemaBoth } from "./core/index.js";
|
|
7
7
|
/**
|
|
8
8
|
* A generic array type, used to defined types like {@link (TreeArrayNode:interface)}.
|
|
9
9
|
*
|
|
@@ -79,22 +79,88 @@ export interface TreeArrayNodeBase<out T, in TNew, in TMoveFrom> extends Readonl
|
|
|
79
79
|
moveToEnd(sourceIndex: number, source: TMoveFrom): void;
|
|
80
80
|
/**
|
|
81
81
|
* Moves the specified item to the desired location in the array.
|
|
82
|
-
*
|
|
83
|
-
*
|
|
82
|
+
*
|
|
83
|
+
* WARNING - This API is easily misused.
|
|
84
|
+
* Please read the documentation for the `destinationGap` parameter carefully.
|
|
85
|
+
*
|
|
86
|
+
* @param destinationGap - The location *between* existing items that the moved item should be moved to.
|
|
87
|
+
*
|
|
88
|
+
* WARNING - `destinationGap` describes a location between existing items *prior to applying the move operation*.
|
|
89
|
+
*
|
|
90
|
+
* For example, if the array contains items `[A, B, C]` before the move, the `destinationGap` must be one of the following:
|
|
91
|
+
*
|
|
92
|
+
* - `0` (between the start of the array and `A`'s original position)
|
|
93
|
+
* - `1` (between `A`'s original position and `B`'s original position)
|
|
94
|
+
* - `2` (between `B`'s original position and `C`'s original position)
|
|
95
|
+
* - `3` (between `C`'s original position and the end of the array)
|
|
96
|
+
*
|
|
97
|
+
* So moving `A` between `B` and `C` would require `destinationGap` to be `2`.
|
|
98
|
+
*
|
|
99
|
+
* This interpretation of `destinationGap` makes it easy to specify the desired destination relative to a sibling item that is not being moved,
|
|
100
|
+
* or relative to the start or end of the array:
|
|
101
|
+
*
|
|
102
|
+
* - Move to the start of the array: `array.moveToIndex(0, ...)` (see also `moveToStart`)
|
|
103
|
+
* - Move to before some item X: `array.moveToIndex(indexOfX, ...)`
|
|
104
|
+
* - Move to after some item X: `array.moveToIndex(indexOfX + 1`, ...)
|
|
105
|
+
* - Move to the end of the array: `array.moveToIndex(array.length, ...)` (see also `moveToEnd`)
|
|
106
|
+
*
|
|
107
|
+
* This interpretation of `destinationGap` does however make it less obvious how to move an item relative to its current position:
|
|
108
|
+
*
|
|
109
|
+
* - Move item B before its predecessor: `array.moveToIndex(indexOfB - 1, ...)`
|
|
110
|
+
* - Move item B after its successor: `array.moveToIndex(indexOfB + 2, ...)`
|
|
111
|
+
*
|
|
112
|
+
* Notice the asymmetry between `-1` and `+2` in the above examples.
|
|
113
|
+
* In such scenarios, it can often be easier to approach such edits by swapping adjacent items:
|
|
114
|
+
* If items A and B are adjacent, such that A precedes B,
|
|
115
|
+
* then they can be swapped with `array.moveToIndex(indexOfA, indexOfB)`.
|
|
116
|
+
*
|
|
84
117
|
* @param sourceIndex - The index of the item to move.
|
|
85
118
|
* @throws Throws if any of the input indices are not in the range [0, `array.length`).
|
|
86
119
|
*/
|
|
87
|
-
moveToIndex(
|
|
120
|
+
moveToIndex(destinationGap: number, sourceIndex: number): void;
|
|
88
121
|
/**
|
|
89
122
|
* Moves the specified item to the desired location in the array.
|
|
90
|
-
*
|
|
91
|
-
*
|
|
123
|
+
*
|
|
124
|
+
* WARNING - This API is easily misused.
|
|
125
|
+
* Please read the documentation for the `destinationGap` parameter carefully.
|
|
126
|
+
*
|
|
127
|
+
* @param destinationGap - The location *between* existing items that the moved item should be moved to.
|
|
128
|
+
*
|
|
129
|
+
* WARNING - `destinationGap` describes a location between existing items *prior to applying the move operation*.
|
|
130
|
+
*
|
|
131
|
+
* For example, if the array contains items `[A, B, C]` before the move, the `destinationGap` must be one of the following:
|
|
132
|
+
*
|
|
133
|
+
* - `0` (between the start of the array and `A`'s original position)
|
|
134
|
+
* - `1` (between `A`'s original position and `B`'s original position)
|
|
135
|
+
* - `2` (between `B`'s original position and `C`'s original position)
|
|
136
|
+
* - `3` (between `C`'s original position and the end of the array)
|
|
137
|
+
*
|
|
138
|
+
* So moving `A` between `B` and `C` would require `destinationGap` to be `2`.
|
|
139
|
+
*
|
|
140
|
+
* This interpretation of `destinationGap` makes it easy to specify the desired destination relative to a sibling item that is not being moved,
|
|
141
|
+
* or relative to the start or end of the array:
|
|
142
|
+
*
|
|
143
|
+
* - Move to the start of the array: `array.moveToIndex(0, ...)` (see also `moveToStart`)
|
|
144
|
+
* - Move to before some item X: `array.moveToIndex(indexOfX, ...)`
|
|
145
|
+
* - Move to after some item X: `array.moveToIndex(indexOfX + 1`, ...)
|
|
146
|
+
* - Move to the end of the array: `array.moveToIndex(array.length, ...)` (see also `moveToEnd`)
|
|
147
|
+
*
|
|
148
|
+
* This interpretation of `destinationGap` does however make it less obvious how to move an item relative to its current position:
|
|
149
|
+
*
|
|
150
|
+
* - Move item B before its predecessor: `array.moveToIndex(indexOfB - 1, ...)`
|
|
151
|
+
* - Move item B after its successor: `array.moveToIndex(indexOfB + 2, ...)`
|
|
152
|
+
*
|
|
153
|
+
* Notice the asymmetry between `-1` and `+2` in the above examples.
|
|
154
|
+
* In such scenarios, it can often be easier to approach such edits by swapping adjacent items:
|
|
155
|
+
* If items A and B are adjacent, such that A precedes B,
|
|
156
|
+
* then they can be swapped with `array.moveToIndex(indexOfA, indexOfB)`.
|
|
157
|
+
*
|
|
92
158
|
* @param sourceIndex - The index of the item to move.
|
|
93
159
|
* @param source - The source array to move the item out of.
|
|
94
160
|
* @throws Throws if any of the source index is not in the range [0, `array.length`),
|
|
95
161
|
* or if the index is not in the range [0, `array.length`].
|
|
96
162
|
*/
|
|
97
|
-
moveToIndex(
|
|
163
|
+
moveToIndex(destinationGap: number, sourceIndex: number, source: TMoveFrom): void;
|
|
98
164
|
/**
|
|
99
165
|
* Moves the specified items to the start of the array.
|
|
100
166
|
* @param sourceStart - The starting index of the range to move (inclusive).
|
|
@@ -133,24 +199,91 @@ export interface TreeArrayNodeBase<out T, in TNew, in TMoveFrom> extends Readonl
|
|
|
133
199
|
moveRangeToEnd(sourceStart: number, sourceEnd: number, source: TMoveFrom): void;
|
|
134
200
|
/**
|
|
135
201
|
* Moves the specified items to the desired location within the array.
|
|
136
|
-
*
|
|
137
|
-
*
|
|
202
|
+
*
|
|
203
|
+
* WARNING - This API is easily misused.
|
|
204
|
+
* Please read the documentation for the `destinationGap` parameter carefully.
|
|
205
|
+
*
|
|
206
|
+
* @param destinationGap - The location *between* existing items that the moved item should be moved to.
|
|
207
|
+
*
|
|
208
|
+
* WARNING - `destinationGap` describes a location between existing items *prior to applying the move operation*.
|
|
209
|
+
*
|
|
210
|
+
* For example, if the array contains items `[A, B, C]` before the move, the `destinationGap` must be one of the following:
|
|
211
|
+
*
|
|
212
|
+
* - `0` (between the start of the array and `A`'s original position)
|
|
213
|
+
* - `1` (between `A`'s original position and `B`'s original position)
|
|
214
|
+
* - `2` (between `B`'s original position and `C`'s original position)
|
|
215
|
+
* - `3` (between `C`'s original position and the end of the array)
|
|
216
|
+
*
|
|
217
|
+
* So moving `A` between `B` and `C` would require `destinationGap` to be `2`.
|
|
218
|
+
*
|
|
219
|
+
* This interpretation of `destinationGap` makes it easy to specify the desired destination relative to a sibling item that is not being moved,
|
|
220
|
+
* or relative to the start or end of the array:
|
|
221
|
+
*
|
|
222
|
+
* - Move to the start of the array: `array.moveToIndex(0, ...)` (see also `moveToStart`)
|
|
223
|
+
* - Move to before some item X: `array.moveToIndex(indexOfX, ...)`
|
|
224
|
+
* - Move to after some item X: `array.moveToIndex(indexOfX + 1`, ...)
|
|
225
|
+
* - Move to the end of the array: `array.moveToIndex(array.length, ...)` (see also `moveToEnd`)
|
|
226
|
+
*
|
|
227
|
+
* This interpretation of `destinationGap` does however make it less obvious how to move an item relative to its current position:
|
|
228
|
+
*
|
|
229
|
+
* - Move item B before its predecessor: `array.moveToIndex(indexOfB - 1, ...)`
|
|
230
|
+
* - Move item B after its successor: `array.moveToIndex(indexOfB + 2, ...)`
|
|
231
|
+
*
|
|
232
|
+
* Notice the asymmetry between `-1` and `+2` in the above examples.
|
|
233
|
+
* In such scenarios, it can often be easier to approach such edits by swapping adjacent items:
|
|
234
|
+
* If items A and B are adjacent, such that A precedes B,
|
|
235
|
+
* then they can be swapped with `array.moveToIndex(indexOfA, indexOfB)`.
|
|
236
|
+
*
|
|
138
237
|
* @param sourceStart - The starting index of the range to move (inclusive).
|
|
139
238
|
* @param sourceEnd - The ending index of the range to move (exclusive)
|
|
140
239
|
* @throws Throws if any of the input indices are not in the range [0, `array.length`) or if `sourceStart` is greater than `sourceEnd`.
|
|
141
240
|
* if any of the input indices are not in the range [0, `array.length`], or if `sourceStart` is greater than `sourceEnd`.
|
|
142
241
|
*/
|
|
143
|
-
moveRangeToIndex(
|
|
242
|
+
moveRangeToIndex(destinationGap: number, sourceStart: number, sourceEnd: number): void;
|
|
144
243
|
/**
|
|
145
244
|
* Moves the specified items to the desired location within the array.
|
|
146
|
-
*
|
|
245
|
+
*
|
|
246
|
+
* WARNING - This API is easily misused.
|
|
247
|
+
* Please read the documentation for the `destinationGap` parameter carefully.
|
|
248
|
+
*
|
|
249
|
+
* @param destinationGap - The location *between* existing items that the moved item should be moved to.
|
|
250
|
+
*
|
|
251
|
+
* WARNING - `destinationGap` describes a location between existing items *prior to applying the move operation*.
|
|
252
|
+
*
|
|
253
|
+
* For example, if the array contains items `[A, B, C]` before the move, the `destinationGap` must be one of the following:
|
|
254
|
+
*
|
|
255
|
+
* - `0` (between the start of the array and `A`'s original position)
|
|
256
|
+
* - `1` (between `A`'s original position and `B`'s original position)
|
|
257
|
+
* - `2` (between `B`'s original position and `C`'s original position)
|
|
258
|
+
* - `3` (between `C`'s original position and the end of the array)
|
|
259
|
+
*
|
|
260
|
+
* So moving `A` between `B` and `C` would require `destinationGap` to be `2`.
|
|
261
|
+
*
|
|
262
|
+
* This interpretation of `destinationGap` makes it easy to specify the desired destination relative to a sibling item that is not being moved,
|
|
263
|
+
* or relative to the start or end of the array:
|
|
264
|
+
*
|
|
265
|
+
* - Move to the start of the array: `array.moveToIndex(0, ...)` (see also `moveToStart`)
|
|
266
|
+
* - Move to before some item X: `array.moveToIndex(indexOfX, ...)`
|
|
267
|
+
* - Move to after some item X: `array.moveToIndex(indexOfX + 1`, ...)
|
|
268
|
+
* - Move to the end of the array: `array.moveToIndex(array.length, ...)` (see also `moveToEnd`)
|
|
269
|
+
*
|
|
270
|
+
* This interpretation of `destinationGap` does however make it less obvious how to move an item relative to its current position:
|
|
271
|
+
*
|
|
272
|
+
* - Move item B before its predecessor: `array.moveToIndex(indexOfB - 1, ...)`
|
|
273
|
+
* - Move item B after its successor: `array.moveToIndex(indexOfB + 2, ...)`
|
|
274
|
+
*
|
|
275
|
+
* Notice the asymmetry between `-1` and `+2` in the above examples.
|
|
276
|
+
* In such scenarios, it can often be easier to approach such edits by swapping adjacent items:
|
|
277
|
+
* If items A and B are adjacent, such that A precedes B,
|
|
278
|
+
* then they can be swapped with `array.moveToIndex(indexOfA, indexOfB)`.
|
|
279
|
+
*
|
|
147
280
|
* @param sourceStart - The starting index of the range to move (inclusive).
|
|
148
281
|
* @param sourceEnd - The ending index of the range to move (exclusive)
|
|
149
282
|
* @param source - The source array to move items out of.
|
|
150
283
|
* @throws Throws if the types of any of the items being moved are not allowed in the destination array,
|
|
151
284
|
* if any of the input indices are not in the range [0, `array.length`], or if `sourceStart` is greater than `sourceEnd`.
|
|
152
285
|
*/
|
|
153
|
-
moveRangeToIndex(
|
|
286
|
+
moveRangeToIndex(destinationGap: number, sourceStart: number, sourceEnd: number, source: TMoveFrom): void;
|
|
154
287
|
/**
|
|
155
288
|
* Returns a custom IterableIterator which throws usage errors if concurrent editing and iteration occurs.
|
|
156
289
|
*/
|
|
@@ -208,5 +341,5 @@ export declare function asIndex(key: string | symbol, exclusiveMax: number): num
|
|
|
208
341
|
*
|
|
209
342
|
* @param name - Unique identifier for this schema including the factory's scope.
|
|
210
343
|
*/
|
|
211
|
-
export declare function arraySchema<TName extends string, const T extends ImplicitAllowedTypes, const ImplicitlyConstructable extends boolean>(identifier: TName, info: T, implicitlyConstructable: ImplicitlyConstructable, customizable: boolean):
|
|
344
|
+
export declare function arraySchema<TName extends string, const T extends ImplicitAllowedTypes, const ImplicitlyConstructable extends boolean>(identifier: TName, info: T, implicitlyConstructable: ImplicitlyConstructable, customizable: boolean): TreeNodeSchemaBoth<TName, NodeKind.Array, TreeArrayNode<T> & WithType<TName, NodeKind.Array, unknown>, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>, ImplicitlyConstructable, T>;
|
|
212
345
|
//# sourceMappingURL=arrayNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrayNode.d.ts","sourceRoot":"","sources":["../../src/simple-tree/arrayNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"arrayNode.d.ts","sourceRoot":"","sources":["../../src/simple-tree/arrayNode.ts"],"names":[],"mappings":"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"}
|
|
@@ -17,12 +17,13 @@ const index_js_1 = require("../core/index.js");
|
|
|
17
17
|
const index_js_2 = require("../feature-libraries/index.js");
|
|
18
18
|
const proxies_js_1 = require("./proxies.js");
|
|
19
19
|
const proxyBinding_js_1 = require("./proxyBinding.js");
|
|
20
|
+
const schemaTypes_js_1 = require("./schemaTypes.js");
|
|
20
21
|
const index_js_3 = require("./core/index.js");
|
|
21
22
|
const toMapTree_js_1 = require("./toMapTree.js");
|
|
22
23
|
const index_js_4 = require("../util/index.js");
|
|
23
|
-
const toFlexSchema_js_1 = require("./toFlexSchema.js");
|
|
24
24
|
const index_js_5 = require("./core/index.js");
|
|
25
25
|
const treeNodeValid_js_1 = require("./treeNodeValid.js");
|
|
26
|
+
const createContext_js_1 = require("./createContext.js");
|
|
26
27
|
/**
|
|
27
28
|
* A {@link TreeNode} which implements 'readonly T[]' and the array mutation APIs.
|
|
28
29
|
* @public
|
|
@@ -185,7 +186,7 @@ function createArrayNodeProxy(allowAdditionalProperties, proxyTarget, dispatchTa
|
|
|
185
186
|
}
|
|
186
187
|
const maybeContent = field.at(maybeIndex);
|
|
187
188
|
return (0, index_js_2.isFlexTreeNode)(maybeContent)
|
|
188
|
-
? (0,
|
|
189
|
+
? (0, index_js_3.getOrCreateNodeFromInnerNode)(maybeContent)
|
|
189
190
|
: maybeContent;
|
|
190
191
|
},
|
|
191
192
|
set: (target, key, newValue, receiver) => {
|
|
@@ -237,7 +238,7 @@ function createArrayNodeProxy(allowAdditionalProperties, proxyTarget, dispatchTa
|
|
|
237
238
|
// To satisfy 'deepEquals' level scrutiny, the property descriptor for indexed properties must
|
|
238
239
|
// be a simple value property (as opposed to using getter) and declared writable/enumerable/configurable.
|
|
239
240
|
return {
|
|
240
|
-
value: (0, index_js_2.isFlexTreeNode)(val) ? (0,
|
|
241
|
+
value: (0, index_js_2.isFlexTreeNode)(val) ? (0, index_js_3.getOrCreateNodeFromInnerNode)(val) : val,
|
|
241
242
|
writable: true, // For MVP, setting indexed properties is reported as allowed here (for deep equals compatibility noted above), but not actually supported.
|
|
242
243
|
enumerable: true,
|
|
243
244
|
configurable: true,
|
|
@@ -308,7 +309,7 @@ class CustomArrayNodeBase extends TreeNodeWithArrayFeatures {
|
|
|
308
309
|
if (val === undefined) {
|
|
309
310
|
return val;
|
|
310
311
|
}
|
|
311
|
-
return (0,
|
|
312
|
+
return (0, index_js_3.getOrCreateNodeFromInnerNode)(val);
|
|
312
313
|
}
|
|
313
314
|
insertAt(index, ...value) {
|
|
314
315
|
const field = getSequenceField(this);
|
|
@@ -352,13 +353,13 @@ class CustomArrayNodeBase extends TreeNodeWithArrayFeatures {
|
|
|
352
353
|
validateIndex(sourceIndex, sourceField, "moveToEnd");
|
|
353
354
|
this.moveRangeToIndex(this.length, sourceIndex, sourceIndex + 1, source);
|
|
354
355
|
}
|
|
355
|
-
moveToIndex(
|
|
356
|
+
moveToIndex(destinationGap, sourceIndex, source) {
|
|
356
357
|
const sourceArray = source ?? this;
|
|
357
358
|
const sourceField = getSequenceField(sourceArray);
|
|
358
359
|
const destinationField = getSequenceField(this);
|
|
359
|
-
validateIndex(
|
|
360
|
+
validateIndex(destinationGap, destinationField, "moveToIndex", true);
|
|
360
361
|
validateIndex(sourceIndex, sourceField, "moveToIndex");
|
|
361
|
-
this.moveRangeToIndex(
|
|
362
|
+
this.moveRangeToIndex(destinationGap, sourceIndex, sourceIndex + 1, source);
|
|
362
363
|
}
|
|
363
364
|
moveRangeToStart(sourceStart, sourceEnd, source) {
|
|
364
365
|
validateIndexRange(sourceStart, sourceEnd, source ?? getSequenceField(this), "moveRangeToStart");
|
|
@@ -368,30 +369,35 @@ class CustomArrayNodeBase extends TreeNodeWithArrayFeatures {
|
|
|
368
369
|
validateIndexRange(sourceStart, sourceEnd, source ?? getSequenceField(this), "moveRangeToEnd");
|
|
369
370
|
this.moveRangeToIndex(this.length, sourceStart, sourceEnd, source);
|
|
370
371
|
}
|
|
371
|
-
moveRangeToIndex(
|
|
372
|
+
moveRangeToIndex(destinationGap, sourceStart, sourceEnd, source) {
|
|
372
373
|
const destinationField = getSequenceField(this);
|
|
374
|
+
const destinationSchema = this.allowedTypes;
|
|
373
375
|
const sourceField = source !== undefined ? getSequenceField(source) : destinationField;
|
|
374
|
-
validateIndex(
|
|
376
|
+
validateIndex(destinationGap, destinationField, "moveRangeToIndex", true);
|
|
375
377
|
validateIndexRange(sourceStart, sourceEnd, source ?? destinationField, "moveRangeToIndex");
|
|
376
378
|
// TODO: determine support for move across different sequence types
|
|
377
379
|
if (sourceField !== destinationField) {
|
|
378
380
|
for (let i = sourceStart; i < sourceEnd; i++) {
|
|
379
381
|
const sourceNode = sourceField.boxedAt(i) ?? (0, internal_1.oob)();
|
|
380
|
-
|
|
382
|
+
const sourceSchema = (0, index_js_3.getSimpleNodeSchemaFromInnerNode)(sourceNode);
|
|
383
|
+
if (!destinationSchema.has(sourceSchema)) {
|
|
381
384
|
throw new internal_2.UsageError("Type in source sequence is not allowed in destination.");
|
|
382
385
|
}
|
|
383
386
|
}
|
|
384
387
|
}
|
|
385
388
|
const movedCount = sourceEnd - sourceStart;
|
|
386
389
|
if (!destinationField.context.isHydrated()) {
|
|
387
|
-
if (!(
|
|
390
|
+
if (!(sourceField instanceof index_js_5.UnhydratedTreeSequenceField)) {
|
|
388
391
|
throw new internal_2.UsageError("Cannot move elements from an unhydrated array to a hydrated array.");
|
|
389
392
|
}
|
|
390
|
-
if (sourceField
|
|
391
|
-
|
|
393
|
+
if (sourceField.context.isHydrated()) {
|
|
394
|
+
throw new internal_2.UsageError("Cannot move elements from an unhydrated array to a hydrated array.");
|
|
395
|
+
}
|
|
396
|
+
if (sourceField !== destinationField || destinationGap < sourceStart) {
|
|
397
|
+
destinationField.editor.insert(destinationGap, sourceField.editor.remove(sourceStart, movedCount));
|
|
392
398
|
}
|
|
393
|
-
else if (
|
|
394
|
-
destinationField.editor.insert(
|
|
399
|
+
else if (destinationGap > sourceStart + movedCount) {
|
|
400
|
+
destinationField.editor.insert(destinationGap - movedCount, sourceField.editor.remove(sourceStart, movedCount));
|
|
395
401
|
}
|
|
396
402
|
}
|
|
397
403
|
else {
|
|
@@ -401,7 +407,7 @@ class CustomArrayNodeBase extends TreeNodeWithArrayFeatures {
|
|
|
401
407
|
if (sourceField.context !== destinationField.context) {
|
|
402
408
|
throw new internal_2.UsageError("Cannot move elements between two different TreeViews.");
|
|
403
409
|
}
|
|
404
|
-
destinationField.context.checkout.editor.move(sourceField.getFieldPath(), sourceStart, movedCount, destinationField.getFieldPath(),
|
|
410
|
+
destinationField.context.checkout.editor.move(sourceField.getFieldPath(), sourceStart, movedCount, destinationField.getFieldPath(), destinationGap);
|
|
405
411
|
}
|
|
406
412
|
}
|
|
407
413
|
values() {
|
|
@@ -428,7 +434,7 @@ CustomArrayNodeBase.kind = index_js_3.NodeKind.Array;
|
|
|
428
434
|
*/
|
|
429
435
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
430
436
|
function arraySchema(identifier, info, implicitlyConstructable, customizable) {
|
|
431
|
-
|
|
437
|
+
const lazyChildTypes = new internal_1.Lazy(() => (0, schemaTypes_js_1.normalizeAllowedTypes)(info));
|
|
432
438
|
let unhydratedContext;
|
|
433
439
|
// This class returns a proxy from its constructor to handle numeric indexing.
|
|
434
440
|
// Alternatively it could extend a normal class which gets tons of numeric properties added.
|
|
@@ -448,12 +454,11 @@ function arraySchema(identifier, info, implicitlyConstructable, customizable) {
|
|
|
448
454
|
return createArrayNodeProxy(customizable, proxyTarget, instance);
|
|
449
455
|
}
|
|
450
456
|
static buildRawNode(instance, input) {
|
|
451
|
-
return
|
|
457
|
+
return index_js_5.UnhydratedFlexTreeNode.getOrCreate(unhydratedContext, (0, toMapTree_js_1.mapTreeFromNodeData)(input, this));
|
|
452
458
|
}
|
|
453
459
|
static oneTimeSetup() {
|
|
454
460
|
const schema = this;
|
|
455
|
-
|
|
456
|
-
unhydratedContext = new index_js_2.UnhydratedContext((0, toFlexSchema_js_1.toFlexSchema)(schema));
|
|
461
|
+
unhydratedContext = (0, createContext_js_1.getUnhydratedContext)(schema);
|
|
457
462
|
// First run, do extra validation.
|
|
458
463
|
// TODO: provide a way for TreeConfiguration to trigger this same validation to ensure it gets run early.
|
|
459
464
|
// Scan for shadowing inherited members which won't work, but stop scan early to allow shadowing built in (which seems to work ok).
|
|
@@ -475,6 +480,10 @@ function arraySchema(identifier, info, implicitlyConstructable, customizable) {
|
|
|
475
480
|
prototype = Reflect.getPrototypeOf(prototype);
|
|
476
481
|
}
|
|
477
482
|
}
|
|
483
|
+
return unhydratedContext;
|
|
484
|
+
}
|
|
485
|
+
static get childTypes() {
|
|
486
|
+
return lazyChildTypes.value;
|
|
478
487
|
}
|
|
479
488
|
// eslint-disable-next-line import/no-deprecated
|
|
480
489
|
get [index_js_3.typeNameSymbol]() {
|
|
@@ -486,6 +495,9 @@ function arraySchema(identifier, info, implicitlyConstructable, customizable) {
|
|
|
486
495
|
get simpleSchema() {
|
|
487
496
|
return info;
|
|
488
497
|
}
|
|
498
|
+
get allowedTypes() {
|
|
499
|
+
return lazyChildTypes.value;
|
|
500
|
+
}
|
|
489
501
|
}
|
|
490
502
|
Schema.constructorCached = undefined;
|
|
491
503
|
Schema.identifier = identifier;
|