@fluidframework/tree 2.0.0-dev-rc.5.0.0.271045 → 2.0.0-dev-rc.5.0.0.271717

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 (1607) hide show
  1. package/.eslintrc.cjs +5 -0
  2. package/api-report/tree.alpha.api.md +10 -21
  3. package/api-report/tree.beta.api.md +10 -21
  4. package/api-report/tree.public.api.md +10 -21
  5. package/dist/beta.d.ts +0 -1
  6. package/dist/codec/codec.d.ts +2 -2
  7. package/dist/codec/codec.d.ts.map +1 -1
  8. package/dist/codec/codec.js +0 -1
  9. package/dist/codec/codec.js.map +1 -1
  10. package/dist/codec/discriminatedUnions.d.ts +2 -2
  11. package/dist/codec/discriminatedUnions.d.ts.map +1 -1
  12. package/dist/codec/discriminatedUnions.js +0 -1
  13. package/dist/codec/discriminatedUnions.js.map +1 -1
  14. package/dist/codec/noopValidator.d.ts +1 -1
  15. package/dist/codec/noopValidator.d.ts.map +1 -1
  16. package/dist/codec/noopValidator.js.map +1 -1
  17. package/dist/codec/versioned/codec.d.ts +3 -3
  18. package/dist/codec/versioned/codec.d.ts.map +1 -1
  19. package/dist/codec/versioned/codec.js.map +1 -1
  20. package/dist/codec/versioned/format.d.ts +1 -1
  21. package/dist/codec/versioned/format.d.ts.map +1 -1
  22. package/dist/codec/versioned/format.js.map +1 -1
  23. package/dist/core/change-family/changeFamily.d.ts +5 -5
  24. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  25. package/dist/core/change-family/changeFamily.js.map +1 -1
  26. package/dist/core/change-family/editBuilder.d.ts +1 -1
  27. package/dist/core/change-family/editBuilder.d.ts.map +1 -1
  28. package/dist/core/change-family/editBuilder.js +0 -2
  29. package/dist/core/change-family/editBuilder.js.map +1 -1
  30. package/dist/core/forest/editableForest.d.ts +5 -5
  31. package/dist/core/forest/editableForest.d.ts.map +1 -1
  32. package/dist/core/forest/editableForest.js.map +1 -1
  33. package/dist/core/forest/forest.d.ts +3 -3
  34. package/dist/core/forest/forest.d.ts.map +1 -1
  35. package/dist/core/forest/forest.js.map +1 -1
  36. package/dist/core/rebase/changeRebaser.d.ts +1 -1
  37. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  38. package/dist/core/rebase/changeRebaser.js.map +1 -1
  39. package/dist/core/rebase/revisionTagCodec.d.ts +4 -4
  40. package/dist/core/rebase/revisionTagCodec.d.ts.map +1 -1
  41. package/dist/core/rebase/revisionTagCodec.js +0 -2
  42. package/dist/core/rebase/revisionTagCodec.js.map +1 -1
  43. package/dist/core/rebase/types.d.ts +3 -3
  44. package/dist/core/rebase/types.d.ts.map +1 -1
  45. package/dist/core/rebase/types.js.map +1 -1
  46. package/dist/core/rebase/utils.d.ts +2 -2
  47. package/dist/core/rebase/utils.d.ts.map +1 -1
  48. package/dist/core/rebase/utils.js.map +1 -1
  49. package/dist/core/schema-stored/format.d.ts +2 -2
  50. package/dist/core/schema-stored/format.d.ts.map +1 -1
  51. package/dist/core/schema-stored/format.js.map +1 -1
  52. package/dist/core/schema-stored/schema.d.ts +3 -3
  53. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  54. package/dist/core/schema-stored/schema.js +0 -4
  55. package/dist/core/schema-stored/schema.js.map +1 -1
  56. package/dist/core/schema-stored/storedSchemaRepository.d.ts +3 -3
  57. package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  58. package/dist/core/schema-stored/storedSchemaRepository.js +1 -3
  59. package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
  60. package/dist/core/schema-view/view.d.ts +1 -1
  61. package/dist/core/schema-view/view.d.ts.map +1 -1
  62. package/dist/core/schema-view/view.js +0 -2
  63. package/dist/core/schema-view/view.js.map +1 -1
  64. package/dist/core/tree/anchorSet.d.ts +56 -18
  65. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  66. package/dist/core/tree/anchorSet.js +97 -52
  67. package/dist/core/tree/anchorSet.js.map +1 -1
  68. package/dist/core/tree/cursor.d.ts +3 -3
  69. package/dist/core/tree/cursor.d.ts.map +1 -1
  70. package/dist/core/tree/cursor.js.map +1 -1
  71. package/dist/core/tree/delta.d.ts +3 -3
  72. package/dist/core/tree/delta.d.ts.map +1 -1
  73. package/dist/core/tree/delta.js.map +1 -1
  74. package/dist/core/tree/deltaUtil.d.ts +2 -2
  75. package/dist/core/tree/deltaUtil.d.ts.map +1 -1
  76. package/dist/core/tree/deltaUtil.js.map +1 -1
  77. package/dist/core/tree/detachedFieldIndex.d.ts +7 -7
  78. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  79. package/dist/core/tree/detachedFieldIndex.js +2 -8
  80. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  81. package/dist/core/tree/detachedFieldIndexCodec.d.ts +4 -4
  82. package/dist/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
  83. package/dist/core/tree/detachedFieldIndexCodec.js +0 -3
  84. package/dist/core/tree/detachedFieldIndexCodec.js.map +1 -1
  85. package/dist/core/tree/detachedFieldIndexFormat.d.ts +2 -2
  86. package/dist/core/tree/detachedFieldIndexFormat.d.ts.map +1 -1
  87. package/dist/core/tree/detachedFieldIndexFormat.js.map +1 -1
  88. package/dist/core/tree/detachedFieldIndexTypes.d.ts +3 -3
  89. package/dist/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
  90. package/dist/core/tree/detachedFieldIndexTypes.js.map +1 -1
  91. package/dist/core/tree/mapTree.d.ts +2 -2
  92. package/dist/core/tree/mapTree.d.ts.map +1 -1
  93. package/dist/core/tree/mapTree.js.map +1 -1
  94. package/dist/core/tree/pathTree.d.ts +3 -3
  95. package/dist/core/tree/pathTree.d.ts.map +1 -1
  96. package/dist/core/tree/pathTree.js.map +1 -1
  97. package/dist/core/tree/persistedTreeTextFormat.d.ts +1 -1
  98. package/dist/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  99. package/dist/core/tree/persistedTreeTextFormat.js.map +1 -1
  100. package/dist/core/tree/sparseTree.d.ts +2 -2
  101. package/dist/core/tree/sparseTree.d.ts.map +1 -1
  102. package/dist/core/tree/sparseTree.js +11 -15
  103. package/dist/core/tree/sparseTree.js.map +1 -1
  104. package/dist/core/tree/treeTextFormat.d.ts +2 -2
  105. package/dist/core/tree/treeTextFormat.d.ts.map +1 -1
  106. package/dist/core/tree/treeTextFormat.js.map +1 -1
  107. package/dist/core/tree/types.d.ts +3 -3
  108. package/dist/core/tree/types.d.ts.map +1 -1
  109. package/dist/core/tree/types.js +0 -1
  110. package/dist/core/tree/types.js.map +1 -1
  111. package/dist/core/tree/visitDelta.d.ts +5 -5
  112. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  113. package/dist/core/tree/visitDelta.js.map +1 -1
  114. package/dist/core/tree/visitPath.d.ts +2 -2
  115. package/dist/core/tree/visitPath.d.ts.map +1 -1
  116. package/dist/core/tree/visitPath.js.map +1 -1
  117. package/dist/core/tree/visitorUtils.d.ts +7 -7
  118. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  119. package/dist/core/tree/visitorUtils.js.map +1 -1
  120. package/dist/domains/json/jsonCursor.d.ts +2 -2
  121. package/dist/domains/json/jsonCursor.d.ts.map +1 -1
  122. package/dist/domains/json/jsonCursor.js.map +1 -1
  123. package/dist/domains/json/jsonDomainSchema.js.map +1 -1
  124. package/dist/domains/schemaBuilder.d.ts +2 -2
  125. package/dist/domains/schemaBuilder.d.ts.map +1 -1
  126. package/dist/domains/schemaBuilder.js +70 -70
  127. package/dist/domains/schemaBuilder.js.map +1 -1
  128. package/dist/events/events.js +1 -2
  129. package/dist/events/events.js.map +1 -1
  130. package/dist/feature-libraries/changeAtomIdCodec.d.ts +2 -2
  131. package/dist/feature-libraries/changeAtomIdCodec.d.ts.map +1 -1
  132. package/dist/feature-libraries/changeAtomIdCodec.js.map +1 -1
  133. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts +2 -2
  134. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  135. package/dist/feature-libraries/chunked-forest/basicChunk.js +1 -14
  136. package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  137. package/dist/feature-libraries/chunked-forest/chunk.d.ts +2 -2
  138. package/dist/feature-libraries/chunked-forest/chunk.d.ts.map +1 -1
  139. package/dist/feature-libraries/chunked-forest/chunk.js.map +1 -1
  140. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +4 -4
  141. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  142. package/dist/feature-libraries/chunked-forest/chunkTree.js +6 -13
  143. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  144. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -4
  145. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  146. package/dist/feature-libraries/chunked-forest/chunkedForest.js +2 -9
  147. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  148. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts +3 -3
  149. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts.map +1 -1
  150. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +3 -1
  151. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
  152. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +17 -7
  153. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  154. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +6 -11
  155. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  156. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +8 -8
  157. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  158. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +2 -5
  159. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  160. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +3 -3
  161. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  162. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +0 -1
  163. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  164. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +6 -5
  165. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  166. package/dist/feature-libraries/chunked-forest/codec/codecs.js +4 -1
  167. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  168. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +7 -7
  169. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  170. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +13 -25
  171. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  172. package/dist/feature-libraries/chunked-forest/codec/fieldBatch.d.ts +1 -1
  173. package/dist/feature-libraries/chunked-forest/codec/fieldBatch.d.ts.map +1 -1
  174. package/dist/feature-libraries/chunked-forest/codec/fieldBatch.js.map +1 -1
  175. package/dist/feature-libraries/chunked-forest/codec/format.d.ts +1 -1
  176. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  177. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  178. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +1 -1
  179. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  180. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  181. package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts +5 -5
  182. package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
  183. package/dist/feature-libraries/chunked-forest/codec/nodeShape.js +5 -8
  184. package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
  185. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts +6 -6
  186. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts.map +1 -1
  187. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js.map +1 -1
  188. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +2 -2
  189. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  190. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  191. package/dist/feature-libraries/chunked-forest/emptyChunk.d.ts +1 -1
  192. package/dist/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
  193. package/dist/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
  194. package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
  195. package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
  196. package/dist/feature-libraries/chunked-forest/sequenceChunk.js +0 -1
  197. package/dist/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
  198. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +2 -2
  199. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  200. package/dist/feature-libraries/chunked-forest/uniformChunk.js +5 -40
  201. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  202. package/dist/feature-libraries/contextuallyTyped.d.ts +5 -5
  203. package/dist/feature-libraries/contextuallyTyped.d.ts.map +1 -1
  204. package/dist/feature-libraries/contextuallyTyped.js.map +1 -1
  205. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -3
  206. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  207. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +0 -2
  208. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  209. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +3 -3
  210. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  211. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  212. package/dist/feature-libraries/default-schema/defaultSchema.d.ts +1 -1
  213. package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
  214. package/dist/feature-libraries/default-schema/defaultSchema.js.map +1 -1
  215. package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
  216. package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
  217. package/dist/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
  218. package/dist/feature-libraries/deltaUtils.d.ts +1 -1
  219. package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
  220. package/dist/feature-libraries/deltaUtils.js.map +1 -1
  221. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +4 -4
  222. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  223. package/dist/feature-libraries/detachedFieldIndexSummarizer.js +1 -2
  224. package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  225. package/dist/feature-libraries/editableTreeBinder.d.ts +3 -3
  226. package/dist/feature-libraries/editableTreeBinder.d.ts.map +1 -1
  227. package/dist/feature-libraries/editableTreeBinder.js +12 -13
  228. package/dist/feature-libraries/editableTreeBinder.js.map +1 -1
  229. package/dist/feature-libraries/fieldGenerator.d.ts +2 -2
  230. package/dist/feature-libraries/fieldGenerator.d.ts.map +1 -1
  231. package/dist/feature-libraries/fieldGenerator.js.map +1 -1
  232. package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts +5 -5
  233. package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
  234. package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +11 -12
  235. package/dist/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
  236. package/dist/feature-libraries/flex-tree/context.d.ts +8 -8
  237. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  238. package/dist/feature-libraries/flex-tree/context.js +3 -7
  239. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  240. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +9 -9
  241. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  242. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  243. package/dist/feature-libraries/flex-tree/index.d.ts +1 -1
  244. package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
  245. package/dist/feature-libraries/flex-tree/index.js +1 -4
  246. package/dist/feature-libraries/flex-tree/index.js.map +1 -1
  247. package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +4 -4
  248. package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
  249. package/dist/feature-libraries/flex-tree/lazyEntity.js +22 -13
  250. package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  251. package/dist/feature-libraries/flex-tree/lazyField.d.ts +6 -6
  252. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  253. package/dist/feature-libraries/flex-tree/lazyField.js +0 -6
  254. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  255. package/dist/feature-libraries/flex-tree/lazyNode.d.ts +5 -5
  256. package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  257. package/dist/feature-libraries/flex-tree/lazyNode.js +19 -13
  258. package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  259. package/dist/feature-libraries/flex-tree/treeEvents.d.ts +1 -13
  260. package/dist/feature-libraries/flex-tree/treeEvents.d.ts.map +1 -1
  261. package/dist/feature-libraries/flex-tree/treeEvents.js +0 -31
  262. package/dist/feature-libraries/flex-tree/treeEvents.js.map +1 -1
  263. package/dist/feature-libraries/flex-tree/unboxed.d.ts +5 -5
  264. package/dist/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
  265. package/dist/feature-libraries/flex-tree/unboxed.js.map +1 -1
  266. package/dist/feature-libraries/flex-tree/utilities.d.ts +1 -1
  267. package/dist/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
  268. package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
  269. package/dist/feature-libraries/forest-summary/codec.d.ts +3 -3
  270. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  271. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  272. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +7 -7
  273. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  274. package/dist/feature-libraries/forest-summary/forestSummarizer.js +1 -6
  275. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  276. package/dist/feature-libraries/forest-summary/format.d.ts +1 -1
  277. package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
  278. package/dist/feature-libraries/forest-summary/format.js.map +1 -1
  279. package/dist/feature-libraries/index.d.ts +1 -1
  280. package/dist/feature-libraries/index.d.ts.map +1 -1
  281. package/dist/feature-libraries/index.js +1 -3
  282. package/dist/feature-libraries/index.js.map +1 -1
  283. package/dist/feature-libraries/mapTreeCursor.d.ts +2 -2
  284. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  285. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  286. package/dist/feature-libraries/memoizedIdRangeAllocator.d.ts +1 -1
  287. package/dist/feature-libraries/memoizedIdRangeAllocator.d.ts.map +1 -1
  288. package/dist/feature-libraries/memoizedIdRangeAllocator.js.map +1 -1
  289. package/dist/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
  290. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  291. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  292. package/dist/feature-libraries/modular-schema/comparison.d.ts +2 -2
  293. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  294. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  295. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +2 -2
  296. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  297. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  298. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +7 -7
  299. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  300. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  301. package/dist/feature-libraries/modular-schema/fieldKind.d.ts +1 -1
  302. package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  303. package/dist/feature-libraries/modular-schema/fieldKind.js +0 -2
  304. package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  305. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
  306. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  307. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  308. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +3 -3
  309. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +1 -1
  310. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -3
  311. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
  312. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts +4 -4
  313. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  314. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  315. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
  316. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  317. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  318. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +1 -1
  319. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
  320. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
  321. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.d.ts +1 -1
  322. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.d.ts.map +1 -1
  323. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
  324. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts +2 -2
  325. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  326. package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  327. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +5 -5
  328. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  329. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +2 -0
  330. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  331. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +6 -6
  332. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  333. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +2 -5
  334. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  335. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +3 -3
  336. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  337. package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
  338. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +3 -3
  339. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  340. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  341. package/dist/feature-libraries/node-key/mockNodeKeyManager.d.ts +2 -2
  342. package/dist/feature-libraries/node-key/mockNodeKeyManager.d.ts.map +1 -1
  343. package/dist/feature-libraries/node-key/mockNodeKeyManager.js +4 -2
  344. package/dist/feature-libraries/node-key/mockNodeKeyManager.js.map +1 -1
  345. package/dist/feature-libraries/node-key/nodeKey.d.ts +3 -3
  346. package/dist/feature-libraries/node-key/nodeKey.d.ts.map +1 -1
  347. package/dist/feature-libraries/node-key/nodeKey.js.map +1 -1
  348. package/dist/feature-libraries/node-key/nodeKeyIndex.d.ts +4 -4
  349. package/dist/feature-libraries/node-key/nodeKeyIndex.d.ts.map +1 -1
  350. package/dist/feature-libraries/node-key/nodeKeyIndex.js +0 -3
  351. package/dist/feature-libraries/node-key/nodeKeyIndex.js.map +1 -1
  352. package/dist/feature-libraries/node-key/nodeKeyManager.d.ts +1 -1
  353. package/dist/feature-libraries/node-key/nodeKeyManager.d.ts.map +1 -1
  354. package/dist/feature-libraries/node-key/nodeKeyManager.js.map +1 -1
  355. package/dist/feature-libraries/object-forest/objectForest.d.ts +2 -2
  356. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  357. package/dist/feature-libraries/object-forest/objectForest.js +28 -23
  358. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  359. package/dist/feature-libraries/optional-field/optionalField.d.ts +3 -3
  360. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  361. package/dist/feature-libraries/optional-field/optionalField.js +3 -1
  362. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  363. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +1 -1
  364. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
  365. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -1
  366. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +1 -1
  367. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
  368. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -1
  369. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +2 -2
  370. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  371. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  372. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +3 -3
  373. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +1 -1
  374. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js.map +1 -1
  375. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +3 -3
  376. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  377. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  378. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
  379. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  380. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  381. package/dist/feature-libraries/schema-aware/schemaAware.d.ts +4 -4
  382. package/dist/feature-libraries/schema-aware/schemaAware.d.ts.map +1 -1
  383. package/dist/feature-libraries/schema-aware/schemaAware.js +0 -2
  384. package/dist/feature-libraries/schema-aware/schemaAware.js.map +1 -1
  385. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +2 -2
  386. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  387. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  388. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +1 -1
  389. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  390. package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  391. package/dist/feature-libraries/schema-edits/schemaChangeTypes.d.ts +1 -1
  392. package/dist/feature-libraries/schema-edits/schemaChangeTypes.d.ts.map +1 -1
  393. package/dist/feature-libraries/schema-edits/schemaChangeTypes.js.map +1 -1
  394. package/dist/feature-libraries/schema-index/codec.d.ts +2 -2
  395. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  396. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  397. package/dist/feature-libraries/schema-index/format.d.ts +1 -1
  398. package/dist/feature-libraries/schema-index/format.d.ts.map +1 -1
  399. package/dist/feature-libraries/schema-index/format.js.map +1 -1
  400. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +7 -7
  401. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  402. package/dist/feature-libraries/schema-index/schemaSummarizer.js +1 -5
  403. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  404. package/dist/feature-libraries/schemaBuilder.d.ts +2 -2
  405. package/dist/feature-libraries/schemaBuilder.d.ts.map +1 -1
  406. package/dist/feature-libraries/schemaBuilder.js.map +1 -1
  407. package/dist/feature-libraries/schemaBuilderBase.d.ts +4 -4
  408. package/dist/feature-libraries/schemaBuilderBase.d.ts.map +1 -1
  409. package/dist/feature-libraries/schemaBuilderBase.js +3 -14
  410. package/dist/feature-libraries/schemaBuilderBase.js.map +1 -1
  411. package/dist/feature-libraries/sequence-field/compose.d.ts +5 -5
  412. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  413. package/dist/feature-libraries/sequence-field/compose.js +0 -6
  414. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  415. package/dist/feature-libraries/sequence-field/formatV1.d.ts +1 -1
  416. package/dist/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
  417. package/dist/feature-libraries/sequence-field/formatV1.js.map +1 -1
  418. package/dist/feature-libraries/sequence-field/formatV2.d.ts +1 -1
  419. package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  420. package/dist/feature-libraries/sequence-field/formatV2.js.map +1 -1
  421. package/dist/feature-libraries/sequence-field/helperTypes.d.ts +1 -1
  422. package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  423. package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  424. package/dist/feature-libraries/sequence-field/invert.d.ts +3 -3
  425. package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  426. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  427. package/dist/feature-libraries/sequence-field/markListFactory.d.ts +1 -1
  428. package/dist/feature-libraries/sequence-field/markListFactory.d.ts.map +1 -1
  429. package/dist/feature-libraries/sequence-field/markListFactory.js +4 -3
  430. package/dist/feature-libraries/sequence-field/markListFactory.js.map +1 -1
  431. package/dist/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  432. package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  433. package/dist/feature-libraries/sequence-field/markQueue.js +2 -4
  434. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  435. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +5 -5
  436. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  437. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  438. package/dist/feature-libraries/sequence-field/prune.d.ts +2 -2
  439. package/dist/feature-libraries/sequence-field/prune.d.ts.map +1 -1
  440. package/dist/feature-libraries/sequence-field/prune.js.map +1 -1
  441. package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -3
  442. package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  443. package/dist/feature-libraries/sequence-field/rebase.js +0 -6
  444. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  445. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +3 -3
  446. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -1
  447. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
  448. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts +2 -2
  449. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  450. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  451. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts +3 -3
  452. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  453. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  454. package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts +2 -2
  455. package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts.map +1 -1
  456. package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js.map +1 -1
  457. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +5 -5
  458. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
  459. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
  460. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +5 -5
  461. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  462. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  463. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +4 -4
  464. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  465. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  466. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +3 -3
  467. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  468. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  469. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -3
  470. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  471. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  472. package/dist/feature-libraries/sequence-field/types.d.ts +2 -2
  473. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  474. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  475. package/dist/feature-libraries/sequence-field/utils.d.ts +5 -5
  476. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  477. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  478. package/dist/feature-libraries/storedToViewSchema.d.ts +2 -2
  479. package/dist/feature-libraries/storedToViewSchema.d.ts.map +1 -1
  480. package/dist/feature-libraries/storedToViewSchema.js.map +1 -1
  481. package/dist/feature-libraries/treeCursorUtils.d.ts +1 -1
  482. package/dist/feature-libraries/treeCursorUtils.d.ts.map +1 -1
  483. package/dist/feature-libraries/treeCursorUtils.js +9 -13
  484. package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
  485. package/dist/feature-libraries/treeTextCursor.d.ts +2 -2
  486. package/dist/feature-libraries/treeTextCursor.d.ts.map +1 -1
  487. package/dist/feature-libraries/treeTextCursor.js.map +1 -1
  488. package/dist/feature-libraries/typed-schema/schemaCollection.d.ts +3 -3
  489. package/dist/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
  490. package/dist/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
  491. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +4 -4
  492. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
  493. package/dist/feature-libraries/typed-schema/typedTreeSchema.js +4 -23
  494. package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
  495. package/dist/feature-libraries/typed-schema/view.d.ts +4 -4
  496. package/dist/feature-libraries/typed-schema/view.d.ts.map +1 -1
  497. package/dist/feature-libraries/typed-schema/view.js +0 -7
  498. package/dist/feature-libraries/typed-schema/view.js.map +1 -1
  499. package/dist/feature-libraries/valueUtilities.d.ts +2 -2
  500. package/dist/feature-libraries/valueUtilities.d.ts.map +1 -1
  501. package/dist/feature-libraries/valueUtilities.js.map +1 -1
  502. package/dist/index.d.ts +1 -1
  503. package/dist/index.d.ts.map +1 -1
  504. package/dist/index.js +1 -2
  505. package/dist/index.js.map +1 -1
  506. package/dist/packageVersion.d.ts +1 -1
  507. package/dist/packageVersion.js +1 -1
  508. package/dist/packageVersion.js.map +1 -1
  509. package/dist/public.d.ts +0 -1
  510. package/dist/shared-tree/schematizeTree.d.ts +3 -3
  511. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  512. package/dist/shared-tree/schematizeTree.js.map +1 -1
  513. package/dist/shared-tree/schematizingTreeView.d.ts +4 -4
  514. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  515. package/dist/shared-tree/schematizingTreeView.js +10 -27
  516. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  517. package/dist/shared-tree/sharedTree.d.ts +15 -11
  518. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  519. package/dist/shared-tree/sharedTree.js +13 -10
  520. package/dist/shared-tree/sharedTree.js.map +1 -1
  521. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +4 -4
  522. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  523. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  524. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +3 -3
  525. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  526. package/dist/shared-tree/sharedTreeChangeEnricher.js +11 -14
  527. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  528. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
  529. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  530. package/dist/shared-tree/sharedTreeChangeFamily.js +3 -5
  531. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  532. package/dist/shared-tree/sharedTreeChangeFormat.d.ts +1 -1
  533. package/dist/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
  534. package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  535. package/dist/shared-tree/sharedTreeChangeTypes.d.ts +1 -1
  536. package/dist/shared-tree/sharedTreeChangeTypes.d.ts.map +1 -1
  537. package/dist/shared-tree/sharedTreeChangeTypes.js.map +1 -1
  538. package/dist/shared-tree/sharedTreeEditBuilder.d.ts +3 -3
  539. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  540. package/dist/shared-tree/sharedTreeEditBuilder.js +0 -2
  541. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  542. package/dist/shared-tree/treeApi.d.ts +1 -1
  543. package/dist/shared-tree/treeApi.d.ts.map +1 -1
  544. package/dist/shared-tree/treeApi.js.map +1 -1
  545. package/dist/shared-tree/treeCheckout.d.ts +7 -7
  546. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  547. package/dist/shared-tree/treeCheckout.js +11 -22
  548. package/dist/shared-tree/treeCheckout.js.map +1 -1
  549. package/dist/shared-tree/treeView.d.ts +3 -3
  550. package/dist/shared-tree/treeView.d.ts.map +1 -1
  551. package/dist/shared-tree/treeView.js +0 -6
  552. package/dist/shared-tree/treeView.js.map +1 -1
  553. package/dist/shared-tree-core/branch.d.ts +2 -2
  554. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  555. package/dist/shared-tree-core/branch.js +25 -31
  556. package/dist/shared-tree-core/branch.js.map +1 -1
  557. package/dist/shared-tree-core/branchCommitEnricher.d.ts +2 -2
  558. package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  559. package/dist/shared-tree-core/branchCommitEnricher.js +9 -12
  560. package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
  561. package/dist/shared-tree-core/changeEnricher.d.ts +1 -1
  562. package/dist/shared-tree-core/changeEnricher.d.ts.map +1 -1
  563. package/dist/shared-tree-core/changeEnricher.js.map +1 -1
  564. package/dist/shared-tree-core/defaultResubmitMachine.d.ts +2 -2
  565. package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  566. package/dist/shared-tree-core/defaultResubmitMachine.js +19 -21
  567. package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  568. package/dist/shared-tree-core/editManager.d.ts +3 -3
  569. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  570. package/dist/shared-tree-core/editManager.js +37 -53
  571. package/dist/shared-tree-core/editManager.js.map +1 -1
  572. package/dist/shared-tree-core/editManagerCodecs.d.ts +5 -5
  573. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  574. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  575. package/dist/shared-tree-core/editManagerFormat.d.ts +4 -4
  576. package/dist/shared-tree-core/editManagerFormat.d.ts.map +1 -1
  577. package/dist/shared-tree-core/editManagerFormat.js.map +1 -1
  578. package/dist/shared-tree-core/editManagerSummarizer.d.ts +9 -9
  579. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  580. package/dist/shared-tree-core/editManagerSummarizer.js +1 -5
  581. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  582. package/dist/shared-tree-core/messageCodecs.d.ts +5 -5
  583. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  584. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  585. package/dist/shared-tree-core/messageFormat.d.ts +4 -4
  586. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  587. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  588. package/dist/shared-tree-core/messageTypes.d.ts +2 -2
  589. package/dist/shared-tree-core/messageTypes.d.ts.map +1 -1
  590. package/dist/shared-tree-core/messageTypes.js.map +1 -1
  591. package/dist/shared-tree-core/resubmitMachine.d.ts +1 -1
  592. package/dist/shared-tree-core/resubmitMachine.d.ts.map +1 -1
  593. package/dist/shared-tree-core/resubmitMachine.js.map +1 -1
  594. package/dist/shared-tree-core/sequenceIdUtils.d.ts +1 -1
  595. package/dist/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  596. package/dist/shared-tree-core/sequenceIdUtils.js.map +1 -1
  597. package/dist/shared-tree-core/sharedTreeCore.d.ts +10 -10
  598. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  599. package/dist/shared-tree-core/sharedTreeCore.js +7 -24
  600. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  601. package/dist/shared-tree-core/transactionEnricher.d.ts +2 -2
  602. package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  603. package/dist/shared-tree-core/transactionEnricher.js +1 -3
  604. package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
  605. package/dist/shared-tree-core/transactionStack.d.ts +1 -1
  606. package/dist/shared-tree-core/transactionStack.d.ts.map +1 -1
  607. package/dist/shared-tree-core/transactionStack.js +3 -1
  608. package/dist/shared-tree-core/transactionStack.js.map +1 -1
  609. package/dist/simple-tree/arrayNode.d.ts +2 -2
  610. package/dist/simple-tree/arrayNode.d.ts.map +1 -1
  611. package/dist/simple-tree/arrayNode.js +34 -26
  612. package/dist/simple-tree/arrayNode.js.map +1 -1
  613. package/dist/simple-tree/leafNodeSchema.d.ts +1 -1
  614. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  615. package/dist/simple-tree/leafNodeSchema.js +2 -4
  616. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  617. package/dist/simple-tree/mapNode.d.ts +2 -2
  618. package/dist/simple-tree/mapNode.d.ts.map +1 -1
  619. package/dist/simple-tree/mapNode.js +5 -5
  620. package/dist/simple-tree/mapNode.js.map +1 -1
  621. package/dist/simple-tree/nodeKeys.d.ts +2 -2
  622. package/dist/simple-tree/nodeKeys.d.ts.map +1 -1
  623. package/dist/simple-tree/nodeKeys.js.map +1 -1
  624. package/dist/simple-tree/objectNode.d.ts +5 -5
  625. package/dist/simple-tree/objectNode.d.ts.map +1 -1
  626. package/dist/simple-tree/objectNode.js +6 -6
  627. package/dist/simple-tree/objectNode.js.map +1 -1
  628. package/dist/simple-tree/proxies.d.ts +4 -4
  629. package/dist/simple-tree/proxies.d.ts.map +1 -1
  630. package/dist/simple-tree/proxies.js +6 -4
  631. package/dist/simple-tree/proxies.js.map +1 -1
  632. package/dist/simple-tree/proxyBinding.d.ts +6 -6
  633. package/dist/simple-tree/proxyBinding.d.ts.map +1 -1
  634. package/dist/simple-tree/proxyBinding.js.map +1 -1
  635. package/dist/simple-tree/schemaCaching.d.ts +2 -2
  636. package/dist/simple-tree/schemaCaching.d.ts.map +1 -1
  637. package/dist/simple-tree/schemaCaching.js.map +1 -1
  638. package/dist/simple-tree/schemaCreationUtilities.d.ts +5 -5
  639. package/dist/simple-tree/schemaCreationUtilities.d.ts.map +1 -1
  640. package/dist/simple-tree/schemaCreationUtilities.js.map +1 -1
  641. package/dist/simple-tree/schemaFactory.d.ts +25 -12
  642. package/dist/simple-tree/schemaFactory.d.ts.map +1 -1
  643. package/dist/simple-tree/schemaFactory.js +65 -53
  644. package/dist/simple-tree/schemaFactory.js.map +1 -1
  645. package/dist/simple-tree/schemaFactoryRecursive.d.ts +6 -6
  646. package/dist/simple-tree/schemaFactoryRecursive.d.ts.map +1 -1
  647. package/dist/simple-tree/schemaFactoryRecursive.js.map +1 -1
  648. package/dist/simple-tree/schemaTypes.d.ts +6 -6
  649. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  650. package/dist/simple-tree/schemaTypes.js +3 -12
  651. package/dist/simple-tree/schemaTypes.js.map +1 -1
  652. package/dist/simple-tree/testRecursiveDomain.d.ts +1 -1
  653. package/dist/simple-tree/testRecursiveDomain.d.ts.map +1 -1
  654. package/dist/simple-tree/testRecursiveDomain.js.map +1 -1
  655. package/dist/simple-tree/toFlexSchema.d.ts +4 -4
  656. package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
  657. package/dist/simple-tree/toFlexSchema.js.map +1 -1
  658. package/dist/simple-tree/toMapTree.d.ts +2 -2
  659. package/dist/simple-tree/toMapTree.d.ts.map +1 -1
  660. package/dist/simple-tree/toMapTree.js.map +1 -1
  661. package/dist/simple-tree/tree.d.ts +6 -27
  662. package/dist/simple-tree/tree.d.ts.map +1 -1
  663. package/dist/simple-tree/tree.js +0 -21
  664. package/dist/simple-tree/tree.js.map +1 -1
  665. package/dist/simple-tree/treeNodeApi.d.ts +30 -27
  666. package/dist/simple-tree/treeNodeApi.d.ts.map +1 -1
  667. package/dist/simple-tree/treeNodeApi.js +8 -3
  668. package/dist/simple-tree/treeNodeApi.js.map +1 -1
  669. package/dist/simple-tree/types.d.ts +29 -9
  670. package/dist/simple-tree/types.d.ts.map +1 -1
  671. package/dist/simple-tree/types.js +79 -54
  672. package/dist/simple-tree/types.js.map +1 -1
  673. package/dist/simple-tree/typesUnsafe.d.ts +5 -5
  674. package/dist/simple-tree/typesUnsafe.d.ts.map +1 -1
  675. package/dist/simple-tree/typesUnsafe.js.map +1 -1
  676. package/dist/treeFactory.d.ts +5 -5
  677. package/dist/treeFactory.d.ts.map +1 -1
  678. package/dist/treeFactory.js +10 -9
  679. package/dist/treeFactory.js.map +1 -1
  680. package/dist/util/brand.js +0 -1
  681. package/dist/util/brand.js.map +1 -1
  682. package/dist/util/brandedMap.d.ts +1 -1
  683. package/dist/util/brandedMap.d.ts.map +1 -1
  684. package/dist/util/brandedMap.js.map +1 -1
  685. package/dist/util/nestedMap.d.ts +1 -1
  686. package/dist/util/nestedMap.d.ts.map +1 -1
  687. package/dist/util/nestedMap.js +4 -2
  688. package/dist/util/nestedMap.js.map +1 -1
  689. package/dist/util/nestedSet.d.ts +1 -1
  690. package/dist/util/nestedSet.d.ts.map +1 -1
  691. package/dist/util/nestedSet.js.map +1 -1
  692. package/dist/util/offsetList.js +4 -2
  693. package/dist/util/offsetList.js.map +1 -1
  694. package/dist/util/referenceCounting.js +0 -1
  695. package/dist/util/referenceCounting.js.map +1 -1
  696. package/dist/util/stackyIterator.js +2 -3
  697. package/dist/util/stackyIterator.js.map +1 -1
  698. package/dist/util/typeboxBrand.d.ts +1 -1
  699. package/dist/util/typeboxBrand.d.ts.map +1 -1
  700. package/dist/util/typeboxBrand.js.map +1 -1
  701. package/lib/beta.d.ts +0 -1
  702. package/lib/codec/codec.d.ts +2 -2
  703. package/lib/codec/codec.d.ts.map +1 -1
  704. package/lib/codec/codec.js +0 -1
  705. package/lib/codec/codec.js.map +1 -1
  706. package/lib/codec/discriminatedUnions.d.ts +2 -2
  707. package/lib/codec/discriminatedUnions.d.ts.map +1 -1
  708. package/lib/codec/discriminatedUnions.js +0 -1
  709. package/lib/codec/discriminatedUnions.js.map +1 -1
  710. package/lib/codec/noopValidator.d.ts +1 -1
  711. package/lib/codec/noopValidator.d.ts.map +1 -1
  712. package/lib/codec/noopValidator.js.map +1 -1
  713. package/lib/codec/versioned/codec.d.ts +3 -3
  714. package/lib/codec/versioned/codec.d.ts.map +1 -1
  715. package/lib/codec/versioned/codec.js.map +1 -1
  716. package/lib/codec/versioned/format.d.ts +1 -1
  717. package/lib/codec/versioned/format.d.ts.map +1 -1
  718. package/lib/codec/versioned/format.js.map +1 -1
  719. package/lib/core/change-family/changeFamily.d.ts +5 -5
  720. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  721. package/lib/core/change-family/changeFamily.js.map +1 -1
  722. package/lib/core/change-family/editBuilder.d.ts +1 -1
  723. package/lib/core/change-family/editBuilder.d.ts.map +1 -1
  724. package/lib/core/change-family/editBuilder.js +0 -2
  725. package/lib/core/change-family/editBuilder.js.map +1 -1
  726. package/lib/core/forest/editableForest.d.ts +5 -5
  727. package/lib/core/forest/editableForest.d.ts.map +1 -1
  728. package/lib/core/forest/editableForest.js.map +1 -1
  729. package/lib/core/forest/forest.d.ts +3 -3
  730. package/lib/core/forest/forest.d.ts.map +1 -1
  731. package/lib/core/forest/forest.js.map +1 -1
  732. package/lib/core/rebase/changeRebaser.d.ts +1 -1
  733. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  734. package/lib/core/rebase/changeRebaser.js.map +1 -1
  735. package/lib/core/rebase/revisionTagCodec.d.ts +4 -4
  736. package/lib/core/rebase/revisionTagCodec.d.ts.map +1 -1
  737. package/lib/core/rebase/revisionTagCodec.js +0 -2
  738. package/lib/core/rebase/revisionTagCodec.js.map +1 -1
  739. package/lib/core/rebase/types.d.ts +3 -3
  740. package/lib/core/rebase/types.d.ts.map +1 -1
  741. package/lib/core/rebase/types.js.map +1 -1
  742. package/lib/core/rebase/utils.d.ts +2 -2
  743. package/lib/core/rebase/utils.d.ts.map +1 -1
  744. package/lib/core/rebase/utils.js.map +1 -1
  745. package/lib/core/schema-stored/format.d.ts +2 -2
  746. package/lib/core/schema-stored/format.d.ts.map +1 -1
  747. package/lib/core/schema-stored/format.js.map +1 -1
  748. package/lib/core/schema-stored/schema.d.ts +3 -3
  749. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  750. package/lib/core/schema-stored/schema.js +0 -4
  751. package/lib/core/schema-stored/schema.js.map +1 -1
  752. package/lib/core/schema-stored/storedSchemaRepository.d.ts +3 -3
  753. package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  754. package/lib/core/schema-stored/storedSchemaRepository.js +1 -3
  755. package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
  756. package/lib/core/schema-view/view.d.ts +1 -1
  757. package/lib/core/schema-view/view.d.ts.map +1 -1
  758. package/lib/core/schema-view/view.js +0 -2
  759. package/lib/core/schema-view/view.js.map +1 -1
  760. package/lib/core/tree/anchorSet.d.ts +56 -18
  761. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  762. package/lib/core/tree/anchorSet.js +97 -52
  763. package/lib/core/tree/anchorSet.js.map +1 -1
  764. package/lib/core/tree/cursor.d.ts +3 -3
  765. package/lib/core/tree/cursor.d.ts.map +1 -1
  766. package/lib/core/tree/cursor.js.map +1 -1
  767. package/lib/core/tree/delta.d.ts +3 -3
  768. package/lib/core/tree/delta.d.ts.map +1 -1
  769. package/lib/core/tree/delta.js.map +1 -1
  770. package/lib/core/tree/deltaUtil.d.ts +2 -2
  771. package/lib/core/tree/deltaUtil.d.ts.map +1 -1
  772. package/lib/core/tree/deltaUtil.js.map +1 -1
  773. package/lib/core/tree/detachedFieldIndex.d.ts +7 -7
  774. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  775. package/lib/core/tree/detachedFieldIndex.js +2 -8
  776. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  777. package/lib/core/tree/detachedFieldIndexCodec.d.ts +4 -4
  778. package/lib/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
  779. package/lib/core/tree/detachedFieldIndexCodec.js +1 -4
  780. package/lib/core/tree/detachedFieldIndexCodec.js.map +1 -1
  781. package/lib/core/tree/detachedFieldIndexFormat.d.ts +2 -2
  782. package/lib/core/tree/detachedFieldIndexFormat.d.ts.map +1 -1
  783. package/lib/core/tree/detachedFieldIndexFormat.js.map +1 -1
  784. package/lib/core/tree/detachedFieldIndexTypes.d.ts +3 -3
  785. package/lib/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
  786. package/lib/core/tree/detachedFieldIndexTypes.js.map +1 -1
  787. package/lib/core/tree/mapTree.d.ts +2 -2
  788. package/lib/core/tree/mapTree.d.ts.map +1 -1
  789. package/lib/core/tree/mapTree.js.map +1 -1
  790. package/lib/core/tree/pathTree.d.ts +3 -3
  791. package/lib/core/tree/pathTree.d.ts.map +1 -1
  792. package/lib/core/tree/pathTree.js.map +1 -1
  793. package/lib/core/tree/persistedTreeTextFormat.d.ts +1 -1
  794. package/lib/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  795. package/lib/core/tree/persistedTreeTextFormat.js.map +1 -1
  796. package/lib/core/tree/sparseTree.d.ts +2 -2
  797. package/lib/core/tree/sparseTree.d.ts.map +1 -1
  798. package/lib/core/tree/sparseTree.js +11 -15
  799. package/lib/core/tree/sparseTree.js.map +1 -1
  800. package/lib/core/tree/treeTextFormat.d.ts +2 -2
  801. package/lib/core/tree/treeTextFormat.d.ts.map +1 -1
  802. package/lib/core/tree/treeTextFormat.js.map +1 -1
  803. package/lib/core/tree/types.d.ts +3 -3
  804. package/lib/core/tree/types.d.ts.map +1 -1
  805. package/lib/core/tree/types.js +1 -2
  806. package/lib/core/tree/types.js.map +1 -1
  807. package/lib/core/tree/visitDelta.d.ts +5 -5
  808. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  809. package/lib/core/tree/visitDelta.js.map +1 -1
  810. package/lib/core/tree/visitPath.d.ts +2 -2
  811. package/lib/core/tree/visitPath.d.ts.map +1 -1
  812. package/lib/core/tree/visitPath.js.map +1 -1
  813. package/lib/core/tree/visitorUtils.d.ts +7 -7
  814. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  815. package/lib/core/tree/visitorUtils.js.map +1 -1
  816. package/lib/domains/json/jsonCursor.d.ts +2 -2
  817. package/lib/domains/json/jsonCursor.d.ts.map +1 -1
  818. package/lib/domains/json/jsonCursor.js.map +1 -1
  819. package/lib/domains/json/jsonDomainSchema.js.map +1 -1
  820. package/lib/domains/schemaBuilder.d.ts +2 -2
  821. package/lib/domains/schemaBuilder.d.ts.map +1 -1
  822. package/lib/domains/schemaBuilder.js +70 -70
  823. package/lib/domains/schemaBuilder.js.map +1 -1
  824. package/lib/events/events.js +1 -2
  825. package/lib/events/events.js.map +1 -1
  826. package/lib/feature-libraries/changeAtomIdCodec.d.ts +2 -2
  827. package/lib/feature-libraries/changeAtomIdCodec.d.ts.map +1 -1
  828. package/lib/feature-libraries/changeAtomIdCodec.js.map +1 -1
  829. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts +2 -2
  830. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  831. package/lib/feature-libraries/chunked-forest/basicChunk.js +1 -14
  832. package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  833. package/lib/feature-libraries/chunked-forest/chunk.d.ts +2 -2
  834. package/lib/feature-libraries/chunked-forest/chunk.d.ts.map +1 -1
  835. package/lib/feature-libraries/chunked-forest/chunk.js.map +1 -1
  836. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +4 -4
  837. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  838. package/lib/feature-libraries/chunked-forest/chunkTree.js +6 -13
  839. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  840. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -4
  841. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  842. package/lib/feature-libraries/chunked-forest/chunkedForest.js +2 -9
  843. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  844. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts +3 -3
  845. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts.map +1 -1
  846. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +3 -1
  847. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
  848. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +17 -7
  849. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  850. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +6 -11
  851. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  852. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +8 -8
  853. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  854. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +3 -6
  855. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  856. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +3 -3
  857. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  858. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +0 -1
  859. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  860. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +6 -5
  861. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  862. package/lib/feature-libraries/chunked-forest/codec/codecs.js +5 -2
  863. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  864. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +7 -7
  865. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  866. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +13 -25
  867. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  868. package/lib/feature-libraries/chunked-forest/codec/fieldBatch.d.ts +1 -1
  869. package/lib/feature-libraries/chunked-forest/codec/fieldBatch.d.ts.map +1 -1
  870. package/lib/feature-libraries/chunked-forest/codec/fieldBatch.js.map +1 -1
  871. package/lib/feature-libraries/chunked-forest/codec/format.d.ts +1 -1
  872. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  873. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  874. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +1 -1
  875. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  876. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  877. package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts +5 -5
  878. package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
  879. package/lib/feature-libraries/chunked-forest/codec/nodeShape.js +5 -8
  880. package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
  881. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts +6 -6
  882. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts.map +1 -1
  883. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js.map +1 -1
  884. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +2 -2
  885. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  886. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +1 -1
  887. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  888. package/lib/feature-libraries/chunked-forest/emptyChunk.d.ts +1 -1
  889. package/lib/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
  890. package/lib/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
  891. package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
  892. package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
  893. package/lib/feature-libraries/chunked-forest/sequenceChunk.js +0 -1
  894. package/lib/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
  895. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +2 -2
  896. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  897. package/lib/feature-libraries/chunked-forest/uniformChunk.js +5 -40
  898. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  899. package/lib/feature-libraries/contextuallyTyped.d.ts +5 -5
  900. package/lib/feature-libraries/contextuallyTyped.d.ts.map +1 -1
  901. package/lib/feature-libraries/contextuallyTyped.js.map +1 -1
  902. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -3
  903. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  904. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +0 -2
  905. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  906. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +3 -3
  907. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  908. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  909. package/lib/feature-libraries/default-schema/defaultSchema.d.ts +1 -1
  910. package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
  911. package/lib/feature-libraries/default-schema/defaultSchema.js.map +1 -1
  912. package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
  913. package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
  914. package/lib/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
  915. package/lib/feature-libraries/deltaUtils.d.ts +1 -1
  916. package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
  917. package/lib/feature-libraries/deltaUtils.js +1 -1
  918. package/lib/feature-libraries/deltaUtils.js.map +1 -1
  919. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +4 -4
  920. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  921. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +1 -2
  922. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  923. package/lib/feature-libraries/editableTreeBinder.d.ts +3 -3
  924. package/lib/feature-libraries/editableTreeBinder.d.ts.map +1 -1
  925. package/lib/feature-libraries/editableTreeBinder.js +12 -13
  926. package/lib/feature-libraries/editableTreeBinder.js.map +1 -1
  927. package/lib/feature-libraries/fieldGenerator.d.ts +2 -2
  928. package/lib/feature-libraries/fieldGenerator.d.ts.map +1 -1
  929. package/lib/feature-libraries/fieldGenerator.js.map +1 -1
  930. package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts +5 -5
  931. package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
  932. package/lib/feature-libraries/flex-map-tree/mapTreeNode.js +11 -12
  933. package/lib/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
  934. package/lib/feature-libraries/flex-tree/context.d.ts +8 -8
  935. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  936. package/lib/feature-libraries/flex-tree/context.js +3 -7
  937. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  938. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +9 -9
  939. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  940. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  941. package/lib/feature-libraries/flex-tree/index.d.ts +1 -1
  942. package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
  943. package/lib/feature-libraries/flex-tree/index.js +0 -1
  944. package/lib/feature-libraries/flex-tree/index.js.map +1 -1
  945. package/lib/feature-libraries/flex-tree/lazyEntity.d.ts +4 -4
  946. package/lib/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
  947. package/lib/feature-libraries/flex-tree/lazyEntity.js +23 -14
  948. package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  949. package/lib/feature-libraries/flex-tree/lazyField.d.ts +6 -6
  950. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  951. package/lib/feature-libraries/flex-tree/lazyField.js +0 -6
  952. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  953. package/lib/feature-libraries/flex-tree/lazyNode.d.ts +5 -5
  954. package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  955. package/lib/feature-libraries/flex-tree/lazyNode.js +19 -13
  956. package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  957. package/lib/feature-libraries/flex-tree/treeEvents.d.ts +1 -13
  958. package/lib/feature-libraries/flex-tree/treeEvents.d.ts.map +1 -1
  959. package/lib/feature-libraries/flex-tree/treeEvents.js +1 -28
  960. package/lib/feature-libraries/flex-tree/treeEvents.js.map +1 -1
  961. package/lib/feature-libraries/flex-tree/unboxed.d.ts +5 -5
  962. package/lib/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
  963. package/lib/feature-libraries/flex-tree/unboxed.js.map +1 -1
  964. package/lib/feature-libraries/flex-tree/utilities.d.ts +1 -1
  965. package/lib/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
  966. package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
  967. package/lib/feature-libraries/forest-summary/codec.d.ts +3 -3
  968. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  969. package/lib/feature-libraries/forest-summary/codec.js +1 -1
  970. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  971. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +7 -7
  972. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  973. package/lib/feature-libraries/forest-summary/forestSummarizer.js +1 -6
  974. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  975. package/lib/feature-libraries/forest-summary/format.d.ts +1 -1
  976. package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
  977. package/lib/feature-libraries/forest-summary/format.js.map +1 -1
  978. package/lib/feature-libraries/index.d.ts +1 -1
  979. package/lib/feature-libraries/index.d.ts.map +1 -1
  980. package/lib/feature-libraries/index.js +1 -1
  981. package/lib/feature-libraries/index.js.map +1 -1
  982. package/lib/feature-libraries/mapTreeCursor.d.ts +2 -2
  983. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  984. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  985. package/lib/feature-libraries/memoizedIdRangeAllocator.d.ts +1 -1
  986. package/lib/feature-libraries/memoizedIdRangeAllocator.d.ts.map +1 -1
  987. package/lib/feature-libraries/memoizedIdRangeAllocator.js.map +1 -1
  988. package/lib/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
  989. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  990. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  991. package/lib/feature-libraries/modular-schema/comparison.d.ts +2 -2
  992. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  993. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  994. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +2 -2
  995. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  996. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  997. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +7 -7
  998. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  999. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  1000. package/lib/feature-libraries/modular-schema/fieldKind.d.ts +1 -1
  1001. package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  1002. package/lib/feature-libraries/modular-schema/fieldKind.js +0 -2
  1003. package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  1004. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
  1005. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  1006. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  1007. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +3 -3
  1008. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +1 -1
  1009. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -3
  1010. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
  1011. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts +4 -4
  1012. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  1013. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  1014. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
  1015. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  1016. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  1017. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +1 -1
  1018. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
  1019. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
  1020. package/lib/feature-libraries/modular-schema/genericFieldKindTypes.d.ts +1 -1
  1021. package/lib/feature-libraries/modular-schema/genericFieldKindTypes.d.ts.map +1 -1
  1022. package/lib/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
  1023. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts +2 -2
  1024. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  1025. package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  1026. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +5 -5
  1027. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  1028. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +2 -0
  1029. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  1030. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +6 -6
  1031. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  1032. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +2 -5
  1033. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  1034. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +3 -3
  1035. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  1036. package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
  1037. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +3 -3
  1038. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  1039. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  1040. package/lib/feature-libraries/node-key/mockNodeKeyManager.d.ts +2 -2
  1041. package/lib/feature-libraries/node-key/mockNodeKeyManager.d.ts.map +1 -1
  1042. package/lib/feature-libraries/node-key/mockNodeKeyManager.js +4 -2
  1043. package/lib/feature-libraries/node-key/mockNodeKeyManager.js.map +1 -1
  1044. package/lib/feature-libraries/node-key/nodeKey.d.ts +3 -3
  1045. package/lib/feature-libraries/node-key/nodeKey.d.ts.map +1 -1
  1046. package/lib/feature-libraries/node-key/nodeKey.js.map +1 -1
  1047. package/lib/feature-libraries/node-key/nodeKeyIndex.d.ts +4 -4
  1048. package/lib/feature-libraries/node-key/nodeKeyIndex.d.ts.map +1 -1
  1049. package/lib/feature-libraries/node-key/nodeKeyIndex.js +0 -3
  1050. package/lib/feature-libraries/node-key/nodeKeyIndex.js.map +1 -1
  1051. package/lib/feature-libraries/node-key/nodeKeyManager.d.ts +1 -1
  1052. package/lib/feature-libraries/node-key/nodeKeyManager.d.ts.map +1 -1
  1053. package/lib/feature-libraries/node-key/nodeKeyManager.js.map +1 -1
  1054. package/lib/feature-libraries/object-forest/objectForest.d.ts +2 -2
  1055. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  1056. package/lib/feature-libraries/object-forest/objectForest.js +28 -23
  1057. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  1058. package/lib/feature-libraries/optional-field/optionalField.d.ts +3 -3
  1059. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  1060. package/lib/feature-libraries/optional-field/optionalField.js +3 -1
  1061. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  1062. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +1 -1
  1063. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
  1064. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -1
  1065. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +1 -1
  1066. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
  1067. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -1
  1068. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +2 -2
  1069. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  1070. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  1071. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +3 -3
  1072. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +1 -1
  1073. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js.map +1 -1
  1074. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +3 -3
  1075. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  1076. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  1077. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
  1078. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  1079. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  1080. package/lib/feature-libraries/schema-aware/schemaAware.d.ts +4 -4
  1081. package/lib/feature-libraries/schema-aware/schemaAware.d.ts.map +1 -1
  1082. package/lib/feature-libraries/schema-aware/schemaAware.js +1 -2
  1083. package/lib/feature-libraries/schema-aware/schemaAware.js.map +1 -1
  1084. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +2 -2
  1085. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  1086. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  1087. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +1 -1
  1088. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  1089. package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  1090. package/lib/feature-libraries/schema-edits/schemaChangeTypes.d.ts +1 -1
  1091. package/lib/feature-libraries/schema-edits/schemaChangeTypes.d.ts.map +1 -1
  1092. package/lib/feature-libraries/schema-edits/schemaChangeTypes.js.map +1 -1
  1093. package/lib/feature-libraries/schema-index/codec.d.ts +2 -2
  1094. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  1095. package/lib/feature-libraries/schema-index/codec.js +1 -1
  1096. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  1097. package/lib/feature-libraries/schema-index/format.d.ts +1 -1
  1098. package/lib/feature-libraries/schema-index/format.d.ts.map +1 -1
  1099. package/lib/feature-libraries/schema-index/format.js.map +1 -1
  1100. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +7 -7
  1101. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  1102. package/lib/feature-libraries/schema-index/schemaSummarizer.js +2 -6
  1103. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  1104. package/lib/feature-libraries/schemaBuilder.d.ts +2 -2
  1105. package/lib/feature-libraries/schemaBuilder.d.ts.map +1 -1
  1106. package/lib/feature-libraries/schemaBuilder.js.map +1 -1
  1107. package/lib/feature-libraries/schemaBuilderBase.d.ts +4 -4
  1108. package/lib/feature-libraries/schemaBuilderBase.d.ts.map +1 -1
  1109. package/lib/feature-libraries/schemaBuilderBase.js +3 -14
  1110. package/lib/feature-libraries/schemaBuilderBase.js.map +1 -1
  1111. package/lib/feature-libraries/sequence-field/compose.d.ts +5 -5
  1112. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  1113. package/lib/feature-libraries/sequence-field/compose.js +0 -6
  1114. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  1115. package/lib/feature-libraries/sequence-field/formatV1.d.ts +1 -1
  1116. package/lib/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
  1117. package/lib/feature-libraries/sequence-field/formatV1.js.map +1 -1
  1118. package/lib/feature-libraries/sequence-field/formatV2.d.ts +1 -1
  1119. package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  1120. package/lib/feature-libraries/sequence-field/formatV2.js.map +1 -1
  1121. package/lib/feature-libraries/sequence-field/helperTypes.d.ts +1 -1
  1122. package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  1123. package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  1124. package/lib/feature-libraries/sequence-field/invert.d.ts +3 -3
  1125. package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  1126. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  1127. package/lib/feature-libraries/sequence-field/markListFactory.d.ts +1 -1
  1128. package/lib/feature-libraries/sequence-field/markListFactory.d.ts.map +1 -1
  1129. package/lib/feature-libraries/sequence-field/markListFactory.js +4 -3
  1130. package/lib/feature-libraries/sequence-field/markListFactory.js.map +1 -1
  1131. package/lib/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  1132. package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  1133. package/lib/feature-libraries/sequence-field/markQueue.js +2 -4
  1134. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  1135. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +5 -5
  1136. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  1137. package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  1138. package/lib/feature-libraries/sequence-field/prune.d.ts +2 -2
  1139. package/lib/feature-libraries/sequence-field/prune.d.ts.map +1 -1
  1140. package/lib/feature-libraries/sequence-field/prune.js.map +1 -1
  1141. package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -3
  1142. package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  1143. package/lib/feature-libraries/sequence-field/rebase.js +0 -6
  1144. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  1145. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +3 -3
  1146. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -1
  1147. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
  1148. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts +2 -2
  1149. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  1150. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  1151. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts +3 -3
  1152. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  1153. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  1154. package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts +2 -2
  1155. package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts.map +1 -1
  1156. package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js.map +1 -1
  1157. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +5 -5
  1158. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
  1159. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
  1160. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +5 -5
  1161. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  1162. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  1163. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +4 -4
  1164. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  1165. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  1166. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +3 -3
  1167. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  1168. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  1169. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -3
  1170. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  1171. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  1172. package/lib/feature-libraries/sequence-field/types.d.ts +2 -2
  1173. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  1174. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  1175. package/lib/feature-libraries/sequence-field/utils.d.ts +5 -5
  1176. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  1177. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  1178. package/lib/feature-libraries/storedToViewSchema.d.ts +2 -2
  1179. package/lib/feature-libraries/storedToViewSchema.d.ts.map +1 -1
  1180. package/lib/feature-libraries/storedToViewSchema.js.map +1 -1
  1181. package/lib/feature-libraries/treeCursorUtils.d.ts +1 -1
  1182. package/lib/feature-libraries/treeCursorUtils.d.ts.map +1 -1
  1183. package/lib/feature-libraries/treeCursorUtils.js +9 -13
  1184. package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
  1185. package/lib/feature-libraries/treeTextCursor.d.ts +2 -2
  1186. package/lib/feature-libraries/treeTextCursor.d.ts.map +1 -1
  1187. package/lib/feature-libraries/treeTextCursor.js +1 -1
  1188. package/lib/feature-libraries/treeTextCursor.js.map +1 -1
  1189. package/lib/feature-libraries/typed-schema/schemaCollection.d.ts +3 -3
  1190. package/lib/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
  1191. package/lib/feature-libraries/typed-schema/schemaCollection.js +1 -1
  1192. package/lib/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
  1193. package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts +4 -4
  1194. package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
  1195. package/lib/feature-libraries/typed-schema/typedTreeSchema.js +4 -23
  1196. package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
  1197. package/lib/feature-libraries/typed-schema/view.d.ts +4 -4
  1198. package/lib/feature-libraries/typed-schema/view.d.ts.map +1 -1
  1199. package/lib/feature-libraries/typed-schema/view.js +0 -7
  1200. package/lib/feature-libraries/typed-schema/view.js.map +1 -1
  1201. package/lib/feature-libraries/valueUtilities.d.ts +2 -2
  1202. package/lib/feature-libraries/valueUtilities.d.ts.map +1 -1
  1203. package/lib/feature-libraries/valueUtilities.js.map +1 -1
  1204. package/lib/index.d.ts +1 -1
  1205. package/lib/index.d.ts.map +1 -1
  1206. package/lib/index.js +1 -1
  1207. package/lib/index.js.map +1 -1
  1208. package/lib/packageVersion.d.ts +1 -1
  1209. package/lib/packageVersion.js +1 -1
  1210. package/lib/packageVersion.js.map +1 -1
  1211. package/lib/public.d.ts +0 -1
  1212. package/lib/shared-tree/schematizeTree.d.ts +3 -3
  1213. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  1214. package/lib/shared-tree/schematizeTree.js.map +1 -1
  1215. package/lib/shared-tree/schematizingTreeView.d.ts +4 -4
  1216. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  1217. package/lib/shared-tree/schematizingTreeView.js +11 -28
  1218. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  1219. package/lib/shared-tree/sharedTree.d.ts +15 -11
  1220. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  1221. package/lib/shared-tree/sharedTree.js +14 -11
  1222. package/lib/shared-tree/sharedTree.js.map +1 -1
  1223. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +4 -4
  1224. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  1225. package/lib/shared-tree/sharedTreeChangeCodecs.js +1 -1
  1226. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  1227. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +3 -3
  1228. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  1229. package/lib/shared-tree/sharedTreeChangeEnricher.js +11 -14
  1230. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  1231. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
  1232. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  1233. package/lib/shared-tree/sharedTreeChangeFamily.js +4 -6
  1234. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  1235. package/lib/shared-tree/sharedTreeChangeFormat.d.ts +1 -1
  1236. package/lib/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
  1237. package/lib/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  1238. package/lib/shared-tree/sharedTreeChangeTypes.d.ts +1 -1
  1239. package/lib/shared-tree/sharedTreeChangeTypes.d.ts.map +1 -1
  1240. package/lib/shared-tree/sharedTreeChangeTypes.js.map +1 -1
  1241. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +3 -3
  1242. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  1243. package/lib/shared-tree/sharedTreeEditBuilder.js +0 -2
  1244. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  1245. package/lib/shared-tree/treeApi.d.ts +1 -1
  1246. package/lib/shared-tree/treeApi.d.ts.map +1 -1
  1247. package/lib/shared-tree/treeApi.js.map +1 -1
  1248. package/lib/shared-tree/treeCheckout.d.ts +7 -7
  1249. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  1250. package/lib/shared-tree/treeCheckout.js +12 -23
  1251. package/lib/shared-tree/treeCheckout.js.map +1 -1
  1252. package/lib/shared-tree/treeView.d.ts +3 -3
  1253. package/lib/shared-tree/treeView.d.ts.map +1 -1
  1254. package/lib/shared-tree/treeView.js +0 -6
  1255. package/lib/shared-tree/treeView.js.map +1 -1
  1256. package/lib/shared-tree-core/branch.d.ts +2 -2
  1257. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  1258. package/lib/shared-tree-core/branch.js +25 -31
  1259. package/lib/shared-tree-core/branch.js.map +1 -1
  1260. package/lib/shared-tree-core/branchCommitEnricher.d.ts +2 -2
  1261. package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  1262. package/lib/shared-tree-core/branchCommitEnricher.js +9 -12
  1263. package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
  1264. package/lib/shared-tree-core/changeEnricher.d.ts +1 -1
  1265. package/lib/shared-tree-core/changeEnricher.d.ts.map +1 -1
  1266. package/lib/shared-tree-core/changeEnricher.js.map +1 -1
  1267. package/lib/shared-tree-core/defaultResubmitMachine.d.ts +2 -2
  1268. package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  1269. package/lib/shared-tree-core/defaultResubmitMachine.js +19 -21
  1270. package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  1271. package/lib/shared-tree-core/editManager.d.ts +3 -3
  1272. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  1273. package/lib/shared-tree-core/editManager.js +37 -53
  1274. package/lib/shared-tree-core/editManager.js.map +1 -1
  1275. package/lib/shared-tree-core/editManagerCodecs.d.ts +5 -5
  1276. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  1277. package/lib/shared-tree-core/editManagerCodecs.js +1 -1
  1278. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  1279. package/lib/shared-tree-core/editManagerFormat.d.ts +4 -4
  1280. package/lib/shared-tree-core/editManagerFormat.d.ts.map +1 -1
  1281. package/lib/shared-tree-core/editManagerFormat.js.map +1 -1
  1282. package/lib/shared-tree-core/editManagerSummarizer.d.ts +9 -9
  1283. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  1284. package/lib/shared-tree-core/editManagerSummarizer.js +1 -5
  1285. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  1286. package/lib/shared-tree-core/messageCodecs.d.ts +5 -5
  1287. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  1288. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  1289. package/lib/shared-tree-core/messageFormat.d.ts +4 -4
  1290. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  1291. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  1292. package/lib/shared-tree-core/messageTypes.d.ts +2 -2
  1293. package/lib/shared-tree-core/messageTypes.d.ts.map +1 -1
  1294. package/lib/shared-tree-core/messageTypes.js.map +1 -1
  1295. package/lib/shared-tree-core/resubmitMachine.d.ts +1 -1
  1296. package/lib/shared-tree-core/resubmitMachine.d.ts.map +1 -1
  1297. package/lib/shared-tree-core/resubmitMachine.js.map +1 -1
  1298. package/lib/shared-tree-core/sequenceIdUtils.d.ts +1 -1
  1299. package/lib/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  1300. package/lib/shared-tree-core/sequenceIdUtils.js.map +1 -1
  1301. package/lib/shared-tree-core/sharedTreeCore.d.ts +10 -10
  1302. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  1303. package/lib/shared-tree-core/sharedTreeCore.js +7 -24
  1304. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  1305. package/lib/shared-tree-core/transactionEnricher.d.ts +2 -2
  1306. package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  1307. package/lib/shared-tree-core/transactionEnricher.js +1 -3
  1308. package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
  1309. package/lib/shared-tree-core/transactionStack.d.ts +1 -1
  1310. package/lib/shared-tree-core/transactionStack.d.ts.map +1 -1
  1311. package/lib/shared-tree-core/transactionStack.js +3 -1
  1312. package/lib/shared-tree-core/transactionStack.js.map +1 -1
  1313. package/lib/simple-tree/arrayNode.d.ts +2 -2
  1314. package/lib/simple-tree/arrayNode.d.ts.map +1 -1
  1315. package/lib/simple-tree/arrayNode.js +35 -27
  1316. package/lib/simple-tree/arrayNode.js.map +1 -1
  1317. package/lib/simple-tree/leafNodeSchema.d.ts +1 -1
  1318. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  1319. package/lib/simple-tree/leafNodeSchema.js +2 -4
  1320. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  1321. package/lib/simple-tree/mapNode.d.ts +2 -2
  1322. package/lib/simple-tree/mapNode.d.ts.map +1 -1
  1323. package/lib/simple-tree/mapNode.js +5 -5
  1324. package/lib/simple-tree/mapNode.js.map +1 -1
  1325. package/lib/simple-tree/nodeKeys.d.ts +2 -2
  1326. package/lib/simple-tree/nodeKeys.d.ts.map +1 -1
  1327. package/lib/simple-tree/nodeKeys.js.map +1 -1
  1328. package/lib/simple-tree/objectNode.d.ts +5 -5
  1329. package/lib/simple-tree/objectNode.d.ts.map +1 -1
  1330. package/lib/simple-tree/objectNode.js +6 -6
  1331. package/lib/simple-tree/objectNode.js.map +1 -1
  1332. package/lib/simple-tree/proxies.d.ts +4 -4
  1333. package/lib/simple-tree/proxies.d.ts.map +1 -1
  1334. package/lib/simple-tree/proxies.js +7 -5
  1335. package/lib/simple-tree/proxies.js.map +1 -1
  1336. package/lib/simple-tree/proxyBinding.d.ts +6 -6
  1337. package/lib/simple-tree/proxyBinding.d.ts.map +1 -1
  1338. package/lib/simple-tree/proxyBinding.js.map +1 -1
  1339. package/lib/simple-tree/schemaCaching.d.ts +2 -2
  1340. package/lib/simple-tree/schemaCaching.d.ts.map +1 -1
  1341. package/lib/simple-tree/schemaCaching.js.map +1 -1
  1342. package/lib/simple-tree/schemaCreationUtilities.d.ts +5 -5
  1343. package/lib/simple-tree/schemaCreationUtilities.d.ts.map +1 -1
  1344. package/lib/simple-tree/schemaCreationUtilities.js.map +1 -1
  1345. package/lib/simple-tree/schemaFactory.d.ts +25 -12
  1346. package/lib/simple-tree/schemaFactory.d.ts.map +1 -1
  1347. package/lib/simple-tree/schemaFactory.js +66 -54
  1348. package/lib/simple-tree/schemaFactory.js.map +1 -1
  1349. package/lib/simple-tree/schemaFactoryRecursive.d.ts +6 -6
  1350. package/lib/simple-tree/schemaFactoryRecursive.d.ts.map +1 -1
  1351. package/lib/simple-tree/schemaFactoryRecursive.js +1 -1
  1352. package/lib/simple-tree/schemaFactoryRecursive.js.map +1 -1
  1353. package/lib/simple-tree/schemaTypes.d.ts +6 -6
  1354. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  1355. package/lib/simple-tree/schemaTypes.js +3 -12
  1356. package/lib/simple-tree/schemaTypes.js.map +1 -1
  1357. package/lib/simple-tree/testRecursiveDomain.d.ts +1 -1
  1358. package/lib/simple-tree/testRecursiveDomain.d.ts.map +1 -1
  1359. package/lib/simple-tree/testRecursiveDomain.js.map +1 -1
  1360. package/lib/simple-tree/toFlexSchema.d.ts +4 -4
  1361. package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
  1362. package/lib/simple-tree/toFlexSchema.js.map +1 -1
  1363. package/lib/simple-tree/toMapTree.d.ts +2 -2
  1364. package/lib/simple-tree/toMapTree.d.ts.map +1 -1
  1365. package/lib/simple-tree/toMapTree.js.map +1 -1
  1366. package/lib/simple-tree/tree.d.ts +6 -27
  1367. package/lib/simple-tree/tree.d.ts.map +1 -1
  1368. package/lib/simple-tree/tree.js +0 -21
  1369. package/lib/simple-tree/tree.js.map +1 -1
  1370. package/lib/simple-tree/treeNodeApi.d.ts +30 -27
  1371. package/lib/simple-tree/treeNodeApi.d.ts.map +1 -1
  1372. package/lib/simple-tree/treeNodeApi.js +8 -3
  1373. package/lib/simple-tree/treeNodeApi.js.map +1 -1
  1374. package/lib/simple-tree/types.d.ts +29 -9
  1375. package/lib/simple-tree/types.d.ts.map +1 -1
  1376. package/lib/simple-tree/types.js +78 -54
  1377. package/lib/simple-tree/types.js.map +1 -1
  1378. package/lib/simple-tree/typesUnsafe.d.ts +5 -5
  1379. package/lib/simple-tree/typesUnsafe.d.ts.map +1 -1
  1380. package/lib/simple-tree/typesUnsafe.js.map +1 -1
  1381. package/lib/treeFactory.d.ts +5 -5
  1382. package/lib/treeFactory.d.ts.map +1 -1
  1383. package/lib/treeFactory.js +10 -9
  1384. package/lib/treeFactory.js.map +1 -1
  1385. package/lib/util/brand.js +0 -1
  1386. package/lib/util/brand.js.map +1 -1
  1387. package/lib/util/brandedMap.d.ts +1 -1
  1388. package/lib/util/brandedMap.d.ts.map +1 -1
  1389. package/lib/util/brandedMap.js.map +1 -1
  1390. package/lib/util/nestedMap.d.ts +1 -1
  1391. package/lib/util/nestedMap.d.ts.map +1 -1
  1392. package/lib/util/nestedMap.js +4 -2
  1393. package/lib/util/nestedMap.js.map +1 -1
  1394. package/lib/util/nestedSet.d.ts +1 -1
  1395. package/lib/util/nestedSet.d.ts.map +1 -1
  1396. package/lib/util/nestedSet.js.map +1 -1
  1397. package/lib/util/offsetList.js +4 -2
  1398. package/lib/util/offsetList.js.map +1 -1
  1399. package/lib/util/referenceCounting.js +0 -1
  1400. package/lib/util/referenceCounting.js.map +1 -1
  1401. package/lib/util/stackyIterator.js +2 -3
  1402. package/lib/util/stackyIterator.js.map +1 -1
  1403. package/lib/util/typeboxBrand.d.ts +1 -1
  1404. package/lib/util/typeboxBrand.d.ts.map +1 -1
  1405. package/lib/util/typeboxBrand.js.map +1 -1
  1406. package/package.json +20 -20
  1407. package/src/codec/codec.ts +2 -2
  1408. package/src/codec/discriminatedUnions.ts +2 -2
  1409. package/src/codec/noopValidator.ts +1 -1
  1410. package/src/codec/versioned/codec.ts +4 -4
  1411. package/src/codec/versioned/format.ts +1 -1
  1412. package/src/core/change-family/changeFamily.ts +5 -5
  1413. package/src/core/change-family/editBuilder.ts +1 -1
  1414. package/src/core/forest/editableForest.ts +9 -9
  1415. package/src/core/forest/forest.ts +8 -8
  1416. package/src/core/rebase/changeRebaser.ts +1 -1
  1417. package/src/core/rebase/revisionTagCodec.ts +4 -4
  1418. package/src/core/rebase/types.ts +5 -5
  1419. package/src/core/rebase/utils.ts +6 -6
  1420. package/src/core/schema-stored/format.ts +2 -2
  1421. package/src/core/schema-stored/schema.ts +7 -7
  1422. package/src/core/schema-stored/storedSchemaRepository.ts +6 -6
  1423. package/src/core/schema-view/view.ts +1 -1
  1424. package/src/core/tree/anchorSet.ts +115 -23
  1425. package/src/core/tree/cursor.ts +3 -3
  1426. package/src/core/tree/delta.ts +3 -3
  1427. package/src/core/tree/deltaUtil.ts +4 -4
  1428. package/src/core/tree/detachedFieldIndex.ts +11 -11
  1429. package/src/core/tree/detachedFieldIndexCodec.ts +11 -7
  1430. package/src/core/tree/detachedFieldIndexFormat.ts +2 -2
  1431. package/src/core/tree/detachedFieldIndexTypes.ts +3 -3
  1432. package/src/core/tree/mapTree.ts +2 -2
  1433. package/src/core/tree/pathTree.ts +3 -3
  1434. package/src/core/tree/persistedTreeTextFormat.ts +1 -1
  1435. package/src/core/tree/sparseTree.ts +2 -2
  1436. package/src/core/tree/treeTextFormat.ts +2 -2
  1437. package/src/core/tree/types.ts +10 -4
  1438. package/src/core/tree/visitDelta.ts +8 -8
  1439. package/src/core/tree/visitPath.ts +2 -2
  1440. package/src/core/tree/visitorUtils.ts +9 -9
  1441. package/src/domains/json/jsonCursor.ts +5 -5
  1442. package/src/domains/json/jsonDomainSchema.ts +2 -2
  1443. package/src/domains/schemaBuilder.ts +9 -9
  1444. package/src/feature-libraries/changeAtomIdCodec.ts +2 -2
  1445. package/src/feature-libraries/chunked-forest/basicChunk.ts +9 -9
  1446. package/src/feature-libraries/chunked-forest/chunk.ts +4 -4
  1447. package/src/feature-libraries/chunked-forest/chunkTree.ts +12 -12
  1448. package/src/feature-libraries/chunked-forest/chunkedForest.ts +17 -17
  1449. package/src/feature-libraries/chunked-forest/codec/chunkCodecUtilities.ts +3 -3
  1450. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +33 -17
  1451. package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +12 -7
  1452. package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +5 -5
  1453. package/src/feature-libraries/chunked-forest/codec/codecs.ts +14 -6
  1454. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +16 -16
  1455. package/src/feature-libraries/chunked-forest/codec/fieldBatch.ts +1 -1
  1456. package/src/feature-libraries/chunked-forest/codec/format.ts +1 -1
  1457. package/src/feature-libraries/chunked-forest/codec/formatGeneric.ts +1 -1
  1458. package/src/feature-libraries/chunked-forest/codec/nodeShape.ts +19 -14
  1459. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncoding.ts +11 -11
  1460. package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +10 -5
  1461. package/src/feature-libraries/chunked-forest/emptyChunk.ts +5 -5
  1462. package/src/feature-libraries/chunked-forest/sequenceChunk.ts +1 -1
  1463. package/src/feature-libraries/chunked-forest/uniformChunk.ts +8 -8
  1464. package/src/feature-libraries/contextuallyTyped.ts +12 -12
  1465. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +17 -17
  1466. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +11 -11
  1467. package/src/feature-libraries/default-schema/defaultSchema.ts +1 -1
  1468. package/src/feature-libraries/default-schema/noChangeCodecs.ts +2 -2
  1469. package/src/feature-libraries/deltaUtils.ts +7 -2
  1470. package/src/feature-libraries/detachedFieldIndexSummarizer.ts +5 -5
  1471. package/src/feature-libraries/editableTreeBinder.ts +10 -10
  1472. package/src/feature-libraries/fieldGenerator.ts +2 -2
  1473. package/src/feature-libraries/flex-map-tree/mapTreeNode.ts +32 -32
  1474. package/src/feature-libraries/flex-tree/context.ts +11 -11
  1475. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +15 -12
  1476. package/src/feature-libraries/flex-tree/index.ts +1 -1
  1477. package/src/feature-libraries/flex-tree/lazyEntity.ts +9 -4
  1478. package/src/feature-libraries/flex-tree/lazyField.ts +22 -22
  1479. package/src/feature-libraries/flex-tree/lazyNode.ts +32 -38
  1480. package/src/feature-libraries/flex-tree/treeEvents.ts +1 -38
  1481. package/src/feature-libraries/flex-tree/unboxed.ts +7 -7
  1482. package/src/feature-libraries/flex-tree/utilities.ts +2 -2
  1483. package/src/feature-libraries/forest-summary/codec.ts +7 -3
  1484. package/src/feature-libraries/forest-summary/forestSummarizer.ts +15 -15
  1485. package/src/feature-libraries/forest-summary/format.ts +1 -1
  1486. package/src/feature-libraries/index.ts +0 -2
  1487. package/src/feature-libraries/mapTreeCursor.ts +6 -6
  1488. package/src/feature-libraries/memoizedIdRangeAllocator.ts +3 -3
  1489. package/src/feature-libraries/mitigatedChangeFamily.ts +1 -1
  1490. package/src/feature-libraries/modular-schema/comparison.ts +6 -6
  1491. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +3 -3
  1492. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +7 -7
  1493. package/src/feature-libraries/modular-schema/fieldKind.ts +1 -1
  1494. package/src/feature-libraries/modular-schema/fieldKindConfiguration.ts +2 -2
  1495. package/src/feature-libraries/modular-schema/fieldKindWithEditor.ts +3 -3
  1496. package/src/feature-libraries/modular-schema/genericFieldKind.ts +10 -10
  1497. package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +3 -3
  1498. package/src/feature-libraries/modular-schema/genericFieldKindFormat.ts +1 -1
  1499. package/src/feature-libraries/modular-schema/genericFieldKindTypes.ts +1 -1
  1500. package/src/feature-libraries/modular-schema/isNeverTree.ts +4 -4
  1501. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +25 -20
  1502. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +34 -34
  1503. package/src/feature-libraries/modular-schema/modularChangeFormat.ts +3 -3
  1504. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +3 -3
  1505. package/src/feature-libraries/node-key/mockNodeKeyManager.ts +2 -2
  1506. package/src/feature-libraries/node-key/nodeKey.ts +3 -3
  1507. package/src/feature-libraries/node-key/nodeKeyIndex.ts +4 -4
  1508. package/src/feature-libraries/node-key/nodeKeyManager.ts +1 -1
  1509. package/src/feature-libraries/object-forest/objectForest.ts +22 -22
  1510. package/src/feature-libraries/optional-field/optionalField.ts +20 -20
  1511. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV1.ts +1 -1
  1512. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV2.ts +1 -1
  1513. package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +2 -2
  1514. package/src/feature-libraries/optional-field/optionalFieldCodecV1.ts +4 -4
  1515. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +4 -4
  1516. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +2 -2
  1517. package/src/feature-libraries/schema-aware/schemaAware.ts +8 -4
  1518. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +3 -3
  1519. package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +1 -1
  1520. package/src/feature-libraries/schema-edits/schemaChangeTypes.ts +1 -1
  1521. package/src/feature-libraries/schema-index/codec.ts +8 -4
  1522. package/src/feature-libraries/schema-index/format.ts +1 -1
  1523. package/src/feature-libraries/schema-index/schemaSummarizer.ts +11 -7
  1524. package/src/feature-libraries/schemaBuilder.ts +2 -2
  1525. package/src/feature-libraries/schemaBuilderBase.ts +12 -12
  1526. package/src/feature-libraries/sequence-field/compose.ts +18 -18
  1527. package/src/feature-libraries/sequence-field/formatV1.ts +1 -1
  1528. package/src/feature-libraries/sequence-field/formatV2.ts +1 -1
  1529. package/src/feature-libraries/sequence-field/helperTypes.ts +1 -1
  1530. package/src/feature-libraries/sequence-field/invert.ts +14 -14
  1531. package/src/feature-libraries/sequence-field/markListFactory.ts +1 -1
  1532. package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
  1533. package/src/feature-libraries/sequence-field/moveEffectTable.ts +5 -5
  1534. package/src/feature-libraries/sequence-field/prune.ts +2 -2
  1535. package/src/feature-libraries/sequence-field/rebase.ts +18 -18
  1536. package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +3 -3
  1537. package/src/feature-libraries/sequence-field/replaceRevisions.ts +7 -7
  1538. package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +3 -3
  1539. package/src/feature-libraries/sequence-field/sequenceFieldChangeRebaser.ts +2 -2
  1540. package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +17 -17
  1541. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +16 -16
  1542. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +4 -4
  1543. package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +12 -3
  1544. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +7 -7
  1545. package/src/feature-libraries/sequence-field/types.ts +2 -2
  1546. package/src/feature-libraries/sequence-field/utils.ts +25 -25
  1547. package/src/feature-libraries/storedToViewSchema.ts +7 -7
  1548. package/src/feature-libraries/treeCursorUtils.ts +8 -8
  1549. package/src/feature-libraries/treeTextCursor.ts +10 -6
  1550. package/src/feature-libraries/typed-schema/schemaCollection.ts +11 -6
  1551. package/src/feature-libraries/typed-schema/typedTreeSchema.ts +16 -16
  1552. package/src/feature-libraries/typed-schema/view.ts +8 -8
  1553. package/src/feature-libraries/valueUtilities.ts +2 -2
  1554. package/src/index.ts +0 -1
  1555. package/src/packageVersion.ts +1 -1
  1556. package/src/shared-tree/schematizeTree.ts +7 -7
  1557. package/src/shared-tree/schematizingTreeView.ts +19 -16
  1558. package/src/shared-tree/sharedTree.ts +28 -16
  1559. package/src/shared-tree/sharedTreeChangeCodecs.ts +11 -8
  1560. package/src/shared-tree/sharedTreeChangeEnricher.ts +8 -8
  1561. package/src/shared-tree/sharedTreeChangeFamily.ts +21 -15
  1562. package/src/shared-tree/sharedTreeChangeFormat.ts +1 -1
  1563. package/src/shared-tree/sharedTreeChangeTypes.ts +1 -1
  1564. package/src/shared-tree/sharedTreeEditBuilder.ts +4 -4
  1565. package/src/shared-tree/treeApi.ts +5 -5
  1566. package/src/shared-tree/treeCheckout.ts +28 -23
  1567. package/src/shared-tree/treeView.ts +8 -8
  1568. package/src/shared-tree-core/branch.ts +8 -8
  1569. package/src/shared-tree-core/branchCommitEnricher.ts +2 -2
  1570. package/src/shared-tree-core/changeEnricher.ts +1 -1
  1571. package/src/shared-tree-core/defaultResubmitMachine.ts +2 -2
  1572. package/src/shared-tree-core/editManager.ts +8 -8
  1573. package/src/shared-tree-core/editManagerCodecs.ts +13 -8
  1574. package/src/shared-tree-core/editManagerFormat.ts +5 -5
  1575. package/src/shared-tree-core/editManagerSummarizer.ts +13 -9
  1576. package/src/shared-tree-core/messageCodecs.ts +7 -7
  1577. package/src/shared-tree-core/messageFormat.ts +4 -4
  1578. package/src/shared-tree-core/messageTypes.ts +2 -2
  1579. package/src/shared-tree-core/resubmitMachine.ts +1 -1
  1580. package/src/shared-tree-core/sequenceIdUtils.ts +1 -1
  1581. package/src/shared-tree-core/sharedTreeCore.ts +20 -20
  1582. package/src/shared-tree-core/transactionEnricher.ts +2 -2
  1583. package/src/shared-tree-core/transactionStack.ts +1 -1
  1584. package/src/simple-tree/arrayNode.ts +32 -28
  1585. package/src/simple-tree/leafNodeSchema.ts +4 -4
  1586. package/src/simple-tree/mapNode.ts +10 -10
  1587. package/src/simple-tree/nodeKeys.ts +2 -2
  1588. package/src/simple-tree/objectNode.ts +18 -18
  1589. package/src/simple-tree/proxies.ts +21 -27
  1590. package/src/simple-tree/proxyBinding.ts +14 -14
  1591. package/src/simple-tree/schemaCaching.ts +5 -5
  1592. package/src/simple-tree/schemaCreationUtilities.ts +5 -5
  1593. package/src/simple-tree/schemaFactory.ts +39 -22
  1594. package/src/simple-tree/schemaFactoryRecursive.ts +13 -13
  1595. package/src/simple-tree/schemaTypes.ts +8 -8
  1596. package/src/simple-tree/testRecursiveDomain.ts +1 -1
  1597. package/src/simple-tree/toFlexSchema.ts +13 -13
  1598. package/src/simple-tree/toMapTree.ts +4 -4
  1599. package/src/simple-tree/tree.ts +6 -31
  1600. package/src/simple-tree/treeNodeApi.ts +45 -33
  1601. package/src/simple-tree/types.ts +60 -12
  1602. package/src/simple-tree/typesUnsafe.ts +6 -6
  1603. package/src/treeFactory.ts +5 -5
  1604. package/src/util/brandedMap.ts +1 -1
  1605. package/src/util/nestedMap.ts +1 -1
  1606. package/src/util/nestedSet.ts +1 -1
  1607. package/src/util/typeboxBrand.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"treeApi.js","sourceRoot":"","sources":["../../src/shared-tree/treeApi.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA8E;AAE9E,4DAAoE;AACpE,sDAOiC;AACjC,+CAAwC;AAExC,uEAAuE;AAEvE,+CAAkD;AAElD;;;GAGG;AACU,QAAA,QAAQ,GAAG,MAAM,CAAC,iCAAiC,CAAC,CAAC;AAgUlE;;;GAGG;AACU,QAAA,OAAO,GAAY;IAC/B,GAAG,sBAAW;IAEd,cAAc,EAAE,oBAAoB,EAAE;IAEtC,QAAQ,CAAC,MAAgB,EAAE,KAAe;QACzC,IAAI,OAAO,GAAyB,KAAK,CAAC;QAC1C,OAAO,OAAO,KAAK,SAAS,EAAE,CAAC;YAC9B,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;gBACxB,OAAO,IAAI,CAAC;YACb,CAAC;YACD,OAAO,GAAG,eAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC;QACD,OAAO,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IAE/C,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IAC7B,KAAK,MAAM,UAAU,IAAI,aAAa,EAAE,CAAC;QACxC,QAAQ,UAAU,CAAC,IAAI,EAAE,CAAC;YACzB,KAAK,gBAAgB,CAAC,CAAC,CAAC;gBACvB,MAAM,IAAI,GAAG,IAAA,sBAAW,EAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBAC1C,IAAA,iBAAM,EACL,IAAI,CAAC,UAAU,EAAE,KAAK,qBAAU,CAAC,UAAU,EAC3C,KAAK,CAAC,kHAAkH,CACxH,CAAC;gBACF,QAAQ,CAAC,MAAM,CAAC,uBAAuB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBACzD,MAAM;YACP,CAAC;YACD;gBACC,IAAA,0BAAe,EAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACnC,CAAC;IACF,CAAC;IACD,IAAI,MAAsC,CAAC;IAC3C,IAAI,CAAC;QACJ,MAAM,GAAG,WAAW,EAAE,CAAC;IACxB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACZ,qHAAqH;QACrH,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QAC7B,MAAM,CAAC,CAAC;IACT,CAAC;IAED,IAAI,MAAM,KAAK,gBAAQ,EAAE,CAAC;QACzB,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IAC9B,CAAC;SAAM,CAAC;QACP,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;IAC/B,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport { Context, TreeStatus } from \"../feature-libraries/index.js\";\nimport {\n\tImplicitFieldSchema,\n\tTreeNode,\n\tTreeNodeApi,\n\tTreeView,\n\tgetFlexNode,\n\ttreeNodeApi,\n} from \"../simple-tree/index.js\";\nimport { fail } from \"../util/index.js\";\n\nimport { SchematizingSimpleTreeView } from \"./schematizingTreeView.js\";\nimport { TreeCheckout } from \"./treeCheckout.js\";\nimport { contextToTreeView } from \"./treeView.js\";\n\n/**\n * A special object that signifies when a SharedTree {@link RunTransaction | transaction} should \"roll back\".\n * @public\n */\nexport const rollback = Symbol(\"SharedTree Transaction Rollback\");\n\n/**\n * A function which runs a transaction in a SharedTree.\n * @privateRemarks\n * This interface exists so that the (generously) overloaded `Tree.runTransaction` function can have the \"rollback\" property hanging off of it.\n * The rollback property being available on the function itself gives users a convenient option for rolling back a transaction without having to import another symbol.\n * @public\n */\nexport interface RunTransaction {\n\t/**\n\t * The {@link rollback} object used to roll back a transaction.\n\t */\n\treadonly rollback: typeof rollback;\n\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode, TResult>(node: TNode, transaction: (node: TNode) => TResult): TResult;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TView extends TreeView<ImplicitFieldSchema>, TResult>(\n\t\ttree: TView,\n\t\ttransaction: (root: TView[\"root\"]) => TResult,\n\t): TResult;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * At any point during the transaction, the function may return the special {@link RunTransaction.rollback | rollback value} (`Tree.runTransaction.rollback`) to abort the transaction and discard any changes it made so far.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back (whether by an error or by returning the {@link RunTransaction.rollback} | rollback value), a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode, TResult>(\n\t\tnode: TNode,\n\t\ttransaction: (node: TNode) => TResult | typeof rollback,\n\t): TResult | typeof rollback;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * At any point during the transaction, the function may return the special {@link RunTransaction.rollback | rollback value} (`Tree.runTransaction.rollback`) to abort the transaction and discard any changes it made so far.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back (whether by an error or by returning the {@link RunTransaction.rollback} | rollback value), a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TView extends TreeView<ImplicitFieldSchema>, TResult>(\n\t\ttree: TView,\n\t\ttransaction: (root: TView[\"root\"]) => TResult | typeof rollback,\n\t): TResult | typeof rollback;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode>(node: TNode, transaction: (node: TNode) => void): void;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TView extends TreeView<ImplicitFieldSchema>>(\n\t\ttree: TView,\n\t\ttransaction: (root: TView[\"root\"]) => void,\n\t): void;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode, TResult>(\n\t\tnode: TNode,\n\t\ttransaction: (node: TNode) => TResult,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): TResult;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TView extends TreeView<ImplicitFieldSchema>, TResult>(\n\t\ttree: TView,\n\t\ttransaction: (root: TView[\"root\"]) => TResult,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): TResult;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * At any point during the transaction, the function may return the special {@link RunTransaction.rollback | rollback value} (`Tree.runTransaction.rollback`) to abort the transaction and discard any changes it made so far.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back (whether by an error or by returning the {@link RunTransaction.rollback} | rollback value), a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode, TResult>(\n\t\tnode: TNode,\n\t\ttransaction: (node: TNode) => TResult | typeof rollback,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): TResult | typeof rollback;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * At any point during the transaction, the function may return the special {@link RunTransaction.rollback | rollback value} (`Tree.runTransaction.rollback`) to abort the transaction and discard any changes it made so far.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back (whether by an error or by returning the {@link RunTransaction.rollback} | rollback value), a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TView extends TreeView<ImplicitFieldSchema>, TResult>(\n\t\ttree: TView,\n\t\ttransaction: (root: TView[\"root\"]) => TResult | typeof rollback,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): TResult | typeof rollback;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode>(\n\t\tnode: TNode,\n\t\ttransaction: (node: TNode) => void,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): void;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TView extends TreeView<ImplicitFieldSchema>>(\n\t\ttree: TView,\n\t\ttransaction: (root: TView[\"root\"]) => void,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): void;\n}\n\n/**\n * Provides various functions for interacting with {@link TreeNode}s.\n * @public\n */\nexport interface TreeApi extends TreeNodeApi {\n\t/**\n\t * Run a {@link RunTransaction | transaction}.\n\t */\n\treadonly runTransaction: RunTransaction;\n\t/**\n\t * Check if the subtree defined by `node` contains `other`.\n\t *\n\t * @returns true if `other` is an inclusive descendant of `node`, and false otherwise.\n\t * @remarks\n\t * This includes direct and indirect children:\n\t * as long as `node` is an ancestor of `other` (occurs in its parentage chain), this returns true, regardless of the number of levels of the tree between.\n\t *\n\t * `node` is considered to contain itself, so the case where `node === other` returns true.\n\t *\n\t * This is handy when checking if moving `node` into `other` would create a cycle and thus is invalid.\n\t *\n\t * This check walks the parents of `other` looking for `node`,\n\t * and thus runs in time proportional to the depth of child in the tree.\n\t */\n\tcontains(node: TreeNode, other: TreeNode): boolean;\n}\n\n/**\n * The `Tree` object holds various functions for interacting with {@link TreeNode}s.\n * @public\n */\nexport const treeApi: TreeApi = {\n\t...treeNodeApi,\n\n\trunTransaction: createRunTransaction(),\n\n\tcontains(parent: TreeNode, child: TreeNode): boolean {\n\t\tlet toCheck: TreeNode | undefined = child;\n\t\twhile (toCheck !== undefined) {\n\t\t\tif (toCheck === parent) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\ttoCheck = treeApi.parent(toCheck);\n\t\t}\n\t\treturn false;\n\t},\n};\n\n/**\n * A requirement for a SharedTree transaction to succeed.\n * @remarks Transaction constraints are useful for validating that the state of the tree meets some requirement when a transaction runs.\n * In general, when running a transaction a client can validate their tree state in whatever way they wish and decide to either proceed with the transaction or not.\n * However, they cannot know what the tree state will be when the transaction is _sequenced_.\n * There may have been any number of edits from other clients that get sequenced before the transaction is eventually sequenced.\n * Constraints provide a way to validate the tree state after the transaction has been sequenced and abort the transaction if the constraints are not met.\n * All clients will validate the constraints of a transaction when it is sequenced, so all clients will agree on whether the transaction succeeds or not.\n * @public\n */\nexport type TransactionConstraint = NodeInDocumentConstraint; // TODO: Add more constraint types here\n\n/**\n * A transaction {@link TransactionConstraint | constraint} which requires that the given node exists in the tree.\n * @remarks The node must be in the document (its {@link TreeStatus | status} must be {@link TreeStatus.InDocument | InDocument}) to qualify as \"existing\".\n * @public\n */\nexport interface NodeInDocumentConstraint {\n\treadonly type: \"nodeInDocument\";\n\treadonly node: TreeNode;\n}\n\n// TODO: Add more constraint types here\n\n/** Creates a copy of `runTransaction` with the `rollback` property added so as to satisfy the `RunTransaction` interface. */\nfunction createRunTransaction(): RunTransaction {\n\t/** A type-safe helper to add a \"rollback\" property (as required by the `RunTransaction` interface) to a given object */\n\tfunction defineRollbackProperty<T extends object>(\n\t\ttarget: T,\n\t): T & { rollback: typeof rollback } {\n\t\tReflect.defineProperty(target, \"rollback\", { value: rollback });\n\t\treturn target as T & { readonly rollback: typeof rollback };\n\t}\n\n\treturn defineRollbackProperty(runTransaction.bind({}));\n}\n\n/**\n * Run the given transaction.\n * @remarks\n * This API is not publicly exported but is exported outside of this module so that test code may unit test the `Tree.runTransaction` function directly without being restricted to its public API overloads.\n */\nexport function runTransaction<TNode extends TreeNode, TRoot extends ImplicitFieldSchema, TResult>(\n\ttreeOrNode: TNode | TreeView<TRoot>,\n\ttransaction:\n\t\t| ((node: TNode) => TResult | typeof rollback)\n\t\t| ((root: TRoot) => TResult | typeof rollback),\n\tpreconditions: readonly TransactionConstraint[] = [],\n): TResult | typeof rollback {\n\tif (treeOrNode instanceof SchematizingSimpleTreeView) {\n\t\tconst t = transaction as (root: TRoot) => TResult | typeof rollback;\n\t\treturn runTransactionInCheckout(\n\t\t\ttreeOrNode.checkout,\n\t\t\t() => t(treeOrNode.root as TRoot),\n\t\t\tpreconditions,\n\t\t);\n\t} else {\n\t\tconst node = treeOrNode as TNode;\n\t\tconst t = transaction as (node: TNode) => TResult | typeof rollback;\n\t\tconst context = getFlexNode(node).context;\n\t\tassert(context instanceof Context, 0x901 /* Unsupported context */);\n\t\tconst treeView =\n\t\t\tcontextToTreeView.get(context) ?? fail(\"Expected view to be registered for context\");\n\n\t\treturn runTransactionInCheckout(treeView.checkout, () => t(node), preconditions);\n\t}\n}\n\nfunction runTransactionInCheckout<TResult>(\n\tcheckout: TreeCheckout,\n\ttransaction: () => TResult | typeof rollback,\n\tpreconditions: readonly TransactionConstraint[],\n): TResult | typeof rollback {\n\tcheckout.transaction.start();\n\tfor (const constraint of preconditions) {\n\t\tswitch (constraint.type) {\n\t\t\tcase \"nodeInDocument\": {\n\t\t\t\tconst node = getFlexNode(constraint.node);\n\t\t\t\tassert(\n\t\t\t\t\tnode.treeStatus() === TreeStatus.InDocument,\n\t\t\t\t\t0x90f /* Attempted to apply \"nodeExists\" constraint when building a transaction, but the node is not in the document. */,\n\t\t\t\t);\n\t\t\t\tcheckout.editor.addNodeExistsConstraint(node.anchorNode);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tunreachableCase(constraint.type);\n\t\t}\n\t}\n\tlet result: ReturnType<typeof transaction>;\n\ttry {\n\t\tresult = transaction();\n\t} catch (e) {\n\t\t// If the transaction has an unhandled error, abort and rollback the transaction but continue to propagate the error.\n\t\tcheckout.transaction.abort();\n\t\tthrow e;\n\t}\n\n\tif (result === rollback) {\n\t\tcheckout.transaction.abort();\n\t} else {\n\t\tcheckout.transaction.commit();\n\t}\n\n\treturn result;\n}\n"]}
