@fluidframework/tree 2.83.0 → 2.90.0-378676

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 (781) hide show
  1. package/api-report/tree.alpha.api.md +1 -0
  2. package/dist/core/change-family/changeFamily.d.ts +4 -1
  3. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  4. package/dist/core/change-family/changeFamily.js.map +1 -1
  5. package/dist/core/change-family/index.d.ts +1 -1
  6. package/dist/core/change-family/index.d.ts.map +1 -1
  7. package/dist/core/change-family/index.js.map +1 -1
  8. package/dist/core/index.d.ts +3 -3
  9. package/dist/core/index.d.ts.map +1 -1
  10. package/dist/core/index.js +6 -4
  11. package/dist/core/index.js.map +1 -1
  12. package/dist/core/rebase/changeRebaser.d.ts +6 -1
  13. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  14. package/dist/core/rebase/changeRebaser.js.map +1 -1
  15. package/dist/core/rebase/index.d.ts +1 -1
  16. package/dist/core/rebase/index.d.ts.map +1 -1
  17. package/dist/core/rebase/index.js +2 -1
  18. package/dist/core/rebase/index.js.map +1 -1
  19. package/dist/core/rebase/types.d.ts +1 -0
  20. package/dist/core/rebase/types.d.ts.map +1 -1
  21. package/dist/core/rebase/types.js +5 -1
  22. package/dist/core/rebase/types.js.map +1 -1
  23. package/dist/core/rebase/utils.d.ts.map +1 -1
  24. package/dist/core/rebase/utils.js +25 -7
  25. package/dist/core/rebase/utils.js.map +1 -1
  26. package/dist/core/tree/delta.d.ts +5 -0
  27. package/dist/core/tree/delta.d.ts.map +1 -1
  28. package/dist/core/tree/delta.js.map +1 -1
  29. package/dist/core/tree/detachedFieldIndex.d.ts +13 -1
  30. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  31. package/dist/core/tree/detachedFieldIndex.js +14 -1
  32. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  33. package/dist/core/tree/detachedFieldIndexTypes.d.ts +4 -0
  34. package/dist/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
  35. package/dist/core/tree/detachedFieldIndexTypes.js.map +1 -1
  36. package/dist/core/tree/index.d.ts +2 -2
  37. package/dist/core/tree/index.d.ts.map +1 -1
  38. package/dist/core/tree/index.js +4 -3
  39. package/dist/core/tree/index.js.map +1 -1
  40. package/dist/core/tree/pathTree.d.ts +11 -3
  41. package/dist/core/tree/pathTree.d.ts.map +1 -1
  42. package/dist/core/tree/pathTree.js +14 -2
  43. package/dist/core/tree/pathTree.js.map +1 -1
  44. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  45. package/dist/core/tree/visitDelta.js +17 -13
  46. package/dist/core/tree/visitDelta.js.map +1 -1
  47. package/dist/feature-libraries/changeAtomIdBTree.d.ts +3 -2
  48. package/dist/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  49. package/dist/feature-libraries/changeAtomIdBTree.js +15 -2
  50. package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -1
  51. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +92 -44
  52. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  53. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +220 -70
  54. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  55. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  56. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +12 -2
  57. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  58. package/dist/feature-libraries/default-schema/index.d.ts +2 -1
  59. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  60. package/dist/feature-libraries/default-schema/index.js +4 -2
  61. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  62. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +40 -0
  63. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
  64. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js +153 -0
  65. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
  66. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +7 -6
  67. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  68. package/dist/feature-libraries/default-schema/mappedEditBuilder.js +15 -0
  69. package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  70. package/dist/feature-libraries/deltaUtils.d.ts +1 -0
  71. package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
  72. package/dist/feature-libraries/deltaUtils.js +6 -1
  73. package/dist/feature-libraries/deltaUtils.js.map +1 -1
  74. package/dist/feature-libraries/flex-tree/context.d.ts +9 -0
  75. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  76. package/dist/feature-libraries/flex-tree/context.js +6 -0
  77. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  78. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  79. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  80. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  81. package/dist/feature-libraries/flex-tree/lazyField.d.ts +8 -7
  82. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  83. package/dist/feature-libraries/flex-tree/lazyField.js +39 -8
  84. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  85. package/dist/feature-libraries/index.d.ts +3 -3
  86. package/dist/feature-libraries/index.d.ts.map +1 -1
  87. package/dist/feature-libraries/index.js +8 -4
  88. package/dist/feature-libraries/index.js.map +1 -1
  89. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  90. package/dist/feature-libraries/mitigatedChangeFamily.js +2 -2
  91. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  92. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +100 -24
  93. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  94. package/dist/feature-libraries/modular-schema/crossFieldQueries.js +8 -12
  95. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  96. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +85 -51
  97. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  98. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  99. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  100. package/dist/feature-libraries/modular-schema/genericFieldKind.js +4 -9
  101. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  102. package/dist/feature-libraries/modular-schema/index.d.ts +3 -3
  103. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  104. package/dist/feature-libraries/modular-schema/index.js +2 -3
  105. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  106. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +18 -22
  107. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  108. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +276 -158
  109. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  110. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  111. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -1
  112. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  113. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.d.ts +15 -0
  114. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.d.ts.map +1 -0
  115. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.js +296 -0
  116. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.js.map +1 -0
  117. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +1 -0
  118. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  119. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +8 -0
  120. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  121. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +56 -22
  122. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  123. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1390 -462
  124. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  125. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  126. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  127. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +1 -2
  128. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
  129. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +3 -3
  130. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
  131. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.d.ts +74 -0
  132. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.d.ts.map +1 -0
  133. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.js +35 -0
  134. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.js.map +1 -0
  135. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +49 -10
  136. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  137. package/dist/feature-libraries/modular-schema/modularChangeTypes.js +3 -3
  138. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  139. package/dist/feature-libraries/optional-field/optionalField.d.ts +13 -32
  140. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  141. package/dist/feature-libraries/optional-field/optionalField.js +257 -446
  142. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  143. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +23 -0
  144. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +1 -0
  145. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +31 -0
  146. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +1 -0
  147. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +31 -31
  148. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  149. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  150. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  151. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  152. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +57 -28
  153. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  154. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +12 -0
  155. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +1 -0
  156. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js +57 -0
  157. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js.map +1 -0
  158. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  159. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +5 -1
  160. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  161. package/dist/feature-libraries/optional-field/requiredField.d.ts +3 -2
  162. package/dist/feature-libraries/optional-field/requiredField.d.ts.map +1 -1
  163. package/dist/feature-libraries/optional-field/requiredField.js +6 -1
  164. package/dist/feature-libraries/optional-field/requiredField.js.map +1 -1
  165. package/dist/feature-libraries/sequence-field/compose.d.ts +6 -7
  166. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  167. package/dist/feature-libraries/sequence-field/compose.js +81 -259
  168. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  169. package/dist/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
  170. package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  171. package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  172. package/dist/feature-libraries/sequence-field/invert.d.ts +3 -3
  173. package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  174. package/dist/feature-libraries/sequence-field/invert.js +65 -167
  175. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  176. package/dist/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  177. package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  178. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  179. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
  180. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  181. package/dist/feature-libraries/sequence-field/moveEffectTable.js +7 -90
  182. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  183. package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -3
  184. package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  185. package/dist/feature-libraries/sequence-field/rebase.js +109 -116
  186. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  187. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  188. package/dist/feature-libraries/sequence-field/replaceRevisions.js +19 -32
  189. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  190. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  191. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +1 -2
  192. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  193. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
  194. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  195. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +388 -187
  196. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  197. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  198. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +20 -62
  199. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  200. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  201. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  202. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +13 -13
  203. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  204. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
  205. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  206. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +16 -111
  207. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  208. package/dist/feature-libraries/sequence-field/types.d.ts +37 -74
  209. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  210. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  211. package/dist/feature-libraries/sequence-field/utils.d.ts +20 -25
  212. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  213. package/dist/feature-libraries/sequence-field/utils.js +159 -320
  214. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  215. package/dist/packageVersion.d.ts +1 -1
  216. package/dist/packageVersion.d.ts.map +1 -1
  217. package/dist/packageVersion.js +1 -1
  218. package/dist/packageVersion.js.map +1 -1
  219. package/dist/shared-tree/independentView.d.ts.map +1 -1
  220. package/dist/shared-tree/independentView.js +1 -1
  221. package/dist/shared-tree/independentView.js.map +1 -1
  222. package/dist/shared-tree/index.d.ts +1 -1
  223. package/dist/shared-tree/index.d.ts.map +1 -1
  224. package/dist/shared-tree/index.js.map +1 -1
  225. package/dist/shared-tree/schematizeTree.d.ts +4 -4
  226. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  227. package/dist/shared-tree/schematizeTree.js +2 -1
  228. package/dist/shared-tree/schematizeTree.js.map +1 -1
  229. package/dist/shared-tree/schematizingTreeView.d.ts +1 -5
  230. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  231. package/dist/shared-tree/schematizingTreeView.js +21 -35
  232. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  233. package/dist/shared-tree/sharedTree.d.ts +9 -3
  234. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  235. package/dist/shared-tree/sharedTree.js +4 -1
  236. package/dist/shared-tree/sharedTree.js.map +1 -1
  237. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +1 -0
  238. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  239. package/dist/shared-tree/sharedTreeChangeCodecs.js +8 -0
  240. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  241. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
  242. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  243. package/dist/shared-tree/sharedTreeChangeFamily.js +2 -2
  244. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  245. package/dist/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
  246. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  247. package/dist/shared-tree/sharedTreeEditBuilder.js +14 -7
  248. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  249. package/dist/shared-tree/treeCheckout.d.ts +13 -11
  250. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  251. package/dist/shared-tree/treeCheckout.js +56 -6
  252. package/dist/shared-tree/treeCheckout.js.map +1 -1
  253. package/dist/shared-tree-core/branch.d.ts +3 -2
  254. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  255. package/dist/shared-tree-core/branch.js +4 -3
  256. package/dist/shared-tree-core/branch.js.map +1 -1
  257. package/dist/shared-tree-core/editManager.d.ts +2 -2
  258. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  259. package/dist/shared-tree-core/editManager.js +9 -9
  260. package/dist/shared-tree-core/editManager.js.map +1 -1
  261. package/dist/shared-tree-core/editManagerCodecs.d.ts +4 -0
  262. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  263. package/dist/shared-tree-core/editManagerCodecs.js +10 -2
  264. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  265. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +1 -0
  266. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  267. package/dist/shared-tree-core/editManagerFormatCommons.js +6 -0
  268. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  269. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  270. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  271. package/dist/shared-tree-core/editManagerFormatV1toV4.js +1 -0
  272. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  273. package/dist/shared-tree-core/index.d.ts +2 -2
  274. package/dist/shared-tree-core/index.d.ts.map +1 -1
  275. package/dist/shared-tree-core/index.js +3 -1
  276. package/dist/shared-tree-core/index.js.map +1 -1
  277. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  278. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  279. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  280. package/dist/shared-tree-core/messageCodecs.d.ts +4 -0
  281. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  282. package/dist/shared-tree-core/messageCodecs.js +10 -2
  283. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  284. package/dist/shared-tree-core/messageFormat.d.ts +1 -0
  285. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  286. package/dist/shared-tree-core/messageFormat.js +6 -0
  287. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  288. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +2 -2
  289. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  290. package/dist/shared-tree-core/messageFormatV1ToV4.js +1 -0
  291. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  292. package/dist/shared-tree-core/sharedTreeCore.d.ts +1 -0
  293. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  294. package/dist/shared-tree-core/sharedTreeCore.js +1 -1
  295. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  296. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +16 -12
  297. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  298. package/dist/simple-tree/core/unhydratedFlexTree.js +59 -8
  299. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  300. package/dist/simple-tree/fieldSchema.d.ts +4 -4
  301. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  302. package/dist/simple-tree/fieldSchema.js.map +1 -1
  303. package/dist/simple-tree/index.d.ts +2 -2
  304. package/dist/simple-tree/index.d.ts.map +1 -1
  305. package/dist/simple-tree/index.js +1 -1
  306. package/dist/simple-tree/index.js.map +1 -1
  307. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  308. package/dist/simple-tree/node-kinds/array/arrayNode.js +5 -3
  309. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  310. package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
  311. package/dist/simple-tree/node-kinds/common.js +1 -1
  312. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  313. package/dist/simple-tree/node-kinds/map/mapNode.js +2 -2
  314. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  315. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  316. package/dist/simple-tree/node-kinds/object/objectNode.js +19 -19
  317. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  318. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  319. package/dist/simple-tree/node-kinds/record/recordNode.js +4 -2
  320. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  321. package/dist/simple-tree/prepareForInsertion.d.ts +54 -47
  322. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  323. package/dist/simple-tree/prepareForInsertion.js +183 -125
  324. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  325. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +8 -3
  326. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  327. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +27 -13
  328. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  329. package/dist/treeFactory.d.ts.map +1 -1
  330. package/dist/treeFactory.js +12 -2
  331. package/dist/treeFactory.js.map +1 -1
  332. package/dist/util/index.d.ts +1 -1
  333. package/dist/util/index.d.ts.map +1 -1
  334. package/dist/util/index.js +2 -1
  335. package/dist/util/index.js.map +1 -1
  336. package/dist/util/rangeMap.d.ts +23 -11
  337. package/dist/util/rangeMap.d.ts.map +1 -1
  338. package/dist/util/rangeMap.js +43 -10
  339. package/dist/util/rangeMap.js.map +1 -1
  340. package/lib/core/change-family/changeFamily.d.ts +4 -1
  341. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  342. package/lib/core/change-family/changeFamily.js.map +1 -1
  343. package/lib/core/change-family/index.d.ts +1 -1
  344. package/lib/core/change-family/index.d.ts.map +1 -1
  345. package/lib/core/change-family/index.js.map +1 -1
  346. package/lib/core/index.d.ts +3 -3
  347. package/lib/core/index.d.ts.map +1 -1
  348. package/lib/core/index.js +2 -2
  349. package/lib/core/index.js.map +1 -1
  350. package/lib/core/rebase/changeRebaser.d.ts +6 -1
  351. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  352. package/lib/core/rebase/changeRebaser.js.map +1 -1
  353. package/lib/core/rebase/index.d.ts +1 -1
  354. package/lib/core/rebase/index.d.ts.map +1 -1
  355. package/lib/core/rebase/index.js +1 -1
  356. package/lib/core/rebase/index.js.map +1 -1
  357. package/lib/core/rebase/types.d.ts +1 -0
  358. package/lib/core/rebase/types.d.ts.map +1 -1
  359. package/lib/core/rebase/types.js +3 -0
  360. package/lib/core/rebase/types.js.map +1 -1
  361. package/lib/core/rebase/utils.d.ts.map +1 -1
  362. package/lib/core/rebase/utils.js +25 -7
  363. package/lib/core/rebase/utils.js.map +1 -1
  364. package/lib/core/tree/delta.d.ts +5 -0
  365. package/lib/core/tree/delta.d.ts.map +1 -1
  366. package/lib/core/tree/delta.js.map +1 -1
  367. package/lib/core/tree/detachedFieldIndex.d.ts +13 -1
  368. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  369. package/lib/core/tree/detachedFieldIndex.js +15 -2
  370. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  371. package/lib/core/tree/detachedFieldIndexTypes.d.ts +4 -0
  372. package/lib/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
  373. package/lib/core/tree/detachedFieldIndexTypes.js.map +1 -1
  374. package/lib/core/tree/index.d.ts +2 -2
  375. package/lib/core/tree/index.d.ts.map +1 -1
  376. package/lib/core/tree/index.js +1 -1
  377. package/lib/core/tree/index.js.map +1 -1
  378. package/lib/core/tree/pathTree.d.ts +11 -3
  379. package/lib/core/tree/pathTree.d.ts.map +1 -1
  380. package/lib/core/tree/pathTree.js +12 -1
  381. package/lib/core/tree/pathTree.js.map +1 -1
  382. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  383. package/lib/core/tree/visitDelta.js +17 -13
  384. package/lib/core/tree/visitDelta.js.map +1 -1
  385. package/lib/feature-libraries/changeAtomIdBTree.d.ts +3 -2
  386. package/lib/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  387. package/lib/feature-libraries/changeAtomIdBTree.js +15 -3
  388. package/lib/feature-libraries/changeAtomIdBTree.js.map +1 -1
  389. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +92 -44
  390. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  391. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +217 -69
  392. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  393. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  394. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +12 -2
  395. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  396. package/lib/feature-libraries/default-schema/index.d.ts +2 -1
  397. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  398. package/lib/feature-libraries/default-schema/index.js +2 -1
  399. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  400. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +40 -0
  401. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
  402. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js +149 -0
  403. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
  404. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +7 -6
  405. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  406. package/lib/feature-libraries/default-schema/mappedEditBuilder.js +15 -0
  407. package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  408. package/lib/feature-libraries/deltaUtils.d.ts +1 -0
  409. package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
  410. package/lib/feature-libraries/deltaUtils.js +5 -1
  411. package/lib/feature-libraries/deltaUtils.js.map +1 -1
  412. package/lib/feature-libraries/flex-tree/context.d.ts +9 -0
  413. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  414. package/lib/feature-libraries/flex-tree/context.js +6 -0
  415. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  416. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  417. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  418. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  419. package/lib/feature-libraries/flex-tree/lazyField.d.ts +8 -7
  420. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  421. package/lib/feature-libraries/flex-tree/lazyField.js +40 -9
  422. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  423. package/lib/feature-libraries/index.d.ts +3 -3
  424. package/lib/feature-libraries/index.d.ts.map +1 -1
  425. package/lib/feature-libraries/index.js +3 -3
  426. package/lib/feature-libraries/index.js.map +1 -1
  427. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  428. package/lib/feature-libraries/mitigatedChangeFamily.js +2 -2
  429. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  430. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +100 -24
  431. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  432. package/lib/feature-libraries/modular-schema/crossFieldQueries.js +7 -10
  433. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  434. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +85 -51
  435. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  436. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  437. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  438. package/lib/feature-libraries/modular-schema/genericFieldKind.js +4 -9
  439. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  440. package/lib/feature-libraries/modular-schema/index.d.ts +3 -3
  441. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  442. package/lib/feature-libraries/modular-schema/index.js +1 -1
  443. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  444. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +18 -22
  445. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  446. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +267 -144
  447. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  448. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  449. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -1
  450. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  451. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.d.ts +15 -0
  452. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.d.ts.map +1 -0
  453. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.js +292 -0
  454. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.js.map +1 -0
  455. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +1 -0
  456. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  457. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +8 -0
  458. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  459. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +56 -22
  460. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  461. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1387 -468
  462. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  463. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  464. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  465. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +1 -2
  466. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
  467. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +1 -1
  468. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
  469. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.d.ts +74 -0
  470. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.d.ts.map +1 -0
  471. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.js +32 -0
  472. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.js.map +1 -0
  473. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +49 -10
  474. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  475. package/lib/feature-libraries/modular-schema/modularChangeTypes.js +1 -1
  476. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  477. package/lib/feature-libraries/optional-field/optionalField.d.ts +13 -32
  478. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  479. package/lib/feature-libraries/optional-field/optionalField.js +254 -442
  480. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  481. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +23 -0
  482. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +1 -0
  483. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +27 -0
  484. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +1 -0
  485. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +31 -31
  486. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  487. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  488. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  489. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  490. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +55 -26
  491. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  492. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +12 -0
  493. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +1 -0
  494. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js +53 -0
  495. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js.map +1 -0
  496. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  497. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +5 -1
  498. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  499. package/lib/feature-libraries/optional-field/requiredField.d.ts +3 -2
  500. package/lib/feature-libraries/optional-field/requiredField.d.ts.map +1 -1
  501. package/lib/feature-libraries/optional-field/requiredField.js +5 -1
  502. package/lib/feature-libraries/optional-field/requiredField.js.map +1 -1
  503. package/lib/feature-libraries/sequence-field/compose.d.ts +6 -7
  504. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  505. package/lib/feature-libraries/sequence-field/compose.js +83 -261
  506. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  507. package/lib/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
  508. package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  509. package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  510. package/lib/feature-libraries/sequence-field/invert.d.ts +3 -3
  511. package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  512. package/lib/feature-libraries/sequence-field/invert.js +67 -169
  513. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  514. package/lib/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  515. package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  516. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  517. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
  518. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  519. package/lib/feature-libraries/sequence-field/moveEffectTable.js +6 -84
  520. package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  521. package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -3
  522. package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  523. package/lib/feature-libraries/sequence-field/rebase.js +111 -118
  524. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  525. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  526. package/lib/feature-libraries/sequence-field/replaceRevisions.js +19 -32
  527. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  528. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  529. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +2 -3
  530. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  531. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
  532. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  533. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +379 -182
  534. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  535. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  536. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +21 -63
  537. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  538. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  539. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  540. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +13 -13
  541. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  542. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
  543. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  544. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +16 -111
  545. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  546. package/lib/feature-libraries/sequence-field/types.d.ts +37 -74
  547. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  548. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  549. package/lib/feature-libraries/sequence-field/utils.d.ts +20 -25
  550. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  551. package/lib/feature-libraries/sequence-field/utils.js +155 -313
  552. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  553. package/lib/packageVersion.d.ts +1 -1
  554. package/lib/packageVersion.d.ts.map +1 -1
  555. package/lib/packageVersion.js +1 -1
  556. package/lib/packageVersion.js.map +1 -1
  557. package/lib/shared-tree/independentView.d.ts.map +1 -1
  558. package/lib/shared-tree/independentView.js +1 -1
  559. package/lib/shared-tree/independentView.js.map +1 -1
  560. package/lib/shared-tree/index.d.ts +1 -1
  561. package/lib/shared-tree/index.d.ts.map +1 -1
  562. package/lib/shared-tree/index.js.map +1 -1
  563. package/lib/shared-tree/schematizeTree.d.ts +4 -4
  564. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  565. package/lib/shared-tree/schematizeTree.js +3 -2
  566. package/lib/shared-tree/schematizeTree.js.map +1 -1
  567. package/lib/shared-tree/schematizingTreeView.d.ts +1 -5
  568. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  569. package/lib/shared-tree/schematizingTreeView.js +24 -38
  570. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  571. package/lib/shared-tree/sharedTree.d.ts +9 -3
  572. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  573. package/lib/shared-tree/sharedTree.js +4 -1
  574. package/lib/shared-tree/sharedTree.js.map +1 -1
  575. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +1 -0
  576. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  577. package/lib/shared-tree/sharedTreeChangeCodecs.js +8 -0
  578. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  579. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
  580. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  581. package/lib/shared-tree/sharedTreeChangeFamily.js +3 -3
  582. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  583. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
  584. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  585. package/lib/shared-tree/sharedTreeEditBuilder.js +12 -6
  586. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  587. package/lib/shared-tree/treeCheckout.d.ts +13 -11
  588. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  589. package/lib/shared-tree/treeCheckout.js +59 -9
  590. package/lib/shared-tree/treeCheckout.js.map +1 -1
  591. package/lib/shared-tree-core/branch.d.ts +3 -2
  592. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  593. package/lib/shared-tree-core/branch.js +4 -3
  594. package/lib/shared-tree-core/branch.js.map +1 -1
  595. package/lib/shared-tree-core/editManager.d.ts +2 -2
  596. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  597. package/lib/shared-tree-core/editManager.js +9 -9
  598. package/lib/shared-tree-core/editManager.js.map +1 -1
  599. package/lib/shared-tree-core/editManagerCodecs.d.ts +4 -0
  600. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  601. package/lib/shared-tree-core/editManagerCodecs.js +8 -1
  602. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  603. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +1 -0
  604. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  605. package/lib/shared-tree-core/editManagerFormatCommons.js +6 -0
  606. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  607. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  608. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  609. package/lib/shared-tree-core/editManagerFormatV1toV4.js +1 -0
  610. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  611. package/lib/shared-tree-core/index.d.ts +2 -2
  612. package/lib/shared-tree-core/index.d.ts.map +1 -1
  613. package/lib/shared-tree-core/index.js +2 -2
  614. package/lib/shared-tree-core/index.js.map +1 -1
  615. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  616. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  617. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  618. package/lib/shared-tree-core/messageCodecs.d.ts +4 -0
  619. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  620. package/lib/shared-tree-core/messageCodecs.js +8 -1
  621. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  622. package/lib/shared-tree-core/messageFormat.d.ts +1 -0
  623. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  624. package/lib/shared-tree-core/messageFormat.js +6 -0
  625. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  626. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +2 -2
  627. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  628. package/lib/shared-tree-core/messageFormatV1ToV4.js +1 -0
  629. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  630. package/lib/shared-tree-core/sharedTreeCore.d.ts +1 -0
  631. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  632. package/lib/shared-tree-core/sharedTreeCore.js +1 -1
  633. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  634. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +16 -12
  635. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  636. package/lib/simple-tree/core/unhydratedFlexTree.js +58 -8
  637. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  638. package/lib/simple-tree/fieldSchema.d.ts +4 -4
  639. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  640. package/lib/simple-tree/fieldSchema.js.map +1 -1
  641. package/lib/simple-tree/index.d.ts +2 -2
  642. package/lib/simple-tree/index.d.ts.map +1 -1
  643. package/lib/simple-tree/index.js +1 -1
  644. package/lib/simple-tree/index.js.map +1 -1
  645. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  646. package/lib/simple-tree/node-kinds/array/arrayNode.js +6 -4
  647. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  648. package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
  649. package/lib/simple-tree/node-kinds/common.js +2 -2
  650. package/lib/simple-tree/node-kinds/common.js.map +1 -1
  651. package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
  652. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  653. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  654. package/lib/simple-tree/node-kinds/object/objectNode.js +20 -20
  655. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  656. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  657. package/lib/simple-tree/node-kinds/record/recordNode.js +4 -2
  658. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  659. package/lib/simple-tree/prepareForInsertion.d.ts +54 -47
  660. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  661. package/lib/simple-tree/prepareForInsertion.js +184 -125
  662. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  663. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +8 -3
  664. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  665. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +23 -10
  666. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  667. package/lib/treeFactory.d.ts.map +1 -1
  668. package/lib/treeFactory.js +13 -3
  669. package/lib/treeFactory.js.map +1 -1
  670. package/lib/util/index.d.ts +1 -1
  671. package/lib/util/index.d.ts.map +1 -1
  672. package/lib/util/index.js +1 -1
  673. package/lib/util/index.js.map +1 -1
  674. package/lib/util/rangeMap.d.ts +23 -11
  675. package/lib/util/rangeMap.d.ts.map +1 -1
  676. package/lib/util/rangeMap.js +41 -9
  677. package/lib/util/rangeMap.js.map +1 -1
  678. package/package.json +21 -21
  679. package/src/core/change-family/changeFamily.ts +5 -0
  680. package/src/core/change-family/index.ts +1 -0
  681. package/src/core/index.ts +4 -1
  682. package/src/core/rebase/changeRebaser.ts +6 -1
  683. package/src/core/rebase/index.ts +1 -0
  684. package/src/core/rebase/types.ts +4 -0
  685. package/src/core/rebase/utils.ts +31 -7
  686. package/src/core/tree/delta.ts +6 -0
  687. package/src/core/tree/detachedFieldIndex.ts +29 -1
  688. package/src/core/tree/detachedFieldIndexTypes.ts +5 -0
  689. package/src/core/tree/index.ts +13 -12
  690. package/src/core/tree/pathTree.ts +16 -4
  691. package/src/core/tree/visitDelta.ts +31 -11
  692. package/src/feature-libraries/changeAtomIdBTree.ts +28 -3
  693. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +369 -127
  694. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +13 -4
  695. package/src/feature-libraries/default-schema/index.ts +16 -5
  696. package/src/feature-libraries/default-schema/locationBasedEditBuilder.ts +231 -0
  697. package/src/feature-libraries/default-schema/mappedEditBuilder.ts +35 -9
  698. package/src/feature-libraries/deltaUtils.ts +6 -1
  699. package/src/feature-libraries/flex-tree/context.ts +17 -0
  700. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +7 -8
  701. package/src/feature-libraries/flex-tree/lazyField.ts +65 -24
  702. package/src/feature-libraries/index.ts +22 -9
  703. package/src/feature-libraries/mitigatedChangeFamily.ts +3 -1
  704. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +144 -47
  705. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +113 -58
  706. package/src/feature-libraries/modular-schema/genericFieldKind.ts +7 -18
  707. package/src/feature-libraries/modular-schema/index.ts +16 -16
  708. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +623 -348
  709. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +1 -0
  710. package/src/feature-libraries/modular-schema/modularChangeCodecV3.ts +649 -0
  711. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +14 -0
  712. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +2694 -748
  713. package/src/feature-libraries/modular-schema/modularChangeFormatV1.ts +1 -0
  714. package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +1 -1
  715. package/src/feature-libraries/modular-schema/modularChangeFormatV3.ts +67 -0
  716. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +62 -10
  717. package/src/feature-libraries/optional-field/optionalField.ts +359 -568
  718. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV3.ts +45 -0
  719. package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +31 -35
  720. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +89 -35
  721. package/src/feature-libraries/optional-field/optionalFieldCodecV3.ts +94 -0
  722. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +5 -1
  723. package/src/feature-libraries/optional-field/requiredField.ts +15 -2
  724. package/src/feature-libraries/sequence-field/compose.ts +137 -522
  725. package/src/feature-libraries/sequence-field/helperTypes.ts +34 -19
  726. package/src/feature-libraries/sequence-field/invert.ts +102 -228
  727. package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
  728. package/src/feature-libraries/sequence-field/moveEffectTable.ts +8 -195
  729. package/src/feature-libraries/sequence-field/rebase.ts +171 -207
  730. package/src/feature-libraries/sequence-field/replaceRevisions.ts +26 -52
  731. package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +8 -3
  732. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +677 -229
  733. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +56 -70
  734. package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +28 -30
  735. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +21 -131
  736. package/src/feature-libraries/sequence-field/types.ts +40 -79
  737. package/src/feature-libraries/sequence-field/utils.ts +211 -370
  738. package/src/packageVersion.ts +1 -1
  739. package/src/shared-tree/independentView.ts +12 -6
  740. package/src/shared-tree/index.ts +3 -2
  741. package/src/shared-tree/schematizeTree.ts +21 -8
  742. package/src/shared-tree/schematizingTreeView.ts +38 -68
  743. package/src/shared-tree/sharedTree.ts +30 -15
  744. package/src/shared-tree/sharedTreeChangeCodecs.ts +8 -0
  745. package/src/shared-tree/sharedTreeChangeFamily.ts +7 -4
  746. package/src/shared-tree/sharedTreeEditBuilder.ts +43 -8
  747. package/src/shared-tree/treeCheckout.ts +93 -17
  748. package/src/shared-tree-core/branch.ts +8 -2
  749. package/src/shared-tree-core/editManager.ts +16 -2
  750. package/src/shared-tree-core/editManagerCodecs.ts +11 -1
  751. package/src/shared-tree-core/editManagerFormatCommons.ts +6 -0
  752. package/src/shared-tree-core/editManagerFormatV1toV4.ts +3 -1
  753. package/src/shared-tree-core/index.ts +2 -0
  754. package/src/shared-tree-core/messageCodecV1ToV4.ts +2 -1
  755. package/src/shared-tree-core/messageCodecs.ts +11 -1
  756. package/src/shared-tree-core/messageFormat.ts +6 -0
  757. package/src/shared-tree-core/messageFormatV1ToV4.ts +3 -1
  758. package/src/shared-tree-core/sharedTreeCore.ts +4 -1
  759. package/src/simple-tree/core/unhydratedFlexTree.ts +82 -35
  760. package/src/simple-tree/fieldSchema.ts +6 -4
  761. package/src/simple-tree/index.ts +2 -1
  762. package/src/simple-tree/node-kinds/array/arrayNode.ts +7 -5
  763. package/src/simple-tree/node-kinds/common.ts +2 -5
  764. package/src/simple-tree/node-kinds/map/mapNode.ts +4 -4
  765. package/src/simple-tree/node-kinds/object/objectNode.ts +26 -26
  766. package/src/simple-tree/node-kinds/record/recordNode.ts +10 -9
  767. package/src/simple-tree/prepareForInsertion.ts +342 -200
  768. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +35 -15
  769. package/src/treeFactory.ts +16 -4
  770. package/src/util/index.ts +3 -0
  771. package/src/util/rangeMap.ts +68 -26
  772. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
  773. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
  774. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -50
  775. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
  776. package/docs/main/sequence-field/move-composition.md +0 -46
  777. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
  778. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
  779. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -46
  780. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
  781. package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +0 -57
