@fluidframework/tree 2.113.1 → 2.114.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 (527) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/api-report/tree.alpha.api.md +19 -0
  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 +3 -2
  14. package/dist/core/index.d.ts.map +1 -1
  15. package/dist/core/index.js.map +1 -1
  16. package/dist/core/tree/delta.d.ts +62 -16
  17. package/dist/core/tree/delta.d.ts.map +1 -1
  18. package/dist/core/tree/delta.js.map +1 -1
  19. package/dist/core/tree/detachedFieldIndex.d.ts +7 -13
  20. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  21. package/dist/core/tree/detachedFieldIndex.js +32 -46
  22. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  23. package/dist/core/tree/index.d.ts +1 -0
  24. package/dist/core/tree/index.d.ts.map +1 -1
  25. package/dist/core/tree/index.js.map +1 -1
  26. package/dist/core/tree/visitorUtils.d.ts +2 -4
  27. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  28. package/dist/core/tree/visitorUtils.js +2 -2
  29. package/dist/core/tree/visitorUtils.js.map +1 -1
  30. package/dist/entrypoints/alpha.d.ts +1 -1
  31. package/dist/entrypoints/alpha.d.ts.map +1 -1
  32. package/dist/entrypoints/alpha.js +5 -2
  33. package/dist/entrypoints/alpha.js.map +1 -1
  34. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  35. package/dist/feature-libraries/chunked-forest/uniformChunk.js +10 -2
  36. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  37. package/dist/feature-libraries/comparison-forest/comparisonForest.d.ts +51 -0
  38. package/dist/feature-libraries/comparison-forest/comparisonForest.d.ts.map +1 -0
  39. package/dist/feature-libraries/comparison-forest/comparisonForest.js +98 -0
  40. package/dist/feature-libraries/comparison-forest/comparisonForest.js.map +1 -0
  41. package/dist/feature-libraries/comparison-forest/index.d.ts +6 -0
  42. package/dist/feature-libraries/comparison-forest/index.d.ts.map +1 -0
  43. package/dist/feature-libraries/comparison-forest/index.js +10 -0
  44. package/dist/feature-libraries/comparison-forest/index.js.map +1 -0
  45. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +8 -6
  46. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  47. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
  48. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  49. package/dist/feature-libraries/default-schema/index.d.ts +1 -1
  50. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  51. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  52. package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
  53. package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
  54. package/dist/feature-libraries/default-schema/noChangeCodecs.js +3 -1
  55. package/dist/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
  56. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +6 -3
  57. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  58. package/dist/feature-libraries/detachedFieldIndexSummarizer.js +18 -6
  59. package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  60. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -3
  61. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  62. package/dist/feature-libraries/forest-summary/forestSummarizer.js +2 -3
  63. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  64. package/dist/feature-libraries/index.d.ts +4 -3
  65. package/dist/feature-libraries/index.d.ts.map +1 -1
  66. package/dist/feature-libraries/index.js +77 -72
  67. package/dist/feature-libraries/index.js.map +1 -1
  68. package/dist/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
  69. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  70. package/dist/feature-libraries/mitigatedChangeFamily.js +12 -0
  71. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  72. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +9 -1
  73. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  74. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  75. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
  76. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  77. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  78. package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
  79. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  80. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  81. package/dist/feature-libraries/modular-schema/invert.d.ts +15 -0
  82. package/dist/feature-libraries/modular-schema/invert.d.ts.map +1 -0
  83. package/dist/feature-libraries/modular-schema/invert.js +159 -0
  84. package/dist/feature-libraries/modular-schema/invert.js.map +1 -0
  85. package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts +3 -4
  86. package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
  87. package/dist/feature-libraries/modular-schema/minimizeModularChange.js +2 -2
  88. package/dist/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
  89. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +9 -9
  90. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  91. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +0 -2
  92. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  93. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +2 -2
  94. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  95. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  96. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  97. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  98. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  99. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -22
  100. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  101. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +53 -406
  102. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  103. package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts +61 -0
  104. package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -0
  105. package/dist/feature-libraries/modular-schema/modularChangeUtils.js +205 -0
  106. package/dist/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -0
  107. package/dist/feature-libraries/modular-schema/prune.d.ts +10 -0
  108. package/dist/feature-libraries/modular-schema/prune.d.ts.map +1 -0
  109. package/dist/feature-libraries/modular-schema/prune.js +49 -0
  110. package/dist/feature-libraries/modular-schema/prune.js.map +1 -0
  111. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +2 -2
  112. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  113. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  114. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
  115. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  116. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  117. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
  118. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  119. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  120. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +2 -2
  121. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  122. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  123. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +2 -2
  124. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  125. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  126. package/dist/feature-libraries/treeTextCursor.d.ts +15 -0
  127. package/dist/feature-libraries/treeTextCursor.d.ts.map +1 -1
  128. package/dist/feature-libraries/treeTextCursor.js +64 -1
  129. package/dist/feature-libraries/treeTextCursor.js.map +1 -1
  130. package/dist/index.d.ts +3 -1
  131. package/dist/index.d.ts.map +1 -1
  132. package/dist/index.js +5 -1
  133. package/dist/index.js.map +1 -1
  134. package/dist/packageVersion.d.ts +1 -1
  135. package/dist/packageVersion.js +1 -1
  136. package/dist/packageVersion.js.map +1 -1
  137. package/dist/shared-tree/serializedChange.d.ts +2 -2
  138. package/dist/shared-tree/serializedChange.d.ts.map +1 -1
  139. package/dist/shared-tree/serializedChange.js.map +1 -1
  140. package/dist/shared-tree/sharedTree.d.ts +6 -3
  141. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  142. package/dist/shared-tree/sharedTree.js +8 -6
  143. package/dist/shared-tree/sharedTree.js.map +1 -1
  144. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +2 -2
  145. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  146. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  147. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +41 -4
  148. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  149. package/dist/shared-tree/sharedTreeChangeFamily.js +57 -1
  150. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  151. package/dist/shared-tree/transactionMinimize.d.ts.map +1 -1
  152. package/dist/shared-tree/transactionMinimize.js +2 -2
  153. package/dist/shared-tree/transactionMinimize.js.map +1 -1
  154. package/dist/shared-tree/transactionPostProcessor.d.ts +2 -1
  155. package/dist/shared-tree/transactionPostProcessor.d.ts.map +1 -1
  156. package/dist/shared-tree/transactionPostProcessor.js.map +1 -1
  157. package/dist/shared-tree/treeCheckout.d.ts +8 -7
  158. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  159. package/dist/shared-tree/treeCheckout.js +1 -1
  160. package/dist/shared-tree/treeCheckout.js.map +1 -1
  161. package/dist/shared-tree-core/branch.d.ts +23 -9
  162. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  163. package/dist/shared-tree-core/branch.js +7 -0
  164. package/dist/shared-tree-core/branch.js.map +1 -1
  165. package/dist/shared-tree-core/editManager.d.ts +4 -4
  166. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  167. package/dist/shared-tree-core/editManager.js +2 -0
  168. package/dist/shared-tree-core/editManager.js.map +1 -1
  169. package/dist/shared-tree-core/editManagerCodecs.d.ts +3 -14
  170. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  171. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  172. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +11 -1
  173. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  174. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  175. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +4 -11
  176. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  177. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  178. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +4 -11
  179. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  180. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  181. package/dist/shared-tree-core/editManagerSummarizer.d.ts +4 -4
  182. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  183. package/dist/shared-tree-core/editManagerSummarizer.js +0 -1
  184. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  185. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
  186. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  187. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  188. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  189. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  190. package/dist/shared-tree-core/messageCodecs.d.ts +8 -1
  191. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  192. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  193. package/dist/shared-tree-core/sharedTreeCore.d.ts +5 -5
  194. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  195. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  196. package/dist/shared-tree-core/transaction.d.ts +10 -10
  197. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  198. package/dist/shared-tree-core/transaction.js +6 -3
  199. package/dist/shared-tree-core/transaction.js.map +1 -1
  200. package/dist/simple-tree/api/eraseSchemaDetails.d.ts +15 -0
  201. package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  202. package/dist/simple-tree/api/eraseSchemaDetails.js +15 -0
  203. package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  204. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +21 -2
  205. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  206. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  207. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +13 -0
  208. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  209. package/dist/simple-tree/node-kinds/map/mapNode.js +9 -0
  210. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  211. package/dist/text/textDomain.d.ts +12 -0
  212. package/dist/text/textDomain.d.ts.map +1 -1
  213. package/dist/text/textDomain.js +37 -16
  214. package/dist/text/textDomain.js.map +1 -1
  215. package/dist/text/textDomainFormatted.d.ts +155 -61
  216. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  217. package/dist/text/textDomainFormatted.js +147 -71
  218. package/dist/text/textDomainFormatted.js.map +1 -1
  219. package/dist/text/textDomainFormattedDefault.d.ts +37 -14
  220. package/dist/text/textDomainFormattedDefault.d.ts.map +1 -1
  221. package/dist/text/textDomainFormattedDefault.js +13 -5
  222. package/dist/text/textDomainFormattedDefault.js.map +1 -1
  223. package/dist/treeDataStore.d.ts +49 -0
  224. package/dist/treeDataStore.d.ts.map +1 -0
  225. package/dist/treeDataStore.js +57 -0
  226. package/dist/treeDataStore.js.map +1 -0
  227. package/dist/treeFactory.d.ts +8 -3
  228. package/dist/treeFactory.d.ts.map +1 -1
  229. package/dist/treeFactory.js +6 -1
  230. package/dist/treeFactory.js.map +1 -1
  231. package/lib/core/change-family/changeFamily.d.ts +15 -4
  232. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  233. package/lib/core/change-family/changeFamily.js.map +1 -1
  234. package/lib/core/change-family/editBuilder.d.ts +2 -3
  235. package/lib/core/change-family/editBuilder.d.ts.map +1 -1
  236. package/lib/core/change-family/editBuilder.js +1 -2
  237. package/lib/core/change-family/editBuilder.js.map +1 -1
  238. package/lib/core/change-family/index.d.ts +1 -1
  239. package/lib/core/change-family/index.d.ts.map +1 -1
  240. package/lib/core/change-family/index.js.map +1 -1
  241. package/lib/core/index.d.ts +3 -2
  242. package/lib/core/index.d.ts.map +1 -1
  243. package/lib/core/index.js +1 -1
  244. package/lib/core/index.js.map +1 -1
  245. package/lib/core/tree/delta.d.ts +62 -16
  246. package/lib/core/tree/delta.d.ts.map +1 -1
  247. package/lib/core/tree/delta.js.map +1 -1
  248. package/lib/core/tree/detachedFieldIndex.d.ts +7 -13
  249. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  250. package/lib/core/tree/detachedFieldIndex.js +7 -21
  251. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  252. package/lib/core/tree/index.d.ts +1 -0
  253. package/lib/core/tree/index.d.ts.map +1 -1
  254. package/lib/core/tree/index.js.map +1 -1
  255. package/lib/core/tree/visitorUtils.d.ts +2 -4
  256. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  257. package/lib/core/tree/visitorUtils.js +2 -2
  258. package/lib/core/tree/visitorUtils.js.map +1 -1
  259. package/lib/entrypoints/alpha.d.ts +1 -1
  260. package/lib/entrypoints/alpha.d.ts.map +1 -1
  261. package/lib/entrypoints/alpha.js +1 -1
  262. package/lib/entrypoints/alpha.js.map +1 -1
  263. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  264. package/lib/feature-libraries/chunked-forest/uniformChunk.js +10 -2
  265. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  266. package/lib/feature-libraries/comparison-forest/comparisonForest.d.ts +51 -0
  267. package/lib/feature-libraries/comparison-forest/comparisonForest.d.ts.map +1 -0
  268. package/lib/feature-libraries/comparison-forest/comparisonForest.js +94 -0
  269. package/lib/feature-libraries/comparison-forest/comparisonForest.js.map +1 -0
  270. package/lib/feature-libraries/comparison-forest/index.d.ts +6 -0
  271. package/lib/feature-libraries/comparison-forest/index.d.ts.map +1 -0
  272. package/lib/feature-libraries/comparison-forest/index.js +6 -0
  273. package/lib/feature-libraries/comparison-forest/index.js.map +1 -0
  274. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +8 -6
  275. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  276. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
  277. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  278. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  279. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  280. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  281. package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
  282. package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
  283. package/lib/feature-libraries/default-schema/noChangeCodecs.js +3 -1
  284. package/lib/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
  285. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +6 -3
  286. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  287. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +16 -4
  288. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  289. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -3
  290. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  291. package/lib/feature-libraries/forest-summary/forestSummarizer.js +2 -3
  292. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  293. package/lib/feature-libraries/index.d.ts +4 -3
  294. package/lib/feature-libraries/index.d.ts.map +1 -1
  295. package/lib/feature-libraries/index.js +2 -1
  296. package/lib/feature-libraries/index.js.map +1 -1
  297. package/lib/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
  298. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  299. package/lib/feature-libraries/mitigatedChangeFamily.js +12 -0
  300. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  301. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +9 -1
  302. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  303. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  304. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
  305. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  306. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  307. package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
  308. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  309. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  310. package/lib/feature-libraries/modular-schema/invert.d.ts +15 -0
  311. package/lib/feature-libraries/modular-schema/invert.d.ts.map +1 -0
  312. package/lib/feature-libraries/modular-schema/invert.js +155 -0
  313. package/lib/feature-libraries/modular-schema/invert.js.map +1 -0
  314. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts +3 -4
  315. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
  316. package/lib/feature-libraries/modular-schema/minimizeModularChange.js +2 -2
  317. package/lib/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
  318. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +9 -9
  319. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  320. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +0 -2
  321. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  322. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +2 -2
  323. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  324. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  325. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  326. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  327. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  328. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -22
  329. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  330. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +16 -367
  331. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  332. package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts +61 -0
  333. package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -0
  334. package/lib/feature-libraries/modular-schema/modularChangeUtils.js +192 -0
  335. package/lib/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -0
  336. package/lib/feature-libraries/modular-schema/prune.d.ts +10 -0
  337. package/lib/feature-libraries/modular-schema/prune.d.ts.map +1 -0
  338. package/lib/feature-libraries/modular-schema/prune.js +45 -0
  339. package/lib/feature-libraries/modular-schema/prune.js.map +1 -0
  340. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +2 -2
  341. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  342. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  343. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
  344. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  345. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  346. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
  347. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  348. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  349. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +2 -2
  350. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  351. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  352. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +2 -2
  353. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  354. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  355. package/lib/feature-libraries/treeTextCursor.d.ts +15 -0
  356. package/lib/feature-libraries/treeTextCursor.d.ts.map +1 -1
  357. package/lib/feature-libraries/treeTextCursor.js +62 -1
  358. package/lib/feature-libraries/treeTextCursor.js.map +1 -1
  359. package/lib/index.d.ts +3 -1
  360. package/lib/index.d.ts.map +1 -1
  361. package/lib/index.js +2 -1
  362. package/lib/index.js.map +1 -1
  363. package/lib/packageVersion.d.ts +1 -1
  364. package/lib/packageVersion.js +1 -1
  365. package/lib/packageVersion.js.map +1 -1
  366. package/lib/shared-tree/serializedChange.d.ts +2 -2
  367. package/lib/shared-tree/serializedChange.d.ts.map +1 -1
  368. package/lib/shared-tree/serializedChange.js.map +1 -1
  369. package/lib/shared-tree/sharedTree.d.ts +6 -3
  370. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  371. package/lib/shared-tree/sharedTree.js +9 -7
  372. package/lib/shared-tree/sharedTree.js.map +1 -1
  373. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +2 -2
  374. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  375. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  376. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +41 -4
  377. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  378. package/lib/shared-tree/sharedTreeChangeFamily.js +55 -0
  379. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  380. package/lib/shared-tree/transactionMinimize.d.ts.map +1 -1
  381. package/lib/shared-tree/transactionMinimize.js +3 -3
  382. package/lib/shared-tree/transactionMinimize.js.map +1 -1
  383. package/lib/shared-tree/transactionPostProcessor.d.ts +2 -1
  384. package/lib/shared-tree/transactionPostProcessor.d.ts.map +1 -1
  385. package/lib/shared-tree/transactionPostProcessor.js.map +1 -1
  386. package/lib/shared-tree/treeCheckout.d.ts +8 -7
  387. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  388. package/lib/shared-tree/treeCheckout.js +1 -1
  389. package/lib/shared-tree/treeCheckout.js.map +1 -1
  390. package/lib/shared-tree-core/branch.d.ts +23 -9
  391. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  392. package/lib/shared-tree-core/branch.js +7 -0
  393. package/lib/shared-tree-core/branch.js.map +1 -1
  394. package/lib/shared-tree-core/editManager.d.ts +4 -4
  395. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  396. package/lib/shared-tree-core/editManager.js +2 -0
  397. package/lib/shared-tree-core/editManager.js.map +1 -1
  398. package/lib/shared-tree-core/editManagerCodecs.d.ts +3 -14
  399. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  400. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  401. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +11 -1
  402. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  403. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  404. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +4 -11
  405. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  406. package/lib/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
  407. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  408. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +4 -11
  409. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  410. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
  411. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  412. package/lib/shared-tree-core/editManagerSummarizer.d.ts +4 -4
  413. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  414. package/lib/shared-tree-core/editManagerSummarizer.js +0 -1
  415. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  416. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
  417. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  418. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  419. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  420. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  421. package/lib/shared-tree-core/messageCodecs.d.ts +8 -1
  422. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  423. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  424. package/lib/shared-tree-core/sharedTreeCore.d.ts +5 -5
  425. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  426. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  427. package/lib/shared-tree-core/transaction.d.ts +10 -10
  428. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  429. package/lib/shared-tree-core/transaction.js +6 -3
  430. package/lib/shared-tree-core/transaction.js.map +1 -1
  431. package/lib/simple-tree/api/eraseSchemaDetails.d.ts +15 -0
  432. package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  433. package/lib/simple-tree/api/eraseSchemaDetails.js +15 -0
  434. package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  435. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +21 -2
  436. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  437. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  438. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +13 -0
  439. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  440. package/lib/simple-tree/node-kinds/map/mapNode.js +9 -0
  441. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  442. package/lib/text/textDomain.d.ts +12 -0
  443. package/lib/text/textDomain.d.ts.map +1 -1
  444. package/lib/text/textDomain.js +34 -15
  445. package/lib/text/textDomain.js.map +1 -1
  446. package/lib/text/textDomainFormatted.d.ts +155 -61
  447. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  448. package/lib/text/textDomainFormatted.js +148 -73
  449. package/lib/text/textDomainFormatted.js.map +1 -1
  450. package/lib/text/textDomainFormattedDefault.d.ts +37 -14
  451. package/lib/text/textDomainFormattedDefault.d.ts.map +1 -1
  452. package/lib/text/textDomainFormattedDefault.js +14 -6
  453. package/lib/text/textDomainFormattedDefault.js.map +1 -1
  454. package/lib/treeDataStore.d.ts +49 -0
  455. package/lib/treeDataStore.d.ts.map +1 -0
  456. package/lib/treeDataStore.js +52 -0
  457. package/lib/treeDataStore.js.map +1 -0
  458. package/lib/treeFactory.d.ts +8 -3
  459. package/lib/treeFactory.d.ts.map +1 -1
  460. package/lib/treeFactory.js +5 -0
  461. package/lib/treeFactory.js.map +1 -1
  462. package/package.json +25 -24
  463. package/src/core/change-family/changeFamily.ts +32 -4
  464. package/src/core/change-family/editBuilder.ts +1 -2
  465. package/src/core/change-family/index.ts +2 -0
  466. package/src/core/index.ts +9 -6
  467. package/src/core/tree/delta.ts +62 -16
  468. package/src/core/tree/detachedFieldIndex.ts +7 -38
  469. package/src/core/tree/index.ts +2 -0
  470. package/src/core/tree/visitorUtils.ts +3 -17
  471. package/src/entrypoints/alpha.ts +7 -3
  472. package/src/feature-libraries/chunked-forest/uniformChunk.ts +11 -1
  473. package/src/feature-libraries/comparison-forest/comparisonForest.ts +140 -0
  474. package/src/feature-libraries/comparison-forest/index.ts +6 -0
  475. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +20 -6
  476. package/src/feature-libraries/default-schema/index.ts +1 -0
  477. package/src/feature-libraries/default-schema/noChangeCodecs.ts +11 -3
  478. package/src/feature-libraries/detachedFieldIndexSummarizer.ts +33 -5
  479. package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -3
  480. package/src/feature-libraries/index.ts +5 -0
  481. package/src/feature-libraries/mitigatedChangeFamily.ts +21 -3
  482. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +10 -1
  483. package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +9 -4
  484. package/src/feature-libraries/modular-schema/index.ts +1 -0
  485. package/src/feature-libraries/modular-schema/invert.ts +338 -0
  486. package/src/feature-libraries/modular-schema/minimizeModularChange.ts +3 -5
  487. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +16 -13
  488. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +3 -1
  489. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +2 -1
  490. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +45 -644
  491. package/src/feature-libraries/modular-schema/modularChangeUtils.ts +340 -0
  492. package/src/feature-libraries/modular-schema/prune.ts +69 -0
  493. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +4 -2
  494. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +5 -2
  495. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +4 -2
  496. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +4 -2
  497. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +6 -3
  498. package/src/feature-libraries/treeTextCursor.ts +66 -1
  499. package/src/index.ts +4 -0
  500. package/src/packageVersion.ts +1 -1
  501. package/src/shared-tree/serializedChange.ts +2 -2
  502. package/src/shared-tree/sharedTree.ts +34 -14
  503. package/src/shared-tree/sharedTreeChangeCodecs.ts +11 -3
  504. package/src/shared-tree/sharedTreeChangeFamily.ts +77 -2
  505. package/src/shared-tree/transactionMinimize.ts +7 -3
  506. package/src/shared-tree/transactionPostProcessor.ts +5 -1
  507. package/src/shared-tree/treeCheckout.ts +55 -16
  508. package/src/shared-tree-core/branch.ts +40 -12
  509. package/src/shared-tree-core/editManager.ts +46 -25
  510. package/src/shared-tree-core/editManagerCodecs.ts +9 -21
  511. package/src/shared-tree-core/editManagerCodecsCommons.ts +14 -2
  512. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +18 -21
  513. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +18 -20
  514. package/src/shared-tree-core/editManagerSummarizer.ts +9 -6
  515. package/src/shared-tree-core/messageCodecV1ToV4.ts +3 -3
  516. package/src/shared-tree-core/messageCodecVSharedBranches.ts +2 -2
  517. package/src/shared-tree-core/messageCodecs.ts +12 -2
  518. package/src/shared-tree-core/sharedTreeCore.ts +15 -6
  519. package/src/shared-tree-core/transaction.ts +47 -25
  520. package/src/simple-tree/api/eraseSchemaDetails.ts +15 -0
  521. package/src/simple-tree/node-kinds/array/arrayNode.ts +21 -2
  522. package/src/simple-tree/node-kinds/map/mapNode.ts +24 -2
  523. package/src/text/textDomain.ts +29 -6
  524. package/src/text/textDomainFormatted.ts +351 -134
  525. package/src/text/textDomainFormattedDefault.ts +25 -16
  526. package/src/treeDataStore.ts +125 -0
  527. package/src/treeFactory.ts +11 -3