1
+ {"version":3,"file":"treeApi.js","sourceRoot":"","sources":["../../src/shared-tree/treeApi.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA8E;AAE9E,4DAAoE;AACpE,sDAOiC;AACjC,+CAAwC;AAExC,uEAAuE;AAEvE,+CAAkD;AAElD;;;GAGG;AACU,QAAA,QAAQ,GAAG,MAAM,CAAC,iCAAiC,CAAC,CAAC;AAgUlE;;;GAGG;AACU,QAAA,OAAO,GAAY;IAC/B,GAAG,sBAAW;IAEd,cAAc,EAAE,oBAAoB,EAAE;IAEtC,QAAQ,CAAC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M,CAAC;AACf,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport { Context, TreeStatus } from \"../feature-libraries/index.js\";\nimport {\n\ttype ImplicitFieldSchema,\n\ttype TreeNode,\n\ttype TreeNodeApi,\n\ttype TreeView,\n\tgetFlexNode,\n\ttreeNodeApi,\n} from \"../simple-tree/index.js\";\nimport { fail } from \"../util/index.js\";\n\nimport { SchematizingSimpleTreeView } from \"./schematizingTreeView.js\";\nimport type { TreeCheckout } from \"./treeCheckout.js\";\nimport { contextToTreeView } from \"./treeView.js\";\n\n/**\n * A special object that signifies when a SharedTree {@link RunTransaction | transaction} should \"roll back\".\n * @public\n */\nexport const rollback = Symbol(\"SharedTree Transaction Rollback\");\n\n/**\n * A function which runs a transaction in a SharedTree.\n * @privateRemarks\n * This interface exists so that the (generously) overloaded `Tree.runTransaction` function can have the \"rollback\" property hanging off of it.\n * The rollback property being available on the function itself gives users a convenient option for rolling back a transaction without having to import another symbol.\n * @public\n */\nexport interface RunTransaction {\n\t/**\n\t * The {@link rollback} object used to roll back a transaction.\n\t */\n\treadonly rollback: typeof rollback;\n\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode, TResult>(node: TNode, transaction: (node: TNode) => TResult): TResult;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TView extends TreeView<ImplicitFieldSchema>, TResult>(\n\t\ttree: TView,\n\t\ttransaction: (root: TView[\"root\"]) => TResult,\n\t): TResult;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * At any point during the transaction, the function may return the special {@link RunTransaction.rollback | rollback value} (`Tree.runTransaction.rollback`) to abort the transaction and discard any changes it made so far.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back (whether by an error or by returning the {@link RunTransaction.rollback} | rollback value), a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode, TResult>(\n\t\tnode: TNode,\n\t\ttransaction: (node: TNode) => TResult | typeof rollback,\n\t): TResult | typeof rollback;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * At any point during the transaction, the function may return the special {@link RunTransaction.rollback | rollback value} (`Tree.runTransaction.rollback`) to abort the transaction and discard any changes it made so far.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back (whether by an error or by returning the {@link RunTransaction.rollback} | rollback value), a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TView extends TreeView<ImplicitFieldSchema>, TResult>(\n\t\ttree: TView,\n\t\ttransaction: (root: TView[\"root\"]) => TResult | typeof rollback,\n\t): TResult | typeof rollback;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode>(node: TNode, transaction: (node: TNode) => void): void;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TView extends TreeView<ImplicitFieldSchema>>(\n\t\ttree: TView,\n\t\ttransaction: (root: TView[\"root\"]) => void,\n\t): void;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode, TResult>(\n\t\tnode: TNode,\n\t\ttransaction: (node: TNode) => TResult,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): TResult;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TView extends TreeView<ImplicitFieldSchema>, TResult>(\n\t\ttree: TView,\n\t\ttransaction: (root: TView[\"root\"]) => TResult,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): TResult;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * At any point during the transaction, the function may return the special {@link RunTransaction.rollback | rollback value} (`Tree.runTransaction.rollback`) to abort the transaction and discard any changes it made so far.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back (whether by an error or by returning the {@link RunTransaction.rollback} | rollback value), a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode, TResult>(\n\t\tnode: TNode,\n\t\ttransaction: (node: TNode) => TResult | typeof rollback,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): TResult | typeof rollback;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * At any point during the transaction, the function may return the special {@link RunTransaction.rollback | rollback value} (`Tree.runTransaction.rollback`) to abort the transaction and discard any changes it made so far.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back (whether by an error or by returning the {@link RunTransaction.rollback} | rollback value), a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TView extends TreeView<ImplicitFieldSchema>, TResult>(\n\t\ttree: TView,\n\t\ttransaction: (root: TView[\"root\"]) => TResult | typeof rollback,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): TResult | typeof rollback;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode>(\n\t\tnode: TNode,\n\t\ttransaction: (node: TNode) => void,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): void;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TView extends TreeView<ImplicitFieldSchema>>(\n\t\ttree: TView,\n\t\ttransaction: (root: TView[\"root\"]) => void,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): void;\n}\n\n/**\n * Provides various functions for interacting with {@link TreeNode}s.\n * @public\n */\nexport interface TreeApi extends TreeNodeApi {\n\t/**\n\t * Run a {@link RunTransaction | transaction}.\n\t */\n\treadonly runTransaction: RunTransaction;\n\t/**\n\t * Check if the subtree defined by `node` contains `other`.\n\t *\n\t * @returns true if `other` is an inclusive descendant of `node`, and false otherwise.\n\t * @remarks\n\t * This includes direct and indirect children:\n\t * as long as `node` is an ancestor of `other` (occurs in its parentage chain), this returns true, regardless of the number of levels of the tree between.\n\t *\n\t * `node` is considered to contain itself, so the case where `node === other` returns true.\n\t *\n\t * This is handy when checking if moving `node` into `other` would create a cycle and thus is invalid.\n\t *\n\t * This check walks the parents of `other` looking for `node`,\n\t * and thus runs in time proportional to the depth of child in the tree.\n\t */\n\tcontains(node: TreeNode, other: TreeNode): boolean;\n}\n\n/**\n * The `Tree` object holds various functions for interacting with {@link TreeNode}s.\n * @public\n */\nexport const treeApi: TreeApi = {\n\t...treeNodeApi,\n\n\trunTransaction: createRunTransaction(),\n\n\tcontains(parent: TreeNode, child: TreeNode): boolean {\n\t\tlet toCheck: TreeNode | undefined = child;\n\t\twhile (toCheck !== undefined) {\n\t\t\tif (toCheck === parent) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\ttoCheck = treeApi.parent(toCheck);\n\t\t}\n\t\treturn false;\n\t},\n};\n\n/**\n * A requirement for a SharedTree transaction to succeed.\n * @remarks Transaction constraints are useful for validating that the state of the tree meets some requirement when a transaction runs.\n * In general, when running a transaction a client can validate their tree state in whatever way they wish and decide to either proceed with the transaction or not.\n * However, they cannot know what the tree state will be when the transaction is _sequenced_.\n * There may have been any number of edits from other clients that get sequenced before the transaction is eventually sequenced.\n * Constraints provide a way to validate the tree state after the transaction has been sequenced and abort the transaction if the constraints are not met.\n * All clients will validate the constraints of a transaction when it is sequenced, so all clients will agree on whether the transaction succeeds or not.\n * @public\n */\nexport type TransactionConstraint = NodeInDocumentConstraint; // TODO: Add more constraint types here\n\n/**\n * A transaction {@link TransactionConstraint | constraint} which requires that the given node exists in the tree.\n * @remarks The node must be in the document (its {@link TreeStatus | status} must be {@link TreeStatus.InDocument | InDocument}) to qualify as \"existing\".\n * @public\n */\nexport interface NodeInDocumentConstraint {\n\treadonly type: \"nodeInDocument\";\n\treadonly node: TreeNode;\n}\n\n// TODO: Add more constraint types here\n\n/** Creates a copy of `runTransaction` with the `rollback` property added so as to satisfy the `RunTransaction` interface. */\nfunction createRunTransaction(): RunTransaction {\n\t/** A type-safe helper to add a \"rollback\" property (as required by the `RunTransaction` interface) to a given object */\n\tfunction defineRollbackProperty<T extends object>(\n\t\ttarget: T,\n\t): T & { rollback: typeof rollback } {\n\t\tReflect.defineProperty(target, \"rollback\", { value: rollback });\n\t\treturn target as T & { readonly rollback: typeof rollback };\n\t}\n\n\treturn defineRollbackProperty(runTransaction.bind({}));\n}\n\n/**\n * Run the given transaction.\n * @remarks\n * This API is not publicly exported but is exported outside of this module so that test code may unit test the `Tree.runTransaction` function directly without being restricted to its public API overloads.\n */\nexport function runTransaction<TNode extends TreeNode, TRoot extends ImplicitFieldSchema, TResult>(\n\ttreeOrNode: TNode | TreeView<TRoot>,\n\ttransaction:\n\t\t| ((node: TNode) => TResult | typeof rollback)\n\t\t| ((root: TRoot) => TResult | typeof rollback),\n\tpreconditions: readonly TransactionConstraint[] = [],\n): TResult | typeof rollback {\n\tif (treeOrNode instanceof SchematizingSimpleTreeView) {\n\t\tconst t = transaction as (root: TRoot) => TResult | typeof rollback;\n\t\treturn runTransactionInCheckout(\n\t\t\ttreeOrNode.checkout,\n\t\t\t() => t(treeOrNode.root as TRoot),\n\t\t\tpreconditions,\n\t\t);\n\t} else {\n\t\tconst node = treeOrNode as TNode;\n\t\tconst t = transaction as (node: TNode) => TResult | typeof rollback;\n\t\tconst context = getFlexNode(node).context;\n\t\tassert(context instanceof Context, 0x901 /* Unsupported context */);\n\t\tconst treeView =\n\t\t\tcontextToTreeView.get(context) ?? fail(\"Expected view to be registered for context\");\n\n\t\treturn runTransactionInCheckout(treeView.checkout, () => t(node), preconditions);\n\t}\n}\n\nfunction runTransactionInCheckout<TResult>(\n\tcheckout: TreeCheckout,\n\ttransaction: () => TResult | typeof rollback,\n\tpreconditions: readonly TransactionConstraint[],\n): TResult | typeof rollback {\n\tcheckout.transaction.start();\n\tfor (const constraint of preconditions) {\n\t\tswitch (constraint.type) {\n\t\t\tcase \"nodeInDocument\": {\n\t\t\t\tconst node = getFlexNode(constraint.node);\n\t\t\t\tassert(\n\t\t\t\t\tnode.treeStatus() === TreeStatus.InDocument,\n\t\t\t\t\t0x90f /* Attempted to apply \"nodeExists\" constraint when building a transaction, but the node is not in the document. */,\n\t\t\t\t);\n\t\t\t\tcheckout.editor.addNodeExistsConstraint(node.anchorNode);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tunreachableCase(constraint.type);\n\t\t}\n\t}\n\tlet result: ReturnType<typeof transaction>;\n\ttry {\n\t\tresult = transaction();\n\t} catch (e) {\n\t\t// If the transaction has an unhandled error, abort and rollback the transaction but continue to propagate the error.\n\t\tcheckout.transaction.abort();\n\t\tthrow e;\n\t}\n\n\tif (result === rollback) {\n\t\tcheckout.transaction.abort();\n\t} else {\n\t\tcheckout.transaction.commit();\n\t}\n\n\treturn result;\n}\n"]}
@@ -2,14 +2,14 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IIdCompressor } from "@fluidframework/id-compressor";
6
- import { Anchor, AnchorLocator, AnchorNode, AnchorSetRootEvents, ChangeFamily, CommitMetadata, DetachedFieldIndex, IEditableForest, IForestSubscription, JsonableTree, Revertible, RevisionTag, RevisionTagCodec, TreeStoredSchema, TreeStoredSchemaRepository, TreeStoredSchemaSubscription } from "../core/index.js";
7
- import { HasListeners, IEmitter, Listenable } from "../events/index.js";
8
- import { FieldBatchCodec, TreeCompressionStrategy } from "../feature-libraries/index.js";
5
+ import type { IIdCompressor } from "@fluidframework/id-compressor";
6
+ import { type Anchor, type AnchorLocator, type AnchorNode, type AnchorSetRootEvents, type ChangeFamily, type CommitMetadata, type DetachedFieldIndex, type IEditableForest, type IForestSubscription, type JsonableTree, type Revertible, type RevisionTag, type RevisionTagCodec, type TreeStoredSchema, TreeStoredSchemaRepository, type TreeStoredSchemaSubscription } from "../core/index.js";
7
+ import { type HasListeners, type IEmitter, type Listenable } from "../events/index.js";
8
+ import { type FieldBatchCodec, type TreeCompressionStrategy } from "../feature-libraries/index.js";
9
9
  import { SharedTreeBranch } from "../shared-tree-core/index.js";
