@fluidframework/tree 2.101.1 → 2.103.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/CHANGELOG.md +8 -0
- package/api-report/tree.alpha.api.md +19 -0
- package/dist/codec/codec.d.ts +22 -53
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +7 -44
- 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 -2
- package/dist/codec/index.js.map +1 -1
- package/dist/codec/versioned/codec.d.ts +56 -28
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js +29 -12
- package/dist/codec/versioned/codec.js.map +1 -1
- package/dist/codec/versioned/format.d.ts +5 -4
- package/dist/codec/versioned/format.d.ts.map +1 -1
- package/dist/codec/versioned/format.js +26 -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 -2
- package/dist/codec/versioned/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +4 -3
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +27 -4
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/schema-stored/formatV1.d.ts +16 -15
- package/dist/core/schema-stored/formatV1.d.ts.map +1 -1
- package/dist/core/schema-stored/formatV1.js +31 -8
- package/dist/core/schema-stored/formatV1.js.map +1 -1
- package/dist/core/schema-stored/formatV2.d.ts +29 -28
- package/dist/core/schema-stored/formatV2.d.ts.map +1 -1
- package/dist/core/schema-stored/formatV2.js +33 -10
- package/dist/core/schema-stored/formatV2.js.map +1 -1
- package/dist/core/tree/deltaUtil.d.ts +2 -2
- package/dist/core/tree/deltaUtil.js +2 -2
- package/dist/core/tree/deltaUtil.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.js +3 -2
- package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.js +4 -2
- package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts +3 -3
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.js +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +11 -10
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.js +33 -10
- package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +7 -6
- package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV2.js +25 -2
- package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
- package/dist/core/tree/persistedTreeTextFormat.d.ts +19 -18
- package/dist/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
- package/dist/core/tree/persistedTreeTextFormat.js +33 -10
- package/dist/core/tree/persistedTreeTextFormat.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +38 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +63 -5
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +18 -4
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +34 -2
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +106 -3
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +5 -5
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +2 -2
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +7 -7
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts +13 -12
- package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js +36 -13
- package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatV1.d.ts +36 -35
- package/dist/feature-libraries/chunked-forest/codec/format/formatV1.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js +41 -18
- package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatV2.d.ts +35 -14
- package/dist/feature-libraries/chunked-forest/codec/format/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js +35 -6
- package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatVText.d.ts +106 -0
- package/dist/feature-libraries/chunked-forest/codec/format/formatVText.d.ts.map +1 -0
- package/dist/feature-libraries/chunked-forest/codec/format/formatVText.js +67 -0
- package/dist/feature-libraries/chunked-forest/codec/format/formatVText.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/codec/format/index.d.ts +2 -1
- package/dist/feature-libraries/chunked-forest/codec/format/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/index.js +5 -1
- package/dist/feature-libraries/chunked-forest/codec/format/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/versions.d.ts +38 -4
- package/dist/feature-libraries/chunked-forest/codec/format/versions.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/versions.js +7 -1
- package/dist/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +7 -7
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js +1 -2
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +66 -14
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +101 -36
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +36 -14
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts +5 -4
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js +2 -2
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts +6 -5
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/formatCommon.js +26 -3
- package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +4 -3
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js +26 -3
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +45 -44
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js +48 -25
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +23 -22
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +29 -6
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +1 -1
- 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/optional-field/optionalFieldChangeFormatV1.d.ts +9 -8
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js +31 -8
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +14 -13
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js +34 -11
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +5 -4
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.js +25 -2
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts +2 -2
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +1 -1
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.d.ts +15 -14
- package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.js +27 -4
- package/dist/feature-libraries/schema-index/formatV1.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV2.d.ts +20 -19
- package/dist/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/formatV2.js +27 -4
- package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +1 -3
- package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV1.d.ts +283 -282
- package/dist/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV1.js +63 -40
- package/dist/feature-libraries/sequence-field/formatV1.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.d.ts +180 -179
- package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.js +55 -32
- package/dist/feature-libraries/sequence-field/formatV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV3.d.ts +126 -125
- package/dist/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV3.js +27 -4
- package/dist/feature-libraries/sequence-field/formatV3.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- 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/isAuditableFromOutcome.d.ts +20 -0
- package/dist/shared-tree/isAuditableFromOutcome.d.ts.map +1 -0
- package/dist/shared-tree/isAuditableFromOutcome.js +36 -0
- package/dist/shared-tree/isAuditableFromOutcome.js.map +1 -0
- package/dist/shared-tree/sharedTree.d.ts +2 -2
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFormat.d.ts +8 -7
- package/dist/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFormat.js +28 -5
- package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +5 -3
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +37 -8
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts +2 -2
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts +3 -3
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +2 -2
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +35 -34
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +39 -16
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +15 -15
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.js +33 -10
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +40 -40
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js +27 -4
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js +25 -2
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts +3 -3
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +2 -2
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +5 -5
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js +31 -8
- package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts +7 -7
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.js +29 -6
- package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts +5 -0
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +62 -24
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts +121 -120
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.js +54 -31
- package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
- package/dist/text/codePointUtils.d.ts +48 -0
- package/dist/text/codePointUtils.d.ts.map +1 -0
- package/dist/text/codePointUtils.js +80 -0
- package/dist/text/codePointUtils.js.map +1 -0
- package/dist/text/index.d.ts +1 -0
- package/dist/text/index.d.ts.map +1 -1
- package/dist/text/index.js +4 -1
- package/dist/text/index.js.map +1 -1
- package/dist/text/textDomain.d.ts +93 -1
- package/dist/text/textDomain.d.ts.map +1 -1
- package/dist/text/textDomain.js +65 -8
- package/dist/text/textDomain.js.map +1 -1
- package/dist/text/textDomainFormatted.d.ts +24 -6
- package/dist/text/textDomainFormatted.d.ts.map +1 -1
- package/dist/text/textDomainFormatted.js +29 -1
- package/dist/text/textDomainFormatted.js.map +1 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +9 -7
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/breakable.d.ts +7 -1
- package/dist/util/breakable.d.ts.map +1 -1
- package/dist/util/breakable.js +18 -4
- package/dist/util/breakable.js.map +1 -1
- package/dist/util/typeboxBrand.d.ts +1 -1
- package/dist/util/typeboxBrand.d.ts.map +1 -1
- package/dist/util/typeboxBrand.js +26 -3
- package/dist/util/typeboxBrand.js.map +1 -1
- package/dist/util/utils.d.ts +2 -2
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +25 -2
- package/dist/util/utils.js.map +1 -1
- package/eslint.config.mts +44 -0
- package/lib/codec/codec.d.ts +22 -53
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +7 -44
- 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 +56 -28
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js +27 -10
- package/lib/codec/versioned/codec.js.map +1 -1
- package/lib/codec/versioned/format.d.ts +5 -4
- package/lib/codec/versioned/format.d.ts.map +1 -1
- package/lib/codec/versioned/format.js +1 -1
- 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/rebase/types.d.ts +4 -3
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +1 -1
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/schema-stored/formatV1.d.ts +16 -15
- package/lib/core/schema-stored/formatV1.d.ts.map +1 -1
- package/lib/core/schema-stored/formatV1.js +1 -1
- package/lib/core/schema-stored/formatV1.js.map +1 -1
- package/lib/core/schema-stored/formatV2.d.ts +29 -28
- package/lib/core/schema-stored/formatV2.d.ts.map +1 -1
- package/lib/core/schema-stored/formatV2.js +1 -1
- package/lib/core/schema-stored/formatV2.js.map +1 -1
- package/lib/core/tree/deltaUtil.d.ts +2 -2
- package/lib/core/tree/deltaUtil.js +2 -2
- package/lib/core/tree/deltaUtil.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.js +3 -2
- package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV2.js +5 -3
- package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts +3 -3
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.js +2 -2
- package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +11 -10
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.js +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV2.d.ts +7 -6
- package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV2.js +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
- package/lib/core/tree/persistedTreeTextFormat.d.ts +19 -18
- package/lib/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
- package/lib/core/tree/persistedTreeTextFormat.js +1 -1
- package/lib/core/tree/persistedTreeTextFormat.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +38 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +62 -5
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +20 -6
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +34 -2
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +102 -2
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +5 -5
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +3 -3
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +7 -7
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts +13 -12
- package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatV1.d.ts +36 -35
- package/lib/feature-libraries/chunked-forest/codec/format/formatV1.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatV1.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatV2.d.ts +35 -14
- package/lib/feature-libraries/chunked-forest/codec/format/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatV2.js +9 -3
- package/lib/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatVText.d.ts +106 -0
- package/lib/feature-libraries/chunked-forest/codec/format/formatVText.d.ts.map +1 -0
- package/lib/feature-libraries/chunked-forest/codec/format/formatVText.js +41 -0
- package/lib/feature-libraries/chunked-forest/codec/format/formatVText.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/codec/format/index.d.ts +2 -1
- package/lib/feature-libraries/chunked-forest/codec/format/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/index.js +2 -1
- package/lib/feature-libraries/chunked-forest/codec/format/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/versions.d.ts +38 -4
- package/lib/feature-libraries/chunked-forest/codec/format/versions.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/versions.js +6 -0
- package/lib/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +7 -7
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js +2 -3
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +66 -14
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +101 -36
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +36 -14
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts +5 -4
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js +3 -3
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts +6 -5
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/formatCommon.js +1 -1
- package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +4 -3
- package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindFormat.js +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +45 -44
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +23 -22
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +1 -1
- 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/optional-field/optionalFieldChangeFormatV1.d.ts +9 -8
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.js +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +14 -13
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.js +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +5 -4
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.js +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts +2 -2
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +2 -2
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.d.ts +15 -14
- package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.js +1 -1
- package/lib/feature-libraries/schema-index/formatV1.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV2.d.ts +20 -19
- package/lib/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/formatV2.js +1 -1
- package/lib/feature-libraries/schema-index/formatV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +1 -3
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV1.d.ts +283 -282
- package/lib/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV1.js +1 -1
- package/lib/feature-libraries/sequence-field/formatV1.js.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV2.d.ts +180 -179
- package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV2.js +1 -1
- package/lib/feature-libraries/sequence-field/formatV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV3.d.ts +126 -125
- package/lib/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV3.js +1 -1
- package/lib/feature-libraries/sequence-field/formatV3.js.map +1 -1
- package/lib/index.d.ts +1 -1
- 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/isAuditableFromOutcome.d.ts +20 -0
- package/lib/shared-tree/isAuditableFromOutcome.d.ts.map +1 -0
- package/lib/shared-tree/isAuditableFromOutcome.js +32 -0
- package/lib/shared-tree/isAuditableFromOutcome.js.map +1 -0
- package/lib/shared-tree/sharedTree.d.ts +2 -2
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +1 -1
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFormat.d.ts +8 -7
- package/lib/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFormat.js +1 -1
- package/lib/shared-tree/sharedTreeChangeFormat.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +5 -3
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +38 -9
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts +2 -2
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts +3 -3
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +3 -3
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +35 -34
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +15 -15
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.js +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +40 -40
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.js +1 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.js +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts +3 -3
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +3 -3
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +5 -5
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts +7 -7
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.js +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts +5 -0
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +60 -23
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts +121 -120
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.js +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -1
- package/lib/text/codePointUtils.d.ts +48 -0
- package/lib/text/codePointUtils.d.ts.map +1 -0
- package/lib/text/codePointUtils.js +75 -0
- package/lib/text/codePointUtils.js.map +1 -0
- 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/textDomain.d.ts +93 -1
- package/lib/text/textDomain.d.ts.map +1 -1
- package/lib/text/textDomain.js +56 -0
- package/lib/text/textDomain.js.map +1 -1
- package/lib/text/textDomainFormatted.d.ts +24 -6
- package/lib/text/textDomainFormatted.d.ts.map +1 -1
- package/lib/text/textDomainFormatted.js +30 -2
- package/lib/text/textDomainFormatted.js.map +1 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +2 -0
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/breakable.d.ts +7 -1
- package/lib/util/breakable.d.ts.map +1 -1
- package/lib/util/breakable.js +18 -4
- package/lib/util/breakable.js.map +1 -1
- package/lib/util/typeboxBrand.d.ts +1 -1
- package/lib/util/typeboxBrand.d.ts.map +1 -1
- package/lib/util/typeboxBrand.js +1 -1
- package/lib/util/typeboxBrand.js.map +1 -1
- package/lib/util/utils.d.ts +2 -2
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js +1 -1
- package/lib/util/utils.js.map +1 -1
- package/package.json +24 -24
- package/src/codec/codec.ts +82 -73
- package/src/codec/index.ts +2 -1
- package/src/codec/versioned/codec.ts +173 -73
- package/src/codec/versioned/format.ts +2 -1
- package/src/codec/versioned/index.ts +2 -1
- package/src/core/rebase/types.ts +1 -1
- package/src/core/schema-stored/formatV1.ts +2 -1
- package/src/core/schema-stored/formatV2.ts +2 -1
- package/src/core/tree/deltaUtil.ts +2 -2
- package/src/core/tree/detachedFieldIndexCodecV1.ts +3 -2
- package/src/core/tree/detachedFieldIndexCodecV2.ts +5 -3
- package/src/core/tree/detachedFieldIndexCodecs.ts +2 -2
- package/src/core/tree/detachedFieldIndexFormatCommon.ts +2 -1
- package/src/core/tree/detachedFieldIndexFormatV2.ts +2 -1
- package/src/core/tree/persistedTreeTextFormat.ts +2 -1
- package/src/feature-libraries/chunked-forest/chunkTree.ts +88 -3
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +27 -7
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +143 -7
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +30 -28
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +7 -7
- package/src/feature-libraries/chunked-forest/codec/format/formatGeneric.ts +2 -1
- package/src/feature-libraries/chunked-forest/codec/format/formatV1.ts +2 -1
- package/src/feature-libraries/chunked-forest/codec/format/formatV2.ts +13 -8
- package/src/feature-libraries/chunked-forest/codec/format/formatVText.ts +84 -0
- package/src/feature-libraries/chunked-forest/codec/format/index.ts +6 -1
- package/src/feature-libraries/chunked-forest/codec/format/versions.ts +25 -4
- package/src/feature-libraries/chunked-forest/codec/nodeEncoder.ts +14 -18
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +131 -44
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +36 -14
- package/src/feature-libraries/forest-summary/codec.ts +9 -4
- package/src/feature-libraries/forest-summary/formatCommon.ts +2 -1
- package/src/feature-libraries/modular-schema/genericFieldKindFormat.ts +2 -1
- package/src/feature-libraries/modular-schema/modularChangeFormatV1.ts +2 -1
- package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +2 -1
- package/src/feature-libraries/modular-schema/modularChangeTypes.ts +1 -1
- package/src/feature-libraries/optional-field/optionalFieldChangeFormatV1.ts +2 -1
- package/src/feature-libraries/optional-field/optionalFieldChangeFormatV2.ts +2 -1
- package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +2 -1
- package/src/feature-libraries/schema-index/codec.ts +2 -5
- package/src/feature-libraries/schema-index/formatV1.ts +2 -1
- package/src/feature-libraries/schema-index/formatV2.ts +2 -1
- package/src/feature-libraries/sequence-field/compose.ts +1 -4
- package/src/feature-libraries/sequence-field/formatV1.ts +2 -1
- package/src/feature-libraries/sequence-field/formatV2.ts +2 -1
- package/src/feature-libraries/sequence-field/formatV3.ts +2 -1
- package/src/index.ts +6 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/isAuditableFromOutcome.ts +34 -0
- package/src/shared-tree/sharedTree.ts +2 -5
- package/src/shared-tree/sharedTreeChangeFormat.ts +2 -1
- package/src/shared-tree/treeCheckout.ts +55 -15
- package/src/shared-tree-core/editManager.ts +2 -2
- package/src/shared-tree-core/editManagerCodecs.ts +4 -6
- package/src/shared-tree-core/editManagerFormatCommons.ts +2 -1
- package/src/shared-tree-core/editManagerFormatV1toV4.ts +2 -1
- package/src/shared-tree-core/editManagerFormatVSharedBranches.ts +2 -1
- package/src/shared-tree-core/messageCodecVSharedBranches.ts +2 -1
- package/src/shared-tree-core/messageCodecs.ts +4 -4
- package/src/shared-tree-core/messageFormatV1ToV4.ts +2 -1
- package/src/shared-tree-core/messageFormatVSharedBranches.ts +2 -1
- package/src/simple-tree/core/treeNodeKernel.ts +66 -28
- package/src/simple-tree/simpleSchemaFormatV1.ts +2 -1
- package/src/text/codePointUtils.ts +81 -0
- package/src/text/index.ts +1 -0
- package/src/text/textDomain.ts +155 -2
- package/src/text/textDomainFormatted.ts +73 -2
- package/src/treeFactory.ts +5 -0
- package/src/util/breakable.ts +27 -6
- package/src/util/typeboxBrand.ts +2 -1
- package/src/util/utils.ts +2 -1
|
@@ -3,19 +3,42 @@
|
|
|
3
3
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
6
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
30
|
exports.comparePartialRevisions = exports.subtractChangeAtomIds = exports.newChangeAtomIdRangeMap = exports.mintCommit = exports.CommitKind = exports.comparePartialChangesetLocalIds = exports.compareChangesetLocalIds = exports.offsetChangeAtomId = exports.taggedOptAtomId = exports.taggedAtomId = exports.asChangeAtomId = exports.makeChangeAtomId = exports.areEqualChangeAtomIdOpts = exports.areEqualChangeAtomIds = exports.StableIdSchema = exports.RevisionTagSchema = exports.SessionIdSchema = void 0;
|
|
8
|
-
const
|
|
31
|
+
const Type = __importStar(require("@sinclair/typebox"));
|
|
9
32
|
const index_js_1 = require("../../util/index.js");
|
|
10
33
|
/**
|
|
11
34
|
* The identifier for a particular session/user/client that can generate `GraphCommit`s
|
|
12
35
|
*/
|
|
13
36
|
exports.SessionIdSchema = (0, index_js_1.brandedStringType)();
|
|
14
|
-
exports.RevisionTagSchema =
|
|
15
|
-
|
|
37
|
+
exports.RevisionTagSchema = Type.Union([
|
|
38
|
+
Type.Literal("root"),
|
|
16
39
|
(0, index_js_1.brandedNumberType)(),
|
|
17
40
|
]);
|
|
18
|
-
exports.StableIdSchema =
|
|
41
|
+
exports.StableIdSchema = Type.String();
|
|
19
42
|
/**
|
|
20
43
|
* Returns true iff `a` and `b` are the same.
|
|
21
44
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/rebase/types.ts"],"names":[],"mappings":"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","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tOpSpaceCompressedId,\n\tSessionId,\n\tSessionSpaceCompressedId,\n\tStableId,\n} from \"@fluidframework/id-compressor\";\nimport { Type } from \"@sinclair/typebox\";\n\nimport {\n\ttype Brand,\n\ttype JsonCompatibleReadOnly,\n\ttype NestedMap,\n\tRangeMap,\n\tbrand,\n\tbrandedNumberType,\n\tbrandedStringType,\n\tcomparePartialStrings,\n} from \"../../util/index.js\";\nimport type { RevertibleAlpha } from \"../revertible.js\";\n\n/**\n * The identifier for a particular session/user/client that can generate `GraphCommit`s\n */\nexport const SessionIdSchema = brandedStringType<SessionId>();\n\n/**\n * A unique identifier for a commit. Commits that have been rebased, but are semantically\n * the same, will share the same revision tag.\n *\n * The constant 'root' is reserved for the trunk base: minting a SessionSpaceCompressedId is not\n * possible on readonly clients. These clients generally don't need ids, but must be done at tree initialization time.\n */\nexport type RevisionTag = SessionSpaceCompressedId | \"root\";\nexport type EncodedRevisionTag = Brand<OpSpaceCompressedId, \"EncodedRevisionTag\"> | \"root\";\nexport const RevisionTagSchema = Type.Union([\n\tType.Literal(\"root\"),\n\tbrandedNumberType<Exclude<EncodedRevisionTag, string>>(),\n]);\n\nexport type EncodedStableId = Brand<StableId, \"EncodedStableId\">;\nexport const StableIdSchema = Type.String();\n\n/**\n * An ID which is unique within a revision of a `ModularChangeset`.\n * @remarks\n * Always a real number (never `NaN` or +/- `Infinity`).\n *\n * A `ModularChangeset` which is a composition of multiple revisions may contain duplicate `ChangesetLocalId`s,\n * but they are unique when qualified by the revision of the change they are used in.\n */\nexport type ChangesetLocalId = Brand<number, \"ChangesetLocalId\">;\n\n/**\n * A globally unique ID for an atom of change, or a node associated with the atom of change.\n * *\n * @privateRemarks\n * TODO: Rename this to be more general.\n */\nexport interface ChangeAtomId {\n\t/**\n\t * Uniquely identifies the changeset within which the change was made.\n\t * Only undefined when referring to an anonymous changesets.\n\t */\n\treadonly revision?: RevisionTag;\n\t/**\n\t * Uniquely identifies, in the scope of the changeset, the change made to the field.\n\t */\n\treadonly localId: ChangesetLocalId;\n}\n\nexport type EncodedChangeAtomId = [ChangesetLocalId, EncodedRevisionTag] | ChangesetLocalId;\n\nexport type ChangeAtomIdMap<T> = NestedMap<RevisionTag | undefined, ChangesetLocalId, T>;\n\n/**\n * Returns true iff `a` and `b` are the same.\n */\nexport function areEqualChangeAtomIds(a: ChangeAtomId, b: ChangeAtomId): boolean {\n\treturn a.localId === b.localId && a.revision === b.revision;\n}\n\nexport function areEqualChangeAtomIdOpts(\n\ta: ChangeAtomId | undefined,\n\tb: ChangeAtomId | undefined,\n): boolean {\n\tif (a === undefined || b === undefined) {\n\t\treturn a === b;\n\t}\n\n\treturn areEqualChangeAtomIds(a, b);\n}\n\n/**\n * Returns a ChangeAtomId with the given revision and local ID.\n */\nexport function makeChangeAtomId(\n\tlocalId: ChangesetLocalId,\n\trevision?: RevisionTag,\n): ChangeAtomId {\n\treturn revision === undefined ? { localId } : { localId, revision };\n}\n\nexport function asChangeAtomId(id: ChangesetLocalId | ChangeAtomId): ChangeAtomId {\n\treturn typeof id === \"object\" ? id : { localId: id };\n}\n\nexport function taggedAtomId(\n\tid: ChangeAtomId,\n\trevision: RevisionTag | undefined,\n): ChangeAtomId {\n\treturn makeChangeAtomId(id.localId, id.revision ?? revision);\n}\n\nexport function taggedOptAtomId(\n\tid: ChangeAtomId | undefined,\n\trevision: RevisionTag | undefined,\n): ChangeAtomId | undefined {\n\tif (id === undefined) {\n\t\treturn undefined;\n\t}\n\treturn taggedAtomId(id, revision);\n}\n\nexport function offsetChangeAtomId<T extends ChangeAtomId>(id: T, offset: number): T {\n\treturn { ...id, localId: brand(id.localId + offset) };\n}\n\n// #region These comparison functions are used instead of e.g. `compareNumbers` as a performance optimization\n\nexport function compareChangesetLocalIds(a: ChangesetLocalId, b: ChangesetLocalId): number {\n\treturn a - b; // No need to consider `NaN` or `Infinity` since ChangesetLocalId is always a real number\n}\n\nexport function comparePartialChangesetLocalIds(\n\ta: ChangesetLocalId | undefined,\n\tb: ChangesetLocalId | undefined,\n): number {\n\tif (a === undefined) {\n\t\treturn b === undefined ? 0 : -1;\n\t} else if (b === undefined) {\n\t\treturn 1;\n\t}\n\treturn compareChangesetLocalIds(a, b);\n}\n\n// #endregion\n\n/**\n * A node in a graph of commits. A commit's parent is the commit on which it was based.\n */\nexport interface GraphCommit<TChange> {\n\t/**\n\t * The tag for this commit.\n\t * @remarks\n\t * If this commit is rebased, the corresponding rebased commit will retain this tag.\n\t * With the exception of transaction commits (which all share the same tag), this tag is unique within a given branch history.\n\t */\n\treadonly revision: RevisionTag;\n\t/** The change that will result from applying this commit */\n\treadonly change: TChange;\n\t/** The parent of this commit, on whose change this commit's change is based */\n\treadonly parent?: GraphCommit<TChange>;\n}\n\n/**\n * The type of a commit. This is used to describe the context in which the commit was created.\n *\n * @public\n */\nexport enum CommitKind {\n\t/** A commit corresponding to a change that is not the result of an undo/redo from this client. */\n\tDefault,\n\t/** A commit that is the result of an undo from this client. */\n\tUndo,\n\t/** A commit that is the result of a redo from this client. */\n\tRedo,\n}\n\n/**\n * Information about a commit that has been applied.\n *\n * @sealed @public\n */\nexport interface CommitMetadata {\n\t/**\n\t * A {@link CommitKind} enum value describing whether the commit represents an Edit, an Undo, or a Redo.\n\t */\n\treadonly kind: CommitKind;\n\t/**\n\t * Indicates whether the commit is a local edit\n\t */\n\treadonly isLocal: boolean;\n}\n\n/**\n * Information about a change that has been applied by the local client.\n * @sealed @alpha\n */\nexport interface LocalChangeMetadata extends CommitMetadata {\n\t/**\n\t * Whether the change was made on the local machine/client or received from a remote client.\n\t */\n\treadonly isLocal: true;\n\t/**\n\t * Returns a serializable object that encodes the change.\n\t * @remarks This is only available for local changes.\n\t * This change object can be {@link TreeBranchAlpha.applyChange | applied to another branch} in the same state as the one which generated it.\n\t * The change object must be applied to a SharedTree with the same IdCompressor session ID as it was created from.\n\t * @privateRemarks\n\t * This is a `SerializedChange` from treeCheckout.ts.\n\t */\n\tgetChange(): JsonCompatibleReadOnly;\n\t/**\n\t * Returns an object (a {@link RevertibleAlpha | \"revertible\"}) that can be used to revert the change that produced this event.\n\t * @remarks This is only available for local changes.\n\t * If the change is not revertible (for example, it was a change to the application schema), then this will return `undefined`.\n\t * Revertibles should be disposed when they are no longer needed.\n\t * @param onDisposed - A callback that will be invoked when the `Revertible` is disposed.\n\t * This happens when the `Revertible` is disposed manually or when the `TreeView` that the `Revertible` belongs to is disposed - whichever happens first.\n\t * This is typically used to clean up any resources associated with the `Revertible` in the host application.\n\t * @throws Throws an error if called outside the scope of the `changed` event that provided it.\n\t */\n\tgetRevertible(\n\t\tonDisposed?: (revertible: RevertibleAlpha) => void,\n\t): RevertibleAlpha | undefined;\n\n\t/**\n\t * Optional label provided by the user when commit was created.\n\t * This can be used by undo/redo to group or classify edits.\n\t */\n\treadonly label?: unknown;\n\n\t/**\n\t * A set of {@link RunTransactionParams.label | labels} for all transactions (nested or otherwise)\n\t * that made up this change.\n\t * This can be used to identify, group, or filter changes — for example, to decide whether a change\n\t * should be included in an undo/redo stack.\n\t *\n\t * @remarks\n\t * The optional {@link TransactionLabels.tree | tree} property provides the structural nesting\n\t * of the transactions as a {@link LabelTree}.\n\t *\n\t * The `tree` property is present whenever the change was produced by a transaction that\n\t * includes at least one label. If the change was unlabeled,\n\t * `tree` is `undefined` and the set is empty.\n\t *\n\t * @example\n\t * Checking whether a change was produced by a specific kind of transaction:\n\t * ```typescript\n\t * branch.events.on(\"changed\", (metadata) => {\n\t * if (metadata.labels.has(\"testLabel\")) {\n\t * // This change came from a transaction labeled \"testLabel\"\n\t * }\n\t * });\n\t * ```\n\t *\n\t * @example\n\t * A nested transaction produces a tree that reflects the nesting:\n\t * ```typescript\n\t * tree.runTransaction(() => {\n\t * tree.runTransaction(() => { ... }, { label: \"inner\" });\n\t * }, { label: \"outer\" });\n\t * // metadata.labels.has(\"inner\") === true\n\t * // metadata.labels.tree will be:\n\t * // { label: \"outer\", sublabels: [{ label: \"inner\", sublabels: [] }] }\n\t * ```\n\t */\n\treadonly labels: TransactionLabels;\n}\n\n/**\n * A tree representing the nesting structure of transaction labels.\n *\n * @remarks\n * Each transaction contributes a node whose {@link LabelTree.label} is its\n * {@link RunTransactionParams.label | label} (or `undefined` if no label was provided).\n * When transactions are nested, inner transaction nodes become {@link LabelTree.sublabels | sublabels}\n * of outer ones.\n *\n * @sealed @alpha\n */\nexport interface LabelTree {\n\t/**\n\t * The label for this transaction, or `undefined` if no label was provided.\n\t */\n\tlabel: unknown;\n\n\t/**\n\t * The label trees of any nested transactions within this one.\n\t */\n\tsublabels: LabelTree[];\n}\n\n/**\n * A set of transaction labels with an optional structural tree.\n *\n * @remarks\n * The set contains all label values from the transactions that produced the change.\n * Use standard {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set | Set}\n * methods to check for specific labels.\n *\n * The optional {@link TransactionLabels.tree | tree} property provides the structural nesting\n * of the transactions as a {@link LabelTree}.\n *\n * @sealed @alpha\n */\nexport type TransactionLabels = Set<unknown> & { tree?: LabelTree };\n\n/**\n * Information about a change that has been applied by a remote client.\n * @sealed @alpha\n */\nexport interface RemoteChangeMetadata extends CommitMetadata {\n\t/**\n\t * Whether the change was made on the local machine/client or received from a remote client.\n\t */\n\treadonly isLocal: false;\n\t/**\n\t * Returns a serializable object that encodes the change.\n\t * @remarks This is only available for {@link LocalChangeMetadata | local changes}.\n\t */\n\treadonly getChange?: undefined;\n\t/**\n\t * Returns an object (a {@link RevertibleAlpha | \"revertible\"}) that can be used to revert the change that produced this event.\n\t * @remarks This is only available for {@link LocalChangeMetadata | local changes}.\n\t */\n\treadonly getRevertible?: undefined;\n\t/**\n\t * Label provided by the user when commit was created.\n\t * @remarks This is only available for {@link LocalChangeMetadata | local changes}.\n\t */\n\treadonly label?: undefined;\n\t/**\n\t * A set of labels from nested transaction labels.\n\t * @remarks This is always empty for remote changes. Labels are only available for {@link LocalChangeMetadata | local changes}.\n\t */\n\treadonly labels: TransactionLabels;\n}\n\n/**\n * Information about a {@link LocalChangeMetadata | local} or {@link RemoteChangeMetadata | remote} change that has been applied.\n * @sealed @alpha\n */\nexport type ChangeMetadata = LocalChangeMetadata | RemoteChangeMetadata;\n\n/**\n * Creates a new graph commit object. This is useful for creating copies of commits with different parentage.\n * @param parent - the parent of the new commit\n * @param commit - the contents of the new commit object\n * @returns the new commit object\n */\n// Note that this function is synchronous, and therefore it is not a Promise.\n// However, it is still a strong commit-mint.\nexport function mintCommit<TChange>(\n\tparent: GraphCommit<TChange>,\n\tcommit: Omit<GraphCommit<TChange>, \"parent\">,\n): GraphCommit<TChange> {\n\tconst { revision, change } = commit;\n\treturn {\n\t\trevision,\n\t\tchange,\n\t\tparent,\n\t};\n}\n\nexport type ChangeAtomIdRangeMap<V> = RangeMap<ChangeAtomId, V>;\n\nexport function newChangeAtomIdRangeMap<V>(\n\toffsetValue?: (value: V, offset: number) => V,\n): ChangeAtomIdRangeMap<V> {\n\treturn new RangeMap(offsetChangeAtomId, subtractChangeAtomIds, offsetValue);\n}\n\nexport function subtractChangeAtomIds(a: ChangeAtomId, b: ChangeAtomId): number {\n\tconst cmp = comparePartialRevisions(a.revision, b.revision);\n\tif (cmp !== 0) {\n\t\treturn cmp * Number.POSITIVE_INFINITY;\n\t}\n\n\treturn a.localId - b.localId;\n}\n\n/**\n * Compares two {@link RevisionTag}s to form a strict total ordering.\n * @remarks This function tolerates arbitrary strings, not just the string \"root\".\n * It sorts as follows: `undefined` \\< `string` \\< `number`\n */\nexport function comparePartialRevisions(\n\ta: RevisionTag | undefined,\n\tb: RevisionTag | undefined,\n): number {\n\tif (typeof a === \"number\") {\n\t\treturn typeof b === \"number\" ? a - b : 1;\n\t} else if (typeof b === \"number\") {\n\t\treturn -1;\n\t}\n\n\treturn comparePartialStrings(a, b);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/rebase/types.ts"],"names":[],"mappings":"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","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tOpSpaceCompressedId,\n\tSessionId,\n\tSessionSpaceCompressedId,\n\tStableId,\n} from \"@fluidframework/id-compressor\";\nimport * as Type from \"@sinclair/typebox\";\n\nimport {\n\ttype Brand,\n\ttype JsonCompatibleReadOnly,\n\ttype NestedMap,\n\tRangeMap,\n\tbrand,\n\tbrandedNumberType,\n\tbrandedStringType,\n\tcomparePartialStrings,\n} from \"../../util/index.js\";\nimport type { RevertibleAlpha } from \"../revertible.js\";\n\n/**\n * The identifier for a particular session/user/client that can generate `GraphCommit`s\n */\nexport const SessionIdSchema = brandedStringType<SessionId>();\n\n/**\n * A unique identifier for a commit. Commits that have been rebased, but are semantically\n * the same, will share the same revision tag.\n *\n * The constant 'root' is reserved for the trunk base: minting a SessionSpaceCompressedId is not\n * possible on readonly clients. These clients generally don't need ids, but must be done at tree initialization time.\n */\nexport type RevisionTag = SessionSpaceCompressedId | \"root\";\nexport type EncodedRevisionTag = Brand<OpSpaceCompressedId, \"EncodedRevisionTag\"> | \"root\";\nexport const RevisionTagSchema = Type.Union([\n\tType.Literal(\"root\"),\n\tbrandedNumberType<Exclude<EncodedRevisionTag, string>>(),\n]);\n\nexport type EncodedStableId = Brand<StableId, \"EncodedStableId\">;\nexport const StableIdSchema = Type.String();\n\n/**\n * An ID which is unique within a revision of a `ModularChangeset`.\n * @remarks\n * Always a real number (never `NaN` or +/- `Infinity`).\n *\n * A `ModularChangeset` which is a composition of multiple revisions may contain duplicate `ChangesetLocalId`s,\n * but they are unique when qualified by the revision of the change they are used in.\n */\nexport type ChangesetLocalId = Brand<number, \"ChangesetLocalId\">;\n\n/**\n * A globally unique ID for an atom of change, or a node associated with the atom of change.\n * *\n * @privateRemarks\n * TODO: Rename this to be more general.\n */\nexport interface ChangeAtomId {\n\t/**\n\t * Uniquely identifies the changeset within which the change was made.\n\t * Only undefined when referring to an anonymous changesets.\n\t */\n\treadonly revision?: RevisionTag;\n\t/**\n\t * Uniquely identifies, in the scope of the changeset, the change made to the field.\n\t */\n\treadonly localId: ChangesetLocalId;\n}\n\nexport type EncodedChangeAtomId = [ChangesetLocalId, EncodedRevisionTag] | ChangesetLocalId;\n\nexport type ChangeAtomIdMap<T> = NestedMap<RevisionTag | undefined, ChangesetLocalId, T>;\n\n/**\n * Returns true iff `a` and `b` are the same.\n */\nexport function areEqualChangeAtomIds(a: ChangeAtomId, b: ChangeAtomId): boolean {\n\treturn a.localId === b.localId && a.revision === b.revision;\n}\n\nexport function areEqualChangeAtomIdOpts(\n\ta: ChangeAtomId | undefined,\n\tb: ChangeAtomId | undefined,\n): boolean {\n\tif (a === undefined || b === undefined) {\n\t\treturn a === b;\n\t}\n\n\treturn areEqualChangeAtomIds(a, b);\n}\n\n/**\n * Returns a ChangeAtomId with the given revision and local ID.\n */\nexport function makeChangeAtomId(\n\tlocalId: ChangesetLocalId,\n\trevision?: RevisionTag,\n): ChangeAtomId {\n\treturn revision === undefined ? { localId } : { localId, revision };\n}\n\nexport function asChangeAtomId(id: ChangesetLocalId | ChangeAtomId): ChangeAtomId {\n\treturn typeof id === \"object\" ? id : { localId: id };\n}\n\nexport function taggedAtomId(\n\tid: ChangeAtomId,\n\trevision: RevisionTag | undefined,\n): ChangeAtomId {\n\treturn makeChangeAtomId(id.localId, id.revision ?? revision);\n}\n\nexport function taggedOptAtomId(\n\tid: ChangeAtomId | undefined,\n\trevision: RevisionTag | undefined,\n): ChangeAtomId | undefined {\n\tif (id === undefined) {\n\t\treturn undefined;\n\t}\n\treturn taggedAtomId(id, revision);\n}\n\nexport function offsetChangeAtomId<T extends ChangeAtomId>(id: T, offset: number): T {\n\treturn { ...id, localId: brand(id.localId + offset) };\n}\n\n// #region These comparison functions are used instead of e.g. `compareNumbers` as a performance optimization\n\nexport function compareChangesetLocalIds(a: ChangesetLocalId, b: ChangesetLocalId): number {\n\treturn a - b; // No need to consider `NaN` or `Infinity` since ChangesetLocalId is always a real number\n}\n\nexport function comparePartialChangesetLocalIds(\n\ta: ChangesetLocalId | undefined,\n\tb: ChangesetLocalId | undefined,\n): number {\n\tif (a === undefined) {\n\t\treturn b === undefined ? 0 : -1;\n\t} else if (b === undefined) {\n\t\treturn 1;\n\t}\n\treturn compareChangesetLocalIds(a, b);\n}\n\n// #endregion\n\n/**\n * A node in a graph of commits. A commit's parent is the commit on which it was based.\n */\nexport interface GraphCommit<TChange> {\n\t/**\n\t * The tag for this commit.\n\t * @remarks\n\t * If this commit is rebased, the corresponding rebased commit will retain this tag.\n\t * With the exception of transaction commits (which all share the same tag), this tag is unique within a given branch history.\n\t */\n\treadonly revision: RevisionTag;\n\t/** The change that will result from applying this commit */\n\treadonly change: TChange;\n\t/** The parent of this commit, on whose change this commit's change is based */\n\treadonly parent?: GraphCommit<TChange>;\n}\n\n/**\n * The type of a commit. This is used to describe the context in which the commit was created.\n *\n * @public\n */\nexport enum CommitKind {\n\t/** A commit corresponding to a change that is not the result of an undo/redo from this client. */\n\tDefault,\n\t/** A commit that is the result of an undo from this client. */\n\tUndo,\n\t/** A commit that is the result of a redo from this client. */\n\tRedo,\n}\n\n/**\n * Information about a commit that has been applied.\n *\n * @sealed @public\n */\nexport interface CommitMetadata {\n\t/**\n\t * A {@link CommitKind} enum value describing whether the commit represents an Edit, an Undo, or a Redo.\n\t */\n\treadonly kind: CommitKind;\n\t/**\n\t * Indicates whether the commit is a local edit\n\t */\n\treadonly isLocal: boolean;\n}\n\n/**\n * Information about a change that has been applied by the local client.\n * @sealed @alpha\n */\nexport interface LocalChangeMetadata extends CommitMetadata {\n\t/**\n\t * Whether the change was made on the local machine/client or received from a remote client.\n\t */\n\treadonly isLocal: true;\n\t/**\n\t * Returns a serializable object that encodes the change.\n\t * @remarks This is only available for local changes.\n\t * This change object can be {@link TreeBranchAlpha.applyChange | applied to another branch} in the same state as the one which generated it.\n\t * The change object must be applied to a SharedTree with the same IdCompressor session ID as it was created from.\n\t * @privateRemarks\n\t * This is a `SerializedChange` from treeCheckout.ts.\n\t */\n\tgetChange(): JsonCompatibleReadOnly;\n\t/**\n\t * Returns an object (a {@link RevertibleAlpha | \"revertible\"}) that can be used to revert the change that produced this event.\n\t * @remarks This is only available for local changes.\n\t * If the change is not revertible (for example, it was a change to the application schema), then this will return `undefined`.\n\t * Revertibles should be disposed when they are no longer needed.\n\t * @param onDisposed - A callback that will be invoked when the `Revertible` is disposed.\n\t * This happens when the `Revertible` is disposed manually or when the `TreeView` that the `Revertible` belongs to is disposed - whichever happens first.\n\t * This is typically used to clean up any resources associated with the `Revertible` in the host application.\n\t * @throws Throws an error if called outside the scope of the `changed` event that provided it.\n\t */\n\tgetRevertible(\n\t\tonDisposed?: (revertible: RevertibleAlpha) => void,\n\t): RevertibleAlpha | undefined;\n\n\t/**\n\t * Optional label provided by the user when commit was created.\n\t * This can be used by undo/redo to group or classify edits.\n\t */\n\treadonly label?: unknown;\n\n\t/**\n\t * A set of {@link RunTransactionParams.label | labels} for all transactions (nested or otherwise)\n\t * that made up this change.\n\t * This can be used to identify, group, or filter changes — for example, to decide whether a change\n\t * should be included in an undo/redo stack.\n\t *\n\t * @remarks\n\t * The optional {@link TransactionLabels.tree | tree} property provides the structural nesting\n\t * of the transactions as a {@link LabelTree}.\n\t *\n\t * The `tree` property is present whenever the change was produced by a transaction that\n\t * includes at least one label. If the change was unlabeled,\n\t * `tree` is `undefined` and the set is empty.\n\t *\n\t * @example\n\t * Checking whether a change was produced by a specific kind of transaction:\n\t * ```typescript\n\t * branch.events.on(\"changed\", (metadata) => {\n\t * if (metadata.labels.has(\"testLabel\")) {\n\t * // This change came from a transaction labeled \"testLabel\"\n\t * }\n\t * });\n\t * ```\n\t *\n\t * @example\n\t * A nested transaction produces a tree that reflects the nesting:\n\t * ```typescript\n\t * tree.runTransaction(() => {\n\t * tree.runTransaction(() => { ... }, { label: \"inner\" });\n\t * }, { label: \"outer\" });\n\t * // metadata.labels.has(\"inner\") === true\n\t * // metadata.labels.tree will be:\n\t * // { label: \"outer\", sublabels: [{ label: \"inner\", sublabels: [] }] }\n\t * ```\n\t */\n\treadonly labels: TransactionLabels;\n}\n\n/**\n * A tree representing the nesting structure of transaction labels.\n *\n * @remarks\n * Each transaction contributes a node whose {@link LabelTree.label} is its\n * {@link RunTransactionParams.label | label} (or `undefined` if no label was provided).\n * When transactions are nested, inner transaction nodes become {@link LabelTree.sublabels | sublabels}\n * of outer ones.\n *\n * @sealed @alpha\n */\nexport interface LabelTree {\n\t/**\n\t * The label for this transaction, or `undefined` if no label was provided.\n\t */\n\tlabel: unknown;\n\n\t/**\n\t * The label trees of any nested transactions within this one.\n\t */\n\tsublabels: LabelTree[];\n}\n\n/**\n * A set of transaction labels with an optional structural tree.\n *\n * @remarks\n * The set contains all label values from the transactions that produced the change.\n * Use standard {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set | Set}\n * methods to check for specific labels.\n *\n * The optional {@link TransactionLabels.tree | tree} property provides the structural nesting\n * of the transactions as a {@link LabelTree}.\n *\n * @sealed @alpha\n */\nexport type TransactionLabels = Set<unknown> & { tree?: LabelTree };\n\n/**\n * Information about a change that has been applied by a remote client.\n * @sealed @alpha\n */\nexport interface RemoteChangeMetadata extends CommitMetadata {\n\t/**\n\t * Whether the change was made on the local machine/client or received from a remote client.\n\t */\n\treadonly isLocal: false;\n\t/**\n\t * Returns a serializable object that encodes the change.\n\t * @remarks This is only available for {@link LocalChangeMetadata | local changes}.\n\t */\n\treadonly getChange?: undefined;\n\t/**\n\t * Returns an object (a {@link RevertibleAlpha | \"revertible\"}) that can be used to revert the change that produced this event.\n\t * @remarks This is only available for {@link LocalChangeMetadata | local changes}.\n\t */\n\treadonly getRevertible?: undefined;\n\t/**\n\t * Label provided by the user when commit was created.\n\t * @remarks This is only available for {@link LocalChangeMetadata | local changes}.\n\t */\n\treadonly label?: undefined;\n\t/**\n\t * A set of labels from nested transaction labels.\n\t * @remarks This is always empty for remote changes. Labels are only available for {@link LocalChangeMetadata | local changes}.\n\t */\n\treadonly labels: TransactionLabels;\n}\n\n/**\n * Information about a {@link LocalChangeMetadata | local} or {@link RemoteChangeMetadata | remote} change that has been applied.\n * @sealed @alpha\n */\nexport type ChangeMetadata = LocalChangeMetadata | RemoteChangeMetadata;\n\n/**\n * Creates a new graph commit object. This is useful for creating copies of commits with different parentage.\n * @param parent - the parent of the new commit\n * @param commit - the contents of the new commit object\n * @returns the new commit object\n */\n// Note that this function is synchronous, and therefore it is not a Promise.\n// However, it is still a strong commit-mint.\nexport function mintCommit<TChange>(\n\tparent: GraphCommit<TChange>,\n\tcommit: Omit<GraphCommit<TChange>, \"parent\">,\n): GraphCommit<TChange> {\n\tconst { revision, change } = commit;\n\treturn {\n\t\trevision,\n\t\tchange,\n\t\tparent,\n\t};\n}\n\nexport type ChangeAtomIdRangeMap<V> = RangeMap<ChangeAtomId, V>;\n\nexport function newChangeAtomIdRangeMap<V>(\n\toffsetValue?: (value: V, offset: number) => V,\n): ChangeAtomIdRangeMap<V> {\n\treturn new RangeMap(offsetChangeAtomId, subtractChangeAtomIds, offsetValue);\n}\n\nexport function subtractChangeAtomIds(a: ChangeAtomId, b: ChangeAtomId): number {\n\tconst cmp = comparePartialRevisions(a.revision, b.revision);\n\tif (cmp !== 0) {\n\t\treturn cmp * Number.POSITIVE_INFINITY;\n\t}\n\n\treturn a.localId - b.localId;\n}\n\n/**\n * Compares two {@link RevisionTag}s to form a strict total ordering.\n * @remarks This function tolerates arbitrary strings, not just the string \"root\".\n * It sorts as follows: `undefined` \\< `string` \\< `number`\n */\nexport function comparePartialRevisions(\n\ta: RevisionTag | undefined,\n\tb: RevisionTag | undefined,\n): number {\n\tif (typeof a === \"number\") {\n\t\treturn typeof b === \"number\" ? a - b : 1;\n\t} else if (typeof b === \"number\") {\n\t\treturn -1;\n\t}\n\n\treturn comparePartialStrings(a, b);\n}\n"]}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import * as Type from "@sinclair/typebox";
|
|
6
|
+
import type { Static } from "@sinclair/typebox";
|
|
6
7
|
import { type Brand } from "../../util/index.js";
|
|
7
8
|
/**
|
|
8
9
|
* Key (aka Name or Label) for a field which is scoped to a specific TreeNodeStoredSchema.
|
|
@@ -13,7 +14,7 @@ export type FieldKey = Brand<string, "tree.FieldKey">;
|
|
|
13
14
|
/**
|
|
14
15
|
* TypeBox Schema for encoding {@link FieldKey} in persisted data.
|
|
15
16
|
*/
|
|
16
|
-
export declare const FieldKeySchema:
|
|
17
|
+
export declare const FieldKeySchema: Type.TUnsafe<FieldKey>;
|
|
17
18
|
/**
|
|
18
19
|
* Identifier for a TreeNode schema.
|
|
19
20
|
* Also known as "Definition"
|
|
@@ -28,15 +29,15 @@ export type TreeNodeSchemaIdentifier<TName extends string = string> = Brand<TNam
|
|
|
28
29
|
* Persisted in documents as part of stored schema.
|
|
29
30
|
*/
|
|
30
31
|
export type FieldKindIdentifier = Brand<string, "tree.FieldKindIdentifier">;
|
|
31
|
-
export declare const FieldKindIdentifierSchema:
|
|
32
|
+
export declare const FieldKindIdentifierSchema: Type.TUnsafe<FieldKindIdentifier>;
|
|
32
33
|
/**
|
|
33
34
|
* TypeBox Schema for encoding {@link TreeNodeSchemaIdentifiers} in persisted data.
|
|
34
35
|
*/
|
|
35
|
-
export declare const TreeNodeSchemaIdentifierSchema:
|
|
36
|
+
export declare const TreeNodeSchemaIdentifierSchema: Type.TUnsafe<TreeNodeSchemaIdentifier<string>>;
|
|
36
37
|
export type FieldSchemaFormat = Static<typeof FieldSchemaFormat>;
|
|
37
|
-
export declare const FieldSchemaFormat:
|
|
38
|
-
kind:
|
|
39
|
-
types:
|
|
38
|
+
export declare const FieldSchemaFormat: Type.TObject<{
|
|
39
|
+
kind: Type.TUnsafe<FieldKindIdentifier>;
|
|
40
|
+
types: Type.TArray<Type.TUnsafe<TreeNodeSchemaIdentifier<string>>>;
|
|
40
41
|
}>;
|
|
41
42
|
/**
|
|
42
43
|
* Persisted version of {@link ValueSchema}.
|
|
@@ -54,24 +55,24 @@ export declare enum PersistedValueSchema {
|
|
|
54
55
|
* See {@link DiscriminatedUnionDispatcher} for more information on this pattern.
|
|
55
56
|
*/
|
|
56
57
|
export type TreeNodeSchemaDataFormat = Static<typeof TreeNodeSchemaDataFormat>;
|
|
57
|
-
export declare const TreeNodeSchemaDataFormat:
|
|
58
|
+
export declare const TreeNodeSchemaDataFormat: Type.TObject<{
|
|
58
59
|
/**
|
|
59
60
|
* Object node union member.
|
|
60
61
|
*/
|
|
61
|
-
object:
|
|
62
|
-
kind:
|
|
63
|
-
types:
|
|
62
|
+
object: Type.TOptional<Type.TRecord<Type.TString, Type.TObject<{
|
|
63
|
+
kind: Type.TUnsafe<FieldKindIdentifier>;
|
|
64
|
+
types: Type.TArray<Type.TUnsafe<TreeNodeSchemaIdentifier<string>>>;
|
|
64
65
|
}>>>;
|
|
65
66
|
/**
|
|
66
67
|
* Map node union member.
|
|
67
68
|
*/
|
|
68
|
-
map:
|
|
69
|
-
kind:
|
|
70
|
-
types:
|
|
69
|
+
map: Type.TOptional<Type.TObject<{
|
|
70
|
+
kind: Type.TUnsafe<FieldKindIdentifier>;
|
|
71
|
+
types: Type.TArray<Type.TUnsafe<TreeNodeSchemaIdentifier<string>>>;
|
|
71
72
|
}>>;
|
|
72
73
|
/**
|
|
73
74
|
* Leaf node union member.
|
|
74
75
|
*/
|
|
75
|
-
leaf:
|
|
76
|
+
leaf: Type.TOptional<Type.TEnum<typeof PersistedValueSchema>>;
|
|
76
77
|
}>;
|
|
77
78
|
//# sourceMappingURL=formatV1.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatV1.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/formatV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"formatV1.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/formatV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,EAAiB,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG/D,OAAO,EAAE,KAAK,KAAK,EAAqB,MAAM,qBAAqB,CAAC;AAEpE;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,cAAc,wBAAgC,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,IAAI,KAAK,CAC1E,KAAK,EACL,+BAA+B,CAC/B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;AAC5E,eAAO,MAAM,yBAAyB,mCAA2C,CAAC;AAElF;;GAEG;AACH,eAAO,MAAM,8BAA8B,gDAAgD,CAAC;AAS5F,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACjE,eAAO,MAAM,iBAAiB;;;EAA6D,CAAC;AAE5F;;GAEG;AACH,oBAAY,oBAAoB;IAC/B,MAAM,IAAA;IACN,MAAM,IAAA;IACN,OAAO,IAAA;IACP,WAAW,IAAA;IACX,IAAI,IAAA;CACJ;AAED;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC/E,eAAO,MAAM,wBAAwB;IAEnC;;OAEG;;;;;IAEH;;OAEG;;;;;IAEH;;OAEG;;EAIJ,CAAC"}
|
|
@@ -3,9 +3,32 @@
|
|
|
3
3
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
6
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
30
|
exports.TreeNodeSchemaDataFormat = exports.PersistedValueSchema = exports.FieldSchemaFormat = exports.TreeNodeSchemaIdentifierSchema = exports.FieldKindIdentifierSchema = exports.FieldKeySchema = void 0;
|
|
8
|
-
const
|
|
31
|
+
const Type = __importStar(require("@sinclair/typebox"));
|
|
9
32
|
const index_js_1 = require("../../codec/index.js");
|
|
10
33
|
const index_js_2 = require("../../util/index.js");
|
|
11
34
|
/**
|
|
@@ -17,12 +40,12 @@ exports.FieldKindIdentifierSchema = (0, index_js_2.brandedStringType)();
|
|
|
17
40
|
* TypeBox Schema for encoding {@link TreeNodeSchemaIdentifiers} in persisted data.
|
|
18
41
|
*/
|
|
19
42
|
exports.TreeNodeSchemaIdentifierSchema = (0, index_js_2.brandedStringType)();
|
|
20
|
-
const FieldSchemaFormatBase =
|
|
43
|
+
const FieldSchemaFormatBase = Type.Object({
|
|
21
44
|
kind: exports.FieldKindIdentifierSchema,
|
|
22
|
-
types:
|
|
45
|
+
types: Type.Array(exports.TreeNodeSchemaIdentifierSchema),
|
|
23
46
|
});
|
|
24
47
|
const noAdditionalProps = { additionalProperties: false };
|
|
25
|
-
exports.FieldSchemaFormat =
|
|
48
|
+
exports.FieldSchemaFormat = Type.Composite([FieldSchemaFormatBase], noAdditionalProps);
|
|
26
49
|
/**
|
|
27
50
|
* Persisted version of {@link ValueSchema}.
|
|
28
51
|
*/
|
|
@@ -34,18 +57,18 @@ var PersistedValueSchema;
|
|
|
34
57
|
PersistedValueSchema[PersistedValueSchema["FluidHandle"] = 3] = "FluidHandle";
|
|
35
58
|
PersistedValueSchema[PersistedValueSchema["Null"] = 4] = "Null";
|
|
36
59
|
})(PersistedValueSchema || (exports.PersistedValueSchema = PersistedValueSchema = {}));
|
|
37
|
-
exports.TreeNodeSchemaDataFormat =
|
|
60
|
+
exports.TreeNodeSchemaDataFormat = Type.Object({
|
|
38
61
|
/**
|
|
39
62
|
* Object node union member.
|
|
40
63
|
*/
|
|
41
|
-
object:
|
|
64
|
+
object: Type.Optional(Type.Record(Type.String(), exports.FieldSchemaFormat)),
|
|
42
65
|
/**
|
|
43
66
|
* Map node union member.
|
|
44
67
|
*/
|
|
45
|
-
map:
|
|
68
|
+
map: Type.Optional(exports.FieldSchemaFormat),
|
|
46
69
|
/**
|
|
47
70
|
* Leaf node union member.
|
|
48
71
|
*/
|
|
49
|
-
leaf:
|
|
72
|
+
leaf: Type.Optional(Type.Enum(PersistedValueSchema)),
|
|
50
73
|
}, index_js_1.unionOptions);
|
|
51
74
|
//# sourceMappingURL=formatV1.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatV1.js","sourceRoot":"","sources":["../../../src/core/schema-stored/formatV1.ts"],"names":[],"mappings":";AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"formatV1.js","sourceRoot":"","sources":["../../../src/core/schema-stored/formatV1.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,wDAA0C;AAG1C,mDAAoD;AACpD,kDAAoE;AASpE;;GAEG;AACU,QAAA,cAAc,GAAG,IAAA,4BAAiB,GAAY,CAAC;AAoB/C,QAAA,yBAAyB,GAAG,IAAA,4BAAiB,GAAuB,CAAC;AAElF;;GAEG;AACU,QAAA,8BAA8B,GAAG,IAAA,4BAAiB,GAA4B,CAAC;AAE5F,MAAM,qBAAqB,GAAG,IAAI,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,iCAAyB;IAC/B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,sCAA8B,CAAC;CACjD,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAG5D,QAAA,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,qBAAqB,CAAC,EAAE,iBAAiB,CAAC,CAAC;AAE5F;;GAEG;AACH,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC/B,mEAAM,CAAA;IACN,mEAAM,CAAA;IACN,qEAAO,CAAA;IACP,6EAAW,CAAA;IACX,+DAAI,CAAA;AACL,CAAC,EANW,oBAAoB,oCAApB,oBAAoB,QAM/B;AAQY,QAAA,wBAAwB,GAAG,IAAI,CAAC,MAAM,CAClD;IACC;;OAEG;IACH,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,yBAAiB,CAAC,CAAC;IACpE;;OAEG;IACH,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,yBAAiB,CAAC;IACrC;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;CACpD,EACD,uBAAY,CACZ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as Type from \"@sinclair/typebox\";\nimport type { ObjectOptions, Static } from \"@sinclair/typebox\";\n\nimport { unionOptions } from \"../../codec/index.js\";\nimport { type Brand, brandedStringType } from \"../../util/index.js\";\n\n/**\n * Key (aka Name or Label) for a field which is scoped to a specific TreeNodeStoredSchema.\n *\n * Stable identifier, used when persisting data.\n */\nexport type FieldKey = Brand<string, \"tree.FieldKey\">;\n\n/**\n * TypeBox Schema for encoding {@link FieldKey} in persisted data.\n */\nexport const FieldKeySchema = brandedStringType<FieldKey>();\n\n/**\n * Identifier for a TreeNode schema.\n * Also known as \"Definition\"\n *\n * Stable identifier, used when persisting data.\n */\nexport type TreeNodeSchemaIdentifier<TName extends string = string> = Brand<\n\tTName,\n\t\"tree.TreeNodeSchemaIdentifier\"\n>;\n\n/**\n * Identifier for a FieldKind.\n * Refers to an exact stable policy (ex: specific version of a policy),\n * for how to handle (ex: edit and merge edits to) fields marked with this kind.\n * Persisted in documents as part of stored schema.\n */\nexport type FieldKindIdentifier = Brand<string, \"tree.FieldKindIdentifier\">;\nexport const FieldKindIdentifierSchema = brandedStringType<FieldKindIdentifier>();\n\n/**\n * TypeBox Schema for encoding {@link TreeNodeSchemaIdentifiers} in persisted data.\n */\nexport const TreeNodeSchemaIdentifierSchema = brandedStringType<TreeNodeSchemaIdentifier>();\n\nconst FieldSchemaFormatBase = Type.Object({\n\tkind: FieldKindIdentifierSchema,\n\ttypes: Type.Array(TreeNodeSchemaIdentifierSchema),\n});\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\nexport type FieldSchemaFormat = Static<typeof FieldSchemaFormat>;\nexport const FieldSchemaFormat = Type.Composite([FieldSchemaFormatBase], noAdditionalProps);\n\n/**\n * Persisted version of {@link ValueSchema}.\n */\nexport enum PersistedValueSchema {\n\tNumber,\n\tString,\n\tBoolean,\n\tFluidHandle,\n\tNull,\n}\n\n/**\n * Discriminated union content of tree node schema.\n *\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport type TreeNodeSchemaDataFormat = Static<typeof TreeNodeSchemaDataFormat>;\nexport const TreeNodeSchemaDataFormat = Type.Object(\n\t{\n\t\t/**\n\t\t * Object node union member.\n\t\t */\n\t\tobject: Type.Optional(Type.Record(Type.String(), FieldSchemaFormat)),\n\t\t/**\n\t\t * Map node union member.\n\t\t */\n\t\tmap: Type.Optional(FieldSchemaFormat),\n\t\t/**\n\t\t * Leaf node union member.\n\t\t */\n\t\tleaf: Type.Optional(Type.Enum(PersistedValueSchema)),\n\t},\n\tunionOptions,\n);\n"]}
|
|
@@ -2,43 +2,44 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import type { Static } from "@sinclair/typebox";
|
|
6
|
+
import * as Type from "@sinclair/typebox";
|
|
6
7
|
import type { JsonCompatibleReadOnlyObject } from "../../util/index.js";
|
|
7
8
|
import { PersistedValueSchema } from "./formatV1.js";
|
|
8
9
|
export type PersistedMetadataFormat = Static<typeof PersistedMetadataFormat>;
|
|
9
|
-
export declare const PersistedMetadataFormat:
|
|
10
|
+
export declare const PersistedMetadataFormat: Type.TOptional<Type.TUnsafe<JsonCompatibleReadOnlyObject>>;
|
|
10
11
|
export type FieldSchemaFormat = Static<typeof FieldSchemaFormat>;
|
|
11
|
-
export declare const FieldSchemaFormat:
|
|
12
|
-
kind:
|
|
13
|
-
types:
|
|
14
|
-
metadata:
|
|
12
|
+
export declare const FieldSchemaFormat: Type.TObject<{
|
|
13
|
+
kind: Type.TUnsafe<import("./formatV1.js").FieldKindIdentifier>;
|
|
14
|
+
types: Type.TArray<Type.TUnsafe<import("./formatV1.js").TreeNodeSchemaIdentifier<string>>>;
|
|
15
|
+
metadata: Type.TOptional<Type.TUnsafe<JsonCompatibleReadOnlyObject>>;
|
|
15
16
|
}>;
|
|
16
17
|
/**
|
|
17
18
|
* Format for the content of a {@link TreeNodeStoredSchema}.
|
|
18
19
|
*
|
|
19
20
|
* See {@link DiscriminatedUnionDispatcher} for more information on this pattern.
|
|
20
21
|
*/
|
|
21
|
-
export declare const TreeNodeSchemaUnionFormat:
|
|
22
|
+
export declare const TreeNodeSchemaUnionFormat: Type.TObject<{
|
|
22
23
|
/**
|
|
23
24
|
* Object node union member.
|
|
24
25
|
*/
|
|
25
|
-
object:
|
|
26
|
-
kind:
|
|
27
|
-
types:
|
|
28
|
-
metadata:
|
|
26
|
+
object: Type.TOptional<Type.TRecord<Type.TString, Type.TObject<{
|
|
27
|
+
kind: Type.TUnsafe<import("./formatV1.js").FieldKindIdentifier>;
|
|
28
|
+
types: Type.TArray<Type.TUnsafe<import("./formatV1.js").TreeNodeSchemaIdentifier<string>>>;
|
|
29
|
+
metadata: Type.TOptional<Type.TUnsafe<JsonCompatibleReadOnlyObject>>;
|
|
29
30
|
}>>>;
|
|
30
31
|
/**
|
|
31
32
|
* Map node union member.
|
|
32
33
|
*/
|
|
33
|
-
map:
|
|
34
|
-
kind:
|
|
35
|
-
types:
|
|
36
|
-
metadata:
|
|
34
|
+
map: Type.TOptional<Type.TObject<{
|
|
35
|
+
kind: Type.TUnsafe<import("./formatV1.js").FieldKindIdentifier>;
|
|
36
|
+
types: Type.TArray<Type.TUnsafe<import("./formatV1.js").TreeNodeSchemaIdentifier<string>>>;
|
|
37
|
+
metadata: Type.TOptional<Type.TUnsafe<JsonCompatibleReadOnlyObject>>;
|
|
37
38
|
}>>;
|
|
38
39
|
/**
|
|
39
40
|
* Leaf node union member.
|
|
40
41
|
*/
|
|
41
|
-
leaf:
|
|
42
|
+
leaf: Type.TOptional<Type.TEnum<typeof PersistedValueSchema>>;
|
|
42
43
|
}>;
|
|
43
44
|
export type TreeNodeSchemaUnionFormat = Static<typeof TreeNodeSchemaUnionFormat>;
|
|
44
45
|
/**
|
|
@@ -47,35 +48,35 @@ export type TreeNodeSchemaUnionFormat = Static<typeof TreeNodeSchemaUnionFormat>
|
|
|
47
48
|
* See {@link DiscriminatedUnionDispatcher} for more information on this pattern.
|
|
48
49
|
*/
|
|
49
50
|
export type TreeNodeSchemaDataFormat = Static<typeof TreeNodeSchemaDataFormat>;
|
|
50
|
-
export declare const TreeNodeSchemaDataFormat:
|
|
51
|
+
export declare const TreeNodeSchemaDataFormat: Type.TObject<{
|
|
51
52
|
/**
|
|
52
53
|
* Node kind specific data.
|
|
53
54
|
*/
|
|
54
|
-
kind:
|
|
55
|
+
kind: Type.TObject<{
|
|
55
56
|
/**
|
|
56
57
|
* Object node union member.
|
|
57
58
|
*/
|
|
58
|
-
object:
|
|
59
|
-
kind:
|
|
60
|
-
types:
|
|
61
|
-
metadata:
|
|
59
|
+
object: Type.TOptional<Type.TRecord<Type.TString, Type.TObject<{
|
|
60
|
+
kind: Type.TUnsafe<import("./formatV1.js").FieldKindIdentifier>;
|
|
61
|
+
types: Type.TArray<Type.TUnsafe<import("./formatV1.js").TreeNodeSchemaIdentifier<string>>>;
|
|
62
|
+
metadata: Type.TOptional<Type.TUnsafe<JsonCompatibleReadOnlyObject>>;
|
|
62
63
|
}>>>;
|
|
63
64
|
/**
|
|
64
65
|
* Map node union member.
|
|
65
66
|
*/
|
|
66
|
-
map:
|
|
67
|
-
kind:
|
|
68
|
-
types:
|
|
69
|
-
metadata:
|
|
67
|
+
map: Type.TOptional<Type.TObject<{
|
|
68
|
+
kind: Type.TUnsafe<import("./formatV1.js").FieldKindIdentifier>;
|
|
69
|
+
types: Type.TArray<Type.TUnsafe<import("./formatV1.js").TreeNodeSchemaIdentifier<string>>>;
|
|
70
|
+
metadata: Type.TOptional<Type.TUnsafe<JsonCompatibleReadOnlyObject>>;
|
|
70
71
|
}>>;
|
|
71
72
|
/**
|
|
72
73
|
* Leaf node union member.
|
|
73
74
|
*/
|
|
74
|
-
leaf:
|
|
75
|
+
leaf: Type.TOptional<Type.TEnum<typeof PersistedValueSchema>>;
|
|
75
76
|
}>;
|
|
76
77
|
/**
|
|
77
78
|
* Persisted subset of metadata for this node schema.
|
|
78
79
|
*/
|
|
79
|
-
metadata:
|
|
80
|
+
metadata: Type.TOptional<Type.TUnsafe<JsonCompatibleReadOnlyObject>>;
|
|
80
81
|
}>;
|
|
81
82
|
//# sourceMappingURL=formatV2.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatV2.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/formatV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"formatV2.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/formatV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAiB,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAG1C,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAGxE,OAAO,EAEN,oBAAoB,EAEpB,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC7E,eAAO,MAAM,uBAAuB,4DAInC,CAAC;AAUF,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACjE,eAAO,MAAM,iBAAiB;;;;EAA6D,CAAC;AAE5F;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;IAEpC;;OAEG;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;EAIJ,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAEjF;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC/E,eAAO,MAAM,wBAAwB;IAEnC;;OAEG;;QA5BH;;WAEG;;;;;;QAEH;;WAEG;;;;;;QAEH;;WAEG;;;IAsBH;;OAEG;;EAIJ,CAAC"}
|
|
@@ -3,40 +3,63 @@
|
|
|
3
3
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
6
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
30
|
exports.TreeNodeSchemaDataFormat = exports.TreeNodeSchemaUnionFormat = exports.FieldSchemaFormat = exports.PersistedMetadataFormat = void 0;
|
|
8
|
-
const
|
|
31
|
+
const Type = __importStar(require("@sinclair/typebox"));
|
|
9
32
|
const index_js_1 = require("../../codec/index.js");
|
|
10
33
|
const index_js_2 = require("../../util/index.js");
|
|
11
34
|
const formatV1_js_1 = require("./formatV1.js");
|
|
12
|
-
exports.PersistedMetadataFormat =
|
|
13
|
-
const FieldSchemaFormatBase =
|
|
35
|
+
exports.PersistedMetadataFormat = Type.Optional(Type.Unsafe(Type.Record(Type.String(), index_js_2.JsonCompatibleReadOnlySchema)));
|
|
36
|
+
const FieldSchemaFormatBase = Type.Object({
|
|
14
37
|
kind: formatV1_js_1.FieldKindIdentifierSchema,
|
|
15
|
-
types:
|
|
38
|
+
types: Type.Array(formatV1_js_1.TreeNodeSchemaIdentifierSchema),
|
|
16
39
|
metadata: exports.PersistedMetadataFormat,
|
|
17
40
|
});
|
|
18
41
|
const noAdditionalProps = { additionalProperties: false };
|
|
19
|
-
exports.FieldSchemaFormat =
|
|
42
|
+
exports.FieldSchemaFormat = Type.Composite([FieldSchemaFormatBase], noAdditionalProps);
|
|
20
43
|
/**
|
|
21
44
|
* Format for the content of a {@link TreeNodeStoredSchema}.
|
|
22
45
|
*
|
|
23
46
|
* See {@link DiscriminatedUnionDispatcher} for more information on this pattern.
|
|
24
47
|
*/
|
|
25
|
-
exports.TreeNodeSchemaUnionFormat =
|
|
48
|
+
exports.TreeNodeSchemaUnionFormat = Type.Object({
|
|
26
49
|
/**
|
|
27
50
|
* Object node union member.
|
|
28
51
|
*/
|
|
29
|
-
object:
|
|
52
|
+
object: Type.Optional(Type.Record(Type.String(), exports.FieldSchemaFormat)),
|
|
30
53
|
/**
|
|
31
54
|
* Map node union member.
|
|
32
55
|
*/
|
|
33
|
-
map:
|
|
56
|
+
map: Type.Optional(exports.FieldSchemaFormat),
|
|
34
57
|
/**
|
|
35
58
|
* Leaf node union member.
|
|
36
59
|
*/
|
|
37
|
-
leaf:
|
|
60
|
+
leaf: Type.Optional(Type.Enum(formatV1_js_1.PersistedValueSchema)),
|
|
38
61
|
}, index_js_1.unionOptions);
|
|
39
|
-
exports.TreeNodeSchemaDataFormat =
|
|
62
|
+
exports.TreeNodeSchemaDataFormat = Type.Object({
|
|
40
63
|
/**
|
|
41
64
|
* Node kind specific data.
|
|
42
65
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatV2.js","sourceRoot":"","sources":["../../../src/core/schema-stored/formatV2.ts"],"names":[],"mappings":";AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"formatV2.js","sourceRoot":"","sources":["../../../src/core/schema-stored/formatV2.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,wDAA0C;AAE1C,mDAAoD;AAEpD,kDAAmE;AAEnE,+CAIuB;AAGV,QAAA,uBAAuB,GAAG,IAAI,CAAC,QAAQ,CACnD,IAAI,CAAC,MAAM,CACV,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,uCAA4B,CAAC,CACxD,CACD,CAAC;AAEF,MAAM,qBAAqB,GAAG,IAAI,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,uCAAyB;IAC/B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,4CAA8B,CAAC;IACjD,QAAQ,EAAE,+BAAuB;CACjC,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAG5D,QAAA,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,qBAAqB,CAAC,EAAE,iBAAiB,CAAC,CAAC;AAE5F;;;;GAIG;AACU,QAAA,yBAAyB,GAAG,IAAI,CAAC,MAAM,CACnD;IACC;;OAEG;IACH,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,yBAAiB,CAAC,CAAC;IACpE;;OAEG;IACH,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,yBAAiB,CAAC;IACrC;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,kCAAoB,CAAC,CAAC;CACpD,EACD,uBAAY,CACZ,CAAC;AAUW,QAAA,wBAAwB,GAAG,IAAI,CAAC,MAAM,CAClD;IACC;;OAEG;IACH,IAAI,EAAE,iCAAyB;IAE/B,2CAA2C;IAC3C;;OAEG;IACH,QAAQ,EAAE,+BAAuB;CACjC,EACD,iBAAiB,CACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ObjectOptions, Static } from \"@sinclair/typebox\";\nimport * as Type from \"@sinclair/typebox\";\n\nimport { unionOptions } from \"../../codec/index.js\";\nimport type { JsonCompatibleReadOnlyObject } from \"../../util/index.js\";\nimport { JsonCompatibleReadOnlySchema } from \"../../util/index.js\";\n\nimport {\n\tFieldKindIdentifierSchema,\n\tPersistedValueSchema,\n\tTreeNodeSchemaIdentifierSchema,\n} from \"./formatV1.js\";\n\nexport type PersistedMetadataFormat = Static<typeof PersistedMetadataFormat>;\nexport const PersistedMetadataFormat = Type.Optional(\n\tType.Unsafe<JsonCompatibleReadOnlyObject>(\n\t\tType.Record(Type.String(), JsonCompatibleReadOnlySchema),\n\t),\n);\n\nconst FieldSchemaFormatBase = Type.Object({\n\tkind: FieldKindIdentifierSchema,\n\ttypes: Type.Array(TreeNodeSchemaIdentifierSchema),\n\tmetadata: PersistedMetadataFormat,\n});\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\nexport type FieldSchemaFormat = Static<typeof FieldSchemaFormat>;\nexport const FieldSchemaFormat = Type.Composite([FieldSchemaFormatBase], noAdditionalProps);\n\n/**\n * Format for the content of a {@link TreeNodeStoredSchema}.\n *\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport const TreeNodeSchemaUnionFormat = Type.Object(\n\t{\n\t\t/**\n\t\t * Object node union member.\n\t\t */\n\t\tobject: Type.Optional(Type.Record(Type.String(), FieldSchemaFormat)),\n\t\t/**\n\t\t * Map node union member.\n\t\t */\n\t\tmap: Type.Optional(FieldSchemaFormat),\n\t\t/**\n\t\t * Leaf node union member.\n\t\t */\n\t\tleaf: Type.Optional(Type.Enum(PersistedValueSchema)),\n\t},\n\tunionOptions,\n);\n\nexport type TreeNodeSchemaUnionFormat = Static<typeof TreeNodeSchemaUnionFormat>;\n\n/**\n * Format for {@link TreeNodeStoredSchema}.\n *\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport type TreeNodeSchemaDataFormat = Static<typeof TreeNodeSchemaDataFormat>;\nexport const TreeNodeSchemaDataFormat = Type.Object(\n\t{\n\t\t/**\n\t\t * Node kind specific data.\n\t\t */\n\t\tkind: TreeNodeSchemaUnionFormat,\n\n\t\t// Data in common for all TreeNode schemas:\n\t\t/**\n\t\t * Persisted subset of metadata for this node schema.\n\t\t */\n\t\tmetadata: PersistedMetadataFormat,\n\t},\n\tnoAdditionalProps,\n);\n"]}
|
|
@@ -11,13 +11,13 @@ export declare function offsetDetachId(id: DetachedNodeId, offset: number): Deta
|
|
|
11
11
|
export declare function offsetDetachId(id: DetachedNodeId | undefined, offset: number): DetachedNodeId | undefined;
|
|
12
12
|
export declare function areDetachedNodeIdsEqual(a: DetachedNodeId, b: DetachedNodeId): boolean;
|
|
13
13
|
/**
|
|
14
|
-
* Returns true if a delta field map contains any changes that would be visible in the document (
|
|
14
|
+
* Returns true if a delta field map contains any changes that would be visible in the document (i.e., a detach or an attach)
|
|
15
15
|
* @param fields - Delta FieldMap to check for visible changes
|
|
16
16
|
* @returns True if change map contains any changes that would be visible in the document, false otherwise
|
|
17
17
|
*/
|
|
18
18
|
export declare function deltaFieldMapHasVisibleChanges(fields: FieldMap | undefined): boolean;
|
|
19
19
|
/**
|
|
20
|
-
* Returns true if the given field changes contains any changes that would be visible in the document (
|
|
20
|
+
* Returns true if the given field changes contains any changes that would be visible in the document (i.e., a detach or an attach)
|
|
21
21
|
* @param fieldChanges - Field changes to check for visible changes
|
|
22
22
|
* @returns True if the field changes contain any changes that would be visible in the document, false otherwise
|
|
23
23
|
*/
|
|
@@ -44,7 +44,7 @@ function areDetachedNodeIdsEqual(a, b) {
|
|
|
44
44
|
}
|
|
45
45
|
exports.areDetachedNodeIdsEqual = areDetachedNodeIdsEqual;
|
|
46
46
|
/**
|
|
47
|
-
* Returns true if a delta field map contains any changes that would be visible in the document (
|
|
47
|
+
* Returns true if a delta field map contains any changes that would be visible in the document (i.e., a detach or an attach)
|
|
48
48
|
* @param fields - Delta FieldMap to check for visible changes
|
|
49
49
|
* @returns True if change map contains any changes that would be visible in the document, false otherwise
|
|
50
50
|
*/
|
|
@@ -61,7 +61,7 @@ function deltaFieldMapHasVisibleChanges(fields) {
|
|
|
61
61
|
}
|
|
62
62
|
exports.deltaFieldMapHasVisibleChanges = deltaFieldMapHasVisibleChanges;
|
|
63
63
|
/**
|
|
64
|
-
* Returns true if the given field changes contains any changes that would be visible in the document (
|
|
64
|
+
* Returns true if the given field changes contains any changes that would be visible in the document (i.e., a detach or an attach)
|
|
65
65
|
* @param fieldChanges - Field changes to check for visible changes
|
|
66
66
|
* @returns True if the field changes contain any changes that would be visible in the document, false otherwise
|
|
67
67
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deltaUtil.js","sourceRoot":"","sources":["../../../src/core/tree/deltaUtil.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,yCAA0C;AAE7B,QAAA,UAAU,GAAS,EAAE,CAAC;AAEnC,SAAgB,0BAA0B,CAAC,OAAkB;IAC5D,IAAI,OAAO,CAAC,cAAc,KAAK,CAAC,EAAE,CAAC;QAClC,OAAO,kBAAU,CAAC;IACnB,CAAC;IACD,MAAM,OAAO,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAC7B,MAAM,KAAK,GAAS;QACnB,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;QACxC,MAAM,EAAE,IAAI,GAAG,CAAyB;YACvC,CAAC,uBAAY,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;SAC/E,CAAC;KACF,CAAC;IACF,OAAO,KAAK,CAAC;AACd,CAAC;AAZD,gEAYC;AAED,SAAgB,kBAAkB,CACjC,KAA8B,EAC9B,KAA8B;IAE9B,MAAM,GAAG,GAA4B,EAAE,KAAK,EAAE,CAAC;IAC/C,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACzB,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;IACnB,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC;AATD,gDASC;AAOD,SAAgB,cAAc,CAC7B,EAA8B,EAC9B,MAAc;IAEd,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,OAAO;QACN,GAAG,EAAE;QACL,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,MAAM;KACxB,CAAC;AACH,CAAC;AAXD,wCAWC;AAED,SAAgB,uBAAuB,CAAC,CAAiB,EAAE,CAAiB;IAC3E,OAAO,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,CAAC;AACnD,CAAC;AAFD,0DAEC;AAED;;;;GAIG;AACH,SAAgB,8BAA8B,CAAC,MAA4B;IAC1E,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QAC/C,OAAO,KAAK,CAAC;IACd,CAAC;IACD,KAAK,MAAM,CAAC,EAAE,YAAY,CAAC,IAAI,MAAM,EAAE,CAAC;QACvC,IAAI,mCAAmC,CAAC,YAAY,CAAC,EAAE,CAAC;YACvD,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAVD,wEAUC;AAED;;;;GAIG;AACH,SAAgB,mCAAmC,CAAC,YAA0B;IAC7E,KAAK,MAAM,IAAI,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC;QACvC,IACC,IAAI,CAAC,MAAM,KAAK,SAAS;YACzB,IAAI,CAAC,MAAM,KAAK,SAAS;YACzB,8BAA8B,CAAC,IAAI,CAAC,MAAM,CAAC,EAC1C,CAAC;YACF,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC;AAZD,kFAYC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Mutable } from \"../../util/index.js\";\nimport type { FieldKey } from \"../schema-stored/index.js\";\n\nimport type { TreeChunk } from \"./chunk.js\";\nimport type { DetachedNodeId, FieldChanges, FieldMap, Root } from \"./delta.js\";\nimport { rootFieldKey } from \"./types.js\";\n\nexport const emptyDelta: Root = {};\n\nexport function deltaForRootInitialization(content: TreeChunk): Root {\n\tif (content.topLevelLength === 0) {\n\t\treturn emptyDelta;\n\t}\n\tconst buildId = { minor: 0 };\n\tconst delta: Root = {\n\t\tbuild: [{ id: buildId, trees: content }],\n\t\tfields: new Map<FieldKey, FieldChanges>([\n\t\t\t[rootFieldKey, { marks: [{ count: content.topLevelLength, attach: buildId }] }],\n\t\t]),\n\t};\n\treturn delta;\n}\n\nexport function makeDetachedNodeId(\n\tmajor: DetachedNodeId[\"major\"],\n\tminor: DetachedNodeId[\"minor\"],\n): DetachedNodeId {\n\tconst out: Mutable<DetachedNodeId> = { minor };\n\tif (major !== undefined) {\n\t\tout.major = major;\n\t}\n\treturn out;\n}\n\nexport function offsetDetachId(id: DetachedNodeId, offset: number): DetachedNodeId;\nexport function offsetDetachId(\n\tid: DetachedNodeId | undefined,\n\toffset: number,\n): DetachedNodeId | undefined;\nexport function offsetDetachId(\n\tid: DetachedNodeId | undefined,\n\toffset: number,\n): DetachedNodeId | undefined {\n\tif (id === undefined) {\n\t\treturn undefined;\n\t}\n\treturn {\n\t\t...id,\n\t\tminor: id.minor + offset,\n\t};\n}\n\nexport function areDetachedNodeIdsEqual(a: DetachedNodeId, b: DetachedNodeId): boolean {\n\treturn a.major === b.major && a.minor === b.minor;\n}\n\n/**\n * Returns true if a delta field map contains any changes that would be visible in the document (
|
|
1
|
+
{"version":3,"file":"deltaUtil.js","sourceRoot":"","sources":["../../../src/core/tree/deltaUtil.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,yCAA0C;AAE7B,QAAA,UAAU,GAAS,EAAE,CAAC;AAEnC,SAAgB,0BAA0B,CAAC,OAAkB;IAC5D,IAAI,OAAO,CAAC,cAAc,KAAK,CAAC,EAAE,CAAC;QAClC,OAAO,kBAAU,CAAC;IACnB,CAAC;IACD,MAAM,OAAO,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAC7B,MAAM,KAAK,GAAS;QACnB,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;QACxC,MAAM,EAAE,IAAI,GAAG,CAAyB;YACvC,CAAC,uBAAY,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;SAC/E,CAAC;KACF,CAAC;IACF,OAAO,KAAK,CAAC;AACd,CAAC;AAZD,gEAYC;AAED,SAAgB,kBAAkB,CACjC,KAA8B,EAC9B,KAA8B;IAE9B,MAAM,GAAG,GAA4B,EAAE,KAAK,EAAE,CAAC;IAC/C,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACzB,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;IACnB,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC;AATD,gDASC;AAOD,SAAgB,cAAc,CAC7B,EAA8B,EAC9B,MAAc;IAEd,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,OAAO;QACN,GAAG,EAAE;QACL,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,MAAM;KACxB,CAAC;AACH,CAAC;AAXD,wCAWC;AAED,SAAgB,uBAAuB,CAAC,CAAiB,EAAE,CAAiB;IAC3E,OAAO,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,CAAC;AACnD,CAAC;AAFD,0DAEC;AAED;;;;GAIG;AACH,SAAgB,8BAA8B,CAAC,MAA4B;IAC1E,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QAC/C,OAAO,KAAK,CAAC;IACd,CAAC;IACD,KAAK,MAAM,CAAC,EAAE,YAAY,CAAC,IAAI,MAAM,EAAE,CAAC;QACvC,IAAI,mCAAmC,CAAC,YAAY,CAAC,EAAE,CAAC;YACvD,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAVD,wEAUC;AAED;;;;GAIG;AACH,SAAgB,mCAAmC,CAAC,YAA0B;IAC7E,KAAK,MAAM,IAAI,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC;QACvC,IACC,IAAI,CAAC,MAAM,KAAK,SAAS;YACzB,IAAI,CAAC,MAAM,KAAK,SAAS;YACzB,8BAA8B,CAAC,IAAI,CAAC,MAAM,CAAC,EAC1C,CAAC;YACF,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC;AAZD,kFAYC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Mutable } from \"../../util/index.js\";\nimport type { FieldKey } from \"../schema-stored/index.js\";\n\nimport type { TreeChunk } from \"./chunk.js\";\nimport type { DetachedNodeId, FieldChanges, FieldMap, Root } from \"./delta.js\";\nimport { rootFieldKey } from \"./types.js\";\n\nexport const emptyDelta: Root = {};\n\nexport function deltaForRootInitialization(content: TreeChunk): Root {\n\tif (content.topLevelLength === 0) {\n\t\treturn emptyDelta;\n\t}\n\tconst buildId = { minor: 0 };\n\tconst delta: Root = {\n\t\tbuild: [{ id: buildId, trees: content }],\n\t\tfields: new Map<FieldKey, FieldChanges>([\n\t\t\t[rootFieldKey, { marks: [{ count: content.topLevelLength, attach: buildId }] }],\n\t\t]),\n\t};\n\treturn delta;\n}\n\nexport function makeDetachedNodeId(\n\tmajor: DetachedNodeId[\"major\"],\n\tminor: DetachedNodeId[\"minor\"],\n): DetachedNodeId {\n\tconst out: Mutable<DetachedNodeId> = { minor };\n\tif (major !== undefined) {\n\t\tout.major = major;\n\t}\n\treturn out;\n}\n\nexport function offsetDetachId(id: DetachedNodeId, offset: number): DetachedNodeId;\nexport function offsetDetachId(\n\tid: DetachedNodeId | undefined,\n\toffset: number,\n): DetachedNodeId | undefined;\nexport function offsetDetachId(\n\tid: DetachedNodeId | undefined,\n\toffset: number,\n): DetachedNodeId | undefined {\n\tif (id === undefined) {\n\t\treturn undefined;\n\t}\n\treturn {\n\t\t...id,\n\t\tminor: id.minor + offset,\n\t};\n}\n\nexport function areDetachedNodeIdsEqual(a: DetachedNodeId, b: DetachedNodeId): boolean {\n\treturn a.major === b.major && a.minor === b.minor;\n}\n\n/**\n * Returns true if a delta field map contains any changes that would be visible in the document (i.e., a detach or an attach)\n * @param fields - Delta FieldMap to check for visible changes\n * @returns True if change map contains any changes that would be visible in the document, false otherwise\n */\nexport function deltaFieldMapHasVisibleChanges(fields: FieldMap | undefined): boolean {\n\tif (fields === undefined || fields.size === 0) {\n\t\treturn false;\n\t}\n\tfor (const [, fieldChanges] of fields) {\n\t\tif (deltaFieldChangesHaveVisibleChanges(fieldChanges)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Returns true if the given field changes contains any changes that would be visible in the document (i.e., a detach or an attach)\n * @param fieldChanges - Field changes to check for visible changes\n * @returns True if the field changes contain any changes that would be visible in the document, false otherwise\n */\nexport function deltaFieldChangesHaveVisibleChanges(fieldChanges: FieldChanges): boolean {\n\tfor (const mark of fieldChanges.marks) {\n\t\tif (\n\t\t\tmark.attach !== undefined ||\n\t\t\tmark.detach !== undefined ||\n\t\t\tdeltaFieldMapHasVisibleChanges(mark.fields)\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detachedFieldIndexCodecV1.d.ts","sourceRoot":"","sources":["../../../src/core/tree/detachedFieldIndexCodecV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"detachedFieldIndexCodecV1.d.ts","sourceRoot":"","sources":["../../../src/core/tree/detachedFieldIndexCodecV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAGnE,OAAO,KAAK,EAAE,cAAc,EAAc,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EAEN,KAAK,gBAAgB,EAGrB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,KAAK,EAAE,wBAAwB,EAAS,MAAM,8BAA8B,CAAC;AAkDpF,wBAAgB,8BAA8B,CAC7C,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,aAAa,GACzB,cAAc,CAAC,wBAAwB,CAAC,CAO1C"}
|