@fluidframework/tree 2.103.0 → 2.111.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 +1 -0
- package/CHANGELOG.md +109 -0
- package/api-report/tree.alpha.api.md +60 -34
- package/api-report/tree.beta.api.md +49 -3
- package/api-report/tree.legacy.beta.api.md +49 -3
- package/dist/codec/versioned/format.js +2 -24
- package/dist/codec/versioned/format.js.map +1 -1
- package/dist/core/change-family/changeFamily.d.ts +3 -10
- package/dist/core/change-family/changeFamily.d.ts.map +1 -1
- package/dist/core/change-family/changeFamily.js.map +1 -1
- package/dist/core/rebase/types.d.ts +2 -2
- package/dist/core/rebase/types.js +2 -24
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/schema-stored/formatV1.js +2 -24
- package/dist/core/schema-stored/formatV1.js.map +1 -1
- package/dist/core/schema-stored/formatV2.js +2 -24
- package/dist/core/schema-stored/formatV2.js.map +1 -1
- package/dist/core/schema-stored/index.js +3 -25
- package/dist/core/schema-stored/index.js.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts +2 -2
- package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/dist/core/tree/anchorSet.js +4 -8
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.js +2 -24
- package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV2.js +2 -24
- package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
- package/dist/core/tree/persistedTreeTextFormat.js +2 -24
- package/dist/core/tree/persistedTreeTextFormat.js.map +1 -1
- package/dist/entrypoints/alpha.d.ts +1 -1
- package/dist/entrypoints/alpha.d.ts.map +1 -1
- package/dist/entrypoints/alpha.js.map +1 -1
- package/dist/entrypoints/beta.d.ts +1 -1
- package/dist/entrypoints/beta.d.ts.map +1 -1
- package/dist/entrypoints/beta.js.map +1 -1
- package/dist/entrypoints/internal.js +2 -15
- package/dist/entrypoints/internal.js.map +1 -1
- package/dist/entrypoints/legacy.d.ts +1 -1
- package/dist/entrypoints/legacy.d.ts.map +1 -1
- package/dist/entrypoints/legacy.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +7 -11
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +19 -14
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +13 -32
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +85 -28
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +83 -9
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +4 -2
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +11 -0
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js +2 -24
- package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js +2 -24
- package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js +2 -24
- package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatVText.js +2 -24
- package/dist/feature-libraries/chunked-forest/codec/format/formatVText.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js +2 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js +3 -15
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.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 -1
- package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.js +9 -19
- package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +3 -13
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts +3 -3
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -2
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +4 -6
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/formatCommon.js +2 -24
- package/dist/feature-libraries/forest-summary/formatCommon.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 -25
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js +2 -24
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +9 -9
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +10 -30
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js +2 -24
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +2 -24
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +0 -5
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +11 -55
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js +2 -24
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js +2 -24
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.js +2 -24
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.js +2 -24
- package/dist/feature-libraries/schema-index/formatV1.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV2.js +2 -24
- package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV1.js +2 -24
- package/dist/feature-libraries/sequence-field/formatV1.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.js +2 -24
- package/dist/feature-libraries/sequence-field/formatV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV3.js +2 -24
- package/dist/feature-libraries/sequence-field/formatV3.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -25
- 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 +4 -7
- 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.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +6 -5
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +7 -41
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +5 -1
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +13 -49
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFormat.js +2 -24
- package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
- package/dist/shared-tree/transactionPostProcessor.d.ts +28 -0
- package/dist/shared-tree/transactionPostProcessor.d.ts.map +1 -0
- package/dist/shared-tree/transactionPostProcessor.js +28 -0
- package/dist/shared-tree/transactionPostProcessor.js.map +1 -0
- package/dist/shared-tree/treeAlpha.js +3 -3
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +28 -15
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +124 -145
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree/unhydratedTreeContext.d.ts +5 -5
- package/dist/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
- package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/dist/shared-tree-core/branch.js +13 -17
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts +3 -2
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +3 -9
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.js +2 -4
- package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +3 -3
- package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +3 -3
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +2 -24
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.js +2 -24
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js +2 -24
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.d.ts +5 -9
- package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +5 -10
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +1 -1
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +3 -2
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js +2 -24
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js +2 -24
- package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.js +2 -24
- package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +9 -44
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts +84 -9
- package/dist/shared-tree-core/transaction.d.ts.map +1 -1
- package/dist/shared-tree-core/transaction.js +94 -37
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +1 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts +3 -3
- package/dist/simple-tree/api/schemaCreationUtilities.js +3 -3
- package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +1 -1
- package/dist/simple-tree/api/schemaFactory.js +2 -2
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.js +2 -24
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +2 -2
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +4 -26
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/dist/simple-tree/api/transactionTypes.d.ts +91 -28
- 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 +96 -22
- 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.map +1 -1
- package/dist/simple-tree/api/treeBeta.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +83 -93
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +7 -7
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +6 -10
- package/dist/simple-tree/core/unhydratedFlexTree.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.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +2 -12
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +2 -6
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.js +2 -24
- package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
- package/dist/tableSchema.d.ts +50 -4
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +202 -106
- package/dist/tableSchema.js.map +1 -1
- package/dist/text/index.d.ts +1 -0
- package/dist/text/index.d.ts.map +1 -1
- package/dist/text/index.js +3 -1
- package/dist/text/index.js.map +1 -1
- package/dist/text/textDomainFormatted.d.ts +69 -758
- package/dist/text/textDomainFormatted.d.ts.map +1 -1
- package/dist/text/textDomainFormatted.js +275 -322
- package/dist/text/textDomainFormatted.js.map +1 -1
- package/dist/text/textDomainFormattedDefault.d.ts +273 -0
- package/dist/text/textDomainFormattedDefault.d.ts.map +1 -0
- package/dist/text/textDomainFormattedDefault.js +94 -0
- package/dist/text/textDomainFormattedDefault.js.map +1 -0
- package/dist/util/arrayUtilities.d.ts +20 -0
- package/dist/util/arrayUtilities.d.ts.map +1 -1
- package/dist/util/arrayUtilities.js +24 -1
- package/dist/util/arrayUtilities.js.map +1 -1
- package/dist/util/compressedIds.d.ts +118 -0
- package/dist/util/compressedIds.d.ts.map +1 -0
- package/dist/util/compressedIds.js +133 -0
- package/dist/util/compressedIds.js.map +1 -0
- package/dist/util/index.d.ts +2 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +11 -2
- package/dist/util/index.js.map +1 -1
- package/dist/util/rangeMap.d.ts +13 -0
- package/dist/util/rangeMap.d.ts.map +1 -1
- package/dist/util/rangeMap.js +69 -8
- package/dist/util/rangeMap.js.map +1 -1
- package/dist/util/typeboxBrand.js +2 -24
- package/dist/util/typeboxBrand.js.map +1 -1
- package/dist/util/utils.js +2 -24
- package/dist/util/utils.js.map +1 -1
- package/eslint.config.mts +0 -30
- package/lib/core/change-family/changeFamily.d.ts +3 -10
- package/lib/core/change-family/changeFamily.d.ts.map +1 -1
- package/lib/core/change-family/changeFamily.js.map +1 -1
- package/lib/core/rebase/types.d.ts +2 -2
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts +2 -2
- package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/lib/core/tree/anchorSet.js +1 -5
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/entrypoints/alpha.d.ts +1 -1
- package/lib/entrypoints/alpha.d.ts.map +1 -1
- package/lib/entrypoints/alpha.js.map +1 -1
- package/lib/entrypoints/beta.d.ts +1 -1
- package/lib/entrypoints/beta.d.ts.map +1 -1
- package/lib/entrypoints/beta.js.map +1 -1
- package/lib/entrypoints/legacy.d.ts +1 -1
- package/lib/entrypoints/legacy.d.ts.map +1 -1
- package/lib/entrypoints/legacy.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +1 -5
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +19 -14
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +14 -33
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +85 -28
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +82 -9
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +4 -2
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +12 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js +3 -15
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.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/lazyEntity.js +1 -11
- package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +1 -11
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts +3 -3
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -2
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +4 -6
- package/lib/feature-libraries/forest-summary/forestSummarizer.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/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +10 -10
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +10 -30
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +0 -5
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +1 -45
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- 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 +5 -8
- 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.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +6 -5
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +4 -38
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +5 -1
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +9 -45
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/transactionPostProcessor.d.ts +28 -0
- package/lib/shared-tree/transactionPostProcessor.d.ts.map +1 -0
- package/lib/shared-tree/transactionPostProcessor.js +23 -0
- package/lib/shared-tree/transactionPostProcessor.js.map +1 -0
- package/lib/shared-tree/treeAlpha.js +3 -3
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +28 -15
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +80 -101
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree/unhydratedTreeContext.d.ts +5 -5
- package/lib/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
- package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/lib/shared-tree-core/branch.js +1 -5
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts +3 -2
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +3 -9
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.js +3 -5
- package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +3 -3
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +3 -3
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.d.ts +5 -9
- package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +5 -10
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +1 -1
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +1 -1
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +4 -39
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts +84 -9
- package/lib/shared-tree-core/transaction.d.ts.map +1 -1
- package/lib/shared-tree-core/transaction.js +74 -17
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +1 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts +3 -3
- package/lib/simple-tree/api/schemaCreationUtilities.js +3 -3
- package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +1 -1
- package/lib/simple-tree/api/schemaFactory.js +2 -2
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +2 -2
- 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 +91 -28
- 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 +96 -22
- 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.map +1 -1
- package/lib/simple-tree/api/treeBeta.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +1 -11
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +7 -7
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +1 -5
- package/lib/simple-tree/core/unhydratedFlexTree.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.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +1 -11
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +1 -5
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/tableSchema.d.ts +50 -4
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +171 -75
- package/lib/tableSchema.js.map +1 -1
- package/lib/text/index.d.ts +1 -0
- package/lib/text/index.d.ts.map +1 -1
- package/lib/text/index.js +1 -0
- package/lib/text/index.js.map +1 -1
- package/lib/text/textDomainFormatted.d.ts +69 -758
- package/lib/text/textDomainFormatted.d.ts.map +1 -1
- package/lib/text/textDomainFormatted.js +277 -324
- package/lib/text/textDomainFormatted.js.map +1 -1
- package/lib/text/textDomainFormattedDefault.d.ts +273 -0
- package/lib/text/textDomainFormattedDefault.d.ts.map +1 -0
- package/lib/text/textDomainFormattedDefault.js +91 -0
- package/lib/text/textDomainFormattedDefault.js.map +1 -0
- package/lib/util/arrayUtilities.d.ts +20 -0
- package/lib/util/arrayUtilities.d.ts.map +1 -1
- package/lib/util/arrayUtilities.js +22 -0
- package/lib/util/arrayUtilities.js.map +1 -1
- package/lib/util/compressedIds.d.ts +118 -0
- package/lib/util/compressedIds.d.ts.map +1 -0
- package/lib/util/compressedIds.js +124 -0
- package/lib/util/compressedIds.js.map +1 -0
- package/lib/util/index.d.ts +2 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -1
- package/lib/util/index.js.map +1 -1
- package/lib/util/rangeMap.d.ts +13 -0
- package/lib/util/rangeMap.d.ts.map +1 -1
- package/lib/util/rangeMap.js +69 -8
- package/lib/util/rangeMap.js.map +1 -1
- package/package.json +25 -24
- package/src/core/change-family/changeFamily.ts +3 -12
- package/src/core/rebase/types.ts +2 -2
- package/src/core/schema-stored/storedSchemaRepository.ts +2 -2
- package/src/entrypoints/alpha.ts +12 -8
- package/src/entrypoints/beta.ts +8 -0
- package/src/entrypoints/legacy.ts +8 -0
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +35 -64
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +138 -42
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +32 -4
- package/src/feature-libraries/chunked-forest/codec/index.ts +1 -0
- package/src/feature-libraries/chunked-forest/codec/nodeEncoder.ts +7 -19
- package/src/feature-libraries/chunked-forest/index.ts +3 -0
- package/src/feature-libraries/forest-summary/codec.ts +5 -3
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +4 -5
- package/src/feature-libraries/index.ts +3 -0
- package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +13 -9
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +14 -47
- package/src/feature-libraries/modular-schema/modularChangeTypes.ts +0 -5
- package/src/index.ts +13 -8
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +5 -10
- package/src/shared-tree/index.ts +1 -0
- package/src/shared-tree/schematizingTreeView.ts +29 -25
- package/src/shared-tree/sharedTree.ts +18 -10
- package/src/shared-tree/transactionPostProcessor.ts +40 -0
- package/src/shared-tree/treeAlpha.ts +3 -3
- package/src/shared-tree/treeCheckout.ts +120 -95
- package/src/shared-tree/unhydratedTreeContext.ts +18 -15
- package/src/shared-tree-core/editManagerCodecs.ts +3 -2
- package/src/shared-tree-core/editManagerCodecsCommons.ts +10 -14
- package/src/shared-tree-core/editManagerCodecsV1toV4.ts +3 -2
- package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +3 -2
- package/src/shared-tree-core/editManagerSummarizer.ts +5 -9
- package/src/shared-tree-core/index.ts +8 -5
- package/src/shared-tree-core/sharedTreeCore.ts +3 -2
- package/src/shared-tree-core/transaction.ts +148 -18
- package/src/simple-tree/api/index.ts +13 -9
- package/src/simple-tree/api/schemaCreationUtilities.ts +3 -3
- package/src/simple-tree/api/schemaFactory.ts +2 -2
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +2 -2
- package/src/simple-tree/api/transactionTypes.ts +111 -39
- package/src/simple-tree/api/tree.ts +152 -47
- package/src/simple-tree/api/treeBeta.ts +2 -0
- package/src/simple-tree/core/treeNodeSchema.ts +7 -7
- package/src/simple-tree/index.ts +12 -8
- package/src/tableSchema.ts +306 -80
- package/src/text/index.ts +1 -0
- package/src/text/textDomainFormatted.ts +520 -415
- package/src/text/textDomainFormattedDefault.ts +150 -0
- package/src/util/arrayUtilities.ts +35 -0
- package/src/util/compressedIds.ts +216 -0
- package/src/util/index.ts +17 -0
- package/src/util/rangeMap.ts +108 -9
- package/tsconfig.json +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textDomainFormatted.d.ts","sourceRoot":"","sources":["../../src/text/textDomainFormatted.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"textDomainFormatted.d.ts","sourceRoot":"","sources":["../../src/text/textDomainFormatted.ts"],"names":[],"mappings":"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"}
|
|
@@ -13,287 +13,301 @@ const index_js_3 = require("../shared-tree/index.js");
|
|
|
13
13
|
const index_js_4 = require("../simple-tree/index.js");
|
|
14
14
|
const index_js_5 = require("../util/index.js");
|
|
15
15
|
const textDomain_js_1 = require("./textDomain.js");
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
fullString() {
|
|
43
|
-
const result = this.content.fullString();
|
|
44
|
-
(0, internal_1.debugAssert)(() => result === this.fullString_reference() || "invalid fullString optimizations");
|
|
45
|
-
return result;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* A non-optimized reference implementation of fullString.
|
|
49
|
-
*/
|
|
50
|
-
fullString_reference() {
|
|
51
|
-
return [...this.characters()].join("");
|
|
52
|
-
}
|
|
16
|
+
/**
|
|
17
|
+
* Sets up scope for formatted text schema built-in types.
|
|
18
|
+
* @remarks User-provided factory scoping will be applied as `com.fluidframework.text.formatted<user-scope>`.
|
|
19
|
+
*/
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Inferring is the most practical option here
|
|
21
|
+
function createFormattedScopedFactory(inputSchemaFactory) {
|
|
22
|
+
return (0, index_js_4.createCustomizedFluidFrameworkScopedFactory)(inputSchemaFactory, "text.formatted");
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Schema factory for formatted text types which are not generic.
|
|
26
|
+
*/
|
|
27
|
+
const sfStatic = new index_js_4.SchemaFactoryAlpha("com.fluidframework.text.formatted");
|
|
28
|
+
const formatKey = (0, index_js_5.brand)("format");
|
|
29
|
+
/**
|
|
30
|
+
* A collection of text related types, schema and utilities for working with text beyond the basic {@link SchemaStatics.string}.
|
|
31
|
+
* @remarks
|
|
32
|
+
* This is generic over formatting an embedded object/atom types.
|
|
33
|
+
* See {@link FormattedTextAsTreeDefault} for a default parameterization.
|
|
34
|
+
* @privateRemarks
|
|
35
|
+
* TODO:
|
|
36
|
+
* - Add more comprehensive tests for generic parameterizations other than default.
|
|
37
|
+
* - Sort out API around overwriting subsets of formatting information.
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
var FormattedTextAsTree;
|
|
41
|
+
(function (FormattedTextAsTree) {
|
|
53
42
|
/**
|
|
54
|
-
*
|
|
43
|
+
* Factory for formatted text schema as a function of the formatting and the embedded object (atom) types.
|
|
55
44
|
*/
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
45
|
+
function createSchema(inputSchemaFactory, formatSchema, extraAtoms, defaultFormatInsertable) {
|
|
46
|
+
const atoms = [StringTextAtom, ...extraAtoms];
|
|
47
|
+
const sf = createFormattedScopedFactory(inputSchemaFactory);
|
|
48
|
+
class TextNode extends sf.object("Text", {
|
|
49
|
+
content: index_js_4.SchemaFactory.required([() => StringArray], { key: index_js_1.EmptyKey }),
|
|
50
|
+
}) {
|
|
51
|
+
constructor() {
|
|
52
|
+
super(...arguments);
|
|
53
|
+
this.defaultFormat = index_js_4.TreeBeta.create(formatSchema, defaultFormatInsertable);
|
|
54
|
+
}
|
|
55
|
+
insertAt(index, additionalCharacters) {
|
|
56
|
+
this.content.insertAt(index, index_js_4.TreeArrayNode.spread(textAtomsFromString(additionalCharacters, this.defaultFormat)));
|
|
57
|
+
}
|
|
58
|
+
removeRange(index, end) {
|
|
59
|
+
this.content.removeRange(index, end);
|
|
60
|
+
}
|
|
61
|
+
characters() {
|
|
62
|
+
return (0, index_js_5.mapIterable)(this.content, (atom) => atom.content.content);
|
|
63
|
+
}
|
|
64
|
+
charactersCopy() {
|
|
65
|
+
const result = this.content.charactersCopy();
|
|
66
|
+
(0, internal_1.debugAssert)(() => (0, internal_1.compareArrays)(result, this.charactersCopy_reference()) ||
|
|
67
|
+
"invalid charactersCopy optimizations");
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
characterCount() {
|
|
71
|
+
return this.content.length;
|
|
72
|
+
}
|
|
73
|
+
fullString() {
|
|
74
|
+
const result = this.content.fullString();
|
|
75
|
+
(0, internal_1.debugAssert)(() => result === this.fullString_reference() || "invalid fullString optimizations");
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* A non-optimized reference implementation of fullString.
|
|
80
|
+
*/
|
|
81
|
+
fullString_reference() {
|
|
82
|
+
return [...this.characters()].join("");
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Unoptimized trivially correct implementation of charactersCopy.
|
|
86
|
+
*/
|
|
87
|
+
charactersCopy_reference() {
|
|
88
|
+
return [...this.characters()];
|
|
89
|
+
}
|
|
90
|
+
static fromString(value, format) {
|
|
91
|
+
// Use `this` rather than `TextNode` so the more derived schema class is constructed when using this as a static on a subclass.
|
|
92
|
+
return new this({
|
|
93
|
+
content: [
|
|
94
|
+
// Constructing an ArrayNode from an iterator is supported, so creating an array from the iterable of characters seems like it's not necessary here,
|
|
95
|
+
// 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.
|
|
96
|
+
// Thus the array construction here is necessary to avoid a runtime error.
|
|
97
|
+
...textAtomsFromString(value, format ?? index_js_4.TreeBeta.create(formatSchema, defaultFormatInsertable)),
|
|
98
|
+
],
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
charactersWithFormatting() {
|
|
102
|
+
return this.content;
|
|
103
|
+
}
|
|
104
|
+
insertWithFormattingAt(index, additionalCharacters) {
|
|
105
|
+
this.content.insertAt(index, index_js_4.TreeArrayNode.spread(additionalCharacters));
|
|
106
|
+
}
|
|
107
|
+
formatRange(start, end, format) {
|
|
108
|
+
const formatStart = start ?? 0;
|
|
109
|
+
(0, index_js_5.validateIndex)(formatStart, this.content, "FormattedTextAsTree.formatRange", true);
|
|
110
|
+
const formatEnd = Math.min(this.content.length, end ?? this.content.length);
|
|
111
|
+
(0, index_js_5.validateIndexRange)(formatStart, formatEnd, this.content, "FormattedTextAsTree.formatRange");
|
|
112
|
+
const fieldFormats = Object.entries(format);
|
|
113
|
+
index_js_3.TreeAlpha.context(this).runTransaction(() => {
|
|
114
|
+
for (let i = formatStart; i < formatEnd; i++) {
|
|
115
|
+
const atom = this.content[i];
|
|
116
|
+
// Range validated above, so this should never fail.
|
|
117
|
+
(0, internal_1.assert)(atom !== undefined, 0xd08 /* Index out of bounds while formatting text range. */);
|
|
118
|
+
const formatNode = atom.format;
|
|
119
|
+
const atomFormatSchema = index_js_3.Tree.schema(formatNode);
|
|
120
|
+
if (!(0, index_js_4.isObjectNodeSchema)(atomFormatSchema)) {
|
|
121
|
+
// TODO: redesign this API to work with all allowed FormatSchema types.
|
|
122
|
+
throw new internal_2.UsageError("formatRange currently only supports object nodes for the format.");
|
|
123
|
+
}
|
|
124
|
+
for (const [key, value] of fieldFormats) {
|
|
125
|
+
// Object.entries should only return string keyed enumerable own properties.
|
|
126
|
+
// The TypeScript typing does not account for this, and thus this assertion is necessary for this code to compile.
|
|
127
|
+
(0, internal_1.assert)(typeof key === "string", 0xcc8 /* Object.entries returned a non-string key. */);
|
|
128
|
+
const field = atomFormatSchema.fields.get(key);
|
|
129
|
+
if (field === undefined) {
|
|
130
|
+
throw new internal_2.UsageError(`Unknown format key: ${key}`);
|
|
131
|
+
}
|
|
132
|
+
// Ensures that if the input is a node, it is cloned before being inserted into the tree.
|
|
133
|
+
const clonedValue = index_js_4.TreeBeta.clone(index_js_4.TreeBeta.create(field, value));
|
|
134
|
+
formatNode[key] = clonedValue;
|
|
135
|
+
}
|
|
94
136
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Returns the {@link FormattedTextAsTree.TextAtom.content} at the given atom index, or `undefined` if out of bounds.
|
|
141
|
+
*/
|
|
142
|
+
getAtomCharacterAt(index) {
|
|
143
|
+
const atom = this.content[index];
|
|
144
|
+
if (atom === undefined)
|
|
145
|
+
return undefined;
|
|
146
|
+
return atom.content.content;
|
|
147
|
+
}
|
|
148
|
+
onCharactersChanged(callback) {
|
|
149
|
+
return index_js_3.TreeAlpha.on(this.content, "nodeChanged", ({ delta }) => (0, textDomain_js_1.processCharactersChangedDelta)(delta, (index) => this.getAtomCharacterAt(index), callback));
|
|
150
|
+
}
|
|
151
|
+
onContentChanged(callback) {
|
|
152
|
+
return index_js_3.TreeAlpha.on(this.content, "treeChanged", ({ delta }) => (0, textDomain_js_1.processCharactersChangedDelta)(delta, (index) => this.getAtomCharacterAt(index), callback));
|
|
153
|
+
}
|
|
154
|
+
getUniformRun(startIndex, endIndex) {
|
|
155
|
+
return this.content.getUniformRun(startIndex, endIndex);
|
|
156
|
+
}
|
|
157
|
+
getString(startIndex, endIndex) {
|
|
158
|
+
return this.content.getString(startIndex, endIndex);
|
|
98
159
|
}
|
|
99
|
-
};
|
|
100
|
-
if (branch === undefined) {
|
|
101
|
-
// If this node does not have a corresponding branch, then it is unhydrated.
|
|
102
|
-
// I.e., it is not part of a collaborative session yet.
|
|
103
|
-
// Therefore, we don't need to run the edits as a transaction.
|
|
104
|
-
// Note: for unhydrated nodes each atom edit fires a separate `treeChanged` event,
|
|
105
|
-
// so formatting N atoms will produce N callbacks on `onContentChanged` subscribers
|
|
106
|
-
// instead of the single callback that hydrated (transacted) edits produce.
|
|
107
|
-
// `withBufferedTreeEvents` is not a viable mitigation here: when more than one atom's
|
|
108
|
-
// `format` field changes within the same buffered scope, the kernel's per-field
|
|
109
|
-
// dedup logic discards the delta (see `treeNodeKernel.ts` `#fieldMarksBuffer`),
|
|
110
|
-
// which is worse for incremental consumers than N well-formed callbacks.
|
|
111
|
-
// Use `runTransaction` on a hydrated node (i.e. after inserting into the document)
|
|
112
|
-
// if batched events matter.
|
|
113
|
-
applyFormatting();
|
|
114
160
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
161
|
+
function textAtomsFromString(value, format) {
|
|
162
|
+
const result = (0, index_js_5.mapIterable)((0, textDomain_js_1.charactersFromString)(value), (char) => {
|
|
163
|
+
const textAtom = new StringTextAtom({ content: char });
|
|
164
|
+
const data = {
|
|
165
|
+
content: textAtom,
|
|
166
|
+
format: index_js_4.TreeBeta.clone(format),
|
|
167
|
+
};
|
|
168
|
+
return new StringAtom(data); // Generic break type safety here. TODO: try and make safer.
|
|
119
169
|
});
|
|
170
|
+
return result;
|
|
120
171
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
const atom = this.content[index];
|
|
129
|
-
if (atom === undefined)
|
|
130
|
-
return undefined;
|
|
131
|
-
return atom.content instanceof FormattedTextAsTree.StringLineAtom
|
|
132
|
-
? "\n"
|
|
133
|
-
: atom.content.content;
|
|
134
|
-
}
|
|
135
|
-
onCharactersChanged(callback) {
|
|
136
|
-
return index_js_3.TreeAlpha.on(this.content, "nodeChanged", ({ delta }) => (0, textDomain_js_1.processCharactersChangedDelta)(delta, (index) => this.getAtomCharacterAt(index), callback));
|
|
137
|
-
}
|
|
138
|
-
onContentChanged(callback) {
|
|
139
|
-
return index_js_3.TreeAlpha.on(this.content, "treeChanged", ({ delta }) => (0, textDomain_js_1.processCharactersChangedDelta)(delta, (index) => this.getAtomCharacterAt(index), callback));
|
|
140
|
-
}
|
|
141
|
-
getUniformRun(startIndex, endIndex) {
|
|
142
|
-
return this.content.getUniformRun(startIndex, endIndex);
|
|
143
|
-
}
|
|
144
|
-
getString(startIndex, endIndex) {
|
|
145
|
-
return this.content.getString(startIndex, endIndex);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
const defaultFormat = {
|
|
149
|
-
bold: false,
|
|
150
|
-
italic: false,
|
|
151
|
-
underline: false,
|
|
152
|
-
size: 12,
|
|
153
|
-
font: "Arial",
|
|
154
|
-
};
|
|
155
|
-
const formatKey = (0, index_js_5.brand)("format");
|
|
156
|
-
function textAtomsFromString(value, format) {
|
|
157
|
-
const result = (0, index_js_5.mapIterable)((0, textDomain_js_1.charactersFromString)(value), (char) => new FormattedTextAsTree.StringAtom({
|
|
158
|
-
content: { content: char },
|
|
159
|
-
format: index_js_4.TreeBeta.clone(format),
|
|
160
|
-
}));
|
|
161
|
-
return result;
|
|
162
|
-
}
|
|
163
|
-
class StringArray extends sf.array("StringArray", [() => FormattedTextAsTree.StringAtom]) {
|
|
164
|
-
withBorrowedSequenceCursor(f) {
|
|
165
|
-
const innerNode = (0, index_js_4.getInnerNode)(this);
|
|
166
|
-
// Since the cursor will be used to read content from the tree and won't track observations,
|
|
167
|
-
// treat it as if it observed the whole subtree.
|
|
168
|
-
index_js_2.currentObserver?.observeNodeDeep(innerNode);
|
|
169
|
-
const cursor = innerNode.borrowCursor();
|
|
170
|
-
cursor.enterField(index_js_1.EmptyKey);
|
|
171
|
-
const result = f(cursor);
|
|
172
|
-
cursor.exitField();
|
|
173
|
-
return result;
|
|
174
|
-
}
|
|
175
|
-
getCharactersSubarray(startIndex, endIndex) {
|
|
176
|
-
return this.withBorrowedSequenceCursor((cursor) => {
|
|
177
|
-
const result = [];
|
|
178
|
-
(0, index_js_1.forEachNodeSubsequence)(cursor, startIndex, endIndex, () => {
|
|
179
|
-
(0, internal_1.debugAssert)(() => cursor.type === FormattedTextAsTree.StringAtom.identifier ||
|
|
180
|
-
"invalid fullString type optimizations");
|
|
172
|
+
class StringArray extends sf.array("StringArray", [() => StringAtom]) {
|
|
173
|
+
withBorrowedSequenceCursor(f) {
|
|
174
|
+
const innerNode = (0, index_js_4.getInnerNode)(this);
|
|
175
|
+
// Since the cursor will be used to read content from the tree and won't track observations,
|
|
176
|
+
// treat it as if it observed the whole subtree.
|
|
177
|
+
index_js_2.currentObserver?.observeNodeDeep(innerNode);
|
|
178
|
+
const cursor = innerNode.borrowCursor();
|
|
181
179
|
cursor.enterField(index_js_1.EmptyKey);
|
|
182
|
-
cursor
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
180
|
+
const result = f(cursor);
|
|
181
|
+
cursor.exitField();
|
|
182
|
+
return result;
|
|
183
|
+
}
|
|
184
|
+
getCharactersSubarray(startIndex, endIndex) {
|
|
185
|
+
const slowPathIndexes = [];
|
|
186
|
+
const result = [];
|
|
187
|
+
this.withBorrowedSequenceCursor((cursor) => {
|
|
188
|
+
(0, index_js_1.forEachNodeSubsequence)(cursor, startIndex, endIndex, () => {
|
|
189
|
+
(0, internal_1.debugAssert)(() => cursor.type === StringAtom.identifier ||
|
|
190
|
+
"invalid fullString type optimizations");
|
|
186
191
|
cursor.enterField(index_js_1.EmptyKey);
|
|
187
192
|
cursor.enterNode(0);
|
|
188
|
-
content
|
|
189
|
-
(
|
|
193
|
+
let content;
|
|
194
|
+
switch (cursor.type) {
|
|
195
|
+
case StringTextAtom.identifier: {
|
|
196
|
+
cursor.enterField(index_js_1.EmptyKey);
|
|
197
|
+
cursor.enterNode(0);
|
|
198
|
+
content = cursor.value;
|
|
199
|
+
(0, internal_1.debugAssert)(() => typeof content === "string" || "invalid fullString type optimizations");
|
|
200
|
+
cursor.exitNode();
|
|
201
|
+
cursor.exitField();
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
// TODO: we could optimize this for constant cases via an optional symbol on the atom schema holding the constant.
|
|
205
|
+
// A less general optimization could just include cases for build in types with constant values
|
|
206
|
+
// (like below commented code: currently this would cause a cyclical dependency but could be refactored).
|
|
207
|
+
// case FormattedTextAsTree.StringLineAtom.identifier: {
|
|
208
|
+
// content = "\n";
|
|
209
|
+
// break;
|
|
210
|
+
// }
|
|
211
|
+
default: {
|
|
212
|
+
slowPathIndexes.push(result.length);
|
|
213
|
+
content = ""; // Placeholder for slow path content
|
|
214
|
+
}
|
|
215
|
+
}
|
|
190
216
|
cursor.exitNode();
|
|
191
217
|
cursor.exitField();
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}
|
|
218
|
+
result.push(content);
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
// Fill in slow path cases not optimized above.
|
|
222
|
+
for (const index of slowPathIndexes) {
|
|
223
|
+
const node = this[index + startIndex] ??
|
|
224
|
+
(0, internal_1.fail)(0xd09 /* getCharactersSubarray failed to find index after index range was checked */);
|
|
225
|
+
result[index] = node.content.content;
|
|
201
226
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
getUniformRun(startIndex, endIndex = this.length) {
|
|
220
|
-
(0, index_js_5.validateIndexRange)(startIndex, endIndex, this, "FormattedTextAsTree.getUniformRun");
|
|
221
|
-
if (endIndex === startIndex) {
|
|
222
|
-
throw new internal_2.UsageError("endIndex must be greater than startIndex for getUniformRun.");
|
|
223
|
-
}
|
|
224
|
-
const arrayLength = this.length;
|
|
225
|
-
return this.withBorrowedSequenceCursor((cursor) => {
|
|
226
|
-
cursor.enterNode(startIndex);
|
|
227
|
-
// Capture the content type of the first atom
|
|
228
|
-
cursor.enterField(index_js_1.EmptyKey);
|
|
229
|
-
cursor.enterNode(0);
|
|
230
|
-
const contentType = cursor.type;
|
|
231
|
-
cursor.exitNode();
|
|
232
|
-
cursor.exitField();
|
|
233
|
-
// Build a comparator from the format subtree of the first atom
|
|
234
|
-
// This compares by field key
|
|
235
|
-
cursor.enterField(formatKey);
|
|
236
|
-
cursor.enterNode(0);
|
|
237
|
-
const formatComparator = (0, index_js_2.buildNodeComparator)(cursor);
|
|
238
|
-
cursor.exitNode();
|
|
239
|
-
cursor.exitField();
|
|
240
|
-
let runLength = 1;
|
|
241
|
-
const limit = Math.min(endIndex, arrayLength) - startIndex;
|
|
242
|
-
while (runLength < limit && cursor.nextNode()) {
|
|
243
|
-
// Compare atom type
|
|
244
|
-
cursor.enterField(index_js_1.EmptyKey);
|
|
245
|
-
cursor.enterNode(0);
|
|
246
|
-
const typeMatches = cursor.type === contentType;
|
|
247
|
-
cursor.exitNode();
|
|
248
|
-
cursor.exitField();
|
|
249
|
-
if (!typeMatches) {
|
|
250
|
-
break;
|
|
251
|
-
}
|
|
252
|
-
// Compare format subtree using the compiled comparator
|
|
253
|
-
cursor.enterField(formatKey);
|
|
254
|
-
cursor.enterNode(0);
|
|
255
|
-
const formatMatches = formatComparator(cursor);
|
|
256
|
-
cursor.exitNode();
|
|
257
|
-
cursor.exitField();
|
|
258
|
-
if (formatMatches !== true) {
|
|
259
|
-
break;
|
|
227
|
+
return result;
|
|
228
|
+
}
|
|
229
|
+
charactersCopy() {
|
|
230
|
+
return this.getCharactersSubarray(0, this.length);
|
|
231
|
+
}
|
|
232
|
+
fullString() {
|
|
233
|
+
return this.charactersCopy().join("");
|
|
234
|
+
}
|
|
235
|
+
getString(startIndex, endIndex = this.length) {
|
|
236
|
+
(0, index_js_5.validateIndexRange)(startIndex, endIndex, this, "FormattedTextAsTree.getString");
|
|
237
|
+
return this.getCharactersSubarray(startIndex, endIndex).join("");
|
|
238
|
+
}
|
|
239
|
+
getUniformRun(startIndex, endIndex = this.length) {
|
|
240
|
+
(0, index_js_5.validateIndexRange)(startIndex, endIndex, this, "FormattedTextAsTree.getUniformRun");
|
|
241
|
+
if (endIndex === startIndex) {
|
|
242
|
+
throw new internal_2.UsageError("endIndex must be greater than startIndex for getUniformRun.");
|
|
260
243
|
}
|
|
261
|
-
|
|
244
|
+
const arrayLength = this.length;
|
|
245
|
+
return this.withBorrowedSequenceCursor((cursor) => {
|
|
246
|
+
cursor.enterNode(startIndex);
|
|
247
|
+
// Capture the content type of the first atom
|
|
248
|
+
cursor.enterField(index_js_1.EmptyKey);
|
|
249
|
+
cursor.enterNode(0);
|
|
250
|
+
const contentType = cursor.type;
|
|
251
|
+
cursor.exitNode();
|
|
252
|
+
cursor.exitField();
|
|
253
|
+
// Build a comparator from the format subtree of the first atom
|
|
254
|
+
// This compares by field key
|
|
255
|
+
cursor.enterField(formatKey);
|
|
256
|
+
cursor.enterNode(0);
|
|
257
|
+
const formatComparator = (0, index_js_2.buildNodeComparator)(cursor);
|
|
258
|
+
cursor.exitNode();
|
|
259
|
+
cursor.exitField();
|
|
260
|
+
let runLength = 1;
|
|
261
|
+
const limit = Math.min(endIndex, arrayLength) - startIndex;
|
|
262
|
+
while (runLength < limit && cursor.nextNode()) {
|
|
263
|
+
// Compare atom type
|
|
264
|
+
cursor.enterField(index_js_1.EmptyKey);
|
|
265
|
+
cursor.enterNode(0);
|
|
266
|
+
const typeMatches = cursor.type === contentType;
|
|
267
|
+
cursor.exitNode();
|
|
268
|
+
cursor.exitField();
|
|
269
|
+
if (!typeMatches) {
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
// Compare format subtree using the compiled comparator
|
|
273
|
+
cursor.enterField(formatKey);
|
|
274
|
+
cursor.enterNode(0);
|
|
275
|
+
const formatMatches = formatComparator(cursor);
|
|
276
|
+
cursor.exitNode();
|
|
277
|
+
cursor.exitField();
|
|
278
|
+
if (formatMatches !== true) {
|
|
279
|
+
break;
|
|
280
|
+
}
|
|
281
|
+
runLength++;
|
|
282
|
+
}
|
|
283
|
+
cursor.exitNode();
|
|
284
|
+
return runLength;
|
|
285
|
+
});
|
|
262
286
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
(
|
|
279
|
-
|
|
280
|
-
* Formatting options for characters.
|
|
281
|
-
* @internal
|
|
282
|
-
*/
|
|
283
|
-
class CharacterFormat extends sf.objectAlpha("CharacterFormat", {
|
|
284
|
-
bold: index_js_4.SchemaFactory.boolean,
|
|
285
|
-
italic: index_js_4.SchemaFactory.boolean,
|
|
286
|
-
underline: index_js_4.SchemaFactory.boolean,
|
|
287
|
-
size: index_js_4.SchemaFactory.number,
|
|
288
|
-
font: index_js_4.SchemaFactory.string,
|
|
289
|
-
}) {
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* A unit of the text, with formatting.
|
|
290
|
+
*/
|
|
291
|
+
class StringAtom extends sf.object("StringAtom", {
|
|
292
|
+
content: index_js_4.SchemaFactory.required(atoms, { key: index_js_1.EmptyKey }),
|
|
293
|
+
format: index_js_4.SchemaFactory.required(formatSchema),
|
|
294
|
+
}) {
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Schema for a text node.
|
|
298
|
+
* @remarks
|
|
299
|
+
* See {@link FormattedTextAsTree.Members} for the API.
|
|
300
|
+
* See {@link FormattedTextAsTree.Statics} for static APIs on this Schema, including construction.
|
|
301
|
+
*/
|
|
302
|
+
const Tree = (0, index_js_4.eraseSchemaDetailsSubclassable)()(TextNode);
|
|
303
|
+
return Tree;
|
|
290
304
|
}
|
|
291
|
-
FormattedTextAsTree.
|
|
305
|
+
FormattedTextAsTree.createSchema = createSchema;
|
|
292
306
|
/**
|
|
293
307
|
* Unit in the string representing a single character.
|
|
294
308
|
* @internal
|
|
295
309
|
*/
|
|
296
|
-
class StringTextAtom extends
|
|
310
|
+
class StringTextAtom extends sfStatic.object("StringTextAtom", {
|
|
297
311
|
/**
|
|
298
312
|
* The underlying text content of this atom.
|
|
299
313
|
* @remarks
|
|
@@ -309,66 +323,5 @@ var FormattedTextAsTree;
|
|
|
309
323
|
}) {
|
|
310
324
|
}
|
|
311
325
|
FormattedTextAsTree.StringTextAtom = StringTextAtom;
|
|
312
|
-
/**
|
|
313
|
-
* Tag with which a line in text can be formatted from HTML.
|
|
314
|
-
* @internal
|
|
315
|
-
*/
|
|
316
|
-
FormattedTextAsTree.LineTag = (0, index_js_4.enumFromStrings)(sf.scopedFactory("lineTag"), [
|
|
317
|
-
"h1",
|
|
318
|
-
"h2",
|
|
319
|
-
"h3",
|
|
320
|
-
"h4",
|
|
321
|
-
"h5",
|
|
322
|
-
"li",
|
|
323
|
-
"ol",
|
|
324
|
-
"checked",
|
|
325
|
-
"unchecked",
|
|
326
|
-
"blockquote",
|
|
327
|
-
"codeBlock",
|
|
328
|
-
]);
|
|
329
|
-
/**
|
|
330
|
-
* Unit in the string representing a new line character with line formatting.
|
|
331
|
-
* @remarks
|
|
332
|
-
* This aligns with how Quill represents line formatting.
|
|
333
|
-
* Quill formats line attributes (headers, list, blockquote, etc... ) on the newline character
|
|
334
|
-
* and only lines using this atom can have line-specific formatting.
|
|
335
|
-
* The optional indent level mirrors Quill's indent attribute,
|
|
336
|
-
* which is applies to the line before the line break.
|
|
337
|
-
* Any tagged line can be indented independently.
|
|
338
|
-
* @internal
|
|
339
|
-
*/
|
|
340
|
-
class StringLineAtom extends sf.object("StringLineAtom", {
|
|
341
|
-
tag: FormattedTextAsTree.LineTag.schema,
|
|
342
|
-
indent: index_js_4.SchemaFactory.number,
|
|
343
|
-
}) {
|
|
344
|
-
constructor() {
|
|
345
|
-
super(...arguments);
|
|
346
|
-
this.content = "\n";
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
FormattedTextAsTree.StringLineAtom = StringLineAtom;
|
|
350
|
-
/**
|
|
351
|
-
* Types of "atoms" that make up the text.
|
|
352
|
-
* @internal
|
|
353
|
-
*/
|
|
354
|
-
FormattedTextAsTree.StringAtomContent = [StringTextAtom, StringLineAtom];
|
|
355
|
-
/**
|
|
356
|
-
* A unit of the text, with formatting.
|
|
357
|
-
* @internal
|
|
358
|
-
*/
|
|
359
|
-
class StringAtom extends sf.object("StringAtom", {
|
|
360
|
-
content: index_js_4.SchemaFactory.required(FormattedTextAsTree.StringAtomContent, { key: index_js_1.EmptyKey }),
|
|
361
|
-
format: CharacterFormat,
|
|
362
|
-
}) {
|
|
363
|
-
}
|
|
364
|
-
FormattedTextAsTree.StringAtom = StringAtom;
|
|
365
|
-
/**
|
|
366
|
-
* Schema for a text node.
|
|
367
|
-
* @remarks
|
|
368
|
-
* See {@link FormattedTextAsTree.Members} for the API.
|
|
369
|
-
* See {@link FormattedTextAsTree.Statics} for static APIs on this Schema, including construction.
|
|
370
|
-
* @internal
|
|
371
|
-
*/
|
|
372
|
-
FormattedTextAsTree.Tree = (0, index_js_4.eraseSchemaDetails)()(TextNode);
|
|
373
326
|
})(FormattedTextAsTree || (exports.FormattedTextAsTree = FormattedTextAsTree = {}));
|
|
374
327
|
//# sourceMappingURL=textDomainFormatted.js.map
|