@fluidframework/tree 2.113.1 → 2.114.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (527) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/api-report/tree.alpha.api.md +19 -0
  3. package/dist/core/change-family/changeFamily.d.ts +15 -4
  4. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  5. package/dist/core/change-family/changeFamily.js.map +1 -1
  6. package/dist/core/change-family/editBuilder.d.ts +2 -3
  7. package/dist/core/change-family/editBuilder.d.ts.map +1 -1
  8. package/dist/core/change-family/editBuilder.js +1 -2
  9. package/dist/core/change-family/editBuilder.js.map +1 -1
  10. package/dist/core/change-family/index.d.ts +1 -1
  11. package/dist/core/change-family/index.d.ts.map +1 -1
  12. package/dist/core/change-family/index.js.map +1 -1
  13. package/dist/core/index.d.ts +3 -2
  14. package/dist/core/index.d.ts.map +1 -1
  15. package/dist/core/index.js.map +1 -1
  16. package/dist/core/tree/delta.d.ts +62 -16
  17. package/dist/core/tree/delta.d.ts.map +1 -1
  18. package/dist/core/tree/delta.js.map +1 -1
  19. package/dist/core/tree/detachedFieldIndex.d.ts +7 -13
  20. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  21. package/dist/core/tree/detachedFieldIndex.js +32 -46
  22. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  23. package/dist/core/tree/index.d.ts +1 -0
  24. package/dist/core/tree/index.d.ts.map +1 -1
  25. package/dist/core/tree/index.js.map +1 -1
  26. package/dist/core/tree/visitorUtils.d.ts +2 -4
  27. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  28. package/dist/core/tree/visitorUtils.js +2 -2
  29. package/dist/core/tree/visitorUtils.js.map +1 -1
  30. package/dist/entrypoints/alpha.d.ts +1 -1
  31. package/dist/entrypoints/alpha.d.ts.map +1 -1
  32. package/dist/entrypoints/alpha.js +5 -2
  33. package/dist/entrypoints/alpha.js.map +1 -1
  34. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  35. package/dist/feature-libraries/chunked-forest/uniformChunk.js +10 -2
  36. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  37. package/dist/feature-libraries/comparison-forest/comparisonForest.d.ts +51 -0
  38. package/dist/feature-libraries/comparison-forest/comparisonForest.d.ts.map +1 -0
  39. package/dist/feature-libraries/comparison-forest/comparisonForest.js +98 -0
  40. package/dist/feature-libraries/comparison-forest/comparisonForest.js.map +1 -0
  41. package/dist/feature-libraries/comparison-forest/index.d.ts +6 -0
  42. package/dist/feature-libraries/comparison-forest/index.d.ts.map +1 -0
  43. package/dist/feature-libraries/comparison-forest/index.js +10 -0
  44. package/dist/feature-libraries/comparison-forest/index.js.map +1 -0
  45. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +8 -6
  46. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  47. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
  48. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  49. package/dist/feature-libraries/default-schema/index.d.ts +1 -1
  50. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  51. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  52. package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
  53. package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
  54. package/dist/feature-libraries/default-schema/noChangeCodecs.js +3 -1
  55. package/dist/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
  56. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +6 -3
  57. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  58. package/dist/feature-libraries/detachedFieldIndexSummarizer.js +18 -6
  59. package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  60. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -3
  61. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  62. package/dist/feature-libraries/forest-summary/forestSummarizer.js +2 -3
  63. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  64. package/dist/feature-libraries/index.d.ts +4 -3
  65. package/dist/feature-libraries/index.d.ts.map +1 -1
  66. package/dist/feature-libraries/index.js +77 -72
  67. package/dist/feature-libraries/index.js.map +1 -1
  68. package/dist/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
  69. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  70. package/dist/feature-libraries/mitigatedChangeFamily.js +12 -0
  71. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  72. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +9 -1
  73. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  74. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  75. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
  76. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  77. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  78. package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
  79. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  80. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  81. package/dist/feature-libraries/modular-schema/invert.d.ts +15 -0
  82. package/dist/feature-libraries/modular-schema/invert.d.ts.map +1 -0
  83. package/dist/feature-libraries/modular-schema/invert.js +159 -0
  84. package/dist/feature-libraries/modular-schema/invert.js.map +1 -0
  85. package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts +3 -4
  86. package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
  87. package/dist/feature-libraries/modular-schema/minimizeModularChange.js +2 -2
  88. package/dist/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
  89. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +9 -9
  90. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  91. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +0 -2
  92. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  93. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +2 -2
  94. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  95. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  96. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  97. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  98. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  99. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -22
  100. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  101. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +53 -406
  102. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  103. package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts +61 -0
  104. package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -0
  105. package/dist/feature-libraries/modular-schema/modularChangeUtils.js +205 -0
  106. package/dist/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -0
  107. package/dist/feature-libraries/modular-schema/prune.d.ts +10 -0
  108. package/dist/feature-libraries/modular-schema/prune.d.ts.map +1 -0
  109. package/dist/feature-libraries/modular-schema/prune.js +49 -0
  110. package/dist/feature-libraries/modular-schema/prune.js.map +1 -0
  111. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +2 -2
  112. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  113. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  114. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
  115. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  116. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  117. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
  118. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  119. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  120. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +2 -2
  121. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  122. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  123. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +2 -2
  124. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  125. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  126. package/dist/feature-libraries/treeTextCursor.d.ts +15 -0
  127. package/dist/feature-libraries/treeTextCursor.d.ts.map +1 -1
  128. package/dist/feature-libraries/treeTextCursor.js +64 -1
  129. package/dist/feature-libraries/treeTextCursor.js.map +1 -1
  130. package/dist/index.d.ts +3 -1
  131. package/dist/index.d.ts.map +1 -1
  132. package/dist/index.js +5 -1
  133. package/dist/index.js.map +1 -1
  134. package/dist/packageVersion.d.ts +1 -1
  135. package/dist/packageVersion.js +1 -1
  136. package/dist/packageVersion.js.map +1 -1
  137. package/dist/shared-tree/serializedChange.d.ts +2 -2
  138. package/dist/shared-tree/serializedChange.d.ts.map +1 -1
  139. package/dist/shared-tree/serializedChange.js.map +1 -1
  140. package/dist/shared-tree/sharedTree.d.ts +6 -3
  141. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  142. package/dist/shared-tree/sharedTree.js +8 -6
  143. package/dist/shared-tree/sharedTree.js.map +1 -1
  144. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +2 -2
  145. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  146. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  147. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +41 -4
  148. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  149. package/dist/shared-tree/sharedTreeChangeFamily.js +57 -1
  150. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  151. package/dist/shared-tree/transactionMinimize.d.ts.map +1 -1
  152. package/dist/shared-tree/transactionMinimize.js +2 -2
  153. package/dist/shared-tree/transactionMinimize.js.map +1 -1
  154. package/dist/shared-tree/transactionPostProcessor.d.ts +2 -1
  155. package/dist/shared-tree/transactionPostProcessor.d.ts.map +1 -1
  156. package/dist/shared-tree/transactionPostProcessor.js.map +1 -1
  157. package/dist/shared-tree/treeCheckout.d.ts +8 -7
  158. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  159. package/dist/shared-tree/treeCheckout.js +1 -1
  160. package/dist/shared-tree/treeCheckout.js.map +1 -1
  161. package/dist/shared-tree-core/branch.d.ts +23 -9
  162. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  163. package/dist/shared-tree-core/branch.js +7 -0
  164. package/dist/shared-tree-core/branch.js.map +1 -1
  165. package/dist/shared-tree-core/editManager.d.ts +4 -4
  166. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  167. package/dist/shared-tree-core/editManager.js +2 -0
  168. package/dist/shared-tree-core/editManager.js.map +1 -1
  169. package/dist/shared-tree-core/editManagerCodecs.d.ts +3 -14
  170. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  171. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  172. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +11 -1
  173. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  174. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  175. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +4 -11
  176. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  177. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  178. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +4 -11
  179. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  180. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  181. package/dist/shared-tree-core/editManagerSummarizer.d.ts +4 -4
  182. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  183. package/dist/shared-tree-core/editManagerSummarizer.js +0 -1
  184. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  185. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
  186. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  187. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  188. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  189. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  190. package/dist/shared-tree-core/messageCodecs.d.ts +8 -1
  191. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  192. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  193. package/dist/shared-tree-core/sharedTreeCore.d.ts +5 -5
  194. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  195. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  196. package/dist/shared-tree-core/transaction.d.ts +10 -10
  197. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  198. package/dist/shared-tree-core/transaction.js +6 -3
  199. package/dist/shared-tree-core/transaction.js.map +1 -1
  200. package/dist/simple-tree/api/eraseSchemaDetails.d.ts +15 -0
  201. package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  202. package/dist/simple-tree/api/eraseSchemaDetails.js +15 -0
  203. package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  204. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +21 -2
  205. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  206. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  207. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +13 -0
  208. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  209. package/dist/simple-tree/node-kinds/map/mapNode.js +9 -0
  210. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  211. package/dist/text/textDomain.d.ts +12 -0
  212. package/dist/text/textDomain.d.ts.map +1 -1
  213. package/dist/text/textDomain.js +37 -16
  214. package/dist/text/textDomain.js.map +1 -1
  215. package/dist/text/textDomainFormatted.d.ts +155 -61
  216. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  217. package/dist/text/textDomainFormatted.js +147 -71
  218. package/dist/text/textDomainFormatted.js.map +1 -1
  219. package/dist/text/textDomainFormattedDefault.d.ts +37 -14
  220. package/dist/text/textDomainFormattedDefault.d.ts.map +1 -1
  221. package/dist/text/textDomainFormattedDefault.js +13 -5
  222. package/dist/text/textDomainFormattedDefault.js.map +1 -1
  223. package/dist/treeDataStore.d.ts +49 -0
  224. package/dist/treeDataStore.d.ts.map +1 -0
  225. package/dist/treeDataStore.js +57 -0
  226. package/dist/treeDataStore.js.map +1 -0
  227. package/dist/treeFactory.d.ts +8 -3
  228. package/dist/treeFactory.d.ts.map +1 -1
  229. package/dist/treeFactory.js +6 -1
  230. package/dist/treeFactory.js.map +1 -1
  231. package/lib/core/change-family/changeFamily.d.ts +15 -4
  232. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  233. package/lib/core/change-family/changeFamily.js.map +1 -1
  234. package/lib/core/change-family/editBuilder.d.ts +2 -3
  235. package/lib/core/change-family/editBuilder.d.ts.map +1 -1
  236. package/lib/core/change-family/editBuilder.js +1 -2
  237. package/lib/core/change-family/editBuilder.js.map +1 -1
  238. package/lib/core/change-family/index.d.ts +1 -1
  239. package/lib/core/change-family/index.d.ts.map +1 -1
  240. package/lib/core/change-family/index.js.map +1 -1
  241. package/lib/core/index.d.ts +3 -2
  242. package/lib/core/index.d.ts.map +1 -1
  243. package/lib/core/index.js +1 -1
  244. package/lib/core/index.js.map +1 -1
  245. package/lib/core/tree/delta.d.ts +62 -16
  246. package/lib/core/tree/delta.d.ts.map +1 -1
  247. package/lib/core/tree/delta.js.map +1 -1
  248. package/lib/core/tree/detachedFieldIndex.d.ts +7 -13
  249. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  250. package/lib/core/tree/detachedFieldIndex.js +7 -21
  251. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  252. package/lib/core/tree/index.d.ts +1 -0
  253. package/lib/core/tree/index.d.ts.map +1 -1
  254. package/lib/core/tree/index.js.map +1 -1
  255. package/lib/core/tree/visitorUtils.d.ts +2 -4
  256. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  257. package/lib/core/tree/visitorUtils.js +2 -2
  258. package/lib/core/tree/visitorUtils.js.map +1 -1
  259. package/lib/entrypoints/alpha.d.ts +1 -1
  260. package/lib/entrypoints/alpha.d.ts.map +1 -1
  261. package/lib/entrypoints/alpha.js +1 -1
  262. package/lib/entrypoints/alpha.js.map +1 -1
  263. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  264. package/lib/feature-libraries/chunked-forest/uniformChunk.js +10 -2
  265. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  266. package/lib/feature-libraries/comparison-forest/comparisonForest.d.ts +51 -0
  267. package/lib/feature-libraries/comparison-forest/comparisonForest.d.ts.map +1 -0
  268. package/lib/feature-libraries/comparison-forest/comparisonForest.js +94 -0
  269. package/lib/feature-libraries/comparison-forest/comparisonForest.js.map +1 -0
  270. package/lib/feature-libraries/comparison-forest/index.d.ts +6 -0
  271. package/lib/feature-libraries/comparison-forest/index.d.ts.map +1 -0
  272. package/lib/feature-libraries/comparison-forest/index.js +6 -0
  273. package/lib/feature-libraries/comparison-forest/index.js.map +1 -0
  274. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +8 -6
  275. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  276. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
  277. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  278. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  279. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  280. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  281. package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
  282. package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
  283. package/lib/feature-libraries/default-schema/noChangeCodecs.js +3 -1
  284. package/lib/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
  285. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +6 -3
  286. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  287. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +16 -4
  288. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  289. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -3
  290. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  291. package/lib/feature-libraries/forest-summary/forestSummarizer.js +2 -3
  292. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  293. package/lib/feature-libraries/index.d.ts +4 -3
  294. package/lib/feature-libraries/index.d.ts.map +1 -1
  295. package/lib/feature-libraries/index.js +2 -1
  296. package/lib/feature-libraries/index.js.map +1 -1
  297. package/lib/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
  298. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  299. package/lib/feature-libraries/mitigatedChangeFamily.js +12 -0
  300. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  301. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +9 -1
  302. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  303. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  304. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
  305. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  306. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  307. package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
  308. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  309. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  310. package/lib/feature-libraries/modular-schema/invert.d.ts +15 -0
  311. package/lib/feature-libraries/modular-schema/invert.d.ts.map +1 -0
  312. package/lib/feature-libraries/modular-schema/invert.js +155 -0
  313. package/lib/feature-libraries/modular-schema/invert.js.map +1 -0
  314. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts +3 -4
  315. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
  316. package/lib/feature-libraries/modular-schema/minimizeModularChange.js +2 -2
  317. package/lib/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
  318. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +9 -9
  319. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  320. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +0 -2
  321. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  322. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +2 -2
  323. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  324. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  325. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  326. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  327. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  328. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -22
  329. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  330. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +16 -367
  331. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  332. package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts +61 -0
  333. package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -0
  334. package/lib/feature-libraries/modular-schema/modularChangeUtils.js +192 -0
  335. package/lib/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -0
  336. package/lib/feature-libraries/modular-schema/prune.d.ts +10 -0
  337. package/lib/feature-libraries/modular-schema/prune.d.ts.map +1 -0
  338. package/lib/feature-libraries/modular-schema/prune.js +45 -0
  339. package/lib/feature-libraries/modular-schema/prune.js.map +1 -0
  340. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +2 -2
  341. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  342. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  343. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
  344. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  345. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  346. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
  347. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  348. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  349. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +2 -2
  350. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  351. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  352. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +2 -2
  353. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  354. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  355. package/lib/feature-libraries/treeTextCursor.d.ts +15 -0
  356. package/lib/feature-libraries/treeTextCursor.d.ts.map +1 -1
  357. package/lib/feature-libraries/treeTextCursor.js +62 -1
  358. package/lib/feature-libraries/treeTextCursor.js.map +1 -1
  359. package/lib/index.d.ts +3 -1
  360. package/lib/index.d.ts.map +1 -1
  361. package/lib/index.js +2 -1
  362. package/lib/index.js.map +1 -1
  363. package/lib/packageVersion.d.ts +1 -1
  364. package/lib/packageVersion.js +1 -1
  365. package/lib/packageVersion.js.map +1 -1
  366. package/lib/shared-tree/serializedChange.d.ts +2 -2
  367. package/lib/shared-tree/serializedChange.d.ts.map +1 -1
  368. package/lib/shared-tree/serializedChange.js.map +1 -1
  369. package/lib/shared-tree/sharedTree.d.ts +6 -3
  370. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  371. package/lib/shared-tree/sharedTree.js +9 -7
  372. package/lib/shared-tree/sharedTree.js.map +1 -1
  373. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +2 -2
  374. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  375. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  376. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +41 -4
  377. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  378. package/lib/shared-tree/sharedTreeChangeFamily.js +55 -0
  379. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  380. package/lib/shared-tree/transactionMinimize.d.ts.map +1 -1
  381. package/lib/shared-tree/transactionMinimize.js +3 -3
  382. package/lib/shared-tree/transactionMinimize.js.map +1 -1
  383. package/lib/shared-tree/transactionPostProcessor.d.ts +2 -1
  384. package/lib/shared-tree/transactionPostProcessor.d.ts.map +1 -1
  385. package/lib/shared-tree/transactionPostProcessor.js.map +1 -1
  386. package/lib/shared-tree/treeCheckout.d.ts +8 -7
  387. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  388. package/lib/shared-tree/treeCheckout.js +1 -1
  389. package/lib/shared-tree/treeCheckout.js.map +1 -1
  390. package/lib/shared-tree-core/branch.d.ts +23 -9
  391. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  392. package/lib/shared-tree-core/branch.js +7 -0
  393. package/lib/shared-tree-core/branch.js.map +1 -1
  394. package/lib/shared-tree-core/editManager.d.ts +4 -4
  395. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  396. package/lib/shared-tree-core/editManager.js +2 -0
  397. package/lib/shared-tree-core/editManager.js.map +1 -1
  398. package/lib/shared-tree-core/editManagerCodecs.d.ts +3 -14
  399. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  400. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  401. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +11 -1
  402. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  403. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  404. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +4 -11
  405. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  406. package/lib/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
  407. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  408. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +4 -11
  409. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  410. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
  411. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  412. package/lib/shared-tree-core/editManagerSummarizer.d.ts +4 -4
  413. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  414. package/lib/shared-tree-core/editManagerSummarizer.js +0 -1
  415. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  416. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
  417. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  418. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  419. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  420. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  421. package/lib/shared-tree-core/messageCodecs.d.ts +8 -1
  422. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  423. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  424. package/lib/shared-tree-core/sharedTreeCore.d.ts +5 -5
  425. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  426. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  427. package/lib/shared-tree-core/transaction.d.ts +10 -10
  428. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  429. package/lib/shared-tree-core/transaction.js +6 -3
  430. package/lib/shared-tree-core/transaction.js.map +1 -1
  431. package/lib/simple-tree/api/eraseSchemaDetails.d.ts +15 -0
  432. package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  433. package/lib/simple-tree/api/eraseSchemaDetails.js +15 -0
  434. package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  435. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +21 -2
  436. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  437. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  438. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +13 -0
  439. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  440. package/lib/simple-tree/node-kinds/map/mapNode.js +9 -0
  441. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  442. package/lib/text/textDomain.d.ts +12 -0
  443. package/lib/text/textDomain.d.ts.map +1 -1
  444. package/lib/text/textDomain.js +34 -15
  445. package/lib/text/textDomain.js.map +1 -1
  446. package/lib/text/textDomainFormatted.d.ts +155 -61
  447. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  448. package/lib/text/textDomainFormatted.js +148 -73
  449. package/lib/text/textDomainFormatted.js.map +1 -1
  450. package/lib/text/textDomainFormattedDefault.d.ts +37 -14
  451. package/lib/text/textDomainFormattedDefault.d.ts.map +1 -1
  452. package/lib/text/textDomainFormattedDefault.js +14 -6
  453. package/lib/text/textDomainFormattedDefault.js.map +1 -1
  454. package/lib/treeDataStore.d.ts +49 -0
  455. package/lib/treeDataStore.d.ts.map +1 -0
  456. package/lib/treeDataStore.js +52 -0
  457. package/lib/treeDataStore.js.map +1 -0
  458. package/lib/treeFactory.d.ts +8 -3
  459. package/lib/treeFactory.d.ts.map +1 -1
  460. package/lib/treeFactory.js +5 -0
  461. package/lib/treeFactory.js.map +1 -1
  462. package/package.json +25 -24
  463. package/src/core/change-family/changeFamily.ts +32 -4
  464. package/src/core/change-family/editBuilder.ts +1 -2
  465. package/src/core/change-family/index.ts +2 -0
  466. package/src/core/index.ts +9 -6
  467. package/src/core/tree/delta.ts +62 -16
  468. package/src/core/tree/detachedFieldIndex.ts +7 -38
  469. package/src/core/tree/index.ts +2 -0
  470. package/src/core/tree/visitorUtils.ts +3 -17
  471. package/src/entrypoints/alpha.ts +7 -3
  472. package/src/feature-libraries/chunked-forest/uniformChunk.ts +11 -1
  473. package/src/feature-libraries/comparison-forest/comparisonForest.ts +140 -0
  474. package/src/feature-libraries/comparison-forest/index.ts +6 -0
  475. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +20 -6
  476. package/src/feature-libraries/default-schema/index.ts +1 -0
  477. package/src/feature-libraries/default-schema/noChangeCodecs.ts +11 -3
  478. package/src/feature-libraries/detachedFieldIndexSummarizer.ts +33 -5
  479. package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -3
  480. package/src/feature-libraries/index.ts +5 -0
  481. package/src/feature-libraries/mitigatedChangeFamily.ts +21 -3
  482. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +10 -1
  483. package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +9 -4
  484. package/src/feature-libraries/modular-schema/index.ts +1 -0
  485. package/src/feature-libraries/modular-schema/invert.ts +338 -0
  486. package/src/feature-libraries/modular-schema/minimizeModularChange.ts +3 -5
  487. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +16 -13
  488. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +3 -1
  489. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +2 -1
  490. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +45 -644
  491. package/src/feature-libraries/modular-schema/modularChangeUtils.ts +340 -0
  492. package/src/feature-libraries/modular-schema/prune.ts +69 -0
  493. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +4 -2
  494. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +5 -2
  495. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +4 -2
  496. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +4 -2
  497. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +6 -3
  498. package/src/feature-libraries/treeTextCursor.ts +66 -1
  499. package/src/index.ts +4 -0
  500. package/src/packageVersion.ts +1 -1
  501. package/src/shared-tree/serializedChange.ts +2 -2
  502. package/src/shared-tree/sharedTree.ts +34 -14
  503. package/src/shared-tree/sharedTreeChangeCodecs.ts +11 -3
  504. package/src/shared-tree/sharedTreeChangeFamily.ts +77 -2
  505. package/src/shared-tree/transactionMinimize.ts +7 -3
  506. package/src/shared-tree/transactionPostProcessor.ts +5 -1
  507. package/src/shared-tree/treeCheckout.ts +55 -16
  508. package/src/shared-tree-core/branch.ts +40 -12
  509. package/src/shared-tree-core/editManager.ts +46 -25
  510. package/src/shared-tree-core/editManagerCodecs.ts +9 -21
  511. package/src/shared-tree-core/editManagerCodecsCommons.ts +14 -2
  512. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +18 -21
  513. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +18 -20
  514. package/src/shared-tree-core/editManagerSummarizer.ts +9 -6
  515. package/src/shared-tree-core/messageCodecV1ToV4.ts +3 -3
  516. package/src/shared-tree-core/messageCodecVSharedBranches.ts +2 -2
  517. package/src/shared-tree-core/messageCodecs.ts +12 -2
  518. package/src/shared-tree-core/sharedTreeCore.ts +15 -6
  519. package/src/shared-tree-core/transaction.ts +47 -25
  520. package/src/simple-tree/api/eraseSchemaDetails.ts +15 -0
  521. package/src/simple-tree/node-kinds/array/arrayNode.ts +21 -2
  522. package/src/simple-tree/node-kinds/map/mapNode.ts +24 -2
  523. package/src/text/textDomain.ts +29 -6
  524. package/src/text/textDomainFormatted.ts +351 -134
  525. package/src/text/textDomainFormattedDefault.ts +25 -16
  526. package/src/treeDataStore.ts +125 -0
  527. package/src/treeFactory.ts +11 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,103 @@