@@ -1 +1 @@
1
- {"version":3,"file":"lazyField.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/lazyField.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AACnE,uEAAsE;AAEtE,kDAe6B;AAC7B,kDAAiE;AACjE,yDAA2D;AAC3D,yDAOoC;AACpC,0DAA4D;AAI5D,yDAc4B;AAC5B,mDAA6C;AAC7C,+CAAmF;AACnF,iDAAuE;AAEvE;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,GAAwD,IAAI,OAAO,EAAE,CAAC;AAEtF,SAAgB,SAAS,CACxB,OAAgB,EAChB,MAA2B,EAC3B,MAA+B;IAE/B,MAAM,WAAW,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;IAC9C,IAAI,UAAU,GAAG,KAAK,CAAC;IAEvB,MAAM,iBAAiB,GAAG,GAAkB,EAAE;QAC7C,UAAU,GAAG,IAAI,CAAC;QAClB,MAAM,KAAK,GAAG,IAAI,CACjB,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,IAAA,eAAI,EAAC,KAAK,CAAC,kCAAkC,CAAC,CACzE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;QACxC,OAAO,KAAK,CAAC;IACd,CAAC,CAAC;IAEF,IAAI,WAAW,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACtC,OAAO,iBAAiB,EAAE,CAAC;IAC5B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\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype AnchorNode,\n\tCursorLocationType,\n\ttype ExclusiveMapTree,\n\ttype FieldAnchor,\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype ITreeCursorSynchronous,\n\ttype ITreeSubscriptionCursor,\n\ttype NormalizedFieldUpPath,\n\ttype TreeNavigationResult,\n\tinCursorNode,\n\titerateCursorField,\n\tmapCursorField,\n\trootFieldKey,\n} from \"../../core/index.js\";\nimport { disposeSymbol, getOrCreate } from \"../../util/index.js\";\nimport { combineChunks } from \"../chunked-forest/index.js\";\nimport {\n\tFieldKinds,\n\tMappedEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\ttype ValueFieldEditBuilder,\n} from \"../default-schema/index.js\";\nimport { cursorForMapTreeField } from \"../mapTreeCursor.js\";\nimport type { FlexFieldKind } from \"../modular-schema/index.js\";\n\nimport type { Context } from \"./context.js\";\nimport {\n\tFlexTreeEntityKind,\n\ttype FlexTreeField,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeUnknownUnboxed,\n\ttype FlexibleFieldContent,\n\ttype FlexibleNodeContent,\n\ttype HydratedFlexTreeNode,\n\tTreeStatus,\n\tflexTreeMarker,\n\tflexTreeSlot,\n} from \"./flexTreeTypes.js\";\nimport { LazyEntity } from \"./lazyEntity.js\";\nimport { type LazyTreeNode, getOrCreateHydratedFlexTreeNode } from \"./lazyNode.js\";\nimport { indexForAt, treeStatusFromAnchorCache } from \"./utilities.js\";\n\n/**\n * Reuse fields.\n * Since field currently own cursors and register themselves for disposal when the node hit end of life,\n * not reusing them results in memory leaks every time the field is accessed.\n * Since the fields stay alive until the node is end of life reusing them this way is safe.\n *\n * This ins't a perfect solution:\n *\n * - This can cause leaks, like map nodes will keep all accessed field objects around. Since other things cause this same leak already, its not too bad.\n * - This does not cache the root.\n * - Finding the parent anchor to do the caching on has significant cost.\n *\n * Despite these limitations, this cache provides a large performance win in some common cases (over 10x), especially with how simple tree requests far more field objects than necessary currently.\n */\nconst fieldCache: WeakMap<LazyTreeNode, Map<FieldKey, FlexTreeField>> = new WeakMap();\n\nexport function makeField(\n\tcontext: Context,\n\tschema: FieldKindIdentifier,\n\tcursor: ITreeSubscriptionCursor,\n): FlexTreeField {\n\tconst fieldAnchor = cursor.buildFieldAnchor();\n\tlet usedAnchor = false;\n\n\tconst makeFlexTreeField = (): FlexTreeField => {\n\t\tusedAnchor = true;\n\t\tconst field = new (\n\t\t\tkindToClass.get(schema) ?? fail(0xb0f /* missing field implementation */)\n\t\t)(context, schema, cursor, fieldAnchor);\n\t\treturn field;\n\t};\n\n\tif (fieldAnchor.parent === undefined) {\n\t\treturn makeFlexTreeField();\n\t}\n\n\t// For the common case (all but roots), cache field associated with its node's anchor and field key.\n\tconst anchorNode =\n\t\tcontext.checkout.forest.anchors.locate(fieldAnchor.parent) ??\n\t\tfail(0xb10 /* missing anchor */);\n\n\t// Since anchor-set could be reused across a flex tree context getting disposed, key off the flex tree node not the anchor.\n\tconst cacheKey = anchorNode.slots.get(flexTreeSlot);\n\n\t// If there is no flex tree parent node, skip caching: this is not expected to be a hot path, but should probably be fixed at some point.\n\tif (cacheKey === undefined) {\n\t\treturn makeFlexTreeField();\n\t}\n\n\tconst innerCache = getOrCreate(\n\t\tfieldCache,\n\t\tcacheKey,\n\t\t() => new Map<FieldKey, FlexTreeField>(),\n\t);\n\tconst result = getOrCreate(innerCache, fieldAnchor.fieldKey, makeFlexTreeField);\n\tif (!usedAnchor) {\n\t\t// The anchor must be disposed to avoid leaking. In the case of a cache hit,\n\t\t// we are not transferring ownership to a new FlexTreeField, so it must be disposed of here to avoid the leak.\n\t\tcontext.checkout.forest.anchors.forget(fieldAnchor.parent);\n\t}\n\treturn result;\n}\n\n/**\n * Base type for fields implementing {@link FlexTreeField} using cursors.\n */\nexport abstract class LazyField extends LazyEntity<FieldAnchor> implements FlexTreeField {\n\tpublic get [flexTreeMarker](): FlexTreeEntityKind.Field {\n\t\treturn FlexTreeEntityKind.Field;\n\t}\n\tpublic readonly key: FieldKey;\n\n\t/**\n\t * If this field ends its lifetime before the Anchor does, this needs to be invoked to avoid a double free\n\t * if/when the Anchor is destroyed.\n\t */\n\tprivate readonly offAfterDestroy?: () => void;\n\n\tpublic constructor(\n\t\tcontext: Context,\n\t\tpublic readonly schema: FieldKindIdentifier,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tfieldAnchor: FieldAnchor,\n\t) {\n\t\tsuper(context, cursor, fieldAnchor);\n\t\tassert(cursor.mode === CursorLocationType.Fields, 0x77b /* must be in fields mode */);\n\t\tthis.key = cursor.getFieldKey();\n\t\t// Fields currently live as long as their parent does.\n\t\t// For root fields, this means forever, but other cases can be cleaned up when their parent anchor is deleted.\n\t\tif (fieldAnchor.parent !== undefined) {\n\t\t\tconst anchorNode =\n\t\t\t\tcontext.checkout.forest.anchors.locate(fieldAnchor.parent) ??\n\t\t\t\tfail(0xb11 /* parent anchor node should always exist since field is under a node */);\n\t\t\tthis.offAfterDestroy = anchorNode.events.on(\"afterDestroy\", () => {\n\t\t\t\tthis[disposeSymbol]();\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic is<TKind2 extends FlexFieldKind>(kind: TKind2): this is FlexTreeTypedField<TKind2> {\n\t\tassert(\n\t\t\tthis.context.schemaPolicy.fieldKinds.get(kind.identifier) === kind,\n\t\t\t0xa26 /* Narrowing must be done to a kind that exists in this context */,\n\t\t);\n\n\t\treturn this.schema === kind.identifier;\n\t}\n\n\tpublic get parent(): HydratedFlexTreeNode | undefined {\n\t\tif (this.anchor.parent === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst cursor = this.cursor;\n\t\tcursor.exitField();\n\t\tconst output = getOrCreateHydratedFlexTreeNode(this.context, cursor);\n\t\tcursor.enterField(this.key);\n\t\treturn output;\n\t}\n\n\tprotected override tryMoveCursorToAnchor(\n\t\tcursor: ITreeSubscriptionCursor,\n\t): TreeNavigationResult {\n\t\treturn this.context.checkout.forest.tryMoveCursorToField(this.anchor, cursor);\n\t}\n\n\tprotected override forgetAnchor(): void {\n\t\tthis.offAfterDestroy?.();\n\t\tif (this.anchor.parent === undefined) return;\n\t\tthis.context.checkout.forest.anchors.forget(this.anchor.parent);\n\t}\n\n\tpublic get length(): number {\n\t\treturn this.cursor.getFieldLength();\n\t}\n\n\tpublic atIndex(index: number): FlexTreeUnknownUnboxed {\n\t\treturn inCursorNode(this.cursor, index, (cursor) =>\n\t\t\tunboxedFlexNode(this.context, cursor, this.anchor),\n\t\t);\n\t}\n\n\tpublic boxedAt(index: number): HydratedFlexTreeNode | undefined {\n\t\tconst finalIndex = indexForAt(index, this.length);\n\n\t\tif (finalIndex === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn inCursorNode(this.cursor, finalIndex, (cursor) =>\n\t\t\tgetOrCreateHydratedFlexTreeNode(this.context, cursor),\n\t\t);\n\t}\n\n\tpublic map<U>(callbackfn: (value: FlexTreeUnknownUnboxed, index: number) => U): U[] {\n\t\treturn mapCursorField(this.cursor, (cursor) =>\n\t\t\tcallbackfn(unboxedFlexNode(this.context, cursor, this.anchor), cursor.fieldIndex),\n\t\t);\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<HydratedFlexTreeNode> {\n\t\treturn iterateCursorField(this.cursor, (cursor) =>\n\t\t\tgetOrCreateHydratedFlexTreeNode(this.context, cursor),\n\t\t);\n\t}\n\n\tpublic getFieldPath(): NormalizedFieldUpPath {\n\t\treturn { parent: this.parent?.anchorNode, field: this.key };\n\t}\n\n\t/**\n\t * Returns the path to this field to use for editing. Throws iff this path is not {@link TreeStatus#InDocument}.\n\t * This path is not valid to hold onto across edits: this must be recalled for each edit.\n\t */\n\tpublic getFieldPathForEditing(): NormalizedFieldUpPath {\n\t\tif (\n\t\t\t!this.isFreed() &&\n\t\t\t// Only allow editing if we are the root document field...\n\t\t\t((this.parent === undefined && this.anchor.fieldKey === rootFieldKey) ||\n\t\t\t\t// ...or are under a node in the document\n\t\t\t\t(this.parent !== undefined &&\n\t\t\t\t\ttreeStatusFromAnchorCache(this.parent.anchorNode) === TreeStatus.InDocument))\n\t\t) {\n\t\t\treturn this.getFieldPath();\n\t\t}\n\n\t\tthrow new UsageError(\"Editing only allowed on fields with TreeStatus.InDocument status\");\n\t}\n\n\tprotected getEditor(): IDefaultEditBuilder<ITreeCursorSynchronous> {\n\t\treturn new MappedEditBuilder(\n\t\t\tthis.context.checkout.editor,\n\t\t\t(cursor: ITreeCursorSynchronous) =>\n\t\t\t\tcombineChunks(this.context.checkout.forest.chunkField(cursor)),\n\t\t);\n\t}\n}\n\nexport class LazySequence extends LazyField implements FlexTreeSequenceField {\n\tpublic at(index: number): FlexTreeUnknownUnboxed | undefined {\n\t\tconst finalIndex = indexForAt(index, this.length);\n\n\t\tif (finalIndex === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn this.atIndex(finalIndex);\n\t}\n\tpublic get asArray(): readonly FlexTreeUnknownUnboxed[] {\n\t\treturn this.map((x) => x);\n\t}\n\n\tpublic editor: SequenceFieldEditBuilder<FlexibleFieldContent> = {\n\t\tinsert: (index, newContent) => {\n\t\t\tthis.sequenceEditor().insert(index, cursorForMapTreeField(newContent));\n\t\t},\n\t\tremove: (index, count) => {\n\t\t\tthis.sequenceEditor().remove(index, count);\n\t\t},\n\t};\n\n\tprivate sequenceEditor(): SequenceFieldEditBuilder<ITreeCursorSynchronous> {\n\t\tconst fieldPath = this.getFieldPathForEditing();\n\t\treturn this.getEditor().sequenceField(fieldPath);\n\t}\n}\n\nexport class LazyValueField extends LazyField implements FlexTreeRequiredField {\n\tpublic editor: ValueFieldEditBuilder<FlexibleNodeContent> = {\n\t\tset: (newContent) => {\n\t\t\tthis.valueFieldEditor().set(cursorForMapTreeField([newContent]));\n\t\t},\n\t};\n\n\tprivate valueFieldEditor(): ValueFieldEditBuilder<ITreeCursorSynchronous> {\n\t\tconst fieldPath = this.getFieldPathForEditing();\n\t\tconst fieldEditor = this.getEditor().valueField(fieldPath);\n\t\treturn fieldEditor;\n\t}\n\n\tpublic get content(): FlexTreeUnknownUnboxed {\n\t\treturn this.atIndex(0);\n\t}\n}\n\nexport class LazyOptionalField extends LazyField implements FlexTreeOptionalField {\n\tpublic editor: OptionalFieldEditBuilder<ExclusiveMapTree> = {\n\t\tset: (newContent, wasEmpty) => {\n\t\t\tthis.optionalEditor().set(\n\t\t\t\tnewContent === undefined ? newContent : cursorForMapTreeField([newContent]),\n\t\t\t\twasEmpty,\n\t\t\t);\n\t\t},\n\t};\n\n\tprivate optionalEditor(): OptionalFieldEditBuilder<ITreeCursorSynchronous> {\n\t\tconst fieldPath = this.getFieldPathForEditing();\n\t\tconst fieldEditor = this.getEditor().optionalField(fieldPath);\n\t\treturn fieldEditor;\n\t}\n\n\tpublic get content(): FlexTreeUnknownUnboxed | undefined {\n\t\treturn this.length === 0 ? undefined : this.atIndex(0);\n\t}\n}\n\nexport class LazyForbiddenField extends LazyField {}\n\ntype Builder = new (\n\tcontext: Context,\n\t// Correct use of these builders requires the builder of the matching type to be used.\n\tschema: FieldKindIdentifier,\n\tcursor: ITreeSubscriptionCursor,\n\tfieldAnchor: FieldAnchor,\n) => LazyField;\n\nconst builderList: [FieldKindIdentifier, Builder][] = [\n\t[FieldKinds.forbidden.identifier, LazyForbiddenField],\n\t[FieldKinds.optional.identifier, LazyOptionalField],\n\t[FieldKinds.sequence.identifier, LazySequence],\n\t[FieldKinds.required.identifier, LazyValueField],\n\t[FieldKinds.identifier.identifier, LazyValueField],\n];\n\nconst kindToClass: ReadonlyMap<FieldKindIdentifier, Builder> = new Map(builderList);\n\n/**\n * Returns the flex tree node, or the value if it has one.\n */\nexport function unboxedFlexNode(\n\tcontext: Context,\n\tcursor: ITreeSubscriptionCursor,\n\tfieldAnchor: FieldAnchor,\n): FlexTreeUnknownUnboxed {\n\tconst value = cursor.value;\n\tif (value !== undefined) {\n\t\treturn value;\n\t}\n\n\t// Try accessing cached child node via anchors.\n\t// This avoids O(depth) related costs from getOrCreateHydratedFlexTreeNode in the cached case.\n\tconst anchor = fieldAnchor.parent;\n\tlet child: AnchorNode | undefined;\n\tif (anchor === undefined) {\n\t\tchild = context.checkout.forest.anchors.find({\n\t\t\tparent: undefined,\n\t\t\tparentField: fieldAnchor.fieldKey,\n\t\t\tparentIndex: cursor.fieldIndex,\n\t\t});\n\t} else {\n\t\tconst anchorNode = context.checkout.forest.anchors.locate(anchor);\n\t\tassert(anchorNode !== undefined, 0xa4c /* missing anchor */);\n\t\tchild = anchorNode.childIfAnchored(fieldAnchor.fieldKey, cursor.fieldIndex);\n\t}\n\n\tif (child !== undefined) {\n\t\tconst cached = child.slots.get(flexTreeSlot);\n\t\tif (cached !== undefined) {\n\t\t\treturn cached;\n\t\t}\n\t}\n\n\treturn getOrCreateHydratedFlexTreeNode(context, cursor);\n}\n"]}
1
+ {"version":3,"file":"lazyField.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/lazyField.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AACnE,uEAAsE;AAEtE,kDAc6B;AAC7B,kDAAiE;AACjE,yDAA2D;AAC3D,yDASoC;AACpC,0DAAyF;AAIzF,yDAe4B;AAC5B,mDAA6C;AAC7C,+CAA8E;AAC9E,iDAAuE;AAEvE;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,GAAwD,IAAI,OAAO,EAAE,CAAC;AAEtF,SAAgB,SAAS,CACxB,OAAgB,EAChB,MAA2B,EAC3B,MAA+B;IAE/B,MAAM,WAAW,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;IAC9C,IAAI,UAAU,GAAG,KAAK,CAAC;IAEvB,MAAM,iBAAiB,GAAG,GAAkB,EAAE;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,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IAC7E,CAAC;IAED,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,+BAAY,CAAC,CAAC;QAC7C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,MAAM,CAAC;QACf,CAAC;IACF,CAAC;IAED,OAAO,IAAA,6CAA+B,EAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AACzD,CAAC;AAlCD,0CAkCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype AnchorNode,\n\tCursorLocationType,\n\ttype FieldAnchor,\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype ITreeCursorSynchronous,\n\ttype ITreeSubscriptionCursor,\n\ttype NormalizedFieldUpPath,\n\ttype TreeNavigationResult,\n\tinCursorNode,\n\titerateCursorField,\n\tmapCursorField,\n\trootFieldKey,\n} from \"../../core/index.js\";\nimport { disposeSymbol, getOrCreate } from \"../../util/index.js\";\nimport { combineChunks } from \"../chunked-forest/index.js\";\nimport {\n\tFieldKinds,\n\tMappedEditBuilder,\n\ttype SequenceFieldEditor,\n\ttype RequiredFieldEditor,\n\ttype DataEditor,\n\ttype OptionalFieldEditor,\n\ttype DetachedRootLocation,\n\ttype DetachedRootsLocation,\n} from \"../default-schema/index.js\";\nimport { cursorForMapTreeField, type MinimalMapTreeNodeView } from \"../mapTreeCursor.js\";\nimport type { FlexFieldKind } from \"../modular-schema/index.js\";\n\nimport type { Context } from \"./context.js\";\nimport {\n\tFlexTreeEntityKind,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeUnknownUnboxed,\n\ttype FlexibleFieldContent,\n\ttype FlexibleNodeContent,\n\ttype HydratedFlexTreeNode,\n\tTreeStatus,\n\tflexTreeMarker,\n\tflexTreeSlot,\n} from \"./flexTreeTypes.js\";\nimport { LazyEntity } from \"./lazyEntity.js\";\nimport { LazyTreeNode, getOrCreateHydratedFlexTreeNode } from \"./lazyNode.js\";\nimport { indexForAt, treeStatusFromAnchorCache } from \"./utilities.js\";\n\n/**\n * Reuse fields.\n * Since field currently own cursors and register themselves for disposal when the node hit end of life,\n * not reusing them results in memory leaks every time the field is accessed.\n * Since the fields stay alive until the node is end of life reusing them this way is safe.\n *\n * This ins't a perfect solution:\n *\n * - This can cause leaks, like map nodes will keep all accessed field objects around. Since other things cause this same leak already, its not too bad.\n * - This does not cache the root.\n * - Finding the parent anchor to do the caching on has significant cost.\n *\n * Despite these limitations, this cache provides a large performance win in some common cases (over 10x), especially with how simple tree requests far more field objects than necessary currently.\n */\nconst fieldCache: WeakMap<LazyTreeNode, Map<FieldKey, FlexTreeField>> = new WeakMap();\n\nexport function makeField(\n\tcontext: Context,\n\tschema: FieldKindIdentifier,\n\tcursor: ITreeSubscriptionCursor,\n): FlexTreeField {\n\tconst fieldAnchor = cursor.buildFieldAnchor();\n\tlet usedAnchor = false;\n\n\tconst makeFlexTreeField = (): FlexTreeField => {\n\t\tusedAnchor = true;\n\t\tconst field = new (\n\t\t\tkindToClass.get(schema) ?? fail(0xb0f /* missing field implementation */)\n\t\t)(context, schema, cursor, fieldAnchor);\n\t\treturn field;\n\t};\n\n\tif (fieldAnchor.parent === undefined) {\n\t\treturn makeFlexTreeField();\n\t}\n\n\t// For the common case (all but roots), cache field associated with its node's anchor and field key.\n\tconst anchorNode =\n\t\tcontext.checkout.forest.anchors.locate(fieldAnchor.parent) ??\n\t\tfail(0xb10 /* missing anchor */);\n\n\t// Since anchor-set could be reused across a flex tree context getting disposed, key off the flex tree node not the anchor.\n\tconst cacheKey = anchorNode.slots.get(flexTreeSlot);\n\n\t// If there is no flex tree parent node, skip caching: this is not expected to be a hot path, but should probably be fixed at some point.\n\tif (cacheKey === undefined) {\n\t\treturn makeFlexTreeField();\n\t}\n\n\tconst innerCache = getOrCreate(\n\t\tfieldCache,\n\t\tcacheKey,\n\t\t() => new Map<FieldKey, FlexTreeField>(),\n\t);\n\tconst result = getOrCreate(innerCache, fieldAnchor.fieldKey, makeFlexTreeField);\n\tif (!usedAnchor) {\n\t\t// The anchor must be disposed to avoid leaking. In the case of a cache hit,\n\t\t// we are not transferring ownership to a new FlexTreeField, so it must be disposed of here to avoid the leak.\n\t\tcontext.checkout.forest.anchors.forget(fieldAnchor.parent);\n\t}\n\treturn result;\n}\n\n/**\n * Base type for fields implementing {@link FlexTreeField} using cursors.\n */\nexport abstract class LazyField extends LazyEntity<FieldAnchor> implements FlexTreeField {\n\tpublic get [flexTreeMarker](): FlexTreeEntityKind.Field {\n\t\treturn FlexTreeEntityKind.Field;\n\t}\n\tpublic readonly key: FieldKey;\n\n\t/**\n\t * If this field ends its lifetime before the Anchor does, this needs to be invoked to avoid a double free\n\t * if/when the Anchor is destroyed.\n\t */\n\tprivate readonly offAfterDestroy?: () => void;\n\n\tpublic constructor(\n\t\tcontext: Context,\n\t\tpublic readonly schema: FieldKindIdentifier,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tfieldAnchor: FieldAnchor,\n\t) {\n\t\tsuper(context, cursor, fieldAnchor);\n\t\tassert(cursor.mode === CursorLocationType.Fields, 0x77b /* must be in fields mode */);\n\t\tthis.key = cursor.getFieldKey();\n\t\t// Fields currently live as long as their parent does.\n\t\t// For root fields, this means forever, but other cases can be cleaned up when their parent anchor is deleted.\n\t\tif (fieldAnchor.parent !== undefined) {\n\t\t\tconst anchorNode =\n\t\t\t\tcontext.checkout.forest.anchors.locate(fieldAnchor.parent) ??\n\t\t\t\tfail(0xb11 /* parent anchor node should always exist since field is under a node */);\n\t\t\tthis.offAfterDestroy = anchorNode.events.on(\"afterDestroy\", () => {\n\t\t\t\tthis[disposeSymbol]();\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic is<TKind2 extends FlexFieldKind>(kind: TKind2): this is FlexTreeTypedField<TKind2> {\n\t\tassert(\n\t\t\tthis.context.schemaPolicy.fieldKinds.get(kind.identifier) === kind,\n\t\t\t0xa26 /* Narrowing must be done to a kind that exists in this context */,\n\t\t);\n\n\t\treturn this.schema === kind.identifier;\n\t}\n\n\tpublic get parent(): HydratedFlexTreeNode | undefined {\n\t\tif (this.anchor.parent === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst cursor = this.cursor;\n\t\tcursor.exitField();\n\t\tconst output = getOrCreateHydratedFlexTreeNode(this.context, cursor);\n\t\tcursor.enterField(this.key);\n\t\treturn output;\n\t}\n\n\tprotected override tryMoveCursorToAnchor(\n\t\tcursor: ITreeSubscriptionCursor,\n\t): TreeNavigationResult {\n\t\treturn this.context.checkout.forest.tryMoveCursorToField(this.anchor, cursor);\n\t}\n\n\tprotected override forgetAnchor(): void {\n\t\tthis.offAfterDestroy?.();\n\t\tif (this.anchor.parent === undefined) return;\n\t\tthis.context.checkout.forest.anchors.forget(this.anchor.parent);\n\t}\n\n\tpublic get length(): number {\n\t\treturn this.cursor.getFieldLength();\n\t}\n\n\tpublic atIndex(index: number): FlexTreeUnknownUnboxed {\n\t\treturn inCursorNode(this.cursor, index, (cursor) =>\n\t\t\tunboxedFlexNode(this.context, cursor, this.anchor),\n\t\t);\n\t}\n\n\tpublic boxedAt(index: number): HydratedFlexTreeNode | undefined {\n\t\tconst finalIndex = indexForAt(index, this.length);\n\n\t\tif (finalIndex === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn inCursorNode(this.cursor, finalIndex, (cursor) =>\n\t\t\tgetOrCreateHydratedFlexTreeNode(this.context, cursor),\n\t\t);\n\t}\n\n\tpublic map<U>(callbackfn: (value: FlexTreeUnknownUnboxed, index: number) => U): U[] {\n\t\treturn mapCursorField(this.cursor, (cursor) =>\n\t\t\tcallbackfn(unboxedFlexNode(this.context, cursor, this.anchor), cursor.fieldIndex),\n\t\t);\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<HydratedFlexTreeNode> {\n\t\treturn iterateCursorField(this.cursor, (cursor) =>\n\t\t\tgetOrCreateHydratedFlexTreeNode(this.context, cursor),\n\t\t);\n\t}\n\n\tpublic getFieldPath(): NormalizedFieldUpPath {\n\t\treturn { parent: this.parent?.anchorNode, field: this.key };\n\t}\n\n\t/**\n\t * Returns the path to this field to use for editing. Throws iff this path is not {@link TreeStatus#InDocument}.\n\t * This path is not valid to hold onto across edits: this must be recalled for each edit.\n\t */\n\tpublic getFieldPathForEditing(): NormalizedFieldUpPath {\n\t\tif (!this.isFreed()) {\n\t\t\t// Only allow editing if we are the root document field...\n\t\t\tif (this.parent === undefined && this.anchor.fieldKey === rootFieldKey) {\n\t\t\t\treturn this.getFieldPath();\n\t\t\t}\n\t\t\t// ...or are under a node in the document\n\t\t\tif (this.parent !== undefined) {\n\t\t\t\tconst status = treeStatusFromAnchorCache(this.parent.anchorNode);\n\t\t\t\tif (status === TreeStatus.InDocument || status === TreeStatus.Removed) {\n\t\t\t\t\treturn this.getFieldPath();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthrow new UsageError(\"Editing only allowed on fields with TreeStatus.InDocument status\");\n\t}\n\n\tprotected getEditor(): DataEditor<\n\t\tITreeCursorSynchronous,\n\t\tDetachedRootLocation,\n\t\tDetachedRootsLocation\n\t> {\n\t\treturn new MappedEditBuilder(\n\t\t\tthis.context.checkout.editor,\n\t\t\t(cursor: ITreeCursorSynchronous) =>\n\t\t\t\tcombineChunks(this.context.checkout.forest.chunkField(cursor)),\n\t\t);\n\t}\n}\n\nfunction fieldFromNode(node: FlexTreeNode): FieldKey {\n\tassert(node instanceof LazyTreeNode, \"Invalid tree type\");\n\treturn node.anchorNode.parentField;\n}\n\nexport class LazySequence extends LazyField implements FlexTreeSequenceField {\n\tpublic at(index: number): FlexTreeUnknownUnboxed | undefined {\n\t\tconst finalIndex = indexForAt(index, this.length);\n\n\t\tif (finalIndex === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn this.atIndex(finalIndex);\n\t}\n\tpublic get asArray(): readonly FlexTreeUnknownUnboxed[] {\n\t\treturn this.map((x) => x);\n\t}\n\n\tpublic editor: SequenceFieldEditor<FlexibleFieldContent, readonly FlexTreeNode[]> = {\n\t\tinsert: (index, newContent) => {\n\t\t\tthis.sequenceEditor().insert(index, cursorForMapTreeField(newContent));\n\t\t},\n\t\tremove: (index, count) => {\n\t\t\tthis.sequenceEditor().remove(index, count);\n\t\t},\n\t\tattach: (index, content) => {\n\t\t\tconst contentLocations: DetachedRootsLocation = content.map((node) => ({\n\t\t\t\tfield: fieldFromNode(node),\n\t\t\t\tcount: 1,\n\t\t\t}));\n\t\t\tthis.sequenceEditor().attach(index, contentLocations);\n\t\t},\n\t};\n\n\tprivate sequenceEditor(): SequenceFieldEditor<\n\t\tITreeCursorSynchronous,\n\t\tDetachedRootsLocation\n\t> {\n\t\tconst fieldPath = this.getFieldPathForEditing();\n\t\treturn this.getEditor().sequenceField(fieldPath);\n\t}\n}\n\nexport class LazyValueField extends LazyField implements FlexTreeRequiredField {\n\tpublic editor: RequiredFieldEditor<FlexibleNodeContent, FlexTreeNode> = {\n\t\tset: (newContent) => {\n\t\t\tthis.valueFieldEditor().set(cursorForMapTreeField([newContent]));\n\t\t},\n\t\tattach: (content) => {\n\t\t\tconst root = fieldFromNode(content);\n\t\t\tthis.valueFieldEditor().attach(root);\n\t\t},\n\t};\n\n\tprivate valueFieldEditor(): RequiredFieldEditor<\n\t\tITreeCursorSynchronous,\n\t\tDetachedRootLocation\n\t> {\n\t\tconst fieldPath = this.getFieldPathForEditing();\n\t\treturn this.getEditor().valueField(fieldPath);\n\t}\n\n\tpublic get content(): FlexTreeUnknownUnboxed {\n\t\treturn this.atIndex(0);\n\t}\n}\n\nexport class LazyOptionalField extends LazyField implements FlexTreeOptionalField {\n\tpublic editor: OptionalFieldEditor<MinimalMapTreeNodeView, FlexTreeNode> = {\n\t\tset: (newContent, wasEmpty) => {\n\t\t\tthis.optionalEditor().set(\n\t\t\t\tnewContent === undefined ? newContent : cursorForMapTreeField([newContent]),\n\t\t\t\twasEmpty,\n\t\t\t);\n\t\t},\n\t\tattach: (content, wasEmpty) => {\n\t\t\tif (content === undefined) {\n\t\t\t\tthis.optionalEditor().clear(wasEmpty);\n\t\t\t} else {\n\t\t\t\tconst root = fieldFromNode(content);\n\t\t\t\tthis.optionalEditor().attach(root, wasEmpty);\n\t\t\t}\n\t\t},\n\t\tclear: (wasEmpty) => {\n\t\t\tthis.optionalEditor().clear(wasEmpty);\n\t\t},\n\t};\n\n\tprivate optionalEditor(): OptionalFieldEditor<ITreeCursorSynchronous, DetachedRootLocation> {\n\t\tconst fieldPath = this.getFieldPathForEditing();\n\t\tconst fieldEditor = this.getEditor().optionalField(fieldPath);\n\t\treturn fieldEditor;\n\t}\n\n\tpublic get content(): FlexTreeUnknownUnboxed | undefined {\n\t\treturn this.length === 0 ? undefined : this.atIndex(0);\n\t}\n}\n\nexport class LazyForbiddenField extends LazyField {}\n\ntype Builder = new (\n\tcontext: Context,\n\t// Correct use of these builders requires the builder of the matching type to be used.\n\tschema: FieldKindIdentifier,\n\tcursor: ITreeSubscriptionCursor,\n\tfieldAnchor: FieldAnchor,\n) => LazyField;\n\nconst builderList: [FieldKindIdentifier, Builder][] = [\n\t[FieldKinds.forbidden.identifier, LazyForbiddenField],\n\t[FieldKinds.optional.identifier, LazyOptionalField],\n\t[FieldKinds.sequence.identifier, LazySequence],\n\t[FieldKinds.required.identifier, LazyValueField],\n\t[FieldKinds.identifier.identifier, LazyValueField],\n];\n\nconst kindToClass: ReadonlyMap<FieldKindIdentifier, Builder> = new Map(builderList);\n\n/**\n * Returns the flex tree node, or the value if it has one.\n */\nexport function unboxedFlexNode(\n\tcontext: Context,\n\tcursor: ITreeSubscriptionCursor,\n\tfieldAnchor: FieldAnchor,\n): FlexTreeUnknownUnboxed {\n\tconst value = cursor.value;\n\tif (value !== undefined) {\n\t\treturn value;\n\t}\n\n\t// Try accessing cached child node via anchors.\n\t// This avoids O(depth) related costs from getOrCreateHydratedFlexTreeNode in the cached case.\n\tconst anchor = fieldAnchor.parent;\n\tlet child: AnchorNode | undefined;\n\tif (anchor === undefined) {\n\t\tchild = context.checkout.forest.anchors.find({\n\t\t\tparent: undefined,\n\t\t\tparentField: fieldAnchor.fieldKey,\n\t\t\tparentIndex: cursor.fieldIndex,\n\t\t});\n\t} else {\n\t\tconst anchorNode = context.checkout.forest.anchors.locate(anchor);\n\t\tassert(anchorNode !== undefined, 0xa4c /* missing anchor */);\n\t\tchild = anchorNode.childIfAnchored(fieldAnchor.fieldKey, cursor.fieldIndex);\n\t}\n\n\tif (child !== undefined) {\n\t\tconst cached = child.slots.get(flexTreeSlot);\n\t\tif (cached !== undefined) {\n\t\t\treturn cached;\n\t\t}\n\t}\n\n\treturn getOrCreateHydratedFlexTreeNode(context, cursor);\n}\n"]}
@@ -12,11 +12,11 @@ export { stackTreeNodeCursor, type CursorAdapter, prefixPath, prefixFieldPath, t
12
12
  export { cursorForJsonableTreeNode, cursorForJsonableTreeField, jsonableTreeFromCursor, jsonableTreeFromFieldCursor, jsonableTreeFromForest, } from "./treeTextCursor.js";
13
13
  import * as SequenceField from "./sequence-field/index.js";
14
14
  export { SequenceField };
15
- export { isNeverField, ModularEditBuilder, type FieldEditDescription as EditDescription, type FieldChangeHandler, type FieldChangeRebaser, type FieldEditor, type FieldChangeMap, type FieldChange, type FieldChangeset, type ToDelta, type ModularChangeset, makeModularChangeCodecFamily, type NodeChangeComposer, type NodeChangeInverter, type NodeChangeRebaser, type NodeChangePruner, type CrossFieldManager, CrossFieldTarget, FlexFieldKind, type FullSchemaPolicy, allowsRepoSuperset, type GenericChangeset, genericFieldKind, type HasFieldChanges, type NodeExistsConstraint, ModularChangeFamily, type RelevantRemovedRootsFromChild, EncodedModularChangesetV1, EncodedModularChangesetV2, updateRefreshers, type NodeId, type FieldChangeEncodingContext, type FieldKindConfiguration, type FieldKindConfigurationEntry, isNeverTree, DefaultRevisionReplacer, ModularChangeFormatVersion, } from "./modular-schema/index.js";
16
- export { mapRootChanges } from "./deltaUtils.js";
15
+ export { isNeverField, ModularEditBuilder, type FieldEditDescription as EditDescription, type FieldChangeHandler, type FieldChangeRebaser, type FieldEditor, type FieldChangeMap, type FieldChange, type FieldChangeset, type ToDelta, type ModularChangeset, makeModularChangeCodecFamily, type NodeChangeComposer, type NodeChangeInverter, type NodeChangeRebaser, type NodeChangePruner, type ComposeNodeManager, type InvertNodeManager, type RebaseNodeManager, NodeMoveType, FlexFieldKind, type FullSchemaPolicy, allowsRepoSuperset, type GenericChangeset, genericFieldKind, type HasFieldChanges, type NodeExistsConstraint, ModularChangeFamily, EncodedModularChangesetV1, EncodedModularChangesetV2, updateRefreshers, type NodeId, type FieldChangeEncodingContext, type FieldKindConfiguration, type FieldKindConfigurationEntry, isNeverTree, DefaultRevisionReplacer, ModularChangeFormatVersion, } from "./modular-schema/index.js";
16
+ export { mapRootChanges, nodeIdFromChangeAtom, changeAtomFromDetachedNodeId, } from "./deltaUtils.js";
17
17
  export { type TreeChunk, chunkTree, chunkField, chunkFieldSingle, buildChunkedForest, defaultChunkPolicy, type FieldBatch, type FieldBatchCodec, FieldBatchFormatVersion, getCodecTreeForFieldBatchFormat, makeTreeChunker, makeFieldBatchCodec, type FieldBatchEncodingContext, emptyChunk, combineChunks, type IncrementalEncodingPolicy, defaultIncrementalEncodingPolicy, } from "./chunked-forest/index.js";
18
18
  export { compareLocalNodeIdentifiers, createNodeIdentifierManager, isStableNodeIdentifier, type LocalNodeIdentifier, MockNodeIdentifierManager, type NodeIdentifierManager, nodeKeyTreeIdentifier, type StableNodeIdentifier, } from "./node-identifier/index.js";
19
- export { FieldKinds, type DefaultChangeset, DefaultChangeFamily, DefaultEditBuilder, type IDefaultEditBuilder, type ValueFieldEditBuilder, type OptionalFieldEditBuilder, type SequenceFieldEditBuilder, defaultSchemaPolicy, fieldKinds, fieldKindConfigurations, intoDelta, relevantRemovedRoots, getCodecTreeForModularChangeFormat, } from "./default-schema/index.js";
19
+ export { FieldKinds, type DefaultChangeset, type DetachedRootIds, DefaultChangeFamily, type IdBasedChangeFamilyDataEditor, DefaultIdBasedDataEditor, type DataEditor, type RequiredFieldEditor, type OptionalFieldEditor, type SequenceFieldEditor, defaultSchemaPolicy, fieldKinds, fieldKindConfigurations, intoDelta, relevantRemovedRoots, type DetachedRootLocation, type DetachedRootsLocation, type DetachedRootIdRange, type Locator, LocationBasedDataEditor, type ILocationBasedDataEditor, getCodecTreeForModularChangeFormat, } from "./default-schema/index.js";
20
20
  export { SchemaValidationError, isNodeInSchema, isFieldInSchema, throwOutOfSchema, } from "./schemaChecker.js";
21
21
  export { type FlexTreeOptionalField, type FlexTreeRequiredField, type FlexTreeSequenceField, type FlexTreeContext, type FlexTreeHydratedContext, type FlexTreeTypedField, type FlexTreeEntity, type FlexTreeField, type FlexTreeNode, TreeStatus, Context, type FlexTreeNodeEvents, type FlexTreeUnknownUnboxed, isFlexTreeNode, ContextSlot, flexTreeMarker, assertFlexTreeEntityNotFreed, flexTreeSlot, getSchemaAndPolicy, LazyEntity, treeStatusFromAnchorCache, indexForAt, FlexTreeEntityKind, type FlexibleNodeContent, type FlexibleFieldContent, type FlexTreeHydratedContextMinimal, type HydratedFlexTreeNode, getOrCreateHydratedFlexTreeNode, currentObserver, withObservation, type Observer, } from "./flex-tree/index.js";
22
22
  export { TreeCompressionStrategy } from "./treeCompressionUtils.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,QAAQ,EACb,UAAU,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBA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AuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,UAAU,EACV,OAAO,EACP,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,cAAc,EACd,WAAW,EAEX,cAAc,EACd,4BAA4B,EAC5B,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,yBAAyB,EACzB,UAAU,EACV,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACnC,KAAK,oBAAoB,EACzB,+BAA+B,EAC/B,eAAe,EACf,eAAe,EACf,KAAK,QAAQ,GACb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,OAAO,EACN,KAAK,YAAY,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,iCAAiC,GACjC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EACN,KAAK,SAAS,EACd,eAAe,EACf,UAAU,EACV,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,cAAc,GACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,KAAK,iBAAiB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GACpB,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,QAAQ,EACb,UAAU,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EAC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ChB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACN,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,UAAU,EACV,OAAO,EACP,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,cAAc,EACd,WAAW,EAEX,cAAc,EACd,4BAA4B,EAC5B,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,yBAAyB,EACzB,UAAU,EACV,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACnC,KAAK,oBAAoB,EACzB,+BAA+B,EAC/B,eAAe,EACf,eAAe,EACf,KAAK,QAAQ,GACb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,OAAO,EACN,KAAK,YAAY,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,iCAAiC,GACjC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EACN,KAAK,SAAS,EACd,eAAe,EACf,UAAU,EACV,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,cAAc,GACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,KAAK,iBAAiB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GACpB,MAAM,wBAAwB,CAAC"}
