@fluidframework/tree 2.1.0-276985 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (583) hide show
  1. package/.eslintrc.cjs +7 -0
  2. package/.vscode/Tree.code-workspace +9 -2
  3. package/CHANGELOG.md +38 -0
  4. package/README.md +55 -12
  5. package/api-report/tree.alpha.api.md +2 -1
  6. package/api-report/tree.beta.api.md +2 -1
  7. package/api-report/tree.public.api.md +2 -1
  8. package/beta.d.ts +1 -1
  9. package/dist/beta.d.ts +1 -1
  10. package/dist/core/forest/editableForest.d.ts +6 -3
  11. package/dist/core/forest/editableForest.d.ts.map +1 -1
  12. package/dist/core/forest/editableForest.js +16 -4
  13. package/dist/core/forest/editableForest.js.map +1 -1
  14. package/dist/core/index.d.ts +1 -1
  15. package/dist/core/index.d.ts.map +1 -1
  16. package/dist/core/index.js +3 -1
  17. package/dist/core/index.js.map +1 -1
  18. package/dist/core/rebase/index.d.ts +1 -1
  19. package/dist/core/rebase/index.d.ts.map +1 -1
  20. package/dist/core/rebase/index.js +3 -1
  21. package/dist/core/rebase/index.js.map +1 -1
  22. package/dist/core/rebase/types.d.ts +2 -0
  23. package/dist/core/rebase/types.d.ts.map +1 -1
  24. package/dist/core/rebase/types.js +9 -1
  25. package/dist/core/rebase/types.js.map +1 -1
  26. package/dist/core/tree/anchorSet.d.ts +1 -0
  27. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  28. package/dist/core/tree/anchorSet.js +13 -0
  29. package/dist/core/tree/anchorSet.js.map +1 -1
  30. package/dist/core/tree/detachedFieldIndex.d.ts +48 -11
  31. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  32. package/dist/core/tree/detachedFieldIndex.js +144 -20
  33. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  34. package/dist/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
  35. package/dist/core/tree/detachedFieldIndexCodec.js +13 -4
  36. package/dist/core/tree/detachedFieldIndexCodec.js.map +1 -1
  37. package/dist/core/tree/detachedFieldIndexFormat.d.ts +1 -1
  38. package/dist/core/tree/detachedFieldIndexFormat.d.ts.map +1 -1
  39. package/dist/core/tree/detachedFieldIndexFormat.js.map +1 -1
  40. package/dist/core/tree/detachedFieldIndexTypes.d.ts +39 -4
  41. package/dist/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
  42. package/dist/core/tree/detachedFieldIndexTypes.js.map +1 -1
  43. package/dist/core/tree/index.d.ts +2 -1
  44. package/dist/core/tree/index.d.ts.map +1 -1
  45. package/dist/core/tree/index.js.map +1 -1
  46. package/dist/core/tree/visitDelta.d.ts +3 -1
  47. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  48. package/dist/core/tree/visitDelta.js +31 -15
  49. package/dist/core/tree/visitDelta.js.map +1 -1
  50. package/dist/core/tree/visitorUtils.d.ts +3 -3
  51. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  52. package/dist/core/tree/visitorUtils.js +4 -4
  53. package/dist/core/tree/visitorUtils.js.map +1 -1
  54. package/dist/events/events.d.ts +4 -1
  55. package/dist/events/events.d.ts.map +1 -1
  56. package/dist/events/events.js.map +1 -1
  57. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +1 -1
  58. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  59. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  60. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +1 -0
  61. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  62. package/dist/feature-libraries/editableTreeBinder.js +1 -1
  63. package/dist/feature-libraries/editableTreeBinder.js.map +1 -1
  64. package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts +1 -10
  65. package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
  66. package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +0 -72
  67. package/dist/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
  68. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +1 -51
  69. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  70. package/dist/feature-libraries/flex-tree/flexTreeTypes.js +0 -2
  71. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  72. package/dist/feature-libraries/flex-tree/index.d.ts +3 -2
  73. package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
  74. package/dist/feature-libraries/flex-tree/index.js +5 -1
  75. package/dist/feature-libraries/flex-tree/index.js.map +1 -1
  76. package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +1 -2
  77. package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
  78. package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  79. package/dist/feature-libraries/flex-tree/lazyField.d.ts +1 -6
  80. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  81. package/dist/feature-libraries/flex-tree/lazyField.js +11 -32
  82. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  83. package/dist/feature-libraries/flex-tree/lazyNode.d.ts +1 -5
  84. package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  85. package/dist/feature-libraries/flex-tree/lazyNode.js +0 -30
  86. package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  87. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  88. package/dist/feature-libraries/forest-summary/forestSummarizer.js +1 -1
  89. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  90. package/dist/feature-libraries/index.d.ts +3 -3
  91. package/dist/feature-libraries/index.d.ts.map +1 -1
  92. package/dist/feature-libraries/index.js +6 -3
  93. package/dist/feature-libraries/index.js.map +1 -1
  94. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +11 -0
  95. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  96. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  97. package/dist/feature-libraries/modular-schema/discrepancies.d.ts +96 -0
  98. package/dist/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -0
  99. package/dist/feature-libraries/modular-schema/discrepancies.js +264 -0
  100. package/dist/feature-libraries/modular-schema/discrepancies.js.map +1 -0
  101. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +9 -2
  102. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  103. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  104. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  105. package/dist/feature-libraries/modular-schema/genericFieldKind.js +3 -0
  106. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  107. package/dist/feature-libraries/modular-schema/index.d.ts +2 -1
  108. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  109. package/dist/feature-libraries/modular-schema/index.js +3 -1
  110. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  111. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  112. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +42 -26
  113. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  114. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +51 -2
  115. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  116. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +827 -245
  117. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  118. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  119. package/dist/feature-libraries/modular-schema/modularChangeFormat.js +2 -0
  120. package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
  121. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +44 -1
  122. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  123. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  124. package/dist/feature-libraries/node-key/index.d.ts +0 -1
  125. package/dist/feature-libraries/node-key/index.d.ts.map +1 -1
  126. package/dist/feature-libraries/node-key/index.js +1 -3
  127. package/dist/feature-libraries/node-key/index.js.map +1 -1
  128. package/dist/feature-libraries/object-forest/objectForest.d.ts +3 -2
  129. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  130. package/dist/feature-libraries/object-forest/objectForest.js +5 -4
  131. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  132. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  133. package/dist/feature-libraries/optional-field/optionalField.js +1 -0
  134. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  135. package/dist/feature-libraries/sequence-field/index.d.ts +1 -1
  136. package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
  137. package/dist/feature-libraries/sequence-field/index.js +1 -2
  138. package/dist/feature-libraries/sequence-field/index.js.map +1 -1
  139. package/dist/feature-libraries/sequence-field/invert.js +1 -1
  140. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  141. package/dist/feature-libraries/sequence-field/rebase.js +6 -1
  142. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  143. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  144. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +1 -0
  145. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  146. package/dist/feature-libraries/sequence-field/utils.d.ts +2 -17
  147. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  148. package/dist/feature-libraries/sequence-field/utils.js +31 -39
  149. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  150. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +1 -0
  151. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
  152. package/dist/feature-libraries/typed-schema/typedTreeSchema.js +2 -0
  153. package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
  154. package/dist/index.d.ts +1 -1
  155. package/dist/index.d.ts.map +1 -1
  156. package/dist/index.js.map +1 -1
  157. package/dist/packageVersion.d.ts +1 -1
  158. package/dist/packageVersion.d.ts.map +1 -1
  159. package/dist/packageVersion.js +1 -1
  160. package/dist/packageVersion.js.map +1 -1
  161. package/dist/public.d.ts +1 -1
  162. package/dist/shared-tree/schematizingTreeView.d.ts +4 -2
  163. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  164. package/dist/shared-tree/schematizingTreeView.js +240 -184
  165. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  166. package/dist/shared-tree/sharedTree.d.ts +5 -1
  167. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  168. package/dist/shared-tree/sharedTree.js +157 -90
  169. package/dist/shared-tree/sharedTree.js.map +1 -1
  170. package/dist/shared-tree/sharedTreeChangeEnricher.js +1 -1
  171. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  172. package/dist/shared-tree/treeApi.js +1 -1
  173. package/dist/shared-tree/treeApi.js.map +1 -1
  174. package/dist/shared-tree/treeCheckout.d.ts +10 -1
  175. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  176. package/dist/shared-tree/treeCheckout.js +47 -3
  177. package/dist/shared-tree/treeCheckout.js.map +1 -1
  178. package/dist/shared-tree/treeView.d.ts.map +1 -1
  179. package/dist/shared-tree/treeView.js +7 -3
  180. package/dist/shared-tree/treeView.js.map +1 -1
  181. package/dist/shared-tree-core/branch.d.ts +6 -0
  182. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  183. package/dist/shared-tree-core/branch.js +3 -0
  184. package/dist/shared-tree-core/branch.js.map +1 -1
  185. package/dist/shared-tree-core/sharedTreeCore.d.ts +8 -6
  186. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  187. package/dist/shared-tree-core/sharedTreeCore.js +271 -209
  188. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  189. package/dist/simple-tree/arrayNode.d.ts +4 -0
  190. package/dist/simple-tree/arrayNode.d.ts.map +1 -1
  191. package/dist/simple-tree/arrayNode.js +36 -19
  192. package/dist/simple-tree/arrayNode.js.map +1 -1
  193. package/dist/simple-tree/index.d.ts +3 -3
  194. package/dist/simple-tree/index.d.ts.map +1 -1
  195. package/dist/simple-tree/index.js +2 -1
  196. package/dist/simple-tree/index.js.map +1 -1
  197. package/dist/simple-tree/leafNodeSchema.d.ts +22 -1
  198. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  199. package/dist/simple-tree/leafNodeSchema.js +2 -1
  200. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  201. package/dist/simple-tree/mapNode.d.ts.map +1 -1
  202. package/dist/simple-tree/mapNode.js.map +1 -1
  203. package/dist/simple-tree/objectNode.d.ts.map +1 -1
  204. package/dist/simple-tree/objectNode.js +2 -1
  205. package/dist/simple-tree/objectNode.js.map +1 -1
  206. package/dist/simple-tree/proxies.d.ts.map +1 -1
  207. package/dist/simple-tree/proxies.js +9 -25
  208. package/dist/simple-tree/proxies.js.map +1 -1
  209. package/dist/simple-tree/proxyBinding.d.ts +4 -0
  210. package/dist/simple-tree/proxyBinding.d.ts.map +1 -1
  211. package/dist/simple-tree/proxyBinding.js +23 -1
  212. package/dist/simple-tree/proxyBinding.js.map +1 -1
  213. package/dist/simple-tree/schemaFactory.d.ts +16 -1
  214. package/dist/simple-tree/schemaFactory.d.ts.map +1 -1
  215. package/dist/simple-tree/schemaFactory.js +32 -4
  216. package/dist/simple-tree/schemaFactory.js.map +1 -1
  217. package/dist/simple-tree/schemaTypes.d.ts +36 -1
  218. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  219. package/dist/simple-tree/schemaTypes.js.map +1 -1
  220. package/dist/simple-tree/toFlexSchema.d.ts +2 -2
  221. package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
  222. package/dist/simple-tree/toFlexSchema.js +3 -2
  223. package/dist/simple-tree/toFlexSchema.js.map +1 -1
  224. package/dist/simple-tree/tree.d.ts +4 -1
  225. package/dist/simple-tree/tree.d.ts.map +1 -1
  226. package/dist/simple-tree/tree.js +48 -1
  227. package/dist/simple-tree/tree.js.map +1 -1
  228. package/dist/simple-tree/treeNodeApi.d.ts +2 -75
  229. package/dist/simple-tree/treeNodeApi.d.ts.map +1 -1
  230. package/dist/simple-tree/treeNodeApi.js +17 -25
  231. package/dist/simple-tree/treeNodeApi.js.map +1 -1
  232. package/dist/simple-tree/treeNodeKernel.d.ts +26 -0
  233. package/dist/simple-tree/treeNodeKernel.d.ts.map +1 -0
  234. package/dist/simple-tree/treeNodeKernel.js +83 -0
  235. package/dist/simple-tree/treeNodeKernel.js.map +1 -0
  236. package/dist/simple-tree/types.d.ts +95 -3
  237. package/dist/simple-tree/types.d.ts.map +1 -1
  238. package/dist/simple-tree/types.js +120 -21
  239. package/dist/simple-tree/types.js.map +1 -1
  240. package/dist/util/breakable.d.ts +83 -0
  241. package/dist/util/breakable.d.ts.map +1 -0
  242. package/dist/util/breakable.js +178 -0
  243. package/dist/util/breakable.js.map +1 -0
  244. package/dist/util/index.d.ts +3 -2
  245. package/dist/util/index.d.ts.map +1 -1
  246. package/dist/util/index.js +9 -2
  247. package/dist/util/index.js.map +1 -1
  248. package/dist/util/nestedMap.d.ts +17 -3
  249. package/dist/util/nestedMap.d.ts.map +1 -1
  250. package/dist/util/nestedMap.js +21 -1
  251. package/dist/util/nestedMap.js.map +1 -1
  252. package/dist/util/utils.d.ts +7 -0
  253. package/dist/util/utils.d.ts.map +1 -1
  254. package/dist/util/utils.js +15 -1
  255. package/dist/util/utils.js.map +1 -1
  256. package/internal.d.ts +1 -1
  257. package/lib/beta.d.ts +1 -1
  258. package/lib/core/forest/editableForest.d.ts +6 -3
  259. package/lib/core/forest/editableForest.d.ts.map +1 -1
  260. package/lib/core/forest/editableForest.js +17 -5
  261. package/lib/core/forest/editableForest.js.map +1 -1
  262. package/lib/core/index.d.ts +1 -1
  263. package/lib/core/index.d.ts.map +1 -1
  264. package/lib/core/index.js +1 -1
  265. package/lib/core/index.js.map +1 -1
  266. package/lib/core/rebase/index.d.ts +1 -1
  267. package/lib/core/rebase/index.d.ts.map +1 -1
  268. package/lib/core/rebase/index.js +1 -1
  269. package/lib/core/rebase/index.js.map +1 -1
  270. package/lib/core/rebase/types.d.ts +2 -0
  271. package/lib/core/rebase/types.d.ts.map +1 -1
  272. package/lib/core/rebase/types.js +7 -1
  273. package/lib/core/rebase/types.js.map +1 -1
  274. package/lib/core/tree/anchorSet.d.ts +1 -0
  275. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  276. package/lib/core/tree/anchorSet.js +13 -0
  277. package/lib/core/tree/anchorSet.js.map +1 -1
  278. package/lib/core/tree/detachedFieldIndex.d.ts +48 -11
  279. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  280. package/lib/core/tree/detachedFieldIndex.js +145 -21
  281. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  282. package/lib/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
  283. package/lib/core/tree/detachedFieldIndexCodec.js +13 -4
  284. package/lib/core/tree/detachedFieldIndexCodec.js.map +1 -1
  285. package/lib/core/tree/detachedFieldIndexFormat.d.ts +1 -1
  286. package/lib/core/tree/detachedFieldIndexFormat.d.ts.map +1 -1
  287. package/lib/core/tree/detachedFieldIndexFormat.js.map +1 -1
  288. package/lib/core/tree/detachedFieldIndexTypes.d.ts +39 -4
  289. package/lib/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
  290. package/lib/core/tree/detachedFieldIndexTypes.js.map +1 -1
  291. package/lib/core/tree/index.d.ts +2 -1
  292. package/lib/core/tree/index.d.ts.map +1 -1
  293. package/lib/core/tree/index.js.map +1 -1
  294. package/lib/core/tree/visitDelta.d.ts +3 -1
  295. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  296. package/lib/core/tree/visitDelta.js +31 -15
  297. package/lib/core/tree/visitDelta.js.map +1 -1
  298. package/lib/core/tree/visitorUtils.d.ts +3 -3
  299. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  300. package/lib/core/tree/visitorUtils.js +4 -4
  301. package/lib/core/tree/visitorUtils.js.map +1 -1
  302. package/lib/events/events.d.ts +4 -1
  303. package/lib/events/events.d.ts.map +1 -1
  304. package/lib/events/events.js.map +1 -1
  305. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +1 -1
  306. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  307. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  308. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +1 -0
  309. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  310. package/lib/feature-libraries/editableTreeBinder.js +1 -1
  311. package/lib/feature-libraries/editableTreeBinder.js.map +1 -1
  312. package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts +1 -10
  313. package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
  314. package/lib/feature-libraries/flex-map-tree/mapTreeNode.js +2 -74
  315. package/lib/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
  316. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +1 -51
  317. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  318. package/lib/feature-libraries/flex-tree/flexTreeTypes.js +0 -2
  319. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  320. package/lib/feature-libraries/flex-tree/index.d.ts +3 -2
  321. package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
  322. package/lib/feature-libraries/flex-tree/index.js +2 -1
  323. package/lib/feature-libraries/flex-tree/index.js.map +1 -1
  324. package/lib/feature-libraries/flex-tree/lazyEntity.d.ts +1 -2
  325. package/lib/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
  326. package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  327. package/lib/feature-libraries/flex-tree/lazyField.d.ts +1 -6
  328. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  329. package/lib/feature-libraries/flex-tree/lazyField.js +13 -34
  330. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  331. package/lib/feature-libraries/flex-tree/lazyNode.d.ts +1 -5
  332. package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  333. package/lib/feature-libraries/flex-tree/lazyNode.js +3 -33
  334. package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  335. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  336. package/lib/feature-libraries/forest-summary/forestSummarizer.js +1 -1
  337. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  338. package/lib/feature-libraries/index.d.ts +3 -3
  339. package/lib/feature-libraries/index.d.ts.map +1 -1
  340. package/lib/feature-libraries/index.js +3 -3
  341. package/lib/feature-libraries/index.js.map +1 -1
  342. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +11 -0
  343. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  344. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  345. package/lib/feature-libraries/modular-schema/discrepancies.d.ts +96 -0
  346. package/lib/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -0
  347. package/lib/feature-libraries/modular-schema/discrepancies.js +260 -0
  348. package/lib/feature-libraries/modular-schema/discrepancies.js.map +1 -0
  349. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +9 -2
  350. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  351. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  352. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  353. package/lib/feature-libraries/modular-schema/genericFieldKind.js +3 -0
  354. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  355. package/lib/feature-libraries/modular-schema/index.d.ts +2 -1
  356. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  357. package/lib/feature-libraries/modular-schema/index.js +1 -0
  358. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  359. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  360. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +42 -26
  361. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  362. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +51 -2
  363. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  364. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +826 -247
  365. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  366. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  367. package/lib/feature-libraries/modular-schema/modularChangeFormat.js +2 -0
  368. package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
  369. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +44 -1
  370. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  371. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  372. package/lib/feature-libraries/node-key/index.d.ts +0 -1
  373. package/lib/feature-libraries/node-key/index.d.ts.map +1 -1
  374. package/lib/feature-libraries/node-key/index.js +0 -1
  375. package/lib/feature-libraries/node-key/index.js.map +1 -1
  376. package/lib/feature-libraries/object-forest/objectForest.d.ts +3 -2
  377. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  378. package/lib/feature-libraries/object-forest/objectForest.js +5 -4
  379. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  380. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  381. package/lib/feature-libraries/optional-field/optionalField.js +1 -0
  382. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  383. package/lib/feature-libraries/sequence-field/index.d.ts +1 -1
  384. package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
  385. package/lib/feature-libraries/sequence-field/index.js +1 -1
  386. package/lib/feature-libraries/sequence-field/index.js.map +1 -1
  387. package/lib/feature-libraries/sequence-field/invert.js +1 -1
  388. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  389. package/lib/feature-libraries/sequence-field/rebase.js +6 -1
  390. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  391. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  392. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +2 -1
  393. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  394. package/lib/feature-libraries/sequence-field/utils.d.ts +2 -17
  395. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  396. package/lib/feature-libraries/sequence-field/utils.js +31 -39
  397. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  398. package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts +1 -0
  399. package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
  400. package/lib/feature-libraries/typed-schema/typedTreeSchema.js +4 -2
  401. package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
  402. package/lib/index.d.ts +1 -1
  403. package/lib/index.d.ts.map +1 -1
  404. package/lib/index.js.map +1 -1
  405. package/lib/packageVersion.d.ts +1 -1
  406. package/lib/packageVersion.d.ts.map +1 -1
  407. package/lib/packageVersion.js +1 -1
  408. package/lib/packageVersion.js.map +1 -1
  409. package/lib/public.d.ts +1 -1
  410. package/lib/shared-tree/schematizingTreeView.d.ts +4 -2
  411. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  412. package/lib/shared-tree/schematizingTreeView.js +242 -185
  413. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  414. package/lib/shared-tree/sharedTree.d.ts +5 -1
  415. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  416. package/lib/shared-tree/sharedTree.js +158 -90
  417. package/lib/shared-tree/sharedTree.js.map +1 -1
  418. package/lib/shared-tree/sharedTreeChangeEnricher.js +1 -1
  419. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  420. package/lib/shared-tree/treeApi.js +1 -1
  421. package/lib/shared-tree/treeApi.js.map +1 -1
  422. package/lib/shared-tree/treeCheckout.d.ts +10 -1
  423. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  424. package/lib/shared-tree/treeCheckout.js +47 -3
  425. package/lib/shared-tree/treeCheckout.js.map +1 -1
  426. package/lib/shared-tree/treeView.d.ts.map +1 -1
  427. package/lib/shared-tree/treeView.js +4 -0
  428. package/lib/shared-tree/treeView.js.map +1 -1
  429. package/lib/shared-tree-core/branch.d.ts +6 -0
  430. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  431. package/lib/shared-tree-core/branch.js +3 -0
  432. package/lib/shared-tree-core/branch.js.map +1 -1
  433. package/lib/shared-tree-core/sharedTreeCore.d.ts +8 -6
  434. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  435. package/lib/shared-tree-core/sharedTreeCore.js +273 -210
  436. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  437. package/lib/simple-tree/arrayNode.d.ts +4 -0
  438. package/lib/simple-tree/arrayNode.d.ts.map +1 -1
  439. package/lib/simple-tree/arrayNode.js +39 -22
  440. package/lib/simple-tree/arrayNode.js.map +1 -1
  441. package/lib/simple-tree/index.d.ts +3 -3
  442. package/lib/simple-tree/index.d.ts.map +1 -1
  443. package/lib/simple-tree/index.js +1 -1
  444. package/lib/simple-tree/index.js.map +1 -1
  445. package/lib/simple-tree/leafNodeSchema.d.ts +22 -1
  446. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  447. package/lib/simple-tree/leafNodeSchema.js +1 -1
  448. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  449. package/lib/simple-tree/mapNode.d.ts.map +1 -1
  450. package/lib/simple-tree/mapNode.js.map +1 -1
  451. package/lib/simple-tree/objectNode.d.ts.map +1 -1
  452. package/lib/simple-tree/objectNode.js +3 -2
  453. package/lib/simple-tree/objectNode.js.map +1 -1
  454. package/lib/simple-tree/proxies.d.ts.map +1 -1
  455. package/lib/simple-tree/proxies.js +9 -25
  456. package/lib/simple-tree/proxies.js.map +1 -1
  457. package/lib/simple-tree/proxyBinding.d.ts +4 -0
  458. package/lib/simple-tree/proxyBinding.d.ts.map +1 -1
  459. package/lib/simple-tree/proxyBinding.js +19 -0
  460. package/lib/simple-tree/proxyBinding.js.map +1 -1
  461. package/lib/simple-tree/schemaFactory.d.ts +16 -1
  462. package/lib/simple-tree/schemaFactory.d.ts.map +1 -1
  463. package/lib/simple-tree/schemaFactory.js +30 -3
  464. package/lib/simple-tree/schemaFactory.js.map +1 -1
  465. package/lib/simple-tree/schemaTypes.d.ts +36 -1
  466. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  467. package/lib/simple-tree/schemaTypes.js.map +1 -1
  468. package/lib/simple-tree/toFlexSchema.d.ts +2 -2
  469. package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
  470. package/lib/simple-tree/toFlexSchema.js +3 -2
  471. package/lib/simple-tree/toFlexSchema.js.map +1 -1
  472. package/lib/simple-tree/tree.d.ts +4 -1
  473. package/lib/simple-tree/tree.d.ts.map +1 -1
  474. package/lib/simple-tree/tree.js +44 -0
  475. package/lib/simple-tree/tree.js.map +1 -1
  476. package/lib/simple-tree/treeNodeApi.d.ts +2 -75
  477. package/lib/simple-tree/treeNodeApi.d.ts.map +1 -1
  478. package/lib/simple-tree/treeNodeApi.js +20 -28
  479. package/lib/simple-tree/treeNodeApi.js.map +1 -1
  480. package/lib/simple-tree/treeNodeKernel.d.ts +26 -0
  481. package/lib/simple-tree/treeNodeKernel.d.ts.map +1 -0
  482. package/lib/simple-tree/treeNodeKernel.js +79 -0
  483. package/lib/simple-tree/treeNodeKernel.js.map +1 -0
  484. package/lib/simple-tree/types.d.ts +95 -3
  485. package/lib/simple-tree/types.d.ts.map +1 -1
  486. package/lib/simple-tree/types.js +121 -22
  487. package/lib/simple-tree/types.js.map +1 -1
  488. package/lib/util/breakable.d.ts +83 -0
  489. package/lib/util/breakable.d.ts.map +1 -0
  490. package/lib/util/breakable.js +171 -0
  491. package/lib/util/breakable.js.map +1 -0
  492. package/lib/util/index.d.ts +3 -2
  493. package/lib/util/index.d.ts.map +1 -1
  494. package/lib/util/index.js +3 -2
  495. package/lib/util/index.js.map +1 -1
  496. package/lib/util/nestedMap.d.ts +17 -3
  497. package/lib/util/nestedMap.d.ts.map +1 -1
  498. package/lib/util/nestedMap.js +19 -0
  499. package/lib/util/nestedMap.js.map +1 -1
  500. package/lib/util/utils.d.ts +7 -0
  501. package/lib/util/utils.d.ts.map +1 -1
  502. package/lib/util/utils.js +13 -0
  503. package/lib/util/utils.js.map +1 -1
  504. package/package.json +29 -27
  505. package/src/core/forest/editableForest.ts +25 -4
  506. package/src/core/index.ts +2 -0
  507. package/src/core/rebase/index.ts +2 -0
  508. package/src/core/rebase/types.ts +17 -0
  509. package/src/core/tree/anchorSet.ts +14 -0
  510. package/src/core/tree/detachedFieldIndex.ts +217 -35
  511. package/src/core/tree/detachedFieldIndexCodec.ts +17 -8
  512. package/src/core/tree/detachedFieldIndexFormat.ts +1 -1
  513. package/src/core/tree/detachedFieldIndexTypes.ts +41 -5
  514. package/src/core/tree/index.ts +2 -1
  515. package/src/core/tree/visitDelta.ts +58 -16
  516. package/src/core/tree/visitorUtils.ts +7 -4
  517. package/src/events/events.ts +4 -2
  518. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +1 -1
  519. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +1 -0
  520. package/src/feature-libraries/editableTreeBinder.ts +1 -1
  521. package/src/feature-libraries/flex-map-tree/mapTreeNode.ts +1 -95
  522. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +0 -62
  523. package/src/feature-libraries/flex-tree/index.ts +7 -2
  524. package/src/feature-libraries/flex-tree/lazyEntity.ts +0 -3
  525. package/src/feature-libraries/flex-tree/lazyField.ts +15 -47
  526. package/src/feature-libraries/flex-tree/lazyNode.ts +1 -48
  527. package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -0
  528. package/src/feature-libraries/index.ts +4 -2
  529. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +18 -0
  530. package/src/feature-libraries/modular-schema/discrepancies.ts +395 -0
  531. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +10 -2
  532. package/src/feature-libraries/modular-schema/genericFieldKind.ts +3 -0
  533. package/src/feature-libraries/modular-schema/index.ts +2 -0
  534. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +81 -35
  535. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +1521 -444
  536. package/src/feature-libraries/modular-schema/modularChangeFormat.ts +2 -0
  537. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +51 -0
  538. package/src/feature-libraries/node-key/index.ts +0 -1
  539. package/src/feature-libraries/object-forest/objectForest.ts +7 -3
  540. package/src/feature-libraries/optional-field/optionalField.ts +1 -0
  541. package/src/feature-libraries/sequence-field/index.ts +0 -2
  542. package/src/feature-libraries/sequence-field/invert.ts +1 -1
  543. package/src/feature-libraries/sequence-field/rebase.ts +7 -1
  544. package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +2 -1
  545. package/src/feature-libraries/sequence-field/utils.ts +37 -85
  546. package/src/feature-libraries/typed-schema/typedTreeSchema.ts +10 -0
  547. package/src/index.ts +0 -1
  548. package/src/packageVersion.ts +1 -1
  549. package/src/shared-tree/schematizingTreeView.ts +6 -2
  550. package/src/shared-tree/sharedTree.ts +12 -1
  551. package/src/shared-tree/sharedTreeChangeEnricher.ts +1 -1
  552. package/src/shared-tree/treeApi.ts +1 -1
  553. package/src/shared-tree/treeCheckout.ts +60 -5
  554. package/src/shared-tree/treeView.ts +5 -0
  555. package/src/shared-tree-core/branch.ts +10 -0
  556. package/src/shared-tree-core/sharedTreeCore.ts +25 -6
  557. package/src/simple-tree/arrayNode.ts +50 -23
  558. package/src/simple-tree/index.ts +3 -3
  559. package/src/simple-tree/leafNodeSchema.ts +1 -1
  560. package/src/simple-tree/mapNode.ts +2 -2
  561. package/src/simple-tree/objectNode.ts +9 -3
  562. package/src/simple-tree/proxies.ts +10 -33
  563. package/src/simple-tree/proxyBinding.ts +23 -0
  564. package/src/simple-tree/schemaFactory.ts +37 -2
  565. package/src/simple-tree/schemaTypes.ts +36 -1
  566. package/src/simple-tree/toFlexSchema.ts +5 -4
  567. package/src/simple-tree/tree.ts +68 -4
  568. package/src/simple-tree/treeNodeApi.ts +29 -111
  569. package/src/simple-tree/treeNodeKernel.ts +91 -0
  570. package/src/simple-tree/types.ts +292 -31
  571. package/src/util/breakable.ts +214 -0
  572. package/src/util/index.ts +11 -0
  573. package/src/util/nestedMap.ts +33 -3
  574. package/src/util/utils.ts +17 -0
  575. package/dist/feature-libraries/node-key/nodeKeyIndex.d.ts +0 -41
  576. package/dist/feature-libraries/node-key/nodeKeyIndex.d.ts.map +0 -1
  577. package/dist/feature-libraries/node-key/nodeKeyIndex.js +0 -101
  578. package/dist/feature-libraries/node-key/nodeKeyIndex.js.map +0 -1
  579. package/lib/feature-libraries/node-key/nodeKeyIndex.d.ts +0 -41
  580. package/lib/feature-libraries/node-key/nodeKeyIndex.d.ts.map +0 -1
  581. package/lib/feature-libraries/node-key/nodeKeyIndex.js +0 -97
  582. package/lib/feature-libraries/node-key/nodeKeyIndex.js.map +0 -1
  583. package/src/feature-libraries/node-key/nodeKeyIndex.ts +0 -132