@@ -7,17 +7,18 @@ export { allowsValue, assertAllowedValue, isTreeValue } from "./valueUtilities.j
7
7
  export { ForestSummarizer, forestCodecBuilder, ForestFormatVersion, } from "./forest-summary/index.js";
8
8
  export { cursorForMapTreeField, cursorForMapTreeNode, mapTreeFromCursor, mapTreeFieldFromCursor, type MinimalMapTreeNodeView, mapTreeFieldsWithField, mapTreeWithField, type MapTreeFieldViewGeneric, type MapTreeNodeViewGeneric, type MinimalFieldMap, } from "./mapTreeCursor.js";
9
9
  export { buildForest } from "./object-forest/index.js";
10
+ export { ComparisonForest } from "./comparison-forest/index.js";
10
11
  export { SchemaSummarizer, schemaCodecBuilder, } from "./schema-index/index.js";
11
12
  export { stackTreeNodeCursor, type CursorAdapter, prefixPath, prefixFieldPath, type CursorWithNode, stackTreeFieldCursor, } from "./treeCursorUtils.js";
12
- export { cursorForJsonableTreeNode, cursorForJsonableTreeField, jsonableTreeFromCursor, jsonableTreeFromFieldCursor, jsonableTreeFromForest, } from "./treeTextCursor.js";
13
+ export { cursorForJsonableTreeNode, cursorForJsonableTreeField, jsonableTreeFromCursor, jsonableTreeFromFieldCursor, jsonableTreeFromForest, forestsEqual, assertForestsEqual, } from "./treeTextCursor.js";
13
14
  export { buildNodeComparator, type NodeComparator, } from "./cursorComparator.js";
14
15
  import * as SequenceField from "./sequence-field/index.js";
15
16
  export { SequenceField };
16
- export { isNeverField, ModularEditBuilder, type FieldEditDescription as EditDescription, type FieldChangeHandler, type FieldChangeRebaser, type FieldEditor, type FieldChangeMap, type FieldChange, type FieldChangeset, type ToDelta, type ModularChangeset, makeModularChangeCodecFamily, type NodeChangeComposer, type NodeChangeInverter, type NodeChangeRebaser, type NodeChangePruner, type CrossFieldManager, CrossFieldTarget, FlexFieldKind, type FullSchemaPolicy, allowsRepoSuperset, type GenericChangeset, genericFieldKind, type HasFieldChanges, type NodeExistsConstraint, ModularChangeFamily, type RelevantRemovedRootsFromChild, EncodedModularChangesetV1, EncodedModularChangesetV2, updateRefreshers, type NodeId, type FieldChangeEncodingContext, type FieldKindConfiguration, type FieldKindConfigurationEntry, isNeverTree, DefaultRevisionReplacer, ModularChangeFormatVersion, minimizeModularChangeset, } from "./modular-schema/index.js";
17
+ export { isNeverField, ModularEditBuilder, type FieldEditDescription as EditDescription, type FieldChangeHandler, type FieldChangeRebaser, type FieldEditor, type FieldChangeMap, type FieldChange, type FieldChangeset, type ToDelta, type ModularChangeset, makeModularChangeCodecFamily, type NodeChangeComposer, type NodeChangeInverter, type NodeChangeRebaser, type NodeChangePruner, type CrossFieldManager, CrossFieldTarget, FlexFieldKind, type FullSchemaPolicy, allowsRepoSuperset, type GenericChangeset, genericFieldKind, type HasFieldChanges, type NodeExistsConstraint, ModularChangeFamily, type RelevantRemovedRootsFromChild, EncodedModularChangesetV1, EncodedModularChangesetV2, updateRefreshers, type NodeId, type FieldChangeEncodingContext, type FieldChangeDecodingContext, type FieldKindConfiguration, type FieldKindConfigurationEntry, isNeverTree, DefaultRevisionReplacer, ModularChangeFormatVersion, minimizeModularChangeset, } from "./modular-schema/index.js";
17
18
  export { mapRootChanges } from "./deltaUtils.js";
18
19
  export { type TreeChunk, chunkTree, chunkField, chunkFieldSingle, buildChunkedForest, defaultChunkPolicy, type FieldBatch, type FieldBatchCodec, FieldBatchFormatVersion, makeTreeChunker, fieldBatchCodecBuilder, FieldBatchDecodingContext, type FieldBatchEncodingContext, emptyChunk, combineChunks, type IncrementalEncodingPolicy, defaultIncrementalEncodingPolicy, type IncrementalDecoder, type IncrementalEncoder, } from "./chunked-forest/index.js";
19
20
  export { compareLocalNodeIdentifiers, createNodeIdentifierManager, isStableNodeIdentifier, type LocalNodeIdentifier, MockNodeIdentifierManager, type NodeIdentifierManager, nodeKeyTreeIdentifier, type StableNodeIdentifier, } from "./node-identifier/index.js";
20
- export { FieldKinds, type DefaultChangeset, DefaultChangeFamily, DefaultEditBuilder, type IDefaultEditBuilder, type ValueFieldEditBuilder, type OptionalFieldEditBuilder, type SequenceFieldEditBuilder, defaultSchemaPolicy, fieldKinds, fieldKindConfigurations, intoDelta, relevantRemovedRoots, getCodecTreeForModularChangeFormat, } from "./default-schema/index.js";
21
+ export { FieldKinds, type DefaultChangeProcessingContext, type DefaultChangeset, DefaultChangeFamily, DefaultEditBuilder, type IDefaultEditBuilder, type ValueFieldEditBuilder, type OptionalFieldEditBuilder, type SequenceFieldEditBuilder, defaultSchemaPolicy, fieldKinds, fieldKindConfigurations, intoDelta, relevantRemovedRoots, getCodecTreeForModularChangeFormat, } from "./default-schema/index.js";
21
22
  export { SchemaValidationError, type SchemaValidationErrorContext, isNodeInSchema, isFieldInSchema, throwOutOfSchema, } from "./schemaChecker.js";
22
23
  export { type FlexTreeOptionalField, type FlexTreeRequiredField, type FlexTreeSequenceField, type FlexTreeContext, type FlexTreeHydratedContext, type FlexTreeTypedField, type FlexTreeEntity, type FlexTreeField, type FlexTreeNode, TreeStatus, Context, type FlexTreeNodeEvents, type FlexTreeUnknownUnboxed, isFlexTreeNode, ContextSlot, flexTreeMarker, assertFlexTreeEntityNotFreed, flexTreeSlot, getSchemaAndPolicy, LazyEntity, treeStatusFromAnchorCache, indexForAt, FlexTreeEntityKind, type FlexibleNodeContent, type FlexibleFieldContent, type FlexTreeHydratedContextMinimal, type HydratedFlexTreeNode, getOrCreateHydratedFlexTreeNode, currentObserver, withObservation, type Observer, } from "./flex-tree/index.js";
23
24
  export { TreeCompressionStrategy } from "./treeCompressionUtils.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,QAAQ,EACb,UAAU,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EACN,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,sBAAsB,EACtB,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,eAAe,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACN,gBAAgB,EAChB,kBAAkB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,mBAAmB,EACnB,KAAK,aAAa,EAClB,UAAU,EACV,eAAe,EACf,KAAK,cAAc,EACnB,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,mBAAmB,EACnB,KAAK,cAAc,GACnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,OAAO,E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BAA4B,CAAC;AAEvE,OAAO,EACN,KAAK,SAAS,EACd,eAAe,EACf,UAAU,EACV,KAAK,SAAS,EACd,KAAK,cAAc,GACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,KAAK,iBAAiB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GACpB,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,QAAQ,EACb,UAAU,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EACN,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,sBAAsB,EACtB,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,eAAe,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EACN,gBAAgB,EAChB,kBAAkB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,mBAAmB,EACnB,KAAK,aAAa,EAClB,UAAU,EACV,eAAe,EACf,KAAK,cAAc,EACnB,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,EACtB,YAAY,EACZ,kBAAkB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,mBAAmB,EACnB,KAAK,cAAc,GAC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E,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,OAAO,EACN,KAAK,YAAY,EACjB,qBAAqB,EACrB,mBAAmB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EACN,KAAK,SAAS,EACd,eAAe,EACf,UAAU,EACV,KAAK,SAAS,EACd,KAAK,cAAc,GACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,KAAK,iBAAiB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GACpB,MAAM,wBAAwB,CAAC"}
@@ -7,9 +7,10 @@ export { allowsValue, assertAllowedValue, isTreeValue } from "./valueUtilities.j
7
7
  export { ForestSummarizer, forestCodecBuilder, ForestFormatVersion, } from "./forest-summary/index.js";
8
8
  export { cursorForMapTreeField, cursorForMapTreeNode, mapTreeFromCursor, mapTreeFieldFromCursor, mapTreeFieldsWithField, mapTreeWithField, } from "./mapTreeCursor.js";
9
9
  export { buildForest } from "./object-forest/index.js";
10
+ export { ComparisonForest } from "./comparison-forest/index.js";
10
11
  export { SchemaSummarizer, schemaCodecBuilder, } from "./schema-index/index.js";
11
12
  export { stackTreeNodeCursor, prefixPath, prefixFieldPath, stackTreeFieldCursor, } from "./treeCursorUtils.js";
12
- export { cursorForJsonableTreeNode, cursorForJsonableTreeField, jsonableTreeFromCursor, jsonableTreeFromFieldCursor, jsonableTreeFromForest, } from "./treeTextCursor.js";
13
+ export { cursorForJsonableTreeNode, cursorForJsonableTreeField, jsonableTreeFromCursor, jsonableTreeFromFieldCursor, jsonableTreeFromForest, forestsEqual, assertForestsEqual, } from "./treeTextCursor.js";
13
14
  export { buildNodeComparator, } from "./cursorComparator.js";
14
15
  import * as SequenceField from "./sequence-field/index.js";
