@fluidframework/tree 2.117.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1275) hide show
  1. package/CHANGELOG.md +385 -7
  2. package/README.md +55 -52
  3. package/{api-extractor.json → api-extractor/api-extractor-model.json} +1 -1
  4. package/api-report/tree.alpha.api.md +174 -146
  5. package/api-report/tree.beta.api.md +160 -91
  6. package/api-report/tree.legacy.beta.api.md +160 -91
  7. package/api-report/tree.legacy.public.api.md +26 -43
  8. package/api-report/tree.public.api.md +26 -43
  9. package/dist/api.d.ts +9 -1
  10. package/dist/api.d.ts.map +1 -1
  11. package/dist/api.js +2 -3
  12. package/dist/api.js.map +1 -1
  13. package/dist/codec/codec.d.ts +2 -2
  14. package/dist/codec/codec.d.ts.map +1 -1
  15. package/dist/codec/codec.js +9 -7
  16. package/dist/codec/codec.js.map +1 -1
  17. package/dist/codec/discriminatedUnions.js +1 -0
  18. package/dist/codec/discriminatedUnions.js.map +1 -1
  19. package/dist/codec/versioned/codec.d.ts.map +1 -1
  20. package/dist/codec/versioned/codec.js +4 -2
  21. package/dist/codec/versioned/codec.js.map +1 -1
  22. package/dist/componentApi.d.ts.map +1 -1
  23. package/dist/componentApi.js +20 -17
  24. package/dist/componentApi.js.map +1 -1
  25. package/dist/core/change-family/editBuilder.js +1 -0
  26. package/dist/core/change-family/editBuilder.js.map +1 -1
  27. package/dist/core/forest/editableForest.js +1 -2
  28. package/dist/core/forest/editableForest.js.map +1 -1
  29. package/dist/core/forest/forest.js +3 -3
  30. package/dist/core/forest/forest.js.map +1 -1
  31. package/dist/core/index.d.ts +2 -2
  32. package/dist/core/index.d.ts.map +1 -1
  33. package/dist/core/index.js +9 -5
  34. package/dist/core/index.js.map +1 -1
  35. package/dist/core/rebase/changeRebaser.js +5 -5
  36. package/dist/core/rebase/changeRebaser.js.map +1 -1
  37. package/dist/core/rebase/index.d.ts +1 -1
  38. package/dist/core/rebase/index.d.ts.map +1 -1
  39. package/dist/core/rebase/index.js +2 -1
  40. package/dist/core/rebase/index.js.map +1 -1
  41. package/dist/core/rebase/revisionTagCodec.d.ts +1 -1
  42. package/dist/core/rebase/revisionTagCodec.d.ts.map +1 -1
  43. package/dist/core/rebase/revisionTagCodec.js +3 -1
  44. package/dist/core/rebase/revisionTagCodec.js.map +1 -1
  45. package/dist/core/rebase/types.d.ts +12 -1
  46. package/dist/core/rebase/types.d.ts.map +1 -1
  47. package/dist/core/rebase/types.js +19 -15
  48. package/dist/core/rebase/types.js.map +1 -1
  49. package/dist/core/rebase/utils.js +9 -10
  50. package/dist/core/rebase/utils.js.map +1 -1
  51. package/dist/core/schema-stored/schema.js +9 -4
  52. package/dist/core/schema-stored/schema.js.map +1 -1
  53. package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  54. package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  55. package/dist/core/schema-stored/storedSchemaRepository.js +6 -4
  56. package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
  57. package/dist/core/tree/anchorSet.d.ts +1 -1
  58. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  59. package/dist/core/tree/anchorSet.js +62 -55
  60. package/dist/core/tree/anchorSet.js.map +1 -1
  61. package/dist/core/tree/chunk.js +2 -2
  62. package/dist/core/tree/chunk.js.map +1 -1
  63. package/dist/core/tree/cursor.js +12 -12
  64. package/dist/core/tree/cursor.js.map +1 -1
  65. package/dist/core/tree/deltaUtil.d.ts +34 -9
  66. package/dist/core/tree/deltaUtil.d.ts.map +1 -1
  67. package/dist/core/tree/deltaUtil.js +51 -17
  68. package/dist/core/tree/deltaUtil.js.map +1 -1
  69. package/dist/core/tree/detachedFieldIndex.js +23 -21
  70. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  71. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +10 -10
  72. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  73. package/dist/core/tree/detachedFieldIndexCodecCommon.js +1 -2
  74. package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  75. package/dist/core/tree/detachedFieldIndexCodecV1.js +3 -2
  76. package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  77. package/dist/core/tree/detachedFieldIndexCodecV2.js +3 -2
  78. package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  79. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +3 -3
  80. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  81. package/dist/core/tree/detachedFieldIndexFormatV1.d.ts +1 -1
  82. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
  83. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  84. package/dist/core/tree/index.d.ts +1 -1
  85. package/dist/core/tree/index.d.ts.map +1 -1
  86. package/dist/core/tree/index.js +7 -4
  87. package/dist/core/tree/index.js.map +1 -1
  88. package/dist/core/tree/mapTree.js +1 -2
  89. package/dist/core/tree/mapTree.js.map +1 -1
  90. package/dist/core/tree/pathTree.js +7 -8
  91. package/dist/core/tree/pathTree.js.map +1 -1
  92. package/dist/core/tree/persistedTreeTextFormat.d.ts +4 -4
  93. package/dist/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  94. package/dist/core/tree/sparseTree.js +17 -13
  95. package/dist/core/tree/sparseTree.js.map +1 -1
  96. package/dist/core/tree/treeTextFormat.js +4 -5
  97. package/dist/core/tree/treeTextFormat.js.map +1 -1
  98. package/dist/core/tree/types.js +3 -3
  99. package/dist/core/tree/types.js.map +1 -1
  100. package/dist/core/tree/visitDelta.js +1 -2
  101. package/dist/core/tree/visitDelta.js.map +1 -1
  102. package/dist/core/tree/visitorUtils.js +5 -6
  103. package/dist/core/tree/visitorUtils.js.map +1 -1
  104. package/dist/entrypoints/alpha.d.ts +1 -1
  105. package/dist/entrypoints/alpha.d.ts.map +1 -1
  106. package/dist/entrypoints/alpha.js +6 -4
  107. package/dist/entrypoints/alpha.js.map +1 -1
  108. package/dist/entrypoints/beta.d.ts +1 -1
  109. package/dist/entrypoints/beta.d.ts.map +1 -1
  110. package/dist/entrypoints/beta.js +2 -2
  111. package/dist/entrypoints/beta.js.map +1 -1
  112. package/dist/entrypoints/legacy.d.ts +1 -1
  113. package/dist/entrypoints/legacy.d.ts.map +1 -1
  114. package/dist/entrypoints/legacy.js +2 -2
  115. package/dist/entrypoints/legacy.js.map +1 -1
  116. package/dist/entrypoints/public.d.ts +1 -1
  117. package/dist/entrypoints/public.d.ts.map +1 -1
  118. package/dist/entrypoints/public.js +1 -2
  119. package/dist/entrypoints/public.js.map +1 -1
  120. package/dist/extensibleUnionNode.d.ts.map +1 -1
  121. package/dist/extensibleUnionNode.js +1 -1
  122. package/dist/extensibleUnionNode.js.map +1 -1
  123. package/dist/feature-libraries/changeAtomIdBTree.js +3 -4
  124. package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -1
  125. package/dist/feature-libraries/changeAtomIdCodec.js +1 -2
  126. package/dist/feature-libraries/changeAtomIdCodec.js.map +1 -1
  127. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  128. package/dist/feature-libraries/chunked-forest/basicChunk.js +14 -1
  129. package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  130. package/dist/feature-libraries/chunked-forest/chunkTree.js +28 -20
  131. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  132. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  133. package/dist/feature-libraries/chunked-forest/chunkedForest.js +22 -16
  134. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  135. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +9 -11
  136. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
  137. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +15 -7
  138. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  139. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +7 -3
  140. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  141. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +3 -2
  142. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  143. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  144. package/dist/feature-libraries/chunked-forest/codec/codecs.js +2 -0
  145. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  146. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +33 -17
  147. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  148. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts +2 -2
  149. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -1
  150. package/dist/feature-libraries/chunked-forest/codec/format/versions.js +2 -2
  151. package/dist/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -1
  152. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js +11 -2
  153. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  154. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +5 -6
  155. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  156. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +2 -3
  157. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  158. package/dist/feature-libraries/chunked-forest/sequenceChunk.js +1 -0
  159. package/dist/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
  160. package/dist/feature-libraries/chunked-forest/uniformChunk.js +73 -15
  161. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  162. package/dist/feature-libraries/comparison-forest/comparisonForest.js +79 -79
  163. package/dist/feature-libraries/comparison-forest/comparisonForest.js.map +1 -1
  164. package/dist/feature-libraries/cursorComparator.d.ts +8 -0
  165. package/dist/feature-libraries/cursorComparator.d.ts.map +1 -1
  166. package/dist/feature-libraries/cursorComparator.js +43 -10
  167. package/dist/feature-libraries/cursorComparator.js.map +1 -1
  168. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
  169. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  170. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +2 -2
  171. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  172. package/dist/feature-libraries/default-schema/mappedEditBuilder.js +2 -0
  173. package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  174. package/dist/feature-libraries/deltaUtils.js +2 -3
  175. package/dist/feature-libraries/deltaUtils.js.map +1 -1
  176. package/dist/feature-libraries/detachedFieldIndexSummarizer.js +2 -0
  177. package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  178. package/dist/feature-libraries/editableTreeBinder.js +1 -2
  179. package/dist/feature-libraries/editableTreeBinder.js.map +1 -1
  180. package/dist/feature-libraries/flex-tree/context.js +19 -3
  181. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  182. package/dist/feature-libraries/flex-tree/flexTreeTypes.js +2 -2
  183. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  184. package/dist/feature-libraries/flex-tree/lazyEntity.js +14 -14
  185. package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  186. package/dist/feature-libraries/flex-tree/lazyField.js +28 -30
  187. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  188. package/dist/feature-libraries/flex-tree/lazyNode.js +24 -23
  189. package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  190. package/dist/feature-libraries/flex-tree/observer.js +2 -2
  191. package/dist/feature-libraries/flex-tree/observer.js.map +1 -1
  192. package/dist/feature-libraries/flex-tree/utilities.js +5 -5
  193. package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
  194. package/dist/feature-libraries/forest-summary/forestSummarizer.js +122 -117
  195. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  196. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +49 -32
  197. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  198. package/dist/feature-libraries/forest-summary/summaryTypes.js +2 -3
  199. package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -1
  200. package/dist/feature-libraries/index.d.ts +1 -1
  201. package/dist/feature-libraries/index.js.map +1 -1
  202. package/dist/feature-libraries/indexing/anchorTreeIndex.js +35 -31
  203. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  204. package/dist/feature-libraries/mapTreeCursor.js +6 -7
  205. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  206. package/dist/feature-libraries/mitigatedChangeFamily.js +2 -3
  207. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  208. package/dist/feature-libraries/modular-schema/comparison.js +6 -7
  209. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  210. package/dist/feature-libraries/modular-schema/crossFieldQueries.js +4 -4
  211. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  212. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js +14 -12
  213. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
  214. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +63 -10
  215. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  216. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js +3 -3
  217. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  218. package/dist/feature-libraries/modular-schema/fieldKind.js +10 -0
  219. package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  220. package/dist/feature-libraries/modular-schema/filterEdits.d.ts +13 -0
  221. package/dist/feature-libraries/modular-schema/filterEdits.d.ts.map +1 -0
  222. package/dist/feature-libraries/modular-schema/filterEdits.js +51 -0
  223. package/dist/feature-libraries/modular-schema/filterEdits.js.map +1 -0
  224. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  225. package/dist/feature-libraries/modular-schema/genericFieldKind.js +7 -4
  226. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  227. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js +1 -2
  228. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  229. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +2 -2
  230. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
  231. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js +1 -2
  232. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
  233. package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
  234. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  235. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  236. package/dist/feature-libraries/modular-schema/invert.d.ts +1 -1
  237. package/dist/feature-libraries/modular-schema/invert.d.ts.map +1 -1
  238. package/dist/feature-libraries/modular-schema/invert.js +5 -30
  239. package/dist/feature-libraries/modular-schema/invert.js.map +1 -1
  240. package/dist/feature-libraries/modular-schema/isNeverTree.js +4 -5
  241. package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  242. package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts +5 -7
  243. package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
  244. package/dist/feature-libraries/modular-schema/minimizeModularChange.js +459 -10
  245. package/dist/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
  246. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +14 -15
  247. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  248. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -2
  249. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  250. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +2 -2
  251. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  252. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -10
  253. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  254. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +30 -97
  255. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  256. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +9 -9
  257. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  258. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +4 -4
  259. package/dist/feature-libraries/modular-schema/modularChangeTypes.js +1 -2
  260. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  261. package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts +13 -1
  262. package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -1
  263. package/dist/feature-libraries/modular-schema/modularChangeUtils.js +115 -12
  264. package/dist/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -1
  265. package/dist/feature-libraries/modular-schema/prune.d.ts +2 -3
  266. package/dist/feature-libraries/modular-schema/prune.d.ts.map +1 -1
  267. package/dist/feature-libraries/modular-schema/prune.js +25 -8
  268. package/dist/feature-libraries/modular-schema/prune.js.map +1 -1
  269. package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -3
  270. package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
  271. package/dist/feature-libraries/node-identifier/nodeIdentifier.js +2 -2
  272. package/dist/feature-libraries/node-identifier/nodeIdentifier.js.map +1 -1
  273. package/dist/feature-libraries/node-identifier/nodeIdentifierManager.js +3 -3
  274. package/dist/feature-libraries/node-identifier/nodeIdentifierManager.js.map +1 -1
  275. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  276. package/dist/feature-libraries/object-forest/objectForest.js +274 -267
  277. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  278. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  279. package/dist/feature-libraries/optional-field/optionalField.js +27 -35
  280. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  281. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +7 -7
  282. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
  283. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +8 -8
  284. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
  285. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +1 -2
  286. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  287. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  288. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +1 -2
  289. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  290. package/dist/feature-libraries/schema-index/schemaSummarizer.js +3 -0
  291. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  292. package/dist/feature-libraries/schemaChecker.d.ts +9 -19
  293. package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
  294. package/dist/feature-libraries/schemaChecker.js +135 -51
  295. package/dist/feature-libraries/schemaChecker.js.map +1 -1
  296. package/dist/feature-libraries/sequence-field/compose.js +8 -2
  297. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  298. package/dist/feature-libraries/sequence-field/filterEdits.d.ts +3 -3
  299. package/dist/feature-libraries/sequence-field/filterEdits.d.ts.map +1 -1
  300. package/dist/feature-libraries/sequence-field/filterEdits.js +29 -11
  301. package/dist/feature-libraries/sequence-field/filterEdits.js.map +1 -1
  302. package/dist/feature-libraries/sequence-field/formatV1.d.ts +102 -102
  303. package/dist/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
  304. package/dist/feature-libraries/sequence-field/formatV2.d.ts +79 -79
  305. package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  306. package/dist/feature-libraries/sequence-field/formatV3.d.ts +56 -56
  307. package/dist/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
  308. package/dist/feature-libraries/sequence-field/invert.js +1 -2
  309. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  310. package/dist/feature-libraries/sequence-field/markListFactory.js +3 -4
  311. package/dist/feature-libraries/sequence-field/markListFactory.js.map +1 -1
  312. package/dist/feature-libraries/sequence-field/markQueue.js +4 -2
  313. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  314. package/dist/feature-libraries/sequence-field/moveEffectTable.js +9 -9
  315. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  316. package/dist/feature-libraries/sequence-field/prune.js +1 -2
  317. package/dist/feature-libraries/sequence-field/prune.js.map +1 -1
  318. package/dist/feature-libraries/sequence-field/rebase.js +7 -2
  319. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  320. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +1 -2
  321. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
  322. package/dist/feature-libraries/sequence-field/replaceRevisions.js +1 -2
  323. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  324. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +2 -3
  325. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  326. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +1 -2
  327. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  328. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  329. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +9 -9
  330. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  331. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +1 -2
  332. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  333. package/dist/feature-libraries/sequence-field/utils.d.ts +2 -2
  334. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  335. package/dist/feature-libraries/sequence-field/utils.js +54 -67
  336. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  337. package/dist/feature-libraries/treeCursorUtils.js +19 -15
  338. package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
  339. package/dist/feature-libraries/treeTextCursor.js +8 -8
  340. package/dist/feature-libraries/treeTextCursor.js.map +1 -1
  341. package/dist/feature-libraries/valueUtilities.js +4 -5
  342. package/dist/feature-libraries/valueUtilities.js.map +1 -1
  343. package/dist/index.d.ts +4 -29
  344. package/dist/index.d.ts.map +1 -1
  345. package/dist/index.js +6 -9
  346. package/dist/index.js.map +1 -1
  347. package/dist/internalTypes.d.ts +1 -1
  348. package/dist/internalTypes.d.ts.map +1 -1
  349. package/dist/internalTypes.js.map +1 -1
  350. package/dist/packageVersion.d.ts +1 -1
  351. package/dist/packageVersion.d.ts.map +1 -1
  352. package/dist/packageVersion.js +1 -1
  353. package/dist/packageVersion.js.map +1 -1
  354. package/dist/serializableDomainSchema.d.ts +1 -1
  355. package/dist/shared-tree/history.d.ts.map +1 -1
  356. package/dist/shared-tree/history.js +32 -13
  357. package/dist/shared-tree/history.js.map +1 -1
  358. package/dist/shared-tree/independentView.d.ts +27 -3
  359. package/dist/shared-tree/independentView.d.ts.map +1 -1
  360. package/dist/shared-tree/independentView.js +36 -7
  361. package/dist/shared-tree/independentView.js.map +1 -1
  362. package/dist/shared-tree/index.d.ts +2 -1
  363. package/dist/shared-tree/index.d.ts.map +1 -1
  364. package/dist/shared-tree/index.js +6 -2
  365. package/dist/shared-tree/index.js.map +1 -1
  366. package/dist/shared-tree/isAuditableFromOutcome.js +1 -2
  367. package/dist/shared-tree/isAuditableFromOutcome.js.map +1 -1
  368. package/dist/shared-tree/schematizeTree.js +3 -4
  369. package/dist/shared-tree/schematizeTree.js.map +1 -1
  370. package/dist/shared-tree/schematizingTreeView.d.ts +14 -4
  371. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  372. package/dist/shared-tree/schematizingTreeView.js +107 -37
  373. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  374. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  375. package/dist/shared-tree/sharedTree.js +28 -19
  376. package/dist/shared-tree/sharedTree.js.map +1 -1
  377. package/dist/shared-tree/sharedTreeChangeCodecs.js +3 -3
  378. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  379. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  380. package/dist/shared-tree/sharedTreeChangeEnricher.js +12 -4
  381. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  382. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  383. package/dist/shared-tree/sharedTreeChangeFamily.js +11 -8
  384. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  385. package/dist/shared-tree/sharedTreeChangeFormat.js +2 -3
  386. package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  387. package/dist/shared-tree/sharedTreeEditBuilder.js +2 -0
  388. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  389. package/dist/shared-tree/transactionMinimize.d.ts.map +1 -1
  390. package/dist/shared-tree/transactionMinimize.js +2 -1
  391. package/dist/shared-tree/transactionMinimize.js.map +1 -1
  392. package/dist/shared-tree/transactionPostProcessor.js +2 -3
  393. package/dist/shared-tree/transactionPostProcessor.js.map +1 -1
  394. package/dist/shared-tree/tree.js +2 -2
  395. package/dist/shared-tree/tree.js.map +1 -1
  396. package/dist/shared-tree/treeAlpha.d.ts +5 -16
  397. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  398. package/dist/shared-tree/treeAlpha.js +18 -11
  399. package/dist/shared-tree/treeAlpha.js.map +1 -1
  400. package/{lib/simple-tree/api → dist/shared-tree}/treeBeta.d.ts +8 -65
  401. package/dist/shared-tree/treeBeta.d.ts.map +1 -0
  402. package/dist/shared-tree/treeBeta.js +70 -0
  403. package/dist/shared-tree/treeBeta.js.map +1 -0
  404. package/dist/shared-tree/treeCheckout.d.ts +5 -0
  405. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  406. package/dist/shared-tree/treeCheckout.js +986 -907
  407. package/dist/shared-tree/treeCheckout.js.map +1 -1
  408. package/dist/shared-tree/unhydratedTreeContext.js +3 -4
  409. package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
  410. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  411. package/dist/shared-tree-core/branch.js +24 -20
  412. package/dist/shared-tree-core/branch.js.map +1 -1
  413. package/dist/shared-tree-core/branchCommitCounter.js +35 -32
  414. package/dist/shared-tree-core/branchCommitCounter.js.map +1 -1
  415. package/dist/shared-tree-core/branchCommitEnricher.js +9 -8
  416. package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
  417. package/dist/shared-tree-core/branchIdCodec.js +2 -3
  418. package/dist/shared-tree-core/branchIdCodec.js.map +1 -1
  419. package/dist/shared-tree-core/customMetadataCodec.js +2 -3
  420. package/dist/shared-tree-core/customMetadataCodec.js.map +1 -1
  421. package/dist/shared-tree-core/customMetadataFormat.d.ts.map +1 -1
  422. package/dist/shared-tree-core/defaultResubmitMachine.js +11 -9
  423. package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  424. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  425. package/dist/shared-tree-core/editManager.js +73 -44
  426. package/dist/shared-tree-core/editManager.js.map +1 -1
  427. package/dist/shared-tree-core/editManagerCodecs.js +3 -3
  428. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  429. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
  430. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  431. package/dist/shared-tree-core/editManagerCodecsCommons.js +33 -36
  432. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  433. package/dist/shared-tree-core/editManagerCodecsV1toV4.js +1 -2
  434. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  435. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -2
  436. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  437. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +11 -11
  438. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  439. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +5 -4
  440. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  441. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +10 -9
  442. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  443. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  444. package/dist/shared-tree-core/editManagerSummarizer.js +6 -1
  445. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  446. package/dist/shared-tree-core/messageCodecV1ToV4.js +1 -2
  447. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  448. package/dist/shared-tree-core/messageCodecVSharedBranches.js +1 -2
  449. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  450. package/dist/shared-tree-core/messageCodecs.js +3 -3
  451. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  452. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
  453. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  454. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts +3 -2
  455. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  456. package/dist/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  457. package/dist/shared-tree-core/sharedTreeCore.js +44 -22
  458. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  459. package/dist/shared-tree-core/summaryTypes.js +2 -2
  460. package/dist/shared-tree-core/summaryTypes.js.map +1 -1
  461. package/dist/shared-tree-core/transaction.js +36 -39
  462. package/dist/shared-tree-core/transaction.js.map +1 -1
  463. package/dist/shared-tree-core/versionedSummarizer.js +4 -0
  464. package/dist/shared-tree-core/versionedSummarizer.js.map +1 -1
  465. package/dist/simple-tree/api/cloneTree.d.ts +11 -0
  466. package/dist/simple-tree/api/cloneTree.d.ts.map +1 -0
  467. package/dist/simple-tree/api/cloneTree.js +31 -0
  468. package/dist/simple-tree/api/cloneTree.js.map +1 -0
  469. package/dist/simple-tree/api/conciseTree.js +2 -3
  470. package/dist/simple-tree/api/conciseTree.js.map +1 -1
  471. package/dist/simple-tree/api/configuration.d.ts +4 -4
  472. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  473. package/dist/simple-tree/api/configuration.js +21 -2
  474. package/dist/simple-tree/api/configuration.js.map +1 -1
  475. package/dist/simple-tree/api/create.js +2 -3
  476. package/dist/simple-tree/api/create.js.map +1 -1
  477. package/dist/simple-tree/api/customTree.js +6 -6
  478. package/dist/simple-tree/api/customTree.js.map +1 -1
  479. package/dist/simple-tree/api/dirtyIndex.js +1 -2
  480. package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
  481. package/dist/simple-tree/api/discrepancies.d.ts +36 -3
  482. package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
  483. package/dist/simple-tree/api/discrepancies.js +42 -17
  484. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  485. package/dist/simple-tree/api/eraseSchemaDetails.js +2 -3
  486. package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  487. package/dist/simple-tree/api/getJsonSchema.js +1 -2
  488. package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
  489. package/dist/simple-tree/api/getSimpleSchema.js +1 -2
  490. package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
  491. package/dist/simple-tree/api/identifierIndex.js +1 -2
  492. package/dist/simple-tree/api/identifierIndex.js.map +1 -1
  493. package/dist/simple-tree/api/incrementalAllowedTypes.js +2 -2
  494. package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  495. package/dist/simple-tree/api/index.d.ts +5 -4
  496. package/dist/simple-tree/api/index.d.ts.map +1 -1
  497. package/dist/simple-tree/api/index.js +5 -7
  498. package/dist/simple-tree/api/index.js.map +1 -1
  499. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +22 -3
  500. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  501. package/dist/simple-tree/api/schemaCompatibilityTester.js +140 -11
  502. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  503. package/dist/simple-tree/api/schemaCreationUtilities.d.ts +3 -7
  504. package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  505. package/dist/simple-tree/api/schemaCreationUtilities.js +6 -9
  506. package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  507. package/dist/simple-tree/api/schemaFactory.d.ts +4 -9
  508. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  509. package/dist/simple-tree/api/schemaFactory.js +13 -12
  510. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  511. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +20 -22
  512. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  513. package/dist/simple-tree/api/schemaFactoryAlpha.js +78 -81
  514. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  515. package/dist/simple-tree/api/schemaFactoryBeta.d.ts +7 -9
  516. package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  517. package/dist/simple-tree/api/schemaFactoryBeta.js +32 -35
  518. package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  519. package/dist/simple-tree/api/schemaFactoryRecursive.js +1 -2
  520. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  521. package/dist/simple-tree/api/schemaFromSimple.js +1 -2
  522. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  523. package/dist/simple-tree/api/schemaStatics.d.ts +7 -7
  524. package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
  525. package/dist/simple-tree/api/simpleSchemaCodec.js +2 -3
  526. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  527. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +2 -3
  528. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  529. package/dist/simple-tree/api/simpleTreeIndex.js +1 -2
  530. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  531. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +46 -2
  532. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  533. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +54 -12
  534. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  535. package/dist/simple-tree/api/storedSchema.js +2 -3
  536. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  537. package/dist/simple-tree/api/transactionTypes.d.ts +4 -4
  538. package/dist/simple-tree/api/transactionTypes.js.map +1 -1
  539. package/dist/simple-tree/api/tree.d.ts +243 -58
  540. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  541. package/dist/simple-tree/api/tree.js +3 -5
  542. package/dist/simple-tree/api/tree.js.map +1 -1
  543. package/dist/simple-tree/api/treeChangeEvents.d.ts +16 -4
  544. package/dist/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
  545. package/dist/simple-tree/api/treeChangeEvents.js.map +1 -1
  546. package/dist/simple-tree/api/treeChangeEventsBeta.d.ts +209 -0
  547. package/dist/simple-tree/api/treeChangeEventsBeta.d.ts.map +1 -0
  548. package/dist/simple-tree/api/{treeAlpha.js → treeChangeEventsBeta.js} +1 -1
  549. package/dist/simple-tree/api/treeChangeEventsBeta.js.map +1 -0
  550. package/dist/simple-tree/api/treeNodeApi.d.ts +1 -75
  551. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  552. package/dist/simple-tree/api/treeNodeApi.js +7 -7
  553. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  554. package/dist/simple-tree/api/typesUnsafe.d.ts +8 -6
  555. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  556. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  557. package/dist/simple-tree/api/verboseTree.js +5 -6
  558. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  559. package/dist/simple-tree/core/allowedTypes.js +22 -13
  560. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  561. package/dist/simple-tree/core/context.js +3 -0
  562. package/dist/simple-tree/core/context.js.map +1 -1
  563. package/dist/simple-tree/core/flexList.js +2 -3
  564. package/dist/simple-tree/core/flexList.js.map +1 -1
  565. package/dist/simple-tree/core/getOrCreateNode.js +2 -3
  566. package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
  567. package/dist/simple-tree/core/index.d.ts +1 -1
  568. package/dist/simple-tree/core/index.d.ts.map +1 -1
  569. package/dist/simple-tree/core/index.js +2 -2
  570. package/dist/simple-tree/core/index.js.map +1 -1
  571. package/dist/simple-tree/core/toStored.d.ts +7 -0
  572. package/dist/simple-tree/core/toStored.d.ts.map +1 -1
  573. package/dist/simple-tree/core/toStored.js.map +1 -1
  574. package/dist/simple-tree/core/treeNode.d.ts +3 -4
  575. package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
  576. package/dist/simple-tree/core/treeNode.js +31 -32
  577. package/dist/simple-tree/core/treeNode.js.map +1 -1
  578. package/dist/simple-tree/core/treeNodeKernel.js +194 -192
  579. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  580. package/dist/simple-tree/core/treeNodeSchema.js +3 -3
  581. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  582. package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  583. package/dist/simple-tree/core/treeNodeValid.js +25 -25
  584. package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
  585. package/dist/simple-tree/core/types.js +1 -2
  586. package/dist/simple-tree/core/types.js.map +1 -1
  587. package/dist/simple-tree/core/unhydratedFlexTree.js +177 -150
  588. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  589. package/dist/simple-tree/core/walkSchema.js +2 -3
  590. package/dist/simple-tree/core/walkSchema.js.map +1 -1
  591. package/dist/simple-tree/core/withType.d.ts +7 -9
  592. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  593. package/dist/simple-tree/core/withType.js +6 -7
  594. package/dist/simple-tree/core/withType.js.map +1 -1
  595. package/dist/simple-tree/createContext.js +2 -3
  596. package/dist/simple-tree/createContext.js.map +1 -1
  597. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  598. package/dist/simple-tree/fieldSchema.js +33 -15
  599. package/dist/simple-tree/fieldSchema.js.map +1 -1
  600. package/dist/simple-tree/getTreeNodeForField.js +1 -2
  601. package/dist/simple-tree/getTreeNodeForField.js.map +1 -1
  602. package/dist/simple-tree/index.d.ts +2 -2
  603. package/dist/simple-tree/index.d.ts.map +1 -1
  604. package/dist/simple-tree/index.js +6 -8
  605. package/dist/simple-tree/index.js.map +1 -1
  606. package/dist/simple-tree/leafNodeSchema.d.ts +1 -1
  607. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  608. package/dist/simple-tree/leafNodeSchema.js +18 -17
  609. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  610. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +3 -2
  611. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  612. package/dist/simple-tree/node-kinds/array/arrayNode.js +31 -33
  613. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  614. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  615. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js +2 -2
  616. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  617. package/dist/simple-tree/node-kinds/common.js +1 -2
  618. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  619. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +6 -6
  620. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  621. package/dist/simple-tree/node-kinds/map/mapNode.js +10 -16
  622. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  623. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  624. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js +2 -2
  625. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  626. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  627. package/dist/simple-tree/node-kinds/object/objectNode.js +27 -28
  628. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  629. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +1 -1
  630. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  631. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js +2 -2
  632. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  633. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  634. package/dist/simple-tree/node-kinds/record/recordNode.js +10 -13
  635. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  636. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -2
  637. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  638. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js +2 -2
  639. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  640. package/dist/simple-tree/prepareForInsertion.js +4 -5
  641. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  642. package/dist/simple-tree/toStoredSchema.js +11 -11
  643. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  644. package/dist/simple-tree/treeSchema.js +1 -2
  645. package/dist/simple-tree/treeSchema.js.map +1 -1
  646. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +3 -4
  647. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  648. package/dist/simple-tree/walkFieldSchema.js +1 -2
  649. package/dist/simple-tree/walkFieldSchema.js.map +1 -1
  650. package/dist/tableSchema.d.ts +2 -87
  651. package/dist/tableSchema.d.ts.map +1 -1
  652. package/dist/tableSchema.js +309 -275
  653. package/dist/tableSchema.js.map +1 -1
  654. package/dist/text/codePointUtils.d.ts +16 -3
  655. package/dist/text/codePointUtils.d.ts.map +1 -1
  656. package/dist/text/codePointUtils.js +24 -13
  657. package/dist/text/codePointUtils.js.map +1 -1
  658. package/dist/text/textDomain.d.ts +7 -1
  659. package/dist/text/textDomain.d.ts.map +1 -1
  660. package/dist/text/textDomain.js +32 -28
  661. package/dist/text/textDomain.js.map +1 -1
  662. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  663. package/dist/text/textDomainFormatted.js +45 -34
  664. package/dist/text/textDomainFormatted.js.map +1 -1
  665. package/dist/text/textDomainFormattedDefault.js +2 -5
  666. package/dist/text/textDomainFormattedDefault.js.map +1 -1
  667. package/dist/treeDataStore.js +2 -3
  668. package/dist/treeDataStore.js.map +1 -1
  669. package/dist/treeFactory.js +7 -7
  670. package/dist/treeFactory.js.map +1 -1
  671. package/dist/util/arrayUtilities.js +5 -6
  672. package/dist/util/arrayUtilities.js.map +1 -1
  673. package/dist/util/bTreeUtils.js +3 -4
  674. package/dist/util/bTreeUtils.js.map +1 -1
  675. package/dist/util/brand.js +6 -5
  676. package/dist/util/brand.js.map +1 -1
  677. package/dist/util/brandedMap.js +2 -3
  678. package/dist/util/brandedMap.js.map +1 -1
  679. package/dist/util/breakable.d.ts.map +1 -1
  680. package/dist/util/breakable.js +7 -4
  681. package/dist/util/breakable.js.map +1 -1
  682. package/dist/util/cloneWithReplacements.js +1 -2
  683. package/dist/util/cloneWithReplacements.js.map +1 -1
  684. package/dist/util/compressedIds.js +29 -7
  685. package/dist/util/compressedIds.js.map +1 -1
  686. package/dist/util/idAllocator.js +3 -3
  687. package/dist/util/idAllocator.js.map +1 -1
  688. package/dist/util/nestedMap.js +15 -17
  689. package/dist/util/nestedMap.js.map +1 -1
  690. package/dist/util/nestedSet.js +2 -3
  691. package/dist/util/nestedSet.js.map +1 -1
  692. package/dist/util/offsetList.js +2 -4
  693. package/dist/util/offsetList.js.map +1 -1
  694. package/dist/util/opaque.js +2 -3
  695. package/dist/util/opaque.js.map +1 -1
  696. package/dist/util/rangeMap.js +6 -2
  697. package/dist/util/rangeMap.js.map +1 -1
  698. package/dist/util/readSnapshotBlob.d.ts.map +1 -1
  699. package/dist/util/referenceCounting.js +1 -0
  700. package/dist/util/referenceCounting.js.map +1 -1
  701. package/dist/util/stackyIterator.js +3 -2
  702. package/dist/util/stackyIterator.js.map +1 -1
  703. package/dist/util/typeUtils.js +1 -2
  704. package/dist/util/typeUtils.js.map +1 -1
  705. package/dist/util/typeboxBrand.js +2 -3
  706. package/dist/util/typeboxBrand.js.map +1 -1
  707. package/dist/util/utils.d.ts +2 -2
  708. package/dist/util/utils.d.ts.map +1 -1
  709. package/dist/util/utils.js +32 -32
  710. package/dist/util/utils.js.map +1 -1
  711. package/lib/api.d.ts +9 -1
  712. package/lib/api.d.ts.map +1 -1
  713. package/lib/api.js.map +1 -1
  714. package/lib/codec/codec.d.ts +2 -2
  715. package/lib/codec/codec.d.ts.map +1 -1
  716. package/lib/codec/codec.js +2 -0
  717. package/lib/codec/codec.js.map +1 -1
  718. package/lib/codec/discriminatedUnions.js +1 -0
  719. package/lib/codec/discriminatedUnions.js.map +1 -1
  720. package/lib/codec/versioned/codec.d.ts.map +1 -1
  721. package/lib/codec/versioned/codec.js +2 -0
  722. package/lib/codec/versioned/codec.js.map +1 -1
  723. package/lib/componentApi.d.ts.map +1 -1
  724. package/lib/componentApi.js +20 -17
  725. package/lib/componentApi.js.map +1 -1
  726. package/lib/core/change-family/editBuilder.js +1 -0
  727. package/lib/core/change-family/editBuilder.js.map +1 -1
  728. package/lib/core/index.d.ts +2 -2
  729. package/lib/core/index.d.ts.map +1 -1
  730. package/lib/core/index.js +2 -2
  731. package/lib/core/index.js.map +1 -1
  732. package/lib/core/rebase/index.d.ts +1 -1
  733. package/lib/core/rebase/index.d.ts.map +1 -1
  734. package/lib/core/rebase/index.js +1 -1
  735. package/lib/core/rebase/index.js.map +1 -1
  736. package/lib/core/rebase/revisionTagCodec.js +3 -1
  737. package/lib/core/rebase/revisionTagCodec.js.map +1 -1
  738. package/lib/core/rebase/types.d.ts +12 -1
  739. package/lib/core/rebase/types.d.ts.map +1 -1
  740. package/lib/core/rebase/types.js +3 -0
  741. package/lib/core/rebase/types.js.map +1 -1
  742. package/lib/core/schema-stored/schema.js +5 -0
  743. package/lib/core/schema-stored/schema.js.map +1 -1
  744. package/lib/core/schema-stored/storedSchemaRepository.js +4 -2
  745. package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
  746. package/lib/core/tree/anchorSet.js +61 -54
  747. package/lib/core/tree/anchorSet.js.map +1 -1
  748. package/lib/core/tree/deltaUtil.d.ts +34 -9
  749. package/lib/core/tree/deltaUtil.d.ts.map +1 -1
  750. package/lib/core/tree/deltaUtil.js +41 -10
  751. package/lib/core/tree/deltaUtil.js.map +1 -1
  752. package/lib/core/tree/detachedFieldIndex.js +23 -21
  753. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  754. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +10 -10
  755. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  756. package/lib/core/tree/detachedFieldIndexCodecV1.js +2 -0
  757. package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  758. package/lib/core/tree/detachedFieldIndexCodecV2.js +2 -0
  759. package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  760. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +3 -3
  761. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  762. package/lib/core/tree/index.d.ts +1 -1
  763. package/lib/core/tree/index.d.ts.map +1 -1
  764. package/lib/core/tree/index.js +1 -1
  765. package/lib/core/tree/index.js.map +1 -1
  766. package/lib/core/tree/persistedTreeTextFormat.d.ts +4 -4
  767. package/lib/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  768. package/lib/core/tree/sparseTree.js +15 -11
  769. package/lib/core/tree/sparseTree.js.map +1 -1
  770. package/lib/entrypoints/alpha.d.ts +1 -1
  771. package/lib/entrypoints/alpha.d.ts.map +1 -1
  772. package/lib/entrypoints/alpha.js +1 -1
  773. package/lib/entrypoints/alpha.js.map +1 -1
  774. package/lib/entrypoints/beta.d.ts +1 -1
  775. package/lib/entrypoints/beta.d.ts.map +1 -1
  776. package/lib/entrypoints/beta.js +1 -1
  777. package/lib/entrypoints/beta.js.map +1 -1
  778. package/lib/entrypoints/legacy.d.ts +1 -1
  779. package/lib/entrypoints/legacy.d.ts.map +1 -1
  780. package/lib/entrypoints/legacy.js +1 -1
  781. package/lib/entrypoints/legacy.js.map +1 -1
  782. package/lib/entrypoints/public.d.ts +1 -1
  783. package/lib/entrypoints/public.d.ts.map +1 -1
  784. package/lib/entrypoints/public.js +1 -1
  785. package/lib/entrypoints/public.js.map +1 -1
  786. package/lib/extensibleUnionNode.d.ts.map +1 -1
  787. package/lib/extensibleUnionNode.js +2 -2
  788. package/lib/extensibleUnionNode.js.map +1 -1
  789. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  790. package/lib/feature-libraries/chunked-forest/basicChunk.js +14 -1
  791. package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  792. package/lib/feature-libraries/chunked-forest/chunkTree.js +14 -6
  793. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  794. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  795. package/lib/feature-libraries/chunked-forest/chunkedForest.js +18 -12
  796. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  797. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +1 -3
  798. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
  799. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +8 -0
  800. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  801. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +4 -0
  802. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  803. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +1 -0
  804. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  805. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  806. package/lib/feature-libraries/chunked-forest/codec/codecs.js +2 -0
  807. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  808. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +28 -12
  809. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  810. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts +2 -2
  811. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -1
  812. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js +9 -0
  813. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  814. package/lib/feature-libraries/chunked-forest/sequenceChunk.js +1 -0
  815. package/lib/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
  816. package/lib/feature-libraries/chunked-forest/uniformChunk.js +71 -13
  817. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  818. package/lib/feature-libraries/comparison-forest/comparisonForest.js +79 -79
  819. package/lib/feature-libraries/comparison-forest/comparisonForest.js.map +1 -1
  820. package/lib/feature-libraries/cursorComparator.d.ts +8 -0
  821. package/lib/feature-libraries/cursorComparator.d.ts.map +1 -1
  822. package/lib/feature-libraries/cursorComparator.js +43 -9
  823. package/lib/feature-libraries/cursorComparator.js.map +1 -1
  824. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +3 -0
  825. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  826. package/lib/feature-libraries/default-schema/mappedEditBuilder.js +2 -0
  827. package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  828. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +2 -0
  829. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  830. package/lib/feature-libraries/flex-tree/context.js +19 -3
  831. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  832. package/lib/feature-libraries/flex-tree/lazyEntity.js +12 -12
  833. package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  834. package/lib/feature-libraries/flex-tree/lazyField.js +25 -27
  835. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  836. package/lib/feature-libraries/flex-tree/lazyNode.js +22 -21
  837. package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  838. package/lib/feature-libraries/forest-summary/forestSummarizer.js +122 -117
  839. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  840. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +49 -32
  841. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  842. package/lib/feature-libraries/index.d.ts +1 -1
  843. package/lib/feature-libraries/index.js.map +1 -1
  844. package/lib/feature-libraries/indexing/anchorTreeIndex.js +33 -29
  845. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  846. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js +14 -12
  847. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
  848. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +63 -10
  849. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  850. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  851. package/lib/feature-libraries/modular-schema/fieldKind.js +10 -0
  852. package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  853. package/lib/feature-libraries/modular-schema/filterEdits.d.ts +13 -0
  854. package/lib/feature-libraries/modular-schema/filterEdits.d.ts.map +1 -0
  855. package/lib/feature-libraries/modular-schema/filterEdits.js +46 -0
  856. package/lib/feature-libraries/modular-schema/filterEdits.js.map +1 -0
  857. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  858. package/lib/feature-libraries/modular-schema/genericFieldKind.js +5 -2
  859. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  860. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +2 -2
  861. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
  862. package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
  863. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  864. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  865. package/lib/feature-libraries/modular-schema/invert.d.ts +1 -1
  866. package/lib/feature-libraries/modular-schema/invert.d.ts.map +1 -1
  867. package/lib/feature-libraries/modular-schema/invert.js +6 -30
  868. package/lib/feature-libraries/modular-schema/invert.js.map +1 -1
  869. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts +5 -7
  870. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
  871. package/lib/feature-libraries/modular-schema/minimizeModularChange.js +458 -8
  872. package/lib/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
  873. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -10
  874. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  875. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +20 -85
  876. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  877. package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts +13 -1
  878. package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -1
  879. package/lib/feature-libraries/modular-schema/modularChangeUtils.js +100 -3
  880. package/lib/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -1
  881. package/lib/feature-libraries/modular-schema/prune.d.ts +2 -3
  882. package/lib/feature-libraries/modular-schema/prune.d.ts.map +1 -1
  883. package/lib/feature-libraries/modular-schema/prune.js +25 -7
  884. package/lib/feature-libraries/modular-schema/prune.js.map +1 -1
  885. package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -3
  886. package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
  887. package/lib/feature-libraries/node-identifier/nodeIdentifierManager.js +1 -0
  888. package/lib/feature-libraries/node-identifier/nodeIdentifierManager.js.map +1 -1
  889. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  890. package/lib/feature-libraries/object-forest/objectForest.js +273 -266
  891. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  892. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  893. package/lib/feature-libraries/optional-field/optionalField.js +24 -32
  894. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  895. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +1 -1
  896. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
  897. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +1 -1
  898. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
  899. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  900. package/lib/feature-libraries/schema-index/schemaSummarizer.js +3 -0
  901. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  902. package/lib/feature-libraries/schemaChecker.d.ts +9 -19
  903. package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
  904. package/lib/feature-libraries/schemaChecker.js +133 -49
  905. package/lib/feature-libraries/schemaChecker.js.map +1 -1
  906. package/lib/feature-libraries/sequence-field/compose.js +6 -0
  907. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  908. package/lib/feature-libraries/sequence-field/filterEdits.d.ts +3 -3
  909. package/lib/feature-libraries/sequence-field/filterEdits.d.ts.map +1 -1
  910. package/lib/feature-libraries/sequence-field/filterEdits.js +31 -12
  911. package/lib/feature-libraries/sequence-field/filterEdits.js.map +1 -1
  912. package/lib/feature-libraries/sequence-field/formatV1.d.ts +3 -3
  913. package/lib/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
  914. package/lib/feature-libraries/sequence-field/formatV2.d.ts +3 -3
  915. package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  916. package/lib/feature-libraries/sequence-field/formatV3.d.ts +2 -2
  917. package/lib/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
  918. package/lib/feature-libraries/sequence-field/markListFactory.js +3 -4
  919. package/lib/feature-libraries/sequence-field/markListFactory.js.map +1 -1
  920. package/lib/feature-libraries/sequence-field/markQueue.js +4 -2
  921. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  922. package/lib/feature-libraries/sequence-field/rebase.js +6 -0
  923. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  924. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  925. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +9 -9
  926. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  927. package/lib/feature-libraries/sequence-field/utils.d.ts +2 -2
  928. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  929. package/lib/feature-libraries/sequence-field/utils.js +3 -15
  930. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  931. package/lib/feature-libraries/treeCursorUtils.js +13 -9
  932. package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
  933. package/lib/index.d.ts +4 -29
  934. package/lib/index.d.ts.map +1 -1
  935. package/lib/index.js +2 -17
  936. package/lib/index.js.map +1 -1
  937. package/lib/internalTypes.d.ts +1 -1
  938. package/lib/internalTypes.d.ts.map +1 -1
  939. package/lib/internalTypes.js.map +1 -1
  940. package/lib/packageVersion.d.ts +1 -1
  941. package/lib/packageVersion.d.ts.map +1 -1
  942. package/lib/packageVersion.js +1 -1
  943. package/lib/packageVersion.js.map +1 -1
  944. package/lib/serializableDomainSchema.d.ts +1 -1
  945. package/lib/shared-tree/history.d.ts.map +1 -1
  946. package/lib/shared-tree/history.js +32 -13
  947. package/lib/shared-tree/history.js.map +1 -1
  948. package/lib/shared-tree/independentView.d.ts +27 -3
  949. package/lib/shared-tree/independentView.d.ts.map +1 -1
  950. package/lib/shared-tree/independentView.js +30 -2
  951. package/lib/shared-tree/independentView.js.map +1 -1
  952. package/lib/shared-tree/index.d.ts +2 -1
  953. package/lib/shared-tree/index.d.ts.map +1 -1
  954. package/lib/shared-tree/index.js +2 -1
  955. package/lib/shared-tree/index.js.map +1 -1
  956. package/lib/shared-tree/schematizingTreeView.d.ts +14 -4
  957. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  958. package/lib/shared-tree/schematizingTreeView.js +109 -39
  959. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  960. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  961. package/lib/shared-tree/sharedTree.js +24 -15
  962. package/lib/shared-tree/sharedTree.js.map +1 -1
  963. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  964. package/lib/shared-tree/sharedTreeChangeEnricher.js +12 -4
  965. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  966. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  967. package/lib/shared-tree/sharedTreeChangeFamily.js +6 -3
  968. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  969. package/lib/shared-tree/sharedTreeEditBuilder.js +2 -0
  970. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  971. package/lib/shared-tree/transactionMinimize.d.ts.map +1 -1
  972. package/lib/shared-tree/transactionMinimize.js +4 -3
  973. package/lib/shared-tree/transactionMinimize.js.map +1 -1
  974. package/lib/shared-tree/treeAlpha.d.ts +5 -16
  975. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  976. package/lib/shared-tree/treeAlpha.js +13 -6
  977. package/lib/shared-tree/treeAlpha.js.map +1 -1
  978. package/{dist/simple-tree/api → lib/shared-tree}/treeBeta.d.ts +8 -65
  979. package/lib/shared-tree/treeBeta.d.ts.map +1 -0
  980. package/lib/shared-tree/treeBeta.js +64 -0
  981. package/lib/shared-tree/treeBeta.js.map +1 -0
  982. package/lib/shared-tree/treeCheckout.d.ts +5 -0
  983. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  984. package/lib/shared-tree/treeCheckout.js +985 -906
  985. package/lib/shared-tree/treeCheckout.js.map +1 -1
  986. package/lib/shared-tree/unhydratedTreeContext.js +3 -4
  987. package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
  988. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  989. package/lib/shared-tree-core/branch.js +22 -18
  990. package/lib/shared-tree-core/branch.js.map +1 -1
  991. package/lib/shared-tree-core/branchCommitCounter.js +35 -32
  992. package/lib/shared-tree-core/branchCommitCounter.js.map +1 -1
  993. package/lib/shared-tree-core/branchCommitEnricher.js +9 -8
  994. package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
  995. package/lib/shared-tree-core/customMetadataFormat.d.ts.map +1 -1
  996. package/lib/shared-tree-core/defaultResubmitMachine.js +11 -9
  997. package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  998. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  999. package/lib/shared-tree-core/editManager.js +73 -44
  1000. package/lib/shared-tree-core/editManager.js.map +1 -1
  1001. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
  1002. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  1003. package/lib/shared-tree-core/editManagerCodecsCommons.js +32 -34
  1004. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  1005. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  1006. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  1007. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +4 -4
  1008. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  1009. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -1
  1010. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  1011. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +2 -1
  1012. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  1013. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  1014. package/lib/shared-tree-core/editManagerSummarizer.js +6 -1
  1015. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  1016. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +2 -1
  1017. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  1018. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts +2 -1
  1019. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  1020. package/lib/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  1021. package/lib/shared-tree-core/sharedTreeCore.js +45 -23
  1022. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  1023. package/lib/shared-tree-core/transaction.js +36 -39
  1024. package/lib/shared-tree-core/transaction.js.map +1 -1
  1025. package/lib/shared-tree-core/versionedSummarizer.js +4 -0
  1026. package/lib/shared-tree-core/versionedSummarizer.js.map +1 -1
  1027. package/lib/simple-tree/api/cloneTree.d.ts +11 -0
  1028. package/lib/simple-tree/api/cloneTree.d.ts.map +1 -0
  1029. package/lib/simple-tree/api/cloneTree.js +28 -0
  1030. package/lib/simple-tree/api/cloneTree.js.map +1 -0
  1031. package/lib/simple-tree/api/configuration.d.ts +4 -4
  1032. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  1033. package/lib/simple-tree/api/configuration.js +19 -0
  1034. package/lib/simple-tree/api/configuration.js.map +1 -1
  1035. package/lib/simple-tree/api/discrepancies.d.ts +36 -3
  1036. package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
  1037. package/lib/simple-tree/api/discrepancies.js +40 -14
  1038. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  1039. package/lib/simple-tree/api/index.d.ts +5 -4
  1040. package/lib/simple-tree/api/index.d.ts.map +1 -1
  1041. package/lib/simple-tree/api/index.js +2 -2
  1042. package/lib/simple-tree/api/index.js.map +1 -1
  1043. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +22 -3
  1044. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  1045. package/lib/simple-tree/api/schemaCompatibilityTester.js +136 -7
  1046. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  1047. package/lib/simple-tree/api/schemaCreationUtilities.d.ts +3 -7
  1048. package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  1049. package/lib/simple-tree/api/schemaCreationUtilities.js +1 -3
  1050. package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  1051. package/lib/simple-tree/api/schemaFactory.d.ts +4 -9
  1052. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  1053. package/lib/simple-tree/api/schemaFactory.js +9 -8
  1054. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  1055. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +18 -20
  1056. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  1057. package/lib/simple-tree/api/schemaFactoryAlpha.js +78 -81
  1058. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  1059. package/lib/simple-tree/api/schemaFactoryBeta.d.ts +7 -9
  1060. package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  1061. package/lib/simple-tree/api/schemaFactoryBeta.js +32 -35
  1062. package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  1063. package/lib/simple-tree/api/schemaStatics.d.ts +7 -7
  1064. package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
  1065. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +46 -2
  1066. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  1067. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +48 -6
  1068. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  1069. package/lib/simple-tree/api/transactionTypes.d.ts +4 -4
  1070. package/lib/simple-tree/api/transactionTypes.js.map +1 -1
  1071. package/lib/simple-tree/api/tree.d.ts +243 -58
  1072. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  1073. package/lib/simple-tree/api/tree.js +2 -3
  1074. package/lib/simple-tree/api/tree.js.map +1 -1
  1075. package/lib/simple-tree/api/treeChangeEvents.d.ts +16 -4
  1076. package/lib/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
  1077. package/lib/simple-tree/api/treeChangeEvents.js.map +1 -1
  1078. package/lib/simple-tree/api/treeChangeEventsBeta.d.ts +209 -0
  1079. package/lib/simple-tree/api/treeChangeEventsBeta.d.ts.map +1 -0
  1080. package/lib/simple-tree/api/{treeAlpha.js → treeChangeEventsBeta.js} +1 -1
  1081. package/lib/simple-tree/api/treeChangeEventsBeta.js.map +1 -0
  1082. package/lib/simple-tree/api/treeNodeApi.d.ts +1 -75
  1083. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  1084. package/lib/simple-tree/api/treeNodeApi.js +1 -1
  1085. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  1086. package/lib/simple-tree/api/typesUnsafe.d.ts +8 -6
  1087. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  1088. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  1089. package/lib/simple-tree/core/allowedTypes.js +12 -3
  1090. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  1091. package/lib/simple-tree/core/context.js +3 -0
  1092. package/lib/simple-tree/core/context.js.map +1 -1
  1093. package/lib/simple-tree/core/index.d.ts +1 -1
  1094. package/lib/simple-tree/core/index.d.ts.map +1 -1
  1095. package/lib/simple-tree/core/index.js +1 -1
  1096. package/lib/simple-tree/core/index.js.map +1 -1
  1097. package/lib/simple-tree/core/toStored.d.ts +7 -0
  1098. package/lib/simple-tree/core/toStored.d.ts.map +1 -1
  1099. package/lib/simple-tree/core/toStored.js.map +1 -1
  1100. package/lib/simple-tree/core/treeNode.d.ts +3 -4
  1101. package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
  1102. package/lib/simple-tree/core/treeNode.js +29 -30
  1103. package/lib/simple-tree/core/treeNode.js.map +1 -1
  1104. package/lib/simple-tree/core/treeNodeKernel.js +181 -179
  1105. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  1106. package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  1107. package/lib/simple-tree/core/treeNodeValid.js +22 -22
  1108. package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
  1109. package/lib/simple-tree/core/unhydratedFlexTree.js +173 -146
  1110. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  1111. package/lib/simple-tree/core/withType.d.ts +7 -9
  1112. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  1113. package/lib/simple-tree/core/withType.js +5 -6
  1114. package/lib/simple-tree/core/withType.js.map +1 -1
  1115. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  1116. package/lib/simple-tree/fieldSchema.js +23 -5
  1117. package/lib/simple-tree/fieldSchema.js.map +1 -1
  1118. package/lib/simple-tree/index.d.ts +2 -2
  1119. package/lib/simple-tree/index.d.ts.map +1 -1
  1120. package/lib/simple-tree/index.js +2 -2
  1121. package/lib/simple-tree/index.js.map +1 -1
  1122. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  1123. package/lib/simple-tree/leafNodeSchema.js +16 -15
  1124. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  1125. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +3 -2
  1126. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  1127. package/lib/simple-tree/node-kinds/array/arrayNode.js +28 -32
  1128. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  1129. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  1130. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +6 -6
  1131. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  1132. package/lib/simple-tree/node-kinds/map/mapNode.js +10 -17
  1133. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  1134. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  1135. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  1136. package/lib/simple-tree/node-kinds/object/objectNode.js +25 -28
  1137. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  1138. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +1 -1
  1139. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  1140. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  1141. package/lib/simple-tree/node-kinds/record/recordNode.js +10 -14
  1142. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  1143. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -2
  1144. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  1145. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  1146. package/lib/tableSchema.d.ts +2 -87
  1147. package/lib/tableSchema.d.ts.map +1 -1
  1148. package/lib/tableSchema.js +309 -275
  1149. package/lib/tableSchema.js.map +1 -1
  1150. package/lib/text/codePointUtils.d.ts +16 -3
  1151. package/lib/text/codePointUtils.d.ts.map +1 -1
  1152. package/lib/text/codePointUtils.js +22 -10
  1153. package/lib/text/codePointUtils.js.map +1 -1
  1154. package/lib/text/textDomain.d.ts +7 -1
  1155. package/lib/text/textDomain.d.ts.map +1 -1
  1156. package/lib/text/textDomain.js +21 -17
  1157. package/lib/text/textDomain.js.map +1 -1
  1158. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  1159. package/lib/text/textDomainFormatted.js +43 -32
  1160. package/lib/text/textDomainFormatted.js.map +1 -1
  1161. package/lib/text/textDomainFormattedDefault.js +2 -5
  1162. package/lib/text/textDomainFormattedDefault.js.map +1 -1
  1163. package/lib/util/brand.js +1 -0
  1164. package/lib/util/brand.js.map +1 -1
  1165. package/lib/util/breakable.d.ts.map +1 -1
  1166. package/lib/util/breakable.js +3 -0
  1167. package/lib/util/breakable.js.map +1 -1
  1168. package/lib/util/compressedIds.js +22 -0
  1169. package/lib/util/compressedIds.js.map +1 -1
  1170. package/lib/util/nestedMap.js +2 -4
  1171. package/lib/util/nestedMap.js.map +1 -1
  1172. package/lib/util/offsetList.js +2 -4
  1173. package/lib/util/offsetList.js.map +1 -1
  1174. package/lib/util/rangeMap.js +4 -0
  1175. package/lib/util/rangeMap.js.map +1 -1
  1176. package/lib/util/readSnapshotBlob.d.ts.map +1 -1
  1177. package/lib/util/referenceCounting.js +1 -0
  1178. package/lib/util/referenceCounting.js.map +1 -1
  1179. package/lib/util/stackyIterator.js +3 -2
  1180. package/lib/util/stackyIterator.js.map +1 -1
  1181. package/lib/util/utils.d.ts +2 -2
  1182. package/lib/util/utils.d.ts.map +1 -1
  1183. package/package.json +67 -95
  1184. package/src/api.ts +11 -0
  1185. package/src/core/index.ts +6 -2
  1186. package/src/core/rebase/index.ts +1 -0
  1187. package/src/core/rebase/types.ts +16 -1
  1188. package/src/core/tree/anchorSet.ts +2 -2
  1189. package/src/core/tree/deltaUtil.ts +67 -13
  1190. package/src/core/tree/index.ts +5 -2
  1191. package/src/entrypoints/alpha.ts +21 -20
  1192. package/src/entrypoints/beta.ts +14 -5
  1193. package/src/entrypoints/legacy.ts +14 -5
  1194. package/src/entrypoints/public.ts +1 -5
  1195. package/src/extensibleUnionNode.ts +1 -2
  1196. package/src/feature-libraries/cursorComparator.ts +57 -9
  1197. package/src/feature-libraries/index.ts +1 -1
  1198. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +77 -12
  1199. package/src/feature-libraries/modular-schema/filterEdits.ts +108 -0
  1200. package/src/feature-libraries/modular-schema/genericFieldKind.ts +7 -4
  1201. package/src/feature-libraries/modular-schema/index.ts +5 -2
  1202. package/src/feature-libraries/modular-schema/invert.ts +16 -61
  1203. package/src/feature-libraries/modular-schema/minimizeModularChange.ts +831 -10
  1204. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +10 -124
  1205. package/src/feature-libraries/modular-schema/modularChangeUtils.ts +164 -2
  1206. package/src/feature-libraries/modular-schema/prune.ts +52 -10
  1207. package/src/feature-libraries/optional-field/optionalField.ts +30 -42
  1208. package/src/feature-libraries/schemaChecker.ts +198 -82
  1209. package/src/feature-libraries/sequence-field/filterEdits.ts +62 -26
  1210. package/src/feature-libraries/sequence-field/utils.ts +7 -19
  1211. package/src/index.ts +10 -39
  1212. package/src/internalTypes.ts +1 -1
  1213. package/src/packageVersion.ts +1 -1
  1214. package/src/shared-tree/history.ts +41 -19
  1215. package/src/shared-tree/independentView.ts +40 -3
  1216. package/src/shared-tree/index.ts +5 -1
  1217. package/src/shared-tree/schematizingTreeView.ts +77 -23
  1218. package/src/shared-tree/sharedTree.ts +2 -1
  1219. package/src/shared-tree/transactionMinimize.ts +13 -4
  1220. package/src/shared-tree/treeAlpha.ts +17 -31
  1221. package/src/{simple-tree/api → shared-tree}/treeBeta.ts +56 -167
  1222. package/src/shared-tree/treeCheckout.ts +82 -9
  1223. package/src/shared-tree-core/editManager.ts +16 -8
  1224. package/src/shared-tree-core/editManagerCodecsCommons.ts +30 -34
  1225. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +1 -1
  1226. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +2 -2
  1227. package/src/simple-tree/api/cloneTree.ts +47 -0
  1228. package/src/simple-tree/api/configuration.ts +4 -4
  1229. package/src/simple-tree/api/discrepancies.ts +100 -5
  1230. package/src/simple-tree/api/index.ts +22 -22
  1231. package/src/simple-tree/api/schemaCompatibilityTester.ts +185 -11
  1232. package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -2
  1233. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +87 -6
  1234. package/src/simple-tree/api/transactionTypes.ts +4 -4
  1235. package/src/simple-tree/api/tree.ts +318 -87
  1236. package/src/simple-tree/api/treeChangeEvents.ts +16 -4
  1237. package/src/simple-tree/api/treeChangeEventsBeta.ts +245 -0
  1238. package/src/simple-tree/api/treeNodeApi.ts +6 -85
  1239. package/src/simple-tree/api/typesUnsafe.ts +8 -6
  1240. package/src/simple-tree/core/index.ts +1 -1
  1241. package/src/simple-tree/core/toStored.ts +8 -0
  1242. package/src/simple-tree/core/treeNode.ts +3 -10
  1243. package/src/simple-tree/core/treeNodeValid.ts +3 -1
  1244. package/src/simple-tree/core/withType.ts +8 -11
  1245. package/src/simple-tree/index.ts +7 -7
  1246. package/src/simple-tree/node-kinds/array/arrayNode.ts +14 -12
  1247. package/src/simple-tree/node-kinds/map/mapNode.ts +14 -15
  1248. package/src/simple-tree/node-kinds/object/objectNode.ts +3 -6
  1249. package/src/simple-tree/node-kinds/record/recordNode.ts +6 -8
  1250. package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +2 -1
  1251. package/src/tableSchema.ts +8 -187
  1252. package/src/text/codePointUtils.ts +25 -14
  1253. package/src/text/textDomain.ts +15 -2
  1254. package/src/text/textDomainFormatted.ts +9 -4
  1255. package/tsconfig.json +1 -1
  1256. package/alpha.d.ts +0 -11
  1257. package/beta.d.ts +0 -11
  1258. package/dist/simple-tree/api/treeAlpha.d.ts +0 -126
  1259. package/dist/simple-tree/api/treeAlpha.d.ts.map +0 -1
  1260. package/dist/simple-tree/api/treeAlpha.js.map +0 -1
  1261. package/dist/simple-tree/api/treeBeta.d.ts.map +0 -1
  1262. package/dist/simple-tree/api/treeBeta.js +0 -83
  1263. package/dist/simple-tree/api/treeBeta.js.map +0 -1
  1264. package/docs/main/runtime-schema-upgrade.md +0 -208
  1265. package/internal.d.ts +0 -11
  1266. package/legacy.d.ts +0 -11
  1267. package/lib/simple-tree/api/treeAlpha.d.ts +0 -126
  1268. package/lib/simple-tree/api/treeAlpha.d.ts.map +0 -1
  1269. package/lib/simple-tree/api/treeAlpha.js.map +0 -1
  1270. package/lib/simple-tree/api/treeBeta.d.ts.map +0 -1
  1271. package/lib/simple-tree/api/treeBeta.js +0 -77
  1272. package/lib/simple-tree/api/treeBeta.js.map +0 -1
  1273. package/src/simple-tree/api/treeAlpha.ts +0 -153
  1274. /package/api-extractor/{api-extractor.current.json → api-extractor-report.current.json} +0 -0
  1275. /package/api-extractor/{api-extractor.legacy.json → api-extractor-report.legacy.json} +0 -0