10
- import { IDisposable, TransactionResult, disposeSymbol } from "../util/index.js";
11
- import { SharedTreeChange } from "./sharedTreeChangeTypes.js";
12
- import { ISharedTreeEditor, SharedTreeEditBuilder } from "./sharedTreeEditBuilder.js";
10
+ import { type IDisposable, TransactionResult, disposeSymbol } from "../util/index.js";
11
+ import type { SharedTreeChange } from "./sharedTreeChangeTypes.js";
12
+ import type { ISharedTreeEditor, SharedTreeEditBuilder } from "./sharedTreeEditBuilder.js";
13
13
  /**
14
14
  * Events for {@link ITreeCheckout}.
15
15
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"treeCheckout.d.ts","sourceRoot":"","sources":["../../src/shared-tree/treeCheckout.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAG9D,OAAO,EACN,MAAM,EACN,aAAa,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ACH,wBAAgB,cAAc,CAC7B,IAAI,EAAE,aAAa,EACnB,WAAW,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,iBAAiB,GAAG,IAAI,GAC5D,iBAAiB,CAMnB"}
@@ -40,7 +40,6 @@ function createTreeCheckout(idCompressor, mintRevisionTag, revisionTagCodec, arg
40
40
  }
41
41
  exports.createTreeCheckout = createTreeCheckout;
42
42
  class Transaction {
43
- branch;
44
43
  constructor(branch) {
45
44
  this.branch = branch;
46
45
  }
@@ -66,27 +65,6 @@ class Transaction {
66
65
  * An implementation of {@link ITreeCheckoutFork}.
67
66
  */
