@fluidframework/tree 2.83.0 → 2.90.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/.vscode/settings.json +6 -5
- package/CHANGELOG.md +95 -0
- package/README.md +1 -1
- package/api-report/tree.alpha.api.md +63 -24
- package/api-report/tree.beta.api.md +30 -0
- package/api-report/tree.legacy.beta.api.md +30 -0
- package/dist/alpha.d.ts +10 -6
- package/dist/beta.d.ts +4 -1
- package/dist/codec/codec.d.ts +2 -0
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +4 -3
- 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/codec/versioned/codec.d.ts +13 -1
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js +18 -3
- package/dist/codec/versioned/codec.js.map +1 -1
- package/dist/codec/versioned/format.d.ts +22 -1
- package/dist/codec/versioned/format.d.ts.map +1 -1
- package/dist/codec/versioned/format.js +16 -3
- package/dist/codec/versioned/format.js.map +1 -1
- package/dist/codec/versioned/index.d.ts +1 -1
- package/dist/codec/versioned/index.d.ts.map +1 -1
- package/dist/codec/versioned/index.js +2 -1
- package/dist/codec/versioned/index.js.map +1 -1
- package/dist/core/index.d.ts +1 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/index.d.ts +1 -1
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +78 -0
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +8 -7
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +22 -44
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.js +11 -0
- package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts +3 -2
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js +2 -4
- package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.js +2 -4
- package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
- package/dist/feature-libraries/flex-tree/observer.d.ts +17 -0
- package/dist/feature-libraries/flex-tree/observer.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/observer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts +5 -12
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js +33 -33
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -2
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +6 -7
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts +6 -4
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/formatCommon.js +13 -11
- package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +19 -14
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +31 -48
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/dist/feature-libraries/forest-summary/index.d.ts +1 -1
- package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/index.js +2 -2
- package/dist/feature-libraries/forest-summary/index.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +3 -3
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +4 -5
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +3 -3
- package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/dist/feature-libraries/indexing/index.d.ts +1 -1
- package/dist/feature-libraries/indexing/index.d.ts.map +1 -1
- package/dist/feature-libraries/indexing/index.js.map +1 -1
- package/dist/feature-libraries/indexing/types.d.ts +15 -13
- package/dist/feature-libraries/indexing/types.d.ts.map +1 -1
- package/dist/feature-libraries/indexing/types.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +4 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/independentView.js +2 -2
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +5 -0
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +35 -7
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +7 -7
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/tree.js +1 -1
- package/dist/shared-tree/tree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +8 -1
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +48 -8
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +35 -3
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +123 -17
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree/unhydratedTreeContext.d.ts +20 -0
- package/dist/shared-tree/unhydratedTreeContext.d.ts.map +1 -0
- package/dist/shared-tree/unhydratedTreeContext.js +56 -0
- package/dist/shared-tree/unhydratedTreeContext.js.map +1 -0
- package/dist/shared-tree-core/transaction.d.ts +15 -27
- package/dist/shared-tree-core/transaction.d.ts.map +1 -1
- package/dist/shared-tree-core/transaction.js +7 -11
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/simple-tree/api/configuration.d.ts +4 -0
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/identifierIndex.d.ts +2 -2
- package/dist/simple-tree/api/identifierIndex.d.ts.map +1 -1
- package/dist/simple-tree/api/identifierIndex.js +1 -1
- package/dist/simple-tree/api/identifierIndex.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +3 -3
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +2 -2
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +3 -2
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +3 -2
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.d.ts +15 -13
- package/dist/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.js +4 -4
- package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +4 -4
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +2 -2
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/dist/simple-tree/api/transactionTypes.d.ts +22 -25
- package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/transactionTypes.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +69 -132
- 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/index.d.ts +1 -1
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +2 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/text/textDomain.d.ts +27 -9
- package/dist/text/textDomain.d.ts.map +1 -1
- package/dist/text/textDomain.js +43 -7
- package/dist/text/textDomain.js.map +1 -1
- package/dist/text/textDomainFormatted.d.ts +14 -8
- package/dist/text/textDomainFormatted.d.ts.map +1 -1
- package/dist/text/textDomainFormatted.js +97 -25
- package/dist/text/textDomainFormatted.js.map +1 -1
- package/dist/util/rangeMap.d.ts +1 -0
- package/dist/util/rangeMap.d.ts.map +1 -1
- package/dist/util/rangeMap.js +5 -6
- package/dist/util/rangeMap.js.map +1 -1
- package/lib/alpha.d.ts +10 -6
- package/lib/beta.d.ts +4 -1
- package/lib/codec/codec.d.ts +2 -0
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +4 -3
- 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/codec/versioned/codec.d.ts +13 -1
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js +18 -3
- package/lib/codec/versioned/codec.js.map +1 -1
- package/lib/codec/versioned/format.d.ts +22 -1
- package/lib/codec/versioned/format.d.ts.map +1 -1
- package/lib/codec/versioned/format.js +15 -2
- package/lib/codec/versioned/format.js.map +1 -1
- package/lib/codec/versioned/index.d.ts +1 -1
- package/lib/codec/versioned/index.d.ts.map +1 -1
- package/lib/codec/versioned/index.js +1 -1
- package/lib/codec/versioned/index.js.map +1 -1
- package/lib/core/index.d.ts +1 -2
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +0 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/index.d.ts +1 -1
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +78 -0
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +8 -7
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +25 -45
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.js +11 -0
- package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts +3 -2
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js +2 -2
- package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.js +1 -1
- package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
- package/lib/feature-libraries/flex-tree/observer.d.ts +17 -0
- package/lib/feature-libraries/flex-tree/observer.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/observer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts +5 -12
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js +35 -32
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -2
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +7 -8
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts +6 -4
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/formatCommon.js +7 -4
- package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +19 -14
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +30 -47
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/lib/feature-libraries/forest-summary/index.d.ts +1 -1
- package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/index.js +1 -1
- package/lib/feature-libraries/forest-summary/index.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +3 -3
- 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/indexing/anchorTreeIndex.d.ts +3 -3
- package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/lib/feature-libraries/indexing/index.d.ts +1 -1
- package/lib/feature-libraries/indexing/index.d.ts.map +1 -1
- package/lib/feature-libraries/indexing/index.js.map +1 -1
- package/lib/feature-libraries/indexing/types.d.ts +15 -13
- package/lib/feature-libraries/indexing/types.d.ts.map +1 -1
- package/lib/feature-libraries/indexing/types.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +4 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/independentView.js +3 -3
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +5 -0
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +33 -6
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +8 -8
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/tree.js +1 -1
- package/lib/shared-tree/tree.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +8 -1
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +49 -9
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +35 -3
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +124 -18
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree/unhydratedTreeContext.d.ts +20 -0
- package/lib/shared-tree/unhydratedTreeContext.d.ts.map +1 -0
- package/lib/shared-tree/unhydratedTreeContext.js +52 -0
- package/lib/shared-tree/unhydratedTreeContext.js.map +1 -0
- package/lib/shared-tree-core/transaction.d.ts +15 -27
- package/lib/shared-tree-core/transaction.d.ts.map +1 -1
- package/lib/shared-tree-core/transaction.js +7 -11
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/simple-tree/api/configuration.d.ts +4 -0
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/identifierIndex.d.ts +2 -2
- package/lib/simple-tree/api/identifierIndex.d.ts.map +1 -1
- package/lib/simple-tree/api/identifierIndex.js +2 -2
- package/lib/simple-tree/api/identifierIndex.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +3 -3
- 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 +3 -2
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +3 -2
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/simpleTreeIndex.d.ts +15 -13
- 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/snapshotCompatibilityChecker.d.ts +4 -4
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js +2 -2
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/lib/simple-tree/api/transactionTypes.d.ts +22 -25
- package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/transactionTypes.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +69 -132
- 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/index.d.ts +1 -1
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +1 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/text/textDomain.d.ts +27 -9
- package/lib/text/textDomain.d.ts.map +1 -1
- package/lib/text/textDomain.js +45 -9
- package/lib/text/textDomain.js.map +1 -1
- package/lib/text/textDomainFormatted.d.ts +14 -8
- package/lib/text/textDomainFormatted.d.ts.map +1 -1
- package/lib/text/textDomainFormatted.js +80 -8
- package/lib/text/textDomainFormatted.js.map +1 -1
- package/lib/util/rangeMap.d.ts +1 -0
- package/lib/util/rangeMap.d.ts.map +1 -1
- package/lib/util/rangeMap.js +5 -6
- package/lib/util/rangeMap.js.map +1 -1
- package/package.json +24 -24
- package/src/codec/codec.ts +5 -4
- package/src/codec/index.ts +1 -0
- package/src/codec/versioned/codec.ts +32 -6
- package/src/codec/versioned/format.ts +17 -2
- package/src/codec/versioned/index.ts +1 -1
- package/src/core/index.ts +2 -6
- package/src/core/rebase/index.ts +2 -0
- package/src/core/rebase/types.ts +80 -0
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +59 -78
- package/src/feature-libraries/chunked-forest/codec/format.ts +11 -0
- package/src/feature-libraries/chunked-forest/codec/index.ts +3 -3
- package/src/feature-libraries/chunked-forest/index.ts +2 -3
- package/src/feature-libraries/flex-tree/observer.ts +17 -0
- package/src/feature-libraries/forest-summary/codec.ts +46 -56
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +5 -14
- package/src/feature-libraries/forest-summary/formatCommon.ts +14 -19
- package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +44 -74
- package/src/feature-libraries/forest-summary/index.ts +1 -1
- package/src/feature-libraries/index.ts +2 -4
- package/src/feature-libraries/indexing/anchorTreeIndex.ts +3 -5
- package/src/feature-libraries/indexing/index.ts +1 -1
- package/src/feature-libraries/indexing/types.ts +15 -17
- package/src/index.ts +6 -3
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +3 -3
- package/src/shared-tree/schematizingTreeView.ts +43 -10
- package/src/shared-tree/sharedTree.ts +8 -10
- package/src/shared-tree/tree.ts +1 -1
- package/src/shared-tree/treeAlpha.ts +64 -11
- package/src/shared-tree/treeCheckout.ts +142 -21
- package/src/shared-tree/unhydratedTreeContext.ts +87 -0
- package/src/shared-tree-core/transaction.ts +19 -39
- package/src/simple-tree/api/configuration.ts +4 -0
- package/src/simple-tree/api/identifierIndex.ts +4 -4
- package/src/simple-tree/api/index.ts +3 -1
- package/src/simple-tree/api/schemaFactory.ts +3 -2
- package/src/simple-tree/api/simpleTreeIndex.ts +26 -20
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +4 -4
- package/src/simple-tree/api/transactionTypes.ts +24 -26
- package/src/simple-tree/api/tree.ts +92 -131
- package/src/simple-tree/index.ts +4 -2
- package/src/text/textDomain.ts +91 -12
- package/src/text/textDomainFormatted.ts +127 -15
- package/src/util/rangeMap.ts +5 -11
- package/dist/core/schema-view/index.d.ts +0 -6
- package/dist/core/schema-view/index.d.ts.map +0 -1
- package/dist/core/schema-view/index.js +0 -10
- package/dist/core/schema-view/index.js.map +0 -1
- package/dist/core/schema-view/view.d.ts +0 -31
- package/dist/core/schema-view/view.d.ts.map +0 -1
- package/dist/core/schema-view/view.js +0 -18
- package/dist/core/schema-view/view.js.map +0 -1
- package/dist/feature-libraries/forest-summary/formatV1.d.ts +0 -12
- package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +0 -1
- package/dist/feature-libraries/forest-summary/formatV1.js +0 -10
- package/dist/feature-libraries/forest-summary/formatV1.js.map +0 -1
- package/dist/feature-libraries/forest-summary/formatV2.d.ts +0 -12
- package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +0 -1
- package/dist/feature-libraries/forest-summary/formatV2.js +0 -10
- package/dist/feature-libraries/forest-summary/formatV2.js.map +0 -1
- package/lib/core/schema-view/index.d.ts +0 -6
- package/lib/core/schema-view/index.d.ts.map +0 -1
- package/lib/core/schema-view/index.js +0 -6
- package/lib/core/schema-view/index.js.map +0 -1
- package/lib/core/schema-view/view.d.ts +0 -31
- package/lib/core/schema-view/view.d.ts.map +0 -1
- package/lib/core/schema-view/view.js +0 -14
- package/lib/core/schema-view/view.js.map +0 -1
- package/lib/feature-libraries/forest-summary/formatV1.d.ts +0 -12
- package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +0 -1
- package/lib/feature-libraries/forest-summary/formatV1.js +0 -7
- package/lib/feature-libraries/forest-summary/formatV1.js.map +0 -1
- package/lib/feature-libraries/forest-summary/formatV2.d.ts +0 -12
- package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +0 -1
- package/lib/feature-libraries/forest-summary/formatV2.js +0 -7
- package/lib/feature-libraries/forest-summary/formatV2.js.map +0 -1
- package/src/core/schema-view/README.md +0 -9
- package/src/core/schema-view/index.ts +0 -10
- package/src/core/schema-view/view.ts +0 -38
- package/src/feature-libraries/forest-summary/formatV1.ts +0 -11
- package/src/feature-libraries/forest-summary/formatV2.ts +0 -11
package/src/text/textDomain.ts
CHANGED
|
@@ -3,14 +3,22 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { compareArrays, debugAssert } from "@fluidframework/core-utils/internal";
|
|
7
|
+
|
|
8
|
+
import { EmptyKey, mapCursorField, type ITreeCursorSynchronous } from "../core/index.js";
|
|
7
9
|
import {
|
|
8
10
|
eraseSchemaDetails,
|
|
11
|
+
getInnerNode,
|
|
9
12
|
SchemaFactory,
|
|
10
13
|
SchemaFactoryAlpha,
|
|
11
14
|
TreeArrayNode,
|
|
12
15
|
} from "../simple-tree/index.js";
|
|
16
|
+
// eslint-disable-next-line import-x/no-duplicates
|
|
13
17
|
import type { TreeNode, WithType } from "../simple-tree/index.js";
|
|
18
|
+
// Add some unused imports which show up in the generated d.ts file.
|
|
19
|
+
// This prevents them from getting inline imports generated, cleaning up the d.ts file and API reports.
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports, import-x/no-duplicates
|
|
21
|
+
import type { NodeKind, TreeNodeSchema } from "../simple-tree/index.js";
|
|
14
22
|
|
|
15
23
|
const sf = new SchemaFactoryAlpha("com.fluidframework.text");
|
|
16
24
|
|
|
@@ -26,16 +34,49 @@ class TextNode
|
|
|
26
34
|
TreeArrayNode.spread(charactersFromString(additionalCharacters)),
|
|
27
35
|
);
|
|
28
36
|
}
|
|
29
|
-
public removeRange(index: number,
|
|
30
|
-
this.content.removeRange(index,
|
|
37
|
+
public removeRange(index: number | undefined, end: number | undefined): void {
|
|
38
|
+
this.content.removeRange(index, end);
|
|
31
39
|
}
|
|
32
40
|
public characters(): Iterable<string> {
|
|
33
41
|
return this.content[Symbol.iterator]();
|
|
34
42
|
}
|
|
43
|
+
|
|
44
|
+
public characterCount(): number {
|
|
45
|
+
return this.content.length;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public charactersCopy(): string[] {
|
|
49
|
+
const result = this.content.charactersCopy();
|
|
50
|
+
debugAssert(
|
|
51
|
+
() =>
|
|
52
|
+
compareArrays(result, this.charactersCopy_reference()) ||
|
|
53
|
+
"invalid charactersCopy optimizations",
|
|
54
|
+
);
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
|
|
35
58
|
public fullString(): string {
|
|
59
|
+
const result = this.content.fullString();
|
|
60
|
+
debugAssert(
|
|
61
|
+
() => result === this.fullString_reference() || "invalid fullString optimizations",
|
|
62
|
+
);
|
|
63
|
+
return result;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Unoptimized trivially correct implementation of fullString.
|
|
68
|
+
*/
|
|
69
|
+
public fullString_reference(): string {
|
|
36
70
|
return this.content.join("");
|
|
37
71
|
}
|
|
38
72
|
|
|
73
|
+
/**
|
|
74
|
+
* Unoptimized trivially correct implementation of charactersCopy.
|
|
75
|
+
*/
|
|
76
|
+
public charactersCopy_reference(): string[] {
|
|
77
|
+
return [...this.content];
|
|
78
|
+
}
|
|
79
|
+
|
|
39
80
|
public static fromString(value: string): TextNode {
|
|
40
81
|
// Constructing an ArrayNode from an iterator is supported, so creating an array from the iterable of characters seems like its not necessary here,
|
|
41
82
|
// but to reduce the risk of incorrect data interpretation, we actually ban this in the special case where the iterable is a string directly, which is the case here.
|
|
@@ -58,7 +99,25 @@ export function charactersFromString(value: string): Iterable<string> {
|
|
|
58
99
|
return value;
|
|
59
100
|
}
|
|
60
101
|
|
|
61
|
-
class StringArray extends sf.array("StringArray", SchemaFactory.string) {
|
|
102
|
+
class StringArray extends sf.array("StringArray", SchemaFactory.string) {
|
|
103
|
+
public withBorrowedSequenceCursor<T>(f: (cursor: ITreeCursorSynchronous) => T): T {
|
|
104
|
+
const cursor = getInnerNode(this).borrowCursor();
|
|
105
|
+
cursor.enterField(EmptyKey);
|
|
106
|
+
const result = f(cursor);
|
|
107
|
+
cursor.exitField();
|
|
108
|
+
return result;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
public charactersCopy(): string[] {
|
|
112
|
+
return this.withBorrowedSequenceCursor((cursor) =>
|
|
113
|
+
mapCursorField(cursor, () => cursor.value as string),
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
public fullString(): string {
|
|
118
|
+
return this.charactersCopy().join("");
|
|
119
|
+
}
|
|
120
|
+
}
|
|
62
121
|
|
|
63
122
|
/**
|
|
64
123
|
* A collection of text related types, schema and utilities for working with text beyond the basic {@link SchemaStatics.string}.
|
|
@@ -120,12 +179,12 @@ class StringArray extends sf.array("StringArray", SchemaFactory.string) {}
|
|
|
120
179
|
*
|
|
121
180
|
* Part of that work will be establishing and documenting those patterns so other components with complex encodings can follow them,
|
|
122
181
|
* in addition to implementing them for text.
|
|
123
|
-
* @
|
|
182
|
+
* @alpha
|
|
124
183
|
*/
|
|
125
184
|
export namespace TextAsTree {
|
|
126
185
|
/**
|
|
127
186
|
* Statics for text nodes.
|
|
128
|
-
* @
|
|
187
|
+
* @alpha
|
|
129
188
|
*/
|
|
130
189
|
export interface Statics {
|
|
131
190
|
/**
|
|
@@ -150,7 +209,7 @@ export namespace TextAsTree {
|
|
|
150
209
|
*
|
|
151
210
|
* @see {@link TextAsTree.Statics.fromString} for construction.
|
|
152
211
|
* @see {@link TextAsTree.(Tree:type)} for schema.
|
|
153
|
-
* @
|
|
212
|
+
* @alpha
|
|
154
213
|
*/
|
|
155
214
|
export interface Members {
|
|
156
215
|
/**
|
|
@@ -160,6 +219,20 @@ export namespace TextAsTree {
|
|
|
160
219
|
*/
|
|
161
220
|
characters(): Iterable<string>;
|
|
162
221
|
|
|
222
|
+
/**
|
|
223
|
+
* Optimized way to get a copy of the {@link TextAsTree.Members.characters} in an array.
|
|
224
|
+
*/
|
|
225
|
+
charactersCopy(): string[];
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Gets the number of characters currently in the text.
|
|
229
|
+
* @remarks
|
|
230
|
+
* The length of {@link TextAsTree.Members.characters}.
|
|
231
|
+
* This is not the length of the string returned by {@link TextAsTree.Members.fullString},
|
|
232
|
+
* as that string may contain characters which are made up of multiple UTF-16 code units.
|
|
233
|
+
*/
|
|
234
|
+
characterCount(): number;
|
|
235
|
+
|
|
163
236
|
/**
|
|
164
237
|
* Copy the content of this node into a string.
|
|
165
238
|
*/
|
|
@@ -184,16 +257,22 @@ export namespace TextAsTree {
|
|
|
184
257
|
* Remove a range from a string based on character index.
|
|
185
258
|
* See {@link (TreeArrayNode:interface).removeRange} for more details on the behavior.
|
|
186
259
|
*/
|
|
187
|
-
removeRange(
|
|
260
|
+
removeRange(startIndex: number | undefined, endIndex: number | undefined): void;
|
|
188
261
|
}
|
|
189
262
|
|
|
190
263
|
/**
|
|
191
|
-
* Schema for a
|
|
264
|
+
* Schema for a {@link TextAsTree.(Tree:variable)} node.
|
|
192
265
|
* @remarks
|
|
193
|
-
* See {@link TextAsTree.
|
|
194
|
-
*
|
|
195
|
-
* @internal
|
|
266
|
+
* See {@link TextAsTree.Statics} for static APIs on this schema, including construction.
|
|
267
|
+
* @alpha
|
|
196
268
|
*/
|
|
197
269
|
export const Tree = eraseSchemaDetails<Members, Statics>()(TextNode);
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Node for the {@link TextAsTree.(Tree:type)} schema exposing the {@link TextAsTree.Members} API.
|
|
273
|
+
* @remarks
|
|
274
|
+
* Create using {@link TextAsTree.Statics.fromString}.
|
|
275
|
+
* @alpha
|
|
276
|
+
*/
|
|
198
277
|
export type Tree = Members & TreeNode & WithType<"com.fluidframework.text.Text">;
|
|
199
278
|
}
|
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { assert } from "@fluidframework/core-utils/internal";
|
|
6
|
+
import { assert, compareArrays, debugAssert, fail } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
8
8
|
|
|
9
|
-
import { EmptyKey } from "../core/index.js";
|
|
9
|
+
import { EmptyKey, mapCursorField, type ITreeCursorSynchronous } from "../core/index.js";
|
|
10
|
+
import { currentObserver } from "../feature-libraries/index.js";
|
|
10
11
|
import { TreeAlpha } from "../shared-tree/index.js";
|
|
11
12
|
import {
|
|
12
13
|
enumFromStrings,
|
|
13
14
|
eraseSchemaDetails,
|
|
15
|
+
getInnerNode,
|
|
14
16
|
SchemaFactory,
|
|
15
17
|
SchemaFactoryAlpha,
|
|
16
18
|
TreeArrayNode,
|
|
@@ -22,7 +24,7 @@ import type {
|
|
|
22
24
|
TreeNodeFromImplicitAllowedTypes,
|
|
23
25
|
WithType,
|
|
24
26
|
} from "../simple-tree/index.js";
|
|
25
|
-
import { mapIterable } from "../util/index.js";
|
|
27
|
+
import { mapIterable, validateIndex, validateIndexRange } from "../util/index.js";
|
|
26
28
|
|
|
27
29
|
import { charactersFromString, type TextAsTree } from "./textDomain.js";
|
|
28
30
|
|
|
@@ -43,16 +45,51 @@ class TextNode
|
|
|
43
45
|
TreeArrayNode.spread(textAtomsFromString(additionalCharacters, this.defaultFormat)),
|
|
44
46
|
);
|
|
45
47
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
|
|
49
|
+
public removeRange(index: number | undefined, end: number | undefined): void {
|
|
50
|
+
this.content.removeRange(index, end);
|
|
48
51
|
}
|
|
52
|
+
|
|
49
53
|
public characters(): Iterable<string> {
|
|
50
54
|
return mapIterable(this.content, (atom) => atom.content.content);
|
|
51
55
|
}
|
|
56
|
+
|
|
57
|
+
public charactersCopy(): string[] {
|
|
58
|
+
const result = this.content.charactersCopy();
|
|
59
|
+
debugAssert(
|
|
60
|
+
() =>
|
|
61
|
+
compareArrays(result, this.charactersCopy_reference()) ||
|
|
62
|
+
"invalid charactersCopy optimizations",
|
|
63
|
+
);
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
public characterCount(): number {
|
|
68
|
+
return this.content.length;
|
|
69
|
+
}
|
|
70
|
+
|
|
52
71
|
public fullString(): string {
|
|
72
|
+
const result = this.content.fullString();
|
|
73
|
+
debugAssert(
|
|
74
|
+
() => result === this.fullString_reference() || "invalid fullString optimizations",
|
|
75
|
+
);
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* A non-optimized reference implementation of fullString.
|
|
81
|
+
*/
|
|
82
|
+
public fullString_reference(): string {
|
|
53
83
|
return [...this.characters()].join("");
|
|
54
84
|
}
|
|
55
85
|
|
|
86
|
+
/**
|
|
87
|
+
* Unoptimized trivially correct implementation of charactersCopy.
|
|
88
|
+
*/
|
|
89
|
+
public charactersCopy_reference(): string[] {
|
|
90
|
+
return [...this.characters()];
|
|
91
|
+
}
|
|
92
|
+
|
|
56
93
|
public static fromString(
|
|
57
94
|
value: string,
|
|
58
95
|
format?: FormattedTextAsTree.CharacterFormat,
|
|
@@ -70,7 +107,7 @@ class TextNode
|
|
|
70
107
|
});
|
|
71
108
|
}
|
|
72
109
|
|
|
73
|
-
public charactersWithFormatting():
|
|
110
|
+
public charactersWithFormatting(): readonly FormattedTextAsTree.StringAtom[] {
|
|
74
111
|
return this.content;
|
|
75
112
|
}
|
|
76
113
|
public insertWithFormattingAt(
|
|
@@ -80,14 +117,25 @@ class TextNode
|
|
|
80
117
|
this.content.insertAt(index, TreeArrayNode.spread(additionalCharacters));
|
|
81
118
|
}
|
|
82
119
|
public formatRange(
|
|
83
|
-
|
|
84
|
-
|
|
120
|
+
start: number | undefined,
|
|
121
|
+
end: number | undefined,
|
|
85
122
|
format: Partial<FormattedTextAsTree.CharacterFormat>,
|
|
86
123
|
): void {
|
|
124
|
+
const formatStart = start ?? 0;
|
|
125
|
+
validateIndex(formatStart, this.content, "FormattedTextAsTree.formatRange", true);
|
|
126
|
+
|
|
127
|
+
const formatEnd = Math.min(this.content.length, end ?? this.content.length);
|
|
128
|
+
validateIndexRange(
|
|
129
|
+
formatStart,
|
|
130
|
+
formatEnd,
|
|
131
|
+
this.content,
|
|
132
|
+
"FormattedTextAsTree.formatRange",
|
|
133
|
+
);
|
|
134
|
+
|
|
87
135
|
const branch = TreeAlpha.branch(this);
|
|
88
136
|
|
|
89
137
|
const applyFormatting = (): void => {
|
|
90
|
-
for (let i =
|
|
138
|
+
for (let i = formatStart; i < formatEnd; i++) {
|
|
91
139
|
const atom = this.content[i];
|
|
92
140
|
if (atom === undefined) {
|
|
93
141
|
throw new UsageError("Index out of bounds while formatting text range.");
|
|
@@ -149,7 +197,61 @@ function textAtomsFromString(
|
|
|
149
197
|
return result;
|
|
150
198
|
}
|
|
151
199
|
|
|
152
|
-
class StringArray extends sf.array("StringArray", [() => FormattedTextAsTree.StringAtom]) {
|
|
200
|
+
class StringArray extends sf.array("StringArray", [() => FormattedTextAsTree.StringAtom]) {
|
|
201
|
+
public withBorrowedSequenceCursor<T>(f: (cursor: ITreeCursorSynchronous) => T): T {
|
|
202
|
+
const innerNode = getInnerNode(this);
|
|
203
|
+
// Since the cursor will be used to read content from the tree and won't track observations,
|
|
204
|
+
// treat it as if it observed the whole subtree.
|
|
205
|
+
currentObserver?.observeNodeDeep(innerNode);
|
|
206
|
+
const cursor = innerNode.borrowCursor();
|
|
207
|
+
cursor.enterField(EmptyKey);
|
|
208
|
+
const result = f(cursor);
|
|
209
|
+
cursor.exitField();
|
|
210
|
+
return result;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
public charactersCopy(): string[] {
|
|
214
|
+
return this.withBorrowedSequenceCursor((cursor) =>
|
|
215
|
+
mapCursorField(cursor, () => {
|
|
216
|
+
debugAssert(
|
|
217
|
+
() =>
|
|
218
|
+
cursor.type === FormattedTextAsTree.StringAtom.identifier ||
|
|
219
|
+
"invalid fullString type optimizations",
|
|
220
|
+
);
|
|
221
|
+
cursor.enterField(EmptyKey);
|
|
222
|
+
cursor.enterNode(0);
|
|
223
|
+
let content: string;
|
|
224
|
+
switch (cursor.type) {
|
|
225
|
+
case FormattedTextAsTree.StringTextAtom.identifier: {
|
|
226
|
+
cursor.enterField(EmptyKey);
|
|
227
|
+
cursor.enterNode(0);
|
|
228
|
+
content = cursor.value as string;
|
|
229
|
+
debugAssert(
|
|
230
|
+
() => typeof content === "string" || "invalid fullString type optimizations",
|
|
231
|
+
);
|
|
232
|
+
cursor.exitNode();
|
|
233
|
+
cursor.exitField();
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
case FormattedTextAsTree.StringLineAtom.identifier: {
|
|
237
|
+
content = "\n";
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
default: {
|
|
241
|
+
fail(0xcde /* Unsupported node type in text array */, () => `${cursor.type}`);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
cursor.exitNode();
|
|
245
|
+
cursor.exitField();
|
|
246
|
+
return content;
|
|
247
|
+
}),
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
public fullString(): string {
|
|
252
|
+
return this.charactersCopy().join("");
|
|
253
|
+
}
|
|
254
|
+
}
|
|
153
255
|
|
|
154
256
|
/**
|
|
155
257
|
* A collection of text related types, schema and utilities for working with text beyond the basic {@link SchemaStatics.string}.
|
|
@@ -284,11 +386,15 @@ export namespace FormattedTextAsTree {
|
|
|
284
386
|
defaultFormat: CharacterFormat;
|
|
285
387
|
|
|
286
388
|
/**
|
|
287
|
-
* Gets an
|
|
389
|
+
* Gets an array type view of the characters currently in the text.
|
|
288
390
|
* @remarks
|
|
289
391
|
* This iterator matches the behavior of {@link (TreeArrayNode:interface)} with respect to edits during iteration.
|
|
392
|
+
* @privateRemarks
|
|
393
|
+
* Currently this is implemented by a node and changes with the text over time.
|
|
394
|
+
* We might not want to leak a node like this in the API.
|
|
395
|
+
* Providing a way to index and iterate separately might be better.
|
|
290
396
|
*/
|
|
291
|
-
charactersWithFormatting():
|
|
397
|
+
charactersWithFormatting(): readonly StringAtom[];
|
|
292
398
|
|
|
293
399
|
/**
|
|
294
400
|
* Insert a range of characters into the string based on character index.
|
|
@@ -310,11 +416,17 @@ export namespace FormattedTextAsTree {
|
|
|
310
416
|
|
|
311
417
|
/**
|
|
312
418
|
* Apply formatting to a range of characters based on character index.
|
|
313
|
-
* @param startIndex - The starting index of the range to format.
|
|
314
|
-
* @param
|
|
419
|
+
* @param startIndex - The starting index (inclusive) of the range to format.
|
|
420
|
+
* @param endIndex - The ending index (exclusive) of the range to format.
|
|
315
421
|
* @param format - The formatting to apply to the specified range.
|
|
422
|
+
* @remarks
|
|
423
|
+
* The start and end behave the same as in {@link (TreeArrayNode:interface).removeRange}.
|
|
316
424
|
*/
|
|
317
|
-
formatRange(
|
|
425
|
+
formatRange(
|
|
426
|
+
startIndex: number | undefined,
|
|
427
|
+
endIndex: number | undefined,
|
|
428
|
+
format: Partial<CharacterFormat>,
|
|
429
|
+
): void;
|
|
318
430
|
}
|
|
319
431
|
|
|
320
432
|
/**
|
package/src/util/rangeMap.ts
CHANGED
|
@@ -5,8 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
import { assert, oob } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import { BTree } from "@tylerbu/sorted-btree-es6";
|
|
8
|
-
// eslint-disable-next-line import-x/no-internal-modules
|
|
9
|
-
import { union } from "@tylerbu/sorted-btree-es6/extended/union";
|
|
10
8
|
|
|
11
9
|
/**
|
|
12
10
|
* RangeMap represents a mapping from keys of type K to values of type V or undefined.
|
|
@@ -215,6 +213,7 @@ export class RangeMap<K, V> {
|
|
|
215
213
|
|
|
216
214
|
/**
|
|
217
215
|
* Returns a new map which contains the entries from both input maps.
|
|
216
|
+
* Whenever both maps contain entires for the same keys, the value from map `b` is used in the returned map.
|
|
218
217
|
*/
|
|
219
218
|
public static union<K, V>(a: RangeMap<K, V>, b: RangeMap<K, V>): RangeMap<K, V> {
|
|
220
219
|
assert(
|
|
@@ -224,15 +223,10 @@ export class RangeMap<K, V> {
|
|
|
224
223
|
0xaae /* Maps should have the same behavior */,
|
|
225
224
|
);
|
|
226
225
|
|
|
227
|
-
const merged =
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
b.tree,
|
|
232
|
-
(_key, _val1, val2) => {
|
|
233
|
-
return val2;
|
|
234
|
-
},
|
|
235
|
-
);
|
|
226
|
+
const merged = a.clone();
|
|
227
|
+
for (const entry of b.entries()) {
|
|
228
|
+
merged.set(entry.start, entry.length, entry.value);
|
|
229
|
+
}
|
|
236
230
|
|
|
237
231
|
return merged;
|
|
238
232
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/schema-view/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,iBAAiB,GACjB,MAAM,WAAW,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.AdaptedViewSchema = void 0;
|
|
8
|
-
var view_js_1 = require("./view.js");
|
|
9
|
-
Object.defineProperty(exports, "AdaptedViewSchema", { enumerable: true, get: function () { return view_js_1.AdaptedViewSchema; } });
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/schema-view/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qCAImB;AADlB,4GAAA,iBAAiB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype Adapters,\n\ttype TreeAdapter,\n\tAdaptedViewSchema,\n} from \"./view.js\";\n"]}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import type { TreeNodeSchemaIdentifier, TreeStoredSchema } from "../schema-stored/index.js";
|
|
6
|
-
/**
|
|
7
|
-
* APIs for applying `view schema` to documents.
|
|
8
|
-
*/
|
|
9
|
-
export interface TreeAdapter {
|
|
10
|
-
readonly output: TreeNodeSchemaIdentifier;
|
|
11
|
-
readonly input: TreeNodeSchemaIdentifier;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Minimal selection of adapters (nothing for general out of schema, field level adjustments etc.).
|
|
15
|
-
* Would be used with schematize and have actual conversion/update functionality.
|
|
16
|
-
*
|
|
17
|
-
* TODO: Support more kinds of adapters
|
|
18
|
-
* TODO: support efficient lookup of adapters
|
|
19
|
-
*/
|
|
20
|
-
export interface Adapters {
|
|
21
|
-
readonly tree?: readonly TreeAdapter[];
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* A collection of View information for schema, including policy.
|
|
25
|
-
*/
|
|
26
|
-
export declare class AdaptedViewSchema {
|
|
27
|
-
readonly adapters: Adapters;
|
|
28
|
-
readonly adaptedForViewSchema: TreeStoredSchema;
|
|
29
|
-
constructor(adapters: Adapters, adaptedForViewSchema: TreeStoredSchema);
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=view.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/core/schema-view/view.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE5F;;GAEG;AAEH,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,MAAM,EAAE,wBAAwB,CAAC;IAC1C,QAAQ,CAAC,KAAK,EAAE,wBAAwB,CAAC;CAGzC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;CACvC;AAED;;GAEG;AACH,qBAAa,iBAAiB;aAEZ,QAAQ,EAAE,QAAQ;aAClB,oBAAoB,EAAE,gBAAgB;gBADtC,QAAQ,EAAE,QAAQ,EAClB,oBAAoB,EAAE,gBAAgB;CAEvD"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.AdaptedViewSchema = void 0;
|
|
8
|
-
/**
|
|
9
|
-
* A collection of View information for schema, including policy.
|
|
10
|
-
*/
|
|
11
|
-
class AdaptedViewSchema {
|
|
12
|
-
constructor(adapters, adaptedForViewSchema) {
|
|
13
|
-
this.adapters = adapters;
|
|
14
|
-
this.adaptedForViewSchema = adaptedForViewSchema;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.AdaptedViewSchema = AdaptedViewSchema;
|
|
18
|
-
//# sourceMappingURL=view.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../src/core/schema-view/view.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA0BH;;GAEG;AACH,MAAa,iBAAiB;IAC7B,YACiB,QAAkB,EAClB,oBAAsC;QADtC,aAAQ,GAAR,QAAQ,CAAU;QAClB,yBAAoB,GAApB,oBAAoB,CAAkB;IACpD,CAAC;CACJ;AALD,8CAKC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { TreeNodeSchemaIdentifier, TreeStoredSchema } from \"../schema-stored/index.js\";\n\n/**\n * APIs for applying `view schema` to documents.\n */\n\nexport interface TreeAdapter {\n\treadonly output: TreeNodeSchemaIdentifier;\n\treadonly input: TreeNodeSchemaIdentifier;\n\n\t// TODO: include actual adapter functionality, not just what types it converts\n}\n\n/**\n * Minimal selection of adapters (nothing for general out of schema, field level adjustments etc.).\n * Would be used with schematize and have actual conversion/update functionality.\n *\n * TODO: Support more kinds of adapters\n * TODO: support efficient lookup of adapters\n */\nexport interface Adapters {\n\treadonly tree?: readonly TreeAdapter[];\n}\n\n/**\n * A collection of View information for schema, including policy.\n */\nexport class AdaptedViewSchema {\n\tpublic constructor(\n\t\tpublic readonly adapters: Adapters,\n\t\tpublic readonly adaptedForViewSchema: TreeStoredSchema,\n\t) {}\n}\n"]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import type { Static } from "@sinclair/typebox";
|
|
6
|
-
export declare const FormatV1: import("@sinclair/typebox").TObject<{
|
|
7
|
-
version: import("@sinclair/typebox").TLiteral<import("../../util/brand.js").Brand<1, "ForestFormatVersion">>;
|
|
8
|
-
keys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("../../core/index.js").FieldKey>>;
|
|
9
|
-
fields: import("@sinclair/typebox").TUnsafe<import("../../index.js").JsonCompatibleReadOnly>;
|
|
10
|
-
}>;
|
|
11
|
-
export type FormatV1 = Static<typeof FormatV1>;
|
|
12
|
-
//# sourceMappingURL=formatV1.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatV1.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/formatV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIhD,eAAO,MAAM,QAAQ;;;;EAAuC,CAAC;AAC7D,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.FormatV1 = void 0;
|
|
8
|
-
const formatCommon_js_1 = require("./formatCommon.js");
|
|
9
|
-
exports.FormatV1 = (0, formatCommon_js_1.FormatCommon)(formatCommon_js_1.ForestFormatVersion.v1);
|
|
10
|
-
//# sourceMappingURL=formatV1.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatV1.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/formatV1.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,uDAAsE;AAEzD,QAAA,QAAQ,GAAG,IAAA,8BAAY,EAAC,qCAAmB,CAAC,EAAE,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Static } from \"@sinclair/typebox\";\n\nimport { FormatCommon, ForestFormatVersion } from \"./formatCommon.js\";\n\nexport const FormatV1 = FormatCommon(ForestFormatVersion.v1);\nexport type FormatV1 = Static<typeof FormatV1>;\n"]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import type { Static } from "@sinclair/typebox";
|
|
6
|
-
export declare const FormatV2: import("@sinclair/typebox").TObject<{
|
|
7
|
-
version: import("@sinclair/typebox").TLiteral<import("../../util/brand.js").Brand<2, "ForestFormatVersion">>;
|
|
8
|
-
keys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("../../core/index.js").FieldKey>>;
|
|
9
|
-
fields: import("@sinclair/typebox").TUnsafe<import("../../index.js").JsonCompatibleReadOnly>;
|
|
10
|
-
}>;
|
|
11
|
-
export type FormatV2 = Static<typeof FormatV2>;
|
|
12
|
-
//# sourceMappingURL=formatV2.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatV2.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/formatV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIhD,eAAO,MAAM,QAAQ;;;;EAAuC,CAAC;AAC7D,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.FormatV2 = void 0;
|
|
8
|
-
const formatCommon_js_1 = require("./formatCommon.js");
|
|
9
|
-
exports.FormatV2 = (0, formatCommon_js_1.FormatCommon)(formatCommon_js_1.ForestFormatVersion.v2);
|
|
10
|
-
//# sourceMappingURL=formatV2.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatV2.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/formatV2.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,uDAAsE;AAEzD,QAAA,QAAQ,GAAG,IAAA,8BAAY,EAAC,qCAAmB,CAAC,EAAE,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Static } from \"@sinclair/typebox\";\n\nimport { FormatCommon, ForestFormatVersion } from \"./formatCommon.js\";\n\nexport const FormatV2 = FormatCommon(ForestFormatVersion.v2);\nexport type FormatV2 = Static<typeof FormatV2>;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/schema-view/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,iBAAiB,GACjB,MAAM,WAAW,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/schema-view/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGN,iBAAiB,GACjB,MAAM,WAAW,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype Adapters,\n\ttype TreeAdapter,\n\tAdaptedViewSchema,\n} from \"./view.js\";\n"]}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import type { TreeNodeSchemaIdentifier, TreeStoredSchema } from "../schema-stored/index.js";
|
|
6
|
-
/**
|
|
7
|
-
* APIs for applying `view schema` to documents.
|
|
8
|
-
*/
|
|
9
|
-
export interface TreeAdapter {
|
|
10
|
-
readonly output: TreeNodeSchemaIdentifier;
|
|
11
|
-
readonly input: TreeNodeSchemaIdentifier;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Minimal selection of adapters (nothing for general out of schema, field level adjustments etc.).
|
|
15
|
-
* Would be used with schematize and have actual conversion/update functionality.
|
|
16
|
-
*
|
|
17
|
-
* TODO: Support more kinds of adapters
|
|
18
|
-
* TODO: support efficient lookup of adapters
|
|
19
|
-
*/
|
|
20
|
-
export interface Adapters {
|
|
21
|
-
readonly tree?: readonly TreeAdapter[];
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* A collection of View information for schema, including policy.
|
|
25
|
-
*/
|
|
26
|
-
export declare class AdaptedViewSchema {
|
|
27
|
-
readonly adapters: Adapters;
|
|
28
|
-
readonly adaptedForViewSchema: TreeStoredSchema;
|
|
29
|
-
constructor(adapters: Adapters, adaptedForViewSchema: TreeStoredSchema);
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=view.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/core/schema-view/view.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE5F;;GAEG;AAEH,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,MAAM,EAAE,wBAAwB,CAAC;IAC1C,QAAQ,CAAC,KAAK,EAAE,wBAAwB,CAAC;CAGzC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;CACvC;AAED;;GAEG;AACH,qBAAa,iBAAiB;aAEZ,QAAQ,EAAE,QAAQ;aAClB,oBAAoB,EAAE,gBAAgB;gBADtC,QAAQ,EAAE,QAAQ,EAClB,oBAAoB,EAAE,gBAAgB;CAEvD"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* A collection of View information for schema, including policy.
|
|
7
|
-
*/
|
|
8
|
-
export class AdaptedViewSchema {
|
|
9
|
-
constructor(adapters, adaptedForViewSchema) {
|
|
10
|
-
this.adapters = adapters;
|
|
11
|
-
this.adaptedForViewSchema = adaptedForViewSchema;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=view.js.map
|