15
16
  // eslint-disable-next-line unicorn/prefer-export-from -- fixing requires `export * as` (breaks API-Extractor) or named exports (changes public API)
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sour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licensed under the MIT License.\n */\n\nexport {\n\ttype DownPath,\n\ttoDownPath,\n} from \"./editableTreeBinder.js\";\nexport { allowsValue, assertAllowedValue, isTreeValue } from \"./valueUtilities.js\";\n\nexport {\n\tForestSummarizer,\n\tforestCodecBuilder,\n\tForestFormatVersion,\n} from \"./forest-summary/index.js\";\nexport {\n\tcursorForMapTreeField,\n\tcursorForMapTreeNode,\n\tmapTreeFromCursor,\n\tmapTreeFieldFromCursor,\n\ttype MinimalMapTreeNodeView,\n\tmapTreeFieldsWithField,\n\tmapTreeWithField,\n\ttype MapTreeFieldViewGeneric,\n\ttype MapTreeNodeViewGeneric,\n\ttype MinimalFieldMap,\n} from \"./mapTreeCursor.js\";\nexport { buildForest } from \"./object-forest/index.js\";\nexport {\n\tSchemaSummarizer,\n\tschemaCodecBuilder,\n} from \"./schema-index/index.js\";\nexport {\n\tstackTreeNodeCursor,\n\ttype CursorAdapter,\n\tprefixPath,\n\tprefixFieldPath,\n\ttype CursorWithNode,\n\tstackTreeFieldCursor,\n} from \"./treeCursorUtils.js\";\nexport {\n\tcursorForJsonableTreeNode,\n\tcursorForJsonableTreeField,\n\tjsonableTreeFromCursor,\n\tjsonableTreeFromFieldCursor,\n\tjsonableTreeFromForest,\n} from \"./treeTextCursor.js\";\nexport {\n\tbuildNodeComparator,\n\ttype NodeComparator,\n} from \"./cursorComparator.js\";\n\nimport * as SequenceField from \"./sequence-field/index.js\";\n// eslint-disable-next-line unicorn/prefer-export-from -- fixing requires `export * as` (breaks API-Extractor) or named exports (changes public API)\nexport { SequenceField };\n\nexport {\n\tisNeverField,\n\tModularEditBuilder,\n\ttype FieldEditDescription as EditDescription,\n\ttype FieldChangeHandler,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype FieldChangeMap,\n\ttype FieldChange,\n\ttype FieldChangeset,\n\ttype ToDelta,\n\ttype ModularChangeset,\n\tmakeModularChangeCodecFamily,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\tallowsRepoSuperset,\n\ttype GenericChangeset,\n\tgenericFieldKind,\n\ttype HasFieldChanges,\n\ttype NodeExistsConstraint,\n\tModularChangeFamily,\n\ttype RelevantRemovedRootsFromChild,\n\tEncodedModularChangesetV1,\n\tEncodedModularChangesetV2,\n\tupdateRefreshers,\n\ttype NodeId,\n\ttype FieldChangeEncodingContext,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tisNeverTree,\n\tDefaultRevisionReplacer,\n\tModularChangeFormatVersion,\n\tminimizeModularChangeset,\n} from \"./modular-schema/index.js\";\n\nexport { mapRootChanges } from \"./deltaUtils.js\";\n\nexport {\n\ttype TreeChunk,\n\tchunkTree,\n\tchunkField,\n\tchunkFieldSingle,\n\tbuildChunkedForest,\n\tdefaultChunkPolicy,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tFieldBatchFormatVersion,\n\tmakeTreeChunker,\n\tfieldBatchCodecBuilder,\n\tFieldBatchDecodingContext,\n\ttype FieldBatchEncodingContext,\n\temptyChunk,\n\tcombineChunks,\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n\ttype IncrementalDecoder,\n\ttype IncrementalEncoder,\n} from \"./chunked-forest/index.js\";\n\nexport {\n\tcompareLocalNodeIdentifiers,\n\tcreateNodeIdentifierManager,\n\tisStableNodeIdentifier,\n\ttype LocalNodeIdentifier,\n\tMockNodeIdentifierManager,\n\ttype NodeIdentifierManager,\n\tnodeKeyTreeIdentifier,\n\ttype StableNodeIdentifier,\n} from \"./node-identifier/index.js\";\n\nexport {\n\tFieldKinds,\n\ttype DefaultChangeset,\n\tDefaultChangeFamily,\n\tDefaultEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\tdefaultSchemaPolicy,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tgetCodecTreeForModularChangeFormat,\n} from \"./default-schema/index.js\";\n\nexport {\n\tSchemaValidationError,\n\ttype SchemaValidationErrorContext,\n\tisNodeInSchema,\n\tisFieldInSchema,\n\tthrowOutOfSchema,\n} from \"./schemaChecker.js\";\n\nexport {\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeContext,\n\ttype FlexTreeHydratedContext,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeEntity,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\tTreeStatus,\n\tContext,\n\ttype FlexTreeNodeEvents,\n\ttype FlexTreeUnknownUnboxed,\n\tisFlexTreeNode,\n\tContextSlot,\n\t// Internal\n\tflexTreeMarker,\n\tassertFlexTreeEntityNotFreed,\n\tflexTreeSlot,\n\tgetSchemaAndPolicy,\n\tLazyEntity,\n\ttreeStatusFromAnchorCache,\n\tindexForAt,\n\tFlexTreeEntityKind,\n\ttype FlexibleNodeContent,\n\ttype FlexibleFieldContent,\n\ttype FlexTreeHydratedContextMinimal,\n\ttype HydratedFlexTreeNode,\n\tgetOrCreateHydratedFlexTreeNode,\n\tcurrentObserver,\n\twithObservation,\n\ttype Observer,\n} from \"./flex-tree/index.js\";\n\nexport { TreeCompressionStrategy } from \"./treeCompressionUtils.js\";\n\nexport { valueSchemaAllows } from \"./valueUtilities.js\";\n\nexport { DetachedFieldIndexSummarizer } from \"./detachedFieldIndexSummarizer.js\";\n\nexport {\n\ttype SchemaChange,\n\tmakeSchemaChangeCodec,\n\tEncodedSchemaChange,\n} from \"./schema-edits/index.js\";\n\nexport { makeMitigatedChangeFamily } from \"./mitigatedChangeFamily.js\";\n\nexport {\n\ttype KeyFinder,\n\tAnchorTreeIndex,\n\thasElement,\n\ttype TreeIndex,\n\ttype TreeIndexNodes,\n} from \"./indexing/index.js\";\n\nexport {\n\ttype ChangeAtomIdBTree,\n\tnewChangeAtomIdBTree,\n\tgetFromChangeAtomIdMap,\n\tsetInChangeAtomIdMap,\n} from \"./changeAtomIdBTree.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,UAAU,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EACN,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EAEtB,sBAAsB,EACtB,gBAAgB,GAIhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EACN,gBAAgB,EAChB,kBAAkB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,mBAAmB,EAEnB,UAAU,EACV,eAAe,EAEf,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,EACtB,YAAY,EACZ,kBAAkB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,mBAAmB,GAEnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAC3D,oJAAoJ;AACpJ,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,OAAO,EACN,YAAY,EACZ,kBAAkB,EAUlB,4BAA4B,EAM5B,gBAAgB,EAChB,aAAa,EAEb,kBAAkB,EAElB,gBAAgB,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C,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EAEN,eAAe,EACf,UAAU,GAGV,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAEN,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GACpB,MAAM,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype DownPath,\n\ttoDownPath,\n} from \"./editableTreeBinder.js\";\nexport { allowsValue, assertAllowedValue, isTreeValue } from \"./valueUtilities.js\";\n\nexport {\n\tForestSummarizer,\n\tforestCodecBuilder,\n\tForestFormatVersion,\n} from \"./forest-summary/index.js\";\nexport {\n\tcursorForMapTreeField,\n\tcursorForMapTreeNode,\n\tmapTreeFromCursor,\n\tmapTreeFieldFromCursor,\n\ttype MinimalMapTreeNodeView,\n\tmapTreeFieldsWithField,\n\tmapTreeWithField,\n\ttype MapTreeFieldViewGeneric,\n\ttype MapTreeNodeViewGeneric,\n\ttype MinimalFieldMap,\n} from \"./mapTreeCursor.js\";\nexport { buildForest } from \"./object-forest/index.js\";\nexport { ComparisonForest } from \"./comparison-forest/index.js\";\nexport {\n\tSchemaSummarizer,\n\tschemaCodecBuilder,\n} from \"./schema-index/index.js\";\nexport {\n\tstackTreeNodeCursor,\n\ttype CursorAdapter,\n\tprefixPath,\n\tprefixFieldPath,\n\ttype CursorWithNode,\n\tstackTreeFieldCursor,\n} from \"./treeCursorUtils.js\";\nexport {\n\tcursorForJsonableTreeNode,\n\tcursorForJsonableTreeField,\n\tjsonableTreeFromCursor,\n\tjsonableTreeFromFieldCursor,\n\tjsonableTreeFromForest,\n\tforestsEqual,\n\tassertForestsEqual,\n} from \"./treeTextCursor.js\";\nexport {\n\tbuildNodeComparator,\n\ttype NodeComparator,\n} from \"./cursorComparator.js\";\n\nimport * as SequenceField from \"./sequence-field/index.js\";\n// eslint-disable-next-line unicorn/prefer-export-from -- fixing requires `export * as` (breaks API-Extractor) or named exports (changes public API)\nexport { SequenceField };\n\nexport {\n\tisNeverField,\n\tModularEditBuilder,\n\ttype FieldEditDescription as EditDescription,\n\ttype FieldChangeHandler,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype FieldChangeMap,\n\ttype FieldChange,\n\ttype FieldChangeset,\n\ttype ToDelta,\n\ttype ModularChangeset,\n\tmakeModularChangeCodecFamily,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\tallowsRepoSuperset,\n\ttype GenericChangeset,\n\tgenericFieldKind,\n\ttype HasFieldChanges,\n\ttype NodeExistsConstraint,\n\tModularChangeFamily,\n\ttype RelevantRemovedRootsFromChild,\n\tEncodedModularChangesetV1,\n\tEncodedModularChangesetV2,\n\tupdateRefreshers,\n\ttype NodeId,\n\ttype FieldChangeEncodingContext,\n\ttype FieldChangeDecodingContext,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tisNeverTree,\n\tDefaultRevisionReplacer,\n\tModularChangeFormatVersion,\n\tminimizeModularChangeset,\n} from \"./modular-schema/index.js\";\n\nexport { mapRootChanges } from \"./deltaUtils.js\";\n\nexport {\n\ttype TreeChunk,\n\tchunkTree,\n\tchunkField,\n\tchunkFieldSingle,\n\tbuildChunkedForest,\n\tdefaultChunkPolicy,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tFieldBatchFormatVersion,\n\tmakeTreeChunker,\n\tfieldBatchCodecBuilder,\n\tFieldBatchDecodingContext,\n\ttype FieldBatchEncodingContext,\n\temptyChunk,\n\tcombineChunks,\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n\ttype IncrementalDecoder,\n\ttype IncrementalEncoder,\n} from \"./chunked-forest/index.js\";\n\nexport {\n\tcompareLocalNodeIdentifiers,\n\tcreateNodeIdentifierManager,\n\tisStableNodeIdentifier,\n\ttype LocalNodeIdentifier,\n\tMockNodeIdentifierManager,\n\ttype NodeIdentifierManager,\n\tnodeKeyTreeIdentifier,\n\ttype StableNodeIdentifier,\n} from \"./node-identifier/index.js\";\n\nexport {\n\tFieldKinds,\n\ttype DefaultChangeProcessingContext,\n\ttype DefaultChangeset,\n\tDefaultChangeFamily,\n\tDefaultEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\tdefaultSchemaPolicy,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tgetCodecTreeForModularChangeFormat,\n} from \"./default-schema/index.js\";\n\nexport {\n\tSchemaValidationError,\n\ttype SchemaValidationErrorContext,\n\tisNodeInSchema,\n\tisFieldInSchema,\n\tthrowOutOfSchema,\n} from \"./schemaChecker.js\";\n\nexport {\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeContext,\n\ttype FlexTreeHydratedContext,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeEntity,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\tTreeStatus,\n\tContext,\n\ttype FlexTreeNodeEvents,\n\ttype FlexTreeUnknownUnboxed,\n\tisFlexTreeNode,\n\tContextSlot,\n\t// Internal\n\tflexTreeMarker,\n\tassertFlexTreeEntityNotFreed,\n\tflexTreeSlot,\n\tgetSchemaAndPolicy,\n\tLazyEntity,\n\ttreeStatusFromAnchorCache,\n\tindexForAt,\n\tFlexTreeEntityKind,\n\ttype FlexibleNodeContent,\n\ttype FlexibleFieldContent,\n\ttype FlexTreeHydratedContextMinimal,\n\ttype HydratedFlexTreeNode,\n\tgetOrCreateHydratedFlexTreeNode,\n\tcurrentObserver,\n\twithObservation,\n\ttype Observer,\n} from \"./flex-tree/index.js\";\n\nexport { TreeCompressionStrategy } from \"./treeCompressionUtils.js\";\n\nexport { valueSchemaAllows } from \"./valueUtilities.js\";\n\nexport { DetachedFieldIndexSummarizer } from \"./detachedFieldIndexSummarizer.js\";\n\nexport {\n\ttype SchemaChange,\n\tmakeSchemaChangeCodec,\n\tEncodedSchemaChange,\n} from \"./schema-edits/index.js\";\n\nexport { makeMitigatedChangeFamily } from \"./mitigatedChangeFamily.js\";\n\nexport {\n\ttype KeyFinder,\n\tAnchorTreeIndex,\n\thasElement,\n\ttype TreeIndex,\n\ttype TreeIndexNodes,\n} from \"./indexing/index.js\";\n\nexport {\n\ttype ChangeAtomIdBTree,\n\tnewChangeAtomIdBTree,\n\tgetFromChangeAtomIdMap,\n\tsetInChangeAtomIdMap,\n} from \"./changeAtomIdBTree.js\";\n"]}
@@ -17,6 +17,6 @@ import type { ChangeFamily, ChangeFamilyEditor, ChangeRebaser } from "../core/in
17
17
  * @param onError - A callback invoked for each error thrown.
18
18
  * @returns a mitigated change family.
19
19
  */
20
- export declare function makeMitigatedChangeFamily<TEditor extends ChangeFamilyEditor, TChange>(unmitigatedChangeFamily: ChangeFamily<TEditor, TChange>, fallbackChange: TChange, onError: (error: unknown) => void): ChangeFamily<TEditor, TChange>;
20
+ export declare function makeMitigatedChangeFamily<TEditor extends ChangeFamilyEditor, TChange, TChangeProcessingContext>(unmitigatedChangeFamily: ChangeFamily<TEditor, TChange, TChangeProcessingContext>, fallbackChange: TChange, onError: (error: unknown) => void): ChangeFamily<TEditor, TChange, TChangeProcessingContext>;
21
21
  export declare function makeMitigatedRebaser<TChange>(unmitigatedRebaser: ChangeRebaser<TChange>, fallbackChange: TChange, onError: (error: unknown) => void): ChangeRebaser<TChange>;
22
22
  //# sourceMappingURL=mitigatedChangeFamily.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mitigatedChangeFamily.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/mitigatedChangeFamily.ts"],"names":[],"mappings":"AAAA;;;GA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C/B,aAAa,CAAC,OAAO,CAAC,CA0CxB"}
@@ -23,6 +23,18 @@ export function makeMitigatedChangeFamily(unmitigatedChangeFamily, fallbackChang
23
23
  },
24
24
  rebaser: makeMitigatedRebaser(unmitigatedChangeFamily.rebaser, fallbackChange, onError),
25
25
  codecs: unmitigatedChangeFamily.codecs,
26
+ buildProcessor: (processFn) => {
27
+ const unmitigatedProcessor = unmitigatedChangeFamily.buildProcessor(processFn);
28
+ return (change) => {
29
+ try {
30
+ return unmitigatedProcessor(change);
31
+ }
32
+ catch (error) {
33
+ onError(error);
34
+ return fallbackChange;
35
+ }
36
+ };
37
+ },
26
38
  };
27
39
  }