@@ -27,8 +27,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
27
27
  return result;
28
28
  };
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.makeTreeChunker = exports.getCodecTreeForFieldBatchFormat = exports.FieldBatchFormatVersion = exports.defaultChunkPolicy = exports.buildChunkedForest = exports.chunkFieldSingle = exports.chunkField = exports.chunkTree = exports.mapRootChanges = exports.ModularChangeFormatVersion = exports.DefaultRevisionReplacer = exports.isNeverTree = exports.updateRefreshers = exports.EncodedModularChangesetV2 = exports.EncodedModularChangesetV1 = exports.ModularChangeFamily = exports.genericFieldKind = exports.allowsRepoSuperset = exports.FlexFieldKind = exports.CrossFieldTarget = exports.makeModularChangeCodecFamily = exports.ModularEditBuilder = exports.isNeverField = exports.SequenceField = exports.jsonableTreeFromForest = exports.jsonableTreeFromFieldCursor = exports.jsonableTreeFromCursor = exports.cursorForJsonableTreeField = exports.cursorForJsonableTreeNode = exports.stackTreeFieldCursor = exports.prefixFieldPath = exports.prefixPath = exports.stackTreeNodeCursor = exports.schemaCodecBuilder = exports.makeSchemaCodec = exports.SchemaSummarizer = exports.buildForest = exports.mapTreeWithField = exports.mapTreeFieldsWithField = exports.mapTreeFieldFromCursor = exports.mapTreeFromCursor = exports.cursorForMapTreeNode = exports.cursorForMapTreeField = exports.ForestFormatVersion = exports.getCodecTreeForForestFormat = exports.ForestSummarizer = exports.isTreeValue = exports.assertAllowedValue = exports.allowsValue = exports.toDownPath = void 0;
31
- exports.setInChangeAtomIdMap = exports.getFromChangeAtomIdMap = exports.newChangeAtomIdBTree = exports.hasElement = exports.AnchorTreeIndex = exports.makeMitigatedChangeFamily = exports.getCodecTreeForSchemaChangeFormat = exports.EncodedSchemaChange = exports.makeSchemaChangeCodecs = exports.DetachedFieldIndexSummarizer = exports.valueSchemaAllows = exports.TreeCompressionStrategy = exports.withObservation = exports.currentObserver = exports.getOrCreateHydratedFlexTreeNode = exports.FlexTreeEntityKind = exports.indexForAt = exports.treeStatusFromAnchorCache = exports.LazyEntity = exports.getSchemaAndPolicy = exports.flexTreeSlot = exports.assertFlexTreeEntityNotFreed = exports.flexTreeMarker = exports.ContextSlot = exports.isFlexTreeNode = exports.Context = exports.TreeStatus = exports.throwOutOfSchema = exports.isFieldInSchema = exports.isNodeInSchema = exports.SchemaValidationError = exports.getCodecTreeForModularChangeFormat = exports.relevantRemovedRoots = exports.intoDelta = exports.fieldKindConfigurations = exports.fieldKinds = exports.defaultSchemaPolicy = exports.DefaultEditBuilder = exports.DefaultChangeFamily = exports.FieldKinds = exports.nodeKeyTreeIdentifier = exports.MockNodeIdentifierManager = exports.isStableNodeIdentifier = exports.createNodeIdentifierManager = exports.compareLocalNodeIdentifiers = exports.defaultIncrementalEncodingPolicy = exports.combineChunks = exports.emptyChunk = exports.makeFieldBatchCodec = void 0;
30
+ exports.FieldBatchFormatVersion = exports.defaultChunkPolicy = exports.buildChunkedForest = exports.chunkFieldSingle = exports.chunkField = exports.chunkTree = exports.changeAtomFromDetachedNodeId = exports.nodeIdFromChangeAtom = exports.mapRootChanges = exports.ModularChangeFormatVersion = exports.DefaultRevisionReplacer = exports.isNeverTree = exports.updateRefreshers = exports.EncodedModularChangesetV2 = exports.EncodedModularChangesetV1 = exports.ModularChangeFamily = exports.genericFieldKind = exports.allowsRepoSuperset = exports.FlexFieldKind = exports.NodeMoveType = exports.makeModularChangeCodecFamily = exports.ModularEditBuilder = exports.isNeverField = exports.SequenceField = exports.jsonableTreeFromForest = exports.jsonableTreeFromFieldCursor = exports.jsonableTreeFromCursor = exports.cursorForJsonableTreeField = exports.cursorForJsonableTreeNode = exports.stackTreeFieldCursor = exports.prefixFieldPath = exports.prefixPath = exports.stackTreeNodeCursor = exports.schemaCodecBuilder = exports.makeSchemaCodec = exports.SchemaSummarizer = exports.buildForest = exports.mapTreeWithField = exports.mapTreeFieldsWithField = exports.mapTreeFieldFromCursor = exports.mapTreeFromCursor = exports.cursorForMapTreeNode = exports.cursorForMapTreeField = exports.ForestFormatVersion = exports.getCodecTreeForForestFormat = exports.ForestSummarizer = exports.isTreeValue = exports.assertAllowedValue = exports.allowsValue = exports.toDownPath = void 0;
31
+ exports.newChangeAtomIdBTree = exports.hasElement = exports.AnchorTreeIndex = exports.makeMitigatedChangeFamily = exports.getCodecTreeForSchemaChangeFormat = exports.EncodedSchemaChange = exports.makeSchemaChangeCodecs = exports.DetachedFieldIndexSummarizer = exports.valueSchemaAllows = exports.TreeCompressionStrategy = exports.withObservation = exports.currentObserver = exports.getOrCreateHydratedFlexTreeNode = exports.FlexTreeEntityKind = exports.indexForAt = exports.treeStatusFromAnchorCache = exports.LazyEntity = exports.getSchemaAndPolicy = exports.flexTreeSlot = exports.assertFlexTreeEntityNotFreed = exports.flexTreeMarker = exports.ContextSlot = exports.isFlexTreeNode = exports.Context = exports.TreeStatus = exports.throwOutOfSchema = exports.isFieldInSchema = exports.isNodeInSchema = exports.SchemaValidationError = exports.getCodecTreeForModularChangeFormat = exports.LocationBasedDataEditor = exports.relevantRemovedRoots = exports.intoDelta = exports.fieldKindConfigurations = exports.fieldKinds = exports.defaultSchemaPolicy = exports.DefaultIdBasedDataEditor = exports.DefaultChangeFamily = exports.FieldKinds = exports.nodeKeyTreeIdentifier = exports.MockNodeIdentifierManager = exports.isStableNodeIdentifier = exports.createNodeIdentifierManager = exports.compareLocalNodeIdentifiers = exports.defaultIncrementalEncodingPolicy = exports.combineChunks = exports.emptyChunk = exports.makeFieldBatchCodec = exports.makeTreeChunker = exports.getCodecTreeForFieldBatchFormat = void 0;
32
+ exports.setInChangeAtomIdMap = exports.getFromChangeAtomIdMap = void 0;
32
33
  var editableTreeBinder_js_1 = require("./editableTreeBinder.js");