@@ -19,6 +19,21 @@ const schematizeTree_js_1 = require("./schematizeTree.js");
19
19
  * exists and error if creating a second.
20
20
  */
21
21
  exports.ViewSlot = (0, index_js_1.anchorSlot)();
22
+ function throwIfSchemaIsIncompatible(compatibility) {
23
+ if (compatibility.canView) {
24
+ return;
25
+ }
26
+ const resolution = compatibility.canInitialize
27
+ ? "The document is uninitialized; call TreeView.initialize() before reading or writing TreeView.root."
28
+ : compatibility.canUpgrade
29
+ ? "The stored schema can be upgraded; call TreeView.upgradeSchema() before reading or writing TreeView.root."
30
+ : "The schemas cannot be upgraded automatically. Use a compatible view schema or explicitly migrate the document schema and data.";
31
+ throw new internal_2.UsageError(`TreeView.root is unavailable because the view schema is incompatible with the stored schema. ${resolution}`, (0, internal_2.tagSchemaArtifacts)({
32
+ schemaIncompatibilityDetails: compatibility.discrepancies === undefined
33
+ ? undefined
34
+ : JSON.stringify(compatibility.discrepancies),
35
+ }));
36
+ }
22
37
  /**
23
38
  * Implementation of TreeView wrapping a FlexTreeView.
24
39
  */
