@fluidframework/tree 2.50.0 → 2.51.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/.eslintrc.cjs +3 -2
- package/.vscode/Tree.code-workspace +14 -1
- package/.vscode/settings.json +16 -0
- package/CHANGELOG.md +51 -2
- package/api-report/tree.alpha.api.md +7 -7
- package/dist/core/schema-stored/schema.d.ts +14 -1
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js +3 -0
- package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +7 -2
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +4 -4
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/index.d.ts +1 -0
- package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/index.js +3 -1
- package/dist/feature-libraries/flex-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +5 -5
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts +3 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +5 -3
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +3 -4
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +2 -2
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +3 -8
- 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 +0 -3
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +0 -1
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +1 -8
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/index.d.ts +0 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +1 -3
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts +1 -1
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +7 -10
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +11 -13
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +60 -83
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeTypes.d.ts +1 -1
- package/dist/shared-tree/sharedTreeChangeTypes.js.map +1 -1
- package/dist/shared-tree/tree.d.ts.map +1 -1
- package/dist/shared-tree/tree.js +4 -3
- package/dist/shared-tree/tree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +7 -1
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +7 -2
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +4 -1
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/simple-tree/api/conciseTree.d.ts +1 -1
- package/dist/simple-tree/api/conciseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/conciseTree.js.map +1 -1
- package/dist/simple-tree/api/configuration.d.ts +1 -1
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js +5 -5
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/create.d.ts +3 -1
- package/dist/simple-tree/api/create.d.ts.map +1 -1
- package/dist/simple-tree/api/create.js +2 -0
- package/dist/simple-tree/api/create.js.map +1 -1
- package/dist/simple-tree/api/customTree.d.ts +1 -2
- package/dist/simple-tree/api/customTree.d.ts.map +1 -1
- package/dist/simple-tree/api/customTree.js.map +1 -1
- package/dist/simple-tree/api/getJsonSchema.d.ts +1 -1
- package/dist/simple-tree/api/getJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/getSimpleSchema.d.ts +1 -1
- package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/dist/simple-tree/api/identifierIndex.d.ts +1 -1
- package/dist/simple-tree/api/identifierIndex.js +2 -2
- package/dist/simple-tree/api/identifierIndex.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +1 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +4 -19
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js +31 -82
- package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts +14 -2
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.js +41 -4
- package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +36 -3
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +18 -18
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +16 -16
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +2 -2
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js +2 -2
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +4 -4
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +2 -2
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.d.ts +2 -2
- package/dist/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.js +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +2 -2
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +2 -1
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeBeta.d.ts +4 -1
- package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/treeBeta.js.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.d.ts +1 -2
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +3 -3
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +2 -3
- package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.d.ts +2 -1
- package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +2 -2
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.d.ts +316 -0
- package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -0
- package/dist/simple-tree/core/allowedTypes.js +173 -0
- package/dist/simple-tree/core/allowedTypes.js.map +1 -0
- package/dist/simple-tree/core/context.d.ts +3 -9
- package/dist/simple-tree/core/context.d.ts.map +1 -1
- package/dist/simple-tree/core/context.js +3 -11
- package/dist/simple-tree/core/context.js.map +1 -1
- package/dist/simple-tree/core/flexList.d.ts.map +1 -0
- package/dist/simple-tree/core/flexList.js.map +1 -0
- package/dist/simple-tree/core/getOrCreateNode.d.ts +1 -1
- package/dist/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
- package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +9 -3
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +19 -3
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts +8 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +24 -20
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +182 -39
- package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js +47 -17
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/{lib/simple-tree → dist/simple-tree/core}/treeNodeValid.d.ts +18 -4
- package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -0
- package/dist/simple-tree/{treeNodeValid.js → core/treeNodeValid.js} +41 -11
- package/dist/simple-tree/core/treeNodeValid.js.map +1 -0
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/core/walkSchema.d.ts +2 -1
- package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/walkSchema.js +6 -2
- package/dist/simple-tree/core/walkSchema.js.map +1 -1
- package/dist/simple-tree/createContext.d.ts +6 -2
- package/dist/simple-tree/createContext.d.ts.map +1 -1
- package/dist/simple-tree/createContext.js +15 -3
- package/dist/simple-tree/createContext.js.map +1 -1
- package/dist/{feature-libraries/modular-schema → simple-tree}/discrepancies.d.ts +22 -29
- package/dist/simple-tree/discrepancies.d.ts.map +1 -0
- package/dist/simple-tree/discrepancies.js +382 -0
- package/dist/simple-tree/discrepancies.js.map +1 -0
- package/dist/simple-tree/fieldSchema.d.ts +423 -0
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -0
- package/dist/simple-tree/{schemaTypes.js → fieldSchema.js} +5 -195
- package/dist/simple-tree/fieldSchema.js.map +1 -0
- package/dist/simple-tree/index.d.ts +7 -6
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +17 -11
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +14 -5
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +117 -2
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +3 -4
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +97 -26
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +2 -2
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/common.d.ts +16 -0
- package/dist/simple-tree/node-kinds/common.d.ts.map +1 -0
- package/dist/simple-tree/node-kinds/common.js +42 -0
- package/dist/simple-tree/node-kinds/common.js.map +1 -0
- package/dist/simple-tree/node-kinds/index.d.ts +1 -1
- package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts +2 -3
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +64 -26
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +2 -2
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/index.d.ts +2 -2
- package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts +19 -5
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +131 -27
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +11 -4
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.d.ts +2 -2
- package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.js +41 -13
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +2 -2
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/dist/simple-tree/prepareForInsertion.d.ts +2 -2
- package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/dist/simple-tree/prepareForInsertion.js +3 -3
- package/dist/simple-tree/prepareForInsertion.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +2 -2
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchema.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +6 -7
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +5 -11
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +25 -395
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/dist/simple-tree/unsafeUnknownSchema.d.ts +52 -0
- package/dist/simple-tree/unsafeUnknownSchema.d.ts.map +1 -0
- package/dist/simple-tree/unsafeUnknownSchema.js +13 -0
- package/dist/simple-tree/unsafeUnknownSchema.js.map +1 -0
- package/dist/simple-tree/walkFieldSchema.d.ts +1 -1
- package/dist/simple-tree/walkFieldSchema.js +2 -2
- package/dist/simple-tree/walkFieldSchema.js.map +1 -1
- package/dist/tableSchema.d.ts +12 -12
- package/dist/treeFactory.d.ts +0 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +0 -1
- package/dist/treeFactory.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +14 -1
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js +3 -0
- package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +7 -2
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +4 -4
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/index.d.ts +1 -0
- package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/index.js +1 -0
- package/lib/feature-libraries/flex-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +6 -6
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts +3 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +3 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +1 -2
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +2 -2
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +2 -2
- 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 +0 -3
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +0 -1
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +0 -1
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/index.d.ts +0 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +0 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts +1 -1
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +5 -8
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +11 -13
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +61 -83
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeTypes.d.ts +1 -1
- package/lib/shared-tree/sharedTreeChangeTypes.js.map +1 -1
- package/lib/shared-tree/tree.d.ts.map +1 -1
- package/lib/shared-tree/tree.js +4 -3
- package/lib/shared-tree/tree.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +7 -1
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +7 -2
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +5 -2
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/simple-tree/api/conciseTree.d.ts +1 -1
- package/lib/simple-tree/api/conciseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/conciseTree.js.map +1 -1
- package/lib/simple-tree/api/configuration.d.ts +1 -1
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js +2 -2
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/create.d.ts +3 -1
- package/lib/simple-tree/api/create.d.ts.map +1 -1
- package/lib/simple-tree/api/create.js +2 -0
- package/lib/simple-tree/api/create.js.map +1 -1
- package/lib/simple-tree/api/customTree.d.ts +1 -2
- package/lib/simple-tree/api/customTree.d.ts.map +1 -1
- package/lib/simple-tree/api/customTree.js.map +1 -1
- package/lib/simple-tree/api/getJsonSchema.d.ts +1 -1
- package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/getJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/getSimpleSchema.d.ts +1 -1
- package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/lib/simple-tree/api/identifierIndex.d.ts +1 -1
- package/lib/simple-tree/api/identifierIndex.js +1 -1
- package/lib/simple-tree/api/identifierIndex.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +1 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +4 -19
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.js +25 -76
- package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts +14 -2
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.js +40 -4
- package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +36 -3
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +2 -2
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +16 -16
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +2 -2
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/simpleTreeIndex.d.ts +2 -2
- package/lib/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleTreeIndex.js +2 -2
- package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +2 -2
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +2 -1
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeBeta.d.ts +4 -1
- package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/treeBeta.js.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.d.ts +1 -2
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +2 -2
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +2 -3
- package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.d.ts +2 -1
- package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.d.ts +316 -0
- package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -0
- package/lib/simple-tree/core/allowedTypes.js +162 -0
- package/lib/simple-tree/core/allowedTypes.js.map +1 -0
- package/lib/simple-tree/core/context.d.ts +3 -9
- package/lib/simple-tree/core/context.d.ts.map +1 -1
- package/lib/simple-tree/core/context.js +0 -8
- package/lib/simple-tree/core/context.js.map +1 -1
- package/lib/simple-tree/core/flexList.d.ts.map +1 -0
- package/lib/simple-tree/core/flexList.js.map +1 -0
- package/lib/simple-tree/core/getOrCreateNode.d.ts +1 -1
- package/lib/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
- package/lib/simple-tree/core/getOrCreateNode.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +9 -3
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +6 -3
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts +8 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +10 -6
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +182 -39
- package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js +44 -14
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/{dist/simple-tree → lib/simple-tree/core}/treeNodeValid.d.ts +18 -4
- package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -0
- package/lib/simple-tree/{treeNodeValid.js → core/treeNodeValid.js} +31 -3
- package/lib/simple-tree/core/treeNodeValid.js.map +1 -0
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/core/walkSchema.d.ts +2 -1
- package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/walkSchema.js +7 -3
- package/lib/simple-tree/core/walkSchema.js.map +1 -1
- package/lib/simple-tree/createContext.d.ts +6 -2
- package/lib/simple-tree/createContext.d.ts.map +1 -1
- package/lib/simple-tree/createContext.js +13 -2
- package/lib/simple-tree/createContext.js.map +1 -1
- package/lib/{feature-libraries/modular-schema → simple-tree}/discrepancies.d.ts +22 -29
- package/lib/simple-tree/discrepancies.d.ts.map +1 -0
- package/lib/simple-tree/discrepancies.js +376 -0
- package/lib/simple-tree/discrepancies.js.map +1 -0
- package/lib/simple-tree/fieldSchema.d.ts +423 -0
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -0
- package/lib/simple-tree/{schemaTypes.js → fieldSchema.js} +3 -183
- package/lib/simple-tree/fieldSchema.js.map +1 -0
- package/lib/simple-tree/index.d.ts +7 -6
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +4 -3
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts +14 -5
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +117 -3
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +3 -4
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +86 -15
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +2 -2
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
- package/lib/simple-tree/node-kinds/common.d.ts +16 -0
- package/lib/simple-tree/node-kinds/common.d.ts.map +1 -0
- package/lib/simple-tree/node-kinds/common.js +38 -0
- package/lib/simple-tree/node-kinds/common.js.map +1 -0
- package/lib/simple-tree/node-kinds/index.d.ts +1 -1
- package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts +2 -3
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +51 -13
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +2 -2
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.js +1 -1
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/index.d.ts +2 -2
- package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts +19 -5
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +116 -14
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +11 -4
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.js +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.d.ts +2 -2
- package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.js +40 -12
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +2 -2
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.js +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/lib/simple-tree/prepareForInsertion.d.ts +2 -2
- package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/lib/simple-tree/prepareForInsertion.js +2 -2
- package/lib/simple-tree/prepareForInsertion.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +2 -2
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +2 -3
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +5 -11
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +10 -381
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/lib/simple-tree/unsafeUnknownSchema.d.ts +52 -0
- package/lib/simple-tree/unsafeUnknownSchema.d.ts.map +1 -0
- package/lib/simple-tree/unsafeUnknownSchema.js +10 -0
- package/lib/simple-tree/unsafeUnknownSchema.js.map +1 -0
- package/lib/simple-tree/walkFieldSchema.d.ts +1 -1
- package/lib/simple-tree/walkFieldSchema.js +1 -1
- package/lib/simple-tree/walkFieldSchema.js.map +1 -1
- package/lib/tableSchema.d.ts +12 -12
- package/lib/treeFactory.d.ts +0 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +0 -1
- package/lib/treeFactory.js.map +1 -1
- package/package.json +22 -23
- package/src/core/schema-stored/schema.ts +14 -1
- package/src/feature-libraries/default-schema/schemaChecker.ts +3 -0
- package/src/feature-libraries/flex-tree/context.ts +10 -5
- package/src/feature-libraries/flex-tree/index.ts +2 -0
- package/src/feature-libraries/flex-tree/lazyField.ts +10 -6
- package/src/feature-libraries/flex-tree/lazyNode.ts +6 -1
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -2
- package/src/feature-libraries/index.ts +1 -15
- package/src/feature-libraries/modular-schema/comparison.ts +0 -4
- package/src/feature-libraries/modular-schema/index.ts +0 -17
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/index.ts +0 -2
- package/src/shared-tree/schematizeTree.ts +5 -9
- package/src/shared-tree/schematizingTreeView.ts +75 -113
- package/src/shared-tree/sharedTreeChangeTypes.ts +1 -1
- package/src/shared-tree/tree.ts +4 -3
- package/src/shared-tree/treeAlpha.ts +7 -1
- package/src/shared-tree/treeCheckout.ts +15 -2
- package/src/simple-tree/api/conciseTree.ts +1 -2
- package/src/simple-tree/api/configuration.ts +7 -4
- package/src/simple-tree/api/create.ts +3 -1
- package/src/simple-tree/api/customTree.ts +1 -2
- package/src/simple-tree/api/getJsonSchema.ts +1 -1
- package/src/simple-tree/api/getSimpleSchema.ts +1 -1
- package/src/simple-tree/api/identifierIndex.ts +1 -1
- package/src/simple-tree/api/index.ts +2 -0
- package/src/simple-tree/api/schemaCompatibilityTester.ts +38 -128
- package/src/simple-tree/api/schemaCreationUtilities.ts +50 -5
- package/src/simple-tree/api/schemaFactory.ts +45 -10
- package/src/simple-tree/api/schemaFactoryAlpha.ts +4 -7
- package/src/simple-tree/api/schemaFactoryRecursive.ts +9 -4
- package/src/simple-tree/api/schemaFromSimple.ts +2 -3
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -1
- package/src/simple-tree/api/simpleTreeIndex.ts +8 -3
- package/src/simple-tree/api/storedSchema.ts +1 -2
- package/src/simple-tree/api/tree.ts +2 -2
- package/src/simple-tree/api/treeBeta.ts +4 -1
- package/src/simple-tree/api/treeNodeApi.ts +5 -8
- package/src/simple-tree/api/typesUnsafe.ts +5 -4
- package/src/simple-tree/api/verboseTree.ts +3 -6
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +1 -1
- package/src/simple-tree/core/README.md +1 -1
- package/src/simple-tree/core/allowedTypes.ts +496 -0
- package/src/simple-tree/core/context.ts +3 -10
- package/src/simple-tree/core/getOrCreateNode.ts +1 -1
- package/src/simple-tree/core/index.ts +62 -9
- package/src/simple-tree/core/treeNodeKernel.ts +12 -6
- package/src/simple-tree/core/treeNodeSchema.ts +247 -63
- package/src/simple-tree/{treeNodeValid.ts → core/treeNodeValid.ts} +59 -15
- package/src/simple-tree/core/unhydratedFlexTree.ts +1 -1
- package/src/simple-tree/core/walkSchema.ts +9 -5
- package/src/simple-tree/createContext.ts +26 -2
- package/src/simple-tree/discrepancies.ts +648 -0
- package/src/simple-tree/fieldSchema.ts +734 -0
- package/src/simple-tree/index.ts +41 -31
- package/src/simple-tree/leafNodeSchema.ts +137 -5
- package/src/simple-tree/node-kinds/array/arrayNode.ts +141 -30
- package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +5 -7
- package/src/simple-tree/node-kinds/common.ts +60 -0
- package/src/simple-tree/node-kinds/index.ts +2 -0
- package/src/simple-tree/node-kinds/map/mapNode.ts +91 -33
- package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +5 -7
- package/src/simple-tree/node-kinds/object/index.ts +2 -0
- package/src/simple-tree/node-kinds/object/objectNode.ts +205 -25
- package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +22 -5
- package/src/simple-tree/node-kinds/record/recordNode.ts +68 -26
- package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +6 -8
- package/src/simple-tree/prepareForInsertion.ts +7 -6
- package/src/simple-tree/simpleSchema.ts +2 -2
- package/src/simple-tree/toStoredSchema.ts +2 -3
- package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +12 -494
- package/src/simple-tree/unsafeUnknownSchema.ts +70 -0
- package/src/simple-tree/walkFieldSchema.ts +1 -1
- package/src/treeFactory.ts +0 -1
- package/dist/feature-libraries/modular-schema/discrepancies.d.ts.map +0 -1
- package/dist/feature-libraries/modular-schema/discrepancies.js +0 -361
- package/dist/feature-libraries/modular-schema/discrepancies.js.map +0 -1
- package/dist/shared-tree/checkoutFlexTreeView.d.ts +0 -58
- package/dist/shared-tree/checkoutFlexTreeView.d.ts.map +0 -1
- package/dist/shared-tree/checkoutFlexTreeView.js +0 -77
- package/dist/shared-tree/checkoutFlexTreeView.js.map +0 -1
- package/dist/simple-tree/flexList.d.ts.map +0 -1
- package/dist/simple-tree/flexList.js.map +0 -1
- package/dist/simple-tree/schemaTypes.d.ts +0 -856
- package/dist/simple-tree/schemaTypes.d.ts.map +0 -1
- package/dist/simple-tree/schemaTypes.js.map +0 -1
- package/dist/simple-tree/treeNodeValid.d.ts.map +0 -1
- package/dist/simple-tree/treeNodeValid.js.map +0 -1
- package/lib/feature-libraries/modular-schema/discrepancies.d.ts.map +0 -1
- package/lib/feature-libraries/modular-schema/discrepancies.js +0 -354
- package/lib/feature-libraries/modular-schema/discrepancies.js.map +0 -1
- package/lib/shared-tree/checkoutFlexTreeView.d.ts +0 -58
- package/lib/shared-tree/checkoutFlexTreeView.d.ts.map +0 -1
- package/lib/shared-tree/checkoutFlexTreeView.js +0 -72
- package/lib/shared-tree/checkoutFlexTreeView.js.map +0 -1
- package/lib/simple-tree/flexList.d.ts.map +0 -1
- package/lib/simple-tree/flexList.js.map +0 -1
- package/lib/simple-tree/schemaTypes.d.ts +0 -856
- package/lib/simple-tree/schemaTypes.d.ts.map +0 -1
- package/lib/simple-tree/schemaTypes.js.map +0 -1
- package/lib/simple-tree/treeNodeValid.d.ts.map +0 -1
- package/lib/simple-tree/treeNodeValid.js.map +0 -1
- package/src/feature-libraries/modular-schema/discrepancies.ts +0 -567
- package/src/shared-tree/checkoutFlexTreeView.ts +0 -100
- package/src/simple-tree/schemaTypes.ts +0 -1420
- /package/dist/simple-tree/{flexList.d.ts → core/flexList.d.ts} +0 -0
- /package/dist/simple-tree/{flexList.js → core/flexList.js} +0 -0
- /package/lib/simple-tree/{flexList.d.ts → core/flexList.d.ts} +0 -0
- /package/lib/simple-tree/{flexList.js → core/flexList.js} +0 -0
- /package/src/simple-tree/{flexList.ts → core/flexList.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iEAGiC;AADhC,mHAAA,UAAU,OAAA;AAEX,yDAAmF;AAA1E,gHAAA,WAAW,OAAA;AAAE,uHAAA,kBAAkB,OAAA;AAAE,gHAAA,WAAW,OAAA;AAErD,sDAA6D;AAApD,4GAAA,gBAAgB,OAAA;AACzB,uDAW4B;AAV3B,yHAAA,qBAAqB,OAAA;AACrB,wHAAA,oBAAoB,OAAA;AACpB,qHAAA,iBAAiB,OAAA;AACjB,0HAAA,sBAAsB,OAAA;AAEtB,0HAAA,sBAAsB,OAAA;AACtB,oHAAA,gBAAgB,OAAA;AAKjB,qDAAuD;AAA9C,uGAAA,WAAW,OAAA;AACpB,oDAKiC;AAJhC,4GAAA,gBAAgB,OAAA;AAChB,4GAAA,gBAAgB,OAAA;AAChB,2GAAA,eAAe,OAAA;AACf,4GAAA,gBAAgB,OAAA;AAEjB,2DAO8B;AAN7B,yHAAA,mBAAmB,OAAA;AAEnB,gHAAA,UAAU,OAAA;AACV,qHAAA,eAAe,OAAA;AAEf,0HAAA,oBAAoB,OAAA;AAErB,yDAM6B;AAL5B,8HAAA,yBAAyB,OAAA;AACzB,+HAAA,0BAA0B,OAAA;AAC1B,2HAAA,sBAAsB,OAAA;AACtB,gIAAA,2BAA2B,OAAA;AAC3B,2HAAA,sBAAsB,OAAA;AAGvB,sFAAsF;AACtF,yEAA2D;AA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AAA,uBAAuB,OAAA;AAEhC,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAE1B,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AAErC,oDAIiC;AAFhC,kHAAA,sBAAsB,OAAA;AACtB,+GAAA,mBAAmB,OAAA;AAGpB,uEAAuE;AAA9D,qIAAA,yBAAyB,OAAA;AAElC,iDAO6B;AAL5B,4GAAA,eAAe,OAAA;AACf,uGAAA,UAAU,OAAA;AAMX,6DAAyD;AAAhD,uHAAA,gBAAgB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype DownPath,\n\ttoDownPath,\n} from \"./editableTreeBinder.js\";\nexport { allowsValue, assertAllowedValue, isTreeValue } from \"./valueUtilities.js\";\n\nexport { ForestSummarizer } from \"./forest-summary/index.js\";\nexport {\n\tcursorForMapTreeField,\n\tcursorForMapTreeNode,\n\tmapTreeFromCursor,\n\tmapTreeFieldFromCursor,\n\ttype MinimalMapTreeNodeView,\n\tmapTreeFieldsWithField,\n\tmapTreeWithField,\n\ttype MapTreeFieldViewGeneric,\n\ttype MapTreeNodeViewGeneric,\n\ttype MinimalFieldMap,\n} from \"./mapTreeCursor.js\";\nexport { buildForest } from \"./object-forest/index.js\";\nexport {\n\tSchemaSummarizer,\n\tencodeTreeSchema,\n\tmakeSchemaCodec,\n\tmakeSchemaCodecs,\n} from \"./schema-index/index.js\";\nexport {\n\tstackTreeNodeCursor,\n\ttype CursorAdapter,\n\tprefixPath,\n\tprefixFieldPath,\n\ttype CursorWithNode,\n\tstackTreeFieldCursor,\n} from \"./treeCursorUtils.js\";\nexport {\n\tcursorForJsonableTreeNode,\n\tcursorForJsonableTreeField,\n\tjsonableTreeFromCursor,\n\tjsonableTreeFromFieldCursor,\n\tjsonableTreeFromForest,\n} from \"./treeTextCursor.js\";\n\n// Split this up into separate import and export for compatibility with API-Extractor.\nimport * as SequenceField from \"./sequence-field/index.js\";\nexport { SequenceField };\n\nexport {\n\tisNeverField,\n\tModularEditBuilder,\n\ttype FieldEditDescription as EditDescription,\n\ttype FieldChangeHandler,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype FieldChangeMap,\n\ttype FieldChange,\n\ttype FieldChangeset,\n\ttype ToDelta,\n\ttype ModularChangeset,\n\tmakeModularChangeCodecFamily,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\tallowsRepoSuperset,\n\ttype GenericChangeset,\n\tgenericFieldKind,\n\ttype HasFieldChanges,\n\ttype NodeExistsConstraint,\n\tFieldKindWithEditor,\n\tModularChangeFamily,\n\ttype RelevantRemovedRootsFromChild,\n\tEncodedModularChangeset,\n\tupdateRefreshers,\n\ttype NodeId,\n\ttype FieldChangeEncodingContext,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tisNeverTree,\n} from \"./modular-schema/index.js\";\n\nexport { mapRootChanges } from \"./deltaUtils.js\";\n\nexport {\n\ttype TreeChunk,\n\tchunkTree,\n\tchunkFieldSingle,\n\tbuildChunkedForest,\n\tdefaultChunkPolicy,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tmakeTreeChunker,\n\tmakeFieldBatchCodec,\n\tfluidVersionToFieldBatchCodecWriteVersion,\n\ttype FieldBatchEncodingContext,\n} from \"./chunked-forest/index.js\";\n\nexport {\n\tcompareLocalNodeIdentifiers,\n\tcreateNodeIdentifierManager,\n\tisStableNodeIdentifier,\n\ttype LocalNodeIdentifier,\n\tMockNodeIdentifierManager,\n\ttype NodeIdentifierManager,\n\tnodeKeyTreeIdentifier,\n\ttype StableNodeIdentifier,\n} from \"./node-identifier/index.js\";\n\nexport {\n\tFieldKinds,\n\ttype Required,\n\ttype Optional,\n\ttype Sequence,\n\ttype Identifier,\n\ttype Forbidden,\n\ttype DefaultChangeset,\n\tDefaultChangeFamily,\n\tDefaultEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\tdefaultSchemaPolicy,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tSchemaValidationError,\n\tisNodeInSchema,\n\tisFieldInSchema,\n\tinSchemaOrThrow,\n} from \"./default-schema/index.js\";\n\nexport {\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeContext,\n\ttype FlexTreeHydratedContext,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeEntity,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\tTreeStatus,\n\tContext,\n\ttype FlexTreeNodeEvents,\n\ttype FlexTreeUnknownUnboxed,\n\tisFlexTreeNode,\n\tContextSlot,\n\t// Internal\n\tflexTreeMarker,\n\tassertFlexTreeEntityNotFreed,\n\tflexTreeSlot,\n\tgetSchemaAndPolicy,\n\tLazyEntity,\n\ttreeStatusFromAnchorCache,\n\tindexForAt,\n\tFlexTreeEntityKind,\n\ttype FlexibleNodeContent,\n\ttype FlexibleFieldContent,\n\ttype FlexTreeHydratedContextMinimal,\n\ttype HydratedFlexTreeNode,\n\tgetOrCreateHydratedFlexTreeNode,\n} from \"./flex-tree/index.js\";\n\nexport { TreeCompressionStrategy } from \"./treeCompressionUtils.js\";\n\nexport { valueSchemaAllows } from \"./valueUtilities.js\";\n\nexport { DetachedFieldIndexSummarizer } from \"./detachedFieldIndexSummarizer.js\";\n\nexport {\n\ttype SchemaChange,\n\tmakeSchemaChangeCodecs,\n\tEncodedSchemaChange,\n} from \"./schema-edits/index.js\";\n\nexport { makeMitigatedChangeFamily } from \"./mitigatedChangeFamily.js\";\n\nexport {\n\ttype KeyFinder,\n\tAnchorTreeIndex,\n\thasElement,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n} from \"./indexing/index.js\";\n\nexport { initializeForest } from \"./initializeForest.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comparison.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAIN,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,WAAW,EAEhB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"comparison.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAIN,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,WAAW,EAEhB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,oBAAoB,GAAG,SAAS,EAC1C,QAAQ,EAAE,oBAAoB,GAAG,SAAS,GACxC,OAAO,CAsFT;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,QAAQ,EAAE,WAAW,GAAG,SAAS,EACjC,QAAQ,EAAE,WAAW,GAAG,SAAS,GAC/B,OAAO,CAET;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,qBAAqB,EAC/B,QAAQ,EAAE,qBAAqB,GAC7B,OAAO,CAIT;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CACjD,QAAQ,EAAE,WAAW,EACrB,QAAQ,EAAE,WAAW,GACnB,OAAO,CAOT;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,gBAAgB,GACxB,OAAO,CAqBT;AAED,wBAAgB,cAAc,CAC7B,MAAM,EAAE,qBAAqB,GAAG,SAAS,GACvC,qBAAqB,CAEvB"}
|
|
@@ -10,9 +10,6 @@ const index_js_1 = require("../../core/index.js");
|
|
|
10
10
|
const index_js_2 = require("../../util/index.js");
|
|
11
11
|
const fieldKindWithEditor_js_1 = require("./fieldKindWithEditor.js");
|
|
12
12
|
const isNeverTree_js_1 = require("./isNeverTree.js");
|
|
13
|
-
// TODO:
|
|
14
|
-
// The comparisons in this file seem redundant with those in discrepancies.ts.
|
|
15
|
-
// Rather than both existing, one of which just returns boolean and the other which returns additional details, a simple comparison which returns everything needed should be used.
|
|
16
13
|
/**
|
|
17
14
|
* @returns true iff `superset` is a superset of `original`.
|
|
18
15
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comparison.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AAEnE,kDAU6B;AAC7B,kDAAkD;AAGlD,qEAAsD;AACtD,qDAA+C;AAE/C,QAAQ;AACR,8EAA8E;AAC9E,mLAAmL;AAEnL;;;;;;GAMG;AACH,SAAgB,kBAAkB,CACjC,MAAwB,EACxB,YAA8B,EAC9B,QAA0C,EAC1C,QAA0C;IAE1C,IAAI,IAAA,4BAAW,EAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,IAAA,4BAAW,EAAC,MAAM,EAAE,YAAY,EAAE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CAAC,EAAE,CAAC;YACjF,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAzBD,gDAyBC;AAED,SAAgB,cAAc,CAC7B,MAAyC;IAEzC,OAAO,MAAM,IAAI,iCAAsB,CAAC;AACzC,CAAC;AAJD,wCAIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n\tstoredEmptyFieldSchema,\n} from \"../../core/index.js\";\nimport { compareSets } from \"../../util/index.js\";\n\nimport type { FullSchemaPolicy } from \"./fieldKind.js\";\nimport { withEditor } from \"./fieldKindWithEditor.js\";\nimport { isNeverTree } from \"./isNeverTree.js\";\n\n// TODO:\n// The comparisons in this file seem redundant with those in discrepancies.ts.\n// Rather than both existing, one of which just returns boolean and the other which returns additional details, a simple comparison which returns everything needed should be used.\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * `undefined` TreeNodeStoredSchema means the schema is not present (and thus treated as a NeverTree).\n */\nexport function allowsTreeSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeNodeStoredSchema | undefined,\n\tsuperset: TreeNodeStoredSchema | undefined,\n): boolean {\n\tif (isNeverTree(policy, originalData, original)) {\n\t\treturn true;\n\t}\n\tif (isNeverTree(policy, originalData, superset)) {\n\t\treturn false;\n\t}\n\tassert(original !== undefined, 0x716 /* only never trees have undefined schema */);\n\tassert(superset !== undefined, 0x717 /* only never trees have undefined schema */);\n\tif (original instanceof LeafNodeStoredSchema) {\n\t\tif (superset instanceof LeafNodeStoredSchema) {\n\t\t\treturn allowsValueSuperset(original.leafValue, superset.leafValue);\n\t\t}\n\t\treturn false;\n\t}\n\n\tif (superset instanceof LeafNodeStoredSchema) {\n\t\treturn false;\n\t}\n\n\tassert(\n\t\toriginal instanceof MapNodeStoredSchema || original instanceof ObjectNodeStoredSchema,\n\t\t0x893 /* unsupported node kind */,\n\t);\n\tassert(\n\t\tsuperset instanceof MapNodeStoredSchema || superset instanceof ObjectNodeStoredSchema,\n\t\t0x894 /* unsupported node kind */,\n\t);\n\n\tif (original instanceof MapNodeStoredSchema) {\n\t\tif (superset instanceof MapNodeStoredSchema) {\n\t\t\treturn allowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\tnormalizeField(original.mapFields),\n\t\t\t\tnormalizeField(superset.mapFields),\n\t\t\t);\n\t\t}\n\t\treturn false;\n\t}\n\n\tassert(original instanceof ObjectNodeStoredSchema, 0x895 /* unsupported node kind */);\n\tif (superset instanceof MapNodeStoredSchema) {\n\t\tfor (const [_key, field] of original.objectNodeFields) {\n\t\t\tif (\n\t\t\t\t!allowsFieldSuperset(\n\t\t\t\t\tpolicy,\n\t\t\t\t\toriginalData,\n\t\t\t\t\tnormalizeField(field),\n\t\t\t\t\tnormalizeField(superset.mapFields),\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\tassert(superset instanceof ObjectNodeStoredSchema, 0x896 /* unsupported node kind */);\n\n\treturn compareSets({\n\t\ta: original.objectNodeFields,\n\t\tb: superset.objectNodeFields,\n\t\taExtra: (originalField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(originalField) ??\n\t\t\t\t\tfail(0xb17 /* missing expected field */),\n\t\t\t\tnormalizeField(undefined),\n\t\t\t),\n\t\tbExtra: (supersetField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\tnormalizeField(undefined),\n\t\t\t\tsuperset.objectNodeFields.get(supersetField) ??\n\t\t\t\t\tfail(0xb18 /* missing expected field */),\n\t\t\t),\n\t\tsame: (sameField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(sameField) ?? fail(0xb19 /* missing expected field */),\n\t\t\t\tsuperset.objectNodeFields.get(sameField) ?? fail(0xb1a /* missing expected field */),\n\t\t\t),\n\t});\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsValueSuperset(\n\toriginal: ValueSchema | undefined,\n\tsuperset: ValueSchema | undefined,\n): boolean {\n\treturn original === superset;\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsFieldSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeFieldStoredSchema,\n\tsuperset: TreeFieldStoredSchema,\n): boolean {\n\treturn withEditor(\n\t\tpolicy.fieldKinds.get(original.kind) ?? fail(0xb1b /* missing kind */),\n\t).allowsFieldSuperset(policy, originalData, original.types, superset);\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsTreeSchemaIdentifierSuperset(\n\toriginal: TreeTypeSet,\n\tsuperset: TreeTypeSet,\n): boolean {\n\tfor (const originalType of original) {\n\t\tif (!superset.has(originalType)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * A version of this that assumes a specific root field could be slightly more permissive in some simple cases,\n * however if any extra fields and fields with unconstrained types are reachable,\n * it would have to compare everything anyway.\n */\nexport function allowsRepoSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginal: TreeStoredSchema,\n\tsuperset: TreeStoredSchema,\n): boolean {\n\t{\n\t\t// TODO: I think its ok to use the field from superset here, but I should confirm it is, and document why.\n\t\tif (\n\t\t\t!allowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginal,\n\t\t\t\toriginal.rootFieldSchema,\n\t\t\t\tsuperset.rootFieldSchema,\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\tfor (const [key, schema] of original.nodeSchema) {\n\t\t// TODO: I think its ok to use the tree from superset here, but I should confirm it is, and document why.\n\t\tif (!allowsTreeSuperset(policy, original, schema, superset.nodeSchema.get(key))) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nexport function normalizeField(\n\tschema: TreeFieldStoredSchema | undefined,\n): TreeFieldStoredSchema {\n\treturn schema ?? storedEmptyFieldSchema;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"comparison.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AAEnE,kDAU6B;AAC7B,kDAAkD;AAGlD,qEAAsD;AACtD,qDAA+C;AAE/C;;;;;;GAMG;AACH,SAAgB,kBAAkB,CACjC,MAAwB,EACxB,YAA8B,EAC9B,QAA0C,EAC1C,QAA0C;IAE1C,IAAI,IAAA,4BAAW,EAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,IAAA,4BAAW,EAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;QACjD,OAAO,KAAK,CAAC;IACd,CAAC;IACD,IAAA,iBAAM,EAAC,QAAQ,KAAK,SAAS,EAAE,KAAK,CAAC,4CAA4C,CAAC,CAAC;IACnF,IAAA,iBAAM,EAAC,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I,iCAAsB,CAAC;AACzC,CAAC;AAJD,wCAIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n\tstoredEmptyFieldSchema,\n} from \"../../core/index.js\";\nimport { compareSets } from \"../../util/index.js\";\n\nimport type { FullSchemaPolicy } from \"./fieldKind.js\";\nimport { withEditor } from \"./fieldKindWithEditor.js\";\nimport { isNeverTree } from \"./isNeverTree.js\";\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * `undefined` TreeNodeStoredSchema means the schema is not present (and thus treated as a NeverTree).\n */\nexport function allowsTreeSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeNodeStoredSchema | undefined,\n\tsuperset: TreeNodeStoredSchema | undefined,\n): boolean {\n\tif (isNeverTree(policy, originalData, original)) {\n\t\treturn true;\n\t}\n\tif (isNeverTree(policy, originalData, superset)) {\n\t\treturn false;\n\t}\n\tassert(original !== undefined, 0x716 /* only never trees have undefined schema */);\n\tassert(superset !== undefined, 0x717 /* only never trees have undefined schema */);\n\tif (original instanceof LeafNodeStoredSchema) {\n\t\tif (superset instanceof LeafNodeStoredSchema) {\n\t\t\treturn allowsValueSuperset(original.leafValue, superset.leafValue);\n\t\t}\n\t\treturn false;\n\t}\n\n\tif (superset instanceof LeafNodeStoredSchema) {\n\t\treturn false;\n\t}\n\n\tassert(\n\t\toriginal instanceof MapNodeStoredSchema || original instanceof ObjectNodeStoredSchema,\n\t\t0x893 /* unsupported node kind */,\n\t);\n\tassert(\n\t\tsuperset instanceof MapNodeStoredSchema || superset instanceof ObjectNodeStoredSchema,\n\t\t0x894 /* unsupported node kind */,\n\t);\n\n\tif (original instanceof MapNodeStoredSchema) {\n\t\tif (superset instanceof MapNodeStoredSchema) {\n\t\t\treturn allowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\tnormalizeField(original.mapFields),\n\t\t\t\tnormalizeField(superset.mapFields),\n\t\t\t);\n\t\t}\n\t\treturn false;\n\t}\n\n\tassert(original instanceof ObjectNodeStoredSchema, 0x895 /* unsupported node kind */);\n\tif (superset instanceof MapNodeStoredSchema) {\n\t\tfor (const [_key, field] of original.objectNodeFields) {\n\t\t\tif (\n\t\t\t\t!allowsFieldSuperset(\n\t\t\t\t\tpolicy,\n\t\t\t\t\toriginalData,\n\t\t\t\t\tnormalizeField(field),\n\t\t\t\t\tnormalizeField(superset.mapFields),\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\tassert(superset instanceof ObjectNodeStoredSchema, 0x896 /* unsupported node kind */);\n\n\treturn compareSets({\n\t\ta: original.objectNodeFields,\n\t\tb: superset.objectNodeFields,\n\t\taExtra: (originalField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(originalField) ??\n\t\t\t\t\tfail(0xb17 /* missing expected field */),\n\t\t\t\tnormalizeField(undefined),\n\t\t\t),\n\t\tbExtra: (supersetField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\tnormalizeField(undefined),\n\t\t\t\tsuperset.objectNodeFields.get(supersetField) ??\n\t\t\t\t\tfail(0xb18 /* missing expected field */),\n\t\t\t),\n\t\tsame: (sameField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(sameField) ?? fail(0xb19 /* missing expected field */),\n\t\t\t\tsuperset.objectNodeFields.get(sameField) ?? fail(0xb1a /* missing expected field */),\n\t\t\t),\n\t});\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsValueSuperset(\n\toriginal: ValueSchema | undefined,\n\tsuperset: ValueSchema | undefined,\n): boolean {\n\treturn original === superset;\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsFieldSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeFieldStoredSchema,\n\tsuperset: TreeFieldStoredSchema,\n): boolean {\n\treturn withEditor(\n\t\tpolicy.fieldKinds.get(original.kind) ?? fail(0xb1b /* missing kind */),\n\t).allowsFieldSuperset(policy, originalData, original.types, superset);\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsTreeSchemaIdentifierSuperset(\n\toriginal: TreeTypeSet,\n\tsuperset: TreeTypeSet,\n): boolean {\n\tfor (const originalType of original) {\n\t\tif (!superset.has(originalType)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * A version of this that assumes a specific root field could be slightly more permissive in some simple cases,\n * however if any extra fields and fields with unconstrained types are reachable,\n * it would have to compare everything anyway.\n */\nexport function allowsRepoSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginal: TreeStoredSchema,\n\tsuperset: TreeStoredSchema,\n): boolean {\n\t{\n\t\t// TODO: I think its ok to use the field from superset here, but I should confirm it is, and document why.\n\t\tif (\n\t\t\t!allowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginal,\n\t\t\t\toriginal.rootFieldSchema,\n\t\t\t\tsuperset.rootFieldSchema,\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\tfor (const [key, schema] of original.nodeSchema) {\n\t\t// TODO: I think its ok to use the tree from superset here, but I should confirm it is, and document why.\n\t\tif (!allowsTreeSuperset(policy, original, schema, superset.nodeSchema.get(key))) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nexport function normalizeField(\n\tschema: TreeFieldStoredSchema | undefined,\n): TreeFieldStoredSchema {\n\treturn schema ?? storedEmptyFieldSchema;\n}\n"]}
|
|
@@ -15,5 +15,4 @@ export type { GenericChangeset } from "./genericFieldKindTypes.js";
|
|
|
15
15
|
export { ModularChangeFamily, ModularEditBuilder, type EditDescription, type GlobalEditDescription, type FieldEditDescription, rebaseRevisionMetadataFromInfo, intoDelta, relevantRemovedRoots, updateRefreshers, } from "./modularChangeFamily.js";
|
|
16
16
|
export { makeModularChangeCodecFamily } from "./modularChangeCodecs.js";
|
|
17
17
|
export type { FieldKindConfiguration, FieldKindConfigurationEntry, } from "./fieldKindConfiguration.js";
|
|
18
|
-
export { getAllowedContentDiscrepancies, isRepoSuperset, type AllowedTypeDiscrepancy, type FieldKindDiscrepancy, type ValueSchemaDiscrepancy, type FieldDiscrepancy, type NodeDiscrepancy, type NodeKindDiscrepancy, type NodeFieldsDiscrepancy, type LinearExtension, type Realizer, fieldRealizer, PosetComparisonResult, comparePosetElements, posetLte, } from "./discrepancies.js";
|
|
19
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,kCAAkC,EAClC,mBAAmB,EACnB,kBAAkB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO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ACtB,2BAA2B,GAC3B,MAAM,6BAA6B,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,kCAAkC,EAClC,mBAAmB,EACnB,kBAAkB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACN,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,gBAAgB,EAChB,kBAAkB,GAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,GACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,+BAA+B,EAC/B,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,KAAK,OAAO,EACZ,eAAe,EACf,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,GACzB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACX,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,GACN,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EACN,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,8BAA8B,EAC9B,SAAS,EACT,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AACxE,YAAY,EACX,sBAAsB,EACtB,2BAA2B,GAC3B,MAAM,6BAA6B,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.makeModularChangeCodecFamily = exports.updateRefreshers = exports.relevantRemovedRoots = exports.intoDelta = exports.rebaseRevisionMetadataFromInfo = exports.ModularEditBuilder = exports.ModularChangeFamily = exports.genericFieldKind = exports.genericChangeHandler = exports.convertGenericChange = exports.NodeAttachState = exports.referenceFreeFieldChangeRebaser = exports.FieldKindWithEditor = exports.FlexFieldKind = exports.EncodedNodeChangeset = exports.EncodedModularChangeset = exports.EncodedRevisionInfo = exports.EncodedChangeAtomId = exports.ChangesetLocalIdSchema = exports.setInCrossFieldMap = exports.CrossFieldTarget = exports.addCrossFieldQuery = exports.isNeverTree = exports.isNeverField = exports.allowsTreeSuperset = exports.allowsFieldSuperset = exports.allowsTreeSchemaIdentifierSuperset = exports.allowsRepoSuperset = void 0;
|
|
8
8
|
var comparison_js_1 = require("./comparison.js");
|
|
9
9
|
Object.defineProperty(exports, "allowsRepoSuperset", { enumerable: true, get: function () { return comparison_js_1.allowsRepoSuperset; } });
|
|
10
10
|
Object.defineProperty(exports, "allowsTreeSchemaIdentifierSuperset", { enumerable: true, get: function () { return comparison_js_1.allowsTreeSchemaIdentifierSuperset; } });
|
|
@@ -43,11 +43,4 @@ Object.defineProperty(exports, "relevantRemovedRoots", { enumerable: true, get:
|
|
|
43
43
|
Object.defineProperty(exports, "updateRefreshers", { enumerable: true, get: function () { return modularChangeFamily_js_1.updateRefreshers; } });
|
|
44
44
|
var modularChangeCodecs_js_1 = require("./modularChangeCodecs.js");
|
|
45
45
|
Object.defineProperty(exports, "makeModularChangeCodecFamily", { enumerable: true, get: function () { return modularChangeCodecs_js_1.makeModularChangeCodecFamily; } });
|
|
46
|
-
var discrepancies_js_1 = require("./discrepancies.js");
|
|
47
|
-
Object.defineProperty(exports, "getAllowedContentDiscrepancies", { enumerable: true, get: function () { return discrepancies_js_1.getAllowedContentDiscrepancies; } });
|
|
48
|
-
Object.defineProperty(exports, "isRepoSuperset", { enumerable: true, get: function () { return discrepancies_js_1.isRepoSuperset; } });
|
|
49
|
-
Object.defineProperty(exports, "fieldRealizer", { enumerable: true, get: function () { return discrepancies_js_1.fieldRealizer; } });
|
|
50
|
-
Object.defineProperty(exports, "PosetComparisonResult", { enumerable: true, get: function () { return discrepancies_js_1.PosetComparisonResult; } });
|
|
51
|
-
Object.defineProperty(exports, "comparePosetElements", { enumerable: true, get: function () { return discrepancies_js_1.comparePosetElements; } });
|
|
52
|
-
Object.defineProperty(exports, "posetLte", { enumerable: true, get: function () { return discrepancies_js_1.posetLte; } });
|
|
53
46
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iDAKyB;AAJxB,mHAAA,kBAAkB,OAAA;AAClB,mIAAA,kCAAkC,OAAA;AAClC,oHAAA,mBAAmB,OAAA;AACnB,mHAAA,kBAAkB,OAAA;AAEnB,mDAA6D;AAApD,8GAAA,YAAY,OAAA;AAAE,6GAAA,WAAW,OAAA;AAClC,+DAOgC;AAN/B,0HAAA,kBAAkB,OAAA;AAIlB,wHAAA,gBAAgB,OAAA;AAChB,0HAAA,kBAAkB,OAAA;AAEnB,mEAMkC;AALjC,gIAAA,sBAAsB,OAAA;AACtB,6HAAA,mBAAmB,OAAA;AACnB,6HAAA,mBAAmB,OAAA;AACnB,iIAAA,uBAAuB,OAAA;AACvB,8HAAA,oBAAoB,OAAA;AAErB,+CAAsE;AAA7D,6GAAA,aAAa,OAAA;AACtB,mEAA+D;AAAtD,6HAAA,mBAAmB,OAAA;AAC5B,iEAgBiC;AAPhC,wIAAA,+BAA+B,OAAA;AAI/B,wHAAA,eAAe,OAAA;AAehB,6DAI+B;AAH9B,2HAAA,oBAAoB,OAAA;AACpB,2HAAA,oBAAoB,OAAA;AACpB,uHAAA,gBAAgB,OAAA;AAGjB,mEAUkC;AATjC,6HAAA,mBAAmB,OAAA;AACnB,4HAAA,kBAAkB,OAAA;AAIlB,wIAAA,8BAA8B,OAAA;AAC9B,mHAAA,SAAS,OAAA;AACT,8HAAA,oBAAoB,OAAA;AACpB,0HAAA,gBAAgB,OAAA;AAEjB,mEAAwE;AAA/D,sIAAA,4BAA4B,OAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iDAKyB;AAJxB,mHAAA,kBAAkB,OAAA;AAClB,mIAAA,kCAAkC,OAAA;AAClC,oHAAA,mBAAmB,OAAA;AACnB,mHAAA,kBAAkB,OAAA;AAEnB,mDAA6D;AAApD,8GAAA,YAAY,OAAA;AAAE,6GAAA,WAAW,OAAA;AAClC,+DAOgC;AAN/B,0HAAA,kBAAkB,OAAA;AAIlB,wHAAA,gBAAgB,OAAA;AAChB,0HAAA,kBAAkB,OAAA;AAEnB,mEAMkC;AALjC,gIAAA,sBAAsB,OAAA;AACtB,6HAAA,mBAAmB,OAAA;AACnB,6HAAA,mBAAmB,OAAA;AACnB,iIAAA,uBAAuB,OAAA;AACvB,8HAAA,oBAAoB,OAAA;AAErB,+CAAsE;AAA7D,6GAAA,aAAa,OAAA;AACtB,mEAA+D;AAAtD,6HAAA,mBAAmB,OAAA;AAC5B,iEAgBiC;AAPhC,wIAAA,+BAA+B,OAAA;AAI/B,wHAAA,eAAe,OAAA;AAehB,6DAI+B;AAH9B,2HAAA,oBAAoB,OAAA;AACpB,2HAAA,oBAAoB,OAAA;AACpB,uHAAA,gBAAgB,OAAA;AAGjB,mEAUkC;AATjC,6HAAA,mBAAmB,OAAA;AACnB,4HAAA,kBAAkB,OAAA;AAIlB,wIAAA,8BAA8B,OAAA;AAC9B,mHAAA,SAAS,OAAA;AACT,8HAAA,oBAAoB,OAAA;AACpB,0HAAA,gBAAgB,OAAA;AAEjB,mEAAwE;AAA/D,sIAAA,4BAA4B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tallowsRepoSuperset,\n\tallowsTreeSchemaIdentifierSuperset,\n\tallowsFieldSuperset,\n\tallowsTreeSuperset,\n} from \"./comparison.js\";\nexport { isNeverField, isNeverTree } from \"./isNeverTree.js\";\nexport {\n\taddCrossFieldQuery,\n\ttype CrossFieldManager,\n\ttype CrossFieldMap,\n\ttype CrossFieldQuerySet,\n\tCrossFieldTarget,\n\tsetInCrossFieldMap,\n} from \"./crossFieldQueries.js\";\nexport {\n\tChangesetLocalIdSchema,\n\tEncodedChangeAtomId,\n\tEncodedRevisionInfo,\n\tEncodedModularChangeset,\n\tEncodedNodeChangeset,\n} from \"./modularChangeFormat.js\";\nexport { FlexFieldKind, type FullSchemaPolicy } from \"./fieldKind.js\";\nexport { FieldKindWithEditor } from \"./fieldKindWithEditor.js\";\nexport {\n\ttype FieldChangeHandler,\n\ttype FieldChangeDelta,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\treferenceFreeFieldChangeRebaser,\n\ttype RebaseRevisionMetadata,\n\ttype RelevantRemovedRootsFromChild,\n\ttype ToDelta,\n\tNodeAttachState,\n\ttype FieldChangeEncodingContext,\n\ttype NestedChangesIndices,\n} from \"./fieldChangeHandler.js\";\nexport type {\n\tCrossFieldKey,\n\tCrossFieldKeyRange,\n\tFieldChange,\n\tFieldChangeMap,\n\tFieldChangeset,\n\tHasFieldChanges,\n\tModularChangeset,\n\tNodeExistsConstraint,\n\tNodeId,\n} from \"./modularChangeTypes.js\";\nexport {\n\tconvertGenericChange,\n\tgenericChangeHandler,\n\tgenericFieldKind,\n} from \"./genericFieldKind.js\";\nexport type { GenericChangeset } from \"./genericFieldKindTypes.js\";\nexport {\n\tModularChangeFamily,\n\tModularEditBuilder,\n\ttype EditDescription,\n\ttype GlobalEditDescription,\n\ttype FieldEditDescription,\n\trebaseRevisionMetadataFromInfo,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tupdateRefreshers,\n} from \"./modularChangeFamily.js\";\nexport { makeModularChangeCodecFamily } from \"./modularChangeCodecs.js\";\nexport type {\n\tFieldKindConfiguration,\n\tFieldKindConfigurationEntry,\n} from \"./fieldKindConfiguration.js\";\n"]}
|
package/dist/packageVersion.d.ts
CHANGED
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/tree";
|
|
11
|
-
exports.pkgVersion = "2.
|
|
11
|
+
exports.pkgVersion = "2.51.0";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sBAAsB,CAAC;AACjC,QAAA,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/tree\";\nexport const pkgVersion = \"2.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sBAAsB,CAAC;AACjC,QAAA,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/tree\";\nexport const pkgVersion = \"2.51.0\";\n"]}
|
|
@@ -6,7 +6,6 @@ export { type ITreePrivate, type SharedTreeOptionsInternal, type SharedTreeOptio
|
|
|
6
6
|
export { createTreeCheckout, TreeCheckout, type ITreeCheckout, type CheckoutEvents, type ITreeCheckoutFork, type BranchableTree, type TreeBranchFork, } from "./treeCheckout.js";
|
|
7
7
|
export { type TreeStoredContent } from "./schematizeTree.js";
|
|
8
8
|
export { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
|
|
9
|
-
export { CheckoutFlexTreeView } from "./checkoutFlexTreeView.js";
|
|
10
9
|
export type { ISharedTreeEditor, ISchemaEditor, SharedTreeEditBuilder, } from "./sharedTreeEditBuilder.js";
|
|
11
10
|
export { Tree } from "./tree.js";
|
|
12
11
|
export type { RunTransaction } from "./tree.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,gBAAgB,EAChB,SAAS,EACT,KAAK,UAAU,EACf,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,oBAAoB,EACzB,uBAAuB,GACvB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,kBAAkB,EAClB,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,cAAc,GACnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAEvE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,gBAAgB,EAChB,SAAS,EACT,KAAK,UAAU,EACf,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,oBAAoB,EACzB,uBAAuB,GACvB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,kBAAkB,EAClB,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,cAAc,GACnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAEvE,YAAY,EACX,iBAAiB,EACjB,aAAa,EACb,qBAAqB,GACrB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EACN,SAAS,EACT,KAAK,mBAAmB,GACxB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACN,0BAA0B,EAC1B,KAAK,WAAW,EAChB,eAAe,GACf,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.independentView = exports.independentInitializedView = exports.TreeAlpha = exports.Tree = exports.
|
|
7
|
+
exports.independentView = exports.independentInitializedView = exports.TreeAlpha = exports.Tree = exports.SchematizingSimpleTreeView = exports.TreeCheckout = exports.createTreeCheckout = exports.persistedToSimpleSchema = exports.exportSimpleSchema = exports.ForestTypeReference = exports.ForestTypeExpensiveDebug = exports.ForestTypeOptimized = exports.defaultSharedTreeOptions = exports.buildConfiguredForest = exports.SharedTreeFormatVersion = exports.getBranch = exports.SharedTreeKernel = void 0;
|
|
8
8
|
var sharedTree_js_1 = require("./sharedTree.js");
|
|
9
9
|
Object.defineProperty(exports, "SharedTreeKernel", { enumerable: true, get: function () { return sharedTree_js_1.SharedTreeKernel; } });
|
|
10
10
|
Object.defineProperty(exports, "getBranch", { enumerable: true, get: function () { return sharedTree_js_1.getBranch; } });
|
|
@@ -21,8 +21,6 @@ Object.defineProperty(exports, "createTreeCheckout", { enumerable: true, get: fu
|
|
|
21
21
|
Object.defineProperty(exports, "TreeCheckout", { enumerable: true, get: function () { return treeCheckout_js_1.TreeCheckout; } });
|
|
22
22
|
var schematizingTreeView_js_1 = require("./schematizingTreeView.js");
|
|
23
23
|
Object.defineProperty(exports, "SchematizingSimpleTreeView", { enumerable: true, get: function () { return schematizingTreeView_js_1.SchematizingSimpleTreeView; } });
|
|
24
|
-
var checkoutFlexTreeView_js_1 = require("./checkoutFlexTreeView.js");
|
|
25
|
-
Object.defineProperty(exports, "CheckoutFlexTreeView", { enumerable: true, get: function () { return checkoutFlexTreeView_js_1.CheckoutFlexTreeView; } });
|
|
26
24
|
var tree_js_1 = require("./tree.js");
|
|
27
25
|
Object.defineProperty(exports, "Tree", { enumerable: true, get: function () { return tree_js_1.Tree; } });
|
|
28
26
|
var treeAlpha_js_1 = require("./treeAlpha.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared-tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iDAoByB;AAhBxB,iHAAA,gBAAgB,OAAA;AAChB,0GAAA,SAAS,OAAA;AAIT,wHAAA,uBAAuB,OAAA;AACvB,sHAAA,qBAAqB,OAAA;AACrB,yHAAA,wBAAwB,OAAA;AAGxB,oHAAA,mBAAmB,OAAA;AACnB,yHAAA,wBAAwB,OAAA;AACxB,oHAAA,mBAAmB,OAAA;AACnB,mHAAA,kBAAkB,OAAA;AAElB,wHAAA,uBAAuB,OAAA;AAGxB,qDAQ2B;AAP1B,qHAAA,kBAAkB,OAAA;AAClB,+GAAA,YAAY,OAAA;AAUb,qEAAuE;AAA9D,qIAAA,0BAA0B,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared-tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iDAoByB;AAhBxB,iHAAA,gBAAgB,OAAA;AAChB,0GAAA,SAAS,OAAA;AAIT,wHAAA,uBAAuB,OAAA;AACvB,sHAAA,qBAAqB,OAAA;AACrB,yHAAA,wBAAwB,OAAA;AAGxB,oHAAA,mBAAmB,OAAA;AACnB,yHAAA,wBAAwB,OAAA;AACxB,oHAAA,mBAAmB,OAAA;AACnB,mHAAA,kBAAkB,OAAA;AAElB,wHAAA,uBAAuB,OAAA;AAGxB,qDAQ2B;AAP1B,qHAAA,kBAAkB,OAAA;AAClB,+GAAA,YAAY,OAAA;AAUb,qEAAuE;AAA9D,qIAAA,0BAA0B,OAAA;AAQnC,qCAAiC;AAAxB,+FAAA,IAAI,OAAA;AAGb,+CAGwB;AAFvB,yGAAA,SAAS,OAAA;AAIV,2DAI8B;AAH7B,gIAAA,0BAA0B,OAAA;AAE1B,qHAAA,eAAe,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype ITreePrivate,\n\ttype SharedTreeOptionsInternal,\n\ttype SharedTreeOptions,\n\tSharedTreeKernel,\n\tgetBranch,\n\ttype ForestType,\n\ttype SharedTreeContentSnapshot,\n\ttype SharedTreeFormatOptions,\n\tSharedTreeFormatVersion,\n\tbuildConfiguredForest,\n\tdefaultSharedTreeOptions,\n\ttype ForestOptions,\n\ttype ITreeInternal,\n\tForestTypeOptimized,\n\tForestTypeExpensiveDebug,\n\tForestTypeReference,\n\texportSimpleSchema,\n\ttype SharedTreeKernelView,\n\tpersistedToSimpleSchema,\n} from \"./sharedTree.js\";\n\nexport {\n\tcreateTreeCheckout,\n\tTreeCheckout,\n\ttype ITreeCheckout,\n\ttype CheckoutEvents,\n\ttype ITreeCheckoutFork,\n\ttype BranchableTree,\n\ttype TreeBranchFork,\n} from \"./treeCheckout.js\";\n\nexport { type TreeStoredContent } from \"./schematizeTree.js\";\n\nexport { SchematizingSimpleTreeView } from \"./schematizingTreeView.js\";\n\nexport type {\n\tISharedTreeEditor,\n\tISchemaEditor,\n\tSharedTreeEditBuilder,\n} from \"./sharedTreeEditBuilder.js\";\n\nexport { Tree } from \"./tree.js\";\nexport type { RunTransaction } from \"./tree.js\";\n\nexport {\n\tTreeAlpha,\n\ttype TreeIdentifierUtils,\n} from \"./treeAlpha.js\";\n\nexport {\n\tindependentInitializedView,\n\ttype ViewContent,\n\tindependentView,\n} from \"./independentView.js\";\n\nexport type { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { type ITreeCursorSynchronous, type TreeStoredSchema } from "../core/index.js";
|
|
6
|
-
import type
|
|
6
|
+
import { type SchemaCompatibilityTester } from "../simple-tree/index.js";
|
|
7
7
|
import type { ITreeCheckout } from "./treeCheckout.js";
|
|
8
8
|
/**
|
|
9
9
|
* Modify `storedSchema` and invoke `setInitialTree` when it's time to set the tree content.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schematizeTree.d.ts","sourceRoot":"","sources":["../../src/shared-tree/schematizeTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAEN,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EAGrB,MAAM,kBAAkB,CAAC;AAQ1B,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"schematizeTree.d.ts","sourceRoot":"","sources":["../../src/shared-tree/schematizeTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAEN,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EAGrB,MAAM,kBAAkB,CAAC;AAQ1B,OAAO,EAAkB,KAAK,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAGzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAChC,gBAAgB,EAAE;IACjB,YAAY,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IAC5C,YAAY,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;CAC5C,EACD,SAAS,EAAE,gBAAgB,EAC3B,cAAc,EAAE,MAAM,IAAI,GACxB,IAAI,CA4CN;AAED,oBAAY,UAAU;IACrB;;OAEG;IACH,IAAI,IAAA;IACJ;;OAEG;IACH,gBAAgB,IAAA;IAChB;;OAEG;IACH,YAAY,IAAA;CACZ;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC7B,UAAU,EAAE,yBAAyB,EACrC,QAAQ,EAAE,aAAa,GACrB,UAAU,CAiBZ;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO,CAG9D;AAoBD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,GAAG,IAAI,CAgCxF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAC3B,UAAU,EAAE,yBAAyB,EACrC,QAAQ,EAAE,aAAa,GACrB,OAAO,CAiBT;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAElC;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,SAAS,sBAAsB,EAAE,GAAG,sBAAsB,GAAG,SAAS,CAAC;CAC7F"}
|
|
@@ -8,7 +8,8 @@ exports.ensureSchema = exports.initialize = exports.canInitialize = exports.eval
|
|
|
8
8
|
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
9
9
|
const index_js_1 = require("../core/index.js");
|
|
10
10
|
const index_js_2 = require("../feature-libraries/index.js");
|
|
11
|
-
const index_js_3 = require("../
|
|
11
|
+
const index_js_3 = require("../simple-tree/index.js");
|
|
12
|
+
const index_js_4 = require("../util/index.js");
|
|
12
13
|
/**
|
|
13
14
|
* Modify `storedSchema` and invoke `setInitialTree` when it's time to set the tree content.
|
|
14
15
|
*
|
|
@@ -44,19 +45,15 @@ function initializeContent(schemaRepository, newSchema, setInitialTree) {
|
|
|
44
45
|
},
|
|
45
46
|
};
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
-
// assert(
|
|
49
|
-
// allowsRepoSuperset(defaultSchemaPolicy, tree.storedSchema, incrementalSchemaUpdate),
|
|
50
|
-
// "Incremental Schema update should support the existing empty tree",
|
|
51
|
-
// );
|
|
52
|
-
(0, internal_1.assert)((0, index_js_2.allowsRepoSuperset)(index_js_2.defaultSchemaPolicy, newSchema, incrementalSchemaUpdate), 0x5c9 /* Incremental Schema during update should be a allow a superset of the final schema */);
|
|
48
|
+
(0, internal_1.assert)((0, index_js_2.allowsRepoSuperset)(index_js_2.defaultSchemaPolicy, newSchema, incrementalSchemaUpdate), 0x5c9 /* Incremental Schema during update should allow a superset of the final schema */);
|
|
53
49
|
// Update to intermediate schema
|
|
54
50
|
schemaRepository.updateSchema(incrementalSchemaUpdate);
|
|
55
51
|
// Insert initial tree
|
|
56
52
|
setInitialTree();
|
|
57
53
|
// If intermediate schema is not final desired schema, update to the final schema:
|
|
58
54
|
if (incrementalSchemaUpdate !== newSchema) {
|
|
59
|
-
|
|
55
|
+
// This makes the root more strict, so set allowNonSupersetSchema to true.
|
|
56
|
+
schemaRepository.updateSchema(newSchema, true);
|
|
60
57
|
}
|
|
61
58
|
}
|
|
62
59
|
exports.initializeContent = initializeContent;
|
|
@@ -102,7 +99,7 @@ function normalizeNewFieldContent(content) {
|
|
|
102
99
|
if (content === undefined) {
|
|
103
100
|
return (0, index_js_2.cursorForMapTreeField)([]);
|
|
104
101
|
}
|
|
105
|
-
if ((0,
|
|
102
|
+
if ((0, index_js_4.isReadonlyArray)(content)) {
|
|
106
103
|
return (0, index_js_2.cursorForMapTreeField)(content.map((c) => (0, index_js_2.mapTreeFromCursor)(c)));
|
|
107
104
|
}
|
|
108
105
|
if (content.mode === 1 /* CursorLocationType.Fields */) {
|
|
@@ -171,7 +168,7 @@ function ensureSchema(viewSchema, checkout) {
|
|
|
171
168
|
return false;
|
|
172
169
|
}
|
|
173
170
|
case UpdateType.SchemaCompatible: {
|
|
174
|
-
checkout.updateSchema(viewSchema.
|
|
171
|
+
checkout.updateSchema((0, index_js_3.toStoredSchema)(viewSchema.viewSchemaRoot));
|
|
175
172
|
return true;
|
|
176
173
|
}
|
|
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AC,CAAC,CAAC;YACT,IAAA,0BAAe,EAAC,aAAa,CAAC,CAAC;QAChC,CAAC;IACF,CAAC;AACF,CAAC;AApBD,oCAoBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tCursorLocationType,\n\ttype ITreeCursorSynchronous,\n\ttype TreeStoredSchema,\n\trootFieldKey,\n\tschemaDataIsEmpty,\n} from \"../core/index.js\";\nimport {\n\tFieldKinds,\n\tallowsRepoSuperset,\n\tcursorForMapTreeField,\n\tdefaultSchemaPolicy,\n\tmapTreeFromCursor,\n} from \"../feature-libraries/index.js\";\nimport type { SchemaCompatibilityTester } from \"../simple-tree/index.js\";\nimport { isReadonlyArray } from \"../util/index.js\";\n\nimport type { ITreeCheckout } from \"./treeCheckout.js\";\n\n/**\n * Modify `storedSchema` and invoke `setInitialTree` when it's time to set the tree content.\n *\n * Requires `storedSchema` to be in its default/empty state.\n *\n * This is done in such a way that if the content (implicitly assumed to start empty)\n * is never out of schema.\n * This means that if the root field of the new schema requires content (like a value field),\n * a temporary intermediate schema is used so the initial empty state is not out of schema.\n *\n * Since this makes multiple changes, callers may want to wrap it in a transaction.\n */\nexport function initializeContent(\n\tschemaRepository: {\n\t\tstoredSchema: ITreeCheckout[\"storedSchema\"];\n\t\tupdateSchema: ITreeCheckout[\"updateSchema\"];\n\t},\n\tnewSchema: TreeStoredSchema,\n\tsetInitialTree: () => void,\n): void {\n\tassert(\n\t\tschemaDataIsEmpty(schemaRepository.storedSchema),\n\t\t0x743 /* cannot initialize after a schema is set */,\n\t);\n\n\tconst rootSchema = newSchema.rootFieldSchema;\n\tconst rootKind = rootSchema.kind;\n\n\t// To keep the data in schema during the update, first define a schema that tolerates the current (empty) tree as well as the final (initial) tree.\n\tlet incrementalSchemaUpdate: TreeStoredSchema;\n\tif (\n\t\trootKind === FieldKinds.sequence.identifier ||\n\t\trootKind === FieldKinds.optional.identifier\n\t) {\n\t\t// These kinds are known to tolerate empty, so use the schema as is:\n\t\tincrementalSchemaUpdate = newSchema;\n\t} else {\n\t\tassert(rootKind === FieldKinds.required.identifier, 0x5c8 /* Unexpected kind */);\n\t\t// Replace value kind with optional kind in root field schema:\n\t\tincrementalSchemaUpdate = {\n\t\t\tnodeSchema: newSchema.nodeSchema,\n\t\t\trootFieldSchema: {\n\t\t\t\tkind: FieldKinds.optional.identifier,\n\t\t\t\ttypes: rootSchema.types,\n\t\t\t\tpersistedMetadata: rootSchema.persistedMetadata,\n\t\t\t},\n\t\t};\n\t}\n\n\t// TODO: fix issues with schema comparison and enable this.\n\t// assert(\n\t// \tallowsRepoSuperset(defaultSchemaPolicy, tree.storedSchema, incrementalSchemaUpdate),\n\t// \t\"Incremental Schema update should support the existing empty tree\",\n\t// );\n\tassert(\n\t\tallowsRepoSuperset(defaultSchemaPolicy, newSchema, incrementalSchemaUpdate),\n\t\t0x5c9 /* Incremental Schema during update should be a allow a superset of the final schema */,\n\t);\n\t// Update to intermediate schema\n\tschemaRepository.updateSchema(incrementalSchemaUpdate);\n\t// Insert initial tree\n\tsetInitialTree();\n\n\t// If intermediate schema is not final desired schema, update to the final schema:\n\tif (incrementalSchemaUpdate !== newSchema) {\n\t\tschemaRepository.updateSchema(newSchema);\n\t}\n}\n\nexport enum UpdateType {\n\t/**\n\t * Already compatible, no update needed.\n\t */\n\tNone,\n\t/**\n\t * Schema can be upgraded leaving tree as is.\n\t */\n\tSchemaCompatible,\n\t/**\n\t * No update currently supported.\n\t */\n\tIncompatible,\n}\n\n/**\n * Returns how compatible updating checkout's schema is with the viewSchema.\n */\nexport function evaluateUpdate(\n\tviewSchema: SchemaCompatibilityTester,\n\tcheckout: ITreeCheckout,\n): UpdateType {\n\tconst compatibility = viewSchema.checkCompatibility(checkout.storedSchema);\n\n\tif (compatibility.canUpgrade && compatibility.canView) {\n\t\t// Compatible as is\n\t\treturn UpdateType.None;\n\t}\n\n\tif (!compatibility.canUpgrade) {\n\t\t// Existing stored schema permits trees which are incompatible with the view schema, so schema can not be updated\n\t\treturn UpdateType.Incompatible;\n\t}\n\n\tassert(!compatibility.canView, 0x8bd /* unexpected case */);\n\tassert(compatibility.canUpgrade, 0x8be /* unexpected case */);\n\n\treturn UpdateType.SchemaCompatible;\n}\n\nexport function canInitialize(checkout: ITreeCheckout): boolean {\n\t// Check for empty.\n\treturn checkout.forest.isEmpty && schemaDataIsEmpty(checkout.storedSchema);\n}\n\nfunction normalizeNewFieldContent(\n\tcontent: readonly ITreeCursorSynchronous[] | ITreeCursorSynchronous | undefined,\n): ITreeCursorSynchronous {\n\tif (content === undefined) {\n\t\treturn cursorForMapTreeField([]);\n\t}\n\n\tif (isReadonlyArray(content)) {\n\t\treturn cursorForMapTreeField(content.map((c) => mapTreeFromCursor(c)));\n\t}\n\n\tif (content.mode === CursorLocationType.Fields) {\n\t\treturn content;\n\t}\n\n\treturn cursorForMapTreeField([mapTreeFromCursor(content)]);\n}\n\n/**\n * Initialize a checkout with a schema and tree content.\n * This function should only be called when the tree is uninitialized (no schema or content).\n * @remarks\n *\n * If the proposed schema (from `treeContent`) is not compatible with the empty tree, this function handles using an intermediate schema\n * which supports the empty tree as well as the final tree content.\n */\nexport function initialize(checkout: ITreeCheckout, treeContent: TreeStoredContent): void {\n\tcheckout.transaction.start();\n\ttry {\n\t\tinitializeContent(checkout, treeContent.schema, () => {\n\t\t\tconst field = { field: rootFieldKey, parent: undefined };\n\t\t\tconst content = normalizeNewFieldContent(treeContent.initialTree);\n\t\t\tconst contentChunk = checkout.forest.chunkField(content);\n\n\t\t\tswitch (checkout.storedSchema.rootFieldSchema.kind) {\n\t\t\t\tcase FieldKinds.optional.identifier: {\n\t\t\t\t\tconst fieldEditor = checkout.editor.optionalField(field);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tcontent.getFieldLength() <= 1,\n\t\t\t\t\t\t0x7f4 /* optional field content should normalize at most one item */,\n\t\t\t\t\t);\n\t\t\t\t\tfieldEditor.set(contentChunk.topLevelLength === 0 ? undefined : contentChunk, true);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase FieldKinds.sequence.identifier: {\n\t\t\t\t\tconst fieldEditor = checkout.editor.sequenceField(field);\n\t\t\t\t\t// TODO: should do an idempotent edit here.\n\t\t\t\t\tfieldEditor.insert(0, contentChunk);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tfail(0xac7 /* unexpected root field kind during initialize */);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t} finally {\n\t\tcheckout.transaction.commit();\n\t}\n}\n\n/**\n * Ensure a {@link ITreeCheckout} can be used with a given {@link SchemaCompatibilityTester}.\n *\n * @remarks\n * It is up to the caller to ensure that compatibility is reevaluated if the checkout's stored schema is edited in the future.\n *\n * @param viewSchema - View schema that `checkout` should be made compatible with.\n * @param allowedSchemaModifications - Flags enum describing the ways this is allowed to modify `checkout`.\n * @param checkout - To be modified as needed to be compatible with `viewSchema`.\n * @param treeContent - Content to be used to initialize `checkout`'s the tree if needed and allowed.\n * @returns true iff checkout now is compatible with `viewSchema`.\n */\nexport function ensureSchema(\n\tviewSchema: SchemaCompatibilityTester,\n\tcheckout: ITreeCheckout,\n): boolean {\n\tconst updatedNeeded = evaluateUpdate(viewSchema, checkout);\n\tswitch (updatedNeeded) {\n\t\tcase UpdateType.None: {\n\t\t\treturn true;\n\t\t}\n\t\tcase UpdateType.Incompatible: {\n\t\t\treturn false;\n\t\t}\n\t\tcase UpdateType.SchemaCompatible: {\n\t\t\tcheckout.updateSchema(viewSchema.viewSchemaAsStored);\n\t\t\treturn true;\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(updatedNeeded);\n\t\t}\n\t}\n}\n\n/**\n * Content that can populate a `SharedTree`.\n */\nexport interface TreeStoredContent {\n\treadonly schema: TreeStoredSchema;\n\n\t/**\n\t * Default tree content to initialize the tree with iff the tree is uninitialized\n\t * (meaning it does not even have any schema set at all).\n\t */\n\treadonly initialTree: readonly ITreeCursorSynchronous[] | ITreeCursorSynchronous | undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"schematizeTree.js","sourceRoot":"","sources":["../../src/shared-tree/schematizeTree.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAEpF,+CAM0B;AAC1B,4DAMuC;AACvC,sDAAyF;AACzF,+CAAmD;AAInD;;;;;;;;;;;GAWG;AACH,SAAgB,iBAAiB,CAChC,gBAGC,EACD,SAA2B,EAC3B,cAA0B;IAE1B,IAAA,iBAAM,EACL,IAAA,4BAAiB,EAAC,gBAAgB,CAAC,YAAY,CAAC,EAChD,KAAK,CAAC,6CAA6C,CACnD,CAAC;IAEF,MAAM,UAAU,GAAG,SAAS,CAAC,eAAe,CAAC;IAC7C,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC;IAEjC,mJAAmJ;IACnJ,IAAI,uBAAyC,CAAC;IAC9C,IACC,QAAQ,KAAK,qBAAU,CAAC,QAAQ,CAAC,UAAU;QAC3C,QAAQ,KAAK,qBAAU,CAAC,QAAQ,CAAC,UAAU,EAC1C,CAAC;QACF,oEAAoE;QACpE,uBAAuB,GAAG,SAAS,CAAC;IACrC,CAAC;SAAM,CAAC;QACP,IAAA,iBAAM,EAAC,QAAQ,KAAK,qBAAU,CAAC,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACjF,8DAA8D;QAC9D,uBAAuB,GAAG;YACzB,UAAU,EAAE,SAAS,CAAC,UAAU;YAChC,eAAe,EAAE;gBAChB,IAAI,EAAE,qBAAU,CAAC,QAAQ,CAAC,UAAU;gBACpC,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,iBAAiB,EAAE,UAAU,CAAC,iBAAiB;aAC/C;SACD,CAAC;IACH,CAAC;IAED,IAAA,iBAAM,EACL,IAAA,6BAAkB,EAAC,8BAAmB,EAAE,SAAS,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AAC,CAAC;YACjE,OAAO,IAAI,CAAC;QACb,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,IAAA,0BAAe,EAAC,aAAa,CAAC,CAAC;QAChC,CAAC;IACF,CAAC;AACF,CAAC;AApBD,oCAoBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tCursorLocationType,\n\ttype ITreeCursorSynchronous,\n\ttype TreeStoredSchema,\n\trootFieldKey,\n\tschemaDataIsEmpty,\n} from \"../core/index.js\";\nimport {\n\tFieldKinds,\n\tallowsRepoSuperset,\n\tcursorForMapTreeField,\n\tdefaultSchemaPolicy,\n\tmapTreeFromCursor,\n} from \"../feature-libraries/index.js\";\nimport { toStoredSchema, type SchemaCompatibilityTester } from \"../simple-tree/index.js\";\nimport { isReadonlyArray } from \"../util/index.js\";\n\nimport type { ITreeCheckout } from \"./treeCheckout.js\";\n\n/**\n * Modify `storedSchema` and invoke `setInitialTree` when it's time to set the tree content.\n *\n * Requires `storedSchema` to be in its default/empty state.\n *\n * This is done in such a way that if the content (implicitly assumed to start empty)\n * is never out of schema.\n * This means that if the root field of the new schema requires content (like a value field),\n * a temporary intermediate schema is used so the initial empty state is not out of schema.\n *\n * Since this makes multiple changes, callers may want to wrap it in a transaction.\n */\nexport function initializeContent(\n\tschemaRepository: {\n\t\tstoredSchema: ITreeCheckout[\"storedSchema\"];\n\t\tupdateSchema: ITreeCheckout[\"updateSchema\"];\n\t},\n\tnewSchema: TreeStoredSchema,\n\tsetInitialTree: () => void,\n): void {\n\tassert(\n\t\tschemaDataIsEmpty(schemaRepository.storedSchema),\n\t\t0x743 /* cannot initialize after a schema is set */,\n\t);\n\n\tconst rootSchema = newSchema.rootFieldSchema;\n\tconst rootKind = rootSchema.kind;\n\n\t// To keep the data in schema during the update, first define a schema that tolerates the current (empty) tree as well as the final (initial) tree.\n\tlet incrementalSchemaUpdate: TreeStoredSchema;\n\tif (\n\t\trootKind === FieldKinds.sequence.identifier ||\n\t\trootKind === FieldKinds.optional.identifier\n\t) {\n\t\t// These kinds are known to tolerate empty, so use the schema as is:\n\t\tincrementalSchemaUpdate = newSchema;\n\t} else {\n\t\tassert(rootKind === FieldKinds.required.identifier, 0x5c8 /* Unexpected kind */);\n\t\t// Replace value kind with optional kind in root field schema:\n\t\tincrementalSchemaUpdate = {\n\t\t\tnodeSchema: newSchema.nodeSchema,\n\t\t\trootFieldSchema: {\n\t\t\t\tkind: FieldKinds.optional.identifier,\n\t\t\t\ttypes: rootSchema.types,\n\t\t\t\tpersistedMetadata: rootSchema.persistedMetadata,\n\t\t\t},\n\t\t};\n\t}\n\n\tassert(\n\t\tallowsRepoSuperset(defaultSchemaPolicy, newSchema, incrementalSchemaUpdate),\n\t\t0x5c9 /* Incremental Schema during update should allow a superset of the final schema */,\n\t);\n\t// Update to intermediate schema\n\tschemaRepository.updateSchema(incrementalSchemaUpdate);\n\t// Insert initial tree\n\tsetInitialTree();\n\n\t// If intermediate schema is not final desired schema, update to the final schema:\n\tif (incrementalSchemaUpdate !== newSchema) {\n\t\t// This makes the root more strict, so set allowNonSupersetSchema to true.\n\t\tschemaRepository.updateSchema(newSchema, true);\n\t}\n}\n\nexport enum UpdateType {\n\t/**\n\t * Already compatible, no update needed.\n\t */\n\tNone,\n\t/**\n\t * Schema can be upgraded leaving tree as is.\n\t */\n\tSchemaCompatible,\n\t/**\n\t * No update currently supported.\n\t */\n\tIncompatible,\n}\n\n/**\n * Returns how compatible updating checkout's schema is with the viewSchema.\n */\nexport function evaluateUpdate(\n\tviewSchema: SchemaCompatibilityTester,\n\tcheckout: ITreeCheckout,\n): UpdateType {\n\tconst compatibility = viewSchema.checkCompatibility(checkout.storedSchema);\n\n\tif (compatibility.canUpgrade && compatibility.canView) {\n\t\t// Compatible as is\n\t\treturn UpdateType.None;\n\t}\n\n\tif (!compatibility.canUpgrade) {\n\t\t// Existing stored schema permits trees which are incompatible with the view schema, so schema can not be updated\n\t\treturn UpdateType.Incompatible;\n\t}\n\n\tassert(!compatibility.canView, 0x8bd /* unexpected case */);\n\tassert(compatibility.canUpgrade, 0x8be /* unexpected case */);\n\n\treturn UpdateType.SchemaCompatible;\n}\n\nexport function canInitialize(checkout: ITreeCheckout): boolean {\n\t// Check for empty.\n\treturn checkout.forest.isEmpty && schemaDataIsEmpty(checkout.storedSchema);\n}\n\nfunction normalizeNewFieldContent(\n\tcontent: readonly ITreeCursorSynchronous[] | ITreeCursorSynchronous | undefined,\n): ITreeCursorSynchronous {\n\tif (content === undefined) {\n\t\treturn cursorForMapTreeField([]);\n\t}\n\n\tif (isReadonlyArray(content)) {\n\t\treturn cursorForMapTreeField(content.map((c) => mapTreeFromCursor(c)));\n\t}\n\n\tif (content.mode === CursorLocationType.Fields) {\n\t\treturn content;\n\t}\n\n\treturn cursorForMapTreeField([mapTreeFromCursor(content)]);\n}\n\n/**\n * Initialize a checkout with a schema and tree content.\n * This function should only be called when the tree is uninitialized (no schema or content).\n * @remarks\n *\n * If the proposed schema (from `treeContent`) is not compatible with the empty tree, this function handles using an intermediate schema\n * which supports the empty tree as well as the final tree content.\n */\nexport function initialize(checkout: ITreeCheckout, treeContent: TreeStoredContent): void {\n\tcheckout.transaction.start();\n\ttry {\n\t\tinitializeContent(checkout, treeContent.schema, () => {\n\t\t\tconst field = { field: rootFieldKey, parent: undefined };\n\t\t\tconst content = normalizeNewFieldContent(treeContent.initialTree);\n\t\t\tconst contentChunk = checkout.forest.chunkField(content);\n\n\t\t\tswitch (checkout.storedSchema.rootFieldSchema.kind) {\n\t\t\t\tcase FieldKinds.optional.identifier: {\n\t\t\t\t\tconst fieldEditor = checkout.editor.optionalField(field);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tcontent.getFieldLength() <= 1,\n\t\t\t\t\t\t0x7f4 /* optional field content should normalize at most one item */,\n\t\t\t\t\t);\n\t\t\t\t\tfieldEditor.set(contentChunk.topLevelLength === 0 ? undefined : contentChunk, true);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase FieldKinds.sequence.identifier: {\n\t\t\t\t\tconst fieldEditor = checkout.editor.sequenceField(field);\n\t\t\t\t\t// TODO: should do an idempotent edit here.\n\t\t\t\t\tfieldEditor.insert(0, contentChunk);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tfail(0xac7 /* unexpected root field kind during initialize */);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t} finally {\n\t\tcheckout.transaction.commit();\n\t}\n}\n\n/**\n * Ensure a {@link ITreeCheckout} can be used with a given {@link SchemaCompatibilityTester}.\n *\n * @remarks\n * It is up to the caller to ensure that compatibility is reevaluated if the checkout's stored schema is edited in the future.\n *\n * @param viewSchema - View schema that `checkout` should be made compatible with.\n * @param allowedSchemaModifications - Flags enum describing the ways this is allowed to modify `checkout`.\n * @param checkout - To be modified as needed to be compatible with `viewSchema`.\n * @param treeContent - Content to be used to initialize `checkout`'s the tree if needed and allowed.\n * @returns true iff checkout now is compatible with `viewSchema`.\n */\nexport function ensureSchema(\n\tviewSchema: SchemaCompatibilityTester,\n\tcheckout: ITreeCheckout,\n): boolean {\n\tconst updatedNeeded = evaluateUpdate(viewSchema, checkout);\n\tswitch (updatedNeeded) {\n\t\tcase UpdateType.None: {\n\t\t\treturn true;\n\t\t}\n\t\tcase UpdateType.Incompatible: {\n\t\t\treturn false;\n\t\t}\n\t\tcase UpdateType.SchemaCompatible: {\n\t\t\tcheckout.updateSchema(toStoredSchema(viewSchema.viewSchemaRoot));\n\t\t\treturn true;\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(updatedNeeded);\n\t\t}\n\t}\n}\n\n/**\n * Content that can populate a `SharedTree`.\n */\nexport interface TreeStoredContent {\n\treadonly schema: TreeStoredSchema;\n\n\t/**\n\t * Default tree content to initialize the tree with iff the tree is uninitialized\n\t * (meaning it does not even have any schema set at all).\n\t */\n\treadonly initialTree: readonly ITreeCursorSynchronous[] | ITreeCursorSynchronous | undefined;\n}\n"]}
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import type { HasListeners, IEmitter, Listenable } from "@fluidframework/core-interfaces/internal";
|
|
6
|
-
import { type NodeIdentifierManager,
|
|
7
|
-
import { type ImplicitFieldSchema, type SchemaCompatibilityStatus, type TreeView, type TreeViewEvents,
|
|
6
|
+
import { type NodeIdentifierManager, Context } from "../feature-libraries/index.js";
|
|
7
|
+
import { type ImplicitFieldSchema, type SchemaCompatibilityStatus, type TreeView, type TreeViewEvents, type TreeViewConfiguration, type TreeViewAlpha, type InsertableField, type ReadableField, type ReadSchema, type UnsafeUnknownSchema, type TreeBranch, type TreeBranchEvents, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type RunTransactionParams, type TransactionConstraint } from "../simple-tree/index.js";
|
|
8
8
|
import { type Breakable, type WithBreakable } from "../util/index.js";
|
|
9
|
-
import { CheckoutFlexTreeView } from "./checkoutFlexTreeView.js";
|
|
10
9
|
import type { ITreeCheckout, TreeCheckout } from "./treeCheckout.js";
|
|
11
10
|
/**
|
|
12
11
|
* Creating multiple tree views from the same checkout is not supported. This slot is used to detect if one already
|
|
@@ -22,11 +21,11 @@ export declare class SchematizingSimpleTreeView<in out TRootSchema extends Impli
|
|
|
22
21
|
readonly nodeKeyManager: NodeIdentifierManager;
|
|
23
22
|
private readonly onDispose?;
|
|
24
23
|
/**
|
|
25
|
-
*
|
|
24
|
+
* This is set to undefined when this object is disposed or the view schema does not support viewing the document's stored schema.
|
|
26
25
|
*
|
|
27
26
|
* The view schema may be incompatible with the stored schema. Use `compatibility` to check.
|
|
28
27
|
*/
|
|
29
|
-
private
|
|
28
|
+
private flexTreeContext;
|
|
30
29
|
/**
|
|
31
30
|
* Undefined iff uninitialized or disposed.
|
|
32
31
|
*/
|
|
@@ -34,6 +33,10 @@ export declare class SchematizingSimpleTreeView<in out TRootSchema extends Impli
|
|
|
34
33
|
private readonly schemaPolicy;
|
|
35
34
|
readonly events: Listenable<TreeViewEvents & TreeBranchEvents> & IEmitter<TreeViewEvents & TreeBranchEvents> & HasListeners<TreeViewEvents & TreeBranchEvents>;
|
|
36
35
|
private readonly viewSchema;
|
|
36
|
+
/**
|
|
37
|
+
* Events to unregister upon flex-tree view disposal.
|
|
38
|
+
*/
|
|
39
|
+
private readonly flexTreeViewUnregisterCallbacks;
|
|
37
40
|
/**
|
|
38
41
|
* Events to unregister upon disposal.
|
|
39
42
|
*/
|
|
@@ -54,9 +57,9 @@ export declare class SchematizingSimpleTreeView<in out TRootSchema extends Impli
|
|
|
54
57
|
initialize(content: InsertableField<TRootSchema>): void;
|
|
55
58
|
upgradeSchema(): void;
|
|
56
59
|
/**
|
|
57
|
-
* Gets the
|
|
60
|
+
* Gets the flex-tree context. Throws when disposed or out of schema.
|
|
58
61
|
*/
|
|
59
|
-
|
|
62
|
+
getFlexTreeContext(): Context;
|
|
60
63
|
/**
|
|
61
64
|
* {@inheritDoc @fluidframework/shared-tree#TreeViewAlpha.runTransaction}
|
|
62
65
|
*/
|
|
@@ -80,7 +83,7 @@ export declare class SchematizingSimpleTreeView<in out TRootSchema extends Impli
|
|
|
80
83
|
*/
|
|
81
84
|
private update;
|
|
82
85
|
private runSchemaEdit;
|
|
83
|
-
private
|
|
86
|
+
private disposeFlexView;
|
|
84
87
|
get compatibility(): SchemaCompatibilityStatus;
|
|
85
88
|
dispose(): void;
|
|
86
89
|
get root(): ReadableField<TRootSchema>;
|
|
@@ -95,11 +98,6 @@ export declare class SchematizingSimpleTreeView<in out TRootSchema extends Impli
|
|
|
95
98
|
* Other checkout implementations (e.g. not associated with a view) may be supported in the future.
|
|
96
99
|
*/
|
|
97
100
|
export declare function getCheckout(context: TreeBranch): TreeCheckout;
|
|
98
|
-
/**
|
|
99
|
-
* Creates a view that self-disposes whenever the stored schema changes.
|
|
100
|
-
* This may only be called when the schema is already known to be compatible (typically via ensureSchema).
|
|
101
|
-
*/
|
|
102
|
-
export declare function requireSchema(checkout: ITreeCheckout, viewSchema: SchemaCompatibilityTester, onDispose: () => void, nodeKeyManager: NodeIdentifierManager, schemaPolicy: FullSchemaPolicy): CheckoutFlexTreeView;
|
|
103
101
|
/**
|
|
104
102
|
* Adds constraints to a `checkout`'s pending transaction.
|
|
105
103
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schematizingTreeView.d.ts","sourceRoot":"","sources":["../../src/shared-tree/schematizingTreeView.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,MAAM,0CAA0C,CAAC;AAKlD,OAAO,EACN,KAAK,qBAAqB,EAI1B,
|
|
1
|
+
{"version":3,"file":"schematizingTreeView.d.ts","sourceRoot":"","sources":["../../src/shared-tree/schematizingTreeView.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,MAAM,0CAA0C,CAAC;AAKlD,OAAO,EACN,KAAK,qBAAqB,EAI1B,OAAO,EACP,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,QAAQ,EACb,KAAK,cAAc,EAMnB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,gBAAgB,EAGrB,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAS1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,KAAK,SAAS,EAGd,KAAK,aAAa,EAClB,MAA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