package/.eslintrc.cjs CHANGED
@@ -70,6 +70,13 @@ module.exports = {
70
70
  "@typescript-eslint/explicit-function-return-type": "off",
71
71
  },
72
72
  },
73
+ // TODO: Remove this override once this config has been updated to extend at least the "recommended" base config.
74
+ {
75
+ files: ["src/test/**/*.generated.ts*"],
76
+ rules: {
77
+ "@typescript-eslint/no-explicit-any": ["off"],
78
+ },
79
+ },
73
80
  ],
74
81
  settings: {
75
82
  "import/extensions": [".ts", ".tsx", ".d.ts", ".js", ".jsx"],
@@ -11,7 +11,14 @@
11
11
  ],
12
12
  "settings": {
13
13
  "search.followSymlinks": false,
14
- "typescript.preferences.autoImportFileExcludePatterns": ["**/dist/**"],
15
- "typescript.preferences.importModuleSpecifier": "project-relative"
14
+ "typescript.preferences.autoImportFileExcludePatterns": [
15
+ "**/dist/**",
16
+ "**/lib/**",
17
+ // Avoid suggesting autoimports for the 'previous' version packages which are used for typetesting.
18
+ "**/node_modules/**/@fluid*/*-previous",
19
+ "**/node_modules/**/@fluid*/*-previous/*"
20
+ ],
21
+ "typescript.preferences.importModuleSpecifier": "project-relative",
22
+ "typescript.preferences.preferTypeOnlyAutoImports": true
16
23
  }
