@fluidframework/tree 2.113.1 → 2.115.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (660) hide show
  1. package/CHANGELOG.md +289 -0
  2. package/api-report/tree.alpha.api.md +127 -39
  3. package/dist/core/change-family/changeFamily.d.ts +15 -4
  4. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  5. package/dist/core/change-family/changeFamily.js.map +1 -1
  6. package/dist/core/change-family/editBuilder.d.ts +2 -3
  7. package/dist/core/change-family/editBuilder.d.ts.map +1 -1
  8. package/dist/core/change-family/editBuilder.js +1 -2
  9. package/dist/core/change-family/editBuilder.js.map +1 -1
  10. package/dist/core/change-family/index.d.ts +1 -1
  11. package/dist/core/change-family/index.d.ts.map +1 -1
  12. package/dist/core/change-family/index.js.map +1 -1
  13. package/dist/core/index.d.ts +4 -3
  14. package/dist/core/index.d.ts.map +1 -1
  15. package/dist/core/index.js +3 -2
  16. package/dist/core/index.js.map +1 -1
  17. package/dist/core/rebase/index.d.ts +1 -1
  18. package/dist/core/rebase/index.d.ts.map +1 -1
  19. package/dist/core/rebase/index.js +2 -1
  20. package/dist/core/rebase/index.js.map +1 -1
  21. package/dist/core/rebase/types.d.ts +110 -0
  22. package/dist/core/rebase/types.d.ts.map +1 -1
  23. package/dist/core/rebase/types.js +47 -1
  24. package/dist/core/rebase/types.js.map +1 -1
  25. package/dist/core/tree/delta.d.ts +62 -16
  26. package/dist/core/tree/delta.d.ts.map +1 -1
  27. package/dist/core/tree/delta.js.map +1 -1
  28. package/dist/core/tree/detachedFieldIndex.d.ts +7 -13
  29. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  30. package/dist/core/tree/detachedFieldIndex.js +32 -46
  31. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  32. package/dist/core/tree/index.d.ts +1 -0
  33. package/dist/core/tree/index.d.ts.map +1 -1
  34. package/dist/core/tree/index.js.map +1 -1
  35. package/dist/core/tree/visitorUtils.d.ts +2 -4
  36. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  37. package/dist/core/tree/visitorUtils.js +2 -2
  38. package/dist/core/tree/visitorUtils.js.map +1 -1
  39. package/dist/entrypoints/alpha.d.ts +1 -1
  40. package/dist/entrypoints/alpha.d.ts.map +1 -1
  41. package/dist/entrypoints/alpha.js +8 -3
  42. package/dist/entrypoints/alpha.js.map +1 -1
  43. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +9 -6
  44. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  45. package/dist/feature-libraries/chunked-forest/codec/codecs.js +16 -13
  46. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  47. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  48. package/dist/feature-libraries/chunked-forest/uniformChunk.js +10 -2
  49. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  50. package/dist/feature-libraries/comparison-forest/comparisonForest.d.ts +51 -0
  51. package/dist/feature-libraries/comparison-forest/comparisonForest.d.ts.map +1 -0
  52. package/dist/feature-libraries/comparison-forest/comparisonForest.js +98 -0
  53. package/dist/feature-libraries/comparison-forest/comparisonForest.js.map +1 -0
  54. package/dist/feature-libraries/comparison-forest/index.d.ts +6 -0
  55. package/dist/feature-libraries/comparison-forest/index.d.ts.map +1 -0
  56. package/dist/feature-libraries/comparison-forest/index.js +10 -0
  57. package/dist/feature-libraries/comparison-forest/index.js.map +1 -0
  58. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +8 -6
  59. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  60. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
  61. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  62. package/dist/feature-libraries/default-schema/index.d.ts +1 -1
  63. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  64. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  65. package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
  66. package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
  67. package/dist/feature-libraries/default-schema/noChangeCodecs.js +3 -1
  68. package/dist/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
  69. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +6 -3
  70. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  71. package/dist/feature-libraries/detachedFieldIndexSummarizer.js +18 -6
  72. package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  73. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -3
  74. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  75. package/dist/feature-libraries/forest-summary/forestSummarizer.js +2 -3
  76. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  77. package/dist/feature-libraries/index.d.ts +4 -3
  78. package/dist/feature-libraries/index.d.ts.map +1 -1
  79. package/dist/feature-libraries/index.js +77 -72
  80. package/dist/feature-libraries/index.js.map +1 -1
  81. package/dist/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
  82. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  83. package/dist/feature-libraries/mitigatedChangeFamily.js +12 -0
  84. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  85. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +9 -1
  86. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  87. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  88. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
  89. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  90. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  91. package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
  92. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  93. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  94. package/dist/feature-libraries/modular-schema/invert.d.ts +15 -0
  95. package/dist/feature-libraries/modular-schema/invert.d.ts.map +1 -0
  96. package/dist/feature-libraries/modular-schema/invert.js +159 -0
  97. package/dist/feature-libraries/modular-schema/invert.js.map +1 -0
  98. package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts +3 -4
  99. package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
  100. package/dist/feature-libraries/modular-schema/minimizeModularChange.js +2 -2
  101. package/dist/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
  102. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +9 -9
  103. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  104. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +0 -2
  105. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  106. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +2 -2
  107. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  108. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  109. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  110. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  111. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  112. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -22
  113. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  114. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +53 -406
  115. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  116. package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts +61 -0
  117. package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -0
  118. package/dist/feature-libraries/modular-schema/modularChangeUtils.js +205 -0
  119. package/dist/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -0
  120. package/dist/feature-libraries/modular-schema/prune.d.ts +10 -0
  121. package/dist/feature-libraries/modular-schema/prune.d.ts.map +1 -0
  122. package/dist/feature-libraries/modular-schema/prune.js +49 -0
  123. package/dist/feature-libraries/modular-schema/prune.js.map +1 -0
  124. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +2 -2
  125. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  126. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  127. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
  128. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  129. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  130. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
  131. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  132. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  133. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +2 -2
  134. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  135. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  136. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +2 -2
  137. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  138. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  139. package/dist/feature-libraries/treeTextCursor.d.ts +15 -0
  140. package/dist/feature-libraries/treeTextCursor.d.ts.map +1 -1
  141. package/dist/feature-libraries/treeTextCursor.js +64 -1
  142. package/dist/feature-libraries/treeTextCursor.js.map +1 -1
  143. package/dist/index.d.ts +6 -4
  144. package/dist/index.d.ts.map +1 -1
  145. package/dist/index.js +10 -5
  146. package/dist/index.js.map +1 -1
  147. package/dist/packageVersion.d.ts +1 -1
  148. package/dist/packageVersion.js +1 -1
  149. package/dist/packageVersion.js.map +1 -1
  150. package/dist/shared-tree/serializedChange.d.ts +2 -2
  151. package/dist/shared-tree/serializedChange.d.ts.map +1 -1
  152. package/dist/shared-tree/serializedChange.js.map +1 -1
  153. package/dist/shared-tree/sharedTree.d.ts +11 -3
  154. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  155. package/dist/shared-tree/sharedTree.js +9 -7
  156. package/dist/shared-tree/sharedTree.js.map +1 -1
  157. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +2 -2
  158. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  159. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  160. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +41 -4
  161. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  162. package/dist/shared-tree/sharedTreeChangeFamily.js +57 -1
  163. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  164. package/dist/shared-tree/transactionMinimize.d.ts.map +1 -1
  165. package/dist/shared-tree/transactionMinimize.js +2 -2
  166. package/dist/shared-tree/transactionMinimize.js.map +1 -1
  167. package/dist/shared-tree/transactionPostProcessor.d.ts +2 -1
  168. package/dist/shared-tree/transactionPostProcessor.d.ts.map +1 -1
  169. package/dist/shared-tree/transactionPostProcessor.js.map +1 -1
  170. package/dist/shared-tree/treeCheckout.d.ts +13 -7
  171. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  172. package/dist/shared-tree/treeCheckout.js +59 -13
  173. package/dist/shared-tree/treeCheckout.js.map +1 -1
  174. package/dist/shared-tree-core/branch.d.ts +24 -9
  175. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  176. package/dist/shared-tree-core/branch.js +7 -0
  177. package/dist/shared-tree-core/branch.js.map +1 -1
  178. package/dist/shared-tree-core/editManager.d.ts +4 -4
  179. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  180. package/dist/shared-tree-core/editManager.js +2 -0
  181. package/dist/shared-tree-core/editManager.js.map +1 -1
  182. package/dist/shared-tree-core/editManagerCodecs.d.ts +3 -14
  183. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  184. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  185. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +11 -1
  186. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  187. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  188. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +4 -11
  189. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  190. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  191. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +4 -11
  192. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  193. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  194. package/dist/shared-tree-core/editManagerSummarizer.d.ts +4 -4
  195. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  196. package/dist/shared-tree-core/editManagerSummarizer.js +0 -1
  197. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  198. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
  199. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  200. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  201. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  202. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  203. package/dist/shared-tree-core/messageCodecs.d.ts +8 -1
  204. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  205. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  206. package/dist/shared-tree-core/sharedTreeCore.d.ts +5 -5
  207. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  208. package/dist/shared-tree-core/sharedTreeCore.js +1 -1
  209. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  210. package/dist/shared-tree-core/transaction.d.ts +10 -10
  211. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  212. package/dist/shared-tree-core/transaction.js +6 -3
  213. package/dist/shared-tree-core/transaction.js.map +1 -1
  214. package/dist/simple-tree/api/eraseSchemaDetails.d.ts +15 -0
  215. package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  216. package/dist/simple-tree/api/eraseSchemaDetails.js +15 -0
  217. package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  218. package/dist/simple-tree/api/index.d.ts +1 -1
  219. package/dist/simple-tree/api/index.d.ts.map +1 -1
  220. package/dist/simple-tree/api/index.js +2 -3
  221. package/dist/simple-tree/api/index.js.map +1 -1
  222. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +3 -3
  223. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  224. package/dist/simple-tree/api/schemaStatics.d.ts +6 -7
  225. package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
  226. package/dist/simple-tree/api/schemaStatics.js.map +1 -1
  227. package/dist/simple-tree/api/treeNodeApi.d.ts +20 -24
  228. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  229. package/dist/simple-tree/api/treeNodeApi.js +48 -49
  230. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  231. package/dist/simple-tree/core/treeNode.d.ts +5 -6
  232. package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
  233. package/dist/simple-tree/core/treeNode.js +2 -4
  234. package/dist/simple-tree/core/treeNode.js.map +1 -1
  235. package/dist/simple-tree/core/withType.d.ts +20 -7
  236. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  237. package/dist/simple-tree/core/withType.js +4 -7
  238. package/dist/simple-tree/core/withType.js.map +1 -1
  239. package/dist/simple-tree/index.d.ts +2 -2
  240. package/dist/simple-tree/index.d.ts.map +1 -1
  241. package/dist/simple-tree/index.js +3 -4
  242. package/dist/simple-tree/index.js.map +1 -1
  243. package/dist/simple-tree/leafNodeSchema.d.ts +6 -1
  244. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  245. package/dist/simple-tree/leafNodeSchema.js +0 -1
  246. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  247. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +53 -5
  248. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  249. package/dist/simple-tree/node-kinds/array/arrayNode.js +91 -10
  250. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  251. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +90 -0
  252. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  253. package/dist/simple-tree/node-kinds/map/mapNode.js +26 -1
  254. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  255. package/dist/simple-tree/node-kinds/object/objectNode.js +2 -2
  256. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  257. package/dist/simple-tree/node-kinds/record/recordNode.js +2 -2
  258. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  259. package/dist/text/codePointUtils.d.ts +2 -2
  260. package/dist/text/codePointUtils.js +2 -2
  261. package/dist/text/codePointUtils.js.map +1 -1
  262. package/dist/text/index.d.ts +3 -3
  263. package/dist/text/index.d.ts.map +1 -1
  264. package/dist/text/index.js +4 -4
  265. package/dist/text/index.js.map +1 -1
  266. package/dist/text/textDomain.d.ts +30 -18
  267. package/dist/text/textDomain.d.ts.map +1 -1
  268. package/dist/text/textDomain.js +44 -23
  269. package/dist/text/textDomain.js.map +1 -1
  270. package/dist/text/textDomainFormatted.d.ts +180 -82
  271. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  272. package/dist/text/textDomainFormatted.js +164 -84
  273. package/dist/text/textDomainFormatted.js.map +1 -1
  274. package/dist/text/textDomainFormattedDefault.d.ts +48 -25
  275. package/dist/text/textDomainFormattedDefault.d.ts.map +1 -1
  276. package/dist/text/textDomainFormattedDefault.js +24 -19
  277. package/dist/text/textDomainFormattedDefault.js.map +1 -1
  278. package/dist/treeDataStore.d.ts +49 -0
  279. package/dist/treeDataStore.d.ts.map +1 -0
  280. package/dist/treeDataStore.js +57 -0
  281. package/dist/treeDataStore.js.map +1 -0
  282. package/dist/treeFactory.d.ts +8 -3
  283. package/dist/treeFactory.d.ts.map +1 -1
  284. package/dist/treeFactory.js +6 -1
  285. package/dist/treeFactory.js.map +1 -1
  286. package/dist/util/compressedIds.d.ts +22 -2
  287. package/dist/util/compressedIds.d.ts.map +1 -1
  288. package/dist/util/compressedIds.js +22 -1
  289. package/dist/util/compressedIds.js.map +1 -1
  290. package/lib/core/change-family/changeFamily.d.ts +15 -4
  291. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  292. package/lib/core/change-family/changeFamily.js.map +1 -1
  293. package/lib/core/change-family/editBuilder.d.ts +2 -3
  294. package/lib/core/change-family/editBuilder.d.ts.map +1 -1
  295. package/lib/core/change-family/editBuilder.js +1 -2
  296. package/lib/core/change-family/editBuilder.js.map +1 -1
  297. package/lib/core/change-family/index.d.ts +1 -1
  298. package/lib/core/change-family/index.d.ts.map +1 -1
  299. package/lib/core/change-family/index.js.map +1 -1
  300. package/lib/core/index.d.ts +4 -3
  301. package/lib/core/index.d.ts.map +1 -1
  302. package/lib/core/index.js +2 -2
  303. package/lib/core/index.js.map +1 -1
  304. package/lib/core/rebase/index.d.ts +1 -1
  305. package/lib/core/rebase/index.d.ts.map +1 -1
  306. package/lib/core/rebase/index.js +1 -1
  307. package/lib/core/rebase/index.js.map +1 -1
  308. package/lib/core/rebase/types.d.ts +110 -0
  309. package/lib/core/rebase/types.d.ts.map +1 -1
  310. package/lib/core/rebase/types.js +46 -0
  311. package/lib/core/rebase/types.js.map +1 -1
  312. package/lib/core/tree/delta.d.ts +62 -16
  313. package/lib/core/tree/delta.d.ts.map +1 -1
  314. package/lib/core/tree/delta.js.map +1 -1
  315. package/lib/core/tree/detachedFieldIndex.d.ts +7 -13
  316. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  317. package/lib/core/tree/detachedFieldIndex.js +7 -21
  318. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  319. package/lib/core/tree/index.d.ts +1 -0
  320. package/lib/core/tree/index.d.ts.map +1 -1
  321. package/lib/core/tree/index.js.map +1 -1
  322. package/lib/core/tree/visitorUtils.d.ts +2 -4
  323. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  324. package/lib/core/tree/visitorUtils.js +2 -2
  325. package/lib/core/tree/visitorUtils.js.map +1 -1
  326. package/lib/entrypoints/alpha.d.ts +1 -1
  327. package/lib/entrypoints/alpha.d.ts.map +1 -1
  328. package/lib/entrypoints/alpha.js +1 -1
  329. package/lib/entrypoints/alpha.js.map +1 -1
  330. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +9 -6
  331. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  332. package/lib/feature-libraries/chunked-forest/codec/codecs.js +16 -13
  333. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  334. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  335. package/lib/feature-libraries/chunked-forest/uniformChunk.js +10 -2
  336. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  337. package/lib/feature-libraries/comparison-forest/comparisonForest.d.ts +51 -0
  338. package/lib/feature-libraries/comparison-forest/comparisonForest.d.ts.map +1 -0
  339. package/lib/feature-libraries/comparison-forest/comparisonForest.js +94 -0
  340. package/lib/feature-libraries/comparison-forest/comparisonForest.js.map +1 -0
  341. package/lib/feature-libraries/comparison-forest/index.d.ts +6 -0
  342. package/lib/feature-libraries/comparison-forest/index.d.ts.map +1 -0
  343. package/lib/feature-libraries/comparison-forest/index.js +6 -0
  344. package/lib/feature-libraries/comparison-forest/index.js.map +1 -0
  345. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +8 -6
  346. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  347. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
  348. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  349. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  350. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  351. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  352. package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
  353. package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
  354. package/lib/feature-libraries/default-schema/noChangeCodecs.js +3 -1
  355. package/lib/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
  356. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +6 -3
  357. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  358. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +16 -4
  359. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  360. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -3
  361. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  362. package/lib/feature-libraries/forest-summary/forestSummarizer.js +2 -3
  363. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  364. package/lib/feature-libraries/index.d.ts +4 -3
  365. package/lib/feature-libraries/index.d.ts.map +1 -1
  366. package/lib/feature-libraries/index.js +2 -1
  367. package/lib/feature-libraries/index.js.map +1 -1
  368. package/lib/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
  369. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  370. package/lib/feature-libraries/mitigatedChangeFamily.js +12 -0
  371. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  372. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +9 -1
  373. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  374. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  375. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
  376. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  377. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  378. package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
  379. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  380. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  381. package/lib/feature-libraries/modular-schema/invert.d.ts +15 -0
  382. package/lib/feature-libraries/modular-schema/invert.d.ts.map +1 -0
  383. package/lib/feature-libraries/modular-schema/invert.js +155 -0
  384. package/lib/feature-libraries/modular-schema/invert.js.map +1 -0
  385. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts +3 -4
  386. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
  387. package/lib/feature-libraries/modular-schema/minimizeModularChange.js +2 -2
  388. package/lib/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
  389. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +9 -9
  390. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  391. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +0 -2
  392. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  393. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +2 -2
  394. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  395. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  396. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  397. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  398. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  399. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -22
  400. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  401. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +16 -367
  402. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  403. package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts +61 -0
  404. package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -0
  405. package/lib/feature-libraries/modular-schema/modularChangeUtils.js +192 -0
  406. package/lib/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -0
  407. package/lib/feature-libraries/modular-schema/prune.d.ts +10 -0
  408. package/lib/feature-libraries/modular-schema/prune.d.ts.map +1 -0
  409. package/lib/feature-libraries/modular-schema/prune.js +45 -0
  410. package/lib/feature-libraries/modular-schema/prune.js.map +1 -0
  411. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +2 -2
  412. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  413. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  414. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
  415. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  416. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  417. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
  418. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  419. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  420. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +2 -2
  421. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  422. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  423. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +2 -2
  424. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  425. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  426. package/lib/feature-libraries/treeTextCursor.d.ts +15 -0
  427. package/lib/feature-libraries/treeTextCursor.d.ts.map +1 -1
  428. package/lib/feature-libraries/treeTextCursor.js +62 -1
  429. package/lib/feature-libraries/treeTextCursor.js.map +1 -1
  430. package/lib/index.d.ts +6 -4
  431. package/lib/index.d.ts.map +1 -1
  432. package/lib/index.js +4 -3
  433. package/lib/index.js.map +1 -1
  434. package/lib/packageVersion.d.ts +1 -1
  435. package/lib/packageVersion.js +1 -1
  436. package/lib/packageVersion.js.map +1 -1
  437. package/lib/shared-tree/serializedChange.d.ts +2 -2
  438. package/lib/shared-tree/serializedChange.d.ts.map +1 -1
  439. package/lib/shared-tree/serializedChange.js.map +1 -1
  440. package/lib/shared-tree/sharedTree.d.ts +11 -3
  441. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  442. package/lib/shared-tree/sharedTree.js +10 -8
  443. package/lib/shared-tree/sharedTree.js.map +1 -1
  444. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +2 -2
  445. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  446. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  447. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +41 -4
  448. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  449. package/lib/shared-tree/sharedTreeChangeFamily.js +55 -0
  450. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  451. package/lib/shared-tree/transactionMinimize.d.ts.map +1 -1
  452. package/lib/shared-tree/transactionMinimize.js +3 -3
  453. package/lib/shared-tree/transactionMinimize.js.map +1 -1
  454. package/lib/shared-tree/transactionPostProcessor.d.ts +2 -1
  455. package/lib/shared-tree/transactionPostProcessor.d.ts.map +1 -1
  456. package/lib/shared-tree/transactionPostProcessor.js.map +1 -1
  457. package/lib/shared-tree/treeCheckout.d.ts +13 -7
  458. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  459. package/lib/shared-tree/treeCheckout.js +61 -15
  460. package/lib/shared-tree/treeCheckout.js.map +1 -1
  461. package/lib/shared-tree-core/branch.d.ts +24 -9
  462. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  463. package/lib/shared-tree-core/branch.js +7 -0
  464. package/lib/shared-tree-core/branch.js.map +1 -1
  465. package/lib/shared-tree-core/editManager.d.ts +4 -4
  466. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  467. package/lib/shared-tree-core/editManager.js +2 -0
  468. package/lib/shared-tree-core/editManager.js.map +1 -1
  469. package/lib/shared-tree-core/editManagerCodecs.d.ts +3 -14
  470. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  471. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  472. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +11 -1
  473. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  474. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  475. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +4 -11
  476. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  477. package/lib/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
  478. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  479. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +4 -11
  480. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  481. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
  482. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  483. package/lib/shared-tree-core/editManagerSummarizer.d.ts +4 -4
  484. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  485. package/lib/shared-tree-core/editManagerSummarizer.js +0 -1
  486. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  487. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
  488. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  489. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  490. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  491. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  492. package/lib/shared-tree-core/messageCodecs.d.ts +8 -1
  493. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  494. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  495. package/lib/shared-tree-core/sharedTreeCore.d.ts +5 -5
  496. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  497. package/lib/shared-tree-core/sharedTreeCore.js +1 -1
  498. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  499. package/lib/shared-tree-core/transaction.d.ts +10 -10
  500. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  501. package/lib/shared-tree-core/transaction.js +6 -3
  502. package/lib/shared-tree-core/transaction.js.map +1 -1
  503. package/lib/simple-tree/api/eraseSchemaDetails.d.ts +15 -0
  504. package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  505. package/lib/simple-tree/api/eraseSchemaDetails.js +15 -0
  506. package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  507. package/lib/simple-tree/api/index.d.ts +1 -1
  508. package/lib/simple-tree/api/index.d.ts.map +1 -1
  509. package/lib/simple-tree/api/index.js +1 -1
  510. package/lib/simple-tree/api/index.js.map +1 -1
  511. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +3 -3
  512. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  513. package/lib/simple-tree/api/schemaStatics.d.ts +6 -7
  514. package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
  515. package/lib/simple-tree/api/schemaStatics.js.map +1 -1
  516. package/lib/simple-tree/api/treeNodeApi.d.ts +20 -24
  517. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  518. package/lib/simple-tree/api/treeNodeApi.js +46 -46
  519. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  520. package/lib/simple-tree/core/treeNode.d.ts +5 -6
  521. package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
  522. package/lib/simple-tree/core/treeNode.js +2 -4
  523. package/lib/simple-tree/core/treeNode.js.map +1 -1
  524. package/lib/simple-tree/core/withType.d.ts +20 -7
  525. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  526. package/lib/simple-tree/core/withType.js +4 -7
  527. package/lib/simple-tree/core/withType.js.map +1 -1
  528. package/lib/simple-tree/index.d.ts +2 -2
  529. package/lib/simple-tree/index.d.ts.map +1 -1
  530. package/lib/simple-tree/index.js +1 -1
  531. package/lib/simple-tree/index.js.map +1 -1
  532. package/lib/simple-tree/leafNodeSchema.d.ts +6 -1
  533. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  534. package/lib/simple-tree/leafNodeSchema.js +0 -1
  535. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  536. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +53 -5
  537. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  538. package/lib/simple-tree/node-kinds/array/arrayNode.js +93 -12
  539. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  540. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +90 -0
  541. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  542. package/lib/simple-tree/node-kinds/map/mapNode.js +27 -2
  543. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  544. package/lib/simple-tree/node-kinds/object/objectNode.js +3 -3
  545. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  546. package/lib/simple-tree/node-kinds/record/recordNode.js +3 -3
  547. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  548. package/lib/text/codePointUtils.d.ts +2 -2
  549. package/lib/text/codePointUtils.js +2 -2
  550. package/lib/text/codePointUtils.js.map +1 -1
  551. package/lib/text/index.d.ts +3 -3
  552. package/lib/text/index.d.ts.map +1 -1
  553. package/lib/text/index.js +3 -3
  554. package/lib/text/index.js.map +1 -1
  555. package/lib/text/textDomain.d.ts +30 -18
  556. package/lib/text/textDomain.d.ts.map +1 -1
  557. package/lib/text/textDomain.js +41 -22
  558. package/lib/text/textDomain.js.map +1 -1
  559. package/lib/text/textDomainFormatted.d.ts +180 -82
  560. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  561. package/lib/text/textDomainFormatted.js +165 -86
  562. package/lib/text/textDomainFormatted.js.map +1 -1
  563. package/lib/text/textDomainFormattedDefault.d.ts +48 -25
  564. package/lib/text/textDomainFormattedDefault.d.ts.map +1 -1
  565. package/lib/text/textDomainFormattedDefault.js +25 -20
  566. package/lib/text/textDomainFormattedDefault.js.map +1 -1
  567. package/lib/treeDataStore.d.ts +49 -0
  568. package/lib/treeDataStore.d.ts.map +1 -0
  569. package/lib/treeDataStore.js +52 -0
  570. package/lib/treeDataStore.js.map +1 -0
  571. package/lib/treeFactory.d.ts +8 -3
  572. package/lib/treeFactory.d.ts.map +1 -1
  573. package/lib/treeFactory.js +5 -0
  574. package/lib/treeFactory.js.map +1 -1
  575. package/lib/util/compressedIds.d.ts +22 -2
  576. package/lib/util/compressedIds.d.ts.map +1 -1
  577. package/lib/util/compressedIds.js +22 -1
  578. package/lib/util/compressedIds.js.map +1 -1
  579. package/package.json +32 -24
  580. package/src/core/change-family/changeFamily.ts +32 -4
  581. package/src/core/change-family/editBuilder.ts +1 -2
  582. package/src/core/change-family/index.ts +2 -0
  583. package/src/core/index.ts +11 -6
  584. package/src/core/rebase/index.ts +2 -0
  585. package/src/core/rebase/types.ts +113 -0
  586. package/src/core/tree/delta.ts +62 -16
  587. package/src/core/tree/detachedFieldIndex.ts +7 -38
  588. package/src/core/tree/index.ts +2 -0
  589. package/src/core/tree/visitorUtils.ts +3 -17
  590. package/src/entrypoints/alpha.ts +9 -1
  591. package/src/feature-libraries/chunked-forest/codec/codecs.ts +17 -14
  592. package/src/feature-libraries/chunked-forest/uniformChunk.ts +11 -1
  593. package/src/feature-libraries/comparison-forest/comparisonForest.ts +140 -0
  594. package/src/feature-libraries/comparison-forest/index.ts +6 -0
  595. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +20 -6
  596. package/src/feature-libraries/default-schema/index.ts +1 -0
  597. package/src/feature-libraries/default-schema/noChangeCodecs.ts +11 -3
  598. package/src/feature-libraries/detachedFieldIndexSummarizer.ts +33 -5
  599. package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -3
  600. package/src/feature-libraries/index.ts +5 -0
  601. package/src/feature-libraries/mitigatedChangeFamily.ts +21 -3
  602. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +10 -1
  603. package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +9 -4
  604. package/src/feature-libraries/modular-schema/index.ts +1 -0
  605. package/src/feature-libraries/modular-schema/invert.ts +338 -0
  606. package/src/feature-libraries/modular-schema/minimizeModularChange.ts +3 -5
  607. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +16 -13
  608. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +3 -1
  609. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +2 -1
  610. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +45 -644
  611. package/src/feature-libraries/modular-schema/modularChangeUtils.ts +340 -0
  612. package/src/feature-libraries/modular-schema/prune.ts +69 -0
  613. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +4 -2
  614. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +5 -2
  615. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +4 -2
  616. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +4 -2
  617. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +6 -3
  618. package/src/feature-libraries/treeTextCursor.ts +66 -1
  619. package/src/index.ts +11 -4
  620. package/src/packageVersion.ts +1 -1
  621. package/src/shared-tree/serializedChange.ts +2 -2
  622. package/src/shared-tree/sharedTree.ts +40 -15
  623. package/src/shared-tree/sharedTreeChangeCodecs.ts +11 -3
  624. package/src/shared-tree/sharedTreeChangeFamily.ts +77 -2
  625. package/src/shared-tree/transactionMinimize.ts +7 -3
  626. package/src/shared-tree/transactionPostProcessor.ts +5 -1
  627. package/src/shared-tree/treeCheckout.ts +136 -30
  628. package/src/shared-tree-core/branch.ts +41 -12
  629. package/src/shared-tree-core/editManager.ts +46 -25
  630. package/src/shared-tree-core/editManagerCodecs.ts +9 -21
  631. package/src/shared-tree-core/editManagerCodecsCommons.ts +14 -2
  632. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +18 -21
  633. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +18 -20
  634. package/src/shared-tree-core/editManagerSummarizer.ts +9 -6
  635. package/src/shared-tree-core/messageCodecV1ToV4.ts +3 -3
  636. package/src/shared-tree-core/messageCodecVSharedBranches.ts +2 -2
  637. package/src/shared-tree-core/messageCodecs.ts +12 -2
  638. package/src/shared-tree-core/sharedTreeCore.ts +16 -7
  639. package/src/shared-tree-core/transaction.ts +47 -25
  640. package/src/simple-tree/api/eraseSchemaDetails.ts +15 -0
  641. package/src/simple-tree/api/index.ts +0 -1
  642. package/src/simple-tree/api/schemaStatics.ts +2 -2
  643. package/src/simple-tree/api/treeNodeApi.ts +64 -48
  644. package/src/simple-tree/core/treeNode.ts +13 -10
  645. package/src/simple-tree/core/withType.ts +20 -7
  646. package/src/simple-tree/index.ts +1 -2
  647. package/src/simple-tree/leafNodeSchema.ts +6 -1
  648. package/src/simple-tree/node-kinds/array/arrayNode.ts +130 -16
  649. package/src/simple-tree/node-kinds/map/mapNode.ts +137 -5
  650. package/src/simple-tree/node-kinds/object/objectNode.ts +3 -3
  651. package/src/simple-tree/node-kinds/record/recordNode.ts +3 -3
  652. package/src/text/README.md +1 -1
  653. package/src/text/codePointUtils.ts +2 -2
  654. package/src/text/index.ts +3 -3
  655. package/src/text/textDomain.ts +50 -27
  656. package/src/text/textDomainFormatted.ts +384 -163
  657. package/src/text/textDomainFormattedDefault.ts +32 -32
  658. package/src/treeDataStore.ts +125 -0
  659. package/src/treeFactory.ts +11 -3
  660. package/src/util/compressedIds.ts +36 -3
