@fluidframework/tree 2.113.0-411909 → 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 (534) hide show
  1. package/CHANGELOG.md +272 -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/optionalField.js +1 -1
  112. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  113. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +2 -2
  114. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  115. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  116. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
  117. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  118. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  119. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
  120. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  121. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  122. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +2 -2
  123. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  124. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  125. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +2 -2
  126. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  127. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  128. package/dist/feature-libraries/treeTextCursor.d.ts +15 -0
  129. package/dist/feature-libraries/treeTextCursor.d.ts.map +1 -1
  130. package/dist/feature-libraries/treeTextCursor.js +64 -1
  131. package/dist/feature-libraries/treeTextCursor.js.map +1 -1
  132. package/dist/index.d.ts +3 -1
  133. package/dist/index.d.ts.map +1 -1
  134. package/dist/index.js +5 -1
  135. package/dist/index.js.map +1 -1
  136. package/dist/packageVersion.d.ts +1 -1
  137. package/dist/packageVersion.d.ts.map +1 -1
  138. package/dist/packageVersion.js +1 -1
  139. package/dist/packageVersion.js.map +1 -1
  140. package/dist/shared-tree/serializedChange.d.ts +2 -2
  141. package/dist/shared-tree/serializedChange.d.ts.map +1 -1
  142. package/dist/shared-tree/serializedChange.js.map +1 -1
  143. package/dist/shared-tree/sharedTree.d.ts +6 -3
  144. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  145. package/dist/shared-tree/sharedTree.js +8 -6
  146. package/dist/shared-tree/sharedTree.js.map +1 -1
  147. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +2 -2
  148. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  149. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  150. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +41 -4
  151. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  152. package/dist/shared-tree/sharedTreeChangeFamily.js +57 -1
  153. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  154. package/dist/shared-tree/transactionMinimize.d.ts.map +1 -1
  155. package/dist/shared-tree/transactionMinimize.js +2 -2
  156. package/dist/shared-tree/transactionMinimize.js.map +1 -1
  157. package/dist/shared-tree/transactionPostProcessor.d.ts +2 -1
  158. package/dist/shared-tree/transactionPostProcessor.d.ts.map +1 -1
  159. package/dist/shared-tree/transactionPostProcessor.js.map +1 -1
  160. package/dist/shared-tree/treeCheckout.d.ts +8 -7
  161. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  162. package/dist/shared-tree/treeCheckout.js +1 -1
  163. package/dist/shared-tree/treeCheckout.js.map +1 -1
  164. package/dist/shared-tree-core/branch.d.ts +23 -9
  165. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  166. package/dist/shared-tree-core/branch.js +7 -0
  167. package/dist/shared-tree-core/branch.js.map +1 -1
  168. package/dist/shared-tree-core/editManager.d.ts +4 -4
  169. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  170. package/dist/shared-tree-core/editManager.js +2 -0
  171. package/dist/shared-tree-core/editManager.js.map +1 -1
  172. package/dist/shared-tree-core/editManagerCodecs.d.ts +3 -14
  173. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  174. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  175. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +11 -1
  176. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  177. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  178. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +4 -11
  179. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  180. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  181. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +4 -11
  182. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  183. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  184. package/dist/shared-tree-core/editManagerSummarizer.d.ts +4 -4
  185. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  186. package/dist/shared-tree-core/editManagerSummarizer.js +0 -1
  187. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  188. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
  189. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  190. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  191. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  192. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  193. package/dist/shared-tree-core/messageCodecs.d.ts +8 -1
  194. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  195. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  196. package/dist/shared-tree-core/sharedTreeCore.d.ts +5 -5
  197. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  198. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  199. package/dist/shared-tree-core/transaction.d.ts +10 -10
  200. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  201. package/dist/shared-tree-core/transaction.js +6 -3
  202. package/dist/shared-tree-core/transaction.js.map +1 -1
  203. package/dist/simple-tree/api/eraseSchemaDetails.d.ts +15 -0
  204. package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  205. package/dist/simple-tree/api/eraseSchemaDetails.js +15 -0
  206. package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  207. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +21 -2
  208. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  209. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  210. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +13 -0
  211. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  212. package/dist/simple-tree/node-kinds/map/mapNode.js +9 -0
  213. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  214. package/dist/text/textDomain.d.ts +12 -0
  215. package/dist/text/textDomain.d.ts.map +1 -1
  216. package/dist/text/textDomain.js +37 -16
  217. package/dist/text/textDomain.js.map +1 -1
  218. package/dist/text/textDomainFormatted.d.ts +155 -61
  219. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  220. package/dist/text/textDomainFormatted.js +147 -71
  221. package/dist/text/textDomainFormatted.js.map +1 -1
  222. package/dist/text/textDomainFormattedDefault.d.ts +37 -14
  223. package/dist/text/textDomainFormattedDefault.d.ts.map +1 -1
  224. package/dist/text/textDomainFormattedDefault.js +13 -5
  225. package/dist/text/textDomainFormattedDefault.js.map +1 -1
  226. package/dist/treeDataStore.d.ts +49 -0
  227. package/dist/treeDataStore.d.ts.map +1 -0
  228. package/dist/treeDataStore.js +57 -0
  229. package/dist/treeDataStore.js.map +1 -0
  230. package/dist/treeFactory.d.ts +8 -3
  231. package/dist/treeFactory.d.ts.map +1 -1
  232. package/dist/treeFactory.js +6 -1
  233. package/dist/treeFactory.js.map +1 -1
  234. package/lib/core/change-family/changeFamily.d.ts +15 -4
  235. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  236. package/lib/core/change-family/changeFamily.js.map +1 -1
  237. package/lib/core/change-family/editBuilder.d.ts +2 -3
  238. package/lib/core/change-family/editBuilder.d.ts.map +1 -1
  239. package/lib/core/change-family/editBuilder.js +1 -2
  240. package/lib/core/change-family/editBuilder.js.map +1 -1
  241. package/lib/core/change-family/index.d.ts +1 -1
  242. package/lib/core/change-family/index.d.ts.map +1 -1
  243. package/lib/core/change-family/index.js.map +1 -1
  244. package/lib/core/index.d.ts +3 -2
  245. package/lib/core/index.d.ts.map +1 -1
  246. package/lib/core/index.js +1 -1
  247. package/lib/core/index.js.map +1 -1
  248. package/lib/core/tree/delta.d.ts +62 -16
  249. package/lib/core/tree/delta.d.ts.map +1 -1
  250. package/lib/core/tree/delta.js.map +1 -1
  251. package/lib/core/tree/detachedFieldIndex.d.ts +7 -13
  252. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  253. package/lib/core/tree/detachedFieldIndex.js +7 -21
  254. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  255. package/lib/core/tree/index.d.ts +1 -0
  256. package/lib/core/tree/index.d.ts.map +1 -1
  257. package/lib/core/tree/index.js.map +1 -1
  258. package/lib/core/tree/visitorUtils.d.ts +2 -4
  259. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  260. package/lib/core/tree/visitorUtils.js +2 -2
  261. package/lib/core/tree/visitorUtils.js.map +1 -1
  262. package/lib/entrypoints/alpha.d.ts +1 -1
  263. package/lib/entrypoints/alpha.d.ts.map +1 -1
  264. package/lib/entrypoints/alpha.js +1 -1
  265. package/lib/entrypoints/alpha.js.map +1 -1
  266. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  267. package/lib/feature-libraries/chunked-forest/uniformChunk.js +10 -2
  268. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  269. package/lib/feature-libraries/comparison-forest/comparisonForest.d.ts +51 -0
  270. package/lib/feature-libraries/comparison-forest/comparisonForest.d.ts.map +1 -0
  271. package/lib/feature-libraries/comparison-forest/comparisonForest.js +94 -0
  272. package/lib/feature-libraries/comparison-forest/comparisonForest.js.map +1 -0
  273. package/lib/feature-libraries/comparison-forest/index.d.ts +6 -0
  274. package/lib/feature-libraries/comparison-forest/index.d.ts.map +1 -0
  275. package/lib/feature-libraries/comparison-forest/index.js +6 -0
  276. package/lib/feature-libraries/comparison-forest/index.js.map +1 -0
  277. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +8 -6
  278. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  279. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
  280. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  281. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  282. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  283. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  284. package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
  285. package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
  286. package/lib/feature-libraries/default-schema/noChangeCodecs.js +3 -1
  287. package/lib/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
  288. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +6 -3
  289. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  290. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +16 -4
  291. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  292. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -3
  293. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  294. package/lib/feature-libraries/forest-summary/forestSummarizer.js +2 -3
  295. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  296. package/lib/feature-libraries/index.d.ts +4 -3
  297. package/lib/feature-libraries/index.d.ts.map +1 -1
  298. package/lib/feature-libraries/index.js +2 -1
  299. package/lib/feature-libraries/index.js.map +1 -1
  300. package/lib/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
  301. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  302. package/lib/feature-libraries/mitigatedChangeFamily.js +12 -0
  303. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  304. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +9 -1
  305. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  306. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  307. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
  308. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  309. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  310. package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
  311. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  312. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  313. package/lib/feature-libraries/modular-schema/invert.d.ts +15 -0
  314. package/lib/feature-libraries/modular-schema/invert.d.ts.map +1 -0
  315. package/lib/feature-libraries/modular-schema/invert.js +155 -0
  316. package/lib/feature-libraries/modular-schema/invert.js.map +1 -0
  317. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts +3 -4
  318. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
  319. package/lib/feature-libraries/modular-schema/minimizeModularChange.js +2 -2
  320. package/lib/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
  321. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +9 -9
  322. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  323. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +0 -2
  324. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  325. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +2 -2
  326. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  327. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  328. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  329. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  330. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  331. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -22
  332. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  333. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +16 -367
  334. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  335. package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts +61 -0
  336. package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -0
  337. package/lib/feature-libraries/modular-schema/modularChangeUtils.js +192 -0
  338. package/lib/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -0
  339. package/lib/feature-libraries/modular-schema/prune.d.ts +10 -0
  340. package/lib/feature-libraries/modular-schema/prune.d.ts.map +1 -0
  341. package/lib/feature-libraries/modular-schema/prune.js +45 -0
  342. package/lib/feature-libraries/modular-schema/prune.js.map +1 -0
  343. package/lib/feature-libraries/optional-field/optionalField.js +1 -1
  344. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  345. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +2 -2
  346. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  347. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  348. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
  349. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  350. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  351. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
  352. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  353. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  354. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +2 -2
  355. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  356. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  357. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +2 -2
  358. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  359. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  360. package/lib/feature-libraries/treeTextCursor.d.ts +15 -0
  361. package/lib/feature-libraries/treeTextCursor.d.ts.map +1 -1
  362. package/lib/feature-libraries/treeTextCursor.js +62 -1
  363. package/lib/feature-libraries/treeTextCursor.js.map +1 -1
  364. package/lib/index.d.ts +3 -1
  365. package/lib/index.d.ts.map +1 -1
  366. package/lib/index.js +2 -1
  367. package/lib/index.js.map +1 -1
  368. package/lib/packageVersion.d.ts +1 -1
  369. package/lib/packageVersion.d.ts.map +1 -1
  370. package/lib/packageVersion.js +1 -1
  371. package/lib/packageVersion.js.map +1 -1
  372. package/lib/shared-tree/serializedChange.d.ts +2 -2
  373. package/lib/shared-tree/serializedChange.d.ts.map +1 -1
  374. package/lib/shared-tree/serializedChange.js.map +1 -1
  375. package/lib/shared-tree/sharedTree.d.ts +6 -3
  376. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  377. package/lib/shared-tree/sharedTree.js +9 -7
  378. package/lib/shared-tree/sharedTree.js.map +1 -1
  379. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +2 -2
  380. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  381. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  382. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +41 -4
  383. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  384. package/lib/shared-tree/sharedTreeChangeFamily.js +55 -0
  385. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  386. package/lib/shared-tree/transactionMinimize.d.ts.map +1 -1
  387. package/lib/shared-tree/transactionMinimize.js +3 -3
  388. package/lib/shared-tree/transactionMinimize.js.map +1 -1
  389. package/lib/shared-tree/transactionPostProcessor.d.ts +2 -1
  390. package/lib/shared-tree/transactionPostProcessor.d.ts.map +1 -1
  391. package/lib/shared-tree/transactionPostProcessor.js.map +1 -1
  392. package/lib/shared-tree/treeCheckout.d.ts +8 -7
  393. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  394. package/lib/shared-tree/treeCheckout.js +1 -1
  395. package/lib/shared-tree/treeCheckout.js.map +1 -1
  396. package/lib/shared-tree-core/branch.d.ts +23 -9
  397. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  398. package/lib/shared-tree-core/branch.js +7 -0
  399. package/lib/shared-tree-core/branch.js.map +1 -1
  400. package/lib/shared-tree-core/editManager.d.ts +4 -4
  401. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  402. package/lib/shared-tree-core/editManager.js +2 -0
  403. package/lib/shared-tree-core/editManager.js.map +1 -1
  404. package/lib/shared-tree-core/editManagerCodecs.d.ts +3 -14
  405. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  406. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  407. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +11 -1
  408. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  409. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  410. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +4 -11
  411. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  412. package/lib/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
  413. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  414. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +4 -11
  415. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  416. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
  417. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  418. package/lib/shared-tree-core/editManagerSummarizer.d.ts +4 -4
  419. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  420. package/lib/shared-tree-core/editManagerSummarizer.js +0 -1
  421. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  422. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
  423. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  424. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  425. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  426. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  427. package/lib/shared-tree-core/messageCodecs.d.ts +8 -1
  428. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  429. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  430. package/lib/shared-tree-core/sharedTreeCore.d.ts +5 -5
  431. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  432. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  433. package/lib/shared-tree-core/transaction.d.ts +10 -10
  434. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  435. package/lib/shared-tree-core/transaction.js +6 -3
  436. package/lib/shared-tree-core/transaction.js.map +1 -1
  437. package/lib/simple-tree/api/eraseSchemaDetails.d.ts +15 -0
  438. package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  439. package/lib/simple-tree/api/eraseSchemaDetails.js +15 -0
  440. package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  441. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +21 -2
  442. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  443. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  444. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +13 -0
  445. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  446. package/lib/simple-tree/node-kinds/map/mapNode.js +9 -0
  447. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  448. package/lib/text/textDomain.d.ts +12 -0
  449. package/lib/text/textDomain.d.ts.map +1 -1
  450. package/lib/text/textDomain.js +34 -15
  451. package/lib/text/textDomain.js.map +1 -1
  452. package/lib/text/textDomainFormatted.d.ts +155 -61
  453. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  454. package/lib/text/textDomainFormatted.js +148 -73
  455. package/lib/text/textDomainFormatted.js.map +1 -1
  456. package/lib/text/textDomainFormattedDefault.d.ts +37 -14
  457. package/lib/text/textDomainFormattedDefault.d.ts.map +1 -1
  458. package/lib/text/textDomainFormattedDefault.js +14 -6
  459. package/lib/text/textDomainFormattedDefault.js.map +1 -1
  460. package/lib/treeDataStore.d.ts +49 -0
  461. package/lib/treeDataStore.d.ts.map +1 -0
  462. package/lib/treeDataStore.js +52 -0
  463. package/lib/treeDataStore.js.map +1 -0
  464. package/lib/treeFactory.d.ts +8 -3
  465. package/lib/treeFactory.d.ts.map +1 -1
  466. package/lib/treeFactory.js +5 -0
  467. package/lib/treeFactory.js.map +1 -1
  468. package/package.json +25 -24
  469. package/src/core/change-family/changeFamily.ts +32 -4
  470. package/src/core/change-family/editBuilder.ts +1 -2
  471. package/src/core/change-family/index.ts +2 -0
  472. package/src/core/index.ts +9 -6
  473. package/src/core/tree/delta.ts +62 -16
  474. package/src/core/tree/detachedFieldIndex.ts +7 -38
  475. package/src/core/tree/index.ts +2 -0
  476. package/src/core/tree/visitorUtils.ts +3 -17
  477. package/src/entrypoints/alpha.ts +7 -3
  478. package/src/feature-libraries/chunked-forest/uniformChunk.ts +11 -1
  479. package/src/feature-libraries/comparison-forest/comparisonForest.ts +140 -0
  480. package/src/feature-libraries/comparison-forest/index.ts +6 -0
  481. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +20 -6
  482. package/src/feature-libraries/default-schema/index.ts +1 -0
  483. package/src/feature-libraries/default-schema/noChangeCodecs.ts +11 -3
  484. package/src/feature-libraries/detachedFieldIndexSummarizer.ts +33 -5
  485. package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -3
  486. package/src/feature-libraries/index.ts +5 -0
  487. package/src/feature-libraries/mitigatedChangeFamily.ts +21 -3
  488. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +10 -1
  489. package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +9 -4
  490. package/src/feature-libraries/modular-schema/index.ts +1 -0
  491. package/src/feature-libraries/modular-schema/invert.ts +338 -0
  492. package/src/feature-libraries/modular-schema/minimizeModularChange.ts +3 -5
  493. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +16 -13
  494. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +3 -1
  495. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +2 -1
  496. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +45 -644
  497. package/src/feature-libraries/modular-schema/modularChangeUtils.ts +340 -0
  498. package/src/feature-libraries/modular-schema/prune.ts +69 -0
  499. package/src/feature-libraries/optional-field/optionalField.ts +1 -1
  500. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +4 -2
  501. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +5 -2
  502. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +4 -2
  503. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +4 -2
  504. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +6 -3
  505. package/src/feature-libraries/treeTextCursor.ts +66 -1
  506. package/src/index.ts +4 -0
  507. package/src/packageVersion.ts +1 -1
  508. package/src/shared-tree/serializedChange.ts +2 -2
  509. package/src/shared-tree/sharedTree.ts +34 -14
  510. package/src/shared-tree/sharedTreeChangeCodecs.ts +11 -3
  511. package/src/shared-tree/sharedTreeChangeFamily.ts +77 -2
  512. package/src/shared-tree/transactionMinimize.ts +7 -3
  513. package/src/shared-tree/transactionPostProcessor.ts +5 -1
  514. package/src/shared-tree/treeCheckout.ts +55 -16
  515. package/src/shared-tree-core/branch.ts +40 -12
  516. package/src/shared-tree-core/editManager.ts +46 -25
  517. package/src/shared-tree-core/editManagerCodecs.ts +9 -21
  518. package/src/shared-tree-core/editManagerCodecsCommons.ts +14 -2
  519. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +18 -21
  520. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +18 -20
  521. package/src/shared-tree-core/editManagerSummarizer.ts +9 -6
  522. package/src/shared-tree-core/messageCodecV1ToV4.ts +3 -3
  523. package/src/shared-tree-core/messageCodecVSharedBranches.ts +2 -2
  524. package/src/shared-tree-core/messageCodecs.ts +12 -2
  525. package/src/shared-tree-core/sharedTreeCore.ts +15 -6
  526. package/src/shared-tree-core/transaction.ts +47 -25
  527. package/src/simple-tree/api/eraseSchemaDetails.ts +15 -0
  528. package/src/simple-tree/node-kinds/array/arrayNode.ts +21 -2
  529. package/src/simple-tree/node-kinds/map/mapNode.ts +24 -2
  530. package/src/text/textDomain.ts +29 -6
  531. package/src/text/textDomainFormatted.ts +351 -134
  532. package/src/text/textDomainFormattedDefault.ts +25 -16
  533. package/src/treeDataStore.ts +125 -0
  534. package/src/treeFactory.ts +11 -3
