@fluidframework/tree 2.113.1 → 2.115.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (660) hide show
  1. package/CHANGELOG.md +289 -0
  2. package/api-report/tree.alpha.api.md +127 -39
  3. package/dist/core/change-family/changeFamily.d.ts +15 -4
  4. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  5. package/dist/core/change-family/changeFamily.js.map +1 -1
  6. package/dist/core/change-family/editBuilder.d.ts +2 -3
  7. package/dist/core/change-family/editBuilder.d.ts.map +1 -1
  8. package/dist/core/change-family/editBuilder.js +1 -2
  9. package/dist/core/change-family/editBuilder.js.map +1 -1
  10. package/dist/core/change-family/index.d.ts +1 -1
  11. package/dist/core/change-family/index.d.ts.map +1 -1
  12. package/dist/core/change-family/index.js.map +1 -1
  13. package/dist/core/index.d.ts +4 -3
  14. package/dist/core/index.d.ts.map +1 -1
  15. package/dist/core/index.js +3 -2
  16. package/dist/core/index.js.map +1 -1
  17. package/dist/core/rebase/index.d.ts +1 -1
  18. package/dist/core/rebase/index.d.ts.map +1 -1
  19. package/dist/core/rebase/index.js +2 -1
  20. package/dist/core/rebase/index.js.map +1 -1
  21. package/dist/core/rebase/types.d.ts +110 -0
  22. package/dist/core/rebase/types.d.ts.map +1 -1
  23. package/dist/core/rebase/types.js +47 -1
  24. package/dist/core/rebase/types.js.map +1 -1
  25. package/dist/core/tree/delta.d.ts +62 -16
  26. package/dist/core/tree/delta.d.ts.map +1 -1
  27. package/dist/core/tree/delta.js.map +1 -1
  28. package/dist/core/tree/detachedFieldIndex.d.ts +7 -13
  29. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  30. package/dist/core/tree/detachedFieldIndex.js +32 -46
  31. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  32. package/dist/core/tree/index.d.ts +1 -0
  33. package/dist/core/tree/index.d.ts.map +1 -1
  34. package/dist/core/tree/index.js.map +1 -1
  35. package/dist/core/tree/visitorUtils.d.ts +2 -4
  36. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  37. package/dist/core/tree/visitorUtils.js +2 -2
  38. package/dist/core/tree/visitorUtils.js.map +1 -1
  39. package/dist/entrypoints/alpha.d.ts +1 -1
  40. package/dist/entrypoints/alpha.d.ts.map +1 -1
  41. package/dist/entrypoints/alpha.js +8 -3
  42. package/dist/entrypoints/alpha.js.map +1 -1
  43. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +9 -6
  44. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  45. package/dist/feature-libraries/chunked-forest/codec/codecs.js +16 -13
  46. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  47. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  48. package/dist/feature-libraries/chunked-forest/uniformChunk.js +10 -2
  49. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  50. package/dist/feature-libraries/comparison-forest/comparisonForest.d.ts +51 -0
  51. package/dist/feature-libraries/comparison-forest/comparisonForest.d.ts.map +1 -0
  52. package/dist/feature-libraries/comparison-forest/comparisonForest.js +98 -0
  53. package/dist/feature-libraries/comparison-forest/comparisonForest.js.map +1 -0
  54. package/dist/feature-libraries/comparison-forest/index.d.ts +6 -0
  55. package/dist/feature-libraries/comparison-forest/index.d.ts.map +1 -0
  56. package/dist/feature-libraries/comparison-forest/index.js +10 -0
  57. package/dist/feature-libraries/comparison-forest/index.js.map +1 -0
  58. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +8 -6
  59. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  60. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
  61. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  62. package/dist/feature-libraries/default-schema/index.d.ts +1 -1
  63. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  64. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  65. package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
  66. package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
  67. package/dist/feature-libraries/default-schema/noChangeCodecs.js +3 -1
  68. package/dist/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
  69. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +6 -3
  70. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  71. package/dist/feature-libraries/detachedFieldIndexSummarizer.js +18 -6
  72. package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  73. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -3
  74. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  75. package/dist/feature-libraries/forest-summary/forestSummarizer.js +2 -3
  76. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  77. package/dist/feature-libraries/index.d.ts +4 -3
  78. package/dist/feature-libraries/index.d.ts.map +1 -1
  79. package/dist/feature-libraries/index.js +77 -72
  80. package/dist/feature-libraries/index.js.map +1 -1
  81. package/dist/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
  82. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  83. package/dist/feature-libraries/mitigatedChangeFamily.js +12 -0
  84. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  85. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +9 -1
  86. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  87. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  88. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
  89. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  90. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  91. package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
  92. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  93. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  94. package/dist/feature-libraries/modular-schema/invert.d.ts +15 -0
  95. package/dist/feature-libraries/modular-schema/invert.d.ts.map +1 -0
  96. package/dist/feature-libraries/modular-schema/invert.js +159 -0
  97. package/dist/feature-libraries/modular-schema/invert.js.map +1 -0
  98. package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts +3 -4
  99. package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
  100. package/dist/feature-libraries/modular-schema/minimizeModularChange.js +2 -2
  101. package/dist/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
  102. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +9 -9
  103. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  104. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +0 -2
  105. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  106. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +2 -2
  107. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  108. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  109. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  110. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  111. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  112. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -22
  113. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  114. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +53 -406
  115. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  116. package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts +61 -0
  117. package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -0
  118. package/dist/feature-libraries/modular-schema/modularChangeUtils.js +205 -0
  119. package/dist/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -0
  120. package/dist/feature-libraries/modular-schema/prune.d.ts +10 -0
  121. package/dist/feature-libraries/modular-schema/prune.d.ts.map +1 -0
  122. package/dist/feature-libraries/modular-schema/prune.js +49 -0
  123. package/dist/feature-libraries/modular-schema/prune.js.map +1 -0
  124. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +2 -2
  125. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  126. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  127. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
  128. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  129. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  130. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
  131. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  132. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  133. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +2 -2
  134. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  135. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  136. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +2 -2
  137. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  138. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  139. package/dist/feature-libraries/treeTextCursor.d.ts +15 -0
  140. package/dist/feature-libraries/treeTextCursor.d.ts.map +1 -1
  141. package/dist/feature-libraries/treeTextCursor.js +64 -1
  142. package/dist/feature-libraries/treeTextCursor.js.map +1 -1
  143. package/dist/index.d.ts +6 -4
  144. package/dist/index.d.ts.map +1 -1
  145. package/dist/index.js +10 -5
  146. package/dist/index.js.map +1 -1
  147. package/dist/packageVersion.d.ts +1 -1
  148. package/dist/packageVersion.js +1 -1
  149. package/dist/packageVersion.js.map +1 -1
  150. package/dist/shared-tree/serializedChange.d.ts +2 -2
  151. package/dist/shared-tree/serializedChange.d.ts.map +1 -1
  152. package/dist/shared-tree/serializedChange.js.map +1 -1
  153. package/dist/shared-tree/sharedTree.d.ts +11 -3
  154. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  155. package/dist/shared-tree/sharedTree.js +9 -7
  156. package/dist/shared-tree/sharedTree.js.map +1 -1
  157. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +2 -2
  158. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  159. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  160. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +41 -4
  161. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  162. package/dist/shared-tree/sharedTreeChangeFamily.js +57 -1
  163. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  164. package/dist/shared-tree/transactionMinimize.d.ts.map +1 -1
  165. package/dist/shared-tree/transactionMinimize.js +2 -2
  166. package/dist/shared-tree/transactionMinimize.js.map +1 -1
  167. package/dist/shared-tree/transactionPostProcessor.d.ts +2 -1
  168. package/dist/shared-tree/transactionPostProcessor.d.ts.map +1 -1
  169. package/dist/shared-tree/transactionPostProcessor.js.map +1 -1
  170. package/dist/shared-tree/treeCheckout.d.ts +13 -7
  171. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  172. package/dist/shared-tree/treeCheckout.js +59 -13
  173. package/dist/shared-tree/treeCheckout.js.map +1 -1
  174. package/dist/shared-tree-core/branch.d.ts +24 -9
  175. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  176. package/dist/shared-tree-core/branch.js +7 -0
  177. package/dist/shared-tree-core/branch.js.map +1 -1
  178. package/dist/shared-tree-core/editManager.d.ts +4 -4
  179. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  180. package/dist/shared-tree-core/editManager.js +2 -0
  181. package/dist/shared-tree-core/editManager.js.map +1 -1
  182. package/dist/shared-tree-core/editManagerCodecs.d.ts +3 -14
  183. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  184. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  185. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +11 -1
  186. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  187. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  188. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +4 -11
  189. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  190. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  191. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +4 -11
  192. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  193. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  194. package/dist/shared-tree-core/editManagerSummarizer.d.ts +4 -4
  195. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  196. package/dist/shared-tree-core/editManagerSummarizer.js +0 -1
  197. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  198. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
  199. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  200. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  201. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  202. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  203. package/dist/shared-tree-core/messageCodecs.d.ts +8 -1
  204. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  205. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  206. package/dist/shared-tree-core/sharedTreeCore.d.ts +5 -5
  207. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  208. package/dist/shared-tree-core/sharedTreeCore.js +1 -1
  209. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  210. package/dist/shared-tree-core/transaction.d.ts +10 -10
  211. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  212. package/dist/shared-tree-core/transaction.js +6 -3
  213. package/dist/shared-tree-core/transaction.js.map +1 -1
  214. package/dist/simple-tree/api/eraseSchemaDetails.d.ts +15 -0
  215. package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  216. package/dist/simple-tree/api/eraseSchemaDetails.js +15 -0
  217. package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  218. package/dist/simple-tree/api/index.d.ts +1 -1
  219. package/dist/simple-tree/api/index.d.ts.map +1 -1
  220. package/dist/simple-tree/api/index.js +2 -3
  221. package/dist/simple-tree/api/index.js.map +1 -1
  222. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +3 -3
  223. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  224. package/dist/simple-tree/api/schemaStatics.d.ts +6 -7
  225. package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
  226. package/dist/simple-tree/api/schemaStatics.js.map +1 -1
  227. package/dist/simple-tree/api/treeNodeApi.d.ts +20 -24
  228. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  229. package/dist/simple-tree/api/treeNodeApi.js +48 -49
  230. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  231. package/dist/simple-tree/core/treeNode.d.ts +5 -6
  232. package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
  233. package/dist/simple-tree/core/treeNode.js +2 -4
  234. package/dist/simple-tree/core/treeNode.js.map +1 -1
  235. package/dist/simple-tree/core/withType.d.ts +20 -7
  236. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  237. package/dist/simple-tree/core/withType.js +4 -7
  238. package/dist/simple-tree/core/withType.js.map +1 -1
  239. package/dist/simple-tree/index.d.ts +2 -2
  240. package/dist/simple-tree/index.d.ts.map +1 -1
  241. package/dist/simple-tree/index.js +3 -4
  242. package/dist/simple-tree/index.js.map +1 -1
  243. package/dist/simple-tree/leafNodeSchema.d.ts +6 -1
  244. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  245. package/dist/simple-tree/leafNodeSchema.js +0 -1
  246. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  247. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +53 -5
  248. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  249. package/dist/simple-tree/node-kinds/array/arrayNode.js +91 -10
  250. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  251. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +90 -0
  252. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  253. package/dist/simple-tree/node-kinds/map/mapNode.js +26 -1
  254. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  255. package/dist/simple-tree/node-kinds/object/objectNode.js +2 -2
  256. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  257. package/dist/simple-tree/node-kinds/record/recordNode.js +2 -2
  258. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  259. package/dist/text/codePointUtils.d.ts +2 -2
  260. package/dist/text/codePointUtils.js +2 -2
  261. package/dist/text/codePointUtils.js.map +1 -1
  262. package/dist/text/index.d.ts +3 -3
  263. package/dist/text/index.d.ts.map +1 -1
  264. package/dist/text/index.js +4 -4
  265. package/dist/text/index.js.map +1 -1
  266. package/dist/text/textDomain.d.ts +30 -18
  267. package/dist/text/textDomain.d.ts.map +1 -1
  268. package/dist/text/textDomain.js +44 -23
  269. package/dist/text/textDomain.js.map +1 -1
  270. package/dist/text/textDomainFormatted.d.ts +180 -82
  271. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  272. package/dist/text/textDomainFormatted.js +164 -84
  273. package/dist/text/textDomainFormatted.js.map +1 -1
  274. package/dist/text/textDomainFormattedDefault.d.ts +48 -25
  275. package/dist/text/textDomainFormattedDefault.d.ts.map +1 -1
  276. package/dist/text/textDomainFormattedDefault.js +24 -19
  277. package/dist/text/textDomainFormattedDefault.js.map +1 -1
  278. package/dist/treeDataStore.d.ts +49 -0
  279. package/dist/treeDataStore.d.ts.map +1 -0
  280. package/dist/treeDataStore.js +57 -0
  281. package/dist/treeDataStore.js.map +1 -0
  282. package/dist/treeFactory.d.ts +8 -3
  283. package/dist/treeFactory.d.ts.map +1 -1
  284. package/dist/treeFactory.js +6 -1
  285. package/dist/treeFactory.js.map +1 -1
  286. package/dist/util/compressedIds.d.ts +22 -2
  287. package/dist/util/compressedIds.d.ts.map +1 -1
  288. package/dist/util/compressedIds.js +22 -1
  289. package/dist/util/compressedIds.js.map +1 -1
  290. package/lib/core/change-family/changeFamily.d.ts +15 -4
  291. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  292. package/lib/core/change-family/changeFamily.js.map +1 -1
  293. package/lib/core/change-family/editBuilder.d.ts +2 -3
  294. package/lib/core/change-family/editBuilder.d.ts.map +1 -1
  295. package/lib/core/change-family/editBuilder.js +1 -2
  296. package/lib/core/change-family/editBuilder.js.map +1 -1
  297. package/lib/core/change-family/index.d.ts +1 -1
  298. package/lib/core/change-family/index.d.ts.map +1 -1
  299. package/lib/core/change-family/index.js.map +1 -1
  300. package/lib/core/index.d.ts +4 -3
  301. package/lib/core/index.d.ts.map +1 -1
  302. package/lib/core/index.js +2 -2
  303. package/lib/core/index.js.map +1 -1
  304. package/lib/core/rebase/index.d.ts +1 -1
  305. package/lib/core/rebase/index.d.ts.map +1 -1
  306. package/lib/core/rebase/index.js +1 -1
  307. package/lib/core/rebase/index.js.map +1 -1
  308. package/lib/core/rebase/types.d.ts +110 -0
  309. package/lib/core/rebase/types.d.ts.map +1 -1
  310. package/lib/core/rebase/types.js +46 -0
  311. package/lib/core/rebase/types.js.map +1 -1
  312. package/lib/core/tree/delta.d.ts +62 -16
  313. package/lib/core/tree/delta.d.ts.map +1 -1
  314. package/lib/core/tree/delta.js.map +1 -1
  315. package/lib/core/tree/detachedFieldIndex.d.ts +7 -13
  316. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  317. package/lib/core/tree/detachedFieldIndex.js +7 -21
  318. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  319. package/lib/core/tree/index.d.ts +1 -0
  320. package/lib/core/tree/index.d.ts.map +1 -1
  321. package/lib/core/tree/index.js.map +1 -1
  322. package/lib/core/tree/visitorUtils.d.ts +2 -4
  323. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  324. package/lib/core/tree/visitorUtils.js +2 -2
  325. package/lib/core/tree/visitorUtils.js.map +1 -1
  326. package/lib/entrypoints/alpha.d.ts +1 -1
  327. package/lib/entrypoints/alpha.d.ts.map +1 -1
  328. package/lib/entrypoints/alpha.js +1 -1
  329. package/lib/entrypoints/alpha.js.map +1 -1
  330. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +9 -6
  331. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  332. package/lib/feature-libraries/chunked-forest/codec/codecs.js +16 -13
  333. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  334. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  335. package/lib/feature-libraries/chunked-forest/uniformChunk.js +10 -2
  336. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  337. package/lib/feature-libraries/comparison-forest/comparisonForest.d.ts +51 -0
  338. package/lib/feature-libraries/comparison-forest/comparisonForest.d.ts.map +1 -0
  339. package/lib/feature-libraries/comparison-forest/comparisonForest.js +94 -0
  340. package/lib/feature-libraries/comparison-forest/comparisonForest.js.map +1 -0
  341. package/lib/feature-libraries/comparison-forest/index.d.ts +6 -0
  342. package/lib/feature-libraries/comparison-forest/index.d.ts.map +1 -0
  343. package/lib/feature-libraries/comparison-forest/index.js +6 -0
  344. package/lib/feature-libraries/comparison-forest/index.js.map +1 -0
  345. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +8 -6
  346. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  347. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
  348. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  349. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  350. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  351. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  352. package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
  353. package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
  354. package/lib/feature-libraries/default-schema/noChangeCodecs.js +3 -1
  355. package/lib/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
  356. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +6 -3
  357. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  358. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +16 -4
  359. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  360. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -3
  361. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  362. package/lib/feature-libraries/forest-summary/forestSummarizer.js +2 -3
  363. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  364. package/lib/feature-libraries/index.d.ts +4 -3
  365. package/lib/feature-libraries/index.d.ts.map +1 -1
  366. package/lib/feature-libraries/index.js +2 -1
  367. package/lib/feature-libraries/index.js.map +1 -1
  368. package/lib/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
  369. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  370. package/lib/feature-libraries/mitigatedChangeFamily.js +12 -0
  371. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  372. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +9 -1
  373. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  374. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  375. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
  376. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  377. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  378. package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
  379. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  380. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  381. package/lib/feature-libraries/modular-schema/invert.d.ts +15 -0
  382. package/lib/feature-libraries/modular-schema/invert.d.ts.map +1 -0
  383. package/lib/feature-libraries/modular-schema/invert.js +155 -0
  384. package/lib/feature-libraries/modular-schema/invert.js.map +1 -0
  385. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts +3 -4
  386. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
  387. package/lib/feature-libraries/modular-schema/minimizeModularChange.js +2 -2
  388. package/lib/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
  389. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +9 -9
  390. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  391. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +0 -2
  392. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  393. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +2 -2
  394. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  395. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  396. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  397. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  398. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  399. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -22
  400. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  401. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +16 -367
  402. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  403. package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts +61 -0
  404. package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -0
  405. package/lib/feature-libraries/modular-schema/modularChangeUtils.js +192 -0
  406. package/lib/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -0
  407. package/lib/feature-libraries/modular-schema/prune.d.ts +10 -0
  408. package/lib/feature-libraries/modular-schema/prune.d.ts.map +1 -0
  409. package/lib/feature-libraries/modular-schema/prune.js +45 -0
  410. package/lib/feature-libraries/modular-schema/prune.js.map +1 -0
  411. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +2 -2
  412. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  413. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  414. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
  415. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  416. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  417. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
  418. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  419. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  420. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +2 -2
  421. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  422. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  423. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +2 -2
  424. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  425. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  426. package/lib/feature-libraries/treeTextCursor.d.ts +15 -0
  427. package/lib/feature-libraries/treeTextCursor.d.ts.map +1 -1
  428. package/lib/feature-libraries/treeTextCursor.js +62 -1
  429. package/lib/feature-libraries/treeTextCursor.js.map +1 -1
  430. package/lib/index.d.ts +6 -4
  431. package/lib/index.d.ts.map +1 -1
  432. package/lib/index.js +4 -3
  433. package/lib/index.js.map +1 -1
  434. package/lib/packageVersion.d.ts +1 -1
  435. package/lib/packageVersion.js +1 -1
  436. package/lib/packageVersion.js.map +1 -1
  437. package/lib/shared-tree/serializedChange.d.ts +2 -2
  438. package/lib/shared-tree/serializedChange.d.ts.map +1 -1
  439. package/lib/shared-tree/serializedChange.js.map +1 -1
  440. package/lib/shared-tree/sharedTree.d.ts +11 -3
  441. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  442. package/lib/shared-tree/sharedTree.js +10 -8
  443. package/lib/shared-tree/sharedTree.js.map +1 -1
  444. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +2 -2
  445. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  446. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  447. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +41 -4
  448. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  449. package/lib/shared-tree/sharedTreeChangeFamily.js +55 -0
  450. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  451. package/lib/shared-tree/transactionMinimize.d.ts.map +1 -1
  452. package/lib/shared-tree/transactionMinimize.js +3 -3
  453. package/lib/shared-tree/transactionMinimize.js.map +1 -1
  454. package/lib/shared-tree/transactionPostProcessor.d.ts +2 -1
  455. package/lib/shared-tree/transactionPostProcessor.d.ts.map +1 -1
  456. package/lib/shared-tree/transactionPostProcessor.js.map +1 -1
  457. package/lib/shared-tree/treeCheckout.d.ts +13 -7
  458. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  459. package/lib/shared-tree/treeCheckout.js +61 -15
  460. package/lib/shared-tree/treeCheckout.js.map +1 -1
  461. package/lib/shared-tree-core/branch.d.ts +24 -9
  462. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  463. package/lib/shared-tree-core/branch.js +7 -0
  464. package/lib/shared-tree-core/branch.js.map +1 -1
  465. package/lib/shared-tree-core/editManager.d.ts +4 -4
  466. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  467. package/lib/shared-tree-core/editManager.js +2 -0
  468. package/lib/shared-tree-core/editManager.js.map +1 -1
  469. package/lib/shared-tree-core/editManagerCodecs.d.ts +3 -14
  470. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  471. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  472. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +11 -1
  473. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  474. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  475. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +4 -11
  476. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  477. package/lib/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
  478. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  479. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +4 -11
  480. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  481. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
  482. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  483. package/lib/shared-tree-core/editManagerSummarizer.d.ts +4 -4
  484. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  485. package/lib/shared-tree-core/editManagerSummarizer.js +0 -1
  486. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  487. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
  488. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  489. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  490. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  491. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  492. package/lib/shared-tree-core/messageCodecs.d.ts +8 -1
  493. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  494. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  495. package/lib/shared-tree-core/sharedTreeCore.d.ts +5 -5
  496. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  497. package/lib/shared-tree-core/sharedTreeCore.js +1 -1
  498. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  499. package/lib/shared-tree-core/transaction.d.ts +10 -10
  500. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  501. package/lib/shared-tree-core/transaction.js +6 -3
  502. package/lib/shared-tree-core/transaction.js.map +1 -1
  503. package/lib/simple-tree/api/eraseSchemaDetails.d.ts +15 -0
  504. package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  505. package/lib/simple-tree/api/eraseSchemaDetails.js +15 -0
  506. package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  507. package/lib/simple-tree/api/index.d.ts +1 -1
  508. package/lib/simple-tree/api/index.d.ts.map +1 -1
  509. package/lib/simple-tree/api/index.js +1 -1
  510. package/lib/simple-tree/api/index.js.map +1 -1
  511. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +3 -3
  512. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  513. package/lib/simple-tree/api/schemaStatics.d.ts +6 -7
  514. package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
  515. package/lib/simple-tree/api/schemaStatics.js.map +1 -1
  516. package/lib/simple-tree/api/treeNodeApi.d.ts +20 -24
  517. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  518. package/lib/simple-tree/api/treeNodeApi.js +46 -46
  519. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  520. package/lib/simple-tree/core/treeNode.d.ts +5 -6
  521. package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
  522. package/lib/simple-tree/core/treeNode.js +2 -4
  523. package/lib/simple-tree/core/treeNode.js.map +1 -1
  524. package/lib/simple-tree/core/withType.d.ts +20 -7
  525. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  526. package/lib/simple-tree/core/withType.js +4 -7
  527. package/lib/simple-tree/core/withType.js.map +1 -1
  528. package/lib/simple-tree/index.d.ts +2 -2
  529. package/lib/simple-tree/index.d.ts.map +1 -1
  530. package/lib/simple-tree/index.js +1 -1
  531. package/lib/simple-tree/index.js.map +1 -1
  532. package/lib/simple-tree/leafNodeSchema.d.ts +6 -1
  533. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  534. package/lib/simple-tree/leafNodeSchema.js +0 -1
  535. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  536. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +53 -5
  537. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  538. package/lib/simple-tree/node-kinds/array/arrayNode.js +93 -12
  539. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  540. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +90 -0
  541. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  542. package/lib/simple-tree/node-kinds/map/mapNode.js +27 -2
  543. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  544. package/lib/simple-tree/node-kinds/object/objectNode.js +3 -3
  545. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  546. package/lib/simple-tree/node-kinds/record/recordNode.js +3 -3
  547. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  548. package/lib/text/codePointUtils.d.ts +2 -2
  549. package/lib/text/codePointUtils.js +2 -2
  550. package/lib/text/codePointUtils.js.map +1 -1
  551. package/lib/text/index.d.ts +3 -3
  552. package/lib/text/index.d.ts.map +1 -1
  553. package/lib/text/index.js +3 -3
  554. package/lib/text/index.js.map +1 -1
  555. package/lib/text/textDomain.d.ts +30 -18
  556. package/lib/text/textDomain.d.ts.map +1 -1
  557. package/lib/text/textDomain.js +41 -22
  558. package/lib/text/textDomain.js.map +1 -1
  559. package/lib/text/textDomainFormatted.d.ts +180 -82
  560. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  561. package/lib/text/textDomainFormatted.js +165 -86
  562. package/lib/text/textDomainFormatted.js.map +1 -1
  563. package/lib/text/textDomainFormattedDefault.d.ts +48 -25
  564. package/lib/text/textDomainFormattedDefault.d.ts.map +1 -1
  565. package/lib/text/textDomainFormattedDefault.js +25 -20
  566. package/lib/text/textDomainFormattedDefault.js.map +1 -1
  567. package/lib/treeDataStore.d.ts +49 -0
  568. package/lib/treeDataStore.d.ts.map +1 -0
  569. package/lib/treeDataStore.js +52 -0
  570. package/lib/treeDataStore.js.map +1 -0
  571. package/lib/treeFactory.d.ts +8 -3
  572. package/lib/treeFactory.d.ts.map +1 -1
  573. package/lib/treeFactory.js +5 -0
  574. package/lib/treeFactory.js.map +1 -1
  575. package/lib/util/compressedIds.d.ts +22 -2
  576. package/lib/util/compressedIds.d.ts.map +1 -1
  577. package/lib/util/compressedIds.js +22 -1
  578. package/lib/util/compressedIds.js.map +1 -1
  579. package/package.json +32 -24
  580. package/src/core/change-family/changeFamily.ts +32 -4
  581. package/src/core/change-family/editBuilder.ts +1 -2
  582. package/src/core/change-family/index.ts +2 -0
  583. package/src/core/index.ts +11 -6
  584. package/src/core/rebase/index.ts +2 -0
  585. package/src/core/rebase/types.ts +113 -0
  586. package/src/core/tree/delta.ts +62 -16
  587. package/src/core/tree/detachedFieldIndex.ts +7 -38
  588. package/src/core/tree/index.ts +2 -0
  589. package/src/core/tree/visitorUtils.ts +3 -17
  590. package/src/entrypoints/alpha.ts +9 -1
  591. package/src/feature-libraries/chunked-forest/codec/codecs.ts +17 -14
  592. package/src/feature-libraries/chunked-forest/uniformChunk.ts +11 -1
  593. package/src/feature-libraries/comparison-forest/comparisonForest.ts +140 -0
  594. package/src/feature-libraries/comparison-forest/index.ts +6 -0
  595. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +20 -6
  596. package/src/feature-libraries/default-schema/index.ts +1 -0
  597. package/src/feature-libraries/default-schema/noChangeCodecs.ts +11 -3
  598. package/src/feature-libraries/detachedFieldIndexSummarizer.ts +33 -5
  599. package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -3
  600. package/src/feature-libraries/index.ts +5 -0
  601. package/src/feature-libraries/mitigatedChangeFamily.ts +21 -3
  602. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +10 -1
  603. package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +9 -4
  604. package/src/feature-libraries/modular-schema/index.ts +1 -0
  605. package/src/feature-libraries/modular-schema/invert.ts +338 -0
  606. package/src/feature-libraries/modular-schema/minimizeModularChange.ts +3 -5
  607. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +16 -13
  608. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +3 -1
  609. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +2 -1
  610. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +45 -644
  611. package/src/feature-libraries/modular-schema/modularChangeUtils.ts +340 -0
  612. package/src/feature-libraries/modular-schema/prune.ts +69 -0
  613. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +4 -2
  614. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +5 -2
  615. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +4 -2
  616. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +4 -2
  617. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +6 -3
  618. package/src/feature-libraries/treeTextCursor.ts +66 -1
  619. package/src/index.ts +11 -4
  620. package/src/packageVersion.ts +1 -1
  621. package/src/shared-tree/serializedChange.ts +2 -2
  622. package/src/shared-tree/sharedTree.ts +40 -15
  623. package/src/shared-tree/sharedTreeChangeCodecs.ts +11 -3
  624. package/src/shared-tree/sharedTreeChangeFamily.ts +77 -2
  625. package/src/shared-tree/transactionMinimize.ts +7 -3
  626. package/src/shared-tree/transactionPostProcessor.ts +5 -1
  627. package/src/shared-tree/treeCheckout.ts +136 -30
  628. package/src/shared-tree-core/branch.ts +41 -12
  629. package/src/shared-tree-core/editManager.ts +46 -25
  630. package/src/shared-tree-core/editManagerCodecs.ts +9 -21
  631. package/src/shared-tree-core/editManagerCodecsCommons.ts +14 -2
  632. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +18 -21
  633. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +18 -20
  634. package/src/shared-tree-core/editManagerSummarizer.ts +9 -6
  635. package/src/shared-tree-core/messageCodecV1ToV4.ts +3 -3
  636. package/src/shared-tree-core/messageCodecVSharedBranches.ts +2 -2
  637. package/src/shared-tree-core/messageCodecs.ts +12 -2
  638. package/src/shared-tree-core/sharedTreeCore.ts +16 -7
  639. package/src/shared-tree-core/transaction.ts +47 -25
  640. package/src/simple-tree/api/eraseSchemaDetails.ts +15 -0
  641. package/src/simple-tree/api/index.ts +0 -1
  642. package/src/simple-tree/api/schemaStatics.ts +2 -2
  643. package/src/simple-tree/api/treeNodeApi.ts +64 -48
  644. package/src/simple-tree/core/treeNode.ts +13 -10
  645. package/src/simple-tree/core/withType.ts +20 -7
  646. package/src/simple-tree/index.ts +1 -2
  647. package/src/simple-tree/leafNodeSchema.ts +6 -1
  648. package/src/simple-tree/node-kinds/array/arrayNode.ts +130 -16
  649. package/src/simple-tree/node-kinds/map/mapNode.ts +137 -5
  650. package/src/simple-tree/node-kinds/object/objectNode.ts +3 -3
  651. package/src/simple-tree/node-kinds/record/recordNode.ts +3 -3
  652. package/src/text/README.md +1 -1
  653. package/src/text/codePointUtils.ts +2 -2
  654. package/src/text/index.ts +3 -3
  655. package/src/text/textDomain.ts +50 -27
  656. package/src/text/textDomainFormatted.ts +384 -163
  657. package/src/text/textDomainFormattedDefault.ts +32 -32
  658. package/src/treeDataStore.ts +125 -0
  659. package/src/treeFactory.ts +11 -3
  660. package/src/util/compressedIds.ts +36 -3