68
67
  class TreeCheckout {
69
- transaction;
70
- branch;
71
- changeFamily;
72
- storedSchema;
73
- forest;
74
- events;
75
- mintRevisionTag;
76
- revisionTagCodec;
77
- idCompressor;
78
- removedRoots;
79
- isDisposed = false;
80
- /**
81
- * Set of revertibles maintained for automatic disposal
82
- */
83
- revertibles = new Set();
84
- /**
85
- * Each branch's head commit corresponds to a revertible commit.
86
- * Maintaining a whole branch ensures the commit graph is not pruned in a way that would prevent the commit from
87
- * being reverted.
88
- */
89
- revertibleCommitBranches = new Map();
90
68
  constructor(transaction, branch, changeFamily, storedSchema, forest, events, mintRevisionTag, revisionTagCodec, idCompressor, removedRoots = (0, index_js_2.makeDetachedFieldIndex)("repair", revisionTagCodec, idCompressor)) {
91
69
  this.transaction = transaction;
92
70
  this.branch = branch;
@@ -98,6 +76,17 @@ class TreeCheckout {
98
76
  this.revisionTagCodec = revisionTagCodec;
99
77
  this.idCompressor = idCompressor;
100
78
  this.removedRoots = removedRoots;
79
+ this.isDisposed = false;
80
+ /**
81
+ * Set of revertibles maintained for automatic disposal
82
+ */
83
+ this.revertibles = new Set();
84
+ /**
85
+ * Each branch's head commit corresponds to a revertible commit.
86
+ * Maintaining a whole branch ensures the commit graph is not pruned in a way that would prevent the commit from
87
+ * being reverted.
88
+ */
89
+ this.revertibleCommitBranches = new Map();
101
90
  // We subscribe to `beforeChange` rather than `afterChange` here because it's possible that the change is invalid WRT our forest.
102
91
  // For example, a bug in the editor might produce a malformed change object and thus applying the change to the forest will throw an error.
103
92
  // In such a case we will crash here, preventing the change from being added to the commit graph, and preventing `afterChange` from firing.
@@ -1 +1 @@
1
- {"version":3,"file":"treeCheckout.js","sourceRoot":"","sources":["../../src/shared-tree/treeCheckout.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,uEAAsE;AACtE,gDAAkD;AAClD,+CA2B0B;AAC1B,iDAAuF;AACvF,4DAOuC;AACvC,2DAAsF;AACtF,+CAAuF;AAEvF,2EAAsF;AAmJtF;;;;;;GAMG;AACH,SAAgB,kBAAkB,CACjC,YAA2B,EAC3B,eAAkC,EAClC,gBAAkC,EAClC,IAWC;IAED,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,IAAI,IAAA,sBAAW,GAAE,CAAC;IAC7C,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,IAAI,IAAI,qCAA0B,EAAE,CAAC;IAChE,MAAM,mBAAmB,GAAG,EAAE,aAAa,EAAE,wBAAa,EAAE,CAAC;IAC7D,MAAM,wBAAwB,GAAG,CAAC,CAAC;IACnC,MAAM,YAAY,GACjB,IAAI,EAAE,YAAY;QAClB,IAAI,kDAAsB,CACzB,gBAAgB,EAChB,IAAI,EAAE,eAAe;YACpB,IAAA,8BAAmB,EAAC,mBAAmB,EAAE,wBAAwB,CAAC,EACnE,EAAE,aAAa,EAAE,wBAAa,EAAE,EAChC,IAAI,EAAE,wBAAwB,CAC9B,CAAC;IACH,MAAM,MAAM,GACX,IAAI,EAAE,MAAM;QACZ,IAAI,2BAAgB,CACnB;YACC,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YACxC,QAAQ,EAAE,MAAM;SAChB,EACD,YAAY,EACZ,GAAG,EAAE,CAAC,YAAY,CAAC,oBAAoB,EAAE,CACzC,CAAC;IACH,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM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,CAAC,YAAY,CAAC,OAAO,EACzB,MAAM,EACN,cAAc,EACd,UAAU,EACV,IAAI,CAAC,eAAe,CACpB,CAAC,MAAM,CACR,CAAC;QACH,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAChB,MAAM,CAAC,MAAM,EACb,IAAI,CAAC,eAAe,EAAE,EACtB,IAAI,KAAK,qBAAU,CAAC,OAAO,IAAI,IAAI,KAAK,qBAAU,CAAC,IAAI;YACtD,CAAC,CAAC,qBAAU,CAAC,IAAI;YACjB,CAAC,CAAC,qBAAU,CAAC,IAAI,CAClB,CAAC;IACH,CAAC;CACD;AAtSD,oCAsSC;AAED;;;;;;;;GAQG;AACH,SAAgB,cAAc,CAC7B,IAAmB,EACnB,WAA8D;IAE9D,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IACzB,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IACjC,OAAO,MAAM,KAAK,4BAAiB,CAAC,KAAK;QACxC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE;QAC1B,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;AAC9B,CAAC;AATD,wCASC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { IIdCompressor } from \"@fluidframework/id-compressor\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { noopValidator } from \"../codec/index.js\";\nimport {\n\tAnchor,\n\tAnchorLocator,\n\tAnchorNode,\n\tAnchorSet,\n\tAnchorSetRootEvents,\n\tChangeFamily,\n\tCommitKind,\n\tCommitMetadata,\n\tDeltaVisitor,\n\tDetachedFieldIndex,\n\tIEditableForest,\n\tIForestSubscription,\n\tJsonableTree,\n\tRevertible,\n\tRevertibleStatus,\n\tRevisionTag,\n\tRevisionTagCodec,\n\tTreeStoredSchema,\n\tTreeStoredSchemaRepository,\n\tTreeStoredSchemaSubscription,\n\tcombineVisitors,\n\tmakeAnonChange,\n\tmakeDetachedFieldIndex,\n\trebaseChange,\n\ttagChange,\n\tvisitDelta,\n} from \"../core/index.js\";\nimport { HasListeners, IEmitter, Listenable, createEmitter } from \"../events/index.js\";\nimport {\n\tFieldBatchCodec,\n\tTreeCompressionStrategy,\n\tbuildForest,\n\tintoDelta,\n\tjsonableTreeFromCursor,\n\tmakeFieldBatchCodec,\n} from \"../feature-libraries/index.js\";\nimport { SharedTreeBranch, getChangeReplaceType } from \"../shared-tree-core/index.js\";\nimport { IDisposable, TransactionResult, disposeSymbol, fail } from \"../util/index.js\";\n\nimport { SharedTreeChangeFamily, hasSchemaChange } from \"./sharedTreeChangeFamily.js\";\nimport { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\nimport { ISharedTreeEditor, SharedTreeEditBuilder } from \"./sharedTreeEditBuilder.js\";\n\n/**\n * Events for {@link ITreeCheckout}.\n * @internal\n */\nexport interface CheckoutEvents {\n\t/**\n\t * A batch of changes has finished processing and the view is in a consistent state.\n\t * It is once again safe to access the FlexTree, Forest and AnchorSet.\n\t *\n\t * @remarks\n\t * This is mainly useful for knowing when to do followup work scheduled during events from Anchors.\n\t */\n\tafterBatch(): void;\n\n\t/**\n\t * Fired when a revertible change has been made to this view.\n\t *\n\t * Applications which subscribe to this event are expected to revert or discard revertibles they acquire (failure to do so will leak memory).\n\t * The provided revertible is inherently bound to the view that raised the event, calling `revert` won't apply to forked views.\n\t *\n\t * @param revertible - The revertible that can be used to revert the change.\n\t */\n\n\t/**\n\t * {@inheritdoc TreeViewEvents.commitApplied}\n\t */\n\tcommitApplied(data: CommitMetadata, getRevertible?: RevertibleFactory): void;\n}\n\n/**\n * Factory for creating a {@link Revertible}.\n * Will error if invoked outside the scope of the `commitApplied` event that provides it, or if invoked multiple times.\n *\n * @param onRevertibleDisposed - A callback that will be invoked when the `Revertible` generated by this factory is disposed.\n * This happens when the `Revertible` is disposed manually, or when the `TreeView` that the `Revertible` belongs to is disposed,\n * whichever happens first.\n * This is typically used to clean up any resources associated with the `Revertible` in the host application.\n *\n * @public\n */\nexport type RevertibleFactory = (\n\tonRevertibleDisposed?: (revertible: Revertible) => void,\n) => Revertible;\n\n/**\n * Provides a means for interacting with a SharedTree.\n * This includes reading data from the tree and running transactions to mutate the tree.\n * @remarks This interface should not have any implementations other than those provided by the SharedTree package libraries.\n * @privateRemarks\n * API for interacting with a {@link SharedTreeBranch}.\n * Implementations of this interface must implement the {@link branchKey} property.\n * @internal\n */\nexport interface ITreeCheckout extends AnchorLocator {\n\t/**\n\t * Read and Write access for schema stored in the document.\n\t *\n\t * These APIs are temporary and will be replaced with different abstractions (View Schema based) in a different place later.\n\t *\n\t * TODO:\n\t * Editing of this should be moved into transactions with the rest of tree editing to they can be intermixed.\n\t * This will be done after the relations between views, branches and Indexes are figured out.\n\t *\n\t * TODO:\n\t * Public APIs for dealing with schema should be in terms of View Schema, and schema update policies.\n\t * The actual stored schema should be hidden (or ar least not be the most prominent way to interact with schema).\n\t *\n\t * TODO:\n\t * Something should ensure the document contents are always in schema.\n\t */\n\treadonly storedSchema: TreeStoredSchemaSubscription;\n\t/**\n\t * Current contents.\n\t * Updated by edits (local and remote).\n\t * Use `editor` to create a local edit.\n\t */\n\treadonly forest: IForestSubscription;\n\n\t/**\n\t * Used to edit the state of the tree. Edits will be immediately applied locally to the tree.\n\t * If there is no transaction currently ongoing, then the edits will be submitted to Fluid immediately as well.\n\t */\n\treadonly editor: ISharedTreeEditor;\n\n\t/**\n\t * A collection of functions for managing transactions.\n\t */\n\treadonly transaction: ITransaction;\n\n\t/**\n\t * Spawn a new view which is based off of the current state of this view.\n\t * Any mutations of the new view will not apply to this view until the new view is merged back into this view via `merge()`.\n\t */\n\tfork(): ITreeCheckoutFork;\n\n\t/**\n\t * Apply all the new changes on the given view to this view.\n\t * @param view - a view which was created by a call to `fork()`.\n\t * It is automatically disposed after the merge completes.\n\t * @remarks All ongoing transactions (if any) in `view` will be committed before the merge.\n\t */\n\tmerge(view: ITreeCheckoutFork): void;\n\n\t/**\n\t * Apply all the new changes on the given view to this view.\n\t * @param view - a view which was created by a call to `fork()`.\n\t * @param disposeView - whether or not to dispose `view` after the merge completes.\n\t * @remarks All ongoing transactions (if any) in `view` will be committed before the merge.\n\t */\n\tmerge(view: ITreeCheckoutFork, disposeView: boolean): void;\n\n\t/**\n\t * Rebase the given view onto this view.\n\t * @param view - a view which was created by a call to `fork()`. It is modified by this operation.\n\t */\n\trebase(view: ITreeCheckoutFork): void;\n\n\t/**\n\t * Replaces all schema with the provided schema.\n\t * Can over-write preexisting schema, and removes unmentioned schema.\n\t */\n\tupdateSchema(newSchema: TreeStoredSchema): void;\n\n\t/**\n\t * Events about this view.\n\t */\n\treadonly events: Listenable<CheckoutEvents>;\n\n\t/**\n\t * Events about the root of the tree in this view.\n\t */\n\treadonly rootEvents: Listenable<AnchorSetRootEvents>;\n\n\t/**\n\t * Returns a JsonableTree for each tree that was removed from (and not restored to) the document.\n\t * This list is guaranteed to contain all nodes that are recoverable through undo/redo on this checkout.\n\t * The list may also contain additional nodes.\n\t *\n\t * This is only intended for use in testing and exceptional code paths: it is not performant.\n\t */\n\tgetRemovedRoots(): [string | number | undefined, number, JsonableTree][];\n}\n\n/**\n * Creates a {@link TreeCheckout}.\n * @param args - an object containing optional components that will be used to build the view.\n * Any components not provided will be created by default.\n * @remarks This does not create a {@link SharedTree}, but rather a view with the minimal state\n * and functionality required to implement {@link ITreeCheckout}.\n */\nexport function createTreeCheckout(\n\tidCompressor: IIdCompressor,\n\tmintRevisionTag: () => RevisionTag,\n\trevisionTagCodec: RevisionTagCodec,\n\targs?: {\n\t\tbranch?: SharedTreeBranch<SharedTreeEditBuilder, SharedTreeChange>;\n\t\tchangeFamily?: ChangeFamily<SharedTreeEditBuilder, SharedTreeChange>;\n\t\tschema?: TreeStoredSchemaRepository;\n\t\tforest?: IEditableForest;\n\t\tfieldBatchCodec?: FieldBatchCodec;\n\t\tevents?: Listenable<CheckoutEvents> &\n\t\t\tIEmitter<CheckoutEvents> &\n\t\t\tHasListeners<CheckoutEvents>;\n\t\tremovedRoots?: DetachedFieldIndex;\n\t\tchunkCompressionStrategy?: TreeCompressionStrategy;\n\t},\n): TreeCheckout {\n\tconst forest = args?.forest ?? buildForest();\n\tconst schema = args?.schema ?? new TreeStoredSchemaRepository();\n\tconst defaultCodecOptions = { jsonValidator: noopValidator };\n\tconst defaultFieldBatchVersion = 1;\n\tconst changeFamily =\n\t\targs?.changeFamily ??\n\t\tnew SharedTreeChangeFamily(\n\t\t\trevisionTagCodec,\n\t\t\targs?.fieldBatchCodec ??\n\t\t\t\tmakeFieldBatchCodec(defaultCodecOptions, defaultFieldBatchVersion),\n\t\t\t{ jsonValidator: noopValidator },\n\t\t\targs?.chunkCompressionStrategy,\n\t\t);\n\tconst branch =\n\t\targs?.branch ??\n\t\tnew SharedTreeBranch(\n\t\t\t{\n\t\t\t\tchange: changeFamily.rebaser.compose([]),\n\t\t\t\trevision: \"root\",\n\t\t\t},\n\t\t\tchangeFamily,\n\t\t\t() => idCompressor.generateCompressedId(),\n\t\t);\n\tconst events = args?.events ?? createEmitter();\n\n\tconst transaction = new Transaction(branch);\n\n\treturn new TreeCheckout(\n\t\ttransaction,\n\t\tbranch,\n\t\tchangeFamily,\n\t\tschema,\n\t\tforest,\n\t\tevents,\n\t\tmintRevisionTag,\n\t\trevisionTagCodec,\n\t\tidCompressor,\n\t\targs?.removedRoots,\n\t);\n}\n\n/**\n * A collection of functions for managing transactions.\n * Transactions allow edits to be batched into atomic units.\n * Edits made during a transaction will update the local state of the tree immediately, but will be squashed into a single edit when the transaction is committed.\n * If the transaction is aborted, the local state will be reset to what it was before the transaction began.\n * Transactions may nest, meaning that a transaction may be started while a transaction is already ongoing.\n *\n * To avoid updating observers of the view state with intermediate results during a transaction,\n * use {@link ITreeCheckout#fork} and {@link ISharedTreeFork#merge}.\n * @internal\n */\nexport interface ITransaction {\n\t/**\n\t * Start a new transaction.\n\t * If a transaction is already in progress when this new transaction starts, then this transaction will be \"nested\" inside of it,\n\t * i.e. the outer transaction will still be in progress after this new transaction is committed or aborted.\n\t *\n\t * @remarks - Asynchronous transactions are not supported on the root checkout,\n\t * since it is always kept up-to-date with the latest remote edits and the results of this rebasing (which might invalidate\n\t * the transaction) is not visible to the application author.\n\t * Instead,\n\t *\n\t * 1. fork the root checkout\n\t * 2. run the transaction on the fork\n\t * 3. merge the fork back into the root checkout\n\t *\n\t * @privateRemarks - There is currently no enforcement that asynchronous transactions don't happen on the root checkout.\n\t * AB#6488 tracks adding some enforcement to make it more clear to application authors that this is not supported.\n\t */\n\tstart(): void;\n\t/**\n\t * Close this transaction by squashing its edits and committing them as a single edit.\n\t * If this is the root checkout and there are no ongoing transactions remaining, the squashed edit will be submitted to Fluid.\n\t */\n\tcommit(): TransactionResult.Commit;\n\t/**\n\t * Close this transaction and revert the state of the tree to what it was before this transaction began.\n\t */\n\tabort(): TransactionResult.Abort;\n\t/**\n\t * True if there is at least one transaction currently in progress on this view, otherwise false.\n\t */\n\tinProgress(): boolean;\n}\n\nclass Transaction implements ITransaction {\n\tpublic constructor(\n\t\tprivate readonly branch: SharedTreeBranch<SharedTreeEditBuilder, SharedTreeChange>,\n\t) {}\n\n\tpublic start(): void {\n\t\tthis.branch.startTransaction();\n\t\tthis.branch.editor.enterTransaction();\n\t}\n\tpublic commit(): TransactionResult.Commit {\n\t\tthis.branch.commitTransaction();\n\t\tthis.branch.editor.exitTransaction();\n\t\treturn TransactionResult.Commit;\n\t}\n\tpublic abort(): TransactionResult.Abort {\n\t\tthis.branch.abortTransaction();\n\t\tthis.branch.editor.exitTransaction();\n\t\treturn TransactionResult.Abort;\n\t}\n\tpublic inProgress(): boolean {\n\t\treturn this.branch.isTransacting();\n\t}\n}\n\n/**\n * Branch (like in a version control system) of SharedTree.\n *\n * {@link ITreeCheckout} that has forked off of the main trunk/branch.\n * @internal\n */\nexport interface ITreeCheckoutFork extends ITreeCheckout, IDisposable {\n\t/**\n\t * Rebase the changes that have been applied to this view over all the new changes in the given view.\n\t * @param view - Either the root view or a view that was created by a call to `fork()`. It is not modified by this operation.\n\t */\n\trebaseOnto(view: ITreeCheckout): void;\n}\n\n/**\n * An implementation of {@link ITreeCheckoutFork}.\n */\nexport class TreeCheckout implements ITreeCheckoutFork {\n\tprivate isDisposed = false;\n\n\t/**\n\t * Set of revertibles maintained for automatic disposal\n\t */\n\tprivate readonly revertibles = new Set<DisposableRevertible>();\n\n\t/**\n\t * Each branch's head commit corresponds to a revertible commit.\n\t * Maintaining a whole branch ensures the commit graph is not pruned in a way that would prevent the commit from\n\t * being reverted.\n\t */\n\tprivate readonly revertibleCommitBranches = new Map<\n\t\tRevisionTag,\n\t\tSharedTreeBranch<SharedTreeEditBuilder, SharedTreeChange>\n\t>();\n\n\tpublic constructor(\n\t\tpublic readonly transaction: ITransaction,\n\t\tprivate readonly branch: SharedTreeBranch<SharedTreeEditBuilder, SharedTreeChange>,\n\t\tprivate readonly changeFamily: ChangeFamily<SharedTreeEditBuilder, SharedTreeChange>,\n\t\tpublic readonly storedSchema: TreeStoredSchemaRepository,\n\t\tpublic readonly forest: IEditableForest,\n\t\tpublic readonly events: Listenable<CheckoutEvents> &\n\t\t\tIEmitter<CheckoutEvents> &\n\t\t\tHasListeners<CheckoutEvents>,\n\t\tprivate readonly mintRevisionTag: () => RevisionTag,\n\t\tprivate readonly revisionTagCodec: RevisionTagCodec,\n\t\tprivate readonly idCompressor: IIdCompressor,\n\t\tprivate readonly removedRoots: DetachedFieldIndex = makeDetachedFieldIndex(\n\t\t\t\"repair\",\n\t\t\trevisionTagCodec,\n\t\t\tidCompressor,\n\t\t),\n\t) {\n\t\t// We subscribe to `beforeChange` rather than `afterChange` here because it's possible that the change is invalid WRT our forest.\n\t\t// For example, a bug in the editor might produce a malformed change object and thus applying the change to the forest will throw an error.\n\t\t// In such a case we will crash here, preventing the change from being added to the commit graph, and preventing `afterChange` from firing.\n\t\t// One important consequence of this is that we will not submit the op containing the invalid change, since op submissions happens in response to `afterChange`.\n\t\tbranch.on(\"beforeChange\", (event) => {\n\t\t\tif (event.change !== undefined) {\n\t\t\t\t// Conflicts due to schema will be empty and thus are not applied.\n\t\t\t\tfor (const change of event.change.change.changes) {\n\t\t\t\t\tif (change.type === \"data\") {\n\t\t\t\t\t\tconst delta = intoDelta(\n\t\t\t\t\t\t\ttagChange(change.innerChange, event.change.revision),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.withCombinedVisitor((visitor) => {\n\t\t\t\t\t\t\tvisitDelta(delta, visitor, this.removedRoots);\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (change.type === \"schema\") {\n\t\t\t\t\t\t// Schema changes from a current to a new schema are expected to be backwards compatible.\n\t\t\t\t\t\t// This guarantees that all data in the forest (which is valid before the schema change)\n\t\t\t\t\t\t// is also valid under the new schema.\n\t\t\t\t\t\t// Note however, that such schema changes may in some cases be rolled back:\n\t\t\t\t\t\t// Case 1: A transaction with a schema change may be aborted.\n\t\t\t\t\t\t// The transaction may have made some data changes that would render some trees invalid\n\t\t\t\t\t\t// under the old schema, but these changes will also be rolled back, thereby putting the forest\n\t\t\t\t\t\t// back in the state before the transaction, which is valid under the original (reinstated) schema.\n\t\t\t\t\t\t// Case 2: A branch with a schema change may be rebased such that the schema change (because\n\t\t\t\t\t\t// of a constraint) is no longer applied.\n\t\t\t\t\t\t// Such a branch may contain data changes that would render some trees invalid under the\n\t\t\t\t\t\t// original schema. These data changes may not necessarily be rolled back.\n\t\t\t\t\t\t// They will however be rebased over the rollback of the schema change. This rebasing will\n\t\t\t\t\t\t// ensure that these data changes are muted if they would render some trees invalid under the\n\t\t\t\t\t\t// original (reinstated) schema.\n\t\t\t\t\t\tstoredSchema.apply(change.innerChange.schema.new);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfail(\"Unknown Shared Tree change type.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.events.emit(\"afterBatch\");\n\t\t\t}\n\t\t\tif (event.type === \"replace\" && getChangeReplaceType(event) === \"transactionCommit\") {\n\t\t\t\tconst transactionRevision = event.newCommits[0].revision;\n\t\t\t\tfor (const transactionStep of event.removedCommits) {\n\t\t\t\t\tthis.removedRoots.updateMajor(transactionStep.revision, transactionRevision);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbranch.on(\"commitApplied\", (data) => {\n\t\t\tconst commit = branch.getHead();\n\t\t\tconst { change, revision } = commit;\n\t\t\tlet withinEventContext = true;\n\n\t\t\tconst getRevertible = hasSchemaChange(change)\n\t\t\t\t? undefined\n\t\t\t\t: (onRevertibleDisposed?: (revertible: Revertible) => void) => {\n\t\t\t\t\t\tif (!withinEventContext) {\n\t\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\t\"Cannot get a revertible outside of the context of a commitApplied event.\",\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (this.revertibleCommitBranches.get(revision) !== undefined) {\n\t\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\t\"Cannot generate the same revertible more than once. Note that this can happen when multiple commitApplied event listeners are registered.\",\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst revertibleCommits = this.revertibleCommitBranches;\n\t\t\t\t\t\tconst revertible: DisposableRevertible = {\n\t\t\t\t\t\t\tget status(): RevertibleStatus {\n\t\t\t\t\t\t\t\tconst revertibleCommit = revertibleCommits.get(revision);\n\t\t\t\t\t\t\t\treturn revertibleCommit === undefined\n\t\t\t\t\t\t\t\t\t? RevertibleStatus.Disposed\n\t\t\t\t\t\t\t\t\t: RevertibleStatus.Valid;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\trevert: (release: boolean = true) => {\n\t\t\t\t\t\t\t\tif (revertible.status === RevertibleStatus.Disposed) {\n\t\t\t\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\t\t\t\"Unable to revert a revertible that has been disposed.\",\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.revertRevertible(revision, data.kind);\n\t\t\t\t\t\t\t\tif (release) {\n\t\t\t\t\t\t\t\t\trevertible.dispose();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tdispose: () => {\n\t\t\t\t\t\t\t\tif (revertible.status === RevertibleStatus.Disposed) {\n\t\t\t\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\t\t\t\"Unable to dispose a revertible that has already been disposed.\",\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.disposeRevertible(revertible, revision);\n\t\t\t\t\t\t\t\tonRevertibleDisposed?.(revertible);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tthis.revertibleCommitBranches.set(revision, branch.fork());\n\t\t\t\t\t\tthis.revertibles.add(revertible);\n\t\t\t\t\t\treturn revertible;\n\t\t\t\t };\n\n\t\t\tthis.events.emit(\"commitApplied\", data, getRevertible);\n\t\t\twithinEventContext = false;\n\t\t});\n\t}\n\n\tprivate withCombinedVisitor(fn: (visitor: DeltaVisitor) => void): void {\n\t\tconst anchorVisitor = this.forest.anchors.acquireVisitor();\n\t\tconst combinedVisitor = combineVisitors(\n\t\t\t[this.forest.acquireVisitor(), anchorVisitor],\n\t\t\t[anchorVisitor],\n\t\t);\n\t\tfn(combinedVisitor);\n\t\tcombinedVisitor.free();\n\t}\n\n\tprivate checkNotDisposed(): void {\n\t\tassert(!this.isDisposed, 0x911 /* Invalid operation on a disposed TreeCheckout */);\n\t}\n\n\tpublic get rootEvents(): Listenable<AnchorSetRootEvents> {\n\t\treturn this.forest.anchors;\n\t}\n\n\tpublic get editor(): ISharedTreeEditor {\n\t\tthis.checkNotDisposed();\n\t\treturn this.branch.editor;\n\t}\n\n\tpublic locate(anchor: Anchor): AnchorNode | undefined {\n\t\tthis.checkNotDisposed();\n\t\treturn this.forest.anchors.locate(anchor);\n\t}\n\n\tpublic fork(): TreeCheckout {\n\t\tthis.checkNotDisposed();\n\t\tconst anchors = new AnchorSet();\n\t\tconst branch = this.branch.fork();\n\t\tconst storedSchema = this.storedSchema.clone();\n\t\tconst forest = this.forest.clone(storedSchema, anchors);\n\t\tconst transaction = new Transaction(branch);\n\t\treturn new TreeCheckout(\n\t\t\ttransaction,\n\t\t\tbranch,\n\t\t\tthis.changeFamily,\n\t\t\tstoredSchema,\n\t\t\tforest,\n\t\t\tcreateEmitter(),\n\t\t\tthis.mintRevisionTag,\n\t\t\tthis.revisionTagCodec,\n\t\t\tthis.idCompressor,\n\t\t\tthis.removedRoots.clone(),\n\t\t);\n\t}\n\n\tpublic rebase(view: TreeCheckout): void {\n\t\tthis.checkNotDisposed();\n\t\tview.branch.rebaseOnto(this.branch);\n\t}\n\n\tpublic rebaseOnto(view: ITreeCheckout): void {\n\t\tthis.checkNotDisposed();\n\t\tview.rebase(this);\n\t}\n\n\tpublic merge(view: TreeCheckout): void;\n\tpublic merge(view: TreeCheckout, disposeView: boolean): void;\n\tpublic merge(view: TreeCheckout, disposeView = true): void {\n\t\tthis.checkNotDisposed();\n\t\tassert(\n\t\t\t!this.transaction.inProgress() || disposeView,\n\t\t\t0x710 /* A view that is merged into an in-progress transaction must be disposed */,\n\t\t);\n\t\twhile (view.transaction.inProgress()) {\n\t\t\tview.transaction.commit();\n\t\t}\n\t\tthis.branch.merge(view.branch);\n\t\tif (disposeView) {\n\t\t\tview[disposeSymbol]();\n\t\t}\n\t}\n\n\tpublic updateSchema(newSchema: TreeStoredSchema): void {\n\t\tthis.checkNotDisposed();\n\t\tthis.editor.schema.setStoredSchema(this.storedSchema.clone(), newSchema);\n\t}\n\n\tpublic [disposeSymbol](): void {\n\t\tthis.checkNotDisposed();\n\t\tthis.isDisposed = true;\n\t\tthis.purgeRevertibles();\n\t\tthis.branch.dispose();\n\t}\n\n\tpublic getRemovedRoots(): [string | number | undefined, number, JsonableTree][] {\n\t\tconst trees: [string | number | undefined, number, JsonableTree][] = [];\n\t\tconst cursor = this.forest.allocateCursor(\"getRemovedRoots\");\n\t\tfor (const { id, root } of this.removedRoots.entries()) {\n\t\t\tconst parentField = this.removedRoots.toFieldKey(root);\n\t\t\tthis.forest.moveCursorToPath(\n\t\t\t\t{ parent: undefined, parentField, parentIndex: 0 },\n\t\t\t\tcursor,\n\t\t\t);\n\t\t\tconst tree = jsonableTreeFromCursor(cursor);\n\t\t\t// This method is used for tree consistency comparison.\n\t\t\tconst { major, minor } = id;\n\t\t\tconst finalizedMajor =\n\t\t\t\tmajor !== undefined ? this.revisionTagCodec.encode(major) : major;\n\t\t\ttrees.push([finalizedMajor, minor, tree]);\n\t\t}\n\t\tcursor.free();\n\t\treturn trees;\n\t}\n\n\tprivate purgeRevertibles(): void {\n\t\tfor (const revertible of this.revertibles) {\n\t\t\trevertible.dispose();\n\t\t}\n\t}\n\n\tprivate disposeRevertible(revertible: DisposableRevertible, revision: RevisionTag): void {\n\t\tthis.revertibleCommitBranches.get(revision)?.dispose();\n\t\tthis.revertibleCommitBranches.delete(revision);\n\t\tthis.revertibles.delete(revertible);\n\t}\n\n\tprivate revertRevertible(revision: RevisionTag, kind: CommitKind): void {\n\t\tif (this.branch.isTransacting()) {\n\t\t\tthrow new UsageError(\"Undo is not yet supported during transactions.\");\n\t\t}\n\n\t\tconst revertibleBranch = this.revertibleCommitBranches.get(revision);\n\t\tassert(revertibleBranch !== undefined, 0x7cc /* expected to find a revertible commit */);\n\t\tconst commitToRevert = revertibleBranch.getHead();\n\n\t\tlet change = makeAnonChange(\n\t\t\tthis.changeFamily.rebaser.invert(tagChange(commitToRevert.change, revision), false),\n\t\t);\n\n\t\tconst headCommit = this.branch.getHead();\n\t\t// Rebase the inverted change onto any commits that occurred after the undoable commits.\n\t\tif (commitToRevert !== headCommit) {\n\t\t\tchange = makeAnonChange(\n\t\t\t\trebaseChange(\n\t\t\t\t\tthis.changeFamily.rebaser,\n\t\t\t\t\tchange,\n\t\t\t\t\tcommitToRevert,\n\t\t\t\t\theadCommit,\n\t\t\t\t\tthis.mintRevisionTag,\n\t\t\t\t).change,\n\t\t\t);\n\t\t}\n\n\t\tthis.branch.apply(\n\t\t\tchange.change,\n\t\t\tthis.mintRevisionTag(),\n\t\t\tkind === CommitKind.Default || kind === CommitKind.Redo\n\t\t\t\t? CommitKind.Undo\n\t\t\t\t: CommitKind.Redo,\n\t\t);\n\t}\n}\n\n/**\n * Run a synchronous transaction on the given shared tree view.\n * This is a convenience helper around the {@link SharedTreeFork#transaction} APIs.\n * @param view - the view on which to run the transaction\n * @param transaction - the transaction function. This will be executed immediately. It is passed `view` as an argument for convenience.\n * If this function returns an `Abort` result then the transaction will be aborted. Otherwise, it will be committed.\n * @returns whether or not the transaction was committed or aborted\n * @internal\n */\nexport function runSynchronous(\n\tview: ITreeCheckout,\n\ttransaction: (view: ITreeCheckout) => TransactionResult | void,\n): TransactionResult {\n\tview.transaction.start();\n\tconst result = transaction(view);\n\treturn result === TransactionResult.Abort\n\t\t? view.transaction.abort()\n\t\t: view.transaction.commit();\n}\n\ninterface DisposableRevertible extends Revertible {\n\tdispose: () => void;\n}\n"]}
1
+ {"version":3,"file":"treeCheckout.js","sourceRoot":"","sources":["../../src/shared-tree/treeCheckout.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,uEAAsE;AACtE,gDAAkD;AAClD,+CA2B0B;AAC1B,iDAK4B;AAC5B,4DAOuC;AACvC,2DAAsF;AACtF,+CAA4F;AAE5F,2EAAsF;AAmJtF;;;;;;GAMG;AACH,SAAgB,kBAAkB,CACjC,YAA2B,EAC3B,eAAkC,EAClC,gBAAkC,EAClC,IAWC;IAED,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,IAAI,IAAA,sBAAW,GAAE,CAAC;IAC7C,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,I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AC,WAAW,CAAC,KAAK,EAAE;QAC1B,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;AAC9B,CAAC;AATD,wCASC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { noopValidator } from \"../codec/index.js\";\nimport {\n\ttype Anchor,\n\ttype AnchorLocator,\n\ttype AnchorNode,\n\tAnchorSet,\n\ttype AnchorSetRootEvents,\n\ttype ChangeFamily,\n\tCommitKind,\n\ttype CommitMetadata,\n\ttype DeltaVisitor,\n\ttype DetachedFieldIndex,\n\ttype IEditableForest,\n\ttype IForestSubscription,\n\ttype JsonableTree,\n\ttype Revertible,\n\tRevertibleStatus,\n\ttype RevisionTag,\n\ttype RevisionTagCodec,\n\ttype TreeStoredSchema,\n\tTreeStoredSchemaRepository,\n\ttype TreeStoredSchemaSubscription,\n\tcombineVisitors,\n\tmakeAnonChange,\n\tmakeDetachedFieldIndex,\n\trebaseChange,\n\ttagChange,\n\tvisitDelta,\n} from \"../core/index.js\";\nimport {\n\ttype HasListeners,\n\ttype IEmitter,\n\ttype Listenable,\n\tcreateEmitter,\n} from \"../events/index.js\";\nimport {\n\ttype FieldBatchCodec,\n\ttype TreeCompressionStrategy,\n\tbuildForest,\n\tintoDelta,\n\tjsonableTreeFromCursor,\n\tmakeFieldBatchCodec,\n} from \"../feature-libraries/index.js\";\nimport { SharedTreeBranch, getChangeReplaceType } from \"../shared-tree-core/index.js\";\nimport { type IDisposable, TransactionResult, disposeSymbol, fail } from \"../util/index.js\";\n\nimport { SharedTreeChangeFamily, hasSchemaChange } from \"./sharedTreeChangeFamily.js\";\nimport type { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\nimport type { ISharedTreeEditor, SharedTreeEditBuilder } from \"./sharedTreeEditBuilder.js\";\n\n/**\n * Events for {@link ITreeCheckout}.\n * @internal\n */\nexport interface CheckoutEvents {\n\t/**\n\t * A batch of changes has finished processing and the view is in a consistent state.\n\t * It is once again safe to access the FlexTree, Forest and AnchorSet.\n\t *\n\t * @remarks\n\t * This is mainly useful for knowing when to do followup work scheduled during events from Anchors.\n\t */\n\tafterBatch(): void;\n\n\t/**\n\t * Fired when a revertible change has been made to this view.\n\t *\n\t * Applications which subscribe to this event are expected to revert or discard revertibles they acquire (failure to do so will leak memory).\n\t * The provided revertible is inherently bound to the view that raised the event, calling `revert` won't apply to forked views.\n\t *\n\t * @param revertible - The revertible that can be used to revert the change.\n\t */\n\n\t/**\n\t * {@inheritdoc TreeViewEvents.commitApplied}\n\t */\n\tcommitApplied(data: CommitMetadata, getRevertible?: RevertibleFactory): void;\n}\n\n/**\n * Factory for creating a {@link Revertible}.\n * Will error if invoked outside the scope of the `commitApplied` event that provides it, or if invoked multiple times.\n *\n * @param onRevertibleDisposed - A callback that will be invoked when the `Revertible` generated by this factory is disposed.\n * This happens when the `Revertible` is disposed manually, or when the `TreeView` that the `Revertible` belongs to is disposed,\n * whichever happens first.\n * This is typically used to clean up any resources associated with the `Revertible` in the host application.\n *\n * @public\n */\nexport type RevertibleFactory = (\n\tonRevertibleDisposed?: (revertible: Revertible) => void,\n) => Revertible;\n\n/**\n * Provides a means for interacting with a SharedTree.\n * This includes reading data from the tree and running transactions to mutate the tree.\n * @remarks This interface should not have any implementations other than those provided by the SharedTree package libraries.\n * @privateRemarks\n * API for interacting with a {@link SharedTreeBranch}.\n * Implementations of this interface must implement the {@link branchKey} property.\n * @internal\n */\nexport interface ITreeCheckout extends AnchorLocator {\n\t/**\n\t * Read and Write access for schema stored in the document.\n\t *\n\t * These APIs are temporary and will be replaced with different abstractions (View Schema based) in a different place later.\n\t *\n\t * TODO:\n\t * Editing of this should be moved into transactions with the rest of tree editing to they can be intermixed.\n\t * This will be done after the relations between views, branches and Indexes are figured out.\n\t *\n\t * TODO:\n\t * Public APIs for dealing with schema should be in terms of View Schema, and schema update policies.\n\t * The actual stored schema should be hidden (or ar least not be the most prominent way to interact with schema).\n\t *\n\t * TODO:\n\t * Something should ensure the document contents are always in schema.\n\t */\n\treadonly storedSchema: TreeStoredSchemaSubscription;\n\t/**\n\t * Current contents.\n\t * Updated by edits (local and remote).\n\t * Use `editor` to create a local edit.\n\t */\n\treadonly forest: IForestSubscription;\n\n\t/**\n\t * Used to edit the state of the tree. Edits will be immediately applied locally to the tree.\n\t * If there is no transaction currently ongoing, then the edits will be submitted to Fluid immediately as well.\n\t */\n\treadonly editor: ISharedTreeEditor;\n\n\t/**\n\t * A collection of functions for managing transactions.\n\t */\n\treadonly transaction: ITransaction;\n\n\t/**\n\t * Spawn a new view which is based off of the current state of this view.\n\t * Any mutations of the new view will not apply to this view until the new view is merged back into this view via `merge()`.\n\t */\n\tfork(): ITreeCheckoutFork;\n\n\t/**\n\t * Apply all the new changes on the given view to this view.\n\t * @param view - a view which was created by a call to `fork()`.\n\t * It is automatically disposed after the merge completes.\n\t * @remarks All ongoing transactions (if any) in `view` will be committed before the merge.\n\t */\n\tmerge(view: ITreeCheckoutFork): void;\n\n\t/**\n\t * Apply all the new changes on the given view to this view.\n\t * @param view - a view which was created by a call to `fork()`.\n\t * @param disposeView - whether or not to dispose `view` after the merge completes.\n\t * @remarks All ongoing transactions (if any) in `view` will be committed before the merge.\n\t */\n\tmerge(view: ITreeCheckoutFork, disposeView: boolean): void;\n\n\t/**\n\t * Rebase the given view onto this view.\n\t * @param view - a view which was created by a call to `fork()`. It is modified by this operation.\n\t */\n\trebase(view: ITreeCheckoutFork): void;\n\n\t/**\n\t * Replaces all schema with the provided schema.\n\t * Can over-write preexisting schema, and removes unmentioned schema.\n\t */\n\tupdateSchema(newSchema: TreeStoredSchema): void;\n\n\t/**\n\t * Events about this view.\n\t */\n\treadonly events: Listenable<CheckoutEvents>;\n\n\t/**\n\t * Events about the root of the tree in this view.\n\t */\n\treadonly rootEvents: Listenable<AnchorSetRootEvents>;\n\n\t/**\n\t * Returns a JsonableTree for each tree that was removed from (and not restored to) the document.\n\t * This list is guaranteed to contain all nodes that are recoverable through undo/redo on this checkout.\n\t * The list may also contain additional nodes.\n\t *\n\t * This is only intended for use in testing and exceptional code paths: it is not performant.\n\t */\n\tgetRemovedRoots(): [string | number | undefined, number, JsonableTree][];\n}\n\n/**\n * Creates a {@link TreeCheckout}.\n * @param args - an object containing optional components that will be used to build the view.\n * Any components not provided will be created by default.\n * @remarks This does not create a {@link SharedTree}, but rather a view with the minimal state\n * and functionality required to implement {@link ITreeCheckout}.\n */\nexport function createTreeCheckout(\n\tidCompressor: IIdCompressor,\n\tmintRevisionTag: () => RevisionTag,\n\trevisionTagCodec: RevisionTagCodec,\n\targs?: {\n\t\tbranch?: SharedTreeBranch<SharedTreeEditBuilder, SharedTreeChange>;\n\t\tchangeFamily?: ChangeFamily<SharedTreeEditBuilder, SharedTreeChange>;\n\t\tschema?: TreeStoredSchemaRepository;\n\t\tforest?: IEditableForest;\n\t\tfieldBatchCodec?: FieldBatchCodec;\n\t\tevents?: Listenable<CheckoutEvents> &\n\t\t\tIEmitter<CheckoutEvents> &\n\t\t\tHasListeners<CheckoutEvents>;\n\t\tremovedRoots?: DetachedFieldIndex;\n\t\tchunkCompressionStrategy?: TreeCompressionStrategy;\n\t},\n): TreeCheckout {\n\tconst forest = args?.forest ?? buildForest();\n\tconst schema = args?.schema ?? new TreeStoredSchemaRepository();\n\tconst defaultCodecOptions = { jsonValidator: noopValidator };\n\tconst defaultFieldBatchVersion = 1;\n\tconst changeFamily =\n\t\targs?.changeFamily ??\n\t\tnew SharedTreeChangeFamily(\n\t\t\trevisionTagCodec,\n\t\t\targs?.fieldBatchCodec ??\n\t\t\t\tmakeFieldBatchCodec(defaultCodecOptions, defaultFieldBatchVersion),\n\t\t\t{ jsonValidator: noopValidator },\n\t\t\targs?.chunkCompressionStrategy,\n\t\t);\n\tconst branch =\n\t\targs?.branch ??\n\t\tnew SharedTreeBranch(\n\t\t\t{\n\t\t\t\tchange: changeFamily.rebaser.compose([]),\n\t\t\t\trevision: \"root\",\n\t\t\t},\n\t\t\tchangeFamily,\n\t\t\t() => idCompressor.generateCompressedId(),\n\t\t);\n\tconst events = args?.events ?? createEmitter();\n\n\tconst transaction = new Transaction(branch);\n\n\treturn new TreeCheckout(\n\t\ttransaction,\n\t\tbranch,\n\t\tchangeFamily,\n\t\tschema,\n\t\tforest,\n\t\tevents,\n\t\tmintRevisionTag,\n\t\trevisionTagCodec,\n\t\tidCompressor,\n\t\targs?.removedRoots,\n\t);\n}\n\n/**\n * A collection of functions for managing transactions.\n * Transactions allow edits to be batched into atomic units.\n * Edits made during a transaction will update the local state of the tree immediately, but will be squashed into a single edit when the transaction is committed.\n * If the transaction is aborted, the local state will be reset to what it was before the transaction began.\n * Transactions may nest, meaning that a transaction may be started while a transaction is already ongoing.\n *\n * To avoid updating observers of the view state with intermediate results during a transaction,\n * use {@link ITreeCheckout#fork} and {@link ISharedTreeFork#merge}.\n * @internal\n */\nexport interface ITransaction {\n\t/**\n\t * Start a new transaction.\n\t * If a transaction is already in progress when this new transaction starts, then this transaction will be \"nested\" inside of it,\n\t * i.e. the outer transaction will still be in progress after this new transaction is committed or aborted.\n\t *\n\t * @remarks - Asynchronous transactions are not supported on the root checkout,\n\t * since it is always kept up-to-date with the latest remote edits and the results of this rebasing (which might invalidate\n\t * the transaction) is not visible to the application author.\n\t * Instead,\n\t *\n\t * 1. fork the root checkout\n\t * 2. run the transaction on the fork\n\t * 3. merge the fork back into the root checkout\n\t *\n\t * @privateRemarks - There is currently no enforcement that asynchronous transactions don't happen on the root checkout.\n\t * AB#6488 tracks adding some enforcement to make it more clear to application authors that this is not supported.\n\t */\n\tstart(): void;\n\t/**\n\t * Close this transaction by squashing its edits and committing them as a single edit.\n\t * If this is the root checkout and there are no ongoing transactions remaining, the squashed edit will be submitted to Fluid.\n\t */\n\tcommit(): TransactionResult.Commit;\n\t/**\n\t * Close this transaction and revert the state of the tree to what it was before this transaction began.\n\t */\n\tabort(): TransactionResult.Abort;\n\t/**\n\t * True if there is at least one transaction currently in progress on this view, otherwise false.\n\t */\n\tinProgress(): boolean;\n}\n\nclass Transaction implements ITransaction {\n\tpublic constructor(\n\t\tprivate readonly branch: SharedTreeBranch<SharedTreeEditBuilder, SharedTreeChange>,\n\t) {}\n\n\tpublic start(): void {\n\t\tthis.branch.startTransaction();\n\t\tthis.branch.editor.enterTransaction();\n\t}\n\tpublic commit(): TransactionResult.Commit {\n\t\tthis.branch.commitTransaction();\n\t\tthis.branch.editor.exitTransaction();\n\t\treturn TransactionResult.Commit;\n\t}\n\tpublic abort(): TransactionResult.Abort {\n\t\tthis.branch.abortTransaction();\n\t\tthis.branch.editor.exitTransaction();\n\t\treturn TransactionResult.Abort;\n\t}\n\tpublic inProgress(): boolean {\n\t\treturn this.branch.isTransacting();\n\t}\n}\n\n/**\n * Branch (like in a version control system) of SharedTree.\n *\n * {@link ITreeCheckout} that has forked off of the main trunk/branch.\n * @internal\n */\nexport interface ITreeCheckoutFork extends ITreeCheckout, IDisposable {\n\t/**\n\t * Rebase the changes that have been applied to this view over all the new changes in the given view.\n\t * @param view - Either the root view or a view that was created by a call to `fork()`. It is not modified by this operation.\n\t */\n\trebaseOnto(view: ITreeCheckout): void;\n}\n\n/**\n * An implementation of {@link ITreeCheckoutFork}.\n */\nexport class TreeCheckout implements ITreeCheckoutFork {\n\tprivate isDisposed = false;\n\n\t/**\n\t * Set of revertibles maintained for automatic disposal\n\t */\n\tprivate readonly revertibles = new Set<DisposableRevertible>();\n\n\t/**\n\t * Each branch's head commit corresponds to a revertible commit.\n\t * Maintaining a whole branch ensures the commit graph is not pruned in a way that would prevent the commit from\n\t * being reverted.\n\t */\n\tprivate readonly revertibleCommitBranches = new Map<\n\t\tRevisionTag,\n\t\tSharedTreeBranch<SharedTreeEditBuilder, SharedTreeChange>\n\t>();\n\n\tpublic constructor(\n\t\tpublic readonly transaction: ITransaction,\n\t\tprivate readonly branch: SharedTreeBranch<SharedTreeEditBuilder, SharedTreeChange>,\n\t\tprivate readonly changeFamily: ChangeFamily<SharedTreeEditBuilder, SharedTreeChange>,\n\t\tpublic readonly storedSchema: TreeStoredSchemaRepository,\n\t\tpublic readonly forest: IEditableForest,\n\t\tpublic readonly events: Listenable<CheckoutEvents> &\n\t\t\tIEmitter<CheckoutEvents> &\n\t\t\tHasListeners<CheckoutEvents>,\n\t\tprivate readonly mintRevisionTag: () => RevisionTag,\n\t\tprivate readonly revisionTagCodec: RevisionTagCodec,\n\t\tprivate readonly idCompressor: IIdCompressor,\n\t\tprivate readonly removedRoots: DetachedFieldIndex = makeDetachedFieldIndex(\n\t\t\t\"repair\",\n\t\t\trevisionTagCodec,\n\t\t\tidCompressor,\n\t\t),\n\t) {\n\t\t// We subscribe to `beforeChange` rather than `afterChange` here because it's possible that the change is invalid WRT our forest.\n\t\t// For example, a bug in the editor might produce a malformed change object and thus applying the change to the forest will throw an error.\n\t\t// In such a case we will crash here, preventing the change from being added to the commit graph, and preventing `afterChange` from firing.\n\t\t// One important consequence of this is that we will not submit the op containing the invalid change, since op submissions happens in response to `afterChange`.\n\t\tbranch.on(\"beforeChange\", (event) => {\n\t\t\tif (event.change !== undefined) {\n\t\t\t\t// Conflicts due to schema will be empty and thus are not applied.\n\t\t\t\tfor (const change of event.change.change.changes) {\n\t\t\t\t\tif (change.type === \"data\") {\n\t\t\t\t\t\tconst delta = intoDelta(\n\t\t\t\t\t\t\ttagChange(change.innerChange, event.change.revision),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.withCombinedVisitor((visitor) => {\n\t\t\t\t\t\t\tvisitDelta(delta, visitor, this.removedRoots);\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (change.type === \"schema\") {\n\t\t\t\t\t\t// Schema changes from a current to a new schema are expected to be backwards compatible.\n\t\t\t\t\t\t// This guarantees that all data in the forest (which is valid before the schema change)\n\t\t\t\t\t\t// is also valid under the new schema.\n\t\t\t\t\t\t// Note however, that such schema changes may in some cases be rolled back:\n\t\t\t\t\t\t// Case 1: A transaction with a schema change may be aborted.\n\t\t\t\t\t\t// The transaction may have made some data changes that would render some trees invalid\n\t\t\t\t\t\t// under the old schema, but these changes will also be rolled back, thereby putting the forest\n\t\t\t\t\t\t// back in the state before the transaction, which is valid under the original (reinstated) schema.\n\t\t\t\t\t\t// Case 2: A branch with a schema change may be rebased such that the schema change (because\n\t\t\t\t\t\t// of a constraint) is no longer applied.\n\t\t\t\t\t\t// Such a branch may contain data changes that would render some trees invalid under the\n\t\t\t\t\t\t// original schema. These data changes may not necessarily be rolled back.\n\t\t\t\t\t\t// They will however be rebased over the rollback of the schema change. This rebasing will\n\t\t\t\t\t\t// ensure that these data changes are muted if they would render some trees invalid under the\n\t\t\t\t\t\t// original (reinstated) schema.\n\t\t\t\t\t\tstoredSchema.apply(change.innerChange.schema.new);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfail(\"Unknown Shared Tree change type.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.events.emit(\"afterBatch\");\n\t\t\t}\n\t\t\tif (event.type === \"replace\" && getChangeReplaceType(event) === \"transactionCommit\") {\n\t\t\t\tconst transactionRevision = event.newCommits[0].revision;\n\t\t\t\tfor (const transactionStep of event.removedCommits) {\n\t\t\t\t\tthis.removedRoots.updateMajor(transactionStep.revision, transactionRevision);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbranch.on(\"commitApplied\", (data) => {\n\t\t\tconst commit = branch.getHead();\n\t\t\tconst { change, revision } = commit;\n\t\t\tlet withinEventContext = true;\n\n\t\t\tconst getRevertible = hasSchemaChange(change)\n\t\t\t\t? undefined\n\t\t\t\t: (onRevertibleDisposed?: (revertible: Revertible) => void) => {\n\t\t\t\t\t\tif (!withinEventContext) {\n\t\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\t\"Cannot get a revertible outside of the context of a commitApplied event.\",\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (this.revertibleCommitBranches.get(revision) !== undefined) {\n\t\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\t\"Cannot generate the same revertible more than once. Note that this can happen when multiple commitApplied event listeners are registered.\",\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst revertibleCommits = this.revertibleCommitBranches;\n\t\t\t\t\t\tconst revertible: DisposableRevertible = {\n\t\t\t\t\t\t\tget status(): RevertibleStatus {\n\t\t\t\t\t\t\t\tconst revertibleCommit = revertibleCommits.get(revision);\n\t\t\t\t\t\t\t\treturn revertibleCommit === undefined\n\t\t\t\t\t\t\t\t\t? RevertibleStatus.Disposed\n\t\t\t\t\t\t\t\t\t: RevertibleStatus.Valid;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\trevert: (release: boolean = true) => {\n\t\t\t\t\t\t\t\tif (revertible.status === RevertibleStatus.Disposed) {\n\t\t\t\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\t\t\t\"Unable to revert a revertible that has been disposed.\",\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.revertRevertible(revision, data.kind);\n\t\t\t\t\t\t\t\tif (release) {\n\t\t\t\t\t\t\t\t\trevertible.dispose();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tdispose: () => {\n\t\t\t\t\t\t\t\tif (revertible.status === RevertibleStatus.Disposed) {\n\t\t\t\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\t\t\t\"Unable to dispose a revertible that has already been disposed.\",\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.disposeRevertible(revertible, revision);\n\t\t\t\t\t\t\t\tonRevertibleDisposed?.(revertible);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tthis.revertibleCommitBranches.set(revision, branch.fork());\n\t\t\t\t\t\tthis.revertibles.add(revertible);\n\t\t\t\t\t\treturn revertible;\n\t\t\t\t };\n\n\t\t\tthis.events.emit(\"commitApplied\", data, getRevertible);\n\t\t\twithinEventContext = false;\n\t\t});\n\t}\n\n\tprivate withCombinedVisitor(fn: (visitor: DeltaVisitor) => void): void {\n\t\tconst anchorVisitor = this.forest.anchors.acquireVisitor();\n\t\tconst combinedVisitor = combineVisitors(\n\t\t\t[this.forest.acquireVisitor(), anchorVisitor],\n\t\t\t[anchorVisitor],\n\t\t);\n\t\tfn(combinedVisitor);\n\t\tcombinedVisitor.free();\n\t}\n\n\tprivate checkNotDisposed(): void {\n\t\tassert(!this.isDisposed, 0x911 /* Invalid operation on a disposed TreeCheckout */);\n\t}\n\n\tpublic get rootEvents(): Listenable<AnchorSetRootEvents> {\n\t\treturn this.forest.anchors;\n\t}\n\n\tpublic get editor(): ISharedTreeEditor {\n\t\tthis.checkNotDisposed();\n\t\treturn this.branch.editor;\n\t}\n\n\tpublic locate(anchor: Anchor): AnchorNode | undefined {\n\t\tthis.checkNotDisposed();\n\t\treturn this.forest.anchors.locate(anchor);\n\t}\n\n\tpublic fork(): TreeCheckout {\n\t\tthis.checkNotDisposed();\n\t\tconst anchors = new AnchorSet();\n\t\tconst branch = this.branch.fork();\n\t\tconst storedSchema = this.storedSchema.clone();\n\t\tconst forest = this.forest.clone(storedSchema, anchors);\n\t\tconst transaction = new Transaction(branch);\n\t\treturn new TreeCheckout(\n\t\t\ttransaction,\n\t\t\tbranch,\n\t\t\tthis.changeFamily,\n\t\t\tstoredSchema,\n\t\t\tforest,\n\t\t\tcreateEmitter(),\n\t\t\tthis.mintRevisionTag,\n\t\t\tthis.revisionTagCodec,\n\t\t\tthis.idCompressor,\n\t\t\tthis.removedRoots.clone(),\n\t\t);\n\t}\n\n\tpublic rebase(view: TreeCheckout): void {\n\t\tthis.checkNotDisposed();\n\t\tview.branch.rebaseOnto(this.branch);\n\t}\n\n\tpublic rebaseOnto(view: ITreeCheckout): void {\n\t\tthis.checkNotDisposed();\n\t\tview.rebase(this);\n\t}\n\n\tpublic merge(view: TreeCheckout): void;\n\tpublic merge(view: TreeCheckout, disposeView: boolean): void;\n\tpublic merge(view: TreeCheckout, disposeView = true): void {\n\t\tthis.checkNotDisposed();\n\t\tassert(\n\t\t\t!this.transaction.inProgress() || disposeView,\n\t\t\t0x710 /* A view that is merged into an in-progress transaction must be disposed */,\n\t\t);\n\t\twhile (view.transaction.inProgress()) {\n\t\t\tview.transaction.commit();\n\t\t}\n\t\tthis.branch.merge(view.branch);\n\t\tif (disposeView) {\n\t\t\tview[disposeSymbol]();\n\t\t}\n\t}\n\n\tpublic updateSchema(newSchema: TreeStoredSchema): void {\n\t\tthis.checkNotDisposed();\n\t\tthis.editor.schema.setStoredSchema(this.storedSchema.clone(), newSchema);\n\t}\n\n\tpublic [disposeSymbol](): void {\n\t\tthis.checkNotDisposed();\n\t\tthis.isDisposed = true;\n\t\tthis.purgeRevertibles();\n\t\tthis.branch.dispose();\n\t}\n\n\tpublic getRemovedRoots(): [string | number | undefined, number, JsonableTree][] {\n\t\tconst trees: [string | number | undefined, number, JsonableTree][] = [];\n\t\tconst cursor = this.forest.allocateCursor(\"getRemovedRoots\");\n\t\tfor (const { id, root } of this.removedRoots.entries()) {\n\t\t\tconst parentField = this.removedRoots.toFieldKey(root);\n\t\t\tthis.forest.moveCursorToPath(\n\t\t\t\t{ parent: undefined, parentField, parentIndex: 0 },\n\t\t\t\tcursor,\n\t\t\t);\n\t\t\tconst tree = jsonableTreeFromCursor(cursor);\n\t\t\t// This method is used for tree consistency comparison.\n\t\t\tconst { major, minor } = id;\n\t\t\tconst finalizedMajor =\n\t\t\t\tmajor !== undefined ? this.revisionTagCodec.encode(major) : major;\n\t\t\ttrees.push([finalizedMajor, minor, tree]);\n\t\t}\n\t\tcursor.free();\n\t\treturn trees;\n\t}\n\n\tprivate purgeRevertibles(): void {\n\t\tfor (const revertible of this.revertibles) {\n\t\t\trevertible.dispose();\n\t\t}\n\t}\n\n\tprivate disposeRevertible(revertible: DisposableRevertible, revision: RevisionTag): void {\n\t\tthis.revertibleCommitBranches.get(revision)?.dispose();\n\t\tthis.revertibleCommitBranches.delete(revision);\n\t\tthis.revertibles.delete(revertible);\n\t}\n\n\tprivate revertRevertible(revision: RevisionTag, kind: CommitKind): void {\n\t\tif (this.branch.isTransacting()) {\n\t\t\tthrow new UsageError(\"Undo is not yet supported during transactions.\");\n\t\t}\n\n\t\tconst revertibleBranch = this.revertibleCommitBranches.get(revision);\n\t\tassert(revertibleBranch !== undefined, 0x7cc /* expected to find a revertible commit */);\n\t\tconst commitToRevert = revertibleBranch.getHead();\n\n\t\tlet change = makeAnonChange(\n\t\t\tthis.changeFamily.rebaser.invert(tagChange(commitToRevert.change, revision), false),\n\t\t);\n\n\t\tconst headCommit = this.branch.getHead();\n\t\t// Rebase the inverted change onto any commits that occurred after the undoable commits.\n\t\tif (commitToRevert !== headCommit) {\n\t\t\tchange = makeAnonChange(\n\t\t\t\trebaseChange(\n\t\t\t\t\tthis.changeFamily.rebaser,\n\t\t\t\t\tchange,\n\t\t\t\t\tcommitToRevert,\n\t\t\t\t\theadCommit,\n\t\t\t\t\tthis.mintRevisionTag,\n\t\t\t\t).change,\n\t\t\t);\n\t\t}\n\n\t\tthis.branch.apply(\n\t\t\tchange.change,\n\t\t\tthis.mintRevisionTag(),\n\t\t\tkind === CommitKind.Default || kind === CommitKind.Redo\n\t\t\t\t? CommitKind.Undo\n\t\t\t\t: CommitKind.Redo,\n\t\t);\n\t}\n}\n\n/**\n * Run a synchronous transaction on the given shared tree view.\n * This is a convenience helper around the {@link SharedTreeFork#transaction} APIs.\n * @param view - the view on which to run the transaction\n * @param transaction - the transaction function. This will be executed immediately. It is passed `view` as an argument for convenience.\n * If this function returns an `Abort` result then the transaction will be aborted. Otherwise, it will be committed.\n * @returns whether or not the transaction was committed or aborted\n * @internal\n */\nexport function runSynchronous(\n\tview: ITreeCheckout,\n\ttransaction: (view: ITreeCheckout) => TransactionResult | void,\n): TransactionResult {\n\tview.transaction.start();\n\tconst result = transaction(view);\n\treturn result === TransactionResult.Abort\n\t\t? view.transaction.abort()\n\t\t: view.transaction.commit();\n}\n\ninterface DisposableRevertible extends Revertible {\n\tdispose: () => void;\n}\n"]}
@@ -2,9 +2,9 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { Context, FlexFieldSchema, FlexTreeContext, FlexTreeSchema, FlexTreeTypedField, NodeKeyManager } from "../feature-libraries/index.js";
6
- import { IDisposable, disposeSymbol } from "../util/index.js";
7
- import { ITreeCheckout, ITreeCheckoutFork, TreeCheckout } from "./treeCheckout.js";
5
+ import { type Context, type FlexFieldSchema, type FlexTreeContext, type FlexTreeSchema, type FlexTreeTypedField, type NodeKeyManager } from "../feature-libraries/index.js";
6
+ import { type IDisposable, disposeSymbol } from "../util/index.js";
7
+ import type { ITreeCheckout, ITreeCheckoutFork, TreeCheckout } from "./treeCheckout.js";
8
8
  /**
9
9
  * An editable view of a (version control style) branch of a shared tree.
10
10
  * @privateRemarks
@@ -1 +1 @@
1
- {"version":3,"file":"treeView.d.ts","sourceRoot":"","sources":["../../src/shared-tree/treeView.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,OAAO,EACP,eAAe,EACf,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,cAAc,EAEd,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEnF;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,SAAS,eAAe,CAAE,SAAQ,WAAW;IACtF;;;;;OAKG;IACH,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K,CAAC,CAAC;gBAEnC,QAAQ,EAAE,SAAS,EACnB,MAAM,EAAE,cAAc,CAAC,KAAK,CAAC,EAC7B,cAAc,EAAE,cAAc,EAC7B,SAAS,CAAC,SAAQ,IAAI,aAAA;IAOjC,CAAC,aAAa,CAAC,IAAI,IAAI;IAKvB,IAAI,IAAI,oBAAoB,CAAC,KAAK,EAAE,YAAY,GAAG,iBAAiB,CAAC;CAI5E;AAED;;;GAGG;AAGH,eAAO,MAAM,iBAAiB,2DAAoD,CAAC"}
@@ -11,12 +11,6 @@ const index_js_2 = require("../util/index.js");
11
11
  * Implementation of FlexTreeView wrapping a ITreeCheckout.
12
12
  */
13
13
  class CheckoutFlexTreeView {
14
- checkout;
15
- schema;
16
- nodeKeyManager;
17
- onDispose;
18
- context;
19
- flexTree;
20
14
  constructor(checkout, schema, nodeKeyManager, onDispose) {
21
15
  this.checkout = checkout;
22
16
  this.schema = schema;
@@ -1 +1 @@
1
- {"version":3,"file":"treeView.js","sourceRoot":"","sources":["../../src/shared-tree/treeView.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4DAQuC;AACvC,+CAA8D;AAmD9D;;GAEG;AACH,MAAa,oBAAoB;IAQf;IACA;IACA;IACC;IANF,OAAO,CAAU;IACjB,QAAQ,CAA4B;IACpD,YACiB,QAAmB,EACnB,MAA6B,EAC7B,cAA8B,EAC7B,SAAsB;QAHvB,aAAQ,GAAR,QAAQ,CAAW;QACnB,WAAM,GAAN,MAAM,CAAuB;QAC7B,mBAAc,GAAd,cAAc,CAAgB;QAC7B,cAAS,GAAT,SAAS,CAAa;QAEvC,IAAI,CAAC,OAAO,GAAG,IAAA,yBAAc,EAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;QACrE,yBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAiC,CAAC;IAChE,CAAC;IAEM,CAAC,wBAAa,CAAC;QACrB,IAAI,CAAC,OAAO,CAAC,wBAAa,CAAC,EAAE,CAAC;QAC9B,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;IACpB,CAAC;IAEM,IAAI;QACV,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACpC,OAAO,IAAI,oBAAoB,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAC3E,CAAC;CACD;AA3BD,oDA2BC;AAED;;;GAGG;AACH,uCAAuC;AACvC,8DAA8D;AACjD,QAAA,iBAAiB,GAAG,IAAI,OAAO,EAAsC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tContext,\n\tFlexFieldSchema,\n\tFlexTreeContext,\n\tFlexTreeSchema,\n\tFlexTreeTypedField,\n\tNodeKeyManager,\n\tgetTreeContext,\n} from \"../feature-libraries/index.js\";\nimport { IDisposable, disposeSymbol } from \"../util/index.js\";\n\nimport { ITreeCheckout, ITreeCheckoutFork, TreeCheckout } from \"./treeCheckout.js\";\n\n/**\n * An editable view of a (version control style) branch of a shared tree.\n * @privateRemarks\n * TODO:\n * 1. Once ISharedTreeView is renamed this can become ISharedTreeView.\n * 2. This object should be combined with or accessible from the TreeContext to allow easy access to thinks like branching.\n * @internal\n */\nexport interface FlexTreeView<in out TRoot extends FlexFieldSchema> extends IDisposable {\n\t/**\n\t * Context for controlling the FlexTree nodes produced from {@link FlexTreeView.flexTree}.\n\t *\n\t * @remarks\n\t * This is an owning reference: disposing of this view disposes its context.\n\t */\n\treadonly context: FlexTreeContext;\n\n\t/**\n\t * Access non-view schema specific aspects of of this branch.\n\t *\n\t * @remarks\n\t * This is a non-owning reference: disposing of this view does not impact the branch.\n\t */\n\treadonly checkout: ITreeCheckout;\n\n\t/**\n\t * Get a typed view of the tree content using the flex-tree API.\n\t */\n\treadonly flexTree: FlexTreeTypedField<TRoot>;\n\n\t/**\n\t * Spawn a new view which is based off of the current state of this view.\n\t * Any mutations of the new view will not apply to this view until the new view is merged back into this view via `merge()`.\n\t */\n\tfork(): ITreeViewFork<TRoot>;\n}\n\n/**\n * Branch (like in a version control system) of SharedTree.\n *\n * {@link FlexTreeView} that has forked off of the main trunk/branch.\n * @internal\n */\nexport interface ITreeViewFork<in out TRoot extends FlexFieldSchema> extends FlexTreeView<TRoot> {\n\treadonly checkout: ITreeCheckoutFork;\n}\n\n/**\n * Implementation of FlexTreeView wrapping a ITreeCheckout.\n */\nexport class CheckoutFlexTreeView<\n\tin out TRoot extends FlexFieldSchema,\n\tout TCheckout extends TreeCheckout = TreeCheckout,\n> implements FlexTreeView<TRoot>\n{\n\tpublic readonly context: Context;\n\tpublic readonly flexTree: FlexTreeTypedField<TRoot>;\n\tpublic constructor(\n\t\tpublic readonly checkout: TCheckout,\n\t\tpublic readonly schema: FlexTreeSchema<TRoot>,\n\t\tpublic readonly nodeKeyManager: NodeKeyManager,\n\t\tprivate readonly onDispose?: () => void,\n\t) {\n\t\tthis.context = getTreeContext(schema, this.checkout, nodeKeyManager);\n\t\tcontextToTreeView.set(this.context, this);\n\t\tthis.flexTree = this.context.root as FlexTreeTypedField<TRoot>;\n\t}\n\n\tpublic [disposeSymbol](): void {\n\t\tthis.context[disposeSymbol]();\n\t\tthis.onDispose?.();\n\t}\n\n\tpublic fork(): CheckoutFlexTreeView<TRoot, TreeCheckout & ITreeCheckoutFork> {\n\t\tconst branch = this.checkout.fork();\n\t\treturn new CheckoutFlexTreeView(branch, this.schema, this.nodeKeyManager);\n\t}\n}\n\n/**\n * Maps the context of every {@link CheckoutFlexTreeView} to the view.\n * In practice, this allows the view or checkout to be obtained from a flex node by first getting the context from the flex node and then using this map.\n */\n// TODO: use something other than `any`\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const contextToTreeView = new WeakMap<Context, CheckoutFlexTreeView<any>>();\n"]}
1
+ {"version":3,"file":"treeView.js","sourceRoot":"","sources":["../../src/shared-tree/treeView.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4DAQuC;AACvC,+CAAmE;AAmDnE;;GAEG;AACH,MAAa,oBAAoB;IAOhC,YACiB,QAAmB,EACnB,MAA6B,EAC7B,cAA8B,EAC7B,SAAsB;QAHvB,aAAQ,GAAR,QAAQ,CAAW;QACnB,WAAM,GAAN,MAAM,CAAuB;QAC7B,mBAAc,GAAd,cAAc,CAAgB;QAC7B,cAAS,GAAT,SAAS,CAAa;QAEvC,IAAI,CAAC,OAAO,GAAG,IAAA,yBAAc,EAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;QACrE,yBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAiC,CAAC;IAChE,CAAC;IAEM,CAAC,wBAAa,CAAC;QACrB,IAAI,CAAC,OAAO,CAAC,wBAAa,CAAC,EAAE,CAAC;QAC9B,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;IACpB,CAAC;IAEM,IAAI;QACV,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACpC,OAAO,IAAI,oBAAoB,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAC3E,CAAC;CACD;AA3BD,oDA2BC;AAED;;;GAGG;AACH,uCAAuC;AACvC,8DAA8D;AACjD,QAAA,iBAAiB,GAAG,IAAI,OAAO,EAAsC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype Context,\n\ttype FlexFieldSchema,\n\ttype FlexTreeContext,\n\ttype FlexTreeSchema,\n\ttype FlexTreeTypedField,\n\ttype NodeKeyManager,\n\tgetTreeContext,\n} from \"../feature-libraries/index.js\";\nimport { type IDisposable, disposeSymbol } from \"../util/index.js\";\n\nimport type { ITreeCheckout, ITreeCheckoutFork, TreeCheckout } from \"./treeCheckout.js\";\n\n/**\n * An editable view of a (version control style) branch of a shared tree.\n * @privateRemarks\n * TODO:\n * 1. Once ISharedTreeView is renamed this can become ISharedTreeView.\n * 2. This object should be combined with or accessible from the TreeContext to allow easy access to thinks like branching.\n * @internal\n */\nexport interface FlexTreeView<in out TRoot extends FlexFieldSchema> extends IDisposable {\n\t/**\n\t * Context for controlling the FlexTree nodes produced from {@link FlexTreeView.flexTree}.\n\t *\n\t * @remarks\n\t * This is an owning reference: disposing of this view disposes its context.\n\t */\n\treadonly context: FlexTreeContext;\n\n\t/**\n\t * Access non-view schema specific aspects of of this branch.\n\t *\n\t * @remarks\n\t * This is a non-owning reference: disposing of this view does not impact the branch.\n\t */\n\treadonly checkout: ITreeCheckout;\n\n\t/**\n\t * Get a typed view of the tree content using the flex-tree API.\n\t */\n\treadonly flexTree: FlexTreeTypedField<TRoot>;\n\n\t/**\n\t * Spawn a new view which is based off of the current state of this view.\n\t * Any mutations of the new view will not apply to this view until the new view is merged back into this view via `merge()`.\n\t */\n\tfork(): ITreeViewFork<TRoot>;\n}\n\n/**\n * Branch (like in a version control system) of SharedTree.\n *\n * {@link FlexTreeView} that has forked off of the main trunk/branch.\n * @internal\n */\nexport interface ITreeViewFork<in out TRoot extends FlexFieldSchema> extends FlexTreeView<TRoot> {\n\treadonly checkout: ITreeCheckoutFork;\n}\n\n/**\n * Implementation of FlexTreeView wrapping a ITreeCheckout.\n */\nexport class CheckoutFlexTreeView<\n\tin out TRoot extends FlexFieldSchema,\n\tout TCheckout extends TreeCheckout = TreeCheckout,\n> implements FlexTreeView<TRoot>\n{\n\tpublic readonly context: Context;\n\tpublic readonly flexTree: FlexTreeTypedField<TRoot>;\n\tpublic constructor(\n\t\tpublic readonly checkout: TCheckout,\n\t\tpublic readonly schema: FlexTreeSchema<TRoot>,\n\t\tpublic readonly nodeKeyManager: NodeKeyManager,\n\t\tprivate readonly onDispose?: () => void,\n\t) {\n\t\tthis.context = getTreeContext(schema, this.checkout, nodeKeyManager);\n\t\tcontextToTreeView.set(this.context, this);\n\t\tthis.flexTree = this.context.root as FlexTreeTypedField<TRoot>;\n\t}\n\n\tpublic [disposeSymbol](): void {\n\t\tthis.context[disposeSymbol]();\n\t\tthis.onDispose?.();\n\t}\n\n\tpublic fork(): CheckoutFlexTreeView<TRoot, TreeCheckout & ITreeCheckoutFork> {\n\t\tconst branch = this.checkout.fork();\n\t\treturn new CheckoutFlexTreeView(branch, this.schema, this.nodeKeyManager);\n\t}\n}\n\n/**\n * Maps the context of every {@link CheckoutFlexTreeView} to the view.\n * In practice, this allows the view or checkout to be obtained from a flex node by first getting the context from the flex node and then using this map.\n */\n// TODO: use something other than `any`\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const contextToTreeView = new WeakMap<Context, CheckoutFlexTreeView<any>>();\n"]}
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { BranchRebaseResult, ChangeFamily, ChangeFamilyEditor, CommitKind, CommitMetadata, GraphCommit, RevisionTag, TaggedChange } from "../core/index.js";
6
- import { EventEmitter, Listenable } from "../events/index.js";
5
+ import { type BranchRebaseResult, type ChangeFamily, type ChangeFamilyEditor, CommitKind, type CommitMetadata, type GraphCommit, type RevisionTag, type TaggedChange } from "../core/index.js";
6
+ import { EventEmitter, type Listenable } from "../events/index.js";
7
7
  /**
8
8
  * Describes a change to a `SharedTreeBranch`. Various operations can mutate the head of the branch;
9
9
  * this change format describes each in terms of the "removed commits" (all commits which were present
@@ -1 +1 @@
1
- {"version":3,"file":"branch.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/branch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO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;;;;OAOG;IACI,OAAO,IAAI,IAAI;IAetB,OAAO,CAAC,iBAAiB;CAGzB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,UAAU,CAAC;IAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,CAAA;CAAE,CAAC,EAC9E,QAAQ,EAAE,CAAC,EACX,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,GACvB,MAAM,IAAI,CASZ"}
@@ -37,37 +37,6 @@ exports.getChangeReplaceType = getChangeReplaceType;
37
37
  * A branch of changes that can be applied to a SharedTree.
38
38
  */
39
39
  class SharedTreeBranch extends index_js_2.EventEmitter {
40
- head;
41
- changeFamily;
42
- mintRevisionTag;
43
- branchTrimmer;
44
- editor;
45
- transactions = new transactionStack_js_1.TransactionStack();
46
- /**
47
- * After pushing a starting revision to the transaction stack, this branch might be rebased
48
- * over commits which are children of that starting revision. When the transaction is committed,
49
- * those rebased-over commits should not be included in the transaction's squash commit, even though
50
- * they exist between the starting revision and the final commit within the transaction.
51
- *
52
- * Whenever `rebaseOnto` is called during a transaction, this map is augmented with an entry from the
53
- * original merge-base to the new merge-base.
54
- *
55
- * This state need only be retained for the lifetime of the transaction.
56
- *
57
- * TODO: This strategy might need to be revisited when adding better support for async transactions.
58
- * Since:
59
- *
60
- * 1. Transactionality is guaranteed primarily by squashing at commit time
61
- * 2. Branches may be rebased with an ongoing transaction
62
- *
63
- * a rebase operation might invalidate only a portion of a transaction's commits, thus defeating the
64
- * purpose of transactionality.
65
- *
66
- * AB#6483 and children items track this work.
67
- */
68
- initialTransactionRevToRebasedRev = new Map();
69
- disposed = false;
70
- unsubscribeBranchTrimmer;
71
40
  /**
72
41
  * Construct a new branch.
73
42
  * @param head - the head of the branch
@@ -81,6 +50,31 @@ class SharedTreeBranch extends index_js_2.EventEmitter {
81
50
  this.changeFamily = changeFamily;
82
51
  this.mintRevisionTag = mintRevisionTag;
83
52
  this.branchTrimmer = branchTrimmer;
53
+ this.transactions = new transactionStack_js_1.TransactionStack();
54
+ /**
55
+ * After pushing a starting revision to the transaction stack, this branch might be rebased
56
+ * over commits which are children of that starting revision. When the transaction is committed,
57
+ * those rebased-over commits should not be included in the transaction's squash commit, even though
58
+ * they exist between the starting revision and the final commit within the transaction.
59
+ *
60
+ * Whenever `rebaseOnto` is called during a transaction, this map is augmented with an entry from the
61
+ * original merge-base to the new merge-base.
62
+ *
63
+ * This state need only be retained for the lifetime of the transaction.
64
+ *
65
+ * TODO: This strategy might need to be revisited when adding better support for async transactions.
66
+ * Since:
67
+ *
68
+ * 1. Transactionality is guaranteed primarily by squashing at commit time
69
+ * 2. Branches may be rebased with an ongoing transaction
70
+ *
71
+ * a rebase operation might invalidate only a portion of a transaction's commits, thus defeating the
72
+ * purpose of transactionality.
73
+ *
74
+ * AB#6483 and children items track this work.
75
+ */
76
+ this.initialTransactionRevToRebasedRev = new Map();
77
+ this.disposed = false;
84
78
  this.editor = this.changeFamily.buildEditor((change) => this.apply(change, mintRevisionTag()));
85
79
  this.unsubscribeBranchTrimmer = branchTrimmer?.on("ancestryTrimmed", (commit) => {
86
80
  this.emit("ancestryTrimmed", commit);