@@ -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,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QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;CAC1B;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB,CAAC,MAAM,GAAG,UAAU;IACrD,wEAAwE;IACxE,QAAQ,CAAC,EAAE,EAAE,cAAc,CAAC;IAC5B,8FAA8F;IAC9F,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC,gDAAgD;IAChD,QAAQ,CAAC,EAAE,EAAE,cAAc,CAAC;IAC5B,2DAA2D;IAC3D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,0DAA0D;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"]}
@@ -2,13 +2,11 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { IIdCompressor } from "@fluidframework/id-compressor";
6
- import { type CodecWriteOptions } from "../../codec/index.js";
7
- import { type IdAllocator, type JsonCompatibleReadOnly } from "../../util/index.js";
8
- import type { RevisionTag, RevisionTagCodec } from "../rebase/index.js";
5
+ import { type IdAllocator } from "../../util/index.js";
6
+ import type { RevisionTag } from "../rebase/index.js";
9
7
  import type { FieldKey } from "../schema-stored/index.js";
10
8
  import type * as Delta from "./delta.js";
11
- import type { ForestRootId } from "./detachedFieldIndexTypes.js";
9
+ import type { DetachedFieldSummaryData, ForestRootId } from "./detachedFieldIndexTypes.js";
12
10
  /**
13
11
  * Readonly interface for {@link DetachedFieldIndex}.
14
12
  */
