@fluidframework/tree 2.74.0 → 2.80.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +1 -16
- package/CHANGELOG.md +18 -0
- package/api-report/tree.alpha.api.md +20 -2
- package/dist/alpha.d.ts +4 -0
- package/dist/codec/codec.d.ts +31 -3
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +10 -0
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/index.d.ts +2 -2
- 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 +80 -22
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js +137 -15
- package/dist/codec/versioned/codec.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/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -4
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/changeRebaser.d.ts +36 -2
- package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
- package/dist/core/rebase/changeRebaser.js.map +1 -1
- package/dist/core/rebase/index.d.ts +2 -2
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js +1 -2
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +6 -2
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +1 -12
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/rebase/utils.js +3 -3
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/schema-stored/schema.js +3 -3
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +3 -4
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts +1 -2
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +12 -56
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +18 -10
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.js +6 -6
- package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts +2 -3
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.js +4 -5
- package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.d.ts +2 -3
- package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.js +4 -6
- package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts +5 -6
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.js +11 -41
- package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/dist/core/tree/index.d.ts +1 -1
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js +2 -2
- package/dist/core/tree/index.js.map +1 -1
- package/dist/core/tree/mapTree.js +1 -1
- package/dist/core/tree/mapTree.js.map +1 -1
- package/dist/core/tree/sparseTree.d.ts.map +1 -1
- package/dist/core/tree/sparseTree.js +1 -0
- package/dist/core/tree/sparseTree.js.map +1 -1
- package/dist/core/tree/treeTextFormat.d.ts.map +1 -1
- package/dist/core/tree/treeTextFormat.js +5 -9
- package/dist/core/tree/treeTextFormat.js.map +1 -1
- package/dist/feature-libraries/changeAtomIdBTree.d.ts +10 -0
- package/dist/feature-libraries/changeAtomIdBTree.d.ts.map +1 -0
- package/dist/feature-libraries/changeAtomIdBTree.js +16 -0
- package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/basicChunk.js +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +6 -6
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +7 -4
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +19 -11
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +3 -3
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +9 -5
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +15 -5
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +19 -14
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +11 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +2 -0
- package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js +6 -0
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +11 -13
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +3 -2
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +9 -7
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.js +6 -6
- package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.js +10 -1
- package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +12 -9
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +25 -0
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js +59 -0
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -0
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +3 -3
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +4 -4
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js +2 -2
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +4 -2
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +11 -7
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +49 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +315 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +15 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +31 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +25 -288
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +14 -8
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +225 -195
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/{modularChangeFormat.d.ts → modularChangeFormatV1.d.ts} +5 -6
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +7 -7
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +112 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +21 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +13 -3
- 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/node-identifier/mockNodeIdentifierManager.js +1 -1
- package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +4 -4
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.js +34 -39
- package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +14 -2
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts +7 -21
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +28 -70
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/index.d.ts +2 -2
- package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/index.js +2 -5
- package/dist/feature-libraries/schema-index/index.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +1 -9
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +1 -12
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/schemaChecker.js +11 -6
- package/dist/feature-libraries/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +17 -13
- package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.js +5 -4
- package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
- package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/moveEffectTable.js +15 -9
- package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.js +26 -18
- package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.js +40 -35
- package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +16 -8
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +4 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +6 -3
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.js +46 -27
- package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.js +7 -7
- package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
- package/dist/feature-libraries/treeTextCursor.js +2 -2
- package/dist/feature-libraries/treeTextCursor.js.map +1 -1
- package/dist/feature-libraries/valueUtilities.d.ts.map +1 -1
- package/dist/feature-libraries/valueUtilities.js +16 -8
- package/dist/feature-libraries/valueUtilities.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -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/schematizingTreeView.d.ts +2 -3
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +20 -9
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +61 -44
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +9 -8
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js +4 -2
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +3 -2
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +19 -14
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +35 -29
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +21 -23
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +2 -0
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +31 -18
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +3 -1
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +5 -3
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.js +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/dist/shared-tree-core/editManager.js +1 -1
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +9 -4
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +1 -0
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +6 -0
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.js +1 -0
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +3 -3
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js +2 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +8 -4
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +1 -0
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormat.js +6 -0
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js +8 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
- package/dist/shared-tree-core/sequenceIdUtils.js +4 -4
- package/dist/shared-tree-core/sequenceIdUtils.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +12 -8
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts +25 -8
- package/dist/shared-tree-core/transaction.d.ts.map +1 -1
- package/dist/shared-tree-core/transaction.js +65 -30
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.d.ts +2 -2
- package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.js +3 -3
- package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
- package/dist/simple-tree/api/configuration.js +1 -1
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/customTree.d.ts.map +1 -1
- package/dist/simple-tree/api/customTree.js +13 -9
- package/dist/simple-tree/api/customTree.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/dist/simple-tree/api/discrepancies.js +21 -17
- package/dist/simple-tree/api/discrepancies.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +1 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +12 -8
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +18 -9
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.js +10 -5
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +15 -11
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.js +10 -10
- package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +2 -3
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/transactionTypes.d.ts +17 -4
- package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/transactionTypes.js.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +21 -13
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +14 -9
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +6 -3
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +20 -15
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/getTreeNodeForField.d.ts.map +1 -1
- package/dist/simple-tree/getTreeNodeForField.js +2 -1
- package/dist/simple-tree/getTreeNodeForField.js.map +1 -1
- package/dist/simple-tree/index.d.ts +1 -1
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +9 -6
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +15 -15
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +4 -5
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.js +2 -3
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +9 -5
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/treeFactory.js +7 -3
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/bTreeUtils.js +1 -1
- package/dist/util/bTreeUtils.js.map +1 -1
- package/dist/util/breakable.js +7 -9
- package/dist/util/breakable.js.map +1 -1
- package/dist/util/idAllocator.d.ts.map +1 -1
- package/dist/util/idAllocator.js +1 -2
- package/dist/util/idAllocator.js.map +1 -1
- package/dist/util/nestedMap.d.ts.map +1 -1
- package/dist/util/nestedMap.js +1 -1
- package/dist/util/nestedMap.js.map +1 -1
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +16 -15
- package/dist/util/utils.js.map +1 -1
- package/eslint.config.mts +1 -16
- package/lib/alpha.d.ts +4 -0
- package/lib/codec/codec.d.ts +31 -3
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +10 -0
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/index.d.ts +2 -2
- 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 +80 -22
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js +138 -15
- package/lib/codec/versioned/codec.js.map +1 -1
- package/lib/codec/versioned/index.d.ts +1 -1
- package/lib/codec/versioned/index.d.ts.map +1 -1
- package/lib/codec/versioned/index.js +1 -1
- package/lib/codec/versioned/index.js.map +1 -1
- package/lib/core/index.d.ts +2 -2
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +2 -2
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/changeRebaser.d.ts +36 -2
- package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
- package/lib/core/rebase/changeRebaser.js.map +1 -1
- package/lib/core/rebase/index.d.ts +2 -2
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +6 -2
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +0 -10
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/rebase/utils.js +3 -3
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/schema-stored/schema.js +3 -3
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +3 -4
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts +1 -2
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +13 -57
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +18 -10
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.js +4 -4
- package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts +2 -3
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.js +4 -5
- package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV2.d.ts +2 -3
- package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV2.js +4 -6
- package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts +5 -6
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.js +12 -39
- package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/lib/core/tree/index.d.ts +1 -1
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +1 -1
- package/lib/core/tree/index.js.map +1 -1
- package/lib/core/tree/mapTree.js +1 -1
- package/lib/core/tree/mapTree.js.map +1 -1
- package/lib/core/tree/sparseTree.d.ts.map +1 -1
- package/lib/core/tree/sparseTree.js +1 -0
- package/lib/core/tree/sparseTree.js.map +1 -1
- package/lib/core/tree/treeTextFormat.d.ts.map +1 -1
- package/lib/core/tree/treeTextFormat.js +5 -9
- package/lib/core/tree/treeTextFormat.js.map +1 -1
- package/lib/feature-libraries/changeAtomIdBTree.d.ts +10 -0
- package/lib/feature-libraries/changeAtomIdBTree.d.ts.map +1 -0
- package/lib/feature-libraries/changeAtomIdBTree.js +11 -0
- package/lib/feature-libraries/changeAtomIdBTree.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/basicChunk.js +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +6 -6
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +7 -4
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +19 -11
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +3 -3
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +9 -5
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +15 -5
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +19 -14
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +11 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +2 -0
- package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js +6 -0
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +11 -13
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +3 -2
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +3 -2
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.js +6 -6
- package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.js +10 -1
- package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +12 -9
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +25 -0
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js +55 -0
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -0
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +3 -3
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +5 -5
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +4 -2
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +3 -1
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +49 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +298 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +15 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +27 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +27 -290
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +14 -8
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +118 -88
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/{modularChangeFormat.d.ts → modularChangeFormatV1.d.ts} +5 -6
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +4 -4
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +112 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +18 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +13 -3
- 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/node-identifier/mockNodeIdentifierManager.js +1 -1
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +4 -4
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.js +35 -40
- package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +15 -3
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts +7 -21
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +30 -68
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/index.d.ts +2 -2
- package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/index.js +2 -2
- package/lib/feature-libraries/schema-index/index.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +1 -9
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +0 -10
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/schemaChecker.js +11 -6
- package/lib/feature-libraries/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +17 -13
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.js +5 -4
- package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
- package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/moveEffectTable.js +15 -9
- package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.js +26 -18
- package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.js +41 -36
- package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +16 -8
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +4 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +6 -3
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.js +46 -27
- package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.js +7 -7
- package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
- package/lib/feature-libraries/treeTextCursor.js +2 -2
- package/lib/feature-libraries/treeTextCursor.js.map +1 -1
- package/lib/feature-libraries/valueUtilities.d.ts.map +1 -1
- package/lib/feature-libraries/valueUtilities.js +16 -8
- package/lib/feature-libraries/valueUtilities.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +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/schematizingTreeView.d.ts +2 -3
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +20 -9
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +30 -13
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +9 -8
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js +4 -2
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +3 -2
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +19 -14
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +35 -29
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +21 -23
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +2 -0
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +32 -19
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +3 -1
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +5 -3
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.js +2 -2
- package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/lib/shared-tree-core/editManager.js +1 -1
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +9 -4
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +1 -0
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +6 -0
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.js +1 -0
- package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +3 -3
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.js +2 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +8 -4
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +1 -0
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormat.js +6 -0
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js +8 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
- package/lib/shared-tree-core/sequenceIdUtils.js +4 -4
- package/lib/shared-tree-core/sequenceIdUtils.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +12 -8
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts +25 -8
- package/lib/shared-tree-core/transaction.d.ts.map +1 -1
- package/lib/shared-tree-core/transaction.js +67 -32
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.d.ts +2 -2
- package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.js +3 -3
- package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
- package/lib/simple-tree/api/configuration.js +1 -1
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/customTree.d.ts.map +1 -1
- package/lib/simple-tree/api/customTree.js +13 -9
- package/lib/simple-tree/api/customTree.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/lib/simple-tree/api/discrepancies.js +21 -17
- package/lib/simple-tree/api/discrepancies.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +1 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +12 -8
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +18 -9
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaCodec.js +10 -5
- package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +15 -11
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/simpleTreeIndex.js +10 -10
- package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +4 -7
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/transactionTypes.d.ts +17 -4
- package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/transactionTypes.js.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +21 -13
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +14 -9
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +6 -3
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +20 -15
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/getTreeNodeForField.d.ts.map +1 -1
- package/lib/simple-tree/getTreeNodeForField.js +2 -1
- package/lib/simple-tree/getTreeNodeForField.js.map +1 -1
- package/lib/simple-tree/index.d.ts +1 -1
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +9 -6
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +15 -15
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +4 -5
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.js +2 -3
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +9 -5
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/treeFactory.js +7 -3
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/bTreeUtils.js +1 -1
- package/lib/util/bTreeUtils.js.map +1 -1
- package/lib/util/breakable.js +7 -9
- package/lib/util/breakable.js.map +1 -1
- package/lib/util/idAllocator.d.ts.map +1 -1
- package/lib/util/idAllocator.js +1 -2
- package/lib/util/idAllocator.js.map +1 -1
- package/lib/util/nestedMap.d.ts.map +1 -1
- package/lib/util/nestedMap.js +1 -1
- package/lib/util/nestedMap.js.map +1 -1
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js +16 -15
- package/lib/util/utils.js.map +1 -1
- package/package.json +32 -32
- package/src/codec/codec.ts +48 -8
- package/src/codec/index.ts +4 -1
- package/src/codec/versioned/codec.ts +340 -22
- package/src/codec/versioned/index.ts +3 -1
- package/src/core/index.ts +2 -2
- package/src/core/rebase/changeRebaser.ts +40 -6
- package/src/core/rebase/index.ts +1 -1
- package/src/core/rebase/types.ts +6 -18
- package/src/core/rebase/utils.ts +3 -3
- package/src/core/schema-stored/schema.ts +3 -3
- package/src/core/tree/anchorSet.ts +3 -4
- package/src/core/tree/detachedFieldIndex.ts +13 -74
- package/src/core/tree/detachedFieldIndexCodecCommon.ts +4 -8
- package/src/core/tree/detachedFieldIndexCodecV1.ts +3 -7
- package/src/core/tree/detachedFieldIndexCodecV2.ts +5 -9
- package/src/core/tree/detachedFieldIndexCodecs.ts +21 -64
- package/src/core/tree/index.ts +1 -1
- package/src/core/tree/mapTree.ts +1 -1
- package/src/core/tree/sparseTree.ts +1 -0
- package/src/core/tree/treeTextFormat.ts +5 -9
- package/src/feature-libraries/changeAtomIdBTree.ts +24 -0
- package/src/feature-libraries/chunked-forest/basicChunk.ts +1 -1
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +5 -5
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +7 -4
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +19 -11
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +3 -3
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -5
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +1 -1
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +48 -17
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +12 -2
- package/src/feature-libraries/default-schema/mappedEditBuilder.ts +6 -0
- package/src/feature-libraries/flex-tree/lazyField.ts +13 -14
- package/src/feature-libraries/index.ts +10 -5
- package/src/feature-libraries/indexing/anchorTreeIndex.ts +5 -5
- package/src/feature-libraries/mitigatedChangeFamily.ts +11 -6
- package/src/feature-libraries/modular-schema/comparison.ts +12 -9
- package/src/feature-libraries/modular-schema/defaultRevisionReplacer.ts +70 -0
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +3 -6
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +5 -7
- package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +1 -1
- package/src/feature-libraries/modular-schema/index.ts +5 -2
- package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +703 -0
- package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +89 -0
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +39 -523
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +159 -125
- package/src/feature-libraries/modular-schema/{modularChangeFormat.ts → modularChangeFormatV1.ts} +4 -4
- package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +34 -0
- package/src/feature-libraries/modular-schema/modularChangeTypes.ts +13 -4
- package/src/feature-libraries/node-identifier/mockNodeIdentifierManager.ts +1 -1
- package/src/feature-libraries/object-forest/objectForest.ts +4 -4
- package/src/feature-libraries/optional-field/optionalField.ts +34 -46
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +18 -3
- package/src/feature-libraries/schema-index/codec.ts +30 -90
- package/src/feature-libraries/schema-index/index.ts +2 -4
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +0 -17
- package/src/feature-libraries/schemaChecker.ts +11 -6
- package/src/feature-libraries/sequence-field/compose.ts +17 -13
- package/src/feature-libraries/sequence-field/invert.ts +5 -4
- package/src/feature-libraries/sequence-field/moveEffectTable.ts +15 -9
- package/src/feature-libraries/sequence-field/rebase.ts +26 -18
- package/src/feature-libraries/sequence-field/replaceRevisions.ts +52 -56
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +16 -8
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +4 -2
- package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +6 -3
- package/src/feature-libraries/sequence-field/utils.ts +46 -27
- package/src/feature-libraries/treeCursorUtils.ts +7 -7
- package/src/feature-libraries/treeTextCursor.ts +2 -2
- package/src/feature-libraries/valueUtilities.ts +16 -8
- package/src/index.ts +4 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/schematizingTreeView.ts +23 -13
- package/src/shared-tree/sharedTree.ts +30 -14
- package/src/shared-tree/sharedTreeChangeCodecs.ts +10 -9
- package/src/shared-tree/sharedTreeChangeEnricher.ts +4 -2
- package/src/shared-tree/sharedTreeChangeFamily.ts +29 -19
- package/src/shared-tree/sharedTreeEditBuilder.ts +9 -5
- package/src/shared-tree/treeAlpha.ts +60 -51
- package/src/shared-tree/treeCheckout.ts +66 -50
- package/src/shared-tree-core/branch.ts +8 -3
- package/src/shared-tree-core/branchCommitEnricher.ts +3 -8
- package/src/shared-tree-core/editManager.ts +1 -1
- package/src/shared-tree-core/editManagerCodecs.ts +9 -4
- package/src/shared-tree-core/editManagerFormatCommons.ts +6 -0
- package/src/shared-tree-core/editManagerFormatV1toV4.ts +3 -1
- package/src/shared-tree-core/editManagerSummarizer.ts +3 -3
- package/src/shared-tree-core/messageCodecV1ToV4.ts +2 -1
- package/src/shared-tree-core/messageCodecVSharedBranches.ts +2 -1
- package/src/shared-tree-core/messageCodecs.ts +8 -4
- package/src/shared-tree-core/messageFormat.ts +6 -1
- package/src/shared-tree-core/messageFormatV1ToV4.ts +16 -2
- package/src/shared-tree-core/sequenceIdUtils.ts +4 -4
- package/src/shared-tree-core/sharedTreeCore.ts +11 -7
- package/src/shared-tree-core/transaction.ts +115 -56
- package/src/shared-tree-core/transactionEnricher.ts +5 -6
- package/src/simple-tree/api/configuration.ts +1 -1
- package/src/simple-tree/api/customTree.ts +14 -10
- package/src/simple-tree/api/discrepancies.ts +23 -17
- package/src/simple-tree/api/index.ts +2 -0
- package/src/simple-tree/api/schemaFactory.ts +11 -7
- package/src/simple-tree/api/schemaFromSimple.ts +18 -9
- package/src/simple-tree/api/simpleSchemaCodec.ts +10 -5
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +17 -13
- package/src/simple-tree/api/simpleTreeIndex.ts +8 -8
- package/src/simple-tree/api/storedSchema.ts +10 -7
- package/src/simple-tree/api/transactionTypes.ts +19 -4
- package/src/simple-tree/api/treeNodeApi.ts +21 -13
- package/src/simple-tree/api/verboseTree.ts +14 -9
- package/src/simple-tree/core/treeNodeKernel.ts +6 -3
- package/src/simple-tree/core/unhydratedFlexTree.ts +22 -17
- package/src/simple-tree/getTreeNodeForField.ts +2 -1
- package/src/simple-tree/index.ts +2 -0
- package/src/simple-tree/leafNodeSchema.ts +8 -5
- package/src/simple-tree/node-kinds/array/arrayNode.ts +23 -23
- package/src/simple-tree/node-kinds/object/objectNode.ts +4 -5
- package/src/simple-tree/node-kinds/record/recordNode.ts +2 -3
- package/src/simple-tree/toStoredSchema.ts +9 -5
- package/src/treeFactory.ts +10 -5
- package/src/util/bTreeUtils.ts +1 -1
- package/src/util/breakable.ts +9 -9
- package/src/util/idAllocator.ts +1 -2
- package/src/util/nestedMap.ts +1 -3
- package/src/util/utils.ts +14 -13
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
|
@@ -102,7 +102,11 @@ class UnhydratedFlexTreeNode {
|
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
adoptBy(parent, index) {
|
|
105
|
-
if (parent
|
|
105
|
+
if (parent === undefined) {
|
|
106
|
+
(0, internal_1.assert)(this.location !== unparentedLocation, 0xa09 /* Node may not be un-adopted if it does not have a parent */);
|
|
107
|
+
this.location = unparentedLocation;
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
106
110
|
(0, internal_1.assert)(index !== undefined, 0xa08 /* Expected index */);
|
|
107
111
|
if (this.location !== unparentedLocation) {
|
|
108
112
|
throw new internal_2.UsageError("A node may not be in more than one place in the tree");
|
|
@@ -118,10 +122,6 @@ class UnhydratedFlexTreeNode {
|
|
|
118
122
|
}
|
|
119
123
|
this.location = { parent, index };
|
|
120
124
|
}
|
|
121
|
-
else {
|
|
122
|
-
(0, internal_1.assert)(this.location !== unparentedLocation, 0xa09 /* Node may not be un-adopted if it does not have a parent */);
|
|
123
|
-
this.location = unparentedLocation;
|
|
124
|
-
}
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
127
127
|
* The field this tree is in, and the index within that field.
|
|
@@ -239,7 +239,7 @@ class UnhydratedFlexTreeField {
|
|
|
239
239
|
return (0, index_js_2.cursorForMapTreeField)(this.children);
|
|
240
240
|
}
|
|
241
241
|
getPendingDefault() {
|
|
242
|
-
return
|
|
242
|
+
return Array.isArray(this.lazyChildren) ? undefined : this.lazyChildren;
|
|
243
243
|
}
|
|
244
244
|
/**
|
|
245
245
|
* Populate pending default (if present) using the provided context.
|
|
@@ -331,11 +331,11 @@ class UnhydratedOptionalField extends UnhydratedFlexTreeField {
|
|
|
331
331
|
(0, internal_1.assert)(newContent instanceof UnhydratedFlexTreeNode, 0xbb7 /* Expected unhydrated node */);
|
|
332
332
|
}
|
|
333
333
|
this.edit((mapTrees) => {
|
|
334
|
-
if (newContent
|
|
335
|
-
mapTrees
|
|
334
|
+
if (newContent === undefined) {
|
|
335
|
+
mapTrees.length = 0;
|
|
336
336
|
}
|
|
337
337
|
else {
|
|
338
|
-
mapTrees
|
|
338
|
+
mapTrees[0] = newContent;
|
|
339
339
|
}
|
|
340
340
|
});
|
|
341
341
|
},
|
|
@@ -377,7 +377,7 @@ class UnhydratedSequenceField extends UnhydratedFlexTreeField {
|
|
|
377
377
|
}
|
|
378
378
|
else {
|
|
379
379
|
// ...but we avoid using `splice` + spread for very large input arrays since there is a limit on how many elements can be spread (too many will overflow the stack).
|
|
380
|
-
return mapTrees.slice(0, index)
|
|
380
|
+
return [...mapTrees.slice(0, index), ...newContentChecked, ...mapTrees.slice(index)];
|
|
381
381
|
}
|
|
382
382
|
});
|
|
383
383
|
},
|
|
@@ -411,17 +411,22 @@ exports.UnhydratedSequenceField = UnhydratedSequenceField;
|
|
|
411
411
|
function createField(...args) {
|
|
412
412
|
switch (args[1]) {
|
|
413
413
|
case index_js_2.FieldKinds.required.identifier:
|
|
414
|
-
case index_js_2.FieldKinds.identifier.identifier:
|
|
414
|
+
case index_js_2.FieldKinds.identifier.identifier: {
|
|
415
415
|
return new UnhydratedRequiredField(...args);
|
|
416
|
-
|
|
416
|
+
}
|
|
417
|
+
case index_js_2.FieldKinds.optional.identifier: {
|
|
417
418
|
return new UnhydratedOptionalField(...args);
|
|
418
|
-
|
|
419
|
+
}
|
|
420
|
+
case index_js_2.FieldKinds.sequence.identifier: {
|
|
419
421
|
return new UnhydratedSequenceField(...args);
|
|
420
|
-
|
|
422
|
+
}
|
|
423
|
+
case index_js_2.FieldKinds.forbidden.identifier: {
|
|
421
424
|
// TODO: this seems to used by unknown optional fields. They should probably use "optional" not "Forbidden" schema.
|
|
422
425
|
return new UnhydratedFlexTreeField(...args);
|
|
423
|
-
|
|
426
|
+
}
|
|
427
|
+
default: {
|
|
424
428
|
return (0, internal_1.fail)(0xb9d /* unsupported field kind */);
|
|
429
|
+
}
|
|
425
430
|
}
|
|
426
431
|
}
|
|
427
432
|
exports.createField = createField;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unhydratedFlexTree.js","sourceRoot":"","sources":["../../../src/simple-tree/core/unhydratedFlexTree.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;AAEH,+DAA6D;AAE7D,kEAAwE;AACxE,uEAAsE;AAEtE,kDAc6B;AAC7B,+DA4B0C;AAC1C,kDAAsF;AAiBtF;;GAEG;AACH,MAAa,sBAAsB;IAG3B,UAAU;QAChB,OAAO,KAAK,CAAC;IACd,CAAC;IAID,IAAW,YAAY;QACtB,OAAO,CACN,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAA,eAAI,EAAC,KAAK,CAAC,oBAAoB,CAAC,CACtF,CAAC;IACH,CAAC;IAeD,IAAW,MAAM;QAEhB,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAED,IAAW,OAAO;QACj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AAC,QAAQ,CAAC,UAAU;YAClC,OAAO,IAAI,uBAAuB,CAAC,GAAG,IAAI,CAAC,CAAC;QAC7C,KAAK,qBAAU,CAAC,SAAS,CAAC,UAAU;YACnC,mHAAmH;YACnH,OAAO,IAAI,uBAAuB,CAAC,GAAG,IAAI,CAAC,CAAC;QAC7C;YACC,OAAO,IAAA,eAAI,EAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAClD,CAAC;AACF,CAAC;AAjBD,kCAiBC;AAED,SAAgB,qBAAqB,CAAC,OAAgB;IACrD,OAAO,IAAI,qBAAU,CACpB,GACC,OAAO,IAAI,WACZ,4EAA4E,CAC5E,CAAC;AACH,CAAC;AAND,sDAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { createEmitter } from \"@fluid-internal/client-utils\";\nimport type { HasListeners, Listenable } from \"@fluidframework/core-interfaces/internal\";\nimport { assert, oob, fail } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype AnchorEvents,\n\tdummyRoot,\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype ITreeCursorSynchronous,\n\ttype NodeData,\n\ttype NormalizedFieldUpPath,\n\ttype SchemaPolicy,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeValue,\n\ttype Value,\n} from \"../../core/index.js\";\nimport {\n\ttype FlexTreeContext,\n\tFlexTreeEntityKind,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeUnknownUnboxed,\n\tflexTreeMarker,\n\tindexForAt,\n\ttype FlexTreeHydratedContext,\n\ttype FlexFieldKind,\n\tFieldKinds,\n\ttype SequenceFieldEditBuilder,\n\tcursorForMapTreeNode,\n\ttype OptionalFieldEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype FlexibleNodeContent,\n\ttype FlexTreeHydratedContextMinimal,\n\ttype FlexibleFieldContent,\n\ttype MapTreeFieldViewGeneric,\n\ttype MapTreeNodeViewGeneric,\n\ttype HydratedFlexTreeNode,\n\tcursorForMapTreeField,\n\ttype MinimalFieldMap,\n\tcurrentObserver,\n} from \"../../feature-libraries/index.js\";\nimport { brand, filterIterable, getOrCreate, mapIterable } from \"../../util/index.js\";\n\nimport type { Context } from \"./context.js\";\nimport type { ContextualFieldProvider } from \"../fieldSchema.js\";\nimport type { TreeNode } from \"./treeNode.js\";\n\ninterface UnhydratedTreeSequenceFieldEditBuilder\n\textends SequenceFieldEditBuilder<FlexibleFieldContent, UnhydratedFlexTreeNode[]> {}\n\ntype UnhydratedFlexTreeNodeEvents = Pick<\n\tAnchorEvents,\n\t\"childrenChangedAfterBatch\" | \"subtreeChangedAfterBatch\"\n>;\n\n/** A node's parent field and its index in that field */\ntype LocationInField = FlexTreeNode[\"parentField\"];\n\n/**\n * The {@link Unhydrated} implementation of {@link FlexTreeNode}.\n */\nexport class UnhydratedFlexTreeNode\n\timplements FlexTreeNode, MapTreeNodeViewGeneric<UnhydratedFlexTreeNode>\n{\n\tpublic isHydrated(): this is HydratedFlexTreeNode {\n\t\treturn false;\n\t}\n\n\tprivate location = unparentedLocation;\n\n\tpublic get storedSchema(): TreeNodeStoredSchema {\n\t\treturn (\n\t\t\tthis.context.schema.nodeSchema.get(this.data.type) ?? fail(0xb46 /* missing schema */)\n\t\t);\n\t}\n\n\t/**\n\t * Cache storing the {@link TreeNode} for this inner node.\n\t * @remarks\n\t * When creating a `TreeNode` for this `UnhydratedFlexTreeNode`, cache the `TreeNode` in this property.\n\t * Currently this is done by {@link TreeNodeKernel}.\n\t *\n\t * See {@link getOrCreateNodeFromInnerNode} how to get the `TreeNode`, even if not already created, regardless of hydration status.\n\t */\n\tpublic treeNode: TreeNode | undefined;\n\n\tpublic readonly [flexTreeMarker] = FlexTreeEntityKind.Node as const;\n\n\tprivate readonly _events = createEmitter<UnhydratedFlexTreeNodeEvents>();\n\tpublic get events(): Listenable<UnhydratedFlexTreeNodeEvents> &\n\t\tHasListeners<UnhydratedFlexTreeNodeEvents> {\n\t\treturn this._events;\n\t}\n\n\tpublic get context(): FlexTreeContext {\n\t\treturn this.simpleContext.flexContext;\n\t}\n\n\t/**\n\t * Create a new UnhydratedFlexTreeNode.\n\t */\n\tpublic constructor(\n\t\t/**\n\t\t * The {@link NodeData} for this node.\n\t\t */\n\t\tpublic readonly data: NodeData,\n\t\t/**\n\t\t * All {@link UnhydratedFlexTreeField} for this node that have been created so far.\n\t\t * @remarks\n\t\t * This includes all non-empty fields, but also any empty fields which have been previously requested.\n\t\t */\n\t\tprivate readonly fieldsAll: Map<FieldKey, UnhydratedFlexTreeField>,\n\t\t/**\n\t\t * The {@link Context} for this node.\n\t\t * @remarks\n\t\t * Provides access to all schema reachable from this node.\n\t\t * See {@link getUnhydratedContext}.\n\t\t */\n\t\tpublic readonly simpleContext: Context,\n\t) {\n\t\tfor (const [_key, field] of this.fieldsAll) {\n\t\t\tfield.parent = this;\n\t\t}\n\t}\n\n\t/**\n\t * The non-empty fields on this node.\n\t * @remarks\n\t * This is needed to implement {@link MapTreeNodeViewGeneric.fields}, which must omit empty fields.\n\t * Due to having to detect if a field is empty, this forces the evaluation of any pending defaults in the fields.\n\t * Use {@link allFieldsLazy} to avoid evaluating pending defaults.\n\t */\n\tpublic readonly fields: MinimalFieldMap<UnhydratedFlexTreeField> = {\n\t\tget: (key: FieldKey): UnhydratedFlexTreeField | undefined => this.tryGetField(key),\n\t\t[Symbol.iterator]: (): IterableIterator<[FieldKey, UnhydratedFlexTreeField]> => {\n\t\t\tcurrentObserver?.observeNodeFields(this);\n\t\t\treturn filterIterable(this.fieldsAll, ([, field]) => field.length > 0);\n\t\t},\n\t};\n\n\tpublic [Symbol.iterator](): IterableIterator<UnhydratedFlexTreeField> {\n\t\treturn mapIterable(this.fields, ([, field]) => field)[Symbol.iterator]();\n\t}\n\n\t/**\n\t * Gets all fields, without filtering out empty ones.\n\t * @remarks\n\t * This avoids forcing the evaluating of pending defaults in the fields, and also saves a copy on access.\n\t */\n\tpublic get allFieldsLazy(): ReadonlyMap<FieldKey, UnhydratedFlexTreeField> {\n\t\treturn this.fieldsAll;\n\t}\n\n\tpublic get type(): TreeNodeSchemaIdentifier {\n\t\treturn this.data.type;\n\t}\n\n\tprivate getOrCreateField(key: FieldKey): UnhydratedFlexTreeField {\n\t\treturn getOrCreate(this.fieldsAll, key, () => {\n\t\t\tconst stored = this.storedSchema.getFieldSchema(key).kind;\n\t\t\tconst field = createField(this.context, stored, key, []);\n\t\t\tfield.parent = this;\n\t\t\treturn field;\n\t\t});\n\t}\n\n\t/**\n\t * Set this node's parentage (see {@link FlexTreeNode.parentField}).\n\t * @remarks The node may be given a parent if it has none, or may have its parent removed (by passing `undefined`).\n\t * However, a node with a parent may not be directly re-assigned a different parent.\n\t * That likely indicates either an attempted multi-parenting or an attempt to \"move\" the node, neither of which are supported.\n\t * Removing a node's parent twice in a row is also not supported, as it likely indicates a bug.\n\t */\n\tpublic adoptBy(parent: undefined): void;\n\tpublic adoptBy(parent: UnhydratedFlexTreeField, index: number): void;\n\tpublic adoptBy(parent: UnhydratedFlexTreeField | undefined, index?: number): void {\n\t\tif (parent !== undefined) {\n\t\t\tassert(index !== undefined, 0xa08 /* Expected index */);\n\t\t\tif (this.location !== unparentedLocation) {\n\t\t\t\tthrow new UsageError(\"A node may not be in more than one place in the tree\");\n\t\t\t}\n\t\t\tlet unhydratedNode: UnhydratedFlexTreeNode | undefined = parent.parent;\n\t\t\twhile (unhydratedNode !== undefined) {\n\t\t\t\tif (unhydratedNode === this) {\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\"A node may not be inserted into a location that is under itself\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst parentNode: FlexTreeNode | undefined = unhydratedNode.parentField.parent.parent;\n\t\t\t\tassert(\n\t\t\t\t\tparentNode === undefined || parentNode instanceof UnhydratedFlexTreeNode,\n\t\t\t\t\t0xb77 /* Unhydrated node's parent should be an unhydrated node */,\n\t\t\t\t);\n\t\t\t\tunhydratedNode = parentNode;\n\t\t\t}\n\t\t\tthis.location = { parent, index };\n\t\t} else {\n\t\t\tassert(\n\t\t\t\tthis.location !== unparentedLocation,\n\t\t\t\t0xa09 /* Node may not be un-adopted if it does not have a parent */,\n\t\t\t);\n\t\t\tthis.location = unparentedLocation;\n\t\t}\n\t}\n\n\t/**\n\t * The field this tree is in, and the index within that field.\n\t * @remarks If this node is unparented, this method will return the special {@link unparentedLocation} as the parent.\n\t */\n\tpublic get parentField(): LocationInField {\n\t\tcurrentObserver?.observeParentOf(this);\n\t\treturn this.location;\n\t}\n\n\tpublic borrowCursor(): ITreeCursorSynchronous {\n\t\treturn cursorForMapTreeNode<MapTreeNodeViewGeneric<UnhydratedFlexTreeNode>>(this);\n\t}\n\n\tpublic tryGetField(key: FieldKey): UnhydratedFlexTreeField | undefined {\n\t\tcurrentObserver?.observeNodeField(this, key);\n\n\t\tconst field = this.fieldsAll.get(key);\n\t\t// Only return the field if it is not empty, in order to fulfill the contract of `tryGetField`.\n\t\tif (field !== undefined && field.length > 0) {\n\t\t\treturn field;\n\t\t}\n\t}\n\n\tpublic getBoxed(key: string): UnhydratedFlexTreeField {\n\t\tconst fieldKey: FieldKey = brand(key);\n\n\t\tcurrentObserver?.observeNodeField(this, fieldKey);\n\n\t\treturn this.getOrCreateField(fieldKey);\n\t}\n\n\tpublic keys(): IterableIterator<FieldKey> {\n\t\treturn Array.from(this.fields, ([key]) => key)[Symbol.iterator]();\n\t}\n\n\tpublic get value(): Value {\n\t\treturn this.data.value;\n\t}\n\n\tpublic emitChangedEvent(key: FieldKey): void {\n\t\tthis._events.emit(\"childrenChangedAfterBatch\", { changedFields: new Set([key]) });\n\n\t\t// Also emit subtree changed event for this node and all ancestors.\n\t\tthis.#emitSubtreeChangedEvents();\n\t}\n\n\t/**\n\t * Emit subtree changed events for this node and all ancestors.\n\t */\n\t#emitSubtreeChangedEvents(): void {\n\t\tthis._events.emit(\"subtreeChangedAfterBatch\");\n\n\t\tconst parent = this.parentField.parent.parent;\n\t\tassert(\n\t\t\tparent === undefined || parent instanceof UnhydratedFlexTreeNode,\n\t\t\t0xb76 /* Unhydrated node's parent should be an unhydrated node */,\n\t\t);\n\t\tif (parent !== undefined) {\n\t\t\tparent.#emitSubtreeChangedEvents();\n\t\t}\n\t}\n}\n\n/**\n * Implementation of `FlexTreeContext`.\n *\n * @remarks An editor is required to edit the FlexTree.\n */\nexport class UnhydratedContext implements FlexTreeContext {\n\t/**\n\t * @param flexSchema - Schema to use when working with the tree.\n\t */\n\tpublic constructor(\n\t\tpublic readonly schemaPolicy: SchemaPolicy,\n\t\tpublic readonly schema: TreeStoredSchema,\n\t) {}\n\n\tpublic isDisposed(): boolean {\n\t\treturn false;\n\t}\n\n\tpublic isHydrated(): this is FlexTreeHydratedContext {\n\t\treturn false;\n\t}\n}\n\n// #region Fields\n\n/**\n * A special singleton that is the implicit {@link LocationInField} of all un-parented {@link UnhydratedFlexTreeNode}s.\n * @remarks This exists because {@link UnhydratedFlexTreeNode.parentField} must return a field.\n * If a {@link UnhydratedFlexTreeNode} is created without a parent, its {@link UnhydratedFlexTreeNode.parentField} property will point to this object.\n * However, this field cannot be used in any practical way because it is empty, i.e. it does not actually contain the children that claim to be parented under it.\n * It has the \"empty\" schema and it will always contain zero children if queried.\n * Any nodes with this location will have a dummy parent index of `-1`.\n *\n * TODO: make this make sense.\n */\nconst unparentedLocation: LocationInField = {\n\tparent: {\n\t\tkey: dummyRoot,\n\t\tparent: undefined,\n\t\tschema: brand(FieldKinds.optional.identifier),\n\t},\n\tindex: 0,\n};\n\n/**\n * The {@link Unhydrated} implementation of {@link FlexTreeField}.\n */\nexport class UnhydratedFlexTreeField\n\timplements FlexTreeField, MapTreeFieldViewGeneric<UnhydratedFlexTreeNode>\n{\n\tpublic [flexTreeMarker] = FlexTreeEntityKind.Field as const;\n\n\tpublic parent: UnhydratedFlexTreeNode | undefined = undefined;\n\n\tpublic constructor(\n\t\tpublic readonly context: FlexTreeContext,\n\t\tpublic readonly schema: FieldKindIdentifier,\n\t\tpublic readonly key: FieldKey,\n\t\t/**\n\t\t * The children of this field.\n\t\t * @remarks\n\t\t * This is either an array of {@link UnhydratedFlexTreeNode}s or a {@link ContextualFieldProvider} that will be used to populate the children lazily (after which it will become an array).\n\t\t * See {@link fillPendingDefaults}.\n\t\t * Note that any fields using a {@link ConstantFieldProvider} should be evaluated before constructing the UnhydratedFlexTreeField.\n\t\t */\n\t\tprivate lazyChildren: UnhydratedFlexTreeNode[] | ContextualFieldProvider,\n\t) {\n\t\t// When this field is created (which only happens one time, because it is cached), all the children become parented for the first time.\n\t\t// \"Adopt\" each child by updating its parent information to point to this field.\n\t\tif (Array.isArray(lazyChildren)) {\n\t\t\tfor (const [i, child] of lazyChildren.entries()) {\n\t\t\t\tchild.adoptBy(this, i);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic borrowCursor(): ITreeCursorSynchronous {\n\t\treturn cursorForMapTreeField<MapTreeNodeViewGeneric<UnhydratedFlexTreeNode>>(\n\t\t\tthis.children,\n\t\t);\n\t}\n\n\tprivate getPendingDefault(): ContextualFieldProvider | undefined {\n\t\treturn !Array.isArray(this.lazyChildren) ? this.lazyChildren : undefined;\n\t}\n\n\t/**\n\t * Populate pending default (if present) using the provided context.\n\t * @remarks\n\t * This apply to just this field: caller will likely want to recursively walk the tree.\n\t * @see {@link pendingDefault}.\n\t */\n\tpublic fillPendingDefaults(context: FlexTreeHydratedContextMinimal): void {\n\t\tconst provider = this.getPendingDefault();\n\t\tif (provider) {\n\t\t\tconst content = provider(context);\n\t\t\tthis.lazyChildren = content;\n\t\t}\n\t}\n\n\t/**\n\t * Returns true if this field has a pending default due to defined defined using a {@link ContextualFieldProvider}.\n\t */\n\tpublic get pendingDefault(): boolean {\n\t\treturn this.getPendingDefault() !== undefined;\n\t}\n\n\tpublic get children(): UnhydratedFlexTreeNode[] {\n\t\tconst provider = this.getPendingDefault();\n\t\tif (provider) {\n\t\t\tconst content = provider(\"UseGlobalContext\");\n\t\t\tthis.lazyChildren = content;\n\t\t}\n\t\treturn this.lazyChildren as UnhydratedFlexTreeNode[];\n\t}\n\n\tpublic get length(): number {\n\t\treturn this.children.length;\n\t}\n\n\tpublic is<TKind2 extends FlexFieldKind>(kind: TKind2): this is FlexTreeTypedField<TKind2> {\n\t\treturn this.schema === kind.identifier;\n\t}\n\n\tpublic boxedAt(index: number): FlexTreeNode | undefined {\n\t\tconst i = indexForAt(index, this.length);\n\t\tif (i === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst m = this.children[i];\n\t\treturn m;\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<UnhydratedFlexTreeNode> {\n\t\treturn this.children[Symbol.iterator]();\n\t}\n\n\t/**\n\t * Mutate this field.\n\t * @param edit - A function which receives the current `MapTree`s that comprise the contents of the field so that it may be mutated.\n\t * The function may mutate the array in place or return a new array.\n\t * If a new array is returned then it will be used as the new contents of the field, otherwise the original array will be continue to be used.\n\t * @remarks All edits to the field (i.e. mutations of the field's MapTrees) should be directed through this function.\n\t * This function ensures that the parent MapTree has no empty fields (which is an invariant of `MapTree`) after the mutation.\n\t */\n\tprotected edit(\n\t\tedit: (mapTrees: UnhydratedFlexTreeNode[]) => void | UnhydratedFlexTreeNode[],\n\t): void {\n\t\t// Clear parents for all old map trees.\n\t\tfor (const tree of this.children) {\n\t\t\ttree.adoptBy(undefined);\n\t\t}\n\n\t\tthis.lazyChildren = edit(this.children) ?? this.children;\n\n\t\t// Set parents for all new map trees.\n\t\tfor (const [index, tree] of this.children.entries()) {\n\t\t\ttree.adoptBy(this, index);\n\t\t}\n\n\t\tthis.parent?.emitChangedEvent(this.key);\n\t}\n\n\tpublic getFieldPath(): NormalizedFieldUpPath {\n\t\tthrow unsupportedUsageError(\"Editing an array\");\n\t}\n\n\t/** Unboxes leaf nodes to their values */\n\tprotected unboxed(index: number): TreeValue | UnhydratedFlexTreeNode {\n\t\tconst child = this.children[index] ?? oob();\n\t\tconst value = child.value;\n\t\tif (value !== undefined) {\n\t\t\treturn value;\n\t\t}\n\t\treturn child;\n\t}\n}\n\n/**\n * The {@link Unhydrated} implementation of {@link FlexTreeOptionalField}.\n */\nexport class UnhydratedOptionalField\n\textends UnhydratedFlexTreeField\n\timplements FlexTreeOptionalField\n{\n\tpublic readonly editor = {\n\t\tset: (newContent: FlexibleNodeContent | undefined): void => {\n\t\t\tif (newContent !== undefined) {\n\t\t\t\tassert(\n\t\t\t\t\tnewContent instanceof UnhydratedFlexTreeNode,\n\t\t\t\t\t0xbb7 /* Expected unhydrated node */,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthis.edit((mapTrees) => {\n\t\t\t\tif (newContent !== undefined) {\n\t\t\t\t\tmapTrees[0] = newContent;\n\t\t\t\t} else {\n\t\t\t\t\tmapTrees.length = 0;\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t} satisfies OptionalFieldEditBuilder<FlexibleNodeContent> &\n\t\tValueFieldEditBuilder<FlexibleNodeContent>;\n\n\tpublic get content(): FlexTreeUnknownUnboxed | undefined {\n\t\tconst value = this.children[0];\n\t\tif (value !== undefined) {\n\t\t\treturn this.unboxed(0);\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n\nclass UnhydratedRequiredField\n\textends UnhydratedOptionalField\n\timplements FlexTreeRequiredField\n{\n\tpublic override get content(): FlexTreeUnknownUnboxed {\n\t\t// This cannot use ?? since null is a legal value here.\n\t\tassert(\n\t\t\tsuper.content !== undefined,\n\t\t\t0xa57 /* Expected EagerMapTree required field to have a value */,\n\t\t);\n\t\treturn super.content;\n\t}\n}\n\n/**\n * The {@link Unhydrated} implementation of {@link FlexTreeSequenceField}.\n */\nexport class UnhydratedSequenceField\n\textends UnhydratedFlexTreeField\n\timplements FlexTreeSequenceField\n{\n\tpublic readonly editor = {\n\t\tinsert: (index, newContent): void => {\n\t\t\tfor (const c of newContent) {\n\t\t\t\tassert(c !== undefined, 0xa0a /* Unexpected sparse array content */);\n\t\t\t\tassert(c instanceof UnhydratedFlexTreeNode, 0xbb8 /* Expected unhydrated node */);\n\t\t\t}\n\t\t\tconst newContentChecked = newContent as readonly UnhydratedFlexTreeNode[];\n\t\t\tthis.edit((mapTrees) => {\n\t\t\t\tif (newContent.length < 1000) {\n\t\t\t\t\t// For \"smallish arrays\" (`1000` is not empirically derived), the `splice` function is appropriate...\n\t\t\t\t\tmapTrees.splice(index, 0, ...newContentChecked);\n\t\t\t\t} else {\n\t\t\t\t\t// ...but we avoid using `splice` + spread for very large input arrays since there is a limit on how many elements can be spread (too many will overflow the stack).\n\t\t\t\t\treturn mapTrees.slice(0, index).concat(newContentChecked, mapTrees.slice(index));\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\tremove: (index, count): UnhydratedFlexTreeNode[] => {\n\t\t\tfor (let i = index; i < index + count; i++) {\n\t\t\t\tconst c = this.children[i];\n\t\t\t\tassert(c !== undefined, 0xa0b /* Unexpected sparse array */);\n\t\t\t}\n\t\t\tlet removed: UnhydratedFlexTreeNode[] | undefined;\n\t\t\tthis.edit((mapTrees) => {\n\t\t\t\tremoved = mapTrees.splice(index, count);\n\t\t\t});\n\t\t\treturn removed ?? fail(0xb4a /* Expected removed to be set by edit */);\n\t\t},\n\t} satisfies UnhydratedTreeSequenceFieldEditBuilder;\n\n\tpublic at(index: number): FlexTreeUnknownUnboxed | undefined {\n\t\tconst i = indexForAt(index, this.length);\n\t\tif (i === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.unboxed(i);\n\t}\n\tpublic map<U>(callbackfn: (value: FlexTreeUnknownUnboxed, index: number) => U): U[] {\n\t\treturn Array.from(this, callbackfn);\n\t}\n}\n\n// #endregion Fields\n\n/** Creates a field with the given attributes */\nexport function createField(\n\t...args: ConstructorParameters<typeof UnhydratedFlexTreeField>\n): UnhydratedFlexTreeField {\n\tswitch (args[1]) {\n\t\tcase FieldKinds.required.identifier:\n\t\tcase FieldKinds.identifier.identifier:\n\t\t\treturn new UnhydratedRequiredField(...args);\n\t\tcase FieldKinds.optional.identifier:\n\t\t\treturn new UnhydratedOptionalField(...args);\n\t\tcase FieldKinds.sequence.identifier:\n\t\t\treturn new UnhydratedSequenceField(...args);\n\t\tcase FieldKinds.forbidden.identifier:\n\t\t\t// TODO: this seems to used by unknown optional fields. They should probably use \"optional\" not \"Forbidden\" schema.\n\t\t\treturn new UnhydratedFlexTreeField(...args);\n\t\tdefault:\n\t\t\treturn fail(0xb9d /* unsupported field kind */);\n\t}\n}\n\nexport function unsupportedUsageError(message?: string): Error {\n\treturn new UsageError(\n\t\t`${\n\t\t\tmessage ?? \"Operation\"\n\t\t} is not supported for content that has not yet been inserted into the tree`,\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"unhydratedFlexTree.js","sourceRoot":"","sources":["../../../src/simple-tree/core/unhydratedFlexTree.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;AAEH,+DAA6D;AAE7D,kEAAwE;AACxE,uEAAsE;AAEtE,kDAc6B;AAC7B,+DA4B0C;AAC1C,kDAAsF;AAiBtF;;GAEG;AACH,MAAa,sBAAsB;IAG3B,UAAU;QAChB,OAAO,KAAK,CAAC;IACd,CAAC;IAID,IAAW,YAAY;QACtB,OAAO,CACN,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAA,eAAI,EAAC,KAAK,CAAC,oBAAoB,CAAC,CACtF,CAAC;IACH,CAAC;IAeD,IAAW,MAAM;QAEhB,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAED,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;IACvC,CA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,qBAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;YACrC,OAAO,IAAI,uBAAuB,CAAC,GAAG,IAAI,CAAC,CAAC;QAC7C,CAAC;QACD,KAAK,qBAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;YACtC,mHAAmH;YACnH,OAAO,IAAI,uBAAuB,CAAC,GAAG,IAAI,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,OAAO,IAAA,eAAI,EAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;QACjD,CAAC;IACF,CAAC;AACF,CAAC;AAtBD,kCAsBC;AAED,SAAgB,qBAAqB,CAAC,OAAgB;IACrD,OAAO,IAAI,qBAAU,CACpB,GACC,OAAO,IAAI,WACZ,4EAA4E,CAC5E,CAAC;AACH,CAAC;AAND,sDAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { createEmitter } from \"@fluid-internal/client-utils\";\nimport type { HasListeners, Listenable } from \"@fluidframework/core-interfaces/internal\";\nimport { assert, oob, fail } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype AnchorEvents,\n\tdummyRoot,\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype ITreeCursorSynchronous,\n\ttype NodeData,\n\ttype NormalizedFieldUpPath,\n\ttype SchemaPolicy,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeValue,\n\ttype Value,\n} from \"../../core/index.js\";\nimport {\n\ttype FlexTreeContext,\n\tFlexTreeEntityKind,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeUnknownUnboxed,\n\tflexTreeMarker,\n\tindexForAt,\n\ttype FlexTreeHydratedContext,\n\ttype FlexFieldKind,\n\tFieldKinds,\n\ttype SequenceFieldEditBuilder,\n\tcursorForMapTreeNode,\n\ttype OptionalFieldEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype FlexibleNodeContent,\n\ttype FlexTreeHydratedContextMinimal,\n\ttype FlexibleFieldContent,\n\ttype MapTreeFieldViewGeneric,\n\ttype MapTreeNodeViewGeneric,\n\ttype HydratedFlexTreeNode,\n\tcursorForMapTreeField,\n\ttype MinimalFieldMap,\n\tcurrentObserver,\n} from \"../../feature-libraries/index.js\";\nimport { brand, filterIterable, getOrCreate, mapIterable } from \"../../util/index.js\";\n\nimport type { Context } from \"./context.js\";\nimport type { ContextualFieldProvider } from \"../fieldSchema.js\";\nimport type { TreeNode } from \"./treeNode.js\";\n\ninterface UnhydratedTreeSequenceFieldEditBuilder\n\textends SequenceFieldEditBuilder<FlexibleFieldContent, UnhydratedFlexTreeNode[]> {}\n\ntype UnhydratedFlexTreeNodeEvents = Pick<\n\tAnchorEvents,\n\t\"childrenChangedAfterBatch\" | \"subtreeChangedAfterBatch\"\n>;\n\n/** A node's parent field and its index in that field */\ntype LocationInField = FlexTreeNode[\"parentField\"];\n\n/**\n * The {@link Unhydrated} implementation of {@link FlexTreeNode}.\n */\nexport class UnhydratedFlexTreeNode\n\timplements FlexTreeNode, MapTreeNodeViewGeneric<UnhydratedFlexTreeNode>\n{\n\tpublic isHydrated(): this is HydratedFlexTreeNode {\n\t\treturn false;\n\t}\n\n\tprivate location = unparentedLocation;\n\n\tpublic get storedSchema(): TreeNodeStoredSchema {\n\t\treturn (\n\t\t\tthis.context.schema.nodeSchema.get(this.data.type) ?? fail(0xb46 /* missing schema */)\n\t\t);\n\t}\n\n\t/**\n\t * Cache storing the {@link TreeNode} for this inner node.\n\t * @remarks\n\t * When creating a `TreeNode` for this `UnhydratedFlexTreeNode`, cache the `TreeNode` in this property.\n\t * Currently this is done by {@link TreeNodeKernel}.\n\t *\n\t * See {@link getOrCreateNodeFromInnerNode} how to get the `TreeNode`, even if not already created, regardless of hydration status.\n\t */\n\tpublic treeNode: TreeNode | undefined;\n\n\tpublic readonly [flexTreeMarker] = FlexTreeEntityKind.Node as const;\n\n\tprivate readonly _events = createEmitter<UnhydratedFlexTreeNodeEvents>();\n\tpublic get events(): Listenable<UnhydratedFlexTreeNodeEvents> &\n\t\tHasListeners<UnhydratedFlexTreeNodeEvents> {\n\t\treturn this._events;\n\t}\n\n\tpublic get context(): FlexTreeContext {\n\t\treturn this.simpleContext.flexContext;\n\t}\n\n\t/**\n\t * Create a new UnhydratedFlexTreeNode.\n\t */\n\tpublic constructor(\n\t\t/**\n\t\t * The {@link NodeData} for this node.\n\t\t */\n\t\tpublic readonly data: NodeData,\n\t\t/**\n\t\t * All {@link UnhydratedFlexTreeField} for this node that have been created so far.\n\t\t * @remarks\n\t\t * This includes all non-empty fields, but also any empty fields which have been previously requested.\n\t\t */\n\t\tprivate readonly fieldsAll: Map<FieldKey, UnhydratedFlexTreeField>,\n\t\t/**\n\t\t * The {@link Context} for this node.\n\t\t * @remarks\n\t\t * Provides access to all schema reachable from this node.\n\t\t * See {@link getUnhydratedContext}.\n\t\t */\n\t\tpublic readonly simpleContext: Context,\n\t) {\n\t\tfor (const [_key, field] of this.fieldsAll) {\n\t\t\tfield.parent = this;\n\t\t}\n\t}\n\n\t/**\n\t * The non-empty fields on this node.\n\t * @remarks\n\t * This is needed to implement {@link MapTreeNodeViewGeneric.fields}, which must omit empty fields.\n\t * Due to having to detect if a field is empty, this forces the evaluation of any pending defaults in the fields.\n\t * Use {@link allFieldsLazy} to avoid evaluating pending defaults.\n\t */\n\tpublic readonly fields: MinimalFieldMap<UnhydratedFlexTreeField> = {\n\t\tget: (key: FieldKey): UnhydratedFlexTreeField | undefined => this.tryGetField(key),\n\t\t[Symbol.iterator]: (): IterableIterator<[FieldKey, UnhydratedFlexTreeField]> => {\n\t\t\tcurrentObserver?.observeNodeFields(this);\n\t\t\treturn filterIterable(this.fieldsAll, ([, field]) => field.length > 0);\n\t\t},\n\t};\n\n\tpublic [Symbol.iterator](): IterableIterator<UnhydratedFlexTreeField> {\n\t\treturn mapIterable(this.fields, ([, field]) => field)[Symbol.iterator]();\n\t}\n\n\t/**\n\t * Gets all fields, without filtering out empty ones.\n\t * @remarks\n\t * This avoids forcing the evaluating of pending defaults in the fields, and also saves a copy on access.\n\t */\n\tpublic get allFieldsLazy(): ReadonlyMap<FieldKey, UnhydratedFlexTreeField> {\n\t\treturn this.fieldsAll;\n\t}\n\n\tpublic get type(): TreeNodeSchemaIdentifier {\n\t\treturn this.data.type;\n\t}\n\n\tprivate getOrCreateField(key: FieldKey): UnhydratedFlexTreeField {\n\t\treturn getOrCreate(this.fieldsAll, key, () => {\n\t\t\tconst stored = this.storedSchema.getFieldSchema(key).kind;\n\t\t\tconst field = createField(this.context, stored, key, []);\n\t\t\tfield.parent = this;\n\t\t\treturn field;\n\t\t});\n\t}\n\n\t/**\n\t * Set this node's parentage (see {@link FlexTreeNode.parentField}).\n\t * @remarks The node may be given a parent if it has none, or may have its parent removed (by passing `undefined`).\n\t * However, a node with a parent may not be directly re-assigned a different parent.\n\t * That likely indicates either an attempted multi-parenting or an attempt to \"move\" the node, neither of which are supported.\n\t * Removing a node's parent twice in a row is also not supported, as it likely indicates a bug.\n\t */\n\tpublic adoptBy(parent: undefined): void;\n\tpublic adoptBy(parent: UnhydratedFlexTreeField, index: number): void;\n\tpublic adoptBy(parent: UnhydratedFlexTreeField | undefined, index?: number): void {\n\t\tif (parent === undefined) {\n\t\t\tassert(\n\t\t\t\tthis.location !== unparentedLocation,\n\t\t\t\t0xa09 /* Node may not be un-adopted if it does not have a parent */,\n\t\t\t);\n\t\t\tthis.location = unparentedLocation;\n\t\t} else {\n\t\t\tassert(index !== undefined, 0xa08 /* Expected index */);\n\t\t\tif (this.location !== unparentedLocation) {\n\t\t\t\tthrow new UsageError(\"A node may not be in more than one place in the tree\");\n\t\t\t}\n\t\t\tlet unhydratedNode: UnhydratedFlexTreeNode | undefined = parent.parent;\n\t\t\twhile (unhydratedNode !== undefined) {\n\t\t\t\tif (unhydratedNode === this) {\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\"A node may not be inserted into a location that is under itself\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst parentNode: FlexTreeNode | undefined = unhydratedNode.parentField.parent.parent;\n\t\t\t\tassert(\n\t\t\t\t\tparentNode === undefined || parentNode instanceof UnhydratedFlexTreeNode,\n\t\t\t\t\t0xb77 /* Unhydrated node's parent should be an unhydrated node */,\n\t\t\t\t);\n\t\t\t\tunhydratedNode = parentNode;\n\t\t\t}\n\t\t\tthis.location = { parent, index };\n\t\t}\n\t}\n\n\t/**\n\t * The field this tree is in, and the index within that field.\n\t * @remarks If this node is unparented, this method will return the special {@link unparentedLocation} as the parent.\n\t */\n\tpublic get parentField(): LocationInField {\n\t\tcurrentObserver?.observeParentOf(this);\n\t\treturn this.location;\n\t}\n\n\tpublic borrowCursor(): ITreeCursorSynchronous {\n\t\treturn cursorForMapTreeNode<MapTreeNodeViewGeneric<UnhydratedFlexTreeNode>>(this);\n\t}\n\n\tpublic tryGetField(key: FieldKey): UnhydratedFlexTreeField | undefined {\n\t\tcurrentObserver?.observeNodeField(this, key);\n\n\t\tconst field = this.fieldsAll.get(key);\n\t\t// Only return the field if it is not empty, in order to fulfill the contract of `tryGetField`.\n\t\tif (field !== undefined && field.length > 0) {\n\t\t\treturn field;\n\t\t}\n\t}\n\n\tpublic getBoxed(key: string): UnhydratedFlexTreeField {\n\t\tconst fieldKey: FieldKey = brand(key);\n\n\t\tcurrentObserver?.observeNodeField(this, fieldKey);\n\n\t\treturn this.getOrCreateField(fieldKey);\n\t}\n\n\tpublic keys(): IterableIterator<FieldKey> {\n\t\treturn Array.from(this.fields, ([key]) => key)[Symbol.iterator]();\n\t}\n\n\tpublic get value(): Value {\n\t\treturn this.data.value;\n\t}\n\n\tpublic emitChangedEvent(key: FieldKey): void {\n\t\tthis._events.emit(\"childrenChangedAfterBatch\", { changedFields: new Set([key]) });\n\n\t\t// Also emit subtree changed event for this node and all ancestors.\n\t\tthis.#emitSubtreeChangedEvents();\n\t}\n\n\t/**\n\t * Emit subtree changed events for this node and all ancestors.\n\t */\n\t#emitSubtreeChangedEvents(): void {\n\t\tthis._events.emit(\"subtreeChangedAfterBatch\");\n\n\t\tconst parent = this.parentField.parent.parent;\n\t\tassert(\n\t\t\tparent === undefined || parent instanceof UnhydratedFlexTreeNode,\n\t\t\t0xb76 /* Unhydrated node's parent should be an unhydrated node */,\n\t\t);\n\t\tif (parent !== undefined) {\n\t\t\tparent.#emitSubtreeChangedEvents();\n\t\t}\n\t}\n}\n\n/**\n * Implementation of `FlexTreeContext`.\n *\n * @remarks An editor is required to edit the FlexTree.\n */\nexport class UnhydratedContext implements FlexTreeContext {\n\t/**\n\t * @param flexSchema - Schema to use when working with the tree.\n\t */\n\tpublic constructor(\n\t\tpublic readonly schemaPolicy: SchemaPolicy,\n\t\tpublic readonly schema: TreeStoredSchema,\n\t) {}\n\n\tpublic isDisposed(): boolean {\n\t\treturn false;\n\t}\n\n\tpublic isHydrated(): this is FlexTreeHydratedContext {\n\t\treturn false;\n\t}\n}\n\n// #region Fields\n\n/**\n * A special singleton that is the implicit {@link LocationInField} of all un-parented {@link UnhydratedFlexTreeNode}s.\n * @remarks This exists because {@link UnhydratedFlexTreeNode.parentField} must return a field.\n * If a {@link UnhydratedFlexTreeNode} is created without a parent, its {@link UnhydratedFlexTreeNode.parentField} property will point to this object.\n * However, this field cannot be used in any practical way because it is empty, i.e. it does not actually contain the children that claim to be parented under it.\n * It has the \"empty\" schema and it will always contain zero children if queried.\n * Any nodes with this location will have a dummy parent index of `-1`.\n *\n * TODO: make this make sense.\n */\nconst unparentedLocation: LocationInField = {\n\tparent: {\n\t\tkey: dummyRoot,\n\t\tparent: undefined,\n\t\tschema: brand(FieldKinds.optional.identifier),\n\t},\n\tindex: 0,\n};\n\n/**\n * The {@link Unhydrated} implementation of {@link FlexTreeField}.\n */\nexport class UnhydratedFlexTreeField\n\timplements FlexTreeField, MapTreeFieldViewGeneric<UnhydratedFlexTreeNode>\n{\n\tpublic [flexTreeMarker] = FlexTreeEntityKind.Field as const;\n\n\tpublic parent: UnhydratedFlexTreeNode | undefined = undefined;\n\n\tpublic constructor(\n\t\tpublic readonly context: FlexTreeContext,\n\t\tpublic readonly schema: FieldKindIdentifier,\n\t\tpublic readonly key: FieldKey,\n\t\t/**\n\t\t * The children of this field.\n\t\t * @remarks\n\t\t * This is either an array of {@link UnhydratedFlexTreeNode}s or a {@link ContextualFieldProvider} that will be used to populate the children lazily (after which it will become an array).\n\t\t * See {@link fillPendingDefaults}.\n\t\t * Note that any fields using a {@link ConstantFieldProvider} should be evaluated before constructing the UnhydratedFlexTreeField.\n\t\t */\n\t\tprivate lazyChildren: UnhydratedFlexTreeNode[] | ContextualFieldProvider,\n\t) {\n\t\t// When this field is created (which only happens one time, because it is cached), all the children become parented for the first time.\n\t\t// \"Adopt\" each child by updating its parent information to point to this field.\n\t\tif (Array.isArray(lazyChildren)) {\n\t\t\tfor (const [i, child] of lazyChildren.entries()) {\n\t\t\t\tchild.adoptBy(this, i);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic borrowCursor(): ITreeCursorSynchronous {\n\t\treturn cursorForMapTreeField<MapTreeNodeViewGeneric<UnhydratedFlexTreeNode>>(\n\t\t\tthis.children,\n\t\t);\n\t}\n\n\tprivate getPendingDefault(): ContextualFieldProvider | undefined {\n\t\treturn Array.isArray(this.lazyChildren) ? undefined : this.lazyChildren;\n\t}\n\n\t/**\n\t * Populate pending default (if present) using the provided context.\n\t * @remarks\n\t * This apply to just this field: caller will likely want to recursively walk the tree.\n\t * @see {@link pendingDefault}.\n\t */\n\tpublic fillPendingDefaults(context: FlexTreeHydratedContextMinimal): void {\n\t\tconst provider = this.getPendingDefault();\n\t\tif (provider) {\n\t\t\tconst content = provider(context);\n\t\t\tthis.lazyChildren = content;\n\t\t}\n\t}\n\n\t/**\n\t * Returns true if this field has a pending default due to defined defined using a {@link ContextualFieldProvider}.\n\t */\n\tpublic get pendingDefault(): boolean {\n\t\treturn this.getPendingDefault() !== undefined;\n\t}\n\n\tpublic get children(): UnhydratedFlexTreeNode[] {\n\t\tconst provider = this.getPendingDefault();\n\t\tif (provider) {\n\t\t\tconst content = provider(\"UseGlobalContext\");\n\t\t\tthis.lazyChildren = content;\n\t\t}\n\t\treturn this.lazyChildren as UnhydratedFlexTreeNode[];\n\t}\n\n\tpublic get length(): number {\n\t\treturn this.children.length;\n\t}\n\n\tpublic is<TKind2 extends FlexFieldKind>(kind: TKind2): this is FlexTreeTypedField<TKind2> {\n\t\treturn this.schema === kind.identifier;\n\t}\n\n\tpublic boxedAt(index: number): FlexTreeNode | undefined {\n\t\tconst i = indexForAt(index, this.length);\n\t\tif (i === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst m = this.children[i];\n\t\treturn m;\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<UnhydratedFlexTreeNode> {\n\t\treturn this.children[Symbol.iterator]();\n\t}\n\n\t/**\n\t * Mutate this field.\n\t * @param edit - A function which receives the current `MapTree`s that comprise the contents of the field so that it may be mutated.\n\t * The function may mutate the array in place or return a new array.\n\t * If a new array is returned then it will be used as the new contents of the field, otherwise the original array will be continue to be used.\n\t * @remarks All edits to the field (i.e. mutations of the field's MapTrees) should be directed through this function.\n\t * This function ensures that the parent MapTree has no empty fields (which is an invariant of `MapTree`) after the mutation.\n\t */\n\tprotected edit(\n\t\tedit: (mapTrees: UnhydratedFlexTreeNode[]) => void | UnhydratedFlexTreeNode[],\n\t): void {\n\t\t// Clear parents for all old map trees.\n\t\tfor (const tree of this.children) {\n\t\t\ttree.adoptBy(undefined);\n\t\t}\n\n\t\tthis.lazyChildren = edit(this.children) ?? this.children;\n\n\t\t// Set parents for all new map trees.\n\t\tfor (const [index, tree] of this.children.entries()) {\n\t\t\ttree.adoptBy(this, index);\n\t\t}\n\n\t\tthis.parent?.emitChangedEvent(this.key);\n\t}\n\n\tpublic getFieldPath(): NormalizedFieldUpPath {\n\t\tthrow unsupportedUsageError(\"Editing an array\");\n\t}\n\n\t/** Unboxes leaf nodes to their values */\n\tprotected unboxed(index: number): TreeValue | UnhydratedFlexTreeNode {\n\t\tconst child = this.children[index] ?? oob();\n\t\tconst value = child.value;\n\t\tif (value !== undefined) {\n\t\t\treturn value;\n\t\t}\n\t\treturn child;\n\t}\n}\n\n/**\n * The {@link Unhydrated} implementation of {@link FlexTreeOptionalField}.\n */\nexport class UnhydratedOptionalField\n\textends UnhydratedFlexTreeField\n\timplements FlexTreeOptionalField\n{\n\tpublic readonly editor = {\n\t\tset: (newContent: FlexibleNodeContent | undefined): void => {\n\t\t\tif (newContent !== undefined) {\n\t\t\t\tassert(\n\t\t\t\t\tnewContent instanceof UnhydratedFlexTreeNode,\n\t\t\t\t\t0xbb7 /* Expected unhydrated node */,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthis.edit((mapTrees) => {\n\t\t\t\tif (newContent === undefined) {\n\t\t\t\t\tmapTrees.length = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmapTrees[0] = newContent;\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t} satisfies OptionalFieldEditBuilder<FlexibleNodeContent> &\n\t\tValueFieldEditBuilder<FlexibleNodeContent>;\n\n\tpublic get content(): FlexTreeUnknownUnboxed | undefined {\n\t\tconst value = this.children[0];\n\t\tif (value !== undefined) {\n\t\t\treturn this.unboxed(0);\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n\nclass UnhydratedRequiredField\n\textends UnhydratedOptionalField\n\timplements FlexTreeRequiredField\n{\n\tpublic override get content(): FlexTreeUnknownUnboxed {\n\t\t// This cannot use ?? since null is a legal value here.\n\t\tassert(\n\t\t\tsuper.content !== undefined,\n\t\t\t0xa57 /* Expected EagerMapTree required field to have a value */,\n\t\t);\n\t\treturn super.content;\n\t}\n}\n\n/**\n * The {@link Unhydrated} implementation of {@link FlexTreeSequenceField}.\n */\nexport class UnhydratedSequenceField\n\textends UnhydratedFlexTreeField\n\timplements FlexTreeSequenceField\n{\n\tpublic readonly editor = {\n\t\tinsert: (index, newContent): void => {\n\t\t\tfor (const c of newContent) {\n\t\t\t\tassert(c !== undefined, 0xa0a /* Unexpected sparse array content */);\n\t\t\t\tassert(c instanceof UnhydratedFlexTreeNode, 0xbb8 /* Expected unhydrated node */);\n\t\t\t}\n\t\t\tconst newContentChecked = newContent as readonly UnhydratedFlexTreeNode[];\n\t\t\tthis.edit((mapTrees) => {\n\t\t\t\tif (newContent.length < 1000) {\n\t\t\t\t\t// For \"smallish arrays\" (`1000` is not empirically derived), the `splice` function is appropriate...\n\t\t\t\t\tmapTrees.splice(index, 0, ...newContentChecked);\n\t\t\t\t} else {\n\t\t\t\t\t// ...but we avoid using `splice` + spread for very large input arrays since there is a limit on how many elements can be spread (too many will overflow the stack).\n\t\t\t\t\treturn [...mapTrees.slice(0, index), ...newContentChecked, ...mapTrees.slice(index)];\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\tremove: (index, count): UnhydratedFlexTreeNode[] => {\n\t\t\tfor (let i = index; i < index + count; i++) {\n\t\t\t\tconst c = this.children[i];\n\t\t\t\tassert(c !== undefined, 0xa0b /* Unexpected sparse array */);\n\t\t\t}\n\t\t\tlet removed: UnhydratedFlexTreeNode[] | undefined;\n\t\t\tthis.edit((mapTrees) => {\n\t\t\t\tremoved = mapTrees.splice(index, count);\n\t\t\t});\n\t\t\treturn removed ?? fail(0xb4a /* Expected removed to be set by edit */);\n\t\t},\n\t} satisfies UnhydratedTreeSequenceFieldEditBuilder;\n\n\tpublic at(index: number): FlexTreeUnknownUnboxed | undefined {\n\t\tconst i = indexForAt(index, this.length);\n\t\tif (i === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.unboxed(i);\n\t}\n\tpublic map<U>(callbackfn: (value: FlexTreeUnknownUnboxed, index: number) => U): U[] {\n\t\treturn Array.from(this, callbackfn);\n\t}\n}\n\n// #endregion Fields\n\n/** Creates a field with the given attributes */\nexport function createField(\n\t...args: ConstructorParameters<typeof UnhydratedFlexTreeField>\n): UnhydratedFlexTreeField {\n\tswitch (args[1]) {\n\t\tcase FieldKinds.required.identifier:\n\t\tcase FieldKinds.identifier.identifier: {\n\t\t\treturn new UnhydratedRequiredField(...args);\n\t\t}\n\t\tcase FieldKinds.optional.identifier: {\n\t\t\treturn new UnhydratedOptionalField(...args);\n\t\t}\n\t\tcase FieldKinds.sequence.identifier: {\n\t\t\treturn new UnhydratedSequenceField(...args);\n\t\t}\n\t\tcase FieldKinds.forbidden.identifier: {\n\t\t\t// TODO: this seems to used by unknown optional fields. They should probably use \"optional\" not \"Forbidden\" schema.\n\t\t\treturn new UnhydratedFlexTreeField(...args);\n\t\t}\n\t\tdefault: {\n\t\t\treturn fail(0xb9d /* unsupported field kind */);\n\t\t}\n\t}\n}\n\nexport function unsupportedUsageError(message?: string): Error {\n\treturn new UsageError(\n\t\t`${\n\t\t\tmessage ?? \"Operation\"\n\t\t} is not supported for content that has not yet been inserted into the tree`,\n\t);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTreeNodeForField.d.ts","sourceRoot":"","sources":["../../src/simple-tree/getTreeNodeForField.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAEN,KAAK,aAAa,EAIlB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,KAAK,QAAQ,EAAgC,MAAM,iBAAiB,CAAC;AAE9E;;GAEG;AACH,wBAAgB,sBAAsB,CACrC,KAAK,EAAE,aAAa,GAClB,QAAQ,GAAG,SAAS,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"getTreeNodeForField.d.ts","sourceRoot":"","sources":["../../src/simple-tree/getTreeNodeForField.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAEN,KAAK,aAAa,EAIlB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,KAAK,QAAQ,EAAgC,MAAM,iBAAiB,CAAC;AAE9E;;GAEG;AACH,wBAAgB,sBAAsB,CACrC,KAAK,EAAE,aAAa,GAClB,QAAQ,GAAG,SAAS,GAAG,SAAS,CA2BlC"}
|
|
@@ -31,8 +31,9 @@ function tryGetTreeNodeForField(field) {
|
|
|
31
31
|
// Identifier fields are just required fields that hold strings
|
|
32
32
|
return field.content;
|
|
33
33
|
}
|
|
34
|
-
default:
|
|
34
|
+
default: {
|
|
35
35
|
(0, internal_1.fail)(0xadf /* invalid field kind */);
|
|
36
|
+
}
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
exports.tryGetTreeNodeForField = tryGetTreeNodeForField;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTreeNodeForField.js","sourceRoot":"","sources":["../../src/simple-tree/getTreeNodeForField.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA2D;AAG3D,4DAMuC;AAEvC,8CAA8E;AAE9E;;GAEG;AACH,SAAgB,sBAAsB,CACrC,KAAoB;IAEpB,SAAS,gBAAgB,CACxB,SAAwD;QAExD,MAAM,YAAY,GAAG,SAAS,CAAC,OAAO,CAAC;QACvC,OAAO,IAAA,yBAAc,EAAC,YAAY,CAAC;YAClC,CAAC,CAAC,IAAA,uCAA4B,EAAC,YAAY,CAAC;YAC5C,CAAC,CAAC,YAAY,CAAC;IACjB,CAAC;IACD,QAAQ,KAAK,CAAC,MAAM,EAAE,CAAC;QACtB,KAAK,qBAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;YACrC,MAAM,UAAU,GAAG,KAA8B,CAAC;YAClD,OAAO,gBAAgB,CAAC,UAAU,CAAC,CAAC;Q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,CAAC;YACT,IAAA,eAAI,EAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;QACtC,CAAC;IACF,CAAC;AACF,CAAC;AA7BD,wDA6BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\n\nimport type { TreeValue } from \"../core/index.js\";\nimport {\n\tFieldKinds,\n\ttype FlexTreeField,\n\tisFlexTreeNode,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeOptionalField,\n} from \"../feature-libraries/index.js\";\n\nimport { type TreeNode, getOrCreateNodeFromInnerNode } from \"./core/index.js\";\n\n/**\n * Retrieve the associated {@link TreeNode} for the given field's content.\n */\nexport function tryGetTreeNodeForField(\n\tfield: FlexTreeField,\n): TreeNode | TreeValue | undefined {\n\tfunction tryToUnboxLeaves(\n\t\tflexField: FlexTreeOptionalField | FlexTreeRequiredField,\n\t): TreeNode | TreeValue | undefined {\n\t\tconst maybeContent = flexField.content;\n\t\treturn isFlexTreeNode(maybeContent)\n\t\t\t? getOrCreateNodeFromInnerNode(maybeContent)\n\t\t\t: maybeContent;\n\t}\n\tswitch (field.schema) {\n\t\tcase FieldKinds.required.identifier: {\n\t\t\tconst typedField = field as FlexTreeRequiredField;\n\t\t\treturn tryToUnboxLeaves(typedField);\n\t\t}\n\t\tcase FieldKinds.optional.identifier: {\n\t\t\tconst typedField = field as FlexTreeOptionalField;\n\t\t\treturn tryToUnboxLeaves(typedField);\n\t\t}\n\t\tcase FieldKinds.identifier.identifier: {\n\t\t\t// Identifier fields are just required fields that hold strings\n\t\t\treturn (field as FlexTreeRequiredField).content as string;\n\t\t}\n\n\t\tdefault: {\n\t\t\tfail(0xadf /* invalid field kind */);\n\t\t}\n\t}\n}\n"]}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
export { typeNameSymbol, typeSchemaSymbol, contentSchemaSymbol, type WithType, type TreeNodeSchema, type AnnotatedAllowedType, type AllowedTypesFullEvaluated, NodeKind, type TreeNodeSchemaClass, type TreeNodeSchemaNonClass, type TreeNodeSchemaCore, TreeNode, type Unhydrated, type InternalTreeNode, isTreeNode, tryDisposeTreeNode, HydratedContext, SimpleContextSlot, getInnerNode, getOrCreateNodeFromInnerNode, getOrCreateNodeFromInnerUnboxedNode, getKernel, type NodeFromSchema, isTreeNodeSchemaClass, type TreeNodeFromImplicitAllowedTypes, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, type AllowedTypes, type InsertableTreeNodeFromAllowedTypes, type InsertableTypedNode, type NodeBuilderData, type Input, normalizeAllowedTypes, type NodeSchemaMetadata, type ImplicitAllowedTypes, type AllowedTypesMetadata, evaluateLazySchema, type UnannotateAllowedTypesList, type AllowedTypeMetadata, type AnnotatedAllowedTypes, SchemaUpgrade, type LazyItem, type FlexList, type FlexListToUnion, type ExtractItemType, walkNodeSchema, walkAllowedTypes, type SchemaVisitor, type SimpleNodeSchemaBase, withBufferedTreeEvents, type AnnotateAllowedTypesList, type AllowedTypesFull, type AllowedTypesFullFromMixed, AnnotatedAllowedTypesInternal, type NumberKeys, ExpectStored, createSchemaUpgrade, } from "./core/index.js";
|
|
6
6
|
export { walkFieldSchema } from "./walkFieldSchema.js";
|
|
7
7
|
export type { UnsafeUnknownSchema, Insertable } from "./unsafeUnknownSchema.js";
|
|
8
|
-
export { type ITree, type TreeView, type ViewableTree, type TreeViewEvents, TreeViewConfiguration, TreeViewConfigurationAlpha, type ITreeViewConfiguration, type SchemaCompatibilityStatus, type ITreeConfigurationOptions, SchemaFactory, scoped, SchemaFactoryBeta, type SchemaStaticsBeta, SchemaFactoryAlpha, type ObjectSchemaOptionsAlpha, type ObjectSchemaOptions, type ScopedSchemaName, type ValidateRecursiveSchema, type FixRecursiveArraySchema, adaptEnum, enumFromStrings, singletonSchema, treeNodeApi, type TreeNodeApi, type NodeChangedData, borrowCursorFromTreeNodeOrValue, exportConcise, importConcise, TreeBeta, type TreeChangeEventsBeta, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, type DirtyTreeStatus, trackDirtyNodes, type DirtyTreeMap, type JsonSchemaId, type JsonSchemaType, type JsonObjectNodeSchema, type JsonArrayNodeSchema, type JsonMapNodeSchema, type JsonLeafNodeSchema, type JsonSchemaRef, type JsonRefPath, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonTreeSchema, type JsonFieldSchema, type JsonLeafSchemaType, type JsonRecordNodeSchema, type JsonStringKeyPatternProperties, type TreeSchemaEncodingOptions, getJsonSchema, getSimpleSchema, type VerboseTreeNode, type TreeEncodingOptions, type VerboseTree, extractPersistedSchema, comparePersistedSchema, type ConciseTree, SchemaCompatibilityTester, type Unenforced, type System_Unsafe, type ArrayNodeCustomizableSchemaUnsafe, type MapNodeCustomizableSchemaUnsafe, type TreeRecordNodeUnsafe, type UnannotateAllowedTypeUnsafe, type AnnotatedAllowedTypeUnsafe, type AnnotatedAllowedTypesUnsafe, type AllowedTypesFullUnsafe, type AllowedTypesFullFromMixedUnsafe, type UnannotateAllowedTypesListUnsafe, type AnnotateAllowedTypesListUnsafe, type TreeViewAlpha, type TreeViewBeta, type TreeBranch, type TreeBranchAlpha, type TreeBranchEvents, getPropertyKeyFromStoredKey, getStoredKey, tryGetSchema, applySchemaToParserOptions, cursorFromVerbose, verboseFromCursor, conciseFromCursor, createFromCursor, asTreeViewAlpha, customFromCursorStored, type CustomTreeNode, type CustomTreeValue, tryStoredSchemaAsArray, type SchemaStatics, type ITreeAlpha, type TransactionConstraint, type NodeInDocumentConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, generateSchemaFromSimpleSchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, type HandleConverter, allowUnused, type FieldSchemaAlphaUnsafe, getIdentifierFromNode, type ValidateRecursiveSchemaTemplate, type FixRecursiveRecursionLimit, schemaStatics, type TreeChangeEvents, type NodeSchemaOptions, type NodeSchemaOptionsAlpha, KeyEncodingOptions, type TreeParsingOptions, incrementalSummaryHint, incrementalEncodingPolicyForAllowedTypes, type SchemaFactory_base, encodeSchemaCompatibilitySnapshot, decodeSchemaCompatibilitySnapshot, exportCompatibilitySchemaSnapshot, importCompatibilitySchemaSnapshot, checkCompatibility, eraseSchemaDetails, eraseSchemaDetailsSubclassable, } from "./api/index.js";
|
|
8
|
+
export { type ITree, type TreeView, type ViewableTree, type TreeViewEvents, TreeViewConfiguration, TreeViewConfigurationAlpha, type ITreeViewConfiguration, type SchemaCompatibilityStatus, type ITreeConfigurationOptions, SchemaFactory, scoped, SchemaFactoryBeta, type SchemaStaticsBeta, SchemaFactoryAlpha, type ObjectSchemaOptionsAlpha, type ObjectSchemaOptions, type ScopedSchemaName, type ValidateRecursiveSchema, type FixRecursiveArraySchema, adaptEnum, enumFromStrings, singletonSchema, treeNodeApi, type TreeNodeApi, type NodeChangedData, borrowCursorFromTreeNodeOrValue, exportConcise, importConcise, TreeBeta, type TreeChangeEventsBeta, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, type DirtyTreeStatus, trackDirtyNodes, type DirtyTreeMap, type JsonSchemaId, type JsonSchemaType, type JsonObjectNodeSchema, type JsonArrayNodeSchema, type JsonMapNodeSchema, type JsonLeafNodeSchema, type JsonSchemaRef, type JsonRefPath, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonTreeSchema, type JsonFieldSchema, type JsonLeafSchemaType, type JsonRecordNodeSchema, type JsonStringKeyPatternProperties, type TreeSchemaEncodingOptions, getJsonSchema, getSimpleSchema, type VerboseTreeNode, type TreeEncodingOptions, type VerboseTree, extractPersistedSchema, comparePersistedSchema, type ConciseTree, SchemaCompatibilityTester, type Unenforced, type System_Unsafe, type ArrayNodeCustomizableSchemaUnsafe, type MapNodeCustomizableSchemaUnsafe, type TreeRecordNodeUnsafe, type UnannotateAllowedTypeUnsafe, type AnnotatedAllowedTypeUnsafe, type AnnotatedAllowedTypesUnsafe, type AllowedTypesFullUnsafe, type AllowedTypesFullFromMixedUnsafe, type UnannotateAllowedTypesListUnsafe, type AnnotateAllowedTypesListUnsafe, type TreeViewAlpha, type TreeViewBeta, type TreeBranch, type TreeBranchAlpha, type TreeBranchEvents, getPropertyKeyFromStoredKey, getStoredKey, tryGetSchema, applySchemaToParserOptions, cursorFromVerbose, verboseFromCursor, conciseFromCursor, createFromCursor, asTreeViewAlpha, customFromCursorStored, type CustomTreeNode, type CustomTreeValue, tryStoredSchemaAsArray, type SchemaStatics, type ITreeAlpha, type TransactionConstraint, type TransactionConstraintAlpha, type NodeInDocumentConstraint, type NoChangeConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, generateSchemaFromSimpleSchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, type HandleConverter, allowUnused, type FieldSchemaAlphaUnsafe, getIdentifierFromNode, type ValidateRecursiveSchemaTemplate, type FixRecursiveRecursionLimit, schemaStatics, type TreeChangeEvents, type NodeSchemaOptions, type NodeSchemaOptionsAlpha, KeyEncodingOptions, type TreeParsingOptions, incrementalSummaryHint, incrementalEncodingPolicyForAllowedTypes, type SchemaFactory_base, encodeSchemaCompatibilitySnapshot, decodeSchemaCompatibilitySnapshot, exportCompatibilitySchemaSnapshot, importCompatibilitySchemaSnapshot, checkCompatibility, eraseSchemaDetails, eraseSchemaDetailsSubclassable, } from "./api/index.js";
|
|
9
9
|
export type { SimpleTreeSchema, SimpleNodeSchema, SimpleFieldSchema, SimpleLeafNodeSchema, SimpleMapNodeSchema, SimpleArrayNodeSchema, SimpleObjectNodeSchema, SimpleNodeSchemaBaseAlpha, SimpleObjectFieldSchema, SimpleRecordNodeSchema, SimpleAllowedTypeAttributes, SchemaType, } from "./simpleSchema.js";
|
|
10
10
|
export { type ImplicitFieldSchema, type TreeFieldFromImplicitField, FieldKind, FieldSchema, FieldSchemaAlpha, type InsertableTreeFieldFromImplicitField, type DefaultProvider, type FieldProps, type FieldPropsAlpha, normalizeFieldSchema, areFieldSchemaEqual, areImplicitFieldSchemaEqual, type ApplyKind, type FieldSchemaMetadata, type InsertableField, type ApplyKindInput, type ReadableField, type ReadSchema, } from "./fieldSchema.js";
|
|
11
11
|
export { tryGetTreeNodeForField } from "./getTreeNodeForField.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,QAAQ,EACR,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,QAAQ,EACR,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,4BAA4B,EAC5B,mCAAmC,EACnC,SAAS,EACT,KAAK,cAAc,EACnB,qBAAqB,EACrB,KAAK,gCAAgC,EACrC,KAAK,0CAA0C,EAC/C,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,kCAAkC,EACvC,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,KAAK,EACV,qBAAqB,EACrB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,kBAAkB,EAClB,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,aAAa,EACb,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,cAAc,EACd,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,oBAAoB,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O,EACN,gCAAgC,EAChC,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,oBAAoB,GACzB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACN,mBAAmB,EACnB,8BAA8B,GAC9B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,wCAAwC,EACxC,uCAAuC,GACvC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,UAAU,GACV,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,KAAK,UAAU,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,QAAQ,EACR,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,QAAQ,EACR,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,4BAA4B,EAC5B,mCAAmC,EACnC,SAAS,EACT,KAAK,cAAc,EACnB,qBAAqB,EACrB,KAAK,gCAAgC,EACrC,KAAK,0CAA0C,EAC/C,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,kCAAkC,EACvC,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,KAAK,EACV,qBAAqB,EACrB,K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,gCAAgC,OAAA;AAKjC,mEAGkC;AAFjC,6HAAA,mBAAmB,OAAA;AACnB,wIAAA,8BAA8B,OAAA;AAE/B,yDAQ6B;AAP5B,mHAAA,cAAc,OAAA;AACd,qHAAA,gBAAgB,OAAA;AAChB,oHAAA,eAAe,OAAA;AACf,oHAAA,eAAe,OAAA;AACf,uHAAA,kBAAkB,OAAA;AAClB,6IAAA,wCAAwC,OAAA;AACxC,4IAAA,uCAAuC,OAAA;AAExC,yDAM6B;AAL5B,iHAAA,YAAY,OAAA;AACZ,iHAAA,YAAY,OAAA;AACZ,kHAAA,aAAa,OAAA;AACb,iHAAA,YAAY,OAAA;AACZ,+GAAA,UAAU,OAAA;AAGX,uDAA0D;AAAjD,wHAAA,oBAAoB,OAAA;AAC7B,iDAAoE;AAA1C,iHAAA,gBAAgB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttypeNameSymbol,\n\ttypeSchemaSymbol,\n\tcontentSchemaSymbol,\n\ttype WithType,\n\ttype TreeNodeSchema,\n\ttype AnnotatedAllowedType,\n\ttype AllowedTypesFullEvaluated,\n\tNodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchemaNonClass,\n\ttype TreeNodeSchemaCore,\n\tTreeNode,\n\ttype Unhydrated,\n\ttype InternalTreeNode,\n\tisTreeNode,\n\ttryDisposeTreeNode,\n\tHydratedContext,\n\tSimpleContextSlot,\n\tgetInnerNode,\n\tgetOrCreateNodeFromInnerNode,\n\tgetOrCreateNodeFromInnerUnboxedNode,\n\tgetKernel,\n\ttype NodeFromSchema,\n\tisTreeNodeSchemaClass,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\ttype AllowedTypes,\n\ttype InsertableTreeNodeFromAllowedTypes,\n\ttype InsertableTypedNode,\n\ttype NodeBuilderData,\n\ttype Input,\n\tnormalizeAllowedTypes,\n\ttype NodeSchemaMetadata,\n\ttype ImplicitAllowedTypes,\n\ttype AllowedTypesMetadata,\n\tevaluateLazySchema,\n\ttype UnannotateAllowedTypesList,\n\ttype AllowedTypeMetadata,\n\ttype AnnotatedAllowedTypes,\n\tSchemaUpgrade,\n\ttype LazyItem,\n\ttype FlexList,\n\ttype FlexListToUnion,\n\ttype ExtractItemType,\n\twalkNodeSchema,\n\twalkAllowedTypes,\n\ttype SchemaVisitor,\n\ttype SimpleNodeSchemaBase,\n\twithBufferedTreeEvents,\n\ttype AnnotateAllowedTypesList,\n\ttype AllowedTypesFull,\n\ttype AllowedTypesFullFromMixed,\n\tAnnotatedAllowedTypesInternal,\n\ttype NumberKeys,\n\tExpectStored,\n\tcreateSchemaUpgrade,\n} from \"./core/index.js\";\nexport { walkFieldSchema } from \"./walkFieldSchema.js\";\nexport type { UnsafeUnknownSchema, Insertable } from \"./unsafeUnknownSchema.js\";\nexport {\n\ttype ITree,\n\ttype TreeView,\n\ttype ViewableTree,\n\ttype TreeViewEvents,\n\tTreeViewConfiguration,\n\tTreeViewConfigurationAlpha,\n\ttype ITreeViewConfiguration,\n\ttype SchemaCompatibilityStatus,\n\ttype ITreeConfigurationOptions,\n\tSchemaFactory,\n\tscoped,\n\tSchemaFactoryBeta,\n\ttype SchemaStaticsBeta,\n\tSchemaFactoryAlpha,\n\ttype ObjectSchemaOptionsAlpha,\n\ttype ObjectSchemaOptions,\n\ttype ScopedSchemaName,\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttreeNodeApi,\n\ttype TreeNodeApi,\n\ttype NodeChangedData,\n\tborrowCursorFromTreeNodeOrValue,\n\texportConcise,\n\timportConcise,\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\ttype SimpleTreeIndex,\n\ttype IdentifierIndex,\n\tcreateSimpleTreeIndex,\n\tcreateIdentifierIndex,\n\ttype DirtyTreeStatus,\n\ttrackDirtyNodes,\n\ttype DirtyTreeMap,\n\ttype JsonSchemaId,\n\ttype JsonSchemaType,\n\ttype JsonObjectNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonLeafNodeSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonTreeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonLeafSchemaType,\n\ttype JsonRecordNodeSchema,\n\ttype JsonStringKeyPatternProperties,\n\ttype TreeSchemaEncodingOptions,\n\tgetJsonSchema,\n\tgetSimpleSchema,\n\ttype VerboseTreeNode,\n\ttype TreeEncodingOptions,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n\ttype ConciseTree,\n\tSchemaCompatibilityTester,\n\ttype Unenforced,\n\ttype System_Unsafe,\n\ttype ArrayNodeCustomizableSchemaUnsafe,\n\ttype MapNodeCustomizableSchemaUnsafe,\n\ttype TreeRecordNodeUnsafe,\n\ttype UnannotateAllowedTypeUnsafe,\n\ttype AnnotatedAllowedTypeUnsafe,\n\ttype AnnotatedAllowedTypesUnsafe,\n\ttype AllowedTypesFullUnsafe,\n\ttype AllowedTypesFullFromMixedUnsafe,\n\ttype UnannotateAllowedTypesListUnsafe,\n\ttype AnnotateAllowedTypesListUnsafe,\n\ttype TreeViewAlpha,\n\ttype TreeViewBeta,\n\ttype TreeBranch,\n\ttype TreeBranchAlpha,\n\ttype TreeBranchEvents,\n\tgetPropertyKeyFromStoredKey,\n\tgetStoredKey,\n\ttryGetSchema,\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\tverboseFromCursor,\n\tconciseFromCursor,\n\tcreateFromCursor,\n\tasTreeViewAlpha,\n\tcustomFromCursorStored,\n\ttype CustomTreeNode,\n\ttype CustomTreeValue,\n\ttryStoredSchemaAsArray,\n\ttype SchemaStatics,\n\ttype ITreeAlpha,\n\ttype TransactionConstraint,\n\ttype NodeInDocumentConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n\tgenerateSchemaFromSimpleSchema,\n\treplaceConciseTreeHandles,\n\treplaceHandles,\n\treplaceVerboseTreeHandles,\n\ttype HandleConverter,\n\tallowUnused,\n\ttype FieldSchemaAlphaUnsafe,\n\tgetIdentifierFromNode,\n\ttype ValidateRecursiveSchemaTemplate,\n\ttype FixRecursiveRecursionLimit,\n\tschemaStatics,\n\ttype TreeChangeEvents,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaOptionsAlpha,\n\tKeyEncodingOptions,\n\ttype TreeParsingOptions,\n\tincrementalSummaryHint,\n\tincrementalEncodingPolicyForAllowedTypes,\n\ttype SchemaFactory_base,\n\tencodeSchemaCompatibilitySnapshot,\n\tdecodeSchemaCompatibilitySnapshot,\n\texportCompatibilitySchemaSnapshot,\n\timportCompatibilitySchemaSnapshot,\n\tcheckCompatibility,\n\teraseSchemaDetails,\n\teraseSchemaDetailsSubclassable,\n} from \"./api/index.js\";\nexport type {\n\tSimpleTreeSchema,\n\tSimpleNodeSchema,\n\tSimpleFieldSchema,\n\tSimpleLeafNodeSchema,\n\tSimpleMapNodeSchema,\n\tSimpleArrayNodeSchema,\n\tSimpleObjectNodeSchema,\n\tSimpleNodeSchemaBaseAlpha,\n\tSimpleObjectFieldSchema,\n\tSimpleRecordNodeSchema,\n\tSimpleAllowedTypeAttributes,\n\tSchemaType,\n} from \"./simpleSchema.js\";\nexport {\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\tFieldKind,\n\tFieldSchema,\n\tFieldSchemaAlpha,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype DefaultProvider,\n\ttype FieldProps,\n\ttype FieldPropsAlpha,\n\tnormalizeFieldSchema,\n\tareFieldSchemaEqual,\n\tareImplicitFieldSchemaEqual,\n\ttype ApplyKind,\n\ttype FieldSchemaMetadata,\n\ttype InsertableField,\n\ttype ApplyKindInput,\n\ttype ReadableField,\n\ttype ReadSchema,\n} from \"./fieldSchema.js\";\nexport { tryGetTreeNodeForField } from \"./getTreeNodeForField.js\";\nexport {\n\ttype ArrayNodeCustomizableSchema,\n\ttype ArrayNodePojoEmulationSchema,\n\tArrayNodeSchema,\n\tasIndex,\n\tisArrayNodeSchema,\n\tIterableTreeArrayContent,\n\ttype ReadonlyArrayNode,\n\tTreeArrayNode,\n\ttype MapNodeCustomizableSchema,\n\ttype MapNodePojoEmulationSchema,\n\tMapNodeSchema,\n\tisMapNodeSchema,\n\ttype TreeMapNode,\n\ttype MapNodeInsertableData,\n\ttype FieldHasDefault,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype ObjectFromSchemaRecord,\n\tObjectNodeSchema,\n\ttype ObjectNodeSchemaPrivate,\n\tobjectSchema,\n\tisObjectNodeSchema,\n\ttype TreeObjectNode,\n\tsetField,\n\tisRecordNodeSchema,\n\ttype RecordNodeCustomizableSchema,\n\ttype RecordNodeInsertableData,\n\ttype RecordNodePojoEmulationSchema,\n\tRecordNodeSchema,\n\ttype TreeRecordNode,\n} from \"./node-kinds/index.js\";\nexport {\n\tunhydratedFlexTreeFromInsertable,\n\ttype InsertableContent,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n} from \"./unhydratedFlexTreeFromInsertable.js\";\nexport {\n\tprepareForInsertion,\n\tprepareForInsertionContextless,\n} from \"./prepareForInsertion.js\";\nexport {\n\ttoStoredSchema,\n\tconvertFieldKind,\n\ttoUpgradeSchema,\n\ttoInitialSchema,\n\ttoUnhydratedSchema,\n\trestrictiveStoredSchemaGenerationOptions,\n\tpermissiveStoredSchemaGenerationOptions,\n} from \"./toStoredSchema.js\";\nexport {\n\tnumberSchema,\n\tstringSchema,\n\tbooleanSchema,\n\thandleSchema,\n\tnullSchema,\n} from \"./leafNodeSchema.js\";\nexport type { LeafSchema } from \"./leafNodeSchema.js\";\nexport { getUnhydratedContext } from \"./createContext.js\";\nexport { type TreeSchema, createTreeSchema } from \"./treeSchema.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;AAEH,4CA0DyB;AAzDxB,0GAAA,cAAc,OAAA;AACd,4GAAA,gBAAgB,OAAA;AAChB,+GAAA,mBAAmB,OAAA;AAKnB,oGAAA,QAAQ,OAAA;AAIR,oGAAA,QAAQ,OAAA;AAGR,sGAAA,UAAU,OAAA;AACV,8GAAA,kBAAkB,OAAA;AAClB,2GAAA,eAAe,OAAA;AACf,6GAAA,iBAAiB,OAAA;AACjB,wGAAA,YAAY,OAAA;AACZ,wHAAA,4BAA4B,OAAA;AAC5B,+HAAA,mCAAmC,OAAA;AACnC,qGAAA,SAAS,OAAA;AAET,iHAAA,qBAAqB,OAAA;AASrB,iHAAA,qBAAqB,OAAA;AAIrB,8GAAA,kBAAkB,OAAA;AAIlB,yGAAA,aAAa,OAAA;AAKb,0GAAA,cAAc,OAAA;AACd,4GAAA,gBAAgB,OAAA;AAGhB,kHAAA,sBAAsB,OAAA;AAItB,yHAAA,6BAA6B,OAAA;AAE7B,wGAAA,YAAY,OAAA;AACZ,+GAAA,mBAAmB,OAAA;AAEpB,2DAAuD;AAA9C,qHAAA,eAAe,OAAA;AAExB,2CAqIwB;AAhIvB,iHAAA,qBAAqB,OAAA;AACrB,sHAAA,0BAA0B,OAAA;AAI1B,yGAAA,aAAa,OAAA;AACb,kGAAA,MAAM,OAAA;AACN,6GAAA,iBAAiB,OAAA;AAEjB,8GAAA,kBAAkB,OAAA;AAMlB,qGAAA,SAAS,OAAA;AACT,2GAAA,eAAe,OAAA;AACf,2GAAA,eAAe,OAAA;AACf,uGAAA,WAAW,OAAA;AAGX,2HAAA,+BAA+B,OAAA;AAC/B,yGAAA,aAAa,OAA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,OAAA;AAQ5B,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAC/B,kDA8B+B;AA3B9B,2GAAA,eAAe,OAAA;AACf,mGAAA,OAAO,OAAA;AACP,6GAAA,iBAAiB,OAAA;AACjB,oHAAA,wBAAwB,OAAA;AAExB,yGAAA,aAAa,OAAA;AAGb,yGAAA,aAAa,OAAA;AACb,2GAAA,eAAe,OAAA;AAMf,4GAAA,gBAAgB,OAAA;AAEhB,wGAAA,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAElB,oGAAA,QAAQ,OAAA;AACR,8GAAA,kBAAkB,OAAA;AAIlB,4GAAA,gBAAgB,OAAA;AAGjB,6FAK+C;AAJ9C,uJAAA,gCAAgC,OAAA;AAKjC,mEAGkC;AAFjC,6HAAA,mBAAmB,OAAA;AACnB,wIAAA,8BAA8B,OAAA;AAE/B,yDAQ6B;AAP5B,mHAAA,cAAc,OAAA;AACd,qHAAA,gBAAgB,OAAA;AAChB,oHAAA,eAAe,OAAA;AACf,oHAAA,eAAe,OAAA;AACf,uHAAA,kBAAkB,OAAA;AAClB,6IAAA,wCAAwC,OAAA;AACxC,4IAAA,uCAAuC,OAAA;AAExC,yDAM6B;AAL5B,iHAAA,YAAY,OAAA;AACZ,iHAAA,YAAY,OAAA;AACZ,kHAAA,aAAa,OAAA;AACb,iHAAA,YAAY,OAAA;AACZ,+GAAA,UAAU,OAAA;AAGX,uDAA0D;AAAjD,wHAAA,oBAAoB,OAAA;AAC7B,iDAAoE;AAA1C,iHAAA,gBAAgB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttypeNameSymbol,\n\ttypeSchemaSymbol,\n\tcontentSchemaSymbol,\n\ttype WithType,\n\ttype TreeNodeSchema,\n\ttype AnnotatedAllowedType,\n\ttype AllowedTypesFullEvaluated,\n\tNodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchemaNonClass,\n\ttype TreeNodeSchemaCore,\n\tTreeNode,\n\ttype Unhydrated,\n\ttype InternalTreeNode,\n\tisTreeNode,\n\ttryDisposeTreeNode,\n\tHydratedContext,\n\tSimpleContextSlot,\n\tgetInnerNode,\n\tgetOrCreateNodeFromInnerNode,\n\tgetOrCreateNodeFromInnerUnboxedNode,\n\tgetKernel,\n\ttype NodeFromSchema,\n\tisTreeNodeSchemaClass,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\ttype AllowedTypes,\n\ttype InsertableTreeNodeFromAllowedTypes,\n\ttype InsertableTypedNode,\n\ttype NodeBuilderData,\n\ttype Input,\n\tnormalizeAllowedTypes,\n\ttype NodeSchemaMetadata,\n\ttype ImplicitAllowedTypes,\n\ttype AllowedTypesMetadata,\n\tevaluateLazySchema,\n\ttype UnannotateAllowedTypesList,\n\ttype AllowedTypeMetadata,\n\ttype AnnotatedAllowedTypes,\n\tSchemaUpgrade,\n\ttype LazyItem,\n\ttype FlexList,\n\ttype FlexListToUnion,\n\ttype ExtractItemType,\n\twalkNodeSchema,\n\twalkAllowedTypes,\n\ttype SchemaVisitor,\n\ttype SimpleNodeSchemaBase,\n\twithBufferedTreeEvents,\n\ttype AnnotateAllowedTypesList,\n\ttype AllowedTypesFull,\n\ttype AllowedTypesFullFromMixed,\n\tAnnotatedAllowedTypesInternal,\n\ttype NumberKeys,\n\tExpectStored,\n\tcreateSchemaUpgrade,\n} from \"./core/index.js\";\nexport { walkFieldSchema } from \"./walkFieldSchema.js\";\nexport type { UnsafeUnknownSchema, Insertable } from \"./unsafeUnknownSchema.js\";\nexport {\n\ttype ITree,\n\ttype TreeView,\n\ttype ViewableTree,\n\ttype TreeViewEvents,\n\tTreeViewConfiguration,\n\tTreeViewConfigurationAlpha,\n\ttype ITreeViewConfiguration,\n\ttype SchemaCompatibilityStatus,\n\ttype ITreeConfigurationOptions,\n\tSchemaFactory,\n\tscoped,\n\tSchemaFactoryBeta,\n\ttype SchemaStaticsBeta,\n\tSchemaFactoryAlpha,\n\ttype ObjectSchemaOptionsAlpha,\n\ttype ObjectSchemaOptions,\n\ttype ScopedSchemaName,\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttreeNodeApi,\n\ttype TreeNodeApi,\n\ttype NodeChangedData,\n\tborrowCursorFromTreeNodeOrValue,\n\texportConcise,\n\timportConcise,\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\ttype SimpleTreeIndex,\n\ttype IdentifierIndex,\n\tcreateSimpleTreeIndex,\n\tcreateIdentifierIndex,\n\ttype DirtyTreeStatus,\n\ttrackDirtyNodes,\n\ttype DirtyTreeMap,\n\ttype JsonSchemaId,\n\ttype JsonSchemaType,\n\ttype JsonObjectNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonLeafNodeSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonTreeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonLeafSchemaType,\n\ttype JsonRecordNodeSchema,\n\ttype JsonStringKeyPatternProperties,\n\ttype TreeSchemaEncodingOptions,\n\tgetJsonSchema,\n\tgetSimpleSchema,\n\ttype VerboseTreeNode,\n\ttype TreeEncodingOptions,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n\ttype ConciseTree,\n\tSchemaCompatibilityTester,\n\ttype Unenforced,\n\ttype System_Unsafe,\n\ttype ArrayNodeCustomizableSchemaUnsafe,\n\ttype MapNodeCustomizableSchemaUnsafe,\n\ttype TreeRecordNodeUnsafe,\n\ttype UnannotateAllowedTypeUnsafe,\n\ttype AnnotatedAllowedTypeUnsafe,\n\ttype AnnotatedAllowedTypesUnsafe,\n\ttype AllowedTypesFullUnsafe,\n\ttype AllowedTypesFullFromMixedUnsafe,\n\ttype UnannotateAllowedTypesListUnsafe,\n\ttype AnnotateAllowedTypesListUnsafe,\n\ttype TreeViewAlpha,\n\ttype TreeViewBeta,\n\ttype TreeBranch,\n\ttype TreeBranchAlpha,\n\ttype TreeBranchEvents,\n\tgetPropertyKeyFromStoredKey,\n\tgetStoredKey,\n\ttryGetSchema,\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\tverboseFromCursor,\n\tconciseFromCursor,\n\tcreateFromCursor,\n\tasTreeViewAlpha,\n\tcustomFromCursorStored,\n\ttype CustomTreeNode,\n\ttype CustomTreeValue,\n\ttryStoredSchemaAsArray,\n\ttype SchemaStatics,\n\ttype ITreeAlpha,\n\ttype TransactionConstraint,\n\ttype TransactionConstraintAlpha,\n\ttype NodeInDocumentConstraint,\n\ttype NoChangeConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n\tgenerateSchemaFromSimpleSchema,\n\treplaceConciseTreeHandles,\n\treplaceHandles,\n\treplaceVerboseTreeHandles,\n\ttype HandleConverter,\n\tallowUnused,\n\ttype FieldSchemaAlphaUnsafe,\n\tgetIdentifierFromNode,\n\ttype ValidateRecursiveSchemaTemplate,\n\ttype FixRecursiveRecursionLimit,\n\tschemaStatics,\n\ttype TreeChangeEvents,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaOptionsAlpha,\n\tKeyEncodingOptions,\n\ttype TreeParsingOptions,\n\tincrementalSummaryHint,\n\tincrementalEncodingPolicyForAllowedTypes,\n\ttype SchemaFactory_base,\n\tencodeSchemaCompatibilitySnapshot,\n\tdecodeSchemaCompatibilitySnapshot,\n\texportCompatibilitySchemaSnapshot,\n\timportCompatibilitySchemaSnapshot,\n\tcheckCompatibility,\n\teraseSchemaDetails,\n\teraseSchemaDetailsSubclassable,\n} from \"./api/index.js\";\nexport type {\n\tSimpleTreeSchema,\n\tSimpleNodeSchema,\n\tSimpleFieldSchema,\n\tSimpleLeafNodeSchema,\n\tSimpleMapNodeSchema,\n\tSimpleArrayNodeSchema,\n\tSimpleObjectNodeSchema,\n\tSimpleNodeSchemaBaseAlpha,\n\tSimpleObjectFieldSchema,\n\tSimpleRecordNodeSchema,\n\tSimpleAllowedTypeAttributes,\n\tSchemaType,\n} from \"./simpleSchema.js\";\nexport {\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\tFieldKind,\n\tFieldSchema,\n\tFieldSchemaAlpha,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype DefaultProvider,\n\ttype FieldProps,\n\ttype FieldPropsAlpha,\n\tnormalizeFieldSchema,\n\tareFieldSchemaEqual,\n\tareImplicitFieldSchemaEqual,\n\ttype ApplyKind,\n\ttype FieldSchemaMetadata,\n\ttype InsertableField,\n\ttype ApplyKindInput,\n\ttype ReadableField,\n\ttype ReadSchema,\n} from \"./fieldSchema.js\";\nexport { tryGetTreeNodeForField } from \"./getTreeNodeForField.js\";\nexport {\n\ttype ArrayNodeCustomizableSchema,\n\ttype ArrayNodePojoEmulationSchema,\n\tArrayNodeSchema,\n\tasIndex,\n\tisArrayNodeSchema,\n\tIterableTreeArrayContent,\n\ttype ReadonlyArrayNode,\n\tTreeArrayNode,\n\ttype MapNodeCustomizableSchema,\n\ttype MapNodePojoEmulationSchema,\n\tMapNodeSchema,\n\tisMapNodeSchema,\n\ttype TreeMapNode,\n\ttype MapNodeInsertableData,\n\ttype FieldHasDefault,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype ObjectFromSchemaRecord,\n\tObjectNodeSchema,\n\ttype ObjectNodeSchemaPrivate,\n\tobjectSchema,\n\tisObjectNodeSchema,\n\ttype TreeObjectNode,\n\tsetField,\n\tisRecordNodeSchema,\n\ttype RecordNodeCustomizableSchema,\n\ttype RecordNodeInsertableData,\n\ttype RecordNodePojoEmulationSchema,\n\tRecordNodeSchema,\n\ttype TreeRecordNode,\n} from \"./node-kinds/index.js\";\nexport {\n\tunhydratedFlexTreeFromInsertable,\n\ttype InsertableContent,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n} from \"./unhydratedFlexTreeFromInsertable.js\";\nexport {\n\tprepareForInsertion,\n\tprepareForInsertionContextless,\n} from \"./prepareForInsertion.js\";\nexport {\n\ttoStoredSchema,\n\tconvertFieldKind,\n\ttoUpgradeSchema,\n\ttoInitialSchema,\n\ttoUnhydratedSchema,\n\trestrictiveStoredSchemaGenerationOptions,\n\tpermissiveStoredSchemaGenerationOptions,\n} from \"./toStoredSchema.js\";\nexport {\n\tnumberSchema,\n\tstringSchema,\n\tbooleanSchema,\n\thandleSchema,\n\tnullSchema,\n} from \"./leafNodeSchema.js\";\nexport type { LeafSchema } from \"./leafNodeSchema.js\";\nexport { getUnhydratedContext } from \"./createContext.js\";\nexport { type TreeSchema, createTreeSchema } from \"./treeSchema.js\";\n"]}
|
|
@@ -140,7 +140,10 @@ function mapValueWithFallbacks(value, allowedTypes) {
|
|
|
140
140
|
// Map such input to +0.
|
|
141
141
|
return 0;
|
|
142
142
|
}
|
|
143
|
-
else if (
|
|
143
|
+
else if (Number.isFinite(value)) {
|
|
144
|
+
return value;
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
144
147
|
// Our serialized data format does not support NaN nor +/-∞.
|
|
145
148
|
// If the schema supports `null`, fall back to that. Otherwise, throw.
|
|
146
149
|
// This is intended to match JSON's behavior for such values.
|
|
@@ -151,23 +154,23 @@ function mapValueWithFallbacks(value, allowedTypes) {
|
|
|
151
154
|
throw new internal_2.UsageError(`Received unsupported numeric value: ${value}.`);
|
|
152
155
|
}
|
|
153
156
|
}
|
|
154
|
-
else {
|
|
155
|
-
return value;
|
|
156
|
-
}
|
|
157
157
|
}
|
|
158
158
|
case "string":
|
|
159
159
|
// TODO:
|
|
160
160
|
// This should detect invalid strings. Something like @stdlib/regexp-utf16-unpaired-surrogate could be used to do this.
|
|
161
161
|
// See SchemaFactory.string for details.
|
|
162
|
-
case "boolean":
|
|
162
|
+
case "boolean": {
|
|
163
163
|
return value;
|
|
164
|
+
}
|
|
164
165
|
case "object": {
|
|
165
166
|
if (value === null || (0, internal_3.isFluidHandle)(value)) {
|
|
166
167
|
return value;
|
|
167
168
|
}
|
|
168
169
|
}
|
|
169
|
-
|
|
170
|
+
// fallthrough
|
|
171
|
+
default: {
|
|
170
172
|
throw new internal_2.UsageError(`Received unsupported leaf value: ${value}.`);
|
|
173
|
+
}
|
|
171
174
|
}
|
|
172
175
|
}
|
|
173
176
|
//# sourceMappingURL=leafNodeSchema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leafNodeSchema.js","sourceRoot":"","sources":["../../src/simple-tree/leafNodeSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;AAEH,kEAA6D;AAC7D,uEAAsE;AACtE,qEAAuE;AAEvE,+CAA+D;AAC/D,4DAKuC;AAEvC,8CAYyB;AAEzB,+CAA4E;AAC5E,yDAAsE;AAGtE;;;;;;;;GAQG;AACH,MAAa,cAAc;IAyBnB,MAAM,CAAC,IAAiC;QAC9C,IAAI,IAAA,yBAAc,EAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;YACzB,IAAA,iBAAM,EAAC,IAAA,4BAAiB,EAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;YACvE,OAAO,KAAK,CAAC;QACd,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,oBAAoB,CAAC,IAAkB;QAC7C,OAAO,IAAI,CAAC;IACb,CAAC;IAOD,YAAmB,IAAU,EAAE,CAAI;QApCnB,SAAI,GAAG,mBAAQ,CAAC,IAAI,CAAC;QAErB,4BAAuB,GAAG,IAAa,CAAC;QACxC,eAAU,GAAgC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rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { isFluidHandle } from \"@fluidframework/runtime-utils/internal\";\n\nimport { type TreeValue, ValueSchema } from \"../core/index.js\";\nimport {\n\ttype FlexTreeNode,\n\tisFlexTreeNode,\n\tisTreeValue,\n\tvalueSchemaAllows,\n} from \"../feature-libraries/index.js\";\n\nimport {\n\tNodeKind,\n\ttype TreeNodeSchema,\n\ttype TreeNodeSchemaNonClass,\n\ttype NodeSchemaMetadata,\n\ttype TreeLeafValue,\n\ttype TreeNodeSchemaCorePrivate,\n\ttype TreeNodeSchemaPrivateData,\n\tprivateDataSymbol,\n\ttype TreeNodeSchemaInitializedData,\n\tCompatibilityLevel,\n\ttype FlexContent,\n} from \"./core/index.js\";\nimport type { SimpleLeafNodeSchema } from \"./simpleSchema.js\";\nimport { brand, type JsonCompatibleReadOnlyObject } from \"../util/index.js\";\nimport { getTreeNodeSchemaInitializedData } from \"./createContext.js\";\nimport type { FactoryContent } from \"./unhydratedFlexTreeFromInsertable.js\";\n\n/**\n * Instances of this class are schema for leaf nodes.\n * @remarks\n * Unlike other schema, leaf schema are class instances instead of classes themselves.\n * This is because the instance type (the tree node type) for leaves are not objects,\n * so those instances can't be instances of a schema based class.\n * @privateRemarks\n * This class refers to the underlying flex tree schema in its constructor, so this class can't be included in the package API.\n */\nexport class LeafNodeSchema<Name extends string, const T extends ValueSchema>\n\timplements\n\t\tTreeNodeSchemaNonClass<Name, NodeKind.Leaf, TreeValue<T>, TreeValue<T>>,\n\t\tSimpleLeafNodeSchema,\n\t\tTreeNodeSchemaCorePrivate\n{\n\tpublic readonly identifier: Name;\n\tpublic readonly kind = NodeKind.Leaf;\n\tpublic readonly info: T;\n\tpublic readonly implicitlyConstructable = true as const;\n\tpublic readonly childTypes: ReadonlySet<TreeNodeSchema> = new Set();\n\tpublic readonly [privateDataSymbol]: TreeNodeSchemaPrivateData = {\n\t\tidempotentInitialize: () =>\n\t\t\t(this.#initializedData ??= getTreeNodeSchemaInitializedData(this, {\n\t\t\t\tshallowCompatibilityTest: (data: FactoryContent): CompatibilityLevel =>\n\t\t\t\t\tshallowCompatibilityTest(this, data),\n\t\t\t\ttoFlexContent: (\n\t\t\t\t\tdata: FactoryContent,\n\t\t\t\t\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n\t\t\t\t): FlexContent => leafToFlexContent(data, this, allowedTypes),\n\t\t\t})),\n\t\tchildAllowedTypes: [],\n\t};\n\t#initializedData: TreeNodeSchemaInitializedData | undefined;\n\n\tpublic create(data: TreeValue<T> | FlexTreeNode): TreeValue<T> {\n\t\tif (isFlexTreeNode(data)) {\n\t\t\tconst value = data.value;\n\t\t\tassert(valueSchemaAllows(this.info, value), 0x916 /* invalid value */);\n\t\t\treturn value;\n\t\t}\n\t\treturn data;\n\t}\n\n\tpublic createFromInsertable(data: TreeValue<T>): TreeValue<T> {\n\t\treturn data;\n\t}\n\n\tpublic readonly leafKind: ValueSchema;\n\n\tpublic readonly metadata: NodeSchemaMetadata = {};\n\tpublic readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined;\n\n\tpublic constructor(name: Name, t: T) {\n\t\tthis.identifier = name;\n\t\tthis.info = t;\n\t\tthis.leafKind = t;\n\t}\n}\n\n/**\n * Wrapper around LeafNodeSchema's constructor that provides the return type that is desired in the package public API.\n */\nfunction makeLeaf<Name extends string, const T extends ValueSchema>(\n\tname: Name,\n\tt: T,\n): LeafSchema<Name, TreeValue<T>> & SimpleLeafNodeSchema {\n\t// Names in this domain follow https://en.wikipedia.org/wiki/Reverse_domain_name_notation\n\treturn new LeafNodeSchema(`com.fluidframework.leaf.${name}`, t);\n}\n\n/**\n * A {@link TreeNodeSchema} for a {@link TreeLeafValue}.\n * @remarks\n * This is just a more specific alias for a particular {@link TreeNodeSchemaNonClass}.\n * It only exists to make the API (particularly errors, IntelliSense, and generated .d.ts files) more readable.\n *\n * See {@link SchemaFactory} and its various properties for actual leaf schema objects.\n * @privateRemarks\n * This is an interface so its name will show up in things like type errors instead of the fully expanded TreeNodeSchemaNonClass.\n * @system @sealed @public\n */\nexport interface LeafSchema<Name extends string, T extends TreeLeafValue>\n\textends TreeNodeSchemaNonClass<\n\t\t`com.fluidframework.leaf.${Name}`,\n\t\tNodeKind.Leaf,\n\t\t/* TNode */ T,\n\t\t/* TInsertable */ T,\n\t\t/* ImplicitlyConstructable */ true\n\t> {}\n\n// Leaf schema shared between all SchemaFactory instances.\nexport const stringSchema = makeLeaf(\"string\", ValueSchema.String);\nexport const numberSchema = makeLeaf(\"number\", ValueSchema.Number);\nexport const booleanSchema = makeLeaf(\"boolean\", ValueSchema.Boolean);\nexport const nullSchema = makeLeaf(\"null\", ValueSchema.Null);\nexport const handleSchema = makeLeaf(\"handle\", ValueSchema.FluidHandle);\n\n/**\n * Checks if data might be schema-compatible.\n *\n * @returns false if `data` is incompatible with `type` based on a cheap/shallow check.\n *\n * Note that this may return true for cases where data is incompatible, but it must not return false in cases where the data is compatible.\n */\nfunction shallowCompatibilityTest(\n\tschema: TreeNodeSchema,\n\tdata: FactoryContent,\n): CompatibilityLevel {\n\tif (isTreeValue(data)) {\n\t\treturn allowsValue(schema, data) ? CompatibilityLevel.Normal : CompatibilityLevel.None;\n\t}\n\n\treturn CompatibilityLevel.None;\n}\n\nfunction allowsValue(schema: TreeNodeSchema, value: TreeValue): boolean {\n\tif (schema.kind === NodeKind.Leaf) {\n\t\treturn valueSchemaAllows(schema.info as ValueSchema, value);\n\t}\n\treturn false;\n}\n\n/**\n * Transforms data under a Leaf schema.\n * @param data - The tree data to be transformed. Must be a {@link TreeValue}.\n * @param schema - The schema associated with the value.\n * @param allowedTypes - The allowed types specified by the parent.\n * Used to determine which fallback values may be appropriate.\n */\nexport function leafToFlexContent(\n\tdata: FactoryContent,\n\tschema: TreeNodeSchema,\n\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n): FlexContent {\n\tassert(schema.kind === NodeKind.Leaf, 0x921 /* Expected a leaf schema. */);\n\tif (!isTreeValue(data)) {\n\t\t// This rule exists to protect against useless `toString` output like `[object Object]`.\n\t\t// In this case, that's actually reasonable behavior, since object input is not compatible with Leaf schemas.\n\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\tthrow new UsageError(`Input data is incompatible with leaf schema: ${data}`);\n\t}\n\n\tconst mappedValue = mapValueWithFallbacks(data, allowedTypes);\n\tconst mappedSchema = [...allowedTypes].find((type) => allowsValue(type, mappedValue));\n\n\tassert(mappedSchema !== undefined, 0x84a /* Unsupported schema for provided primitive. */);\n\n\tconst result: FlexContent = [\n\t\t{\n\t\t\tvalue: mappedValue,\n\t\t\ttype: brand(mappedSchema.identifier),\n\t\t},\n\t\tnew Map(),\n\t];\n\n\treturn result;\n}\n\n/**\n * Checks an incoming {@link TreeLeafValue} to ensure it is compatible with its requirements.\n * For unsupported values with a schema-compatible replacement, return the replacement value.\n * For unsupported values without a schema-compatible replacement, throw.\n * For supported values, return the input.\n */\nfunction mapValueWithFallbacks(\n\tvalue: TreeLeafValue,\n\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n): TreeValue {\n\tswitch (typeof value) {\n\t\tcase \"number\": {\n\t\t\tif (Object.is(value, -0)) {\n\t\t\t\t// Our serialized data format does not support -0.\n\t\t\t\t// Map such input to +0.\n\t\t\t\treturn 0;\n\t\t\t} else if (!Number.isFinite(value)) {\n\t\t\t\t// Our serialized data format does not support NaN nor +/-∞.\n\t\t\t\t// If the schema supports `null`, fall back to that. Otherwise, throw.\n\t\t\t\t// This is intended to match JSON's behavior for such values.\n\t\t\t\tif (allowedTypes.has(nullSchema)) {\n\t\t\t\t\treturn null;\n\t\t\t\t} else {\n\t\t\t\t\tthrow new UsageError(`Received unsupported numeric value: ${value}.`);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\t\tcase \"string\":\n\t\t// TODO:\n\t\t// This should detect invalid strings. Something like @stdlib/regexp-utf16-unpaired-surrogate could be used to do this.\n\t\t// See SchemaFactory.string for details.\n\t\tcase \"boolean\":\n\t\t\treturn value;\n\t\tcase \"object\": {\n\t\t\tif (value === null || isFluidHandle(value)) {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\t\tdefault:\n\t\t\tthrow new UsageError(`Received unsupported leaf value: ${value}.`);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"leafNodeSchema.js","sourceRoot":"","sources":["../../src/simple-tree/leafNodeSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;AAEH,kEAA6D;AAC7D,uEAAsE;AACtE,qEAAuE;AAEvE,+CAA+D;AAC/D,4DAKuC;AAEvC,8CAYyB;AAEzB,+CAA4E;AAC5E,yDAAsE;AAGtE;;;;;;;;GAQG;AACH,MAAa,cAAc;IAyBnB,MAAM,CAAC,IAAiC;QAC9C,IAAI,IAAA,yBAAc,EAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;YACzB,IAAA,iBAAM,EAAC,IAAA,4BAAiB,EAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;YACvE,OAAO,KAAK,CAAC;QACd,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,oBAAoB,CAAC,IAAkB;QAC7C,OAAO,IAAI,CAAC;IACb,CAAC;IAOD,YAAmB,IAAU,EAAE,CAAI;QApCnB,SAAI,GAAG,mBAAQ,CAAC,IAAI,CAAC;QAErB,4BAAuB,GAAG,IAAa,CAAC;QACxC,eAAU,GAAgC,IAAI,GAAG,EAAE,CAAC;QACpD,QAAmB,GAA8B;YAChE,oBAAoB,EAAE,GAAG,EAAE,CAC1B,CAAC,oIAA0B,IAAA,mDAAgC,EAAC,IAAI,EAAE;gBACjE,wBAAwB,EAAE,CAAC,IAAoB,EAAsB,EAAE,C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KG;AACH,SAAS,qBAAqB,CAC7B,KAAoB,EACpB,YAAyC;IAEzC,QAAQ,OAAO,KAAK,EAAE,CAAC;QACtB,KAAK,QAAQ,CAAC,CAAC,CAAC;YACf,IAAI,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC1B,kDAAkD;gBAClD,wBAAwB;gBACxB,OAAO,CAAC,CAAC;YACV,CAAC;iBAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBACnC,OAAO,KAAK,CAAC;YACd,CAAC;iBAAM,CAAC;gBACP,4DAA4D;gBAC5D,sEAAsE;gBACtE,6DAA6D;gBAC7D,IAAI,YAAY,CAAC,GAAG,CAAC,kBAAU,CAAC,EAAE,CAAC;oBAClC,OAAO,IAAI,CAAC;gBACb,CAAC;qBAAM,CAAC;oBACP,MAAM,IAAI,qBAAU,CAAC,uCAAuC,KAAK,GAAG,CAAC,CAAC;gBACvE,CAAC;YACF,CAAC;QACF,CAAC;QACD,KAAK,QAAQ,CAAC;QACd,QAAQ;QACR,uHAAuH;QACvH,wCAAwC;QACxC,KAAK,SAAS,CAAC,CAAC,CAAC;YAChB,OAAO,KAAK,CAAC;QACd,CAAC;QACD,KAAK,QAAQ,CAAC,CAAC,CAAC;YACf,IAAI,KAAK,KAAK,IAAI,IAAI,IAAA,wBAAa,EAAC,KAAK,CAAC,EAAE,CAAC;gBAC5C,OAAO,KAAK,CAAC;YACd,CAAC;QACF,CAAC;QACD,cAAc;QACd,OAAO,CAAC,CAAC,CAAC;YACT,MAAM,IAAI,qBAAU,CAAC,oCAAoC,KAAK,GAAG,CAAC,CAAC;QACpE,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { isFluidHandle } from \"@fluidframework/runtime-utils/internal\";\n\nimport { type TreeValue, ValueSchema } from \"../core/index.js\";\nimport {\n\ttype FlexTreeNode,\n\tisFlexTreeNode,\n\tisTreeValue,\n\tvalueSchemaAllows,\n} from \"../feature-libraries/index.js\";\n\nimport {\n\tNodeKind,\n\ttype TreeNodeSchema,\n\ttype TreeNodeSchemaNonClass,\n\ttype NodeSchemaMetadata,\n\ttype TreeLeafValue,\n\ttype TreeNodeSchemaCorePrivate,\n\ttype TreeNodeSchemaPrivateData,\n\tprivateDataSymbol,\n\ttype TreeNodeSchemaInitializedData,\n\tCompatibilityLevel,\n\ttype FlexContent,\n} from \"./core/index.js\";\nimport type { SimpleLeafNodeSchema } from \"./simpleSchema.js\";\nimport { brand, type JsonCompatibleReadOnlyObject } from \"../util/index.js\";\nimport { getTreeNodeSchemaInitializedData } from \"./createContext.js\";\nimport type { FactoryContent } from \"./unhydratedFlexTreeFromInsertable.js\";\n\n/**\n * Instances of this class are schema for leaf nodes.\n * @remarks\n * Unlike other schema, leaf schema are class instances instead of classes themselves.\n * This is because the instance type (the tree node type) for leaves are not objects,\n * so those instances can't be instances of a schema based class.\n * @privateRemarks\n * This class refers to the underlying flex tree schema in its constructor, so this class can't be included in the package API.\n */\nexport class LeafNodeSchema<Name extends string, const T extends ValueSchema>\n\timplements\n\t\tTreeNodeSchemaNonClass<Name, NodeKind.Leaf, TreeValue<T>, TreeValue<T>>,\n\t\tSimpleLeafNodeSchema,\n\t\tTreeNodeSchemaCorePrivate\n{\n\tpublic readonly identifier: Name;\n\tpublic readonly kind = NodeKind.Leaf;\n\tpublic readonly info: T;\n\tpublic readonly implicitlyConstructable = true as const;\n\tpublic readonly childTypes: ReadonlySet<TreeNodeSchema> = new Set();\n\tpublic readonly [privateDataSymbol]: TreeNodeSchemaPrivateData = {\n\t\tidempotentInitialize: () =>\n\t\t\t(this.#initializedData ??= getTreeNodeSchemaInitializedData(this, {\n\t\t\t\tshallowCompatibilityTest: (data: FactoryContent): CompatibilityLevel =>\n\t\t\t\t\tshallowCompatibilityTest(this, data),\n\t\t\t\ttoFlexContent: (\n\t\t\t\t\tdata: FactoryContent,\n\t\t\t\t\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n\t\t\t\t): FlexContent => leafToFlexContent(data, this, allowedTypes),\n\t\t\t})),\n\t\tchildAllowedTypes: [],\n\t};\n\t#initializedData: TreeNodeSchemaInitializedData | undefined;\n\n\tpublic create(data: TreeValue<T> | FlexTreeNode): TreeValue<T> {\n\t\tif (isFlexTreeNode(data)) {\n\t\t\tconst value = data.value;\n\t\t\tassert(valueSchemaAllows(this.info, value), 0x916 /* invalid value */);\n\t\t\treturn value;\n\t\t}\n\t\treturn data;\n\t}\n\n\tpublic createFromInsertable(data: TreeValue<T>): TreeValue<T> {\n\t\treturn data;\n\t}\n\n\tpublic readonly leafKind: ValueSchema;\n\n\tpublic readonly metadata: NodeSchemaMetadata = {};\n\tpublic readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined;\n\n\tpublic constructor(name: Name, t: T) {\n\t\tthis.identifier = name;\n\t\tthis.info = t;\n\t\tthis.leafKind = t;\n\t}\n}\n\n/**\n * Wrapper around LeafNodeSchema's constructor that provides the return type that is desired in the package public API.\n */\nfunction makeLeaf<Name extends string, const T extends ValueSchema>(\n\tname: Name,\n\tt: T,\n): LeafSchema<Name, TreeValue<T>> & SimpleLeafNodeSchema {\n\t// Names in this domain follow https://en.wikipedia.org/wiki/Reverse_domain_name_notation\n\treturn new LeafNodeSchema(`com.fluidframework.leaf.${name}`, t);\n}\n\n/**\n * A {@link TreeNodeSchema} for a {@link TreeLeafValue}.\n * @remarks\n * This is just a more specific alias for a particular {@link TreeNodeSchemaNonClass}.\n * It only exists to make the API (particularly errors, IntelliSense, and generated .d.ts files) more readable.\n *\n * See {@link SchemaFactory} and its various properties for actual leaf schema objects.\n * @privateRemarks\n * This is an interface so its name will show up in things like type errors instead of the fully expanded TreeNodeSchemaNonClass.\n * @system @sealed @public\n */\nexport interface LeafSchema<Name extends string, T extends TreeLeafValue>\n\textends TreeNodeSchemaNonClass<\n\t\t`com.fluidframework.leaf.${Name}`,\n\t\tNodeKind.Leaf,\n\t\t/* TNode */ T,\n\t\t/* TInsertable */ T,\n\t\t/* ImplicitlyConstructable */ true\n\t> {}\n\n// Leaf schema shared between all SchemaFactory instances.\nexport const stringSchema = makeLeaf(\"string\", ValueSchema.String);\nexport const numberSchema = makeLeaf(\"number\", ValueSchema.Number);\nexport const booleanSchema = makeLeaf(\"boolean\", ValueSchema.Boolean);\nexport const nullSchema = makeLeaf(\"null\", ValueSchema.Null);\nexport const handleSchema = makeLeaf(\"handle\", ValueSchema.FluidHandle);\n\n/**\n * Checks if data might be schema-compatible.\n *\n * @returns false if `data` is incompatible with `type` based on a cheap/shallow check.\n *\n * Note that this may return true for cases where data is incompatible, but it must not return false in cases where the data is compatible.\n */\nfunction shallowCompatibilityTest(\n\tschema: TreeNodeSchema,\n\tdata: FactoryContent,\n): CompatibilityLevel {\n\tif (isTreeValue(data)) {\n\t\treturn allowsValue(schema, data) ? CompatibilityLevel.Normal : CompatibilityLevel.None;\n\t}\n\n\treturn CompatibilityLevel.None;\n}\n\nfunction allowsValue(schema: TreeNodeSchema, value: TreeValue): boolean {\n\tif (schema.kind === NodeKind.Leaf) {\n\t\treturn valueSchemaAllows(schema.info as ValueSchema, value);\n\t}\n\treturn false;\n}\n\n/**\n * Transforms data under a Leaf schema.\n * @param data - The tree data to be transformed. Must be a {@link TreeValue}.\n * @param schema - The schema associated with the value.\n * @param allowedTypes - The allowed types specified by the parent.\n * Used to determine which fallback values may be appropriate.\n */\nexport function leafToFlexContent(\n\tdata: FactoryContent,\n\tschema: TreeNodeSchema,\n\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n): FlexContent {\n\tassert(schema.kind === NodeKind.Leaf, 0x921 /* Expected a leaf schema. */);\n\tif (!isTreeValue(data)) {\n\t\t// This rule exists to protect against useless `toString` output like `[object Object]`.\n\t\t// In this case, that's actually reasonable behavior, since object input is not compatible with Leaf schemas.\n\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\tthrow new UsageError(`Input data is incompatible with leaf schema: ${data}`);\n\t}\n\n\tconst mappedValue = mapValueWithFallbacks(data, allowedTypes);\n\tconst mappedSchema = [...allowedTypes].find((type) => allowsValue(type, mappedValue));\n\n\tassert(mappedSchema !== undefined, 0x84a /* Unsupported schema for provided primitive. */);\n\n\tconst result: FlexContent = [\n\t\t{\n\t\t\tvalue: mappedValue,\n\t\t\ttype: brand(mappedSchema.identifier),\n\t\t},\n\t\tnew Map(),\n\t];\n\n\treturn result;\n}\n\n/**\n * Checks an incoming {@link TreeLeafValue} to ensure it is compatible with its requirements.\n * For unsupported values with a schema-compatible replacement, return the replacement value.\n * For unsupported values without a schema-compatible replacement, throw.\n * For supported values, return the input.\n */\nfunction mapValueWithFallbacks(\n\tvalue: TreeLeafValue,\n\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n): TreeValue {\n\tswitch (typeof value) {\n\t\tcase \"number\": {\n\t\t\tif (Object.is(value, -0)) {\n\t\t\t\t// Our serialized data format does not support -0.\n\t\t\t\t// Map such input to +0.\n\t\t\t\treturn 0;\n\t\t\t} else if (Number.isFinite(value)) {\n\t\t\t\treturn value;\n\t\t\t} else {\n\t\t\t\t// Our serialized data format does not support NaN nor +/-∞.\n\t\t\t\t// If the schema supports `null`, fall back to that. Otherwise, throw.\n\t\t\t\t// This is intended to match JSON's behavior for such values.\n\t\t\t\tif (allowedTypes.has(nullSchema)) {\n\t\t\t\t\treturn null;\n\t\t\t\t} else {\n\t\t\t\t\tthrow new UsageError(`Received unsupported numeric value: ${value}.`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcase \"string\":\n\t\t// TODO:\n\t\t// This should detect invalid strings. Something like @stdlib/regexp-utf16-unpaired-surrogate could be used to do this.\n\t\t// See SchemaFactory.string for details.\n\t\tcase \"boolean\": {\n\t\t\treturn value;\n\t\t}\n\t\tcase \"object\": {\n\t\t\tif (value === null || isFluidHandle(value)) {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\t\t// fallthrough\n\t\tdefault: {\n\t\t\tthrow new UsageError(`Received unsupported leaf value: ${value}.`);\n\t\t}\n\t}\n}\n"]}
|
|
@@ -276,7 +276,7 @@ class CustomArrayNodeBase extends TreeNodeWithArrayFeatures {
|
|
|
276
276
|
}
|
|
277
277
|
toJSON() {
|
|
278
278
|
// This override causes the class instance to `JSON.stringify` as `[a, b]` rather than `{0: a, 1: b}`.
|
|
279
|
-
return
|
|
279
|
+
return [...this];
|
|
280
280
|
}
|
|
281
281
|
// Instances of this class are used as the dispatch object for the proxy,
|
|
282
282
|
// and thus its set of keys is used to implement `has` (for the `in` operator) for the non-numeric cases.
|
|
@@ -288,7 +288,7 @@ class CustomArrayNodeBase extends TreeNodeWithArrayFeatures {
|
|
|
288
288
|
[(_CustomArrayNodeBase_instances = new WeakSet(), _CustomArrayNodeBase_mapTreesFromFieldData = function _CustomArrayNodeBase_mapTreesFromFieldData(value) {
|
|
289
289
|
const sequenceField = getSequenceField(this);
|
|
290
290
|
const content = value;
|
|
291
|
-
const contentArray = content.flatMap((c) => c instanceof IterableTreeArrayContent ?
|
|
291
|
+
const contentArray = content.flatMap((c) => c instanceof IterableTreeArrayContent ? [...c] : [c]);
|
|
292
292
|
const kernel = (0, index_js_3.getKernel)(this);
|
|
293
293
|
const flexContext = kernel.getInnerNode().context;
|
|
294
294
|
(0, internal_1.assert)(flexContext === kernel.context.flexContext, 0xc14 /* Expected flexContext to match */);
|
|
@@ -333,12 +333,12 @@ class CustomArrayNodeBase extends TreeNodeWithArrayFeatures {
|
|
|
333
333
|
}
|
|
334
334
|
removeRange(start, end) {
|
|
335
335
|
const field = getSequenceField(this);
|
|
336
|
-
const { length } = field;
|
|
336
|
+
const { length, editor } = field;
|
|
337
337
|
const removeStart = start ?? 0;
|
|
338
338
|
(0, index_js_4.validateIndex)(removeStart, field, "TreeArrayNode.removeRange", true);
|
|
339
339
|
const removeEnd = Math.min(length, end ?? length);
|
|
340
340
|
(0, index_js_4.validateIndexRange)(removeStart, removeEnd, field, "TreeArrayNode.removeRange");
|
|
341
|
-
|
|
341
|
+
editor.remove(removeStart, removeEnd - removeStart);
|
|
342
342
|
}
|
|
343
343
|
moveToStart(sourceIndex, source) {
|
|
344
344
|
const sourceArray = source ?? this;
|
|
@@ -374,7 +374,7 @@ class CustomArrayNodeBase extends TreeNodeWithArrayFeatures {
|
|
|
374
374
|
const kernel = (0, index_js_3.getKernel)(this);
|
|
375
375
|
const destinationStored = (kernel.context.flexContext.schema.nodeSchema.get((0, index_js_4.brand)(kernel.schema.identifier)) ??
|
|
376
376
|
(0, internal_1.fail)(0xc16 /* missing schema for array node */)).getFieldSchema(index_js_1.EmptyKey).types;
|
|
377
|
-
const sourceField = source
|
|
377
|
+
const sourceField = source === undefined ? destinationField : getSequenceField(source);
|
|
378
378
|
(0, index_js_4.validateIndex)(destinationGap, destinationField, "TreeArrayNode.moveRangeToIndex", true);
|
|
379
379
|
(0, index_js_4.validateIndexRange)(sourceStart, sourceEnd, source ?? destinationField, "TreeArrayNode.moveRangeToIndex");
|
|
380
380
|
// TODO: determine support for move across different sequence types
|
|
@@ -392,7 +392,16 @@ class CustomArrayNodeBase extends TreeNodeWithArrayFeatures {
|
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
const movedCount = sourceEnd - sourceStart;
|
|
395
|
-
if (
|
|
395
|
+
if (destinationField.context.isHydrated()) {
|
|
396
|
+
if (!sourceField.context.isHydrated()) {
|
|
397
|
+
throw new internal_2.UsageError("Cannot move elements from an unhydrated array to a hydrated array.");
|
|
398
|
+
}
|
|
399
|
+
if (sourceField.context !== destinationField.context) {
|
|
400
|
+
throw new internal_2.UsageError("Cannot move elements between two different TreeViews.");
|
|
401
|
+
}
|
|
402
|
+
destinationField.context.checkout.editor.move(sourceField.getFieldPath(), sourceStart, movedCount, destinationField.getFieldPath(), destinationGap);
|
|
403
|
+
}
|
|
404
|
+
else {
|
|
396
405
|
if (!(sourceField instanceof index_js_3.UnhydratedSequenceField)) {
|
|
397
406
|
throw new internal_2.UsageError("Cannot move elements from a hydrated array to an unhydrated array.");
|
|
398
407
|
}
|
|
@@ -413,15 +422,6 @@ class CustomArrayNodeBase extends TreeNodeWithArrayFeatures {
|
|
|
413
422
|
}
|
|
414
423
|
});
|
|
415
424
|
}
|
|
416
|
-
else {
|
|
417
|
-
if (!sourceField.context.isHydrated()) {
|
|
418
|
-
throw new internal_2.UsageError("Cannot move elements from an unhydrated array to a hydrated array.");
|
|
419
|
-
}
|
|
420
|
-
if (sourceField.context !== destinationField.context) {
|
|
421
|
-
throw new internal_2.UsageError("Cannot move elements between two different TreeViews.");
|
|
422
|
-
}
|
|
423
|
-
destinationField.context.checkout.editor.move(sourceField.getFieldPath(), sourceStart, movedCount, destinationField.getFieldPath(), destinationGap);
|
|
424
|
-
}
|
|
425
425
|
}
|
|
426
426
|
values() {
|
|
427
427
|
return this.generateValues((0, index_js_3.getKernel)(this).generationNumber);
|