@@ -1 +1 @@
1
- {"version":3,"file":"forestSummarizer.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/forestSummarizer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAU7D,kDAY6B;AAC7B,8DAKyC;AACzC,kDAI6B;AAC7B,wDAAwD;AACxD,iEAAsF;AACtF,yDAKoC;AACpC,wEAAqE;AAErE,yCAAkE;AAClE,iFAGwC;AACxC,qEAIkC;AAClC,uDAG2B;AAE3B;;GAEG;AACH,MAAa,gBACZ,SAAQ,8BAA+C;IAQvD;;OAEG;IACH,YACkB,MAAuB,EACvB,gBAAkC,EAClC,cAAyC,EACzC,cAAyC,EAC1D,OAA0B,EACT,YAA2B,EA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AC;gBACV,EAAE,EAAE,OAAO;gBACX,KAAK,EAAE,OAAO;aACd,CAAC,CAAC;YACH,YAAY,CAAC,IAAI,CAAC;gBACjB,QAAQ;gBACR,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE;aAC/D,CAAC,CAAC;QACJ,CAAC;QAED,IAAA,iBAAM,EAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAC9D,IAAA,qBAAU,EACT,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,GAAG,CAAC,YAAY,CAAC,EAAE,EACxC,SAAS,EACT,IAAI,CAAC,MAAM,EACX,IAAA,iCAAsB,EAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,YAAY,CAAC,CACxE,CAAC;IACH,CAAC;CACD;AAlLD,4CAkLC","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 type { IChannelStorageService } from \"@fluidframework/datastore-definitions/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\nimport type {\n\tIExperimentalIncrementalSummaryContext,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport type { SummaryTreeBuilder } from \"@fluidframework/runtime-utils/internal\";\n\nimport type { CodecWriteOptions } from \"../../codec/index.js\";\nimport {\n\ttype DeltaDetachedNodeBuild,\n\ttype DeltaFieldChanges,\n\ttype FieldKey,\n\ttype IEditableForest,\n\ttype ITreeCursorSynchronous,\n\ttype ITreeSubscriptionCursor,\n\ttype RevisionTagCodec,\n\tTreeNavigationResult,\n\tapplyDelta,\n\tforEachField,\n\tmakeDetachedFieldIndex,\n} from \"../../core/index.js\";\nimport {\n\tVersionedSummarizer,\n\ttype Summarizable,\n\ttype SummaryElementParser,\n\ttype SummaryElementStringifier,\n} from \"../../shared-tree-core/index.js\";\nimport {\n\tidAllocatorFromMaxId,\n\treadAndParseSnapshotBlob,\n\ttype JsonCompatibleReadOnly,\n} from \"../../util/index.js\";\n// eslint-disable-next-line import-x/no-internal-modules\nimport { chunkFieldSingle, defaultChunkPolicy } from \"../chunked-forest/chunkTree.js\";\nimport {\n\tdefaultIncrementalEncodingPolicy,\n\ttype FieldBatchDecodingContext,\n\ttype FieldBatchEncodingContext,\n\ttype IncrementalEncodingPolicy,\n} from \"../chunked-forest/index.js\";\nimport { TreeCompressionStrategy } from \"../treeCompressionUtils.js\";\n\nimport { forestCodecBuilder, type ForestCodec } from \"./codec.js\";\nimport {\n\tForestIncrementalSummaryBehavior,\n\tForestIncrementalSummaryBuilder,\n} from \"./incrementalSummaryBuilder.js\";\nimport {\n\tForestSummaryFormatVersion,\n\tforestSummaryKey,\n\tsupportedForestSummaryFormatVersions,\n} from \"./summaryFormatCommon.js\";\nimport {\n\tminVersionToForestSummaryFormatVersion,\n\tgetForestRootSummaryContentKey,\n} from \"./summaryTypes.js\";\n\n/**\n * Provides methods for summarizing and loading a forest.\n */\nexport class ForestSummarizer\n\textends VersionedSummarizer<ForestSummaryFormatVersion>\n\timplements Summarizable\n{\n\tprivate readonly codec: ForestCodec;\n\n\tprivate readonly incrementalSummaryBuilder: ForestIncrementalSummaryBuilder;\n\tprivate readonly forestRootSummaryContentKey: string;\n\n\t/**\n\t * @param encoderContext - The schema if provided here must be mutated by the caller to keep it up to date.\n\t */\n\tpublic constructor(\n\t\tprivate readonly forest: IEditableForest,\n\t\tprivate readonly revisionTagCodec: RevisionTagCodec,\n\t\tprivate readonly encoderContext: FieldBatchEncodingContext,\n\t\tprivate readonly decoderContext: FieldBatchDecodingContext,\n\t\toptions: CodecWriteOptions,\n\t\tprivate readonly idCompressor: IIdCompressor,\n\t\tinitialSequenceNumber: number,\n\t\tshouldEncodeIncrementally: IncrementalEncodingPolicy = defaultIncrementalEncodingPolicy,\n\t) {\n\t\tsuper(\n\t\t\tforestSummaryKey,\n\t\t\tminVersionToForestSummaryFormatVersion(options.minVersionForCollab),\n\t\t\tsupportedForestSummaryFormatVersions,\n\t\t\ttrue /* supportPreVersioningFormat */,\n\t\t);\n\n\t\tthis.codec = forestCodecBuilder.build(options);\n\n\t\tconst summaryFormatWriteVersion = minVersionToForestSummaryFormatVersion(\n\t\t\toptions.minVersionForCollab,\n\t\t);\n\t\tthis.forestRootSummaryContentKey = getForestRootSummaryContentKey(\n\t\t\tsummaryFormatWriteVersion,\n\t\t);\n\n\t\t// Incremental summary is supported in ForestSummaryFormatVersion.v3 onwards.\n\t\t// Note that even in versions that support it, it is possible that the\n\t\t// FieldBatchCodec will not use incremental encoding (for example if using its v1 formats which does not support it).\n\t\tconst enableIncrementalSummary =\n\t\t\tsummaryFormatWriteVersion >= ForestSummaryFormatVersion.v3 &&\n\t\t\tencoderContext.encodeType === TreeCompressionStrategy.CompressedIncremental;\n\t\tthis.incrementalSummaryBuilder = new ForestIncrementalSummaryBuilder(\n\t\t\tenableIncrementalSummary,\n\t\t\t(cursor: ITreeCursorSynchronous) => this.forest.chunkField(cursor),\n\t\t\tshouldEncodeIncrementally,\n\t\t\tinitialSequenceNumber,\n\t\t);\n\t}\n\n\t/**\n\t * Summarization of the forest's tree content.\n\t * @returns a summary tree containing the forest's tree content.\n\t * @remarks\n\t * If incremental summary is disabled, all the content will be added to a single summary blob.\n\t * If incremental summary is enabled, the summary will be a tree.\n\t * See {@link ForestIncrementalSummaryBuilder} for details of what this tree looks like.\n\t *\n\t * TODO: when perf matters, this should be replaced with a chunked async version using a binary format.\n\t */\n\tprotected summarizeInternal(props: {\n\t\tstringify: SummaryElementStringifier;\n\t\tfullTree?: boolean;\n\t\ttrackState?: boolean;\n\t\ttelemetryContext?: ITelemetryContext;\n\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext;\n\t\tbuilder: SummaryTreeBuilder;\n\t}): void {\n\t\tconst { stringify, fullTree = false, incrementalSummaryContext, builder } = props;\n\n\t\tconst rootCursor = this.forest.getCursorAboveDetachedFields();\n\t\tconst fieldMap: Map<FieldKey, ITreeCursorSynchronous & ITreeSubscriptionCursor> =\n\t\t\tnew Map();\n\t\t// TODO: Encode all detached fields in one operation for better performance and compression\n\t\tforEachField(rootCursor, (cursor) => {\n\t\t\tconst key = cursor.getFieldKey();\n\t\t\tconst innerCursor = this.forest.allocateCursor(\"getTreeString\");\n\t\t\tassert(\n\t\t\t\tthis.forest.tryMoveCursorToField({ fieldKey: key, parent: undefined }, innerCursor) ===\n\t\t\t\t\tTreeNavigationResult.Ok,\n\t\t\t\t0x892 /* failed to navigate to field */,\n\t\t\t);\n\t\t\tfieldMap.set(key, innerCursor as ITreeCursorSynchronous & ITreeSubscriptionCursor);\n\t\t});\n\n\t\t// Let the incremental summary builder know that we are starting a new summary.\n\t\t// It returns whether incremental encoding is enabled.\n\t\tconst incrementalSummaryBehavior = this.incrementalSummaryBuilder.startSummary({\n\t\t\tfullTree,\n\t\t\tincrementalSummaryContext,\n\t\t\tstringify,\n\t\t\tbuilder,\n\t\t});\n\t\tconst encoderContext: FieldBatchEncodingContext = {\n\t\t\t...this.encoderContext,\n\t\t\tincrementalEncoder:\n\t\t\t\tincrementalSummaryBehavior === ForestIncrementalSummaryBehavior.Incremental\n\t\t\t\t\t? this.incrementalSummaryBuilder\n\t\t\t\t\t: undefined,\n\t\t};\n\t\tconst encoded = this.codec.encode(fieldMap, encoderContext);\n\t\tfor (const value of fieldMap.values()) {\n\t\t\tvalue.free();\n\t\t}\n\n\t\tthis.incrementalSummaryBuilder.completeSummary({\n\t\t\tincrementalSummaryContext,\n\t\t\tforestSummaryRootContent: stringify(encoded),\n\t\t\tforestSummaryRootContentKey: this.forestRootSummaryContentKey,\n\t\t\tbuilder,\n\t\t});\n\t}\n\n\tprotected async loadInternal(\n\t\tservices: IChannelStorageService,\n\t\tparse: SummaryElementParser,\n\t\tversion: ForestSummaryFormatVersion | undefined,\n\t): Promise<void> {\n\t\t// Get the key of the summary blob where the top-level forest content is stored based on the summary format version.\n\t\t// If the summary was generated as `ForestIncrementalSummaryBehavior.SingleBlob`, this blob will contain all\n\t\t// of forest's contents.\n\t\t// If the summary was generated as `ForestIncrementalSummaryBehavior.Incremental`, this blob will contain only\n\t\t// the top-level forest node's contents.\n\t\t// The contents of the incremental chunks will be in separate tree nodes and will be read later during decoding.\n\t\tconst forestSummaryRootContentKey = getForestRootSummaryContentKey(version);\n\t\tassert(\n\t\t\tawait services.contains(forestSummaryRootContentKey),\n\t\t\t0xc21 /* Forest summary content missing in snapshot */,\n\t\t);\n\n\t\t// Load the incremental summary builder so that it can download any incremental chunks in the\n\t\t// snapshot.\n\t\tawait this.incrementalSummaryBuilder.load({\n\t\t\tservices,\n\t\t\treadAndParseChunk: async (chunkBlobPath: string) =>\n\t\t\t\treadAndParseSnapshotBlob(chunkBlobPath, services, parse),\n\t\t});\n\n\t\t// TODO: this code is parsing data without an optional validator, this should be defined in a typebox schema as part of the\n\t\t// forest summary format.\n\t\tconst fields = this.codec.decode(\n\t\t\t(await readAndParseSnapshotBlob(\n\t\t\t\tforestSummaryRootContentKey,\n\t\t\t\tservices,\n\t\t\t\tparse,\n\t\t\t\t// TODO: this type cast assumes there are no handles, which should probably be enforced at runtime or the need for this cast should be removed altogether.\n\t\t\t)) as JsonCompatibleReadOnly,\n\t\t\tthis.decoderContext.withIncrementalDecoder(this.incrementalSummaryBuilder),\n\t\t);\n\t\tconst allocator = idAllocatorFromMaxId();\n\t\tconst fieldChanges: [FieldKey, DeltaFieldChanges][] = [];\n\t\tconst build: DeltaDetachedNodeBuild[] = [];\n\t\tfor (const [fieldKey, field] of fields) {\n\t\t\tconst chunked = chunkFieldSingle(field, {\n\t\t\t\tpolicy: defaultChunkPolicy,\n\t\t\t\tidCompressor: this.idCompressor,\n\t\t\t});\n\t\t\tconst buildId = { minor: allocator.allocate(chunked.topLevelLength) };\n\t\t\tbuild.push({\n\t\t\t\tid: buildId,\n\t\t\t\ttrees: chunked,\n\t\t\t});\n\t\t\tfieldChanges.push([\n\t\t\t\tfieldKey,\n\t\t\t\t{ marks: [{ count: chunked.topLevelLength, attach: buildId }] },\n\t\t\t]);\n\t\t}\n\n\t\tassert(this.forest.isEmpty, 0x797 /* forest must be empty */);\n\t\tapplyDelta(\n\t\t\t{ build, fields: new Map(fieldChanges) },\n\t\t\tundefined,\n\t\t\tthis.forest,\n\t\t\tmakeDetachedFieldIndex(\"init\", this.revisionTagCodec, this.idCompressor),\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"file":"forestSummarizer.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/forestSummarizer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAU7D,kDAW6B;AAC7B,8DAKyC;AACzC,kDAI6B;AAC7B,wDAAwD;AACxD,iEAAsF;AACtF,yDAKoC;AACpC,wEAAqE;AAErE,yCAAkE;AAClE,iFAGwC;AACxC,qEAIkC;AAClC,uDAG2B;AAE3B;;GAEG;AACH,MAAa,gBACZ,SAAQ,8BAA+C;IAQvD;;OAEG;IACH,YACkB,MAAuB,EACvB,cAAyC,EACzC,cAAyC,EAC1D,OAA0B,EACT,YAA2B,EAC5C,qBAA6B,EAC7B,4BAAuD,2CAAgC;QAEvF,KAAK,CACJ,yCAAgB,EAChB,IAAA,wDAAsC,EAAC,OAAO,CAAC,mBAAmB,CAAC,EACnE,6DAAoC,EACpC,IAAI,CAAC,gCAAgC,CACrC,CAAC;QAbe,WAAM,GAAN,MAAM,CAAiB;QACvB,mBAAc,GAAd,cAAc,CAA2B;QACzC,mBAAc,GAAd,cAAc,CAA2B;QAEzC,iBAAY,GAAZ,YAAY,CAAe;QAW5C,IAAI,CAAC,KAAK,GAAG,6BAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAE/C,MAAM,yBAAyB,GAAG,IAAA,wDAAsC,EACvE,OAAO,CAAC,mBAAmB,CAC3B,CAAC;QAC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AAM,CAAC,CAC9B,CAAC;IACH,CAAC;CACD;AAjLD,4CAiLC","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 type { IChannelStorageService } from \"@fluidframework/datastore-definitions/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\nimport type {\n\tIExperimentalIncrementalSummaryContext,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport type { SummaryTreeBuilder } from \"@fluidframework/runtime-utils/internal\";\n\nimport type { CodecWriteOptions } from \"../../codec/index.js\";\nimport {\n\ttype DeltaDetachedNodeBuild,\n\ttype DeltaFieldChanges,\n\ttype FieldKey,\n\ttype IEditableForest,\n\ttype ITreeCursorSynchronous,\n\ttype ITreeSubscriptionCursor,\n\tTreeNavigationResult,\n\tapplyDelta,\n\tforEachField,\n\tmakeDetachedFieldIndex,\n} from \"../../core/index.js\";\nimport {\n\tVersionedSummarizer,\n\ttype Summarizable,\n\ttype SummaryElementParser,\n\ttype SummaryElementStringifier,\n} from \"../../shared-tree-core/index.js\";\nimport {\n\tidAllocatorFromMaxId,\n\treadAndParseSnapshotBlob,\n\ttype JsonCompatibleReadOnly,\n} from \"../../util/index.js\";\n// eslint-disable-next-line import-x/no-internal-modules\nimport { chunkFieldSingle, defaultChunkPolicy } from \"../chunked-forest/chunkTree.js\";\nimport {\n\tdefaultIncrementalEncodingPolicy,\n\ttype FieldBatchDecodingContext,\n\ttype FieldBatchEncodingContext,\n\ttype IncrementalEncodingPolicy,\n} from \"../chunked-forest/index.js\";\nimport { TreeCompressionStrategy } from \"../treeCompressionUtils.js\";\n\nimport { forestCodecBuilder, type ForestCodec } from \"./codec.js\";\nimport {\n\tForestIncrementalSummaryBehavior,\n\tForestIncrementalSummaryBuilder,\n} from \"./incrementalSummaryBuilder.js\";\nimport {\n\tForestSummaryFormatVersion,\n\tforestSummaryKey,\n\tsupportedForestSummaryFormatVersions,\n} from \"./summaryFormatCommon.js\";\nimport {\n\tminVersionToForestSummaryFormatVersion,\n\tgetForestRootSummaryContentKey,\n} from \"./summaryTypes.js\";\n\n/**\n * Provides methods for summarizing and loading a forest.\n */\nexport class ForestSummarizer\n\textends VersionedSummarizer<ForestSummaryFormatVersion>\n\timplements Summarizable\n{\n\tprivate readonly codec: ForestCodec;\n\n\tprivate readonly incrementalSummaryBuilder: ForestIncrementalSummaryBuilder;\n\tprivate readonly forestRootSummaryContentKey: string;\n\n\t/**\n\t * @param encoderContext - The schema if provided here must be mutated by the caller to keep it up to date.\n\t */\n\tpublic constructor(\n\t\tprivate readonly forest: IEditableForest,\n\t\tprivate readonly encoderContext: FieldBatchEncodingContext,\n\t\tprivate readonly decoderContext: FieldBatchDecodingContext,\n\t\toptions: CodecWriteOptions,\n\t\tprivate readonly idCompressor: IIdCompressor,\n\t\tinitialSequenceNumber: number,\n\t\tshouldEncodeIncrementally: IncrementalEncodingPolicy = defaultIncrementalEncodingPolicy,\n\t) {\n\t\tsuper(\n\t\t\tforestSummaryKey,\n\t\t\tminVersionToForestSummaryFormatVersion(options.minVersionForCollab),\n\t\t\tsupportedForestSummaryFormatVersions,\n\t\t\ttrue /* supportPreVersioningFormat */,\n\t\t);\n\n\t\tthis.codec = forestCodecBuilder.build(options);\n\n\t\tconst summaryFormatWriteVersion = minVersionToForestSummaryFormatVersion(\n\t\t\toptions.minVersionForCollab,\n\t\t);\n\t\tthis.forestRootSummaryContentKey = getForestRootSummaryContentKey(\n\t\t\tsummaryFormatWriteVersion,\n\t\t);\n\n\t\t// Incremental summary is supported in ForestSummaryFormatVersion.v3 onwards.\n\t\t// Note that even in versions that support it, it is possible that the\n\t\t// FieldBatchCodec will not use incremental encoding (for example if using its v1 formats which does not support it).\n\t\tconst enableIncrementalSummary =\n\t\t\tsummaryFormatWriteVersion >= ForestSummaryFormatVersion.v3 &&\n\t\t\tencoderContext.encodeType === TreeCompressionStrategy.CompressedIncremental;\n\t\tthis.incrementalSummaryBuilder = new ForestIncrementalSummaryBuilder(\n\t\t\tenableIncrementalSummary,\n\t\t\t(cursor: ITreeCursorSynchronous) => this.forest.chunkField(cursor),\n\t\t\tshouldEncodeIncrementally,\n\t\t\tinitialSequenceNumber,\n\t\t);\n\t}\n\n\t/**\n\t * Summarization of the forest's tree content.\n\t * @returns a summary tree containing the forest's tree content.\n\t * @remarks\n\t * If incremental summary is disabled, all the content will be added to a single summary blob.\n\t * If incremental summary is enabled, the summary will be a tree.\n\t * See {@link ForestIncrementalSummaryBuilder} for details of what this tree looks like.\n\t *\n\t * TODO: when perf matters, this should be replaced with a chunked async version using a binary format.\n\t */\n\tprotected summarizeInternal(props: {\n\t\tstringify: SummaryElementStringifier;\n\t\tfullTree?: boolean;\n\t\ttrackState?: boolean;\n\t\ttelemetryContext?: ITelemetryContext;\n\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext;\n\t\tbuilder: SummaryTreeBuilder;\n\t}): void {\n\t\tconst { stringify, fullTree = false, incrementalSummaryContext, builder } = props;\n\n\t\tconst rootCursor = this.forest.getCursorAboveDetachedFields();\n\t\tconst fieldMap: Map<FieldKey, ITreeCursorSynchronous & ITreeSubscriptionCursor> =\n\t\t\tnew Map();\n\t\t// TODO: Encode all detached fields in one operation for better performance and compression\n\t\tforEachField(rootCursor, (cursor) => {\n\t\t\tconst key = cursor.getFieldKey();\n\t\t\tconst innerCursor = this.forest.allocateCursor(\"getTreeString\");\n\t\t\tassert(\n\t\t\t\tthis.forest.tryMoveCursorToField({ fieldKey: key, parent: undefined }, innerCursor) ===\n\t\t\t\t\tTreeNavigationResult.Ok,\n\t\t\t\t0x892 /* failed to navigate to field */,\n\t\t\t);\n\t\t\tfieldMap.set(key, innerCursor as ITreeCursorSynchronous & ITreeSubscriptionCursor);\n\t\t});\n\n\t\t// Let the incremental summary builder know that we are starting a new summary.\n\t\t// It returns whether incremental encoding is enabled.\n\t\tconst incrementalSummaryBehavior = this.incrementalSummaryBuilder.startSummary({\n\t\t\tfullTree,\n\t\t\tincrementalSummaryContext,\n\t\t\tstringify,\n\t\t\tbuilder,\n\t\t});\n\t\tconst encoderContext: FieldBatchEncodingContext = {\n\t\t\t...this.encoderContext,\n\t\t\tincrementalEncoder:\n\t\t\t\tincrementalSummaryBehavior === ForestIncrementalSummaryBehavior.Incremental\n\t\t\t\t\t? this.incrementalSummaryBuilder\n\t\t\t\t\t: undefined,\n\t\t};\n\t\tconst encoded = this.codec.encode(fieldMap, encoderContext);\n\t\tfor (const value of fieldMap.values()) {\n\t\t\tvalue.free();\n\t\t}\n\n\t\tthis.incrementalSummaryBuilder.completeSummary({\n\t\t\tincrementalSummaryContext,\n\t\t\tforestSummaryRootContent: stringify(encoded),\n\t\t\tforestSummaryRootContentKey: this.forestRootSummaryContentKey,\n\t\t\tbuilder,\n\t\t});\n\t}\n\n\tprotected async loadInternal(\n\t\tservices: IChannelStorageService,\n\t\tparse: SummaryElementParser,\n\t\tversion: ForestSummaryFormatVersion | undefined,\n\t): Promise<void> {\n\t\t// Get the key of the summary blob where the top-level forest content is stored based on the summary format version.\n\t\t// If the summary was generated as `ForestIncrementalSummaryBehavior.SingleBlob`, this blob will contain all\n\t\t// of forest's contents.\n\t\t// If the summary was generated as `ForestIncrementalSummaryBehavior.Incremental`, this blob will contain only\n\t\t// the top-level forest node's contents.\n\t\t// The contents of the incremental chunks will be in separate tree nodes and will be read later during decoding.\n\t\tconst forestSummaryRootContentKey = getForestRootSummaryContentKey(version);\n\t\tassert(\n\t\t\tawait services.contains(forestSummaryRootContentKey),\n\t\t\t0xc21 /* Forest summary content missing in snapshot */,\n\t\t);\n\n\t\t// Load the incremental summary builder so that it can download any incremental chunks in the\n\t\t// snapshot.\n\t\tawait this.incrementalSummaryBuilder.load({\n\t\t\tservices,\n\t\t\treadAndParseChunk: async (chunkBlobPath: string) =>\n\t\t\t\treadAndParseSnapshotBlob(chunkBlobPath, services, parse),\n\t\t});\n\n\t\t// TODO: this code is parsing data without an optional validator, this should be defined in a typebox schema as part of the\n\t\t// forest summary format.\n\t\tconst fields = this.codec.decode(\n\t\t\t(await readAndParseSnapshotBlob(\n\t\t\t\tforestSummaryRootContentKey,\n\t\t\t\tservices,\n\t\t\t\tparse,\n\t\t\t\t// TODO: this type cast assumes there are no handles, which should probably be enforced at runtime or the need for this cast should be removed altogether.\n\t\t\t)) as JsonCompatibleReadOnly,\n\t\t\tthis.decoderContext.withIncrementalDecoder(this.incrementalSummaryBuilder),\n\t\t);\n\t\tconst allocator = idAllocatorFromMaxId();\n\t\tconst fieldChanges: [FieldKey, DeltaFieldChanges][] = [];\n\t\tconst build: DeltaDetachedNodeBuild[] = [];\n\t\tfor (const [fieldKey, field] of fields) {\n\t\t\tconst chunked = chunkFieldSingle(field, {\n\t\t\t\tpolicy: defaultChunkPolicy,\n\t\t\t\tidCompressor: this.idCompressor,\n\t\t\t});\n\t\t\tconst buildId = { minor: allocator.allocate(chunked.topLevelLength) };\n\t\t\tbuild.push({\n\t\t\t\tid: buildId,\n\t\t\t\ttrees: chunked,\n\t\t\t});\n\t\t\tfieldChanges.push([\n\t\t\t\tfieldKey,\n\t\t\t\t{ marks: [{ count: chunked.topLevelLength, attach: buildId }] },\n\t\t\t]);\n\t\t}\n\n\t\tassert(this.forest.isEmpty, 0x797 /* forest must be empty */);\n\t\tapplyDelta(\n\t\t\t{ build, fields: new Map(fieldChanges) },\n\t\t\tundefined,\n\t\t\tthis.forest,\n\t\t\tmakeDetachedFieldIndex(\"init\"),\n\t\t);\n\t}\n}\n"]}
@@ -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,kB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BAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACnC,KAAK,oBAAoB,EACzB,+BAA+B,EAC/B,eAAe,EACf,eAAe,EACf,KAAK,QAAQ,GACb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,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"}
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,0BAA0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B,EACvB,KAAK,sBAAsB,EAC3B,cAAc,EACd,WAAW,EAEX,cAAc,EACd,4BAA4B,EAC5B,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,yBAAyB,EACzB,UAAU,EACV,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACnC,KAAK,oBAAoB,EACzB,+BAA+B,EAC/B,eAAe,EACf,eAAe,EACf,KAAK,QAAQ,GACb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,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"}
@@ -4,8 +4,9 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.makeTreeChunker = exports.FieldBatchFormatVersion = exports.defaultChunkPolicy = exports.buildChunkedForest = exports.chunkFieldSingle = exports.chunkField = exports.chunkTree = exports.mapRootChanges = exports.minimizeModularChangeset = exports.ModularChangeFormatVersion = exports.DefaultRevisionReplacer = exports.isNeverTree = exports.updateRefreshers = exports.EncodedModularChangesetV2 = exports.EncodedModularChangesetV1 = exports.ModularChangeFamily = exports.genericFieldKind = exports.allowsRepoSuperset = exports.FlexFieldKind = exports.CrossFieldTarget = exports.makeModularChangeCodecFamily = exports.ModularEditBuilder = exports.isNeverField = exports.SequenceField = exports.buildNodeComparator = exports.jsonableTreeFromForest = exports.jsonableTreeFromFieldCursor = exports.jsonableTreeFromCursor = exports.cursorForJsonableTreeField = exports.cursorForJsonableTreeNode = exports.stackTreeFieldCursor = exports.prefixFieldPath = exports.prefixPath = exports.stackTreeNodeCursor = exports.schemaCodecBuilder = exports.SchemaSummarizer = exports.buildForest = exports.mapTreeWithField = exports.mapTreeFieldsWithField = exports.mapTreeFieldFromCursor = exports.mapTreeFromCursor = exports.cursorForMapTreeNode = exports.cursorForMapTreeField = exports.ForestFormatVersion = exports.forestCodecBuilder = exports.ForestSummarizer = exports.isTreeValue = exports.assertAllowedValue = exports.allowsValue = exports.toDownPath = void 0;
8
- exports.setInChangeAtomIdMap = exports.getFromChangeAtomIdMap = exports.newChangeAtomIdBTree = exports.hasElement = exports.AnchorTreeIndex = exports.makeMitigatedChangeFamily = exports.EncodedSchemaChange = exports.makeSchemaChangeCodec = exports.DetachedFieldIndexSummarizer = exports.valueSchemaAllows = exports.TreeCompressionStrategy = exports.withObservation = exports.currentObserver = exports.getOrCreateHydratedFlexTreeNode = exports.FlexTreeEntityKind = exports.indexForAt = exports.treeStatusFromAnchorCache = exports.LazyEntity = exports.getSchemaAndPolicy = exports.flexTreeSlot = exports.assertFlexTreeEntityNotFreed = exports.flexTreeMarker = exports.ContextSlot = exports.isFlexTreeNode = exports.Context = exports.TreeStatus = exports.throwOutOfSchema = exports.isFieldInSchema = exports.isNodeInSchema = exports.SchemaValidationError = exports.getCodecTreeForModularChangeFormat = exports.relevantRemovedRoots = exports.intoDelta = exports.fieldKindConfigurations = exports.fieldKinds = exports.defaultSchemaPolicy = exports.DefaultEditBuilder = exports.DefaultChangeFamily = exports.FieldKinds = exports.nodeKeyTreeIdentifier = exports.MockNodeIdentifierManager = exports.isStableNodeIdentifier = exports.createNodeIdentifierManager = exports.compareLocalNodeIdentifiers = exports.defaultIncrementalEncodingPolicy = exports.combineChunks = exports.emptyChunk = exports.FieldBatchDecodingContext = exports.fieldBatchCodecBuilder = void 0;
7
+ exports.buildChunkedForest = exports.chunkFieldSingle = exports.chunkField = exports.chunkTree = exports.mapRootChanges = exports.minimizeModularChangeset = exports.ModularChangeFormatVersion = exports.DefaultRevisionReplacer = exports.isNeverTree = exports.updateRefreshers = exports.EncodedModularChangesetV2 = exports.EncodedModularChangesetV1 = exports.ModularChangeFamily = exports.genericFieldKind = exports.allowsRepoSuperset = exports.FlexFieldKind = exports.CrossFieldTarget = exports.makeModularChangeCodecFamily = exports.ModularEditBuilder = exports.isNeverField = exports.SequenceField = exports.buildNodeComparator = exports.assertForestsEqual = exports.forestsEqual = exports.jsonableTreeFromForest = exports.jsonableTreeFromFieldCursor = exports.jsonableTreeFromCursor = exports.cursorForJsonableTreeField = exports.cursorForJsonableTreeNode = exports.stackTreeFieldCursor = exports.prefixFieldPath = exports.prefixPath = exports.stackTreeNodeCursor = exports.schemaCodecBuilder = exports.SchemaSummarizer = exports.ComparisonForest = exports.buildForest = exports.mapTreeWithField = exports.mapTreeFieldsWithField = exports.mapTreeFieldFromCursor = exports.mapTreeFromCursor = exports.cursorForMapTreeNode = exports.cursorForMapTreeField = exports.ForestFormatVersion = exports.forestCodecBuilder = exports.ForestSummarizer = exports.isTreeValue = exports.assertAllowedValue = exports.allowsValue = exports.toDownPath = void 0;
8
+ exports.newChangeAtomIdBTree = exports.hasElement = exports.AnchorTreeIndex = exports.makeMitigatedChangeFamily = exports.EncodedSchemaChange = exports.makeSchemaChangeCodec = exports.DetachedFieldIndexSummarizer = exports.valueSchemaAllows = exports.TreeCompressionStrategy = exports.withObservation = exports.currentObserver = exports.getOrCreateHydratedFlexTreeNode = exports.FlexTreeEntityKind = exports.indexForAt = exports.treeStatusFromAnchorCache = exports.LazyEntity = exports.getSchemaAndPolicy = exports.flexTreeSlot = exports.assertFlexTreeEntityNotFreed = exports.flexTreeMarker = exports.ContextSlot = exports.isFlexTreeNode = exports.Context = exports.TreeStatus = exports.throwOutOfSchema = exports.isFieldInSchema = exports.isNodeInSchema = exports.SchemaValidationError = exports.getCodecTreeForModularChangeFormat = exports.relevantRemovedRoots = exports.intoDelta = exports.fieldKindConfigurations = exports.fieldKinds = exports.defaultSchemaPolicy = exports.DefaultEditBuilder = exports.DefaultChangeFamily = exports.FieldKinds = exports.nodeKeyTreeIdentifier = exports.MockNodeIdentifierManager = exports.isStableNodeIdentifier = exports.createNodeIdentifierManager = exports.compareLocalNodeIdentifiers = exports.defaultIncrementalEncodingPolicy = exports.combineChunks = exports.emptyChunk = exports.FieldBatchDecodingContext = exports.fieldBatchCodecBuilder = exports.makeTreeChunker = exports.FieldBatchFormatVersion = exports.defaultChunkPolicy = void 0;
9
+ exports.setInChangeAtomIdMap = exports.getFromChangeAtomIdMap = void 0;
9
10
  const tslib_1 = require("tslib");
