@fluidframework/tree 2.118.1 → 3.0.1
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 +367 -75
- package/README.md +55 -52
- package/{api-extractor.json → api-extractor/api-extractor-model.json} +1 -1
- package/api-report/tree.alpha.api.md +130 -145
- package/api-report/tree.beta.api.md +122 -91
- package/api-report/tree.legacy.beta.api.md +122 -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/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.js +5 -5
- 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 +2 -2
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +59 -26
- 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.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.js +2 -3
- 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 +3 -3
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +4 -7
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js +2 -3
- 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 +80 -61
- 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/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.js +23 -23
- 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 +5 -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/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/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 +2 -2
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +60 -27
- 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.js +19 -0
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +3 -3
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/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 +80 -61
- 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/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.js +19 -19
- 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 +19 -21
- package/src/entrypoints/beta.ts +12 -5
- package/src/entrypoints/legacy.ts +12 -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/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/sequence-field/filterEdits.ts +62 -26
- package/src/feature-libraries/sequence-field/utils.ts +7 -19
- package/src/index.ts +7 -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 +2 -2
- 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/index.ts +15 -21
- 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 +139 -85
- 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/treeNode.ts +3 -10
- package/src/simple-tree/core/withType.ts +8 -11
- package/src/simple-tree/index.ts +3 -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/glossary.md +0 -163
- 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/lib/tableSchema.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
|
|
6
5
|
import { assert, fail, oob } from "@fluidframework/core-utils/internal";
|
|
7
6
|
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
8
7
|
import { EmptyKey } from "./core/index.js";
|
|
@@ -137,7 +136,7 @@ export var System_TableSchema;
|
|
|
137
136
|
*/
|
|
138
137
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify
|
|
139
138
|
function createTableSchema(inputSchemaFactory, _cellSchema, columnSchema, rowSchema) {
|
|
140
|
-
var
|
|
139
|
+
var _a;
|
|
141
140
|
const schemaFactory = createTableScopedFactory(inputSchemaFactory);
|
|
142
141
|
/**
|
|
143
142
|
* {@link Table} inner fields.
|
|
@@ -178,51 +177,6 @@ export var System_TableSchema;
|
|
|
178
177
|
}) {
|
|
179
178
|
constructor(node) {
|
|
180
179
|
super(node ?? { table: { columns: [], rows: [] } });
|
|
181
|
-
_Table_instances.add(this);
|
|
182
|
-
// #region ID lookup caches
|
|
183
|
-
// Looking up rows/columns by string ID is a hot path (every getCell / setCell / etc. call goes
|
|
184
|
-
// through #tryGetRow or #tryGetColumn). Rather than scanning the arrays linearly on every call,
|
|
185
|
-
// we maintain lazily-built Maps from ID → node.
|
|
186
|
-
//
|
|
187
|
-
// Cache invalidation:
|
|
188
|
-
// Each cache is marked stale (reset to `undefined`) by a `nodeChanged` listener registered on
|
|
189
|
-
// the corresponding array node (this.table.rows / this.table.columns). `nodeChanged` fires on
|
|
190
|
-
// an array node whenever an element is inserted, removed, or moved — exactly the set of
|
|
191
|
-
// operations that could change which ID maps to which node. The event fires after the full
|
|
192
|
-
// batch of edits has been applied (including remote edits received from collaborators), so the
|
|
193
|
-
// cache is always rebuilt from a consistent, in-schema state.
|
|
194
|
-
// TODO: Consider if we should do more fine-grained invalidation here. E.g. look at the specific deltas
|
|
195
|
-
// returned by the `nodeChanged` event and only invalidate entries as needed.
|
|
196
|
-
//
|
|
197
|
-
// Listener lifetime:
|
|
198
|
-
// The listener is registered exactly once per cache (guarded by the non-undefined check on the
|
|
199
|
-
// stored unsubscribe callback). Subsequent cache rebuilds after invalidation reuse the same
|
|
200
|
-
// listener — no additional subscriptions accumulate. The unsubscribe callback is stored so
|
|
201
|
-
// that explicit cleanup is possible in the future if needed.
|
|
202
|
-
/**
|
|
203
|
-
* Cache from row ID → row node for O(1) lookups in {@link Table.#tryGetRow}.
|
|
204
|
-
* `undefined` means the cache is stale and must be rebuilt before use.
|
|
205
|
-
*/
|
|
206
|
-
_Table_rowCache.set(this, undefined);
|
|
207
|
-
/**
|
|
208
|
-
* Unsubscribe function for the `nodeChanged` listener on `this.table.rows`.
|
|
209
|
-
* `undefined` means the listener has not yet been registered (first cache build is pending).
|
|
210
|
-
* After the first build, this is always defined and the listener remains active for the
|
|
211
|
-
* lifetime of the Table node.
|
|
212
|
-
*/
|
|
213
|
-
_Table_rowCacheUnsubscribe.set(this, undefined);
|
|
214
|
-
/**
|
|
215
|
-
* Cache from column ID → column node for O(1) lookups in {@link Table.#tryGetColumn}.
|
|
216
|
-
* `undefined` means the cache is stale and must be rebuilt before use.
|
|
217
|
-
*/
|
|
218
|
-
_Table_columnCache.set(this, undefined);
|
|
219
|
-
/**
|
|
220
|
-
* Unsubscribe function for the `nodeChanged` listener on `this.table.columns`.
|
|
221
|
-
* `undefined` means the listener has not yet been registered (first cache build is pending).
|
|
222
|
-
* After the first build, this is always defined and the listener remains active for the
|
|
223
|
-
* lifetime of the Table node.
|
|
224
|
-
*/
|
|
225
|
-
_Table_columnCacheUnsubscribe.set(this, undefined);
|
|
226
180
|
}
|
|
227
181
|
static create(initialContents) {
|
|
228
182
|
// #region Input validation
|
|
@@ -256,47 +210,33 @@ export var System_TableSchema;
|
|
|
256
210
|
return this.table.rows;
|
|
257
211
|
}
|
|
258
212
|
getColumn(indexOrId) {
|
|
259
|
-
return
|
|
213
|
+
return this.#tryGetColumn(indexOrId);
|
|
260
214
|
}
|
|
261
215
|
getRow(indexOrId) {
|
|
262
|
-
return
|
|
216
|
+
return this.#tryGetRow(indexOrId);
|
|
263
217
|
}
|
|
264
218
|
getCell(key) {
|
|
265
219
|
const { column: columnOrIdOrIndex, row: rowOrIdOrIndex } = key;
|
|
266
|
-
const row =
|
|
220
|
+
const row = this.#tryGetRow(rowOrIdOrIndex);
|
|
267
221
|
if (row === undefined) {
|
|
268
222
|
return undefined;
|
|
269
223
|
}
|
|
270
|
-
const columnId =
|
|
224
|
+
const columnId = this.#tryGetColumnId(columnOrIdOrIndex);
|
|
271
225
|
if (columnId === undefined) {
|
|
272
226
|
return undefined;
|
|
273
227
|
}
|
|
274
228
|
return row.cells[columnId];
|
|
275
229
|
}
|
|
276
|
-
insertColumns(
|
|
277
|
-
// Dispatch on the runtime type of the first argument to disambiguate the two overloads:
|
|
278
|
-
// * Array → positional `(columns, index?)` overload
|
|
279
|
-
// * object → deprecated `(params)` property-bag overload
|
|
280
|
-
let index;
|
|
281
|
-
let columns;
|
|
282
|
-
if (Array.isArray(columnsOrParams)) {
|
|
283
|
-
index = maybeIndex;
|
|
284
|
-
columns = columnsOrParams;
|
|
285
|
-
}
|
|
286
|
-
else {
|
|
287
|
-
const params = columnsOrParams;
|
|
288
|
-
index = params.index;
|
|
289
|
-
columns = params.columns;
|
|
290
|
-
}
|
|
230
|
+
insertColumns(columns, index) {
|
|
291
231
|
// #region Input validation
|
|
292
232
|
// Ensure specified index is valid
|
|
293
233
|
if (index !== undefined) {
|
|
294
234
|
validateIndex(index, this.table.columns, "Table.insertColumns", true);
|
|
295
235
|
}
|
|
296
236
|
// Ensure the new columns being inserted are valid
|
|
297
|
-
|
|
237
|
+
this.#validateNewColumns(columns);
|
|
298
238
|
// #endregion
|
|
299
|
-
|
|
239
|
+
this.#applyEditsInBatch({
|
|
300
240
|
applyEdits: () => {
|
|
301
241
|
// TypeScript is unable to narrow the column type correctly here, hence the casts below.
|
|
302
242
|
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
@@ -327,28 +267,14 @@ export var System_TableSchema;
|
|
|
327
267
|
// Inserting the input nodes into the tree hydrates them, making them usable as nodes.
|
|
328
268
|
return columns;
|
|
329
269
|
}
|
|
330
|
-
insertRows(
|
|
331
|
-
// Dispatch on the runtime type of the first argument to disambiguate the two overloads:
|
|
332
|
-
// * Array → positional `(rows, index?)` overload
|
|
333
|
-
// * object → deprecated `(params)` property-bag overload
|
|
334
|
-
let index;
|
|
335
|
-
let rows;
|
|
336
|
-
if (Array.isArray(rowsOrParams)) {
|
|
337
|
-
index = maybeIndex;
|
|
338
|
-
rows = rowsOrParams;
|
|
339
|
-
}
|
|
340
|
-
else {
|
|
341
|
-
const params = rowsOrParams;
|
|
342
|
-
index = params.index;
|
|
343
|
-
rows = params.rows;
|
|
344
|
-
}
|
|
270
|
+
insertRows(rows, index) {
|
|
345
271
|
// #region Input validation
|
|
346
272
|
// Ensure specified index is valid
|
|
347
273
|
if (index !== undefined) {
|
|
348
274
|
validateIndex(index, this.table.rows, "Table.insertRows", true);
|
|
349
275
|
}
|
|
350
276
|
// Ensure the new rows being inserted are valid
|
|
351
|
-
|
|
277
|
+
this.#validateNewRows(rows);
|
|
352
278
|
// #endregion
|
|
353
279
|
// Relevant invariant: each cell corresponds to an existing row and column.
|
|
354
280
|
// Prevents cell leaks from concurrently removed columns.
|
|
@@ -357,8 +283,8 @@ export var System_TableSchema;
|
|
|
357
283
|
// We only need to constrain columns that the new rows actually reference — a removed column with no
|
|
358
284
|
// corresponding cell in the inserted rows cannot orphan anything from this insertion.
|
|
359
285
|
// TODO: Replace with "no detach" constraint on the column array when available.
|
|
360
|
-
const columnConstraints =
|
|
361
|
-
|
|
286
|
+
const columnConstraints = this.#buildColumnInDocumentConstraintsForRows(rows);
|
|
287
|
+
this.#applyEditsInBatch({
|
|
362
288
|
applyEdits: () => {
|
|
363
289
|
// TypeScript is unable to narrow the row type correctly here, hence the casts below.
|
|
364
290
|
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
@@ -376,27 +302,10 @@ export var System_TableSchema;
|
|
|
376
302
|
// Inserting the input nodes into the tree hydrates them, making them usable as nodes.
|
|
377
303
|
return rows;
|
|
378
304
|
}
|
|
379
|
-
setCell(
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
let rowOrId;
|
|
384
|
-
let columnOrId;
|
|
385
|
-
let cell;
|
|
386
|
-
if (maybeColumn === undefined) {
|
|
387
|
-
const params = rowOrParams;
|
|
388
|
-
rowOrId = params.key.row;
|
|
389
|
-
columnOrId = params.key.column;
|
|
390
|
-
cell = params.cell;
|
|
391
|
-
}
|
|
392
|
-
else {
|
|
393
|
-
rowOrId = rowOrParams;
|
|
394
|
-
columnOrId = maybeColumn;
|
|
395
|
-
cell = maybeCell;
|
|
396
|
-
}
|
|
397
|
-
const row = __classPrivateFieldGet(this, _Table_instances, "m", _Table_getRow).call(this, rowOrId);
|
|
398
|
-
const column = __classPrivateFieldGet(this, _Table_instances, "m", _Table_getColumn).call(this, columnOrId);
|
|
399
|
-
__classPrivateFieldGet(this, _Table_instances, "m", _Table_applyEditsInBatch).call(this, {
|
|
305
|
+
setCell(rowOrId, columnOrId, cell) {
|
|
306
|
+
const row = this.#getRow(rowOrId);
|
|
307
|
+
const column = this.#getColumn(columnOrId);
|
|
308
|
+
this.#applyEditsInBatch({
|
|
400
309
|
applyEdits: () => {
|
|
401
310
|
row.cells[column.id] = cell;
|
|
402
311
|
},
|
|
@@ -441,7 +350,7 @@ export var System_TableSchema;
|
|
|
441
350
|
return [];
|
|
442
351
|
}
|
|
443
352
|
validateIndexRange(startIndex, endIndex, this.table.columns, "Table.removeColumns");
|
|
444
|
-
|
|
353
|
+
this.#applyEditsInBatch({
|
|
445
354
|
applyEdits: () => {
|
|
446
355
|
const columnsToRemove = this.table.columns.slice(startIndex, endIndex);
|
|
447
356
|
// First, remove all cells that correspond to each column from each row.
|
|
@@ -475,14 +384,14 @@ export var System_TableSchema;
|
|
|
475
384
|
// expected by both the cell-deletion loop and the returned array.
|
|
476
385
|
const columnsToRemove = new Set();
|
|
477
386
|
for (const columnOrIdToRemove of indexOrColumns) {
|
|
478
|
-
columnsToRemove.add(
|
|
387
|
+
columnsToRemove.add(this.#getColumn(columnOrIdToRemove));
|
|
479
388
|
}
|
|
480
389
|
// Collect contiguous runs of columns-to-remove as [start, end) ranges so they can be
|
|
481
390
|
// removed via a small number of `removeRange` calls below.
|
|
482
391
|
const ranges = collectContiguousRanges(this.table.columns, (column) => columnsToRemove.has(column));
|
|
483
392
|
// Note, throwing an error within a transaction will abort the entire transaction.
|
|
484
393
|
// So if we throw an error here for any column, no columns will be removed.
|
|
485
|
-
|
|
394
|
+
this.#applyEditsInBatch({
|
|
486
395
|
applyEdits: () => {
|
|
487
396
|
// Remove the corresponding cell from every row.
|
|
488
397
|
// The per-column `id` values are hoisted out of the row loop so each row's `cells`
|
|
@@ -519,7 +428,7 @@ export var System_TableSchema;
|
|
|
519
428
|
validateIndexRange(startIndex, endIndex, this.table.rows, "Table.removeRows");
|
|
520
429
|
// Compute revert constraints from the rows being removed.
|
|
521
430
|
const rowsBeingRemoved = this.table.rows.slice(startIndex, endIndex);
|
|
522
|
-
|
|
431
|
+
this.#applyEditsInBatch({
|
|
523
432
|
applyEdits: () => {
|
|
524
433
|
removedRows = removeRangeFromArray(startIndex, endIndex, this.table.rows, "Table.removeRows");
|
|
525
434
|
},
|
|
@@ -528,7 +437,7 @@ export var System_TableSchema;
|
|
|
528
437
|
// each column referenced by those cells to still exist. Columns the removed rows
|
|
529
438
|
// don't reference cannot be orphaned by the revert and need not be constrained.
|
|
530
439
|
// TODO: Replace with "no detach on revert" constraint on the column array when available.
|
|
531
|
-
preconditionsOnRevert:
|
|
440
|
+
preconditionsOnRevert: this.#buildColumnInDocumentConstraintsForRows(rowsBeingRemoved),
|
|
532
441
|
});
|
|
533
442
|
return removedRows ?? fail(0xccd /* Transaction did not complete */);
|
|
534
443
|
}
|
|
@@ -543,14 +452,14 @@ export var System_TableSchema;
|
|
|
543
452
|
// expected by the returned array.
|
|
544
453
|
const rowsToRemove = new Set();
|
|
545
454
|
for (const rowToRemove of indexOrRows) {
|
|
546
|
-
rowsToRemove.add(
|
|
455
|
+
rowsToRemove.add(this.#getRow(rowToRemove));
|
|
547
456
|
}
|
|
548
457
|
// Collect contiguous runs of rows-to-remove as [start, end) ranges so they can be
|
|
549
458
|
// removed via a small number of `removeRange` calls below.
|
|
550
459
|
const ranges = collectContiguousRanges(this.table.rows, (row) => rowsToRemove.has(row));
|
|
551
460
|
// Note, throwing an error within a transaction will abort the entire transaction.
|
|
552
461
|
// So if we throw an error here for any row, no rows will be removed.
|
|
553
|
-
|
|
462
|
+
this.#applyEditsInBatch({
|
|
554
463
|
applyEdits: () => {
|
|
555
464
|
// Ranges are iterated in reverse so each `removeRange` call doesn't shift
|
|
556
465
|
// the indices of yet-to-remove ranges at lower positions.
|
|
@@ -564,32 +473,18 @@ export var System_TableSchema;
|
|
|
564
473
|
// each column referenced by those cells to still exist. Columns the removed rows
|
|
565
474
|
// don't reference cannot be orphaned by the revert and need not be constrained.
|
|
566
475
|
// TODO: Replace with "no detach on revert" constraint on the column array when available.
|
|
567
|
-
preconditionsOnRevert:
|
|
476
|
+
preconditionsOnRevert: this.#buildColumnInDocumentConstraintsForRows(rowsToRemove),
|
|
568
477
|
});
|
|
569
478
|
return [...rowsToRemove];
|
|
570
479
|
}
|
|
571
|
-
removeCell(
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
// * otherwise → positional `(row, column)` overload
|
|
575
|
-
let rowOrIdOrIndex;
|
|
576
|
-
let columnOrIdOrIndex;
|
|
577
|
-
if (maybeColumn === undefined) {
|
|
578
|
-
const key = rowOrKey;
|
|
579
|
-
rowOrIdOrIndex = key.row;
|
|
580
|
-
columnOrIdOrIndex = key.column;
|
|
581
|
-
}
|
|
582
|
-
else {
|
|
583
|
-
rowOrIdOrIndex = rowOrKey;
|
|
584
|
-
columnOrIdOrIndex = maybeColumn;
|
|
585
|
-
}
|
|
586
|
-
const row = __classPrivateFieldGet(this, _Table_instances, "m", _Table_getRow).call(this, rowOrIdOrIndex);
|
|
587
|
-
const column = __classPrivateFieldGet(this, _Table_instances, "m", _Table_getColumn).call(this, columnOrIdOrIndex);
|
|
480
|
+
removeCell(rowOrIdOrIndex, columnOrIdOrIndex) {
|
|
481
|
+
const row = this.#getRow(rowOrIdOrIndex);
|
|
482
|
+
const column = this.#getColumn(columnOrIdOrIndex);
|
|
588
483
|
const cell = row.cells[column.id];
|
|
589
484
|
if (cell === undefined) {
|
|
590
485
|
return undefined;
|
|
591
486
|
}
|
|
592
|
-
|
|
487
|
+
this.#applyEditsInBatch({
|
|
593
488
|
applyEdits: () => {
|
|
594
489
|
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete -- This is currently how Record node entries are deleted.
|
|
595
490
|
delete row.cells[column.id];
|
|
@@ -603,6 +498,203 @@ export var System_TableSchema;
|
|
|
603
498
|
});
|
|
604
499
|
return cell;
|
|
605
500
|
}
|
|
501
|
+
// #region ID lookup caches
|
|
502
|
+
// Looking up rows/columns by string ID is a hot path (every getCell / setCell / etc. call goes
|
|
503
|
+
// through #tryGetRow or #tryGetColumn). Rather than scanning the arrays linearly on every call,
|
|
504
|
+
// we maintain lazily-built Maps from ID → node.
|
|
505
|
+
//
|
|
506
|
+
// Cache invalidation:
|
|
507
|
+
// Each cache is marked stale (reset to `undefined`) by a `nodeChanged` listener registered on
|
|
508
|
+
// the corresponding array node (this.table.rows / this.table.columns). `nodeChanged` fires on
|
|
509
|
+
// an array node whenever an element is inserted, removed, or moved — exactly the set of
|
|
510
|
+
// operations that could change which ID maps to which node. The event fires after the full
|
|
511
|
+
// batch of edits has been applied (including remote edits received from collaborators), so the
|
|
512
|
+
// cache is always rebuilt from a consistent, in-schema state.
|
|
513
|
+
// TODO: Consider if we should do more fine-grained invalidation here. E.g. look at the specific deltas
|
|
514
|
+
// returned by the `nodeChanged` event and only invalidate entries as needed.
|
|
515
|
+
//
|
|
516
|
+
// Listener lifetime:
|
|
517
|
+
// The listener is registered exactly once per cache (guarded by the non-undefined check on the
|
|
518
|
+
// stored unsubscribe callback). Subsequent cache rebuilds after invalidation reuse the same
|
|
519
|
+
// listener — no additional subscriptions accumulate. The unsubscribe callback is stored so
|
|
520
|
+
// that explicit cleanup is possible in the future if needed.
|
|
521
|
+
/**
|
|
522
|
+
* Cache from row ID → row node for O(1) lookups in {@link Table.#tryGetRow}.
|
|
523
|
+
* `undefined` means the cache is stale and must be rebuilt before use.
|
|
524
|
+
*/
|
|
525
|
+
#rowCache = undefined;
|
|
526
|
+
/**
|
|
527
|
+
* Unsubscribe function for the `nodeChanged` listener on `this.table.rows`.
|
|
528
|
+
* `undefined` means the listener has not yet been registered (first cache build is pending).
|
|
529
|
+
* After the first build, this is always defined and the listener remains active for the
|
|
530
|
+
* lifetime of the Table node.
|
|
531
|
+
*/
|
|
532
|
+
#rowCacheUnsubscribe = undefined;
|
|
533
|
+
/**
|
|
534
|
+
* Cache from column ID → column node for O(1) lookups in {@link Table.#tryGetColumn}.
|
|
535
|
+
* `undefined` means the cache is stale and must be rebuilt before use.
|
|
536
|
+
*/
|
|
537
|
+
#columnCache = undefined;
|
|
538
|
+
/**
|
|
539
|
+
* Unsubscribe function for the `nodeChanged` listener on `this.table.columns`.
|
|
540
|
+
* `undefined` means the listener has not yet been registered (first cache build is pending).
|
|
541
|
+
* After the first build, this is always defined and the listener remains active for the
|
|
542
|
+
* lifetime of the Table node.
|
|
543
|
+
*/
|
|
544
|
+
#columnCacheUnsubscribe = undefined;
|
|
545
|
+
// #endregion
|
|
546
|
+
/**
|
|
547
|
+
* Applies the provided edits in a "batch".
|
|
548
|
+
*
|
|
549
|
+
* @remarks
|
|
550
|
+
* For hydrated trees, this will be done in a transaction to ensure atomicity.
|
|
551
|
+
*
|
|
552
|
+
* Transactions are not supported for unhydrated trees, so we cannot run a transaction in that case.
|
|
553
|
+
* But since there are no collaborators, this is not an issue.
|
|
554
|
+
*/
|
|
555
|
+
#applyEditsInBatch(options) {
|
|
556
|
+
const { applyEdits, preconditions, preconditionsOnRevert } = options;
|
|
557
|
+
const context = TreeAlpha.context(this);
|
|
558
|
+
// Ensure events are paused until all of the edits are applied.
|
|
559
|
+
// This ensures that the user sees the corresponding table-level edit as atomic,
|
|
560
|
+
// and ensures they are not spammed with intermediate events.
|
|
561
|
+
withBufferedTreeEvents(() => {
|
|
562
|
+
if (context.isView()) {
|
|
563
|
+
context.runTransaction(() => {
|
|
564
|
+
applyEdits();
|
|
565
|
+
if (preconditionsOnRevert !== undefined) {
|
|
566
|
+
return { preconditionsOnRevert };
|
|
567
|
+
}
|
|
568
|
+
}, preconditions === undefined ? undefined : { preconditions });
|
|
569
|
+
}
|
|
570
|
+
else {
|
|
571
|
+
// If this node does not have a corresponding view, then it is unhydrated.
|
|
572
|
+
// I.e., it is not part of a collaborative session yet.
|
|
573
|
+
// Therefore, we don't need to run the edits as a transaction.
|
|
574
|
+
applyEdits();
|
|
575
|
+
}
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* Builds an array of `nodeInDocument` constraints over each column referenced by a cell
|
|
580
|
+
* in any of `rows`.
|
|
581
|
+
*
|
|
582
|
+
* @remarks
|
|
583
|
+
* The orphan-cell invariant only cares about columns that have cells in the affected rows;
|
|
584
|
+
* columns absent from those rows' cells have no cell to orphan, so they need not be
|
|
585
|
+
* constrained. This keeps the constraint set proportional to the cells touched rather than
|
|
586
|
+
* the total column count, which matters for sparse tables.
|
|
587
|
+
*
|
|
588
|
+
* Returns `undefined` when:
|
|
589
|
+
* - The table is unhydrated (no transaction will run), or
|
|
590
|
+
* - None of `rows` reference any cells.
|
|
591
|
+
*
|
|
592
|
+
* In those cases there is nothing to constrain, and returning `undefined` avoids
|
|
593
|
+
* allocating an array that would only be discarded.
|
|
594
|
+
*/
|
|
595
|
+
#buildColumnInDocumentConstraintsForRows(rows) {
|
|
596
|
+
if (!TreeAlpha.context(this).isView()) {
|
|
597
|
+
return undefined;
|
|
598
|
+
}
|
|
599
|
+
const referencedColumnIds = new Set();
|
|
600
|
+
for (const row of rows) {
|
|
601
|
+
// `cells` is intentionally hidden on the public row type, so cast to read it.
|
|
602
|
+
const cells = row.cells;
|
|
603
|
+
if (cells === undefined) {
|
|
604
|
+
continue;
|
|
605
|
+
}
|
|
606
|
+
for (const id of Object.keys(cells)) {
|
|
607
|
+
referencedColumnIds.add(id);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
if (referencedColumnIds.size === 0) {
|
|
611
|
+
return undefined;
|
|
612
|
+
}
|
|
613
|
+
const columnCache = this.#getColumnCache();
|
|
614
|
+
const constraints = [];
|
|
615
|
+
for (const id of referencedColumnIds) {
|
|
616
|
+
const column = columnCache.get(id) ?? fail(0xd05 /* Column ID not found in cache */);
|
|
617
|
+
constraints.push({ type: "nodeInDocument", node: column });
|
|
618
|
+
}
|
|
619
|
+
assert(constraints.length > 0, 0xd06 /* No constraints generated for column references. */);
|
|
620
|
+
return constraints;
|
|
621
|
+
}
|
|
622
|
+
/**
|
|
623
|
+
* Returns the column ID → column node cache, building and caching it first if stale.
|
|
624
|
+
*
|
|
625
|
+
* @remarks
|
|
626
|
+
* The first time this is called, it builds the map from the current contents of
|
|
627
|
+
* `this.table.columns` and registers a `nodeChanged` listener on that array.
|
|
628
|
+
* The listener invalidates the cache (sets `#columnCache` to `undefined`) whenever
|
|
629
|
+
* the column array is structurally modified (insert / remove / move), so every
|
|
630
|
+
* subsequent call that follows a structural change automatically triggers a rebuild.
|
|
631
|
+
* The listener is registered only once — it is not re-registered on cache rebuilds.
|
|
632
|
+
*/
|
|
633
|
+
#getColumnCache() {
|
|
634
|
+
let cache = this.#columnCache;
|
|
635
|
+
if (cache === undefined) {
|
|
636
|
+
cache = new Map();
|
|
637
|
+
for (const column of this.table.columns) {
|
|
638
|
+
// TypeScript is unable to narrow array element types correctly here.
|
|
639
|
+
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
640
|
+
cache.set(column.id, column);
|
|
641
|
+
}
|
|
642
|
+
this.#columnCache = cache;
|
|
643
|
+
// Register the invalidation listener once. The `nodeChanged` event fires on the
|
|
644
|
+
// array node itself after any structural change (insert / remove / move), which is
|
|
645
|
+
// exactly the set of changes that can alter the ID → node mapping.
|
|
646
|
+
if (this.#columnCacheUnsubscribe === undefined) {
|
|
647
|
+
this.#columnCacheUnsubscribe = Tree.on(this.columns, "nodeChanged", () => {
|
|
648
|
+
this.#columnCache = undefined;
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
return cache;
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* Attempts to resolve the provided Column node, ID, or index to the corresponding Column ID.
|
|
656
|
+
* Returns `undefined` if there is no match.
|
|
657
|
+
*/
|
|
658
|
+
#tryGetColumnId(columnOrIdOrIndex) {
|
|
659
|
+
if (typeof columnOrIdOrIndex === "string") {
|
|
660
|
+
return columnOrIdOrIndex;
|
|
661
|
+
}
|
|
662
|
+
return this.#tryGetColumn(columnOrIdOrIndex)?.id;
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* Attempts to resolve the provided Column node or ID to a Column node in the table.
|
|
666
|
+
* Returns `undefined` if there is no match.
|
|
667
|
+
* @remarks Searches for a match based strictly on the ID and returns that result.
|
|
668
|
+
*/
|
|
669
|
+
#tryGetColumn(columnOrIdOrIndex) {
|
|
670
|
+
if (typeof columnOrIdOrIndex === "number") {
|
|
671
|
+
if (columnOrIdOrIndex < 0 || columnOrIdOrIndex >= this.table.columns.length) {
|
|
672
|
+
return undefined;
|
|
673
|
+
}
|
|
674
|
+
// TypeScript is unable to narrow the types correctly here, hence the cast.
|
|
675
|
+
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
676
|
+
return this.table.columns[columnOrIdOrIndex];
|
|
677
|
+
}
|
|
678
|
+
const columnCache = this.#getColumnCache();
|
|
679
|
+
if (typeof columnOrIdOrIndex === "string") {
|
|
680
|
+
return columnCache.get(columnOrIdOrIndex);
|
|
681
|
+
}
|
|
682
|
+
// If the user provided a node, ensure it actually exists in this table.
|
|
683
|
+
const cached = columnCache.get(columnOrIdOrIndex.id);
|
|
684
|
+
return cached === columnOrIdOrIndex ? columnOrIdOrIndex : undefined;
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* Attempts to resolve the provided Column node or ID to a Column node in the table.
|
|
688
|
+
* @throws Throws a `UsageError` if there is no match.
|
|
689
|
+
* @remarks Searches for a match based strictly on the ID and returns that result.
|
|
690
|
+
*/
|
|
691
|
+
#getColumn(columnOrIdOrIndex) {
|
|
692
|
+
const column = this.#tryGetColumn(columnOrIdOrIndex);
|
|
693
|
+
if (column === undefined) {
|
|
694
|
+
_a._throwMissingColumnError(columnOrIdOrIndex);
|
|
695
|
+
}
|
|
696
|
+
return column;
|
|
697
|
+
}
|
|
606
698
|
/**
|
|
607
699
|
* Throw a `UsageError` for a missing Column by its ID or index.
|
|
608
700
|
*/
|
|
@@ -615,6 +707,89 @@ export var System_TableSchema;
|
|
|
615
707
|
}
|
|
616
708
|
throw new UsageError(`The specified column node with ID "${columnOrIdOrIndex.id}" does not exist in the table.`);
|
|
617
709
|
}
|
|
710
|
+
/**
|
|
711
|
+
* Returns the row ID → row node cache, building and caching it first if stale.
|
|
712
|
+
*
|
|
713
|
+
* @remarks
|
|
714
|
+
* The first time this is called, it builds the map from the current contents of
|
|
715
|
+
* `this.table.rows` and registers a `nodeChanged` listener on that array.
|
|
716
|
+
* The listener invalidates the cache (sets `#rowCache` to `undefined`) whenever
|
|
717
|
+
* the row array is structurally modified (insert / remove / move), so every
|
|
718
|
+
* subsequent call that follows a structural change automatically triggers a rebuild.
|
|
719
|
+
* The listener is registered only once — it is not re-registered on cache rebuilds.
|
|
720
|
+
*/
|
|
721
|
+
#getRowCache() {
|
|
722
|
+
let cache = this.#rowCache;
|
|
723
|
+
if (cache === undefined) {
|
|
724
|
+
cache = new Map();
|
|
725
|
+
for (const row of this.table.rows) {
|
|
726
|
+
// TypeScript is unable to narrow array element types correctly here.
|
|
727
|
+
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
728
|
+
cache.set(row.id, row);
|
|
729
|
+
}
|
|
730
|
+
this.#rowCache = cache;
|
|
731
|
+
// Register the invalidation listener once. The `nodeChanged` event fires on the
|
|
732
|
+
// array node itself after any structural change (insert / remove / move), which is
|
|
733
|
+
// exactly the set of changes that can alter the ID → node mapping.
|
|
734
|
+
if (this.#rowCacheUnsubscribe === undefined) {
|
|
735
|
+
this.#rowCacheUnsubscribe = Tree.on(this.rows, "nodeChanged", () => {
|
|
736
|
+
this.#rowCache = undefined;
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
return cache;
|
|
741
|
+
}
|
|
742
|
+
/**
|
|
743
|
+
* Attempts to resolve the provided Row node or ID to a Row node in the table.
|
|
744
|
+
* Returns `undefined` if there is no match.
|
|
745
|
+
* @remarks Searches for a match based strictly on the ID and returns that result.
|
|
746
|
+
*/
|
|
747
|
+
#tryGetRow(rowOrIdOrIndex) {
|
|
748
|
+
if (typeof rowOrIdOrIndex === "number") {
|
|
749
|
+
if (rowOrIdOrIndex < 0 || rowOrIdOrIndex >= this.table.rows.length) {
|
|
750
|
+
return undefined;
|
|
751
|
+
}
|
|
752
|
+
// TypeScript is unable to narrow the types correctly here, hence the cast.
|
|
753
|
+
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
754
|
+
return this.table.rows[rowOrIdOrIndex];
|
|
755
|
+
}
|
|
756
|
+
const rowCache = this.#getRowCache();
|
|
757
|
+
if (typeof rowOrIdOrIndex === "string") {
|
|
758
|
+
return rowCache.get(rowOrIdOrIndex);
|
|
759
|
+
}
|
|
760
|
+
// If the user provided a node, ensure it actually exists in this table.
|
|
761
|
+
const cached = rowCache.get(rowOrIdOrIndex.id);
|
|
762
|
+
return cached === rowOrIdOrIndex ? rowOrIdOrIndex : undefined;
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* Attempts to resolve the provided Row node, ID, or index to a Row node in the table.
|
|
766
|
+
* @throws Throws a `UsageError` if there is no match.
|
|
767
|
+
* @remarks Searches for a match based strictly on the ID and returns that result.
|
|
768
|
+
*/
|
|
769
|
+
#getRow(rowOrIdOrIndex) {
|
|
770
|
+
const row = this.#tryGetRow(rowOrIdOrIndex);
|
|
771
|
+
if (row === undefined) {
|
|
772
|
+
_a._throwMissingRowError(rowOrIdOrIndex);
|
|
773
|
+
}
|
|
774
|
+
return row;
|
|
775
|
+
}
|
|
776
|
+
/**
|
|
777
|
+
* Validates the provided list of new columns being inserted into the table.
|
|
778
|
+
* @throws Throws a `UsageError` if any of the following conditions are met:
|
|
779
|
+
* - A column with a duplicate ID is being inserted.
|
|
780
|
+
*/
|
|
781
|
+
#validateNewColumns(newColumns) {
|
|
782
|
+
return _a._validateNewColumns(newColumns, this.#getColumnCache());
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* Validates the provided list of new rows being inserted into the table.
|
|
786
|
+
* @throws Throws a `UsageError` if any of the following conditions are met:
|
|
787
|
+
* - A row with a duplicate ID is being inserted.
|
|
788
|
+
* - A row is being inserted that contains cells for columns that do not exist in the table.
|
|
789
|
+
*/
|
|
790
|
+
#validateNewRows(newRows) {
|
|
791
|
+
return _a._validateNewRows(newRows, this.#getRowCache(), this.#getColumnCache());
|
|
792
|
+
}
|
|
618
793
|
/**
|
|
619
794
|
* Validates the provided list of new columns being inserted into the table.
|
|
620
795
|
* @throws Throws a `UsageError` if any of the following conditions are met:
|
|
@@ -680,148 +855,7 @@ export var System_TableSchema;
|
|
|
680
855
|
throw new UsageError(`The specified row node with ID "${rowOrIdOrIndex.id}" does not exist in the table.`);
|
|
681
856
|
}
|
|
682
857
|
}
|
|
683
|
-
_a = Table
|
|
684
|
-
const { applyEdits, preconditions, preconditionsOnRevert } = options;
|
|
685
|
-
const context = TreeAlpha.context(this);
|
|
686
|
-
// Ensure events are paused until all of the edits are applied.
|
|
687
|
-
// This ensures that the user sees the corresponding table-level edit as atomic,
|
|
688
|
-
// and ensures they are not spammed with intermediate events.
|
|
689
|
-
withBufferedTreeEvents(() => {
|
|
690
|
-
if (context.isView()) {
|
|
691
|
-
context.runTransaction(() => {
|
|
692
|
-
applyEdits();
|
|
693
|
-
if (preconditionsOnRevert !== undefined) {
|
|
694
|
-
return { preconditionsOnRevert };
|
|
695
|
-
}
|
|
696
|
-
}, preconditions === undefined ? undefined : { preconditions });
|
|
697
|
-
}
|
|
698
|
-
else {
|
|
699
|
-
// If this node does not have a corresponding view, then it is unhydrated.
|
|
700
|
-
// I.e., it is not part of a collaborative session yet.
|
|
701
|
-
// Therefore, we don't need to run the edits as a transaction.
|
|
702
|
-
applyEdits();
|
|
703
|
-
}
|
|
704
|
-
});
|
|
705
|
-
}, _Table_buildColumnInDocumentConstraintsForRows = function _Table_buildColumnInDocumentConstraintsForRows(rows) {
|
|
706
|
-
if (!TreeAlpha.context(this).isView()) {
|
|
707
|
-
return undefined;
|
|
708
|
-
}
|
|
709
|
-
const referencedColumnIds = new Set();
|
|
710
|
-
for (const row of rows) {
|
|
711
|
-
// `cells` is intentionally hidden on the public row type, so cast to read it.
|
|
712
|
-
const cells = row.cells;
|
|
713
|
-
if (cells === undefined) {
|
|
714
|
-
continue;
|
|
715
|
-
}
|
|
716
|
-
for (const id of Object.keys(cells)) {
|
|
717
|
-
referencedColumnIds.add(id);
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
if (referencedColumnIds.size === 0) {
|
|
721
|
-
return undefined;
|
|
722
|
-
}
|
|
723
|
-
const columnCache = __classPrivateFieldGet(this, _Table_instances, "m", _Table_getColumnCache).call(this);
|
|
724
|
-
const constraints = [];
|
|
725
|
-
for (const id of referencedColumnIds) {
|
|
726
|
-
const column = columnCache.get(id) ?? fail(0xd05 /* Column ID not found in cache */);
|
|
727
|
-
constraints.push({ type: "nodeInDocument", node: column });
|
|
728
|
-
}
|
|
729
|
-
assert(constraints.length > 0, 0xd06 /* No constraints generated for column references. */);
|
|
730
|
-
return constraints;
|
|
731
|
-
}, _Table_getColumnCache = function _Table_getColumnCache() {
|
|
732
|
-
let cache = __classPrivateFieldGet(this, _Table_columnCache, "f");
|
|
733
|
-
if (cache === undefined) {
|
|
734
|
-
cache = new Map();
|
|
735
|
-
for (const column of this.table.columns) {
|
|
736
|
-
// TypeScript is unable to narrow array element types correctly here.
|
|
737
|
-
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
738
|
-
cache.set(column.id, column);
|
|
739
|
-
}
|
|
740
|
-
__classPrivateFieldSet(this, _Table_columnCache, cache, "f");
|
|
741
|
-
// Register the invalidation listener once. The `nodeChanged` event fires on the
|
|
742
|
-
// array node itself after any structural change (insert / remove / move), which is
|
|
743
|
-
// exactly the set of changes that can alter the ID → node mapping.
|
|
744
|
-
if (__classPrivateFieldGet(this, _Table_columnCacheUnsubscribe, "f") === undefined) {
|
|
745
|
-
__classPrivateFieldSet(this, _Table_columnCacheUnsubscribe, Tree.on(this.columns, "nodeChanged", () => {
|
|
746
|
-
__classPrivateFieldSet(this, _Table_columnCache, undefined, "f");
|
|
747
|
-
}), "f");
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
return cache;
|
|
751
|
-
}, _Table_tryGetColumnId = function _Table_tryGetColumnId(columnOrIdOrIndex) {
|
|
752
|
-
if (typeof columnOrIdOrIndex === "string") {
|
|
753
|
-
return columnOrIdOrIndex;
|
|
754
|
-
}
|
|
755
|
-
return __classPrivateFieldGet(this, _Table_instances, "m", _Table_tryGetColumn).call(this, columnOrIdOrIndex)?.id;
|
|
756
|
-
}, _Table_tryGetColumn = function _Table_tryGetColumn(columnOrIdOrIndex) {
|
|
757
|
-
if (typeof columnOrIdOrIndex === "number") {
|
|
758
|
-
if (columnOrIdOrIndex < 0 || columnOrIdOrIndex >= this.table.columns.length) {
|
|
759
|
-
return undefined;
|
|
760
|
-
}
|
|
761
|
-
// TypeScript is unable to narrow the types correctly here, hence the cast.
|
|
762
|
-
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
763
|
-
return this.table.columns[columnOrIdOrIndex];
|
|
764
|
-
}
|
|
765
|
-
const columnCache = __classPrivateFieldGet(this, _Table_instances, "m", _Table_getColumnCache).call(this);
|
|
766
|
-
if (typeof columnOrIdOrIndex === "string") {
|
|
767
|
-
return columnCache.get(columnOrIdOrIndex);
|
|
768
|
-
}
|
|
769
|
-
// If the user provided a node, ensure it actually exists in this table.
|
|
770
|
-
const cached = columnCache.get(columnOrIdOrIndex.id);
|
|
771
|
-
return cached === columnOrIdOrIndex ? columnOrIdOrIndex : undefined;
|
|
772
|
-
}, _Table_getColumn = function _Table_getColumn(columnOrIdOrIndex) {
|
|
773
|
-
const column = __classPrivateFieldGet(this, _Table_instances, "m", _Table_tryGetColumn).call(this, columnOrIdOrIndex);
|
|
774
|
-
if (column === undefined) {
|
|
775
|
-
_a._throwMissingColumnError(columnOrIdOrIndex);
|
|
776
|
-
}
|
|
777
|
-
return column;
|
|
778
|
-
}, _Table_getRowCache = function _Table_getRowCache() {
|
|
779
|
-
let cache = __classPrivateFieldGet(this, _Table_rowCache, "f");
|
|
780
|
-
if (cache === undefined) {
|
|
781
|
-
cache = new Map();
|
|
782
|
-
for (const row of this.table.rows) {
|
|
783
|
-
// TypeScript is unable to narrow array element types correctly here.
|
|
784
|
-
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
785
|
-
cache.set(row.id, row);
|
|
786
|
-
}
|
|
787
|
-
__classPrivateFieldSet(this, _Table_rowCache, cache, "f");
|
|
788
|
-
// Register the invalidation listener once. The `nodeChanged` event fires on the
|
|
789
|
-
// array node itself after any structural change (insert / remove / move), which is
|
|
790
|
-
// exactly the set of changes that can alter the ID → node mapping.
|
|
791
|
-
if (__classPrivateFieldGet(this, _Table_rowCacheUnsubscribe, "f") === undefined) {
|
|
792
|
-
__classPrivateFieldSet(this, _Table_rowCacheUnsubscribe, Tree.on(this.rows, "nodeChanged", () => {
|
|
793
|
-
__classPrivateFieldSet(this, _Table_rowCache, undefined, "f");
|
|
794
|
-
}), "f");
|
|
795
|
-
}
|
|
796
|
-
}
|
|
797
|
-
return cache;
|
|
798
|
-
}, _Table_tryGetRow = function _Table_tryGetRow(rowOrIdOrIndex) {
|
|
799
|
-
if (typeof rowOrIdOrIndex === "number") {
|
|
800
|
-
if (rowOrIdOrIndex < 0 || rowOrIdOrIndex >= this.table.rows.length) {
|
|
801
|
-
return undefined;
|
|
802
|
-
}
|
|
803
|
-
// TypeScript is unable to narrow the types correctly here, hence the cast.
|
|
804
|
-
// See: https://github.com/microsoft/TypeScript/issues/52144
|
|
805
|
-
return this.table.rows[rowOrIdOrIndex];
|
|
806
|
-
}
|
|
807
|
-
const rowCache = __classPrivateFieldGet(this, _Table_instances, "m", _Table_getRowCache).call(this);
|
|
808
|
-
if (typeof rowOrIdOrIndex === "string") {
|
|
809
|
-
return rowCache.get(rowOrIdOrIndex);
|
|
810
|
-
}
|
|
811
|
-
// If the user provided a node, ensure it actually exists in this table.
|
|
812
|
-
const cached = rowCache.get(rowOrIdOrIndex.id);
|
|
813
|
-
return cached === rowOrIdOrIndex ? rowOrIdOrIndex : undefined;
|
|
814
|
-
}, _Table_getRow = function _Table_getRow(rowOrIdOrIndex) {
|
|
815
|
-
const row = __classPrivateFieldGet(this, _Table_instances, "m", _Table_tryGetRow).call(this, rowOrIdOrIndex);
|
|
816
|
-
if (row === undefined) {
|
|
817
|
-
_a._throwMissingRowError(rowOrIdOrIndex);
|
|
818
|
-
}
|
|
819
|
-
return row;
|
|
820
|
-
}, _Table_validateNewColumns = function _Table_validateNewColumns(newColumns) {
|
|
821
|
-
return _a._validateNewColumns(newColumns, __classPrivateFieldGet(this, _Table_instances, "m", _Table_getColumnCache).call(this));
|
|
822
|
-
}, _Table_validateNewRows = function _Table_validateNewRows(newRows) {
|
|
823
|
-
return _a._validateNewRows(newRows, __classPrivateFieldGet(this, _Table_instances, "m", _Table_getRowCache).call(this), __classPrivateFieldGet(this, _Table_instances, "m", _Table_getColumnCache).call(this));
|
|
824
|
-
};
|
|
858
|
+
_a = Table;
|
|
825
859
|
// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly "__#124291@#brand": unknown;`
|
|
826
860
|
// for the private brand field of TreeNode.
|
|
827
861
|
// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.
|