@fluidframework/tree 2.74.0-365691 → 2.74.0-368706

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 (1243) hide show
  1. package/.vscode/settings.json +2 -2
  2. package/api-report/tree.alpha.api.md +119 -85
  3. package/api-report/tree.beta.api.md +0 -1
  4. package/api-report/tree.legacy.beta.api.md +0 -1
  5. package/api-report/tree.legacy.public.api.md +0 -1
  6. package/api-report/tree.public.api.md +0 -1
  7. package/dist/alpha.d.ts +3 -2
  8. package/dist/codec/codec.d.ts +14 -1
  9. package/dist/codec/codec.d.ts.map +1 -1
  10. package/dist/codec/codec.js +11 -0
  11. package/dist/codec/codec.js.map +1 -1
  12. package/dist/codec/versioned/codec.d.ts +1 -1
  13. package/dist/codec/versioned/codec.d.ts.map +1 -1
  14. package/dist/codec/versioned/codec.js.map +1 -1
  15. package/dist/codec/versioned/format.d.ts +4 -1
  16. package/dist/codec/versioned/format.d.ts.map +1 -1
  17. package/dist/codec/versioned/format.js +4 -1
  18. package/dist/codec/versioned/format.js.map +1 -1
  19. package/dist/core/change-family/changeFamily.d.ts +4 -1
  20. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  21. package/dist/core/change-family/changeFamily.js.map +1 -1
  22. package/dist/core/change-family/index.d.ts +1 -1
  23. package/dist/core/change-family/index.d.ts.map +1 -1
  24. package/dist/core/change-family/index.js.map +1 -1
  25. package/dist/core/index.d.ts +3 -3
  26. package/dist/core/index.d.ts.map +1 -1
  27. package/dist/core/index.js +7 -4
  28. package/dist/core/index.js.map +1 -1
  29. package/dist/core/rebase/changeRebaser.d.ts +6 -1
  30. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  31. package/dist/core/rebase/changeRebaser.js.map +1 -1
  32. package/dist/core/rebase/index.d.ts +1 -1
  33. package/dist/core/rebase/index.d.ts.map +1 -1
  34. package/dist/core/rebase/index.js +2 -1
  35. package/dist/core/rebase/index.js.map +1 -1
  36. package/dist/core/rebase/types.d.ts +2 -1
  37. package/dist/core/rebase/types.d.ts.map +1 -1
  38. package/dist/core/rebase/types.js +5 -1
  39. package/dist/core/rebase/types.js.map +1 -1
  40. package/dist/core/rebase/utils.d.ts.map +1 -1
  41. package/dist/core/rebase/utils.js +25 -7
  42. package/dist/core/rebase/utils.js.map +1 -1
  43. package/dist/core/tree/detachedFieldIndex.d.ts +40 -13
  44. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  45. package/dist/core/tree/detachedFieldIndex.js +21 -12
  46. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  47. package/dist/core/tree/index.d.ts +4 -3
  48. package/dist/core/tree/index.d.ts.map +1 -1
  49. package/dist/core/tree/index.js +6 -2
  50. package/dist/core/tree/index.js.map +1 -1
  51. package/dist/core/tree/pathTree.d.ts +11 -3
  52. package/dist/core/tree/pathTree.d.ts.map +1 -1
  53. package/dist/core/tree/pathTree.js +14 -2
  54. package/dist/core/tree/pathTree.js.map +1 -1
  55. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  56. package/dist/feature-libraries/chunked-forest/basicChunk.js +7 -0
  57. package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  58. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  59. package/dist/feature-libraries/chunked-forest/chunkTree.js +4 -1
  60. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  61. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
  62. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
  63. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
  64. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
  65. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  66. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +90 -42
  67. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  68. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +234 -69
  69. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  70. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +4 -4
  71. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  72. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +33 -28
  73. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  74. package/dist/feature-libraries/default-schema/index.d.ts +2 -1
  75. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  76. package/dist/feature-libraries/default-schema/index.js +4 -2
  77. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  78. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +36 -0
  79. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
  80. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js +126 -0
  81. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
  82. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +7 -6
  83. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  84. package/dist/feature-libraries/default-schema/mappedEditBuilder.js +15 -0
  85. package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  86. package/dist/feature-libraries/deltaUtils.d.ts +1 -0
  87. package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
  88. package/dist/feature-libraries/deltaUtils.js +6 -1
  89. package/dist/feature-libraries/deltaUtils.js.map +1 -1
  90. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
  91. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  92. package/dist/feature-libraries/detachedFieldIndexSummarizer.js +41 -11
  93. package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  94. package/dist/feature-libraries/flex-tree/context.d.ts +9 -0
  95. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  96. package/dist/feature-libraries/flex-tree/context.js +6 -0
  97. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  98. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  99. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  100. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  101. package/dist/feature-libraries/flex-tree/lazyField.d.ts +8 -7
  102. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  103. package/dist/feature-libraries/flex-tree/lazyField.js +37 -8
  104. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  105. package/dist/feature-libraries/forest-summary/codec.d.ts +2 -2
  106. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  107. package/dist/feature-libraries/forest-summary/codec.js +4 -4
  108. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  109. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +9 -13
  110. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  111. package/dist/feature-libraries/forest-summary/forestSummarizer.js +21 -26
  112. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  113. package/dist/feature-libraries/forest-summary/format.d.ts +41 -5
  114. package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
  115. package/dist/feature-libraries/forest-summary/format.js +7 -7
  116. package/dist/feature-libraries/forest-summary/format.js.map +1 -1
  117. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +11 -9
  118. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  119. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +16 -29
  120. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  121. package/dist/feature-libraries/forest-summary/index.d.ts +2 -1
  122. package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
  123. package/dist/feature-libraries/forest-summary/index.js +3 -2
  124. package/dist/feature-libraries/forest-summary/index.js.map +1 -1
  125. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts +47 -0
  126. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
  127. package/dist/feature-libraries/forest-summary/summaryTypes.js +57 -0
  128. package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
  129. package/dist/feature-libraries/index.d.ts +4 -4
  130. package/dist/feature-libraries/index.d.ts.map +1 -1
  131. package/dist/feature-libraries/index.js +7 -3
  132. package/dist/feature-libraries/index.js.map +1 -1
  133. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  134. package/dist/feature-libraries/mapTreeCursor.js +1 -0
  135. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  136. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  137. package/dist/feature-libraries/mitigatedChangeFamily.js +2 -2
  138. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  139. package/dist/feature-libraries/modular-schema/comparison.d.ts +18 -2
  140. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  141. package/dist/feature-libraries/modular-schema/comparison.js +54 -3
  142. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  143. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
  144. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  145. package/dist/feature-libraries/modular-schema/crossFieldQueries.js +4 -7
  146. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  147. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +20 -52
  148. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  149. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  150. package/dist/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
  151. package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  152. package/dist/feature-libraries/modular-schema/fieldKind.js +0 -21
  153. package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  154. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  155. package/dist/feature-libraries/modular-schema/genericFieldKind.js +7 -10
  156. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  157. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js +2 -2
  158. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  159. package/dist/feature-libraries/modular-schema/index.d.ts +5 -5
  160. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  161. package/dist/feature-libraries/modular-schema/index.js +12 -8
  162. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  163. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +17 -0
  164. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
  165. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +388 -0
  166. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
  167. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +17 -0
  168. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
  169. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +413 -0
  170. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
  171. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  172. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  173. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +8 -284
  174. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  175. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +48 -15
  176. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  177. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1298 -465
  178. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  179. package/dist/feature-libraries/modular-schema/{modularChangeFormat.d.ts → modularChangeFormatV1.d.ts} +2 -2
  180. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
  181. package/dist/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +5 -5
  182. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
  183. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +146 -0
  184. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
  185. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +32 -0
  186. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
  187. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +50 -10
  188. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  189. package/dist/feature-libraries/modular-schema/modularChangeTypes.js +24 -3
  190. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  191. package/dist/feature-libraries/optional-field/index.d.ts +2 -2
  192. package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
  193. package/dist/feature-libraries/optional-field/index.js +1 -2
  194. package/dist/feature-libraries/optional-field/index.js.map +1 -1
  195. package/dist/feature-libraries/optional-field/optionalField.d.ts +5 -26
  196. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  197. package/dist/feature-libraries/optional-field/optionalField.js +217 -451
  198. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  199. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
  200. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  201. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  202. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  203. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  204. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +57 -28
  205. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  206. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
  207. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  208. package/dist/feature-libraries/schema-index/schemaSummarizer.js +42 -16
  209. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  210. package/dist/feature-libraries/sequence-field/compose.d.ts +6 -7
  211. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  212. package/dist/feature-libraries/sequence-field/compose.js +80 -256
  213. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  214. package/dist/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
  215. package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  216. package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  217. package/dist/feature-libraries/sequence-field/index.d.ts +2 -3
  218. package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
  219. package/dist/feature-libraries/sequence-field/index.js +1 -3
  220. package/dist/feature-libraries/sequence-field/index.js.map +1 -1
  221. package/dist/feature-libraries/sequence-field/invert.d.ts +3 -3
  222. package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  223. package/dist/feature-libraries/sequence-field/invert.js +65 -167
  224. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  225. package/dist/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  226. package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  227. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  228. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
  229. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  230. package/dist/feature-libraries/sequence-field/moveEffectTable.js +7 -86
  231. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  232. package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -3
  233. package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  234. package/dist/feature-libraries/sequence-field/rebase.js +106 -112
  235. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  236. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  237. package/dist/feature-libraries/sequence-field/replaceRevisions.js +16 -33
  238. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  239. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  240. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +0 -2
  241. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  242. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
  243. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  244. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +358 -179
  245. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  246. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  247. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +20 -60
  248. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  249. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  250. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  251. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
  252. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  253. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
  254. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  255. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +14 -109
  256. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  257. package/dist/feature-libraries/sequence-field/types.d.ts +30 -59
  258. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  259. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  260. package/dist/feature-libraries/sequence-field/utils.d.ts +15 -24
  261. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  262. package/dist/feature-libraries/sequence-field/utils.js +111 -299
  263. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  264. package/dist/index.d.ts +1 -1
  265. package/dist/index.d.ts.map +1 -1
  266. package/dist/index.js +3 -3
  267. package/dist/index.js.map +1 -1
  268. package/dist/packageVersion.d.ts +1 -1
  269. package/dist/packageVersion.js +1 -1
  270. package/dist/packageVersion.js.map +1 -1
  271. package/dist/shared-tree/independentView.d.ts +1 -1
  272. package/dist/shared-tree/independentView.d.ts.map +1 -1
  273. package/dist/shared-tree/independentView.js.map +1 -1
  274. package/dist/shared-tree/index.d.ts +1 -1
  275. package/dist/shared-tree/index.d.ts.map +1 -1
  276. package/dist/shared-tree/index.js.map +1 -1
  277. package/dist/shared-tree/schematizeTree.d.ts +4 -4
  278. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  279. package/dist/shared-tree/schematizeTree.js +2 -1
  280. package/dist/shared-tree/schematizeTree.js.map +1 -1
  281. package/dist/shared-tree/schematizingTreeView.d.ts +1 -5
  282. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  283. package/dist/shared-tree/schematizingTreeView.js +32 -33
  284. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  285. package/dist/shared-tree/sharedTree.d.ts +11 -5
  286. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  287. package/dist/shared-tree/sharedTree.js +14 -4
  288. package/dist/shared-tree/sharedTree.js.map +1 -1
  289. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  290. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  291. package/dist/shared-tree/sharedTreeChangeCodecs.js +1 -0
  292. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  293. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
  294. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  295. package/dist/shared-tree/sharedTreeChangeEnricher.js +25 -11
  296. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  297. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
  298. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  299. package/dist/shared-tree/sharedTreeChangeFamily.js +2 -2
  300. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  301. package/dist/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
  302. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  303. package/dist/shared-tree/sharedTreeEditBuilder.js +13 -6
  304. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  305. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  306. package/dist/shared-tree/treeAlpha.js +1 -1
  307. package/dist/shared-tree/treeAlpha.js.map +1 -1
  308. package/dist/shared-tree/treeCheckout.d.ts +12 -10
  309. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  310. package/dist/shared-tree/treeCheckout.js +66 -17
  311. package/dist/shared-tree/treeCheckout.js.map +1 -1
  312. package/dist/shared-tree-core/branch.d.ts +3 -2
  313. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  314. package/dist/shared-tree-core/branch.js +4 -3
  315. package/dist/shared-tree-core/branch.js.map +1 -1
  316. package/dist/shared-tree-core/editManager.d.ts +2 -2
  317. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  318. package/dist/shared-tree-core/editManager.js +9 -9
  319. package/dist/shared-tree-core/editManager.js.map +1 -1
  320. package/dist/shared-tree-core/editManagerCodecs.d.ts +4 -0
  321. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  322. package/dist/shared-tree-core/editManagerCodecs.js +16 -6
  323. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  324. package/{lib/shared-tree-core/editManagerCodecsV5.d.ts → dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
  325. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
  326. package/dist/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +7 -7
  327. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
  328. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +20 -6
  329. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  330. package/dist/shared-tree-core/editManagerFormatCommons.js +22 -7
  331. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  332. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  333. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  334. package/dist/shared-tree-core/editManagerFormatV1toV4.js +1 -0
  335. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  336. package/dist/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
  337. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
  338. package/dist/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
  339. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
  340. package/dist/shared-tree-core/editManagerSummarizer.d.ts +29 -9
  341. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  342. package/dist/shared-tree-core/editManagerSummarizer.js +41 -13
  343. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  344. package/dist/shared-tree-core/index.d.ts +5 -3
  345. package/dist/shared-tree-core/index.d.ts.map +1 -1
  346. package/dist/shared-tree-core/index.js +8 -1
  347. package/dist/shared-tree-core/index.js.map +1 -1
  348. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  349. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  350. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  351. package/{lib/shared-tree-core/messageCodecV5.d.ts → dist/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
  352. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
  353. package/dist/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +6 -6
  354. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
  355. package/dist/shared-tree-core/messageCodecs.d.ts +4 -0
  356. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  357. package/dist/shared-tree-core/messageCodecs.js +16 -6
  358. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  359. package/dist/shared-tree-core/messageFormat.d.ts +20 -6
  360. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  361. package/dist/shared-tree-core/messageFormat.js +22 -7
  362. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  363. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
  364. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  365. package/dist/shared-tree-core/messageFormatV1ToV4.js +8 -1
  366. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  367. package/dist/shared-tree-core/{messageFormatV5.d.ts → messageFormatVSharedBranches.d.ts} +5 -7
  368. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
  369. package/dist/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
  370. package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
  371. package/dist/shared-tree-core/sharedTreeCore.d.ts +14 -47
  372. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  373. package/dist/shared-tree-core/sharedTreeCore.js +30 -18
  374. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  375. package/dist/shared-tree-core/summaryTypes.d.ts +94 -0
  376. package/dist/shared-tree-core/summaryTypes.d.ts.map +1 -0
  377. package/dist/shared-tree-core/summaryTypes.js +47 -0
  378. package/dist/shared-tree-core/summaryTypes.js.map +1 -0
  379. package/dist/shared-tree-core/versionedSummarizer.d.ts +67 -0
  380. package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
  381. package/dist/shared-tree-core/versionedSummarizer.js +63 -0
  382. package/dist/shared-tree-core/versionedSummarizer.js.map +1 -0
  383. package/dist/simple-tree/api/configuration.d.ts +3 -26
  384. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  385. package/dist/simple-tree/api/configuration.js +10 -21
  386. package/dist/simple-tree/api/configuration.js.map +1 -1
  387. package/dist/simple-tree/api/dirtyIndex.d.ts +11 -0
  388. package/dist/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  389. package/dist/simple-tree/api/dirtyIndex.js +7 -0
  390. package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
  391. package/dist/simple-tree/api/discrepancies.d.ts +1 -1
  392. package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
  393. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  394. package/dist/simple-tree/api/getSimpleSchema.d.ts +3 -3
  395. package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  396. package/dist/simple-tree/api/getSimpleSchema.js +9 -3
  397. package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
  398. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  399. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  400. package/dist/simple-tree/api/incrementalAllowedTypes.js +7 -0
  401. package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  402. package/dist/simple-tree/api/index.d.ts +3 -4
  403. package/dist/simple-tree/api/index.d.ts.map +1 -1
  404. package/dist/simple-tree/api/index.js +4 -5
  405. package/dist/simple-tree/api/index.js.map +1 -1
  406. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  407. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  408. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  409. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
  410. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  411. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  412. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  413. package/dist/simple-tree/api/schemaFactoryRecursive.js +0 -1
  414. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  415. package/dist/simple-tree/api/schemaFromSimple.d.ts +6 -1
  416. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  417. package/dist/simple-tree/api/schemaFromSimple.js +5 -0
  418. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  419. package/dist/simple-tree/api/schemaStatics.d.ts +12 -12
  420. package/dist/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
  421. package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  422. package/dist/simple-tree/api/simpleSchemaCodec.js +18 -6
  423. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  424. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  425. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  426. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  427. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
  428. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  429. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +13 -8
  430. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  431. package/dist/simple-tree/api/typesUnsafe.d.ts +3 -3
  432. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  433. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  434. package/dist/simple-tree/core/allowedTypes.d.ts +2 -2
  435. package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
  436. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  437. package/dist/simple-tree/core/index.d.ts +1 -1
  438. package/dist/simple-tree/core/index.d.ts.map +1 -1
  439. package/dist/simple-tree/core/index.js +2 -3
  440. package/dist/simple-tree/core/index.js.map +1 -1
  441. package/dist/simple-tree/core/toStored.d.ts +17 -15
  442. package/dist/simple-tree/core/toStored.d.ts.map +1 -1
  443. package/dist/simple-tree/core/toStored.js +5 -40
  444. package/dist/simple-tree/core/toStored.js.map +1 -1
  445. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
  446. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  447. package/dist/simple-tree/core/unhydratedFlexTree.js +59 -8
  448. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  449. package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
  450. package/dist/simple-tree/core/walkSchema.js +4 -0
  451. package/dist/simple-tree/core/walkSchema.js.map +1 -1
  452. package/dist/simple-tree/createContext.d.ts.map +1 -1
  453. package/dist/simple-tree/createContext.js +20 -5
  454. package/dist/simple-tree/createContext.js.map +1 -1
  455. package/dist/simple-tree/fieldSchema.d.ts +7 -7
  456. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  457. package/dist/simple-tree/fieldSchema.js.map +1 -1
  458. package/dist/simple-tree/index.d.ts +8 -7
  459. package/dist/simple-tree/index.d.ts.map +1 -1
  460. package/dist/simple-tree/index.js +15 -12
  461. package/dist/simple-tree/index.js.map +1 -1
  462. package/dist/simple-tree/leafNodeSchema.d.ts +5 -5
  463. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  464. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  465. package/dist/simple-tree/node-kinds/array/arrayNode.js +5 -3
  466. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  467. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
  468. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  469. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  470. package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
  471. package/dist/simple-tree/node-kinds/common.js +1 -1
  472. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  473. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  474. package/dist/simple-tree/node-kinds/map/mapNode.js +2 -2
  475. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  476. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
  477. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  478. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  479. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  480. package/dist/simple-tree/node-kinds/object/objectNode.js +18 -18
  481. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  482. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
  483. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  484. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  485. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  486. package/dist/simple-tree/node-kinds/record/recordNode.js +4 -2
  487. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  488. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
  489. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  490. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  491. package/dist/simple-tree/prepareForInsertion.d.ts +54 -47
  492. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  493. package/dist/simple-tree/prepareForInsertion.js +183 -125
  494. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  495. package/dist/simple-tree/simpleSchema.d.ts +55 -23
  496. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  497. package/dist/simple-tree/simpleSchema.js +17 -0
  498. package/dist/simple-tree/simpleSchema.js.map +1 -1
  499. package/dist/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
  500. package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
  501. package/dist/simple-tree/simpleSchemaFormatV1.js +8 -1
  502. package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  503. package/dist/simple-tree/toStoredSchema.d.ts +58 -11
  504. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  505. package/dist/simple-tree/toStoredSchema.js +205 -30
  506. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  507. package/dist/simple-tree/treeSchema.d.ts +23 -0
  508. package/dist/simple-tree/treeSchema.d.ts.map +1 -0
  509. package/dist/simple-tree/treeSchema.js +25 -0
  510. package/dist/simple-tree/treeSchema.js.map +1 -0
  511. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
  512. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  513. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +29 -11
  514. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  515. package/dist/tableSchema.d.ts +117 -63
  516. package/dist/tableSchema.d.ts.map +1 -1
  517. package/dist/tableSchema.js +159 -58
  518. package/dist/tableSchema.js.map +1 -1
  519. package/dist/treeFactory.d.ts.map +1 -1
  520. package/dist/treeFactory.js +17 -3
  521. package/dist/treeFactory.js.map +1 -1
  522. package/dist/util/index.d.ts +2 -1
  523. package/dist/util/index.d.ts.map +1 -1
  524. package/dist/util/index.js +4 -1
  525. package/dist/util/index.js.map +1 -1
  526. package/dist/util/rangeMap.d.ts +24 -12
  527. package/dist/util/rangeMap.d.ts.map +1 -1
  528. package/dist/util/rangeMap.js +46 -6
  529. package/dist/util/rangeMap.js.map +1 -1
  530. package/dist/util/readSnapshotBlob.d.ts +13 -0
  531. package/dist/util/readSnapshotBlob.d.ts.map +1 -0
  532. package/dist/util/readSnapshotBlob.js +18 -0
  533. package/dist/util/readSnapshotBlob.js.map +1 -0
  534. package/lib/alpha.d.ts +3 -2
  535. package/lib/codec/codec.d.ts +14 -1
  536. package/lib/codec/codec.d.ts.map +1 -1
  537. package/lib/codec/codec.js +11 -0
  538. package/lib/codec/codec.js.map +1 -1
  539. package/lib/codec/versioned/codec.d.ts +1 -1
  540. package/lib/codec/versioned/codec.d.ts.map +1 -1
  541. package/lib/codec/versioned/codec.js.map +1 -1
  542. package/lib/codec/versioned/format.d.ts +4 -1
  543. package/lib/codec/versioned/format.d.ts.map +1 -1
  544. package/lib/codec/versioned/format.js +4 -1
  545. package/lib/codec/versioned/format.js.map +1 -1
  546. package/lib/core/change-family/changeFamily.d.ts +4 -1
  547. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  548. package/lib/core/change-family/changeFamily.js.map +1 -1
  549. package/lib/core/change-family/index.d.ts +1 -1
  550. package/lib/core/change-family/index.d.ts.map +1 -1
  551. package/lib/core/change-family/index.js.map +1 -1
  552. package/lib/core/index.d.ts +3 -3
  553. package/lib/core/index.d.ts.map +1 -1
  554. package/lib/core/index.js +2 -2
  555. package/lib/core/index.js.map +1 -1
  556. package/lib/core/rebase/changeRebaser.d.ts +6 -1
  557. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  558. package/lib/core/rebase/changeRebaser.js.map +1 -1
  559. package/lib/core/rebase/index.d.ts +1 -1
  560. package/lib/core/rebase/index.d.ts.map +1 -1
  561. package/lib/core/rebase/index.js +1 -1
  562. package/lib/core/rebase/index.js.map +1 -1
  563. package/lib/core/rebase/types.d.ts +2 -1
  564. package/lib/core/rebase/types.d.ts.map +1 -1
  565. package/lib/core/rebase/types.js +3 -0
  566. package/lib/core/rebase/types.js.map +1 -1
  567. package/lib/core/rebase/utils.d.ts.map +1 -1
  568. package/lib/core/rebase/utils.js +25 -7
  569. package/lib/core/rebase/utils.js.map +1 -1
  570. package/lib/core/tree/detachedFieldIndex.d.ts +40 -13
  571. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  572. package/lib/core/tree/detachedFieldIndex.js +22 -13
  573. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  574. package/lib/core/tree/index.d.ts +4 -3
  575. package/lib/core/tree/index.d.ts.map +1 -1
  576. package/lib/core/tree/index.js +3 -2
  577. package/lib/core/tree/index.js.map +1 -1
  578. package/lib/core/tree/pathTree.d.ts +11 -3
  579. package/lib/core/tree/pathTree.d.ts.map +1 -1
  580. package/lib/core/tree/pathTree.js +12 -1
  581. package/lib/core/tree/pathTree.js.map +1 -1
  582. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  583. package/lib/feature-libraries/chunked-forest/basicChunk.js +8 -1
  584. package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  585. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  586. package/lib/feature-libraries/chunked-forest/chunkTree.js +4 -1
  587. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  588. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
  589. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
  590. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
  591. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
  592. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  593. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +90 -42
  594. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  595. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +232 -69
  596. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  597. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +4 -4
  598. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  599. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +34 -29
  600. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  601. package/lib/feature-libraries/default-schema/index.d.ts +2 -1
  602. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  603. package/lib/feature-libraries/default-schema/index.js +2 -1
  604. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  605. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +36 -0
  606. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
  607. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js +122 -0
  608. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
  609. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +7 -6
  610. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  611. package/lib/feature-libraries/default-schema/mappedEditBuilder.js +15 -0
  612. package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  613. package/lib/feature-libraries/deltaUtils.d.ts +1 -0
  614. package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
  615. package/lib/feature-libraries/deltaUtils.js +5 -1
  616. package/lib/feature-libraries/deltaUtils.js.map +1 -1
  617. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
  618. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  619. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +38 -8
  620. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  621. package/lib/feature-libraries/flex-tree/context.d.ts +9 -0
  622. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  623. package/lib/feature-libraries/flex-tree/context.js +6 -0
  624. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  625. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  626. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  627. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  628. package/lib/feature-libraries/flex-tree/lazyField.d.ts +8 -7
  629. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  630. package/lib/feature-libraries/flex-tree/lazyField.js +38 -9
  631. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  632. package/lib/feature-libraries/forest-summary/codec.d.ts +2 -2
  633. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  634. package/lib/feature-libraries/forest-summary/codec.js +5 -5
  635. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  636. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +9 -13
  637. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  638. package/lib/feature-libraries/forest-summary/forestSummarizer.js +17 -22
  639. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  640. package/lib/feature-libraries/forest-summary/format.d.ts +41 -5
  641. package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
  642. package/lib/feature-libraries/forest-summary/format.js +3 -3
  643. package/lib/feature-libraries/forest-summary/format.js.map +1 -1
  644. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +11 -9
  645. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  646. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +13 -26
  647. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  648. package/lib/feature-libraries/forest-summary/index.d.ts +2 -1
  649. package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
  650. package/lib/feature-libraries/forest-summary/index.js +2 -1
  651. package/lib/feature-libraries/forest-summary/index.js.map +1 -1
  652. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts +47 -0
  653. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
  654. package/lib/feature-libraries/forest-summary/summaryTypes.js +53 -0
  655. package/lib/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
  656. package/lib/feature-libraries/index.d.ts +4 -4
  657. package/lib/feature-libraries/index.d.ts.map +1 -1
  658. package/lib/feature-libraries/index.js +3 -3
  659. package/lib/feature-libraries/index.js.map +1 -1
  660. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  661. package/lib/feature-libraries/mapTreeCursor.js +2 -1
  662. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  663. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  664. package/lib/feature-libraries/mitigatedChangeFamily.js +2 -2
  665. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  666. package/lib/feature-libraries/modular-schema/comparison.d.ts +18 -2
  667. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  668. package/lib/feature-libraries/modular-schema/comparison.js +55 -5
  669. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  670. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
  671. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  672. package/lib/feature-libraries/modular-schema/crossFieldQueries.js +3 -5
  673. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  674. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +20 -52
  675. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  676. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  677. package/lib/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
  678. package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  679. package/lib/feature-libraries/modular-schema/fieldKind.js +0 -21
  680. package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  681. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  682. package/lib/feature-libraries/modular-schema/genericFieldKind.js +7 -10
  683. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  684. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js +1 -1
  685. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  686. package/lib/feature-libraries/modular-schema/index.d.ts +5 -5
  687. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  688. package/lib/feature-libraries/modular-schema/index.js +4 -3
  689. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  690. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +17 -0
  691. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
  692. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +384 -0
  693. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
  694. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +17 -0
  695. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
  696. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +409 -0
  697. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
  698. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  699. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  700. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +9 -285
  701. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  702. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +48 -15
  703. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  704. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1284 -458
  705. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  706. package/lib/feature-libraries/modular-schema/{modularChangeFormat.d.ts → modularChangeFormatV1.d.ts} +2 -2
  707. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
  708. package/lib/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +2 -2
  709. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
  710. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +146 -0
  711. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
  712. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +29 -0
  713. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
  714. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +50 -10
  715. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  716. package/lib/feature-libraries/modular-schema/modularChangeTypes.js +20 -2
  717. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  718. package/lib/feature-libraries/optional-field/index.d.ts +2 -2
  719. package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
  720. package/lib/feature-libraries/optional-field/index.js +1 -1
  721. package/lib/feature-libraries/optional-field/index.js.map +1 -1
  722. package/lib/feature-libraries/optional-field/optionalField.d.ts +5 -26
  723. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  724. package/lib/feature-libraries/optional-field/optionalField.js +217 -449
  725. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  726. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
  727. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  728. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  729. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  730. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  731. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +55 -26
  732. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  733. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
  734. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  735. package/lib/feature-libraries/schema-index/schemaSummarizer.js +38 -12
  736. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  737. package/lib/feature-libraries/sequence-field/compose.d.ts +6 -7
  738. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  739. package/lib/feature-libraries/sequence-field/compose.js +82 -258
  740. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  741. package/lib/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
  742. package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  743. package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  744. package/lib/feature-libraries/sequence-field/index.d.ts +2 -3
  745. package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
  746. package/lib/feature-libraries/sequence-field/index.js +0 -1
  747. package/lib/feature-libraries/sequence-field/index.js.map +1 -1
  748. package/lib/feature-libraries/sequence-field/invert.d.ts +3 -3
  749. package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  750. package/lib/feature-libraries/sequence-field/invert.js +67 -169
  751. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  752. package/lib/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  753. package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  754. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  755. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
  756. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  757. package/lib/feature-libraries/sequence-field/moveEffectTable.js +6 -80
  758. package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  759. package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -3
  760. package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  761. package/lib/feature-libraries/sequence-field/rebase.js +108 -114
  762. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  763. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  764. package/lib/feature-libraries/sequence-field/replaceRevisions.js +16 -33
  765. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  766. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  767. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +0 -2
  768. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  769. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
  770. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  771. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +350 -175
  772. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  773. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  774. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +21 -61
  775. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  776. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  777. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  778. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
  779. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  780. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
  781. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  782. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +14 -109
  783. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  784. package/lib/feature-libraries/sequence-field/types.d.ts +30 -59
  785. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  786. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  787. package/lib/feature-libraries/sequence-field/utils.d.ts +15 -24
  788. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  789. package/lib/feature-libraries/sequence-field/utils.js +107 -292
  790. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  791. package/lib/index.d.ts +1 -1
  792. package/lib/index.d.ts.map +1 -1
  793. package/lib/index.js +1 -1
  794. package/lib/index.js.map +1 -1
  795. package/lib/packageVersion.d.ts +1 -1
  796. package/lib/packageVersion.js +1 -1
  797. package/lib/packageVersion.js.map +1 -1
  798. package/lib/shared-tree/independentView.d.ts +1 -1
  799. package/lib/shared-tree/independentView.d.ts.map +1 -1
  800. package/lib/shared-tree/independentView.js.map +1 -1
  801. package/lib/shared-tree/index.d.ts +1 -1
  802. package/lib/shared-tree/index.d.ts.map +1 -1
  803. package/lib/shared-tree/index.js.map +1 -1
  804. package/lib/shared-tree/schematizeTree.d.ts +4 -4
  805. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  806. package/lib/shared-tree/schematizeTree.js +3 -2
  807. package/lib/shared-tree/schematizeTree.js.map +1 -1
  808. package/lib/shared-tree/schematizingTreeView.d.ts +1 -5
  809. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  810. package/lib/shared-tree/schematizingTreeView.js +35 -36
  811. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  812. package/lib/shared-tree/sharedTree.d.ts +11 -5
  813. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  814. package/lib/shared-tree/sharedTree.js +14 -4
  815. package/lib/shared-tree/sharedTree.js.map +1 -1
  816. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  817. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  818. package/lib/shared-tree/sharedTreeChangeCodecs.js +1 -0
  819. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  820. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
  821. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  822. package/lib/shared-tree/sharedTreeChangeEnricher.js +25 -11
  823. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  824. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
  825. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  826. package/lib/shared-tree/sharedTreeChangeFamily.js +3 -3
  827. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  828. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
  829. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  830. package/lib/shared-tree/sharedTreeEditBuilder.js +11 -5
  831. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  832. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  833. package/lib/shared-tree/treeAlpha.js +2 -2
  834. package/lib/shared-tree/treeAlpha.js.map +1 -1
  835. package/lib/shared-tree/treeCheckout.d.ts +12 -10
  836. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  837. package/lib/shared-tree/treeCheckout.js +69 -20
  838. package/lib/shared-tree/treeCheckout.js.map +1 -1
  839. package/lib/shared-tree-core/branch.d.ts +3 -2
  840. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  841. package/lib/shared-tree-core/branch.js +4 -3
  842. package/lib/shared-tree-core/branch.js.map +1 -1
  843. package/lib/shared-tree-core/editManager.d.ts +2 -2
  844. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  845. package/lib/shared-tree-core/editManager.js +9 -9
  846. package/lib/shared-tree-core/editManager.js.map +1 -1
  847. package/lib/shared-tree-core/editManagerCodecs.d.ts +4 -0
  848. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  849. package/lib/shared-tree-core/editManagerCodecs.js +14 -5
  850. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  851. package/{dist/shared-tree-core/editManagerCodecsV5.d.ts → lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
  852. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
  853. package/lib/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +4 -4
  854. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
  855. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +20 -6
  856. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  857. package/lib/shared-tree-core/editManagerFormatCommons.js +22 -7
  858. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  859. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  860. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  861. package/lib/shared-tree-core/editManagerFormatV1toV4.js +1 -0
  862. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  863. package/lib/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
  864. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
  865. package/lib/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
  866. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
  867. package/lib/shared-tree-core/editManagerSummarizer.d.ts +29 -9
  868. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  869. package/lib/shared-tree-core/editManagerSummarizer.js +39 -11
  870. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  871. package/lib/shared-tree-core/index.d.ts +5 -3
  872. package/lib/shared-tree-core/index.d.ts.map +1 -1
  873. package/lib/shared-tree-core/index.js +4 -2
  874. package/lib/shared-tree-core/index.js.map +1 -1
  875. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  876. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  877. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  878. package/{dist/shared-tree-core/messageCodecV5.d.ts → lib/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
  879. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
  880. package/lib/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +3 -3
  881. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
  882. package/lib/shared-tree-core/messageCodecs.d.ts +4 -0
  883. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  884. package/lib/shared-tree-core/messageCodecs.js +14 -5
  885. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  886. package/lib/shared-tree-core/messageFormat.d.ts +20 -6
  887. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  888. package/lib/shared-tree-core/messageFormat.js +22 -7
  889. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  890. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
  891. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  892. package/lib/shared-tree-core/messageFormatV1ToV4.js +8 -1
  893. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  894. package/lib/shared-tree-core/{messageFormatV5.d.ts → messageFormatVSharedBranches.d.ts} +5 -7
  895. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
  896. package/lib/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
  897. package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
  898. package/lib/shared-tree-core/sharedTreeCore.d.ts +14 -47
  899. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  900. package/lib/shared-tree-core/sharedTreeCore.js +28 -16
  901. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  902. package/lib/shared-tree-core/summaryTypes.d.ts +94 -0
  903. package/lib/shared-tree-core/summaryTypes.d.ts.map +1 -0
  904. package/lib/shared-tree-core/summaryTypes.js +43 -0
  905. package/lib/shared-tree-core/summaryTypes.js.map +1 -0
  906. package/lib/shared-tree-core/versionedSummarizer.d.ts +67 -0
  907. package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
  908. package/lib/shared-tree-core/versionedSummarizer.js +59 -0
  909. package/lib/shared-tree-core/versionedSummarizer.js.map +1 -0
  910. package/lib/simple-tree/api/configuration.d.ts +3 -26
  911. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  912. package/lib/simple-tree/api/configuration.js +14 -25
  913. package/lib/simple-tree/api/configuration.js.map +1 -1
  914. package/lib/simple-tree/api/dirtyIndex.d.ts +11 -0
  915. package/lib/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  916. package/lib/simple-tree/api/dirtyIndex.js +7 -0
  917. package/lib/simple-tree/api/dirtyIndex.js.map +1 -1
  918. package/lib/simple-tree/api/discrepancies.d.ts +1 -1
  919. package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
  920. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  921. package/lib/simple-tree/api/getSimpleSchema.d.ts +3 -3
  922. package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  923. package/lib/simple-tree/api/getSimpleSchema.js +9 -3
  924. package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
  925. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  926. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  927. package/lib/simple-tree/api/incrementalAllowedTypes.js +8 -1
  928. package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  929. package/lib/simple-tree/api/index.d.ts +3 -4
  930. package/lib/simple-tree/api/index.d.ts.map +1 -1
  931. package/lib/simple-tree/api/index.js +2 -3
  932. package/lib/simple-tree/api/index.js.map +1 -1
  933. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  934. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  935. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  936. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
  937. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  938. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  939. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  940. package/lib/simple-tree/api/schemaFactoryRecursive.js +0 -1
  941. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  942. package/lib/simple-tree/api/schemaFromSimple.d.ts +6 -1
  943. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  944. package/lib/simple-tree/api/schemaFromSimple.js +5 -0
  945. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  946. package/lib/simple-tree/api/schemaStatics.d.ts +12 -12
  947. package/lib/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
  948. package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  949. package/lib/simple-tree/api/simpleSchemaCodec.js +15 -3
  950. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  951. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  952. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  953. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  954. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
  955. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  956. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +15 -10
  957. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  958. package/lib/simple-tree/api/typesUnsafe.d.ts +3 -3
  959. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  960. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  961. package/lib/simple-tree/core/allowedTypes.d.ts +2 -2
  962. package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
  963. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  964. package/lib/simple-tree/core/index.d.ts +1 -1
  965. package/lib/simple-tree/core/index.d.ts.map +1 -1
  966. package/lib/simple-tree/core/index.js +1 -1
  967. package/lib/simple-tree/core/index.js.map +1 -1
  968. package/lib/simple-tree/core/toStored.d.ts +17 -15
  969. package/lib/simple-tree/core/toStored.d.ts.map +1 -1
  970. package/lib/simple-tree/core/toStored.js +4 -37
  971. package/lib/simple-tree/core/toStored.js.map +1 -1
  972. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
  973. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  974. package/lib/simple-tree/core/unhydratedFlexTree.js +58 -8
  975. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  976. package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
  977. package/lib/simple-tree/core/walkSchema.js +5 -1
  978. package/lib/simple-tree/core/walkSchema.js.map +1 -1
  979. package/lib/simple-tree/createContext.d.ts.map +1 -1
  980. package/lib/simple-tree/createContext.js +20 -5
  981. package/lib/simple-tree/createContext.js.map +1 -1
  982. package/lib/simple-tree/fieldSchema.d.ts +7 -7
  983. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  984. package/lib/simple-tree/fieldSchema.js.map +1 -1
  985. package/lib/simple-tree/index.d.ts +8 -7
  986. package/lib/simple-tree/index.d.ts.map +1 -1
  987. package/lib/simple-tree/index.js +6 -5
  988. package/lib/simple-tree/index.js.map +1 -1
  989. package/lib/simple-tree/leafNodeSchema.d.ts +5 -5
  990. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  991. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  992. package/lib/simple-tree/node-kinds/array/arrayNode.js +6 -4
  993. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  994. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
  995. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  996. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  997. package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
  998. package/lib/simple-tree/node-kinds/common.js +2 -2
  999. package/lib/simple-tree/node-kinds/common.js.map +1 -1
  1000. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  1001. package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
  1002. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  1003. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
  1004. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  1005. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  1006. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  1007. package/lib/simple-tree/node-kinds/object/objectNode.js +19 -19
  1008. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  1009. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
  1010. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  1011. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  1012. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  1013. package/lib/simple-tree/node-kinds/record/recordNode.js +4 -2
  1014. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  1015. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
  1016. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  1017. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  1018. package/lib/simple-tree/prepareForInsertion.d.ts +54 -47
  1019. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  1020. package/lib/simple-tree/prepareForInsertion.js +183 -124
  1021. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  1022. package/lib/simple-tree/simpleSchema.d.ts +55 -23
  1023. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  1024. package/lib/simple-tree/simpleSchema.js +16 -1
  1025. package/lib/simple-tree/simpleSchema.js.map +1 -1
  1026. package/lib/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
  1027. package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
  1028. package/lib/simple-tree/simpleSchemaFormatV1.js +8 -1
  1029. package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  1030. package/lib/simple-tree/toStoredSchema.d.ts +58 -11
  1031. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  1032. package/lib/simple-tree/toStoredSchema.js +204 -31
  1033. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  1034. package/lib/simple-tree/treeSchema.d.ts +23 -0
  1035. package/lib/simple-tree/treeSchema.d.ts.map +1 -0
  1036. package/lib/simple-tree/treeSchema.js +21 -0
  1037. package/lib/simple-tree/treeSchema.js.map +1 -0
  1038. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
  1039. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  1040. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +26 -9
  1041. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  1042. package/lib/tableSchema.d.ts +117 -63
  1043. package/lib/tableSchema.d.ts.map +1 -1
  1044. package/lib/tableSchema.js +160 -59
  1045. package/lib/tableSchema.js.map +1 -1
  1046. package/lib/treeFactory.d.ts.map +1 -1
  1047. package/lib/treeFactory.js +18 -4
  1048. package/lib/treeFactory.js.map +1 -1
  1049. package/lib/util/index.d.ts +2 -1
  1050. package/lib/util/index.d.ts.map +1 -1
  1051. package/lib/util/index.js +2 -1
  1052. package/lib/util/index.js.map +1 -1
  1053. package/lib/util/rangeMap.d.ts +24 -12
  1054. package/lib/util/rangeMap.d.ts.map +1 -1
  1055. package/lib/util/rangeMap.js +44 -5
  1056. package/lib/util/rangeMap.js.map +1 -1
  1057. package/lib/util/readSnapshotBlob.d.ts +13 -0
  1058. package/lib/util/readSnapshotBlob.d.ts.map +1 -0
  1059. package/lib/util/readSnapshotBlob.js +14 -0
  1060. package/lib/util/readSnapshotBlob.js.map +1 -0
  1061. package/package.json +21 -21
  1062. package/src/codec/codec.ts +15 -1
  1063. package/src/codec/versioned/codec.ts +1 -1
  1064. package/src/codec/versioned/format.ts +4 -1
  1065. package/src/core/change-family/changeFamily.ts +5 -0
  1066. package/src/core/change-family/index.ts +1 -0
  1067. package/src/core/index.ts +7 -2
  1068. package/src/core/rebase/changeRebaser.ts +6 -1
  1069. package/src/core/rebase/index.ts +1 -0
  1070. package/src/core/rebase/types.ts +8 -1
  1071. package/src/core/rebase/utils.ts +31 -7
  1072. package/src/core/tree/detachedFieldIndex.ts +71 -14
  1073. package/src/core/tree/index.ts +9 -3
  1074. package/src/core/tree/pathTree.ts +16 -4
  1075. package/src/feature-libraries/chunked-forest/basicChunk.ts +7 -1
  1076. package/src/feature-libraries/chunked-forest/chunkTree.ts +6 -1
  1077. package/src/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.ts +15 -7
  1078. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -9
  1079. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +393 -127
  1080. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +35 -38
  1081. package/src/feature-libraries/default-schema/index.ts +16 -5
  1082. package/src/feature-libraries/default-schema/locationBasedEditBuilder.ts +180 -0
  1083. package/src/feature-libraries/default-schema/mappedEditBuilder.ts +35 -9
  1084. package/src/feature-libraries/deltaUtils.ts +6 -1
  1085. package/src/feature-libraries/detachedFieldIndexSummarizer.ts +62 -15
  1086. package/src/feature-libraries/flex-tree/context.ts +17 -0
  1087. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +7 -8
  1088. package/src/feature-libraries/flex-tree/lazyField.ts +66 -24
  1089. package/src/feature-libraries/forest-summary/codec.ts +8 -8
  1090. package/src/feature-libraries/forest-summary/forestSummarizer.ts +45 -37
  1091. package/src/feature-libraries/forest-summary/format.ts +4 -4
  1092. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +23 -39
  1093. package/src/feature-libraries/forest-summary/index.ts +2 -1
  1094. package/src/feature-libraries/forest-summary/summaryTypes.ts +61 -0
  1095. package/src/feature-libraries/index.ts +22 -9
  1096. package/src/feature-libraries/mapTreeCursor.ts +2 -1
  1097. package/src/feature-libraries/mitigatedChangeFamily.ts +3 -1
  1098. package/src/feature-libraries/modular-schema/comparison.ts +63 -5
  1099. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +142 -44
  1100. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +36 -57
  1101. package/src/feature-libraries/modular-schema/fieldKind.ts +24 -40
  1102. package/src/feature-libraries/modular-schema/genericFieldKind.ts +10 -19
  1103. package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +1 -1
  1104. package/src/feature-libraries/modular-schema/index.ts +21 -15
  1105. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +732 -0
  1106. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +790 -0
  1107. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +29 -499
  1108. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +2542 -742
  1109. package/src/feature-libraries/modular-schema/{modularChangeFormat.ts → modularChangeFormatV1.ts} +2 -1
  1110. package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +62 -0
  1111. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +98 -10
  1112. package/src/feature-libraries/optional-field/index.ts +1 -3
  1113. package/src/feature-libraries/optional-field/optionalField.ts +317 -574
  1114. package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +24 -38
  1115. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +89 -35
  1116. package/src/feature-libraries/schema-index/schemaSummarizer.ts +59 -18
  1117. package/src/feature-libraries/sequence-field/compose.ts +134 -519
  1118. package/src/feature-libraries/sequence-field/helperTypes.ts +34 -19
  1119. package/src/feature-libraries/sequence-field/index.ts +0 -9
  1120. package/src/feature-libraries/sequence-field/invert.ts +103 -228
  1121. package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
  1122. package/src/feature-libraries/sequence-field/moveEffectTable.ts +8 -191
  1123. package/src/feature-libraries/sequence-field/rebase.ts +168 -203
  1124. package/src/feature-libraries/sequence-field/replaceRevisions.ts +31 -52
  1125. package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +0 -2
  1126. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +643 -220
  1127. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +56 -68
  1128. package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +25 -27
  1129. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +19 -129
  1130. package/src/feature-libraries/sequence-field/types.ts +34 -64
  1131. package/src/feature-libraries/sequence-field/utils.ts +133 -346
  1132. package/src/index.ts +3 -2
  1133. package/src/packageVersion.ts +1 -1
  1134. package/src/shared-tree/independentView.ts +1 -1
  1135. package/src/shared-tree/index.ts +3 -2
  1136. package/src/shared-tree/schematizeTree.ts +21 -8
  1137. package/src/shared-tree/schematizingTreeView.ts +50 -68
  1138. package/src/shared-tree/sharedTree.ts +39 -12
  1139. package/src/shared-tree/sharedTreeChangeCodecs.ts +5 -1
  1140. package/src/shared-tree/sharedTreeChangeEnricher.ts +31 -11
  1141. package/src/shared-tree/sharedTreeChangeFamily.ts +7 -4
  1142. package/src/shared-tree/sharedTreeEditBuilder.ts +46 -12
  1143. package/src/shared-tree/treeAlpha.ts +2 -3
  1144. package/src/shared-tree/treeCheckout.ts +104 -31
  1145. package/src/shared-tree-core/branch.ts +8 -2
  1146. package/src/shared-tree-core/editManager.ts +16 -2
  1147. package/src/shared-tree-core/editManagerCodecs.ts +17 -5
  1148. package/src/shared-tree-core/{editManagerCodecsV5.ts → editManagerCodecsVSharedBranches.ts} +3 -3
  1149. package/src/shared-tree-core/editManagerFormatCommons.ts +22 -7
  1150. package/src/shared-tree-core/editManagerFormatV1toV4.ts +3 -1
  1151. package/src/shared-tree-core/{editManagerFormatV5.ts → editManagerFormatVSharedBranches.ts} +2 -2
  1152. package/src/shared-tree-core/editManagerSummarizer.ts +58 -16
  1153. package/src/shared-tree-core/index.ts +11 -3
  1154. package/src/shared-tree-core/messageCodecV1ToV4.ts +2 -1
  1155. package/src/shared-tree-core/{messageCodecV5.ts → messageCodecVSharedBranches.ts} +3 -3
  1156. package/src/shared-tree-core/messageCodecs.ts +17 -5
  1157. package/src/shared-tree-core/messageFormat.ts +22 -7
  1158. package/src/shared-tree-core/messageFormatV1ToV4.ts +16 -2
  1159. package/src/shared-tree-core/{messageFormatV5.ts → messageFormatVSharedBranches.ts} +4 -6
  1160. package/src/shared-tree-core/sharedTreeCore.ts +67 -76
  1161. package/src/shared-tree-core/summaryTypes.ts +122 -0
  1162. package/src/shared-tree-core/versionedSummarizer.ts +107 -0
  1163. package/src/simple-tree/api/configuration.ts +21 -68
  1164. package/src/simple-tree/api/dirtyIndex.ts +11 -0
  1165. package/src/simple-tree/api/discrepancies.ts +1 -1
  1166. package/src/simple-tree/api/getSimpleSchema.ts +13 -6
  1167. package/src/simple-tree/api/incrementalAllowedTypes.ts +15 -3
  1168. package/src/simple-tree/api/index.ts +3 -4
  1169. package/src/simple-tree/api/schemaCompatibilityTester.ts +1 -1
  1170. package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -2
  1171. package/src/simple-tree/api/schemaFactoryRecursive.ts +0 -2
  1172. package/src/simple-tree/api/schemaFromSimple.ts +11 -5
  1173. package/src/simple-tree/api/simpleSchemaCodec.ts +17 -3
  1174. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -1
  1175. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +18 -10
  1176. package/src/simple-tree/api/typesUnsafe.ts +7 -3
  1177. package/src/simple-tree/core/allowedTypes.ts +3 -3
  1178. package/src/simple-tree/core/index.ts +2 -2
  1179. package/src/simple-tree/core/toStored.ts +22 -55
  1180. package/src/simple-tree/core/unhydratedFlexTree.ts +87 -36
  1181. package/src/simple-tree/core/walkSchema.ts +6 -0
  1182. package/src/simple-tree/createContext.ts +26 -11
  1183. package/src/simple-tree/fieldSchema.ts +16 -7
  1184. package/src/simple-tree/index.ts +12 -11
  1185. package/src/simple-tree/node-kinds/array/arrayNode.ts +12 -7
  1186. package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +3 -3
  1187. package/src/simple-tree/node-kinds/common.ts +2 -5
  1188. package/src/simple-tree/node-kinds/map/mapNode.ts +9 -6
  1189. package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +3 -3
  1190. package/src/simple-tree/node-kinds/object/objectNode.ts +26 -26
  1191. package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +6 -2
  1192. package/src/simple-tree/node-kinds/record/recordNode.ts +15 -11
  1193. package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +3 -3
  1194. package/src/simple-tree/prepareForInsertion.ts +343 -200
  1195. package/src/simple-tree/simpleSchema.ts +79 -32
  1196. package/src/simple-tree/simpleSchemaFormatV1.ts +9 -1
  1197. package/src/simple-tree/toStoredSchema.ts +319 -61
  1198. package/src/simple-tree/treeSchema.ts +54 -0
  1199. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +42 -14
  1200. package/src/tableSchema.ts +485 -166
  1201. package/src/treeFactory.ts +19 -5
  1202. package/src/util/index.ts +5 -0
  1203. package/src/util/rangeMap.ts +72 -18
  1204. package/src/util/readSnapshotBlob.ts +23 -0
  1205. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
  1206. package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
  1207. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
  1208. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
  1209. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -50
  1210. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
  1211. package/dist/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
  1212. package/dist/shared-tree-core/editManagerCodecsV5.js.map +0 -1
  1213. package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
  1214. package/dist/shared-tree-core/editManagerFormatV5.js.map +0 -1
  1215. package/dist/shared-tree-core/messageCodecV5.d.ts.map +0 -1
  1216. package/dist/shared-tree-core/messageCodecV5.js.map +0 -1
  1217. package/dist/shared-tree-core/messageFormatV5.d.ts.map +0 -1
  1218. package/dist/shared-tree-core/messageFormatV5.js.map +0 -1
  1219. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
  1220. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
  1221. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +0 -177
  1222. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
  1223. package/docs/main/sequence-field/move-composition.md +0 -46
  1224. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
  1225. package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
  1226. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
  1227. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
  1228. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -46
  1229. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
  1230. package/lib/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
  1231. package/lib/shared-tree-core/editManagerCodecsV5.js.map +0 -1
  1232. package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
  1233. package/lib/shared-tree-core/editManagerFormatV5.js.map +0 -1
  1234. package/lib/shared-tree-core/messageCodecV5.d.ts.map +0 -1
  1235. package/lib/shared-tree-core/messageCodecV5.js.map +0 -1
  1236. package/lib/shared-tree-core/messageFormatV5.d.ts.map +0 -1
  1237. package/lib/shared-tree-core/messageFormatV5.js.map +0 -1
  1238. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
  1239. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
  1240. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +0 -171
  1241. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
  1242. package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +0 -57
  1243. package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +0 -209
@@ -1 +1 @@
1
- {"version":3,"file":"changeRebaser.d.ts","sourceRoot":"","sources":["../../../src/core/rebase/changeRebaser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,WAAW,aAAa,CAAC,UAAU;IACxC,UAAU,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IAEnC;;;OAGG;IACH,OAAO,CAAC,OAAO,EAAE,YAAY,CAAC,UAAU,CAAC,EAAE,GAAG,UAAU,CAAC;IAEzD;;;;;;;;;;;;OAYG;IACH,MAAM,CACL,OAAO,EAAE,YAAY,CAAC,UAAU,CAAC,EACjC,UAAU,EAAE,OAAO,EACnB,QAAQ,EAAE,WAAW,GACnB,UAAU,CAAC;IAEd;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CACL,MAAM,EAAE,YAAY,CAAC,UAAU,CAAC,EAChC,IAAI,EAAE,YAAY,CAAC,UAAU,CAAC,EAC9B,gBAAgB,EAAE,sBAAsB,GACtC,UAAU,CAAC;IAEd,cAAc,CACb,MAAM,EAAE,UAAU,EAClB,WAAW,EAAE,WAAW,GAAG,SAAS,EACpC,UAAU,CAAC,EAAE,WAAW,GACtB,UAAU,CAAC;CACd;AAED,MAAM,WAAW,YAAY,CAAC,UAAU,EAA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,iBAAiB;IAC5B,UAAU,IAAA;IACV,OAAO,IAAA;IACP,QAAQ,IAAA;CACR"}
@@ -1 +1 @@
1
- {"version":3,"file":"changeRebaser.js","sourceRoot":"","sources":["../../../src/core/rebase/changeRebaser.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAyGH,SAAgB,eAAe,CAC9B,KAAwB,EACxB,MAAY;IAEZ,OAAO,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,CAAC;AAC7B,CAAC;AALD,0CAKC;AA6BD,SAAgB,SAAS,CAAI,MAAS,EAAE,QAAiC;IACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AAC7B,CAAC;AAFD,8BAEC;AAED,SAAgB,kBAAkB,CACjC,aAAsB,EACtB,QAAc,EACd,UAAmC;IAEnC,OAAO;QACN,QAAQ;QACR,MAAM,EAAE,aAAa;QACrB,UAAU;KACV,CAAC;AACH,CAAC;AAVD,gDAUC;AAED,SAAgB,cAAc,CAAI,MAAS;IAC1C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;AACxC,CAAC;AAFD,wCAEC;AAMD,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC5B,qEAAU,CAAA;IACV,+DAAO,CAAA;IACP,iEAAQ,CAAA;AACT,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Invariant } from \"../../util/index.js\";\n\nimport type { RevisionTag } from \"./types.js\";\n\n/**\n * Rebasing logic for a particular kind of change.\n *\n * This interface is used to provide rebase policy to `Rebaser`.\n *\n * The implementation must ensure TChangeset forms a {@link https://en.wikipedia.org/wiki/Group_(mathematics | group}) where:\n * - `compose([])` is the identity element.\n * - associativity is defined as `compose([...a, ...b])` is equal to\n * `compose([compose(a), compose(b)])` for all `a` and `b`.\n * - `inverse(a)` gives the inverse element of `a`.\n *\n * In these requirements the definition of equality is up to the implementer,\n * but it is required that any two changes which are considered equal:\n * - have the same impact when applied to any tree.\n * - can be substituted for each-other in all methods on this\n * interface and produce equal (by this same definition) results.\n *\n * For the sake of testability, implementations will likely want to have a concrete equality implementation.\n *\n * This API uses `compose` on arrays instead of an explicit identity element and associative binary operator\n * to allow the implementation more room for optimization,\n * but should otherwise be equivalent to the identity element and binary operator group approach.\n *\n * TODO:\n * Be more specific about the above requirements.\n * For example, would something that is close to forming a group but has precision issues\n * (ex: the floating point numbers and addition) be ok?\n * Would this cause decoherence (and thus be absolutely not ok),\n * or just minor semantic precision issues, which could be tolerated.\n * For now assume that such issues are not ok.\n */\nexport interface ChangeRebaser<TChangeset> {\n\t_typeCheck?: Invariant<TChangeset>;\n\n\t/**\n\t * Compose a collection of changesets into a single one.\n\t * See {@link ChangeRebaser} for requirements.\n\t */\n\tcompose(changes: TaggedChange<TChangeset>[]): TChangeset;\n\n\t/**\n\t * @param changes - The changes to invert.\n\t * @param isRollback - Whether the inverted change is meant to rollback a change on a branch as is the case when\n\t * performing a sandwich rebase.\n\t * @param revision - The revision for the invert changeset.\n\t * This flag is relevant to merge semantics that are dependent on edit sequencing order:\n\t * - In the context of an undo, this function inverts a change that is sequenced and applied before the produced inverse.\n\t * - In the context of a rollback, this function inverts a change that is sequenced after but applied before the produced inverse.\n\t * @returns the inverse of `changes`.\n\t *\n\t * `compose([changes, inverse(changes)])` be equal to `compose([])`:\n\t * See {@link ChangeRebaser} for details.\n\t */\n\tinvert(\n\t\tchanges: TaggedChange<TChangeset>,\n\t\tisRollback: boolean,\n\t\trevision: RevisionTag,\n\t): TChangeset;\n\n\t/**\n\t * Rebase `change` over `over`.\n\t *\n\t * The resulting changeset should, as much as possible, replicate the same semantics as `change`,\n\t * except be valid to apply after `over` instead of before it.\n\t *\n\t * When rebasing `change` onto a new branch, `revisionMetadata` should include entries for all changesets\n\t * from the source which are being rebased onto the target branch.\n\t *\n\t * Requirements:\n\t * The implementation must ensure that for all possible changesets `a`, `b` and `c`:\n\t * - `rebase(a, compose([b, c])` is equal to `rebase(rebase(a, b), c)`.\n\t * - `rebase(compose([a, b]), c)` is equal to\n\t * `compose([rebase(a, c), rebase(b, compose([inverse(a), c, rebase(a, c)])])`.\n\t * - `rebase(a, compose([]))` is equal to `a`.\n\t * - `rebase(compose([]), a)` is equal to `compose([])`.\n\t */\n\trebase(\n\t\tchange: TaggedChange<TChangeset>,\n\t\tover: TaggedChange<TChangeset>,\n\t\trevisionMetadata: RevisionMetadataSource,\n\t): TChangeset;\n\n\tchangeRevision(\n\t\tchange: TChangeset,\n\t\tnewRevision: RevisionTag | undefined,\n\t\trollBackOf?: RevisionTag,\n\t): TChangeset;\n}\n\nexport interface TaggedChange<TChangeset, TTag = RevisionTag | undefined> {\n\treadonly revision: TTag;\n\t/**\n\t * When populated, indicates that the changeset is a rollback for the purpose of a rebase sandwich.\n\t * The value corresponds to the `revision` of the original changeset being rolled back.\n\t */\n\treadonly rollbackOf?: RevisionTag;\n\treadonly change: TChangeset;\n}\n\nexport function mapTaggedChange<TIn, TOut>(\n\tinput: TaggedChange<TIn>,\n\tchange: TOut,\n): TaggedChange<TOut> {\n\treturn { ...input, change };\n}\n\n/**\n * A callback that returns the index of the changeset associated with the given RevisionTag among the changesets being\n * composed or rebased. This index is solely meant to communicate relative ordering, and is only valid within the scope of the\n * compose or rebase operation.\n *\n * During composition, the index reflects the order of the changeset within the overall composed changeset that is\n * being produced.\n *\n * During rebase, the indices of the base changes are all lower than the indices of the change being rebased.\n */\nexport type RevisionIndexer = (tag: RevisionTag) => number | undefined;\n\nexport interface RevisionMetadataSource {\n\treadonly getIndex: RevisionIndexer;\n\treadonly tryGetInfo: (tag: RevisionTag | undefined) => RevisionInfo | undefined;\n\treadonly hasRollback: (tag: RevisionTag) => boolean;\n}\n\nexport interface RevisionInfo {\n\treadonly revision: RevisionTag;\n\t/**\n\t * When populated, indicates that the changeset is a rollback for the purpose of a rebase sandwich.\n\t * The value corresponds to the `revision` of the original changeset being rolled back.\n\t */\n\treadonly rollbackOf?: RevisionTag;\n}\n\nexport function tagChange<T>(change: T, revision: RevisionTag | undefined): TaggedChange<T> {\n\treturn { revision, change };\n}\n\nexport function tagRollbackInverse<TChange, TTag>(\n\tinverseChange: TChange,\n\trevision: TTag,\n\trollbackOf: RevisionTag | undefined,\n): TaggedChange<TChange, TTag> {\n\treturn {\n\t\trevision,\n\t\tchange: inverseChange,\n\t\trollbackOf,\n\t};\n}\n\nexport function makeAnonChange<T>(change: T): TaggedChange<T> {\n\treturn { revision: undefined, change };\n}\n\nexport interface FinalChange {\n\treadonly status: FinalChangeStatus;\n}\n\nexport enum FinalChangeStatus {\n\tconflicted,\n\trebased,\n\tcommuted,\n}\n"]}
1
+ {"version":3,"file":"changeRebaser.js","sourceRoot":"","sources":["../../../src/core/rebase/changeRebaser.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAyGH,SAAgB,eAAe,CAC9B,KAAwB,EACxB,MAAY;IAEZ,OAAO,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,CAAC;AAC7B,CAAC;AALD,0CAKC;AAkCD,SAAgB,SAAS,CAAI,MAAS,EAAE,QAAiC;IACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AAC7B,CAAC;AAFD,8BAEC;AAED,SAAgB,kBAAkB,CACjC,aAAsB,EACtB,QAAc,EACd,UAAmC;IAEnC,OAAO;QACN,QAAQ;QACR,MAAM,EAAE,aAAa;QACrB,UAAU;KACV,CAAC;AACH,CAAC;AAVD,gDAUC;AAED,SAAgB,cAAc,CAAI,MAAS;IAC1C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;AACxC,CAAC;AAFD,wCAEC;AAMD,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC5B,qEAAU,CAAA;IACV,+DAAO,CAAA;IACP,iEAAQ,CAAA;AACT,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Invariant } from \"../../util/index.js\";\n\nimport type { RevisionTag } from \"./types.js\";\n\n/**\n * Rebasing logic for a particular kind of change.\n *\n * This interface is used to provide rebase policy to `Rebaser`.\n *\n * The implementation must ensure TChangeset forms a {@link https://en.wikipedia.org/wiki/Group_(mathematics | group}) where:\n * - `compose([])` is the identity element.\n * - associativity is defined as `compose([...a, ...b])` is equal to\n * `compose([compose(a), compose(b)])` for all `a` and `b`.\n * - `inverse(a)` gives the inverse element of `a`.\n *\n * In these requirements the definition of equality is up to the implementer,\n * but it is required that any two changes which are considered equal:\n * - have the same impact when applied to any tree.\n * - can be substituted for each-other in all methods on this\n * interface and produce equal (by this same definition) results.\n *\n * For the sake of testability, implementations will likely want to have a concrete equality implementation.\n *\n * This API uses `compose` on arrays instead of an explicit identity element and associative binary operator\n * to allow the implementation more room for optimization,\n * but should otherwise be equivalent to the identity element and binary operator group approach.\n *\n * TODO:\n * Be more specific about the above requirements.\n * For example, would something that is close to forming a group but has precision issues\n * (ex: the floating point numbers and addition) be ok?\n * Would this cause decoherence (and thus be absolutely not ok),\n * or just minor semantic precision issues, which could be tolerated.\n * For now assume that such issues are not ok.\n */\nexport interface ChangeRebaser<TChangeset> {\n\t_typeCheck?: Invariant<TChangeset>;\n\n\t/**\n\t * Compose a collection of changesets into a single one.\n\t * See {@link ChangeRebaser} for requirements.\n\t */\n\tcompose(changes: TaggedChange<TChangeset>[]): TChangeset;\n\n\t/**\n\t * @param changes - The changes to invert.\n\t * @param isRollback - Whether the inverted change is meant to rollback a change on a branch as is the case when\n\t * performing a sandwich rebase.\n\t * @param revision - The revision for the invert changeset.\n\t * This flag is relevant to merge semantics that are dependent on edit sequencing order:\n\t * - In the context of an undo, this function inverts a change that is sequenced and applied before the produced inverse.\n\t * - In the context of a rollback, this function inverts a change that is sequenced after but applied before the produced inverse.\n\t * @returns the inverse of `changes`.\n\t *\n\t * `compose([changes, inverse(changes)])` be equal to `compose([])`:\n\t * See {@link ChangeRebaser} for details.\n\t */\n\tinvert(\n\t\tchanges: TaggedChange<TChangeset>,\n\t\tisRollback: boolean,\n\t\trevision: RevisionTag,\n\t): TChangeset;\n\n\t/**\n\t * Rebase `change` over `over`.\n\t *\n\t * The resulting changeset should, as much as possible, replicate the same semantics as `change`,\n\t * except be valid to apply after `over` instead of before it.\n\t *\n\t * When rebasing `change` onto a new branch, `revisionMetadata` should include entries for all changesets\n\t * from the source which are being rebased onto the target branch.\n\t *\n\t * Requirements:\n\t * The implementation must ensure that for all possible changesets `a`, `b` and `c`:\n\t * - `rebase(a, compose([b, c])` is equal to `rebase(rebase(a, b), c)`.\n\t * - `rebase(compose([a, b]), c)` is equal to\n\t * `compose([rebase(a, c), rebase(b, compose([inverse(a), c, rebase(a, c)])])`.\n\t * - `rebase(a, compose([]))` is equal to `a`.\n\t * - `rebase(compose([]), a)` is equal to `compose([])`.\n\t */\n\trebase(\n\t\tchange: TaggedChange<TChangeset>,\n\t\tover: TaggedChange<TChangeset>,\n\t\trevisionMetadata: RevisionMetadataSource,\n\t): TChangeset;\n\n\tchangeRevision(\n\t\tchange: TChangeset,\n\t\tnewRevision: RevisionTag | undefined,\n\t\trollBackOf?: RevisionTag,\n\t): TChangeset;\n}\n\nexport interface TaggedChange<TChangeset, TTag = RevisionTag | undefined> {\n\treadonly revision: TTag;\n\t/**\n\t * When populated, indicates that the changeset is a rollback for the purpose of a rebase sandwich.\n\t * The value corresponds to the `revision` of the original changeset being rolled back.\n\t */\n\treadonly rollbackOf?: RevisionTag;\n\treadonly change: TChangeset;\n}\n\nexport function mapTaggedChange<TIn, TOut>(\n\tinput: TaggedChange<TIn>,\n\tchange: TOut,\n): TaggedChange<TOut> {\n\treturn { ...input, change };\n}\n\n/**\n * A callback that returns the index of the changeset associated with the given RevisionTag among the changesets being\n * composed or rebased. This index is solely meant to communicate relative ordering, and is only valid within the scope of the\n * compose or rebase operation.\n *\n * During composition, the index reflects the order of the changeset within the overall composed changeset that is\n * being produced.\n *\n * During rebase, the indices of the base changes are all lower than the indices of the change being rebased.\n */\nexport type RevisionIndexer = (tag: RevisionTag) => number | undefined;\n\nexport interface RevisionMetadataSource {\n\t/**\n\t * @returns a positive number if tag2 is a later revision than tag1 or a negative number if tag2 is an earlier revision.\n\t * Returns zero is the order cannot be determined, which happens if both revisions are older\n\t * than the set of revisions handled by this metadata source.\n\t */\n\treadonly compareRevisions: (tag1: RevisionTag, tag2: RevisionTag) => number;\n\treadonly tryGetInfo: (tag: RevisionTag | undefined) => RevisionInfo | undefined;\n\treadonly hasRollback: (tag: RevisionTag) => boolean;\n}\n\nexport interface RevisionInfo {\n\treadonly revision: RevisionTag;\n\t/**\n\t * When populated, indicates that the changeset is a rollback for the purpose of a rebase sandwich.\n\t * The value corresponds to the `revision` of the original changeset being rolled back.\n\t */\n\treadonly rollbackOf?: RevisionTag;\n}\n\nexport function tagChange<T>(change: T, revision: RevisionTag | undefined): TaggedChange<T> {\n\treturn { revision, change };\n}\n\nexport function tagRollbackInverse<TChange, TTag>(\n\tinverseChange: TChange,\n\trevision: TTag,\n\trollbackOf: RevisionTag | undefined,\n): TaggedChange<TChange, TTag> {\n\treturn {\n\t\trevision,\n\t\tchange: inverseChange,\n\t\trollbackOf,\n\t};\n}\n\nexport function makeAnonChange<T>(change: T): TaggedChange<T> {\n\treturn { revision: undefined, change };\n}\n\nexport interface FinalChange {\n\treadonly status: FinalChangeStatus;\n}\n\nexport enum FinalChangeStatus {\n\tconflicted,\n\trebased,\n\tcommuted,\n}\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, areEqualChangeAtomIdOpts, makeChangeAtomId, asChangeAtomId, mintCommit, type GraphCommit, CommitKind, type CommitMetadata, type RevisionTag, RevisionTagSchema, type EncodedRevisionTag, type EncodedChangeAtomId, type EncodedStableId, type ChangesetLocalId, type ChangeAtomId, type ChangeAtomIdMap, SessionIdSchema, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, StableIdSchema, subtractChangeAtomIds, replaceAtomRevisions, type ChangeAtomIdRangeMap, newChangeAtomIdRangeMap, compareRevisions, } from "./types.js";
5
+ export { areEqualChangeAtomIds, areEqualChangeAtomIdOpts, makeChangeAtomId, asChangeAtomId, mintCommit, type GraphCommit, CommitKind, type CommitMetadata, type RevisionTag, RevisionTagSchema, type EncodedRevisionTag, type EncodedChangeAtomId, type EncodedStableId, type ChangesetLocalId, type ChangeAtomId, type ChangeAtomIdMap, SessionIdSchema, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, StableIdSchema, subtractChangeAtomIds, replaceAtomRevisions, type ChangeAtomIdRangeMap, newChangeAtomIdRangeMap, newChangeAtomIdTransform, compareRevisions, } 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, replaceChange, isAncestor, diffHistories, } 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,wBAAwB,EACxB,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,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,oBAAoB,EACzB,uBAAuB,EACvB,gBAAgB,GAChB,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,EAC5B,aAAa,EACb,UAAU,EACV,aAAa,GACb,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,wBAAwB,EACxB,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,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,oBAAoB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,GAChB,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,EAC5B,aAAa,EACb,UAAU,EACV,aAAa,GACb,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.diffHistories = exports.isAncestor = exports.replaceChange = 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.compareRevisions = exports.newChangeAtomIdRangeMap = exports.replaceAtomRevisions = exports.subtractChangeAtomIds = exports.StableIdSchema = exports.offsetChangeAtomId = exports.taggedOptAtomId = exports.taggedAtomId = exports.SessionIdSchema = exports.RevisionTagSchema = exports.CommitKind = exports.mintCommit = exports.asChangeAtomId = exports.makeChangeAtomId = exports.areEqualChangeAtomIdOpts = exports.areEqualChangeAtomIds = void 0;
7
+ exports.diffHistories = exports.isAncestor = exports.replaceChange = 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.compareRevisions = exports.newChangeAtomIdTransform = exports.newChangeAtomIdRangeMap = exports.replaceAtomRevisions = exports.subtractChangeAtomIds = exports.StableIdSchema = exports.offsetChangeAtomId = exports.taggedOptAtomId = exports.taggedAtomId = exports.SessionIdSchema = exports.RevisionTagSchema = exports.CommitKind = exports.mintCommit = exports.asChangeAtomId = exports.makeChangeAtomId = exports.areEqualChangeAtomIdOpts = 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, "areEqualChangeAtomIdOpts", { enumerable: true, get: function () { return types_js_1.areEqualChangeAtomIdOpts; } });
@@ -21,6 +21,7 @@ Object.defineProperty(exports, "StableIdSchema", { enumerable: true, get: functi
21
21
  Object.defineProperty(exports, "subtractChangeAtomIds", { enumerable: true, get: function () { return types_js_1.subtractChangeAtomIds; } });
22
22
  Object.defineProperty(exports, "replaceAtomRevisions", { enumerable: true, get: function () { return types_js_1.replaceAtomRevisions; } });
23
23
  Object.defineProperty(exports, "newChangeAtomIdRangeMap", { enumerable: true, get: function () { return types_js_1.newChangeAtomIdRangeMap; } });
24
+ Object.defineProperty(exports, "newChangeAtomIdTransform", { enumerable: true, get: function () { return types_js_1.newChangeAtomIdTransform; } });
24
25
  Object.defineProperty(exports, "compareRevisions", { enumerable: true, get: function () { return types_js_1.compareRevisions; } });
25
26
  var revisionTagCodec_js_1 = require("./revisionTagCodec.js");
26
27
  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,uCA2BoB;AA1BnB,iHAAA,qBAAqB,OAAA;AACrB,oHAAA,wBAAwB,OAAA;AACxB,4GAAA,gBAAgB,OAAA;AAChB,0GAAA,cAAc,OAAA;AACd,sGAAA,UAAU,OAAA;AAEV,sGAAA,UAAU,OAAA;AAGV,6GAAA,iBAAiB,OAAA;AAOjB,2GAAA,eAAe,OAAA;AACf,wGAAA,YAAY,OAAA;AACZ,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,0GAAA,cAAc,OAAA;AACd,iHAAA,qBAAqB,OAAA;AACrB,gHAAA,oBAAoB,OAAA;AAEpB,mHAAA,uBAAuB,OAAA;AACvB,4GAAA,gBAAgB,OAAA;AAEjB,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,uCAaoB;AAZnB,wGAAA,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAClB,wGAAA,YAAY,OAAA;AAEZ,wGAAA,YAAY,OAAA;AACZ,mHAAA,uBAAuB,OAAA;AACvB,0HAAA,8BAA8B,OAAA;AAG9B,yGAAA,aAAa,OAAA;AACb,sGAAA,UAAU,OAAA;AACV,yGAAA,aAAa,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tareEqualChangeAtomIds,\n\tareEqualChangeAtomIdOpts,\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 EncodedStableId,\n\ttype ChangesetLocalId,\n\ttype ChangeAtomId,\n\ttype ChangeAtomIdMap,\n\tSessionIdSchema,\n\ttaggedAtomId,\n\ttaggedOptAtomId,\n\toffsetChangeAtomId,\n\tStableIdSchema,\n\tsubtractChangeAtomIds,\n\treplaceAtomRevisions,\n\ttype ChangeAtomIdRangeMap,\n\tnewChangeAtomIdRangeMap,\n\tcompareRevisions,\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\treplaceChange,\n\tisAncestor,\n\tdiffHistories,\n} from \"./utils.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/rebase/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uCA4BoB;AA3BnB,iHAAA,qBAAqB,OAAA;AACrB,oHAAA,wBAAwB,OAAA;AACxB,4GAAA,gBAAgB,OAAA;AAChB,0GAAA,cAAc,OAAA;AACd,sGAAA,UAAU,OAAA;AAEV,sGAAA,UAAU,OAAA;AAGV,6GAAA,iBAAiB,OAAA;AAOjB,2GAAA,eAAe,OAAA;AACf,wGAAA,YAAY,OAAA;AACZ,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,0GAAA,cAAc,OAAA;AACd,iHAAA,qBAAqB,OAAA;AACrB,gHAAA,oBAAoB,OAAA;AAEpB,mHAAA,uBAAuB,OAAA;AACvB,oHAAA,wBAAwB,OAAA;AACxB,4GAAA,gBAAgB,OAAA;AAEjB,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,uCAaoB;AAZnB,wGAAA,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAClB,wGAAA,YAAY,OAAA;AAEZ,wGAAA,YAAY,OAAA;AACZ,mHAAA,uBAAuB,OAAA;AACvB,0HAAA,8BAA8B,OAAA;AAG9B,yGAAA,aAAa,OAAA;AACb,sGAAA,UAAU,OAAA;AACV,yGAAA,aAAa,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tareEqualChangeAtomIds,\n\tareEqualChangeAtomIdOpts,\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 EncodedStableId,\n\ttype ChangesetLocalId,\n\ttype ChangeAtomId,\n\ttype ChangeAtomIdMap,\n\tSessionIdSchema,\n\ttaggedAtomId,\n\ttaggedOptAtomId,\n\toffsetChangeAtomId,\n\tStableIdSchema,\n\tsubtractChangeAtomIds,\n\treplaceAtomRevisions,\n\ttype ChangeAtomIdRangeMap,\n\tnewChangeAtomIdRangeMap,\n\tnewChangeAtomIdTransform,\n\tcompareRevisions,\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\treplaceChange,\n\tisAncestor,\n\tdiffHistories,\n} from \"./utils.js\";\n"]}
@@ -57,7 +57,7 @@ export declare function makeChangeAtomId(localId: ChangesetLocalId, revision?: R
57
57
  export declare function asChangeAtomId(id: ChangesetLocalId | ChangeAtomId): ChangeAtomId;
58
58
  export declare function taggedAtomId(id: ChangeAtomId, revision: RevisionTag | undefined): ChangeAtomId;
59
59
  export declare function taggedOptAtomId(id: ChangeAtomId | undefined, revision: RevisionTag | undefined): ChangeAtomId | undefined;
60
- export declare function offsetChangeAtomId(id: ChangeAtomId, offset: number): ChangeAtomId;
60
+ export declare function offsetChangeAtomId<T extends ChangeAtomId = ChangeAtomId>(id: T, offset: number): T;
61
61
  export declare function replaceAtomRevisions(id: ChangeAtomId, oldRevisions: Set<RevisionTag | undefined>, newRevision: RevisionTag | undefined): ChangeAtomId;
62
62
  /**
63
63
  * A node in a graph of commits. A commit's parent is the commit on which it was based.
@@ -107,6 +107,7 @@ export interface CommitMetadata {
107
107
  export declare function mintCommit<TChange>(parent: GraphCommit<TChange>, commit: Omit<GraphCommit<TChange>, "parent">): GraphCommit<TChange>;
108
108
  export type ChangeAtomIdRangeMap<V> = RangeMap<ChangeAtomId, V>;
109
109
  export declare function newChangeAtomIdRangeMap<V>(): ChangeAtomIdRangeMap<V>;
110
+ export declare function newChangeAtomIdTransform(): ChangeAtomIdRangeMap<ChangeAtomId>;
110
111
  export declare function subtractChangeAtomIds(a: ChangeAtomId, b: ChangeAtomId): number;
111
112
  export declare function compareRevisions(a: RevisionTag | undefined, b: RevisionTag | undefined): number;
112
113
  //# sourceMappingURL=types.d.ts.map
@@ -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,QAAQ,EACR,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EACN,KAAK,KAAK,E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"__esModule", { value: true });
7
- exports.compareRevisions = exports.subtractChangeAtomIds = exports.newChangeAtomIdRangeMap = exports.mintCommit = exports.CommitKind = exports.replaceAtomRevisions = exports.offsetChangeAtomId = exports.taggedOptAtomId = exports.taggedAtomId = exports.asChangeAtomId = exports.makeChangeAtomId = exports.areEqualChangeAtomIdOpts = exports.areEqualChangeAtomIds = exports.StableIdSchema = exports.RevisionTagSchema = exports.SessionIdSchema = void 0;
7
+ exports.compareRevisions = exports.subtractChangeAtomIds = exports.newChangeAtomIdTransform = exports.newChangeAtomIdRangeMap = exports.mintCommit = exports.CommitKind = exports.replaceAtomRevisions = exports.offsetChangeAtomId = exports.taggedOptAtomId = exports.taggedAtomId = exports.asChangeAtomId = exports.makeChangeAtomId = exports.areEqualChangeAtomIdOpts = exports.areEqualChangeAtomIds = exports.StableIdSchema = 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
  /**
@@ -102,6 +102,10 @@ function newChangeAtomIdRangeMap() {
102
102
  return new index_js_1.RangeMap(offsetChangeAtomId, subtractChangeAtomIds);
103
103
  }
104
104
  exports.newChangeAtomIdRangeMap = newChangeAtomIdRangeMap;
105
+ function newChangeAtomIdTransform() {
106
+ return new index_js_1.RangeMap(offsetChangeAtomId, subtractChangeAtomIds, offsetChangeAtomId);
107
+ }
108
+ exports.newChangeAtomIdTransform = newChangeAtomIdTransform;
105
109
  function subtractChangeAtomIds(a, b) {
106
110
  const cmp = compareRevisions(a.revision, b.revision);
107
111
  if (cmp !== 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/rebase/types.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH,+CAAyC;AAEzC,kDAO6B;AAE7B;;GAEG;AACU,QAAA,eAAe,GAAG,IAAA,4BAAiB,GAAa,CAAC;AAWjD,QAAA,iBAAiB,GAAG,cAAI,CAAC,KAA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ACtC,OAAO,IAAI,mBAAQ,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,CAAC;AAChE,CAAC;AAFD,0DAEC;AAED,SAAgB,qBAAqB,CAAC,CAAe,EAAE,CAAe;IACrE,MAAM,GAAG,GAAG,gBAAgB,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;IACrD,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC;QACf,OAAO,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACvC,CAAC;IAED,OAAO,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC;AAC9B,CAAC;AAPD,sDAOC;AAED,SAAgB,gBAAgB,CAC/B,CAA0B,EAC1B,CAA0B;IAE1B,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QACrB,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC;SAAM,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,CAAC,CAAC;IACV,CAAC;SAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAClB,OAAO,CAAC,CAAC,CAAC;IACX,CAAC;SAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAClB,OAAO,CAAC,CAAC;IACV,CAAC;IAED,OAAO,CAAC,CAAC;AACV,CAAC;AAfD,4CAeC","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\tStableId,\n} from \"@fluidframework/id-compressor\";\nimport { Type } from \"@sinclair/typebox\";\n\nimport {\n\ttype Brand,\n\ttype NestedMap,\n\tRangeMap,\n\tbrand,\n\tbrandedNumberType,\n\tbrandedStringType,\n} from \"../../util/index.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 */\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\nexport type EncodedStableId = Brand<StableId, \"EncodedStableId\">;\nexport const StableIdSchema = Type.String();\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 */\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 * *\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\nexport type ChangeAtomIdMap<T> = NestedMap<RevisionTag | undefined, ChangesetLocalId, 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\nexport function areEqualChangeAtomIdOpts(\n\ta: ChangeAtomId | undefined,\n\tb: ChangeAtomId | undefined,\n): boolean {\n\tif (a === undefined || b === undefined) {\n\t\treturn a === b;\n\t}\n\n\treturn areEqualChangeAtomIds(a, b);\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}\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 from this client. */\n\tDefault,\n\t/** A commit that is the result of an undo from this client. */\n\tUndo,\n\t/** A commit that is the result of a redo from this client. */\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 type ChangeAtomIdRangeMap<V> = RangeMap<ChangeAtomId, V>;\n\nexport function newChangeAtomIdRangeMap<V>(): ChangeAtomIdRangeMap<V> {\n\treturn new RangeMap(offsetChangeAtomId, subtractChangeAtomIds);\n}\n\nexport function subtractChangeAtomIds(a: ChangeAtomId, b: ChangeAtomId): number {\n\tconst cmp = compareRevisions(a.revision, b.revision);\n\tif (cmp !== 0) {\n\t\treturn cmp * Number.POSITIVE_INFINITY;\n\t}\n\n\treturn a.localId - b.localId;\n}\n\nexport function compareRevisions(\n\ta: RevisionTag | undefined,\n\tb: RevisionTag | undefined,\n): number {\n\tif (a === undefined) {\n\t\treturn b === undefined ? 0 : -1;\n\t} else if (b === undefined) {\n\t\treturn 1;\n\t} else if (a < b) {\n\t\treturn -1;\n\t} else if (a > b) {\n\t\treturn 1;\n\t}\n\n\treturn 0;\n}\n"]}
1
+ {"version":3,"file":"types.js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esContent":["/*!\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\tStableId,\n} from \"@fluidframework/id-compressor\";\nimport { Type } from \"@sinclair/typebox\";\n\nimport {\n\ttype Brand,\n\ttype NestedMap,\n\tRangeMap,\n\tbrand,\n\tbrandedNumberType,\n\tbrandedStringType,\n} from \"../../util/index.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 */\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\nexport type EncodedStableId = Brand<StableId, \"EncodedStableId\">;\nexport const StableIdSchema = Type.String();\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 */\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 * *\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\nexport type ChangeAtomIdMap<T> = NestedMap<RevisionTag | undefined, ChangesetLocalId, 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\nexport function areEqualChangeAtomIdOpts(\n\ta: ChangeAtomId | undefined,\n\tb: ChangeAtomId | undefined,\n): boolean {\n\tif (a === undefined || b === undefined) {\n\t\treturn a === b;\n\t}\n\n\treturn areEqualChangeAtomIds(a, b);\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<T extends ChangeAtomId = ChangeAtomId>(\n\tid: T,\n\toffset: number,\n): T {\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}\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 from this client. */\n\tDefault,\n\t/** A commit that is the result of an undo from this client. */\n\tUndo,\n\t/** A commit that is the result of a redo from this client. */\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 type ChangeAtomIdRangeMap<V> = RangeMap<ChangeAtomId, V>;\n\nexport function newChangeAtomIdRangeMap<V>(): ChangeAtomIdRangeMap<V> {\n\treturn new RangeMap(offsetChangeAtomId, subtractChangeAtomIds);\n}\n\nexport function newChangeAtomIdTransform(): ChangeAtomIdRangeMap<ChangeAtomId> {\n\treturn new RangeMap(offsetChangeAtomId, subtractChangeAtomIds, offsetChangeAtomId);\n}\n\nexport function subtractChangeAtomIds(a: ChangeAtomId, b: ChangeAtomId): number {\n\tconst cmp = compareRevisions(a.revision, b.revision);\n\tif (cmp !== 0) {\n\t\treturn cmp * Number.POSITIVE_INFINITY;\n\t}\n\n\treturn a.localId - b.localId;\n}\n\nexport function compareRevisions(\n\ta: RevisionTag | undefined,\n\tb: RevisionTag | undefined,\n): number {\n\tif (a === undefined) {\n\t\treturn b === undefined ? 0 : -1;\n\t} else if (b === undefined) {\n\t\treturn 1;\n\t} else if (a < b) {\n\t\treturn -1;\n\t} else if (a > b) {\n\t\treturn 1;\n\t}\n\n\treturn 0;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/core/rebase/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EAKjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAc,MAAM,YAAY,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,cAAc,CAAC,OAAO;IACtC;;;;OAIG;IACH,oBAAoB,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7C;;;;OAIG;IACH,aAAa,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;IACtC;;;;OAIG;IACH,aAAa,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B;;OAEG;IACH,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC;;OAEG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;C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EAAE,OAAO,GACjB,OAAO,CAcT;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,OAAO,EACpC,aAAa,EAAE,aAAa,CAAC,OAAO,CAAC,EACrC,YAAY,EAAE,WAAW,CAAC,OAAO,CAAC,EAClC,YAAY,EAAE,WAAW,CAAC,OAAO,CAAC,EAClC,eAAe,EAAE,MAAM,WAAW,GAChC,OAAO,CAWT"}
@@ -134,7 +134,9 @@ function rebaseBranch(mintRevisionTag, changeRebaser, sourceHead, targetCommit,
134
134
  rebaseDistance: targetCommits.length,
135
135
  countDropped: sourceBranchLength - sourceSet.size,
136
136
  },
137
- }, "sourceChange", () => changeRebaser.compose(editsToCompose));
137
+ }, "sourceChange", () => {
138
+ return changeRebaser.compose(editsToCompose);
139
+ });
138
140
  }