33
34
  Object.defineProperty(exports, "toDownPath", { enumerable: true, get: function () { return editableTreeBinder_js_1.toDownPath; } });
34
35
  var valueUtilities_js_1 = require("./valueUtilities.js");
@@ -69,7 +70,7 @@ var index_js_4 = require("./modular-schema/index.js");
69
70
  Object.defineProperty(exports, "isNeverField", { enumerable: true, get: function () { return index_js_4.isNeverField; } });
70
71
  Object.defineProperty(exports, "ModularEditBuilder", { enumerable: true, get: function () { return index_js_4.ModularEditBuilder; } });
71
72
  Object.defineProperty(exports, "makeModularChangeCodecFamily", { enumerable: true, get: function () { return index_js_4.makeModularChangeCodecFamily; } });
72
- Object.defineProperty(exports, "CrossFieldTarget", { enumerable: true, get: function () { return index_js_4.CrossFieldTarget; } });
73
+ Object.defineProperty(exports, "NodeMoveType", { enumerable: true, get: function () { return index_js_4.NodeMoveType; } });
73
74
  Object.defineProperty(exports, "FlexFieldKind", { enumerable: true, get: function () { return index_js_4.FlexFieldKind; } });
74
75
  Object.defineProperty(exports, "allowsRepoSuperset", { enumerable: true, get: function () { return index_js_4.allowsRepoSuperset; } });
