@fluidframework/tree 2.40.0-336023 → 2.41.0-337492
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/api-report/tree.alpha.api.md +4 -1
- package/dist/alpha.d.ts +1 -0
- package/dist/codec/codec.d.ts +5 -1
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +6 -2
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/index.d.ts +1 -1
- package/dist/codec/index.d.ts.map +1 -1
- package/dist/codec/index.js +2 -1
- package/dist/codec/index.js.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/schema-stored/{format.d.ts → formatV1.d.ts} +1 -1
- package/dist/core/schema-stored/formatV1.d.ts.map +1 -0
- package/dist/core/schema-stored/{format.js → formatV1.js} +1 -1
- package/dist/core/schema-stored/formatV1.js.map +1 -0
- package/dist/core/schema-stored/index.d.ts +3 -3
- package/dist/core/schema-stored/index.d.ts.map +1 -1
- package/dist/core/schema-stored/index.js +3 -3
- package/dist/core/schema-stored/index.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +3 -1
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +8 -6
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/dist/core/schema-view/index.d.ts +1 -1
- package/dist/core/schema-view/index.d.ts.map +1 -1
- package/dist/core/schema-view/index.js +1 -2
- package/dist/core/schema-view/index.js.map +1 -1
- package/dist/core/schema-view/view.d.ts +0 -27
- package/dist/core/schema-view/view.d.ts.map +1 -1
- package/dist/core/schema-view/view.js +1 -35
- package/dist/core/schema-view/view.js.map +1 -1
- package/dist/core/tree/persistedTreeTextFormat.d.ts +4 -4
- package/dist/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
- package/dist/core/tree/persistedTreeTextFormat.js +1 -1
- package/dist/core/tree/persistedTreeTextFormat.js.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js +0 -7
- package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/forest-summary/format.d.ts +2 -2
- package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/format.js +1 -1
- package/dist/feature-libraries/forest-summary/format.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +1 -1
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +4 -2
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.d.ts +3 -3
- package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.js +2 -2
- package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -9
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormat.js +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +14 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +26 -5
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts +34 -5
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +63 -9
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/{lib/feature-libraries/schema-index/format.d.ts → dist/feature-libraries/schema-index/formatV1.d.ts} +9 -9
- package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -0
- package/dist/feature-libraries/schema-index/{format.js → formatV1.js} +4 -4
- package/dist/feature-libraries/schema-index/formatV1.js.map +1 -0
- package/dist/feature-libraries/schema-index/index.d.ts +2 -2
- package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/index.js +6 -3
- package/dist/feature-libraries/schema-index/index.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +5 -5
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +4 -4
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -8
- package/dist/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/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +1 -1
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +1 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +2 -1
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts +9 -10
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +10 -34
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +4 -6
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +28 -3
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +29 -3
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/tree.d.ts +24 -0
- package/dist/shared-tree/tree.d.ts.map +1 -1
- package/dist/shared-tree/tree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +2 -0
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +3 -2
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.d.ts +0 -1
- package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.js +0 -1
- package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.d.ts +1 -1
- package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.js +4 -1
- package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +2 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +2 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +9 -0
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +7 -0
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts +8 -7
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +13 -9
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +25 -0
- 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/treeChangeEvents.d.ts +83 -0
- package/dist/simple-tree/api/treeChangeEvents.d.ts.map +1 -0
- package/dist/simple-tree/api/treeChangeEvents.js +7 -0
- package/dist/simple-tree/api/treeChangeEvents.js.map +1 -0
- package/dist/simple-tree/api/treeNodeApi.d.ts +2 -1
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts +28 -0
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js.map +1 -1
- 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 +2 -1
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +5 -5
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/treeNode.d.ts +94 -0
- package/dist/simple-tree/core/treeNode.d.ts.map +1 -0
- package/dist/simple-tree/core/treeNode.js +123 -0
- package/dist/simple-tree/core/treeNode.js.map +1 -0
- package/dist/simple-tree/core/treeNodeKernel.d.ts +2 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +3 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/types.d.ts +0 -165
- package/dist/simple-tree/core/types.d.ts.map +1 -1
- package/dist/simple-tree/core/types.js +1 -113
- package/dist/simple-tree/core/types.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +5 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/core/withType.d.ts +1 -1
- package/dist/simple-tree/core/withType.d.ts.map +1 -1
- package/dist/simple-tree/core/withType.js.map +1 -1
- package/dist/simple-tree/index.d.ts +2 -2
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +3 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +1 -0
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts +8 -8
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +27 -32
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/tableSchema.d.ts +309 -91
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +319 -78
- package/dist/tableSchema.js.map +1 -1
- package/dist/treeFactory.d.ts +1 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +30 -75
- package/dist/treeFactory.js.map +1 -1
- package/lib/alpha.d.ts +1 -0
- package/lib/codec/codec.d.ts +5 -1
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +5 -1
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/index.d.ts +1 -1
- package/lib/codec/index.d.ts.map +1 -1
- package/lib/codec/index.js +1 -1
- package/lib/codec/index.js.map +1 -1
- package/lib/core/index.d.ts +2 -2
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +2 -2
- package/lib/core/index.js.map +1 -1
- package/lib/core/schema-stored/{format.d.ts → formatV1.d.ts} +1 -1
- package/lib/core/schema-stored/formatV1.d.ts.map +1 -0
- package/lib/core/schema-stored/{format.js → formatV1.js} +1 -1
- package/lib/core/schema-stored/formatV1.js.map +1 -0
- package/lib/core/schema-stored/index.d.ts +3 -3
- package/lib/core/schema-stored/index.d.ts.map +1 -1
- package/lib/core/schema-stored/index.js +2 -2
- package/lib/core/schema-stored/index.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +3 -1
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +3 -1
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/lib/core/schema-view/index.d.ts +1 -1
- package/lib/core/schema-view/index.d.ts.map +1 -1
- package/lib/core/schema-view/index.js +1 -1
- package/lib/core/schema-view/index.js.map +1 -1
- package/lib/core/schema-view/view.d.ts +0 -27
- package/lib/core/schema-view/view.d.ts.map +1 -1
- package/lib/core/schema-view/view.js +0 -34
- package/lib/core/schema-view/view.js.map +1 -1
- package/lib/core/tree/persistedTreeTextFormat.d.ts +4 -4
- package/lib/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
- package/lib/core/tree/persistedTreeTextFormat.js +2 -2
- package/lib/core/tree/persistedTreeTextFormat.js.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js +0 -7
- package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/forest-summary/format.d.ts +2 -2
- package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/format.js +2 -2
- package/lib/feature-libraries/forest-summary/format.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +1 -1
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +1 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.d.ts +3 -3
- package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.js +2 -2
- package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -9
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormat.js +3 -3
- package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +14 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +26 -6
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.js +3 -3
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts +34 -5
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +61 -9
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/{dist/feature-libraries/schema-index/format.d.ts → lib/feature-libraries/schema-index/formatV1.d.ts} +9 -9
- package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -0
- package/lib/feature-libraries/schema-index/{format.js → formatV1.js} +5 -5
- package/lib/feature-libraries/schema-index/formatV1.js.map +1 -0
- package/lib/feature-libraries/schema-index/index.d.ts +2 -2
- package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/index.js +2 -2
- package/lib/feature-libraries/schema-index/index.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +5 -5
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +5 -5
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/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/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +2 -2
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +1 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts +9 -10
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +11 -35
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +5 -7
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +28 -3
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +29 -4
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/tree.d.ts +24 -0
- package/lib/shared-tree/tree.d.ts.map +1 -1
- package/lib/shared-tree/tree.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +2 -0
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +4 -3
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.d.ts +0 -1
- package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.js +0 -1
- package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.d.ts +1 -1
- package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.js +4 -1
- package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +2 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +9 -0
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +7 -0
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts +8 -7
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +17 -11
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +25 -0
- 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/treeChangeEvents.d.ts +83 -0
- package/lib/simple-tree/api/treeChangeEvents.d.ts.map +1 -0
- package/lib/simple-tree/api/treeChangeEvents.js +6 -0
- package/lib/simple-tree/api/treeChangeEvents.js.map +1 -0
- package/lib/simple-tree/api/treeNodeApi.d.ts +2 -1
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/arrayNode.d.ts +28 -0
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js.map +1 -1
- 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 +2 -1
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +1 -1
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/treeNode.d.ts +94 -0
- package/lib/simple-tree/core/treeNode.d.ts.map +1 -0
- package/lib/simple-tree/core/treeNode.js +118 -0
- package/lib/simple-tree/core/treeNode.js.map +1 -0
- package/lib/simple-tree/core/treeNodeKernel.d.ts +2 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +3 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/core/types.d.ts +0 -165
- package/lib/simple-tree/core/types.d.ts.map +1 -1
- package/lib/simple-tree/core/types.js +0 -110
- package/lib/simple-tree/core/types.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +5 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/core/withType.d.ts +1 -1
- package/lib/simple-tree/core/withType.d.ts.map +1 -1
- package/lib/simple-tree/core/withType.js.map +1 -1
- package/lib/simple-tree/index.d.ts +2 -2
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +1 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +1 -0
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts +8 -8
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +26 -31
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/tableSchema.d.ts +309 -91
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +319 -78
- package/lib/tableSchema.js.map +1 -1
- package/lib/treeFactory.d.ts +1 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +30 -75
- package/lib/treeFactory.js.map +1 -1
- package/package.json +21 -21
- package/src/codec/codec.ts +6 -1
- package/src/codec/index.ts +1 -0
- package/src/core/index.ts +1 -2
- package/src/core/schema-stored/index.ts +3 -3
- package/src/core/schema-stored/schema.ts +3 -1
- package/src/core/schema-stored/storedSchemaRepository.ts +1 -1
- package/src/core/schema-view/index.ts +0 -1
- package/src/core/schema-view/view.ts +0 -31
- package/src/core/tree/persistedTreeTextFormat.ts +2 -2
- package/src/feature-libraries/default-schema/schemaChecker.ts +0 -8
- package/src/feature-libraries/forest-summary/format.ts +2 -2
- package/src/feature-libraries/index.ts +7 -1
- package/src/feature-libraries/mapTreeCursor.ts +3 -3
- package/src/feature-libraries/modular-schema/modularChangeFormat.ts +3 -3
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +38 -9
- package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +3 -4
- package/src/feature-libraries/schema-index/codec.ts +80 -12
- package/src/feature-libraries/schema-index/{format.ts → formatV1.ts} +4 -4
- package/src/feature-libraries/schema-index/index.ts +7 -2
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +9 -9
- package/src/index.ts +1 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +3 -2
- package/src/shared-tree/index.ts +2 -0
- package/src/shared-tree/schematizeTree.ts +6 -36
- package/src/shared-tree/schematizingTreeView.ts +5 -12
- package/src/shared-tree/sharedTree.ts +67 -6
- package/src/shared-tree/tree.ts +24 -0
- package/src/shared-tree/treeAlpha.ts +6 -3
- package/src/shared-tree-core/branchCommitEnricher.ts +0 -1
- package/src/shared-tree-core/transactionEnricher.ts +4 -1
- package/src/simple-tree/api/index.ts +2 -0
- package/src/simple-tree/api/schemaFactory.ts +9 -0
- package/src/simple-tree/api/storedSchema.ts +24 -13
- package/src/simple-tree/api/tree.ts +25 -0
- package/src/simple-tree/api/treeBeta.ts +3 -1
- package/src/simple-tree/api/treeChangeEvents.ts +84 -0
- package/src/simple-tree/api/treeNodeApi.ts +1 -1
- package/src/simple-tree/arrayNode.ts +28 -0
- package/src/simple-tree/core/getOrCreateNode.ts +1 -1
- package/src/simple-tree/core/index.ts +5 -4
- package/src/simple-tree/core/treeNode.ts +163 -0
- package/src/simple-tree/core/treeNodeKernel.ts +2 -1
- package/src/simple-tree/core/treeNodeSchema.ts +3 -1
- package/src/simple-tree/core/types.ts +0 -234
- package/src/simple-tree/core/unhydratedFlexTree.ts +6 -1
- package/src/simple-tree/core/withType.ts +1 -1
- package/src/simple-tree/index.ts +2 -1
- package/src/simple-tree/schemaTypes.ts +1 -0
- package/src/simple-tree/toStoredSchema.ts +42 -41
- package/src/tableSchema.ts +713 -259
- package/src/treeFactory.ts +56 -173
- package/dist/core/schema-stored/format.d.ts.map +0 -1
- package/dist/core/schema-stored/format.js.map +0 -1
- package/dist/feature-libraries/schema-index/format.d.ts.map +0 -1
- package/dist/feature-libraries/schema-index/format.js.map +0 -1
- package/lib/core/schema-stored/format.d.ts.map +0 -1
- package/lib/core/schema-stored/format.js.map +0 -1
- package/lib/feature-libraries/schema-index/format.d.ts.map +0 -1
- package/lib/feature-libraries/schema-index/format.js.map +0 -1
- /package/src/core/schema-stored/{format.ts → formatV1.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tableSchema.d.ts","sourceRoot":"","sources":["../src/tableSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"tableSchema.d.ts","sourceRoot":"","sources":["../src/tableSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EACN,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAEzB,KAAK,0CAA0C,EAC/C,KAAK,QAAQ,EACb,KA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ACvC,KAAK,CAAC,KAAK,SAAS,oBAAoB,EACxC,KAAK,CAAC,OAAO,SAAS,kBAAkB,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAEjE,MAAM,EAAE,kBAAkB,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG;QACvF,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;KACzB,GACC,kBAAkB,CAAC,eAAe,CACpC,MAAM,EACN,KAAK,EACL,OAAO,EACP,kBAAkB,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,CACpF,CAAC;IACF;;;OAGG;IACH,SAAgB,KAAK,CACpB,KAAK,CAAC,MAAM,SAAS,MAAM,GAAG,SAAS,EACvC,KAAK,CAAC,KAAK,SAAS,oBAAoB,EACxC,KAAK,CAAC,OAAO,SAAS,kBAAkB,CAAC,gBAAgB,CAAC,MAAM,CAAC,EACjE,KAAK,CAAC,IAAI,SAAS,kBAAkB,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,EAElE,MAAM,EAAE,kBAAkB,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG;QACvF,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;QACzB,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC;KACnB,GACC,kBAAkB,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;CA2BpE"}
|
package/dist/tableSchema.js
CHANGED
|
@@ -6,11 +6,18 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.TableSchema = exports.System_TableSchema = void 0;
|
|
8
8
|
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
9
|
+
const internal_2 = require("@fluidframework/telemetry-utils/internal");
|
|
9
10
|
const index_js_1 = require("./shared-tree/index.js");
|
|
10
11
|
const index_js_2 = require("./simple-tree/index.js");
|
|
11
|
-
// Future improvement TODOs
|
|
12
|
+
// Future improvement TODOs:
|
|
13
|
+
// - Omit `cells` property from Row insertion type.
|
|
12
14
|
// - Record-like type parameters / input parameters?
|
|
13
15
|
// - Omit `props` properties from Row and Column schemas when not provided?
|
|
16
|
+
// Longer-term work:
|
|
17
|
+
// - Add constraint APIs to make it possible to avoid situations that could yield "orphaned" cells.
|
|
18
|
+
/**
|
|
19
|
+
* The sub-scope applied to user-provided {@link SchemaFactory}s by table schema factories.
|
|
20
|
+
*/
|
|
14
21
|
const tableSchemaFactorySubScope = "table";
|
|
15
22
|
/**
|
|
16
23
|
* Not intended for use outside of this package.
|
|
@@ -25,11 +32,11 @@ const tableSchemaFactorySubScope = "table";
|
|
|
25
32
|
var System_TableSchema;
|
|
26
33
|
(function (System_TableSchema) {
|
|
27
34
|
/**
|
|
28
|
-
* Factory for creating
|
|
35
|
+
* Factory for creating column schema.
|
|
29
36
|
* @system @internal
|
|
30
37
|
*/
|
|
31
38
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify
|
|
32
|
-
function
|
|
39
|
+
function createColumnSchema(inputSchemaFactory, propsSchema) {
|
|
33
40
|
const schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);
|
|
34
41
|
// Note: `columnFields` is broken into two parts to work around a TypeScript bug
|
|
35
42
|
// that results in broken `.d.ts` output.
|
|
@@ -71,14 +78,13 @@ var System_TableSchema;
|
|
|
71
78
|
const ColumnSchemaType = Column;
|
|
72
79
|
return ColumnSchemaType;
|
|
73
80
|
}
|
|
74
|
-
System_TableSchema.
|
|
81
|
+
System_TableSchema.createColumnSchema = createColumnSchema;
|
|
75
82
|
/**
|
|
76
|
-
* Factory for creating
|
|
77
|
-
*
|
|
83
|
+
* Factory for creating row schema.
|
|
78
84
|
* @sealed @internal
|
|
79
85
|
*/
|
|
80
86
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify
|
|
81
|
-
function
|
|
87
|
+
function createRowSchema(inputSchemaFactory, cellSchema, propsSchema) {
|
|
82
88
|
const schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);
|
|
83
89
|
// Note: `rowFields` is broken into two parts to work around a TypeScript bug
|
|
84
90
|
// that results in broken `.d.ts` output.
|
|
@@ -118,15 +124,19 @@ var System_TableSchema;
|
|
|
118
124
|
return this.cells.get(columnId);
|
|
119
125
|
}
|
|
120
126
|
setCell(columnOrId, value) {
|
|
127
|
+
// TODO: throw if column does not exist in the owning table.
|
|
121
128
|
const columnId = typeof columnOrId === "string" ? columnOrId : columnOrId.id;
|
|
122
129
|
this.cells.set(columnId, value);
|
|
123
130
|
}
|
|
124
131
|
removeCell(columnOrId) {
|
|
132
|
+
// TODO: throw if column does not exist in the owning table.
|
|
125
133
|
const columnId = typeof columnOrId === "string" ? columnOrId : columnOrId.id;
|
|
126
|
-
|
|
127
|
-
|
|
134
|
+
const cell = this.cells.get(columnId);
|
|
135
|
+
if (cell === undefined) {
|
|
136
|
+
return undefined;
|
|
128
137
|
}
|
|
129
138
|
this.cells.delete(columnId);
|
|
139
|
+
return cell;
|
|
130
140
|
}
|
|
131
141
|
}
|
|
132
142
|
// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly "__#124291@#brand": unknown;`
|
|
@@ -137,13 +147,13 @@ var System_TableSchema;
|
|
|
137
147
|
const RowSchemaType = Row;
|
|
138
148
|
return RowSchemaType;
|
|
139
149
|
}
|
|
140
|
-
System_TableSchema.
|
|
150
|
+
System_TableSchema.createRowSchema = createRowSchema;
|
|
141
151
|
/**
|
|
142
|
-
* Factory for creating
|
|
152
|
+
* Factory for creating table schema.
|
|
143
153
|
* @system @internal
|
|
144
154
|
*/
|
|
145
155
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify
|
|
146
|
-
function
|
|
156
|
+
function createTableSchema(inputSchemaFactory, _cellSchema, columnSchema, rowSchema) {
|
|
147
157
|
const schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);
|
|
148
158
|
/**
|
|
149
159
|
* {@link Table} fields.
|
|
@@ -172,98 +182,245 @@ var System_TableSchema;
|
|
|
172
182
|
return this.rows.find((_row) => _row.id === id);
|
|
173
183
|
}
|
|
174
184
|
getCell(key) {
|
|
175
|
-
const {
|
|
176
|
-
const row = this.
|
|
177
|
-
if (row
|
|
178
|
-
|
|
179
|
-
if (column !== undefined) {
|
|
180
|
-
return row.getCell(column.id);
|
|
181
|
-
}
|
|
185
|
+
const { column: columnOrId, row: rowOrId } = key;
|
|
186
|
+
const row = this._getRow(rowOrId);
|
|
187
|
+
if (row === undefined) {
|
|
188
|
+
return undefined;
|
|
182
189
|
}
|
|
183
|
-
|
|
184
|
-
|
|
190
|
+
const column = this._getColumn(columnOrId);
|
|
191
|
+
if (column === undefined) {
|
|
192
|
+
return undefined;
|
|
193
|
+
}
|
|
194
|
+
return row.getCell(column);
|
|
185
195
|
}
|
|
186
196
|
insertColumn({ column, index, }) {
|
|
187
|
-
|
|
188
|
-
|
|
197
|
+
const inserted = this.insertColumns({
|
|
198
|
+
columns: [column],
|
|
199
|
+
index,
|
|
200
|
+
});
|
|
201
|
+
return inserted[0] ?? (0, internal_1.oob)();
|
|
202
|
+
}
|
|
203
|
+
insertColumns({ columns, index, }) {
|
|
204
|
+
// #region Input validation
|
|
205
|
+
// Ensure index is valid
|
|
206
|
+
if (index !== undefined) {
|
|
207
|
+
Table.validateInsertionIndex(index, this.columns);
|
|
208
|
+
}
|
|
209
|
+
// Check all of the columns being inserted an ensure the table does not already contain any with the same ID.
|
|
210
|
+
for (const column of columns) {
|
|
211
|
+
// TypeScript is unable to narrow the type of the column type correctly here, hence the casts below.
|
|
189
212
|
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
213
|
+
const maybeId = column.id;
|
|
214
|
+
if (maybeId !== undefined && this.containsColumnWithId(maybeId)) {
|
|
215
|
+
throw new internal_2.UsageError(`A column with ID "${column.id}" already exists in the table.`);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
// #endregion
|
|
219
|
+
// TypeScript is unable to narrow the column type correctly here, hence the casts below.
|
|
220
|
+
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
221
|
+
if (index === undefined) {
|
|
190
222
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
191
|
-
this.columns.insertAtEnd(
|
|
223
|
+
this.columns.insertAtEnd(index_js_2.TreeArrayNode.spread(columns));
|
|
192
224
|
}
|
|
193
225
|
else {
|
|
194
|
-
// TypeScript is unable to narrow the types correctly here, hence the cast.
|
|
195
|
-
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
196
226
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
197
|
-
this.columns.insertAt(index,
|
|
227
|
+
this.columns.insertAt(index, index_js_2.TreeArrayNode.spread(columns));
|
|
198
228
|
}
|
|
199
|
-
// Inserting the input
|
|
200
|
-
return
|
|
229
|
+
// Inserting the input nodes into the tree hydrates them, making them usable as nodes.
|
|
230
|
+
return columns;
|
|
231
|
+
}
|
|
232
|
+
insertRow({ row, index, }) {
|
|
233
|
+
const inserted = this.insertRows({
|
|
234
|
+
rows: [row],
|
|
235
|
+
index,
|
|
236
|
+
});
|
|
237
|
+
return inserted[0] ?? (0, internal_1.oob)();
|
|
201
238
|
}
|
|
202
239
|
insertRows({ index, rows, }) {
|
|
240
|
+
// #region Input validation
|
|
241
|
+
// Ensure index is valid
|
|
242
|
+
if (index !== undefined) {
|
|
243
|
+
Table.validateInsertionIndex(index, this.rows);
|
|
244
|
+
}
|
|
245
|
+
// Note: TypeScript is unable to narrow the type of the row type correctly here, hence the casts below.
|
|
246
|
+
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
247
|
+
for (const newRow of rows) {
|
|
248
|
+
// Check all of the rows being inserted an ensure the table does not already contain any with the same ID.
|
|
249
|
+
const maybeId = newRow.id;
|
|
250
|
+
if (maybeId !== undefined && this.containsRowWithId(maybeId)) {
|
|
251
|
+
throw new internal_2.UsageError(`A row with ID "${newRow.id}" already exists in the table.`);
|
|
252
|
+
}
|
|
253
|
+
// If the row contains cells, verify that the table contains the columns for those cells.
|
|
254
|
+
// Note: we intentionally hide `cells` on `IRow` to avoid leaking the internal data representation as much as possible, so we have to cast here.
|
|
255
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
256
|
+
if (newRow.cells !== undefined) {
|
|
257
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
258
|
+
const keys = Object.keys(newRow.cells);
|
|
259
|
+
for (const key of keys) {
|
|
260
|
+
if (!this.containsColumnWithId(key)) {
|
|
261
|
+
throw new internal_2.UsageError(`Attempted to insert row a cell under column ID "${key}", but the table does not contain a column with that ID.`);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
// #endregion
|
|
267
|
+
// TypeScript is unable to narrow the row type correctly here, hence the casts below.
|
|
268
|
+
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
203
269
|
if (index === undefined) {
|
|
204
|
-
// TypeScript is unable to narrow the types correctly here, hence the cast.
|
|
205
|
-
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
206
270
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
207
271
|
this.rows.insertAtEnd(index_js_2.TreeArrayNode.spread(rows));
|
|
208
272
|
}
|
|
209
273
|
else {
|
|
210
|
-
// TypeScript is unable to narrow the types correctly here, hence the cast.
|
|
211
|
-
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
212
274
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
213
275
|
this.rows.insertAt(index, index_js_2.TreeArrayNode.spread(rows));
|
|
214
276
|
}
|
|
215
277
|
// Inserting the input nodes into the tree hydrates them, making them usable as nodes.
|
|
216
278
|
return rows;
|
|
217
279
|
}
|
|
218
|
-
setCell({ key, cell }) {
|
|
219
|
-
const {
|
|
220
|
-
const row = this.
|
|
221
|
-
if (row
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
280
|
+
setCell({ key, cell, }) {
|
|
281
|
+
const { column: columnOrId, row: rowOrId } = key;
|
|
282
|
+
const row = this._getRow(rowOrId);
|
|
283
|
+
if (row === undefined) {
|
|
284
|
+
const rowId = this._getRowId(rowOrId);
|
|
285
|
+
throw new internal_2.UsageError(`No row with ID "${rowId}" exists in the table.`);
|
|
286
|
+
}
|
|
287
|
+
const column = this._getColumn(columnOrId);
|
|
288
|
+
if (column === undefined) {
|
|
289
|
+
const columnId = this._getColumnId(columnOrId);
|
|
290
|
+
throw new internal_2.UsageError(`No column with ID "${columnId}" exists in the table.`);
|
|
226
291
|
}
|
|
292
|
+
row.setCell(column, cell);
|
|
227
293
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
294
|
+
removeColumns(columns) {
|
|
295
|
+
// If there are no columns to remove, do nothing
|
|
296
|
+
if (columns.length === 0) {
|
|
297
|
+
return [];
|
|
298
|
+
}
|
|
299
|
+
// If there is only one column to remove, remove it (and don't incur cost of transaction)
|
|
300
|
+
if (columns.length === 1) {
|
|
301
|
+
const removedColumn = this.removeColumn(columns[0] ?? (0, internal_1.oob)());
|
|
302
|
+
return [removedColumn];
|
|
303
|
+
}
|
|
304
|
+
// If there are multiple columns to remove, remove them in a transaction.
|
|
305
|
+
const removedColumns = [];
|
|
306
|
+
index_js_1.Tree.runTransaction(this, () => {
|
|
307
|
+
// Note, throwing an error within a transaction will abort the entire transaction.
|
|
308
|
+
// So if we throw an error here for any row, no columns will be removed.
|
|
309
|
+
for (const columnToRemove of columns) {
|
|
310
|
+
const removedRow = this.removeColumn(columnToRemove);
|
|
311
|
+
removedColumns.push(removedRow);
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
return removedColumns;
|
|
315
|
+
}
|
|
316
|
+
removeColumn(columnOrId) {
|
|
317
|
+
const column = this._getColumn(columnOrId);
|
|
318
|
+
const index = column === undefined ? -1 : this.columns.indexOf(column);
|
|
319
|
+
if (index === -1) {
|
|
320
|
+
const columnId = this._getColumnId(columnOrId);
|
|
321
|
+
throw new internal_2.UsageError(`Specified column with ID "${columnId}" does not exist in the table.`);
|
|
322
|
+
}
|
|
233
323
|
this.columns.removeAt(index);
|
|
324
|
+
return column;
|
|
325
|
+
}
|
|
326
|
+
removeAllColumns() {
|
|
327
|
+
// TypeScript is unable to narrow the row type correctly here, hence the cast.
|
|
328
|
+
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
329
|
+
return this.removeColumns(this.columns);
|
|
234
330
|
}
|
|
235
331
|
removeRows(rows) {
|
|
236
332
|
// If there are no rows to remove, do nothing
|
|
237
333
|
if (rows.length === 0) {
|
|
238
|
-
return;
|
|
334
|
+
return [];
|
|
239
335
|
}
|
|
240
|
-
// If there is only one row to remove, remove it
|
|
336
|
+
// If there is only one row to remove, remove it (and don't incur cost of transaction)
|
|
241
337
|
if (rows.length === 1) {
|
|
242
|
-
const
|
|
243
|
-
|
|
244
|
-
return;
|
|
338
|
+
const removedRow = this.removeRow(rows[0] ?? (0, internal_1.oob)());
|
|
339
|
+
return [removedRow];
|
|
245
340
|
}
|
|
246
|
-
// If there are multiple rows to remove, remove them in a transaction
|
|
247
|
-
|
|
341
|
+
// If there are multiple rows to remove, remove them in a transaction.
|
|
342
|
+
const removedRows = [];
|
|
248
343
|
index_js_1.Tree.runTransaction(this, () => {
|
|
249
|
-
//
|
|
250
|
-
for
|
|
251
|
-
|
|
252
|
-
this.
|
|
344
|
+
// Note, throwing an error within a transaction will abort the entire transaction.
|
|
345
|
+
// So if we throw an error here for any row, no rows will be removed.
|
|
346
|
+
for (const rowToRemove of rows) {
|
|
347
|
+
const removedRow = this.removeRow(rowToRemove);
|
|
348
|
+
removedRows.push(removedRow);
|
|
253
349
|
}
|
|
254
350
|
});
|
|
351
|
+
return removedRows;
|
|
352
|
+
}
|
|
353
|
+
removeRow(rowOrId) {
|
|
354
|
+
const rowToRemove = this._getRow(rowOrId);
|
|
355
|
+
const index = rowToRemove === undefined ? -1 : this.rows.indexOf(rowToRemove);
|
|
356
|
+
// If the row does not exist in the table, throw an error.
|
|
357
|
+
if (index === -1) {
|
|
358
|
+
const rowId = this._getRowId(rowOrId);
|
|
359
|
+
throw new internal_2.UsageError(`Specified row with ID "${rowId}" does not exist in the table.`);
|
|
360
|
+
}
|
|
361
|
+
this.rows.removeAt(index);
|
|
362
|
+
return rowToRemove;
|
|
255
363
|
}
|
|
256
364
|
removeAllRows() {
|
|
257
|
-
|
|
365
|
+
// TypeScript is unable to narrow the row type correctly here, hence the cast.
|
|
366
|
+
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
367
|
+
return this.removeRows(this.rows);
|
|
258
368
|
}
|
|
259
369
|
removeCell(key) {
|
|
260
|
-
const {
|
|
261
|
-
const row = this.
|
|
262
|
-
if (row
|
|
263
|
-
const
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
370
|
+
const { column: columnOrId, row: rowOrId } = key;
|
|
371
|
+
const row = this._getRow(rowOrId);
|
|
372
|
+
if (row === undefined) {
|
|
373
|
+
const rowId = this._getRowId(rowOrId);
|
|
374
|
+
throw new internal_2.UsageError(`Specified row with ID "${rowId}" does not exist in the table.`);
|
|
375
|
+
}
|
|
376
|
+
const column = this._getColumn(columnOrId);
|
|
377
|
+
if (column === undefined) {
|
|
378
|
+
const columnId = this._getColumnId(columnOrId);
|
|
379
|
+
throw new internal_2.UsageError(`Specified column with ID "${columnId}" does not exist in the table.`);
|
|
380
|
+
}
|
|
381
|
+
const cell = row.getCell(column.id);
|
|
382
|
+
if (cell === undefined) {
|
|
383
|
+
return undefined;
|
|
384
|
+
}
|
|
385
|
+
row.removeCell(column.id);
|
|
386
|
+
return cell;
|
|
387
|
+
}
|
|
388
|
+
_getColumn(columnOrId) {
|
|
389
|
+
return typeof columnOrId === "string" ? this.getColumn(columnOrId) : columnOrId;
|
|
390
|
+
}
|
|
391
|
+
_getColumnId(columnOrId) {
|
|
392
|
+
return typeof columnOrId === "string" ? columnOrId : columnOrId.id;
|
|
393
|
+
}
|
|
394
|
+
_getRow(rowOrId) {
|
|
395
|
+
return typeof rowOrId === "string" ? this.getRow(rowOrId) : rowOrId;
|
|
396
|
+
}
|
|
397
|
+
_getRowId(rowOrId) {
|
|
398
|
+
return typeof rowOrId === "string" ? rowOrId : rowOrId.id;
|
|
399
|
+
}
|
|
400
|
+
containsColumnWithId(columnId) {
|
|
401
|
+
// TypeScript is unable to narrow the types correctly here, hence the cast.
|
|
402
|
+
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
403
|
+
return (this.columns.find((column) => column.id === columnId) !==
|
|
404
|
+
undefined);
|
|
405
|
+
}
|
|
406
|
+
containsRowWithId(rowId) {
|
|
407
|
+
// TypeScript is unable to narrow the types correctly here, hence the cast.
|
|
408
|
+
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
409
|
+
return this.rows.find((row) => row.id === rowId) !== undefined;
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Ensure that the specified index is a valid location for item insertion in the destination list.
|
|
413
|
+
* @throws Throws a usage error if the destination is invalid.
|
|
414
|
+
*/
|
|
415
|
+
static validateInsertionIndex(index, destinationList) {
|
|
416
|
+
if (index < 0) {
|
|
417
|
+
throw new internal_2.UsageError("The index must be greater than or equal to 0.");
|
|
418
|
+
}
|
|
419
|
+
if (index > destinationList.length) {
|
|
420
|
+
throw new internal_2.UsageError("The index specified for insertion is out of bounds.");
|
|
421
|
+
}
|
|
422
|
+
if (!Number.isInteger(index)) {
|
|
423
|
+
throw new internal_2.UsageError("The index must be an integer.");
|
|
267
424
|
}
|
|
268
425
|
}
|
|
269
426
|
}
|
|
@@ -276,12 +433,96 @@ var System_TableSchema;
|
|
|
276
433
|
// Return the table schema
|
|
277
434
|
return TableSchemaType;
|
|
278
435
|
}
|
|
279
|
-
System_TableSchema.
|
|
436
|
+
System_TableSchema.createTableSchema = createTableSchema;
|
|
280
437
|
// #endregion
|
|
281
438
|
})(System_TableSchema || (exports.System_TableSchema = System_TableSchema = {}));
|
|
282
439
|
/**
|
|
283
440
|
* Contains types and factories for creating schema to represent dynamic tabular data.
|
|
284
|
-
*
|
|
441
|
+
*
|
|
442
|
+
* @remarks
|
|
443
|
+
*
|
|
444
|
+
* Tables created using these APIs are...
|
|
445
|
+
*
|
|
446
|
+
* - sparse, meaning that cells may be omitted, and new rows are empty by default.
|
|
447
|
+
*
|
|
448
|
+
* - dynamic, meaning that their structure can be modified at runtime.
|
|
449
|
+
* Columns and rows can be inserted, removed, modified, and reordered.
|
|
450
|
+
* Cells can be inserted, removed, and modified.
|
|
451
|
+
*
|
|
452
|
+
* - row-major, meaning that operating on rows (including inserts, removal, moves, and traversal) is more efficient than operating on columns.
|
|
453
|
+
*
|
|
454
|
+
* Column and Row schema created using these APIs are extensible via the `props` field.
|
|
455
|
+
* This allows association of additional properties with column and row nodes.
|
|
456
|
+
*
|
|
457
|
+
* Note: for now it is possible for table cells to become "orphaned".
|
|
458
|
+
* That is, it is possible to enter a state where one or more rows contain cells with no corresponding column.
|
|
459
|
+
* To help avoid this situation, you can manually remove corresponding cells when removing columns.
|
|
460
|
+
* Either way, it is possible to enter such a state via the merging of edits.
|
|
461
|
+
* For example: one client might add a row while another concurrently removes a column, orphaning the cell where the column and row intersected.
|
|
462
|
+
*
|
|
463
|
+
* @example Using default Column and Row schema
|
|
464
|
+
*
|
|
465
|
+
* ```typescript
|
|
466
|
+
* class Cell extends schemaFactory.object("TableCell", {
|
|
467
|
+
* value: schemaFactory.string,
|
|
468
|
+
* }) {}
|
|
469
|
+
*
|
|
470
|
+
* class Table extends TableSchema.table({
|
|
471
|
+
* schemaFactory,
|
|
472
|
+
* cell: Cell,
|
|
473
|
+
* }) {}
|
|
474
|
+
*
|
|
475
|
+
* const table = new Table({
|
|
476
|
+
* columns: [{ id: "column-0" }],
|
|
477
|
+
* rows: [{ id: "row-0", cells: {} }],
|
|
478
|
+
* });
|
|
479
|
+
* ```
|
|
480
|
+
*
|
|
481
|
+
* @example Customizing Column and Row schema
|
|
482
|
+
*
|
|
483
|
+
* ```typescript
|
|
484
|
+
* class Cell extends schemaFactory.object("TableCell", {
|
|
485
|
+
* value: schemaFactory.string,
|
|
486
|
+
* }) {}
|
|
487
|
+
*
|
|
488
|
+
* class ColumnProps extends schemaFactory.object("TableColumnProps", {
|
|
489
|
+
* // Column label to display.
|
|
490
|
+
* label: schemaFactory.string,
|
|
491
|
+
* // The type of data represented by the cells. Default: string.
|
|
492
|
+
* dataType: schemaFactory.optional(schemaFactory.string),
|
|
493
|
+
* }) {}
|
|
494
|
+
*
|
|
495
|
+
* class Column extends TableSchema.column({
|
|
496
|
+
* schemaFactory,
|
|
497
|
+
* props: ColumnProps,
|
|
498
|
+
* }) {}
|
|
499
|
+
*
|
|
500
|
+
* class Row extends TableSchema.row({
|
|
501
|
+
* schemaFactory,
|
|
502
|
+
* cell: Cell,
|
|
503
|
+
* }) {}
|
|
504
|
+
*
|
|
505
|
+
* class Table extends TableSchema.table({
|
|
506
|
+
* schemaFactory,
|
|
507
|
+
* cell: Cell,
|
|
508
|
+
* column: Column,
|
|
509
|
+
* row: Row,
|
|
510
|
+
* }) {}
|
|
511
|
+
*
|
|
512
|
+
* const table = new Table({
|
|
513
|
+
* columns: [
|
|
514
|
+
* new Column({ props: { label: "Entry", dataType: "string" } }),
|
|
515
|
+
* new Column({ props: { label: "Date", dataType: "date" } }),
|
|
516
|
+
* new Column({ props: { label: "Amount", dataType: "number" } }),
|
|
517
|
+
* ],
|
|
518
|
+
* rows: [],
|
|
519
|
+
* });
|
|
520
|
+
* ```
|
|
521
|
+
*
|
|
522
|
+
* @privateRemarks
|
|
523
|
+
* The above examples are backed by tests in `tableSchema.spec.ts`.
|
|
524
|
+
* Those tests and these examples should be kept in-sync to ensure that the examples are correct.
|
|
525
|
+
*
|
|
285
526
|
* @internal
|
|
286
527
|
*/
|
|
287
528
|
var TableSchema;
|
|
@@ -290,29 +531,29 @@ var TableSchema;
|
|
|
290
531
|
/**
|
|
291
532
|
* Overload implementation
|
|
292
533
|
*/
|
|
293
|
-
function
|
|
294
|
-
return System_TableSchema.
|
|
534
|
+
function column({ schemaFactory, props = index_js_2.SchemaFactory.optional(index_js_2.SchemaFactory.null), }) {
|
|
535
|
+
return System_TableSchema.createColumnSchema(schemaFactory, props);
|
|
295
536
|
}
|
|
296
|
-
TableSchema.
|
|
537
|
+
TableSchema.column = column;
|
|
297
538
|
/**
|
|
298
539
|
* Overload implementation
|
|
299
540
|
*/
|
|
300
|
-
function
|
|
301
|
-
return System_TableSchema.
|
|
541
|
+
function row({ schemaFactory, cell, props = index_js_2.SchemaFactory.optional(index_js_2.SchemaFactory.null), }) {
|
|
542
|
+
return System_TableSchema.createRowSchema(schemaFactory, cell, props);
|
|
302
543
|
}
|
|
303
|
-
TableSchema.
|
|
544
|
+
TableSchema.row = row;
|
|
304
545
|
/**
|
|
305
546
|
* Overload implementation
|
|
306
547
|
*/
|
|
307
|
-
function
|
|
548
|
+
function table({ schemaFactory, cell: cellSchema, column: columnSchema = column({
|
|
308
549
|
schemaFactory,
|
|
309
|
-
}), row =
|
|
550
|
+
}), row: rowSchema = row({
|
|
310
551
|
schemaFactory,
|
|
311
|
-
cell,
|
|
552
|
+
cell: cellSchema,
|
|
312
553
|
}), }) {
|
|
313
|
-
return System_TableSchema.
|
|
554
|
+
return System_TableSchema.createTableSchema(schemaFactory, cellSchema, columnSchema, rowSchema);
|
|
314
555
|
}
|
|
315
|
-
TableSchema.
|
|
556
|
+
TableSchema.table = table;
|
|
316
557
|
// #endregion
|
|
317
558
|
})(TableSchema || (exports.TableSchema = TableSchema = {}));
|
|
318
559
|
//# sourceMappingURL=tableSchema.js.map
|