28
40
  export function makeMitigatedRebaser(unmitigatedRebaser, fallbackChange, onError) {
@@ -1 +1 @@
1
- {"version":3,"file":"mitigatedChangeFamily.js","sourceRoot":"","sources":["../../src/feature-libraries/mitigatedChangeFamily.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,yBAAyB,CACxC,uBAAuD,EACvD,cAAuB,EACvB,OAAiC;IAEjC,OAAO;QACN,WAAW,EAAE,CACZ,eAAkC,EAClC,cAAuD,EAC7C,EAAE;YACZ,OAAO,uBAAuB,CAAC,WAAW,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;QAC7E,CAAC;QACD,OAAO,EAAE,oBAAoB,CAAC,uBAAuB,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC;QACvF,MAAM,EAAE,uBAAuB,CAAC,MAAM;KACtC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,oBAAoB,CACnC,kBAA0C,EAC1C,cAAuB,EACvB,OAAiC;IAEjC,MAAM,YAAY,GAAG,CAAC,EAAiB,EAAW,EAAE;QACnD,IAAI,CAAC;YACJ,OAAO,EAAE,EAAE,CAAC;QACb,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACzB,OAAO,CAAC,KAAK,CAAC,CAAC;YACf,OAAO,cAAc,CAAC;QACvB,CAAC;IACF,CAAC,CAAC;IAEF,OAAO;QACN,OAAO,EAAE,CAAC,OAAgC,EAAW,EAAE;YACtD,OAAO,YAAY,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QAChE,CAAC;QACD,MAAM,EAAE,CACP,OAA8B,EAC9B,UAAmB,EACnB,QAAqB,EACX,EAAE;YACZ,OAAO,YAAY,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;QACrF,CAAC;QACD,MAAM,EAAE,CACP,MAA6B,EAC7B,IAA2B,EAC3B,gBAAwC,EACxC,uBAAiC,EACvB,EAAE;YACZ,OAAO,YAAY,CAAC,GAAG,EAAE,CACxB,kBAAkB,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,uBAAuB,CAAC,CAClF,CAAC;QACH,CAAC;QACD,YAAY,EAAE,CAAC,MAAe,EAAgC,EAAE;YAC/D,IAAI,CAAC;gBACJ,OAAO,kBAAkB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;YAChD,CAAC;YAAC,OAAO,KAAc,EAAE,CAAC;gBACzB,OAAO,CAAC,KAAK,CAAC,CAAC;gBACf,OAAO,IAAI,GAAG,EAAE,CAAC;YAClB,CAAC;QACF,CAAC;QACD,cAAc,EAAE,CAAC,MAAe,EAAE,QAA0B,EAAW,EAAE,CACxE,YAAY,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;KACxE,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tChangeFamily,\n\tChangeFamilyEditor,\n\tChangeRebaser,\n\tRevisionMetadataSource,\n\tRevisionReplacer,\n\tRevisionTag,\n\tTaggedChange,\n} from \"../core/index.js\";\n\n/**\n * Makes a given `ChangeFamily` safer to use by wrapping some of its functions in try-catch blocks.\n *\n * Mitigated functions:\n * - {@link ChangeFamily.intoDelta} (an empty Delta is returned instead)\n * - {@link ChangeRebaser.rebase} (the given `fallbackChange` is returned instead)\n * - {@link ChangeRebaser.invert} (the given `fallbackChange` is returned instead)\n * - {@link ChangeRebaser.compose} (the given `fallbackChange` is returned instead)\n *\n * @param unmitigatedChangeFamily - The change family to mitigate.\n * @param fallbackChange - A changeset to use as a fallback when one of the mitigated functions throws.\n * @param onError - A callback invoked for each error thrown.\n * @returns a mitigated change family.\n */\nexport function makeMitigatedChangeFamily<TEditor extends ChangeFamilyEditor, TChange>(\n\tunmitigatedChangeFamily: ChangeFamily<TEditor, TChange>,\n\tfallbackChange: TChange,\n\tonError: (error: unknown) => void,\n): ChangeFamily<TEditor, TChange> {\n\treturn {\n\t\tbuildEditor: (\n\t\t\tmintRevisionTag: () => RevisionTag,\n\t\t\tchangeReceiver: (change: TaggedChange<TChange>) => void,\n\t\t): TEditor => {\n\t\t\treturn unmitigatedChangeFamily.buildEditor(mintRevisionTag, changeReceiver);\n\t\t},\n\t\trebaser: makeMitigatedRebaser(unmitigatedChangeFamily.rebaser, fallbackChange, onError),\n\t\tcodecs: unmitigatedChangeFamily.codecs,\n\t};\n}\n\nexport function makeMitigatedRebaser<TChange>(\n\tunmitigatedRebaser: ChangeRebaser<TChange>,\n\tfallbackChange: TChange,\n\tonError: (error: unknown) => void,\n): ChangeRebaser<TChange> {\n\tconst withFallback = (fn: () => TChange): TChange => {\n\t\ttry {\n\t\t\treturn fn();\n\t\t} catch (error: unknown) {\n\t\t\tonError(error);\n\t\t\treturn fallbackChange;\n\t\t}\n\t};\n\n\treturn {\n\t\tcompose: (changes: TaggedChange<TChange>[]): TChange => {\n\t\t\treturn withFallback(() => unmitigatedRebaser.compose(changes));\n\t\t},\n\t\tinvert: (\n\t\t\tchanges: TaggedChange<TChange>,\n\t\t\tisRollback: boolean,\n\t\t\trevision: RevisionTag,\n\t\t): TChange => {\n\t\t\treturn withFallback(() => unmitigatedRebaser.invert(changes, isRollback, revision));\n\t\t},\n\t\trebase: (\n\t\t\tchange: TaggedChange<TChange>,\n\t\t\tover: TaggedChange<TChange>,\n\t\t\trevisionMetadata: RevisionMetadataSource,\n\t\t\tignoreNoChangeViolation?: boolean,\n\t\t): TChange => {\n\t\t\treturn withFallback(() =>\n\t\t\t\tunmitigatedRebaser.rebase(change, over, revisionMetadata, ignoreNoChangeViolation),\n\t\t\t);\n\t\t},\n\t\tgetRevisions: (change: TChange): Set<RevisionTag | undefined> => {\n\t\t\ttry {\n\t\t\t\treturn unmitigatedRebaser.getRevisions(change);\n\t\t\t} catch (error: unknown) {\n\t\t\t\tonError(error);\n\t\t\t\treturn new Set();\n\t\t\t}\n\t\t},\n\t\tchangeRevision: (change: TChange, replacer: RevisionReplacer): TChange =>\n\t\t\twithFallback(() => unmitigatedRebaser.changeRevision(change, replacer)),\n\t};\n}\n"]}
1
+ {"version":3,"file":"mitigatedChangeFamily.js","sourceRoot":"","sources":["../../src/feature-libraries/mitigatedChangeFamily.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,yBAAyB,CAKxC,uBAAiF,EACjF,cAAuB,EACvB,OAAiC;IAEjC,OAAO;QACN,WAAW,EAAE,CACZ,eAAkC,EAClC,cAAuD,EAC7C,EAAE;YACZ,OAAO,uBAAuB,CAAC,WAAW,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;QAC7E,CAAC;QACD,OAAO,EAAE,oBAAoB,CAAC,uBAAuB,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC;QACvF,MAAM,EAAE,uBAAuB,CAAC,MAAM;QACtC,cAAc,EAAE,CACf,SAA6D,EAC5B,EAAE;YACnC,MAAM,oBAAoB,GAAG,uBAAuB,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;YAC/E,OAAO,CAA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AC,MAAM,CAAC,CAAC;YAChD,CAAC;YAAC,OAAO,KAAc,EAAE,CAAC;gBACzB,OAAO,CAAC,KAAK,CAAC,CAAC;gBACf,OAAO,IAAI,GAAG,EAAE,CAAC;YAClB,CAAC;QACF,CAAC;QACD,cAAc,EAAE,CAAC,MAAe,EAAE,QAA0B,EAAW,EAAE,CACxE,YAAY,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;KACxE,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tChangeFamily,\n\tChangeFamilyEditor,\n\tChangeRebaser,\n\tProcessChangeFn,\n\tRevisionMetadataSource,\n\tRevisionReplacer,\n\tRevisionTag,\n\tTaggedChange,\n} from \"../core/index.js\";\n\n/**\n * Makes a given `ChangeFamily` safer to use by wrapping some of its functions in try-catch blocks.\n *\n * Mitigated functions:\n * - {@link ChangeFamily.intoDelta} (an empty Delta is returned instead)\n * - {@link ChangeRebaser.rebase} (the given `fallbackChange` is returned instead)\n * - {@link ChangeRebaser.invert} (the given `fallbackChange` is returned instead)\n * - {@link ChangeRebaser.compose} (the given `fallbackChange` is returned instead)\n *\n * @param unmitigatedChangeFamily - The change family to mitigate.\n * @param fallbackChange - A changeset to use as a fallback when one of the mitigated functions throws.\n * @param onError - A callback invoked for each error thrown.\n * @returns a mitigated change family.\n */\nexport function makeMitigatedChangeFamily<\n\tTEditor extends ChangeFamilyEditor,\n\tTChange,\n\tTChangeProcessingContext,\n>(\n\tunmitigatedChangeFamily: ChangeFamily<TEditor, TChange, TChangeProcessingContext>,\n\tfallbackChange: TChange,\n\tonError: (error: unknown) => void,\n): ChangeFamily<TEditor, TChange, TChangeProcessingContext> {\n\treturn {\n\t\tbuildEditor: (\n\t\t\tmintRevisionTag: () => RevisionTag,\n\t\t\tchangeReceiver: (change: TaggedChange<TChange>) => void,\n\t\t): TEditor => {\n\t\t\treturn unmitigatedChangeFamily.buildEditor(mintRevisionTag, changeReceiver);\n\t\t},\n\t\trebaser: makeMitigatedRebaser(unmitigatedChangeFamily.rebaser, fallbackChange, onError),\n\t\tcodecs: unmitigatedChangeFamily.codecs,\n\t\tbuildProcessor: (\n\t\t\tprocessFn: ProcessChangeFn<TChange, TChangeProcessingContext>,\n\t\t): ((change: TChange) => TChange) => {\n\t\t\tconst unmitigatedProcessor = unmitigatedChangeFamily.buildProcessor(processFn);\n\t\t\treturn (change: TChange): TChange => {\n\t\t\t\ttry {\n\t\t\t\t\treturn unmitigatedProcessor(change);\n\t\t\t\t} catch (error: unknown) {\n\t\t\t\t\tonError(error);\n\t\t\t\t\treturn fallbackChange;\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t};\n}\n\nexport function makeMitigatedRebaser<TChange>(\n\tunmitigatedRebaser: ChangeRebaser<TChange>,\n\tfallbackChange: TChange,\n\tonError: (error: unknown) => void,\n): ChangeRebaser<TChange> {\n\tconst withFallback = (fn: () => TChange): TChange => {\n\t\ttry {\n\t\t\treturn fn();\n\t\t} catch (error: unknown) {\n\t\t\tonError(error);\n\t\t\treturn fallbackChange;\n\t\t}\n\t};\n\n\treturn {\n\t\tcompose: (changes: TaggedChange<TChange>[]): TChange => {\n\t\t\treturn withFallback(() => unmitigatedRebaser.compose(changes));\n\t\t},\n\t\tinvert: (\n\t\t\tchanges: TaggedChange<TChange>,\n\t\t\tisRollback: boolean,\n\t\t\trevision: RevisionTag,\n\t\t): TChange => {\n\t\t\treturn withFallback(() => unmitigatedRebaser.invert(changes, isRollback, revision));\n\t\t},\n\t\trebase: (\n\t\t\tchange: TaggedChange<TChange>,\n\t\t\tover: TaggedChange<TChange>,\n\t\t\trevisionMetadata: RevisionMetadataSource,\n\t\t\tignoreNoChangeViolation?: boolean,\n\t\t): TChange => {\n\t\t\treturn withFallback(() =>\n\t\t\t\tunmitigatedRebaser.rebase(change, over, revisionMetadata, ignoreNoChangeViolation),\n\t\t\t);\n\t\t},\n\t\tgetRevisions: (change: TChange): Set<RevisionTag | undefined> => {\n\t\t\ttry {\n\t\t\t\treturn unmitigatedRebaser.getRevisions(change);\n\t\t\t} catch (error: unknown) {\n\t\t\t\tonError(error);\n\t\t\t\treturn new Set();\n\t\t\t}\n\t\t},\n\t\tchangeRevision: (change: TChange, replacer: RevisionReplacer): TChange =>\n\t\t\twithFallback(() => unmitigatedRebaser.changeRevision(change, replacer)),\n\t};\n}\n"]}
@@ -37,7 +37,7 @@ export interface FieldChangeDelta {
37
37
  export interface FieldChangeHandler<TChangeset, TEditor extends FieldEditor<TChangeset> = FieldEditor<TChangeset>> {
38
38
  _typeCheck?: Invariant<TChangeset>;
39
39
  readonly rebaser: FieldChangeRebaser<TChangeset>;
40
- readonly codecsFactory: (revisionTagCodec: JsonCodecPart<RevisionTag, typeof RevisionTagSchema, ChangeEncodingContext>) => ICodecFamily<TChangeset, FieldChangeEncodingContext>;
40
+ readonly codecsFactory: (revisionTagCodec: JsonCodecPart<RevisionTag, typeof RevisionTagSchema, ChangeEncodingContext>) => ICodecFamily<TChangeset, FieldChangeEncodingContext, FieldChangeDecodingContext>;
41
41
  readonly editor: TEditor;
42
42
  intoDelta(change: TChangeset, deltaFromChild: ToDelta): FieldChangeDelta;
43
43
  /**
@@ -200,6 +200,14 @@ export interface RebaseRevisionMetadata extends RevisionMetadataSource {
200
200
  export interface FieldChangeEncodingContext {
201
201
  readonly baseContext: ChangeEncodingContext;
202
202
  encodeNode(nodeId: NodeId): EncodedNodeChangeset;
203
+ }
204
+ /**
205
+ * Context provided to field change codecs when decoding.
206
+ * @remarks
207
+ * The decode-side counterpart of {@link FieldChangeEncodingContext}.
208
+ */
209
+ export interface FieldChangeDecodingContext {
210
+ readonly baseContext: ChangeEncodingContext;
203
211
  decodeNode(encodedNode: EncodedNodeChangeset): NodeId;
204
212
  }
205
213
  //# sourceMappingURL=fieldChangeHandler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fieldChangeHandler.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldChangeHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,KAAK,EACX,YAAY,EACZ,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,EACjB,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAE1E,MAAM,MAAM,oBAAoB,GAAG;IAClC,MAAM;IACN,MAAM,GAAG,SAAS;IAClB,MAAM,GAAG,SAAS;CAClB,EAAE,CAAC;AAEJ;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAC;IACnC;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,wBAAwB,EAAE,CAAC;IACtD;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,uBAAuB,EAAE,CAAC;CACrD;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB,CAClC,UAAU,EACV,OAAO,SAAS,WAAW,CAAC,UAAU,CAAC,GAAG,WAAW,CAAC,UAAU,CAAC;IAEjE,UAAU,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,kBAAkB,C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AAM,KAAK,QAAQ,CAAC,mBAAmB,CAAC,CAAC;AAE7F,MAAM,WAAW,sBAAuB,SAAQ,sBAAsB;IACrE,QAAQ,CAAC,mBAAmB,EAAE,MAAM,WAAW,GAAG,SAAS,CAAC;IAC5D,QAAQ,CAAC,gBAAgB,EAAE,MAAM,WAAW,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,WAAW,EAAE,qBAAqB,CAAC;IAC5C,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,CAAC;IACjD,UAAU,CAAC,WAAW,EAAE,oBAAoB,GAAG,MAAM,CAAC;CACtD"}
1
+ {"version":3,"file":"fieldChangeHandler.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldChangeHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,KAAK,EACX,YAAY,EACZ,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,EACjB,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAE1E,MAAM,MAAM,oBAAoB,GAAG;IAClC,MAAM;IACN,MAAM,GAAG,SAAS;IAClB,MAAM,GAAG,SAAS;CAClB,EAAE,CAAC;AAEJ;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH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A;AACpB,CAAC,EAjBW,gBAAgB,KAAhB,gBAAgB,QAiB3B;AAED;;;GAGG;AACH,MAAM,UAAU,+BAA+B,CAAa,IAK3D;IACA,OAAO,0BAA0B,CAAC;QACjC,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC;QACpF,MAAM,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QAC7D,MAAM,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC;QACzE,WAAW,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC;KACnE,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAa,IAKtD;IACA,OAAO;QACN,GAAG,IAAI;QACP,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM;QACzB,gBAAgB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM;KACpC,CAAC;AACH,CAAC;AAqBD,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IAC1B,6DAAQ,CAAA;IACR,6DAAQ,CAAA;AACT,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ICodecFamily, JsonCodecPart } from \"../../codec/index.js\";\nimport type {\n\tChangeAtomId,\n\tChangeEncodingContext,\n\tDeltaDetachedNodeChanges,\n\tDeltaDetachedNodeId,\n\tDeltaDetachedNodeRename,\n\tDeltaFieldChanges,\n\tDeltaFieldMap,\n\tRevisionMetadataSource,\n\tRevisionReplacer,\n\tRevisionTag,\n\tRevisionTagSchema,\n} from \"../../core/index.js\";\nimport type { IdAllocator, Invariant, RangeQueryResult } from \"../../util/index.js\";\n\nimport type { CrossFieldManager } from \"./crossFieldQueries.js\";\nimport type { EncodedNodeChangeset } from \"./modularChangeFormatV1.js\";\nimport type { CrossFieldKeyRange, NodeId } from \"./modularChangeTypes.js\";\n\nexport type NestedChangesIndices = [\n\tNodeId,\n\tnumber | undefined /* inputIndex */,\n\tnumber | undefined /* outputIndex */,\n][];\n\n/**\n * The return value of calling {@link FieldChangeHandler.intoDelta}.\n */\nexport interface FieldChangeDelta {\n\t/**\n\t * {@inheritdoc DeltaFieldChanges}\n\t */\n\treadonly local?: DeltaFieldChanges;\n\t/**\n\t * {@inheritdoc DeltaRoot.global}\n\t */\n\treadonly global?: readonly DeltaDetachedNodeChanges[];\n\t/**\n\t * {@inheritdoc DeltaRoot.rename}\n\t */\n\treadonly rename?: readonly DeltaDetachedNodeRename[];\n}\n\n/**\n * Functionality provided by a field kind which will be composed with other `FieldChangeHandler`s to\n * implement a unified ChangeFamily supporting documents with multiple field kinds.\n */\nexport interface FieldChangeHandler<\n\tTChangeset,\n\tTEditor extends FieldEditor<TChangeset> = FieldEditor<TChangeset>,\n> {\n\t_typeCheck?: Invariant<TChangeset>;\n\treadonly rebaser: FieldChangeRebaser<TChangeset>;\n\treadonly codecsFactory: (\n\t\trevisionTagCodec: JsonCodecPart<\n\t\t\tRevisionTag,\n\t\t\ttypeof RevisionTagSchema,\n\t\t\tChangeEncodingContext\n\t\t>,\n\t) => ICodecFamily<TChangeset, FieldChangeEncodingContext>;\n\treadonly editor: TEditor;\n\tintoDelta(change: TChangeset, deltaFromChild: ToDelta): FieldChangeDelta;\n\t/**\n\t * Returns the set of removed roots that should be in memory for the given change to be applied.\n\t * A removed root is relevant if any of the following is true:\n\t * - It is being inserted\n\t * - It is being restored\n\t * - It is being edited\n\t * - The ID it is associated with is being changed\n\t *\n\t * Implementations are allowed to be conservative by returning more removed roots than strictly necessary\n\t * (though they should, for the sake of performance, try to avoid doing so).\n\t *\n\t * Implementations are not allowed to return IDs for non-root trees, even if they are removed.\n\t *\n\t * @param change - The change to be applied.\n\t * @param relevantRemovedRootsFromChild - Delegate for collecting relevant removed roots from child changes.\n\t */\n\treadonly relevantRemovedRoots: (\n\t\tchange: TChangeset,\n\t\trelevantRemovedRootsFromChild: RelevantRemovedRootsFromChild,\n\t) => Iterable<DeltaDetachedNodeId>;\n\n\t/**\n\t * Returns whether this change is empty, meaning that it represents no modifications to the field\n\t * and could be removed from the ModularChangeset tree without changing its behavior.\n\t */\n\tisEmpty(change: TChangeset): boolean;\n\n\t/**\n\t * @param change - The field change to get the child changes from.\n\t *\n\t * @returns The set of `NodeId`s that correspond to nested changes in the given `change`.\n\t * Each `NodeId` is associated with the following:\n\t * - index of the node in the field in the input context of the changeset (or `undefined` if the node is not\n\t * attached in the input context).\n\t * - index of the node in the field in the output context of the changeset (or `undefined` if the node is not\n\t * attached in the output context).\n\t * For all returned entries where the index is defined,\n\t * the indices are are ordered from smallest to largest (with no duplicates).\n\t * The returned array is owned by the caller.\n\t */\n\tgetNestedChanges(change: TChangeset): NestedChangesIndices;\n\n\t/**\n\t * @returns A list of all cross-field keys contained in the change.\n\t * This should not include cross-field keys in descendant fields.\n\t */\n\tgetCrossFieldKeys(change: TChangeset): CrossFieldKeyRange[];\n\n\tcreateEmpty(): TChangeset;\n}\n\nexport interface FieldChangeRebaser<TChangeset> {\n\t/**\n\t * Compose a collection of changesets into a single one.\n\t * For each node which has a change in both changesets, `composeChild` must be called\n\t * and the result used as the composite node change.\n\t * Calling `composeChild` when one of the changesets has no node change is unnecessary but tolerated.\n\t * See `ChangeRebaser` for more details.\n\t */\n\tcompose(\n\t\tchange1: TChangeset,\n\t\tchange2: TChangeset,\n\t\tcomposeChild: NodeChangeComposer,\n\t\tgenId: IdAllocator,\n\t\tcrossFieldManager: CrossFieldManager,\n\t\trevisionMetadata: RevisionMetadataSource,\n\t): TChangeset;\n\n\t/**\n\t * @returns the inverse of `changes`.\n\t * See `ChangeRebaser` for details.\n\t */\n\tinvert(\n\t\tchange: TChangeset,\n\t\tisRollback: boolean,\n\t\tgenId: IdAllocator,\n\t\trevision: RevisionTag | undefined,\n\t\tcrossFieldManager: CrossFieldManager,\n\t\trevisionMetadata: RevisionMetadataSource,\n\t): TChangeset;\n\n\t/**\n\t * Rebase `change` over `over`.\n\t * See `ChangeRebaser` for details.\n\t */\n\trebase(\n\t\tchange: TChangeset,\n\t\tover: TChangeset,\n\t\trebaseChild: NodeChangeRebaser,\n\t\tgenId: IdAllocator,\n\t\tcrossFieldManager: CrossFieldManager,\n\t\trevisionMetadata: RebaseRevisionMetadata,\n\t): TChangeset;\n\n\t/**\n\t * @returns `change` with any empty child node changesets removed.\n\t */\n\tprune(change: TChangeset, pruneChild: NodeChangePruner): TChangeset;\n\n\treplaceRevisions(change: TChangeset, replacer: RevisionReplacer): TChangeset;\n\n\t/**\n\t * Returns a copy of the given changeset with edits removed as specified.\n\t * @param change - The change to filter edits from\n\t * @param filterDetach - This should be called for each range of detaches in the changeset,\n\t * and the detach should be preserved, removed, or converted to a non-move detach as specified.\n\t * If the returned result does not cover the entire detach range, the remainder should be queried again.\n\t * @param filterDetach - This should be called for each range of attaches in the changeset,\n\t * and the attach should be preserved, removed, or converted to a non-move attach as specified.\n\t * If the returned result does not cover the entire detach range, the remainder should be queried again.\n\t * @param preserveOtherEdits - Whether edits other than attaches and detaches (e.g. root renames),\n\t * should be preserved or removed.\n\t */\n\tfilterEdits(\n\t\tchange: TChangeset,\n\t\toptions: {\n\t\t\tfilterDetach: EditFilterFunc;\n\t\t\tfilterAttach: EditFilterFunc;\n\t\t\tpreserveOtherEdits: boolean;\n\t\t},\n\t): TChangeset;\n}\n\nexport type EditFilterFunc = (\n\tid: ChangeAtomId,\n\tcount: number,\n\tendpoint?: ChangeAtomId,\n) => RangeQueryResult<EditFilterStatus>;\n\n/**\n * Used to describe what should be done with a particular attach or detach during `filterEdits`.\n */\nexport enum EditFilterStatus {\n\t/**\n\t * The edit should be removed from the filtered changeset.\n\t */\n\tRemove,\n\n\t/**\n\t * The edit should be preserved in the filtered changeset.\n\t */\n\tPreserve,\n\n\t/**\n\t * This should only be used for an attach or detach which is part of a move.\n\t * The edit should be preserved, but should be adjusted, if necessary,\n\t * to reflect that the other endpoint of the move has been filtered out.\n\t */\n\tPreserveWithoutMove,\n}\n\n/**\n * Helper for creating a {@link FieldChangeRebaser} which does not need access to revision tags.\n * This should only be used for fields where the child nodes cannot be edited.\n */\nexport function referenceFreeFieldChangeRebaser<TChangeset>(data: {\n\tcompose: (change1: TChangeset, change2: TChangeset) => TChangeset;\n\tinvert: (change: TChangeset) => TChangeset;\n\trebase: (change: TChangeset, over: TChangeset) => TChangeset;\n\tfilterEdits: FieldChangeRebaser<TChangeset>[\"filterEdits\"];\n}): FieldChangeRebaser<TChangeset> {\n\treturn isolatedFieldChangeRebaser({\n\t\tcompose: (change1, change2, _composeChild, _genId) => data.compose(change1, change2),\n\t\tinvert: (change, _invertChild, _genId) => data.invert(change),\n\t\trebase: (change, over, _rebaseChild, _genId) => data.rebase(change, over),\n\t\tfilterEdits: (change, options) => data.filterEdits(change, options),\n\t});\n}\n\nexport function isolatedFieldChangeRebaser<TChangeset>(data: {\n\tcompose: FieldChangeRebaser<TChangeset>[\"compose\"];\n\tinvert: FieldChangeRebaser<TChangeset>[\"invert\"];\n\trebase: FieldChangeRebaser<TChangeset>[\"rebase\"];\n\tfilterEdits: FieldChangeRebaser<TChangeset>[\"filterEdits\"];\n}): FieldChangeRebaser<TChangeset> {\n\treturn {\n\t\t...data,\n\t\tprune: (change) => change,\n\t\treplaceRevisions: (change) => change,\n\t};\n}\n\nexport interface FieldEditor<TChangeset> {\n\t/**\n\t * Creates a changeset which represents the given changes to the children of this editor's field.\n\t * For each element in the given iterable\n\t * - The number represents the index of the child node in the field.\n\t * - The `NodeId` represents the nested changes for that child node.\n\t * Note: The indices in the iterable must be ordered from smallest to largest (with no duplicates).\n\t */\n\tbuildChildChanges(changes: Iterable<[index: number, change: NodeId]>): TChangeset;\n}\n\n/**\n * The `index` represents the index of the child node in the input context.\n * The `index` should be `undefined` iff the child node does not exist in the input context (e.g., an inserted node).\n */\nexport type ToDelta = (child: NodeId) => DeltaFieldMap;\n\nexport type NodeChangeInverter = (change: NodeId) => NodeId;\n\nexport enum NodeAttachState {\n\tAttached,\n\tDetached,\n}\n\nexport type NodeChangeRebaser = (\n\tchange: NodeId | undefined,\n\tbaseChange: NodeId | undefined,\n\t/**\n\t * Whether the node is attached to this field in the output context of the base change.\n\t * Defaults to attached if undefined.\n\t */\n\tstate?: NodeAttachState,\n) => NodeId | undefined;\n\nexport type NodeChangeComposer = (\n\tchange1: NodeId | undefined,\n\tchange2: NodeId | undefined,\n) => NodeId;\n\nexport type NodeChangePruner = (change: NodeId) => NodeId | undefined;\n\n/**\n * A function that returns the set of removed roots that should be in memory for a given node changeset to be applied.\n */\nexport type RelevantRemovedRootsFromChild = (child: NodeId) => Iterable<DeltaDetachedNodeId>;\n\nexport interface RebaseRevisionMetadata extends RevisionMetadataSource {\n\treadonly getRevisionToRebase: () => RevisionTag | undefined;\n\treadonly getBaseRevisions: () => RevisionTag[];\n}\n\nexport interface FieldChangeEncodingContext {\n\treadonly baseContext: ChangeEncodingContext;\n\tencodeNode(nodeId: NodeId): EncodedNodeChangeset;\n\tdecodeNode(encodedNode: EncodedNodeChangeset): NodeId;\n}\n"]}
1
+ {"version":3,"file":"fieldChangeHandler.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldChangeHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkMH;;GAEG;AACH,MAAM,CAAN,IAAY,gBAiBX;AAjBD,WAAY,gBAAgB;IAC3B;;OAEG;IACH,2DAAM,CAAA;IAEN;;OAEG;IACH,+DAAQ,CAAA;IAER;;;;OAIG;IACH,qFAAmB,CAAA;AACpB,CAAC,EAjBW,gBAAgB,KAAhB,gBAAgB,QAiB3B;AAED;;;GAGG;AACH,MAAM,UAAU,+BAA+B,CAAa,IAK3D;IACA,OAAO,0BAA0B,CAAC;QACjC,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC;QACpF,MAAM,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QAC7D,MAAM,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC;QACzE,WAAW,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC;KACnE,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAa,IAKtD;IACA,OAAO;QACN,GAAG,IAAI;QACP,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM;QACzB,gBAAgB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM;KACpC,CAAC;AACH,CAAC;AAqBD,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IAC1B,6DAAQ,CAAA;IACR,6DAAQ,CAAA;AACT,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ICodecFamily, JsonCodecPart } from \"../../codec/index.js\";\nimport type {\n\tChangeAtomId,\n\tChangeEncodingContext,\n\tDeltaDetachedNodeChanges,\n\tDeltaDetachedNodeId,\n\tDeltaDetachedNodeRename,\n\tDeltaFieldChanges,\n\tDeltaFieldMap,\n\tRevisionMetadataSource,\n\tRevisionReplacer,\n\tRevisionTag,\n\tRevisionTagSchema,\n} from \"../../core/index.js\";\nimport type { IdAllocator, Invariant, RangeQueryResult } from \"../../util/index.js\";\n\nimport type { CrossFieldManager } from \"./crossFieldQueries.js\";\nimport type { EncodedNodeChangeset } from \"./modularChangeFormatV1.js\";\nimport type { CrossFieldKeyRange, NodeId } from \"./modularChangeTypes.js\";\n\nexport type NestedChangesIndices = [\n\tNodeId,\n\tnumber | undefined /* inputIndex */,\n\tnumber | undefined /* outputIndex */,\n][];\n\n/**\n * The return value of calling {@link FieldChangeHandler.intoDelta}.\n */\nexport interface FieldChangeDelta {\n\t/**\n\t * {@inheritdoc DeltaFieldChanges}\n\t */\n\treadonly local?: DeltaFieldChanges;\n\t/**\n\t * {@inheritdoc DeltaRoot.global}\n\t */\n\treadonly global?: readonly DeltaDetachedNodeChanges[];\n\t/**\n\t * {@inheritdoc DeltaRoot.rename}\n\t */\n\treadonly rename?: readonly DeltaDetachedNodeRename[];\n}\n\n/**\n * Functionality provided by a field kind which will be composed with other `FieldChangeHandler`s to\n * implement a unified ChangeFamily supporting documents with multiple field kinds.\n */\nexport interface FieldChangeHandler<\n\tTChangeset,\n\tTEditor extends FieldEditor<TChangeset> = FieldEditor<TChangeset>,\n> {\n\t_typeCheck?: Invariant<TChangeset>;\n\treadonly rebaser: FieldChangeRebaser<TChangeset>;\n\treadonly codecsFactory: (\n\t\trevisionTagCodec: JsonCodecPart<\n\t\t\tRevisionTag,\n\t\t\ttypeof RevisionTagSchema,\n\t\t\tChangeEncodingContext\n\t\t>,\n\t) => ICodecFamily<TChangeset, FieldChangeEncodingContext, FieldChangeDecodingContext>;\n\treadonly editor: TEditor;\n\tintoDelta(change: TChangeset, deltaFromChild: ToDelta): FieldChangeDelta;\n\t/**\n\t * Returns the set of removed roots that should be in memory for the given change to be applied.\n\t * A removed root is relevant if any of the following is true:\n\t * - It is being inserted\n\t * - It is being restored\n\t * - It is being edited\n\t * - The ID it is associated with is being changed\n\t *\n\t * Implementations are allowed to be conservative by returning more removed roots than strictly necessary\n\t * (though they should, for the sake of performance, try to avoid doing so).\n\t *\n\t * Implementations are not allowed to return IDs for non-root trees, even if they are removed.\n\t *\n\t * @param change - The change to be applied.\n\t * @param relevantRemovedRootsFromChild - Delegate for collecting relevant removed roots from child changes.\n\t */\n\treadonly relevantRemovedRoots: (\n\t\tchange: TChangeset,\n\t\trelevantRemovedRootsFromChild: RelevantRemovedRootsFromChild,\n\t) => Iterable<DeltaDetachedNodeId>;\n\n\t/**\n\t * Returns whether this change is empty, meaning that it represents no modifications to the field\n\t * and could be removed from the ModularChangeset tree without changing its behavior.\n\t */\n\tisEmpty(change: TChangeset): boolean;\n\n\t/**\n\t * @param change - The field change to get the child changes from.\n\t *\n\t * @returns The set of `NodeId`s that correspond to nested changes in the given `change`.\n\t * Each `NodeId` is associated with the following:\n\t * - index of the node in the field in the input context of the changeset (or `undefined` if the node is not\n\t * attached in the input context).\n\t * - index of the node in the field in the output context of the changeset (or `undefined` if the node is not\n\t * attached in the output context).\n\t * For all returned entries where the index is defined,\n\t * the indices are are ordered from smallest to largest (with no duplicates).\n\t * The returned array is owned by the caller.\n\t */\n\tgetNestedChanges(change: TChangeset): NestedChangesIndices;\n\n\t/**\n\t * @returns A list of all cross-field keys contained in the change.\n\t * This should not include cross-field keys in descendant fields.\n\t */\n\tgetCrossFieldKeys(change: TChangeset): CrossFieldKeyRange[];\n\n\tcreateEmpty(): TChangeset;\n}\n\nexport interface FieldChangeRebaser<TChangeset> {\n\t/**\n\t * Compose a collection of changesets into a single one.\n\t * For each node which has a change in both changesets, `composeChild` must be called\n\t * and the result used as the composite node change.\n\t * Calling `composeChild` when one of the changesets has no node change is unnecessary but tolerated.\n\t * See `ChangeRebaser` for more details.\n\t */\n\tcompose(\n\t\tchange1: TChangeset,\n\t\tchange2: TChangeset,\n\t\tcomposeChild: NodeChangeComposer,\n\t\tgenId: IdAllocator,\n\t\tcrossFieldManager: CrossFieldManager,\n\t\trevisionMetadata: RevisionMetadataSource,\n\t): TChangeset;\n\n\t/**\n\t * @returns the inverse of `changes`.\n\t * See `ChangeRebaser` for details.\n\t */\n\tinvert(\n\t\tchange: TChangeset,\n\t\tisRollback: boolean,\n\t\tgenId: IdAllocator,\n\t\trevision: RevisionTag | undefined,\n\t\tcrossFieldManager: CrossFieldManager,\n\t\trevisionMetadata: RevisionMetadataSource,\n\t): TChangeset;\n\n\t/**\n\t * Rebase `change` over `over`.\n\t * See `ChangeRebaser` for details.\n\t */\n\trebase(\n\t\tchange: TChangeset,\n\t\tover: TChangeset,\n\t\trebaseChild: NodeChangeRebaser,\n\t\tgenId: IdAllocator,\n\t\tcrossFieldManager: CrossFieldManager,\n\t\trevisionMetadata: RebaseRevisionMetadata,\n\t): TChangeset;\n\n\t/**\n\t * @returns `change` with any empty child node changesets removed.\n\t */\n\tprune(change: TChangeset, pruneChild: NodeChangePruner): TChangeset;\n\n\treplaceRevisions(change: TChangeset, replacer: RevisionReplacer): TChangeset;\n\n\t/**\n\t * Returns a copy of the given changeset with edits removed as specified.\n\t * @param change - The change to filter edits from\n\t * @param filterDetach - This should be called for each range of detaches in the changeset,\n\t * and the detach should be preserved, removed, or converted to a non-move detach as specified.\n\t * If the returned result does not cover the entire detach range, the remainder should be queried again.\n\t * @param filterDetach - This should be called for each range of attaches in the changeset,\n\t * and the attach should be preserved, removed, or converted to a non-move attach as specified.\n\t * If the returned result does not cover the entire detach range, the remainder should be queried again.\n\t * @param preserveOtherEdits - Whether edits other than attaches and detaches (e.g. root renames),\n\t * should be preserved or removed.\n\t */\n\tfilterEdits(\n\t\tchange: TChangeset,\n\t\toptions: {\n\t\t\tfilterDetach: EditFilterFunc;\n\t\t\tfilterAttach: EditFilterFunc;\n\t\t\tpreserveOtherEdits: boolean;\n\t\t},\n\t): TChangeset;\n}\n\nexport type EditFilterFunc = (\n\tid: ChangeAtomId,\n\tcount: number,\n\tendpoint?: ChangeAtomId,\n) => RangeQueryResult<EditFilterStatus>;\n\n/**\n * Used to describe what should be done with a particular attach or detach during `filterEdits`.\n */\nexport enum EditFilterStatus {\n\t/**\n\t * The edit should be removed from the filtered changeset.\n\t */\n\tRemove,\n\n\t/**\n\t * The edit should be preserved in the filtered changeset.\n\t */\n\tPreserve,\n\n\t/**\n\t * This should only be used for an attach or detach which is part of a move.\n\t * The edit should be preserved, but should be adjusted, if necessary,\n\t * to reflect that the other endpoint of the move has been filtered out.\n\t */\n\tPreserveWithoutMove,\n}\n\n/**\n * Helper for creating a {@link FieldChangeRebaser} which does not need access to revision tags.\n * This should only be used for fields where the child nodes cannot be edited.\n */\nexport function referenceFreeFieldChangeRebaser<TChangeset>(data: {\n\tcompose: (change1: TChangeset, change2: TChangeset) => TChangeset;\n\tinvert: (change: TChangeset) => TChangeset;\n\trebase: (change: TChangeset, over: TChangeset) => TChangeset;\n\tfilterEdits: FieldChangeRebaser<TChangeset>[\"filterEdits\"];\n}): FieldChangeRebaser<TChangeset> {\n\treturn isolatedFieldChangeRebaser({\n\t\tcompose: (change1, change2, _composeChild, _genId) => data.compose(change1, change2),\n\t\tinvert: (change, _invertChild, _genId) => data.invert(change),\n\t\trebase: (change, over, _rebaseChild, _genId) => data.rebase(change, over),\n\t\tfilterEdits: (change, options) => data.filterEdits(change, options),\n\t});\n}\n\nexport function isolatedFieldChangeRebaser<TChangeset>(data: {\n\tcompose: FieldChangeRebaser<TChangeset>[\"compose\"];\n\tinvert: FieldChangeRebaser<TChangeset>[\"invert\"];\n\trebase: FieldChangeRebaser<TChangeset>[\"rebase\"];\n\tfilterEdits: FieldChangeRebaser<TChangeset>[\"filterEdits\"];\n}): FieldChangeRebaser<TChangeset> {\n\treturn {\n\t\t...data,\n\t\tprune: (change) => change,\n\t\treplaceRevisions: (change) => change,\n\t};\n}\n\nexport interface FieldEditor<TChangeset> {\n\t/**\n\t * Creates a changeset which represents the given changes to the children of this editor's field.\n\t * For each element in the given iterable\n\t * - The number represents the index of the child node in the field.\n\t * - The `NodeId` represents the nested changes for that child node.\n\t * Note: The indices in the iterable must be ordered from smallest to largest (with no duplicates).\n\t */\n\tbuildChildChanges(changes: Iterable<[index: number, change: NodeId]>): TChangeset;\n}\n\n/**\n * The `index` represents the index of the child node in the input context.\n * The `index` should be `undefined` iff the child node does not exist in the input context (e.g., an inserted node).\n */\nexport type ToDelta = (child: NodeId) => DeltaFieldMap;\n\nexport type NodeChangeInverter = (change: NodeId) => NodeId;\n\nexport enum NodeAttachState {\n\tAttached,\n\tDetached,\n}\n\nexport type NodeChangeRebaser = (\n\tchange: NodeId | undefined,\n\tbaseChange: NodeId | undefined,\n\t/**\n\t * Whether the node is attached to this field in the output context of the base change.\n\t * Defaults to attached if undefined.\n\t */\n\tstate?: NodeAttachState,\n) => NodeId | undefined;\n\nexport type NodeChangeComposer = (\n\tchange1: NodeId | undefined,\n\tchange2: NodeId | undefined,\n) => NodeId;\n\nexport type NodeChangePruner = (change: NodeId) => NodeId | undefined;\n\n/**\n * A function that returns the set of removed roots that should be in memory for a given node changeset to be applied.\n */\nexport type RelevantRemovedRootsFromChild = (child: NodeId) => Iterable<DeltaDetachedNodeId>;\n\nexport interface RebaseRevisionMetadata extends RevisionMetadataSource {\n\treadonly getRevisionToRebase: () => RevisionTag | undefined;\n\treadonly getBaseRevisions: () => RevisionTag[];\n}\n\nexport interface FieldChangeEncodingContext {\n\treadonly baseContext: ChangeEncodingContext;\n\tencodeNode(nodeId: NodeId): EncodedNodeChangeset;\n}\n\n/**\n * Context provided to field change codecs when decoding.\n * @remarks\n * The decode-side counterpart of {@link FieldChangeEncodingContext}.\n */\nexport interface FieldChangeDecodingContext {\n\treadonly baseContext: ChangeEncodingContext;\n\tdecodeNode(encodedNode: EncodedNodeChangeset): NodeId;\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { type ICodecFamily } from "../../codec/index.js";
6
- import type { FieldChangeEncodingContext } from "./fieldChangeHandler.js";
6
+ import type { FieldChangeEncodingContext, FieldChangeDecodingContext } from "./fieldChangeHandler.js";
7
7
  import { type GenericChangeset } from "./genericFieldKindTypes.js";
8
- export declare function makeGenericChangeCodec(): ICodecFamily<GenericChangeset, FieldChangeEncodingContext>;
8
+ export declare function makeGenericChangeCodec(): ICodecFamily<GenericChangeset, FieldChangeEncodingContext, FieldChangeDecodingContext>;
9
9
  //# sourceMappingURL=genericFieldKindCodecs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"genericFieldKindCodecs.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/genericFieldKindCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,YAAY,EAAoC,MAAM,sBAAsB,CAAC;AAE3F,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAE1E,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAGxF,wBAAgB,sBAAsB,IAAI,YAAY,CACrD,gBAAgB,EAChB,0BAA0B,CAC1B,CAEA"}
1
+ {"version":3,"file":"genericFieldKindCodecs.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/genericFieldKindCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,YAAY,EAAoC,MAAM,sBAAsB,CAAC;AAE3F,OAAO,KAAK,EACX,0BAA0B,EAC1B,0BAA0B,EAC1B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAGxF,wBAAgB,sBAAsB,IAAI,YAAY,CACrD,gBAAgB,EAChB,0BAA0B,EAC1B,0BAA0B,CAC1B,CAEA"}
@@ -1 +1 @@
1
- {"version":3,"file":"genericFieldKindCodecs.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/genericFieldKindCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAsC,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG3F,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAyB,MAAM,4BAA4B,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,MAAM,UAAU,sBAAsB;IAIrC,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;AAC9C,CAAC;AAED,SAAS,WAAW;IAMnB,OAAO;QACN,MAAM,EAAE,CACP,MAAwB,EACxB,OAAmC,EACT,EAAE;YAC5B,MAAM,OAAO,GAA4B,MAAM;iBAC7C,OAAO,EAAE;iBACT,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YACxE,OAAO,OAAO,CAAC;QAChB,CAAC;QACD,MAAM,EAAE,CACP,OAAgC,EAChC,OAAmC,EAChB,EAAE;YACrB,OAAO,mBAAmB,CACzB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAC7E,CAAC;QACH,CAAC;QACD,aAAa,EAAE,uBAAuB,CAAC,oBAAoB,CAAC;KAC5D,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ICodecFamily, type IJsonCodec, makeCodecFamily } from \"../../codec/index.js\";\n\nimport type { FieldChangeEncodingContext } from \"./fieldChangeHandler.js\";\nimport { EncodedGenericChangeset } from \"./genericFieldKindFormat.js\";\nimport { newGenericChangeset, type GenericChangeset } from \"./genericFieldKindTypes.js\";\nimport { EncodedNodeChangeset } from \"./modularChangeFormatV1.js\";\n\nexport function makeGenericChangeCodec(): ICodecFamily<\n\tGenericChangeset,\n\tFieldChangeEncodingContext\n> {\n\treturn makeCodecFamily([[1, makeV1Codec()]]);\n}\n\nfunction makeV1Codec(): IJsonCodec<\n\tGenericChangeset,\n\tEncodedGenericChangeset,\n\tEncodedGenericChangeset,\n\tFieldChangeEncodingContext\n> {\n\treturn {\n\t\tencode: (\n\t\t\tchange: GenericChangeset,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): EncodedGenericChangeset => {\n\t\t\tconst encoded: EncodedGenericChangeset = change\n\t\t\t\t.toArray()\n\t\t\t\t.map(([index, nodeChange]) => [index, context.encodeNode(nodeChange)]);\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: (\n\t\t\tencoded: EncodedGenericChangeset,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): GenericChangeset => {\n\t\t\treturn newGenericChangeset(\n\t\t\t\tencoded.map(([index, nodeChange]) => [index, context.decodeNode(nodeChange)]),\n\t\t\t);\n\t\t},\n\t\tencodedSchema: EncodedGenericChangeset(EncodedNodeChangeset),\n\t};\n}\n"]}
1
+ {"version":3,"file":"genericFieldKindCodecs.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/genericFieldKindCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAsC,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAM3F,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAyB,MAAM,4BAA4B,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,MAAM,UAAU,sBAAsB;IAKrC,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;AAC9C,CAAC;AAED,SAAS,WAAW;IAOnB,OAAO;QACN,MAAM,EAAE,CACP,MAAwB,EACxB,OAAmC,EACT,EAAE;YAC5B,MAAM,OAAO,GAA4B,MAAM;iBAC7C,OAAO,EAAE;iBACT,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YACxE,OAAO,OAAO,CAAC;QAChB,CAAC;QACD,MAAM,EAAE,CACP,OAAgC,EAChC,OAAmC,EAChB,EAAE;YACrB,OAAO,mBAAmB,CACzB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAC7E,CAAC;QACH,CAAC;QACD,aAAa,EAAE,uBAAuB,CAAC,oBAAoB,CAAC;KAC5D,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ICodecFamily, type IJsonCodec, makeCodecFamily } from \"../../codec/index.js\";\n\nimport type {\n\tFieldChangeEncodingContext,\n\tFieldChangeDecodingContext,\n} from \"./fieldChangeHandler.js\";\nimport { EncodedGenericChangeset } from \"./genericFieldKindFormat.js\";\nimport { newGenericChangeset, type GenericChangeset } from \"./genericFieldKindTypes.js\";\nimport { EncodedNodeChangeset } from \"./modularChangeFormatV1.js\";\n\nexport function makeGenericChangeCodec(): ICodecFamily<\n\tGenericChangeset,\n\tFieldChangeEncodingContext,\n\tFieldChangeDecodingContext\n> {\n\treturn makeCodecFamily([[1, makeV1Codec()]]);\n}\n\nfunction makeV1Codec(): IJsonCodec<\n\tGenericChangeset,\n\tEncodedGenericChangeset,\n\tEncodedGenericChangeset,\n\tFieldChangeEncodingContext,\n\tFieldChangeDecodingContext\n> {\n\treturn {\n\t\tencode: (\n\t\t\tchange: GenericChangeset,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): EncodedGenericChangeset => {\n\t\t\tconst encoded: EncodedGenericChangeset = change\n\t\t\t\t.toArray()\n\t\t\t\t.map(([index, nodeChange]) => [index, context.encodeNode(nodeChange)]);\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: (\n\t\t\tencoded: EncodedGenericChangeset,\n\t\t\tcontext: FieldChangeDecodingContext,\n\t\t): GenericChangeset => {\n\t\t\treturn newGenericChangeset(\n\t\t\t\tencoded.map(([index, nodeChange]) => [index, context.decodeNode(nodeChange)]),\n\t\t\t);\n\t\t},\n\t\tencodedSchema: EncodedGenericChangeset(EncodedNodeChangeset),\n\t};\n}\n"]}
@@ -8,7 +8,7 @@ export { addCrossFieldQuery, type CrossFieldManager, type CrossFieldMap, type Cr
8
8
  export { ChangesetLocalIdSchema, EncodedChangeAtomId, EncodedRevisionInfo, EncodedModularChangesetV1, EncodedNodeChangeset, } from "./modularChangeFormatV1.js";
9
9
  export { EncodedModularChangesetV2 } from "./modularChangeFormatV2.js";
10
10
  export { FlexFieldKind, type FullSchemaPolicy } from "./fieldKind.js";
11
- export { type EditFilterFunc, EditFilterStatus, type FieldChangeHandler, type FieldChangeDelta, type FieldChangeEncodingContext, type FieldChangeRebaser, type FieldEditor, type NestedChangesIndices, type NodeChangeComposer, type NodeChangeInverter, type NodeChangeRebaser, type NodeChangePruner, referenceFreeFieldChangeRebaser, type RebaseRevisionMetadata, type RelevantRemovedRootsFromChild, type ToDelta, NodeAttachState, } from "./fieldChangeHandler.js";
11
+ export { type EditFilterFunc, EditFilterStatus, type FieldChangeHandler, type FieldChangeDelta, type FieldChangeEncodingContext, type FieldChangeDecodingContext, type FieldChangeRebaser, type FieldEditor, type NestedChangesIndices, type NodeChangeComposer, type NodeChangeInverter, type NodeChangeRebaser, type NodeChangePruner, referenceFreeFieldChangeRebaser, type RebaseRevisionMetadata, type RelevantRemovedRootsFromChild, type ToDelta, NodeAttachState, } from "./fieldChangeHandler.js";
12
12
  export type { CrossFieldKey, CrossFieldKeyRange, FieldChange, FieldChangeMap, FieldChangeset, HasFieldChanges, ModularChangeset, NoChangeConstraint, NodeExistsConstraint, NodeId, } from "./modularChangeTypes.js";
13
13
  export { convertGenericChange, genericChangeHandler, genericFieldKind, } from "./genericFieldKind.js";
14
14
  export type { GenericChangeset } from "./genericFieldKindTypes.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,kCAAkC,EAClC,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,GAC1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACN,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,gBAAgB,EAChB,kBAAkB,GAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,oBAAoB,GACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EACN,KAAK,cAAc,EACnB,gBAAgB,EAChB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,+BAA+B,EAC/B,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,KAAK,OAAO,EACZ,eAAe,GACf,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACX,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,MAAM,GACN,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EACN,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,8BAA8B,EAC9B,SAAS,EACT,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,0BAA0B,EAC1B,4BAA4B,GAC5B,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACX,sBAAsB,EACtB,2BAA2B,GAC3B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,kCAAkC,EAClC,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,GAC1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACN,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,gBAAgB,EAChB,kBAAkB,GAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,oBAAoB,GACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,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,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,kCAAkC,EAClC,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,GAC1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACN,kBAAkB,EAIlB,gBAAgB,EAChB,kBAAkB,GAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,oBAAoB,GACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAyB,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAEN,gBAAgB,EAWhB,+BAA+B,EAI/B,eAAe,GACf,MAAM,yBAAyB,CAAC;AAajC,OAAO,EACN,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACN,mBAAmB,EACnB,kBAAkB,EAIlB,8BAA8B,EAC9B,SAAS,EACT,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,0BAA0B,EAC1B,4BAA4B,GAC5B,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tallowsRepoSuperset,\n\tallowsTreeSchemaIdentifierSuperset,\n\tallowsFieldSuperset,\n\tallowsTreeSuperset,\n\tallowsMultiplicitySuperset,\n} from \"./comparison.js\";\nexport { isNeverField, isNeverTree } from \"./isNeverTree.js\";\nexport {\n\taddCrossFieldQuery,\n\ttype CrossFieldManager,\n\ttype CrossFieldMap,\n\ttype CrossFieldQuerySet,\n\tCrossFieldTarget,\n\tsetInCrossFieldMap,\n} from \"./crossFieldQueries.js\";\nexport {\n\tChangesetLocalIdSchema,\n\tEncodedChangeAtomId,\n\tEncodedRevisionInfo,\n\tEncodedModularChangesetV1,\n\tEncodedNodeChangeset,\n} from \"./modularChangeFormatV1.js\";\nexport { EncodedModularChangesetV2 } from \"./modularChangeFormatV2.js\";\nexport { FlexFieldKind, type FullSchemaPolicy } from \"./fieldKind.js\";\nexport {\n\ttype EditFilterFunc,\n\tEditFilterStatus,\n\ttype FieldChangeHandler,\n\ttype FieldChangeDelta,\n\ttype FieldChangeEncodingContext,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype NestedChangesIndices,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\treferenceFreeFieldChangeRebaser,\n\ttype RebaseRevisionMetadata,\n\ttype RelevantRemovedRootsFromChild,\n\ttype ToDelta,\n\tNodeAttachState,\n} from \"./fieldChangeHandler.js\";\nexport type {\n\tCrossFieldKey,\n\tCrossFieldKeyRange,\n\tFieldChange,\n\tFieldChangeMap,\n\tFieldChangeset,\n\tHasFieldChanges,\n\tModularChangeset,\n\tNoChangeConstraint,\n\tNodeExistsConstraint,\n\tNodeId,\n} from \"./modularChangeTypes.js\";\nexport {\n\tconvertGenericChange,\n\tgenericChangeHandler,\n\tgenericFieldKind,\n} from \"./genericFieldKind.js\";\nexport type { GenericChangeset } from \"./genericFieldKindTypes.js\";\nexport {\n\tModularChangeFamily,\n\tModularEditBuilder,\n\ttype EditDescription,\n\ttype GlobalEditDescription,\n\ttype FieldEditDescription,\n\trebaseRevisionMetadataFromInfo,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tupdateRefreshers,\n} from \"./modularChangeFamily.js\";\nexport {\n\tModularChangeFormatVersion,\n\tmakeModularChangeCodecFamily,\n} from \"./modularChangeCodecs.js\";\nexport type {\n\tFieldKindConfiguration,\n\tFieldKindConfigurationEntry,\n} from \"./fieldKindConfiguration.js\";\nexport { DefaultRevisionReplacer } from \"./defaultRevisionReplacer.js\";\nexport { minimizeModularChangeset } from \"./minimizeModularChange.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,kCAAkC,EAClC,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,GAC1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACN,kBAAkB,EAIlB,gBAAgB,EAChB,kBAAkB,GAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,oBAAoB,GACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAyB,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAEN,gBAAgB,EAYhB,+BAA+B,EAI/B,eAAe,GACf,MAAM,yBAAyB,CAAC;AAajC,OAAO,EACN,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACN,mBAAmB,EACnB,kBAAkB,EAIlB,8BAA8B,EAC9B,SAAS,EACT,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,0BAA0B,EAC1B,4BAA4B,GAC5B,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tallowsRepoSuperset,\n\tallowsTreeSchemaIdentifierSuperset,\n\tallowsFieldSuperset,\n\tallowsTreeSuperset,\n\tallowsMultiplicitySuperset,\n} from \"./comparison.js\";\nexport { isNeverField, isNeverTree } from \"./isNeverTree.js\";\nexport {\n\taddCrossFieldQuery,\n\ttype CrossFieldManager,\n\ttype CrossFieldMap,\n\ttype CrossFieldQuerySet,\n\tCrossFieldTarget,\n\tsetInCrossFieldMap,\n} from \"./crossFieldQueries.js\";\nexport {\n\tChangesetLocalIdSchema,\n\tEncodedChangeAtomId,\n\tEncodedRevisionInfo,\n\tEncodedModularChangesetV1,\n\tEncodedNodeChangeset,\n} from \"./modularChangeFormatV1.js\";\nexport { EncodedModularChangesetV2 } from \"./modularChangeFormatV2.js\";\nexport { FlexFieldKind, type FullSchemaPolicy } from \"./fieldKind.js\";\nexport {\n\ttype EditFilterFunc,\n\tEditFilterStatus,\n\ttype FieldChangeHandler,\n\ttype FieldChangeDelta,\n\ttype FieldChangeEncodingContext,\n\ttype FieldChangeDecodingContext,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype NestedChangesIndices,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\treferenceFreeFieldChangeRebaser,\n\ttype RebaseRevisionMetadata,\n\ttype RelevantRemovedRootsFromChild,\n\ttype ToDelta,\n\tNodeAttachState,\n} from \"./fieldChangeHandler.js\";\nexport type {\n\tCrossFieldKey,\n\tCrossFieldKeyRange,\n\tFieldChange,\n\tFieldChangeMap,\n\tFieldChangeset,\n\tHasFieldChanges,\n\tModularChangeset,\n\tNoChangeConstraint,\n\tNodeExistsConstraint,\n\tNodeId,\n} from \"./modularChangeTypes.js\";\nexport {\n\tconvertGenericChange,\n\tgenericChangeHandler,\n\tgenericFieldKind,\n} from \"./genericFieldKind.js\";\nexport type { GenericChangeset } from \"./genericFieldKindTypes.js\";\nexport {\n\tModularChangeFamily,\n\tModularEditBuilder,\n\ttype EditDescription,\n\ttype GlobalEditDescription,\n\ttype FieldEditDescription,\n\trebaseRevisionMetadataFromInfo,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tupdateRefreshers,\n} from \"./modularChangeFamily.js\";\nexport {\n\tModularChangeFormatVersion,\n\tmakeModularChangeCodecFamily,\n} from \"./modularChangeCodecs.js\";\nexport type {\n\tFieldKindConfiguration,\n\tFieldKindConfigurationEntry,\n} from \"./fieldKindConfiguration.js\";\nexport { DefaultRevisionReplacer } from \"./defaultRevisionReplacer.js\";\nexport { minimizeModularChangeset } from \"./minimizeModularChange.js\";\n"]}