@@ -44,8 +42,6 @@ export type DetachedFieldIndexCheckpoint = () => void;
44
42
  export declare class DetachedFieldIndex implements ReadOnlyDetachedFieldIndex {
45
43
  private readonly name;
46
44
  private rootIdAllocator;
47
- private readonly revisionTagCodec;
48
- private readonly idCompressor;
49
45
  /**
50
46
  * A mapping from detached node ids to detached fields.
51
47
  */
@@ -58,8 +54,6 @@ export declare class DetachedFieldIndex implements ReadOnlyDetachedFieldIndex {
58
54
  * undefined revisions are tolerated but any roots not associated with a revision must be disposed manually
59
55
  */
60
56
  private latestRelevantRevisionToFields;
61
- private readonly codec;
62
- private readonly options;
63
57
  /**
64
58
  * The process for loading `DetachedFieldIndex` data from a summary is split into two steps:
65
59
  * 1. Call {@link loadData}
@@ -73,7 +67,7 @@ export declare class DetachedFieldIndex implements ReadOnlyDetachedFieldIndex {
73
67
  * @param name - A name for the index, used as a prefix for the generated field keys.
74
68
  * @param rootIdAllocator - An ID allocator used to generate unique field keys.
75
69
  */
76
- constructor(name: string, rootIdAllocator: IdAllocator<ForestRootId>, revisionTagCodec: RevisionTagCodec, idCompressor: IIdCompressor, options?: CodecWriteOptions);
70
+ constructor(name: string, rootIdAllocator: IdAllocator<ForestRootId>);
77
71
  clone(): DetachedFieldIndex;
78
72
  /**
79
73
  * Creates a restorable checkpoint of the current state of the DetachedFieldIndex.
@@ -113,11 +107,11 @@ export declare class DetachedFieldIndex implements ReadOnlyDetachedFieldIndex {
113
107
  * Updates the latest revision that is relevant to the provided root
114
108
  */
115
109
  updateLatestRevision(id: Delta.DetachedNodeId, revision: RevisionTag | undefined): void;
116
- encode(): JsonCompatibleReadOnly;
110
+ getSummaryData(): DetachedFieldSummaryData;
117
111
  /**
118
- * Loads the tree index from the given string, this overrides any existing data.
112
+ * Loads the tree index from summary data, this overrides any existing data.
119
113
  */
120
- loadData(data: JsonCompatibleReadOnly): void;
114
+ loadData(detachedFieldIndex: DetachedFieldSummaryData): void;
121
115
  /**
122
116
  * Sets the latest relevant revision for any roots that have an undefined latest relevant revision.
123
117
  * This occurs when the detached field index is loaded from a summary and can only be called once after
@@ -1 +1 @@
1
- {"version":3,"file":"detachedFieldIndex.d.ts","sourceRoot":"","sources":["../../../src/core/tree/detachedFieldIndex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EACN,KAAK,iBAAiB,EAItB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAS3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAC;AAEzC,OAAO,KAAK,EAGX,YAAY,EAGZ,MAAM,8BAA8B,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C;;OAEG;IACH,KAAK,IAAI,kBAAkB,CAAC;IAE5B;;;OAGG;IACH,UAAU,CAAC,EAAE,EAAE,YAAY,GAAG,QAAQ,CAAC;IAEvC;;;OAGG;IACH,WAAW,CAAC,EAAE,EAAE,KAAK,CAAC,cAAc,GAAG,YAAY,GAAG,SAAS,CAAC;IAEhE;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,cAAc,GAAG,YAAY,CAAC;CACjD;AAED;;;GAGG;AACH,MAAM,MAAM,4BAA4B,GAAG,MAAM,IAAI,CAAC;AAEtD;;GAEG;AACH,qBAAa,kBA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S,GAC/B,IAAI;IAmBA,cAAc,IAAI,wBAAwB;IAOjD;;OAEG;IACI,QAAQ,CAAC,kBAAkB,EAAE,wBAAwB,GAAG,IAAI;IAiBnE;;;;OAIG;IACI,yBAAyB,CAAC,cAAc,EAAE,WAAW,GAAG,IAAI;CAqBnE"}
@@ -6,9 +6,7 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.DetachedFieldIndex = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
- const index_js_1 = require("../../codec/index.js");
10
- const index_js_2 = require("../../util/index.js");
11
- const detachedFieldIndexCodecs_js_1 = require("./detachedFieldIndexCodecs.js");
9
+ const index_js_1 = require("../../util/index.js");
12
10
  /**
13
11
  * The tree index records detached field IDs and associates them with a change atom ID.
14
12
  */
@@ -17,11 +15,9 @@ class DetachedFieldIndex {
17
15
  * @param name - A name for the index, used as a prefix for the generated field keys.
18
16
  * @param rootIdAllocator - An ID allocator used to generate unique field keys.
19
17
  */
20
- constructor(name, rootIdAllocator, revisionTagCodec, idCompressor, options) {
18
+ constructor(name, rootIdAllocator) {
21
19
  this.name = name;
22
20
  this.rootIdAllocator = rootIdAllocator;
23
- this.revisionTagCodec = revisionTagCodec;
24
- this.idCompressor = idCompressor;
25
21
  /**
26
22
  * A mapping from detached node ids to detached fields.
27
23
  */
@@ -43,20 +39,11 @@ class DetachedFieldIndex {
43
39
  * This helps ensure that `setRevisionsForLoadedData` is only called after `loadData` and only called once.
44
40
  */
45
41
  this.isFullyLoaded = true;
46
- this.options = options ?? {
47
- jsonValidator: index_js_1.FormatValidatorNoOp,
48
- minVersionForCollab: index_js_1.FluidClientVersion.v2_0,
49
- };
50
- this.codec = detachedFieldIndexCodecs_js_1.detachedFieldIndexCodecBuilder.build({
51
- ...this.options,
52
- revisionTagCodec,
53
- idCompressor,
54
- });
55
42
  }
56
43
  clone() {
57
- const clone = new DetachedFieldIndex(this.name, (0, index_js_2.idAllocatorFromMaxId)(this.rootIdAllocator.getMaxId()), this.revisionTagCodec, this.idCompressor, this.options);
58
- (0, index_js_2.populateNestedMap)(this.detachedNodeToField, clone.detachedNodeToField, true);
59
- (0, index_js_2.populateNestedMap)(this.latestRelevantRevisionToFields, clone.latestRelevantRevisionToFields, true);
44
+ const clone = new DetachedFieldIndex(this.name, (0, index_js_1.idAllocatorFromMaxId)(this.rootIdAllocator.getMaxId()));
45
+ (0, index_js_1.populateNestedMap)(this.detachedNodeToField, clone.detachedNodeToField, true);
46
+ (0, index_js_1.populateNestedMap)(this.latestRelevantRevisionToFields, clone.latestRelevantRevisionToFields, true);
60
47
  return clone;
61
48
  }
62
49
  /**
@@ -66,9 +53,9 @@ class DetachedFieldIndex {
66
53
  const clone = this.clone();
67
54
  return () => {
68
55
  this.purge();
69
- (0, index_js_2.populateNestedMap)(clone.detachedNodeToField, this.detachedNodeToField, true);
70
- (0, index_js_2.populateNestedMap)(clone.latestRelevantRevisionToFields, this.latestRelevantRevisionToFields, true);
71
- this.rootIdAllocator = (0, index_js_2.idAllocatorFromMaxId)(clone.rootIdAllocator.getMaxId());
56
+ (0, index_js_1.populateNestedMap)(clone.detachedNodeToField, this.detachedNodeToField, true);
57
+ (0, index_js_1.populateNestedMap)(clone.latestRelevantRevisionToFields, this.latestRelevantRevisionToFields, true);
58
+ this.rootIdAllocator = (0, index_js_1.idAllocatorFromMaxId)(clone.rootIdAllocator.getMaxId());
72
59
  };
73
60
  }
74
61
  *entries() {
@@ -97,10 +84,10 @@ class DetachedFieldIndex {
97
84
  this.latestRelevantRevisionToFields.clear();
98
85
  }
99
86
  toFieldKey(id) {
100
- return (0, index_js_2.brand)(`${this.name}-${id}`);
87
+ return (0, index_js_1.brand)(`${this.name}-${id}`);
101
88
  }
102
89
  tryGetEntry(id) {
103
- return (0, index_js_2.tryGetFromNestedMap)(this.detachedNodeToField, id.major, id.minor)?.root;
90
+ return (0, index_js_1.tryGetFromNestedMap)(this.detachedNodeToField, id.major, id.minor)?.root;
104
91
  }
105
92
  getEntry(id) {
106
93
  const key = this.tryGetEntry(id);
@@ -126,15 +113,15 @@ class DetachedFieldIndex {
126
113
  }
127
114
  this.latestRelevantRevisionToFields.delete(revision);
128
115
  for (const detachedNodeId of entries.values()) {
129
- const found = (0, index_js_2.deleteFromNestedMap)(this.detachedNodeToField, detachedNodeId.major, detachedNodeId.minor);
116
+ const found = (0, index_js_1.deleteFromNestedMap)(this.detachedNodeToField, detachedNodeId.major, detachedNodeId.minor);
130
117
  (0, internal_1.assert)(found, 0x9ba /* Unable to delete unknown entry */);
131
118
  }
132
119
  }
133
120
  deleteEntry(nodeId) {
134
- const entry = (0, index_js_2.tryGetFromNestedMap)(this.detachedNodeToField, nodeId.major, nodeId.minor);
121
+ const entry = (0, index_js_1.tryGetFromNestedMap)(this.detachedNodeToField, nodeId.major, nodeId.minor);
135
122
  (0, internal_1.assert)(entry !== undefined, 0x9bb /* Unable to delete unknown entry */);
136
- (0, index_js_2.deleteFromNestedMap)(this.detachedNodeToField, nodeId.major, nodeId.minor);
137
- (0, index_js_2.deleteFromNestedMap)(this.latestRelevantRevisionToFields, entry.latestRelevantRevision, entry.root);
123
+ (0, index_js_1.deleteFromNestedMap)(this.detachedNodeToField, nodeId.major, nodeId.minor);
124
+ (0, index_js_1.deleteFromNestedMap)(this.latestRelevantRevisionToFields, entry.latestRelevantRevision, entry.root);
138
125
  }
139
126
  /**
140
127
  * Associates the DetachedNodeId with a field key and creates an entry for it in the index.
@@ -148,13 +135,13 @@ class DetachedFieldIndex {
148
135
  const root = this.rootIdAllocator.allocate(count);
149
136
  if (nodeId !== undefined) {
150
137
  for (let i = 0; i < count; i++) {
151
- (0, internal_1.assert)((0, index_js_2.tryGetFromNestedMap)(this.detachedNodeToField, nodeId.major, nodeId.minor + i) ===
138
+ (0, internal_1.assert)((0, index_js_1.tryGetFromNestedMap)(this.detachedNodeToField, nodeId.major, nodeId.minor + i) ===
152
139
  undefined, 0x7ce /* Detached node ID already exists in index */);
153
- (0, index_js_2.setInNestedMap)(this.detachedNodeToField, nodeId.major, nodeId.minor + i, {
154
- root: (0, index_js_2.brand)(root + i),
140
+ (0, index_js_1.setInNestedMap)(this.detachedNodeToField, nodeId.major, nodeId.minor + i, {
141
+ root: (0, index_js_1.brand)(root + i),
155
142
  latestRelevantRevision: revision,
156
143
  });
157
- (0, index_js_2.setInNestedMap)(this.latestRelevantRevisionToFields, revision, root + i, {
144
+ (0, index_js_1.setInNestedMap)(this.latestRelevantRevisionToFields, revision, root + i, {
158
145
  major: nodeId.major,
159
146
  minor: nodeId.minor + i,
160
147
  });
@@ -166,36 +153,35 @@ class DetachedFieldIndex {
166
153
  * Updates the latest revision that is relevant to the provided root
167
154
  */
168
155
  updateLatestRevision(id, revision) {
169
- const fieldEntry = (0, index_js_2.tryGetFromNestedMap)(this.detachedNodeToField, id.major, id.minor);
156
+ const fieldEntry = (0, index_js_1.tryGetFromNestedMap)(this.detachedNodeToField, id.major, id.minor);
170
157
  (0, internal_1.assert)(fieldEntry !== undefined, 0x9bc /* detached node id does not exist in the detached field index */);
171
158
  const { root, latestRelevantRevision: previousRevision } = fieldEntry;
172
159
  // remove this root from the set of roots for the previous latest revision
173
- (0, index_js_2.deleteFromNestedMap)(this.latestRelevantRevisionToFields, previousRevision, root);
160
+ (0, index_js_1.deleteFromNestedMap)(this.latestRelevantRevisionToFields, previousRevision, root);
174
161
  // add this root to the set of roots for the new latest revision
175
- (0, index_js_2.setInNestedMap)(this.latestRelevantRevisionToFields, revision, root, id);
176
- (0, index_js_2.setInNestedMap)(this.detachedNodeToField, id.major, id.minor, {
162
+ (0, index_js_1.setInNestedMap)(this.latestRelevantRevisionToFields, revision, root, id);
163
+ (0, index_js_1.setInNestedMap)(this.detachedNodeToField, id.major, id.minor, {
177
164
  root,
178
165
  latestRelevantRevision: revision,
179
166
  });
180
167
  }
181
- encode() {
182
- return this.codec.encode({
168
+ getSummaryData() {
169
+ return {
183
170
  data: this.detachedNodeToField,
184
171
  maxId: this.rootIdAllocator.getMaxId(),
185
- });
172
+ };
186
173
  }
187
174
  /**
188
- * Loads the tree index from the given string, this overrides any existing data.
175
+ * Loads the tree index from summary data, this overrides any existing data.
189
176
  */
190
- loadData(data) {
191
- const detachedFieldIndex = this.codec.decode(data);
192
- this.rootIdAllocator = (0, index_js_2.idAllocatorFromMaxId)(detachedFieldIndex.maxId);
177
+ loadData(detachedFieldIndex) {
178
+ this.rootIdAllocator = (0, index_js_1.idAllocatorFromMaxId)(detachedFieldIndex.maxId);
193
179
  this.detachedNodeToField = new Map();
194
180
  this.latestRelevantRevisionToFields = new Map();
195
181
  this.isFullyLoaded = false;
196
182
  const rootMap = new Map();
197
- (0, index_js_2.forEachInNestedMap)(detachedFieldIndex.data, ({ root }, major, minor) => {
198
- (0, index_js_2.setInNestedMap)(this.detachedNodeToField, major, minor, { root });
183
+ (0, index_js_1.forEachInNestedMap)(detachedFieldIndex.data, ({ root }, major, minor) => {
184
+ (0, index_js_1.setInNestedMap)(this.detachedNodeToField, major, minor, { root });
199
185
  rootMap.set(root, { major, minor });
200
186
  });
201
187
  this.latestRelevantRevisionToFields.set(undefined, rootMap);
@@ -209,8 +195,8 @@ class DetachedFieldIndex {
209
195
  (0, internal_1.assert)(!this.isFullyLoaded, 0x9bd /* revisions should only be set once using this function after loading data from a summary */);
210
196
  const newDetachedNodeToField = new Map();
211
197
  const rootMap = new Map();
212
- (0, index_js_2.forEachInNestedMap)(this.detachedNodeToField, ({ root }, major, minor) => {
213
- (0, index_js_2.setInNestedMap)(newDetachedNodeToField, major, minor, {
198
+ (0, index_js_1.forEachInNestedMap)(this.detachedNodeToField, ({ root }, major, minor) => {
199
+ (0, index_js_1.setInNestedMap)(newDetachedNodeToField, major, minor, {
214
200
  root,
215
201
  latestRelevantRevision: latestRevision,
216
202
  });
@@ -1 +1 @@
1
- {"version":3,"file":"detachedFieldIndex.js","sourceRoot":"","sources":["../../../src/core/tree/detachedFieldIndex.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AA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KAAK,EAAE,KAAK,EAAE,EAAE;YACvE,IAAA,yBAAc,EAAC,sBAAsB,EAAE,KAAK,EAAE,KAAK,EAAE;gBACpD,IAAI;gBACJ,sBAAsB,EAAE,cAAc;aACtC,CAAC,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,mBAAmB,GAAG,sBAAsB,CAAC;QAClD,IAAI,CAAC,8BAA8B,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACtD,IAAI,CAAC,8BAA8B,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QACjE,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;IAC3B,CAAC;CACD;AAhSD,gDAgSC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport {\n\ttype CodecWriteOptions,\n\tFluidClientVersion,\n\tFormatValidatorNoOp,\n\ttype IJsonCodec,\n} from \"../../codec/index.js\";\nimport {\n\ttype IdAllocator,\n\ttype JsonCompatibleReadOnly,\n\ttype NestedMap,\n\tbrand,\n\tdeleteFromNestedMap,\n\tforEachInNestedMap,\n\tidAllocatorFromMaxId,\n\tpopulateNestedMap,\n\tsetInNestedMap,\n\ttryGetFromNestedMap,\n} from \"../../util/index.js\";\nimport type { RevisionTag, RevisionTagCodec } from \"../rebase/index.js\";\nimport type { FieldKey } from \"../schema-stored/index.js\";\n\nimport type * as Delta from \"./delta.js\";\nimport { detachedFieldIndexCodecBuilder } from \"./detachedFieldIndexCodecs.js\";\nimport type {\n\tDetachedField,\n\tDetachedFieldSummaryData,\n\tForestRootId,\n\tMajor,\n\tMinor,\n} from \"./detachedFieldIndexTypes.js\";\n\n/**\n * Readonly interface for {@link DetachedFieldIndex}.\n */\nexport interface ReadOnlyDetachedFieldIndex {\n\t/**\n\t * Creates a deep clone of this `DetachedFieldIndex`.\n\t */\n\tclone(): DetachedFieldIndex;\n\n\t/**\n\t * Returns a field key for the given ID.\n\t * This does not save the field key on the index. To do so, call {@link createEntry}.\n\t */\n\ttoFieldKey(id: ForestRootId): FieldKey;\n\n\t/**\n\t * Returns the `ForestRootId` associated with the given id.\n\t * Returns undefined if no such id is known to the index.\n\t */\n\ttryGetEntry(id: Delta.DetachedNodeId): ForestRootId | undefined;\n\n\t/**\n\t * Returns the `ForestRootId` associated with the given id.\n\t * Fails if no such id is known to the index.\n\t */\n\tgetEntry(id: Delta.DetachedNodeId): ForestRootId;\n}\n\n/**\n * Restores the originating DetachedFieldIndex to the state it was in when the checkpoint was created.\n * Can be invoked multiple times.\n */\nexport type DetachedFieldIndexCheckpoint = () => void;\n\n/**\n * The tree index records detached field IDs and associates them with a change atom ID.\n */\nexport class DetachedFieldIndex implements ReadOnlyDetachedFieldIndex {\n\t/**\n\t * A mapping from detached node ids to detached fields.\n\t */\n\tprivate detachedNodeToField: NestedMap<Major, Minor, DetachedField> = new Map();\n\t/**\n\t * A map from revisions to all detached fields for which the revision is the latest relevant revision.\n\t * See {@link DetachedField.latestRelevantRevision}.\n\t *\n\t * @remarks\n\t * undefined revisions are tolerated but any roots not associated with a revision must be disposed manually\n\t */\n\tprivate latestRelevantRevisionToFields: NestedMap<\n\t\tRevisionTag | undefined,\n\t\tForestRootId,\n\t\tDelta.DetachedNodeId\n\t> = new Map();\n\n\tprivate readonly codec: IJsonCodec<DetachedFieldSummaryData>;\n\tprivate readonly options: CodecWriteOptions;\n\n\t/**\n\t * The process for loading `DetachedFieldIndex` data from a summary is split into two steps:\n\t * 1. Call {@link loadData}\n\t * 2. Call {@link setRevisionsForLoadedData}\n\t *\n\t * This flag is only set to `false` after calling `loadData` and is set back to `true` after calling `setRevisionsForLoadedData`.\n\t * This helps ensure that `setRevisionsForLoadedData` is only called after `loadData` and only called once.\n\t */\n\tprivate isFullyLoaded = true;\n\n\t/**\n\t * @param name - A name for the index, used as a prefix for the generated field keys.\n\t * @param rootIdAllocator - An ID allocator used to generate unique field keys.\n\t */\n\tpublic constructor(\n\t\tprivate readonly name: string,\n\t\tprivate rootIdAllocator: IdAllocator<ForestRootId>,\n\t\tprivate readonly revisionTagCodec: RevisionTagCodec,\n\t\tprivate readonly idCompressor: IIdCompressor,\n\t\toptions?: CodecWriteOptions,\n\t) {\n\t\tthis.options = options ?? {\n\t\t\tjsonValidator: FormatValidatorNoOp,\n\t\t\tminVersionForCollab: FluidClientVersion.v2_0,\n\t\t};\n\t\tthis.codec = detachedFieldIndexCodecBuilder.build({\n\t\t\t...this.options,\n\t\t\trevisionTagCodec,\n\t\t\tidCompressor,\n\t\t});\n\t}\n\n\tpublic clone(): DetachedFieldIndex {\n\t\tconst clone = new DetachedFieldIndex(\n\t\t\tthis.name,\n\t\t\tidAllocatorFromMaxId(this.rootIdAllocator.getMaxId()) as IdAllocator<ForestRootId>,\n\t\t\tthis.revisionTagCodec,\n\t\t\tthis.idCompressor,\n\t\t\tthis.options,\n\t\t);\n\t\tpopulateNestedMap(this.detachedNodeToField, clone.detachedNodeToField, true);\n\t\tpopulateNestedMap(\n\t\t\tthis.latestRelevantRevisionToFields,\n\t\t\tclone.latestRelevantRevisionToFields,\n\t\t\ttrue,\n\t\t);\n\t\treturn clone;\n\t}\n\n\t/**\n\t * Creates a restorable checkpoint of the current state of the DetachedFieldIndex.\n\t */\n\tpublic createCheckpoint(): DetachedFieldIndexCheckpoint {\n\t\tconst clone = this.clone();\n\t\treturn () => {\n\t\t\tthis.purge();\n\t\t\tpopulateNestedMap(clone.detachedNodeToField, this.detachedNodeToField, true);\n\t\t\tpopulateNestedMap(\n\t\t\t\tclone.latestRelevantRevisionToFields,\n\t\t\t\tthis.latestRelevantRevisionToFields,\n\t\t\t\ttrue,\n\t\t\t);\n\t\t\tthis.rootIdAllocator = idAllocatorFromMaxId(\n\t\t\t\tclone.rootIdAllocator.getMaxId(),\n\t\t\t) as IdAllocator<ForestRootId>;\n\t\t};\n\t}\n\n\tpublic *entries(): Generator<{\n\t\troot: ForestRootId;\n\t\tlatestRelevantRevision?: RevisionTag;\n\t\tid: Delta.DetachedNodeId;\n\t}> {\n\t\tfor (const [major, innerMap] of this.detachedNodeToField) {\n\t\t\tif (major === undefined) {\n\t\t\t\tfor (const [minor, { root, latestRelevantRevision }] of innerMap) {\n\t\t\t\t\tyield latestRelevantRevision === undefined\n\t\t\t\t\t\t? { id: { minor }, root }\n\t\t\t\t\t\t: { id: { minor }, root, latestRelevantRevision };\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (const [minor, { root, latestRelevantRevision }] of innerMap) {\n\t\t\t\t\tyield latestRelevantRevision === undefined\n\t\t\t\t\t\t? { id: { major, minor }, root }\n\t\t\t\t\t\t: { id: { major, minor }, root, latestRelevantRevision };\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Removes all entries from the index.\n\t */\n\tpublic purge(): void {\n\t\tthis.detachedNodeToField.clear();\n\t\tthis.latestRelevantRevisionToFields.clear();\n\t}\n\n\tpublic toFieldKey(id: ForestRootId): FieldKey {\n\t\treturn brand(`${this.name}-${id}`);\n\t}\n\n\tpublic tryGetEntry(id: Delta.DetachedNodeId): ForestRootId | undefined {\n\t\treturn tryGetFromNestedMap(this.detachedNodeToField, id.major, id.minor)?.root;\n\t}\n\n\tpublic getEntry(id: Delta.DetachedNodeId): ForestRootId {\n\t\tconst key = this.tryGetEntry(id);\n\t\tassert(key !== undefined, 0x7aa /* Unknown removed node ID */);\n\t\treturn key;\n\t}\n\n\t/**\n\t * Returns the detached root IDs for all the trees that were detached or last modified by the given revision.\n\t */\n\tpublic *getRootsLastTouchedByRevision(revision: RevisionTag): Iterable<ForestRootId> {\n\t\tconst roots = this.latestRelevantRevisionToFields.get(revision);\n\t\tif (roots !== undefined) {\n\t\t\tyield* roots.keys();\n\t\t}\n\t}\n\n\t/**\n\t * Removes the detached roots for all the trees that were detached or last modified by the given revision.\n\t */\n\tpublic deleteRootsLastTouchedByRevision(revision: RevisionTag): void {\n\t\tconst entries = this.latestRelevantRevisionToFields.get(revision);\n\t\tif (entries === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.latestRelevantRevisionToFields.delete(revision);\n\t\tfor (const detachedNodeId of entries.values()) {\n\t\t\tconst found = deleteFromNestedMap(\n\t\t\t\tthis.detachedNodeToField,\n\t\t\t\tdetachedNodeId.major,\n\t\t\t\tdetachedNodeId.minor,\n\t\t\t);\n\t\t\tassert(found, 0x9ba /* Unable to delete unknown entry */);\n\t\t}\n\t}\n\n\tpublic deleteEntry(nodeId: Delta.DetachedNodeId): void {\n\t\tconst entry = tryGetFromNestedMap(this.detachedNodeToField, nodeId.major, nodeId.minor);\n\t\tassert(entry !== undefined, 0x9bb /* Unable to delete unknown entry */);\n\t\tdeleteFromNestedMap(this.detachedNodeToField, nodeId.major, nodeId.minor);\n\t\tdeleteFromNestedMap(\n\t\t\tthis.latestRelevantRevisionToFields,\n\t\t\tentry.latestRelevantRevision,\n\t\t\tentry.root,\n\t\t);\n\t}\n\n\t/**\n\t * Associates the DetachedNodeId with a field key and creates an entry for it in the index.\n\t * @param nodeId - The ID of the detached node.\n\t * @param revision - The revision that last detached the root.\n\t * See {@link DetachedField.latestRelevantRevision} for details.\n\t * @param count - The number of entries to create. These entries will have consecutive minor IDs.\n\t * @returns The atomic ID that the `DetachedFieldIndex` uses to uniquely identify the first root.\n\t */\n\tpublic createEntry(\n\t\tnodeId?: Delta.DetachedNodeId,\n\t\trevision?: RevisionTag,\n\t\tcount: number = 1,\n\t): ForestRootId {\n\t\tconst root = this.rootIdAllocator.allocate(count);\n\t\tif (nodeId !== undefined) {\n\t\t\tfor (let i = 0; i < count; i++) {\n\t\t\t\tassert(\n\t\t\t\t\ttryGetFromNestedMap(this.detachedNodeToField, nodeId.major, nodeId.minor + i) ===\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t0x7ce /* Detached node ID already exists in index */,\n\t\t\t\t);\n\t\t\t\tsetInNestedMap(this.detachedNodeToField, nodeId.major, nodeId.minor + i, {\n\t\t\t\t\troot: brand<ForestRootId>(root + i),\n\t\t\t\t\tlatestRelevantRevision: revision,\n\t\t\t\t});\n\t\t\t\tsetInNestedMap(this.latestRelevantRevisionToFields, revision, root + i, {\n\t\t\t\t\tmajor: nodeId.major,\n\t\t\t\t\tminor: nodeId.minor + i,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn root;\n\t}\n\n\t/**\n\t * Updates the latest revision that is relevant to the provided root\n\t */\n\tpublic updateLatestRevision(\n\t\tid: Delta.DetachedNodeId,\n\t\trevision: RevisionTag | undefined,\n\t): void {\n\t\tconst fieldEntry = tryGetFromNestedMap(this.detachedNodeToField, id.major, id.minor);\n\t\tassert(\n\t\t\tfieldEntry !== undefined,\n\t\t\t0x9bc /* detached node id does not exist in the detached field index */,\n\t\t);\n\t\tconst { root, latestRelevantRevision: previousRevision } = fieldEntry;\n\n\t\t// remove this root from the set of roots for the previous latest revision\n\t\tdeleteFromNestedMap(this.latestRelevantRevisionToFields, previousRevision, root);\n\n\t\t// add this root to the set of roots for the new latest revision\n\t\tsetInNestedMap(this.latestRelevantRevisionToFields, revision, root, id);\n\t\tsetInNestedMap(this.detachedNodeToField, id.major, id.minor, {\n\t\t\troot,\n\t\t\tlatestRelevantRevision: revision,\n\t\t});\n\t}\n\n\tpublic encode(): JsonCompatibleReadOnly {\n\t\treturn this.codec.encode({\n\t\t\tdata: this.detachedNodeToField,\n\t\t\tmaxId: this.rootIdAllocator.getMaxId(),\n\t\t});\n\t}\n\n\t/**\n\t * Loads the tree index from the given string, this overrides any existing data.\n\t */\n\tpublic loadData(data: JsonCompatibleReadOnly): void {\n\t\tconst detachedFieldIndex: DetachedFieldSummaryData = this.codec.decode(data);\n\n\t\tthis.rootIdAllocator = idAllocatorFromMaxId(\n\t\t\tdetachedFieldIndex.maxId,\n\t\t) as IdAllocator<ForestRootId>;\n\n\t\tthis.detachedNodeToField = new Map();\n\t\tthis.latestRelevantRevisionToFields = new Map();\n\t\tthis.isFullyLoaded = false;\n\t\tconst rootMap = new Map<ForestRootId, Delta.DetachedNodeId>();\n\t\tforEachInNestedMap(detachedFieldIndex.data, ({ root }, major, minor) => {\n\t\t\tsetInNestedMap(this.detachedNodeToField, major, minor, { root });\n\t\t\trootMap.set(root, { major, minor });\n\t\t});\n\n\t\tthis.latestRelevantRevisionToFields.set(undefined, rootMap);\n\t}\n\n\t/**\n\t * Sets the latest relevant revision for any roots that have an undefined latest relevant revision.\n\t * This occurs when the detached field index is loaded from a summary and can only be called once after\n\t * the summary has been loaded.\n\t */\n\tpublic setRevisionsForLoadedData(latestRevision: RevisionTag): void {\n\t\tassert(\n\t\t\t!this.isFullyLoaded,\n\t\t\t0x9bd /* revisions should only be set once using this function after loading data from a summary */,\n\t\t);\n\n\t\tconst newDetachedNodeToField: NestedMap<Major, Minor, DetachedField> = new Map();\n\t\tconst rootMap = new Map();\n\t\tforEachInNestedMap(this.detachedNodeToField, ({ root }, major, minor) => {\n\t\t\tsetInNestedMap(newDetachedNodeToField, major, minor, {\n\t\t\t\troot,\n\t\t\t\tlatestRelevantRevision: latestRevision,\n\t\t\t});\n\t\t\trootMap.set(root, { major, minor });\n\t\t});\n\n\t\tthis.detachedNodeToField = newDetachedNodeToField;\n\t\tthis.latestRelevantRevisionToFields.delete(undefined);\n\t\tthis.latestRelevantRevisionToFields.set(latestRevision, rootMap);\n\t\tthis.isFullyLoaded = true;\n\t}\n}\n"]}
1
+ {"version":3,"file":"detachedFieldIndex.js","sourceRoot":"","sources":["../../../src/core/tree/detachedFieldIndex.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAC7D,kDAU6B;AA+C7B;;GAEG;AACH,MAAa,kBAAkB;IA4B9B;;;OAGG;IACH,YACkB,IAAY,EACrB,eAA0C;QADjC,SAA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AAI,EAAE,CAAC,CAAC;YACjE,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,8BAA8B,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;;OAIG;IACI,yBAAyB,CAAC,cAA2B;QAC3D,IAAA,iBAAM,EACL,CAAC,IAAI,CAAC,aAAa,EACnB,KAAK,CAAC,6FAA6F,CACnG,CAAC;QAEF,MAAM,sBAAsB,GAA2C,IAAI,GAAG,EAAE,CAAC;QACjF,MAAM,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;QAC1B,IAAA,6BAAkB,EAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YACvE,IAAA,yBAAc,EAAC,sBAAsB,EAAE,KAAK,EAAE,KAAK,EAAE;gBACpD,IAAI;gBACJ,sBAAsB,EAAE,cAAc;aACtC,CAAC,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,mBAAmB,GAAG,sBAAsB,CAAC;QAClD,IAAI,CAAC,8BAA8B,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACtD,IAAI,CAAC,8BAA8B,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QACjE,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;IAC3B,CAAC;CACD;AA3QD,gDA2QC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\ttype IdAllocator,\n\ttype NestedMap,\n\tbrand,\n\tdeleteFromNestedMap,\n\tforEachInNestedMap,\n\tidAllocatorFromMaxId,\n\tpopulateNestedMap,\n\tsetInNestedMap,\n\ttryGetFromNestedMap,\n} from \"../../util/index.js\";\nimport type { RevisionTag } from \"../rebase/index.js\";\nimport type { FieldKey } from \"../schema-stored/index.js\";\n\nimport type * as Delta from \"./delta.js\";\nimport type {\n\tDetachedField,\n\tDetachedFieldSummaryData,\n\tForestRootId,\n\tMajor,\n\tMinor,\n} from \"./detachedFieldIndexTypes.js\";\n\n/**\n * Readonly interface for {@link DetachedFieldIndex}.\n */\nexport interface ReadOnlyDetachedFieldIndex {\n\t/**\n\t * Creates a deep clone of this `DetachedFieldIndex`.\n\t */\n\tclone(): DetachedFieldIndex;\n\n\t/**\n\t * Returns a field key for the given ID.\n\t * This does not save the field key on the index. To do so, call {@link createEntry}.\n\t */\n\ttoFieldKey(id: ForestRootId): FieldKey;\n\n\t/**\n\t * Returns the `ForestRootId` associated with the given id.\n\t * Returns undefined if no such id is known to the index.\n\t */\n\ttryGetEntry(id: Delta.DetachedNodeId): ForestRootId | undefined;\n\n\t/**\n\t * Returns the `ForestRootId` associated with the given id.\n\t * Fails if no such id is known to the index.\n\t */\n\tgetEntry(id: Delta.DetachedNodeId): ForestRootId;\n}\n\n/**\n * Restores the originating DetachedFieldIndex to the state it was in when the checkpoint was created.\n * Can be invoked multiple times.\n */\nexport type DetachedFieldIndexCheckpoint = () => void;\n\n/**\n * The tree index records detached field IDs and associates them with a change atom ID.\n */\nexport class DetachedFieldIndex implements ReadOnlyDetachedFieldIndex {\n\t/**\n\t * A mapping from detached node ids to detached fields.\n\t */\n\tprivate detachedNodeToField: NestedMap<Major, Minor, DetachedField> = new Map();\n\t/**\n\t * A map from revisions to all detached fields for which the revision is the latest relevant revision.\n\t * See {@link DetachedField.latestRelevantRevision}.\n\t *\n\t * @remarks\n\t * undefined revisions are tolerated but any roots not associated with a revision must be disposed manually\n\t */\n\tprivate latestRelevantRevisionToFields: NestedMap<\n\t\tRevisionTag | undefined,\n\t\tForestRootId,\n\t\tDelta.DetachedNodeId\n\t> = new Map();\n\n\t/**\n\t * The process for loading `DetachedFieldIndex` data from a summary is split into two steps:\n\t * 1. Call {@link loadData}\n\t * 2. Call {@link setRevisionsForLoadedData}\n\t *\n\t * This flag is only set to `false` after calling `loadData` and is set back to `true` after calling `setRevisionsForLoadedData`.\n\t * This helps ensure that `setRevisionsForLoadedData` is only called after `loadData` and only called once.\n\t */\n\tprivate isFullyLoaded = true;\n\n\t/**\n\t * @param name - A name for the index, used as a prefix for the generated field keys.\n\t * @param rootIdAllocator - An ID allocator used to generate unique field keys.\n\t */\n\tpublic constructor(\n\t\tprivate readonly name: string,\n\t\tprivate rootIdAllocator: IdAllocator<ForestRootId>,\n\t) {}\n\n\tpublic clone(): DetachedFieldIndex {\n\t\tconst clone = new DetachedFieldIndex(\n\t\t\tthis.name,\n\t\t\tidAllocatorFromMaxId(this.rootIdAllocator.getMaxId()) as IdAllocator<ForestRootId>,\n\t\t);\n\t\tpopulateNestedMap(this.detachedNodeToField, clone.detachedNodeToField, true);\n\t\tpopulateNestedMap(\n\t\t\tthis.latestRelevantRevisionToFields,\n\t\t\tclone.latestRelevantRevisionToFields,\n\t\t\ttrue,\n\t\t);\n\t\treturn clone;\n\t}\n\n\t/**\n\t * Creates a restorable checkpoint of the current state of the DetachedFieldIndex.\n\t */\n\tpublic createCheckpoint(): DetachedFieldIndexCheckpoint {\n\t\tconst clone = this.clone();\n\t\treturn () => {\n\t\t\tthis.purge();\n\t\t\tpopulateNestedMap(clone.detachedNodeToField, this.detachedNodeToField, true);\n\t\t\tpopulateNestedMap(\n\t\t\t\tclone.latestRelevantRevisionToFields,\n\t\t\t\tthis.latestRelevantRevisionToFields,\n\t\t\t\ttrue,\n\t\t\t);\n\t\t\tthis.rootIdAllocator = idAllocatorFromMaxId(\n\t\t\t\tclone.rootIdAllocator.getMaxId(),\n\t\t\t) as IdAllocator<ForestRootId>;\n\t\t};\n\t}\n\n\tpublic *entries(): Generator<{\n\t\troot: ForestRootId;\n\t\tlatestRelevantRevision?: RevisionTag;\n\t\tid: Delta.DetachedNodeId;\n\t}> {\n\t\tfor (const [major, innerMap] of this.detachedNodeToField) {\n\t\t\tif (major === undefined) {\n\t\t\t\tfor (const [minor, { root, latestRelevantRevision }] of innerMap) {\n\t\t\t\t\tyield latestRelevantRevision === undefined\n\t\t\t\t\t\t? { id: { minor }, root }\n\t\t\t\t\t\t: { id: { minor }, root, latestRelevantRevision };\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (const [minor, { root, latestRelevantRevision }] of innerMap) {\n\t\t\t\t\tyield latestRelevantRevision === undefined\n\t\t\t\t\t\t? { id: { major, minor }, root }\n\t\t\t\t\t\t: { id: { major, minor }, root, latestRelevantRevision };\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Removes all entries from the index.\n\t */\n\tpublic purge(): void {\n\t\tthis.detachedNodeToField.clear();\n\t\tthis.latestRelevantRevisionToFields.clear();\n\t}\n\n\tpublic toFieldKey(id: ForestRootId): FieldKey {\n\t\treturn brand(`${this.name}-${id}`);\n\t}\n\n\tpublic tryGetEntry(id: Delta.DetachedNodeId): ForestRootId | undefined {\n\t\treturn tryGetFromNestedMap(this.detachedNodeToField, id.major, id.minor)?.root;\n\t}\n\n\tpublic getEntry(id: Delta.DetachedNodeId): ForestRootId {\n\t\tconst key = this.tryGetEntry(id);\n\t\tassert(key !== undefined, 0x7aa /* Unknown removed node ID */);\n\t\treturn key;\n\t}\n\n\t/**\n\t * Returns the detached root IDs for all the trees that were detached or last modified by the given revision.\n\t */\n\tpublic *getRootsLastTouchedByRevision(revision: RevisionTag): Iterable<ForestRootId> {\n\t\tconst roots = this.latestRelevantRevisionToFields.get(revision);\n\t\tif (roots !== undefined) {\n\t\t\tyield* roots.keys();\n\t\t}\n\t}\n\n\t/**\n\t * Removes the detached roots for all the trees that were detached or last modified by the given revision.\n\t */\n\tpublic deleteRootsLastTouchedByRevision(revision: RevisionTag): void {\n\t\tconst entries = this.latestRelevantRevisionToFields.get(revision);\n\t\tif (entries === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.latestRelevantRevisionToFields.delete(revision);\n\t\tfor (const detachedNodeId of entries.values()) {\n\t\t\tconst found = deleteFromNestedMap(\n\t\t\t\tthis.detachedNodeToField,\n\t\t\t\tdetachedNodeId.major,\n\t\t\t\tdetachedNodeId.minor,\n\t\t\t);\n\t\t\tassert(found, 0x9ba /* Unable to delete unknown entry */);\n\t\t}\n\t}\n\n\tpublic deleteEntry(nodeId: Delta.DetachedNodeId): void {\n\t\tconst entry = tryGetFromNestedMap(this.detachedNodeToField, nodeId.major, nodeId.minor);\n\t\tassert(entry !== undefined, 0x9bb /* Unable to delete unknown entry */);\n\t\tdeleteFromNestedMap(this.detachedNodeToField, nodeId.major, nodeId.minor);\n\t\tdeleteFromNestedMap(\n\t\t\tthis.latestRelevantRevisionToFields,\n\t\t\tentry.latestRelevantRevision,\n\t\t\tentry.root,\n\t\t);\n\t}\n\n\t/**\n\t * Associates the DetachedNodeId with a field key and creates an entry for it in the index.\n\t * @param nodeId - The ID of the detached node.\n\t * @param revision - The revision that last detached the root.\n\t * See {@link DetachedField.latestRelevantRevision} for details.\n\t * @param count - The number of entries to create. These entries will have consecutive minor IDs.\n\t * @returns The atomic ID that the `DetachedFieldIndex` uses to uniquely identify the first root.\n\t */\n\tpublic createEntry(\n\t\tnodeId?: Delta.DetachedNodeId,\n\t\trevision?: RevisionTag,\n\t\tcount: number = 1,\n\t): ForestRootId {\n\t\tconst root = this.rootIdAllocator.allocate(count);\n\t\tif (nodeId !== undefined) {\n\t\t\tfor (let i = 0; i < count; i++) {\n\t\t\t\tassert(\n\t\t\t\t\ttryGetFromNestedMap(this.detachedNodeToField, nodeId.major, nodeId.minor + i) ===\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t0x7ce /* Detached node ID already exists in index */,\n\t\t\t\t);\n\t\t\t\tsetInNestedMap(this.detachedNodeToField, nodeId.major, nodeId.minor + i, {\n\t\t\t\t\troot: brand<ForestRootId>(root + i),\n\t\t\t\t\tlatestRelevantRevision: revision,\n\t\t\t\t});\n\t\t\t\tsetInNestedMap(this.latestRelevantRevisionToFields, revision, root + i, {\n\t\t\t\t\tmajor: nodeId.major,\n\t\t\t\t\tminor: nodeId.minor + i,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn root;\n\t}\n\n\t/**\n\t * Updates the latest revision that is relevant to the provided root\n\t */\n\tpublic updateLatestRevision(\n\t\tid: Delta.DetachedNodeId,\n\t\trevision: RevisionTag | undefined,\n\t): void {\n\t\tconst fieldEntry = tryGetFromNestedMap(this.detachedNodeToField, id.major, id.minor);\n\t\tassert(\n\t\t\tfieldEntry !== undefined,\n\t\t\t0x9bc /* detached node id does not exist in the detached field index */,\n\t\t);\n\t\tconst { root, latestRelevantRevision: previousRevision } = fieldEntry;\n\n\t\t// remove this root from the set of roots for the previous latest revision\n\t\tdeleteFromNestedMap(this.latestRelevantRevisionToFields, previousRevision, root);\n\n\t\t// add this root to the set of roots for the new latest revision\n\t\tsetInNestedMap(this.latestRelevantRevisionToFields, revision, root, id);\n\t\tsetInNestedMap(this.detachedNodeToField, id.major, id.minor, {\n\t\t\troot,\n\t\t\tlatestRelevantRevision: revision,\n\t\t});\n\t}\n\n\tpublic getSummaryData(): DetachedFieldSummaryData {\n\t\treturn {\n\t\t\tdata: this.detachedNodeToField,\n\t\t\tmaxId: this.rootIdAllocator.getMaxId(),\n\t\t};\n\t}\n\n\t/**\n\t * Loads the tree index from summary data, this overrides any existing data.\n\t */\n\tpublic loadData(detachedFieldIndex: DetachedFieldSummaryData): void {\n\t\tthis.rootIdAllocator = idAllocatorFromMaxId(\n\t\t\tdetachedFieldIndex.maxId,\n\t\t) as IdAllocator<ForestRootId>;\n\n\t\tthis.detachedNodeToField = new Map();\n\t\tthis.latestRelevantRevisionToFields = new Map();\n\t\tthis.isFullyLoaded = false;\n\t\tconst rootMap = new Map<ForestRootId, Delta.DetachedNodeId>();\n\t\tforEachInNestedMap(detachedFieldIndex.data, ({ root }, major, minor) => {\n\t\t\tsetInNestedMap(this.detachedNodeToField, major, minor, { root });\n\t\t\trootMap.set(root, { major, minor });\n\t\t});\n\n\t\tthis.latestRelevantRevisionToFields.set(undefined, rootMap);\n\t}\n\n\t/**\n\t * Sets the latest relevant revision for any roots that have an undefined latest relevant revision.\n\t * This occurs when the detached field index is loaded from a summary and can only be called once after\n\t * the summary has been loaded.\n\t */\n\tpublic setRevisionsForLoadedData(latestRevision: RevisionTag): void {\n\t\tassert(\n\t\t\t!this.isFullyLoaded,\n\t\t\t0x9bd /* revisions should only be set once using this function after loading data from a summary */,\n\t\t);\n\n\t\tconst newDetachedNodeToField: NestedMap<Major, Minor, DetachedField> = new Map();\n\t\tconst rootMap = new Map();\n\t\tforEachInNestedMap(this.detachedNodeToField, ({ root }, major, minor) => {\n\t\t\tsetInNestedMap(newDetachedNodeToField, major, minor, {\n\t\t\t\troot,\n\t\t\t\tlatestRelevantRevision: latestRevision,\n\t\t\t});\n\t\t\trootMap.set(root, { major, minor });\n\t\t});\n\n\t\tthis.detachedNodeToField = newDetachedNodeToField;\n\t\tthis.latestRelevantRevisionToFields.delete(undefined);\n\t\tthis.latestRelevantRevisionToFields.set(latestRevision, rootMap);\n\t\tthis.isFullyLoaded = true;\n\t}\n}\n"]}
@@ -16,6 +16,7 @@ export { SparseNode, getDescendant } from "./sparseTree.js";
16
16
  export { deltaForRootInitialization, makeDetachedNodeId, offsetDetachId, emptyDelta, areDetachedNodeIdsEqual, deltaFieldMapHasVisibleChanges, deltaFieldChangesHaveVisibleChanges, } from "./deltaUtil.js";
17
17
  export { type TreeChunk, dummyRoot, cursorChunk, tryGetChunk, type ChunkedCursor, } from "./chunk.js";
18
18
  export { DetachedFieldIndex, type DetachedFieldIndexCheckpoint, type ReadOnlyDetachedFieldIndex, } from "./detachedFieldIndex.js";
19
+ export { type DetachedFieldSummaryData } from "./detachedFieldIndexTypes.js";
19
20
  export { detachedFieldIndexCodecBuilder } from "./detachedFieldIndexCodecs.js";
20
21
  export { DetachedFieldIndexFormatVersion } from "./detachedFieldIndexFormatCommon.js";
21
22
  export { type FormatV1 } from "./detachedFieldIndexFormatV1.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,SAAS,EACT,KAAK,UAAU,EACf,KAAK,UAAU,EACf,UAAU,EACV,KAAK,YAAY,EACjB,KAAK,mBAAmB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,KAAK,WAAW,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACd,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,EAClB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,sBAAsB,GACtB,MAAM,aAAa,CAAC;AACrB,YAAY,EACX,UAAU,EACV,IAAI,IAAI,SAAS,EACjB,IAAI,IAAI,SAAS,EACjB,cAAc,IAAI,mBAAmB,EACrC,QAAQ,IAAI,aAAa,EACzB,mBAAmB,IAAI,wBAAwB,EAC/C,iBAAiB,IAAI,sBAAsB,EAC3C,uBAAuB,IAAI,4BAA4B,EACvD,kBAAkB,IAAI,uBAAuB,EAC7C,YAAY,IAAI,iBAAiB,GACjC,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,gBAAgB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EACN,SAAS,EACT,WAAW,EACX,QAAQ,EACR,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,K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AA,mBAAmB,OAAA;AAC5B,uCAeoB;AAdnB,oGAAA,QAAQ,OAAA;AAQR,8GAAA,kBAAkB,OAAA;AAClB,8GAAA,kBAAkB,OAAA;AAClB,wGAAA,YAAY,OAAA;AAEZ,qGAAA,SAAS,OAAA;AACT,gHAAA,oBAAoB,OAAA;AAErB,iDAAgE;AAApC,2GAAA,UAAU,OAAA;AACtC,qDAO2B;AAL1B,gHAAA,aAAa,OAAA;AACb,6GAAA,UAAU,OAAA;AACV,yHAAA,sBAAsB,OAAA;AACtB,kHAAA,eAAe,OAAA;AACf,yHAAA,sBAAsB,OAAA;AAGvB,iDAA4D;AAAnD,2GAAA,UAAU,OAAA;AAAE,8GAAA,aAAa,OAAA;AAElC,+CAQwB;AAPvB,0HAAA,0BAA0B,OAAA;AAC1B,kHAAA,kBAAkB,OAAA;AAClB,8GAAA,cAAc,OAAA;AACd,0GAAA,UAAU,OAAA;AACV,uHAAA,uBAAuB,OAAA;AACvB,8HAAA,8BAA8B,OAAA;AAC9B,mIAAA,mCAAmC,OAAA;AAGpC,uCAMoB;AAJnB,qGAAA,SAAS,OAAA;AACT,uGAAA,WAAW,OAAA;AACX,uGAAA,WAAW,OAAA;AAIZ,iEAIiC;AAHhC,2HAAA,kBAAkB,OAAA;AAKnB,6EAA+E;AAAtE,6IAAA,8BAA8B,OAAA;AACvC,yFAAsF;AAA7E,oJAAA,+BAA+B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype Anchor,\n\ttype AnchorLocator,\n\tAnchorSet,\n\ttype AnchorSlot,\n\ttype AnchorNode,\n\tanchorSlot,\n\ttype AnchorEvents,\n\ttype AnchorSetRootEvents,\n} from \"./anchorSet.js\";\nexport {\n\ttype ITreeCursor,\n\tCursorLocationType,\n\tcastCursorToSynchronous,\n\tmapCursorField,\n\tmapCursorFields,\n\tforEachNode,\n\tforEachNodeInSubtree,\n\tforEachField,\n\titerateCursorField,\n\ttype ITreeCursorSynchronous,\n\ttype PathRootPrefix,\n\tinCursorField,\n\tinCursorNode,\n\tCursorMarker,\n\tisCursor,\n\tforEachNodeSubsequence,\n} from \"./cursor.js\";\nexport type {\n\tProtoNodes,\n\tRoot as DeltaRoot,\n\tMark as DeltaMark,\n\tDetachedNodeId as DeltaDetachedNodeId,\n\tFieldMap as DeltaFieldMap,\n\tDetachedNodeChanges as DeltaDetachedNodeChanges,\n\tDetachedNodeBuild as DeltaDetachedNodeBuild,\n\tDetachedNodeDestruction as DeltaDetachedNodeDestruction,\n\tDetachedNodeRename as DeltaDetachedNodeRename,\n\tFieldChanges as DeltaFieldChanges,\n} from \"./delta.js\";\nexport { type MapTree, type ExclusiveMapTree, deepCopyMapTree } from \"./mapTree.js\";\nexport {\n\tclonePath,\n\ttopDownPath,\n\tgetDepth,\n\ttype UpPath,\n\ttype NormalizedUpPath,\n\ttype INormalizedUpPath,\n\ttype NormalizedFieldUpPath,\n\ttype FieldUpPath,\n\ttype Range,\n\ttype RangeUpPath,\n\ttype PlaceUpPath,\n\ttype PlaceIndex,\n\ttype NodeIndex,\n\tcompareUpPaths,\n\tcompareFieldUpPaths,\n\tisDetachedUpPathRoot as isDetachedUpPath,\n\tgetDetachedFieldContainingPath,\n\ttype UpPathDefault,\n} from \"./pathTree.js\";\nexport {\n\ttype FieldMapObject,\n\ttype GenericFieldsNode,\n\tgenericTreeDeleteIfEmpty,\n\tgenericTreeKeys,\n\ttype GenericTreeNode,\n\tgetGenericTreeField,\n\ttype JsonableTree,\n\tsetGenericTreeField,\n} from \"./treeTextFormat.js\";\nexport { EncodedJsonableTree } from \"./persistedTreeTextFormat.js\";\nexport {\n\tEmptyKey,\n\ttype TreeType,\n\ttype ChildLocation,\n\ttype DetachedField,\n\ttype ChildCollection,\n\ttype RootField,\n\ttype Value,\n\ttype TreeValue,\n\tdetachedFieldAsKey,\n\tkeyAsDetachedField,\n\trootFieldKey,\n\ttype NodeData,\n\trootField,\n\taboveRootPlaceholder,\n} from \"./types.js\";\nexport { type DeltaVisitor, visitDelta } from \"./visitDelta.js\";\nexport {\n\ttype AnnouncedVisitor,\n\tannounceDelta,\n\tapplyDelta,\n\tcreateAnnouncedVisitor,\n\tcombineVisitors,\n\tmakeDetachedFieldIndex,\n} from \"./visitorUtils.js\";\n\nexport { SparseNode, getDescendant } from \"./sparseTree.js\";\n\nexport {\n\tdeltaForRootInitialization,\n\tmakeDetachedNodeId,\n\toffsetDetachId,\n\temptyDelta,\n\tareDetachedNodeIdsEqual,\n\tdeltaFieldMapHasVisibleChanges,\n\tdeltaFieldChangesHaveVisibleChanges,\n} from \"./deltaUtil.js\";\n\nexport {\n\ttype TreeChunk,\n\tdummyRoot,\n\tcursorChunk,\n\ttryGetChunk,\n\ttype ChunkedCursor,\n} from \"./chunk.js\";\n\nexport {\n\tDetachedFieldIndex,\n\ttype DetachedFieldIndexCheckpoint,\n\ttype ReadOnlyDetachedFieldIndex,\n} from \"./detachedFieldIndex.js\";\n\nexport { detachedFieldIndexCodecBuilder } from \"./detachedFieldIndexCodecs.js\";\nexport { DetachedFieldIndexFormatVersion } from \"./detachedFieldIndexFormatCommon.js\";\nexport { type FormatV1 } from \"./detachedFieldIndexFormatV1.js\";\n\nexport { type ForestRootId } from \"./detachedFieldIndexTypes.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,+CASwB;AANvB,yGAAA,SAAS,OAAA;AAGT,0GAAA,UAAU,OAAA;AAIX,yCAiBqB;AAfpB,+GAAA,kBAAkB,OAAA;AAClB,oHAAA,uBAAuB,OAAA;AACvB,2GAAA,cAAc,OAAA;AACd,4GAAA,eAAe,OAAA;AACf,wGAAA,WAAW,OAAA;AACX,iHAAA,oBAAoB,OAAA;AACpB,yGAAA,YAAY,OAAA;AACZ,+GAAA,kBAAkB,OAAA;AAGlB,0GAAA,aAAa,OAAA;AACb,yGAAA,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,iEAIiC;AAHhC,2HAAA,kBAAkB,OAAA;AAOnB,6EAA+E;AAAtE,6IAAA,8BAA8B,OAAA;AACvC,yFAAsF;AAA7E,oJAAA,+BAA+B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype Anchor,\n\ttype AnchorLocator,\n\tAnchorSet,\n\ttype AnchorSlot,\n\ttype AnchorNode,\n\tanchorSlot,\n\ttype AnchorEvents,\n\ttype AnchorSetRootEvents,\n} from \"./anchorSet.js\";\nexport {\n\ttype ITreeCursor,\n\tCursorLocationType,\n\tcastCursorToSynchronous,\n\tmapCursorField,\n\tmapCursorFields,\n\tforEachNode,\n\tforEachNodeInSubtree,\n\tforEachField,\n\titerateCursorField,\n\ttype ITreeCursorSynchronous,\n\ttype PathRootPrefix,\n\tinCursorField,\n\tinCursorNode,\n\tCursorMarker,\n\tisCursor,\n\tforEachNodeSubsequence,\n} from \"./cursor.js\";\nexport type {\n\tProtoNodes,\n\tRoot as DeltaRoot,\n\tMark as DeltaMark,\n\tDetachedNodeId as DeltaDetachedNodeId,\n\tFieldMap as DeltaFieldMap,\n\tDetachedNodeChanges as DeltaDetachedNodeChanges,\n\tDetachedNodeBuild as DeltaDetachedNodeBuild,\n\tDetachedNodeDestruction as DeltaDetachedNodeDestruction,\n\tDetachedNodeRename as DeltaDetachedNodeRename,\n\tFieldChanges as DeltaFieldChanges,\n} from \"./delta.js\";\nexport { type MapTree, type ExclusiveMapTree, deepCopyMapTree } from \"./mapTree.js\";\nexport {\n\tclonePath,\n\ttopDownPath,\n\tgetDepth,\n\ttype UpPath,\n\ttype NormalizedUpPath,\n\ttype INormalizedUpPath,\n\ttype NormalizedFieldUpPath,\n\ttype FieldUpPath,\n\ttype Range,\n\ttype RangeUpPath,\n\ttype PlaceUpPath,\n\ttype PlaceIndex,\n\ttype NodeIndex,\n\tcompareUpPaths,\n\tcompareFieldUpPaths,\n\tisDetachedUpPathRoot as isDetachedUpPath,\n\tgetDetachedFieldContainingPath,\n\ttype UpPathDefault,\n} from \"./pathTree.js\";\nexport {\n\ttype FieldMapObject,\n\ttype GenericFieldsNode,\n\tgenericTreeDeleteIfEmpty,\n\tgenericTreeKeys,\n\ttype GenericTreeNode,\n\tgetGenericTreeField,\n\ttype JsonableTree,\n\tsetGenericTreeField,\n} from \"./treeTextFormat.js\";\nexport { EncodedJsonableTree } from \"./persistedTreeTextFormat.js\";\nexport {\n\tEmptyKey,\n\ttype TreeType,\n\ttype ChildLocation,\n\ttype DetachedField,\n\ttype ChildCollection,\n\ttype RootField,\n\ttype Value,\n\ttype TreeValue,\n\tdetachedFieldAsKey,\n\tkeyAsDetachedField,\n\trootFieldKey,\n\ttype NodeData,\n\trootField,\n\taboveRootPlaceholder,\n} from \"./types.js\";\nexport { type DeltaVisitor, visitDelta } from \"./visitDelta.js\";\nexport {\n\ttype AnnouncedVisitor,\n\tannounceDelta,\n\tapplyDelta,\n\tcreateAnnouncedVisitor,\n\tcombineVisitors,\n\tmakeDetachedFieldIndex,\n} from \"./visitorUtils.js\";\n\nexport { SparseNode, getDescendant } from \"./sparseTree.js\";\n\nexport {\n\tdeltaForRootInitialization,\n\tmakeDetachedNodeId,\n\toffsetDetachId,\n\temptyDelta,\n\tareDetachedNodeIdsEqual,\n\tdeltaFieldMapHasVisibleChanges,\n\tdeltaFieldChangesHaveVisibleChanges,\n} from \"./deltaUtil.js\";\n\nexport {\n\ttype TreeChunk,\n\tdummyRoot,\n\tcursorChunk,\n\ttryGetChunk,\n\ttype ChunkedCursor,\n} from \"./chunk.js\";\n\nexport {\n\tDetachedFieldIndex,\n\ttype DetachedFieldIndexCheckpoint,\n\ttype ReadOnlyDetachedFieldIndex,\n} from \"./detachedFieldIndex.js\";\n\nexport { type DetachedFieldSummaryData } from \"./detachedFieldIndexTypes.js\";\n\nexport { detachedFieldIndexCodecBuilder } from \"./detachedFieldIndexCodecs.js\";\nexport { DetachedFieldIndexFormatVersion } from \"./detachedFieldIndexFormatCommon.js\";\nexport { type FormatV1 } from \"./detachedFieldIndexFormatV1.js\";\n\nexport { type ForestRootId } from \"./detachedFieldIndexTypes.js\";\n"]}
@@ -2,16 +2,14 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { IIdCompressor } from "@fluidframework/id-compressor";
6
- import type { CodecWriteOptions } from "../../codec/index.js";
7
- import type { RevisionTag, RevisionTagCodec } from "../rebase/index.js";
5
+ import type { RevisionTag } from "../rebase/index.js";
8
6
  import type { FieldKey } from "../schema-stored/index.js";
9
7
  import type { ITreeCursorSynchronous } from "./cursor.js";
10
8
  import type { Root } from "./delta.js";
11
9
  import { DetachedFieldIndex } from "./detachedFieldIndex.js";
12
10
  import type { PlaceIndex, Range } from "./pathTree.js";
13
11
  import { type DeltaVisitor } from "./visitDelta.js";
14
- export declare function makeDetachedFieldIndex(prefix: string | undefined, revisionTagCodec: RevisionTagCodec, idCompressor: IIdCompressor, options?: CodecWriteOptions): DetachedFieldIndex;
12
+ export declare function makeDetachedFieldIndex(prefix?: string): DetachedFieldIndex;
15
13
  export declare function applyDelta(delta: Root, latestRevision: RevisionTag | undefined, deltaProcessor: {
16
14
  acquireVisitor: () => DeltaVisitor;
17
15
  }, detachedFieldIndex: DetachedFieldIndex): void;
@@ -1 +1 @@
1
- {"version":3,"file":"visitorUtils.d.ts","sourceRoot":"","sources":["../../../src/core/tree/visitorUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,KAAK,EAAE,sBAA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