10
11
  var editableTreeBinder_js_1 = require("./editableTreeBinder.js");
11
12
  Object.defineProperty(exports, "toDownPath", { enumerable: true, get: function () { return editableTreeBinder_js_1.toDownPath; } });
@@ -26,9 +27,11 @@ Object.defineProperty(exports, "mapTreeFieldsWithField", { enumerable: true, get
26
27
  Object.defineProperty(exports, "mapTreeWithField", { enumerable: true, get: function () { return mapTreeCursor_js_1.mapTreeWithField; } });
27
28
  var index_js_2 = require("./object-forest/index.js");
28
29
  Object.defineProperty(exports, "buildForest", { enumerable: true, get: function () { return index_js_2.buildForest; } });
29
- var index_js_3 = require("./schema-index/index.js");
30
- Object.defineProperty(exports, "SchemaSummarizer", { enumerable: true, get: function () { return index_js_3.SchemaSummarizer; } });
31
- Object.defineProperty(exports, "schemaCodecBuilder", { enumerable: true, get: function () { return index_js_3.schemaCodecBuilder; } });
30
+ var index_js_3 = require("./comparison-forest/index.js");
31
+ Object.defineProperty(exports, "ComparisonForest", { enumerable: true, get: function () { return index_js_3.ComparisonForest; } });
32
+ var index_js_4 = require("./schema-index/index.js");
33
+ Object.defineProperty(exports, "SchemaSummarizer", { enumerable: true, get: function () { return index_js_4.SchemaSummarizer; } });
34
+ Object.defineProperty(exports, "schemaCodecBuilder", { enumerable: true, get: function () { return index_js_4.schemaCodecBuilder; } });
32
35
  var treeCursorUtils_js_1 = require("./treeCursorUtils.js");
33
36
  Object.defineProperty(exports, "stackTreeNodeCursor", { enumerable: true, get: function () { return treeCursorUtils_js_1.stackTreeNodeCursor; } });
34
37
  Object.defineProperty(exports, "prefixPath", { enumerable: true, get: function () { return treeCursorUtils_js_1.prefixPath; } });
@@ -40,93 +43,95 @@ Object.defineProperty(exports, "cursorForJsonableTreeField", { enumerable: true,
40
43
  Object.defineProperty(exports, "jsonableTreeFromCursor", { enumerable: true, get: function () { return treeTextCursor_js_1.jsonableTreeFromCursor; } });
41
44
  Object.defineProperty(exports, "jsonableTreeFromFieldCursor", { enumerable: true, get: function () { return treeTextCursor_js_1.jsonableTreeFromFieldCursor; } });
42
45
  Object.defineProperty(exports, "jsonableTreeFromForest", { enumerable: true, get: function () { return treeTextCursor_js_1.jsonableTreeFromForest; } });
46
+ Object.defineProperty(exports, "forestsEqual", { enumerable: true, get: function () { return treeTextCursor_js_1.forestsEqual; } });
47
+ Object.defineProperty(exports, "assertForestsEqual", { enumerable: true, get: function () { return treeTextCursor_js_1.assertForestsEqual; } });
43
48
  var cursorComparator_js_1 = require("./cursorComparator.js");
44
49
  Object.defineProperty(exports, "buildNodeComparator", { enumerable: true, get: function () { return cursorComparator_js_1.buildNodeComparator; } });
45
50
  const SequenceField = tslib_1.__importStar(require("./sequence-field/index.js"));
46
51
  exports.SequenceField = SequenceField;
47
- var index_js_4 = require("./modular-schema/index.js");
48
- Object.defineProperty(exports, "isNeverField", { enumerable: true, get: function () { return index_js_4.isNeverField; } });
49
- Object.defineProperty(exports, "ModularEditBuilder", { enumerable: true, get: function () { return index_js_4.ModularEditBuilder; } });
50
- Object.defineProperty(exports, "makeModularChangeCodecFamily", { enumerable: true, get: function () { return index_js_4.makeModularChangeCodecFamily; } });
51
- Object.defineProperty(exports, "CrossFieldTarget", { enumerable: true, get: function () { return index_js_4.CrossFieldTarget; } });
52
- Object.defineProperty(exports, "FlexFieldKind", { enumerable: true, get: function () { return index_js_4.FlexFieldKind; } });
53
- Object.defineProperty(exports, "allowsRepoSuperset", { enumerable: true, get: function () { return index_js_4.allowsRepoSuperset; } });
54
- Object.defineProperty(exports, "genericFieldKind", { enumerable: true, get: function () { return index_js_4.genericFieldKind; } });
55
- Object.defineProperty(exports, "ModularChangeFamily", { enumerable: true, get: function () { return index_js_4.ModularChangeFamily; } });
56
- Object.defineProperty(exports, "EncodedModularChangesetV1", { enumerable: true, get: function () { return index_js_4.EncodedModularChangesetV1; } });
57
- Object.defineProperty(exports, "EncodedModularChangesetV2", { enumerable: true, get: function () { return index_js_4.EncodedModularChangesetV2; } });
58
- Object.defineProperty(exports, "updateRefreshers", { enumerable: true, get: function () { return index_js_4.updateRefreshers; } });
59
- Object.defineProperty(exports, "isNeverTree", { enumerable: true, get: function () { return index_js_4.isNeverTree; } });
60
- Object.defineProperty(exports, "DefaultRevisionReplacer", { enumerable: true, get: function () { return index_js_4.DefaultRevisionReplacer; } });
61
- Object.defineProperty(exports, "ModularChangeFormatVersion", { enumerable: true, get: function () { return index_js_4.ModularChangeFormatVersion; } });
62
- Object.defineProperty(exports, "minimizeModularChangeset", { enumerable: true, get: function () { return index_js_4.minimizeModularChangeset; } });
52
+ var index_js_5 = require("./modular-schema/index.js");
53
+ Object.defineProperty(exports, "isNeverField", { enumerable: true, get: function () { return index_js_5.isNeverField; } });
54
+ Object.defineProperty(exports, "ModularEditBuilder", { enumerable: true, get: function () { return index_js_5.ModularEditBuilder; } });
55
+ Object.defineProperty(exports, "makeModularChangeCodecFamily", { enumerable: true, get: function () { return index_js_5.makeModularChangeCodecFamily; } });
56
+ Object.defineProperty(exports, "CrossFieldTarget", { enumerable: true, get: function () { return index_js_5.CrossFieldTarget; } });
57
+ Object.defineProperty(exports, "FlexFieldKind", { enumerable: true, get: function () { return index_js_5.FlexFieldKind; } });
58
+ Object.defineProperty(exports, "allowsRepoSuperset", { enumerable: true, get: function () { return index_js_5.allowsRepoSuperset; } });
59
+ Object.defineProperty(exports, "genericFieldKind", { enumerable: true, get: function () { return index_js_5.genericFieldKind; } });
60
+ Object.defineProperty(exports, "ModularChangeFamily", { enumerable: true, get: function () { return index_js_5.ModularChangeFamily; } });
61
+ Object.defineProperty(exports, "EncodedModularChangesetV1", { enumerable: true, get: function () { return index_js_5.EncodedModularChangesetV1; } });
62
+ Object.defineProperty(exports, "EncodedModularChangesetV2", { enumerable: true, get: function () { return index_js_5.EncodedModularChangesetV2; } });
63
+ Object.defineProperty(exports, "updateRefreshers", { enumerable: true, get: function () { return index_js_5.updateRefreshers; } });
64
+ Object.defineProperty(exports, "isNeverTree", { enumerable: true, get: function () { return index_js_5.isNeverTree; } });
65
+ Object.defineProperty(exports, "DefaultRevisionReplacer", { enumerable: true, get: function () { return index_js_5.DefaultRevisionReplacer; } });
66
+ Object.defineProperty(exports, "ModularChangeFormatVersion", { enumerable: true, get: function () { return index_js_5.ModularChangeFormatVersion; } });
67
+ Object.defineProperty(exports, "minimizeModularChangeset", { enumerable: true, get: function () { return index_js_5.minimizeModularChangeset; } });
63
68
  var deltaUtils_js_1 = require("./deltaUtils.js");
64
69
  Object.defineProperty(exports, "mapRootChanges", { enumerable: true, get: function () { return deltaUtils_js_1.mapRootChanges; } });
65
- var index_js_5 = require("./chunked-forest/index.js");
66
- Object.defineProperty(exports, "chunkTree", { enumerable: true, get: function () { return index_js_5.chunkTree; } });
67
- Object.defineProperty(exports, "chunkField", { enumerable: true, get: function () { return index_js_5.chunkField; } });
68
- Object.defineProperty(exports, "chunkFieldSingle", { enumerable: true, get: function () { return index_js_5.chunkFieldSingle; } });
69
- Object.defineProperty(exports, "buildChunkedForest", { enumerable: true, get: function () { return index_js_5.buildChunkedForest; } });
70
- Object.defineProperty(exports, "defaultChunkPolicy", { enumerable: true, get: function () { return index_js_5.defaultChunkPolicy; } });
71
- Object.defineProperty(exports, "FieldBatchFormatVersion", { enumerable: true, get: function () { return index_js_5.FieldBatchFormatVersion; } });
72
- Object.defineProperty(exports, "makeTreeChunker", { enumerable: true, get: function () { return index_js_5.makeTreeChunker; } });
73
- Object.defineProperty(exports, "fieldBatchCodecBuilder", { enumerable: true, get: function () { return index_js_5.fieldBatchCodecBuilder; } });
74
- Object.defineProperty(exports, "FieldBatchDecodingContext", { enumerable: true, get: function () { return index_js_5.FieldBatchDecodingContext; } });
75
- Object.defineProperty(exports, "emptyChunk", { enumerable: true, get: function () { return index_js_5.emptyChunk; } });
76
- Object.defineProperty(exports, "combineChunks", { enumerable: true, get: function () { return index_js_5.combineChunks; } });
77
- Object.defineProperty(exports, "defaultIncrementalEncodingPolicy", { enumerable: true, get: function () { return index_js_5.defaultIncrementalEncodingPolicy; } });
78
- var index_js_6 = require("./node-identifier/index.js");
79
- Object.defineProperty(exports, "compareLocalNodeIdentifiers", { enumerable: true, get: function () { return index_js_6.compareLocalNodeIdentifiers; } });
80
- Object.defineProperty(exports, "createNodeIdentifierManager", { enumerable: true, get: function () { return index_js_6.createNodeIdentifierManager; } });
81
- Object.defineProperty(exports, "isStableNodeIdentifier", { enumerable: true, get: function () { return index_js_6.isStableNodeIdentifier; } });
82
- Object.defineProperty(exports, "MockNodeIdentifierManager", { enumerable: true, get: function () { return index_js_6.MockNodeIdentifierManager; } });
83
- Object.defineProperty(exports, "nodeKeyTreeIdentifier", { enumerable: true, get: function () { return index_js_6.nodeKeyTreeIdentifier; } });
84
- var index_js_7 = require("./default-schema/index.js");
85
- Object.defineProperty(exports, "FieldKinds", { enumerable: true, get: function () { return index_js_7.FieldKinds; } });
86
- Object.defineProperty(exports, "DefaultChangeFamily", { enumerable: true, get: function () { return index_js_7.DefaultChangeFamily; } });
87
- Object.defineProperty(exports, "DefaultEditBuilder", { enumerable: true, get: function () { return index_js_7.DefaultEditBuilder; } });
88
- Object.defineProperty(exports, "defaultSchemaPolicy", { enumerable: true, get: function () { return index_js_7.defaultSchemaPolicy; } });
89
- Object.defineProperty(exports, "fieldKinds", { enumerable: true, get: function () { return index_js_7.fieldKinds; } });
90
- Object.defineProperty(exports, "fieldKindConfigurations", { enumerable: true, get: function () { return index_js_7.fieldKindConfigurations; } });
91
- Object.defineProperty(exports, "intoDelta", { enumerable: true, get: function () { return index_js_7.intoDelta; } });
92
- Object.defineProperty(exports, "relevantRemovedRoots", { enumerable: true, get: function () { return index_js_7.relevantRemovedRoots; } });
93
- Object.defineProperty(exports, "getCodecTreeForModularChangeFormat", { enumerable: true, get: function () { return index_js_7.getCodecTreeForModularChangeFormat; } });
70
+ var index_js_6 = require("./chunked-forest/index.js");
71
+ Object.defineProperty(exports, "chunkTree", { enumerable: true, get: function () { return index_js_6.chunkTree; } });
72
+ Object.defineProperty(exports, "chunkField", { enumerable: true, get: function () { return index_js_6.chunkField; } });
73
+ Object.defineProperty(exports, "chunkFieldSingle", { enumerable: true, get: function () { return index_js_6.chunkFieldSingle; } });
74
+ Object.defineProperty(exports, "buildChunkedForest", { enumerable: true, get: function () { return index_js_6.buildChunkedForest; } });
75
+ Object.defineProperty(exports, "defaultChunkPolicy", { enumerable: true, get: function () { return index_js_6.defaultChunkPolicy; } });
76
+ Object.defineProperty(exports, "FieldBatchFormatVersion", { enumerable: true, get: function () { return index_js_6.FieldBatchFormatVersion; } });
77
+ Object.defineProperty(exports, "makeTreeChunker", { enumerable: true, get: function () { return index_js_6.makeTreeChunker; } });
78
+ Object.defineProperty(exports, "fieldBatchCodecBuilder", { enumerable: true, get: function () { return index_js_6.fieldBatchCodecBuilder; } });
79
+ Object.defineProperty(exports, "FieldBatchDecodingContext", { enumerable: true, get: function () { return index_js_6.FieldBatchDecodingContext; } });
80
+ Object.defineProperty(exports, "emptyChunk", { enumerable: true, get: function () { return index_js_6.emptyChunk; } });
81
+ Object.defineProperty(exports, "combineChunks", { enumerable: true, get: function () { return index_js_6.combineChunks; } });
82
+ Object.defineProperty(exports, "defaultIncrementalEncodingPolicy", { enumerable: true, get: function () { return index_js_6.defaultIncrementalEncodingPolicy; } });
83
+ var index_js_7 = require("./node-identifier/index.js");
84
+ Object.defineProperty(exports, "compareLocalNodeIdentifiers", { enumerable: true, get: function () { return index_js_7.compareLocalNodeIdentifiers; } });
85
+ Object.defineProperty(exports, "createNodeIdentifierManager", { enumerable: true, get: function () { return index_js_7.createNodeIdentifierManager; } });
86
+ Object.defineProperty(exports, "isStableNodeIdentifier", { enumerable: true, get: function () { return index_js_7.isStableNodeIdentifier; } });
87
+ Object.defineProperty(exports, "MockNodeIdentifierManager", { enumerable: true, get: function () { return index_js_7.MockNodeIdentifierManager; } });
88
+ Object.defineProperty(exports, "nodeKeyTreeIdentifier", { enumerable: true, get: function () { return index_js_7.nodeKeyTreeIdentifier; } });
89
+ var index_js_8 = require("./default-schema/index.js");
90
+ Object.defineProperty(exports, "FieldKinds", { enumerable: true, get: function () { return index_js_8.FieldKinds; } });
91
+ Object.defineProperty(exports, "DefaultChangeFamily", { enumerable: true, get: function () { return index_js_8.DefaultChangeFamily; } });
92
+ Object.defineProperty(exports, "DefaultEditBuilder", { enumerable: true, get: function () { return index_js_8.DefaultEditBuilder; } });
93
+ Object.defineProperty(exports, "defaultSchemaPolicy", { enumerable: true, get: function () { return index_js_8.defaultSchemaPolicy; } });
94
+ Object.defineProperty(exports, "fieldKinds", { enumerable: true, get: function () { return index_js_8.fieldKinds; } });
95
+ Object.defineProperty(exports, "fieldKindConfigurations", { enumerable: true, get: function () { return index_js_8.fieldKindConfigurations; } });
96
+ Object.defineProperty(exports, "intoDelta", { enumerable: true, get: function () { return index_js_8.intoDelta; } });
97
+ Object.defineProperty(exports, "relevantRemovedRoots", { enumerable: true, get: function () { return index_js_8.relevantRemovedRoots; } });
98
+ Object.defineProperty(exports, "getCodecTreeForModularChangeFormat", { enumerable: true, get: function () { return index_js_8.getCodecTreeForModularChangeFormat; } });
94
99
  var schemaChecker_js_1 = require("./schemaChecker.js");
95
100
  Object.defineProperty(exports, "SchemaValidationError", { enumerable: true, get: function () { return schemaChecker_js_1.SchemaValidationError; } });
96
101
  Object.defineProperty(exports, "isNodeInSchema", { enumerable: true, get: function () { return schemaChecker_js_1.isNodeInSchema; } });
97
102
  Object.defineProperty(exports, "isFieldInSchema", { enumerable: true, get: function () { return schemaChecker_js_1.isFieldInSchema; } });
98
103
  Object.defineProperty(exports, "throwOutOfSchema", { enumerable: true, get: function () { return schemaChecker_js_1.throwOutOfSchema; } });
99
- var index_js_8 = require("./flex-tree/index.js");
100
- Object.defineProperty(exports, "TreeStatus", { enumerable: true, get: function () { return index_js_8.TreeStatus; } });
101
- Object.defineProperty(exports, "Context", { enumerable: true, get: function () { return index_js_8.Context; } });
102
- Object.defineProperty(exports, "isFlexTreeNode", { enumerable: true, get: function () { return index_js_8.isFlexTreeNode; } });
103
- Object.defineProperty(exports, "ContextSlot", { enumerable: true, get: function () { return index_js_8.ContextSlot; } });
104
+ var index_js_9 = require("./flex-tree/index.js");
105
+ Object.defineProperty(exports, "TreeStatus", { enumerable: true, get: function () { return index_js_9.TreeStatus; } });
106
+ Object.defineProperty(exports, "Context", { enumerable: true, get: function () { return index_js_9.Context; } });
107
+ Object.defineProperty(exports, "isFlexTreeNode", { enumerable: true, get: function () { return index_js_9.isFlexTreeNode; } });
108
+ Object.defineProperty(exports, "ContextSlot", { enumerable: true, get: function () { return index_js_9.ContextSlot; } });
104
109
  // Internal
105
- Object.defineProperty(exports, "flexTreeMarker", { enumerable: true, get: function () { return index_js_8.flexTreeMarker; } });
106
- Object.defineProperty(exports, "assertFlexTreeEntityNotFreed", { enumerable: true, get: function () { return index_js_8.assertFlexTreeEntityNotFreed; } });
107
- Object.defineProperty(exports, "flexTreeSlot", { enumerable: true, get: function () { return index_js_8.flexTreeSlot; } });
108
- Object.defineProperty(exports, "getSchemaAndPolicy", { enumerable: true, get: function () { return index_js_8.getSchemaAndPolicy; } });
109
- Object.defineProperty(exports, "LazyEntity", { enumerable: true, get: function () { return index_js_8.LazyEntity; } });
110
- Object.defineProperty(exports, "treeStatusFromAnchorCache", { enumerable: true, get: function () { return index_js_8.treeStatusFromAnchorCache; } });
111
- Object.defineProperty(exports, "indexForAt", { enumerable: true, get: function () { return index_js_8.indexForAt; } });
112
- Object.defineProperty(exports, "FlexTreeEntityKind", { enumerable: true, get: function () { return index_js_8.FlexTreeEntityKind; } });
113
- Object.defineProperty(exports, "getOrCreateHydratedFlexTreeNode", { enumerable: true, get: function () { return index_js_8.getOrCreateHydratedFlexTreeNode; } });
114
- Object.defineProperty(exports, "currentObserver", { enumerable: true, get: function () { return index_js_8.currentObserver; } });
115
- Object.defineProperty(exports, "withObservation", { enumerable: true, get: function () { return index_js_8.withObservation; } });
110
+ Object.defineProperty(exports, "flexTreeMarker", { enumerable: true, get: function () { return index_js_9.flexTreeMarker; } });
111
+ Object.defineProperty(exports, "assertFlexTreeEntityNotFreed", { enumerable: true, get: function () { return index_js_9.assertFlexTreeEntityNotFreed; } });
112
+ Object.defineProperty(exports, "flexTreeSlot", { enumerable: true, get: function () { return index_js_9.flexTreeSlot; } });
113
+ Object.defineProperty(exports, "getSchemaAndPolicy", { enumerable: true, get: function () { return index_js_9.getSchemaAndPolicy; } });
114
+ Object.defineProperty(exports, "LazyEntity", { enumerable: true, get: function () { return index_js_9.LazyEntity; } });
115
+ Object.defineProperty(exports, "treeStatusFromAnchorCache", { enumerable: true, get: function () { return index_js_9.treeStatusFromAnchorCache; } });
116
+ Object.defineProperty(exports, "indexForAt", { enumerable: true, get: function () { return index_js_9.indexForAt; } });
117
+ Object.defineProperty(exports, "FlexTreeEntityKind", { enumerable: true, get: function () { return index_js_9.FlexTreeEntityKind; } });
118
+ Object.defineProperty(exports, "getOrCreateHydratedFlexTreeNode", { enumerable: true, get: function () { return index_js_9.getOrCreateHydratedFlexTreeNode; } });
119
+ Object.defineProperty(exports, "currentObserver", { enumerable: true, get: function () { return index_js_9.currentObserver; } });
120
+ Object.defineProperty(exports, "withObservation", { enumerable: true, get: function () { return index_js_9.withObservation; } });
116
121
  var treeCompressionUtils_js_1 = require("./treeCompressionUtils.js");
117
122
  Object.defineProperty(exports, "TreeCompressionStrategy", { enumerable: true, get: function () { return treeCompressionUtils_js_1.TreeCompressionStrategy; } });
118
123
  var valueUtilities_js_2 = require("./valueUtilities.js");
119
124
  Object.defineProperty(exports, "valueSchemaAllows", { enumerable: true, get: function () { return valueUtilities_js_2.valueSchemaAllows; } });
120
125
  var detachedFieldIndexSummarizer_js_1 = require("./detachedFieldIndexSummarizer.js");
121
126
  Object.defineProperty(exports, "DetachedFieldIndexSummarizer", { enumerable: true, get: function () { return detachedFieldIndexSummarizer_js_1.DetachedFieldIndexSummarizer; } });
122
- var index_js_9 = require("./schema-edits/index.js");
123
- Object.defineProperty(exports, "makeSchemaChangeCodec", { enumerable: true, get: function () { return index_js_9.makeSchemaChangeCodec; } });
124
- Object.defineProperty(exports, "EncodedSchemaChange", { enumerable: true, get: function () { return index_js_9.EncodedSchemaChange; } });
127
+ var index_js_10 = require("./schema-edits/index.js");
128
+ Object.defineProperty(exports, "makeSchemaChangeCodec", { enumerable: true, get: function () { return index_js_10.makeSchemaChangeCodec; } });
129
+ Object.defineProperty(exports, "EncodedSchemaChange", { enumerable: true, get: function () { return index_js_10.EncodedSchemaChange; } });
125
130
  var mitigatedChangeFamily_js_1 = require("./mitigatedChangeFamily.js");
126
131
  Object.defineProperty(exports, "makeMitigatedChangeFamily", { enumerable: true, get: function () { return mitigatedChangeFamily_js_1.makeMitigatedChangeFamily; } });
127
- var index_js_10 = require("./indexing/index.js");
128
- Object.defineProperty(exports, "AnchorTreeIndex", { enumerable: true, get: function () { return index_js_10.AnchorTreeIndex; } });
129
- Object.defineProperty(exports, "hasElement", { enumerable: true, get: function () { return index_js_10.hasElement; } });
132
+ var index_js_11 = require("./indexing/index.js");
133
+ Object.defineProperty(exports, "AnchorTreeIndex", { enumerable: true, get: function () { return index_js_11.AnchorTreeIndex; } });
134
+ Object.defineProperty(exports, "hasElement", { enumerable: true, get: function () { return index_js_11.hasElement; } });
130
135
  var changeAtomIdBTree_js_1 = require("./changeAtomIdBTree.js");
131
136
  Object.defineProperty(exports, "newChangeAtomIdBTree", { enumerable: true, get: function () { return changeAtomIdBTree_js_1.newChangeAtomIdBTree; } });
132
137
  Object.defineProperty(exports, "getFromChangeAtomIdMap", { enumerable: true, get: function () { return changeAtomIdBTree_js_1.getFromChangeAtomIdMap; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;AAEH,iEAGiC;AADhC,mHAAA,UAAU,OAAA;AAEX,yDAAmF;AAA1E,gHAAA,WAAW,OAAA;AAAE,uHAAA,kBAAkB,OAAA;AAAE,gHAAA,WAAW,OAAA;AAErD,sDAImC;AAHlC,4GAAA,gBAAgB,OAAA;AAChB,8GAAA,kBAAkB,OAAA;AAClB,+GAAA,mBAAmB,OAAA;AAEpB,uDAW4B;AAV3B,yHAAA,qBAAqB,OAAA;AACrB,wHAAA,oBAAoB,OAAA;AACpB,qHAAA,iBAAiB,OAAA;AACjB,0HAAA,sBAAsB,OAAA;AAEtB,0HAAA,sBAAsB,OAAA;AACtB,oHAAA,gBAAgB,OAAA;AAKjB,qDAAuD;AAA9C,uGAAA,WAAW,OAAA;AACpB,oDAGiC;AAFhC,4GAAA,gBAAgB,OAAA;AAChB,8GAAA,kBAAkB,OAAA;AAEnB,2DAO8B;AAN7B,yHAAA,mBAAmB,OAAA;AAEnB,gHAAA,UAAU,OAAA;AACV,qHAAA,eAAe,OAAA;AAEf,0HAAA,oBAAoB,OAAA;AAErB,yDAM6B;AAL5B,8HAAA,yBAAyB,OAAA;AACzB,+HAAA,0BAA0B,OAAA;AAC1B,2HAAA,sBAAsB,OAAA;AACtB,gIAAA,2BAA2B,OAAA;AAC3B,2HAAA,sBAAsB,OAAA;AAEvB,6DAG+B;AAF9B,0HAAA,mBAAmB,OAAA;AAIpB,iFAA2D;AAElD,sCAAa;AAEt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B;AAL3B,yHAAA,qBAAqB,OAAA;AAErB,kHAAA,cAAc,OAAA;AACd,mHAAA,eAAe,OAAA;AACf,oHAAA,gBAAgB,OAAA;AAGjB,iDAiC8B;AAvB7B,sGAAA,UAAU,OAAA;AACV,mGAAA,OAAO,OAAA;AAGP,0GAAA,cAAc,OAAA;AACd,uGAAA,WAAW,OAAA;AACX,WAAW;AACX,0GAAA,cAAc,OAAA;AACd,wHAAA,4BAA4B,OAAA;AAC5B,wGAAA,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAClB,sGAAA,UAAU,OAAA;AACV,qHAAA,yBAAyB,OAAA;AACzB,sGAAA,UAAU,OAAA;AACV,8GAAA,kBAAkB,OAAA;AAKlB,2HAAA,+BAA+B,OAAA;AAC/B,2GAAA,eAAe,OAAA;AACf,2GAAA,eAAe,OAAA;AAIhB,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAEhC,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAE1B,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AAErC,oDAIiC;AAFhC,iHAAA,qBAAqB,OAAA;AACrB,+GAAA,mBAAmB,OAAA;AAGpB,uEAAuE;AAA9D,qIAAA,yBAAyB,OAAA;AAElC,iDAM6B;AAJ5B,4GAAA,eAAe,OAAA;AACf,uGAAA,UAAU,OAAA;AAKX,+DAKgC;AAH/B,4HAAA,oBAAoB,OAAA;AACpB,8HAAA,sBAAsB,OAAA;AACtB,4HAAA,oBAAoB,OAAA","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 {\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;;;;;;A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AAc,OAAA;AACd,wHAAA,4BAA4B,OAAA;AAC5B,wGAAA,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAClB,sGAAA,UAAU,OAAA;AACV,qHAAA,yBAAyB,OAAA;AACzB,sGAAA,UAAU,OAAA;AACV,8GAAA,kBAAkB,OAAA;AAKlB,2HAAA,+BAA+B,OAAA;AAC/B,2GAAA,eAAe,OAAA;AACf,2GAAA,eAAe,OAAA;AAIhB,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAEhC,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAE1B,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AAErC,qDAIiC;AAFhC,kHAAA,qBAAqB,OAAA;AACrB,gHAAA,mBAAmB,OAAA;AAGpB,uEAAuE;AAA9D,qIAAA,yBAAyB,OAAA;AAElC,iDAM6B;AAJ5B,4GAAA,eAAe,OAAA;AACf,uGAAA,UAAU,OAAA;AAKX,+DAKgC;AAH/B,4HAAA,oBAAoB,OAAA;AACpB,8HAAA,sBAAsB,OAAA;AACtB,4HAAA,oBAAoB,OAAA","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;;;GAGG;AAEH,OAAO,KAAK,EACX,YAAY,EACZ,kBAAkB,EAClB,aAAa,EAKb,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,SAAS,kBAAkB,EAAE,OAAO,EACpF,uBAAuB,EAAE,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,EACvD,cAAc,EAAE,OAAO,EACvB,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAC/B,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAWhC;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAC3C,kBAAkB,EAAE,aAAa,CAAC,OAAO,CAAC,EAC1C,cAAc,EAAE,OAAO,EACvB,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAC/B,aAAa,CAAC,OAAO,CAAC,CA0CxB"}
1
+ {"version":3,"file":"mitigatedChangeFamily.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/mitigatedChangeFamily.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,YAAY,EACZ,kBAAkB,EAClB,aAAa,EAMb,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CACxC,OAAO,SAAS,kBAAkB,EAClC,OAAO,EACP,wBAAwB,EAExB,uBAAuB,EAAE,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,wBAAwB,CAAC,EACjF,cAAc,EAAE,OAAO,EACvB,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAC/B,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,wBAAwB,CAAC,CAwB1D;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAC3C,kBAAkB,EAAE,aAAa,CAAC,OAAO,CAAC,EAC1C,cAAc,EAAE,OAAO,EACvB,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAC/B,aAAa,CAAC,OAAO,CAAC,CA0CxB"}
@@ -26,6 +26,18 @@ function makeMitigatedChangeFamily(unmitigatedChangeFamily, fallbackChange, onEr
26
26
  },
27
27
  rebaser: makeMitigatedRebaser(unmitigatedChangeFamily.rebaser, fallbackChange, onError),
28
28
  codecs: unmitigatedChangeFamily.codecs,
29
+ buildProcessor: (processFn) => {
30
+ const unmitigatedProcessor = unmitigatedChangeFamily.buildProcessor(processFn);
31
+ return (change) => {
32
+ try {
33
+ return unmitigatedProcessor(change);
34
+ }
35
+ catch (error) {
36
+ onError(error);
37
+ return fallbackChange;
38
+ }
39
+ };
40
+ },
29
41
  };
30
42
  }
31
43
  exports.makeMitigatedChangeFamily = makeMitigatedChangeFamily;
@@ -1 +1 @@
1
- {"version":3,"file":"mitigatedChangeFamily.js","sourceRoot":"","sources":["../../src/feature-libraries/mitigatedChangeFamily.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAYH;;;;;;;;;;;;;GAaG;AACH,SAAgB,yBAAyB,CACxC,uBAAuD,EACvD,cAAuB,EACvB,OAAiC;IAEjC,OAAO;QACN,WAAW,EAAE,CACZ,eAAkC,EAClC,cAAuD,EAC7C,EAAE;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;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;AA9CD,oDA8CC","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":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,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;AA9CD,oDA8CC","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,MA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AC,WAAW,EAAE,qBAAqB,CAAC;IAC5C,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,CAAC;CACjD;AAED;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,WAAW,EAAE,qBAAqB,CAAC;IAC5C,UAAU,CAAC,WAAW,EAAE,oBAAoB,GAAG,MAAM,CAAC;CACtD"}
@@ -1 +1 @@
1
- {"version":3,"file":"fieldChangeHandler.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldChangeHandler.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAkMH;;GAEG;AACH,IAAY,gBAiBX;AAjBD,WAAY,gBAAgB;IAC3B;;OAEG;IACH,2DAAM,CAAA;IAEN;;OAEG;IACH,+DAAQ,CAAA;IAER;;;;OAIG;IACH,qFAAmB,CAAA;AACpB,CAAC,EAjBW,gBAAgB,gCAAhB,gBAAgB,QAiB3B;AAED;;;GAGG;AACH,SAAgB,+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;AAZD,0EAYC;AAED,SAAgB,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;AAXD,gEAWC;AAqBD,IAAY,eAGX;AAHD,WAAY,eAAe;IAC1B,6DAAQ,CAAA;IACR,6DAAQ,CAAA;AACT,CAAC,EAHW,eAAe,+BAAf,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,IAAY,gBAiBX;AAjBD,WAAY,gBAAgB;IAC3B;;OAEG;IACH,2DAAM,CAAA;IAEN;;OAEG;IACH,+DAAQ,CAAA;IAER;;;;OAIG;IACH,qFAAmB,CAAA;AACpB,CAAC,EAjBW,gBAAgB,gCAAhB,gBAAgB,QAiB3B;AAED;;;GAGG;AACH,SAAgB,+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;AAZD,0EAYC;AAED,SAAgB,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;AAXD,gEAWC;AAqBD,IAAY,eAGX;AAHD,WAAY,eAAe;IAC1B,6DAAQ,CAAA;IACR,6DAAQ,CAAA;AACT,CAAC,EAHW,eAAe,+BAAf,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"}