@@ -0,0 +1,15 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { type FieldKindIdentifier, type RevisionTag, type TaggedChange } from "../../core/index.js";
6
+ import { type ModularChangeset } from "./modularChangeTypes.js";
7
+ import type { FlexFieldKind } from "./fieldKind.js";
8
+ /**
9
+ * @param change - The change to invert.
10
+ * @param isRollback - Whether the inverted change is meant to rollback a change on a branch as is the case when
11
+ * performing a sandwich rebase.
12
+ * @param revisionForInvert - The revision for the invert changeset.
13
+ */
14
+ export declare function invertModularChange(change: TaggedChange<ModularChangeset>, isRollback: boolean, revisionForInvert: RevisionTag, fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>): ModularChangeset;
15
+ //# sourceMappingURL=invert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invert.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/invert.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAIN,KAAK,mBAAmB,EAGxB,KAAK,WAAW,EAChB,KAAK,YAAY,EAEjB,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAMN,KAAK,gBAAgB,EAGrB,MAAM,yBAAyB,CAAC;AAajC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGpD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,YAAY,CAAC,gBAAgB,CAAC,EACtC,UAAU,EAAE,OAAO,EACnB,iBAAiB,EAAE,WAAW,EAC9B,UAAU,EAAE,WAAW,CAAC,mBAAmB,EAAE,aAAa,CAAC,GACzD,gBAAgB,CA+GlB"}
@@ -0,0 +1,155 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { assert } from "@fluidframework/core-utils/internal";
6
+ import { revisionMetadataSourceFromInfo, } from "../../core/index.js";
7
+ import { brand, idAllocatorFromMaxId } from "../../util/index.js";
8
+ import { newChangeAtomIdBTree, setInChangeAtomIdMap, } from "../changeAtomIdBTree.js";
9
+ import { newCrossFieldKeyTable, } from "./modularChangeTypes.js";
10
+ import { CrossFieldManagerI, getChangeHandler, getRevInfoFromTaggedChanges, hasConflicts, makeModularChangeset, newConstraintState, newCrossFieldTable, updateConstraintsForFields, } from "./modularChangeUtils.js";
11
+ import { NodeAttachState } from "./fieldChangeHandler.js";
12
+ /**
13
+ * @param change - The change to invert.
14
+ * @param isRollback - Whether the inverted change is meant to rollback a change on a branch as is the case when
15
+ * performing a sandwich rebase.
16
+ * @param revisionForInvert - The revision for the invert changeset.
17
+ */
18
+ export function invertModularChange(change, isRollback, revisionForInvert, fieldKinds) {
19
+ // Rollback changesets destroy the nodes created by the change being rolled back.
20
+ const destroys = isRollback ? invertBuilds(change.change.builds) : undefined;
21
+ // Destroys only occur in rollback changesets, which are never inverted.
22
+ assert(change.change.destroys === undefined, 0x89a /* Unexpected destroys in change to invert */);
23
+ const revInfos = isRollback
24
+ ? [{ revision: revisionForInvert, rollbackOf: change.revision }]
25
+ : [{ revision: revisionForInvert }];
26
+ const noChangeConstraint = change.change.noChangeConstraintOnRevert;
27
+ const noChangeConstraintOnRevert = change.change.noChangeConstraint;
28
+ if (hasConflicts(change.change)) {
29
+ return makeModularChangeset({
30
+ maxId: change.change.maxId,
31
+ revisions: revInfos,
32
+ destroys,
33
+ });
34
+ }
35
+ const genId = idAllocatorFromMaxId(change.change.maxId ?? -1);
36
+ const crossFieldTable = {
37
+ ...newCrossFieldTable(),
38
+ originalFieldToContext: new Map(),
39
+ invertedNodeToParent: brand(change.change.nodeToParent.clone()),
40
+ };
41
+ const { revInfos: oldRevInfos } = getRevInfoFromTaggedChanges([change]);
42
+ const revisionMetadata = revisionMetadataSourceFromInfo(oldRevInfos);
43
+ const invertedFields = invertFieldMap(change.change.fieldChanges, undefined, isRollback, genId, crossFieldTable, revisionMetadata, revisionForInvert, fieldKinds);
44
+ const invertedNodes = newChangeAtomIdBTree();
45
+ change.change.nodeChanges.forEachPair(([revision, localId], nodeChangeset) => {
46
+ invertedNodes.set([revision, localId], invertNodeChange(nodeChangeset, { revision, localId }, isRollback, genId, crossFieldTable, revisionMetadata, revisionForInvert, fieldKinds));
47
+ });
48
+ if (crossFieldTable.invalidatedFields.size > 0) {
49
+ const fieldsToUpdate = crossFieldTable.invalidatedFields;
50
+ crossFieldTable.invalidatedFields = new Set();
51
+ for (const fieldChange of fieldsToUpdate) {
52
+ const originalFieldChange = fieldChange.change;
53
+ const context = crossFieldTable.originalFieldToContext.get(fieldChange);
54
+ assert(context !== undefined, 0x851 /* Should have context for every invalidated field */);
55
+ const { invertedField, fieldId } = context;
56
+ const amendedChange = getChangeHandler(fieldKinds, fieldChange.fieldKind).rebaser.invert(originalFieldChange, isRollback, genId, revisionForInvert, new InvertManager(crossFieldTable, fieldChange, fieldId), revisionMetadata);
57
+ invertedField.change = brand(amendedChange);
58
+ }
59
+ }
60
+ const crossFieldKeys = makeCrossFieldKeyTable(invertedFields, invertedNodes, fieldKinds);
61
+ const constraintState = newConstraintState(0);
62
+ updateConstraintsForFields(invertedFields, NodeAttachState.Attached, constraintState, invertedNodes, fieldKinds);
63
+ return makeModularChangeset({
64
+ fieldChanges: invertedFields,
65
+ nodeChanges: invertedNodes,
66
+ nodeToParent: crossFieldTable.invertedNodeToParent,
67
+ nodeAliases: change.change.nodeAliases,
68
+ crossFieldKeys,
69
+ maxId: genId.getMaxId(),
70
+ revisions: revInfos,
71
+ constraintViolationCount: constraintState.violationCount,
72
+ noChangeConstraint,
73
+ noChangeConstraintOnRevert,
74
+ destroys,
75
+ });
76
+ }
77
+ function invertFieldMap(changes, parentId, isRollback, genId, crossFieldTable, revisionMetadata, revisionForInvert, fieldKinds) {
78
+ const invertedFields = new Map();
79
+ for (const [field, fieldChange] of changes) {
80
+ const fieldId = { nodeId: parentId, field };
81
+ const manager = new InvertManager(crossFieldTable, fieldChange, fieldId);
82
+ const invertedChange = getChangeHandler(fieldKinds, fieldChange.fieldKind).rebaser.invert(fieldChange.change, isRollback, genId, revisionForInvert, manager, revisionMetadata);
83
+ const invertedFieldChange = {
84
+ ...fieldChange,
85
+ change: brand(invertedChange),
86
+ };
87
+ invertedFields.set(field, invertedFieldChange);
88
+ crossFieldTable.originalFieldToContext.set(fieldChange, {
89
+ fieldId,
90
+ invertedField: invertedFieldChange,
91
+ });
92
+ }
93
+ return invertedFields;
94
+ }
95
+ function invertNodeChange(change, id, isRollback, genId, crossFieldTable, revisionMetadata, revisionForInvert, fieldKinds) {
96
+ const inverse = {};
97
+ // If the node has a constraint, it should be inverted to a node-exist-on-revert constraint. This ensure that if
98
+ // the inverse is inverted again, the original input constraint will be restored.
99
+ if (change.nodeExistsConstraint !== undefined) {
100
+ inverse.nodeExistsConstraintOnRevert = change.nodeExistsConstraint;
101
+ }
102
+ // The node-exist-on-revert constraint of a node is the constraint that should apply when the a change is reverted.
103
+ // So, it should become the constraint in the inverse. If this constraint is violated when applying the inverse,
104
+ // it will be discarded.
105
+ if (change.nodeExistsConstraintOnRevert !== undefined) {
106
+ inverse.nodeExistsConstraint = change.nodeExistsConstraintOnRevert;
107
+ }
108
+ if (change.fieldChanges !== undefined) {
109
+ inverse.fieldChanges = invertFieldMap(change.fieldChanges, id, isRollback, genId, crossFieldTable, revisionMetadata, revisionForInvert, fieldKinds);
110
+ }
111
+ return inverse;
112
+ }
113
+ function invertBuilds(builds) {
114
+ if (builds !== undefined) {
115
+ return brand(builds.mapValues((chunk) => chunk.topLevelLength));
116
+ }
117
+ return undefined;
118
+ }
119
+ class InvertManager extends CrossFieldManagerI {
120
+ constructor(table, field, fieldId, allowInval = true) {
121
+ super(table, field, allowInval);
122
+ this.fieldId = fieldId;
123
+ }
124
+ onMoveIn(id) {
125
+ setInChangeAtomIdMap(this.table.invertedNodeToParent, id, this.fieldId);
126
+ }
127
+ moveKey(target, revision, id, count) {
128
+ assert(false, 0x9c5 /* Keys should not be moved manually during invert */);
129
+ }
130
+ get table() {
131
+ return this.crossFieldTable;
132
+ }
133
+ }
134
+ function makeCrossFieldKeyTable(fields, nodes, fieldKinds) {
135
+ const keys = newCrossFieldKeyTable();
136
+ populateCrossFieldKeyTableForFieldMap(keys, fields, undefined, fieldKinds);
137
+ nodes.forEachPair(([revision, localId], node) => {
138
+ if (node.fieldChanges !== undefined) {
139
+ populateCrossFieldKeyTableForFieldMap(keys, node.fieldChanges, {
140
+ revision,
141
+ localId,
142
+ }, fieldKinds);
143
+ }
144
+ });
145
+ return keys;
146
+ }
147
+ function populateCrossFieldKeyTableForFieldMap(table, fields, parent, fieldKinds) {
148
+ for (const [fieldKey, fieldChange] of fields) {
149
+ const keys = getChangeHandler(fieldKinds, fieldChange.fieldKind).getCrossFieldKeys(fieldChange.change);
150
+ for (const { key, count } of keys) {
151
+ table.set(key, count, { nodeId: parent, field: fieldKey });
152
+ }
153
+ }
154
+ }
155
+ //# sourceMappingURL=invert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invert.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/invert.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,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C;IAC5E,CAAC;IAED,IAAY,KAAK;QAChB,OAAO,IAAI,CAAC,eAA8B,CAAC;IAC5C,CAAC;CACD;AAED,SAAS,sBAAsB,CAC9B,MAAsB,EACtB,KAAuC,EACvC,UAA2D;IAE3D,MAAM,IAAI,GAAuB,qBAAqB,EAAE,CAAC;IACzD,qCAAqC,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;IAC3E,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE;QAC/C,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACrC,qCAAqC,CACpC,IAAI,EACJ,IAAI,CAAC,YAAY,EACjB;gBACC,QAAQ;gBACR,OAAO;aACP,EACD,UAAU,CACV,CAAC;QACH,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACb,CAAC;AAED,SAAS,qCAAqC,CAC7C,KAAyB,EACzB,MAAsB,EACtB,MAA0B,EAC1B,UAA2D;IAE3D,KAAK,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,IAAI,MAAM,EAAE,CAAC;QAC9C,MAAM,IAAI,GAAG,gBAAgB,CAAC,UAAU,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC,iBAAiB,CACjF,WAAW,CAAC,MAAM,CAClB,CAAC;QACF,KAAK,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC;YACnC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC5D,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\trevisionMetadataSourceFromInfo,\n\ttype ChangeAtomId,\n\ttype ChangesetLocalId,\n\ttype FieldKindIdentifier,\n\ttype RevisionInfo,\n\ttype RevisionMetadataSource,\n\ttype RevisionTag,\n\ttype TaggedChange,\n\ttype TreeChunk,\n} from \"../../core/index.js\";\nimport { brand, idAllocatorFromMaxId, type IdAllocator } from \"../../util/index.js\";\nimport {\n\tnewChangeAtomIdBTree,\n\tsetInChangeAtomIdMap,\n\ttype ChangeAtomIdBTree,\n} from \"../changeAtomIdBTree.js\";\nimport {\n\tnewCrossFieldKeyTable,\n\ttype CrossFieldKeyTable,\n\ttype FieldChange,\n\ttype FieldChangeMap,\n\ttype FieldId,\n\ttype ModularChangeset,\n\ttype NodeChangeset,\n\ttype NodeId,\n} from \"./modularChangeTypes.js\";\nimport {\n\tCrossFieldManagerI,\n\tgetChangeHandler,\n\tgetRevInfoFromTaggedChanges,\n\thasConflicts,\n\tmakeModularChangeset,\n\tnewConstraintState,\n\tnewCrossFieldTable,\n\tupdateConstraintsForFields,\n\ttype CrossFieldTable,\n} from \"./modularChangeUtils.js\";\nimport type { CrossFieldTarget } from \"./crossFieldQueries.js\";\nimport type { FlexFieldKind } from \"./fieldKind.js\";\nimport { NodeAttachState } from \"./fieldChangeHandler.js\";\n\n/**\n * @param change - The change to invert.\n * @param isRollback - Whether the inverted change is meant to rollback a change on a branch as is the case when\n * performing a sandwich rebase.\n * @param revisionForInvert - The revision for the invert changeset.\n */\nexport function invertModularChange(\n\tchange: TaggedChange<ModularChangeset>,\n\tisRollback: boolean,\n\trevisionForInvert: RevisionTag,\n\tfieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>,\n): ModularChangeset {\n\t// Rollback changesets destroy the nodes created by the change being rolled back.\n\tconst destroys = isRollback ? invertBuilds(change.change.builds) : undefined;\n\n\t// Destroys only occur in rollback changesets, which are never inverted.\n\tassert(\n\t\tchange.change.destroys === undefined,\n\t\t0x89a /* Unexpected destroys in change to invert */,\n\t);\n\n\tconst revInfos: RevisionInfo[] = isRollback\n\t\t? [{ revision: revisionForInvert, rollbackOf: change.revision }]\n\t\t: [{ revision: revisionForInvert }];\n\n\tconst noChangeConstraint = change.change.noChangeConstraintOnRevert;\n\tconst noChangeConstraintOnRevert = change.change.noChangeConstraint;\n\n\tif (hasConflicts(change.change)) {\n\t\treturn makeModularChangeset({\n\t\t\tmaxId: change.change.maxId as number,\n\t\t\trevisions: revInfos,\n\t\t\tdestroys,\n\t\t});\n\t}\n\n\tconst genId: IdAllocator = idAllocatorFromMaxId(change.change.maxId ?? -1);\n\n\tconst crossFieldTable: InvertTable = {\n\t\t...newCrossFieldTable<FieldChange>(),\n\t\toriginalFieldToContext: new Map(),\n\t\tinvertedNodeToParent: brand(change.change.nodeToParent.clone()),\n\t};\n\tconst { revInfos: oldRevInfos } = getRevInfoFromTaggedChanges([change]);\n\tconst revisionMetadata = revisionMetadataSourceFromInfo(oldRevInfos);\n\n\tconst invertedFields = invertFieldMap(\n\t\tchange.change.fieldChanges,\n\t\tundefined,\n\t\tisRollback,\n\t\tgenId,\n\t\tcrossFieldTable,\n\t\trevisionMetadata,\n\t\trevisionForInvert,\n\t\tfieldKinds,\n\t);\n\n\tconst invertedNodes = newChangeAtomIdBTree<NodeChangeset>();\n\tchange.change.nodeChanges.forEachPair(([revision, localId], nodeChangeset) => {\n\t\tinvertedNodes.set(\n\t\t\t[revision, localId],\n\t\t\tinvertNodeChange(\n\t\t\t\tnodeChangeset,\n\t\t\t\t{ revision, localId },\n\t\t\t\tisRollback,\n\t\t\t\tgenId,\n\t\t\t\tcrossFieldTable,\n\t\t\t\trevisionMetadata,\n\t\t\t\trevisionForInvert,\n\t\t\t\tfieldKinds,\n\t\t\t),\n\t\t);\n\t});\n\n\tif (crossFieldTable.invalidatedFields.size > 0) {\n\t\tconst fieldsToUpdate = crossFieldTable.invalidatedFields;\n\t\tcrossFieldTable.invalidatedFields = new Set();\n\t\tfor (const fieldChange of fieldsToUpdate) {\n\t\t\tconst originalFieldChange = fieldChange.change;\n\t\t\tconst context = crossFieldTable.originalFieldToContext.get(fieldChange);\n\t\t\tassert(\n\t\t\t\tcontext !== undefined,\n\t\t\t\t0x851 /* Should have context for every invalidated field */,\n\t\t\t);\n\t\t\tconst { invertedField, fieldId } = context;\n\n\t\t\tconst amendedChange = getChangeHandler(fieldKinds, fieldChange.fieldKind).rebaser.invert(\n\t\t\t\toriginalFieldChange,\n\t\t\t\tisRollback,\n\t\t\t\tgenId,\n\t\t\t\trevisionForInvert,\n\t\t\t\tnew InvertManager(crossFieldTable, fieldChange, fieldId),\n\t\t\t\trevisionMetadata,\n\t\t\t);\n\t\t\tinvertedField.change = brand(amendedChange);\n\t\t}\n\t}\n\n\tconst crossFieldKeys = makeCrossFieldKeyTable(invertedFields, invertedNodes, fieldKinds);\n\n\tconst constraintState = newConstraintState(0);\n\tupdateConstraintsForFields(\n\t\tinvertedFields,\n\t\tNodeAttachState.Attached,\n\t\tconstraintState,\n\t\tinvertedNodes,\n\t\tfieldKinds,\n\t);\n\n\treturn makeModularChangeset({\n\t\tfieldChanges: invertedFields,\n\t\tnodeChanges: invertedNodes,\n\t\tnodeToParent: crossFieldTable.invertedNodeToParent,\n\t\tnodeAliases: change.change.nodeAliases,\n\t\tcrossFieldKeys,\n\t\tmaxId: genId.getMaxId(),\n\t\trevisions: revInfos,\n\t\tconstraintViolationCount: constraintState.violationCount,\n\t\tnoChangeConstraint,\n\t\tnoChangeConstraintOnRevert,\n\t\tdestroys,\n\t});\n}\n\nfunction invertFieldMap(\n\tchanges: FieldChangeMap,\n\tparentId: NodeId | undefined,\n\tisRollback: boolean,\n\tgenId: IdAllocator,\n\tcrossFieldTable: InvertTable,\n\trevisionMetadata: RevisionMetadataSource,\n\trevisionForInvert: RevisionTag,\n\tfieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>,\n): FieldChangeMap {\n\tconst invertedFields: FieldChangeMap = new Map();\n\n\tfor (const [field, fieldChange] of changes) {\n\t\tconst fieldId = { nodeId: parentId, field };\n\t\tconst manager = new InvertManager(crossFieldTable, fieldChange, fieldId);\n\t\tconst invertedChange = getChangeHandler(fieldKinds, fieldChange.fieldKind).rebaser.invert(\n\t\t\tfieldChange.change,\n\t\t\tisRollback,\n\t\t\tgenId,\n\t\t\trevisionForInvert,\n\t\t\tmanager,\n\t\t\trevisionMetadata,\n\t\t);\n\n\t\tconst invertedFieldChange: FieldChange = {\n\t\t\t...fieldChange,\n\t\t\tchange: brand(invertedChange),\n\t\t};\n\t\tinvertedFields.set(field, invertedFieldChange);\n\n\t\tcrossFieldTable.originalFieldToContext.set(fieldChange, {\n\t\t\tfieldId,\n\t\t\tinvertedField: invertedFieldChange,\n\t\t});\n\t}\n\n\treturn invertedFields;\n}\n\nfunction invertNodeChange(\n\tchange: NodeChangeset,\n\tid: NodeId,\n\tisRollback: boolean,\n\tgenId: IdAllocator,\n\tcrossFieldTable: InvertTable,\n\trevisionMetadata: RevisionMetadataSource,\n\trevisionForInvert: RevisionTag,\n\tfieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>,\n): NodeChangeset {\n\tconst inverse: NodeChangeset = {};\n\n\t// If the node has a constraint, it should be inverted to a node-exist-on-revert constraint. This ensure that if\n\t// the inverse is inverted again, the original input constraint will be restored.\n\tif (change.nodeExistsConstraint !== undefined) {\n\t\tinverse.nodeExistsConstraintOnRevert = change.nodeExistsConstraint;\n\t}\n\n\t// The node-exist-on-revert constraint of a node is the constraint that should apply when the a change is reverted.\n\t// So, it should become the constraint in the inverse. If this constraint is violated when applying the inverse,\n\t// it will be discarded.\n\tif (change.nodeExistsConstraintOnRevert !== undefined) {\n\t\tinverse.nodeExistsConstraint = change.nodeExistsConstraintOnRevert;\n\t}\n\n\tif (change.fieldChanges !== undefined) {\n\t\tinverse.fieldChanges = invertFieldMap(\n\t\t\tchange.fieldChanges,\n\t\t\tid,\n\t\t\tisRollback,\n\t\t\tgenId,\n\t\t\tcrossFieldTable,\n\t\t\trevisionMetadata,\n\t\t\trevisionForInvert,\n\t\t\tfieldKinds,\n\t\t);\n\t}\n\n\treturn inverse;\n}\n\nfunction invertBuilds(\n\tbuilds: ChangeAtomIdBTree<TreeChunk> | undefined,\n): ChangeAtomIdBTree<number> | undefined {\n\tif (builds !== undefined) {\n\t\treturn brand(builds.mapValues((chunk) => chunk.topLevelLength));\n\t}\n\treturn undefined;\n}\n\ninterface InvertTable extends CrossFieldTable<FieldChange> {\n\toriginalFieldToContext: Map<FieldChange, InvertContext>;\n\tinvertedNodeToParent: ChangeAtomIdBTree<FieldId>;\n}\n\ninterface InvertContext {\n\tfieldId: FieldId;\n\tinvertedField: FieldChange;\n}\n\nclass InvertManager extends CrossFieldManagerI<FieldChange> {\n\tpublic constructor(\n\t\ttable: InvertTable,\n\t\tfield: FieldChange,\n\t\tprivate readonly fieldId: FieldId,\n\t\tallowInval = true,\n\t) {\n\t\tsuper(table, field, allowInval);\n\t}\n\n\tpublic override onMoveIn(id: ChangeAtomId): void {\n\t\tsetInChangeAtomIdMap(this.table.invertedNodeToParent, id, this.fieldId);\n\t}\n\n\tpublic override moveKey(\n\t\ttarget: CrossFieldTarget,\n\t\trevision: RevisionTag | undefined,\n\t\tid: ChangesetLocalId,\n\t\tcount: number,\n\t): void {\n\t\tassert(false, 0x9c5 /* Keys should not be moved manually during invert */);\n\t}\n\n\tprivate get table(): InvertTable {\n\t\treturn this.crossFieldTable as InvertTable;\n\t}\n}\n\nfunction makeCrossFieldKeyTable(\n\tfields: FieldChangeMap,\n\tnodes: ChangeAtomIdBTree<NodeChangeset>,\n\tfieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>,\n): CrossFieldKeyTable {\n\tconst keys: CrossFieldKeyTable = newCrossFieldKeyTable();\n\tpopulateCrossFieldKeyTableForFieldMap(keys, fields, undefined, fieldKinds);\n\tnodes.forEachPair(([revision, localId], node) => {\n\t\tif (node.fieldChanges !== undefined) {\n\t\t\tpopulateCrossFieldKeyTableForFieldMap(\n\t\t\t\tkeys,\n\t\t\t\tnode.fieldChanges,\n\t\t\t\t{\n\t\t\t\t\trevision,\n\t\t\t\t\tlocalId,\n\t\t\t\t},\n\t\t\t\tfieldKinds,\n\t\t\t);\n\t\t}\n\t});\n\n\treturn keys;\n}\n\nfunction populateCrossFieldKeyTableForFieldMap(\n\ttable: CrossFieldKeyTable,\n\tfields: FieldChangeMap,\n\tparent: NodeId | undefined,\n\tfieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>,\n): void {\n\tfor (const [fieldKey, fieldChange] of fields) {\n\t\tconst keys = getChangeHandler(fieldKinds, fieldChange.fieldKind).getCrossFieldKeys(\n\t\t\tfieldChange.change,\n\t\t);\n\t\tfor (const { key, count } of keys) {\n\t\t\ttable.set(key, count, { nodeId: parent, field: fieldKey });\n\t\t}\n\t}\n}\n"]}
@@ -2,8 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { FieldKindIdentifier } from "../../core/index.js";
6
- import type { FlexFieldKind } from "./fieldKind.js";
5
+ import type { ModularChangeFamily } from "./modularChangeFamily.js";
7
6
  import type { ModularChangeset } from "./modularChangeTypes.js";
8
7
  /**
9
8
  * "Minimizes" a {@link ModularChangeset} so that it contains no extraneous
@@ -19,7 +18,7 @@ import type { ModularChangeset } from "./modularChangeTypes.js";
19
18
  * future change.
20
19
  *
21
20
  * @param change - The change to minimize.
22
- * @param fieldKinds - The field kinds to delegate to when computing the change's delta.
21
+ * @param changeFamily - The change family used to compute the change's delta and identify built nodes.
23
22
  */
24
- export declare function minimizeModularChangeset(change: ModularChangeset, fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>): ModularChangeset;
23
+ export declare function minimizeModularChangeset(change: ModularChangeset, changeFamily: ModularChangeFamily): ModularChangeset;
25
24
  //# sourceMappingURL=minimizeModularChange.d.ts.map