@@ -27,29 +42,70 @@ let SchematizingSimpleTreeView = (() => {
27
42
  let _classDescriptor;
28
43
  let _classExtraInitializers = [];
29
44
  let _classThis;
30
- var SchematizingSimpleTreeView = _classThis = class {
45
+ var SchematizingSimpleTreeView = class {
46
+ static { _classThis = this; }
47
+ static {
48
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
49
+ tslib_1.__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
50
+ SchematizingSimpleTreeView = _classThis = _classDescriptor.value;
51
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
52
+ tslib_1.__runInitializers(_classThis, _classExtraInitializers);
53
+ }
54
+ checkout;
55
+ config;
56
+ nodeKeyManager;
57
+ onDispose;
58
+ /**
59
+ * This is set to undefined when this object is disposed or the view schema does not support viewing the document's stored schema.
60
+ *
61
+ * The view schema may be incompatible with the stored schema. Use `compatibility` to check.
62
+ */
63
+ flexTreeContext;
64
+ /**
65
+ * Undefined if and only if uninitialized or disposed.
66
+ */
67
+ currentCompatibility;
68
+ /**
69
+ * Cached map of upgrade statuses, computed alongside compatibility.
70
+ * @remarks Undefined if and only if uninitialized or disposed.
71
+ */
72
+ currentEnabledUpgrades;
73
+ events = (0, client_utils_1.createEmitter)();
74
+ /**
75
+ * The schema for this view, captured at construction time for compatibility checking.
76
+ */
77
+ viewSchema;
78
+ /**
79
+ * Stored-schema generation policy from the view configuration, frozen at construction time.
80
+ */
81
+ stagedUpgradePolicy;
82
+ /**
83
+ * Events to unregister upon flex-tree view disposal.
84
+ */
85
+ flexTreeViewUnregisterCallbacks = new Set();
86
+ /**
87
+ * Events to unregister upon disposal.
88
+ */
89
+ unregisterCallbacks = new Set();
90
+ disposed = false;
91
+ /**
92
+ * This is set to true while an edit impacting the document schema is in progress.
93
+ * This allows suppressing extra rootChanged / schemaChanged events until the edit concludes.
94
+ * This is useful especially for some initialization edits, since document initialization can involve transient schemas
95
+ * which are implementation details and should not be exposed to the user.
96
+ */
97
+ midUpgrade = false;
98
+ /**
99
+ * Hydration work deferred until Context has been created.
100
+ */
101
+ pendingHydration;
102
+ rootFieldSchema;
103
+ breaker;
31
104
  constructor(checkout, config, nodeKeyManager, onDispose) {
32
105
  this.checkout = checkout;
33
106
  this.config = config;
34
107
  this.nodeKeyManager = nodeKeyManager;
35
108
  this.onDispose = onDispose;
36
- this.events = (0, client_utils_1.createEmitter)();
37
- /**
38
- * Events to unregister upon flex-tree view disposal.
39
- */
40
- this.flexTreeViewUnregisterCallbacks = new Set();
41
- /**
42
- * Events to unregister upon disposal.
43
- */
44
- this.unregisterCallbacks = new Set();
45
- this.disposed = false;
46
- /**
47
- * This is set to true while an edit impacting the document schema is in progress.
48
- * This allows suppressing extra rootChanged / schemaChanged events until the edit concludes.
49
- * This is useful especially for some initialization edits, since document initialization can involve transient schemas
50
- * which are implementation details and should not be exposed to the user.
51
- */
52
- this.midUpgrade = false;
53
109
  this.breaker = checkout.breaker;
54
110
  if (checkout.forest.anchors.slots.has(exports.ViewSlot)) {
55
111
  throw new internal_2.UsageError("Cannot create a second tree view from the same checkout");
@@ -58,9 +114,7 @@ let SchematizingSimpleTreeView = (() => {
58
114
  this.rootFieldSchema = (0, index_js_3.normalizeFieldSchema)(config.schema);
59
115
  const stagedUpgradePolicy = config instanceof index_js_3.TreeViewConfigurationAlpha ? config.stagedUpgradePolicy : undefined;
60
116
  const configAlpha = new index_js_3.TreeViewConfigurationAlpha({
61
- schema: config.schema,
62
- enableSchemaValidation: config.enableSchemaValidation,
63
- preventAmbiguity: config.preventAmbiguity,
117
+ ...config,
64
118
  stagedUpgradePolicy,
65
119
  });
66
120
  this.stagedUpgradePolicy = configAlpha.stagedUpgradePolicy;
@@ -72,7 +126,9 @@ let SchematizingSimpleTreeView = (() => {
72
126
  canUpgrade: true,
73
127
  isEquivalent: false,
74
128
  canInitialize: true,
129
+ discrepancies: undefined,
75
130
  };
131
+ this.currentEnabledUpgrades = new Map();
76
132
  this.update();
77
133
  this.unregisterCallbacks.add(this.checkout.events.on("changed", (data, getRevertible) => {
78
134
  this.events.emit("changed", data, getRevertible);
@@ -135,7 +191,7 @@ let SchematizingSimpleTreeView = (() => {
135
191
  }
136
192
  upgradeSchema() {
137
193
  this.ensureUndisposed();
138
- const newSchema = (0, index_js_3.toUpgradeSchema)(this.viewSchema.root, this.stagedUpgradePolicy);
194
+ const newSchema = (0, index_js_3.toUpgradeSchema)(this.viewSchema.root, this.effectiveUpgradePolicy);
139
195
  const storedSchema = this.checkout.storedSchema.clone();
140
196
  if (!(0, index_js_2.allowsRepoSuperset)(index_js_2.defaultSchemaPolicy, storedSchema, newSchema)) {
141
197
  throw new internal_2.UsageError("Existing stored schema cannot be upgraded to the requested schema (see TreeView.compatibility.canUpgrade).");
@@ -146,6 +202,27 @@ let SchematizingSimpleTreeView = (() => {
146
202
  }
147
203
  this.runSchemaEdit(() => this.checkout.updateSchema(newSchema));
148
204
  }
205
+ isStagedUpgradeEnabled(upgrade) {
206
+ if (!this.currentEnabledUpgrades) {
207
+ this.failDisposed();
208
+ }
209
+ return this.currentEnabledUpgrades.get(upgrade) ?? "disabled";
210
+ }
211
+ get effectiveUpgradePolicy() {
212
+ const configuredPolicy = this.stagedUpgradePolicy;
213
+ if (configuredPolicy.includeAlreadyEnabledUpgrades === false) {
214
+ return configuredPolicy;
215
+ }
216
+ const enabledUpgrades = this.currentEnabledUpgrades;
217
+ (0, internal_1.assert)(enabledUpgrades !== undefined, 0xd3e /* Enabled upgrades must be available for an active view */);
218
+ if (enabledUpgrades.size === 0) {
219
+ return configuredPolicy;
220
+ }
221
+ return {
222
+ includeStaged: (upgrade) => configuredPolicy.includeStaged(upgrade) || enabledUpgrades.has(upgrade),
223
+ includeStagedOptional: (upgrade) => configuredPolicy.includeStagedOptional(upgrade) || enabledUpgrades.has(upgrade),
224
+ };
225
+ }
149
226
  /**
150
227
  * Gets the flex-tree context. Throws when disposed or out of schema.
151
228
  */
@@ -233,8 +310,12 @@ let SchematizingSimpleTreeView = (() => {
233
310
  this.events.emit("rootChanged");
234
311
  }
235
312
  }
313
+ /**
314
+ * Computes the current schema compatibility status and updates the cached enabled upgrades.
315
+ */
236
316
  computeCompatibility() {
237
- const compatibility = (0, index_js_3.checkSchemaCompatibility)(this.viewSchema, this.checkout.storedSchema, this.stagedUpgradePolicy);
317
+ const { enabledUpgrades, ...compatibility } = (0, index_js_3.checkSchemaCompatibility)(this.viewSchema, this.checkout.storedSchema, this.stagedUpgradePolicy);
318
+ this.currentEnabledUpgrades = enabledUpgrades;
238
319
  return {
239
320
  ...compatibility,
240
321
  canInitialize: (0, schematizeTree_js_1.canInitialize)(this.checkout),
@@ -284,6 +365,7 @@ let SchematizingSimpleTreeView = (() => {
284
365
  }
285
366
  this.checkout.forest.anchors.slots.delete(exports.ViewSlot);
286
367
  this.currentCompatibility = undefined;
368
+ this.currentEnabledUpgrades = undefined;
287
369
  this.onDispose?.();
288
370
  if (!this.checkout.isSharedBranch && !this.checkout.disposed) {
289
371
  // All non-shared branches are 1:1 with views, so if a user manually disposes a view, we should also dispose the checkout/branch.
@@ -292,9 +374,7 @@ let SchematizingSimpleTreeView = (() => {
292
374
  }
293
375
  get flexRoot() {
294
376
  this.breaker.use();
295
- if (!this.compatibility.canView) {
296
- throw new internal_2.UsageError("Document is out of schema. Check TreeView.compatibility before accessing TreeView.root.");
297
- }
377
+ throwIfSchemaIsIncompatible(this.compatibility);
298
378
  const view = this.getFlexTreeContext();
299
379
  (0, internal_1.assert)(view.root.is(index_js_2.FieldKinds.optional) ||
300
380
  view.root.is(index_js_2.FieldKinds.required) ||
@@ -306,9 +386,7 @@ let SchematizingSimpleTreeView = (() => {
306
386
  }
307
387
  set root(newRoot) {
308
388
  this.breaker.use();
309
- if (!this.compatibility.canView) {
310
- throw new internal_2.UsageError("Document is out of schema. Check TreeView.compatibility before accessing TreeView.root.");
311
- }
389
+ throwIfSchemaIsIncompatible(this.compatibility);
312
390
  const view = this.getFlexTreeContext();
313
391
  (0, index_js_3.setField)(view.root, this.rootFieldSchema, newRoot, this.checkout.storedSchema.rootFieldSchema);
314
392
  }
@@ -339,14 +417,6 @@ let SchematizingSimpleTreeView = (() => {
339
417
  return this.checkout.branchHistory;
340
418
  }
341
419
  };
342
- tslib_1.__setFunctionName(_classThis, "SchematizingSimpleTreeView");
343
- (() => {
344
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
345
- tslib_1.__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
346
- SchematizingSimpleTreeView = _classThis = _classDescriptor.value;
347
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
348
- tslib_1.__runInitializers(_classThis, _classExtraInitializers);
349
- })();
350
420
  return SchematizingSimpleTreeView = _classThis;
351
421
  })();
352
422
  exports.SchematizingSimpleTreeView = SchematizingSimpleTreeView;
@@ -1 +1 @@
1
- {"version":3,"file":"schematizingTreeView.js","sourceRoot":"","sources":["../../src/shared-tree/schematizingTreeView.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,+DAA6D;AAM7D,kEAA6D;AAC7D,uEAAsE;AAEtE,+CAAuF;AACvF,4DAWuC;AACvC,sDAoCiC;AACjC,+CAM0B;AAE1B,2DAAsF;AAGtF;;;GAGG;AACU,QAAA,QAAQ,GAAG,IAAA,qBAAU,GAAiC,CAAC;AAEpE;;GAEG;IAEU,0BAA0B;4BADt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D,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QAC7C,CAAC;QAEM,UAAU,CAAC,OAA6B;YAC9C,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC;QAEM,kBAAkB,CAAC,OAA6B;YACtD,OAAO,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAClD,CAAC;QAEM,6BAA6B,CACnC,OAA6B;YAE7B,OAAO,IAAI,CAAC,QAAQ,CAAC,6BAA6B,CAAC,OAAO,CAAC,CAAC;QAC7D,CAAC;QAED,uBAAuB;QAEvB,IAAW,aAAa;YACvB,OAAO,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC;QACpC,CAAC;;;;;QAnfF,qLAofC;;;QApfY,+DAA0B;;;;AAA1B,gEAA0B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { createEmitter } from \"@fluid-internal/client-utils\";\nimport type {\n\tHasListeners,\n\tIEmitter,\n\tListenable,\n} from \"@fluidframework/core-interfaces/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { anchorSlot, rootFieldKey, type RevertToOptionsAlpha } from \"../core/index.js\";\nimport {\n\ttype NodeIdentifierManager,\n\tdefaultSchemaPolicy,\n\tcursorForMapTreeField,\n\tContext,\n\tcombineChunks,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeUnknownUnboxed,\n\tFieldKinds,\n\ttype FlexTreeRequiredField,\n\tallowsRepoSuperset,\n} from \"../feature-libraries/index.js\";\nimport {\n\ttype ImplicitFieldSchema,\n\ttype SchemaCompatibilityStatus,\n\ttype TreeView,\n\ttype TreeViewEvents,\n\ttryGetTreeNodeForField,\n\tsetField,\n\tnormalizeFieldSchema,\n\tcheckSchemaCompatibility,\n\ttype InsertableContent,\n\ttype StagedSchemaUpgradePolicy,\n\ttype TreeViewConfiguration,\n\ttype TreeViewAlpha,\n\ttype InsertableField,\n\ttype ReadableField,\n\ttype ReadSchema,\n\ttype UnsafeUnknownSchema,\n\ttype TreeBranchEvents,\n\ttype VoidTransactionCallbackStatusAlpha,\n\ttype TransactionCallbackStatusAlpha,\n\ttype TransactionVoidResult,\n\ttype TransactionValueResult,\n\ttype RunTransactionParamsAlpha,\n\tHydratedContext,\n\tSimpleContextSlot,\n\tareImplicitFieldSchemaEqual,\n\tprepareForInsertionContextless,\n\ttype FieldSchema,\n\ttryDisposeTreeNode,\n\tFieldSchemaAlpha,\n\tTreeViewConfigurationAlpha,\n\ttoInitialSchema,\n\ttoUpgradeSchema,\n\ttype TreeBranchHistory,\n\ttype UntypedTreeViewAlpha,\n\ttype TreeSchema,\n} from \"../simple-tree/index.js\";\nimport {\n\ttype Breakable,\n\tbreakingClass,\n\tdisposeSymbol,\n\ttype JsonCompatibleReadOnly,\n\ttype WithBreakable,\n} from \"../util/index.js\";\n\nimport { canInitialize, initialize, initializerFromChunk } from \"./schematizeTree.js\";\nimport type { TreeCheckout } from \"./treeCheckout.js\";\n\n/**\n * Creating multiple tree views from the same checkout is not supported. This slot is used to detect if one already\n * exists and error if creating a second.\n */\nexport const ViewSlot = anchorSlot<TreeView<ImplicitFieldSchema>>();\n\n/**\n * Implementation of TreeView wrapping a FlexTreeView.\n */\n@breakingClass\nexport class SchematizingSimpleTreeView<\n\tin out TRootSchema extends ImplicitFieldSchema | UnsafeUnknownSchema,\n> implements TreeViewAlpha<TRootSchema>, WithBreakable\n{\n\t/**\n\t * This is set to undefined when this object is disposed or the view schema does not support viewing the document's stored schema.\n\t *\n\t * The view schema may be incompatible with the stored schema. Use `compatibility` to check.\n\t */\n\tprivate flexTreeContext: Context | undefined;\n\n\t/**\n\t * Undefined iff uninitialized or disposed.\n\t */\n\tprivate currentCompatibility: SchemaCompatibilityStatus | undefined;\n\tpublic readonly events: Listenable<TreeViewEvents & TreeBranchEvents> &\n\t\tIEmitter<TreeViewEvents & TreeBranchEvents> &\n\t\tHasListeners<TreeViewEvents & TreeBranchEvents> = createEmitter();\n\n\t/**\n\t * The schema for this view, captured at construction time for compatibility checking.\n\t */\n\tprivate readonly viewSchema: TreeSchema;\n\t/**\n\t * Stored-schema generation policy from the view configuration, frozen at construction time.\n\t */\n\tprivate readonly stagedUpgradePolicy: StagedSchemaUpgradePolicy;\n\n\t/**\n\t * Events to unregister upon flex-tree view disposal.\n\t */\n\tprivate readonly flexTreeViewUnregisterCallbacks = new Set<() => void>();\n\n\t/**\n\t * Events to unregister upon disposal.\n\t */\n\tprivate readonly unregisterCallbacks = new Set<() => void>();\n\n\tpublic disposed = false;\n\t/**\n\t * This is set to true while an edit impacting the document schema is in progress.\n\t * This allows suppressing extra rootChanged / schemaChanged events until the edit concludes.\n\t * This is useful especially for some initialization edits, since document initialization can involve transient schemas\n\t * which are implementation details and should not be exposed to the user.\n\t */\n\tprivate midUpgrade = false;\n\n\t/**\n\t * Hydration work deferred until Context has been created.\n\t */\n\tprivate pendingHydration?: () => void;\n\n\tprivate readonly rootFieldSchema: FieldSchema;\n\tpublic readonly breaker: Breakable;\n\n\tpublic constructor(\n\t\tpublic readonly checkout: TreeCheckout,\n\t\tpublic readonly config: TreeViewConfiguration<ReadSchema<TRootSchema>>,\n\t\tpublic readonly nodeKeyManager: NodeIdentifierManager,\n\t\tprivate readonly onDispose?: () => void,\n\t) {\n\t\tthis.breaker = checkout.breaker;\n\t\tif (checkout.forest.anchors.slots.has(ViewSlot)) {\n\t\t\tthrow new UsageError(\"Cannot create a second tree view from the same checkout\");\n\t\t}\n\t\tcheckout.forest.anchors.slots.set(ViewSlot, this);\n\n\t\tthis.rootFieldSchema = normalizeFieldSchema(config.schema);\n\n\t\tconst stagedUpgradePolicy =\n\t\t\tconfig instanceof TreeViewConfigurationAlpha ? config.stagedUpgradePolicy : undefined;\n\t\tconst configAlpha = new TreeViewConfigurationAlpha({\n\t\t\tschema: config.schema,\n\t\t\tenableSchemaValidation: config.enableSchemaValidation,\n\t\t\tpreventAmbiguity: config.preventAmbiguity,\n\t\t\tstagedUpgradePolicy,\n\t\t});\n\t\tthis.stagedUpgradePolicy = configAlpha.stagedUpgradePolicy;\n\n\t\t// Store viewSchema directly from the configuration (TreeViewConfigurationAlpha implements TreeSchema)\n\t\tthis.viewSchema = configAlpha;\n\t\t// This must be initialized before `update` can be called.\n\t\tthis.currentCompatibility = {\n\t\t\tcanView: false,\n\t\t\tcanUpgrade: true,\n\t\t\tisEquivalent: false,\n\t\t\tcanInitialize: true,\n\t\t};\n\t\tthis.update();\n\n\t\tthis.unregisterCallbacks.add(\n\t\t\tthis.checkout.events.on(\"changed\", (data, getRevertible) => {\n\t\t\t\tthis.events.emit(\"changed\", data, getRevertible);\n\t\t\t\tthis.events.emit(\"commitApplied\", data, getRevertible);\n\t\t\t}),\n\t\t);\n\t}\n\n\tpublic isBranch(): this is UntypedTreeViewAlpha {\n\t\treturn this.isView();\n\t}\n\n\tpublic isView(): this is UntypedTreeViewAlpha {\n\t\treturn true;\n\t}\n\n\tpublic applyChange(change: JsonCompatibleReadOnly): void {\n\t\tthis.checkout.applySerializedChange(change);\n\t}\n\n\tpublic hasRootSchema<TSchema extends ImplicitFieldSchema>(\n\t\tschema: TSchema,\n\t): this is TreeViewAlpha<TSchema> {\n\t\treturn areImplicitFieldSchemaEqual(this.rootFieldSchema, schema);\n\t}\n\n\tpublic get schema(): ReadSchema<TRootSchema> {\n\t\treturn this.config.schema;\n\t}\n\n\tpublic initialize(content: InsertableField<TRootSchema>): void {\n\t\tthis.ensureUndisposed();\n\n\t\tconst compatibility = this.compatibility;\n\t\tif (!compatibility.canInitialize) {\n\t\t\tthrow new UsageError(\"Tree cannot be initialized more than once.\");\n\t\t}\n\n\t\tthis.runSchemaEdit(() => {\n\t\t\tconst schema = toInitialSchema(this.config.schema, this.stagedUpgradePolicy);\n\t\t\t// This has to be the contextless version, since when \"initialize\" is called (right after this),\n\t\t\t// it will do a schema change which would dispose of the current context (see inside `update`).\n\t\t\t// Thus using the current context (if any) would hydrate nodes then\n\t\t\t// immediately dispose them instead of having them actually be useable after initialize.\n\t\t\t// For this to work,\n\t\t\t// the hydration must be deferred until after the content is inserted into the tree and the final schema change is done (for required roots),\n\t\t\t// but before any user event could could run.\n\t\t\tconst mapTree = prepareForInsertionContextless(\n\t\t\t\tcontent as InsertableContent | undefined,\n\t\t\t\tthis.rootFieldSchema,\n\t\t\t\t{\n\t\t\t\t\tschema,\n\t\t\t\t\tpolicy: defaultSchemaPolicy,\n\t\t\t\t},\n\t\t\t\tthis,\n\t\t\t\tschema.rootFieldSchema,\n\t\t\t\t(batches, doHydration) => {\n\t\t\t\t\tassert(\n\t\t\t\t\t\tthis.pendingHydration === undefined,\n\t\t\t\t\t\t0xc74 /* pendingHydration already set */,\n\t\t\t\t\t);\n\t\t\t\t\tthis.pendingHydration = () => {\n\t\t\t\t\t\tassert(\n\t\t\t\t\t\t\tbatches.length <= 1,\n\t\t\t\t\t\t\t0xc75 /* initialize should at most one hydration batch */,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tfor (const batch of batches) {\n\t\t\t\t\t\t\tdoHydration(batch, {\n\t\t\t\t\t\t\t\tparent: undefined,\n\t\t\t\t\t\t\t\tparentField: rootFieldKey,\n\t\t\t\t\t\t\t\tparentIndex: 0,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t);\n\n\t\t\tthis.runTransaction(() => {\n\t\t\t\tinitialize(\n\t\t\t\t\tthis.checkout,\n\t\t\t\t\tschema,\n\t\t\t\t\tinitializerFromChunk(this.checkout, () => {\n\t\t\t\t\t\t// This must be done after initial schema is set!\n\t\t\t\t\t\treturn combineChunks(\n\t\t\t\t\t\t\tthis.checkout.forest.chunkField(\n\t\t\t\t\t\t\t\tcursorForMapTreeField(mapTree === undefined ? [] : [mapTree]),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t});\n\t\t});\n\t}\n\n\tpublic upgradeSchema(): void {\n\t\tthis.ensureUndisposed();\n\n\t\tconst newSchema = toUpgradeSchema(this.viewSchema.root, this.stagedUpgradePolicy);\n\t\tconst storedSchema = this.checkout.storedSchema.clone();\n\t\tif (!allowsRepoSuperset(defaultSchemaPolicy, storedSchema, newSchema)) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"Existing stored schema cannot be upgraded to the requested schema (see TreeView.compatibility.canUpgrade).\",\n\t\t\t);\n\t\t}\n\t\tif (allowsRepoSuperset(defaultSchemaPolicy, newSchema, storedSchema)) {\n\t\t\t// No-op\n\t\t\treturn;\n\t\t}\n\n\t\tthis.runSchemaEdit(() => this.checkout.updateSchema(newSchema));\n\t}\n\n\t/**\n\t * Gets the flex-tree context. Throws when disposed or out of schema.\n\t */\n\tpublic getFlexTreeContext(): Context {\n\t\tthis.ensureUndisposed();\n\t\tassert(this.flexTreeContext !== undefined, 0x8c0 /* unexpected getViewOrError */);\n\t\treturn this.flexTreeContext;\n\t}\n\n\tpublic runTransaction<TSuccessValue, TFailureValue>(\n\t\ttransaction: () => TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>,\n\t\tparams?: RunTransactionParamsAlpha,\n\t): TransactionValueResult<TSuccessValue, TFailureValue>;\n\tpublic runTransaction(\n\t\ttransaction: () => VoidTransactionCallbackStatusAlpha | void,\n\t\tparams?: RunTransactionParamsAlpha,\n\t): TransactionVoidResult;\n\tpublic runTransaction<TSuccessValue, TFailureValue>(\n\t\ttransaction: () =>\n\t\t\t| TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>\n\t\t\t| VoidTransactionCallbackStatusAlpha\n\t\t\t| void,\n\t\tparams?: RunTransactionParamsAlpha,\n\t): TransactionValueResult<TSuccessValue, TFailureValue> | TransactionVoidResult {\n\t\tthis.ensureUndisposed();\n\t\treturn this.checkout.runTransaction(transaction, params);\n\t}\n\n\tpublic runTransactionAsync<TSuccessValue, TFailureValue>(\n\t\ttransaction: () => Promise<TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>>,\n\t\tparams?: RunTransactionParamsAlpha,\n\t): Promise<TransactionValueResult<TSuccessValue, TFailureValue>>;\n\tpublic runTransactionAsync(\n\t\ttransaction: () => Promise<VoidTransactionCallbackStatusAlpha | void>,\n\t\tparams?: RunTransactionParamsAlpha,\n\t): Promise<TransactionVoidResult>;\n\tpublic async runTransactionAsync<TSuccessValue, TFailureValue>(\n\t\ttransaction: () => Promise<\n\t\t\t| TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>\n\t\t\t| VoidTransactionCallbackStatusAlpha\n\t\t\t| void\n\t\t>,\n\t\tparams: RunTransactionParamsAlpha | undefined,\n\t): Promise<TransactionValueResult<TSuccessValue, TFailureValue> | TransactionVoidResult> {\n\t\tthis.ensureUndisposed();\n\t\tif (this.checkout.transaction.size > 0) {\n\t\t\t// breaker.break() sets brokenBy synchronously before throwing.\n\t\t\t// A plain `throw` inside an async function would be captured as a rejected Promise\n\t\t\t// before @breakingClass could set brokenBy. By setting it here first, the\n\t\t\t// subsequent call to unmountTransaction (also @breakingClass-wrapped) will see the\n\t\t\t// broken state and throw synchronously, propagating out of the outer runTransaction\n\t\t\t// to its caller.\n\t\t\tthis.breaker.break(\n\t\t\t\tnew UsageError(\n\t\t\t\t\t\"An asynchronous transaction cannot be started while another transaction is already in progress.\",\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t\treturn this.checkout.runTransactionAsync(transaction, params);\n\t}\n\n\tprivate ensureUndisposed(): void {\n\t\tif (this.disposed) {\n\t\t\tthis.failDisposed();\n\t\t}\n\t}\n\n\tprivate failDisposed(): never {\n\t\tthrow new UsageError(\"Accessed a disposed TreeView.\");\n\t}\n\n\t/**\n\t * Updates `this.view` and the current compatibility status.\n\t * Invoked during initialization and when `this.view` needs to be replaced due to stored schema changes.\n\t * Handles re-registering for events to call update in the future.\n\t * @remarks\n\t * This does not check if the view needs to be replaced, it replaces it unconditionally:\n\t * callers should do any checking to detect if it's really needed before calling `update`.\n\t * @privateRemarks\n\t * This implementation avoids making any edits, which prevents it from being invoked reentrantly.\n\t * If implicit initialization (or some other edit) is desired, it should be done outside of this method.\n\t */\n\tprivate update(): void {\n\t\tthis.disposeFlexView();\n\n\t\tconst compatibility = this.computeCompatibility();\n\t\tthis.currentCompatibility = compatibility;\n\n\t\tconst anchors = this.checkout.forest.anchors;\n\t\tconst slots = anchors.slots;\n\n\t\tif (compatibility.canView) {\n\t\t\tthis.flexTreeContext = new Context(\n\t\t\t\tdefaultSchemaPolicy,\n\t\t\t\tthis.checkout,\n\t\t\t\tthis.nodeKeyManager,\n\t\t\t);\n\t\t\tassert(!slots.has(SimpleContextSlot), 0xa47 /* extra simple tree context */);\n\t\t\tassert(\n\t\t\t\tthis.rootFieldSchema instanceof FieldSchemaAlpha,\n\t\t\t\t0xbfa /* all field schema should be FieldSchemaAlpha */,\n\t\t\t);\n\t\t\tslots.set(\n\t\t\t\tSimpleContextSlot,\n\t\t\t\tnew HydratedContext(\n\t\t\t\t\tthis.flexTreeContext,\n\t\t\t\t\tHydratedContext.schemaMapFromRootSchema(\n\t\t\t\t\t\tthis.rootFieldSchema.allowedTypesFull.evaluate(),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t// Trigger \"rootChanged\" events if the root changes in the future.\n\t\t\t{\n\t\t\t\t// Currently there is no good way to do this as FlexTreeField has no events for changes.\n\t\t\t\t// this.root.on(????)\n\t\t\t\t// As a workaround for the above, trigger \"rootChanged\" in \"afterBatch\".\n\t\t\t\t// Ideally these events would be just events for changes within the root.\n\t\t\t\t// TODO: provide a better event: this.view.flexTree.on(????) and/or integrate with with the normal event code paths.\n\n\t\t\t\t// Track what the root was before to be able to detect changes.\n\t\t\t\t// This uses the flex tree root to avoid demanding the simple-tree TreeNode when it might not be hydrated yet.\n\t\t\t\tlet lastRoot: FlexTreeUnknownUnboxed | undefined = (\n\t\t\t\t\tthis.flexTreeContext.root as FlexTreeOptionalField\n\t\t\t\t).content;\n\n\t\t\t\tthis.flexTreeViewUnregisterCallbacks.add(\n\t\t\t\t\tthis.checkout.events.on(\"afterBatch\", () => {\n\t\t\t\t\t\t// In the initialization flow, this event is raised before the correct compatibility w.r.t the new schema is calculated.\n\t\t\t\t\t\t// Accessing `this.root` in that case can throw. It's OK to ignore this because:\n\t\t\t\t\t\t// - The rootChanged event will already be raised at the end of the current upgrade\n\t\t\t\t\t\t// - It doesn't matter that `lastRoot` isn't updated in this case, because `update` will be called again before the upgrade\n\t\t\t\t\t\t// completes (at which point this callback and the `lastRoot` captured here will be out of scope anyway)\n\t\t\t\t\t\tif (!this.midUpgrade && lastRoot !== this.flexRoot.content) {\n\t\t\t\t\t\t\tlastRoot = this.flexRoot.content;\n\t\t\t\t\t\t\tthis.events.emit(\"rootChanged\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tthis.flexTreeViewUnregisterCallbacks.add(\n\t\t\t// Will dispose the old view (if there is one) when its no longer valid, and create a new one if appropriate.\n\t\t\tthis.checkout.storedSchema.events.on(\"afterSchemaChange\", () => this.update()),\n\t\t);\n\n\t\tif (!this.midUpgrade) {\n\t\t\tassert(\n\t\t\t\tthis.pendingHydration === undefined,\n\t\t\t\t0xc76 /* no nodes should be pending hydration when triggering events that could access nodes */,\n\t\t\t);\n\t\t\tthis.events.emit(\"schemaChanged\");\n\t\t\tthis.events.emit(\"rootChanged\");\n\t\t}\n\t}\n\n\tprivate computeCompatibility(): SchemaCompatibilityStatus {\n\t\tconst compatibility = checkSchemaCompatibility(\n\t\t\tthis.viewSchema,\n\t\t\tthis.checkout.storedSchema,\n\t\t\tthis.stagedUpgradePolicy,\n\t\t);\n\t\treturn {\n\t\t\t...compatibility,\n\t\t\tcanInitialize: canInitialize(this.checkout),\n\t\t};\n\t}\n\n\tprivate runSchemaEdit(edit: () => void): void {\n\t\tthis.midUpgrade = true;\n\t\ttry {\n\t\t\tedit();\n\t\t} finally {\n\t\t\tthis.midUpgrade = false;\n\t\t}\n\t\t// Ensure hydration is flushed before events run which could access nodes.\n\t\tthis.pendingHydration?.();\n\t\tthis.pendingHydration = undefined;\n\t\tthis.events.emit(\"schemaChanged\");\n\t\tthis.events.emit(\"rootChanged\");\n\t}\n\n\tprivate disposeFlexView(): void {\n\t\tconst anchors = this.checkout.forest.anchors;\n\t\tif (this.flexTreeContext !== undefined) {\n\t\t\t// Cleanup any TreeNodes cached in the AnchorSet when disposing the flex-tree which they wrap.\n\t\t\tfor (const anchorNode of anchors) {\n\t\t\t\ttryDisposeTreeNode(anchorNode);\n\t\t\t}\n\n\t\t\tthis.flexTreeContext[disposeSymbol]();\n\t\t\tthis.flexTreeContext = undefined;\n\t\t}\n\t\tfor (const unregister of this.flexTreeViewUnregisterCallbacks) {\n\t\t\tunregister();\n\t\t}\n\t\tthis.flexTreeViewUnregisterCallbacks.clear();\n\t\tanchors.slots.delete(SimpleContextSlot);\n\t}\n\n\tpublic get compatibility(): SchemaCompatibilityStatus {\n\t\tif (!this.currentCompatibility) {\n\t\t\tthis.failDisposed();\n\t\t}\n\t\treturn this.currentCompatibility;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.disposed = true;\n\t\tthis.disposeFlexView();\n\t\tfor (const unregister of this.unregisterCallbacks) {\n\t\t\tunregister();\n\t\t}\n\t\tthis.checkout.forest.anchors.slots.delete(ViewSlot);\n\t\tthis.currentCompatibility = undefined;\n\t\tthis.onDispose?.();\n\t\tif (!this.checkout.isSharedBranch && !this.checkout.disposed) {\n\t\t\t// All non-shared branches are 1:1 with views, so if a user manually disposes a view, we should also dispose the checkout/branch.\n\t\t\tthis.checkout.dispose();\n\t\t}\n\t}\n\n\tprivate get flexRoot(): FlexTreeOptionalField | FlexTreeRequiredField {\n\t\tthis.breaker.use();\n\t\tif (!this.compatibility.canView) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"Document is out of schema. Check TreeView.compatibility before accessing TreeView.root.\",\n\t\t\t);\n\t\t}\n\t\tconst view = this.getFlexTreeContext();\n\t\tassert(\n\t\t\tview.root.is(FieldKinds.optional) ||\n\t\t\t\tview.root.is(FieldKinds.required) ||\n\t\t\t\tview.root.is(FieldKinds.identifier),\n\t\t\t0xc77 /* unexpected root field kind */,\n\t\t);\n\t\treturn view.root;\n\t}\n\n\tpublic get root(): ReadableField<TRootSchema> {\n\t\treturn tryGetTreeNodeForField(this.flexRoot) as ReadableField<TRootSchema>;\n\t}\n\n\tpublic set root(newRoot: InsertableField<TRootSchema>) {\n\t\tthis.breaker.use();\n\t\tif (!this.compatibility.canView) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"Document is out of schema. Check TreeView.compatibility before accessing TreeView.root.\",\n\t\t\t);\n\t\t}\n\t\tconst view = this.getFlexTreeContext();\n\t\tsetField(\n\t\t\tview.root,\n\t\t\tthis.rootFieldSchema,\n\t\t\tnewRoot as InsertableContent | undefined,\n\t\t\tthis.checkout.storedSchema.rootFieldSchema,\n\t\t);\n\t}\n\n\t// #region Branching\n\n\tpublic fork(): ReturnType<UntypedTreeViewAlpha[\"fork\"]> &\n\t\tSchematizingSimpleTreeView<TRootSchema> {\n\t\treturn this.checkout.fork().viewWith(this.config);\n\t}\n\n\tpublic rewindTo(revision: string): void {\n\t\tthis.checkout.rewindTo(revision);\n\t}\n\n\tpublic revertTo(revision: string, options?: RevertToOptionsAlpha): void {\n\t\tthis.checkout.revertTo(revision, options);\n\t}\n\n\tpublic merge(context: UntypedTreeViewAlpha, disposeMerged = true): void {\n\t\tthis.checkout.merge(context, disposeMerged);\n\t}\n\n\tpublic rebaseOnto(context: UntypedTreeViewAlpha): void {\n\t\tthis.checkout.rebaseOnto(context);\n\t}\n\n\tpublic isMissingEditsFrom(context: UntypedTreeViewAlpha): boolean {\n\t\treturn this.checkout.isMissingEditsFrom(context);\n\t}\n\n\tpublic computeNetChangeIfRebasedOnto(\n\t\tcontext: UntypedTreeViewAlpha,\n\t): JsonCompatibleReadOnly | undefined {\n\t\treturn this.checkout.computeNetChangeIfRebasedOnto(context);\n\t}\n\n\t// #endregion Branching\n\n\tpublic get branchHistory(): TreeBranchHistory {\n\t\treturn this.checkout.branchHistory;\n\t}\n}\n"]}
1
+ {"version":3,"file":"schematizingTreeView.js","sourceRoot":"","sources":["../../src/shared-tree/schematizingTreeView.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,+DAA6D;AAM7D,kEAA6D;AAC7D,uEAA0F;AAE1F,+CAAuF;AACvF,4DAWuC;AACvC,sDAsCiC;AACjC,+CAM0B;AAE1B,2DAAsF;AAGtF;;;GAGG;AACU,QAAA,QAAQ,GAAG,IAAA,qBAAU,GAAoB,CAAC;AAEvD,SAAS,2BAA2B,CAAC,aAA4C;IAChF,IAAI,aAAa,CAAC,OAAO,EAAE,CAAC;QAC3B,OAAO;IACR,CAAC;IAED,MAAM,UAAU,GAAG,aAAa,CAAC,aAAa;QAC7C,CAAC,CAAC,oGAAoG;QACtG,CAAC,CAAC,aAAa,CAAC,UAAU;YACzB,CAAC,CAAC,2GAA2G;YAC7G,CAAC,CAAC,gIAAgI,CAAC;IACrI,MAAM,IAAI,qBAAU,CACnB,gGAAgG,UAAU,EAAE,EAC5G,IAAA,6BAAkB,EAAC;QAClB,4BAA4B,EAC3B,aAAa,CAAC,aAAa,KAAK,SAAS;YACxC,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,aAAa,CAAC;KAC/C,CAAC,CACF,CAAC;AACH,CAAC;AAED;;GAEG;IAEU,0BAA0B;4BADtC,wBAAa;;;;;;;;YACd,qLAmhBC;;;YAnhBY,+DAA0B;;QA6DrB,QAAQ;QACR,MAAM;QACN,cAAc;QACb,SAAS;QA5D3B;;;;WAIG;QACK,eAAe,CAAsB;QAE7C;;WAEG;QACK,oBAAoB,CAA4C;QACxE;;;WAGG;QACK,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AO,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAClD,CAAC;QAEM,6BAA6B,CACnC,OAA6B;YAE7B,OAAO,IAAI,CAAC,QAAQ,CAAC,6BAA6B,CAAC,OAAO,CAAC,CAAC;QAC7D,CAAC;QAED,uBAAuB;QAEvB,IAAW,aAAa;YACvB,OAAO,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC;QACpC,CAAC;;;;AAlhBW,gEAA0B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { createEmitter } from \"@fluid-internal/client-utils\";\nimport type {\n\tHasListeners,\n\tIEmitter,\n\tListenable,\n} from \"@fluidframework/core-interfaces/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { tagSchemaArtifacts, UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { anchorSlot, rootFieldKey, type RevertToOptionsAlpha } from \"../core/index.js\";\nimport {\n\ttype NodeIdentifierManager,\n\tdefaultSchemaPolicy,\n\tcursorForMapTreeField,\n\tContext,\n\tcombineChunks,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeUnknownUnboxed,\n\tFieldKinds,\n\ttype FlexTreeRequiredField,\n\tallowsRepoSuperset,\n} from \"../feature-libraries/index.js\";\nimport {\n\ttype ImplicitFieldSchema,\n\ttype SchemaCompatibilityStatusBeta,\n\ttype TreeContextAlpha,\n\ttype TreeViewEvents,\n\ttryGetTreeNodeForField,\n\tsetField,\n\tnormalizeFieldSchema,\n\tcheckSchemaCompatibility,\n\ttype InsertableContent,\n\ttype StagedSchemaUpgradePolicy,\n\ttype TreeViewConfiguration,\n\ttype TreeViewAlpha,\n\ttype InsertableField,\n\ttype ReadableField,\n\ttype ReadSchema,\n\ttype UnsafeUnknownSchema,\n\ttype TreeBranchEvents,\n\ttype VoidTransactionCallbackStatusAlpha,\n\ttype TransactionCallbackStatusAlpha,\n\ttype TransactionVoidResult,\n\ttype TransactionValueResult,\n\ttype RunTransactionParamsAlpha,\n\tHydratedContext,\n\tSimpleContextSlot,\n\tareImplicitFieldSchemaEqual,\n\tprepareForInsertionContextless,\n\ttype FieldSchema,\n\ttryDisposeTreeNode,\n\tFieldSchemaAlpha,\n\tTreeViewConfigurationAlpha,\n\ttoInitialSchema,\n\ttoUpgradeSchema,\n\ttype TreeBranchHistory,\n\ttype UntypedTreeViewAlpha,\n\ttype TreeSchema,\n\ttype SchemaUpgrade,\n\ttype StagedUpgradeStatus,\n} from \"../simple-tree/index.js\";\nimport {\n\ttype Breakable,\n\tbreakingClass,\n\tdisposeSymbol,\n\ttype JsonCompatibleReadOnly,\n\ttype WithBreakable,\n} from \"../util/index.js\";\n\nimport { canInitialize, initialize, initializerFromChunk } from \"./schematizeTree.js\";\nimport type { TreeCheckout } from \"./treeCheckout.js\";\n\n/**\n * Creating multiple tree views from the same checkout is not supported. This slot is used to detect if one already\n * exists and error if creating a second.\n */\nexport const ViewSlot = anchorSlot<TreeContextAlpha>();\n\nfunction throwIfSchemaIsIncompatible(compatibility: SchemaCompatibilityStatusBeta): void {\n\tif (compatibility.canView) {\n\t\treturn;\n\t}\n\n\tconst resolution = compatibility.canInitialize\n\t\t? \"The document is uninitialized; call TreeView.initialize() before reading or writing TreeView.root.\"\n\t\t: compatibility.canUpgrade\n\t\t\t? \"The stored schema can be upgraded; call TreeView.upgradeSchema() before reading or writing TreeView.root.\"\n\t\t\t: \"The schemas cannot be upgraded automatically. Use a compatible view schema or explicitly migrate the document schema and data.\";\n\tthrow new UsageError(\n\t\t`TreeView.root is unavailable because the view schema is incompatible with the stored schema. ${resolution}`,\n\t\ttagSchemaArtifacts({\n\t\t\tschemaIncompatibilityDetails:\n\t\t\t\tcompatibility.discrepancies === undefined\n\t\t\t\t\t? undefined\n\t\t\t\t\t: JSON.stringify(compatibility.discrepancies),\n\t\t}),\n\t);\n}\n\n/**\n * Implementation of TreeView wrapping a FlexTreeView.\n */\n@breakingClass\nexport class SchematizingSimpleTreeView<\n\tin out TRootSchema extends ImplicitFieldSchema | UnsafeUnknownSchema,\n> implements TreeViewAlpha<TRootSchema>, WithBreakable\n{\n\t/**\n\t * This is set to undefined when this object is disposed or the view schema does not support viewing the document's stored schema.\n\t *\n\t * The view schema may be incompatible with the stored schema. Use `compatibility` to check.\n\t */\n\tprivate flexTreeContext: Context | undefined;\n\n\t/**\n\t * Undefined if and only if uninitialized or disposed.\n\t */\n\tprivate currentCompatibility: SchemaCompatibilityStatusBeta | undefined;\n\t/**\n\t * Cached map of upgrade statuses, computed alongside compatibility.\n\t * @remarks Undefined if and only if uninitialized or disposed.\n\t */\n\tprivate currentEnabledUpgrades: ReadonlyMap<SchemaUpgrade, StagedUpgradeStatus> | undefined;\n\tpublic readonly events: Listenable<TreeViewEvents & TreeBranchEvents> &\n\t\tIEmitter<TreeViewEvents & TreeBranchEvents> &\n\t\tHasListeners<TreeViewEvents & TreeBranchEvents> = createEmitter();\n\n\t/**\n\t * The schema for this view, captured at construction time for compatibility checking.\n\t */\n\tprivate readonly viewSchema: TreeSchema;\n\t/**\n\t * Stored-schema generation policy from the view configuration, frozen at construction time.\n\t */\n\tprivate readonly stagedUpgradePolicy: StagedSchemaUpgradePolicy;\n\n\t/**\n\t * Events to unregister upon flex-tree view disposal.\n\t */\n\tprivate readonly flexTreeViewUnregisterCallbacks = new Set<() => void>();\n\n\t/**\n\t * Events to unregister upon disposal.\n\t */\n\tprivate readonly unregisterCallbacks = new Set<() => void>();\n\n\tpublic disposed = false;\n\t/**\n\t * This is set to true while an edit impacting the document schema is in progress.\n\t * This allows suppressing extra rootChanged / schemaChanged events until the edit concludes.\n\t * This is useful especially for some initialization edits, since document initialization can involve transient schemas\n\t * which are implementation details and should not be exposed to the user.\n\t */\n\tprivate midUpgrade = false;\n\n\t/**\n\t * Hydration work deferred until Context has been created.\n\t */\n\tprivate pendingHydration?: () => void;\n\n\tprivate readonly rootFieldSchema: FieldSchema;\n\tpublic readonly breaker: Breakable;\n\n\tpublic constructor(\n\t\tpublic readonly checkout: TreeCheckout,\n\t\tpublic readonly config: TreeViewConfiguration<ReadSchema<TRootSchema>>,\n\t\tpublic readonly nodeKeyManager: NodeIdentifierManager,\n\t\tprivate readonly onDispose?: () => void,\n\t) {\n\t\tthis.breaker = checkout.breaker;\n\t\tif (checkout.forest.anchors.slots.has(ViewSlot)) {\n\t\t\tthrow new UsageError(\"Cannot create a second tree view from the same checkout\");\n\t\t}\n\t\tcheckout.forest.anchors.slots.set(ViewSlot, this);\n\n\t\tthis.rootFieldSchema = normalizeFieldSchema(config.schema);\n\n\t\tconst stagedUpgradePolicy =\n\t\t\tconfig instanceof TreeViewConfigurationAlpha ? config.stagedUpgradePolicy : undefined;\n\t\tconst configAlpha = new TreeViewConfigurationAlpha({\n\t\t\t...config,\n\t\t\tstagedUpgradePolicy,\n\t\t});\n\t\tthis.stagedUpgradePolicy = configAlpha.stagedUpgradePolicy;\n\n\t\t// Store viewSchema directly from the configuration (TreeViewConfigurationAlpha implements TreeSchema)\n\t\tthis.viewSchema = configAlpha;\n\t\t// This must be initialized before `update` can be called.\n\t\tthis.currentCompatibility = {\n\t\t\tcanView: false,\n\t\t\tcanUpgrade: true,\n\t\t\tisEquivalent: false,\n\t\t\tcanInitialize: true,\n\t\t\tdiscrepancies: undefined,\n\t\t};\n\t\tthis.currentEnabledUpgrades = new Map();\n\t\tthis.update();\n\n\t\tthis.unregisterCallbacks.add(\n\t\t\tthis.checkout.events.on(\"changed\", (data, getRevertible) => {\n\t\t\t\tthis.events.emit(\"changed\", data, getRevertible);\n\t\t\t\tthis.events.emit(\"commitApplied\", data, getRevertible);\n\t\t\t}),\n\t\t);\n\t}\n\n\tpublic isBranch(): this is UntypedTreeViewAlpha {\n\t\treturn this.isView();\n\t}\n\n\tpublic isView(): this is UntypedTreeViewAlpha {\n\t\treturn true;\n\t}\n\n\tpublic applyChange(change: JsonCompatibleReadOnly): void {\n\t\tthis.checkout.applySerializedChange(change);\n\t}\n\n\tpublic hasRootSchema<TSchema extends ImplicitFieldSchema>(\n\t\tschema: TSchema,\n\t): this is TreeViewAlpha<TSchema> {\n\t\treturn areImplicitFieldSchemaEqual(this.rootFieldSchema, schema);\n\t}\n\n\tpublic get schema(): ReadSchema<TRootSchema> {\n\t\treturn this.config.schema;\n\t}\n\n\tpublic initialize(content: InsertableField<TRootSchema>): void {\n\t\tthis.ensureUndisposed();\n\n\t\tconst compatibility = this.compatibility;\n\t\tif (!compatibility.canInitialize) {\n\t\t\tthrow new UsageError(\"Tree cannot be initialized more than once.\");\n\t\t}\n\n\t\tthis.runSchemaEdit(() => {\n\t\t\tconst schema = toInitialSchema(this.config.schema, this.stagedUpgradePolicy);\n\t\t\t// This has to be the contextless version, since when \"initialize\" is called (right after this),\n\t\t\t// it will do a schema change which would dispose of the current context (see inside `update`).\n\t\t\t// Thus using the current context (if any) would hydrate nodes then\n\t\t\t// immediately dispose them instead of having them actually be useable after initialize.\n\t\t\t// For this to work,\n\t\t\t// the hydration must be deferred until after the content is inserted into the tree and the final schema change is done (for required roots),\n\t\t\t// but before any user event could could run.\n\t\t\tconst mapTree = prepareForInsertionContextless(\n\t\t\t\tcontent as InsertableContent | undefined,\n\t\t\t\tthis.rootFieldSchema,\n\t\t\t\t{\n\t\t\t\t\tschema,\n\t\t\t\t\tpolicy: defaultSchemaPolicy,\n\t\t\t\t},\n\t\t\t\tthis,\n\t\t\t\tschema.rootFieldSchema,\n\t\t\t\t(batches, doHydration) => {\n\t\t\t\t\tassert(\n\t\t\t\t\t\tthis.pendingHydration === undefined,\n\t\t\t\t\t\t0xc74 /* pendingHydration already set */,\n\t\t\t\t\t);\n\t\t\t\t\tthis.pendingHydration = () => {\n\t\t\t\t\t\tassert(\n\t\t\t\t\t\t\tbatches.length <= 1,\n\t\t\t\t\t\t\t0xc75 /* initialize should at most one hydration batch */,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tfor (const batch of batches) {\n\t\t\t\t\t\t\tdoHydration(batch, {\n\t\t\t\t\t\t\t\tparent: undefined,\n\t\t\t\t\t\t\t\tparentField: rootFieldKey,\n\t\t\t\t\t\t\t\tparentIndex: 0,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t);\n\n\t\t\tthis.runTransaction(() => {\n\t\t\t\tinitialize(\n\t\t\t\t\tthis.checkout,\n\t\t\t\t\tschema,\n\t\t\t\t\tinitializerFromChunk(this.checkout, () => {\n\t\t\t\t\t\t// This must be done after initial schema is set!\n\t\t\t\t\t\treturn combineChunks(\n\t\t\t\t\t\t\tthis.checkout.forest.chunkField(\n\t\t\t\t\t\t\t\tcursorForMapTreeField(mapTree === undefined ? [] : [mapTree]),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t});\n\t\t});\n\t}\n\n\tpublic upgradeSchema(): void {\n\t\tthis.ensureUndisposed();\n\n\t\tconst newSchema = toUpgradeSchema(this.viewSchema.root, this.effectiveUpgradePolicy);\n\t\tconst storedSchema = this.checkout.storedSchema.clone();\n\t\tif (!allowsRepoSuperset(defaultSchemaPolicy, storedSchema, newSchema)) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"Existing stored schema cannot be upgraded to the requested schema (see TreeView.compatibility.canUpgrade).\",\n\t\t\t);\n\t\t}\n\t\tif (allowsRepoSuperset(defaultSchemaPolicy, newSchema, storedSchema)) {\n\t\t\t// No-op\n\t\t\treturn;\n\t\t}\n\n\t\tthis.runSchemaEdit(() => this.checkout.updateSchema(newSchema));\n\t}\n\n\tpublic isStagedUpgradeEnabled(upgrade: SchemaUpgrade): StagedUpgradeStatus {\n\t\tif (!this.currentEnabledUpgrades) {\n\t\t\tthis.failDisposed();\n\t\t}\n\t\treturn this.currentEnabledUpgrades.get(upgrade) ?? \"disabled\";\n\t}\n\n\tprivate get effectiveUpgradePolicy(): StagedSchemaUpgradePolicy {\n\t\tconst configuredPolicy = this.stagedUpgradePolicy;\n\t\tif (configuredPolicy.includeAlreadyEnabledUpgrades === false) {\n\t\t\treturn configuredPolicy;\n\t\t}\n\t\tconst enabledUpgrades = this.currentEnabledUpgrades;\n\t\tassert(\n\t\t\tenabledUpgrades !== undefined,\n\t\t\t0xd3e /* Enabled upgrades must be available for an active view */,\n\t\t);\n\t\tif (enabledUpgrades.size === 0) {\n\t\t\treturn configuredPolicy;\n\t\t}\n\n\t\treturn {\n\t\t\tincludeStaged: (upgrade) =>\n\t\t\t\tconfiguredPolicy.includeStaged(upgrade) || enabledUpgrades.has(upgrade),\n\t\t\tincludeStagedOptional: (upgrade) =>\n\t\t\t\tconfiguredPolicy.includeStagedOptional(upgrade) || enabledUpgrades.has(upgrade),\n\t\t};\n\t}\n\n\t/**\n\t * Gets the flex-tree context. Throws when disposed or out of schema.\n\t */\n\tpublic getFlexTreeContext(): Context {\n\t\tthis.ensureUndisposed();\n\t\tassert(this.flexTreeContext !== undefined, 0x8c0 /* unexpected getViewOrError */);\n\t\treturn this.flexTreeContext;\n\t}\n\n\tpublic runTransaction<TSuccessValue, TFailureValue>(\n\t\ttransaction: () => TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>,\n\t\tparams?: RunTransactionParamsAlpha,\n\t): TransactionValueResult<TSuccessValue, TFailureValue>;\n\tpublic runTransaction(\n\t\ttransaction: () => VoidTransactionCallbackStatusAlpha | void,\n\t\tparams?: RunTransactionParamsAlpha,\n\t): TransactionVoidResult;\n\tpublic runTransaction<TSuccessValue, TFailureValue>(\n\t\ttransaction: () =>\n\t\t\t| TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>\n\t\t\t| VoidTransactionCallbackStatusAlpha\n\t\t\t| void,\n\t\tparams?: RunTransactionParamsAlpha,\n\t): TransactionValueResult<TSuccessValue, TFailureValue> | TransactionVoidResult {\n\t\tthis.ensureUndisposed();\n\t\treturn this.checkout.runTransaction(transaction, params);\n\t}\n\n\tpublic runTransactionAsync<TSuccessValue, TFailureValue>(\n\t\ttransaction: () => Promise<TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>>,\n\t\tparams?: RunTransactionParamsAlpha,\n\t): Promise<TransactionValueResult<TSuccessValue, TFailureValue>>;\n\tpublic runTransactionAsync(\n\t\ttransaction: () => Promise<VoidTransactionCallbackStatusAlpha | void>,\n\t\tparams?: RunTransactionParamsAlpha,\n\t): Promise<TransactionVoidResult>;\n\tpublic async runTransactionAsync<TSuccessValue, TFailureValue>(\n\t\ttransaction: () => Promise<\n\t\t\t| TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>\n\t\t\t| VoidTransactionCallbackStatusAlpha\n\t\t\t| void\n\t\t>,\n\t\tparams: RunTransactionParamsAlpha | undefined,\n\t): Promise<TransactionValueResult<TSuccessValue, TFailureValue> | TransactionVoidResult> {\n\t\tthis.ensureUndisposed();\n\t\tif (this.checkout.transaction.size > 0) {\n\t\t\t// breaker.break() sets brokenBy synchronously before throwing.\n\t\t\t// A plain `throw` inside an async function would be captured as a rejected Promise\n\t\t\t// before @breakingClass could set brokenBy. By setting it here first, the\n\t\t\t// subsequent call to unmountTransaction (also @breakingClass-wrapped) will see the\n\t\t\t// broken state and throw synchronously, propagating out of the outer runTransaction\n\t\t\t// to its caller.\n\t\t\tthis.breaker.break(\n\t\t\t\tnew UsageError(\n\t\t\t\t\t\"An asynchronous transaction cannot be started while another transaction is already in progress.\",\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t\treturn this.checkout.runTransactionAsync(transaction, params);\n\t}\n\n\tprivate ensureUndisposed(): void {\n\t\tif (this.disposed) {\n\t\t\tthis.failDisposed();\n\t\t}\n\t}\n\n\tprivate failDisposed(): never {\n\t\tthrow new UsageError(\"Accessed a disposed TreeView.\");\n\t}\n\n\t/**\n\t * Updates `this.view` and the current compatibility status.\n\t * Invoked during initialization and when `this.view` needs to be replaced due to stored schema changes.\n\t * Handles re-registering for events to call update in the future.\n\t * @remarks\n\t * This does not check if the view needs to be replaced, it replaces it unconditionally:\n\t * callers should do any checking to detect if it's really needed before calling `update`.\n\t * @privateRemarks\n\t * This implementation avoids making any edits, which prevents it from being invoked reentrantly.\n\t * If implicit initialization (or some other edit) is desired, it should be done outside of this method.\n\t */\n\tprivate update(): void {\n\t\tthis.disposeFlexView();\n\n\t\tconst compatibility = this.computeCompatibility();\n\t\tthis.currentCompatibility = compatibility;\n\n\t\tconst anchors = this.checkout.forest.anchors;\n\t\tconst slots = anchors.slots;\n\n\t\tif (compatibility.canView) {\n\t\t\tthis.flexTreeContext = new Context(\n\t\t\t\tdefaultSchemaPolicy,\n\t\t\t\tthis.checkout,\n\t\t\t\tthis.nodeKeyManager,\n\t\t\t);\n\t\t\tassert(!slots.has(SimpleContextSlot), 0xa47 /* extra simple tree context */);\n\t\t\tassert(\n\t\t\t\tthis.rootFieldSchema instanceof FieldSchemaAlpha,\n\t\t\t\t0xbfa /* all field schema should be FieldSchemaAlpha */,\n\t\t\t);\n\t\t\tslots.set(\n\t\t\t\tSimpleContextSlot,\n\t\t\t\tnew HydratedContext(\n\t\t\t\t\tthis.flexTreeContext,\n\t\t\t\t\tHydratedContext.schemaMapFromRootSchema(\n\t\t\t\t\t\tthis.rootFieldSchema.allowedTypesFull.evaluate(),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t// Trigger \"rootChanged\" events if the root changes in the future.\n\t\t\t{\n\t\t\t\t// Currently there is no good way to do this as FlexTreeField has no events for changes.\n\t\t\t\t// this.root.on(????)\n\t\t\t\t// As a workaround for the above, trigger \"rootChanged\" in \"afterBatch\".\n\t\t\t\t// Ideally these events would be just events for changes within the root.\n\t\t\t\t// TODO: provide a better event: this.view.flexTree.on(????) and/or integrate with with the normal event code paths.\n\n\t\t\t\t// Track what the root was before to be able to detect changes.\n\t\t\t\t// This uses the flex tree root to avoid demanding the simple-tree TreeNode when it might not be hydrated yet.\n\t\t\t\tlet lastRoot: FlexTreeUnknownUnboxed | undefined = (\n\t\t\t\t\tthis.flexTreeContext.root as FlexTreeOptionalField\n\t\t\t\t).content;\n\n\t\t\t\tthis.flexTreeViewUnregisterCallbacks.add(\n\t\t\t\t\tthis.checkout.events.on(\"afterBatch\", () => {\n\t\t\t\t\t\t// In the initialization flow, this event is raised before the correct compatibility w.r.t the new schema is calculated.\n\t\t\t\t\t\t// Accessing `this.root` in that case can throw. It's OK to ignore this because:\n\t\t\t\t\t\t// - The rootChanged event will already be raised at the end of the current upgrade\n\t\t\t\t\t\t// - It doesn't matter that `lastRoot` isn't updated in this case, because `update` will be called again before the upgrade\n\t\t\t\t\t\t// completes (at which point this callback and the `lastRoot` captured here will be out of scope anyway)\n\t\t\t\t\t\tif (!this.midUpgrade && lastRoot !== this.flexRoot.content) {\n\t\t\t\t\t\t\tlastRoot = this.flexRoot.content;\n\t\t\t\t\t\t\tthis.events.emit(\"rootChanged\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tthis.flexTreeViewUnregisterCallbacks.add(\n\t\t\t// Will dispose the old view (if there is one) when its no longer valid, and create a new one if appropriate.\n\t\t\tthis.checkout.storedSchema.events.on(\"afterSchemaChange\", () => this.update()),\n\t\t);\n\n\t\tif (!this.midUpgrade) {\n\t\t\tassert(\n\t\t\t\tthis.pendingHydration === undefined,\n\t\t\t\t0xc76 /* no nodes should be pending hydration when triggering events that could access nodes */,\n\t\t\t);\n\t\t\tthis.events.emit(\"schemaChanged\");\n\t\t\tthis.events.emit(\"rootChanged\");\n\t\t}\n\t}\n\n\t/**\n\t * Computes the current schema compatibility status and updates the cached enabled upgrades.\n\t */\n\tprivate computeCompatibility(): SchemaCompatibilityStatusBeta {\n\t\tconst { enabledUpgrades, ...compatibility } = checkSchemaCompatibility(\n\t\t\tthis.viewSchema,\n\t\t\tthis.checkout.storedSchema,\n\t\t\tthis.stagedUpgradePolicy,\n\t\t);\n\t\tthis.currentEnabledUpgrades = enabledUpgrades;\n\t\treturn {\n\t\t\t...compatibility,\n\t\t\tcanInitialize: canInitialize(this.checkout),\n\t\t};\n\t}\n\n\tprivate runSchemaEdit(edit: () => void): void {\n\t\tthis.midUpgrade = true;\n\t\ttry {\n\t\t\tedit();\n\t\t} finally {\n\t\t\tthis.midUpgrade = false;\n\t\t}\n\t\t// Ensure hydration is flushed before events run which could access nodes.\n\t\tthis.pendingHydration?.();\n\t\tthis.pendingHydration = undefined;\n\t\tthis.events.emit(\"schemaChanged\");\n\t\tthis.events.emit(\"rootChanged\");\n\t}\n\n\tprivate disposeFlexView(): void {\n\t\tconst anchors = this.checkout.forest.anchors;\n\t\tif (this.flexTreeContext !== undefined) {\n\t\t\t// Cleanup any TreeNodes cached in the AnchorSet when disposing the flex-tree which they wrap.\n\t\t\tfor (const anchorNode of anchors) {\n\t\t\t\ttryDisposeTreeNode(anchorNode);\n\t\t\t}\n\n\t\t\tthis.flexTreeContext[disposeSymbol]();\n\t\t\tthis.flexTreeContext = undefined;\n\t\t}\n\t\tfor (const unregister of this.flexTreeViewUnregisterCallbacks) {\n\t\t\tunregister();\n\t\t}\n\t\tthis.flexTreeViewUnregisterCallbacks.clear();\n\t\tanchors.slots.delete(SimpleContextSlot);\n\t}\n\n\tpublic get compatibility(): SchemaCompatibilityStatusBeta {\n\t\tif (!this.currentCompatibility) {\n\t\t\tthis.failDisposed();\n\t\t}\n\t\treturn this.currentCompatibility;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.disposed = true;\n\t\tthis.disposeFlexView();\n\t\tfor (const unregister of this.unregisterCallbacks) {\n\t\t\tunregister();\n\t\t}\n\t\tthis.checkout.forest.anchors.slots.delete(ViewSlot);\n\t\tthis.currentCompatibility = undefined;\n\t\tthis.currentEnabledUpgrades = undefined;\n\t\tthis.onDispose?.();\n\t\tif (!this.checkout.isSharedBranch && !this.checkout.disposed) {\n\t\t\t// All non-shared branches are 1:1 with views, so if a user manually disposes a view, we should also dispose the checkout/branch.\n\t\t\tthis.checkout.dispose();\n\t\t}\n\t}\n\n\tprivate get flexRoot(): FlexTreeOptionalField | FlexTreeRequiredField {\n\t\tthis.breaker.use();\n\t\tthrowIfSchemaIsIncompatible(this.compatibility);\n\t\tconst view = this.getFlexTreeContext();\n\t\tassert(\n\t\t\tview.root.is(FieldKinds.optional) ||\n\t\t\t\tview.root.is(FieldKinds.required) ||\n\t\t\t\tview.root.is(FieldKinds.identifier),\n\t\t\t0xc77 /* unexpected root field kind */,\n\t\t);\n\t\treturn view.root;\n\t}\n\n\tpublic get root(): ReadableField<TRootSchema> {\n\t\treturn tryGetTreeNodeForField(this.flexRoot) as ReadableField<TRootSchema>;\n\t}\n\n\tpublic set root(newRoot: InsertableField<TRootSchema>) {\n\t\tthis.breaker.use();\n\t\tthrowIfSchemaIsIncompatible(this.compatibility);\n\t\tconst view = this.getFlexTreeContext();\n\t\tsetField(\n\t\t\tview.root,\n\t\t\tthis.rootFieldSchema,\n\t\t\tnewRoot as InsertableContent | undefined,\n\t\t\tthis.checkout.storedSchema.rootFieldSchema,\n\t\t);\n\t}\n\n\t// #region Branching\n\n\tpublic fork(): ReturnType<UntypedTreeViewAlpha[\"fork\"]> &\n\t\tSchematizingSimpleTreeView<TRootSchema> {\n\t\treturn this.checkout.fork().viewWith(this.config);\n\t}\n\n\tpublic rewindTo(revision: string): void {\n\t\tthis.checkout.rewindTo(revision);\n\t}\n\n\tpublic revertTo(revision: string, options?: RevertToOptionsAlpha): void {\n\t\tthis.checkout.revertTo(revision, options);\n\t}\n\n\tpublic merge(context: UntypedTreeViewAlpha, disposeMerged = true): void {\n\t\tthis.checkout.merge(context, disposeMerged);\n\t}\n\n\tpublic rebaseOnto(context: UntypedTreeViewAlpha): void {\n\t\tthis.checkout.rebaseOnto(context);\n\t}\n\n\tpublic isMissingEditsFrom(context: UntypedTreeViewAlpha): boolean {\n\t\treturn this.checkout.isMissingEditsFrom(context);\n\t}\n\n\tpublic computeNetChangeIfRebasedOnto(\n\t\tcontext: UntypedTreeViewAlpha,\n\t): JsonCompatibleReadOnly | undefined {\n\t\treturn this.checkout.computeNetChangeIfRebasedOnto(context);\n\t}\n\n\t// #endregion Branching\n\n\tpublic get branchHistory(): TreeBranchHistory {\n\t\treturn this.checkout.branchHistory;\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"sharedTree.d.ts","sourceRoot":"","sources":["../../src/shared-tree/sharedTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAE3F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,KAAK,EAAE,aAAa,EAAY,MAAM,+BAA+B,CAAC;AAC7E,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AACjG,OAAO,KAAK,EACX,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,MAAM,6CAA6C,CAAC;AAGrD,OAAO,EACN,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAI1B,KAAK,aAAa,EAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEN,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,YAAY,EAOjB,KAAK,gBAAgB,EACrB,0BAA0B,EAC1B,KAAK,4BAA4B,EAKjC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAMN,uBAAuB,EAYvB,KAAK,yBAAyB,EAC9B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACN,KAAK,QAAQ,EACb,KAAK,uBAAuB,EAI5B,KAAK,6BAA6B,EAClC,oBAAoB,EACpB,cAAc,EACd,wBAAwB,EAExB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,KAAK,mBAAmB,EAExB,KAAK,UAAU,EAEf,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACb,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAIhB,KAAK,UAAU,EAGf,KAAK,UA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;;;;;;;;;GAWG;AACH,MAAM,WAAW,UAAW,SAAQ,UAAU,CAAC,YAAY,CAAC;CAAG;AAE/D;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,YAG/B,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,YAa/B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,wBAAwB,YAgBpC,CAAC;AAaF;;GAEG;AACH,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,4BAA4B,EACpC,YAAY,EAAE,aAAa,EAC3B,yBAAyB,EAAE,yBAAyB,GAClD,eAAe,CAOjB;AAED,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,yBAAyB,CAaxE,CAAC"}
@@ -4,10 +4,15 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.defaultSharedTreeOptions = exports.buildConfiguredForest = exports.ForestTypeExpensiveDebug = exports.ForestTypeOptimized = exports.ForestTypeReference = exports.getCodecTreeForSharedTreeFormat = exports.changeFormatVersionForMessage = exports.changeFormatVersionForEditManager = exports.persistedToSimpleSchema = exports.exportSimpleSchema = exports.SharedTreeKernel = void 0;
7
+ exports.defaultSharedTreeOptions = exports.ForestTypeExpensiveDebug = exports.ForestTypeOptimized = exports.ForestTypeReference = exports.changeFormatVersionForMessage = exports.changeFormatVersionForEditManager = exports.SharedTreeKernel = void 0;
8
+ exports.exportSimpleSchema = exportSimpleSchema;
9
+ exports.persistedToSimpleSchema = persistedToSimpleSchema;
10
+ exports.getCodecTreeForSharedTreeFormat = getCodecTreeForSharedTreeFormat;
11
+ exports.buildConfiguredForest = buildConfiguredForest;
8
12
  const tslib_1 = require("tslib");
9
13
  const internal_1 = require("@fluidframework/core-utils/internal");
10
14
  const internal_2 = require("@fluidframework/telemetry-utils/internal");
15
+ const semver_ts_1 = require("semver-ts");
11
16
  const index_js_1 = require("../codec/index.js");
12
17
  const index_js_2 = require("../core/index.js");
13
18
  const index_js_3 = require("../feature-libraries/index.js");
@@ -31,16 +36,36 @@ let SharedTreeKernel = (() => {
31
36
  let _classSuper = index_js_5.SharedTreeCore;
32
37
  let _instanceExtraInitializers = [];
33
38
  let _contentSnapshot_decorators;
34
- var SharedTreeKernel = _classThis = class extends _classSuper {
39
+ var SharedTreeKernel = class extends _classSuper {
40
+ static { _classThis = this; }
41
+ static {
42
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
43
+ _contentSnapshot_decorators = [index_js_7.throwIfBroken];
44
+ tslib_1.__esDecorate(this, null, _contentSnapshot_decorators, { kind: "method", name: "contentSnapshot", static: false, private: false, access: { has: obj => "contentSnapshot" in obj, get: obj => obj.contentSnapshot }, metadata: _metadata }, null, _instanceExtraInitializers);
45
+ tslib_1.__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
46
+ SharedTreeKernel = _classThis = _classDescriptor.value;
47
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
48
+ tslib_1.__runInitializers(_classThis, _classExtraInitializers);
49
+ }
50
+ checkout = tslib_1.__runInitializers(this, _instanceExtraInitializers);
35
51
  get storedSchema() {
36
52
  return this.checkout.storedSchema;
37
53
  }
54
+ checkouts = new Map();
55
+ /**
56
+ * The app-facing API for SharedTree implemented by this Kernel.
57
+ * @remarks
58
+ * This is the API grafted onto the ISharedObject which apps can access.
59
+ * It includes both the APIs used for internal testing, and public facing APIs (both stable and unstable).
60
+ * Different users will have access to different subsets of this API, see {@link ITree}, {@link ITreeAlpha} and {@link ITreeInternal} which this {@link ITreePrivate} extends.
61
+ */
62
+ view;
38
63
  constructor(breaker, sharedObject, serializer, submitLocalMessage, lastSequenceNumber, initialSequenceNumber, idCompressor, optionsParam) {
39
64
  const options = {
40
65
  ...exports.defaultSharedTreeOptions,
41
66
  ...optionsParam,
42
67
  };
43
- if (options.minVersionForCollab < index_js_1.FluidClientVersion.v2_0) {
68
+ if ((0, semver_ts_1.lt)(options.minVersionForCollab, index_js_1.FluidClientVersion.v2_0)) {
44
69
  throw new internal_2.UsageError("SharedTree requires minVersionForCollab of at least 2.0.0");
45
70
  }
46
71
  const schema = new index_js_2.TreeStoredSchemaRepository();
@@ -91,8 +116,6 @@ let SharedTreeKernel = (() => {
91
116
  throw error;
92
117
  });
93
118
  super(breaker, sharedObject, serializer, submitLocalMessage, [schemaSummarizer, forestSummarizer, removedRootsSummarizer], changeFamily, options, exports.changeFormatVersionForEditManager, exports.changeFormatVersionForMessage, idCompressor, schema, index_js_3.defaultSchemaPolicy);
94
- this.checkout = tslib_1.__runInitializers(this, _instanceExtraInitializers);
95
- this.checkouts = new Map();
96
119
  this.checkout = (0, treeCheckout_js_1.createTreeCheckout)(idCompressor, this.mintRevisionTag, revisionTagCodec, {
97
120
  branch: this.getLocalBranch(),
98
121
  changeFamily,
@@ -192,16 +215,6 @@ let SharedTreeKernel = (() => {
192
215
  }
193
216
  onDisconnect() { }
194
217
  };
195
- tslib_1.__setFunctionName(_classThis, "SharedTreeKernel");
196
- (() => {
197
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
198
- _contentSnapshot_decorators = [index_js_7.throwIfBroken];
199
- tslib_1.__esDecorate(_classThis, null, _contentSnapshot_decorators, { kind: "method", name: "contentSnapshot", static: false, private: false, access: { has: obj => "contentSnapshot" in obj, get: obj => obj.contentSnapshot }, metadata: _metadata }, null, _instanceExtraInitializers);
200
- tslib_1.__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
201
- SharedTreeKernel = _classThis = _classDescriptor.value;
202
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
203
- tslib_1.__runInitializers(_classThis, _classExtraInitializers);
204
- })();
205
218
  return SharedTreeKernel = _classThis;
206
219
  })();
207
220
  exports.SharedTreeKernel = SharedTreeKernel;
@@ -213,7 +226,6 @@ function exportSimpleSchema(storedSchema) {
213
226
  })),
214
227
  };
215
228
  }
216
- exports.exportSimpleSchema = exportSimpleSchema;
217
229
  /**
218
230
  * A way to parse schema in the persisted format from {@link extractPersistedSchema}.
219
231
  * @remarks
@@ -231,7 +243,6 @@ function persistedToSimpleSchema(persisted, options) {
231
243
  const stored = schemaCodec.decode(persisted);
232
244
  return exportSimpleSchema(stored);
233
245
  }
234
- exports.persistedToSimpleSchema = persistedToSimpleSchema;
235
246
  /**
236
247
  * Defines for each EditManagerFormatVersion the SharedTreeChangeFormatVersion to use.
237
248
  * This is an arbitrary mapping that is injected in the EditManger codec.
@@ -285,7 +296,6 @@ function getCodecTreeForSharedTreeFormat(clientVersion) {
285
296
  children,
286
297
  };
287
298
  }
288
- exports.getCodecTreeForSharedTreeFormat = getCodecTreeForSharedTreeFormat;
289
299
  /**
290
300
  * Reference implementation of forest.
291
301
  * @remarks
@@ -326,7 +336,6 @@ function toForestType(factory) {
326
336
  function buildConfiguredForest(breaker, factory, schema, idCompressor, shouldEncodeIncrementally) {
327
337
  return factory(breaker, schema, idCompressor, shouldEncodeIncrementally);
328
338
  }
329
- exports.buildConfiguredForest = buildConfiguredForest;
330
339
  exports.defaultSharedTreeOptions = {
331
340
  jsonValidator: index_js_1.FormatValidatorNoOp,
332
341
  minVersionForCollab: index_js_1.FluidClientVersion.v2_0,