@fluidframework/tree 2.117.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +385 -7
- package/README.md +55 -52
- package/{api-extractor.json → api-extractor/api-extractor-model.json} +1 -1
- package/api-report/tree.alpha.api.md +174 -146
- package/api-report/tree.beta.api.md +160 -91
- package/api-report/tree.legacy.beta.api.md +160 -91
- package/api-report/tree.legacy.public.api.md +26 -43
- package/api-report/tree.public.api.md +26 -43
- package/dist/api.d.ts +9 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +2 -3
- package/dist/api.js.map +1 -1
- package/dist/codec/codec.d.ts +2 -2
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +9 -7
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/discriminatedUnions.js +1 -0
- package/dist/codec/discriminatedUnions.js.map +1 -1
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js +4 -2
- package/dist/codec/versioned/codec.js.map +1 -1
- package/dist/componentApi.d.ts.map +1 -1
- package/dist/componentApi.js +20 -17
- package/dist/componentApi.js.map +1 -1
- package/dist/core/change-family/editBuilder.js +1 -0
- package/dist/core/change-family/editBuilder.js.map +1 -1
- package/dist/core/forest/editableForest.js +1 -2
- package/dist/core/forest/editableForest.js.map +1 -1
- package/dist/core/forest/forest.js +3 -3
- package/dist/core/forest/forest.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 +9 -5
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/changeRebaser.js +5 -5
- package/dist/core/rebase/changeRebaser.js.map +1 -1
- package/dist/core/rebase/index.d.ts +1 -1
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js +2 -1
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/revisionTagCodec.d.ts +1 -1
- package/dist/core/rebase/revisionTagCodec.d.ts.map +1 -1
- package/dist/core/rebase/revisionTagCodec.js +3 -1
- package/dist/core/rebase/revisionTagCodec.js.map +1 -1
- package/dist/core/rebase/types.d.ts +12 -1
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +19 -15
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/rebase/utils.js +9 -10
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/schema-stored/schema.js +9 -4
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.js +6 -4
- package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts +1 -1
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +62 -55
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/chunk.js +2 -2
- package/dist/core/tree/chunk.js.map +1 -1
- package/dist/core/tree/cursor.js +12 -12
- package/dist/core/tree/cursor.js.map +1 -1
- package/dist/core/tree/deltaUtil.d.ts +34 -9
- package/dist/core/tree/deltaUtil.d.ts.map +1 -1
- package/dist/core/tree/deltaUtil.js +51 -17
- package/dist/core/tree/deltaUtil.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +23 -21
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +10 -10
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.js +1 -2
- package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.js +3 -2
- package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.js +3 -2
- package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +3 -3
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV1.d.ts +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
- package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.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 +7 -4
- package/dist/core/tree/index.js.map +1 -1
- package/dist/core/tree/mapTree.js +1 -2
- package/dist/core/tree/mapTree.js.map +1 -1
- package/dist/core/tree/pathTree.js +7 -8
- package/dist/core/tree/pathTree.js.map +1 -1
- package/dist/core/tree/persistedTreeTextFormat.d.ts +4 -4
- package/dist/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
- package/dist/core/tree/sparseTree.js +17 -13
- package/dist/core/tree/sparseTree.js.map +1 -1
- package/dist/core/tree/treeTextFormat.js +4 -5
- package/dist/core/tree/treeTextFormat.js.map +1 -1
- package/dist/core/tree/types.js +3 -3
- package/dist/core/tree/types.js.map +1 -1
- package/dist/core/tree/visitDelta.js +1 -2
- package/dist/core/tree/visitDelta.js.map +1 -1
- package/dist/core/tree/visitorUtils.js +5 -6
- package/dist/core/tree/visitorUtils.js.map +1 -1
- package/dist/entrypoints/alpha.d.ts +1 -1
- package/dist/entrypoints/alpha.d.ts.map +1 -1
- package/dist/entrypoints/alpha.js +6 -4
- package/dist/entrypoints/alpha.js.map +1 -1
- package/dist/entrypoints/beta.d.ts +1 -1
- package/dist/entrypoints/beta.d.ts.map +1 -1
- package/dist/entrypoints/beta.js +2 -2
- package/dist/entrypoints/beta.js.map +1 -1
- package/dist/entrypoints/legacy.d.ts +1 -1
- package/dist/entrypoints/legacy.d.ts.map +1 -1
- package/dist/entrypoints/legacy.js +2 -2
- package/dist/entrypoints/legacy.js.map +1 -1
- package/dist/entrypoints/public.d.ts +1 -1
- package/dist/entrypoints/public.d.ts.map +1 -1
- package/dist/entrypoints/public.js +1 -2
- package/dist/entrypoints/public.js.map +1 -1
- package/dist/extensibleUnionNode.d.ts.map +1 -1
- package/dist/extensibleUnionNode.js +1 -1
- package/dist/extensibleUnionNode.js.map +1 -1
- package/dist/feature-libraries/changeAtomIdBTree.js +3 -4
- package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -1
- package/dist/feature-libraries/changeAtomIdCodec.js +1 -2
- package/dist/feature-libraries/changeAtomIdCodec.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js +14 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +28 -20
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +22 -16
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +9 -11
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +15 -7
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +7 -3
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +3 -2
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.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 +2 -0
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +33 -17
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts +2 -2
- package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/versions.js +2 -2
- package/dist/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js +11 -2
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +5 -6
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +2 -3
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.js +1 -0
- package/dist/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +73 -15
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/comparison-forest/comparisonForest.js +79 -79
- package/dist/feature-libraries/comparison-forest/comparisonForest.js.map +1 -1
- package/dist/feature-libraries/cursorComparator.d.ts +8 -0
- package/dist/feature-libraries/cursorComparator.d.ts.map +1 -1
- package/dist/feature-libraries/cursorComparator.js +43 -10
- package/dist/feature-libraries/cursorComparator.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +2 -2
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js +2 -0
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
- package/dist/feature-libraries/deltaUtils.js +2 -3
- package/dist/feature-libraries/deltaUtils.js.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js +2 -0
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/dist/feature-libraries/editableTreeBinder.js +1 -2
- package/dist/feature-libraries/editableTreeBinder.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +19 -3
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js +2 -2
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.js +14 -14
- package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +28 -30
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +24 -23
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/observer.js +2 -2
- package/dist/feature-libraries/flex-tree/observer.js.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.js +5 -5
- package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +122 -117
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +49 -32
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/dist/feature-libraries/forest-summary/summaryTypes.js +2 -3
- package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +1 -1
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.js +35 -31
- package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.js +6 -7
- package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.js +2 -3
- package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +6 -7
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js +4 -4
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js +14 -12
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +63 -10
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js +3 -3
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.js +10 -0
- package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/filterEdits.d.ts +13 -0
- package/dist/feature-libraries/modular-schema/filterEdits.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/filterEdits.js +51 -0
- package/dist/feature-libraries/modular-schema/filterEdits.js.map +1 -0
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +7 -4
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js +1 -2
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js +1 -2
- package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/invert.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/invert.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/invert.js +5 -30
- package/dist/feature-libraries/modular-schema/invert.js.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.js +4 -5
- package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts +5 -7
- package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/minimizeModularChange.js +459 -10
- package/dist/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +14 -15
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -2
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -10
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +30 -97
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +9 -9
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +4 -4
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js +1 -2
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts +13 -1
- package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeUtils.js +115 -12
- package/dist/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -1
- package/dist/feature-libraries/modular-schema/prune.d.ts +2 -3
- package/dist/feature-libraries/modular-schema/prune.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/prune.js +25 -8
- package/dist/feature-libraries/modular-schema/prune.js.map +1 -1
- package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -3
- package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
- package/dist/feature-libraries/node-identifier/nodeIdentifier.js +2 -2
- package/dist/feature-libraries/node-identifier/nodeIdentifier.js.map +1 -1
- package/dist/feature-libraries/node-identifier/nodeIdentifierManager.js +3 -3
- package/dist/feature-libraries/node-identifier/nodeIdentifierManager.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +274 -267
- 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 +27 -35
- package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +7 -7
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +8 -8
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +1 -2
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +1 -2
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +3 -0
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/feature-libraries/schemaChecker.d.ts +9 -19
- package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/schemaChecker.js +135 -51
- package/dist/feature-libraries/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +8 -2
- package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
- package/dist/feature-libraries/sequence-field/filterEdits.d.ts +3 -3
- package/dist/feature-libraries/sequence-field/filterEdits.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/filterEdits.js +29 -11
- package/dist/feature-libraries/sequence-field/filterEdits.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV1.d.ts +102 -102
- package/dist/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.d.ts +79 -79
- package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV3.d.ts +56 -56
- package/dist/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.js +1 -2
- package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
- package/dist/feature-libraries/sequence-field/markListFactory.js +3 -4
- package/dist/feature-libraries/sequence-field/markListFactory.js.map +1 -1
- package/dist/feature-libraries/sequence-field/markQueue.js +4 -2
- package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/dist/feature-libraries/sequence-field/moveEffectTable.js +9 -9
- package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
- package/dist/feature-libraries/sequence-field/prune.js +1 -2
- package/dist/feature-libraries/sequence-field/prune.js.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.js +7 -2
- package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +1 -2
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.js +1 -2
- package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +2 -3
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +1 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +9 -9
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +1 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.js +54 -67
- package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.js +19 -15
- package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
- package/dist/feature-libraries/treeTextCursor.js +8 -8
- package/dist/feature-libraries/treeTextCursor.js.map +1 -1
- package/dist/feature-libraries/valueUtilities.js +4 -5
- package/dist/feature-libraries/valueUtilities.js.map +1 -1
- package/dist/index.d.ts +4 -29
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -9
- package/dist/index.js.map +1 -1
- package/dist/internalTypes.d.ts +1 -1
- package/dist/internalTypes.d.ts.map +1 -1
- package/dist/internalTypes.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/serializableDomainSchema.d.ts +1 -1
- package/dist/shared-tree/history.d.ts.map +1 -1
- package/dist/shared-tree/history.js +32 -13
- package/dist/shared-tree/history.js.map +1 -1
- package/dist/shared-tree/independentView.d.ts +27 -3
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +36 -7
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +2 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +6 -2
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/isAuditableFromOutcome.js +1 -2
- package/dist/shared-tree/isAuditableFromOutcome.js.map +1 -1
- package/dist/shared-tree/schematizeTree.js +3 -4
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +14 -4
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +107 -37
- 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 +28 -19
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +3 -3
- 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 +12 -4
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +11 -8
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFormat.js +2 -3
- package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js +2 -0
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/transactionMinimize.d.ts.map +1 -1
- package/dist/shared-tree/transactionMinimize.js +2 -1
- package/dist/shared-tree/transactionMinimize.js.map +1 -1
- package/dist/shared-tree/transactionPostProcessor.js +2 -3
- package/dist/shared-tree/transactionPostProcessor.js.map +1 -1
- package/dist/shared-tree/tree.js +2 -2
- package/dist/shared-tree/tree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +5 -16
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +18 -11
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/{lib/simple-tree/api → dist/shared-tree}/treeBeta.d.ts +8 -65
- package/dist/shared-tree/treeBeta.d.ts.map +1 -0
- package/dist/shared-tree/treeBeta.js +70 -0
- package/dist/shared-tree/treeBeta.js.map +1 -0
- package/dist/shared-tree/treeCheckout.d.ts +5 -0
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +986 -907
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree/unhydratedTreeContext.js +3 -4
- package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +24 -20
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/branchCommitCounter.js +35 -32
- package/dist/shared-tree-core/branchCommitCounter.js.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.js +9 -8
- package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/dist/shared-tree-core/branchIdCodec.js +2 -3
- package/dist/shared-tree-core/branchIdCodec.js.map +1 -1
- package/dist/shared-tree-core/customMetadataCodec.js +2 -3
- package/dist/shared-tree-core/customMetadataCodec.js.map +1 -1
- package/dist/shared-tree-core/customMetadataFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.js +11 -9
- package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +73 -44
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +3 -3
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.js +33 -36
- package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js +1 -2
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -2
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +11 -11
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +5 -4
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +10 -9
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +6 -1
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.js +1 -2
- package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js +1 -2
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +3 -3
- package/dist/shared-tree-core/messageCodecs.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/messageFormatVSharedBranches.d.ts +3 -2
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +44 -22
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/summaryTypes.js +2 -2
- package/dist/shared-tree-core/summaryTypes.js.map +1 -1
- package/dist/shared-tree-core/transaction.js +36 -39
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/shared-tree-core/versionedSummarizer.js +4 -0
- package/dist/shared-tree-core/versionedSummarizer.js.map +1 -1
- package/dist/simple-tree/api/cloneTree.d.ts +11 -0
- package/dist/simple-tree/api/cloneTree.d.ts.map +1 -0
- package/dist/simple-tree/api/cloneTree.js +31 -0
- package/dist/simple-tree/api/cloneTree.js.map +1 -0
- package/dist/simple-tree/api/conciseTree.js +2 -3
- package/dist/simple-tree/api/conciseTree.js.map +1 -1
- package/dist/simple-tree/api/configuration.d.ts +4 -4
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js +21 -2
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/create.js +2 -3
- package/dist/simple-tree/api/create.js.map +1 -1
- package/dist/simple-tree/api/customTree.js +6 -6
- package/dist/simple-tree/api/customTree.js.map +1 -1
- package/dist/simple-tree/api/dirtyIndex.js +1 -2
- package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts +36 -3
- package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/dist/simple-tree/api/discrepancies.js +42 -17
- package/dist/simple-tree/api/discrepancies.js.map +1 -1
- package/dist/simple-tree/api/eraseSchemaDetails.js +2 -3
- package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -1
- package/dist/simple-tree/api/getJsonSchema.js +1 -2
- package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/getSimpleSchema.js +1 -2
- package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/dist/simple-tree/api/identifierIndex.js +1 -2
- package/dist/simple-tree/api/identifierIndex.js.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.js +2 -2
- package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +5 -4
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +5 -7
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +22 -3
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js +140 -11
- package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts +3 -7
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.js +6 -9
- package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +4 -9
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +13 -12
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +20 -22
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +78 -81
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts +7 -9
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.js +32 -35
- package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js +1 -2
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +1 -2
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/schemaStatics.d.ts +7 -7
- package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.js +2 -3
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +2 -3
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.js +1 -2
- package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +46 -2
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +54 -12
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.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 +4 -4
- package/dist/simple-tree/api/transactionTypes.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +243 -58
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js +3 -5
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeChangeEvents.d.ts +16 -4
- package/dist/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
- package/dist/simple-tree/api/treeChangeEvents.js.map +1 -1
- package/dist/simple-tree/api/treeChangeEventsBeta.d.ts +209 -0
- package/dist/simple-tree/api/treeChangeEventsBeta.d.ts.map +1 -0
- package/dist/simple-tree/api/{treeAlpha.js → treeChangeEventsBeta.js} +1 -1
- package/dist/simple-tree/api/treeChangeEventsBeta.js.map +1 -0
- package/dist/simple-tree/api/treeNodeApi.d.ts +1 -75
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +7 -7
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +8 -6
- package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +5 -6
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.js +22 -13
- package/dist/simple-tree/core/allowedTypes.js.map +1 -1
- package/dist/simple-tree/core/context.js +3 -0
- package/dist/simple-tree/core/context.js.map +1 -1
- package/dist/simple-tree/core/flexList.js +2 -3
- package/dist/simple-tree/core/flexList.js.map +1 -1
- package/dist/simple-tree/core/getOrCreateNode.js +2 -3
- package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +1 -1
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +2 -2
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/toStored.d.ts +7 -0
- package/dist/simple-tree/core/toStored.d.ts.map +1 -1
- package/dist/simple-tree/core/toStored.js.map +1 -1
- package/dist/simple-tree/core/treeNode.d.ts +3 -4
- package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNode.js +31 -32
- package/dist/simple-tree/core/treeNode.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +194 -192
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js +3 -3
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.js +25 -25
- package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
- package/dist/simple-tree/core/types.js +1 -2
- package/dist/simple-tree/core/types.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +177 -150
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/core/walkSchema.js +2 -3
- package/dist/simple-tree/core/walkSchema.js.map +1 -1
- package/dist/simple-tree/core/withType.d.ts +7 -9
- package/dist/simple-tree/core/withType.d.ts.map +1 -1
- package/dist/simple-tree/core/withType.js +6 -7
- package/dist/simple-tree/core/withType.js.map +1 -1
- package/dist/simple-tree/createContext.js +2 -3
- package/dist/simple-tree/createContext.js.map +1 -1
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/fieldSchema.js +33 -15
- package/dist/simple-tree/fieldSchema.js.map +1 -1
- package/dist/simple-tree/getTreeNodeForField.js +1 -2
- package/dist/simple-tree/getTreeNodeForField.js.map +1 -1
- package/dist/simple-tree/index.d.ts +2 -2
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +6 -8
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +18 -17
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +3 -2
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +31 -33
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js +2 -2
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/common.js +1 -2
- package/dist/simple-tree/node-kinds/common.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts +6 -6
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +10 -16
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.js +2 -2
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.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 +27 -28
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.js +2 -2
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.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 +10 -13
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -2
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.js +2 -2
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/dist/simple-tree/prepareForInsertion.js +4 -5
- package/dist/simple-tree/prepareForInsertion.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +11 -11
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/treeSchema.js +1 -2
- package/dist/simple-tree/treeSchema.js.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +3 -4
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/dist/simple-tree/walkFieldSchema.js +1 -2
- package/dist/simple-tree/walkFieldSchema.js.map +1 -1
- package/dist/tableSchema.d.ts +2 -87
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +309 -275
- package/dist/tableSchema.js.map +1 -1
- package/dist/text/codePointUtils.d.ts +16 -3
- package/dist/text/codePointUtils.d.ts.map +1 -1
- package/dist/text/codePointUtils.js +24 -13
- package/dist/text/codePointUtils.js.map +1 -1
- package/dist/text/textDomain.d.ts +7 -1
- package/dist/text/textDomain.d.ts.map +1 -1
- package/dist/text/textDomain.js +32 -28
- package/dist/text/textDomain.js.map +1 -1
- package/dist/text/textDomainFormatted.d.ts.map +1 -1
- package/dist/text/textDomainFormatted.js +45 -34
- package/dist/text/textDomainFormatted.js.map +1 -1
- package/dist/text/textDomainFormattedDefault.js +2 -5
- package/dist/text/textDomainFormattedDefault.js.map +1 -1
- package/dist/treeDataStore.js +2 -3
- package/dist/treeDataStore.js.map +1 -1
- package/dist/treeFactory.js +7 -7
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/arrayUtilities.js +5 -6
- package/dist/util/arrayUtilities.js.map +1 -1
- package/dist/util/bTreeUtils.js +3 -4
- package/dist/util/bTreeUtils.js.map +1 -1
- package/dist/util/brand.js +6 -5
- package/dist/util/brand.js.map +1 -1
- package/dist/util/brandedMap.js +2 -3
- package/dist/util/brandedMap.js.map +1 -1
- package/dist/util/breakable.d.ts.map +1 -1
- package/dist/util/breakable.js +7 -4
- package/dist/util/breakable.js.map +1 -1
- package/dist/util/cloneWithReplacements.js +1 -2
- package/dist/util/cloneWithReplacements.js.map +1 -1
- package/dist/util/compressedIds.js +29 -7
- package/dist/util/compressedIds.js.map +1 -1
- package/dist/util/idAllocator.js +3 -3
- package/dist/util/idAllocator.js.map +1 -1
- package/dist/util/nestedMap.js +15 -17
- package/dist/util/nestedMap.js.map +1 -1
- package/dist/util/nestedSet.js +2 -3
- package/dist/util/nestedSet.js.map +1 -1
- package/dist/util/offsetList.js +2 -4
- package/dist/util/offsetList.js.map +1 -1
- package/dist/util/opaque.js +2 -3
- package/dist/util/opaque.js.map +1 -1
- package/dist/util/rangeMap.js +6 -2
- package/dist/util/rangeMap.js.map +1 -1
- package/dist/util/readSnapshotBlob.d.ts.map +1 -1
- package/dist/util/referenceCounting.js +1 -0
- package/dist/util/referenceCounting.js.map +1 -1
- package/dist/util/stackyIterator.js +3 -2
- package/dist/util/stackyIterator.js.map +1 -1
- package/dist/util/typeUtils.js +1 -2
- package/dist/util/typeUtils.js.map +1 -1
- package/dist/util/typeboxBrand.js +2 -3
- package/dist/util/typeboxBrand.js.map +1 -1
- package/dist/util/utils.d.ts +2 -2
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +32 -32
- package/dist/util/utils.js.map +1 -1
- package/lib/api.d.ts +9 -1
- package/lib/api.d.ts.map +1 -1
- package/lib/api.js.map +1 -1
- package/lib/codec/codec.d.ts +2 -2
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +2 -0
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/discriminatedUnions.js +1 -0
- package/lib/codec/discriminatedUnions.js.map +1 -1
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js +2 -0
- package/lib/codec/versioned/codec.js.map +1 -1
- package/lib/componentApi.d.ts.map +1 -1
- package/lib/componentApi.js +20 -17
- package/lib/componentApi.js.map +1 -1
- package/lib/core/change-family/editBuilder.js +1 -0
- package/lib/core/change-family/editBuilder.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/index.d.ts +1 -1
- 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/revisionTagCodec.js +3 -1
- package/lib/core/rebase/revisionTagCodec.js.map +1 -1
- package/lib/core/rebase/types.d.ts +12 -1
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +3 -0
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/schema-stored/schema.js +5 -0
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.js +4 -2
- package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/lib/core/tree/anchorSet.js +61 -54
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/deltaUtil.d.ts +34 -9
- package/lib/core/tree/deltaUtil.d.ts.map +1 -1
- package/lib/core/tree/deltaUtil.js +41 -10
- package/lib/core/tree/deltaUtil.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +23 -21
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +10 -10
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.js +2 -0
- package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV2.js +2 -0
- package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +3 -3
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.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/persistedTreeTextFormat.d.ts +4 -4
- package/lib/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
- package/lib/core/tree/sparseTree.js +15 -11
- package/lib/core/tree/sparseTree.js.map +1 -1
- package/lib/entrypoints/alpha.d.ts +1 -1
- package/lib/entrypoints/alpha.d.ts.map +1 -1
- package/lib/entrypoints/alpha.js +1 -1
- package/lib/entrypoints/alpha.js.map +1 -1
- package/lib/entrypoints/beta.d.ts +1 -1
- package/lib/entrypoints/beta.d.ts.map +1 -1
- package/lib/entrypoints/beta.js +1 -1
- package/lib/entrypoints/beta.js.map +1 -1
- package/lib/entrypoints/legacy.d.ts +1 -1
- package/lib/entrypoints/legacy.d.ts.map +1 -1
- package/lib/entrypoints/legacy.js +1 -1
- package/lib/entrypoints/legacy.js.map +1 -1
- package/lib/entrypoints/public.d.ts +1 -1
- package/lib/entrypoints/public.d.ts.map +1 -1
- package/lib/entrypoints/public.js +1 -1
- package/lib/entrypoints/public.js.map +1 -1
- package/lib/extensibleUnionNode.d.ts.map +1 -1
- package/lib/extensibleUnionNode.js +2 -2
- package/lib/extensibleUnionNode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js +14 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +14 -6
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +18 -12
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +1 -3
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +8 -0
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +4 -0
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +1 -0
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.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 +2 -0
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +28 -12
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts +2 -2
- package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js +9 -0
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.js +1 -0
- package/lib/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +71 -13
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/comparison-forest/comparisonForest.js +79 -79
- package/lib/feature-libraries/comparison-forest/comparisonForest.js.map +1 -1
- package/lib/feature-libraries/cursorComparator.d.ts +8 -0
- package/lib/feature-libraries/cursorComparator.d.ts.map +1 -1
- package/lib/feature-libraries/cursorComparator.js +43 -9
- package/lib/feature-libraries/cursorComparator.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +3 -0
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js +2 -0
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js +2 -0
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +19 -3
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.js +12 -12
- package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +25 -27
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +22 -21
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +122 -117
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +49 -32
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +1 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.js +33 -29
- package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js +14 -12
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +63 -10
- 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/fieldKind.js +10 -0
- package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/filterEdits.d.ts +13 -0
- package/lib/feature-libraries/modular-schema/filterEdits.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/filterEdits.js +46 -0
- package/lib/feature-libraries/modular-schema/filterEdits.js.map +1 -0
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +5 -2
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/invert.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/invert.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/invert.js +6 -30
- package/lib/feature-libraries/modular-schema/invert.js.map +1 -1
- package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts +5 -7
- package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/minimizeModularChange.js +458 -8
- package/lib/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -10
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +20 -85
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts +13 -1
- package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeUtils.js +100 -3
- package/lib/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -1
- package/lib/feature-libraries/modular-schema/prune.d.ts +2 -3
- package/lib/feature-libraries/modular-schema/prune.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/prune.js +25 -7
- package/lib/feature-libraries/modular-schema/prune.js.map +1 -1
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -3
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
- package/lib/feature-libraries/node-identifier/nodeIdentifierManager.js +1 -0
- package/lib/feature-libraries/node-identifier/nodeIdentifierManager.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +273 -266
- 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 +24 -32
- package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +3 -0
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/feature-libraries/schemaChecker.d.ts +9 -19
- package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/schemaChecker.js +133 -49
- package/lib/feature-libraries/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +6 -0
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/filterEdits.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/filterEdits.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/filterEdits.js +31 -12
- package/lib/feature-libraries/sequence-field/filterEdits.js.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV1.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV2.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV3.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/markListFactory.js +3 -4
- package/lib/feature-libraries/sequence-field/markListFactory.js.map +1 -1
- package/lib/feature-libraries/sequence-field/markQueue.js +4 -2
- package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.js +6 -0
- package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +9 -9
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.js +3 -15
- package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.js +13 -9
- package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
- package/lib/index.d.ts +4 -29
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -17
- package/lib/index.js.map +1 -1
- package/lib/internalTypes.d.ts +1 -1
- package/lib/internalTypes.d.ts.map +1 -1
- package/lib/internalTypes.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/serializableDomainSchema.d.ts +1 -1
- package/lib/shared-tree/history.d.ts.map +1 -1
- package/lib/shared-tree/history.js +32 -13
- package/lib/shared-tree/history.js.map +1 -1
- package/lib/shared-tree/independentView.d.ts +27 -3
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +30 -2
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +2 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +2 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +14 -4
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +109 -39
- 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 +24 -15
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js +12 -4
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +6 -3
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js +2 -0
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/transactionMinimize.d.ts.map +1 -1
- package/lib/shared-tree/transactionMinimize.js +4 -3
- package/lib/shared-tree/transactionMinimize.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +5 -16
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +13 -6
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/{dist/simple-tree/api → lib/shared-tree}/treeBeta.d.ts +8 -65
- package/lib/shared-tree/treeBeta.d.ts.map +1 -0
- package/lib/shared-tree/treeBeta.js +64 -0
- package/lib/shared-tree/treeBeta.js.map +1 -0
- package/lib/shared-tree/treeCheckout.d.ts +5 -0
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +985 -906
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree/unhydratedTreeContext.js +3 -4
- package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +22 -18
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/branchCommitCounter.js +35 -32
- package/lib/shared-tree-core/branchCommitCounter.js.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.js +9 -8
- package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/lib/shared-tree-core/customMetadataFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.js +11 -9
- package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +73 -44
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.js +32 -34
- package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +4 -4
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +2 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +6 -1
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +2 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts +2 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +45 -23
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.js +36 -39
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/shared-tree-core/versionedSummarizer.js +4 -0
- package/lib/shared-tree-core/versionedSummarizer.js.map +1 -1
- package/lib/simple-tree/api/cloneTree.d.ts +11 -0
- package/lib/simple-tree/api/cloneTree.d.ts.map +1 -0
- package/lib/simple-tree/api/cloneTree.js +28 -0
- package/lib/simple-tree/api/cloneTree.js.map +1 -0
- package/lib/simple-tree/api/configuration.d.ts +4 -4
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js +19 -0
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts +36 -3
- package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/lib/simple-tree/api/discrepancies.js +40 -14
- package/lib/simple-tree/api/discrepancies.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +5 -4
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +2 -2
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +22 -3
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.js +136 -7
- package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts +3 -7
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.js +1 -3
- package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +4 -9
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +9 -8
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +18 -20
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +78 -81
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts +7 -9
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.js +32 -35
- package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/lib/simple-tree/api/schemaStatics.d.ts +7 -7
- package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +46 -2
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js +48 -6
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/lib/simple-tree/api/transactionTypes.d.ts +4 -4
- package/lib/simple-tree/api/transactionTypes.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +243 -58
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js +2 -3
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeChangeEvents.d.ts +16 -4
- package/lib/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
- package/lib/simple-tree/api/treeChangeEvents.js.map +1 -1
- package/lib/simple-tree/api/treeChangeEventsBeta.d.ts +209 -0
- package/lib/simple-tree/api/treeChangeEventsBeta.d.ts.map +1 -0
- package/lib/simple-tree/api/{treeAlpha.js → treeChangeEventsBeta.js} +1 -1
- package/lib/simple-tree/api/treeChangeEventsBeta.js.map +1 -0
- package/lib/simple-tree/api/treeNodeApi.d.ts +1 -75
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +1 -1
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +8 -6
- package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.js +12 -3
- package/lib/simple-tree/core/allowedTypes.js.map +1 -1
- package/lib/simple-tree/core/context.js +3 -0
- package/lib/simple-tree/core/context.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +1 -1
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +1 -1
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/toStored.d.ts +7 -0
- package/lib/simple-tree/core/toStored.d.ts.map +1 -1
- package/lib/simple-tree/core/toStored.js.map +1 -1
- package/lib/simple-tree/core/treeNode.d.ts +3 -4
- package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNode.js +29 -30
- package/lib/simple-tree/core/treeNode.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +181 -179
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.js +22 -22
- package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +173 -146
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/core/withType.d.ts +7 -9
- package/lib/simple-tree/core/withType.d.ts.map +1 -1
- package/lib/simple-tree/core/withType.js +5 -6
- package/lib/simple-tree/core/withType.js.map +1 -1
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/fieldSchema.js +23 -5
- package/lib/simple-tree/fieldSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +2 -2
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +2 -2
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +16 -15
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +3 -2
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +28 -32
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts +6 -6
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +10 -17
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.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 +25 -28
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.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 +10 -14
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -2
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/lib/tableSchema.d.ts +2 -87
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +309 -275
- package/lib/tableSchema.js.map +1 -1
- package/lib/text/codePointUtils.d.ts +16 -3
- package/lib/text/codePointUtils.d.ts.map +1 -1
- package/lib/text/codePointUtils.js +22 -10
- package/lib/text/codePointUtils.js.map +1 -1
- package/lib/text/textDomain.d.ts +7 -1
- package/lib/text/textDomain.d.ts.map +1 -1
- package/lib/text/textDomain.js +21 -17
- package/lib/text/textDomain.js.map +1 -1
- package/lib/text/textDomainFormatted.d.ts.map +1 -1
- package/lib/text/textDomainFormatted.js +43 -32
- package/lib/text/textDomainFormatted.js.map +1 -1
- package/lib/text/textDomainFormattedDefault.js +2 -5
- package/lib/text/textDomainFormattedDefault.js.map +1 -1
- package/lib/util/brand.js +1 -0
- package/lib/util/brand.js.map +1 -1
- package/lib/util/breakable.d.ts.map +1 -1
- package/lib/util/breakable.js +3 -0
- package/lib/util/breakable.js.map +1 -1
- package/lib/util/compressedIds.js +22 -0
- package/lib/util/compressedIds.js.map +1 -1
- package/lib/util/nestedMap.js +2 -4
- package/lib/util/nestedMap.js.map +1 -1
- package/lib/util/offsetList.js +2 -4
- package/lib/util/offsetList.js.map +1 -1
- package/lib/util/rangeMap.js +4 -0
- package/lib/util/rangeMap.js.map +1 -1
- package/lib/util/readSnapshotBlob.d.ts.map +1 -1
- package/lib/util/referenceCounting.js +1 -0
- package/lib/util/referenceCounting.js.map +1 -1
- package/lib/util/stackyIterator.js +3 -2
- package/lib/util/stackyIterator.js.map +1 -1
- package/lib/util/utils.d.ts +2 -2
- package/lib/util/utils.d.ts.map +1 -1
- package/package.json +67 -95
- package/src/api.ts +11 -0
- package/src/core/index.ts +6 -2
- package/src/core/rebase/index.ts +1 -0
- package/src/core/rebase/types.ts +16 -1
- package/src/core/tree/anchorSet.ts +2 -2
- package/src/core/tree/deltaUtil.ts +67 -13
- package/src/core/tree/index.ts +5 -2
- package/src/entrypoints/alpha.ts +21 -20
- package/src/entrypoints/beta.ts +14 -5
- package/src/entrypoints/legacy.ts +14 -5
- package/src/entrypoints/public.ts +1 -5
- package/src/extensibleUnionNode.ts +1 -2
- package/src/feature-libraries/cursorComparator.ts +57 -9
- package/src/feature-libraries/index.ts +1 -1
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +77 -12
- package/src/feature-libraries/modular-schema/filterEdits.ts +108 -0
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +7 -4
- package/src/feature-libraries/modular-schema/index.ts +5 -2
- package/src/feature-libraries/modular-schema/invert.ts +16 -61
- package/src/feature-libraries/modular-schema/minimizeModularChange.ts +831 -10
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +10 -124
- package/src/feature-libraries/modular-schema/modularChangeUtils.ts +164 -2
- package/src/feature-libraries/modular-schema/prune.ts +52 -10
- package/src/feature-libraries/optional-field/optionalField.ts +30 -42
- package/src/feature-libraries/schemaChecker.ts +198 -82
- package/src/feature-libraries/sequence-field/filterEdits.ts +62 -26
- package/src/feature-libraries/sequence-field/utils.ts +7 -19
- package/src/index.ts +10 -39
- package/src/internalTypes.ts +1 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/history.ts +41 -19
- package/src/shared-tree/independentView.ts +40 -3
- package/src/shared-tree/index.ts +5 -1
- package/src/shared-tree/schematizingTreeView.ts +77 -23
- package/src/shared-tree/sharedTree.ts +2 -1
- package/src/shared-tree/transactionMinimize.ts +13 -4
- package/src/shared-tree/treeAlpha.ts +17 -31
- package/src/{simple-tree/api → shared-tree}/treeBeta.ts +56 -167
- package/src/shared-tree/treeCheckout.ts +82 -9
- package/src/shared-tree-core/editManager.ts +16 -8
- package/src/shared-tree-core/editManagerCodecsCommons.ts +30 -34
- package/src/shared-tree-core/editManagerCodecsV1toV4.ts +1 -1
- package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +2 -2
- package/src/simple-tree/api/cloneTree.ts +47 -0
- package/src/simple-tree/api/configuration.ts +4 -4
- package/src/simple-tree/api/discrepancies.ts +100 -5
- package/src/simple-tree/api/index.ts +22 -22
- package/src/simple-tree/api/schemaCompatibilityTester.ts +185 -11
- package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -2
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +87 -6
- package/src/simple-tree/api/transactionTypes.ts +4 -4
- package/src/simple-tree/api/tree.ts +318 -87
- package/src/simple-tree/api/treeChangeEvents.ts +16 -4
- package/src/simple-tree/api/treeChangeEventsBeta.ts +245 -0
- package/src/simple-tree/api/treeNodeApi.ts +6 -85
- package/src/simple-tree/api/typesUnsafe.ts +8 -6
- package/src/simple-tree/core/index.ts +1 -1
- package/src/simple-tree/core/toStored.ts +8 -0
- package/src/simple-tree/core/treeNode.ts +3 -10
- package/src/simple-tree/core/treeNodeValid.ts +3 -1
- package/src/simple-tree/core/withType.ts +8 -11
- package/src/simple-tree/index.ts +7 -7
- package/src/simple-tree/node-kinds/array/arrayNode.ts +14 -12
- package/src/simple-tree/node-kinds/map/mapNode.ts +14 -15
- package/src/simple-tree/node-kinds/object/objectNode.ts +3 -6
- package/src/simple-tree/node-kinds/record/recordNode.ts +6 -8
- package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +2 -1
- package/src/tableSchema.ts +8 -187
- package/src/text/codePointUtils.ts +25 -14
- package/src/text/textDomain.ts +15 -2
- package/src/text/textDomainFormatted.ts +9 -4
- package/tsconfig.json +1 -1
- package/alpha.d.ts +0 -11
- package/beta.d.ts +0 -11
- package/dist/simple-tree/api/treeAlpha.d.ts +0 -126
- package/dist/simple-tree/api/treeAlpha.d.ts.map +0 -1
- package/dist/simple-tree/api/treeAlpha.js.map +0 -1
- package/dist/simple-tree/api/treeBeta.d.ts.map +0 -1
- package/dist/simple-tree/api/treeBeta.js +0 -83
- package/dist/simple-tree/api/treeBeta.js.map +0 -1
- package/docs/main/runtime-schema-upgrade.md +0 -208
- package/internal.d.ts +0 -11
- package/legacy.d.ts +0 -11
- package/lib/simple-tree/api/treeAlpha.d.ts +0 -126
- package/lib/simple-tree/api/treeAlpha.d.ts.map +0 -1
- package/lib/simple-tree/api/treeAlpha.js.map +0 -1
- package/lib/simple-tree/api/treeBeta.d.ts.map +0 -1
- package/lib/simple-tree/api/treeBeta.js +0 -77
- package/lib/simple-tree/api/treeBeta.js.map +0 -1
- package/src/simple-tree/api/treeAlpha.ts +0 -153
- /package/api-extractor/{api-extractor.current.json → api-extractor-report.current.json} +0 -0
- /package/api-extractor/{api-extractor.legacy.json → api-extractor-report.legacy.json} +0 -0
package/dist/tableSchema.js
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.TableSchema = exports.System_TableSchema = void 0;
|
|
8
|
-
const tslib_1 = require("tslib");
|
|
9
8
|
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
10
9
|
const internal_2 = require("@fluidframework/telemetry-utils/internal");
|
|
11
10
|
const index_js_1 = require("./core/index.js");
|
|
@@ -140,7 +139,7 @@ var System_TableSchema;
|
|
|
140
139
|
*/
|
|
141
140
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify
|
|
142
141
|
function createTableSchema(inputSchemaFactory, _cellSchema, columnSchema, rowSchema) {
|
|
143
|
-
var
|
|
142
|
+
var _a;
|
|
144
143
|
const schemaFactory = createTableScopedFactory(inputSchemaFactory);
|
|
145
144
|
/**
|
|
146
145
|
* {@link Table} inner fields.
|
|
@@ -181,51 +180,6 @@ var System_TableSchema;
|
|
|
181
180
|
}) {
|
|
182
181
|
constructor(node) {
|
|
183
182
|
super(node ?? { table: { columns: [], rows: [] } });
|
|
184
|
-
_Table_instances.add(this);
|
|
185
|
-
// #region ID lookup caches
|
|
186
|
-
// Looking up rows/columns by string ID is a hot path (every getCell / setCell / etc. call goes
|
|
187
|
-
// through #tryGetRow or #tryGetColumn). Rather than scanning the arrays linearly on every call,
|
|
188
|
-
// we maintain lazily-built Maps from ID → node.
|
|
189
|
-
//
|
|
190
|
-
// Cache invalidation:
|
|
191
|
-
// Each cache is marked stale (reset to `undefined`) by a `nodeChanged` listener registered on
|
|
192
|
-
// the corresponding array node (this.table.rows / this.table.columns). `nodeChanged` fires on
|
|
193
|
-
// an array node whenever an element is inserted, removed, or moved — exactly the set of
|
|
194
|
-
// operations that could change which ID maps to which node. The event fires after the full
|
|
195
|
-
// batch of edits has been applied (including remote edits received from collaborators), so the
|
|
196
|
-
// cache is always rebuilt from a consistent, in-schema state.
|
|
197
|
-
// TODO: Consider if we should do more fine-grained invalidation here. E.g. look at the specific deltas
|
|
198
|
-
// returned by the `nodeChanged` event and only invalidate entries as needed.
|
|
199
|
-
//
|
|
200
|
-
// Listener lifetime:
|
|
201
|
-
// The listener is registered exactly once per cache (guarded by the non-undefined check on the
|
|
202
|
-
// stored unsubscribe callback). Subsequent cache rebuilds after invalidation reuse the same
|
|
203
|
-
// listener — no additional subscriptions accumulate. The unsubscribe callback is stored so
|
|
204
|
-
// that explicit cleanup is possible in the future if needed.
|
|
205
|
-
/**
|
|
206
|
-
* Cache from row ID → row node for O(1) lookups in {@link Table.#tryGetRow}.
|
|
207
|
-
* `undefined` means the cache is stale and must be rebuilt before use.
|
|
208
|
-
*/
|
|
209
|
-
_Table_rowCache.set(this, undefined);
|
|
210
|
-
/**
|
|
211
|
-
* Unsubscribe function for the `nodeChanged` listener on `this.table.rows`.
|
|
212
|
-
* `undefined` means the listener has not yet been registered (first cache build is pending).
|
|
213
|
-
* After the first build, this is always defined and the listener remains active for the
|
|
214
|
-
* lifetime of the Table node.
|
|
215
|
-
*/
|
|
216
|
-
_Table_rowCacheUnsubscribe.set(this, undefined);
|
|
217
|
-
/**
|
|
218
|
-
* Cache from column ID → column node for O(1) lookups in {@link Table.#tryGetColumn}.
|
|
219
|
-
* `undefined` means the cache is stale and must be rebuilt before use.
|
|
220
|
-
*/
|
|
221
|
-
_Table_columnCache.set(this, undefined);
|
|
222
|
-
/**
|
|
223
|
-
* Unsubscribe function for the `nodeChanged` listener on `this.table.columns`.
|
|
224
|
-
* `undefined` means the listener has not yet been registered (first cache build is pending).
|
|
225
|
-
* After the first build, this is always defined and the listener remains active for the
|
|
226
|
-
* lifetime of the Table node.
|
|
227
|
-
*/
|
|
228
|
-
_Table_columnCacheUnsubscribe.set(this, undefined);
|
|
229
183
|
}
|
|
230
184
|
static create(initialContents) {
|
|
231
185
|
// #region Input validation
|
|
@@ -259,47 +213,33 @@ var System_TableSchema;
|
|
|
259
213
|
return this.table.rows;
|
|
260
214
|
}
|
|
261
215
|
getColumn(indexOrId) {
|
|
262
|
-
return
|
|
216
|
+
return this.#tryGetColumn(indexOrId);
|
|
263
217
|
}
|
|
264
218
|
getRow(indexOrId) {
|
|
265
|
-
return
|
|
219
|
+
return this.#tryGetRow(indexOrId);
|
|
266
220
|
}
|
|
267
221
|
getCell(key) {
|
|
268
222
|
const { column: columnOrIdOrIndex, row: rowOrIdOrIndex } = key;
|
|
269
|
-
const row =
|
|
223
|
+
const row = this.#tryGetRow(rowOrIdOrIndex);
|
|
270
224
|
if (row === undefined) {
|
|
271
225
|
return undefined;
|
|
272
226
|
}
|
|
273
|
-
const columnId =
|
|
227
|
+
const columnId = this.#tryGetColumnId(columnOrIdOrIndex);
|
|
274
228
|
if (columnId === undefined) {
|
|
275
229
|
return undefined;
|
|
276
230
|
}
|
|
277
231
|
return row.cells[columnId];
|
|
278
232
|
}
|
|
279
|
-
insertColumns(
|
|
280
|
-
// Dispatch on the runtime type of the first argument to disambiguate the two overloads:
|
|
281
|
-
// * Array → positional `(columns, index?)` overload
|
|
282
|
-
// * object → deprecated `(params)` property-bag overload
|
|
283
|
-
let index;
|
|
284
|
-
let columns;
|
|
285
|
-
if (Array.isArray(columnsOrParams)) {
|
|
286
|
-
index = maybeIndex;
|
|
287
|
-
columns = columnsOrParams;
|
|
288
|
-
}
|
|
289
|
-
else {
|
|
290
|
-
const params = columnsOrParams;
|
|
291
|
-
index = params.index;
|
|
292
|
-
columns = params.columns;
|
|
293
|
-
}
|
|
233
|
+
insertColumns(columns, index) {
|
|
294
234
|
// #region Input validation
|
|
295
235
|
// Ensure specified index is valid
|
|
296
236
|
if (index !== undefined) {
|
|
297
237
|
(0, index_js_4.validateIndex)(index, this.table.columns, "Table.insertColumns", true);
|
|
298
238
|
}
|
|
299
239
|
// Ensure the new columns being inserted are valid
|
|
300
|
-
|
|
240
|
+
this.#validateNewColumns(columns);
|
|
301
241
|
// #endregion
|
|
302
|
-
|
|
242
|
+
this.#applyEditsInBatch({
|
|
303
243
|
applyEdits: () => {
|
|
304
244
|
// TypeScript is unable to narrow the column type correctly here, hence the casts below.
|
|
305
245
|
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
@@ -330,28 +270,14 @@ var System_TableSchema;
|
|
|
330
270
|
// Inserting the input nodes into the tree hydrates them, making them usable as nodes.
|
|
331
271
|
return columns;
|
|
332
272
|
}
|
|
333
|
-
insertRows(
|
|
334
|
-
// Dispatch on the runtime type of the first argument to disambiguate the two overloads:
|
|
335
|
-
// * Array → positional `(rows, index?)` overload
|
|
336
|
-
// * object → deprecated `(params)` property-bag overload
|
|
337
|
-
let index;
|
|
338
|
-
let rows;
|
|
339
|
-
if (Array.isArray(rowsOrParams)) {
|
|
340
|
-
index = maybeIndex;
|
|
341
|
-
rows = rowsOrParams;
|
|
342
|
-
}
|
|
343
|
-
else {
|
|
344
|
-
const params = rowsOrParams;
|
|
345
|
-
index = params.index;
|
|
346
|
-
rows = params.rows;
|
|
347
|
-
}
|
|
273
|
+
insertRows(rows, index) {
|
|
348
274
|
// #region Input validation
|
|
349
275
|
// Ensure specified index is valid
|
|
350
276
|
if (index !== undefined) {
|
|
351
277
|
(0, index_js_4.validateIndex)(index, this.table.rows, "Table.insertRows", true);
|
|
352
278
|
}
|
|
353
279
|
// Ensure the new rows being inserted are valid
|
|
354
|
-
|
|
280
|
+
this.#validateNewRows(rows);
|
|
355
281
|
// #endregion
|
|
356
282
|
// Relevant invariant: each cell corresponds to an existing row and column.
|
|
357
283
|
// Prevents cell leaks from concurrently removed columns.
|
|
@@ -360,8 +286,8 @@ var System_TableSchema;
|
|
|
360
286
|
// We only need to constrain columns that the new rows actually reference — a removed column with no
|
|
361
287
|
// corresponding cell in the inserted rows cannot orphan anything from this insertion.
|
|
362
288
|
// TODO: Replace with "no detach" constraint on the column array when available.
|
|
363
|
-
const columnConstraints =
|
|
364
|
-
|
|
289
|
+
const columnConstraints = this.#buildColumnInDocumentConstraintsForRows(rows);
|
|
290
|
+
this.#applyEditsInBatch({
|
|
365
291
|
applyEdits: () => {
|
|
366
292
|
// TypeScript is unable to narrow the row type correctly here, hence the casts below.
|
|
367
293
|
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
@@ -379,27 +305,10 @@ var System_TableSchema;
|
|
|
379
305
|
// Inserting the input nodes into the tree hydrates them, making them usable as nodes.
|
|
380
306
|
return rows;
|
|
381
307
|
}
|
|
382
|
-
setCell(
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
let rowOrId;
|
|
387
|
-
let columnOrId;
|
|
388
|
-
let cell;
|
|
389
|
-
if (maybeColumn === undefined) {
|
|
390
|
-
const params = rowOrParams;
|
|
391
|
-
rowOrId = params.key.row;
|
|
392
|
-
columnOrId = params.key.column;
|
|
393
|
-
cell = params.cell;
|
|
394
|
-
}
|
|
395
|
-
else {
|
|
396
|
-
rowOrId = rowOrParams;
|
|
397
|
-
columnOrId = maybeColumn;
|
|
398
|
-
cell = maybeCell;
|
|
399
|
-
}
|
|
400
|
-
const row = tslib_1.__classPrivateFieldGet(this, _Table_instances, "m", _Table_getRow).call(this, rowOrId);
|
|
401
|
-
const column = tslib_1.__classPrivateFieldGet(this, _Table_instances, "m", _Table_getColumn).call(this, columnOrId);
|
|
402
|
-
tslib_1.__classPrivateFieldGet(this, _Table_instances, "m", _Table_applyEditsInBatch).call(this, {
|
|
308
|
+
setCell(rowOrId, columnOrId, cell) {
|
|
309
|
+
const row = this.#getRow(rowOrId);
|
|
310
|
+
const column = this.#getColumn(columnOrId);
|
|
311
|
+
this.#applyEditsInBatch({
|
|
403
312
|
applyEdits: () => {
|
|
404
313
|
row.cells[column.id] = cell;
|
|
405
314
|
},
|
|
@@ -444,7 +353,7 @@ var System_TableSchema;
|
|
|
444
353
|
return [];
|
|
445
354
|
}
|
|
446
355
|
(0, index_js_4.validateIndexRange)(startIndex, endIndex, this.table.columns, "Table.removeColumns");
|
|
447
|
-
|
|
356
|
+
this.#applyEditsInBatch({
|
|
448
357
|
applyEdits: () => {
|
|
449
358
|
const columnsToRemove = this.table.columns.slice(startIndex, endIndex);
|
|
450
359
|
// First, remove all cells that correspond to each column from each row.
|
|
@@ -478,14 +387,14 @@ var System_TableSchema;
|
|
|
478
387
|
// expected by both the cell-deletion loop and the returned array.
|
|
479
388
|
const columnsToRemove = new Set();
|
|
480
389
|
for (const columnOrIdToRemove of indexOrColumns) {
|
|
481
|
-
columnsToRemove.add(
|
|
390
|
+
columnsToRemove.add(this.#getColumn(columnOrIdToRemove));
|
|
482
391
|
}
|
|
483
392
|
// Collect contiguous runs of columns-to-remove as [start, end) ranges so they can be
|
|
484
393
|
// removed via a small number of `removeRange` calls below.
|
|
485
394
|
const ranges = (0, index_js_4.collectContiguousRanges)(this.table.columns, (column) => columnsToRemove.has(column));
|
|
486
395
|
// Note, throwing an error within a transaction will abort the entire transaction.
|
|
487
396
|
// So if we throw an error here for any column, no columns will be removed.
|
|
488
|
-
|
|
397
|
+
this.#applyEditsInBatch({
|
|
489
398
|
applyEdits: () => {
|
|
490
399
|
// Remove the corresponding cell from every row.
|
|
491
400
|
// The per-column `id` values are hoisted out of the row loop so each row's `cells`
|
|
@@ -522,7 +431,7 @@ var System_TableSchema;
|
|
|
522
431
|
(0, index_js_4.validateIndexRange)(startIndex, endIndex, this.table.rows, "Table.removeRows");
|
|
523
432
|
// Compute revert constraints from the rows being removed.
|
|
524
433
|
const rowsBeingRemoved = this.table.rows.slice(startIndex, endIndex);
|
|
525
|
-
|
|
434
|
+
this.#applyEditsInBatch({
|
|
526
435
|
applyEdits: () => {
|
|
527
436
|
removedRows = removeRangeFromArray(startIndex, endIndex, this.table.rows, "Table.removeRows");
|
|
528
437
|
},
|
|
@@ -531,7 +440,7 @@ var System_TableSchema;
|
|
|
531
440
|
// each column referenced by those cells to still exist. Columns the removed rows
|
|
532
441
|
// don't reference cannot be orphaned by the revert and need not be constrained.
|
|
533
442
|
// TODO: Replace with "no detach on revert" constraint on the column array when available.
|
|
534
|
-
preconditionsOnRevert:
|
|
443
|
+
preconditionsOnRevert: this.#buildColumnInDocumentConstraintsForRows(rowsBeingRemoved),
|
|
535
444
|
});
|
|
536
445
|
return removedRows ?? (0, internal_1.fail)(0xccd /* Transaction did not complete */);
|
|
537
446
|
}
|
|
@@ -546,14 +455,14 @@ var System_TableSchema;
|
|
|
546
455
|
// expected by the returned array.
|
|
547
456
|
const rowsToRemove = new Set();
|
|
548
457
|
for (const rowToRemove of indexOrRows) {
|
|
549
|
-
rowsToRemove.add(
|
|
458
|
+
rowsToRemove.add(this.#getRow(rowToRemove));
|
|
550
459
|
}
|
|
551
460
|
// Collect contiguous runs of rows-to-remove as [start, end) ranges so they can be
|
|
552
461
|
// removed via a small number of `removeRange` calls below.
|
|
553
462
|
const ranges = (0, index_js_4.collectContiguousRanges)(this.table.rows, (row) => rowsToRemove.has(row));
|
|
554
463
|
// Note, throwing an error within a transaction will abort the entire transaction.
|
|
555
464
|
// So if we throw an error here for any row, no rows will be removed.
|
|
556
|
-
|
|
465
|
+
this.#applyEditsInBatch({
|
|
557
466
|
applyEdits: () => {
|
|
558
467
|
// Ranges are iterated in reverse so each `removeRange` call doesn't shift
|
|
559
468
|
// the indices of yet-to-remove ranges at lower positions.
|
|
@@ -567,32 +476,18 @@ var System_TableSchema;
|
|
|
567
476
|
// each column referenced by those cells to still exist. Columns the removed rows
|
|
568
477
|
// don't reference cannot be orphaned by the revert and need not be constrained.
|
|
569
478
|
// TODO: Replace with "no detach on revert" constraint on the column array when available.
|
|
570
|
-
preconditionsOnRevert:
|
|
479
|
+
preconditionsOnRevert: this.#buildColumnInDocumentConstraintsForRows(rowsToRemove),
|
|
571
480
|
});
|
|
572
481
|
return [...rowsToRemove];
|
|
573
482
|
}
|
|
574
|
-
removeCell(
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
// * otherwise → positional `(row, column)` overload
|
|
578
|
-
let rowOrIdOrIndex;
|
|
579
|
-
let columnOrIdOrIndex;
|
|
580
|
-
if (maybeColumn === undefined) {
|
|
581
|
-
const key = rowOrKey;
|
|
582
|
-
rowOrIdOrIndex = key.row;
|
|
583
|
-
columnOrIdOrIndex = key.column;
|
|
584
|
-
}
|
|
585
|
-
else {
|
|
586
|
-
rowOrIdOrIndex = rowOrKey;
|
|
587
|
-
columnOrIdOrIndex = maybeColumn;
|
|
588
|
-
}
|
|
589
|
-
const row = tslib_1.__classPrivateFieldGet(this, _Table_instances, "m", _Table_getRow).call(this, rowOrIdOrIndex);
|
|
590
|
-
const column = tslib_1.__classPrivateFieldGet(this, _Table_instances, "m", _Table_getColumn).call(this, columnOrIdOrIndex);
|
|
483
|
+
removeCell(rowOrIdOrIndex, columnOrIdOrIndex) {
|
|
484
|
+
const row = this.#getRow(rowOrIdOrIndex);
|
|
485
|
+
const column = this.#getColumn(columnOrIdOrIndex);
|
|
591
486
|
const cell = row.cells[column.id];
|
|
592
487
|
if (cell === undefined) {
|
|
593
488
|
return undefined;
|
|
594
489
|
}
|
|
595
|
-
|
|
490
|
+
this.#applyEditsInBatch({
|
|
596
491
|
applyEdits: () => {
|
|
597
492
|
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete -- This is currently how Record node entries are deleted.
|
|
598
493
|
delete row.cells[column.id];
|
|
@@ -606,6 +501,203 @@ var System_TableSchema;
|
|
|
606
501
|
});
|
|
607
502
|
return cell;
|
|
608
503
|
}
|
|
504
|
+
// #region ID lookup caches
|
|
505
|
+
// Looking up rows/columns by string ID is a hot path (every getCell / setCell / etc. call goes
|
|
506
|
+
// through #tryGetRow or #tryGetColumn). Rather than scanning the arrays linearly on every call,
|
|
507
|
+
// we maintain lazily-built Maps from ID → node.
|
|
508
|
+
//
|
|
509
|
+
// Cache invalidation:
|
|
510
|
+
// Each cache is marked stale (reset to `undefined`) by a `nodeChanged` listener registered on
|
|
511
|
+
// the corresponding array node (this.table.rows / this.table.columns). `nodeChanged` fires on
|
|
512
|
+
// an array node whenever an element is inserted, removed, or moved — exactly the set of
|
|
513
|
+
// operations that could change which ID maps to which node. The event fires after the full
|
|
514
|
+
// batch of edits has been applied (including remote edits received from collaborators), so the
|
|
515
|
+
// cache is always rebuilt from a consistent, in-schema state.
|
|
516
|
+
// TODO: Consider if we should do more fine-grained invalidation here. E.g. look at the specific deltas
|
|
517
|
+
// returned by the `nodeChanged` event and only invalidate entries as needed.
|
|
518
|
+
//
|
|
519
|
+
// Listener lifetime:
|
|
520
|
+
// The listener is registered exactly once per cache (guarded by the non-undefined check on the
|
|
521
|
+
// stored unsubscribe callback). Subsequent cache rebuilds after invalidation reuse the same
|
|
522
|
+
// listener — no additional subscriptions accumulate. The unsubscribe callback is stored so
|
|
523
|
+
// that explicit cleanup is possible in the future if needed.
|
|
524
|
+
/**
|
|
525
|
+
* Cache from row ID → row node for O(1) lookups in {@link Table.#tryGetRow}.
|
|
526
|
+
* `undefined` means the cache is stale and must be rebuilt before use.
|
|
527
|
+
*/
|
|
528
|
+
#rowCache = undefined;
|
|
529
|
+
/**
|
|
530
|
+
* Unsubscribe function for the `nodeChanged` listener on `this.table.rows`.
|
|
531
|
+
* `undefined` means the listener has not yet been registered (first cache build is pending).
|
|
532
|
+
* After the first build, this is always defined and the listener remains active for the
|
|
533
|
+
* lifetime of the Table node.
|
|
534
|
+
*/
|
|
535
|
+
#rowCacheUnsubscribe = undefined;
|
|
536
|
+
/**
|
|
537
|
+
* Cache from column ID → column node for O(1) lookups in {@link Table.#tryGetColumn}.
|
|
538
|
+
* `undefined` means the cache is stale and must be rebuilt before use.
|
|
539
|
+
*/
|
|
540
|
+
#columnCache = undefined;
|
|
541
|
+
/**
|
|
542
|
+
* Unsubscribe function for the `nodeChanged` listener on `this.table.columns`.
|
|
543
|
+
* `undefined` means the listener has not yet been registered (first cache build is pending).
|
|
544
|
+
* After the first build, this is always defined and the listener remains active for the
|
|
545
|
+
* lifetime of the Table node.
|
|
546
|
+
*/
|
|
547
|
+
#columnCacheUnsubscribe = undefined;
|
|
548
|
+
// #endregion
|
|
549
|
+
/**
|
|
550
|
+
* Applies the provided edits in a "batch".
|
|
551
|
+
*
|
|
552
|
+
* @remarks
|
|
553
|
+
* For hydrated trees, this will be done in a transaction to ensure atomicity.
|
|
554
|
+
*
|
|
555
|
+
* Transactions are not supported for unhydrated trees, so we cannot run a transaction in that case.
|
|
556
|
+
* But since there are no collaborators, this is not an issue.
|
|
557
|
+
*/
|
|
558
|
+
#applyEditsInBatch(options) {
|
|
559
|
+
const { applyEdits, preconditions, preconditionsOnRevert } = options;
|
|
560
|
+
const context = index_js_2.TreeAlpha.context(this);
|
|
561
|
+
// Ensure events are paused until all of the edits are applied.
|
|
562
|
+
// This ensures that the user sees the corresponding table-level edit as atomic,
|
|
563
|
+
// and ensures they are not spammed with intermediate events.
|
|
564
|
+
(0, index_js_3.withBufferedTreeEvents)(() => {
|
|
565
|
+
if (context.isView()) {
|
|
566
|
+
context.runTransaction(() => {
|
|
567
|
+
applyEdits();
|
|
568
|
+
if (preconditionsOnRevert !== undefined) {
|
|
569
|
+
return { preconditionsOnRevert };
|
|
570
|
+
}
|
|
571
|
+
}, preconditions === undefined ? undefined : { preconditions });
|
|
572
|
+
}
|
|
573
|
+
else {
|
|
574
|
+
// If this node does not have a corresponding view, then it is unhydrated.
|
|
575
|
+
// I.e., it is not part of a collaborative session yet.
|
|
576
|
+
// Therefore, we don't need to run the edits as a transaction.
|
|
577
|
+
applyEdits();
|
|
578
|
+
}
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* Builds an array of `nodeInDocument` constraints over each column referenced by a cell
|
|
583
|
+
* in any of `rows`.
|
|
584
|
+
*
|
|
585
|
+
* @remarks
|
|
586
|
+
* The orphan-cell invariant only cares about columns that have cells in the affected rows;
|
|
587
|
+
* columns absent from those rows' cells have no cell to orphan, so they need not be
|
|
588
|
+
* constrained. This keeps the constraint set proportional to the cells touched rather than
|
|
589
|
+
* the total column count, which matters for sparse tables.
|
|
590
|
+
*
|
|
591
|
+
* Returns `undefined` when:
|
|
592
|
+
* - The table is unhydrated (no transaction will run), or
|
|
593
|
+
* - None of `rows` reference any cells.
|
|
594
|
+
*
|
|
595
|
+
* In those cases there is nothing to constrain, and returning `undefined` avoids
|
|
596
|
+
* allocating an array that would only be discarded.
|
|
597
|
+
*/
|
|
598
|
+
#buildColumnInDocumentConstraintsForRows(rows) {
|
|
599
|
+
if (!index_js_2.TreeAlpha.context(this).isView()) {
|
|
600
|
+
return undefined;
|
|
601
|
+
}
|
|
602
|
+
const referencedColumnIds = new Set();
|
|
603
|
+
for (const row of rows) {
|
|
604
|
+
// `cells` is intentionally hidden on the public row type, so cast to read it.
|
|
605
|
+
const cells = row.cells;
|
|
606
|
+
if (cells === undefined) {
|
|
607
|
+
continue;
|
|
608
|
+
}
|
|
609
|
+
for (const id of Object.keys(cells)) {
|
|
610
|
+
referencedColumnIds.add(id);
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
if (referencedColumnIds.size === 0) {
|
|
614
|
+
return undefined;
|
|
615
|
+
}
|
|
616
|
+
const columnCache = this.#getColumnCache();
|
|
617
|
+
const constraints = [];
|
|
618
|
+
for (const id of referencedColumnIds) {
|
|
619
|
+
const column = columnCache.get(id) ?? (0, internal_1.fail)(0xd05 /* Column ID not found in cache */);
|
|
620
|
+
constraints.push({ type: "nodeInDocument", node: column });
|
|
621
|
+
}
|
|
622
|
+
(0, internal_1.assert)(constraints.length > 0, 0xd06 /* No constraints generated for column references. */);
|
|
623
|
+
return constraints;
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* Returns the column ID → column node cache, building and caching it first if stale.
|
|
627
|
+
*
|
|
628
|
+
* @remarks
|
|
629
|
+
* The first time this is called, it builds the map from the current contents of
|
|
630
|
+
* `this.table.columns` and registers a `nodeChanged` listener on that array.
|
|
631
|
+
* The listener invalidates the cache (sets `#columnCache` to `undefined`) whenever
|
|
632
|
+
* the column array is structurally modified (insert / remove / move), so every
|
|
633
|
+
* subsequent call that follows a structural change automatically triggers a rebuild.
|
|
634
|
+
* The listener is registered only once — it is not re-registered on cache rebuilds.
|
|
635
|
+
*/
|
|
636
|
+
#getColumnCache() {
|
|
637
|
+
let cache = this.#columnCache;
|
|
638
|
+
if (cache === undefined) {
|
|
639
|
+
cache = new Map();
|
|
640
|
+
for (const column of this.table.columns) {
|
|
641
|
+
// TypeScript is unable to narrow array element types correctly here.
|
|
642
|
+
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
643
|
+
cache.set(column.id, column);
|
|
644
|
+
}
|
|
645
|
+
this.#columnCache = cache;
|
|
646
|
+
// Register the invalidation listener once. The `nodeChanged` event fires on the
|
|
647
|
+
// array node itself after any structural change (insert / remove / move), which is
|
|
648
|
+
// exactly the set of changes that can alter the ID → node mapping.
|
|
649
|
+
if (this.#columnCacheUnsubscribe === undefined) {
|
|
650
|
+
this.#columnCacheUnsubscribe = index_js_2.Tree.on(this.columns, "nodeChanged", () => {
|
|
651
|
+
this.#columnCache = undefined;
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
return cache;
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* Attempts to resolve the provided Column node, ID, or index to the corresponding Column ID.
|
|
659
|
+
* Returns `undefined` if there is no match.
|
|
660
|
+
*/
|
|
661
|
+
#tryGetColumnId(columnOrIdOrIndex) {
|
|
662
|
+
if (typeof columnOrIdOrIndex === "string") {
|
|
663
|
+
return columnOrIdOrIndex;
|
|
664
|
+
}
|
|
665
|
+
return this.#tryGetColumn(columnOrIdOrIndex)?.id;
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* Attempts to resolve the provided Column node or ID to a Column node in the table.
|
|
669
|
+
* Returns `undefined` if there is no match.
|
|
670
|
+
* @remarks Searches for a match based strictly on the ID and returns that result.
|
|
671
|
+
*/
|
|
672
|
+
#tryGetColumn(columnOrIdOrIndex) {
|
|
673
|
+
if (typeof columnOrIdOrIndex === "number") {
|
|
674
|
+
if (columnOrIdOrIndex < 0 || columnOrIdOrIndex >= this.table.columns.length) {
|
|
675
|
+
return undefined;
|
|
676
|
+
}
|
|
677
|
+
// TypeScript is unable to narrow the types correctly here, hence the cast.
|
|
678
|
+
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
679
|
+
return this.table.columns[columnOrIdOrIndex];
|
|
680
|
+
}
|
|
681
|
+
const columnCache = this.#getColumnCache();
|
|
682
|
+
if (typeof columnOrIdOrIndex === "string") {
|
|
683
|
+
return columnCache.get(columnOrIdOrIndex);
|
|
684
|
+
}
|
|
685
|
+
// If the user provided a node, ensure it actually exists in this table.
|
|
686
|
+
const cached = columnCache.get(columnOrIdOrIndex.id);
|
|
687
|
+
return cached === columnOrIdOrIndex ? columnOrIdOrIndex : undefined;
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
* Attempts to resolve the provided Column node or ID to a Column node in the table.
|
|
691
|
+
* @throws Throws a `UsageError` if there is no match.
|
|
692
|
+
* @remarks Searches for a match based strictly on the ID and returns that result.
|
|
693
|
+
*/
|
|
694
|
+
#getColumn(columnOrIdOrIndex) {
|
|
695
|
+
const column = this.#tryGetColumn(columnOrIdOrIndex);
|
|
696
|
+
if (column === undefined) {
|
|
697
|
+
_a._throwMissingColumnError(columnOrIdOrIndex);
|
|
698
|
+
}
|
|
699
|
+
return column;
|
|
700
|
+
}
|
|
609
701
|
/**
|
|
610
702
|
* Throw a `UsageError` for a missing Column by its ID or index.
|
|
611
703
|
*/
|
|
@@ -618,6 +710,89 @@ var System_TableSchema;
|
|
|
618
710
|
}
|
|
619
711
|
throw new internal_2.UsageError(`The specified column node with ID "${columnOrIdOrIndex.id}" does not exist in the table.`);
|
|
620
712
|
}
|
|
713
|
+
/**
|
|
714
|
+
* Returns the row ID → row node cache, building and caching it first if stale.
|
|
715
|
+
*
|
|
716
|
+
* @remarks
|
|
717
|
+
* The first time this is called, it builds the map from the current contents of
|
|
718
|
+
* `this.table.rows` and registers a `nodeChanged` listener on that array.
|
|
719
|
+
* The listener invalidates the cache (sets `#rowCache` to `undefined`) whenever
|
|
720
|
+
* the row array is structurally modified (insert / remove / move), so every
|
|
721
|
+
* subsequent call that follows a structural change automatically triggers a rebuild.
|
|
722
|
+
* The listener is registered only once — it is not re-registered on cache rebuilds.
|
|
723
|
+
*/
|
|
724
|
+
#getRowCache() {
|
|
725
|
+
let cache = this.#rowCache;
|
|
726
|
+
if (cache === undefined) {
|
|
727
|
+
cache = new Map();
|
|
728
|
+
for (const row of this.table.rows) {
|
|
729
|
+
// TypeScript is unable to narrow array element types correctly here.
|
|
730
|
+
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
731
|
+
cache.set(row.id, row);
|
|
732
|
+
}
|
|
733
|
+
this.#rowCache = cache;
|
|
734
|
+
// Register the invalidation listener once. The `nodeChanged` event fires on the
|
|
735
|
+
// array node itself after any structural change (insert / remove / move), which is
|
|
736
|
+
// exactly the set of changes that can alter the ID → node mapping.
|
|
737
|
+
if (this.#rowCacheUnsubscribe === undefined) {
|
|
738
|
+
this.#rowCacheUnsubscribe = index_js_2.Tree.on(this.rows, "nodeChanged", () => {
|
|
739
|
+
this.#rowCache = undefined;
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
return cache;
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* Attempts to resolve the provided Row node or ID to a Row node in the table.
|
|
747
|
+
* Returns `undefined` if there is no match.
|
|
748
|
+
* @remarks Searches for a match based strictly on the ID and returns that result.
|
|
749
|
+
*/
|
|
750
|
+
#tryGetRow(rowOrIdOrIndex) {
|
|
751
|
+
if (typeof rowOrIdOrIndex === "number") {
|
|
752
|
+
if (rowOrIdOrIndex < 0 || rowOrIdOrIndex >= this.table.rows.length) {
|
|
753
|
+
return undefined;
|
|
754
|
+
}
|
|
755
|
+
// TypeScript is unable to narrow the types correctly here, hence the cast.
|
|
756
|
+
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
757
|
+
return this.table.rows[rowOrIdOrIndex];
|
|
758
|
+
}
|
|
759
|
+
const rowCache = this.#getRowCache();
|
|
760
|
+
if (typeof rowOrIdOrIndex === "string") {
|
|
761
|
+
return rowCache.get(rowOrIdOrIndex);
|
|
762
|
+
}
|
|
763
|
+
// If the user provided a node, ensure it actually exists in this table.
|
|
764
|
+
const cached = rowCache.get(rowOrIdOrIndex.id);
|
|
765
|
+
return cached === rowOrIdOrIndex ? rowOrIdOrIndex : undefined;
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* Attempts to resolve the provided Row node, ID, or index to a Row node in the table.
|
|
769
|
+
* @throws Throws a `UsageError` if there is no match.
|
|
770
|
+
* @remarks Searches for a match based strictly on the ID and returns that result.
|
|
771
|
+
*/
|
|
772
|
+
#getRow(rowOrIdOrIndex) {
|
|
773
|
+
const row = this.#tryGetRow(rowOrIdOrIndex);
|
|
774
|
+
if (row === undefined) {
|
|
775
|
+
_a._throwMissingRowError(rowOrIdOrIndex);
|
|
776
|
+
}
|
|
777
|
+
return row;
|
|
778
|
+
}
|
|
779
|
+
/**
|
|
780
|
+
* Validates the provided list of new columns being inserted into the table.
|
|
781
|
+
* @throws Throws a `UsageError` if any of the following conditions are met:
|
|
782
|
+
* - A column with a duplicate ID is being inserted.
|
|
783
|
+
*/
|
|
784
|
+
#validateNewColumns(newColumns) {
|
|
785
|
+
return _a._validateNewColumns(newColumns, this.#getColumnCache());
|
|
786
|
+
}
|
|
787
|
+
/**
|
|
788
|
+
* Validates the provided list of new rows being inserted into the table.
|
|
789
|
+
* @throws Throws a `UsageError` if any of the following conditions are met:
|
|
790
|
+
* - A row with a duplicate ID is being inserted.
|
|
791
|
+
* - A row is being inserted that contains cells for columns that do not exist in the table.
|
|
792
|
+
*/
|
|
793
|
+
#validateNewRows(newRows) {
|
|
794
|
+
return _a._validateNewRows(newRows, this.#getRowCache(), this.#getColumnCache());
|
|
795
|
+
}
|
|
621
796
|
/**
|
|
622
797
|
* Validates the provided list of new columns being inserted into the table.
|
|
623
798
|
* @throws Throws a `UsageError` if any of the following conditions are met:
|
|
@@ -683,148 +858,7 @@ var System_TableSchema;
|
|
|
683
858
|
throw new internal_2.UsageError(`The specified row node with ID "${rowOrIdOrIndex.id}" does not exist in the table.`);
|
|
684
859
|
}
|
|
685
860
|
}
|
|
686
|
-
_a = Table
|
|
687
|
-
const { applyEdits, preconditions, preconditionsOnRevert } = options;
|
|
688
|
-
const context = index_js_2.TreeAlpha.context(this);
|
|
689
|
-
// Ensure events are paused until all of the edits are applied.
|
|
690
|
-
// This ensures that the user sees the corresponding table-level edit as atomic,
|
|
691
|
-
// and ensures they are not spammed with intermediate events.
|
|
692
|
-
(0, index_js_3.withBufferedTreeEvents)(() => {
|
|
693
|
-
if (context.isView()) {
|
|
694
|
-
context.runTransaction(() => {
|
|
695
|
-
applyEdits();
|
|
696
|
-
if (preconditionsOnRevert !== undefined) {
|
|
697
|
-
return { preconditionsOnRevert };
|
|
698
|
-
}
|
|
699
|
-
}, preconditions === undefined ? undefined : { preconditions });
|
|
700
|
-
}
|
|
701
|
-
else {
|
|
702
|
-
// If this node does not have a corresponding view, then it is unhydrated.
|
|
703
|
-
// I.e., it is not part of a collaborative session yet.
|
|
704
|
-
// Therefore, we don't need to run the edits as a transaction.
|
|
705
|
-
applyEdits();
|
|
706
|
-
}
|
|
707
|
-
});
|
|
708
|
-
}, _Table_buildColumnInDocumentConstraintsForRows = function _Table_buildColumnInDocumentConstraintsForRows(rows) {
|
|
709
|
-
if (!index_js_2.TreeAlpha.context(this).isView()) {
|
|
710
|
-
return undefined;
|
|
711
|
-
}
|
|
712
|
-
const referencedColumnIds = new Set();
|
|
713
|
-
for (const row of rows) {
|
|
714
|
-
// `cells` is intentionally hidden on the public row type, so cast to read it.
|
|
715
|
-
const cells = row.cells;
|
|
716
|
-
if (cells === undefined) {
|
|
717
|
-
continue;
|
|
718
|
-
}
|
|
719
|
-
for (const id of Object.keys(cells)) {
|
|
720
|
-
referencedColumnIds.add(id);
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
if (referencedColumnIds.size === 0) {
|
|
724
|
-
return undefined;
|
|
725
|
-
}
|
|
726
|
-
const columnCache = tslib_1.__classPrivateFieldGet(this, _Table_instances, "m", _Table_getColumnCache).call(this);
|
|
727
|
-
const constraints = [];
|
|
728
|
-
for (const id of referencedColumnIds) {
|
|
729
|
-
const column = columnCache.get(id) ?? (0, internal_1.fail)(0xd05 /* Column ID not found in cache */);
|
|
730
|
-
constraints.push({ type: "nodeInDocument", node: column });
|
|
731
|
-
}
|
|
732
|
-
(0, internal_1.assert)(constraints.length > 0, 0xd06 /* No constraints generated for column references. */);
|
|
733
|
-
return constraints;
|
|
734
|
-
}, _Table_getColumnCache = function _Table_getColumnCache() {
|
|
735
|
-
let cache = tslib_1.__classPrivateFieldGet(this, _Table_columnCache, "f");
|
|
736
|
-
if (cache === undefined) {
|
|
737
|
-
cache = new Map();
|
|
738
|
-
for (const column of this.table.columns) {
|
|
739
|
-
// TypeScript is unable to narrow array element types correctly here.
|
|
740
|
-
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
741
|
-
cache.set(column.id, column);
|
|
742
|
-
}
|
|
743
|
-
tslib_1.__classPrivateFieldSet(this, _Table_columnCache, cache, "f");
|
|
744
|
-
// Register the invalidation listener once. The `nodeChanged` event fires on the
|
|
745
|
-
// array node itself after any structural change (insert / remove / move), which is
|
|
746
|
-
// exactly the set of changes that can alter the ID → node mapping.
|
|
747
|
-
if (tslib_1.__classPrivateFieldGet(this, _Table_columnCacheUnsubscribe, "f") === undefined) {
|
|
748
|
-
tslib_1.__classPrivateFieldSet(this, _Table_columnCacheUnsubscribe, index_js_2.Tree.on(this.columns, "nodeChanged", () => {
|
|
749
|
-
tslib_1.__classPrivateFieldSet(this, _Table_columnCache, undefined, "f");
|
|
750
|
-
}), "f");
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
return cache;
|
|
754
|
-
}, _Table_tryGetColumnId = function _Table_tryGetColumnId(columnOrIdOrIndex) {
|
|
755
|
-
if (typeof columnOrIdOrIndex === "string") {
|
|
756
|
-
return columnOrIdOrIndex;
|
|
757
|
-
}
|
|
758
|
-
return tslib_1.__classPrivateFieldGet(this, _Table_instances, "m", _Table_tryGetColumn).call(this, columnOrIdOrIndex)?.id;
|
|
759
|
-
}, _Table_tryGetColumn = function _Table_tryGetColumn(columnOrIdOrIndex) {
|
|
760
|
-
if (typeof columnOrIdOrIndex === "number") {
|
|
761
|
-
if (columnOrIdOrIndex < 0 || columnOrIdOrIndex >= this.table.columns.length) {
|
|
762
|
-
return undefined;
|
|
763
|
-
}
|
|
764
|
-
// TypeScript is unable to narrow the types correctly here, hence the cast.
|
|
765
|
-
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
766
|
-
return this.table.columns[columnOrIdOrIndex];
|
|
767
|
-
}
|
|
768
|
-
const columnCache = tslib_1.__classPrivateFieldGet(this, _Table_instances, "m", _Table_getColumnCache).call(this);
|
|
769
|
-
if (typeof columnOrIdOrIndex === "string") {
|
|
770
|
-
return columnCache.get(columnOrIdOrIndex);
|
|
771
|
-
}
|
|
772
|
-
// If the user provided a node, ensure it actually exists in this table.
|
|
773
|
-
const cached = columnCache.get(columnOrIdOrIndex.id);
|
|
774
|
-
return cached === columnOrIdOrIndex ? columnOrIdOrIndex : undefined;
|
|
775
|
-
}, _Table_getColumn = function _Table_getColumn(columnOrIdOrIndex) {
|
|
776
|
-
const column = tslib_1.__classPrivateFieldGet(this, _Table_instances, "m", _Table_tryGetColumn).call(this, columnOrIdOrIndex);
|
|
777
|
-
if (column === undefined) {
|
|
778
|
-
_a._throwMissingColumnError(columnOrIdOrIndex);
|
|
779
|
-
}
|
|
780
|
-
return column;
|
|
781
|
-
}, _Table_getRowCache = function _Table_getRowCache() {
|
|
782
|
-
let cache = tslib_1.__classPrivateFieldGet(this, _Table_rowCache, "f");
|
|
783
|
-
if (cache === undefined) {
|
|
784
|
-
cache = new Map();
|
|
785
|
-
for (const row of this.table.rows) {
|
|
786
|
-
// TypeScript is unable to narrow array element types correctly here.
|
|
787
|
-
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
788
|
-
cache.set(row.id, row);
|
|
789
|
-
}
|
|
790
|
-
tslib_1.__classPrivateFieldSet(this, _Table_rowCache, cache, "f");
|
|
791
|
-
// Register the invalidation listener once. The `nodeChanged` event fires on the
|
|
792
|
-
// array node itself after any structural change (insert / remove / move), which is
|
|
793
|
-
// exactly the set of changes that can alter the ID → node mapping.
|
|
794
|
-
if (tslib_1.__classPrivateFieldGet(this, _Table_rowCacheUnsubscribe, "f") === undefined) {
|
|
795
|
-
tslib_1.__classPrivateFieldSet(this, _Table_rowCacheUnsubscribe, index_js_2.Tree.on(this.rows, "nodeChanged", () => {
|
|
796
|
-
tslib_1.__classPrivateFieldSet(this, _Table_rowCache, undefined, "f");
|
|
797
|
-
}), "f");
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
return cache;
|
|
801
|
-
}, _Table_tryGetRow = function _Table_tryGetRow(rowOrIdOrIndex) {
|
|
802
|
-
if (typeof rowOrIdOrIndex === "number") {
|
|
803
|
-
if (rowOrIdOrIndex < 0 || rowOrIdOrIndex >= this.table.rows.length) {
|
|
804
|
-
return undefined;
|
|
805
|
-
}
|
|
806
|
-
// TypeScript is unable to narrow the types correctly here, hence the cast.
|
|
807
|
-
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
808
|
-
return this.table.rows[rowOrIdOrIndex];
|
|
809
|
-
}
|
|
810
|
-
const rowCache = tslib_1.__classPrivateFieldGet(this, _Table_instances, "m", _Table_getRowCache).call(this);
|
|
811
|
-
if (typeof rowOrIdOrIndex === "string") {
|
|
812
|
-
return rowCache.get(rowOrIdOrIndex);
|
|
813
|
-
}
|
|
814
|
-
// If the user provided a node, ensure it actually exists in this table.
|
|
815
|
-
const cached = rowCache.get(rowOrIdOrIndex.id);
|
|
816
|
-
return cached === rowOrIdOrIndex ? rowOrIdOrIndex : undefined;
|
|
817
|
-
}, _Table_getRow = function _Table_getRow(rowOrIdOrIndex) {
|
|
818
|
-
const row = tslib_1.__classPrivateFieldGet(this, _Table_instances, "m", _Table_tryGetRow).call(this, rowOrIdOrIndex);
|
|
819
|
-
if (row === undefined) {
|
|
820
|
-
_a._throwMissingRowError(rowOrIdOrIndex);
|
|
821
|
-
}
|
|
822
|
-
return row;
|
|
823
|
-
}, _Table_validateNewColumns = function _Table_validateNewColumns(newColumns) {
|
|
824
|
-
return _a._validateNewColumns(newColumns, tslib_1.__classPrivateFieldGet(this, _Table_instances, "m", _Table_getColumnCache).call(this));
|
|
825
|
-
}, _Table_validateNewRows = function _Table_validateNewRows(newRows) {
|
|
826
|
-
return _a._validateNewRows(newRows, tslib_1.__classPrivateFieldGet(this, _Table_instances, "m", _Table_getRowCache).call(this), tslib_1.__classPrivateFieldGet(this, _Table_instances, "m", _Table_getColumnCache).call(this));
|
|
827
|
-
};
|
|
861
|
+
_a = Table;
|
|
828
862
|
// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly "__#124291@#brand": unknown;`
|
|
829
863
|
// for the private brand field of TreeNode.
|
|
830
864
|
// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.
|