139
141
  exports.rebaseBranch = rebaseBranch;
140
142
  /**
@@ -165,21 +167,37 @@ function rebaseChange(changeRebaser, change, sourceHead, targetHead, mintRevisio
165
167
  }
166
168
  exports.rebaseChange = rebaseChange;
167
169
  function revisionMetadataSourceFromInfo(revInfos) {
168
- const getIndex = (revision) => {
169
- const index = revInfos.findIndex((revInfo) => revInfo.revision === revision);
170
- return index >= 0 ? index : undefined;
170
+ const compareRevisions = (revision1, revision2) => {
171
+ const index1 = getIndex(revision1);
172
+ const index2 = getIndex(revision2);
173
+ if (index1 !== undefined) {
174
+ return index2 !== undefined ? index2 - index1 : -1;
175
+ }
176
+ return index2 !== undefined ? 1 : 0;
171
177
  };
172
178
  const tryGetInfo = (revision) => {
173
179
  if (revision === undefined) {
174
180
  return undefined;
175
181
  }
176
- const index = getIndex(revision);
177
- return index === undefined ? undefined : revInfos[index];
182
+ return revInfos.find((info) => info.revision === revision);
178
183
  };
179
184
  const hasRollback = (revision) => {
180
185
  return revInfos.find((info) => info.rollbackOf === revision) !== undefined;
181
186
  };
182
- return { getIndex, tryGetInfo, hasRollback };
187
+ const getIndex = (revision) => {
188
+ const index = revInfos.findIndex((revInfo) => revInfo.revision === revision);
189
+ if (index >= 0) {
190
+ return index;
191
+ }
192
+ const rollbackIndex = revInfos.findIndex((revInfo) => revInfo.rollbackOf === revision);
193
+ if (rollbackIndex >= 0) {
194
+ // This change is the forward revision of a rollback included in revInfos, so it comes after
195
+ // all revisions in revInfos. Earlier rollbacks have later forward revisions.
196
+ return 2 * revInfos.length - rollbackIndex;
197
+ }
198
+ return undefined;
199
+ };
200
+ return { compareRevisions, tryGetInfo, hasRollback };
183
201
  }
184
202
  exports.revisionMetadataSourceFromInfo = revisionMetadataSourceFromInfo;
185
203
  function rebaseChangeOverChanges(changeRebaser, changeToRebase, changesToRebaseOver) {
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/core/rebase/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAkE;AAElE,kDAAsF;AAEtF,yDAS4B;AAC5B,yCAA4E;AAuK5E,SAAgB,YAAY,CAC3B,eAAkC,EAClC,aAAqC,EACrC,UAAgC,EAChC,YAAkC,EAClC,UAAU,GAAG,YAAY;IAEzB,4CAA4C;IAC5C,MAAM,UAAU,GAA2B,EAAE,CAAC;IAC9C,MAAM,UAAU,GAA2B,EAAE,CAAC;IAC9C,MAAM,QAAQ,GAAG,kBAAkB,CAAC,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;IACxF,IAAA,iBAAM,EAAC,QAAQ,KAAK,SAAS,EAAE,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAErE,MAAM,kBAAkB,GAAG,UAAU,CAAC,MAAM,CAAC;IAE7C,oDAAoD;IACpD,MAAM,iBAAiB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC;IAC1E,IAAI,iBAAiB,KAAK,CAAC,CAAC,EAAE,CAAC;QAC9B,6GAA6G;QAC7G,uGAAuG;QACvG,+GAA+G;QAC/G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IAC5F,IAAA,iBAAM,EAAC,QAAQ,KAAK,SAAS,EAAE,KAAK,CAAC,8BAA8B,CAAC,CAAC;IACrE,MAAM,QAAQ,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAC1C,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,eAAe,CAAC,CAC1D,CAAC;IAEF,QAAQ,CAAC,OAAO,EAAE,CAAC;IACnB,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC,GAAG,QAAQ,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC;AAC5D,CAAC;AAhBD,sCAgBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob } from \"@fluidframework/core-utils/internal\";\n\nimport { defineLazyCachedProperty, hasSome, type Mutable } from \"../../util/index.js\";\n\nimport {\n\ttype ChangeRebaser,\n\ttype RevisionInfo,\n\ttype RevisionMetadataSource,\n\ttype TaggedChange,\n\tmakeAnonChange,\n\tmapTaggedChange,\n\ttagChange,\n\ttagRollbackInverse,\n} from \"./changeRebaser.js\";\nimport { type GraphCommit, type RevisionTag, mintCommit } from \"./types.js\";\n\n/**\n * Contains information about how the commit graph changed as the result of rebasing a source branch onto another target branch.\n * @remarks\n * ```text\n * Consider the commit graph below containing two branches, X and Y, with head commits C and E, respectively.\n * Branch Y branches off of Branch X at their common ancestor commit A, i.e. \"Y is based off of X at commit A\".\n *\n * A ─ B ─ C ← Branch X\n * └─ D ─ E ← Branch Y\n *\n * Branch Y is then rebased onto Branch X. This results in the following commit graph:\n *\n * A ─ B ─ C ← Branch X\n * └─ D'─ E'← Branch Y\n *\n * Commits D' and E' are the rebased versions of commits D and E, respectively. This results in:\n * deletedSourceCommits: [D, E],\n * targetCommits: [B, C],\n * sourceCommits: [D', E']\n * ```\n */\nexport interface RebasedCommits<TChange> {\n\t/**\n\t * The commits on the original source branch that were rebased. These are no longer referenced by the source branch and have\n\t * been replaced with new versions on the new source branch, see {@link sourceCommits}. In the case that the source\n\t * branch was already ahead of the target branch before the rebase, this list will be empty.\n\t */\n\tdeletedSourceCommits: GraphCommit<TChange>[];\n\t/**\n\t * All commits on the target branch that the source branch's commits were rebased over. These are now the direct\n\t * ancestors of {@link sourceCommits}. In the case that the source branch was already ahead of the target branch\n\t * before the rebase, this list will be empty.\n\t */\n\ttargetCommits: GraphCommit<TChange>[];\n\t/**\n\t * All commits on the source branch that are not also on the target branch after the rebase operation. In the case that the\n\t * source branch was already ahead of the target branch before the rebase, these are the same commits that were already on\n\t * the source branch before the rebase, otherwise these are the new, rebased versions of {@link deletedSourceCommits}.\n\t */\n\tsourceCommits: GraphCommit<TChange>[];\n}\n\n/**\n * Telemetry metrics for a rebase operation.\n */\nexport interface RebaseStats {\n\t/**\n\t * The length of the source branch before the rebase.\n\t */\n\treadonly sourceBranchLength: number;\n\t/**\n\t * Number of commits rebased over on the target branch.\n\t */\n\treadonly rebaseDistance: number;\n\t/**\n\t * The number of commits that are dropped from the source branch when rebased to the target branch.\n\t */\n\treadonly countDropped: number;\n}\n\nexport interface RebaseStatsWithDuration extends RebaseStats {\n\treadonly duration: number;\n}\n\nexport interface BranchRebaseResult<TChange> {\n\t/**\n\t * The head of a rebased source branch.\n\t */\n\treadonly newSourceHead: GraphCommit<TChange>;\n\t/**\n\t * A thunk that computes the cumulative change to the source branch (undefined if no change occurred)\n\t */\n\treadonly sourceChange: TChange | undefined;\n\t/**\n\t * Details about how the commits on the source branch changed\n\t */\n\treadonly commits: RebasedCommits<TChange>;\n\t/**\n\t * Telemetry properties for the rebase operation.\n\t */\n\treadonly telemetryProperties: RebaseStats;\n}\n\ninterface RebaseChangeResult<TChange> {\n\treadonly change: TChange;\n\t/**\n\t * Telemetry properties for the rebase operation.\n\t */\n\treadonly telemetryProperties: RebaseStats;\n}\n\n/**\n * Rebases a source branch onto another commit in a target branch.\n *\n * A \"branch\" is defined as a \"head\" commit and all ancestors of that commit, i.e. one linked list in a graph of commits.\n *\n * The source and target branch must share an ancestor.\n * @param changeRebaser - the change rebaser responsible for rebasing the changes in the commits of each branch\n * @param sourceHead - the head of the source branch, which will be rebased onto `targetHead`\n * @param targetHead - the commit to rebase the source branch onto\n * @returns a {@link BranchRebaseResult}\n * @remarks While a single branch must not have multiple commits with the same revision tag (that will result in undefined\n * behavior), there may be a commit on the source branch with the same revision tag as a commit on the target branch. If such\n * a pair is encountered while rebasing, it will be \"cancelled out\" in the new branch. For example:\n * ```\n * // (A)-(B)-(C) <- Branch X\n * // \\\n * // (B')-(D) <- Branch Y\n * //\n * // As Branch Y is rebased onto Branch X, commits B and B' cancel out so there is no version of B on the new rebased source branch\n * //\n * // (A)-(B)-(C) <- Branch X\n * // \\\n * // (D') <- Branch Y'\n * //\n * ```\n */\nexport function rebaseBranch<TChange>(\n\tmintRevisionTag: () => RevisionTag,\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tsourceHead: GraphCommit<TChange>,\n\ttargetHead: GraphCommit<TChange>,\n): BranchRebaseResult<TChange>;\n\n/**\n * Rebases a source branch onto another commit in a target branch.\n *\n * A \"branch\" is defined as a \"head\" commit and all ancestors of that commit, i.e. one linked list in a graph of commits.\n *\n * The source and target branch must share an ancestor.\n * @param changeRebaser - the change rebaser responsible for rebasing the changes in the commits of each branch\n * @param sourceHead - the head of the source branch, which will be rebased onto `newBase`\n * @param targetCommit - the commit on the target branch to rebase the source branch onto.\n * @param targetHead - the head of the branch that `newBase` belongs to. Must be `newBase` or a descendent of `newBase`.\n * @returns a {@link BranchRebaseResult}\n * @remarks While a single branch must not have multiple commits with the same revision tag (that will result in undefined\n * behavior), there may be a commit on the source branch with the same revision tag as a commit on the target branch. If such\n * a pair is encountered while rebasing, it will be \"cancelled out\" in the new branch. Additionally, this function will rebase\n * the source branch _farther_ than `newBase` if the source branch's next commits after `newBase` match those on the target branch.\n * For example:\n * ```\n * // (A)-(B)-(C)-(D)-(E) <- Branch X\n * // \\\n * // (B')-(D')-(F) <- Branch Y\n * //\n * // If Branch Y is rebased onto commit C of Branch X, the branches must at least look like this afterwards (B was cancelled out):\n * //\n * // (A)-(B)-(C)-(D)-(E) <- Branch X\n * // \\\n * // (D'')-(F') <- Branch Y'\n * //\n * // But this function will recognize that B is equivalent to B' and D is equivalent to D', and instead produce:\n * //\n * // (A)-(B)-(C)-(D)-(E) <- Branch X\n * // \\\n * // (F') <- Branch Y'\n * ```\n */\nexport function rebaseBranch<TChange>(\n\tmintRevisionTag: () => RevisionTag,\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tsourceHead: GraphCommit<TChange>,\n\ttargetCommit: GraphCommit<TChange>,\n\ttargetHead: GraphCommit<TChange>,\n): BranchRebaseResult<TChange>;\nexport function rebaseBranch<TChange>(\n\tmintRevisionTag: () => RevisionTag,\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tsourceHead: GraphCommit<TChange>,\n\ttargetCommit: GraphCommit<TChange>,\n\ttargetHead = targetCommit,\n): BranchRebaseResult<TChange> {\n\t// Get both source and target as path arrays\n\tconst sourcePath: GraphCommit<TChange>[] = [];\n\tconst targetPath: GraphCommit<TChange>[] = [];\n\tconst ancestor = findCommonAncestor([sourceHead, sourcePath], [targetHead, targetPath]);\n\tassert(ancestor !== undefined, 0x675 /* branches must be related */);\n\n\tconst sourceBranchLength = sourcePath.length;\n\n\t// Find where `targetCommit` is in the target branch\n\tconst targetCommitIndex = targetPath.findIndex((r) => r === targetCommit);\n\tif (targetCommitIndex === -1) {\n\t\t// If the targetCommit is not in the target path, then it is either disjoint from `target` or it is behind/at\n\t\t// the commit where source and target diverge (ancestor), in which case there is nothing more to rebase\n\t\t// TODO: Ideally, this would be an \"assertExpensive\". It is commented out because it causes O(N²) behavior when\n\t\t// processing N inbound commits from the same client whose ref seq# is not advancing (which is a common case).\n\t\t// N can be large when the client is sending a burst of changes (potentially on reconnection).\n\t\t// assert(\n\t\t// \tfindCommonAncestor(targetCommit, targetHead) !== undefined,\n\t\t// \t0x676 /* target commit is not in target branch */,\n\t\t// );\n\t\treturn {\n\t\t\tnewSourceHead: sourceHead,\n\t\t\tsourceChange: undefined,\n\t\t\tcommits: { deletedSourceCommits: [], targetCommits: [], sourceCommits: sourcePath },\n\t\t\ttelemetryProperties: {\n\t\t\t\tsourceBranchLength,\n\t\t\t\trebaseDistance: targetCommitIndex + 1,\n\t\t\t\tcountDropped: 0,\n\t\t\t},\n\t\t};\n\t}\n\n\t// Iterate through the target path and look for commits that are also present on the source branch (i.e. they\n\t// have matching tags). Each commit found in the target branch can be skipped when processing the source branch\n\t// because it has already been rebased onto the target. In the case that one or more of these commits are present\n\t// directly after `targetCommit`, then the new base can be advanced further without having to do any work.\n\tconst sourceSet = new Set(sourcePath.map((r) => r.revision));\n\tlet newBaseIndex = targetCommitIndex;\n\n\tfor (const [i, { revision }] of targetPath.entries()) {\n\t\tif (sourceSet.has(revision)) {\n\t\t\tsourceSet.delete(revision);\n\t\t\tnewBaseIndex = Math.max(newBaseIndex, i);\n\t\t} else if (i > targetCommitIndex) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/** The commit on the target branch that the new source branch branches off of (i.e. the new common ancestor) */\n\tconst newBase = targetPath[newBaseIndex] ?? oob();\n\t// Figure out how much of the trunk to start rebasing over.\n\tconst targetCommits = targetPath.slice(0, newBaseIndex + 1);\n\tconst deletedSourceCommits = [...sourcePath];\n\n\t// If the source and target rebase path begin with a range that has all the same revisions, remove it; it is\n\t// equivalent on both branches and doesn't need to be rebased.\n\tconst targetRebasePath = [...targetCommits];\n\tif (hasSome(sourcePath) && hasSome(targetRebasePath)) {\n\t\tconst minLength = Math.min(sourcePath.length, targetRebasePath.length);\n\t\tfor (let i = 0; i < minLength; i++) {\n\t\t\tconst firstSourcePath = sourcePath[0];\n\t\t\tconst firstTargetRebasePath = targetRebasePath[0];\n\t\t\tif (firstSourcePath.revision === firstTargetRebasePath.revision) {\n\t\t\t\tsourcePath.shift();\n\t\t\t\ttargetRebasePath.shift();\n\t\t\t}\n\t\t}\n\t}\n\n\tconst sourceCommits: GraphCommit<TChange>[] = [];\n\n\t// If all commits that are about to be rebased over on the target branch already comprise the start of the source branch,\n\t// are in the same order, and have no other commits interleaving them, then no rebasing needs to occur. Those commits can\n\t// simply be removed from the source branch, and the remaining commits on the source branch are reparented off of the new\n\t// base commit.\n\tif (!hasSome(targetRebasePath)) {\n\t\tfor (const c of sourcePath) {\n\t\t\tsourceCommits.push(mintCommit(sourceCommits[sourceCommits.length - 1] ?? newBase, c));\n\t\t}\n\t\treturn {\n\t\t\tnewSourceHead: sourceCommits[sourceCommits.length - 1] ?? newBase,\n\t\t\tsourceChange: undefined,\n\t\t\tcommits: {\n\t\t\t\tdeletedSourceCommits,\n\t\t\t\ttargetCommits,\n\t\t\t\tsourceCommits,\n\t\t\t},\n\t\t\ttelemetryProperties: {\n\t\t\t\tsourceBranchLength,\n\t\t\t\trebaseDistance: targetCommits.length,\n\t\t\t\tcountDropped: sourceBranchLength - sourceSet.size,\n\t\t\t},\n\t\t};\n\t}\n\n\t// For each source commit, rebase backwards over the inverses of any commits already rebased, and then\n\t// rebase forwards over the rest of the commits up to the new base before advancing the new base.\n\tlet newHead = newBase;\n\tconst revInfos = getRevInfoFromTaggedChanges([...targetRebasePath, ...sourcePath]);\n\t// Note that the `revisionMetadata` gets updated as `revInfos` gets updated.\n\tconst revisionMetadata = revisionMetadataSourceFromInfo(revInfos);\n\tlet editsToCompose: TaggedChange<TChange>[] = targetRebasePath.slice();\n\tfor (const c of sourcePath) {\n\t\tconst rollback = rollbackFromCommit(changeRebaser, c, mintRevisionTag, true /* cache */);\n\t\tif (sourceSet.has(c.revision)) {\n\t\t\tconst currentComposedEdit = makeAnonChange(changeRebaser.compose(editsToCompose));\n\t\t\teditsToCompose = [currentComposedEdit];\n\t\t\tconst change = changeRebaser.rebase(c, currentComposedEdit, revisionMetadata);\n\t\t\tnewHead = {\n\t\t\t\trevision: c.revision,\n\t\t\t\tchange,\n\t\t\t\tparent: newHead,\n\t\t\t};\n\t\t\tsourceCommits.push(newHead);\n\t\t\teditsToCompose.push(tagChange(change, c.revision));\n\t\t}\n\t\trevInfos.push({ revision: c.revision });\n\t\teditsToCompose.unshift(rollback);\n\t\trevInfos.unshift({ revision: rollback.revision, rollbackOf: rollback.rollbackOf });\n\t}\n\n\treturn defineLazyCachedProperty(\n\t\t{\n\t\t\tnewSourceHead: newHead,\n\t\t\tcommits: {\n\t\t\t\tdeletedSourceCommits,\n\t\t\t\ttargetCommits,\n\t\t\t\tsourceCommits,\n\t\t\t},\n\t\t\ttelemetryProperties: {\n\t\t\t\tsourceBranchLength,\n\t\t\t\trebaseDistance: targetCommits.length,\n\t\t\t\tcountDropped: sourceBranchLength - sourceSet.size,\n\t\t\t},\n\t\t},\n\t\t\"sourceChange\",\n\t\t() => changeRebaser.compose(editsToCompose),\n\t);\n}\n\n/**\n * \"Sandwich/Horseshoe Rebase\" a change over the given source and target branches\n * @param changeRebaser - the change rebaser responsible for rebasing the change over the commits in each branch\n * @param change - the change to rebase\n * @param sourceHead - the head of the branch that `change` is based on\n * @param targetHead - the branch to rebase `change` onto\n * @returns the rebased change\n *\n * @remarks inverses will be cached.\n */\nexport function rebaseChange<TChange>(\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tchange: TaggedChange<TChange>,\n\tsourceHead: GraphCommit<TChange>,\n\ttargetHead: GraphCommit<TChange>,\n\tmintRevisionTag: () => RevisionTag,\n): RebaseChangeResult<TChange> {\n\tconst sourcePath: GraphCommit<TChange>[] = [];\n\tconst targetPath: GraphCommit<TChange>[] = [];\n\tassert(\n\t\tfindCommonAncestor([sourceHead, sourcePath], [targetHead, targetPath]) !== undefined,\n\t\t0x576 /* branch A and branch B must be related */,\n\t);\n\n\tconst inverses = sourcePath.map((commit) =>\n\t\trollbackFromCommit(changeRebaser, commit, mintRevisionTag, true),\n\t);\n\tinverses.reverse();\n\n\tconst telemetryProperties = {\n\t\tsourceBranchLength: 1,\n\t\trebaseDistance: sourcePath.length + targetPath.length,\n\t\tcountDropped: 0,\n\t};\n\n\treturn {\n\t\tchange: rebaseChangeOverChanges(changeRebaser, change, [...inverses, ...targetPath]),\n\t\ttelemetryProperties,\n\t};\n}\n\nexport function revisionMetadataSourceFromInfo(\n\trevInfos: readonly RevisionInfo[],\n): RevisionMetadataSource {\n\tconst getIndex = (revision: RevisionTag): number | undefined => {\n\t\tconst index = revInfos.findIndex((revInfo) => revInfo.revision === revision);\n\t\treturn index >= 0 ? index : undefined;\n\t};\n\tconst tryGetInfo = (revision: RevisionTag | undefined): RevisionInfo | undefined => {\n\t\tif (revision === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst index = getIndex(revision);\n\t\treturn index === undefined ? undefined : revInfos[index];\n\t};\n\n\tconst hasRollback = (revision: RevisionTag): boolean => {\n\t\treturn revInfos.find((info) => info.rollbackOf === revision) !== undefined;\n\t};\n\n\treturn { getIndex, tryGetInfo, hasRollback };\n}\n\nexport function rebaseChangeOverChanges<TChange>(\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tchangeToRebase: TaggedChange<TChange>,\n\tchangesToRebaseOver: TaggedChange<TChange>[],\n): TChange {\n\tconst revisionMetadata = revisionMetadataSourceFromInfo(\n\t\tgetRevInfoFromTaggedChanges([...changesToRebaseOver, changeToRebase]),\n\t);\n\n\treturn changesToRebaseOver.reduce(\n\t\t(a, b) => mapTaggedChange(changeToRebase, changeRebaser.rebase(a, b, revisionMetadata)),\n\t\tchangeToRebase,\n\t).change;\n}\n\n// TODO: Deduplicate\nfunction getRevInfoFromTaggedChanges(changes: TaggedChange<unknown>[]): RevisionInfo[] {\n\tconst revInfos: RevisionInfo[] = [];\n\tfor (const taggedChange of changes) {\n\t\trevInfos.push(...revisionInfoFromTaggedChange(taggedChange));\n\t}\n\n\treturn revInfos;\n}\n\n// TODO: Deduplicate\nfunction revisionInfoFromTaggedChange(taggedChange: TaggedChange<unknown>): RevisionInfo[] {\n\tconst revInfos: RevisionInfo[] = [];\n\tif (taggedChange.revision !== undefined) {\n\t\tconst info: Mutable<RevisionInfo> = { revision: taggedChange.revision };\n\t\tif (taggedChange.rollbackOf !== undefined) {\n\t\t\tinfo.rollbackOf = taggedChange.rollbackOf;\n\t\t}\n\t\trevInfos.push(info);\n\t}\n\treturn revInfos;\n}\n\nfunction rollbackFromCommit<TChange>(\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tcommit: GraphCommit<TChange>,\n\tmintRevisionTag: () => RevisionTag,\n\tcache?: boolean,\n): TaggedChange<TChange, RevisionTag> {\n\tconst cachedRollback = Rollback.get(commit);\n\tif (cachedRollback !== undefined) {\n\t\treturn cachedRollback;\n\t}\n\tconst tag = mintRevisionTag();\n\tconst rollback = tagRollbackInverse(\n\t\tchangeRebaser.invert(commit, true, tag),\n\t\ttag,\n\t\tcommit.revision,\n\t);\n\n\tif (cache === true) {\n\t\tRollback.set(commit, rollback);\n\t}\n\treturn rollback;\n}\n\n/**\n * Find the furthest ancestor of some descendant.\n * @param descendant - a descendant. If an empty `path` array is included, it will be populated\n * with the chain of ancestry for `descendant` from most distant to closest (not including the furthest ancestor,\n * but otherwise including `descendant`).\n * @returns the furthest ancestor of `descendant`, or `descendant` itself if `descendant` has no ancestors.\n */\nexport function findAncestor<T extends { parent?: T }>(\n\tdescendant: T | [descendant: T, path?: T[]],\n): T;\n/**\n * Find the furthest ancestor of some descendant.\n * @param descendant - a descendant. If an empty `path` array is included, it will be populated\n * with the chain of ancestry for `descendant` from most distant to closest (not including the furthest ancestor,\n * but otherwise including `descendant`).\n * @returns the furthest ancestor of `descendant`, or `descendant` itself if `descendant` has no ancestors. Returns\n * `undefined` if `descendant` is undefined.\n */\nexport function findAncestor<T extends { parent?: T }>(\n\tdescendant: T | [descendant: T | undefined, path?: T[]] | undefined,\n): T | undefined;\n/**\n * Find an ancestor of some descendant.\n * @param descendant - a descendant. If an empty `path` array is included, it will be populated\n * with the chain of ancestry for `descendant` from most distant to closest (not including the ancestor found by `predicate`,\n * but otherwise including `descendant`).\n * @param predicate - a function which will be evaluated on `descendant` and then ancestor of `descendant` (in ascending order) until it returns true.\n * @returns the closest ancestor of `descendant` that satisfies `predicate`, or `undefined` if no such ancestor exists.\n *\n * @example\n *\n * ```typescript\n * interface Parented {\n * id: string;\n * parent?: Parented;\n * }\n * const g = { id: \"g\" }; // Grandparent\n * const p = { parent: g, id: \"p\" }; // Parent\n * const c = { parent: p, id: \"c\" }; // Child\n * const path: Parented[] = [];\n * const ancestor = findAncestor<Parented>([c, path], (n) => n.id === \"g\");\n * // ancestor === g\n * // path === [p, c]\n * ```\n */\nexport function findAncestor<T extends { parent?: T }>(\n\tdescendant: T | [descendant: T | undefined, path?: T[]] | undefined,\n\tpredicate: (t: T) => boolean,\n): T | undefined;\nexport function findAncestor<T extends { parent?: T }>(\n\tdescendant: T | [descendant: T | undefined, path?: T[]] | undefined,\n\tpredicate: (t: T) => boolean = (t): boolean => t.parent === undefined,\n): T | undefined {\n\tlet d: T | undefined;\n\tlet path: T[] | undefined;\n\tif (Array.isArray(descendant)) {\n\t\t[d, path] = descendant;\n\t} else {\n\t\td = descendant;\n\t}\n\tfor (let cur = d; cur !== undefined; cur = cur.parent) {\n\t\tif (predicate(cur)) {\n\t\t\tpath?.reverse();\n\t\t\treturn cur;\n\t\t}\n\t\tpath?.push(cur);\n\t}\n\n\tif (path !== undefined) {\n\t\tpath.length = 0;\n\t}\n\treturn undefined;\n}\n\n/**\n * Find a common ancestor between two descendants that are linked by parent pointers.\n * @param descendantA - a descendant. If an empty `path` array is included, it will be populated\n * with the chain of commits from the ancestor to `descendantA` (not including the ancestor).\n * @param descendantB - another descendant. If an empty `path` array is included, it will be populated\n * with the chain of commits from the ancestor to `descendantB` (not including the ancestor).\n * @returns the common ancestor of `descendantA` and `descendantB`, or `undefined` if no such ancestor exists.\n *\n * @example\n *\n * ```typescript\n * interface Parented {\n * parent?: Parented;\n * }\n * const shared = {};\n * const a = { parent: shared };\n * const b1 = { parent: shared };\n * const b2 = { parent: b1 };\n * const pathB: Parented[] = []\n * const ancestor = findCommonAncestor<Parented>(a, [b2, pathB]);\n * // ancestor === shared\n * // pathB === [b1, b2]\n * ```\n */\nexport function findCommonAncestor<T extends { parent?: T }>(\n\tdescendantA: T | [descendantA: T, path?: T[]] | undefined,\n\tdescendantB: T | [descendantB: T, path?: T[]] | undefined,\n): T | undefined {\n\tlet a: T | undefined;\n\tlet b: T | undefined;\n\tlet pathA: T[] | undefined;\n\tlet pathB: T[] | undefined;\n\tif (Array.isArray(descendantA)) {\n\t\t[a, pathA] = descendantA;\n\t\tassert(pathA === undefined || pathA.length === 0, 0x578 /* Path A must be empty */);\n\t} else {\n\t\ta = descendantA;\n\t}\n\tif (Array.isArray(descendantB)) {\n\t\t[b, pathB] = descendantB;\n\t\tassert(pathB === undefined || pathB.length === 0, 0x579 /* Path B must be empty */);\n\t} else {\n\t\tb = descendantB;\n\t}\n\n\tif (a === b) {\n\t\treturn a;\n\t}\n\n\tconst reversePaths = (): void => {\n\t\tpathA?.reverse();\n\t\tpathB?.reverse();\n\t};\n\n\tconst visited = new Set();\n\twhile (a !== undefined || b !== undefined) {\n\t\tif (a !== undefined) {\n\t\t\tif (visited.has(a)) {\n\t\t\t\tif (pathB !== undefined) {\n\t\t\t\t\tpathB.length = pathB.findIndex((r) => Object.is(r, a));\n\t\t\t\t}\n\t\t\t\treversePaths();\n\t\t\t\treturn a;\n\t\t\t}\n\t\t\tvisited.add(a);\n\t\t\tpathA?.push(a);\n\t\t\ta = a.parent;\n\t\t}\n\n\t\tif (b !== undefined) {\n\t\t\tif (visited.has(b)) {\n\t\t\t\tif (pathA !== undefined) {\n\t\t\t\t\tpathA.length = pathA.findIndex((r) => Object.is(r, b));\n\t\t\t\t}\n\t\t\t\treversePaths();\n\t\t\t\treturn b;\n\t\t\t}\n\t\t\tvisited.add(b);\n\t\t\tpathB?.push(b);\n\t\t\tb = b.parent;\n\t\t}\n\t}\n\n\tif (pathA !== undefined) {\n\t\tpathA.length = 0;\n\t}\n\tif (pathB !== undefined) {\n\t\tpathB.length = 0;\n\t}\n\treturn undefined;\n}\n\nexport function replaceChange<TChange>(\n\tcommit: GraphCommit<TChange>,\n\tchange: TChange,\n): GraphCommit<TChange> {\n\tconst output = { ...commit, change };\n\tRollback.set(output, undefined);\n\treturn output;\n}\n\n/** Associates rollback data with commits */\nnamespace Rollback {\n\tconst map = new WeakMap<GraphCommit<unknown>, TaggedChange<unknown, RevisionTag>>();\n\n\texport function get<TChange>(\n\t\tcommit: GraphCommit<TChange>,\n\t): TaggedChange<TChange, RevisionTag> | undefined {\n\t\treturn map.get(commit) as TaggedChange<TChange, RevisionTag> | undefined;\n\t}\n\n\texport function set<TChange>(\n\t\tcommit: GraphCommit<TChange>,\n\t\trollback: TaggedChange<TChange, RevisionTag> | undefined,\n\t): void {\n\t\tif (rollback === undefined) {\n\t\t\tmap.delete(commit);\n\t\t} else {\n\t\t\tmap.set(commit, rollback);\n\t\t}\n\t}\n}\n\n/**\n * Checks if one node is an ancestor of another in a parent-linked tree structure.\n * @param ancestor - The potential ancestor node\n * @param descendant - The potential descendant node\n * @param allowEqual - If true, returns true when ancestor === descendant\n * @returns true if ancestor is an ancestor of descendant (or equal if allowEqual is true)\n */\nexport function isAncestor<TNode extends { readonly parent?: TNode }>(\n\tancestor: TNode,\n\tdescendant: TNode,\n\tallowEqual: boolean,\n): boolean {\n\tif (allowEqual && ancestor === descendant) {\n\t\treturn true;\n\t}\n\n\tlet current = descendant.parent;\n\twhile (current !== undefined) {\n\t\tif (current === ancestor) {\n\t\t\treturn true;\n\t\t}\n\t\tcurrent = current.parent;\n\t}\n\n\treturn false;\n}\n\n/**\n * Returns a change that represents the different between two places in a commit graph.\n * Applying this change to the state at `sourceCommit` will yield the state at `targetCommit`.\n * @param changeRebaser - the change rebaser responsible for providing inverses to the changes in the commits.\n * @param sourceCommit - the commit representing the initial state.\n * @param targetCommit - the commit representing the final state.\n * @param mintRevisionTag - a function which can be called to create revision tags for any rollback changes that need to be generated.\n * @returns a change representing the difference between `sourceCommit` and `targetCommit`.\n */\nexport function diffHistories<TChange>(\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tsourceCommit: GraphCommit<TChange>,\n\ttargetCommit: GraphCommit<TChange>,\n\tmintRevisionTag: () => RevisionTag,\n): TChange {\n\tconst sourcePath: GraphCommit<TChange>[] = [];\n\tconst targetPath: GraphCommit<TChange>[] = [];\n\tconst ancestor = findCommonAncestor([sourceCommit, sourcePath], [targetCommit, targetPath]);\n\tassert(ancestor !== undefined, 0xc6f /* Branches must be related */);\n\tconst inverses = sourcePath.map((commit) =>\n\t\trollbackFromCommit(changeRebaser, commit, mintRevisionTag),\n\t);\n\n\tinverses.reverse();\n\treturn changeRebaser.compose([...inverses, ...targetPath]);\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/core/rebase/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAkE;AAElE,kDAAsF;AAEtF,yDAS4B;AAC5B,yCAA4E;AAuK5E,SAAgB,YAAY,CAC3B,eAAkC,EAClC,aAAqC,EACrC,UAAgC,EAChC,YAAkC,EAClC,UAAU,GAAG,YAAY;IAEzB,4CAA4C;IAC5C,MAAM,UAAU,GAA2B,EAAE,CAAC;IAC9C,MAAM,UAAU,GAA2B,EAAE,CAAC;IAC9C,MAAM,QAAQ,GAAG,kBAAkB,CAAC,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;IACxF,IAAA,iBAAM,EAAC,QAAQ,KAAK,SAAS,EAAE,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAErE,MAAM,kBAAkB,GAAG,UAAU,CAAC,MAAM,CAAC;IAE7C,oDAAoD;IACpD,MAAM,iBAAiB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC;IAC1E,IAAI,iBAAiB,KAAK,CAAC,CAAC,EAAE,CAA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AAQ,KAAR,QAAQ,QAmBjB;AAED;;;;;;GAMG;AACH,SAAgB,UAAU,CACzB,QAAe,EACf,UAAiB,EACjB,UAAmB;IAEnB,IAAI,UAAU,IAAI,QAAQ,KAAK,UAAU,EAAE,CAAC;QAC3C,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAI,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC;IAChC,OAAO,OAAO,KAAK,SAAS,EAAE,CAAC;QAC9B,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC;QACb,CAAC;QACD,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAC1B,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC;AAlBD,gCAkBC;AAED;;;;;;;;GAQG;AACH,SAAgB,aAAa,CAC5B,aAAqC,EACrC,YAAkC,EAClC,YAAkC,EAClC,eAAkC;IAElC,MAAM,UAAU,GAA2B,EAAE,CAAC;IAC9C,MAAM,UAAU,GAA2B,EAAE,CAAC;IAC9C,MAAM,QAAQ,GAAG,kBAAkB,CAAC,CAAC,YAAY,EAAE,UAAU,CAAC,EAAE,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC;IAC5F,IAAA,iBAAM,EAAC,QAAQ,KAAK,SAAS,EAAE,KAAK,CAAC,8BAA8B,CAAC,CAAC;IACrE,MAAM,QAAQ,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAC1C,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,eAAe,CAAC,CAC1D,CAAC;IAEF,QAAQ,CAAC,OAAO,EAAE,CAAC;IACnB,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC,GAAG,QAAQ,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC;AAC5D,CAAC;AAhBD,sCAgBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob } from \"@fluidframework/core-utils/internal\";\n\nimport { defineLazyCachedProperty, hasSome, type Mutable } from \"../../util/index.js\";\n\nimport {\n\ttype ChangeRebaser,\n\ttype RevisionInfo,\n\ttype RevisionMetadataSource,\n\ttype TaggedChange,\n\tmakeAnonChange,\n\tmapTaggedChange,\n\ttagChange,\n\ttagRollbackInverse,\n} from \"./changeRebaser.js\";\nimport { type GraphCommit, type RevisionTag, mintCommit } from \"./types.js\";\n\n/**\n * Contains information about how the commit graph changed as the result of rebasing a source branch onto another target branch.\n * @remarks\n * ```text\n * Consider the commit graph below containing two branches, X and Y, with head commits C and E, respectively.\n * Branch Y branches off of Branch X at their common ancestor commit A, i.e. \"Y is based off of X at commit A\".\n *\n * A ─ B ─ C ← Branch X\n * └─ D ─ E ← Branch Y\n *\n * Branch Y is then rebased onto Branch X. This results in the following commit graph:\n *\n * A ─ B ─ C ← Branch X\n * └─ D'─ E'← Branch Y\n *\n * Commits D' and E' are the rebased versions of commits D and E, respectively. This results in:\n * deletedSourceCommits: [D, E],\n * targetCommits: [B, C],\n * sourceCommits: [D', E']\n * ```\n */\nexport interface RebasedCommits<TChange> {\n\t/**\n\t * The commits on the original source branch that were rebased. These are no longer referenced by the source branch and have\n\t * been replaced with new versions on the new source branch, see {@link sourceCommits}. In the case that the source\n\t * branch was already ahead of the target branch before the rebase, this list will be empty.\n\t */\n\tdeletedSourceCommits: GraphCommit<TChange>[];\n\t/**\n\t * All commits on the target branch that the source branch's commits were rebased over. These are now the direct\n\t * ancestors of {@link sourceCommits}. In the case that the source branch was already ahead of the target branch\n\t * before the rebase, this list will be empty.\n\t */\n\ttargetCommits: GraphCommit<TChange>[];\n\t/**\n\t * All commits on the source branch that are not also on the target branch after the rebase operation. In the case that the\n\t * source branch was already ahead of the target branch before the rebase, these are the same commits that were already on\n\t * the source branch before the rebase, otherwise these are the new, rebased versions of {@link deletedSourceCommits}.\n\t */\n\tsourceCommits: GraphCommit<TChange>[];\n}\n\n/**\n * Telemetry metrics for a rebase operation.\n */\nexport interface RebaseStats {\n\t/**\n\t * The length of the source branch before the rebase.\n\t */\n\treadonly sourceBranchLength: number;\n\t/**\n\t * Number of commits rebased over on the target branch.\n\t */\n\treadonly rebaseDistance: number;\n\t/**\n\t * The number of commits that are dropped from the source branch when rebased to the target branch.\n\t */\n\treadonly countDropped: number;\n}\n\nexport interface RebaseStatsWithDuration extends RebaseStats {\n\treadonly duration: number;\n}\n\nexport interface BranchRebaseResult<TChange> {\n\t/**\n\t * The head of a rebased source branch.\n\t */\n\treadonly newSourceHead: GraphCommit<TChange>;\n\t/**\n\t * A thunk that computes the cumulative change to the source branch (undefined if no change occurred)\n\t */\n\treadonly sourceChange: TChange | undefined;\n\t/**\n\t * Details about how the commits on the source branch changed\n\t */\n\treadonly commits: RebasedCommits<TChange>;\n\t/**\n\t * Telemetry properties for the rebase operation.\n\t */\n\treadonly telemetryProperties: RebaseStats;\n}\n\ninterface RebaseChangeResult<TChange> {\n\treadonly change: TChange;\n\t/**\n\t * Telemetry properties for the rebase operation.\n\t */\n\treadonly telemetryProperties: RebaseStats;\n}\n\n/**\n * Rebases a source branch onto another commit in a target branch.\n *\n * A \"branch\" is defined as a \"head\" commit and all ancestors of that commit, i.e. one linked list in a graph of commits.\n *\n * The source and target branch must share an ancestor.\n * @param changeRebaser - the change rebaser responsible for rebasing the changes in the commits of each branch\n * @param sourceHead - the head of the source branch, which will be rebased onto `targetHead`\n * @param targetHead - the commit to rebase the source branch onto\n * @returns a {@link BranchRebaseResult}\n * @remarks While a single branch must not have multiple commits with the same revision tag (that will result in undefined\n * behavior), there may be a commit on the source branch with the same revision tag as a commit on the target branch. If such\n * a pair is encountered while rebasing, it will be \"cancelled out\" in the new branch. For example:\n * ```\n * // (A)-(B)-(C) <- Branch X\n * // \\\n * // (B')-(D) <- Branch Y\n * //\n * // As Branch Y is rebased onto Branch X, commits B and B' cancel out so there is no version of B on the new rebased source branch\n * //\n * // (A)-(B)-(C) <- Branch X\n * // \\\n * // (D') <- Branch Y'\n * //\n * ```\n */\nexport function rebaseBranch<TChange>(\n\tmintRevisionTag: () => RevisionTag,\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tsourceHead: GraphCommit<TChange>,\n\ttargetHead: GraphCommit<TChange>,\n): BranchRebaseResult<TChange>;\n\n/**\n * Rebases a source branch onto another commit in a target branch.\n *\n * A \"branch\" is defined as a \"head\" commit and all ancestors of that commit, i.e. one linked list in a graph of commits.\n *\n * The source and target branch must share an ancestor.\n * @param changeRebaser - the change rebaser responsible for rebasing the changes in the commits of each branch\n * @param sourceHead - the head of the source branch, which will be rebased onto `newBase`\n * @param targetCommit - the commit on the target branch to rebase the source branch onto.\n * @param targetHead - the head of the branch that `newBase` belongs to. Must be `newBase` or a descendent of `newBase`.\n * @returns a {@link BranchRebaseResult}\n * @remarks While a single branch must not have multiple commits with the same revision tag (that will result in undefined\n * behavior), there may be a commit on the source branch with the same revision tag as a commit on the target branch. If such\n * a pair is encountered while rebasing, it will be \"cancelled out\" in the new branch. Additionally, this function will rebase\n * the source branch _farther_ than `newBase` if the source branch's next commits after `newBase` match those on the target branch.\n * For example:\n * ```\n * // (A)-(B)-(C)-(D)-(E) <- Branch X\n * // \\\n * // (B')-(D')-(F) <- Branch Y\n * //\n * // If Branch Y is rebased onto commit C of Branch X, the branches must at least look like this afterwards (B was cancelled out):\n * //\n * // (A)-(B)-(C)-(D)-(E) <- Branch X\n * // \\\n * // (D'')-(F') <- Branch Y'\n * //\n * // But this function will recognize that B is equivalent to B' and D is equivalent to D', and instead produce:\n * //\n * // (A)-(B)-(C)-(D)-(E) <- Branch X\n * // \\\n * // (F') <- Branch Y'\n * ```\n */\nexport function rebaseBranch<TChange>(\n\tmintRevisionTag: () => RevisionTag,\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tsourceHead: GraphCommit<TChange>,\n\ttargetCommit: GraphCommit<TChange>,\n\ttargetHead: GraphCommit<TChange>,\n): BranchRebaseResult<TChange>;\nexport function rebaseBranch<TChange>(\n\tmintRevisionTag: () => RevisionTag,\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tsourceHead: GraphCommit<TChange>,\n\ttargetCommit: GraphCommit<TChange>,\n\ttargetHead = targetCommit,\n): BranchRebaseResult<TChange> {\n\t// Get both source and target as path arrays\n\tconst sourcePath: GraphCommit<TChange>[] = [];\n\tconst targetPath: GraphCommit<TChange>[] = [];\n\tconst ancestor = findCommonAncestor([sourceHead, sourcePath], [targetHead, targetPath]);\n\tassert(ancestor !== undefined, 0x675 /* branches must be related */);\n\n\tconst sourceBranchLength = sourcePath.length;\n\n\t// Find where `targetCommit` is in the target branch\n\tconst targetCommitIndex = targetPath.findIndex((r) => r === targetCommit);\n\tif (targetCommitIndex === -1) {\n\t\t// If the targetCommit is not in the target path, then it is either disjoint from `target` or it is behind/at\n\t\t// the commit where source and target diverge (ancestor), in which case there is nothing more to rebase\n\t\t// TODO: Ideally, this would be an \"assertExpensive\". It is commented out because it causes O(N²) behavior when\n\t\t// processing N inbound commits from the same client whose ref seq# is not advancing (which is a common case).\n\t\t// N can be large when the client is sending a burst of changes (potentially on reconnection).\n\t\t// assert(\n\t\t// \tfindCommonAncestor(targetCommit, targetHead) !== undefined,\n\t\t// \t0x676 /* target commit is not in target branch */,\n\t\t// );\n\t\treturn {\n\t\t\tnewSourceHead: sourceHead,\n\t\t\tsourceChange: undefined,\n\t\t\tcommits: { deletedSourceCommits: [], targetCommits: [], sourceCommits: sourcePath },\n\t\t\ttelemetryProperties: {\n\t\t\t\tsourceBranchLength,\n\t\t\t\trebaseDistance: targetCommitIndex + 1,\n\t\t\t\tcountDropped: 0,\n\t\t\t},\n\t\t};\n\t}\n\n\t// Iterate through the target path and look for commits that are also present on the source branch (i.e. they\n\t// have matching tags). Each commit found in the target branch can be skipped when processing the source branch\n\t// because it has already been rebased onto the target. In the case that one or more of these commits are present\n\t// directly after `targetCommit`, then the new base can be advanced further without having to do any work.\n\tconst sourceSet = new Set(sourcePath.map((r) => r.revision));\n\tlet newBaseIndex = targetCommitIndex;\n\n\tfor (const [i, { revision }] of targetPath.entries()) {\n\t\tif (sourceSet.has(revision)) {\n\t\t\tsourceSet.delete(revision);\n\t\t\tnewBaseIndex = Math.max(newBaseIndex, i);\n\t\t} else if (i > targetCommitIndex) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/** The commit on the target branch that the new source branch branches off of (i.e. the new common ancestor) */\n\tconst newBase = targetPath[newBaseIndex] ?? oob();\n\t// Figure out how much of the trunk to start rebasing over.\n\tconst targetCommits = targetPath.slice(0, newBaseIndex + 1);\n\tconst deletedSourceCommits = [...sourcePath];\n\n\t// If the source and target rebase path begin with a range that has all the same revisions, remove it; it is\n\t// equivalent on both branches and doesn't need to be rebased.\n\tconst targetRebasePath = [...targetCommits];\n\tif (hasSome(sourcePath) && hasSome(targetRebasePath)) {\n\t\tconst minLength = Math.min(sourcePath.length, targetRebasePath.length);\n\t\tfor (let i = 0; i < minLength; i++) {\n\t\t\tconst firstSourcePath = sourcePath[0];\n\t\t\tconst firstTargetRebasePath = targetRebasePath[0];\n\t\t\tif (firstSourcePath.revision === firstTargetRebasePath.revision) {\n\t\t\t\tsourcePath.shift();\n\t\t\t\ttargetRebasePath.shift();\n\t\t\t}\n\t\t}\n\t}\n\n\tconst sourceCommits: GraphCommit<TChange>[] = [];\n\n\t// If all commits that are about to be rebased over on the target branch already comprise the start of the source branch,\n\t// are in the same order, and have no other commits interleaving them, then no rebasing needs to occur. Those commits can\n\t// simply be removed from the source branch, and the remaining commits on the source branch are reparented off of the new\n\t// base commit.\n\tif (!hasSome(targetRebasePath)) {\n\t\tfor (const c of sourcePath) {\n\t\t\tsourceCommits.push(mintCommit(sourceCommits[sourceCommits.length - 1] ?? newBase, c));\n\t\t}\n\t\treturn {\n\t\t\tnewSourceHead: sourceCommits[sourceCommits.length - 1] ?? newBase,\n\t\t\tsourceChange: undefined,\n\t\t\tcommits: {\n\t\t\t\tdeletedSourceCommits,\n\t\t\t\ttargetCommits,\n\t\t\t\tsourceCommits,\n\t\t\t},\n\t\t\ttelemetryProperties: {\n\t\t\t\tsourceBranchLength,\n\t\t\t\trebaseDistance: targetCommits.length,\n\t\t\t\tcountDropped: sourceBranchLength - sourceSet.size,\n\t\t\t},\n\t\t};\n\t}\n\n\t// For each source commit, rebase backwards over the inverses of any commits already rebased, and then\n\t// rebase forwards over the rest of the commits up to the new base before advancing the new base.\n\tlet newHead = newBase;\n\tconst revInfos = getRevInfoFromTaggedChanges([...targetRebasePath, ...sourcePath]);\n\t// Note that the `revisionMetadata` gets updated as `revInfos` gets updated.\n\tconst revisionMetadata = revisionMetadataSourceFromInfo(revInfos);\n\tlet editsToCompose: TaggedChange<TChange>[] = targetRebasePath.slice();\n\tfor (const c of sourcePath) {\n\t\tconst rollback = rollbackFromCommit(changeRebaser, c, mintRevisionTag, true /* cache */);\n\t\tif (sourceSet.has(c.revision)) {\n\t\t\tconst currentComposedEdit = makeAnonChange(changeRebaser.compose(editsToCompose));\n\t\t\teditsToCompose = [currentComposedEdit];\n\t\t\tconst change = changeRebaser.rebase(c, currentComposedEdit, revisionMetadata);\n\t\t\tnewHead = {\n\t\t\t\trevision: c.revision,\n\t\t\t\tchange,\n\t\t\t\tparent: newHead,\n\t\t\t};\n\t\t\tsourceCommits.push(newHead);\n\t\t\teditsToCompose.push(tagChange(change, c.revision));\n\t\t}\n\t\trevInfos.push({ revision: c.revision });\n\t\teditsToCompose.unshift(rollback);\n\t\trevInfos.unshift({ revision: rollback.revision, rollbackOf: rollback.rollbackOf });\n\t}\n\n\treturn defineLazyCachedProperty(\n\t\t{\n\t\t\tnewSourceHead: newHead,\n\t\t\tcommits: {\n\t\t\t\tdeletedSourceCommits,\n\t\t\t\ttargetCommits,\n\t\t\t\tsourceCommits,\n\t\t\t},\n\t\t\ttelemetryProperties: {\n\t\t\t\tsourceBranchLength,\n\t\t\t\trebaseDistance: targetCommits.length,\n\t\t\t\tcountDropped: sourceBranchLength - sourceSet.size,\n\t\t\t},\n\t\t},\n\t\t\"sourceChange\",\n\t\t() => {\n\t\t\treturn changeRebaser.compose(editsToCompose);\n\t\t},\n\t);\n}\n\n/**\n * \"Sandwich/Horseshoe Rebase\" a change over the given source and target branches\n * @param changeRebaser - the change rebaser responsible for rebasing the change over the commits in each branch\n * @param change - the change to rebase\n * @param sourceHead - the head of the branch that `change` is based on\n * @param targetHead - the branch to rebase `change` onto\n * @returns the rebased change\n *\n * @remarks inverses will be cached.\n */\nexport function rebaseChange<TChange>(\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tchange: TaggedChange<TChange>,\n\tsourceHead: GraphCommit<TChange>,\n\ttargetHead: GraphCommit<TChange>,\n\tmintRevisionTag: () => RevisionTag,\n): RebaseChangeResult<TChange> {\n\tconst sourcePath: GraphCommit<TChange>[] = [];\n\tconst targetPath: GraphCommit<TChange>[] = [];\n\tassert(\n\t\tfindCommonAncestor([sourceHead, sourcePath], [targetHead, targetPath]) !== undefined,\n\t\t0x576 /* branch A and branch B must be related */,\n\t);\n\n\tconst inverses = sourcePath.map((commit) =>\n\t\trollbackFromCommit(changeRebaser, commit, mintRevisionTag, true),\n\t);\n\tinverses.reverse();\n\n\tconst telemetryProperties = {\n\t\tsourceBranchLength: 1,\n\t\trebaseDistance: sourcePath.length + targetPath.length,\n\t\tcountDropped: 0,\n\t};\n\n\treturn {\n\t\tchange: rebaseChangeOverChanges(changeRebaser, change, [...inverses, ...targetPath]),\n\t\ttelemetryProperties,\n\t};\n}\n\nexport function revisionMetadataSourceFromInfo(\n\trevInfos: readonly RevisionInfo[],\n): RevisionMetadataSource {\n\tconst compareRevisions = (revision1: RevisionTag, revision2: RevisionTag): number => {\n\t\tconst index1 = getIndex(revision1);\n\t\tconst index2 = getIndex(revision2);\n\n\t\tif (index1 !== undefined) {\n\t\t\treturn index2 !== undefined ? index2 - index1 : -1;\n\t\t}\n\n\t\treturn index2 !== undefined ? 1 : 0;\n\t};\n\n\tconst tryGetInfo = (revision: RevisionTag | undefined): RevisionInfo | undefined => {\n\t\tif (revision === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn revInfos.find((info) => info.revision === revision);\n\t};\n\n\tconst hasRollback = (revision: RevisionTag): boolean => {\n\t\treturn revInfos.find((info) => info.rollbackOf === revision) !== undefined;\n\t};\n\n\tconst getIndex = (revision: RevisionTag): number | undefined => {\n\t\tconst index = revInfos.findIndex((revInfo) => revInfo.revision === revision);\n\t\tif (index >= 0) {\n\t\t\treturn index;\n\t\t}\n\n\t\tconst rollbackIndex = revInfos.findIndex((revInfo) => revInfo.rollbackOf === revision);\n\t\tif (rollbackIndex >= 0) {\n\t\t\t// This change is the forward revision of a rollback included in revInfos, so it comes after\n\t\t\t// all revisions in revInfos. Earlier rollbacks have later forward revisions.\n\t\t\treturn 2 * revInfos.length - rollbackIndex;\n\t\t}\n\n\t\treturn undefined;\n\t};\n\n\treturn { compareRevisions, tryGetInfo, hasRollback };\n}\n\nexport function rebaseChangeOverChanges<TChange>(\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tchangeToRebase: TaggedChange<TChange>,\n\tchangesToRebaseOver: TaggedChange<TChange>[],\n): TChange {\n\tconst revisionMetadata = revisionMetadataSourceFromInfo(\n\t\tgetRevInfoFromTaggedChanges([...changesToRebaseOver, changeToRebase]),\n\t);\n\n\treturn changesToRebaseOver.reduce(\n\t\t(a, b) => mapTaggedChange(changeToRebase, changeRebaser.rebase(a, b, revisionMetadata)),\n\t\tchangeToRebase,\n\t).change;\n}\n\n// TODO: Deduplicate\nfunction getRevInfoFromTaggedChanges(changes: TaggedChange<unknown>[]): RevisionInfo[] {\n\tconst revInfos: RevisionInfo[] = [];\n\tfor (const taggedChange of changes) {\n\t\trevInfos.push(...revisionInfoFromTaggedChange(taggedChange));\n\t}\n\n\treturn revInfos;\n}\n\n// TODO: Deduplicate\nfunction revisionInfoFromTaggedChange(taggedChange: TaggedChange<unknown>): RevisionInfo[] {\n\tconst revInfos: RevisionInfo[] = [];\n\tif (taggedChange.revision !== undefined) {\n\t\tconst info: Mutable<RevisionInfo> = { revision: taggedChange.revision };\n\t\tif (taggedChange.rollbackOf !== undefined) {\n\t\t\tinfo.rollbackOf = taggedChange.rollbackOf;\n\t\t}\n\t\trevInfos.push(info);\n\t}\n\treturn revInfos;\n}\n\nfunction rollbackFromCommit<TChange>(\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tcommit: GraphCommit<TChange>,\n\tmintRevisionTag: () => RevisionTag,\n\tcache?: boolean,\n): TaggedChange<TChange, RevisionTag> {\n\tconst cachedRollback = Rollback.get(commit);\n\tif (cachedRollback !== undefined) {\n\t\treturn cachedRollback;\n\t}\n\tconst tag = mintRevisionTag();\n\tconst rollback = tagRollbackInverse(\n\t\tchangeRebaser.invert(commit, true, tag),\n\t\ttag,\n\t\tcommit.revision,\n\t);\n\n\tif (cache === true) {\n\t\tRollback.set(commit, rollback);\n\t}\n\treturn rollback;\n}\n\n/**\n * Find the furthest ancestor of some descendant.\n * @param descendant - a descendant. If an empty `path` array is included, it will be populated\n * with the chain of ancestry for `descendant` from most distant to closest (not including the furthest ancestor,\n * but otherwise including `descendant`).\n * @returns the furthest ancestor of `descendant`, or `descendant` itself if `descendant` has no ancestors.\n */\nexport function findAncestor<T extends { parent?: T }>(\n\tdescendant: T | [descendant: T, path?: T[]],\n): T;\n/**\n * Find the furthest ancestor of some descendant.\n * @param descendant - a descendant. If an empty `path` array is included, it will be populated\n * with the chain of ancestry for `descendant` from most distant to closest (not including the furthest ancestor,\n * but otherwise including `descendant`).\n * @returns the furthest ancestor of `descendant`, or `descendant` itself if `descendant` has no ancestors. Returns\n * `undefined` if `descendant` is undefined.\n */\nexport function findAncestor<T extends { parent?: T }>(\n\tdescendant: T | [descendant: T | undefined, path?: T[]] | undefined,\n): T | undefined;\n/**\n * Find an ancestor of some descendant.\n * @param descendant - a descendant. If an empty `path` array is included, it will be populated\n * with the chain of ancestry for `descendant` from most distant to closest (not including the ancestor found by `predicate`,\n * but otherwise including `descendant`).\n * @param predicate - a function which will be evaluated on `descendant` and then ancestor of `descendant` (in ascending order) until it returns true.\n * @returns the closest ancestor of `descendant` that satisfies `predicate`, or `undefined` if no such ancestor exists.\n *\n * @example\n *\n * ```typescript\n * interface Parented {\n * id: string;\n * parent?: Parented;\n * }\n * const g = { id: \"g\" }; // Grandparent\n * const p = { parent: g, id: \"p\" }; // Parent\n * const c = { parent: p, id: \"c\" }; // Child\n * const path: Parented[] = [];\n * const ancestor = findAncestor<Parented>([c, path], (n) => n.id === \"g\");\n * // ancestor === g\n * // path === [p, c]\n * ```\n */\nexport function findAncestor<T extends { parent?: T }>(\n\tdescendant: T | [descendant: T | undefined, path?: T[]] | undefined,\n\tpredicate: (t: T) => boolean,\n): T | undefined;\nexport function findAncestor<T extends { parent?: T }>(\n\tdescendant: T | [descendant: T | undefined, path?: T[]] | undefined,\n\tpredicate: (t: T) => boolean = (t): boolean => t.parent === undefined,\n): T | undefined {\n\tlet d: T | undefined;\n\tlet path: T[] | undefined;\n\tif (Array.isArray(descendant)) {\n\t\t[d, path] = descendant;\n\t} else {\n\t\td = descendant;\n\t}\n\tfor (let cur = d; cur !== undefined; cur = cur.parent) {\n\t\tif (predicate(cur)) {\n\t\t\tpath?.reverse();\n\t\t\treturn cur;\n\t\t}\n\t\tpath?.push(cur);\n\t}\n\n\tif (path !== undefined) {\n\t\tpath.length = 0;\n\t}\n\treturn undefined;\n}\n\n/**\n * Find a common ancestor between two descendants that are linked by parent pointers.\n * @param descendantA - a descendant. If an empty `path` array is included, it will be populated\n * with the chain of commits from the ancestor to `descendantA` (not including the ancestor).\n * @param descendantB - another descendant. If an empty `path` array is included, it will be populated\n * with the chain of commits from the ancestor to `descendantB` (not including the ancestor).\n * @returns the common ancestor of `descendantA` and `descendantB`, or `undefined` if no such ancestor exists.\n *\n * @example\n *\n * ```typescript\n * interface Parented {\n * parent?: Parented;\n * }\n * const shared = {};\n * const a = { parent: shared };\n * const b1 = { parent: shared };\n * const b2 = { parent: b1 };\n * const pathB: Parented[] = []\n * const ancestor = findCommonAncestor<Parented>(a, [b2, pathB]);\n * // ancestor === shared\n * // pathB === [b1, b2]\n * ```\n */\nexport function findCommonAncestor<T extends { parent?: T }>(\n\tdescendantA: T | [descendantA: T, path?: T[]] | undefined,\n\tdescendantB: T | [descendantB: T, path?: T[]] | undefined,\n): T | undefined {\n\tlet a: T | undefined;\n\tlet b: T | undefined;\n\tlet pathA: T[] | undefined;\n\tlet pathB: T[] | undefined;\n\tif (Array.isArray(descendantA)) {\n\t\t[a, pathA] = descendantA;\n\t\tassert(pathA === undefined || pathA.length === 0, 0x578 /* Path A must be empty */);\n\t} else {\n\t\ta = descendantA;\n\t}\n\tif (Array.isArray(descendantB)) {\n\t\t[b, pathB] = descendantB;\n\t\tassert(pathB === undefined || pathB.length === 0, 0x579 /* Path B must be empty */);\n\t} else {\n\t\tb = descendantB;\n\t}\n\n\tif (a === b) {\n\t\treturn a;\n\t}\n\n\tconst reversePaths = (): void => {\n\t\tpathA?.reverse();\n\t\tpathB?.reverse();\n\t};\n\n\tconst visited = new Set();\n\twhile (a !== undefined || b !== undefined) {\n\t\tif (a !== undefined) {\n\t\t\tif (visited.has(a)) {\n\t\t\t\tif (pathB !== undefined) {\n\t\t\t\t\tpathB.length = pathB.findIndex((r) => Object.is(r, a));\n\t\t\t\t}\n\t\t\t\treversePaths();\n\t\t\t\treturn a;\n\t\t\t}\n\t\t\tvisited.add(a);\n\t\t\tpathA?.push(a);\n\t\t\ta = a.parent;\n\t\t}\n\n\t\tif (b !== undefined) {\n\t\t\tif (visited.has(b)) {\n\t\t\t\tif (pathA !== undefined) {\n\t\t\t\t\tpathA.length = pathA.findIndex((r) => Object.is(r, b));\n\t\t\t\t}\n\t\t\t\treversePaths();\n\t\t\t\treturn b;\n\t\t\t}\n\t\t\tvisited.add(b);\n\t\t\tpathB?.push(b);\n\t\t\tb = b.parent;\n\t\t}\n\t}\n\n\tif (pathA !== undefined) {\n\t\tpathA.length = 0;\n\t}\n\tif (pathB !== undefined) {\n\t\tpathB.length = 0;\n\t}\n\treturn undefined;\n}\n\nexport function replaceChange<TChange>(\n\tcommit: GraphCommit<TChange>,\n\tchange: TChange,\n): GraphCommit<TChange> {\n\tconst output = { ...commit, change };\n\tRollback.set(output, undefined);\n\treturn output;\n}\n\n/** Associates rollback data with commits */\nnamespace Rollback {\n\tconst map = new WeakMap<GraphCommit<unknown>, TaggedChange<unknown, RevisionTag>>();\n\n\texport function get<TChange>(\n\t\tcommit: GraphCommit<TChange>,\n\t): TaggedChange<TChange, RevisionTag> | undefined {\n\t\treturn map.get(commit) as TaggedChange<TChange, RevisionTag> | undefined;\n\t}\n\n\texport function set<TChange>(\n\t\tcommit: GraphCommit<TChange>,\n\t\trollback: TaggedChange<TChange, RevisionTag> | undefined,\n\t): void {\n\t\tif (rollback === undefined) {\n\t\t\tmap.delete(commit);\n\t\t} else {\n\t\t\tmap.set(commit, rollback);\n\t\t}\n\t}\n}\n\n/**\n * Checks if one node is an ancestor of another in a parent-linked tree structure.\n * @param ancestor - The potential ancestor node\n * @param descendant - The potential descendant node\n * @param allowEqual - If true, returns true when ancestor === descendant\n * @returns true if ancestor is an ancestor of descendant (or equal if allowEqual is true)\n */\nexport function isAncestor<TNode extends { readonly parent?: TNode }>(\n\tancestor: TNode,\n\tdescendant: TNode,\n\tallowEqual: boolean,\n): boolean {\n\tif (allowEqual && ancestor === descendant) {\n\t\treturn true;\n\t}\n\n\tlet current = descendant.parent;\n\twhile (current !== undefined) {\n\t\tif (current === ancestor) {\n\t\t\treturn true;\n\t\t}\n\t\tcurrent = current.parent;\n\t}\n\n\treturn false;\n}\n\n/**\n * Returns a change that represents the different between two places in a commit graph.\n * Applying this change to the state at `sourceCommit` will yield the state at `targetCommit`.\n * @param changeRebaser - the change rebaser responsible for providing inverses to the changes in the commits.\n * @param sourceCommit - the commit representing the initial state.\n * @param targetCommit - the commit representing the final state.\n * @param mintRevisionTag - a function which can be called to create revision tags for any rollback changes that need to be generated.\n * @returns a change representing the difference between `sourceCommit` and `targetCommit`.\n */\nexport function diffHistories<TChange>(\n\tchangeRebaser: ChangeRebaser<TChange>,\n\tsourceCommit: GraphCommit<TChange>,\n\ttargetCommit: GraphCommit<TChange>,\n\tmintRevisionTag: () => RevisionTag,\n): TChange {\n\tconst sourcePath: GraphCommit<TChange>[] = [];\n\tconst targetPath: GraphCommit<TChange>[] = [];\n\tconst ancestor = findCommonAncestor([sourceCommit, sourcePath], [targetCommit, targetPath]);\n\tassert(ancestor !== undefined, 0xc6f /* Branches must be related */);\n\tconst inverses = sourcePath.map((commit) =>\n\t\trollbackFromCommit(changeRebaser, commit, mintRevisionTag),\n\t);\n\n\tinverses.reverse();\n\treturn changeRebaser.compose([...inverses, ...targetPath]);\n}\n"]}
@@ -9,10 +9,44 @@ import type { RevisionTag, RevisionTagCodec } from "../rebase/index.js";
9
9
  import type { FieldKey } from "../schema-stored/index.js";
10
10
  import type * as Delta from "./delta.js";
11
11
  import type { ForestRootId, Major } from "./detachedFieldIndexTypes.js";
12
+ /**
13
+ * Readonly interface for {@link DetachedFieldIndex}.
14
+ */
15
+ export interface ReadOnlyDetachedFieldIndex {
16
+ /**
17
+ * Creates a deep clone of this `DetachedFieldIndex`.
18
+ */
19
+ clone(): DetachedFieldIndex;
20
+ /**
21
+ * Returns a field key for the given ID.
22
+ * This does not save the field key on the index. To do so, call {@link createEntry}.
23
+ */
24
+ toFieldKey(id: ForestRootId): FieldKey;
25
+ /**
26
+ * Returns a node ID for the node in the given field.
27
+ * @param field - The field key where the detached node resides.
28
+ */
29
+ fromFieldKey(field: FieldKey): Delta.DetachedNodeId;
30
+ /**
31
+ * Returns the `ForestRootId` associated with the given id.
32
+ * Returns undefined if no such id is known to the index.
33
+ */
34
+ tryGetEntry(id: Delta.DetachedNodeId): ForestRootId | undefined;
35
+ /**
36
+ * Returns the `ForestRootId` associated with the given id.
37
+ * Fails if no such id is known to the index.
38
+ */
39
+ getEntry(id: Delta.DetachedNodeId): ForestRootId;
40
+ }
41
+ /**
42
+ * Restores the originating DetachedFieldIndex to the state it was in when the checkpoint was created.
43
+ * Can be invoked multiple times.
44
+ */
45
+ export type DetachedFieldIndexCheckpoint = () => void;
12
46
  /**
13
47
  * The tree index records detached field IDs and associates them with a change atom ID.
14
48
  */
15
- export declare class DetachedFieldIndex {
49
+ export declare class DetachedFieldIndex implements ReadOnlyDetachedFieldIndex {
16
50
  private readonly name;
17
51
  private rootIdAllocator;
18
52
  private readonly revisionTagCodec;
@@ -46,6 +80,10 @@ export declare class DetachedFieldIndex {
46
80
  */
47
81
  constructor(name: string, rootIdAllocator: IdAllocator<ForestRootId>, revisionTagCodec: RevisionTagCodec, idCompressor: IIdCompressor, options?: CodecWriteOptions);
48
82
  clone(): DetachedFieldIndex;
83
+ /**
84
+ * Creates a restorable checkpoint of the current state of the DetachedFieldIndex.
85
+ */
86
+ createCheckpoint(): DetachedFieldIndexCheckpoint;
49
87
  entries(): Generator<{
50
88
  root: ForestRootId;
51
89
  latestRelevantRevision?: RevisionTag;
@@ -56,20 +94,9 @@ export declare class DetachedFieldIndex {
56
94
  */
57
95
  purge(): void;
58
96
  updateMajor(current: Major, updated: Major): void;
59
- /**
60
- * Returns a field key for the given ID.
61
- * This does not save the field key on the index. To do so, call {@link createEntry}.
62
- */
63
97
  toFieldKey(id: ForestRootId): FieldKey;
64
- /**
65
- * Returns the FieldKey associated with the given id.
66
- * Returns undefined if no such id is known to the index.
67
- */
98
+ fromFieldKey(field: FieldKey): Delta.DetachedNodeId;
68
99
  tryGetEntry(id: Delta.DetachedNodeId): ForestRootId | undefined;
69
- /**
70
- * Returns the FieldKey associated with the given id.
71
- * Fails if no such id is known to the index.
72
- */
73
100
  getEntry(id: Delta.DetachedNodeId): ForestRootId;
74
101
  /**
75
102
  * Returns the detached root IDs for all the trees that were detached or last modified by the given revision.
@@ -1 +1 @@
1
- {"version":3,"file":"detachedFieldIndex.d.ts","sourceRoot":"","sources":["../../../src/core/tree/detachedFieldIndex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,K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