1
1
  # @fluidframework/tree
2
2
 
3
+ ## 2.114.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add clear method to TreeMapNodeAlpha ([#27765](https://github.com/microsoft/FluidFramework/pull/27765)) [30c889b99c](https://github.com/microsoft/FluidFramework/commit/30c889b99caca3d6ad1ab276761092d94118eab1)
8
+
9
+ [`TreeMapNodeAlpha`](https://fluidframework.com/docs/api/fluid-framework/treemapnodealpha-interface) now has a `clear` method, further aligning it with JavaScript's built-in Map API. It removes all elements from the map.
10
+
11
+ The merge semantics of `clear` are loosely specified: either of the following may occur:
12
+ - `clear` may remove all elements that were in the map when the edit was authored, even if some of those elements have since been moved elsewhere in the tree (in which case they are removed from their new location).
13
+ - `clear` may remove all elements that are in the map when the edit is sequenced, even if some of those elements were not yet in the map when the edit was authored.
14
+
15
+ This method is available on `TreeMapNodeAlpha`, which can be obtained from an existing `TreeMapNode` via `asAlpha`, or by declaring the schema with `SchemaFactoryAlpha`'s `mapAlpha`.
16
+
17
+ ```typescript
18
+ const schemaFactory = new SchemaFactoryAlpha("example");
19
+ class Inventory extends schemaFactory.mapAlpha(
20
+ "Inventory",
21
+ schemaFactory.number,
22
+ ) {}
23
+
24
+ const inventory = new Inventory(
25
+ new Map([
26
+ ["apples", 5],
27
+ ["pears", 3],
28
+ ]),
29
+ );
30
+
31
+ inventory.size; // 2
32
+ inventory.clear();
33
+ inventory.size; // 0
34
+ ```
35
+
36
+ - Add new @alpha ServiceClient API for creating and loading Fluid containers ([#27693](https://github.com/microsoft/FluidFramework/pull/27693)) [ee47192d4a](https://github.com/microsoft/FluidFramework/commit/ee47192d4ae91bc28f9154c4d1ead2acad762f3c)
37
+
38
+ This introduces an experimental (`@alpha`), service-agnostic API for working with Fluid containers whose root is an arbitrary data store, along with an in-memory implementation for testing.
39
+
40
+ The new surface is made up of:
41
+ - `ServiceClient` (`@fluidframework/driver-definitions`): the entry point for creating and loading containers. Along with it come the supporting container types (`FluidContainer`, `FluidContainerWithService`, `FluidContainerAttached`), the data store model (`DataStoreKind`, `DataStoreKey`, `DataStoreRegistry`, `DataStoreCreator`), and the generic registry primitives (`Registry`, `RegistryKey`, `lookupInRegistry`, `createBasicRegistryKey`).
42
+ - `defineDataStore` and `sharedObjectRegistryFromIterable` (`@fluidframework/shared-object-base`): build a `DataStoreKind` from a root shared object and a registry of shared object kinds.
43
+ - `defineTreeDataStore` and `instantiateTreeFirstTime` (`@fluidframework/tree`): a SharedTree-specific convenience wrapper that produces a `DataStoreKind` backed by a `TreeView`.
44
+ - `startEphemeralService` (`@fluidframework/local-driver`): starts an in-memory `EphemeralService` for tests. The service owns the lifetime of the in-memory documents and resources, and produces `ServiceClient`s connected to it (via `EphemeralService.newClient` or `EphemeralService.defaultClient`). The helpers `cleanupEphemeralService` and `getDefaultEphemeralService` manage an optional default service instance.
45
+
46
+ Apart from the `@fluidframework/local-driver` helpers (which come from `@fluidframework/local-driver/alpha`), these APIs are also re-exported from `fluid-framework`. None reference any `@legacy` types.
47
+
48
+ Example:
49
+
50
+ ```typescript
51
+ import { startEphemeralService } from "@fluidframework/local-driver/alpha";
52
+ import {
53
+ ServiceClient,
54
+ defineTreeDataStore,
55
+ TreeViewConfiguration,
56
+ SchemaFactory,
57
+ } from "fluid-framework/alpha";
58
+ import { strict as assert } from "node:assert";
59
+
60
+ // Start an ephemeral in-memory service and get a ServiceClient connected to it.
61
+ const service = startEphemeralService();
62
+ const client: ServiceClient = service.defaultClient;
63
+ // Define a DataStoreKind which uses a SharedTree.
64
+ // In this case the schema is for a single number with an initializer that starts the it at 1.
65
+ // This schema is captures in the type allowing for strongly typed access to the data in the tree,
66
+ // where the type matches the schema based runtime enforcement of the schema.
67
+ const numberStore = defineTreeDataStore({
68
+ type: "my-app-root",
69
+ config: new TreeViewConfiguration({ schema: SchemaFactory.number }),
70
+ initializer: () => 1,
71
+ });
72
+
73
+ // Create a container in the service with the above DataStoreKind.
74
+ // Ideally this creation would use a service independent API, and only the attach call would be service dependent,
75
+ // but that is not supported yet.
76
+ const detachedContainer1 = await client.createContainer(numberStore);
77
+ const container1 = await detachedContainer1.attach();
78
+
79
+ // We now have easy and type safe access to the data in the tree, which will be synced over the service.
80
+ assert.equal(container1.data.root, 1);
81
+
82
+ // A second client can load the same container from the service, and will see the same data.
83
+ const container2 = await client.loadContainer(container1.id, numberStore);
84
+ assert.equal(container2.data.root, 1);
85
+
86
+ // Both clients can modify the data, and the changes will be synced over the service.
87
+ container2.data.root = 2;
88
+ // Since we are using an ephemeral service, we can await the synchronization using service.synchronize.
89
+ await service.synchronize();
90
+
91
+ // And now the changes are visible for all clients.
92
+ assert.equal(container1.data.root, 2);
93
+ assert.equal(container2.data.root, 2);
94
+ ```
95
+
96
+ Note that this example does a couple of things which are difficult to do with the other API surfaces:
97
+ 1. It creates a container, then loads a second copy of it, allowing for collaboration. There is currently no non-legacy API surface which allows this without spawning a server process. This is also cleaner than the exacting legacy API options, and can replace the test specific APIs for this as well.
98
+ 2. It creates a container which has a SharedTree at the root, and nothing else. This avoids depending on legacy DDS implementations, which is great for long-term document support and bundle size. This is currently impossible using `fluid-static`, which forces a special root data store. It is also impossible if using `aqueduct`, which forces a root directory in every data store. It can be done using the low level legacy APIs directly, but this new API for it is much simpler.
99
+ 3. There is a common interface all services implement (`ServiceClient`), making the container creation part of the code work for any service implementation.
100
+
3
101
  ## 2.113.0
4
102
 
5
103
  ### Minor Changes
@@ -296,6 +296,9 @@ export function decodeSchemaCompatibilitySnapshot(encodedSchema: JsonCompatibleR
296
296
  interface DefaultProvider extends ErasedType<"@fluidframework/tree.FieldProvider"> {
297
297
  }
298
298
 
299
+ // @alpha
300
+ export function defineTreeDataStore<const TSchema extends ImplicitFieldSchema>(options: TreeDataStoreOptions<TSchema>): DataStoreKind<TreeView<TSchema>>;
301
+
299
302
  // @alpha
300
303
  export interface DirtyTreeMap {
301
304
  // (undocumented)
@@ -638,6 +641,9 @@ TSchema
638
641
  // @public
639
642
  export type InsertableTypedNode<TSchema extends TreeNodeSchema, T = UnionToIntersection<TSchema>> = (T extends TreeNodeSchema<string, NodeKind, TreeNode | TreeLeafValue, never, true> ? NodeBuilderData<T> : never) | (T extends TreeNodeSchema ? Unhydrated<TreeNode extends NodeFromSchema<T> ? never : NodeFromSchema<T>> : never);
640
643
 
644
+ // @alpha
645
+ export function instantiateTreeFirstTime<TSchema extends ImplicitFieldSchema>(rootCreator: SharedObjectCreator, creator: SharedObjectCreator, treeKind: SharedObjectKey<ITree>, options: Pick<TreeDataStoreOptions<TSchema>, "config" | "initializer">): Promise<ITree>;
646
+
641
647
  // @public @sealed
642
648
  export interface InternalTreeNode extends ErasedType<"@fluidframework/tree.InternalTreeNode"> {
643
649
  }
@@ -1279,6 +1285,9 @@ export class SchemaUpgrade {
1279
1285
  // @public @system
1280
1286
  type ScopedSchemaName<TScope extends string | undefined, TName extends number | string> = TScope extends undefined ? `${TName}` : `${TScope}.${TName}`;
1281
1287
 
1288
+ // @alpha
1289
+ export const SharedTreeAlpha: SharedObjectKindAlpha<ITree>;
1290
+
1282
1291
  // @alpha @input
1283
1292
  export interface SharedTreeFormatOptions {
1284
1293
  treeEncodeType: TreeCompressionStrategy;
@@ -1889,6 +1898,15 @@ export interface TreeContextAlpha {
1889
1898
  runTransactionAsync(transaction: () => Promise<void>, params?: RunTransactionParamsAlpha): Promise<TransactionVoidResult>;
1890
1899
  }
1891
1900
 
1901
+ // @alpha @input
1902
+ export interface TreeDataStoreOptions<TSchema extends ImplicitFieldSchema> extends Pick<DataStoreOptions<never, never>, "type"> {
1903
+ readonly config: TreeViewConfiguration<TSchema>;
1904
+ readonly initializer?: (creator: SharedObjectCreator) => InsertableTreeFieldFromImplicitField<TSchema>;
1905
+ // (undocumented)
1906
+ readonly key?: SharedObjectKey<ITree>;
1907
+ readonly registry?: Iterable<SharedObjectKindAlpha<IFluidLoadable>> | SharedObjectRegistry;
1908
+ }
1909
+
1892
1910
  // @beta @input
1893
1911
  export interface TreeEncodingOptions<TKeyOptions = KeyEncodingOptions> {
1894
1912
  readonly keys?: TKeyOptions;
@@ -1932,6 +1950,7 @@ export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTyp
1932
1950
 
1933
1951
  // @alpha @sealed
1934
1952
  export interface TreeMapNodeAlpha<T extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends FluidReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>, TreeNode, Pick<TreeMapNode<T>, "set" | "delete"> {
1953
+ clear(): void;
1935
1954
  }
1936
1955
 
1937
1956
  // @public @sealed
@@ -7,10 +7,12 @@ import type { ICodecFamily, IJsonCodec } from "../../codec/index.js";
7
7
  import type { SchemaAndPolicy } from "../../core/index.js";
8
8
  import type { IdentifierHealingConfig, JsonCompatibleReadOnly } from "../../util/index.js";
9
9
  import type { ChangeRebaser, RevisionTag, TaggedChange } from "../rebase/index.js";
10
- export interface ChangeFamily<TEditor extends ChangeFamilyEditor, TChange> {
10
+ export type ProcessChangeFn<TChange, TChangeProcessingContext> = TChangeProcessingContext extends never ? (change: TChange) => TChange : (change: TChange, context: TChangeProcessingContext) => TChange;
11
+ export interface ChangeFamily<TEditor extends ChangeFamilyEditor, TChange, TChangeProcessingContext = never> {
11
12
  buildEditor(mintRevisionTag: () => RevisionTag, changeReceiver: (change: TaggedChange<TChange>) => void): TEditor;
12
13
  readonly rebaser: ChangeRebaser<TChange>;
13
- readonly codecs: ICodecFamily<TChange, ChangeEncodingContext>;
14
+ readonly codecs: ICodecFamily<TChange, ChangeEncodingContext, ChangeDecodingContext>;
15
+ buildProcessor(processFn: ProcessChangeFn<TChange, TChangeProcessingContext>): (change: TChange) => TChange;
14
16
  }
15
17
  export interface ChangeEncodingContext {
16
18
  readonly originatorId: SessionId;
@@ -28,13 +30,22 @@ export interface ChangeEncodingContext {
28
30
  * (possibly broken) attach-summary blob, never when applying ops.
29
31
  */
30
32
  readonly isSummary: boolean;
33
+ }
34
+ /**
35
+ * Context provided to change codecs when decoding.
36
+ * @remarks
37
+ * The same as {@link ChangeEncodingContext} except that it omits `schema` (only consulted when
38
+ * *encoding*, for schema-aware compression) and adds `healing` (only consulted when *decoding*, to
39
+ * recover unresolvable identifiers from a summary blob).
40
+ */
41
+ export type ChangeDecodingContext = Omit<ChangeEncodingContext, "schema"> & {
31
42
  /**
32
43
  * Heal-on-decode workaround configuration. See {@link IdentifierHealingConfig}.
33
44
  * Only takes effect when `isSummary` is also `true`.
34
45
  */
35
46
  readonly healing?: IdentifierHealingConfig;
36
- }
37
- export type ChangeFamilyCodec<TChange> = IJsonCodec<TChange, JsonCompatibleReadOnly, JsonCompatibleReadOnly, ChangeEncodingContext>;
47
+ };
48
+ export type ChangeFamilyCodec<TChange> = IJsonCodec<TChange, JsonCompatibleReadOnly, JsonCompatibleReadOnly, ChangeEncodingContext, ChangeDecodingContext>;
38
49
  export interface ChangeFamilyEditor {
39
50
  /**
40
51
  * Must be called when a new transaction starts.
@@ -1 +1 @@
1
- {"version":3,"file":"changeFamily.d.ts","sourceRoot":"","sources":["../../../src/core/change-family/changeFamily.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAA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CAAC,YAAY,EAAE,SAAS,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC;IACrC,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;IAClC;;;;;;;;;OASG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CAAC,GAAG;IAC3E;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,uBAAuB,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,OAAO,IAAI,UAAU,CAClD,OAAO,EACP,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,CACrB,CAAC;AAEF,MAAM,WAAW,kBAAkB;IAClC;;;;;;;OAOG;IACH,gBAAgB,IAAI,IAAI,CAAC;IAEzB;;;;;;;OAOG;IACH,eAAe,IAAI,IAAI,CAAC;CACxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"changeFamily.js","sourceRoot":"","sources":["../../../src/core/change-family/changeFamily.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IIdCompressor, SessionId } from \"@fluidframework/id-compressor\";\n\nimport type { ICodecFamily, IJsonCodec } from \"../../codec/index.js\";\nimport type { SchemaAndPolicy } from \"../../core/index.js\";\nimport type { IdentifierHealingConfig, JsonCompatibleReadOnly } from \"../../util/index.js\";\nimport type { ChangeRebaser, RevisionTag, TaggedChange } from \"../rebase/index.js\";\n\nexport interface ChangeFamily<TEditor extends ChangeFamilyEditor, TChange> {\n\tbuildEditor(\n\t\tmintRevisionTag: () => RevisionTag,\n\t\tchangeReceiver: (change: TaggedChange<TChange>) => void,\n\t): TEditor;\n\n\treadonly rebaser: ChangeRebaser<TChange>;\n\treadonly codecs: ICodecFamily<TChange, ChangeEncodingContext>;\n}\n\nexport interface ChangeEncodingContext {\n\treadonly originatorId: SessionId;\n\treadonly revision: RevisionTag | undefined;\n\treadonly idCompressor: IIdCompressor;\n\treadonly schema?: SchemaAndPolicy;\n\t/**\n\t * `true` when this context is encoding to or decoding from a summary blob.\n\t * `false` when this context is for an op (or any other non-summary path,\n\t * including utility encoders that aren't tied to persistence).\n\t *\n\t * @remarks\n\t * Used to gate decode-time recovery behavior — for example, healing of\n\t * unresolvable identifier IDs — that should only run when loading a\n\t * (possibly broken) attach-summary blob, never when applying ops.\n\t */\n\treadonly isSummary: boolean;\n\t/**\n\t * Heal-on-decode workaround configuration. See {@link IdentifierHealingConfig}.\n\t * Only takes effect when `isSummary` is also `true`.\n\t */\n\treadonly healing?: IdentifierHealingConfig;\n}\n\nexport type ChangeFamilyCodec<TChange> = IJsonCodec<\n\tTChange,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tChangeEncodingContext\n>;\n\nexport interface ChangeFamilyEditor {\n\t/**\n\t * Must be called when a new transaction starts.\n\t *\n\t * Note: transactions are an optional feature. It is valid to make edits outside of a transaction.\n\t *\n\t * For each call to this function, a matching call to `exitTransaction` must be made at a later time.\n\t * Can be called repeatedly to indicate the start of nesting transactions.\n\t */\n\tenterTransaction(): void;\n\n\t/**\n\t * Must be called when a transaction ends.\n\t *\n\t * Note: transactions are an optional feature. It is valid to make edits outside of a transaction.\n\t *\n\t * For each call to this function, a matching call to `enterTransaction` must be made at an earlier time.\n\t * Can be called repeatedly to indicate the end of nesting transactions.\n\t */\n\texitTransaction(): void;\n}\n"]}
1
+ {"version":3,"file":"changeFamily.js","sourceRoot":"","sources":["../../../src/core/change-family/changeFamily.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IIdCompressor, SessionId } from \"@fluidframework/id-compressor\";\n\nimport type { ICodecFamily, IJsonCodec } from \"../../codec/index.js\";\nimport type { SchemaAndPolicy } from \"../../core/index.js\";\nimport type { IdentifierHealingConfig, JsonCompatibleReadOnly } from \"../../util/index.js\";\nimport type { ChangeRebaser, RevisionTag, TaggedChange } from \"../rebase/index.js\";\n\nexport type ProcessChangeFn<TChange, TChangeProcessingContext> =\n\tTChangeProcessingContext extends never\n\t\t? (change: TChange) => TChange\n\t\t: (change: TChange, context: TChangeProcessingContext) => TChange;\n\nexport interface ChangeFamily<\n\tTEditor extends ChangeFamilyEditor,\n\tTChange,\n\t// For simplicity, may be a concrete ChangeFamily implementation such as\n\t// ChangeFamilyFoo implements ChangeFamily<EditorFoo, ChangeFoo, ChangeFamilyFoo>\n\t// to provide all details and helpers that processFn for ChangeFoo\n\t// may require, but there is no requirement to follow that pattern.\n\tTChangeProcessingContext = never,\n> {\n\tbuildEditor(\n\t\tmintRevisionTag: () => RevisionTag,\n\t\tchangeReceiver: (change: TaggedChange<TChange>) => void,\n\t): TEditor;\n\n\treadonly rebaser: ChangeRebaser<TChange>;\n\treadonly codecs: ICodecFamily<TChange, ChangeEncodingContext, ChangeDecodingContext>;\n\n\tbuildProcessor(\n\t\tprocessFn: ProcessChangeFn<TChange, TChangeProcessingContext>,\n\t): (change: TChange) => TChange;\n}\n\nexport interface ChangeEncodingContext {\n\treadonly originatorId: SessionId;\n\treadonly revision: RevisionTag | undefined;\n\treadonly idCompressor: IIdCompressor;\n\treadonly schema?: SchemaAndPolicy;\n\t/**\n\t * `true` when this context is encoding to or decoding from a summary blob.\n\t * `false` when this context is for an op (or any other non-summary path,\n\t * including utility encoders that aren't tied to persistence).\n\t *\n\t * @remarks\n\t * Used to gate decode-time recovery behavior — for example, healing of\n\t * unresolvable identifier IDs — that should only run when loading a\n\t * (possibly broken) attach-summary blob, never when applying ops.\n\t */\n\treadonly isSummary: boolean;\n}\n\n/**\n * Context provided to change codecs when decoding.\n * @remarks\n * The same as {@link ChangeEncodingContext} except that it omits `schema` (only consulted when\n * *encoding*, for schema-aware compression) and adds `healing` (only consulted when *decoding*, to\n * recover unresolvable identifiers from a summary blob).\n */\nexport type ChangeDecodingContext = Omit<ChangeEncodingContext, \"schema\"> & {\n\t/**\n\t * Heal-on-decode workaround configuration. See {@link IdentifierHealingConfig}.\n\t * Only takes effect when `isSummary` is also `true`.\n\t */\n\treadonly healing?: IdentifierHealingConfig;\n};\n\nexport type ChangeFamilyCodec<TChange> = IJsonCodec<\n\tTChange,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tChangeEncodingContext,\n\tChangeDecodingContext\n>;\n\nexport interface ChangeFamilyEditor {\n\t/**\n\t * Must be called when a new transaction starts.\n\t *\n\t * Note: transactions are an optional feature. It is valid to make edits outside of a transaction.\n\t *\n\t * For each call to this function, a matching call to `exitTransaction` must be made at a later time.\n\t * Can be called repeatedly to indicate the start of nesting transactions.\n\t */\n\tenterTransaction(): void;\n\n\t/**\n\t * Must be called when a transaction ends.\n\t *\n\t * Note: transactions are an optional feature. It is valid to make edits outside of a transaction.\n\t *\n\t * For each call to this function, a matching call to `enterTransaction` must be made at an earlier time.\n\t * Can be called repeatedly to indicate the end of nesting transactions.\n\t */\n\texitTransaction(): void;\n}\n"]}
@@ -3,11 +3,10 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { TaggedChange } from "../rebase/index.js";
6
- import type { ChangeFamily, ChangeFamilyEditor } from "./changeFamily.js";
6
+ import type { ChangeFamilyEditor } from "./changeFamily.js";
7
7
  export declare abstract class EditBuilder<TChange> implements ChangeFamilyEditor {
8
- protected readonly changeFamily: ChangeFamily<ChangeFamilyEditor, TChange>;
9
8
  private readonly changeReceiver;
10
- constructor(changeFamily: ChangeFamily<ChangeFamilyEditor, TChange>, changeReceiver: (change: TaggedChange<TChange>) => void);
9
+ constructor(changeReceiver: (change: TaggedChange<TChange>) => void);
11
10
  /**
12
11
  * Subclasses add editing methods which call this with their generated edits.
13
12
  *
@@ -1 +1 @@
1
- {"version":3,"file":"editBuilder.d.ts","sourceRoot":"","sources":["../../../src/core/change-family/editBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE1E,8BAAsB,WAAW,CAAC,OAAO,CAAE,YAAW,kBAAkB;IAEtE,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC;IAC1E,OAAO,CAAC,QAAQ,CAAC,cAAc;gBADZ,YAAY,EAAE,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC,EACzD,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,IAAI;IAGzE;;;;OAIG;IACH,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,IAAI;IAInD,gBAAgB,IAAI,IAAI;IACxB,eAAe,IAAI,IAAI;CAC9B"}
1
+ {"version":3,"file":"editBuilder.d.ts","sourceRoot":"","sources":["../../../src/core/change-family/editBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,8BAAsB,WAAW,CAAC,OAAO,CAAE,YAAW,kBAAkB;IAEtE,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,IAAI;IAGzE;;;;OAIG;IACH,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,IAAI;IAInD,gBAAgB,IAAI,IAAI;IACxB,eAAe,IAAI,IAAI;CAC9B"}
@@ -6,8 +6,7 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.EditBuilder = void 0;
8
8
  class EditBuilder {
9
- constructor(changeFamily, changeReceiver) {
10
- this.changeFamily = changeFamily;
9
+ constructor(changeReceiver) {
11
10
  this.changeReceiver = changeReceiver;
12
11
  }
13
12
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"editBuilder.js","sourceRoot":"","sources":["../../../src/core/change-family/editBuilder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAMH,MAAsB,WAAW;IAChC,YACoB,YAAuD,EACzD,cAAuD;QADrD,iBAAY,GAAZ,YAAY,CAA2C;QACzD,mBAAc,GAAd,cAAc,CAAyC;IACtE,CAAC;IAEJ;;;;OAIG;IACO,WAAW,CAAC,MAA6B;QAClD,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAEM,gBAAgB,KAAU,CAAC;IAC3B,eAAe,KAAU,CAAC;CACjC;AAjBD,kCAiBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { TaggedChange } from \"../rebase/index.js\";\n\nimport type { ChangeFamily, ChangeFamilyEditor } from \"./changeFamily.js\";\n\nexport abstract class EditBuilder<TChange> implements ChangeFamilyEditor {\n\tpublic constructor(\n\t\tprotected readonly changeFamily: ChangeFamily<ChangeFamilyEditor, TChange>,\n\t\tprivate readonly changeReceiver: (change: TaggedChange<TChange>) => void,\n\t) {}\n\n\t/**\n\t * Subclasses add editing methods which call this with their generated edits.\n\t *\n\t * @sealed\n\t */\n\tprotected applyChange(change: TaggedChange<TChange>): void {\n\t\tthis.changeReceiver(change);\n\t}\n\n\tpublic enterTransaction(): void {}\n\tpublic exitTransaction(): void {}\n}\n"]}
1
+ {"version":3,"file":"editBuilder.js","sourceRoot":"","sources":["../../../src/core/change-family/editBuilder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAMH,MAAsB,WAAW;IAChC,YACkB,cAAuD;QAAvD,mBAAc,GAAd,cAAc,CAAyC;IACtE,CAAC;IAEJ;;;;OAIG;IACO,WAAW,CAAC,MAA6B;QAClD,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAEM,gBAAgB,KAAU,CAAC;IAC3B,eAAe,KAAU,CAAC;CACjC;AAhBD,kCAgBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { TaggedChange } from \"../rebase/index.js\";\n\nimport type { ChangeFamilyEditor } from \"./changeFamily.js\";\n\nexport abstract class EditBuilder<TChange> implements ChangeFamilyEditor {\n\tpublic constructor(\n\t\tprivate readonly changeReceiver: (change: TaggedChange<TChange>) => void,\n\t) {}\n\n\t/**\n\t * Subclasses add editing methods which call this with their generated edits.\n\t *\n\t * @sealed\n\t */\n\tprotected applyChange(change: TaggedChange<TChange>): void {\n\t\tthis.changeReceiver(change);\n\t}\n\n\tpublic enterTransaction(): void {}\n\tpublic exitTransaction(): void {}\n}\n"]}
@@ -2,6 +2,6 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export type { ChangeFamily, ChangeFamilyEditor, ChangeEncodingContext, ChangeFamilyCodec, } from "./changeFamily.js";
5
+ export type { ChangeFamily, ChangeFamilyEditor, ChangeEncodingContext, ChangeDecodingContext, ChangeFamilyCodec, ProcessChangeFn, } from "./changeFamily.js";
6
6
  export { EditBuilder } from "./editBuilder.js";
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/change-family/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/change-family/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/change-family/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH,mDAA+C;AAAtC,6GAAA,WAAW,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tChangeFamily,\n\tChangeFamilyEditor,\n\tChangeEncodingContext,\n\tChangeFamilyCodec,\n} from \"./changeFamily.js\";\nexport { EditBuilder } from \"./editBuilder.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/change-family/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAUH,mDAA+C;AAAtC,6GAAA,WAAW,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tChangeFamily,\n\tChangeFamilyEditor,\n\tChangeEncodingContext,\n\tChangeDecodingContext,\n\tChangeFamilyCodec,\n\tProcessChangeFn,\n} from \"./changeFamily.js\";\nexport { EditBuilder } from \"./editBuilder.js\";\n"]}
@@ -2,10 +2,11 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { EmptyKey, type TreeType, type Value, type TreeValue, AnchorSet, type DetachedField, type UpPath, type NormalizedUpPath, type INormalizedUpPath, type NormalizedFieldUpPath, type Range, type RangeUpPath, type PlaceUpPath, type PlaceIndex, type NodeIndex, type FieldUpPath, type Anchor, type RootField, type ChildCollection, type ChildLocation, type FieldMapObject, type NodeData, type GenericTreeNode, type JsonableTree, EncodedJsonableTree, rootFieldKey, rootField, type ITreeCursor, CursorLocationType, type ITreeCursorSynchronous, castCursorToSynchronous, type GenericFieldsNode, type AnchorLocator, genericTreeKeys, getGenericTreeField, genericTreeDeleteIfEmpty, getDepth, mapCursorField, mapCursorFields, iterateCursorField, type MapTree, detachedFieldAsKey, keyAsDetachedField, visitDelta, createAnnouncedVisitor, combineVisitors, announceDelta, applyDelta, makeDetachedFieldIndex, setGenericTreeField, type DeltaVisitor, type AnnouncedVisitor, SparseNode, getDescendant, compareUpPaths, clonePath, topDownPath, compareFieldUpPaths, forEachNode, forEachNodeInSubtree, forEachField, type PathRootPrefix, deltaForRootInitialization, makeDetachedNodeId, offsetDetachId, emptyDelta, type AnchorSlot, type AnchorNode, anchorSlot, type UpPathDefault, isDetachedUpPath, inCursorField, inCursorNode, type AnchorEvents, type AnchorSetRootEvents, type ProtoNodes, CursorMarker, isCursor, DetachedFieldIndex, type ReadOnlyDetachedFieldIndex, type DetachedFieldIndexCheckpoint, type ForestRootId, getDetachedFieldContainingPath, aboveRootPlaceholder, type DeltaRoot, type DeltaMark, type DeltaDetachedNodeId, type DeltaFieldMap, type DeltaDetachedNodeChanges, type DeltaDetachedNodeBuild, type DeltaDetachedNodeDestruction, type DeltaDetachedNodeRename, type DeltaFieldChanges, type ExclusiveMapTree, deepCopyMapTree, type TreeChunk, dummyRoot, cursorChunk, tryGetChunk, type ChunkedCursor, DetachedFieldIndexFormatVersion, detachedFieldIndexCodecBuilder, areDetachedNodeIdsEqual, deltaFieldMapHasVisibleChanges, deltaFieldChangesHaveVisibleChanges, forEachNodeSubsequence, } from "./tree/index.js";
5
+ export { EmptyKey, type TreeType, type Value, type TreeValue, AnchorSet, type DetachedField, type UpPath, type NormalizedUpPath, type INormalizedUpPath, type NormalizedFieldUpPath, type Range, type RangeUpPath, type PlaceUpPath, type PlaceIndex, type NodeIndex, type FieldUpPath, type Anchor, type RootField, type ChildCollection, type ChildLocation, type FieldMapObject, type NodeData, type GenericTreeNode, type JsonableTree, EncodedJsonableTree, rootFieldKey, rootField, type ITreeCursor, CursorLocationType, type ITreeCursorSynchronous, castCursorToSynchronous, type GenericFieldsNode, type AnchorLocator, genericTreeKeys, getGenericTreeField, genericTreeDeleteIfEmpty, getDepth, mapCursorField, mapCursorFields, iterateCursorField, type MapTree, detachedFieldAsKey, keyAsDetachedField, visitDelta, createAnnouncedVisitor, combineVisitors, announceDelta, applyDelta, makeDetachedFieldIndex, setGenericTreeField, type DeltaVisitor, type AnnouncedVisitor, SparseNode, getDescendant, compareUpPaths, clonePath, topDownPath, compareFieldUpPaths, forEachNode, forEachNodeInSubtree, forEachField, type PathRootPrefix, deltaForRootInitialization, makeDetachedNodeId, offsetDetachId, emptyDelta, type AnchorSlot, type AnchorNode, anchorSlot, type UpPathDefault, isDetachedUpPath, inCursorField, inCursorNode, type AnchorEvents, type AnchorSetRootEvents, type ProtoNodes, CursorMarker, isCursor, DetachedFieldIndex, type DetachedFieldSummaryData, type ReadOnlyDetachedFieldIndex, type DetachedFieldIndexCheckpoint, type ForestRootId, getDetachedFieldContainingPath, aboveRootPlaceholder, type DeltaRoot, type DeltaMark, type DeltaDetachedNodeId, type DeltaFieldMap, type DeltaDetachedNodeChanges, type DeltaDetachedNodeBuild, type DeltaDetachedNodeDestruction, type DeltaDetachedNodeRename, type DeltaFieldChanges, type ExclusiveMapTree, deepCopyMapTree, type TreeChunk, dummyRoot, cursorChunk, tryGetChunk, type ChunkedCursor, DetachedFieldIndexFormatVersion, detachedFieldIndexCodecBuilder, areDetachedNodeIdsEqual, deltaFieldMapHasVisibleChanges, deltaFieldChangesHaveVisibleChanges, forEachNodeSubsequence, } from "./tree/index.js";
6
6
  export { TreeNavigationResult, type IEditableForest, type IForestSubscription, type TreeLocation, type FieldLocation, type ForestLocation, type ITreeSubscriptionCursor, ITreeSubscriptionCursorState, type FieldAnchor, moveToDetachedField, type ForestEvents, } from "./forest/index.js";
7
7
  export { type FieldKey, type TreeNodeSchemaIdentifier, type TreeFieldStoredSchema, ValueSchema, TreeNodeStoredSchema, type TreeStoredSchemaSubscription, type MutableTreeStoredSchema, type FieldKindIdentifier, type FieldKindData, type TreeTypeSet, type TreeStoredSchema, TreeStoredSchemaRepository, schemaDataIsEmpty, type SchemaEvents, forbiddenFieldKindIdentifier, identifierFieldKindIdentifier, storedEmptyFieldSchema, type StoredSchemaCollection, schemaFormatV1, schemaFormatV2, LeafNodeStoredSchema, ObjectNodeStoredSchema, MapNodeStoredSchema, decodeFieldSchema, encodeFieldSchemaV1, encodeFieldSchemaV2, storedSchemaDecodeDispatcher, type SchemaAndPolicy, Multiplicity, type SchemaPolicy, SchemaFormatVersion, } from "./schema-stored/index.js";
8
- export { type ChangeFamily, type ChangeFamilyCodec, type ChangeEncodingContext, type ChangeFamilyEditor, EditBuilder, } from "./change-family/index.js";
8
+ export type { ChangeFamily, ChangeFamilyCodec, ChangeEncodingContext, ChangeDecodingContext, ChangeFamilyEditor, ProcessChangeFn, } from "./change-family/index.js";
9
+ export { EditBuilder } from "./change-family/index.js";
9
10
  export { areEqualChangeAtomIds, areEqualChangeAtomIdOpts, makeChangeAtomId, asChangeAtomId, type ChangeRebaser, findAncestor, findCommonAncestor, type GraphCommit, CommitKind, type CommitMetadata, type LocalChangeMetadata, type RemoteChangeMetadata, type ChangeMetadata, type LabelTree, type TransactionLabels, type RevisionTag, RevisionTagSchema, RevisionTagCodec, type ChangesetLocalId, type ChangeAtomId, type ChangeAtomIdMap, type TaggedChange, makeAnonChange, tagChange, mapTaggedChange, tagRollbackInverse, SessionIdSchema, mintCommit, rebaseBranch, type BranchRebaseResult, rebaseChange, rebaseChangeOverChanges, type RevisionMetadataSource, revisionMetadataSourceFromInfo, type RevisionInfo, type EncodedRevisionTag, type EncodedStableId, type EncodedChangeAtomId, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, StableIdSchema, subtractChangeAtomIds, replaceChange, type RebaseStats, type RebaseStatsWithDuration, isAncestor, type ChangeAtomIdRangeMap, newChangeAtomIdRangeMap, comparePartialRevisions, compareChangesetLocalIds, comparePartialChangesetLocalIds, diffHistories, type RevisionReplacer, } from "./rebase/index.js";
10
11
  export { type Revertible, RevertibleStatus, type RevertibleFactory, type RevertibleAlphaFactory, type RevertibleAlpha, } from "./revertible.js";
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,SAAS,EACd,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,KAAK,WAAW,EAChB,kBAAkB,EAClB,KAAK,sBAAsB,EAC3B,uBAAuB,EACvB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,QAAQ,EACR,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,KAAK,OAAO,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,EACV,sBAAsB,EACtB,eAAe,EACf,aAAa,EACb,UAAU,EACV,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,YAAY,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B,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,UAAU,EACV,KAAK,oBAAoB,EACzB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,EAC/B,aAAa,EACb,KAAK,gBAAgB,GACrB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACN,KAAK,UAAU,EACf,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,GACpB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,SAAS,EACd,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,KAAK,WAAW,EAChB,kBAAkB,EAClB,KAAK,sBAAsB,EAC3B,uBAAuB,EACvB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,QAAQ,EACR,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,KAAK,OAAO,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,EACV,sBAAsB,EACtB,eAAe,EACf,aAAa,EACb,UAAU,EACV,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,YAAY,EACjB,KA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mB,OAAA;AACnB,wHAAA,4BAA4B,OAAA;AAE5B,wGAAA,YAAY,OAAA;AAEZ,+GAAA,mBAAmB,OAAA;AAGpB,qDAMkC;AADjC,uGAAA,WAAW,OAAA;AAGZ,8CAuD2B;AAtD1B,iHAAA,qBAAqB,OAAA;AACrB,oHAAA,wBAAwB,OAAA;AACxB,4GAAA,gBAAgB,OAAA;AAChB,0GAAA,cAAc,OAAA;AAEd,wGAAA,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAElB,sGAAA,UAAU,OAAA;AAQV,6GAAA,iBAAiB,OAAA;AACjB,4GAAA,gBAAgB,OAAA;AAKhB,0GAAA,cAAc,OAAA;AACd,qGAAA,SAAS,OAAA;AACT,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,2GAAA,eAAe,OAAA;AACf,sGAAA,UAAU,OAAA;AACV,wGAAA,YAAY,OAAA;AAEZ,wGAAA,YAAY,OAAA;AACZ,mHAAA,uBAAuB,OAAA;AAEvB,0HAAA,8BAA8B,OAAA;AAK9B,wGAAA,YAAY,OAAA;AACZ,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,0GAAA,cAAc,OAAA;AACd,iHAAA,qBAAqB,OAAA;AACrB,yGAAA,aAAa,OAAA;AAGb,sGAAA,UAAU,OAAA;AAEV,mHAAA,uBAAuB,OAAA;AACvB,mHAAA,uBAAuB,OAAA;AACvB,oHAAA,wBAAwB,OAAA;AACxB,2HAAA,+BAA+B,OAAA;AAC/B,yGAAA,aAAa,OAAA;AAId,iDAMyB;AAJxB,iHAAA,gBAAgB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tEmptyKey,\n\ttype TreeType,\n\ttype Value,\n\ttype TreeValue,\n\tAnchorSet,\n\ttype DetachedField,\n\ttype UpPath,\n\ttype NormalizedUpPath,\n\ttype INormalizedUpPath,\n\ttype NormalizedFieldUpPath,\n\ttype Range,\n\ttype RangeUpPath,\n\ttype PlaceUpPath,\n\ttype PlaceIndex,\n\ttype NodeIndex,\n\ttype FieldUpPath,\n\ttype Anchor,\n\ttype RootField,\n\ttype ChildCollection,\n\ttype ChildLocation,\n\ttype FieldMapObject,\n\ttype NodeData,\n\ttype GenericTreeNode,\n\ttype JsonableTree,\n\tEncodedJsonableTree,\n\trootFieldKey,\n\trootField,\n\ttype ITreeCursor,\n\tCursorLocationType,\n\ttype ITreeCursorSynchronous,\n\tcastCursorToSynchronous,\n\ttype GenericFieldsNode,\n\ttype AnchorLocator,\n\tgenericTreeKeys,\n\tgetGenericTreeField,\n\tgenericTreeDeleteIfEmpty,\n\tgetDepth,\n\tmapCursorField,\n\tmapCursorFields,\n\titerateCursorField,\n\ttype MapTree,\n\tdetachedFieldAsKey,\n\tkeyAsDetachedField,\n\tvisitDelta,\n\tcreateAnnouncedVisitor,\n\tcombineVisitors,\n\tannounceDelta,\n\tapplyDelta,\n\tmakeDetachedFieldIndex,\n\tsetGenericTreeField,\n\ttype DeltaVisitor,\n\ttype AnnouncedVisitor,\n\tSparseNode,\n\tgetDescendant,\n\tcompareUpPaths,\n\tclonePath,\n\ttopDownPath,\n\tcompareFieldUpPaths,\n\tforEachNode,\n\tforEachNodeInSubtree,\n\tforEachField,\n\ttype PathRootPrefix,\n\tdeltaForRootInitialization,\n\tmakeDetachedNodeId,\n\toffsetDetachId,\n\temptyDelta,\n\ttype AnchorSlot,\n\ttype AnchorNode,\n\tanchorSlot,\n\ttype UpPathDefault,\n\tisDetachedUpPath,\n\tinCursorField,\n\tinCursorNode,\n\ttype AnchorEvents,\n\ttype AnchorSetRootEvents,\n\ttype ProtoNodes,\n\tCursorMarker,\n\tisCursor,\n\tDetachedFieldIndex,\n\ttype ReadOnlyDetachedFieldIndex,\n\ttype DetachedFieldIndexCheckpoint,\n\ttype ForestRootId,\n\tgetDetachedFieldContainingPath,\n\taboveRootPlaceholder,\n\ttype DeltaRoot,\n\ttype DeltaMark,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaFieldMap,\n\ttype DeltaDetachedNodeChanges,\n\ttype DeltaDetachedNodeBuild,\n\ttype DeltaDetachedNodeDestruction,\n\ttype DeltaDetachedNodeRename,\n\ttype DeltaFieldChanges,\n\ttype ExclusiveMapTree,\n\tdeepCopyMapTree,\n\ttype TreeChunk,\n\tdummyRoot,\n\tcursorChunk,\n\ttryGetChunk,\n\ttype ChunkedCursor,\n\tDetachedFieldIndexFormatVersion,\n\tdetachedFieldIndexCodecBuilder,\n\tareDetachedNodeIdsEqual,\n\tdeltaFieldMapHasVisibleChanges,\n\tdeltaFieldChangesHaveVisibleChanges,\n\tforEachNodeSubsequence,\n} from \"./tree/index.js\";\n\nexport {\n\tTreeNavigationResult,\n\ttype IEditableForest,\n\ttype IForestSubscription,\n\ttype TreeLocation,\n\ttype FieldLocation,\n\ttype ForestLocation,\n\ttype ITreeSubscriptionCursor,\n\tITreeSubscriptionCursorState,\n\ttype FieldAnchor,\n\tmoveToDetachedField,\n\ttype ForestEvents,\n} from \"./forest/index.js\";\n\nexport {\n\ttype FieldKey,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeFieldStoredSchema,\n\tValueSchema,\n\tTreeNodeStoredSchema,\n\ttype TreeStoredSchemaSubscription,\n\ttype MutableTreeStoredSchema,\n\ttype FieldKindIdentifier,\n\ttype FieldKindData,\n\ttype TreeTypeSet,\n\ttype TreeStoredSchema,\n\tTreeStoredSchemaRepository,\n\tschemaDataIsEmpty,\n\ttype SchemaEvents,\n\tforbiddenFieldKindIdentifier,\n\tidentifierFieldKindIdentifier,\n\tstoredEmptyFieldSchema,\n\ttype StoredSchemaCollection,\n\tschemaFormatV1,\n\tschemaFormatV2,\n\tLeafNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tdecodeFieldSchema,\n\tencodeFieldSchemaV1,\n\tencodeFieldSchemaV2,\n\tstoredSchemaDecodeDispatcher,\n\ttype SchemaAndPolicy,\n\tMultiplicity,\n\ttype SchemaPolicy,\n\tSchemaFormatVersion,\n} from \"./schema-stored/index.js\";\n\nexport {\n\ttype ChangeFamily,\n\ttype ChangeFamilyCodec,\n\ttype ChangeEncodingContext,\n\ttype ChangeFamilyEditor,\n\tEditBuilder,\n} from \"./change-family/index.js\";\n\nexport {\n\tareEqualChangeAtomIds,\n\tareEqualChangeAtomIdOpts,\n\tmakeChangeAtomId,\n\tasChangeAtomId,\n\ttype ChangeRebaser,\n\tfindAncestor,\n\tfindCommonAncestor,\n\ttype GraphCommit,\n\tCommitKind,\n\ttype CommitMetadata,\n\ttype LocalChangeMetadata,\n\ttype RemoteChangeMetadata,\n\ttype ChangeMetadata,\n\ttype LabelTree,\n\ttype TransactionLabels,\n\ttype RevisionTag,\n\tRevisionTagSchema,\n\tRevisionTagCodec,\n\ttype ChangesetLocalId,\n\ttype ChangeAtomId,\n\ttype ChangeAtomIdMap,\n\ttype TaggedChange,\n\tmakeAnonChange,\n\ttagChange,\n\tmapTaggedChange,\n\ttagRollbackInverse,\n\tSessionIdSchema,\n\tmintCommit,\n\trebaseBranch,\n\ttype BranchRebaseResult,\n\trebaseChange,\n\trebaseChangeOverChanges,\n\ttype RevisionMetadataSource,\n\trevisionMetadataSourceFromInfo,\n\ttype RevisionInfo,\n\ttype EncodedRevisionTag,\n\ttype EncodedStableId,\n\ttype EncodedChangeAtomId,\n\ttaggedAtomId,\n\ttaggedOptAtomId,\n\toffsetChangeAtomId,\n\tStableIdSchema,\n\tsubtractChangeAtomIds,\n\treplaceChange,\n\ttype RebaseStats,\n\ttype RebaseStatsWithDuration,\n\tisAncestor,\n\ttype ChangeAtomIdRangeMap,\n\tnewChangeAtomIdRangeMap,\n\tcomparePartialRevisions,\n\tcompareChangesetLocalIds,\n\tcomparePartialChangesetLocalIds,\n\tdiffHistories,\n\ttype RevisionReplacer,\n} from \"./rebase/index.js\";\n\nexport {\n\ttype Revertible,\n\tRevertibleStatus,\n\ttype RevertibleFactory,\n\ttype RevertibleAlphaFactory,\n\ttype RevertibleAlpha,\n} from \"./revertible.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;AAEH,4CA4GyB;AA3GxB,oGAAA,QAAQ,OAAA;AAIR,qGAAA,SAAS,OAAA;AAoBT,+GAAA,mBAAmB,OAAA;AACnB,wGAAA,YAAY,OAAA;AACZ,qGAAA,SAAS,OAAA;AAET,8GAAA,kBAAkB,OAAA;AAElB,mHAAA,uBAAuB,OAAA;AAGvB,2GAAA,eAAe,OAAA;AACf,+GAAA,mBAAmB,OAAA;AACnB,oHAAA,wBAAwB,OAAA;AACxB,oGAAA,QAAQ,OAAA;AACR,0GAAA,cAAc,OAAA;AACd,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAElB,8GAAA,kBAAkB,OAAA;AAClB,8GAAA,kBAAkB,OAAA;AAClB,sGAAA,UAAU,OAAA;AACV,kHAAA,sBAAsB,OAAA;AACtB,2GAAA,eAAe,OAAA;AACf,yGAAA,aAAa,OAAA;AACb,sGAAA,UAAU,OAAA;AACV,kHAAA,sBAAsB,OAAA;AACtB,+GAAA,mBAAmB,OAAA;AAGnB,sGAAA,UAAU,OAAA;AACV,yGAAA,aAAa,OAAA;AACb,0GAAA,cAAc,OAAA;AACd,qGAAA,SAAS,OAAA;AACT,uGAAA,WAAW,OAAA;AACX,+GAAA,mBAAmB,OAAA;AACnB,uGAAA,WAAW,OAAA;AACX,gHAAA,oBAAoB,OAAA;AACpB,wGAAA,YAAY,OAAA;AAEZ,sHAAA,0BAA0B,OAAA;AAC1B,8GAAA,kBAAkB,OAAA;AAClB,0GAAA,cAAc,OAAA;AACd,sGAAA,UAAU,OAAA;AAGV,sGAAA,UAAU,OAAA;AAEV,4GAAA,gBAAgB,OAAA;AAChB,yGAAA,aAAa,OAAA;AACb,wGAAA,YAAY,OAAA;AAIZ,wGAAA,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AElB,sGAAA,UAAU,OAAA;AAQV,6GAAA,iBAAiB,OAAA;AACjB,4GAAA,gBAAgB,OAAA;AAKhB,0GAAA,cAAc,OAAA;AACd,qGAAA,SAAS,OAAA;AACT,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,2GAAA,eAAe,OAAA;AACf,sGAAA,UAAU,OAAA;AACV,wGAAA,YAAY,OAAA;AAEZ,wGAAA,YAAY,OAAA;AACZ,mHAAA,uBAAuB,OAAA;AAEvB,0HAAA,8BAA8B,OAAA;AAK9B,wGAAA,YAAY,OAAA;AACZ,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,0GAAA,cAAc,OAAA;AACd,iHAAA,qBAAqB,OAAA;AACrB,yGAAA,aAAa,OAAA;AAGb,sGAAA,UAAU,OAAA;AAEV,mHAAA,uBAAuB,OAAA;AACvB,mHAAA,uBAAuB,OAAA;AACvB,oHAAA,wBAAwB,OAAA;AACxB,2HAAA,+BAA+B,OAAA;AAC/B,yGAAA,aAAa,OAAA;AAId,iDAMyB;AAJxB,iHAAA,gBAAgB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tEmptyKey,\n\ttype TreeType,\n\ttype Value,\n\ttype TreeValue,\n\tAnchorSet,\n\ttype DetachedField,\n\ttype UpPath,\n\ttype NormalizedUpPath,\n\ttype INormalizedUpPath,\n\ttype NormalizedFieldUpPath,\n\ttype Range,\n\ttype RangeUpPath,\n\ttype PlaceUpPath,\n\ttype PlaceIndex,\n\ttype NodeIndex,\n\ttype FieldUpPath,\n\ttype Anchor,\n\ttype RootField,\n\ttype ChildCollection,\n\ttype ChildLocation,\n\ttype FieldMapObject,\n\ttype NodeData,\n\ttype GenericTreeNode,\n\ttype JsonableTree,\n\tEncodedJsonableTree,\n\trootFieldKey,\n\trootField,\n\ttype ITreeCursor,\n\tCursorLocationType,\n\ttype ITreeCursorSynchronous,\n\tcastCursorToSynchronous,\n\ttype GenericFieldsNode,\n\ttype AnchorLocator,\n\tgenericTreeKeys,\n\tgetGenericTreeField,\n\tgenericTreeDeleteIfEmpty,\n\tgetDepth,\n\tmapCursorField,\n\tmapCursorFields,\n\titerateCursorField,\n\ttype MapTree,\n\tdetachedFieldAsKey,\n\tkeyAsDetachedField,\n\tvisitDelta,\n\tcreateAnnouncedVisitor,\n\tcombineVisitors,\n\tannounceDelta,\n\tapplyDelta,\n\tmakeDetachedFieldIndex,\n\tsetGenericTreeField,\n\ttype DeltaVisitor,\n\ttype AnnouncedVisitor,\n\tSparseNode,\n\tgetDescendant,\n\tcompareUpPaths,\n\tclonePath,\n\ttopDownPath,\n\tcompareFieldUpPaths,\n\tforEachNode,\n\tforEachNodeInSubtree,\n\tforEachField,\n\ttype PathRootPrefix,\n\tdeltaForRootInitialization,\n\tmakeDetachedNodeId,\n\toffsetDetachId,\n\temptyDelta,\n\ttype AnchorSlot,\n\ttype AnchorNode,\n\tanchorSlot,\n\ttype UpPathDefault,\n\tisDetachedUpPath,\n\tinCursorField,\n\tinCursorNode,\n\ttype AnchorEvents,\n\ttype AnchorSetRootEvents,\n\ttype ProtoNodes,\n\tCursorMarker,\n\tisCursor,\n\tDetachedFieldIndex,\n\ttype DetachedFieldSummaryData,\n\ttype ReadOnlyDetachedFieldIndex,\n\ttype DetachedFieldIndexCheckpoint,\n\ttype ForestRootId,\n\tgetDetachedFieldContainingPath,\n\taboveRootPlaceholder,\n\ttype DeltaRoot,\n\ttype DeltaMark,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaFieldMap,\n\ttype DeltaDetachedNodeChanges,\n\ttype DeltaDetachedNodeBuild,\n\ttype DeltaDetachedNodeDestruction,\n\ttype DeltaDetachedNodeRename,\n\ttype DeltaFieldChanges,\n\ttype ExclusiveMapTree,\n\tdeepCopyMapTree,\n\ttype TreeChunk,\n\tdummyRoot,\n\tcursorChunk,\n\ttryGetChunk,\n\ttype ChunkedCursor,\n\tDetachedFieldIndexFormatVersion,\n\tdetachedFieldIndexCodecBuilder,\n\tareDetachedNodeIdsEqual,\n\tdeltaFieldMapHasVisibleChanges,\n\tdeltaFieldChangesHaveVisibleChanges,\n\tforEachNodeSubsequence,\n} from \"./tree/index.js\";\n\nexport {\n\tTreeNavigationResult,\n\ttype IEditableForest,\n\ttype IForestSubscription,\n\ttype TreeLocation,\n\ttype FieldLocation,\n\ttype ForestLocation,\n\ttype ITreeSubscriptionCursor,\n\tITreeSubscriptionCursorState,\n\ttype FieldAnchor,\n\tmoveToDetachedField,\n\ttype ForestEvents,\n} from \"./forest/index.js\";\n\nexport {\n\ttype FieldKey,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeFieldStoredSchema,\n\tValueSchema,\n\tTreeNodeStoredSchema,\n\ttype TreeStoredSchemaSubscription,\n\ttype MutableTreeStoredSchema,\n\ttype FieldKindIdentifier,\n\ttype FieldKindData,\n\ttype TreeTypeSet,\n\ttype TreeStoredSchema,\n\tTreeStoredSchemaRepository,\n\tschemaDataIsEmpty,\n\ttype SchemaEvents,\n\tforbiddenFieldKindIdentifier,\n\tidentifierFieldKindIdentifier,\n\tstoredEmptyFieldSchema,\n\ttype StoredSchemaCollection,\n\tschemaFormatV1,\n\tschemaFormatV2,\n\tLeafNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tdecodeFieldSchema,\n\tencodeFieldSchemaV1,\n\tencodeFieldSchemaV2,\n\tstoredSchemaDecodeDispatcher,\n\ttype SchemaAndPolicy,\n\tMultiplicity,\n\ttype SchemaPolicy,\n\tSchemaFormatVersion,\n} from \"./schema-stored/index.js\";\n\nexport type {\n\tChangeFamily,\n\tChangeFamilyCodec,\n\tChangeEncodingContext,\n\tChangeDecodingContext,\n\tChangeFamilyEditor,\n\tProcessChangeFn,\n} from \"./change-family/index.js\";\nexport { EditBuilder } from \"./change-family/index.js\";\n\nexport {\n\tareEqualChangeAtomIds,\n\tareEqualChangeAtomIdOpts,\n\tmakeChangeAtomId,\n\tasChangeAtomId,\n\ttype ChangeRebaser,\n\tfindAncestor,\n\tfindCommonAncestor,\n\ttype GraphCommit,\n\tCommitKind,\n\ttype CommitMetadata,\n\ttype LocalChangeMetadata,\n\ttype RemoteChangeMetadata,\n\ttype ChangeMetadata,\n\ttype LabelTree,\n\ttype TransactionLabels,\n\ttype RevisionTag,\n\tRevisionTagSchema,\n\tRevisionTagCodec,\n\ttype ChangesetLocalId,\n\ttype ChangeAtomId,\n\ttype ChangeAtomIdMap,\n\ttype TaggedChange,\n\tmakeAnonChange,\n\ttagChange,\n\tmapTaggedChange,\n\ttagRollbackInverse,\n\tSessionIdSchema,\n\tmintCommit,\n\trebaseBranch,\n\ttype BranchRebaseResult,\n\trebaseChange,\n\trebaseChangeOverChanges,\n\ttype RevisionMetadataSource,\n\trevisionMetadataSourceFromInfo,\n\ttype RevisionInfo,\n\ttype EncodedRevisionTag,\n\ttype EncodedStableId,\n\ttype EncodedChangeAtomId,\n\ttaggedAtomId,\n\ttaggedOptAtomId,\n\toffsetChangeAtomId,\n\tStableIdSchema,\n\tsubtractChangeAtomIds,\n\treplaceChange,\n\ttype RebaseStats,\n\ttype RebaseStatsWithDuration,\n\tisAncestor,\n\ttype ChangeAtomIdRangeMap,\n\tnewChangeAtomIdRangeMap,\n\tcomparePartialRevisions,\n\tcompareChangesetLocalIds,\n\tcomparePartialChangesetLocalIds,\n\tdiffHistories,\n\ttype RevisionReplacer,\n} from \"./rebase/index.js\";\n\nexport {\n\ttype Revertible,\n\tRevertibleStatus,\n\ttype RevertibleFactory,\n\ttype RevertibleAlphaFactory,\n\ttype RevertibleAlpha,\n} from \"./revertible.js\";\n"]}
@@ -63,7 +63,7 @@ import type { TreeChunk } from "./chunk.js";
63
63
  * change information ahead to calling that code.
64
64
  */
65
65
  /**
66
- * Represents the change made to a document.
66
+ * A change made to a document.
67
67
  * Immutable, therefore safe to retain for async processing.
68
68
  */
69
69
  export interface Root<TTrees = ProtoNodes> {
@@ -116,19 +116,49 @@ export interface Root<TTrees = ProtoNodes> {
116
116
  */
117
117
  export type ProtoNodes = TreeChunk;
118
118
  /**
119
- * Represents a change being made to a part of the document tree.
119
+ * A change to a contiguous range of a field,
120
+ * including nested changes described by {@link Mark.fields}.
121
+ *
122
+ * @remarks
123
+ * See {@link FieldChanges} for how these marks are applied to a field.
124
+ *
125
+ * The presence of {@link Mark.attach} and {@link Mark.detach} determines the kind of change:
126
+ *
127
+ * - Retain (neither `attach` nor `detach` are set): retains `count` existing nodes.
128
+ * When `count` is `1`, `fields` may describe nested changes to the retained node.
129
+ * - Detach (`detach` only): removes `count` existing nodes.
130
+ * When `count` is `1`, `fields` may describe nested changes to the detached node.
131
+ * - Attach (`attach` only): inserts `count` new nodes.
132
+ * `fields` must be undefined.
133
+ * - Replace (both `attach` and `detach`): replaces `count` existing nodes with `count` attached
134
+ * nodes.
135
+ * When `count` is `1`, `fields` may describe nested changes to the detached node.
120
136
  */
121
137
  export interface Mark {
122
138
  /**
123
- * The number of nodes affected.
124
- * When `isAttachMark(mark)` is true, this is the number of new nodes being attached.
125
- * When `isAttachMark(mark)` is false, this the number of existing nodes affected.
126
- * Must be 1 when `fields` is populated.
139
+ * The number of existing nodes affected, attached nodes added, or both, according to the
140
+ * combination of {@link Mark.attach} and {@link Mark.detach}.
141
+ * Must be `1` when {@link Mark.fields} is populated.
142
+ * @remarks
143
+ * The size of the attached content is never inferred from what is attached: it must be exactly `count`.
144
+ * This means that a single mark can represent replacing a run of `count` nodes with `count` new nodes,
145
+ * but cannot replace a run of one length with a run of another length.
146
+ * Such edits require multiple marks.
147
+ *
148
+ * Must be a positive integer.
149
+ * Marks with a count of `0` are no-ops and should be omitted from {@link FieldChanges}.
127
150
  */
128
151
  readonly count: number;
129
152
  /**
130
- * Modifications to the pre-existing content.
131
- * Must be undefined when `attach` is set but `detach` is not.
153
+ * Nested changes to pre-existing content.
154
+ * @remarks
155
+ * If {@link Mark.detach} is set, these changes apply to the node being detached.
156
+ * Otherwise, they apply to the retained node.
157
+ *
158
+ * May only be set when this mark applies to exactly one pre-existing node.
159
+ * Therefore, `fields` must be undefined if:
160
+ * - {@link Mark.attach} is set and {@link Mark.detach} is not: in this case there are no pre-existing nodes.
161
+ * - {@link Mark.count} is not 1: in this case there is not exactly one node to modify.
132
162
  */
133
163
  readonly fields?: FieldMap;
134
164
  /**
@@ -144,48 +174,64 @@ export interface Mark {
144
174
  * A globally unique ID for a node in a detached field.
145
175
  */
146
176
  export interface DetachedNodeId {
177
+ /** Revision in which the ID was allocated, if applicable. */
147
178
  readonly major?: RevisionTag;
179
+ /** Identifier within the scope of {@link DetachedNodeId.major}. */
148
180
  readonly minor: number;
149
181
  }
150
182
  export type FieldMap = ReadonlyMap<FieldKey, FieldChanges>;
151
183
  /**
152
- * Represents changes made to a detached node
184
+ * Changes made to a detached node.
153
185
  */
154
186
  export interface DetachedNodeChanges {
187
+ /** ID of the detached node to modify. */
155
188
  readonly id: DetachedNodeId;
189
+ /** Changes to the node's fields. */
156
190
  readonly fields: FieldMap;
157
191
  }
158
192
  /**
159
- * Represents the creation of detached nodes.
193
+ * The creation of detached nodes.
160
194
  *
161
195
  * Tree creation is idempotent: if a tree with the same ID already exists,
162
196
  * then this build is ignored in favor of the existing tree.
163
197
  */
164
198
  export interface DetachedNodeBuild<TTrees = ProtoNodes> {
199
+ /** ID assigned to the first node in {@link DetachedNodeBuild.trees}. */
165
200
  readonly id: DetachedNodeId;
201
+ /** Nodes to create, assigned consecutive IDs by incrementing {@link DetachedNodeId.minor}. */
166
202
  readonly trees: TTrees;
167
203
  }
168
204
  /**
169
- * Represents the destruction of detached nodes
205
+ * The destruction of detached nodes.
170
206
  */
171
207
  export interface DetachedNodeDestruction {
208
+ /** ID of the first detached node to destroy. */
172
209
  readonly id: DetachedNodeId;
210
+ /** Number of consecutively identified nodes to destroy. */
173
211
  readonly count: number;
174
212
  }
175
213
  /**
176
- * Represents a detached node being assigned a new `DetachedNodeId`.
214
+ * A detached node being assigned a new `DetachedNodeId`.
177
215
  */
178
216
  export interface DetachedNodeRename {
217
+ /** Number of consecutively identified nodes to rename. */
179
218
  readonly count: number;
219
+ /** Current ID of the first node. */
180
220
  readonly oldId: DetachedNodeId;
221
+ /** New ID for the first node. */
181
222
  readonly newId: DetachedNodeId;
182
223
  }
183
224
  export interface FieldChanges {
184
225
  /**
185
- * Represents a list of changes to the nodes in the field.
186
- * The index of each mark within the range of nodes, before
187
- * applying any of the changes, is not represented explicitly.
188
- * It corresponds to the sum of `mark.count` values for all previous marks for which `isAttachMark(mark)` is false.
226
+ * A list of changes to the nodes in the field.
227
+ * @remarks
228
+ * This includes changes to the field's nodes and nested changes to those nodes' fields.
229
+ *
230
+ * The index at which each mark applies is implicit. Marks are applied in order, advancing the
231
+ * index according to the kind of {@link Mark} and its {@link Mark.count}.
232
+ *
233
+ * Because this describes changes rather than content, untouched nodes after the final mark are
234
+ * implicitly retained. This is equivalent to a trailing retain mark with the relevant count.
189
235
  */
190
236
  readonly marks: readonly Mark[];
191
237
  }
@@ -1 +1 @@
1
- {"version":3,"file":"delta.d.ts","sourceRoot":"","sources":["../../../src/core/tree/delta.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH;;;GAGG;AACH,MAAM,WAAW,IAAI,CAAC,MAAM,GAAG,UAAU;IACxC;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC;IAC3B;;;;;;;OAOG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;IACt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A0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,oCAAoC;IACpC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,iCAAiC;IACjC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IAC5B;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;CAChC"}
@@ -1 +1 @@
1
- {"version":3,"file":"delta.js","sourceRoot":"","sources":["../../../src/core/tree/delta.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { RevisionTag } from \"../rebase/index.js\";\nimport type { FieldKey } from \"../schema-stored/index.js\";\n\nimport type { TreeChunk } from \"./chunk.js\";\n\n/**\n * This format describes changes that must be applied to a forest in order to update it.\n * Instances of this format are generated based on incoming changesets and consumed by a view layer (e.g., Forest) to\n * update itself.\n *\n * Because this format is only meant for updating document state, it does not fully represent user intentions.\n * For example, if some concurrent edits A and B insert content at the same location, then a Delta that represents\n * represents the state update for edit A would not include information that allows B's insertion to be ordered\n * relative to A's insertion. This format is therefore not fit to be rebased in the face of concurrent changes.\n * Instead this format is used to describe the end product of rebasing user intentions over concurrent edits.\n *\n * This format is self-contained in the following ways:\n *\n * 1. It uses integer indices (offsets, technically) to describe the locations of necessary changes.\n * As such, it does not rely on document nodes being accessible/locatable by ID.\n *\n * 2. This format does not require historical information in order to apply the changes it describes.\n * For example, if a user undoes the deletion of a subtree, then the Delta generated for the undo edit will contain all\n * information necessary to restore that subtree.\n *\n * This format can be generated from any Changeset without having access to the current document state.\n *\n * This format is meant to serve as the lowest common denominator to represent state changes resulting from any kind\n * of operation on any kind of field.\n * This means all such operations must be expressible in terms of this format.\n *\n * Within the above design constrains, this format is designed with the following goals in mind:\n *\n * 1. Make it easy to walk both a document tree and the delta tree to apply the changes described in the delta\n * with a minimum amount of backtracking over the contents of the tree.\n * This a boon for both code simplicity and performance.\n *\n * 2. Make the format terse.\n *\n * 3. Make the format uniform.\n *\n * These goals are reflected in the following design choices (this is very much optional reading for users of this\n * format):\n *\n * 1. All marks that apply to field elements are represented in a single linear structure where marks that affect later\n * elements of the document field appear after marks that affect earlier elements of the document field.\n *\n * If the marks were not ordered in this fashion then a consumer would need to backtrack within the document field.\n *\n * If the marks were represented in multiple such linear structures then it would be necessary to either:\n * - backtrack when iterating over one structure fully, then the next\n * - maintain a pointer within each such linear structure and advance them in lock-step (like in a k-way merge-sort but\n * more fiddly because of the offsets).\n *\n * 2. Nested changes are not inlined within `ProtoNode`s.\n *\n * Inlining them would force the consuming code to detect such changes within the `ProtoNode` and handle them\n * within the context of the content creation.\n * This would be cumbersome because either the code that is responsible for consuming the `ProtoNode` would need to\n * be aware of and have the context to handle such changes, or some caller of that code would need to find and extract such\n * change information ahead to calling that code.\n */\n\n/**\n * Represents the change made to a document.\n * Immutable, therefore safe to retain for async processing.\n */\nexport interface Root<TTrees = ProtoNodes> {\n\t/**\n\t * Changes to apply to the root fields.\n\t */\n\treadonly fields?: FieldMap;\n\t/**\n\t * New detached nodes to be constructed.\n\t * The ordering has no significance.\n\t *\n\t * Build instructions for a root that is undergoing a rename should be listed under the starting name.\n\t * For example, if one wishes to build a tree which is being renamed from ID A to ID B,\n\t * then the build should be listed under ID A.\n\t */\n\treadonly build?: readonly DetachedNodeBuild<TTrees>[];\n\t/**\n\t * New detached nodes to be destroyed.\n\t * The ordering has no significance.\n\t *\n\t * Destruction instructions for a root that is undergoing a rename should be listed under the final name.\n\t * For example, if one wishes to destroy a tree which is being renamed from ID A to ID B,\n\t * then the destruction should be listed under ID B.\n\t */\n\treadonly destroy?: readonly DetachedNodeDestruction[];\n\t/**\n\t * Refreshers for detached nodes that may need to be recreated.\n\t * The ordering has no significance.\n\t */\n\treadonly refreshers?: readonly DetachedNodeBuild<TTrees>[];\n\t/**\n\t * Changes to apply to detached nodes.\n\t * The ordering has no significance.\n\t *\n\t * Nested changes for a root that is undergoing a rename should be listed under the starting name.\n\t * For example, if one wishes to change a tree which is being renamed from ID A to ID B,\n\t * then the changes should be listed under ID A.\n\t */\n\treadonly global?: readonly DetachedNodeChanges[];\n\t/**\n\t * Detached roots whose associated ID needs to be updated.\n\t * The ordering has no significance.\n\t * Note that the renames may need to be performed in a specific order to avoid collisions.\n\t * This ordering problem is left to the consumer of this format.\n\t */\n\treadonly rename?: readonly DetachedNodeRename[];\n}\n\n/**\n * The default representation for a chunk (sub-sequence) of inserted content.\n */\nexport type ProtoNodes = TreeChunk;\n\n/**\n * Represents a change being made to a part of the document tree.\n */\nexport interface Mark {\n\t/**\n\t * The number of nodes affected.\n\t * When `isAttachMark(mark)` is true, this is the number of new nodes being attached.\n\t * When `isAttachMark(mark)` is false, this the number of existing nodes affected.\n\t * Must be 1 when `fields` is populated.\n\t */\n\treadonly count: number;\n\n\t/**\n\t * Modifications to the pre-existing content.\n\t * Must be undefined when `attach` is set but `detach` is not.\n\t */\n\treadonly fields?: FieldMap;\n\n\t/**\n\t * When set, indicates that some pre-existing content is being detached and sent to the given detached field.\n\t */\n\treadonly detach?: DetachedNodeId;\n\n\t/**\n\t * When set, indicates that some content is being attached from the given detached field.\n\t */\n\treadonly attach?: DetachedNodeId;\n}\n\n/**\n * A globally unique ID for a node in a detached field.\n */\nexport interface DetachedNodeId {\n\treadonly major?: RevisionTag;\n\treadonly minor: number;\n}\n\nexport type FieldMap = ReadonlyMap<FieldKey, FieldChanges>;\n\n/**\n * Represents changes made to a detached node\n */\nexport interface DetachedNodeChanges {\n\treadonly id: DetachedNodeId;\n\treadonly fields: FieldMap;\n}\n\n/**\n * Represents the creation of detached nodes.\n *\n * Tree creation is idempotent: if a tree with the same ID already exists,\n * then this build is ignored in favor of the existing tree.\n */\nexport interface DetachedNodeBuild<TTrees = ProtoNodes> {\n\treadonly id: DetachedNodeId;\n\treadonly trees: TTrees;\n}\n\n/**\n * Represents the destruction of detached nodes\n */\nexport interface DetachedNodeDestruction {\n\treadonly id: DetachedNodeId;\n\treadonly count: number;\n}\n\n/**\n * Represents a detached node being assigned a new `DetachedNodeId`.\n */\nexport interface DetachedNodeRename {\n\treadonly count: number;\n\treadonly oldId: DetachedNodeId;\n\treadonly newId: DetachedNodeId;\n}\n\nexport interface FieldChanges {\n\t/**\n\t * Represents a list of changes to the nodes in the field.\n\t * The index of each mark within the range of nodes, before\n\t * applying any of the changes, is not represented explicitly.\n\t * It corresponds to the sum of `mark.count` values for all previous marks for which `isAttachMark(mark)` is false.\n\t */\n\treadonly marks: readonly Mark[];\n}\n"]}
1
+ {"version":3,"file":"delta.js","sourceRoot":"","sources":["../../../src/core/tree/delta.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { RevisionTag } from \"../rebase/index.js\";\nimport type { FieldKey } from \"../schema-stored/index.js\";\n\nimport type { TreeChunk } from \"./chunk.js\";\n\n/**\n * This format describes changes that must be applied to a forest in order to update it.\n * Instances of this format are generated based on incoming changesets and consumed by a view layer (e.g., Forest) to\n * update itself.\n *\n * Because this format is only meant for updating document state, it does not fully represent user intentions.\n * For example, if some concurrent edits A and B insert content at the same location, then a Delta that represents\n * represents the state update for edit A would not include information that allows B's insertion to be ordered\n * relative to A's insertion. This format is therefore not fit to be rebased in the face of concurrent changes.\n * Instead this format is used to describe the end product of rebasing user intentions over concurrent edits.\n *\n * This format is self-contained in the following ways:\n *\n * 1. It uses integer indices (offsets, technically) to describe the locations of necessary changes.\n * As such, it does not rely on document nodes being accessible/locatable by ID.\n *\n * 2. This format does not require historical information in order to apply the changes it describes.\n * For example, if a user undoes the deletion of a subtree, then the Delta generated for the undo edit will contain all\n * information necessary to restore that subtree.\n *\n * This format can be generated from any Changeset without having access to the current document state.\n *\n * This format is meant to serve as the lowest common denominator to represent state changes resulting from any kind\n * of operation on any kind of field.\n * This means all such operations must be expressible in terms of this format.\n *\n * Within the above design constrains, this format is designed with the following goals in mind:\n *\n * 1. Make it easy to walk both a document tree and the delta tree to apply the changes described in the delta\n * with a minimum amount of backtracking over the contents of the tree.\n * This a boon for both code simplicity and performance.\n *\n * 2. Make the format terse.\n *\n * 3. Make the format uniform.\n *\n * These goals are reflected in the following design choices (this is very much optional reading for users of this\n * format):\n *\n * 1. All marks that apply to field elements are represented in a single linear structure where marks that affect later\n * elements of the document field appear after marks that affect earlier elements of the document field.\n *\n * If the marks were not ordered in this fashion then a consumer would need to backtrack within the document field.\n *\n * If the marks were represented in multiple such linear structures then it would be necessary to either:\n * - backtrack when iterating over one structure fully, then the next\n * - maintain a pointer within each such linear structure and advance them in lock-step (like in a k-way merge-sort but\n * more fiddly because of the offsets).\n *\n * 2. Nested changes are not inlined within `ProtoNode`s.\n *\n * Inlining them would force the consuming code to detect such changes within the `ProtoNode` and handle them\n * within the context of the content creation.\n * This would be cumbersome because either the code that is responsible for consuming the `ProtoNode` would need to\n * be aware of and have the context to handle such changes, or some caller of that code would need to find and extract such\n * change information ahead to calling that code.\n */\n\n/**\n * A change made to a document.\n * Immutable, therefore safe to retain for async processing.\n */\nexport interface Root<TTrees = ProtoNodes> {\n\t/**\n\t * Changes to apply to the root fields.\n\t */\n\treadonly fields?: FieldMap;\n\t/**\n\t * New detached nodes to be constructed.\n\t * The ordering has no significance.\n\t *\n\t * Build instructions for a root that is undergoing a rename should be listed under the starting name.\n\t * For example, if one wishes to build a tree which is being renamed from ID A to ID B,\n\t * then the build should be listed under ID A.\n\t */\n\treadonly build?: readonly DetachedNodeBuild<TTrees>[];\n\t/**\n\t * New detached nodes to be destroyed.\n\t * The ordering has no significance.\n\t *\n\t * Destruction instructions for a root that is undergoing a rename should be listed under the final name.\n\t * For example, if one wishes to destroy a tree which is being renamed from ID A to ID B,\n\t * then the destruction should be listed under ID B.\n\t */\n\treadonly destroy?: readonly DetachedNodeDestruction[];\n\t/**\n\t * Refreshers for detached nodes that may need to be recreated.\n\t * The ordering has no significance.\n\t */\n\treadonly refreshers?: readonly DetachedNodeBuild<TTrees>[];\n\t/**\n\t * Changes to apply to detached nodes.\n\t * The ordering has no significance.\n\t *\n\t * Nested changes for a root that is undergoing a rename should be listed under the starting name.\n\t * For example, if one wishes to change a tree which is being renamed from ID A to ID B,\n\t * then the changes should be listed under ID A.\n\t */\n\treadonly global?: readonly DetachedNodeChanges[];\n\t/**\n\t * Detached roots whose associated ID needs to be updated.\n\t * The ordering has no significance.\n\t * Note that the renames may need to be performed in a specific order to avoid collisions.\n\t * This ordering problem is left to the consumer of this format.\n\t */\n\treadonly rename?: readonly DetachedNodeRename[];\n}\n\n/**\n * The default representation for a chunk (sub-sequence) of inserted content.\n */\nexport type ProtoNodes = TreeChunk;\n\n/**\n * A change to a contiguous range of a field,\n * including nested changes described by {@link Mark.fields}.\n *\n * @remarks\n * See {@link FieldChanges} for how these marks are applied to a field.\n *\n * The presence of {@link Mark.attach} and {@link Mark.detach} determines the kind of change:\n *\n * - Retain (neither `attach` nor `detach` are set): retains `count` existing nodes.\n * When `count` is `1`, `fields` may describe nested changes to the retained node.\n * - Detach (`detach` only): removes `count` existing nodes.\n * When `count` is `1`, `fields` may describe nested changes to the detached node.\n * - Attach (`attach` only): inserts `count` new nodes.\n * `fields` must be undefined.\n * - Replace (both `attach` and `detach`): replaces `count` existing nodes with `count` attached\n * nodes.\n * When `count` is `1`, `fields` may describe nested changes to the detached node.\n */\nexport interface Mark {\n\t/**\n\t * The number of existing nodes affected, attached nodes added, or both, according to the\n\t * combination of {@link Mark.attach} and {@link Mark.detach}.\n\t * Must be `1` when {@link Mark.fields} is populated.\n\t * @remarks\n\t * The size of the attached content is never inferred from what is attached: it must be exactly `count`.\n\t * This means that a single mark can represent replacing a run of `count` nodes with `count` new nodes,\n\t * but cannot replace a run of one length with a run of another length.\n\t * Such edits require multiple marks.\n\t *\n\t * Must be a positive integer.\n\t * Marks with a count of `0` are no-ops and should be omitted from {@link FieldChanges}.\n\t */\n\treadonly count: number;\n\n\t/**\n\t * Nested changes to pre-existing content.\n\t * @remarks\n\t * If {@link Mark.detach} is set, these changes apply to the node being detached.\n\t * Otherwise, they apply to the retained node.\n\t *\n\t * May only be set when this mark applies to exactly one pre-existing node.\n\t * Therefore, `fields` must be undefined if:\n\t * - {@link Mark.attach} is set and {@link Mark.detach} is not: in this case there are no pre-existing nodes.\n\t * - {@link Mark.count} is not 1: in this case there is not exactly one node to modify.\n\t */\n\treadonly fields?: FieldMap;\n\n\t/**\n\t * When set, indicates that some pre-existing content is being detached and sent to the given detached field.\n\t */\n\treadonly detach?: DetachedNodeId;\n\n\t/**\n\t * When set, indicates that some content is being attached from the given detached field.\n\t */\n\treadonly attach?: DetachedNodeId;\n}\n\n/**\n * A globally unique ID for a node in a detached field.\n */\nexport interface DetachedNodeId {\n\t/** Revision in which the ID was allocated, if applicable. */\n\treadonly major?: RevisionTag;\n\t/** Identifier within the scope of {@link DetachedNodeId.major}. */\n\treadonly minor: number;\n}\n\nexport type FieldMap = ReadonlyMap<FieldKey, FieldChanges>;\n\n/**\n * Changes made to a detached node.\n */\nexport interface DetachedNodeChanges {\n\t/** ID of the detached node to modify. */\n\treadonly id: DetachedNodeId;\n\t/** Changes to the node's fields. */\n\treadonly fields: FieldMap;\n}\n\n/**\n * The creation of detached nodes.\n *\n * Tree creation is idempotent: if a tree with the same ID already exists,\n * then this build is ignored in favor of the existing tree.\n */\nexport interface DetachedNodeBuild<TTrees = ProtoNodes> {\n\t/** ID assigned to the first node in {@link DetachedNodeBuild.trees}. */\n\treadonly id: DetachedNodeId;\n\t/** Nodes to create, assigned consecutive IDs by incrementing {@link DetachedNodeId.minor}. */\n\treadonly trees: TTrees;\n}\n\n/**\n * The destruction of detached nodes.\n */\nexport interface DetachedNodeDestruction {\n\t/** ID of the first detached node to destroy. */\n\treadonly id: DetachedNodeId;\n\t/** Number of consecutively identified nodes to destroy. */\n\treadonly count: number;\n}\n\n/**\n * A detached node being assigned a new `DetachedNodeId`.\n */\nexport interface DetachedNodeRename {\n\t/** Number of consecutively identified nodes to rename. */\n\treadonly count: number;\n\t/** Current ID of the first node. */\n\treadonly oldId: DetachedNodeId;\n\t/** New ID for the first node. */\n\treadonly newId: DetachedNodeId;\n}\n\nexport interface FieldChanges {\n\t/**\n\t * A list of changes to the nodes in the field.\n\t * @remarks\n\t * This includes changes to the field's nodes and nested changes to those nodes' fields.\n\t *\n\t * The index at which each mark applies is implicit. Marks are applied in order, advancing the\n\t * index according to the kind of {@link Mark} and its {@link Mark.count}.\n\t *\n\t * Because this describes changes rather than content, untouched nodes after the final mark are\n\t * implicitly retained. This is equivalent to a trailing retain mark with the relevant count.\n\t */\n\treadonly marks: readonly Mark[];\n}\n"]}