17
24
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # @fluidframework/tree
2
2
 
3
+ ## 2.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Detect arrayNode iterator invalidation ([#21760](https://github.com/microsoft/FluidFramework/pull/21760)) [6fd320c385](https://github.com/microsoft/FluidFramework/commit/6fd320c38561e272a1acaf4248f47fc386c650e4)
8
+
9
+ When `arrayNode`s are edited concurrently during iteration, an error will be thrown.
10
+
11
+ - tree: Improved performance for accessing identifiers in shortId API ([#21944](https://github.com/microsoft/FluidFramework/pull/21944)) [6b4cf26d9c](https://github.com/microsoft/FluidFramework/commit/6b4cf26d9cc14c1a36cf07fd7408f1d1227e373a)
12
+
13
+ Users should see improved performance when calling the `Tree.shortId` API. Identifier field keys are now cached in the schema for faster access.
14
+
15
+ - ✨ New! Debug visualizers for TreeNodes in NodeJS and browsers ([#21895](https://github.com/microsoft/FluidFramework/pull/21895)) [0d197fefec](https://github.com/microsoft/FluidFramework/commit/0d197fefec852df2911151217ac1b71cde528a70)
16
+
17
+ TreeNodes now have custom debug visualizers to improve the debug experience in NodeJS and in browsers. Note that custom formatters must be enabled in the browser developer tools for that visualizer to be used.
18
+
19
+ - Using "delete" on tree fields now throws an error instead of not working correctly ([#21609](https://github.com/microsoft/FluidFramework/pull/21609)) [416849b1fd](https://github.com/microsoft/FluidFramework/commit/416849b1fda029870ee1c1742100de4f8dde45b7)
20
+
21
+ TypeScript allows `delete` on object node optional fields if the `exactOptionalPropertyTypes` tsconfig setting is not
22
+ enabled. This does not work correctly at runtime and now produces an informative error.
23
+
24
+ - SharedTree content that is removed is now deleted ([#21372](https://github.com/microsoft/FluidFramework/pull/21372)) [a6e412159a](https://github.com/microsoft/FluidFramework/commit/a6e412159a4df6aceb84aac35288b108a5351905)
25
+
26
+ SharedTree now supports garbage collection so that removed content is not retained forever.
27
+ This is an internal change and users of SharedTree won't need to adapt any existing code.
28
+
29
+ This change could cause errors with cross-version collaboration where an older client does not send data that a newer
30
+ version may need. In this case, a "refresher data not found" error will be thrown.
31
+
32
+ - Improved error reporting ([#21940](https://github.com/microsoft/FluidFramework/pull/21940)) [3b8a366dd1](https://github.com/microsoft/FluidFramework/commit/3b8a366dd15660f9c916832040faf772534c0755)
33
+
34
+ Several cases of invalid usage patterns for tree APIs have gained improved error reporting, as well as improved documentation on the APIs detailing what usage is supported.
35
+ These improvements include:
36
+
37
+ - Unsupported usages of schema classes: using more than one schema class derived from a single SchemaFactory generated base class. This used to hit internal asserts, but now has a descriptive user-facing UsageError. Most of this work was done in [9fb3dcf](https://github.com/microsoft/FluidFramework/commit/9fb3dcf491a7f0d66f4abbdc64ab97ccabef4707).
38
+ - Improved detection of when prior exception may have left SharedTree in an invalid state.
39
+ These cases now report a UsageError including a reference to the prior exception. This was mainly done in [9fb3dcf](https://github.com/microsoft/FluidFramework/commit/9fb3dcf491a7f0d66f4abbdc64ab97ccabef4707) and [b77d530](https://github.com/microsoft/FluidFramework/commit/b77d530b9252201c40a90d1a2a6315f76f1a4a4b).
40
+
3
41
  ## 2.0.0-rc.5.0.0
4
42
 
5
43
  ### Minor Changes
package/README.md CHANGED
@@ -7,7 +7,7 @@ The contents of this package are also reported as part of the [`fluid-framework`
7
7
  [SharedTree Philosophy](./docs/SharedTree%20Philosophy.md) covers the goals of the SharedTree project,
8
8
  and some of the implications of those goals for developers working on this package.
9
9
 
10
- <!-- AUTO-GENERATED-CONTENT:START (README_DEPENDENCY_GUIDELINES_SECTION:includeHeading=TRUE) -->
10
+ <!-- AUTO-GENERATED-CONTENT:START (LIBRARY_PACKAGE_README_HEADER) -->
11
11
 
12
12
  <!-- prettier-ignore-start -->
13
13
  <!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
@@ -20,14 +20,13 @@ library consumers should always prefer `^`.
20
20
 
21
21
  If using any of Fluid Framework's unstable APIs (for example, its `beta` APIs), we recommend using a more constrained version range, such as `~`.
22
22
 
23
- <!-- prettier-ignore-end -->
24
-
25
- <!-- AUTO-GENERATED-CONTENT:END -->
23
+ ## Installation
26
24
 
27
- <!-- AUTO-GENERATED-CONTENT:START (README_IMPORT_INSTRUCTIONS:includeHeading=TRUE) -->
25
+ To get started, install the package by running the following command:
28
26
 
29
- <!-- prettier-ignore-start -->
30
- <!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
27
+ ```bash
28
+ npm i @fluidframework/tree
29
+ ```
31
30
 
32
31
  ## Importing from this package
33
32
 
@@ -38,6 +37,10 @@ To access the `public` ([SemVer](https://semver.org/)) APIs, import via `@fluidf
38
37
 
39
38
  To access the `beta` APIs, import via `@fluidframework/tree/beta`.
40
39
 
40
+ ## API Documentation
41
+
42
+ API documentation for **@fluidframework/tree** is available at <https://fluidframework.com/docs/apis/tree>.
43
+
41
44
  <!-- prettier-ignore-end -->
42
45
 
43
46
  <!-- AUTO-GENERATED-CONTENT:END -->
@@ -47,8 +50,8 @@ To access the `beta` APIs, import via `@fluidframework/tree/beta`.
47
50
  Notable consideration that early adopters should be wary of:
48
51
 
49
52
  - The persisted format is stable such that documents created with released versions 2.0.0 or greater of this package are fully supported long term.
50
- - SharedTree currently has unbounded memory growth:
51
- - Removed content is retained in memory and persisted in the document at rest ([fix](https://github.com/microsoft/FluidFramework/pull/21372)).
53
+ - In versions prior to 2.1.0, SharedTree had unbounded memory growth:
54
+ - Removed content was retained in memory and persisted in the document at rest ([fix](https://github.com/microsoft/FluidFramework/pull/21372)). This was fixed in version 2.1.0.
52
55
  - All range changes are atomized.
53
56
  This means that, when inserting/removing/moving multiple contiguous nodes the edit is split up into separate single node edits.
54
57
  This can impact the merge behavior of these edits, as well as the performance of large array edits.
@@ -418,14 +421,54 @@ Applications should have a domain model that can mix tree nodes with custom impl
418
421
  Custom implementations should probably be able to be projections of flex trees, the forest content (via cursors), and updated via either regeneration from the input, or updated by a delta.
419
422
  This is important for performance/scalability and might be how we do virtualization (maybe subtrees that aren't downloaded are just one custom representation?).
420
423
 
421
- <!-- AUTO-GENERATED-CONTENT:START (LIBRARY_PACKAGE_README:scripts=FALSE&installation=FALSE&importInstructions=FALSE) -->
424
+ <!-- AUTO-GENERATED-CONTENT:START (LIBRARY_PACKAGE_README_FOOTER) -->
422
425
 
423
426
  <!-- prettier-ignore-start -->
424
427
  <!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
425
428
 
426
- ## API Documentation
429
+ ## Minimum Client Requirements
427
430
 
428
- API documentation for **@fluidframework/tree** is available at <https://fluidframework.com/docs/apis/tree>.
431
+ These are the platform requirements for the current version of Fluid Framework Client Packages.
432
+ These requirements err on the side of being too strict since within a major version they can be relaxed over time, but not made stricter.
433
+ For Long Term Support (LTS) versions this can require supporting these platforms for several years.
434
+
435
+ It is likely that other configurations will work, but they are not supported: if they stop working, we do not consider that a bug.
436
+ If you would benefit from support for something not listed here, file an issue and the product team will evaluate your request.
437
+ When making such a request please include if the configuration already works (and thus the request is just that it becomes officially supported), or if changes are required to get it working.
438
+
439
+ ### Supported Runtimes
440
+
441
+ - NodeJs ^20.10.0 except that we will drop support for it [when NodeJs 20 loses its upstream support on 2026-04-30](https://github.com/nodejs/release#release-schedule), and will support a newer LTS version of NodeJS (22) at least 1 year before 20 is end-of-life. This same policy applies to NodeJS 22 when it is end of life (2027-04-30).
442
+ - Modern browsers supporting the es2022 standard library: in response to asks we can add explicit support for using babel to polyfill to target specific standards or runtimes (meaning we can avoid/remove use of things that don't polyfill robustly, but otherwise target modern standards).
443
+
444
+ ### Supported Tools
445
+
446
+ - TypeScript 5.4:
447
+ - All [`strict`](https://www.typescriptlang.org/tsconfig) options are supported.
448
+ - [`strictNullChecks`](https://www.typescriptlang.org/tsconfig) is required.
449
+ - [Configuration options deprecated in 5.0](https://github.com/microsoft/TypeScript/issues/51909) are not supported.
450
+ - `exactOptionalPropertyTypes` is currently not fully supported.
451
+ If used, narrowing members of Fluid Framework types types using `in`, `Reflect.has`, `Object.hasOwn` or `Object.prototype.hasOwnProperty` should be avoided as they may incorrectly exclude `undefined` from the possible values in some cases.
452
+ - [webpack](https://webpack.js.org/) 5
453
+ - We are not intending to be prescriptive about what bundler to use.
454
+ Other bundlers which can handle ES Modules should work, but webpack is the only one we actively test.
455
+
456
+ ### Module Resolution
457
+
458
+ [`Node16`, `NodeNext`, or `Bundler`](https://www.typescriptlang.org/tsconfig#moduleResolution) resolution should be used with TypeScript compilerOptions to follow the [Node.js v12+ ESM Resolution and Loading algorithm](https://nodejs.github.io/nodejs.dev/en/api/v20/esm/#resolution-and-loading-algorithm).
459
+ Node10 resolution is not supported as it does not support Fluid Framework's API structuring pattern that is used to distinguish stable APIs from those that are in development.
460
+
461
+ ### Module Formats
462
+
463
+ - ES Modules:
464
+ ES Modules are the preferred way to consume our client packages (including in NodeJs) and consuming our client packages from ES Modules is fully supported.
465
+ - CommonJs:
466
+ Consuming our client packages as CommonJs is supported only in NodeJS and only for the cases listed below.
467
+ This is done to accommodate some workflows without good ES Module support.
468
+ If you have a workflow you would like included in this list, file an issue.
469
+ Once this list of workflows motivating CommonJS support is empty, we may drop support for CommonJS one year after notice of the change is posted here.
470
+
471
+ - Testing with Jest (which lacks [stable ESM support](https://jestjs.io/docs/ecmascript-modules) due to [unstable APIs in NodeJs](https://github.com/nodejs/node/issues/37648))
429
472
 
430
473
  ## Contribution Guidelines
431
474
 
@@ -377,6 +377,7 @@ interface TreeArrayNodeBase<out T, in TNew, in TMoveFrom> extends ReadonlyArray<
377
377
  moveToStart(sourceIndex: number, source: TMoveFrom): void;
378
378
  removeAt(index: number): void;
379
379
  removeRange(start?: number, end?: number): void;
380
+ values(): IterableIterator<T>;
380
381
  }
381
382
 
382
383
  // @public @sealed
@@ -430,7 +431,7 @@ export interface TreeNodeApi {
430
431
  parent(node: TreeNode): TreeNode | undefined;
431
432
  schema<T extends TreeNode | TreeLeafValue>(node: T): TreeNodeSchema<string, NodeKind, unknown, T>;
432
433
  shortId(node: TreeNode): number | string | undefined;
433
- readonly status: (node: TreeNode) => TreeStatus;
434
+ status(node: TreeNode): TreeStatus;
434
435
  }
435
436
 
436
437
  // @public
@@ -377,6 +377,7 @@ interface TreeArrayNodeBase<out T, in TNew, in TMoveFrom> extends ReadonlyArray<
377
377
  moveToStart(sourceIndex: number, source: TMoveFrom): void;
378
378
  removeAt(index: number): void;
379
379
  removeRange(start?: number, end?: number): void;
380
+ values(): IterableIterator<T>;
380
381
  }
381
382
 
382
383
  // @public @sealed
@@ -430,7 +431,7 @@ export interface TreeNodeApi {
430
431
  parent(node: TreeNode): TreeNode | undefined;
431
432
  schema<T extends TreeNode | TreeLeafValue>(node: T): TreeNodeSchema<string, NodeKind, unknown, T>;
432
433
  shortId(node: TreeNode): number | string | undefined;
433
- readonly status: (node: TreeNode) => TreeStatus;
434
+ status(node: TreeNode): TreeStatus;
434
435
  }
435
436
 
436
437
  // @public
@@ -377,6 +377,7 @@ interface TreeArrayNodeBase<out T, in TNew, in TMoveFrom> extends ReadonlyArray<
377
377
  moveToStart(sourceIndex: number, source: TMoveFrom): void;
378
378
  removeAt(index: number): void;
379
379
  removeRange(start?: number, end?: number): void;
380
+ values(): IterableIterator<T>;
380
381
  }
381
382
 
382
383
  // @public @sealed
@@ -430,7 +431,7 @@ export interface TreeNodeApi {
430
431
  parent(node: TreeNode): TreeNode | undefined;
431
432
  schema<T extends TreeNode | TreeLeafValue>(node: T): TreeNodeSchema<string, NodeKind, unknown, T>;
432
433
  shortId(node: TreeNode): number | string | undefined;
433
- readonly status: (node: TreeNode) => TreeStatus;
434
+ status(node: TreeNode): TreeStatus;
434
435
  }
435
436
 
436
437
  // @public
package/beta.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  /*
7
7
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
- * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
8
+ * Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
9
9
  */
10
10
 
11
11
  export * from "./lib/beta.js";
package/dist/beta.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  /*
7
7
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
- * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
8
+ * Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
9
9
  */
10
10
 
11
11
  export {
@@ -25,13 +25,16 @@ export interface IEditableForest extends IForestSubscription {
25
25
  acquireVisitor(): DeltaVisitor;
26
26
  }
27
27
  /**
28
- * Sets the contents of the forest via delta.
29
- * Requires the fores starts empty.
28
+ * Initializes the given forest with the given content.
29
+ * @remarks The forest must be empty when this function is called.
30
+ * This does not perform an edit in the typical sense.
31
+ * Instead, it creates a delta expressing a creation and insertion of the `content` under the {@link rootFieldKey}, and then applies the delta to the forest.
32
+ * If `visitAnchors` is enabled, then the delta will also be applied to the forest's {@link AnchorSet} (in which case there must be no existing anchors when this function is called).
30
33
  *
31
34
  * @remarks
32
35
  * This does not perform an edit: it updates the forest content as if there was an edit that did that.
33
36
  */
34
- export declare function initializeForest(forest: IEditableForest, content: readonly ITreeCursorSynchronous[], revisionTagCodec: RevisionTagCodec, idCompressor: IIdCompressor): void;
37
+ export declare function initializeForest(forest: IEditableForest, content: readonly ITreeCursorSynchronous[], revisionTagCodec: RevisionTagCodec, idCompressor: IIdCompressor, visitAnchors?: boolean): void;
35
38
  /**
36
39
  * Ways to refer to a node in an IEditableForest.
37
40
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"editableForest.d.ts","sourceRoot":"","sources":["../../../src/core/forest/editableForest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EACN,KAAK,MAAM,EAEX,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAI3B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC3D;;;;;;;;;OASG;IACH,cAAc,IAAI,YAAY,CAAC;CAC/B;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC/B,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,SAAS,sBAAsB,EAAE,EAC1C,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,aAAa,GACzB,IAAI,CAIN;AAID;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,uBAAuB,GAAG,MAAM,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,aAAa,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,GAAG,aAAa,GAAG,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;GAGG;AACH,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;CAChC"}
@@ -8,16 +8,28 @@ exports.isFieldLocation = exports.initializeForest = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const index_js_1 = require("../tree/index.js");
10
10
  /**
11
- * Sets the contents of the forest via delta.
12
- * Requires the fores starts empty.
11
+ * Initializes the given forest with the given content.
12
+ * @remarks The forest must be empty when this function is called.
13
+ * This does not perform an edit in the typical sense.
14
+ * Instead, it creates a delta expressing a creation and insertion of the `content` under the {@link rootFieldKey}, and then applies the delta to the forest.
15
+ * If `visitAnchors` is enabled, then the delta will also be applied to the forest's {@link AnchorSet} (in which case there must be no existing anchors when this function is called).
13
16
  *
14
17
  * @remarks
15
18
  * This does not perform an edit: it updates the forest content as if there was an edit that did that.
16
19
  */
17
- function initializeForest(forest, content, revisionTagCodec, idCompressor) {
20
+ function initializeForest(forest, content, revisionTagCodec, idCompressor, visitAnchors = false) {
18
21
  (0, internal_1.assert)(forest.isEmpty, 0x747 /* forest must be empty */);
19
22
  const delta = (0, index_js_1.deltaForRootInitialization)(content);
20
- (0, index_js_1.applyDelta)(delta, forest, (0, index_js_1.makeDetachedFieldIndex)("init", revisionTagCodec, idCompressor));
23
+ let visitor = forest.acquireVisitor();
24
+ if (visitAnchors) {
25
+ (0, internal_1.assert)(forest.anchors.isEmpty(), 0x9b7 /* anchor set must be empty */);
26
+ const anchorVisitor = forest.anchors.acquireVisitor();
27
+ visitor = (0, index_js_1.combineVisitors)([visitor, anchorVisitor], [anchorVisitor]);
28
+ }
29
+ // any detached trees built here are immediately attached so the revision used here doesn't matter
30
+ // we use a dummy revision to make correctness checks in the detached field index easier
31
+ (0, index_js_1.visitDelta)(delta, visitor, (0, index_js_1.makeDetachedFieldIndex)("init", revisionTagCodec, idCompressor), 0);
32
+ visitor.free();
21
33
  }
22
34
  exports.initializeForest = initializeForest;
23
35
  function isFieldLocation(range) {
@@ -1 +1 @@
1
- {"version":3,"file":"editableForest.js","sourceRoot":"","sources":["../../../src/core/forest/editableForest.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAI7D,+CAS0B;AAuB1B;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAC/B,MAAuB,EACvB,OAA0C,EAC1C,gBAAkC,EAClC,YAA2B;IAE3B,IAAA,iBAAM,EAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,0BAA0B,CAAC,CAAC;IACzD,MAAM,KAAK,GAAc,IAAA,qCAA0B,EAAC,OAAO,CAAC,CAAC;IAC7D,IAAA,qBAAU,EAAC,KAAK,EAAE,MAAM,EAAE,IAAA,iCAAsB,EAAC,MAAM,EAAE,gBAAgB,EAAE,YAAY,CAAC,CAAC,CAAC;AAC3F,CAAC;AATD,4CASC;AAkBD,SAAgB,eAAe,CAAC,KAAoC;IACnE,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AAClC,CAAC;AAFD,0CAEC","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\";\n\nimport type { RevisionTagCodec } from \"../rebase/index.js\";\nimport type { FieldKey } from \"../schema-stored/index.js\";\nimport {\n\ttype Anchor,\n\ttype DeltaRoot,\n\ttype DeltaVisitor,\n\ttype DetachedField,\n\ttype ITreeCursorSynchronous,\n\tapplyDelta,\n\tdeltaForRootInitialization,\n\tmakeDetachedFieldIndex,\n} from \"../tree/index.js\";\n\nimport type { IForestSubscription, ITreeSubscriptionCursor } from \"./forest.js\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\n/**\n * Editing APIs.\n * @internal\n */\nexport interface IEditableForest extends IForestSubscription {\n\t/**\n\t * Provides a visitor that can be used to mutate the forest.\n\t *\n\t * @returns a visitor that can be used to mutate the forest.\n\t *\n\t * @remarks\n\t * Mutating the forest does NOT update anchors.\n\t * The visitor must be released after use by calling {@link DeltaVisitor.free} on it.\n\t * It is invalid to acquire a visitor without releasing the previous one.\n\t */\n\tacquireVisitor(): DeltaVisitor;\n}\n\n/**\n * Sets the contents of the forest via delta.\n * Requires the fores starts empty.\n *\n * @remarks\n * This does not perform an edit: it updates the forest content as if there was an edit that did that.\n */\nexport function initializeForest(\n\tforest: IEditableForest,\n\tcontent: readonly ITreeCursorSynchronous[],\n\trevisionTagCodec: RevisionTagCodec,\n\tidCompressor: IIdCompressor,\n): void {\n\tassert(forest.isEmpty, 0x747 /* forest must be empty */);\n\tconst delta: DeltaRoot = deltaForRootInitialization(content);\n\tapplyDelta(delta, forest, makeDetachedFieldIndex(\"init\", revisionTagCodec, idCompressor));\n}\n\n// TODO: Types below here may be useful for input into edit building APIs, but are no longer used here directly.\n\n/**\n * Ways to refer to a node in an IEditableForest.\n * @internal\n */\nexport type ForestLocation = ITreeSubscriptionCursor | Anchor;\n\n/**\n * @internal\n */\nexport interface TreeLocation {\n\treadonly range: FieldLocation | DetachedField;\n\treadonly index: number;\n}\n\nexport function isFieldLocation(range: FieldLocation | DetachedField): range is FieldLocation {\n\treturn typeof range === \"object\";\n}\n\n/**\n * Location of a field within a tree that is not a detached/root field.\n * @internal\n */\nexport interface FieldLocation {\n\treadonly key: FieldKey;\n\treadonly parent: ForestLocation;\n}\n"]}
1
+ {"version":3,"file":"editableForest.js","sourceRoot":"","sources":["../../../src/core/forest/editableForest.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAA6D;AAI7D,+CAU0B;AAuB1B;;;;;;;;;GASG;AACH,SAAgB,gBAAgB,CAC/B,MAAuB,EACvB,OAA0C,EAC1C,gBAAkC,EAClC,YAA2B,EAC3B,YAAY,GAAG,KAAK;IAEpB,IAAA,iBAAM,EAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,0BAA0B,CAAC,CAAC;IACzD,MAAM,KAAK,GAAc,IAAA,qCAA0B,EAAC,OAAO,CAAC,CAAC;IAC7D,IAAI,OAAO,GAAG,MAAM,CAAC,cAAc,EAAE,CAAC;IACtC,IAAI,YAAY,EAAE,CAAC;QAClB,IAAA,iBAAM,EAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,8BAA8B,CAAC,CAAC;QACvE,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;QACtD,OAAO,GAAG,IAAA,0BAAe,EAAC,CAAC,OAAO,EAAE,aAAa,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,kGAAkG;IAClG,wFAAwF;IACxF,IAAA,qBAAU,EACT,KAAK,EACL,OAAO,EACP,IAAA,iCAAsB,EAAC,MAAM,EAAE,gBAAgB,EAAE,YAAY,CAAC,EAC9D,CAA6B,CAC7B,CAAC;IACF,OAAO,CAAC,IAAI,EAAE,CAAC;AAChB,CAAC;AAzBD,4CAyBC;AAkBD,SAAgB,eAAe,CAAC,KAAoC;IACnE,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AAClC,CAAC;AAFD,0CAEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { SessionSpaceCompressedId } from \"@fluidframework/id-compressor\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport type { RevisionTagCodec } from \"../rebase/index.js\";\nimport type { FieldKey } from \"../schema-stored/index.js\";\nimport {\n\ttype Anchor,\n\ttype DeltaRoot,\n\ttype DeltaVisitor,\n\ttype DetachedField,\n\ttype ITreeCursorSynchronous,\n\tcombineVisitors,\n\tdeltaForRootInitialization,\n\tmakeDetachedFieldIndex,\n\tvisitDelta,\n} from \"../tree/index.js\";\n\nimport type { IForestSubscription, ITreeSubscriptionCursor } from \"./forest.js\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\n/**\n * Editing APIs.\n * @internal\n */\nexport interface IEditableForest extends IForestSubscription {\n\t/**\n\t * Provides a visitor that can be used to mutate the forest.\n\t *\n\t * @returns a visitor that can be used to mutate the forest.\n\t *\n\t * @remarks\n\t * Mutating the forest does NOT update anchors.\n\t * The visitor must be released after use by calling {@link DeltaVisitor.free} on it.\n\t * It is invalid to acquire a visitor without releasing the previous one.\n\t */\n\tacquireVisitor(): DeltaVisitor;\n}\n\n/**\n * Initializes the given forest with the given content.\n * @remarks The forest must be empty when this function is called.\n * This does not perform an edit in the typical sense.\n * Instead, it creates a delta expressing a creation and insertion of the `content` under the {@link rootFieldKey}, and then applies the delta to the forest.\n * If `visitAnchors` is enabled, then the delta will also be applied to the forest's {@link AnchorSet} (in which case there must be no existing anchors when this function is called).\n *\n * @remarks\n * This does not perform an edit: it updates the forest content as if there was an edit that did that.\n */\nexport function initializeForest(\n\tforest: IEditableForest,\n\tcontent: readonly ITreeCursorSynchronous[],\n\trevisionTagCodec: RevisionTagCodec,\n\tidCompressor: IIdCompressor,\n\tvisitAnchors = false,\n): void {\n\tassert(forest.isEmpty, 0x747 /* forest must be empty */);\n\tconst delta: DeltaRoot = deltaForRootInitialization(content);\n\tlet visitor = forest.acquireVisitor();\n\tif (visitAnchors) {\n\t\tassert(forest.anchors.isEmpty(), 0x9b7 /* anchor set must be empty */);\n\t\tconst anchorVisitor = forest.anchors.acquireVisitor();\n\t\tvisitor = combineVisitors([visitor, anchorVisitor], [anchorVisitor]);\n\t}\n\n\t// any detached trees built here are immediately attached so the revision used here doesn't matter\n\t// we use a dummy revision to make correctness checks in the detached field index easier\n\tvisitDelta(\n\t\tdelta,\n\t\tvisitor,\n\t\tmakeDetachedFieldIndex(\"init\", revisionTagCodec, idCompressor),\n\t\t0 as SessionSpaceCompressedId,\n\t);\n\tvisitor.free();\n}\n\n// TODO: Types below here may be useful for input into edit building APIs, but are no longer used here directly.\n\n/**\n * Ways to refer to a node in an IEditableForest.\n * @internal\n */\nexport type ForestLocation = ITreeSubscriptionCursor | Anchor;\n\n/**\n * @internal\n */\nexport interface TreeLocation {\n\treadonly range: FieldLocation | DetachedField;\n\treadonly index: number;\n}\n\nexport function isFieldLocation(range: FieldLocation | DetachedField): range is FieldLocation {\n\treturn typeof range === \"object\";\n}\n\n/**\n * Location of a field within a tree that is not a detached/root field.\n * @internal\n */\nexport interface FieldLocation {\n\treadonly key: FieldKey;\n\treadonly parent: ForestLocation;\n}\n"]}
@@ -6,7 +6,7 @@ export { EmptyKey, type TreeType, type Value, type TreeValue, AnchorSet, type De
6
6
  export { TreeNavigationResult, type IEditableForest, type IForestSubscription, type TreeLocation, type FieldLocation, type ForestLocation, type ITreeSubscriptionCursor, ITreeSubscriptionCursorState, initializeForest, type FieldAnchor, moveToDetachedField, type ForestEvents, } from "./forest/index.js";
7
7
  export { type FieldKey, type TreeNodeSchemaIdentifier, type TreeFieldStoredSchema, ValueSchema, TreeNodeStoredSchema, type TreeStoredSchemaSubscription as TreeStoredSchemaSubscription, type MutableTreeStoredSchema, type FieldKindIdentifier, type FieldKindData, type TreeTypeSet, type TreeStoredSchema, TreeStoredSchemaRepository, schemaDataIsEmpty, type SchemaEvents, forbiddenFieldKindIdentifier, identifierFieldKindIdentifier, storedEmptyFieldSchema, type StoredSchemaCollection, schemaFormat, LeafNodeStoredSchema, ObjectNodeStoredSchema, MapNodeStoredSchema, toTreeNodeSchemaDataFormat, decodeFieldSchema, encodeFieldSchema, storedSchemaDecodeDispatcher, type ErasedTreeNodeSchemaDataFormat, type SchemaAndPolicy, Multiplicity, type SchemaPolicy, } from "./schema-stored/index.js";
8
8
  export { type ChangeFamily, type ChangeFamilyCodec, type ChangeEncodingContext, type ChangeFamilyEditor, EditBuilder, } from "./change-family/index.js";
9
- export { areEqualChangeAtomIds, makeChangeAtomId, asChangeAtomId, type ChangeRebaser, findAncestor, findCommonAncestor, type GraphCommit, CommitKind, type CommitMetadata, type RevisionTag, RevisionTagSchema, RevisionTagCodec, type ChangesetLocalId, type ChangeAtomId, type ChangeAtomIdMap, type TaggedChange, makeAnonChange, tagChange, mapTaggedChange, tagRollbackInverse, SessionIdSchema, mintCommit, rebaseBranch, type BranchRebaseResult, rebaseChange, rebaseChangeOverChanges, type RevisionMetadataSource, revisionMetadataSourceFromInfo, type RevisionInfo, type EncodedRevisionTag, type EncodedChangeAtomId, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, replaceAtomRevisions, replaceChange, type RebaseStats, type RebaseStatsWithDuration, } from "./rebase/index.js";
9
+ export { areEqualChangeAtomIds, makeChangeAtomId, asChangeAtomId, type ChangeRebaser, findAncestor, findCommonAncestor, type GraphCommit, CommitKind, type CommitMetadata, type RevisionTag, RevisionTagSchema, RevisionTagCodec, type ChangesetLocalId, type ChangeAtomId, type ChangeAtomIdMap, type TaggedChange, makeAnonChange, tagChange, mapTaggedChange, tagRollbackInverse, SessionIdSchema, mintCommit, rebaseBranch, type BranchRebaseResult, rebaseChange, rebaseChangeOverChanges, type RevisionMetadataSource, revisionMetadataSourceFromInfo, type RevisionInfo, type EncodedRevisionTag, type EncodedChangeAtomId, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, replaceAtomRevisions, getFromChangeAtomIdMap, setInChangeAtomIdMap, replaceChange, type RebaseStats, type RebaseStatsWithDuration, } from "./rebase/index.js";
10
10
  export { type Adapters, AdaptedViewSchema, Compatibility, type TreeAdapter, AllowedUpdateType, } from "./schema-view/index.js";
11
11
  export { type Revertible, RevertibleStatus } from "./revertible/index.js";
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,SAAS,EACd,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,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Y,EACjB,cAAc,EACd,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,KAAK,kBAAkB,EACvB,YAAY,EACZ,uBAAuB,EACvB,KAAK,sBAAsB,EAC3B,8BAA8B,EAC9B,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,uBAAuB,GAC5B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACN,KAAK,QAAQ,EACb,iBAAiB,EACjB,aAAa,EACb,KAAK,WAAW,EAChB,iBAAiB,GACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,KAAK,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,SAAS,EACd,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,KAAK,WAAW,EAChB,kBAAkB,EAClB,KAAK,sBAAsB,EAC3B,uBAAuB,EACvB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,QAAQ,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AAK,QAAQ,EACb,iBAAiB,EACjB,aAAa,EACb,KAAK,WAAW,EAChB,iBAAiB,GACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,KAAK,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -5,7 +5,7 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.ValueSchema = exports.moveToDetachedField = exports.initializeForest = exports.ITreeSubscriptionCursorState = exports.TreeNavigationResult = exports.aboveRootPlaceholder = exports.getDetachedFieldContainingPath = exports.DetachedFieldIndex = exports.isCursor = exports.CursorMarker = exports.inCursorNode = exports.inCursorField = exports.anchorSlot = exports.emptyDelta = exports.offsetDetachId = exports.makeDetachedNodeId = exports.isEmptyFieldChanges = exports.emptyFieldChanges = exports.deltaForRootInitialization = exports.forEachField = exports.forEachNodeInSubtree = exports.forEachNode = exports.compareFieldUpPaths = exports.topDownPath = exports.clonePath = exports.compareUpPaths = exports.getDescendant = exports.SparseNode = exports.setGenericTreeField = exports.makeDetachedFieldIndex = exports.applyDelta = exports.announceDelta = exports.combineVisitors = exports.visitDelta = exports.keyAsDetachedField = exports.detachedFieldAsKey = exports.iterateCursorField = exports.mapCursorFields = exports.mapCursorField = exports.getDepth = exports.genericTreeDeleteIfEmpty = exports.getGenericTreeField = exports.genericTreeKeys = exports.castCursorToSynchronous = exports.CursorLocationType = exports.rootField = exports.rootFieldKey = exports.EncodedJsonableTree = exports.AnchorSet = exports.EmptyKey = void 0;
8
- exports.RevertibleStatus = exports.AllowedUpdateType = exports.Compatibility = exports.AdaptedViewSchema = exports.replaceChange = exports.replaceAtomRevisions = exports.offsetChangeAtomId = exports.taggedOptAtomId = exports.taggedAtomId = exports.revisionMetadataSourceFromInfo = exports.rebaseChangeOverChanges = exports.rebaseChange = exports.rebaseBranch = exports.mintCommit = exports.SessionIdSchema = exports.tagRollbackInverse = exports.mapTaggedChange = exports.tagChange = exports.makeAnonChange = exports.RevisionTagCodec = exports.RevisionTagSchema = exports.CommitKind = exports.findCommonAncestor = exports.findAncestor = exports.asChangeAtomId = exports.makeChangeAtomId = exports.areEqualChangeAtomIds = exports.EditBuilder = exports.Multiplicity = exports.storedSchemaDecodeDispatcher = exports.encodeFieldSchema = exports.decodeFieldSchema = exports.toTreeNodeSchemaDataFormat = exports.MapNodeStoredSchema = exports.ObjectNodeStoredSchema = exports.LeafNodeStoredSchema = exports.schemaFormat = exports.storedEmptyFieldSchema = exports.identifierFieldKindIdentifier = exports.forbiddenFieldKindIdentifier = exports.schemaDataIsEmpty = exports.TreeStoredSchemaRepository = exports.TreeNodeStoredSchema = void 0;
8
+ exports.RevertibleStatus = exports.AllowedUpdateType = exports.Compatibility = exports.AdaptedViewSchema = exports.replaceChange = exports.setInChangeAtomIdMap = exports.getFromChangeAtomIdMap = exports.replaceAtomRevisions = exports.offsetChangeAtomId = exports.taggedOptAtomId = exports.taggedAtomId = exports.revisionMetadataSourceFromInfo = exports.rebaseChangeOverChanges = exports.rebaseChange = exports.rebaseBranch = exports.mintCommit = exports.SessionIdSchema = exports.tagRollbackInverse = exports.mapTaggedChange = exports.tagChange = exports.makeAnonChange = exports.RevisionTagCodec = exports.RevisionTagSchema = exports.CommitKind = exports.findCommonAncestor = exports.findAncestor = exports.asChangeAtomId = exports.makeChangeAtomId = exports.areEqualChangeAtomIds = exports.EditBuilder = exports.Multiplicity = exports.storedSchemaDecodeDispatcher = exports.encodeFieldSchema = exports.decodeFieldSchema = exports.toTreeNodeSchemaDataFormat = exports.MapNodeStoredSchema = exports.ObjectNodeStoredSchema = exports.LeafNodeStoredSchema = exports.schemaFormat = exports.storedEmptyFieldSchema = exports.identifierFieldKindIdentifier = exports.forbiddenFieldKindIdentifier = exports.schemaDataIsEmpty = exports.TreeStoredSchemaRepository = exports.TreeNodeStoredSchema = void 0;
9
9
  var index_js_1 = require("./tree/index.js");
10
10
  Object.defineProperty(exports, "EmptyKey", { enumerable: true, get: function () { return index_js_1.EmptyKey; } });
11
11
  Object.defineProperty(exports, "AnchorSet", { enumerable: true, get: function () { return index_js_1.AnchorSet; } });
@@ -99,6 +99,8 @@ Object.defineProperty(exports, "taggedAtomId", { enumerable: true, get: function
99
99
  Object.defineProperty(exports, "taggedOptAtomId", { enumerable: true, get: function () { return index_js_5.taggedOptAtomId; } });
100
100
  Object.defineProperty(exports, "offsetChangeAtomId", { enumerable: true, get: function () { return index_js_5.offsetChangeAtomId; } });
101
101
  Object.defineProperty(exports, "replaceAtomRevisions", { enumerable: true, get: function () { return index_js_5.replaceAtomRevisions; } });
102
+ Object.defineProperty(exports, "getFromChangeAtomIdMap", { enumerable: true, get: function () { return index_js_5.getFromChangeAtomIdMap; } });
103
+ Object.defineProperty(exports, "setInChangeAtomIdMap", { enumerable: true, get: function () { return index_js_5.setInChangeAtomIdMap; } });
102
104
  Object.defineProperty(exports, "replaceChange", { enumerable: true, get: function () { return index_js_5.replaceChange; } });
103
105
  var index_js_6 = require("./schema-view/index.js");
104
106
  Object.defineProperty(exports, "AdaptedViewSchema", { enumerable: true, get: function () { return index_js_6.AdaptedViewSchema; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,4CA6FyB;AA5FxB,oGAAA,QAAQ,OAAA;AAIR,qGAAA,SAAS,OAAA;AAmBT,+GAAA,mBAAmB,OAAA;AACnB,wGAAA,YAAY,OAAA;AACZ,qGAAA,SAAS,OAAA;AAET,8GAAA,kBAAkB,OAAA;AAElB,mHAAA,uBAAuB,OAAA;AAGvB,2GAAA,eAAe,OAAA;AACf,+GAAA,mBAAmB,OAAA;AACnB,oHAAA,wBAAwB,OAAA;AACxB,oGAAA,QAAQ,OAAA;AACR,0GAAA,cAAc,OAAA;AACd,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAElB,8GAAA,kBAAkB,OAAA;AAClB,8GAAA,kBAAkB,OAAA;AAClB,sGAAA,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A,iBAAiB,OAAA;AACjB,6GAAA,iBAAiB,OAAA;AACjB,wHAAA,4BAA4B,OAAA;AAG5B,wGAAA,YAAY,OAAA;AAIb,qDAMkC;AADjC,uGAAA,WAAW,OAAA;AAGZ,8CAuC2B;AAtC1B,iHAAA,qBAAqB,OAAA;AACrB,4GAAA,gBAAgB,OAAA;AAChB,0GAAA,cAAc,OAAA;AAEd,wGAAA,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAElB,sGAAA,UAAU,OAAA;AAGV,6GAAA,iBAAiB,OAAA;AACjB,4GAAA,gBAAgB,OAAA;AAKhB,0GAAA,cAAc,OAAA;AACd,qGAAA,SAAS,OAAA;AACT,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,2GAAA,eAAe,OAAA;AACf,sGAAA,UAAU,OAAA;AACV,wGAAA,YAAY,OAAA;AAEZ,wGAAA,YAAY,OAAA;AACZ,mHAAA,uBAAuB,OAAA;AAEvB,0HAAA,8BAA8B,OAAA;AAI9B,wGAAA,YAAY,OAAA;AACZ,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,gHAAA,oBAAoB,OAAA;AACpB,yGAAA,aAAa,OAAA;AAKd,mDAMgC;AAJ/B,6GAAA,iBAAiB,OAAA;AACjB,yGAAA,aAAa,OAAA;AAEb,6GAAA,iBAAiB,OAAA;AAGlB,kDAA0E;AAAhD,4GAAA,gBAAgB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tEmptyKey,\n\ttype TreeType,\n\ttype Value,\n\ttype TreeValue,\n\tAnchorSet,\n\ttype DetachedField,\n\ttype UpPath,\n\ttype Range,\n\ttype RangeUpPath,\n\ttype PlaceUpPath,\n\ttype PlaceIndex,\n\ttype NodeIndex,\n\ttype DetachedPlaceUpPath,\n\ttype DetachedRangeUpPath,\n\ttype FieldUpPath,\n\ttype Anchor,\n\ttype RootField,\n\ttype ChildCollection,\n\ttype ChildLocation,\n\ttype FieldMapObject,\n\ttype NodeData,\n\ttype GenericTreeNode,\n\ttype JsonableTree,\n\tEncodedJsonableTree,\n\trootFieldKey,\n\trootField,\n\ttype ITreeCursor,\n\tCursorLocationType,\n\ttype ITreeCursorSynchronous,\n\tcastCursorToSynchronous,\n\ttype GenericFieldsNode,\n\ttype AnchorLocator,\n\tgenericTreeKeys,\n\tgetGenericTreeField,\n\tgenericTreeDeleteIfEmpty,\n\tgetDepth,\n\tmapCursorField,\n\tmapCursorFields,\n\titerateCursorField,\n\ttype MapTree,\n\tdetachedFieldAsKey,\n\tkeyAsDetachedField,\n\tvisitDelta,\n\tcombineVisitors,\n\tannounceDelta,\n\tapplyDelta,\n\tmakeDetachedFieldIndex,\n\tsetGenericTreeField,\n\ttype DeltaVisitor,\n\ttype AnnouncedVisitor,\n\ttype PathVisitor,\n\tSparseNode,\n\tgetDescendant,\n\tcompareUpPaths,\n\tclonePath,\n\ttopDownPath,\n\tcompareFieldUpPaths,\n\tforEachNode,\n\tforEachNodeInSubtree,\n\tforEachField,\n\ttype PathRootPrefix,\n\tdeltaForRootInitialization,\n\temptyFieldChanges,\n\tisEmptyFieldChanges,\n\tmakeDetachedNodeId,\n\toffsetDetachId,\n\temptyDelta,\n\ttype AnchorSlot,\n\ttype AnchorNode,\n\tanchorSlot,\n\ttype UpPathDefault,\n\tinCursorField,\n\tinCursorNode,\n\ttype AnchorEvents,\n\ttype AnchorSetRootEvents,\n\ttype ProtoNodes,\n\tCursorMarker,\n\tisCursor,\n\tDetachedFieldIndex,\n\ttype ForestRootId,\n\tgetDetachedFieldContainingPath,\n\taboveRootPlaceholder,\n\ttype DeltaRoot,\n\ttype DeltaProtoNode,\n\ttype DeltaMark,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaFieldMap,\n\ttype DeltaDetachedNodeChanges,\n\ttype DeltaDetachedNodeBuild,\n\ttype DeltaDetachedNodeDestruction,\n\ttype DeltaDetachedNodeRename,\n\ttype DeltaFieldChanges,\n} from \"./tree/index.js\";\n\nexport {\n\tTreeNavigationResult,\n\ttype IEditableForest,\n\ttype IForestSubscription,\n\ttype TreeLocation,\n\ttype FieldLocation,\n\ttype ForestLocation,\n\ttype ITreeSubscriptionCursor,\n\tITreeSubscriptionCursorState,\n\tinitializeForest,\n\ttype FieldAnchor,\n\tmoveToDetachedField,\n\ttype ForestEvents,\n} from \"./forest/index.js\";\n\nexport {\n\ttype FieldKey,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeFieldStoredSchema,\n\tValueSchema,\n\tTreeNodeStoredSchema,\n\ttype TreeStoredSchemaSubscription as TreeStoredSchemaSubscription,\n\ttype MutableTreeStoredSchema,\n\ttype FieldKindIdentifier,\n\ttype FieldKindData,\n\ttype TreeTypeSet,\n\ttype TreeStoredSchema,\n\tTreeStoredSchemaRepository,\n\tschemaDataIsEmpty,\n\ttype SchemaEvents,\n\tforbiddenFieldKindIdentifier,\n\tidentifierFieldKindIdentifier,\n\tstoredEmptyFieldSchema,\n\ttype StoredSchemaCollection,\n\tschemaFormat,\n\tLeafNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tMapNodeStoredSchema,\n\ttoTreeNodeSchemaDataFormat,\n\tdecodeFieldSchema,\n\tencodeFieldSchema,\n\tstoredSchemaDecodeDispatcher,\n\ttype ErasedTreeNodeSchemaDataFormat,\n\ttype SchemaAndPolicy,\n\tMultiplicity,\n\ttype SchemaPolicy,\n} from \"./schema-stored/index.js\";\n\nexport {\n\ttype ChangeFamily,\n\ttype ChangeFamilyCodec,\n\ttype ChangeEncodingContext,\n\ttype ChangeFamilyEditor,\n\tEditBuilder,\n} from \"./change-family/index.js\";\n\nexport {\n\tareEqualChangeAtomIds,\n\tmakeChangeAtomId,\n\tasChangeAtomId,\n\ttype ChangeRebaser,\n\tfindAncestor,\n\tfindCommonAncestor,\n\ttype GraphCommit,\n\tCommitKind,\n\ttype CommitMetadata,\n\ttype RevisionTag,\n\tRevisionTagSchema,\n\tRevisionTagCodec,\n\ttype ChangesetLocalId,\n\ttype ChangeAtomId,\n\ttype ChangeAtomIdMap,\n\ttype TaggedChange,\n\tmakeAnonChange,\n\ttagChange,\n\tmapTaggedChange,\n\ttagRollbackInverse,\n\tSessionIdSchema,\n\tmintCommit,\n\trebaseBranch,\n\ttype BranchRebaseResult,\n\trebaseChange,\n\trebaseChangeOverChanges,\n\ttype RevisionMetadataSource,\n\trevisionMetadataSourceFromInfo,\n\ttype RevisionInfo,\n\ttype EncodedRevisionTag,\n\ttype EncodedChangeAtomId,\n\ttaggedAtomId,\n\ttaggedOptAtomId,\n\toffsetChangeAtomId,\n\treplaceAtomRevisions,\n\treplaceChange,\n\ttype RebaseStats,\n\ttype RebaseStatsWithDuration,\n} from \"./rebase/index.js\";\n\nexport {\n\ttype Adapters,\n\tAdaptedViewSchema,\n\tCompatibility,\n\ttype TreeAdapter,\n\tAllowedUpdateType,\n} from \"./schema-view/index.js\";\n\nexport { type Revertible, RevertibleStatus } from \"./revertible/index.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,4CA6FyB;AA5FxB,oGAAA,QAAQ,OAAA;AAIR,qGAAA,SAAS,OAAA;AAmBT,+GAAA,mBAAmB,OAAA;AACnB,wGAAA,YAAY,OAAA;AACZ,qGAAA,SAAS,OAAA;AAET,8GAAA,kBAAkB,OAAA;AAElB,mHAAA,uBAAuB,OAAA;AAGvB,2GAAA,eAAe,OAAA;AACf,+GAAA,mBAAmB,OAAA;AACnB,oHAAA,wBAAwB,OAAA;AACxB,oGAAA,QAAQ,OAAA;AACR,0GAAA,cAAc,OAAA;AACd,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAElB,8GAAA,kBAAkB,OAAA;AAClB,8GAAA,kBAAkB,OAAA;AAClB,sGAAA,UAAU,OAAA;AACV,2GAAA,eAAe,OAAA;AACf,yG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;AACjB,wHAAA,4BAA4B,OAAA;AAG5B,wGAAA,YAAY,OAAA;AAIb,qDAMkC;AADjC,uGAAA,WAAW,OAAA;AAGZ,8CAyC2B;AAxC1B,iHAAA,qBAAqB,OAAA;AACrB,4GAAA,gBAAgB,OAAA;AAChB,0GAAA,cAAc,OAAA;AAEd,wGAAA,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAElB,sGAAA,UAAU,OAAA;AAGV,6GAAA,iBAAiB,OAAA;AACjB,4GAAA,gBAAgB,OAAA;AAKhB,0GAAA,cAAc,OAAA;AACd,qGAAA,SAAS,OAAA;AACT,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,2GAAA,eAAe,OAAA;AACf,sGAAA,UAAU,OAAA;AACV,wGAAA,YAAY,OAAA;AAEZ,wGAAA,YAAY,OAAA;AACZ,mHAAA,uBAAuB,OAAA;AAEvB,0HAAA,8BAA8B,OAAA;AAI9B,wGAAA,YAAY,OAAA;AACZ,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,gHAAA,oBAAoB,OAAA;AACpB,kHAAA,sBAAsB,OAAA;AACtB,gHAAA,oBAAoB,OAAA;AACpB,yGAAA,aAAa,OAAA;AAKd,mDAMgC;AAJ/B,6GAAA,iBAAiB,OAAA;AACjB,yGAAA,aAAa,OAAA;AAEb,6GAAA,iBAAiB,OAAA;AAGlB,kDAA0E;AAAhD,4GAAA,gBAAgB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tEmptyKey,\n\ttype TreeType,\n\ttype Value,\n\ttype TreeValue,\n\tAnchorSet,\n\ttype DetachedField,\n\ttype UpPath,\n\ttype Range,\n\ttype RangeUpPath,\n\ttype PlaceUpPath,\n\ttype PlaceIndex,\n\ttype NodeIndex,\n\ttype DetachedPlaceUpPath,\n\ttype DetachedRangeUpPath,\n\ttype FieldUpPath,\n\ttype Anchor,\n\ttype RootField,\n\ttype ChildCollection,\n\ttype ChildLocation,\n\ttype FieldMapObject,\n\ttype NodeData,\n\ttype GenericTreeNode,\n\ttype JsonableTree,\n\tEncodedJsonableTree,\n\trootFieldKey,\n\trootField,\n\ttype ITreeCursor,\n\tCursorLocationType,\n\ttype ITreeCursorSynchronous,\n\tcastCursorToSynchronous,\n\ttype GenericFieldsNode,\n\ttype AnchorLocator,\n\tgenericTreeKeys,\n\tgetGenericTreeField,\n\tgenericTreeDeleteIfEmpty,\n\tgetDepth,\n\tmapCursorField,\n\tmapCursorFields,\n\titerateCursorField,\n\ttype MapTree,\n\tdetachedFieldAsKey,\n\tkeyAsDetachedField,\n\tvisitDelta,\n\tcombineVisitors,\n\tannounceDelta,\n\tapplyDelta,\n\tmakeDetachedFieldIndex,\n\tsetGenericTreeField,\n\ttype DeltaVisitor,\n\ttype AnnouncedVisitor,\n\ttype PathVisitor,\n\tSparseNode,\n\tgetDescendant,\n\tcompareUpPaths,\n\tclonePath,\n\ttopDownPath,\n\tcompareFieldUpPaths,\n\tforEachNode,\n\tforEachNodeInSubtree,\n\tforEachField,\n\ttype PathRootPrefix,\n\tdeltaForRootInitialization,\n\temptyFieldChanges,\n\tisEmptyFieldChanges,\n\tmakeDetachedNodeId,\n\toffsetDetachId,\n\temptyDelta,\n\ttype AnchorSlot,\n\ttype AnchorNode,\n\tanchorSlot,\n\ttype UpPathDefault,\n\tinCursorField,\n\tinCursorNode,\n\ttype AnchorEvents,\n\ttype AnchorSetRootEvents,\n\ttype ProtoNodes,\n\tCursorMarker,\n\tisCursor,\n\tDetachedFieldIndex,\n\ttype ForestRootId,\n\tgetDetachedFieldContainingPath,\n\taboveRootPlaceholder,\n\ttype DeltaRoot,\n\ttype DeltaProtoNode,\n\ttype DeltaMark,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaFieldMap,\n\ttype DeltaDetachedNodeChanges,\n\ttype DeltaDetachedNodeBuild,\n\ttype DeltaDetachedNodeDestruction,\n\ttype DeltaDetachedNodeRename,\n\ttype DeltaFieldChanges,\n} from \"./tree/index.js\";\n\nexport {\n\tTreeNavigationResult,\n\ttype IEditableForest,\n\ttype IForestSubscription,\n\ttype TreeLocation,\n\ttype FieldLocation,\n\ttype ForestLocation,\n\ttype ITreeSubscriptionCursor,\n\tITreeSubscriptionCursorState,\n\tinitializeForest,\n\ttype FieldAnchor,\n\tmoveToDetachedField,\n\ttype ForestEvents,\n} from \"./forest/index.js\";\n\nexport {\n\ttype FieldKey,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeFieldStoredSchema,\n\tValueSchema,\n\tTreeNodeStoredSchema,\n\ttype TreeStoredSchemaSubscription as TreeStoredSchemaSubscription,\n\ttype MutableTreeStoredSchema,\n\ttype FieldKindIdentifier,\n\ttype FieldKindData,\n\ttype TreeTypeSet,\n\ttype TreeStoredSchema,\n\tTreeStoredSchemaRepository,\n\tschemaDataIsEmpty,\n\ttype SchemaEvents,\n\tforbiddenFieldKindIdentifier,\n\tidentifierFieldKindIdentifier,\n\tstoredEmptyFieldSchema,\n\ttype StoredSchemaCollection,\n\tschemaFormat,\n\tLeafNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tMapNodeStoredSchema,\n\ttoTreeNodeSchemaDataFormat,\n\tdecodeFieldSchema,\n\tencodeFieldSchema,\n\tstoredSchemaDecodeDispatcher,\n\ttype ErasedTreeNodeSchemaDataFormat,\n\ttype SchemaAndPolicy,\n\tMultiplicity,\n\ttype SchemaPolicy,\n} from \"./schema-stored/index.js\";\n\nexport {\n\ttype ChangeFamily,\n\ttype ChangeFamilyCodec,\n\ttype ChangeEncodingContext,\n\ttype ChangeFamilyEditor,\n\tEditBuilder,\n} from \"./change-family/index.js\";\n\nexport {\n\tareEqualChangeAtomIds,\n\tmakeChangeAtomId,\n\tasChangeAtomId,\n\ttype ChangeRebaser,\n\tfindAncestor,\n\tfindCommonAncestor,\n\ttype GraphCommit,\n\tCommitKind,\n\ttype CommitMetadata,\n\ttype RevisionTag,\n\tRevisionTagSchema,\n\tRevisionTagCodec,\n\ttype ChangesetLocalId,\n\ttype ChangeAtomId,\n\ttype ChangeAtomIdMap,\n\ttype TaggedChange,\n\tmakeAnonChange,\n\ttagChange,\n\tmapTaggedChange,\n\ttagRollbackInverse,\n\tSessionIdSchema,\n\tmintCommit,\n\trebaseBranch,\n\ttype BranchRebaseResult,\n\trebaseChange,\n\trebaseChangeOverChanges,\n\ttype RevisionMetadataSource,\n\trevisionMetadataSourceFromInfo,\n\ttype RevisionInfo,\n\ttype EncodedRevisionTag,\n\ttype EncodedChangeAtomId,\n\ttaggedAtomId,\n\ttaggedOptAtomId,\n\toffsetChangeAtomId,\n\treplaceAtomRevisions,\n\tgetFromChangeAtomIdMap,\n\tsetInChangeAtomIdMap,\n\treplaceChange,\n\ttype RebaseStats,\n\ttype RebaseStatsWithDuration,\n} from \"./rebase/index.js\";\n\nexport {\n\ttype Adapters,\n\tAdaptedViewSchema,\n\tCompatibility,\n\ttype TreeAdapter,\n\tAllowedUpdateType,\n} from \"./schema-view/index.js\";\n\nexport { type Revertible, RevertibleStatus } from \"./revertible/index.js\";\n"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { areEqualChangeAtomIds, makeChangeAtomId, asChangeAtomId, mintCommit, type GraphCommit, CommitKind, type CommitMetadata, type RevisionTag, RevisionTagSchema, type EncodedRevisionTag, type EncodedChangeAtomId, type ChangesetLocalId, type ChangeAtomId, type ChangeAtomIdMap, SessionIdSchema, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, replaceAtomRevisions, replaceChange, } from "./types.js";
5
+ export { areEqualChangeAtomIds, makeChangeAtomId, asChangeAtomId, mintCommit, type GraphCommit, CommitKind, type CommitMetadata, type RevisionTag, RevisionTagSchema, type EncodedRevisionTag, type EncodedChangeAtomId, type ChangesetLocalId, type ChangeAtomId, type ChangeAtomIdMap, SessionIdSchema, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, replaceAtomRevisions, getFromChangeAtomIdMap, setInChangeAtomIdMap, replaceChange, } from "./types.js";
6
6
  export { RevisionTagCodec } from "./revisionTagCodec.js";
7
7
  export { type ChangeRebaser, type FinalChange, FinalChangeStatus, makeAnonChange, tagChange, mapTaggedChange, tagRollbackInverse, type TaggedChange, type RevisionMetadataSource, type RevisionInfo, } from "./changeRebaser.js";
8
8
  export { findAncestor, findCommonAncestor, rebaseBranch, type BranchRebaseResult, rebaseChange, rebaseChangeOverChanges, revisionMetadataSourceFromInfo, type RebaseStats, type RebaseStatsWithDuration, } from "./utils.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/rebase/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,KAAK,WAAW,EAChB,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,iBAAiB,EACjB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,YAAY,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,KAAK,kBAAkB,EACvB,YAAY,EACZ,uBAAuB,EACvB,8BAA8B,EAC9B,KAAK,WAAW,EAChB,KAAK,uBAAuB,GAC5B,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/rebase/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,KAAK,WAAW,EAChB,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,iBAAiB,EACjB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,aAAa,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,YAAY,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,KAAK,kBAAkB,EACvB,YAAY,EACZ,uBAAuB,EACvB,8BAA8B,EAC9B,KAAK,WAAW,EAChB,KAAK,uBAAuB,GAC5B,MAAM,YAAY,CAAC"}
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.revisionMetadataSourceFromInfo = exports.rebaseChangeOverChanges = exports.rebaseChange = exports.rebaseBranch = exports.findCommonAncestor = exports.findAncestor = exports.tagRollbackInverse = exports.mapTaggedChange = exports.tagChange = exports.makeAnonChange = exports.FinalChangeStatus = exports.RevisionTagCodec = exports.replaceChange = exports.replaceAtomRevisions = exports.offsetChangeAtomId = exports.taggedOptAtomId = exports.taggedAtomId = exports.SessionIdSchema = exports.RevisionTagSchema = exports.CommitKind = exports.mintCommit = exports.asChangeAtomId = exports.makeChangeAtomId = exports.areEqualChangeAtomIds = void 0;
7
+ exports.revisionMetadataSourceFromInfo = exports.rebaseChangeOverChanges = exports.rebaseChange = exports.rebaseBranch = exports.findCommonAncestor = exports.findAncestor = exports.tagRollbackInverse = exports.mapTaggedChange = exports.tagChange = exports.makeAnonChange = exports.FinalChangeStatus = exports.RevisionTagCodec = exports.replaceChange = exports.setInChangeAtomIdMap = exports.getFromChangeAtomIdMap = exports.replaceAtomRevisions = exports.offsetChangeAtomId = exports.taggedOptAtomId = exports.taggedAtomId = exports.SessionIdSchema = exports.RevisionTagSchema = exports.CommitKind = exports.mintCommit = exports.asChangeAtomId = exports.makeChangeAtomId = exports.areEqualChangeAtomIds = void 0;
8
8
  var types_js_1 = require("./types.js");
9
9
  Object.defineProperty(exports, "areEqualChangeAtomIds", { enumerable: true, get: function () { return types_js_1.areEqualChangeAtomIds; } });
10
10
  Object.defineProperty(exports, "makeChangeAtomId", { enumerable: true, get: function () { return types_js_1.makeChangeAtomId; } });
@@ -17,6 +17,8 @@ Object.defineProperty(exports, "taggedAtomId", { enumerable: true, get: function
17
17
  Object.defineProperty(exports, "taggedOptAtomId", { enumerable: true, get: function () { return types_js_1.taggedOptAtomId; } });
18
18
  Object.defineProperty(exports, "offsetChangeAtomId", { enumerable: true, get: function () { return types_js_1.offsetChangeAtomId; } });
19
19
  Object.defineProperty(exports, "replaceAtomRevisions", { enumerable: true, get: function () { return types_js_1.replaceAtomRevisions; } });
20
+ Object.defineProperty(exports, "getFromChangeAtomIdMap", { enumerable: true, get: function () { return types_js_1.getFromChangeAtomIdMap; } });
21
+ Object.defineProperty(exports, "setInChangeAtomIdMap", { enumerable: true, get: function () { return types_js_1.setInChangeAtomIdMap; } });
20
22
  Object.defineProperty(exports, "replaceChange", { enumerable: true, get: function () { return types_js_1.replaceChange; } });
21
23
  var revisionTagCodec_js_1 = require("./revisionTagCodec.js");
22
24
  Object.defineProperty(exports, "RevisionTagCodec", { enumerable: true, get: function () { return revisionTagCodec_js_1.RevisionTagCodec; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/rebase/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uCAqBoB;AApBnB,iHAAA,qBAAqB,OAAA;AACrB,4GAAA,gBAAgB,OAAA;AAChB,0GAAA,cAAc,OAAA;AACd,sGAAA,UAAU,OAAA;AAEV,sGAAA,UAAU,OAAA;AAGV,6GAAA,iBAAiB,OAAA;AAMjB,2GAAA,eAAe,OAAA;AACf,wGAAA,YAAY,OAAA;AACZ,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,gHAAA,oBAAoB,OAAA;AACpB,yGAAA,aAAa,OAAA;AAEd,6DAAyD;AAAhD,uHAAA,gBAAgB,OAAA;AACzB,uDAW4B;AAR3B,qHAAA,iBAAiB,OAAA;AACjB,kHAAA,cAAc,OAAA;AACd,6GAAA,SAAS,OAAA;AACT,mHAAA,eAAe,OAAA;AACf,sHAAA,kBAAkB,OAAA;AAKnB,uCAUoB;AATnB,wGAAA,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAClB,wGAAA,YAAY,OAAA;AAEZ,wGAAA,YAAY,OAAA;AACZ,mHAAA,uBAAuB,OAAA;AACvB,0HAAA,8BAA8B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tareEqualChangeAtomIds,\n\tmakeChangeAtomId,\n\tasChangeAtomId,\n\tmintCommit,\n\ttype GraphCommit,\n\tCommitKind,\n\ttype CommitMetadata,\n\ttype RevisionTag,\n\tRevisionTagSchema,\n\ttype EncodedRevisionTag,\n\ttype EncodedChangeAtomId,\n\ttype ChangesetLocalId,\n\ttype ChangeAtomId,\n\ttype ChangeAtomIdMap,\n\tSessionIdSchema,\n\ttaggedAtomId,\n\ttaggedOptAtomId,\n\toffsetChangeAtomId,\n\treplaceAtomRevisions,\n\treplaceChange,\n} from \"./types.js\";\nexport { RevisionTagCodec } from \"./revisionTagCodec.js\";\nexport {\n\ttype ChangeRebaser,\n\ttype FinalChange,\n\tFinalChangeStatus,\n\tmakeAnonChange,\n\ttagChange,\n\tmapTaggedChange,\n\ttagRollbackInverse,\n\ttype TaggedChange,\n\ttype RevisionMetadataSource,\n\ttype RevisionInfo,\n} from \"./changeRebaser.js\";\nexport {\n\tfindAncestor,\n\tfindCommonAncestor,\n\trebaseBranch,\n\ttype BranchRebaseResult,\n\trebaseChange,\n\trebaseChangeOverChanges,\n\trevisionMetadataSourceFromInfo,\n\ttype RebaseStats,\n\ttype RebaseStatsWithDuration,\n} from \"./utils.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/rebase/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uCAuBoB;AAtBnB,iHAAA,qBAAqB,OAAA;AACrB,4GAAA,gBAAgB,OAAA;AAChB,0GAAA,cAAc,OAAA;AACd,sGAAA,UAAU,OAAA;AAEV,sGAAA,UAAU,OAAA;AAGV,6GAAA,iBAAiB,OAAA;AAMjB,2GAAA,eAAe,OAAA;AACf,wGAAA,YAAY,OAAA;AACZ,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,gHAAA,oBAAoB,OAAA;AACpB,kHAAA,sBAAsB,OAAA;AACtB,gHAAA,oBAAoB,OAAA;AACpB,yGAAA,aAAa,OAAA;AAEd,6DAAyD;AAAhD,uHAAA,gBAAgB,OAAA;AACzB,uDAW4B;AAR3B,qHAAA,iBAAiB,OAAA;AACjB,kHAAA,cAAc,OAAA;AACd,6GAAA,SAAS,OAAA;AACT,mHAAA,eAAe,OAAA;AACf,sHAAA,kBAAkB,OAAA;AAKnB,uCAUoB;AATnB,wGAAA,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAClB,wGAAA,YAAY,OAAA;AAEZ,wGAAA,YAAY,OAAA;AACZ,mHAAA,uBAAuB,OAAA;AACvB,0HAAA,8BAA8B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tareEqualChangeAtomIds,\n\tmakeChangeAtomId,\n\tasChangeAtomId,\n\tmintCommit,\n\ttype GraphCommit,\n\tCommitKind,\n\ttype CommitMetadata,\n\ttype RevisionTag,\n\tRevisionTagSchema,\n\ttype EncodedRevisionTag,\n\ttype EncodedChangeAtomId,\n\ttype ChangesetLocalId,\n\ttype ChangeAtomId,\n\ttype ChangeAtomIdMap,\n\tSessionIdSchema,\n\ttaggedAtomId,\n\ttaggedOptAtomId,\n\toffsetChangeAtomId,\n\treplaceAtomRevisions,\n\tgetFromChangeAtomIdMap,\n\tsetInChangeAtomIdMap,\n\treplaceChange,\n} from \"./types.js\";\nexport { RevisionTagCodec } from \"./revisionTagCodec.js\";\nexport {\n\ttype ChangeRebaser,\n\ttype FinalChange,\n\tFinalChangeStatus,\n\tmakeAnonChange,\n\ttagChange,\n\tmapTaggedChange,\n\ttagRollbackInverse,\n\ttype TaggedChange,\n\ttype RevisionMetadataSource,\n\ttype RevisionInfo,\n} from \"./changeRebaser.js\";\nexport {\n\tfindAncestor,\n\tfindCommonAncestor,\n\trebaseBranch,\n\ttype BranchRebaseResult,\n\trebaseChange,\n\trebaseChangeOverChanges,\n\trevisionMetadataSourceFromInfo,\n\ttype RebaseStats,\n\ttype RebaseStatsWithDuration,\n} from \"./utils.js\";\n"]}
@@ -50,6 +50,8 @@ export type EncodedChangeAtomId = [ChangesetLocalId, EncodedRevisionTag] | Chang
50
50
  * @internal
51
51
  */
52
52
  export type ChangeAtomIdMap<T> = NestedMap<RevisionTag | undefined, ChangesetLocalId, T>;
53
+ export declare function getFromChangeAtomIdMap<T>(map: ChangeAtomIdMap<T>, id: ChangeAtomId): T | undefined;
54
+ export declare function setInChangeAtomIdMap<T>(map: ChangeAtomIdMap<T>, id: ChangeAtomId, value: T): void;
53
55
  /**
54
56
  * @internal
55
57
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/rebase/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,SAAS,EACT,wBAAwB,EACxB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EACN,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,QAAQ,EAIb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,eAAe,gDAAiC,CAAC;AAE9D;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG,wBAAwB,GAAG,MAAM,CAAC;AAC5D,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,GAAG,MAAM,CAAC;AAC3F,eAAO,MAAM,iBAAiB,2KAG5B,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AAEjE;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC5B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;IAChC;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;CACnC;AAED,MAAM,MAAM,mBAAmB,GAAG,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,GAAG,gBAAgB,CAAC;AAE5F;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,SAAS,CAAC,WAAW,GAAG,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AAEzF;;GAEG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,GAA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OAAO,CAAC,EAC5B,MAAM,EAAE,OAAO,GACb,WAAW,CAAC,OAAO,CAAC,CAItB"}
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.replaceChange = exports.mintCommit = exports.CommitKind = exports.replaceAtomRevisions = exports.offsetChangeAtomId = exports.taggedOptAtomId = exports.taggedAtomId = exports.asChangeAtomId = exports.makeChangeAtomId = exports.areEqualChangeAtomIds = exports.RevisionTagSchema = exports.SessionIdSchema = void 0;
7
+ exports.replaceChange = exports.mintCommit = exports.CommitKind = exports.replaceAtomRevisions = exports.offsetChangeAtomId = exports.taggedOptAtomId = exports.taggedAtomId = exports.asChangeAtomId = exports.makeChangeAtomId = exports.areEqualChangeAtomIds = exports.setInChangeAtomIdMap = exports.getFromChangeAtomIdMap = exports.RevisionTagSchema = exports.SessionIdSchema = void 0;
8
8
  const typebox_1 = require("@sinclair/typebox");
9
9
  const index_js_1 = require("../../util/index.js");
10
10
  /**
@@ -15,6 +15,14 @@ exports.RevisionTagSchema = typebox_1.Type.Union([
15
15
  typebox_1.Type.Literal("root"),
16
16
  (0, index_js_1.brandedNumberType)(),
17
17
  ]);
18
+ function getFromChangeAtomIdMap(map, id) {
19
+ return (0, index_js_1.tryGetFromNestedMap)(map, id.revision, id.localId);
20
+ }
21
+ exports.getFromChangeAtomIdMap = getFromChangeAtomIdMap;
22
+ function setInChangeAtomIdMap(map, id, value) {
23
+ (0, index_js_1.setInNestedMap)(map, id.revision, id.localId, value);
24
+ }
25
+ exports.setInChangeAtomIdMap = setInChangeAtomIdMap;
18
26
  /**
19
27
  * @returns true iff `a` and `b` are the same.
20
28
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/rebase/types.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,+CAAyC;AAEzC,kDAO6B;AAG7B;;GAEG;AACU,QAAA,eAAe,GAAG,IAAA,4B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under the MIT License.\n */\n\nimport type {\n\tOpSpaceCompressedId,\n\tSessionId,\n\tSessionSpaceCompressedId,\n} from \"@fluidframework/id-compressor\";\nimport { Type } from \"@sinclair/typebox\";\n\nimport {\n\ttype Brand,\n\ttype NestedMap,\n\ttype RangeMap,\n\tbrand,\n\tbrandedNumberType,\n\tbrandedStringType,\n} from \"../../util/index.js\";\nimport type { TaggedChange } from \"./changeRebaser.js\";\n\n/**\n * The identifier for a particular session/user/client that can generate `GraphCommit`s\n */\nexport const SessionIdSchema = brandedStringType<SessionId>();\n\n/**\n * A unique identifier for a commit. Commits that have been rebased, but are semantically\n * the same, will share the same revision tag.\n *\n * The constant 'root' is reserved for the trunk base: minting a SessionSpaceCompressedId is not\n * possible on readonly clients. These clients generally don't need ids, but must be done at tree initialization time.\n * @internal\n */\nexport type RevisionTag = SessionSpaceCompressedId | \"root\";\nexport type EncodedRevisionTag = Brand<OpSpaceCompressedId, \"EncodedRevisionTag\"> | \"root\";\nexport const RevisionTagSchema = Type.Union([\n\tType.Literal(\"root\"),\n\tbrandedNumberType<Exclude<EncodedRevisionTag, string>>(),\n]);\n\n/**\n * An ID which is unique within a revision of a `ModularChangeset`.\n * A `ModularChangeset` which is a composition of multiple revisions may contain duplicate `ChangesetLocalId`s,\n * but they are unique when qualified by the revision of the change they are used in.\n * @internal\n */\nexport type ChangesetLocalId = Brand<number, \"ChangesetLocalId\">;\n\n/**\n * A globally unique ID for an atom of change, or a node associated with the atom of change.\n * @internal\n *\n * @privateRemarks\n * TODO: Rename this to be more general.\n */\nexport interface ChangeAtomId {\n\t/**\n\t * Uniquely identifies the changeset within which the change was made.\n\t * Only undefined when referring to an anonymous changesets.\n\t */\n\treadonly revision?: RevisionTag;\n\t/**\n\t * Uniquely identifies, in the scope of the changeset, the change made to the field.\n\t */\n\treadonly localId: ChangesetLocalId;\n}\n\nexport type EncodedChangeAtomId = [ChangesetLocalId, EncodedRevisionTag] | ChangesetLocalId;\n\n/**\n * @internal\n */\nexport type ChangeAtomIdMap<T> = NestedMap<RevisionTag | undefined, ChangesetLocalId, T>;\n\n/**\n * @internal\n */\nexport type ChangeAtomIdRangeMap<T> = Map<RevisionTag | undefined, RangeMap<T>>;\n\n/**\n * @returns true iff `a` and `b` are the same.\n */\nexport function areEqualChangeAtomIds(a: ChangeAtomId, b: ChangeAtomId): boolean {\n\treturn a.localId === b.localId && a.revision === b.revision;\n}\n\n/**\n * @returns a ChangeAtomId with the given revision and local ID.\n */\nexport function makeChangeAtomId(\n\tlocalId: ChangesetLocalId,\n\trevision?: RevisionTag,\n): ChangeAtomId {\n\treturn revision === undefined ? { localId } : { localId, revision };\n}\n\nexport function asChangeAtomId(id: ChangesetLocalId | ChangeAtomId): ChangeAtomId {\n\treturn typeof id === \"object\" ? id : { localId: id };\n}\n\nexport function taggedAtomId(\n\tid: ChangeAtomId,\n\trevision: RevisionTag | undefined,\n): ChangeAtomId {\n\treturn makeChangeAtomId(id.localId, id.revision ?? revision);\n}\n\nexport function taggedOptAtomId(\n\tid: ChangeAtomId | undefined,\n\trevision: RevisionTag | undefined,\n): ChangeAtomId | undefined {\n\tif (id === undefined) {\n\t\treturn undefined;\n\t}\n\treturn taggedAtomId(id, revision);\n}\n\nexport function offsetChangeAtomId(id: ChangeAtomId, offset: number): ChangeAtomId {\n\treturn { ...id, localId: brand(id.localId + offset) };\n}\n\nexport function replaceAtomRevisions(\n\tid: ChangeAtomId,\n\toldRevisions: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): ChangeAtomId {\n\treturn oldRevisions.has(id.revision) ? atomWithRevision(id, newRevision) : id;\n}\n\nfunction atomWithRevision(id: ChangeAtomId, revision: RevisionTag | undefined): ChangeAtomId {\n\tconst updated = { ...id, revision };\n\tif (revision === undefined) {\n\t\tdelete updated.revision;\n\t}\n\n\treturn updated;\n}\n\n/**\n * A node in a graph of commits. A commit's parent is the commit on which it was based.\n */\nexport interface GraphCommit<TChange> {\n\t/** The tag for this commit. If this commit is rebased, the corresponding rebased commit will retain this tag. */\n\treadonly revision: RevisionTag;\n\t/** The change that will result from applying this commit */\n\treadonly change: TChange;\n\t/** The parent of this commit, on whose change this commit's change is based */\n\treadonly parent?: GraphCommit<TChange>;\n\t/** The rollback of this commit */\n\trollback?: TaggedChange<TChange, RevisionTag>;\n}\n\n/**\n * The type of a commit. This is used to describe the context in which the commit was created.\n *\n * @public\n */\nexport enum CommitKind {\n\t/** A commit corresponding to a change that is not the result of an undo/redo. */\n\tDefault,\n\t/** A commit that is the result of an undo. */\n\tUndo,\n\t/** A commit that is the result of a redo. */\n\tRedo,\n}\n\n/**\n * Information about a commit that has been applied.\n *\n * @sealed @public\n */\nexport interface CommitMetadata {\n\t/**\n\t * A {@link CommitKind} enum value describing whether the commit represents an Edit, an Undo, or a Redo.\n\t */\n\treadonly kind: CommitKind;\n\t/**\n\t * Indicates whether the commit is a local edit\n\t */\n\treadonly isLocal: boolean;\n}\n\n/**\n * Creates a new graph commit object. This is useful for creating copies of commits with different parentage.\n * @param parent - the parent of the new commit\n * @param commit - the contents of the new commit object\n * @returns the new commit object\n */\n// Note that this function is synchronous, and therefore it is not a Promise.\n// However, it is still a strong commit-mint.\nexport function mintCommit<TChange>(\n\tparent: GraphCommit<TChange>,\n\tcommit: Omit<GraphCommit<TChange>, \"parent\">,\n): GraphCommit<TChange> {\n\tconst { revision, change } = commit;\n\treturn {\n\t\trevision,\n\t\tchange,\n\t\tparent,\n\t};\n}\n\nexport function replaceChange<TChange>(\n\tcommit: GraphCommit<TChange>,\n\tchange: TChange,\n): GraphCommit<TChange> {\n\tconst output = { ...commit, change };\n\tdelete output.rollback;\n\treturn output;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/rebase/types.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,+CAAyC;AAEzC,kDAS6B;AAG7B;;GAEG;AACU,QAAA,eAAe,GAAG,IAAA,4BAAiB,GAAa,CAAC;AAYjD,QAAA,iBAAiB,GA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QAAQ;QACR,MAAM;QACN,MAAM;KACN,CAAC;AACH,CAAC;AAVD,gCAUC;AAED,SAAgB,aAAa,CAC5B,MAA4B,EAC5B,MAAe;IAEf,MAAM,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,CAAC;IACrC,OAAO,MAAM,CAAC,QAAQ,CAAC;IACvB,OAAO,MAAM,CAAC;AACf,CAAC;AAPD,sCAOC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tOpSpaceCompressedId,\n\tSessionId,\n\tSessionSpaceCompressedId,\n} from \"@fluidframework/id-compressor\";\nimport { Type } from \"@sinclair/typebox\";\n\nimport {\n\ttype Brand,\n\ttype NestedMap,\n\ttype RangeMap,\n\tbrand,\n\tbrandedNumberType,\n\tbrandedStringType,\n\tsetInNestedMap,\n\ttryGetFromNestedMap,\n} from \"../../util/index.js\";\nimport type { TaggedChange } from \"./changeRebaser.js\";\n\n/**\n * The identifier for a particular session/user/client that can generate `GraphCommit`s\n */\nexport const SessionIdSchema = brandedStringType<SessionId>();\n\n/**\n * A unique identifier for a commit. Commits that have been rebased, but are semantically\n * the same, will share the same revision tag.\n *\n * The constant 'root' is reserved for the trunk base: minting a SessionSpaceCompressedId is not\n * possible on readonly clients. These clients generally don't need ids, but must be done at tree initialization time.\n * @internal\n */\nexport type RevisionTag = SessionSpaceCompressedId | \"root\";\nexport type EncodedRevisionTag = Brand<OpSpaceCompressedId, \"EncodedRevisionTag\"> | \"root\";\nexport const RevisionTagSchema = Type.Union([\n\tType.Literal(\"root\"),\n\tbrandedNumberType<Exclude<EncodedRevisionTag, string>>(),\n]);\n\n/**\n * An ID which is unique within a revision of a `ModularChangeset`.\n * A `ModularChangeset` which is a composition of multiple revisions may contain duplicate `ChangesetLocalId`s,\n * but they are unique when qualified by the revision of the change they are used in.\n * @internal\n */\nexport type ChangesetLocalId = Brand<number, \"ChangesetLocalId\">;\n\n/**\n * A globally unique ID for an atom of change, or a node associated with the atom of change.\n * @internal\n *\n * @privateRemarks\n * TODO: Rename this to be more general.\n */\nexport interface ChangeAtomId {\n\t/**\n\t * Uniquely identifies the changeset within which the change was made.\n\t * Only undefined when referring to an anonymous changesets.\n\t */\n\treadonly revision?: RevisionTag;\n\t/**\n\t * Uniquely identifies, in the scope of the changeset, the change made to the field.\n\t */\n\treadonly localId: ChangesetLocalId;\n}\n\nexport type EncodedChangeAtomId = [ChangesetLocalId, EncodedRevisionTag] | ChangesetLocalId;\n\n/**\n * @internal\n */\nexport type ChangeAtomIdMap<T> = NestedMap<RevisionTag | undefined, ChangesetLocalId, T>;\n\nexport function getFromChangeAtomIdMap<T>(\n\tmap: ChangeAtomIdMap<T>,\n\tid: ChangeAtomId,\n): T | undefined {\n\treturn tryGetFromNestedMap(map, id.revision, id.localId);\n}\n\nexport function setInChangeAtomIdMap<T>(\n\tmap: ChangeAtomIdMap<T>,\n\tid: ChangeAtomId,\n\tvalue: T,\n): void {\n\tsetInNestedMap(map, id.revision, id.localId, value);\n}\n\n/**\n * @internal\n */\nexport type ChangeAtomIdRangeMap<T> = Map<RevisionTag | undefined, RangeMap<T>>;\n\n/**\n * @returns true iff `a` and `b` are the same.\n */\nexport function areEqualChangeAtomIds(a: ChangeAtomId, b: ChangeAtomId): boolean {\n\treturn a.localId === b.localId && a.revision === b.revision;\n}\n\n/**\n * @returns a ChangeAtomId with the given revision and local ID.\n */\nexport function makeChangeAtomId(\n\tlocalId: ChangesetLocalId,\n\trevision?: RevisionTag,\n): ChangeAtomId {\n\treturn revision === undefined ? { localId } : { localId, revision };\n}\n\nexport function asChangeAtomId(id: ChangesetLocalId | ChangeAtomId): ChangeAtomId {\n\treturn typeof id === \"object\" ? id : { localId: id };\n}\n\nexport function taggedAtomId(\n\tid: ChangeAtomId,\n\trevision: RevisionTag | undefined,\n): ChangeAtomId {\n\treturn makeChangeAtomId(id.localId, id.revision ?? revision);\n}\n\nexport function taggedOptAtomId(\n\tid: ChangeAtomId | undefined,\n\trevision: RevisionTag | undefined,\n): ChangeAtomId | undefined {\n\tif (id === undefined) {\n\t\treturn undefined;\n\t}\n\treturn taggedAtomId(id, revision);\n}\n\nexport function offsetChangeAtomId(id: ChangeAtomId, offset: number): ChangeAtomId {\n\treturn { ...id, localId: brand(id.localId + offset) };\n}\n\nexport function replaceAtomRevisions(\n\tid: ChangeAtomId,\n\toldRevisions: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): ChangeAtomId {\n\treturn oldRevisions.has(id.revision) ? atomWithRevision(id, newRevision) : id;\n}\n\nfunction atomWithRevision(id: ChangeAtomId, revision: RevisionTag | undefined): ChangeAtomId {\n\tconst updated = { ...id, revision };\n\tif (revision === undefined) {\n\t\tdelete updated.revision;\n\t}\n\n\treturn updated;\n}\n\n/**\n * A node in a graph of commits. A commit's parent is the commit on which it was based.\n */\nexport interface GraphCommit<TChange> {\n\t/** The tag for this commit. If this commit is rebased, the corresponding rebased commit will retain this tag. */\n\treadonly revision: RevisionTag;\n\t/** The change that will result from applying this commit */\n\treadonly change: TChange;\n\t/** The parent of this commit, on whose change this commit's change is based */\n\treadonly parent?: GraphCommit<TChange>;\n\t/** The rollback of this commit */\n\trollback?: TaggedChange<TChange, RevisionTag>;\n}\n\n/**\n * The type of a commit. This is used to describe the context in which the commit was created.\n *\n * @public\n */\nexport enum CommitKind {\n\t/** A commit corresponding to a change that is not the result of an undo/redo. */\n\tDefault,\n\t/** A commit that is the result of an undo. */\n\tUndo,\n\t/** A commit that is the result of a redo. */\n\tRedo,\n}\n\n/**\n * Information about a commit that has been applied.\n *\n * @sealed @public\n */\nexport interface CommitMetadata {\n\t/**\n\t * A {@link CommitKind} enum value describing whether the commit represents an Edit, an Undo, or a Redo.\n\t */\n\treadonly kind: CommitKind;\n\t/**\n\t * Indicates whether the commit is a local edit\n\t */\n\treadonly isLocal: boolean;\n}\n\n/**\n * Creates a new graph commit object. This is useful for creating copies of commits with different parentage.\n * @param parent - the parent of the new commit\n * @param commit - the contents of the new commit object\n * @returns the new commit object\n */\n// Note that this function is synchronous, and therefore it is not a Promise.\n// However, it is still a strong commit-mint.\nexport function mintCommit<TChange>(\n\tparent: GraphCommit<TChange>,\n\tcommit: Omit<GraphCommit<TChange>, \"parent\">,\n): GraphCommit<TChange> {\n\tconst { revision, change } = commit;\n\treturn {\n\t\trevision,\n\t\tchange,\n\t\tparent,\n\t};\n}\n\nexport function replaceChange<TChange>(\n\tcommit: GraphCommit<TChange>,\n\tchange: TChange,\n): GraphCommit<TChange> {\n\tconst output = { ...commit, change };\n\tdelete output.rollback;\n\treturn output;\n}\n"]}