75
76
  Object.defineProperty(exports, "genericFieldKind", { enumerable: true, get: function () { return index_js_4.genericFieldKind; } });
@@ -82,6 +83,8 @@ Object.defineProperty(exports, "DefaultRevisionReplacer", { enumerable: true, ge
82
83
  Object.defineProperty(exports, "ModularChangeFormatVersion", { enumerable: true, get: function () { return index_js_4.ModularChangeFormatVersion; } });
83
84
  var deltaUtils_js_1 = require("./deltaUtils.js");
84
85
  Object.defineProperty(exports, "mapRootChanges", { enumerable: true, get: function () { return deltaUtils_js_1.mapRootChanges; } });
86
+ Object.defineProperty(exports, "nodeIdFromChangeAtom", { enumerable: true, get: function () { return deltaUtils_js_1.nodeIdFromChangeAtom; } });
87
+ Object.defineProperty(exports, "changeAtomFromDetachedNodeId", { enumerable: true, get: function () { return deltaUtils_js_1.changeAtomFromDetachedNodeId; } });
85
88
  var index_js_5 = require("./chunked-forest/index.js");
86
89
  Object.defineProperty(exports, "chunkTree", { enumerable: true, get: function () { return index_js_5.chunkTree; } });
87
90
  Object.defineProperty(exports, "chunkField", { enumerable: true, get: function () { return index_js_5.chunkField; } });
@@ -104,12 +107,13 @@ Object.defineProperty(exports, "nodeKeyTreeIdentifier", { enumerable: true, get:
104
107
  var index_js_7 = require("./default-schema/index.js");
105
108
  Object.defineProperty(exports, "FieldKinds", { enumerable: true, get: function () { return index_js_7.FieldKinds; } });
106
109
  Object.defineProperty(exports, "DefaultChangeFamily", { enumerable: true, get: function () { return index_js_7.DefaultChangeFamily; } });
107
- Object.defineProperty(exports, "DefaultEditBuilder", { enumerable: true, get: function () { return index_js_7.DefaultEditBuilder; } });
110
+ Object.defineProperty(exports, "DefaultIdBasedDataEditor", { enumerable: true, get: function () { return index_js_7.DefaultIdBasedDataEditor; } });
108
111
  Object.defineProperty(exports, "defaultSchemaPolicy", { enumerable: true, get: function () { return index_js_7.defaultSchemaPolicy; } });
109
112
  Object.defineProperty(exports, "fieldKinds", { enumerable: true, get: function () { return index_js_7.fieldKinds; } });
110
113
  Object.defineProperty(exports, "fieldKindConfigurations", { enumerable: true, get: function () { return index_js_7.fieldKindConfigurations; } });
111
114
  Object.defineProperty(exports, "intoDelta", { enumerable: true, get: function () { return index_js_7.intoDelta; } });
112
115
  Object.defineProperty(exports, "relevantRemovedRoots", { enumerable: true, get: function () { return index_js_7.relevantRemovedRoots; } });
116
+ Object.defineProperty(exports, "LocationBasedDataEditor", { enumerable: true, get: function () { return index_js_7.LocationBasedDataEditor; } });
113
117
  Object.defineProperty(exports, "getCodecTreeForModularChangeFormat", { enumerable: true, get: function () { return index_js_7.getCodecTreeForModularChangeFormat; } });
114
118
  var schemaChecker_js_1 = require("./schemaChecker.js");
115
119
  Object.defineProperty(exports, "SchemaValidationError", { enumerable: true, get: function () { return schemaChecker_js_1.SchemaValidationError; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iEAGiC;AADhC,mHAAA,UAAU,OAAA;AAEX,yDAAmF;AAA1E,gHAAA,WAAW,OAAA;AAAE,uHAAA,kBAAkB,OAAA;AAAE,gHAAA,WAAW,OAAA;AAErD,sDAImC;AAHlC,4GAAA,gBAAgB,OAAA;AAChB,uHAAA,2BAA2B,OAAA;AAC3B,+GAAA,mBAAmB,OAAA;AAEpB,uDAW4B;AAV3B,yHAAA,qBAAqB,OAAA;AAC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AHhC,kHAAA,sBAAsB,OAAA;AACtB,+GAAA,mBAAmB,OAAA;AACnB,6HAAA,iCAAiC,OAAA;AAGlC,uEAAuE;AAA9D,qIAAA,yBAAyB,OAAA;AAElC,iDAO6B;AAL5B,4GAAA,eAAe,OAAA;AACf,uGAAA,UAAU,OAAA;AAMX,+DAKgC;AAH/B,4HAAA,oBAAoB,OAAA;AACpB,8HAAA,sBAAsB,OAAA;AACtB,4HAAA,oBAAoB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype DownPath,\n\ttoDownPath,\n} from \"./editableTreeBinder.js\";\nexport { allowsValue, assertAllowedValue, isTreeValue } from \"./valueUtilities.js\";\n\nexport {\n\tForestSummarizer,\n\tgetCodecTreeForForestFormat,\n\tForestFormatVersion,\n} from \"./forest-summary/index.js\";\nexport {\n\tcursorForMapTreeField,\n\tcursorForMapTreeNode,\n\tmapTreeFromCursor,\n\tmapTreeFieldFromCursor,\n\ttype MinimalMapTreeNodeView,\n\tmapTreeFieldsWithField,\n\tmapTreeWithField,\n\ttype MapTreeFieldViewGeneric,\n\ttype MapTreeNodeViewGeneric,\n\ttype MinimalFieldMap,\n} from \"./mapTreeCursor.js\";\nexport { buildForest } from \"./object-forest/index.js\";\nexport {\n\tSchemaSummarizer,\n\tmakeSchemaCodec,\n\tschemaCodecBuilder,\n} from \"./schema-index/index.js\";\nexport {\n\tstackTreeNodeCursor,\n\ttype CursorAdapter,\n\tprefixPath,\n\tprefixFieldPath,\n\ttype CursorWithNode,\n\tstackTreeFieldCursor,\n} from \"./treeCursorUtils.js\";\nexport {\n\tcursorForJsonableTreeNode,\n\tcursorForJsonableTreeField,\n\tjsonableTreeFromCursor,\n\tjsonableTreeFromFieldCursor,\n\tjsonableTreeFromForest,\n} from \"./treeTextCursor.js\";\n\nimport * as SequenceField from \"./sequence-field/index.js\";\n// eslint-disable-next-line unicorn/prefer-export-from -- fixing requires `export * as` (breaks API-Extractor) or named exports (changes public API)\nexport { SequenceField };\n\nexport {\n\tisNeverField,\n\tModularEditBuilder,\n\ttype FieldEditDescription as EditDescription,\n\ttype FieldChangeHandler,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype FieldChangeMap,\n\ttype FieldChange,\n\ttype FieldChangeset,\n\ttype ToDelta,\n\ttype ModularChangeset,\n\tmakeModularChangeCodecFamily,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\tallowsRepoSuperset,\n\ttype GenericChangeset,\n\tgenericFieldKind,\n\ttype HasFieldChanges,\n\ttype NodeExistsConstraint,\n\tModularChangeFamily,\n\ttype RelevantRemovedRootsFromChild,\n\tEncodedModularChangesetV1,\n\tEncodedModularChangesetV2,\n\tupdateRefreshers,\n\ttype NodeId,\n\ttype FieldChangeEncodingContext,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tisNeverTree,\n\tDefaultRevisionReplacer,\n\tModularChangeFormatVersion,\n} from \"./modular-schema/index.js\";\n\nexport { mapRootChanges } from \"./deltaUtils.js\";\n\nexport {\n\ttype TreeChunk,\n\tchunkTree,\n\tchunkField,\n\tchunkFieldSingle,\n\tbuildChunkedForest,\n\tdefaultChunkPolicy,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tFieldBatchFormatVersion,\n\tgetCodecTreeForFieldBatchFormat,\n\tmakeTreeChunker,\n\tmakeFieldBatchCodec,\n\ttype FieldBatchEncodingContext,\n\temptyChunk,\n\tcombineChunks,\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n} from \"./chunked-forest/index.js\";\n\nexport {\n\tcompareLocalNodeIdentifiers,\n\tcreateNodeIdentifierManager,\n\tisStableNodeIdentifier,\n\ttype LocalNodeIdentifier,\n\tMockNodeIdentifierManager,\n\ttype NodeIdentifierManager,\n\tnodeKeyTreeIdentifier,\n\ttype StableNodeIdentifier,\n} from \"./node-identifier/index.js\";\n\nexport {\n\tFieldKinds,\n\ttype DefaultChangeset,\n\tDefaultChangeFamily,\n\tDefaultEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\tdefaultSchemaPolicy,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tgetCodecTreeForModularChangeFormat,\n} from \"./default-schema/index.js\";\n\nexport {\n\tSchemaValidationError,\n\tisNodeInSchema,\n\tisFieldInSchema,\n\tthrowOutOfSchema,\n} from \"./schemaChecker.js\";\n\nexport {\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeContext,\n\ttype FlexTreeHydratedContext,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeEntity,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\tTreeStatus,\n\tContext,\n\ttype FlexTreeNodeEvents,\n\ttype FlexTreeUnknownUnboxed,\n\tisFlexTreeNode,\n\tContextSlot,\n\t// Internal\n\tflexTreeMarker,\n\tassertFlexTreeEntityNotFreed,\n\tflexTreeSlot,\n\tgetSchemaAndPolicy,\n\tLazyEntity,\n\ttreeStatusFromAnchorCache,\n\tindexForAt,\n\tFlexTreeEntityKind,\n\ttype FlexibleNodeContent,\n\ttype FlexibleFieldContent,\n\ttype FlexTreeHydratedContextMinimal,\n\ttype HydratedFlexTreeNode,\n\tgetOrCreateHydratedFlexTreeNode,\n\tcurrentObserver,\n\twithObservation,\n\ttype Observer,\n} from \"./flex-tree/index.js\";\n\nexport { TreeCompressionStrategy } from \"./treeCompressionUtils.js\";\n\nexport { valueSchemaAllows } from \"./valueUtilities.js\";\n\nexport { DetachedFieldIndexSummarizer } from \"./detachedFieldIndexSummarizer.js\";\n\nexport {\n\ttype SchemaChange,\n\tmakeSchemaChangeCodecs,\n\tEncodedSchemaChange,\n\tgetCodecTreeForSchemaChangeFormat,\n} from \"./schema-edits/index.js\";\n\nexport { makeMitigatedChangeFamily } from \"./mitigatedChangeFamily.js\";\n\nexport {\n\ttype KeyFinder,\n\tAnchorTreeIndex,\n\thasElement,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n} from \"./indexing/index.js\";\n\nexport {\n\ttype ChangeAtomIdBTree,\n\tnewChangeAtomIdBTree,\n\tgetFromChangeAtomIdMap,\n\tsetInChangeAtomIdMap,\n} from \"./changeAtomIdBTree.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iEAGiC;AADhC,mHAAA,UAAU,OAAA;AAEX,yDAAmF;AAA1E,gHAAA,WAAW,OAAA;AAAE,uHAAA,kBAAkB,OAAA;AAAE,gHAAA,WAAW,OAAA;AAErD,sDAImC;AAHlC,4GAAA,gBAAgB,OAAA;AAChB,uHAAA,2BAA2B,OAAA;AAC3B,+GAAA,mBAAmB,OAAA;AAEpB,uDAW4B;AAV3B,yHAAA,qBAAqB,OAAA;AACrB,wHAAA,oBAAoB,OAAA;AACpB,qHAAA,iBAAiB,OAAA;AACjB,0HAAA,sBAAsB,OAAA;AAEtB,0HAAA,sBAAsB,OAAA;AACtB,oHAAA,gBAAgB,OAAA;AAKjB,qDAAuD;AAA9C,uGAAA,WAAW,OAAA;AACpB,oDAIiC;AAHhC,4GAAA,gBAAgB,OAAA;AAChB,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAEnB,2DAO8B;AAN7B,yHAAA,mBAAmB,OAAA;AAEnB,gHAAA,UAAU,OAAA;AACV,qHAAA,eAAe,OAAA;AAEf,0HAAA,oBAAoB,OAAA;AAErB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c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype DownPath,\n\ttoDownPath,\n} from \"./editableTreeBinder.js\";\nexport { allowsValue, assertAllowedValue, isTreeValue } from \"./valueUtilities.js\";\n\nexport {\n\tForestSummarizer,\n\tgetCodecTreeForForestFormat,\n\tForestFormatVersion,\n} from \"./forest-summary/index.js\";\nexport {\n\tcursorForMapTreeField,\n\tcursorForMapTreeNode,\n\tmapTreeFromCursor,\n\tmapTreeFieldFromCursor,\n\ttype MinimalMapTreeNodeView,\n\tmapTreeFieldsWithField,\n\tmapTreeWithField,\n\ttype MapTreeFieldViewGeneric,\n\ttype MapTreeNodeViewGeneric,\n\ttype MinimalFieldMap,\n} from \"./mapTreeCursor.js\";\nexport { buildForest } from \"./object-forest/index.js\";\nexport {\n\tSchemaSummarizer,\n\tmakeSchemaCodec,\n\tschemaCodecBuilder,\n} from \"./schema-index/index.js\";\nexport {\n\tstackTreeNodeCursor,\n\ttype CursorAdapter,\n\tprefixPath,\n\tprefixFieldPath,\n\ttype CursorWithNode,\n\tstackTreeFieldCursor,\n} from \"./treeCursorUtils.js\";\nexport {\n\tcursorForJsonableTreeNode,\n\tcursorForJsonableTreeField,\n\tjsonableTreeFromCursor,\n\tjsonableTreeFromFieldCursor,\n\tjsonableTreeFromForest,\n} from \"./treeTextCursor.js\";\n\nimport * as SequenceField from \"./sequence-field/index.js\";\n// eslint-disable-next-line unicorn/prefer-export-from -- fixing requires `export * as` (breaks API-Extractor) or named exports (changes public API)\nexport { SequenceField };\n\nexport {\n\tisNeverField,\n\tModularEditBuilder,\n\ttype FieldEditDescription as EditDescription,\n\ttype FieldChangeHandler,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype FieldChangeMap,\n\ttype FieldChange,\n\ttype FieldChangeset,\n\ttype ToDelta,\n\ttype ModularChangeset,\n\tmakeModularChangeCodecFamily,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\ttype ComposeNodeManager,\n\ttype InvertNodeManager,\n\ttype RebaseNodeManager,\n\tNodeMoveType,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\tallowsRepoSuperset,\n\ttype GenericChangeset,\n\tgenericFieldKind,\n\ttype HasFieldChanges,\n\ttype NodeExistsConstraint,\n\tModularChangeFamily,\n\tEncodedModularChangesetV1,\n\tEncodedModularChangesetV2,\n\tupdateRefreshers,\n\ttype NodeId,\n\ttype FieldChangeEncodingContext,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tisNeverTree,\n\tDefaultRevisionReplacer,\n\tModularChangeFormatVersion,\n} from \"./modular-schema/index.js\";\n\nexport {\n\tmapRootChanges,\n\tnodeIdFromChangeAtom,\n\tchangeAtomFromDetachedNodeId,\n} from \"./deltaUtils.js\";\n\nexport {\n\ttype TreeChunk,\n\tchunkTree,\n\tchunkField,\n\tchunkFieldSingle,\n\tbuildChunkedForest,\n\tdefaultChunkPolicy,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tFieldBatchFormatVersion,\n\tgetCodecTreeForFieldBatchFormat,\n\tmakeTreeChunker,\n\tmakeFieldBatchCodec,\n\ttype FieldBatchEncodingContext,\n\temptyChunk,\n\tcombineChunks,\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n} from \"./chunked-forest/index.js\";\n\nexport {\n\tcompareLocalNodeIdentifiers,\n\tcreateNodeIdentifierManager,\n\tisStableNodeIdentifier,\n\ttype LocalNodeIdentifier,\n\tMockNodeIdentifierManager,\n\ttype NodeIdentifierManager,\n\tnodeKeyTreeIdentifier,\n\ttype StableNodeIdentifier,\n} from \"./node-identifier/index.js\";\n\nexport {\n\tFieldKinds,\n\ttype DefaultChangeset,\n\ttype DetachedRootIds,\n\tDefaultChangeFamily,\n\ttype IdBasedChangeFamilyDataEditor,\n\tDefaultIdBasedDataEditor,\n\ttype DataEditor,\n\ttype RequiredFieldEditor,\n\ttype OptionalFieldEditor,\n\ttype SequenceFieldEditor,\n\tdefaultSchemaPolicy,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tintoDelta,\n\trelevantRemovedRoots,\n\ttype DetachedRootLocation,\n\ttype DetachedRootsLocation,\n\ttype DetachedRootIdRange,\n\ttype Locator,\n\tLocationBasedDataEditor,\n\ttype ILocationBasedDataEditor,\n\tgetCodecTreeForModularChangeFormat,\n} from \"./default-schema/index.js\";\n\nexport {\n\tSchemaValidationError,\n\tisNodeInSchema,\n\tisFieldInSchema,\n\tthrowOutOfSchema,\n} from \"./schemaChecker.js\";\n\nexport {\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeContext,\n\ttype FlexTreeHydratedContext,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeEntity,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\tTreeStatus,\n\tContext,\n\ttype FlexTreeNodeEvents,\n\ttype FlexTreeUnknownUnboxed,\n\tisFlexTreeNode,\n\tContextSlot,\n\t// Internal\n\tflexTreeMarker,\n\tassertFlexTreeEntityNotFreed,\n\tflexTreeSlot,\n\tgetSchemaAndPolicy,\n\tLazyEntity,\n\ttreeStatusFromAnchorCache,\n\tindexForAt,\n\tFlexTreeEntityKind,\n\ttype FlexibleNodeContent,\n\ttype FlexibleFieldContent,\n\ttype FlexTreeHydratedContextMinimal,\n\ttype HydratedFlexTreeNode,\n\tgetOrCreateHydratedFlexTreeNode,\n\tcurrentObserver,\n\twithObservation,\n\ttype Observer,\n} from \"./flex-tree/index.js\";\n\nexport { TreeCompressionStrategy } from \"./treeCompressionUtils.js\";\n\nexport { valueSchemaAllows } from \"./valueUtilities.js\";\n\nexport { DetachedFieldIndexSummarizer } from \"./detachedFieldIndexSummarizer.js\";\n\nexport {\n\ttype SchemaChange,\n\tmakeSchemaChangeCodecs,\n\tEncodedSchemaChange,\n\tgetCodecTreeForSchemaChangeFormat,\n} from \"./schema-edits/index.js\";\n\nexport { makeMitigatedChangeFamily } from \"./mitigatedChangeFamily.js\";\n\nexport {\n\ttype KeyFinder,\n\tAnchorTreeIndex,\n\thasElement,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n} from \"./indexing/index.js\";\n\nexport {\n\ttype ChangeAtomIdBTree,\n\tnewChangeAtomIdBTree,\n\tgetFromChangeAtomIdMap,\n\tsetInChangeAtomIdMap,\n} from \"./changeAtomIdBTree.js\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"mitigatedChangeFamily.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/mitigatedChangeFamily.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,YAAY,EACZ,kBAAkB,EAClB,aAAa,EAKb,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,SAAS,kBAAkB,EAAE,OAAO,EACpF,uBAAuB,EAAE,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,EACvD,cAAc,EAAE,OAAO,EACvB,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAC/B,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAWhC;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAC3C,kBAAkB,EAAE,aAAa,CAAC,OAAO,CAAC,EAC1C,cAAc,EAAE,OAAO,EACvB,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAC/B,aAAa,CAAC,OAAO,CAAC,CAuCxB"}
1
+ {"version":3,"file":"mitigatedChangeFamily.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/mitigatedChangeFamily.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,YAAY,EACZ,kBAAkB,EAClB,aAAa,EAMb,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,SAAS,kBAAkB,EAAE,OAAO,EACpF,uBAAuB,EAAE,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,EACvD,cAAc,EAAE,OAAO,EACvB,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAC/B,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAYhC;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAC3C,kBAAkB,EAAE,aAAa,CAAC,OAAO,CAAC,EAC1C,cAAc,EAAE,OAAO,EACvB,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAC/B,aAAa,CAAC,OAAO,CAAC,CAuCxB"}
@@ -21,8 +21,8 @@ exports.makeMitigatedRebaser = exports.makeMitigatedChangeFamily = void 0;
21
21
  */
22
22
  function makeMitigatedChangeFamily(unmitigatedChangeFamily, fallbackChange, onError) {
23
23
  return {
24
- buildEditor: (mintRevisionTag, changeReceiver) => {
25
- return unmitigatedChangeFamily.buildEditor(mintRevisionTag, changeReceiver);
24
+ buildEditor: (mintRevisionTag, changeReceiver, options) => {
25
+ return unmitigatedChangeFamily.buildEditor(mintRevisionTag, changeReceiver, options);
26
26
  },
27
27
  rebaser: makeMitigatedRebaser(unmitigatedChangeFamily.rebaser, fallbackChange, onError),
28
28
  codecs: unmitigatedChangeFamily.codecs,
@@ -1 +1 @@
1
- {"version":3,"file":"mitigatedChangeFamily.js","sourceRoot":"","sources":["../../src/feature-libraries/mitigatedChangeFamily.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAYH;;;;;;;;;;;;;GAaG;AACH,SAAgB,yBAAyB,CACxC,uBAAuD,EACvD,cAAuB,EACvB,OAAiC;IAEjC,OAAO;QACN,WAAW,EAAE,CACZ,eAAkC,EAClC,cAAuD,EAC7C,EAAE;YACZ,OAAO,uBAAuB,CAAC,WAAW,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;QAC7E,CAAC;QACD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AAC;YAClB,CAAC;QACF,CAAC;QACD,cAAc,EAAE,CAAC,MAAe,EAAE,QAA0B,EAAW,EAAE,CACxE,YAAY,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;KACxE,CAAC;AACH,CAAC;AA3CD,oDA2CC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tChangeFamily,\n\tChangeFamilyEditor,\n\tChangeRebaser,\n\tRevisionMetadataSource,\n\tRevisionReplacer,\n\tRevisionTag,\n\tTaggedChange,\n} from \"../core/index.js\";\n\n/**\n * Makes a given `ChangeFamily` safer to use by wrapping some of its functions in try-catch blocks.\n *\n * Mitigated functions:\n * - {@link ChangeFamily.intoDelta} (an empty Delta is returned instead)\n * - {@link ChangeRebaser.rebase} (the given `fallbackChange` is returned instead)\n * - {@link ChangeRebaser.invert} (the given `fallbackChange` is returned instead)\n * - {@link ChangeRebaser.compose} (the given `fallbackChange` is returned instead)\n *\n * @param unmitigatedChangeFamily - The change family to mitigate.\n * @param fallbackChange - A changeset to use as a fallback when one of the mitigated functions throws.\n * @param onError - A callback invoked for each error thrown.\n * @returns a mitigated change family.\n */\nexport function makeMitigatedChangeFamily<TEditor extends ChangeFamilyEditor, TChange>(\n\tunmitigatedChangeFamily: ChangeFamily<TEditor, TChange>,\n\tfallbackChange: TChange,\n\tonError: (error: unknown) => void,\n): ChangeFamily<TEditor, TChange> {\n\treturn {\n\t\tbuildEditor: (\n\t\t\tmintRevisionTag: () => RevisionTag,\n\t\t\tchangeReceiver: (change: TaggedChange<TChange>) => void,\n\t\t): TEditor => {\n\t\t\treturn unmitigatedChangeFamily.buildEditor(mintRevisionTag, changeReceiver);\n\t\t},\n\t\trebaser: makeMitigatedRebaser(unmitigatedChangeFamily.rebaser, fallbackChange, onError),\n\t\tcodecs: unmitigatedChangeFamily.codecs,\n\t};\n}\n\nexport function makeMitigatedRebaser<TChange>(\n\tunmitigatedRebaser: ChangeRebaser<TChange>,\n\tfallbackChange: TChange,\n\tonError: (error: unknown) => void,\n): ChangeRebaser<TChange> {\n\tconst withFallback = (fn: () => TChange): TChange => {\n\t\ttry {\n\t\t\treturn fn();\n\t\t} catch (error: unknown) {\n\t\t\tonError(error);\n\t\t\treturn fallbackChange;\n\t\t}\n\t};\n\n\treturn {\n\t\tcompose: (changes: TaggedChange<TChange>[]): TChange => {\n\t\t\treturn withFallback(() => unmitigatedRebaser.compose(changes));\n\t\t},\n\t\tinvert: (\n\t\t\tchanges: TaggedChange<TChange>,\n\t\t\tisRollback: boolean,\n\t\t\trevision: RevisionTag,\n\t\t): TChange => {\n\t\t\treturn withFallback(() => unmitigatedRebaser.invert(changes, isRollback, revision));\n\t\t},\n\t\trebase: (\n\t\t\tchange: TaggedChange<TChange>,\n\t\t\tover: TaggedChange<TChange>,\n\t\t\trevisionMetadata: RevisionMetadataSource,\n\t\t): TChange => {\n\t\t\treturn withFallback(() => unmitigatedRebaser.rebase(change, over, revisionMetadata));\n\t\t},\n\t\tgetRevisions: (change: TChange): Set<RevisionTag | undefined> => {\n\t\t\ttry {\n\t\t\t\treturn unmitigatedRebaser.getRevisions(change);\n\t\t\t} catch (error: unknown) {\n\t\t\t\tonError(error);\n\t\t\t\treturn new Set();\n\t\t\t}\n\t\t},\n\t\tchangeRevision: (change: TChange, replacer: RevisionReplacer): TChange =>\n\t\t\twithFallback(() => unmitigatedRebaser.changeRevision(change, replacer)),\n\t};\n}\n"]}
1
+ {"version":3,"file":"mitigatedChangeFamily.js","sourceRoot":"","sources":["../../src/feature-libraries/mitigatedChangeFamily.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAaH;;;;;;;;;;;;;GAaG;AACH,SAAgB,yBAAyB,CACxC,uBAAuD,EACvD,cAAuB,EACvB,OAAiC;IAEjC,OAAO;QACN,WAAW,EAAE,CACZ,eAAkC,EAClC,cAAuD,EACvD,OAAuB,EACb,E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AAC;YAAC,OAAO,KAAc,EAAE,CAAC;gBACzB,OAAO,CAAC,KAAK,CAAC,CAAC;gBACf,OAAO,IAAI,GAAG,EAAE,CAAC;YAClB,CAAC;QACF,CAAC;QACD,cAAc,EAAE,CAAC,MAAe,EAAE,QAA0B,EAAW,EAAE,CACxE,YAAY,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;KACxE,CAAC;AACH,CAAC;AA3CD,oDA2CC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tChangeFamily,\n\tChangeFamilyEditor,\n\tChangeRebaser,\n\tEditorOptions,\n\tRevisionMetadataSource,\n\tRevisionReplacer,\n\tRevisionTag,\n\tTaggedChange,\n} from \"../core/index.js\";\n\n/**\n * Makes a given `ChangeFamily` safer to use by wrapping some of its functions in try-catch blocks.\n *\n * Mitigated functions:\n * - {@link ChangeFamily.intoDelta} (an empty Delta is returned instead)\n * - {@link ChangeRebaser.rebase} (the given `fallbackChange` is returned instead)\n * - {@link ChangeRebaser.invert} (the given `fallbackChange` is returned instead)\n * - {@link ChangeRebaser.compose} (the given `fallbackChange` is returned instead)\n *\n * @param unmitigatedChangeFamily - The change family to mitigate.\n * @param fallbackChange - A changeset to use as a fallback when one of the mitigated functions throws.\n * @param onError - A callback invoked for each error thrown.\n * @returns a mitigated change family.\n */\nexport function makeMitigatedChangeFamily<TEditor extends ChangeFamilyEditor, TChange>(\n\tunmitigatedChangeFamily: ChangeFamily<TEditor, TChange>,\n\tfallbackChange: TChange,\n\tonError: (error: unknown) => void,\n): ChangeFamily<TEditor, TChange> {\n\treturn {\n\t\tbuildEditor: (\n\t\t\tmintRevisionTag: () => RevisionTag,\n\t\t\tchangeReceiver: (change: TaggedChange<TChange>) => void,\n\t\t\toptions?: EditorOptions,\n\t\t): TEditor => {\n\t\t\treturn unmitigatedChangeFamily.buildEditor(mintRevisionTag, changeReceiver, options);\n\t\t},\n\t\trebaser: makeMitigatedRebaser(unmitigatedChangeFamily.rebaser, fallbackChange, onError),\n\t\tcodecs: unmitigatedChangeFamily.codecs,\n\t};\n}\n\nexport function makeMitigatedRebaser<TChange>(\n\tunmitigatedRebaser: ChangeRebaser<TChange>,\n\tfallbackChange: TChange,\n\tonError: (error: unknown) => void,\n): ChangeRebaser<TChange> {\n\tconst withFallback = (fn: () => TChange): TChange => {\n\t\ttry {\n\t\t\treturn fn();\n\t\t} catch (error: unknown) {\n\t\t\tonError(error);\n\t\t\treturn fallbackChange;\n\t\t}\n\t};\n\n\treturn {\n\t\tcompose: (changes: TaggedChange<TChange>[]): TChange => {\n\t\t\treturn withFallback(() => unmitigatedRebaser.compose(changes));\n\t\t},\n\t\tinvert: (\n\t\t\tchanges: TaggedChange<TChange>,\n\t\t\tisRollback: boolean,\n\t\t\trevision: RevisionTag,\n\t\t): TChange => {\n\t\t\treturn withFallback(() => unmitigatedRebaser.invert(changes, isRollback, revision));\n\t\t},\n\t\trebase: (\n\t\t\tchange: TaggedChange<TChange>,\n\t\t\tover: TaggedChange<TChange>,\n\t\t\trevisionMetadata: RevisionMetadataSource,\n\t\t): TChange => {\n\t\t\treturn withFallback(() => unmitigatedRebaser.rebase(change, over, revisionMetadata));\n\t\t},\n\t\tgetRevisions: (change: TChange): Set<RevisionTag | undefined> => {\n\t\t\ttry {\n\t\t\t\treturn unmitigatedRebaser.getRevisions(change);\n\t\t\t} catch (error: unknown) {\n\t\t\t\tonError(error);\n\t\t\t\treturn new Set();\n\t\t\t}\n\t\t},\n\t\tchangeRevision: (change: TChange, replacer: RevisionReplacer): TChange =>\n\t\t\twithFallback(() => unmitigatedRebaser.changeRevision(change, replacer)),\n\t};\n}\n"]}
@@ -7,38 +7,114 @@ import type { RangeQueryResult } from "../../util/index.js";
7
7
  import type { NodeId } from "./modularChangeTypes.js";
8
8
  export type CrossFieldMap<T> = ChangeAtomIdRangeMap<T>;
9
9
  export type CrossFieldQuerySet = CrossFieldMap<boolean>;
10
- export declare function addCrossFieldQuery(set: CrossFieldQuerySet, revision: RevisionTag | undefined, id: ChangesetLocalId, count: number): void;
11
- export declare function setInCrossFieldMap<T>(map: CrossFieldMap<T>, revision: RevisionTag | undefined, id: ChangesetLocalId, count: number, value: T): void;
12
- export declare function getFirstFromCrossFieldMap<T>(map: CrossFieldMap<T>, revision: RevisionTag | undefined, id: ChangesetLocalId, count: number): RangeQueryResult<ChangeAtomId, T>;
13
- export declare enum CrossFieldTarget {
14
- Source = 0,
15
- Destination = 1
10
+ export declare function setInCrossFieldMap<T>(map: CrossFieldMap<T>, id: ChangeAtomId, count: number, value: T): void;
11
+ export declare function getFirstFromCrossFieldMap<T>(map: CrossFieldMap<T>, revision: RevisionTag | undefined, id: ChangesetLocalId, count: number): RangeQueryResult<T | undefined>;
12
+ export declare enum NodeMoveType {
13
+ Detach = 0,
14
+ Attach = 1
16
15
  }
17
- /**
18
- * Used by {@link FieldChangeHandler} implementations for exchanging information across other fields
19
- * while rebasing, composing, or inverting a change.
20
- */
21
- export interface CrossFieldManager<T = unknown> {
16
+ export interface InvertNodeManager {
17
+ /**
18
+ * Transfers the given node changes from the input context of the field changeset being inverted to the input context of the detached space (from which it may be further moved).
19
+ *
20
+ * This must be called for each detach in the field kind when rolling-back or reverting a detach.
21
+ * This implies that all detaches in the field must be inverted.
22
+ * @param detachId - The ID of the detach to invert.
23
+ * @param count - The number of nodes being detached.
24
+ * @param nodeChanges - The node changes to transfer.
25
+ * @param newAttachId - The ID that the nodes will be attached with in the inverted changeset of this field.
26
+ */
27
+ invertDetach(detachId: ChangeAtomId, count: number, nodeChanges: NodeId | undefined, newAttachId: ChangeAtomId): void;
28
+ /**
29
+ * Gets the node changes associated with the node being attached in input changeset.
30
+ *
31
+ * This must be called for each attach in the field kind when rolling-back or reverting a attach.
32
+ * This implies that all attaches in the field must be inverted.
33
+ * @param attachId - The ID of the attach to invert.
34
+ * @param count - The number of nodes being attached.
35
+ */
36
+ invertAttach(attachId: ChangeAtomId, count: number): RangeQueryResult<DetachedNodeEntry | undefined>;
37
+ }
38
+ export interface ComposeNodeManager {
22
39
  /**
23
- * Returns the first data range associated with the key of `target`, `revision`, between `id` and `id + count`.
24
- * Calling this records a dependency for the current field on this key if `addDependency` is true.
40
+ * Allows a field kind to query nested changes associated with a node in the input context of the new changeset.
41
+ * This should be called for every detach in the base changeset.
42
+ * @param baseDetachId - The ID of the detach in the base changeset.
43
+ * @param count - The number of nodes being detached.
25
44
  */
26
- get(target: CrossFieldTarget, revision: RevisionTag | undefined, id: ChangesetLocalId, count: number, addDependency: boolean): RangeQueryResult<ChangeAtomId, T>;
45
+ getNewChangesForBaseDetach(baseDetachId: ChangeAtomId, count: number): RangeQueryResult<DetachedNodeEntry | undefined>;
27
46
  /**
28
- * Sets the range of keys to `newValue`.
29
- * If `invalidateDependents` is true, all fields which took a dependency on this key will be considered invalidated
30
- * and will be given a chance to address the new data in `amendCompose`, or a second pass of `rebase` or `invert` as appropriate.
47
+ * Must be called by a field kind when composing an attach in the base changeset with a detach in the new changeset.
48
+ * This allows Modular Change Family to keep track of how a given node is being renamed.
49
+ * @param baseAttachId - The ID of the attach in the base changeset.
50
+ * @param newDetachId - The ID of the detach in the new changeset.
51
+ * @param count - The number of nodes being attached then detached.
31
52
  */
32
- set(target: CrossFieldTarget, revision: RevisionTag | undefined, id: ChangesetLocalId, count: number, newValue: T, invalidateDependents: boolean): void;
53
+ composeAttachDetach(baseAttachId: ChangeAtomId, newDetachId: ChangeAtomId, count: number): void;
33
54
  /**
34
- * This must be called whenever a new node is moved into this field as part of the current rebase, compose, or invert.
35
- * Calling this for a node which was already in the field is tolerated.
55
+ * Must be called by a field kind when composing an attach in the base changeset with nested changes the new changeset.
56
+ *
57
+ * This is needed because child changes are represented at the location of the node they impact in the input context of a changeset.
58
+ * So if the later of the two changes being composed carries nested changes for a node,
59
+ * then in the composed changeset, these nested changes need to be represented at the location of that node in the input context of the composed changeset.
60
+ *
61
+ * @param baseAttachId - The ID of the attach in the base changeset.
62
+ * @param newChanges - The ID of the nested changes associated with this node in the new changeset.
36
63
  */
37
- onMoveIn(id: NodeId): void;
64
+ sendNewChangesToBaseSourceLocation(baseAttachId: ChangeAtomId, newChanges: NodeId): void;
38
65
  /**
39
- * This must be called whenever a new cross field key is moved into this field as part of the current rebase or compose.
40
- * Calling this for a key which was already in the field is tolerated.
66
+ * Must be called by a field kind when composing a detach in the base changeset with an attach of the same nodes in the new changeset.
67
+ * @param baseDetachId - The ID of the detach in the base changeset.
68
+ * @param newAttachId - The ID of the attach in the new changeset.
69
+ * @param count - The number of nodes being detached then attached.
70
+ * @param convertToPin - Should be set to true if the composed change will include a detach and attach with `newAttachId`.
71
+ * Otherwise the composed change should not include either `baseDetachId` or `newAttachId`.
41
72
  */
42
- moveKey(target: CrossFieldTarget, revision: RevisionTag | undefined, id: ChangesetLocalId, count: number): void;
73
+ composeDetachAttach(baseDetachId: ChangeAtomId, newAttachId: ChangeAtomId, count: number, convertToPin: boolean): void;
74
+ }
75
+ export interface RebaseNodeManager {
76
+ /**
77
+ * Must be called by a field kind when rebasing over an attach.
78
+ * The returned child changes and detach intentions must be represented in the output changeset.
79
+ * @param baseAttachId - The ID of the attach that is being rebased over.
80
+ * @param count - The number of nodes attached by the base attach.
81
+ * @returns The new nested changes and detach intentions associated with the node in the changeset being rebased.
82
+ */
83
+ getNewChangesForBaseAttach(baseAttachId: ChangeAtomId, count: number): RangeQueryResult<RebaseDetachedNodeEntry | undefined>;
84
+ /**
85
+ * Must be called by a field kind when rebasing over a detach.
86
+ * The field kind must provide the nested changes and detach intentions associated with the node in the changeset being rebased.
87
+ * @param baseDetachId - The ID of the detach that is being rebased over.
88
+ * @param count - The number of nodes detached by the base detach.
89
+ * @param newDetachId - The ID associated the detach intention (if any) for these nodes in the rebased changeset.
90
+ * @param nodeChange - The nested changes (if any) associated with this node in the rebased changeset.
91
+ * @param newDetachCellId - An additional ID to associate with this node.
92
+ * This ID will be included in the result of {@link getNewChangesForBaseAttach}.
93
+ * This is only used by sequence field for compatibility with earlier client versions.
94
+ */
95
+ rebaseOverDetach(baseDetachId: ChangeAtomId, count: number, newDetachId: ChangeAtomId | undefined, nodeChange: NodeId | undefined, newDetachCellId?: ChangeAtomId): void;
96
+ addDetach(id: ChangeAtomId, count: number): void;
97
+ removeDetach(id: ChangeAtomId, count: number): void;
98
+ /**
99
+ * Returns whether nodes which were either previously detached by `id` or the base changeset is now detaching with `id`
100
+ * are also reattached by the base changeset.
101
+ */
102
+ doesBaseAttachNodes(id: ChangeAtomId, count: number): RangeQueryResult<boolean>;
103
+ /**
104
+ * Returns the root ID the base change renames `id` to, if any.
105
+ */
106
+ getBaseRename(id: ChangeAtomId, count: number): RangeQueryResult<ChangeAtomId | undefined>;
107
+ /**
108
+ * Given a detached node ID in the base changeset's output context,
109
+ * returns the ID the rebased changeset renames that ID to, if any.
110
+ */
111
+ getNewRenameForBaseRename(baseRenameTo: ChangeAtomId, count: number): RangeQueryResult<ChangeAtomId | undefined>;
112
+ }
113
+ export interface DetachedNodeEntry {
114
+ nodeChange?: NodeId;
115
+ detachId?: ChangeAtomId;
116
+ }
117
+ export interface RebaseDetachedNodeEntry extends DetachedNodeEntry {
118
+ cellRename?: ChangeAtomId;
43
119
  }
44
120
  //# sourceMappingURL=crossFieldQueries.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"crossFieldQueries.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/crossFieldQueries.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,oBAAoB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AAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;;OAGG;IACH,OAAO,CACN,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,WAAW,GAAG,SAAS,EACjC,EAAE,EAAE,gBAAgB,EACpB,KAAK,EAAE,MAAM,GACX,IAAI,CAAC;CACR"}
1
+ {"version":3,"file":"crossFieldQueries.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/crossFieldQueries.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,oBAAoB,CAAC,CAAC,CAAC,CAAC;AACvD,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;AAExD,wBAAgB,kBAAkB,CAAC,CAAC,EACnC,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,EACrB,EAAE,EAAE,YAAY,EAChB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,CAAC,GACN,IAAI,CAEN;AAED,wBAAgB,yBAAyB,CAAC,CAAC,EAC1C,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,EACrB,QAAQ,EAAE,WAAW,GAAG,SAAS,EACjC,EAAE,EAAE,gBAAgB,EACpB,KAAK,EAAE,MAAM,GACX,gBAAgB,CAAC,CAAC,GAAG,SAAS,CAAC,CAEjC;AAED,oBAAY,YAAY;IACvB,MAAM,IAAA;IACN,MAAM,IAAA;CACN;AAED,MAAM,WAAW,iBAAiB;IACjC;;;;;;;;;OASG;IACH,YAAY,CACX,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MA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,IAAI,CAAC;IAEpD;;;OAGG;IACH,mBAAmB,CAAC,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAEhF;;OAEG;IACH,aAAa,CAAC,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,gBAAgB,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC;IAE3F;;;OAGG;IACH,yBAAyB,CACxB,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,MAAM,GACX,gBAAgB,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC;CAC9C;AAED,MAAM,WAAW,iBAAiB;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,YAAY,CAAC;CACxB;AAED,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAEjE,UAAU,CAAC,EAAE,YAAY,CAAC;CAC1B"}
@@ -4,22 +4,18 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.CrossFieldTarget = exports.getFirstFromCrossFieldMap = exports.setInCrossFieldMap = exports.addCrossFieldQuery = void 0;
8
- function addCrossFieldQuery(set, revision, id, count) {
9
- setInCrossFieldMap(set, revision, id, count, true);
10
- }
11
- exports.addCrossFieldQuery = addCrossFieldQuery;
12
- function setInCrossFieldMap(map, revision, id, count, value) {
13
- map.set({ revision, localId: id }, count, value);
7
+ exports.NodeMoveType = exports.getFirstFromCrossFieldMap = exports.setInCrossFieldMap = void 0;
8
+ function setInCrossFieldMap(map, id, count, value) {
9
+ map.set(id, count, value);
14
10
  }
15
11
  exports.setInCrossFieldMap = setInCrossFieldMap;
16
12
  function getFirstFromCrossFieldMap(map, revision, id, count) {
17
13
  return map.getFirst({ revision, localId: id }, count);
18
14
  }
19
15
  exports.getFirstFromCrossFieldMap = getFirstFromCrossFieldMap;
20
- var CrossFieldTarget;
21
- (function (CrossFieldTarget) {
22
- CrossFieldTarget[CrossFieldTarget["Source"] = 0] = "Source";
23
- CrossFieldTarget[CrossFieldTarget["Destination"] = 1] = "Destination";
24
- })(CrossFieldTarget || (exports.CrossFieldTarget = CrossFieldTarget = {}));
16
+ var NodeMoveType;
17
+ (function (NodeMoveType) {
18
+ NodeMoveType[NodeMoveType["Detach"] = 0] = "Detach";
19
+ NodeMoveType[NodeMoveType["Attach"] = 1] = "Attach";
20
+ })(NodeMoveType || (exports.NodeMoveType = NodeMoveType = {}));
25
21
  //# sourceMappingURL=crossFieldQueries.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"crossFieldQueries.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/crossFieldQueries.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAeH,SAAgB,kBAAkB,CACjC,GAAuB,EACvB,QAAiC,EACjC,EAAoB,EACpB,KAAa;IAEb,kBAAkB,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AACpD,CAAC;AAPD,gDAOC;AAED,SAAgB,kBAAkB,CACjC,GAAqB,EACrB,QAAiC,EACjC,EAAoB,EACpB,KAAa,EACb,KAAQ;IAER,GAAG,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC;AARD,gDAQC;AAED,SAAgB,yBAAyB,CACxC,GAAqB,EACrB,QAAiC,EACjC,EAAoB,EACpB,KAAa;IAEb,OAAO,GAAG,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;AACvD,CAAC;AAPD,8DAOC;AAED,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC3B,2DAAM,CAAA;IACN,qEAAW,CAAA;AACZ,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tChangeAtomId,\n\tChangeAtomIdRangeMap,\n\tChangesetLocalId,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport type { RangeQueryResult } from \"../../util/index.js\";\n\nimport type { NodeId } from \"./modularChangeTypes.js\";\n\nexport type CrossFieldMap<T> = ChangeAtomIdRangeMap<T>;\nexport type CrossFieldQuerySet = CrossFieldMap<boolean>;\n\nexport function addCrossFieldQuery(\n\tset: CrossFieldQuerySet,\n\trevision: RevisionTag | undefined,\n\tid: ChangesetLocalId,\n\tcount: number,\n): void {\n\tsetInCrossFieldMap(set, revision, id, count, true);\n}\n\nexport function setInCrossFieldMap<T>(\n\tmap: CrossFieldMap<T>,\n\trevision: RevisionTag | undefined,\n\tid: ChangesetLocalId,\n\tcount: number,\n\tvalue: T,\n): void {\n\tmap.set({ revision, localId: id }, count, value);\n}\n\nexport function getFirstFromCrossFieldMap<T>(\n\tmap: CrossFieldMap<T>,\n\trevision: RevisionTag | undefined,\n\tid: ChangesetLocalId,\n\tcount: number,\n): RangeQueryResult<ChangeAtomId, T> {\n\treturn map.getFirst({ revision, localId: id }, count);\n}\n\nexport enum CrossFieldTarget {\n\tSource,\n\tDestination,\n}\n\n/**\n * Used by {@link FieldChangeHandler} implementations for exchanging information across other fields\n * while rebasing, composing, or inverting a change.\n */\nexport interface CrossFieldManager<T = unknown> {\n\t/**\n\t * Returns the first data range associated with the key of `target`, `revision`, between `id` and `id + count`.\n\t * Calling this records a dependency for the current field on this key if `addDependency` is true.\n\t */\n\tget(\n\t\ttarget: CrossFieldTarget,\n\t\trevision: RevisionTag | undefined,\n\t\tid: ChangesetLocalId,\n\t\tcount: number,\n\t\taddDependency: boolean,\n\t): RangeQueryResult<ChangeAtomId, T>;\n\n\t/**\n\t * Sets the range of keys to `newValue`.\n\t * If `invalidateDependents` is true, all fields which took a dependency on this key will be considered invalidated\n\t * and will be given a chance to address the new data in `amendCompose`, or a second pass of `rebase` or `invert` as appropriate.\n\t */\n\tset(\n\t\ttarget: CrossFieldTarget,\n\t\trevision: RevisionTag | undefined,\n\t\tid: ChangesetLocalId,\n\t\tcount: number,\n\t\tnewValue: T,\n\t\tinvalidateDependents: boolean,\n\t): void;\n\n\t/**\n\t * This must be called whenever a new node is moved into this field as part of the current rebase, compose, or invert.\n\t * Calling this for a node which was already in the field is tolerated.\n\t */\n\tonMoveIn(id: NodeId): void;\n\n\t/**\n\t * This must be called whenever a new cross field key is moved into this field as part of the current rebase or compose.\n\t * Calling this for a key which was already in the field is tolerated.\n\t */\n\tmoveKey(\n\t\ttarget: CrossFieldTarget,\n\t\trevision: RevisionTag | undefined,\n\t\tid: ChangesetLocalId,\n\t\tcount: number,\n\t): void;\n}\n"]}
1
+ {"version":3,"file":"crossFieldQueries.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/crossFieldQueries.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAeH,SAAgB,kBAAkB,CACjC,GAAqB,EACrB,EAAgB,EAChB,KAAa,EACb,KAAQ;IAER,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAC3B,CAAC;AAPD,gDAOC;AAED,SAAgB,yBAAyB,CACxC,GAAqB,EACrB,QAAiC,EACjC,EAAoB,EACpB,KAAa;IAEb,OAAO,GAAG,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;AACvD,CAAC;AAPD,8DAOC;AAED,IAAY,YAGX;AAHD,WAAY,YAAY;IACvB,mDAAM,CAAA;IACN,mDAAM,CAAA;AACP,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tChangeAtomId,\n\tChangeAtomIdRangeMap,\n\tChangesetLocalId,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport type { RangeQueryResult } from \"../../util/index.js\";\n\nimport type { NodeId } from \"./modularChangeTypes.js\";\n\nexport type CrossFieldMap<T> = ChangeAtomIdRangeMap<T>;\nexport type CrossFieldQuerySet = CrossFieldMap<boolean>;\n\nexport function setInCrossFieldMap<T>(\n\tmap: CrossFieldMap<T>,\n\tid: ChangeAtomId,\n\tcount: number,\n\tvalue: T,\n): void {\n\tmap.set(id, count, value);\n}\n\nexport function getFirstFromCrossFieldMap<T>(\n\tmap: CrossFieldMap<T>,\n\trevision: RevisionTag | undefined,\n\tid: ChangesetLocalId,\n\tcount: number,\n): RangeQueryResult<T | undefined> {\n\treturn map.getFirst({ revision, localId: id }, count);\n}\n\nexport enum NodeMoveType {\n\tDetach,\n\tAttach,\n}\n\nexport interface InvertNodeManager {\n\t/**\n\t * Transfers the given node changes from the input context of the field changeset being inverted to the input context of the detached space (from which it may be further moved).\n\t *\n\t * This must be called for each detach in the field kind when rolling-back or reverting a detach.\n\t * This implies that all detaches in the field must be inverted.\n\t * @param detachId - The ID of the detach to invert.\n\t * @param count - The number of nodes being detached.\n\t * @param nodeChanges - The node changes to transfer.\n\t * @param newAttachId - The ID that the nodes will be attached with in the inverted changeset of this field.\n\t */\n\tinvertDetach(\n\t\tdetachId: ChangeAtomId,\n\t\tcount: number,\n\t\tnodeChanges: NodeId | undefined,\n\t\tnewAttachId: ChangeAtomId,\n\t): void;\n\n\t/**\n\t * Gets the node changes associated with the node being attached in input changeset.\n\t *\n\t * This must be called for each attach in the field kind when rolling-back or reverting a attach.\n\t * This implies that all attaches in the field must be inverted.\n\t * @param attachId - The ID of the attach to invert.\n\t * @param count - The number of nodes being attached.\n\t */\n\tinvertAttach(\n\t\tattachId: ChangeAtomId,\n\t\tcount: number,\n\t): RangeQueryResult<DetachedNodeEntry | undefined>;\n}\n\nexport interface ComposeNodeManager {\n\t/**\n\t * Allows a field kind to query nested changes associated with a node in the input context of the new changeset.\n\t * This should be called for every detach in the base changeset.\n\t * @param baseDetachId - The ID of the detach in the base changeset.\n\t * @param count - The number of nodes being detached.\n\t */\n\tgetNewChangesForBaseDetach(\n\t\tbaseDetachId: ChangeAtomId,\n\t\tcount: number,\n\t): RangeQueryResult<DetachedNodeEntry | undefined>;\n\n\t/**\n\t * Must be called by a field kind when composing an attach in the base changeset with a detach in the new changeset.\n\t * This allows Modular Change Family to keep track of how a given node is being renamed.\n\t * @param baseAttachId - The ID of the attach in the base changeset.\n\t * @param newDetachId - The ID of the detach in the new changeset.\n\t * @param count - The number of nodes being attached then detached.\n\t */\n\tcomposeAttachDetach(\n\t\tbaseAttachId: ChangeAtomId,\n\t\tnewDetachId: ChangeAtomId,\n\t\tcount: number,\n\t): void;\n\n\t/**\n\t * Must be called by a field kind when composing an attach in the base changeset with nested changes the new changeset.\n\t *\n\t * This is needed because child changes are represented at the location of the node they impact in the input context of a changeset.\n\t * So if the later of the two changes being composed carries nested changes for a node,\n\t * then in the composed changeset, these nested changes need to be represented at the location of that node in the input context of the composed changeset.\n\t *\n\t * @param baseAttachId - The ID of the attach in the base changeset.\n\t * @param newChanges - The ID of the nested changes associated with this node in the new changeset.\n\t */\n\tsendNewChangesToBaseSourceLocation(baseAttachId: ChangeAtomId, newChanges: NodeId): void;\n\n\t// XXX: It doesn't seem like it should be mandatory to call this if you don't want the rename to be removed (e.g., optional field pin).\n\t/**\n\t * Must be called by a field kind when composing a detach in the base changeset with an attach of the same nodes in the new changeset.\n\t * @param baseDetachId - The ID of the detach in the base changeset.\n\t * @param newAttachId - The ID of the attach in the new changeset.\n\t * @param count - The number of nodes being detached then attached.\n\t * @param convertToPin - Should be set to true if the composed change will include a detach and attach with `newAttachId`.\n\t * Otherwise the composed change should not include either `baseDetachId` or `newAttachId`.\n\t */\n\tcomposeDetachAttach(\n\t\tbaseDetachId: ChangeAtomId,\n\t\tnewAttachId: ChangeAtomId,\n\t\tcount: number,\n\t\tconvertToPin: boolean,\n\t): void;\n}\n\nexport interface RebaseNodeManager {\n\t// XXX: It's not clear whether the returned changes are already rebased or not.\n\t/**\n\t * Must be called by a field kind when rebasing over an attach.\n\t * The returned child changes and detach intentions must be represented in the output changeset.\n\t * @param baseAttachId - The ID of the attach that is being rebased over.\n\t * @param count - The number of nodes attached by the base attach.\n\t * @returns The new nested changes and detach intentions associated with the node in the changeset being rebased.\n\t */\n\tgetNewChangesForBaseAttach(\n\t\tbaseAttachId: ChangeAtomId,\n\t\tcount: number,\n\t): RangeQueryResult<RebaseDetachedNodeEntry | undefined>;\n\n\t// XXX: It's not clear if this must be called even when newDetachId and nodeChange are undefined.\n\t// XXX: It's not clear if it's okay to call this once with a newDetachId then once with a nodeChange.\n\t// XXX: It's not clear if nodeChange should be rebased already, or should not be rebased, or if it doesn't matter.\n\t/**\n\t * Must be called by a field kind when rebasing over a detach.\n\t * The field kind must provide the nested changes and detach intentions associated with the node in the changeset being rebased.\n\t * @param baseDetachId - The ID of the detach that is being rebased over.\n\t * @param count - The number of nodes detached by the base detach.\n\t * @param newDetachId - The ID associated the detach intention (if any) for these nodes in the rebased changeset.\n\t * @param nodeChange - The nested changes (if any) associated with this node in the rebased changeset.\n\t * @param newDetachCellId - An additional ID to associate with this node.\n\t * This ID will be included in the result of {@link getNewChangesForBaseAttach}.\n\t * This is only used by sequence field for compatibility with earlier client versions.\n\t */\n\trebaseOverDetach(\n\t\tbaseDetachId: ChangeAtomId,\n\t\tcount: number,\n\t\tnewDetachId: ChangeAtomId | undefined,\n\t\tnodeChange: NodeId | undefined,\n\t\tnewDetachCellId?: ChangeAtomId,\n\t): void;\n\n\taddDetach(id: ChangeAtomId, count: number): void;\n\tremoveDetach(id: ChangeAtomId, count: number): void;\n\n\t/**\n\t * Returns whether nodes which were either previously detached by `id` or the base changeset is now detaching with `id`\n\t * are also reattached by the base changeset.\n\t */\n\tdoesBaseAttachNodes(id: ChangeAtomId, count: number): RangeQueryResult<boolean>;\n\n\t/**\n\t * Returns the root ID the base change renames `id` to, if any.\n\t */\n\tgetBaseRename(id: ChangeAtomId, count: number): RangeQueryResult<ChangeAtomId | undefined>;\n\n\t/**\n\t * Given a detached node ID in the base changeset's output context,\n\t * returns the ID the rebased changeset renames that ID to, if any.\n\t */\n\tgetNewRenameForBaseRename(\n\t\tbaseRenameTo: ChangeAtomId,\n\t\tcount: number,\n\t): RangeQueryResult<ChangeAtomId | undefined>;\n}\n\nexport interface DetachedNodeEntry {\n\tnodeChange?: NodeId;\n\tdetachId?: ChangeAtomId;\n}\n\nexport interface RebaseDetachedNodeEntry extends DetachedNodeEntry {\n\t// This is only needed for sequence field to implement detach cell IDs.\n\tcellRename?: ChangeAtomId;\n}\n"]}