@@ -61,8 +61,11 @@ export type SharedTreeBranchChange<TChange> =
61
61
  /**
62
62
  * The events emitted by a `SharedTreeBranch`
63
63
  */
64
- export interface SharedTreeBranchEvents<TEditor extends ChangeFamilyEditor, TChange>
65
- extends BranchTrimmingEvents {
64
+ export interface SharedTreeBranchEvents<
65
+ TEditor extends ChangeFamilyEditor,
66
+ TChange,
67
+ TChangeProcessingContext,
68
+ > extends BranchTrimmingEvents {
66
69
  /**
67
70
  * Fired just before the head of this branch changes.
68
71
  * @param change - the change to this branch's state and commits
@@ -79,7 +82,18 @@ export interface SharedTreeBranchEvents<TEditor extends ChangeFamilyEditor, TCha
79
82
  * Fired when this branch forks
80
83
  * @param fork - the new branch that forked off of this branch
81
84
  */
82
- fork(fork: SharedTreeBranch<TEditor, TChange>): void;
85
+ fork(fork: SharedTreeBranch<TEditor, TChange, TChangeProcessingContext>): void;
86
+
87
+ /**
88
+ * Fired when a commit is ordered by the sequencing service.
89
+ * @param commit - The commit that was sequenced
90
+ *
91
+ * @remarks
92
+ * Once a commit is sequenced, the following guarantees hold:
93
+ * 1. The changes carried by the commit have been persisted and other peers are able to see them.
94
+ * 2. There can be no more concurrent changes sequenced before this commit, which means this commit has reached its settled form.
95
+ */
96
+ commitSequenced(commit: GraphCommit<TChange>): void;
83
97
 
84
98
  /**
85
99
  * Fired after this branch is disposed
@@ -107,9 +121,16 @@ export interface BranchTrimmingEvents {
107
121
  /**
108
122
  * A branch of changes that can be applied to a SharedTree.
109
123
  */
110
- export class SharedTreeBranch<TEditor extends ChangeFamilyEditor, TChange> {
111
- readonly #events = createEmitter<SharedTreeBranchEvents<TEditor, TChange>>();
112
- public readonly events: Listenable<SharedTreeBranchEvents<TEditor, TChange>> = this.#events;
124
+ export class SharedTreeBranch<
125
+ TEditor extends ChangeFamilyEditor,
126
+ TChange,
127
+ TChangeProcessingContext,
128
+ > {
129
+ readonly #events =
130
+ createEmitter<SharedTreeBranchEvents<TEditor, TChange, TChangeProcessingContext>>();
131
+ public readonly events: Listenable<
132
+ SharedTreeBranchEvents<TEditor, TChange, TChangeProcessingContext>
133
+ > = this.#events;
113
134
  public readonly editor: TEditor;
114
135
  private disposed = false;
115
136
  private readonly unsubscribeBranchTrimmer?: () => void;
@@ -123,7 +144,7 @@ export class SharedTreeBranch<TEditor extends ChangeFamilyEditor, TChange> {
123
144
  */
124
145
  public constructor(
125
146
  private head: GraphCommit<TChange>,
126
- public readonly changeFamily: ChangeFamily<TEditor, TChange>,
147
+ public readonly changeFamily: ChangeFamily<TEditor, TChange, TChangeProcessingContext>,
127
148
  private readonly mintRevisionTag: () => RevisionTag,
128
149
  private readonly branchTrimmer?: Listenable<BranchTrimmingEvents>,
129
150
  private readonly telemetryEventBatcher?: TelemetryEventBatcher<
@@ -177,6 +198,14 @@ export class SharedTreeBranch<TEditor extends ChangeFamilyEditor, TChange> {
177
198
  this.#events.emit("afterChange", changeEvent);
178
199
  }
179
200
 
201
+ /**
202
+ * Notifies the branch that a commit has been sequenced by the sequencing service.
203
+ * @param commit - The commit that was sequenced
204
+ */
205
+ public commitWasSequenced(commit: GraphCommit<TChange>): void {
206
+ this.#events.emit("commitSequenced", commit);
207
+ }
208
+
180
209
  /**
181
210
  * Gets the commit at the head of this branch.
182
211
  */
@@ -194,7 +223,7 @@ export class SharedTreeBranch<TEditor extends ChangeFamilyEditor, TChange> {
194
223
  public fork(
195
224
  commit: GraphCommit<TChange> = this.head,
196
225
  mintRevisionTag: () => RevisionTag = this.mintRevisionTag,
197
- ): SharedTreeBranch<TEditor, TChange> {
226
+ ): SharedTreeBranch<TEditor, TChange, TChangeProcessingContext> {
198
227
  this.assertNotDisposed();
199
228
  const fork = new SharedTreeBranch(
200
229
  commit,
@@ -215,7 +244,7 @@ export class SharedTreeBranch<TEditor extends ChangeFamilyEditor, TChange> {
215
244
  * @returns the result of the rebase or undefined if nothing changed
216
245
  */
217
246
  public rebaseOnto(
218
- branch: SharedTreeBranch<TEditor, TChange>,
247
+ branch: SharedTreeBranch<TEditor, TChange, TChangeProcessingContext>,
219
248
  upTo = branch.getHead(),
220
249
  ): void {
221
250
  this.assertNotDisposed();
@@ -291,7 +320,7 @@ export class SharedTreeBranch<TEditor extends ChangeFamilyEditor, TChange> {
291
320
  * @returns the commits that were added to this branch by the merge, or undefined if nothing changed
292
321
  */
293
322
  public merge(
294
- branch: SharedTreeBranch<TEditor, TChange>,
323
+ branch: SharedTreeBranch<TEditor, TChange, TChangeProcessingContext>,
295
324
  ): { sourceCommits: GraphCommit<TChange>[] } | undefined {
296
325
  this.assertNotDisposed();
297
326
  branch.assertNotDisposed();
@@ -328,8 +357,8 @@ export class SharedTreeBranch<TEditor extends ChangeFamilyEditor, TChange> {
328
357
 
329
358
  /** Rebase `branchHead` onto `onto`, but return undefined if nothing changed */
330
359
  private rebaseBranch(
331
- branch: SharedTreeBranch<TEditor, TChange>,
332
- onto: SharedTreeBranch<TEditor, TChange>,
360
+ branch: SharedTreeBranch<TEditor, TChange, TChangeProcessingContext>,
361
+ onto: SharedTreeBranch<TEditor, TChange, TChangeProcessingContext>,
333
362
  upTo = onto.getHead(),
334
363
  ): BranchRebaseResult<TChange> | undefined {
335
364
  const { head } = branch;
@@ -74,11 +74,14 @@ const maxRebaseStatsAggregationCount = 1000;
74
74
  export class EditManager<
75
75
  TEditor extends ChangeFamilyEditor,
76
76
  TChangeset,
77
- TChangeFamily extends ChangeFamily<TEditor, TChangeset>,
77
+ TChangeProcessingContext = never,
78
78
  > {
79
79
  private readonly _events = createEmitter<BranchTrimmingEvents>();
80
80
 
81
- private readonly sharedBranches = new Map<BranchId, SharedBranch<TEditor, TChangeset>>();
81
+ private readonly sharedBranches = new Map<
82
+ BranchId,
83
+ SharedBranch<TEditor, TChangeset, TChangeProcessingContext>
84
+ >();
82
85
 
83
86
  /**
84
87
  * Tracks where on the trunk of the main branch all registered branches are based.
@@ -90,7 +93,7 @@ export class EditManager<
90
93
  */
91
94
  private readonly trunkBranches = new BTree<
92
95
  SequenceId,
93
- Set<SharedTreeBranch<TEditor, TChangeset>>
96
+ Set<SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext>>
94
97
  >(undefined, sequenceIdComparator);
95
98
 
96
99
  /**
@@ -121,7 +124,7 @@ export class EditManager<
121
124
  * @param retainHistory - when `true`, trunk commits are never trimmed/evicted.
122
125
  */
123
126
  public constructor(
124
- public readonly changeFamily: TChangeFamily,
127
+ public readonly changeFamily: ChangeFamily<TEditor, TChangeset, TChangeProcessingContext>,
125
128
  public readonly localSessionId: SessionId,
126
129
  private readonly mintRevisionTag: () => RevisionTag,
127
130
  private readonly onSharedBranchCreated?: (branchId: BranchId) => void,
@@ -155,7 +158,9 @@ export class EditManager<
155
158
  this.createAndAddSharedBranch("main", "main", undefined, undefined, mainTrunk);
156
159
  }
157
160
 
158
- public getLocalBranch(branchId: BranchId): SharedTreeBranch<TEditor, TChangeset> {
161
+ public getLocalBranch(
162
+ branchId: BranchId,
163
+ ): SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext> {
159
164
  return this.getSharedBranch(branchId).localBranch;
160
165
  }
161
166
 
@@ -163,7 +168,9 @@ export class EditManager<
163
168
  return this.getSharedBranch(branchId).branchName;
164
169
  }
165
170
 
166
- private getSharedBranch(branchId: BranchId): SharedBranch<TEditor, TChangeset> {
171
+ private getSharedBranch(
172
+ branchId: BranchId,
173
+ ): SharedBranch<TEditor, TChangeset, TChangeProcessingContext> {
167
174
  const branch = this.sharedBranches.get(branchId);
168
175
  if (branch === undefined) {
169
176
  throw new UsageError("No shared branch with such ID");
@@ -180,7 +187,9 @@ export class EditManager<
180
187
  * TODO#AB6925: Maintain the divergence point between each branch and the trunk so that we don't have to recompute
181
188
  * it so often.
182
189
  */
183
- private registerBranch(branch: SharedTreeBranch<TEditor, TChangeset>): void {
190
+ private registerBranch(
191
+ branch: SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext>,
192
+ ): void {
184
193
  this.trackBranch(branch);
185
194
  // Whenever the branch is rebased, update our record of its base trunk commit
186
195
  const offBeforeRebase = branch.events.on("beforeChange", (args) => {
@@ -204,7 +213,9 @@ export class EditManager<
204
213
  });
205
214
  }
206
215
 
207
- private trackBranch(b: SharedTreeBranch<TEditor, TChangeset>): void {
216
+ private trackBranch(
217
+ b: SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext>,
218
+ ): void {
208
219
  const main = this.getSharedBranch("main");
209
220
  const trunkCommit =
210
221
  findCommonAncestor(main.trunk.getHead(), b.getHead()) ??
@@ -216,7 +227,9 @@ export class EditManager<
216
227
  branches.add(b);
217
228
  }
218
229
 
219
- private untrackBranch(b: SharedTreeBranch<TEditor, TChangeset>): void {
230
+ private untrackBranch(
231
+ b: SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext>,
232
+ ): void {
220
233
  const main = this.getSharedBranch("main");
221
234
  const trunkCommit =
222
235
  findCommonAncestor(main.trunk.getHead(), b.getHead()) ??
@@ -498,9 +511,9 @@ export class EditManager<
498
511
  branchId: BranchId,
499
512
  branchName: string | undefined,
500
513
  sessionId: SessionId | undefined,
501
- parent: SharedBranch<TEditor, TChangeset> | undefined,
502
- branch: SharedTreeBranch<TEditor, TChangeset>,
503
- ): SharedBranch<TEditor, TChangeset> {
514
+ parent: SharedBranch<TEditor, TChangeset, TChangeProcessingContext> | undefined,
515
+ branch: SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext>,
516
+ ): SharedBranch<TEditor, TChangeset, TChangeProcessingContext> {
504
517
  const sharedBranch = this.createSharedBranch(
505
518
  branchId,
506
519
  branchName,
@@ -514,7 +527,7 @@ export class EditManager<
514
527
 
515
528
  private addSharedBranch(
516
529
  branchId: BranchId,
517
- branch: SharedBranch<TEditor, TChangeset>,
530
+ branch: SharedBranch<TEditor, TChangeset, TChangeProcessingContext>,
518
531
  ): void {
519
532
  assert(
520
533
  !this.sharedBranches.has(branchId),
@@ -537,9 +550,9 @@ export class EditManager<
537
550
  branchId: BranchId,
538
551
  branchName: string | undefined,
539
552
  sessionId: SessionId | undefined,
540
- parent: SharedBranch<TEditor, TChangeset> | undefined,
541
- branch: SharedTreeBranch<TEditor, TChangeset>,
542
- ): SharedBranch<TEditor, TChangeset> {
553
+ parent: SharedBranch<TEditor, TChangeset, TChangeProcessingContext> | undefined,
554
+ branch: SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext>,
555
+ ): SharedBranch<TEditor, TChangeset, TChangeProcessingContext> {
543
556
  const sharedBranch = new SharedBranch(
544
557
  parent,
545
558
  branch,
@@ -587,6 +600,7 @@ export class EditManager<
587
600
  sequenceId: SequenceId,
588
601
  previousSequenceId: SequenceId,
589
602
  ): void => {
603
+ branch.localBranch.commitWasSequenced(commit);
590
604
  // Next, we need to update the sequence IDs that our local branches (user's branches, not peer branches) are associated with.
591
605
  // In particular, if a local branch is based on the previous trunk head (the branch's first ancestor in the trunk is the commit that was the head before we pushed the new commit)
592
606
  // and also branches off of the local branch (it has an ancestor that is part of the local branch), it needs to have its sequence number advanced to be that of the new trunk head.
@@ -604,6 +618,7 @@ export class EditManager<
604
618
  if (findAncestor(forkedBranch.getHead(), (c) => c === commit) !== undefined) {
605
619
  newBranches.add(forkedBranch);
606
620
  currentBranches.delete(forkedBranch);
621
+ forkedBranch.commitWasSequenced(commit);
607
622
  }
608
623
  }
609
624
  // Clean up our trunk branches map by removing any empty sets.
@@ -675,19 +690,21 @@ function getPathFromBase<TCommit extends { parent?: TCommit }>(
675
690
  return path;
676
691
  }
677
692
 
678
- class SharedBranch<TEditor extends ChangeFamilyEditor, TChangeset> {
693
+ class SharedBranch<TEditor extends ChangeFamilyEditor, TChangeset, TChangeProcessingContext> {
679
694
  /**
680
695
  * This branch holds the changes made by this client which have not yet been confirmed as sequenced changes.
681
696
  */
682
- public readonly localBranch: SharedTreeBranch<TEditor, TChangeset>;
697
+ public readonly localBranch: SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext>;
683
698
 
684
699
  /**
685
700
  * Branches are maintained to represent the local change list that the issuing client had
686
701
  * at the time of submitting the latest known edit on the branch.
687
702
  * This means the head commit of each branch is always in its original (non-rebased) form.
688
703
  */
689
- private readonly peerLocalBranches: Map<SessionId, SharedTreeBranch<TEditor, TChangeset>> =
690
- new Map();
704
+ private readonly peerLocalBranches: Map<
705
+ SessionId,
706
+ SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext>
707
+ > = new Map();
691
708
 
692
709
  /**
693
710
  * A map from a sequence id to the commit which has that sequence id.
@@ -714,13 +731,15 @@ class SharedBranch<TEditor extends ChangeFamilyEditor, TChangeset> {
714
731
  >();
715
732
 
716
733
  public constructor(
717
- public readonly parentBranch: SharedBranch<TEditor, TChangeset> | undefined,
718
- public readonly trunk: SharedTreeBranch<TEditor, TChangeset>,
734
+ public readonly parentBranch:
735
+ | SharedBranch<TEditor, TChangeset, TChangeProcessingContext>
736
+ | undefined,
737
+ public readonly trunk: SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext>,
719
738
  private readonly id: BranchId,
720
739
  public readonly branchName: string | undefined,
721
740
  private readonly sessionId: SessionId | undefined,
722
741
  baseCommitSequenceId: SequenceId,
723
- private readonly changeFamily: ChangeFamily<TEditor, TChangeset>,
742
+ private readonly changeFamily: ChangeFamily<TEditor, TChangeset, TChangeProcessingContext>,
724
743
  private readonly mintRevisionTag: () => RevisionTag,
725
744
  branchTrimmer: Listenable<BranchTrimmingEvents>,
726
745
  telemetryEventBatcher: TelemetryEventBatcher<keyof RebaseStatsWithDuration> | undefined,
@@ -837,7 +856,7 @@ class SharedBranch<TEditor extends ChangeFamilyEditor, TChangeset> {
837
856
  public rebasePeer(
838
857
  sessionId: SessionId,
839
858
  referenceSequenceNumber: SeqNumber,
840
- ): SharedTreeBranch<TEditor, TChangeset> {
859
+ ): SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext> {
841
860
  const [, baseRevisionInTrunk] = this.getClosestTrunkCommit(referenceSequenceNumber);
842
861
  const peerLocalBranch = getOrCreate(
843
862
  this.peerLocalBranches,
@@ -848,7 +867,9 @@ class SharedBranch<TEditor extends ChangeFamilyEditor, TChangeset> {
848
867
  return peerLocalBranch;
849
868
  }
850
869
 
851
- public getPeerBranchOrTrunk(sessionId: SessionId): SharedTreeBranch<TEditor, TChangeset> {
870
+ public getPeerBranchOrTrunk(
871
+ sessionId: SessionId,
872
+ ): SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext> {
852
873
  return this.peerLocalBranches.get(sessionId) ?? this.trunk;
853
874
  }
854
875
 
@@ -3,7 +3,6 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import type { IIdCompressor } from "@fluidframework/id-compressor";
7
6
  import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
8
7
  import { lowestMinVersionForCollab } from "@fluidframework/runtime-utils/internal";
9
8
 
@@ -18,30 +17,17 @@ import {
18
17
  type IJsonCodec,
19
18
  makeDiscontinuedCodecAndSchema,
20
19
  } from "../codec/index.js";
21
- import type {
22
- ChangeEncodingContext,
23
- EncodedRevisionTag,
24
- RevisionTag,
25
- SchemaAndPolicy,
26
- } from "../core/index.js";
27
- import type { IdentifierHealingConfig } from "../util/index.js";
20
+ import type { ChangeEncodingContext, EncodedRevisionTag, RevisionTag } from "../core/index.js";
28
21
 
29
22
  import type { SummaryData } from "./editManager.js";
23
+ import type {
24
+ EditManagerDecodingContext,
25
+ EditManagerEncodingContext,
26
+ } from "./editManagerCodecsCommons.js";
30
27
  import { makeV1toV4andV6CodecWithVersion } from "./editManagerCodecsV1toV4.js";
31
28
  import { makeSharedBranchesCodecWithVersion } from "./editManagerCodecsVSharedBranches.js";
32
29
  import { EditManagerFormatVersion } from "./editManagerFormatCommons.js";
33
30
 
34
- /**
35
- * Context required for encoding/decoding the {@link EditManager}'s {@link SummaryData}.
36
- */
37
- export interface EditManagerEncodingContext {
38
- idCompressor: IIdCompressor;
39
- readonly schema?: SchemaAndPolicy;
40
- readonly isSummary: boolean;
41
- /** See {@link IdentifierHealingConfig}. */
42
- readonly healing?: IdentifierHealingConfig;
43
- }
44
-
45
31
  /**
46
32
  * Codec name used to identify the {@link EditManager} codec, see {@link makeEditManagerCodecBuilder}.
47
33
  */
@@ -72,14 +58,16 @@ export function makeEditManagerCodecBuilder<TChangeset>(): VersionDispatchingCod
72
58
  SummaryData<TChangeset>,
73
59
  EditManagerEncodingContext,
74
60
  EditManagerFormatVersion,
75
- typeof editManagerCodecName
61
+ typeof editManagerCodecName,
62
+ EditManagerDecodingContext
76
63
  > {
77
64
  // See EditManagerFormatVersion and its members for documentation on what changed in each version.
78
65
  const versions: CodecVersion<
79
66
  SummaryData<TChangeset>,
80
67
  EditManagerEncodingContext,
81
68
  EditManagerFormatVersion,
82
- EditManagerCodecOptions<TChangeset>
69
+ EditManagerCodecOptions<TChangeset>,
70
+ EditManagerDecodingContext
83
71
  >[] = [
84
72
  makeDiscontinuedCodecAndSchema(EditManagerFormatVersion.v1, "2.73.0"),
85
73
  makeDiscontinuedCodecAndSchema(EditManagerFormatVersion.v2, "2.73.0"),
@@ -9,6 +9,7 @@ import type { IIdCompressor, SessionId } from "@fluidframework/id-compressor";
9
9
  import type { IJsonCodec } from "../codec/index.js";
10
10
  import type {
11
11
  ChangeEncodingContext,
12
+ ChangeDecodingContext,
12
13
  EncodedRevisionTag,
13
14
  RevisionTag,
14
15
  SchemaAndPolicy,
@@ -39,6 +40,17 @@ export interface EditManagerEncodingContext {
39
40
  * but it is carried explicitly so downstream codecs can read it.
40
41
  */
41
42
  readonly isSummary: boolean;
43
+ }
44
+
45
+ /**
46
+ * Context required for decoding the {@link EditManager}'s {@link SummaryData}.
47
+ * @remarks
48
+ * Unlike {@link EditManagerEncodingContext}, this carries {@link IdentifierHealingConfig} (used only
49
+ * on decode) and omits `schema` (only consulted when encoding).
50
+ */
51
+ export interface EditManagerDecodingContext {
52
+ readonly idCompressor: IIdCompressor;
53
+ readonly isSummary: boolean;
42
54
  /** See {@link IdentifierHealingConfig}. */
43
55
  readonly healing?: IdentifierHealingConfig;
44
56
  }
@@ -87,7 +99,7 @@ function decodeCommit<TChangeset, T extends EncodedCommit<JsonCompatibleReadOnly
87
99
  ChangeEncodingContext
88
100
  >,
89
101
  commit: T,
90
- context: ChangeEncodingContext,
102
+ context: ChangeDecodingContext,
91
103
  ) {
92
104
  const revision = revisionTagCodec.decode(commit.revision, {
93
105
  originatorId: commit.sessionId,
@@ -192,7 +204,7 @@ export function decodeSharedBranch<TChangeset>(
192
204
  ChangeEncodingContext
193
205
  >,
194
206
  json: EncodedSharedBranch<TChangeset>,
195
- context: EditManagerEncodingContext,
207
+ context: EditManagerDecodingContext,
196
208
  originatorId: SessionId | undefined,
197
209
  ): SharedBranchSummaryData<TChangeset> {
198
210
  // TODO: sort out EncodedCommit vs Commit, and make this type check without type assertion.
@@ -3,34 +3,23 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import type { IIdCompressor } from "@fluidframework/id-compressor";
7
-
8
6
  import type { CodecAndSchema, IJsonCodec, Versioned } from "../codec/index.js";
9
- import type {
10
- ChangeEncodingContext,
11
- EncodedRevisionTag,
12
- RevisionTag,
13
- SchemaAndPolicy,
14
- } from "../core/index.js";
7
+ import type { ChangeEncodingContext, EncodedRevisionTag, RevisionTag } from "../core/index.js";
15
8
  import {
16
- type IdentifierHealingConfig,
17
9
  type JsonCompatibleReadOnly,
18
10
  type JsonCompatibleReadOnlyObject,
19
11
  JsonCompatibleReadOnlySchema,
20
12
  } from "../util/index.js";
21
13
 
22
14
  import type { SummaryData } from "./editManager.js";
23
- import { decodeSharedBranch, encodeSharedBranch } from "./editManagerCodecsCommons.js";
15
+ import {
16
+ decodeSharedBranch,
17
+ encodeSharedBranch,
18
+ type EditManagerDecodingContext,
19
+ type EditManagerEncodingContext,
20
+ } from "./editManagerCodecsCommons.js";
24
21
  import { EncodedEditManager } from "./editManagerFormatV1toV4.js";
25
22
 
26
- export interface EditManagerEncodingContext {
27
- idCompressor: IIdCompressor;
28
- readonly schema?: SchemaAndPolicy;
29
- readonly isSummary: boolean;
30
- /** See {@link IdentifierHealingConfig}. */
31
- readonly healing?: IdentifierHealingConfig;
32
- }
33
-
34
23
  /**
35
24
  * Create the provided version of the {@link EditManager} codec (which encodes it's {@link SummaryData}).
36
25
  * @remarks
@@ -53,10 +42,18 @@ export function makeV1toV4andV6CodecWithVersion<TChangeset>(
53
42
  ChangeEncodingContext
54
43
  >,
55
44
  version: EncodedEditManager<TChangeset>["version"],
56
- ): CodecAndSchema<SummaryData<TChangeset>, EditManagerEncodingContext> {
45
+ ): CodecAndSchema<
46
+ SummaryData<TChangeset>,
47
+ EditManagerEncodingContext,
48
+ EditManagerDecodingContext
49
+ > {
57
50
  const schema = EncodedEditManager(changeCodec.encodedSchema ?? JsonCompatibleReadOnlySchema);
58
51
 
59
- const codec: CodecAndSchema<SummaryData<TChangeset>, EditManagerEncodingContext> = {
52
+ const codec: CodecAndSchema<
53
+ SummaryData<TChangeset>,
54
+ EditManagerEncodingContext,
55
+ EditManagerDecodingContext
56
+ > = {
60
57
  schema,
61
58
  encode: (
62
59
  data: SummaryData<TChangeset>,
@@ -80,7 +77,7 @@ export function makeV1toV4andV6CodecWithVersion<TChangeset>(
80
77
  },
81
78
  decode: (
82
79
  json: EncodedEditManager<TChangeset> & JsonCompatibleReadOnly,
83
- context: EditManagerEncodingContext,
80
+ context: EditManagerDecodingContext,
84
81
  ): SummaryData<TChangeset> => {
85
82
  return {
86
83
  main: decodeSharedBranch(
@@ -4,17 +4,10 @@
4
4
  */
5
5
 
6
6
  import { assert } from "@fluidframework/core-utils/internal";
7
- import type { IIdCompressor } from "@fluidframework/id-compressor";
8
7
 
9
8
  import type { CodecAndSchema, IJsonCodec } from "../codec/index.js";
10
- import type {
11
- ChangeEncodingContext,
12
- EncodedRevisionTag,
13
- RevisionTag,
14
- SchemaAndPolicy,
15
- } from "../core/index.js";
9
+ import type { ChangeEncodingContext, EncodedRevisionTag, RevisionTag } from "../core/index.js";
16
10
  import {
17
- type IdentifierHealingConfig,
18
11
  type JsonCompatibleReadOnly,
19
12
  type JsonCompatibleReadOnlyObject,
20
13
  JsonCompatibleReadOnlySchema,
@@ -23,18 +16,15 @@ import {
23
16
 
24
17
  import type { BranchId } from "./branch.js";
25
18
  import type { SharedBranchSummaryData, SummaryData } from "./editManager.js";
26
- import { decodeSharedBranch, encodeSharedBranch } from "./editManagerCodecsCommons.js";
19
+ import {
20
+ decodeSharedBranch,
21
+ encodeSharedBranch,
22
+ type EditManagerDecodingContext,
23
+ type EditManagerEncodingContext,
24
+ } from "./editManagerCodecsCommons.js";
27
25
  import type { EncodedSharedBranch } from "./editManagerFormatCommons.js";
28
26
  import { EncodedEditManager } from "./editManagerFormatVSharedBranches.js";
29
27
 
30
- export interface EditManagerEncodingContext {
31
- idCompressor: IIdCompressor;
32
- readonly schema?: SchemaAndPolicy;
33
- readonly isSummary: boolean;
34
- /** See {@link IdentifierHealingConfig}. */
35
- readonly healing?: IdentifierHealingConfig;
36
- }
37
-
38
28
  export function makeSharedBranchesCodecWithVersion<TChangeset>(
39
29
  changeCodec: IJsonCodec<
40
30
  TChangeset,
@@ -49,10 +39,18 @@ export function makeSharedBranchesCodecWithVersion<TChangeset>(
49
39
  ChangeEncodingContext
50
40
  >,
51
41
  version: EncodedEditManager<TChangeset>["version"],
52
- ): CodecAndSchema<SummaryData<TChangeset>, EditManagerEncodingContext> {
42
+ ): CodecAndSchema<
43
+ SummaryData<TChangeset>,
44
+ EditManagerEncodingContext,
45
+ EditManagerDecodingContext
46
+ > {
53
47
  const schema = EncodedEditManager(changeCodec.encodedSchema ?? JsonCompatibleReadOnlySchema);
54
48
 
55
- const codec: CodecAndSchema<SummaryData<TChangeset>, EditManagerEncodingContext> = {
49
+ const codec: CodecAndSchema<
50
+ SummaryData<TChangeset>,
51
+ EditManagerEncodingContext,
52
+ EditManagerDecodingContext
53
+ > = {
56
54
  schema,
57
55
  encode: (data: SummaryData<TChangeset>, context: EditManagerEncodingContext) => {
58
56
  const mainBranch = encodeSharedBranch(
@@ -90,7 +88,7 @@ export function makeSharedBranchesCodecWithVersion<TChangeset>(
90
88
  },
91
89
  decode: (
92
90
  json: EncodedEditManager<TChangeset> & JsonCompatibleReadOnlyObject,
93
- context: EditManagerEncodingContext,
91
+ context: EditManagerDecodingContext,
94
92
  ): SummaryData<TChangeset> => {
95
93
  const mainBranch = decodeSharedBranch(
96
94
  changeCodec,
@@ -15,11 +15,14 @@ import type {
15
15
  import type { SummaryTreeBuilder } from "@fluidframework/runtime-utils/internal";
16
16
 
17
17
  import type { IJsonCodec } from "../codec/index.js";
18
- import type { ChangeFamily, ChangeFamilyEditor, SchemaAndPolicy } from "../core/index.js";
18
+ import type { ChangeFamilyEditor, SchemaAndPolicy } from "../core/index.js";
19
19
  import type { IdentifierHealingConfig, JsonCompatibleReadOnly } from "../util/index.js";
20
20
 
21
21
  import type { EditManager, SummaryData } from "./editManager.js";
22
- import type { EditManagerEncodingContext } from "./editManagerCodecs.js";
22
+ import type {
23
+ EditManagerDecodingContext,
24
+ EditManagerEncodingContext,
25
+ } from "./editManagerCodecsCommons.js";
23
26
  import type {
24
27
  Summarizable,
25
28
  SummaryElementParser,
@@ -65,7 +68,7 @@ function minVersionToEditManagerSummaryFormatVersion(
65
68
  /**
66
69
  * Provides methods for summarizing and loading an `EditManager`
67
70
  */
68
- export class EditManagerSummarizer<TChangeset>
71
+ export class EditManagerSummarizer<TChangeset, TChangeProcessingContext>
69
72
  extends VersionedSummarizer<EditManagerSummaryFormatVersion>
70
73
  implements Summarizable
71
74
  {
@@ -74,13 +77,14 @@ export class EditManagerSummarizer<TChangeset>
74
77
  private readonly editManager: EditManager<
75
78
  ChangeFamilyEditor,
76
79
  TChangeset,
77
- ChangeFamily<ChangeFamilyEditor, TChangeset>
80
+ TChangeProcessingContext
78
81
  >,
79
82
  private readonly codec: IJsonCodec<
80
83
  SummaryData<TChangeset>,
81
84
  JsonCompatibleReadOnly,
82
85
  JsonCompatibleReadOnly,
83
- EditManagerEncodingContext
86
+ EditManagerEncodingContext,
87
+ EditManagerDecodingContext
84
88
  >,
85
89
  private readonly idCompressor: IIdCompressor,
86
90
  minVersionForCollab: MinimumVersionForCollab,
@@ -109,7 +113,6 @@ export class EditManagerSummarizer<TChangeset>
109
113
  idCompressor: this.idCompressor,
110
114
  schema: this.schemaAndPolicy,
111
115
  isSummary: true,
112
- healing: this.healing,
113
116
  };
114
117
  const jsonCompatible = this.codec.encode(this.editManager.getSummaryData(), context);
115
118
  const dataString = stringify(jsonCompatible);
@@ -17,7 +17,7 @@ import {
17
17
  JsonCompatibleReadOnlySchema,
18
18
  } from "../util/index.js";
19
19
 
20
- import type { MessageEncodingContext } from "./messageCodecs.js";
20
+ import type { MessageDecodingContext, MessageEncodingContext } from "./messageCodecs.js";
21
21
  import type { MessageFormatVersion } from "./messageFormat.js";
22
22
  import { Message } from "./messageFormatV1ToV4.js";
23
23
  import type { DecodedMessage } from "./messageTypes.js";
@@ -36,7 +36,7 @@ export function makeV1ToV4CodecWithVersion<TChangeset>(
36
36
  | typeof MessageFormatVersion.v3
37
37
  | typeof MessageFormatVersion.v4
38
38
  | typeof MessageFormatVersion.v6,
39
- ): CodecAndSchema<DecodedMessage<TChangeset>, MessageEncodingContext> {
39
+ ): CodecAndSchema<DecodedMessage<TChangeset>, MessageEncodingContext, MessageDecodingContext> {
40
40
  const schema = Message(changeCodec.encodedSchema ?? JsonCompatibleReadOnlySchema);
41
41
  return {
42
42
  schema,
@@ -70,7 +70,7 @@ export function makeV1ToV4CodecWithVersion<TChangeset>(
70
70
  },
71
71
  decode: (
72
72
  encoded: Message & JsonCompatibleReadOnlyObject & Versioned,
73
- context: MessageEncodingContext,
73
+ context: MessageDecodingContext,
74
74
  ): DecodedMessage<TChangeset> => {
75
75
  const { revision: encodedRevision, originatorId, changeset } = encoded;
76
76
 
@@ -17,7 +17,7 @@ import type {
17
17
  import type { JsonCompatibleReadOnlyObject } from "../util/index.js";
18
18
 
19
19
  import { decodeBranchId, encodeBranchId } from "./branchIdCodec.js";
20
- import type { MessageEncodingContext } from "./messageCodecs.js";
20
+ import type { MessageDecodingContext, MessageEncodingContext } from "./messageCodecs.js";
21
21
  import type { MessageFormatVersion } from "./messageFormat.js";
22
22
  import { Message } from "./messageFormatVSharedBranches.js";
23
23
  import type { DecodedMessage } from "./messageTypes.js";
@@ -79,7 +79,7 @@ export function makeSharedBranchesCodecWithVersion<TChangeset>(
79
79
  },
80
80
  decode: (
81
81
  encoded: Message & JsonCompatibleReadOnlyObject & Versioned,
82
- context: MessageEncodingContext,
82
+ context: MessageDecodingContext,
83
83
  ): DecodedMessage<TChangeset> => {
84
84
  const {
85
85
  revision: encodedRevision,