@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
@@ -4,17 +4,8 @@
4
4
  */
5
5
 
6
6
  import { assert } from "@fluidframework/core-utils/internal";
7
- import type { IIdCompressor } from "@fluidframework/id-compressor";
8
-
9
- import {
10
- type CodecWriteOptions,
11
- FluidClientVersion,
12
- FormatValidatorNoOp,
13
- type IJsonCodec,
14
- } from "../../codec/index.js";
15
7
  import {
16
8
  type IdAllocator,
17
- type JsonCompatibleReadOnly,
18
9
  type NestedMap,
19
10
  brand,
20
11
  deleteFromNestedMap,
@@ -24,11 +15,10 @@ import {
24
15
  setInNestedMap,
25
16
  tryGetFromNestedMap,
26
17
  } from "../../util/index.js";
27
- import type { RevisionTag, RevisionTagCodec } from "../rebase/index.js";
18
+ import type { RevisionTag } from "../rebase/index.js";
28
19
  import type { FieldKey } from "../schema-stored/index.js";
29
20
 
30
21
  import type * as Delta from "./delta.js";
31
- import { detachedFieldIndexCodecBuilder } from "./detachedFieldIndexCodecs.js";
32
22
  import type {
33
23
  DetachedField,
34
24
  DetachedFieldSummaryData,
@@ -92,9 +82,6 @@ export class DetachedFieldIndex implements ReadOnlyDetachedFieldIndex {
92
82
  Delta.DetachedNodeId
93
83
  > = new Map();
94
84
 
95
- private readonly codec: IJsonCodec<DetachedFieldSummaryData>;
96
- private readonly options: CodecWriteOptions;
97
-
98
85
  /**
99
86
  * The process for loading `DetachedFieldIndex` data from a summary is split into two steps:
100
87
  * 1. Call {@link loadData}
@@ -112,28 +99,12 @@ export class DetachedFieldIndex implements ReadOnlyDetachedFieldIndex {
112
99
  public constructor(
113
100
  private readonly name: string,
114
101
  private rootIdAllocator: IdAllocator<ForestRootId>,
115
- private readonly revisionTagCodec: RevisionTagCodec,
116
- private readonly idCompressor: IIdCompressor,
117
- options?: CodecWriteOptions,
118
- ) {
119
- this.options = options ?? {
120
- jsonValidator: FormatValidatorNoOp,
121
- minVersionForCollab: FluidClientVersion.v2_0,
122
- };
123
- this.codec = detachedFieldIndexCodecBuilder.build({
124
- ...this.options,
125
- revisionTagCodec,
126
- idCompressor,
127
- });
128
- }
102
+ ) {}
129
103
 
130
104
  public clone(): DetachedFieldIndex {
131
105
  const clone = new DetachedFieldIndex(
132
106
  this.name,
133
107
  idAllocatorFromMaxId(this.rootIdAllocator.getMaxId()) as IdAllocator<ForestRootId>,
134
- this.revisionTagCodec,
135
- this.idCompressor,
136
- this.options,
137
108
  );
138
109
  populateNestedMap(this.detachedNodeToField, clone.detachedNodeToField, true);
139
110
  populateNestedMap(
@@ -307,19 +278,17 @@ export class DetachedFieldIndex implements ReadOnlyDetachedFieldIndex {
307
278
  });
308
279
  }
309
280
 
310
- public encode(): JsonCompatibleReadOnly {
311
- return this.codec.encode({
281
+ public getSummaryData(): DetachedFieldSummaryData {
282
+ return {
312
283
  data: this.detachedNodeToField,
313
284
  maxId: this.rootIdAllocator.getMaxId(),
314
- });
285
+ };
315
286
  }
316
287
 
317
288
  /**
318
- * Loads the tree index from the given string, this overrides any existing data.
289
+ * Loads the tree index from summary data, this overrides any existing data.
319
290
  */
320
- public loadData(data: JsonCompatibleReadOnly): void {
321
- const detachedFieldIndex: DetachedFieldSummaryData = this.codec.decode(data);
322
-
291
+ public loadData(detachedFieldIndex: DetachedFieldSummaryData): void {
323
292
  this.rootIdAllocator = idAllocatorFromMaxId(
324
293
  detachedFieldIndex.maxId,
325
294
  ) as IdAllocator<ForestRootId>;
@@ -127,6 +127,8 @@ export {
127
127
  type ReadOnlyDetachedFieldIndex,
128
128
  } from "./detachedFieldIndex.js";
129
129
 
130
+ export { type DetachedFieldSummaryData } from "./detachedFieldIndexTypes.js";
131
+
130
132
  export { detachedFieldIndexCodecBuilder } from "./detachedFieldIndexCodecs.js";
131
133
  export { DetachedFieldIndexFormatVersion } from "./detachedFieldIndexFormatCommon.js";
132
134
  export { type FormatV1 } from "./detachedFieldIndexFormatV1.js";
@@ -3,11 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import type { IIdCompressor } from "@fluidframework/id-compressor";
7
-
8
- import type { CodecWriteOptions } from "../../codec/index.js";
9
6
  import { type IdAllocator, idAllocatorFromMaxId } from "../../util/index.js";
10
- import type { RevisionTag, RevisionTagCodec } from "../rebase/index.js";
7
+ import type { RevisionTag } from "../rebase/index.js";
11
8
  import type { FieldKey } from "../schema-stored/index.js";
12
9
 
13
10
  import type { ITreeCursorSynchronous } from "./cursor.js";
@@ -17,19 +14,8 @@ import type { ForestRootId } from "./detachedFieldIndexTypes.js";
17
14
  import type { PlaceIndex, Range } from "./pathTree.js";
18
15
  import { type DeltaVisitor, visitDelta } from "./visitDelta.js";
19
16
 
20
- export function makeDetachedFieldIndex(
21
- prefix: string = "Temp",
22
- revisionTagCodec: RevisionTagCodec,
23
- idCompressor: IIdCompressor,
24
- options?: CodecWriteOptions,
25
- ): DetachedFieldIndex {
26
- return new DetachedFieldIndex(
27
- prefix,
28
- idAllocatorFromMaxId() as IdAllocator<ForestRootId>,
29
- revisionTagCodec,
30
- idCompressor,
31
- options,
32
- );
17
+ export function makeDetachedFieldIndex(prefix: string = "Temp"): DetachedFieldIndex {
18
+ return new DetachedFieldIndex(prefix, idAllocatorFromMaxId() as IdAllocator<ForestRootId>);
33
19
  }
34
20
 
35
21
  export function applyDelta(
@@ -178,6 +178,7 @@ export {
178
178
  ChangeMetadata,
179
179
  CodecName,
180
180
  CodecWriteOptions,
181
+ CommitOutcome,
181
182
  Component,
182
183
  CreateIndependentTreeAlphaOptions,
183
184
  DirtyTreeMap,
@@ -197,6 +198,7 @@ export {
197
198
  FormatValidatorBasic,
198
199
  FormatValidatorNoOp,
199
200
  FormatVersion,
201
+ FormattedText,
200
202
  HandleConverter,
201
203
  ICodecOptions,
202
204
  ITreeAlpha,
@@ -229,6 +231,7 @@ export {
229
231
  JsonTreeSchema,
230
232
  LabelTree,
231
233
  LocalChangeMetadata,
234
+ LocalCommitEvents,
232
235
  MapNodeCustomizableSchema,
233
236
  MapNodeCustomizableSchemaUnsafe,
234
237
  MapNodePojoEmulationSchema,
@@ -244,6 +247,7 @@ export {
244
247
  ObjectNodeSchemaWorkaround,
245
248
  ObjectSchemaOptionsAlpha,
246
249
  ObservationResults,
250
+ PlainText,
247
251
  ReadSchema,
248
252
  ReadableField,
249
253
  RecordNodeCustomizableSchema,
@@ -256,6 +260,7 @@ export {
256
260
  SchemaFactoryAlpha,
257
261
  SchemaStaticsAlpha,
258
262
  SchemaType,
263
+ SharedTreeAlpha,
259
264
  SharedTreeFormatOptions,
260
265
  SharedTreeOptions,
261
266
  SimpleAllowedTypeAttributes,
@@ -271,7 +276,7 @@ export {
271
276
  SimpleTreeSchema,
272
277
  StagedSchemaUpgradePolicy,
273
278
  StagedSchemaUpgradePolicyFactory,
274
- TextAsTree,
279
+ StringSchema,
275
280
  TransactionCallbackStatusAlpha,
276
281
  TransactionConstraintAlpha,
277
282
  TransactionLabels,
@@ -283,6 +288,7 @@ export {
283
288
  TreeChangeEventsAlpha,
284
289
  TreeCompressionStrategy,
285
290
  TreeContextAlpha,
291
+ TreeDataStoreOptions,
286
292
  TreeIdentifierUtils,
287
293
  TreeMapNodeAlpha,
288
294
  TreeParsingOptions,
@@ -307,6 +313,7 @@ export {
307
313
  createArrayInsertionAnchor,
308
314
  createIndependentTreeAlpha,
309
315
  decodeSchemaCompatibilitySnapshot,
316
+ defineTreeDataStore,
310
317
  encodeSchemaCompatibilitySnapshot,
311
318
  eraseSchemaDetails,
312
319
  eraseSchemaDetailsSubclassable,
@@ -321,6 +328,7 @@ export {
321
328
  incrementalSummaryHint,
322
329
  independentInitializedView,
323
330
  independentView,
331
+ instantiateTreeFirstTime,
324
332
  minimize,
325
333
  normalizeAllowedTypes,
326
334
  persistedToSimpleSchema,
@@ -133,10 +133,10 @@ export interface FieldBatchEncodingContext {
133
133
  /**
134
134
  * Decode-side context for {@link FieldBatchCodec}.
135
135
  *
136
- * Carries the per-call `resolveEncodedId` function that encapsulates the
137
- * originator-session lookup and (for the forest-summarizer's legacy heal path)
138
- * the deterministic UUIDv5 synthesis. Heal and originator-session flags live
139
- * inside that function, not on this context.
136
+ * Composes an {@link IdDecodingContext} (which carries the per-call `resolveEncodedId`
137
+ * function encapsulating the originator-session lookup and, for the forest-summarizer's
138
+ * legacy heal path, the deterministic UUIDv5 synthesis) together with the optional
139
+ * incremental decoder for this batch.
140
140
  *
141
141
  * Constructed via one of the two named static factories — {@link forOp} or
142
142
  * {@link forSummary} — depending on the call site's semantics. The constructor
@@ -144,18 +144,19 @@ export interface FieldBatchEncodingContext {
144
144
  * op-style and summary-style decoding is load-bearing (different invariants
145
145
  * apply, and bugs in this area are typically the result of conflating them).
146
146
  */
147
- export class FieldBatchDecodingContext extends IdDecodingContext {
147
+ export class FieldBatchDecodingContext {
148
148
  private constructor(
149
- private readonly options: IdDecoderOptionsOriginatorless | IdDecoderOptionsWithOriginator,
149
+ /**
150
+ * Resolves the encoded identifiers contained in this batch.
151
+ */
152
+ public readonly idDecodingContext: IdDecodingContext,
150
153
  /**
151
154
  * Decoder for incremental fields. Defined when the encoded batch contains
152
155
  * incremental chunks. Only populated on summary-style contexts; op-style
153
156
  * contexts always have this undefined.
154
157
  */
155
158
  public readonly incrementalDecoder?: IncrementalDecoder,
156
- ) {
157
- super(options);
158
- }
159
+ ) {}
159
160
 
160
161
  /**
161
162
  * Construct a decode context for an op.
@@ -167,7 +168,7 @@ export class FieldBatchDecodingContext extends IdDecodingContext {
167
168
  * a UUID. Incremental decoding is not used for ops.
168
169
  */
169
170
  public static forOp(options: IdDecoderOptionsWithOriginator): FieldBatchDecodingContext {
170
- return new FieldBatchDecodingContext(options);
171
+ return new FieldBatchDecodingContext(new IdDecodingContext(options));
171
172
  }
172
173
 
173
174
  /**
@@ -189,7 +190,7 @@ export class FieldBatchDecodingContext extends IdDecodingContext {
189
190
  public static forSummary(
190
191
  options: IdDecoderOptionsOriginatorless | IdDecoderOptionsWithOriginator,
191
192
  ): FieldBatchDecodingContext {
192
- return new FieldBatchDecodingContext(options);
193
+ return new FieldBatchDecodingContext(new IdDecodingContext(options));
193
194
  }
194
195
 
195
196
  /**
@@ -206,10 +207,10 @@ export class FieldBatchDecodingContext extends IdDecodingContext {
206
207
  // This mitigates the risk of using incorrect originator session ID identifiers in incremental chunks.
207
208
  // See also private remarks on forSummary.
208
209
  assert(
209
- !this.hasOriginatorSessionId,
210
+ !this.idDecodingContext.hasOriginatorSessionId,
210
211
  0xd0c /* withIncrementalDecoder can only be called on contexts without an originator session ID */,
211
212
  );
212
- return new FieldBatchDecodingContext(this.options, incrementalDecoder);
213
+ return new FieldBatchDecodingContext(this.idDecodingContext, incrementalDecoder);
213
214
  }
214
215
  }
215
216
 
@@ -298,7 +299,9 @@ function makeFieldBatchCodecForVersion(
298
299
  context: FieldBatchDecodingContext,
299
300
  ): FieldBatch => {
300
301
  // TODO: consider checking data is in schema.
301
- return decode(data, context, context.incrementalDecoder).map((chunk) => chunk.cursor());
302
+ return decode(data, context.idDecodingContext, context.incrementalDecoder).map((chunk) =>
303
+ chunk.cursor(),
304
+ );
302
305
  },
303
306
  schema: encodedFieldBatchType,
304
307
  };
@@ -191,6 +191,17 @@ export class TreeShape {
191
191
  }
192
192
 
193
193
  public equals(other: TreeShape): boolean {
194
+ // Shapes are commonly shared (e.g. all chunks from one chunker reference the same instance), so
195
+ // short-circuit on reference identity to avoid the full structural walk in the common case.
196
+ if (this === other) {
197
+ return true;
198
+ }
199
+
200
+ // A given type usually only has one shape, so check it next to speed up the false case.
201
+ if (this.type !== other.type) {
202
+ return false;
203
+ }
204
+
194
205
  // TODO: either dedupe instances and/or store a collision resistant hash for fast compare.
195
206
 
196
207
  if (
@@ -203,7 +214,6 @@ export class TreeShape {
203
214
  return false;
204
215
  }
205
216
  return (
206
- this.type === other.type &&
207
217
  this.hasValue === other.hasValue &&
208
218
  this.mayContainCompressedIds === other.mayContainCompressedIds
209
219
  );
@@ -0,0 +1,140 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import type { Listenable } from "@fluidframework/core-interfaces";
7
+
8
+ import {
9
+ type Anchor,
10
+ type AnchorSet,
11
+ type AnnouncedVisitor,
12
+ type DeltaVisitor,
13
+ type FieldAnchor,
14
+ type ForestEvents,
15
+ type IEditableForest,
16
+ type ITreeCursorSynchronous,
17
+ type ITreeSubscriptionCursor,
18
+ type TreeChunk,
19
+ type TreeNavigationResult,
20
+ type TreeStoredSchemaSubscription,
21
+ type UpPath,
22
+ combineVisitors,
23
+ createAnnouncedVisitor,
24
+ } from "../../core/index.js";
25
+ import type { Breakable } from "../../util/index.js";
26
+
27
+ import { assertForestsEqual } from "../treeTextCursor.js";
28
+
29
+ /**
30
+ * An {@link IEditableForest} which wraps two other forests: a `main` forest and a `reference` forest.
31
+ *
32
+ * @remarks
33
+ * All read operations are delegated to `main`, so from the outside a `ComparisonForest` behaves exactly like its `main` forest.
34
+ *
35
+ * When a delta is applied (via {@link IEditableForest.acquireVisitor}), the delta is applied to both `main` and `reference`.
36
+ * Once the visitor is freed, the full contents of both forests (including all detached/removed fields) are compared,
37
+ * and an error is thrown if they differ.
38
+ *
39
+ * This is a testing/debugging aid: it allows validating that a forest implementation (for example the optimized `ChunkedForest`)
40
+ * produces the same results as a simpler reference implementation (for example the `ObjectForest`) for every delta that is applied.
41
+ *
42
+ * @privateRemarks
43
+ * This forest is intentionally expensive: it maintains two full copies of the data and re-reads and
44
+ * structurally compares all of their contents after every delta.
45
+ */
46
+ export class ComparisonForest implements IEditableForest {
47
+ /**
48
+ * @param main - The forest whose behavior is under test.
49
+ * All reads are delegated to this forest, and it is the source of truth for anchors and events.
50
+ * @param reference - The forest to compare against.
51
+ * This forest receives all the same deltas as `main`, and its contents are asserted to match `main` after each delta.
52
+ */
53
+ public constructor(
54
+ public readonly main: IEditableForest,
55
+ public readonly reference: IEditableForest,
56
+ ) {
57
+ this.assertValid();
58
+ }
59
+
60
+ private assertValid(): void {
61
+ assertForestsEqual(this.main, this.reference);
62
+ }
63
+
64
+ public get events(): Listenable<ForestEvents> {
65
+ return this.main.events;
66
+ }
67
+
68
+ public get anchors(): AnchorSet {
69
+ return this.main.anchors;
70
+ }
71
+
72
+ public get isEmpty(): boolean {
73
+ return this.main.isEmpty;
74
+ }
75
+
76
+ public clone(schema: TreeStoredSchemaSubscription, breaker?: Breakable): ComparisonForest {
77
+ this.assertValid();
78
+ return new ComparisonForest(
79
+ this.main.clone(schema, breaker),
80
+ this.reference.clone(schema, breaker),
81
+ );
82
+ }
83
+
84
+ public chunkField(cursor: ITreeCursorSynchronous): TreeChunk[] {
85
+ return this.main.chunkField(cursor);
86
+ }
87
+
88
+ public allocateCursor(source?: string): ITreeSubscriptionCursor {
89
+ // Currently we just use the cursor from "main", but we could use "reference" or a custom cursor ensuring both match in behavior.
90
+ // TODO: Add a custom combined cursor type which validates two cursors match, and use it here.
91
+ return this.main.allocateCursor(source);
92
+ }
93
+
94
+ public forgetAnchor(anchor: Anchor): void {
95
+ this.main.forgetAnchor(anchor);
96
+ }
97
+
98
+ public tryMoveCursorToNode(
99
+ destination: Anchor,
100
+ cursorToMove: ITreeSubscriptionCursor,
101
+ ): TreeNavigationResult {
102
+ return this.main.tryMoveCursorToNode(destination, cursorToMove);
103
+ }
104
+
105
+ public tryMoveCursorToField(
106
+ destination: FieldAnchor,
107
+ cursorToMove: ITreeSubscriptionCursor,
108
+ ): TreeNavigationResult {
109
+ return this.main.tryMoveCursorToField(destination, cursorToMove);
110
+ }
111
+
112
+ public moveCursorToPath(destination: UpPath, cursorToMove: ITreeSubscriptionCursor): void {
113
+ this.main.moveCursorToPath(destination, cursorToMove);
114
+ }
115
+
116
+ public getCursorAboveDetachedFields(): ITreeCursorSynchronous {
117
+ return this.main.getCursorAboveDetachedFields();
118
+ }
119
+
120
+ public registerAnnouncedVisitor(visitor: () => AnnouncedVisitor): void {
121
+ this.main.registerAnnouncedVisitor(visitor);
122
+ }
123
+
124
+ public deregisterAnnouncedVisitor(visitor: () => AnnouncedVisitor): void {
125
+ this.main.deregisterAnnouncedVisitor(visitor);
126
+ }
127
+
128
+ public acquireVisitor(): DeltaVisitor {
129
+ this.assertValid();
130
+ const main = this.main;
131
+ const reference = this.reference;
132
+ const mainVisitor = main.acquireVisitor();
133
+ const referenceVisitor = reference.acquireVisitor();
134
+ // A visitor which does nothing except assert the two forests match once the delta has been fully applied to both.
135
+ const comparisonVisitor = createAnnouncedVisitor({
136
+ free: () => this.assertValid(),
137
+ });
138
+ return combineVisitors([mainVisitor, referenceVisitor, comparisonVisitor]);
139
+ }
140
+ }
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ export { ComparisonForest } from "./comparisonForest.js";
@@ -10,6 +10,7 @@ import type { CodecWriteOptions, ICodecFamily } from "../../codec/index.js";
10
10
  import {
11
11
  type ChangeAtomId,
12
12
  type ChangeEncodingContext,
13
+ type ChangeDecodingContext,
13
14
  type ChangeFamily,
14
15
  type ChangeFamilyEditor,
15
16
  type ChangeRebaser,
@@ -24,6 +25,7 @@ import {
24
25
  type UpPath,
25
26
  compareFieldUpPaths,
26
27
  topDownPath,
28
+ type ProcessChangeFn,
27
29
  } from "../../core/index.js";
28
30
  import { brand } from "../../util/index.js";
29
31
  import {
@@ -43,18 +45,20 @@ import { fieldKinds } from "./defaultFieldKinds.js";
43
45
 
44
46
  export type DefaultChangeset = ModularChangeset;
45
47
 
48
+ export type DefaultChangeProcessingContext = ModularChangeFamily;
49
+
46
50
  /**
47
51
  * Implementation of {@link ChangeFamily} based on the default set of supported field kinds.
48
52
  *
49
53
  * @sealed
50
54
  */
51
55
  export class DefaultChangeFamily
52
- implements ChangeFamily<DefaultEditBuilder, DefaultChangeset>
56
+ implements ChangeFamily<DefaultEditBuilder, DefaultChangeset, DefaultChangeProcessingContext>
53
57
  {
54
58
  private readonly modularFamily: ModularChangeFamily;
55
59
 
56
60
  public constructor(
57
- codecs: ICodecFamily<ModularChangeset, ChangeEncodingContext>,
61
+ codecs: ICodecFamily<ModularChangeset, ChangeEncodingContext, ChangeDecodingContext>,
58
62
  codecOptions: CodecWriteOptions,
59
63
  ) {
60
64
  this.modularFamily = new ModularChangeFamily(fieldKinds, codecs, codecOptions);
@@ -64,7 +68,11 @@ export class DefaultChangeFamily
64
68
  return this.modularFamily.rebaser;
65
69
  }
66
70
 
67
- public get codecs(): ICodecFamily<DefaultChangeset, ChangeEncodingContext> {
71
+ public get codecs(): ICodecFamily<
72
+ DefaultChangeset,
73
+ ChangeEncodingContext,
74
+ ChangeDecodingContext
75
+ > {
68
76
  return this.modularFamily.codecs;
69
77
  }
70
78
 
@@ -73,12 +81,18 @@ export class DefaultChangeFamily
73
81
  changeReceiver: (change: TaggedChange<DefaultChangeset>) => void,
74
82
  ): DefaultEditBuilder {
75
83
  return new DefaultEditBuilder(
76
- this,
84
+ this.modularFamily.rebaser,
77
85
  mintRevisionTag,
78
86
  changeReceiver,
79
87
  this.modularFamily.codecOptions,
80
88
  );
81
89
  }
90
+
91
+ public buildProcessor(
92
+ processFn: ProcessChangeFn<DefaultChangeset, DefaultChangeProcessingContext>,
93
+ ): (change: DefaultChangeset) => DefaultChangeset {
94
+ return this.modularFamily.buildProcessor(processFn);
95
+ }
82
96
  }
83
97
 
84
98
  /**
@@ -194,13 +208,13 @@ export class DefaultEditBuilder implements ChangeFamilyEditor, IDefaultEditBuild
194
208
  private readonly modularBuilder: ModularEditBuilder;
195
209
 
196
210
  public constructor(
197
- family: ChangeFamily<ChangeFamilyEditor, DefaultChangeset>,
211
+ rebaser: ChangeRebaser<DefaultChangeset>,
198
212
  private readonly mintRevisionTag: () => RevisionTag,
199
213
  changeReceiver: (change: TaggedChange<DefaultChangeset>) => void,
200
214
  codecOptions: CodecWriteOptions,
201
215
  ) {
202
216
  this.modularBuilder = new ModularEditBuilder(
203
- family,
217
+ rebaser,
204
218
  fieldKinds,
205
219
  changeReceiver,
206
220
  codecOptions,
@@ -12,6 +12,7 @@ export {
12
12
  } from "./defaultFieldKinds.js";
13
13
 
14
14
  export {
15
+ type DefaultChangeProcessingContext,
15
16
  type DefaultChangeset,
16
17
  DefaultChangeFamily,
17
18
  DefaultEditBuilder,
@@ -4,7 +4,15 @@
4
4
  */
5
5
 
6
6
  import { type ICodecFamily, makeCodecFamily, unitCodec } from "../../codec/index.js";
7
- import type { FieldChangeEncodingContext } from "../modular-schema/index.js";
7
+ import type {
8
+ FieldChangeEncodingContext,
9
+ FieldChangeDecodingContext,
10
+ } from "../modular-schema/index.js";
8
11
 
9
- export const noChangeCodecFamily: ICodecFamily<0, FieldChangeEncodingContext> =
10
- makeCodecFamily<0, FieldChangeEncodingContext>([[1, unitCodec]]);
12
+ export const noChangeCodecFamily: ICodecFamily<
13
+ 0,
14
+ FieldChangeEncodingContext,
15
+ FieldChangeDecodingContext
16
+ > = makeCodecFamily<0, FieldChangeEncodingContext, FieldChangeDecodingContext>([
17
+ [1, unitCodec],
18
+ ]);
@@ -5,6 +5,7 @@
5
5
 
6
6
  import { bufferToString } from "@fluid-internal/client-utils";
7
7
  import type { IChannelStorageService } from "@fluidframework/datastore-definitions/internal";
8
+ import type { IIdCompressor } from "@fluidframework/id-compressor";
8
9
  import type {
9
10
  IExperimentalIncrementalSummaryContext,
10
11
  ITelemetryContext,
@@ -12,7 +13,18 @@ import type {
12
13
  } from "@fluidframework/runtime-definitions/internal";
13
14
  import type { SummaryTreeBuilder } from "@fluidframework/runtime-utils/internal";
14
15
 
15
- import type { DetachedFieldIndex } from "../core/index.js";
16
+ import {
17
+ type CodecWriteOptions,
18
+ FluidClientVersion,
19
+ FormatValidatorNoOp,
20
+ type IJsonCodec,
21
+ } from "../codec/index.js";
22
+ import {
23
+ type DetachedFieldIndex,
24
+ type DetachedFieldSummaryData,
25
+ type RevisionTagCodec,
26
+ detachedFieldIndexCodecBuilder,
27
+ } from "../core/index.js";
16
28
  import {
17
29
  type Summarizable,
18
30
  type SummaryElementParser,
@@ -66,16 +78,31 @@ export class DetachedFieldIndexSummarizer
66
78
  extends VersionedSummarizer<DetachedFieldIndexSummaryFormatVersion>
67
79
  implements Summarizable
68
80
  {
81
+ private readonly codec: IJsonCodec<DetachedFieldSummaryData>;
82
+
69
83
  public constructor(
70
84
  private readonly detachedFieldIndex: DetachedFieldIndex,
71
- minVersionForCollab: MinimumVersionForCollab,
85
+ revisionTagCodec: RevisionTagCodec,
86
+ idCompressor: IIdCompressor,
87
+ options?: CodecWriteOptions,
72
88
  ) {
89
+ const normalizedOptions = options ?? {
90
+ jsonValidator: FormatValidatorNoOp,
91
+ minVersionForCollab: FluidClientVersion.v2_0,
92
+ };
73
93
  super(
74
94
  "DetachedFieldIndex",
75
- minVersionToDetachedFieldIndexSummaryFormatVersion(minVersionForCollab),
95
+ minVersionToDetachedFieldIndexSummaryFormatVersion(
96
+ normalizedOptions.minVersionForCollab,
97
+ ),
76
98
  supportedVersions,
77
99
  true,
78
100
  );
101
+ this.codec = detachedFieldIndexCodecBuilder.build({
102
+ ...normalizedOptions,
103
+ revisionTagCodec,
104
+ idCompressor,
105
+ });
79
106
  }
80
107
 
81
108
  protected summarizeInternal(props: {
@@ -87,7 +114,7 @@ export class DetachedFieldIndexSummarizer
87
114
  builder: SummaryTreeBuilder;
88
115
  }): void {
89
116
  const { stringify, builder } = props;
90
- const data = this.detachedFieldIndex.encode();
117
+ const data = this.codec.encode(this.detachedFieldIndex.getSummaryData());
91
118
  builder.addBlob(detachedFieldIndexBlobKey, stringify(data));
92
119
  }
93
120
 
@@ -99,7 +126,8 @@ export class DetachedFieldIndexSummarizer
99
126
  const detachedFieldIndexBuffer = await services.readBlob(detachedFieldIndexBlobKey);
100
127
  const treeBufferString = bufferToString(detachedFieldIndexBuffer, "utf8");
101
128
  const parsed = parse(treeBufferString) as JsonCompatibleReadOnly;
102
- this.detachedFieldIndex.loadData(parsed);
129
+ const decoded = this.codec.decode(parsed);
130
+ this.detachedFieldIndex.loadData(decoded);
103
131
  }
104
132
  }
105
133
  }
@@ -20,7 +20,6 @@ import {
20
20
  type IEditableForest,
21
21
  type ITreeCursorSynchronous,
22
22
  type ITreeSubscriptionCursor,
23
- type RevisionTagCodec,
24
23
  TreeNavigationResult,
25
24
  applyDelta,
26
25
  forEachField,
@@ -79,7 +78,6 @@ export class ForestSummarizer
79
78
  */
80
79
  public constructor(
81
80
  private readonly forest: IEditableForest,
82
- private readonly revisionTagCodec: RevisionTagCodec,
83
81
  private readonly encoderContext: FieldBatchEncodingContext,
84
82
  private readonly decoderContext: FieldBatchDecodingContext,
85
83
  options: CodecWriteOptions,
@@ -240,7 +238,7 @@ export class ForestSummarizer
240
238
  { build, fields: new Map(fieldChanges) },
241
239
  undefined,
242
240
  this.forest,
243
- makeDetachedFieldIndex("init", this.revisionTagCodec, this.idCompressor),
241
+ makeDetachedFieldIndex("init"),
244
242
  );
245
243
  }
246
244
  }