@fluidframework/tree 2.102.0 → 2.103.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (367) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/codec/versioned/format.d.ts +5 -4
  3. package/dist/codec/versioned/format.d.ts.map +1 -1
  4. package/dist/codec/versioned/format.js +26 -3
  5. package/dist/codec/versioned/format.js.map +1 -1
  6. package/dist/core/rebase/types.d.ts +4 -3
  7. package/dist/core/rebase/types.d.ts.map +1 -1
  8. package/dist/core/rebase/types.js +27 -4
  9. package/dist/core/rebase/types.js.map +1 -1
  10. package/dist/core/schema-stored/formatV1.d.ts +16 -15
  11. package/dist/core/schema-stored/formatV1.d.ts.map +1 -1
  12. package/dist/core/schema-stored/formatV1.js +31 -8
  13. package/dist/core/schema-stored/formatV1.js.map +1 -1
  14. package/dist/core/schema-stored/formatV2.d.ts +29 -28
  15. package/dist/core/schema-stored/formatV2.d.ts.map +1 -1
  16. package/dist/core/schema-stored/formatV2.js +33 -10
  17. package/dist/core/schema-stored/formatV2.js.map +1 -1
  18. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +11 -10
  19. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  20. package/dist/core/tree/detachedFieldIndexFormatCommon.js +33 -10
  21. package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  22. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +7 -6
  23. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  24. package/dist/core/tree/detachedFieldIndexFormatV2.js +25 -2
  25. package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  26. package/dist/core/tree/persistedTreeTextFormat.d.ts +19 -18
  27. package/dist/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  28. package/dist/core/tree/persistedTreeTextFormat.js +33 -10
  29. package/dist/core/tree/persistedTreeTextFormat.js.map +1 -1
  30. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  31. package/dist/feature-libraries/chunked-forest/chunkTree.js +1 -1
  32. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  33. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts +13 -12
  34. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -1
  35. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js +36 -13
  36. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -1
  37. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.d.ts +36 -35
  38. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.d.ts.map +1 -1
  39. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js +41 -18
  40. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -1
  41. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.d.ts +26 -25
  42. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.d.ts.map +1 -1
  43. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js +27 -4
  44. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -1
  45. package/dist/feature-libraries/chunked-forest/codec/format/formatVText.d.ts +24 -23
  46. package/dist/feature-libraries/chunked-forest/codec/format/formatVText.d.ts.map +1 -1
  47. package/dist/feature-libraries/chunked-forest/codec/format/formatVText.js +30 -7
  48. package/dist/feature-libraries/chunked-forest/codec/format/formatVText.js.map +1 -1
  49. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +66 -14
  50. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  51. package/dist/feature-libraries/chunked-forest/uniformChunk.js +101 -36
  52. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  53. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  54. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +36 -14
  55. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  56. package/dist/feature-libraries/forest-summary/formatCommon.d.ts +6 -5
  57. package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  58. package/dist/feature-libraries/forest-summary/formatCommon.js +26 -3
  59. package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  60. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +4 -3
  61. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
  62. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js +26 -3
  63. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
  64. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +45 -44
  65. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  66. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js +48 -25
  67. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  68. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +23 -22
  69. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
  70. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +29 -6
  71. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
  72. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +9 -8
  73. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
  74. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js +31 -8
  75. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -1
  76. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +14 -13
  77. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
  78. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js +34 -11
  79. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -1
  80. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +5 -4
  81. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  82. package/dist/feature-libraries/schema-edits/schemaChangeFormat.js +25 -2
  83. package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  84. package/dist/feature-libraries/schema-index/formatV1.d.ts +15 -14
  85. package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
  86. package/dist/feature-libraries/schema-index/formatV1.js +27 -4
  87. package/dist/feature-libraries/schema-index/formatV1.js.map +1 -1
  88. package/dist/feature-libraries/schema-index/formatV2.d.ts +20 -19
  89. package/dist/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
  90. package/dist/feature-libraries/schema-index/formatV2.js +27 -4
  91. package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
  92. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  93. package/dist/feature-libraries/sequence-field/compose.js +1 -3
  94. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  95. package/dist/feature-libraries/sequence-field/formatV1.d.ts +283 -282
  96. package/dist/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
  97. package/dist/feature-libraries/sequence-field/formatV1.js +63 -40
  98. package/dist/feature-libraries/sequence-field/formatV1.js.map +1 -1
  99. package/dist/feature-libraries/sequence-field/formatV2.d.ts +180 -179
  100. package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  101. package/dist/feature-libraries/sequence-field/formatV2.js +55 -32
  102. package/dist/feature-libraries/sequence-field/formatV2.js.map +1 -1
  103. package/dist/feature-libraries/sequence-field/formatV3.d.ts +126 -125
  104. package/dist/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
  105. package/dist/feature-libraries/sequence-field/formatV3.js +27 -4
  106. package/dist/feature-libraries/sequence-field/formatV3.js.map +1 -1
  107. package/dist/packageVersion.d.ts +1 -1
  108. package/dist/packageVersion.js +1 -1
  109. package/dist/packageVersion.js.map +1 -1
  110. package/dist/shared-tree/sharedTree.d.ts +2 -2
  111. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  112. package/dist/shared-tree/sharedTree.js.map +1 -1
  113. package/dist/shared-tree/sharedTreeChangeFormat.d.ts +8 -7
  114. package/dist/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
  115. package/dist/shared-tree/sharedTreeChangeFormat.js +28 -5
  116. package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  117. package/dist/shared-tree/treeCheckout.d.ts +3 -3
  118. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  119. package/dist/shared-tree/treeCheckout.js.map +1 -1
  120. package/dist/shared-tree-core/editManager.d.ts +2 -2
  121. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  122. package/dist/shared-tree-core/editManager.js.map +1 -1
  123. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +35 -34
  124. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  125. package/dist/shared-tree-core/editManagerFormatCommons.js +39 -16
  126. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  127. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +15 -15
  128. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  129. package/dist/shared-tree-core/editManagerFormatV1toV4.js +33 -10
  130. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  131. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +40 -40
  132. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  133. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js +27 -4
  134. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
  135. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  136. package/dist/shared-tree-core/messageCodecVSharedBranches.js +25 -2
  137. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  138. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +5 -5
  139. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  140. package/dist/shared-tree-core/messageFormatV1ToV4.js +31 -8
  141. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  142. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts +7 -7
  143. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  144. package/dist/shared-tree-core/messageFormatVSharedBranches.js +29 -6
  145. package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
  146. package/dist/simple-tree/core/treeNodeKernel.d.ts +5 -0
  147. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  148. package/dist/simple-tree/core/treeNodeKernel.js +37 -13
  149. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  150. package/dist/simple-tree/simpleSchemaFormatV1.d.ts +121 -120
  151. package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
  152. package/dist/simple-tree/simpleSchemaFormatV1.js +54 -31
  153. package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  154. package/dist/util/typeboxBrand.d.ts +1 -1
  155. package/dist/util/typeboxBrand.d.ts.map +1 -1
  156. package/dist/util/typeboxBrand.js +26 -3
  157. package/dist/util/typeboxBrand.js.map +1 -1
  158. package/dist/util/utils.d.ts +2 -2
  159. package/dist/util/utils.d.ts.map +1 -1
  160. package/dist/util/utils.js +25 -2
  161. package/dist/util/utils.js.map +1 -1
  162. package/eslint.config.mts +44 -0
  163. package/lib/codec/versioned/format.d.ts +5 -4
  164. package/lib/codec/versioned/format.d.ts.map +1 -1
  165. package/lib/codec/versioned/format.js +1 -1
  166. package/lib/codec/versioned/format.js.map +1 -1
  167. package/lib/core/rebase/types.d.ts +4 -3
  168. package/lib/core/rebase/types.d.ts.map +1 -1
  169. package/lib/core/rebase/types.js +1 -1
  170. package/lib/core/rebase/types.js.map +1 -1
  171. package/lib/core/schema-stored/formatV1.d.ts +16 -15
  172. package/lib/core/schema-stored/formatV1.d.ts.map +1 -1
  173. package/lib/core/schema-stored/formatV1.js +1 -1
  174. package/lib/core/schema-stored/formatV1.js.map +1 -1
  175. package/lib/core/schema-stored/formatV2.d.ts +29 -28
  176. package/lib/core/schema-stored/formatV2.d.ts.map +1 -1
  177. package/lib/core/schema-stored/formatV2.js +1 -1
  178. package/lib/core/schema-stored/formatV2.js.map +1 -1
  179. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +11 -10
  180. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  181. package/lib/core/tree/detachedFieldIndexFormatCommon.js +1 -1
  182. package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  183. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts +7 -6
  184. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  185. package/lib/core/tree/detachedFieldIndexFormatV2.js +1 -1
  186. package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  187. package/lib/core/tree/persistedTreeTextFormat.d.ts +19 -18
  188. package/lib/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  189. package/lib/core/tree/persistedTreeTextFormat.js +1 -1
  190. package/lib/core/tree/persistedTreeTextFormat.js.map +1 -1
  191. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  192. package/lib/feature-libraries/chunked-forest/chunkTree.js +1 -1
  193. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  194. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts +13 -12
  195. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -1
  196. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.js +1 -1
  197. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -1
  198. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.d.ts +36 -35
  199. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.d.ts.map +1 -1
  200. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.js +1 -1
  201. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -1
  202. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.d.ts +26 -25
  203. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.d.ts.map +1 -1
  204. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.js +1 -1
  205. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -1
  206. package/lib/feature-libraries/chunked-forest/codec/format/formatVText.d.ts +24 -23
  207. package/lib/feature-libraries/chunked-forest/codec/format/formatVText.d.ts.map +1 -1
  208. package/lib/feature-libraries/chunked-forest/codec/format/formatVText.js +1 -1
  209. package/lib/feature-libraries/chunked-forest/codec/format/formatVText.js.map +1 -1
  210. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +66 -14
  211. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  212. package/lib/feature-libraries/chunked-forest/uniformChunk.js +101 -36
  213. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  214. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  215. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +36 -14
  216. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  217. package/lib/feature-libraries/forest-summary/formatCommon.d.ts +6 -5
  218. package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  219. package/lib/feature-libraries/forest-summary/formatCommon.js +1 -1
  220. package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  221. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +4 -3
  222. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
  223. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.js +1 -1
  224. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
  225. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +45 -44
  226. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  227. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js +1 -1
  228. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  229. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +23 -22
  230. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
  231. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +1 -1
  232. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
  233. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +9 -8
  234. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
  235. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.js +1 -1
  236. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -1
  237. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +14 -13
  238. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
  239. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.js +1 -1
  240. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -1
  241. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +5 -4
  242. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  243. package/lib/feature-libraries/schema-edits/schemaChangeFormat.js +1 -1
  244. package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  245. package/lib/feature-libraries/schema-index/formatV1.d.ts +15 -14
  246. package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
  247. package/lib/feature-libraries/schema-index/formatV1.js +1 -1
  248. package/lib/feature-libraries/schema-index/formatV1.js.map +1 -1
  249. package/lib/feature-libraries/schema-index/formatV2.d.ts +20 -19
  250. package/lib/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
  251. package/lib/feature-libraries/schema-index/formatV2.js +1 -1
  252. package/lib/feature-libraries/schema-index/formatV2.js.map +1 -1
  253. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  254. package/lib/feature-libraries/sequence-field/compose.js +1 -3
  255. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  256. package/lib/feature-libraries/sequence-field/formatV1.d.ts +283 -282
  257. package/lib/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
  258. package/lib/feature-libraries/sequence-field/formatV1.js +1 -1
  259. package/lib/feature-libraries/sequence-field/formatV1.js.map +1 -1
  260. package/lib/feature-libraries/sequence-field/formatV2.d.ts +180 -179
  261. package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  262. package/lib/feature-libraries/sequence-field/formatV2.js +1 -1
  263. package/lib/feature-libraries/sequence-field/formatV2.js.map +1 -1
  264. package/lib/feature-libraries/sequence-field/formatV3.d.ts +126 -125
  265. package/lib/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
  266. package/lib/feature-libraries/sequence-field/formatV3.js +1 -1
  267. package/lib/feature-libraries/sequence-field/formatV3.js.map +1 -1
  268. package/lib/packageVersion.d.ts +1 -1
  269. package/lib/packageVersion.js +1 -1
  270. package/lib/packageVersion.js.map +1 -1
  271. package/lib/shared-tree/sharedTree.d.ts +2 -2
  272. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  273. package/lib/shared-tree/sharedTree.js +1 -1
  274. package/lib/shared-tree/sharedTree.js.map +1 -1
  275. package/lib/shared-tree/sharedTreeChangeFormat.d.ts +8 -7
  276. package/lib/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
  277. package/lib/shared-tree/sharedTreeChangeFormat.js +1 -1
  278. package/lib/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  279. package/lib/shared-tree/treeCheckout.d.ts +3 -3
  280. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  281. package/lib/shared-tree/treeCheckout.js +1 -1
  282. package/lib/shared-tree/treeCheckout.js.map +1 -1
  283. package/lib/shared-tree-core/editManager.d.ts +2 -2
  284. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  285. package/lib/shared-tree-core/editManager.js.map +1 -1
  286. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +35 -34
  287. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  288. package/lib/shared-tree-core/editManagerFormatCommons.js +1 -1
  289. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  290. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +15 -15
  291. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  292. package/lib/shared-tree-core/editManagerFormatV1toV4.js +1 -1
  293. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  294. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +40 -40
  295. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  296. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js +1 -1
  297. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
  298. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  299. package/lib/shared-tree-core/messageCodecVSharedBranches.js +1 -1
  300. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  301. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +5 -5
  302. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  303. package/lib/shared-tree-core/messageFormatV1ToV4.js +1 -1
  304. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  305. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts +7 -7
  306. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  307. package/lib/shared-tree-core/messageFormatVSharedBranches.js +1 -1
  308. package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
  309. package/lib/simple-tree/core/treeNodeKernel.d.ts +5 -0
  310. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  311. package/lib/simple-tree/core/treeNodeKernel.js +35 -12
  312. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  313. package/lib/simple-tree/simpleSchemaFormatV1.d.ts +121 -120
  314. package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
  315. package/lib/simple-tree/simpleSchemaFormatV1.js +1 -1
  316. package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  317. package/lib/util/typeboxBrand.d.ts +1 -1
  318. package/lib/util/typeboxBrand.d.ts.map +1 -1
  319. package/lib/util/typeboxBrand.js +1 -1
  320. package/lib/util/typeboxBrand.js.map +1 -1
  321. package/lib/util/utils.d.ts +2 -2
  322. package/lib/util/utils.d.ts.map +1 -1
  323. package/lib/util/utils.js +1 -1
  324. package/lib/util/utils.js.map +1 -1
  325. package/package.json +21 -21
  326. package/src/codec/versioned/format.ts +2 -1
  327. package/src/core/rebase/types.ts +1 -1
  328. package/src/core/schema-stored/formatV1.ts +2 -1
  329. package/src/core/schema-stored/formatV2.ts +2 -1
  330. package/src/core/tree/detachedFieldIndexFormatCommon.ts +2 -1
  331. package/src/core/tree/detachedFieldIndexFormatV2.ts +2 -1
  332. package/src/core/tree/persistedTreeTextFormat.ts +2 -1
  333. package/src/feature-libraries/chunked-forest/chunkTree.ts +3 -2
  334. package/src/feature-libraries/chunked-forest/codec/format/formatGeneric.ts +2 -1
  335. package/src/feature-libraries/chunked-forest/codec/format/formatV1.ts +2 -1
  336. package/src/feature-libraries/chunked-forest/codec/format/formatV2.ts +2 -1
  337. package/src/feature-libraries/chunked-forest/codec/format/formatVText.ts +2 -1
  338. package/src/feature-libraries/chunked-forest/uniformChunk.ts +131 -44
  339. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +36 -14
  340. package/src/feature-libraries/forest-summary/formatCommon.ts +2 -1
  341. package/src/feature-libraries/modular-schema/genericFieldKindFormat.ts +2 -1
  342. package/src/feature-libraries/modular-schema/modularChangeFormatV1.ts +2 -1
  343. package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +2 -1
  344. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV1.ts +2 -1
  345. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV2.ts +2 -1
  346. package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +2 -1
  347. package/src/feature-libraries/schema-index/formatV1.ts +2 -1
  348. package/src/feature-libraries/schema-index/formatV2.ts +2 -1
  349. package/src/feature-libraries/sequence-field/compose.ts +1 -4
  350. package/src/feature-libraries/sequence-field/formatV1.ts +2 -1
  351. package/src/feature-libraries/sequence-field/formatV2.ts +2 -1
  352. package/src/feature-libraries/sequence-field/formatV3.ts +2 -1
  353. package/src/packageVersion.ts +1 -1
  354. package/src/shared-tree/sharedTree.ts +2 -5
  355. package/src/shared-tree/sharedTreeChangeFormat.ts +2 -1
  356. package/src/shared-tree/treeCheckout.ts +3 -6
  357. package/src/shared-tree-core/editManager.ts +2 -2
  358. package/src/shared-tree-core/editManagerFormatCommons.ts +2 -1
  359. package/src/shared-tree-core/editManagerFormatV1toV4.ts +2 -1
  360. package/src/shared-tree-core/editManagerFormatVSharedBranches.ts +2 -1
  361. package/src/shared-tree-core/messageCodecVSharedBranches.ts +2 -1
  362. package/src/shared-tree-core/messageFormatV1ToV4.ts +2 -1
  363. package/src/shared-tree-core/messageFormatVSharedBranches.ts +2 -1
  364. package/src/simple-tree/core/treeNodeKernel.ts +39 -15
  365. package/src/simple-tree/simpleSchemaFormatV1.ts +2 -1
  366. package/src/util/typeboxBrand.ts +2 -1
  367. package/src/util/utils.ts +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"optionalFieldChangeFormatV2.js","sourceRoot":"","sources":["../../../src/feature-libraries/optional-field/optionalFieldChangeFormatV2.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAAwF;AAExF,yDAAiE;AAEjE,MAAM,iBAAiB,GA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C,4EAA4E;IAC5E,CAAC,EAAE,8BAAmB;CACtB,EACD,iBAAiB,CACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ObjectOptions, type Static, type TSchema, Type } from \"@sinclair/typebox\";\n\nimport { EncodedChangeAtomId } from \"../modular-schema/index.js\";\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\n// `null` signifies \"self\". Using undefined doesn't actually JSON round-trip conveniently, since\n// undefined is converted to null when inside an array (which happens in e.g. the moves array).\nexport const EncodedRegisterId = Type.Union([EncodedChangeAtomId, Type.Null()]);\nexport type EncodedRegisterId = Static<typeof EncodedRegisterId>;\n\n// Type is intentionally derived.\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport const EncodedOptionalChangeset = <Schema extends TSchema>(tNodeChange: Schema) =>\n\tType.Object(\n\t\t{\n\t\t\t// Moves between detached fields.\n\t\t\t// These entries should not be interpreted as \"applied one after the other\", but rather as\n\t\t\t// \"applied simultaneously\". As such, this list should not contain duplicated src or dst entries.\n\t\t\tm: Type.Optional(Type.Array(EncodedMove)),\n\t\t\t// Nested changes\n\t\t\tc: Type.Optional(EncodedChildChanges(tNodeChange)),\n\t\t\t// How to replace the current value of the field.\n\t\t\tr: Type.Optional(EncodedReplace),\n\t\t},\n\t\tnoAdditionalProps,\n\t);\n\nexport type EncodedOptionalChangeset<Schema extends TSchema> = Static<\n\tReturnType<typeof EncodedOptionalChangeset<Schema>>\n>;\n\n// Type is intentionally derived.\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nconst EncodedChildChanges = <Schema extends TSchema>(tNodeChange: Schema) =>\n\t// Changes to the children of the node that is in the specified register in the input context of this change.\n\tType.Array(Type.Tuple([EncodedRegisterId, tNodeChange]));\n\n// A list of triplets (source, destination, isNodeTargeting) each representing a move of a node\n// from its current source register to a new destination register.\n// If the move is node targeting then the intention is to move a specific node which happens to be in the source register.\n// Otherwise the intention is to move whatever node happens to be in the source register.\n// These entries should not be interpreted as \"applied one after the other\", but rather as \"applied simultaneously\".\n// As such, changesets should not contain duplicated src or dst entries.\nconst EncodedMove = Type.Tuple([EncodedChangeAtomId, EncodedChangeAtomId]);\n\nconst EncodedReplace = Type.Object(\n\t{\n\t\t// Whether the field is empty in the input context of this change.\n\t\te: Type.Boolean(),\n\t\t// The ID for the node to put in this field, or undefined if the field should be emptied.\n\t\t// Will be \"self\" when the intention is to keep the current node in this field.\n\t\ts: Type.Optional(EncodedRegisterId),\n\t\t// An ID to associate with the node (if any) which is detached by this edit.\n\t\td: EncodedChangeAtomId,\n\t},\n\tnoAdditionalProps,\n);\nexport type EncodedReplace = Static<typeof EncodedReplace>;\n"]}
1
+ {"version":3,"file":"optionalFieldChangeFormatV2.js","sourceRoot":"","sources":["../../../src/feature-libraries/optional-field/optionalFieldChangeFormatV2.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,wDAA0C;AAG1C,yDAAiE;AAEjE,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAEzE,gGAAgG;AAChG,+FAA+F;AAClF,QAAA,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,8BAAmB,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAGhF,iCAAiC;AACjC,4EAA4E;AACrE,MAAM,wBAAwB,GAAG,CAAyB,WAAmB,EAAE,EAAE,CACvF,IAAI,CAAC,MAAM,CACV;IACC,iCAAiC;IACjC,0FAA0F;IAC1F,iGAAiG;IACjG,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACzC,iBAAiB;IACjB,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAClD,iDAAiD;IACjD,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC;CAChC,EACD,iBAAiB,CACjB,CAAC;AAbU,QAAA,wBAAwB,4BAalC;AAMH,iCAAiC;AACjC,4EAA4E;AAC5E,MAAM,mBAAmB,GAAG,CAAyB,WAAmB,EAAE,EAAE;AAC3E,6GAA6G;AAC7G,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,yBAAiB,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;AAE1D,+FAA+F;AAC/F,kEAAkE;AAClE,0HAA0H;AAC1H,yFAAyF;AACzF,oHAAoH;AACpH,wEAAwE;AACxE,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,8BAAmB,EAAE,8BAAmB,CAAC,CAAC,CAAC;AAE3E,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CACjC;IACC,kEAAkE;IAClE,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE;IACjB,yFAAyF;IACzF,+EAA+E;IAC/E,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,yBAAiB,CAAC;IACnC,4EAA4E;IAC5E,CAAC,EAAE,8BAAmB;CACtB,EACD,iBAAiB,CACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as Type from \"@sinclair/typebox\";\nimport type { ObjectOptions, Static, TSchema } from \"@sinclair/typebox\";\n\nimport { EncodedChangeAtomId } from \"../modular-schema/index.js\";\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\n// `null` signifies \"self\". Using undefined doesn't actually JSON round-trip conveniently, since\n// undefined is converted to null when inside an array (which happens in e.g. the moves array).\nexport const EncodedRegisterId = Type.Union([EncodedChangeAtomId, Type.Null()]);\nexport type EncodedRegisterId = Static<typeof EncodedRegisterId>;\n\n// Type is intentionally derived.\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport const EncodedOptionalChangeset = <Schema extends TSchema>(tNodeChange: Schema) =>\n\tType.Object(\n\t\t{\n\t\t\t// Moves between detached fields.\n\t\t\t// These entries should not be interpreted as \"applied one after the other\", but rather as\n\t\t\t// \"applied simultaneously\". As such, this list should not contain duplicated src or dst entries.\n\t\t\tm: Type.Optional(Type.Array(EncodedMove)),\n\t\t\t// Nested changes\n\t\t\tc: Type.Optional(EncodedChildChanges(tNodeChange)),\n\t\t\t// How to replace the current value of the field.\n\t\t\tr: Type.Optional(EncodedReplace),\n\t\t},\n\t\tnoAdditionalProps,\n\t);\n\nexport type EncodedOptionalChangeset<Schema extends TSchema> = Static<\n\tReturnType<typeof EncodedOptionalChangeset<Schema>>\n>;\n\n// Type is intentionally derived.\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nconst EncodedChildChanges = <Schema extends TSchema>(tNodeChange: Schema) =>\n\t// Changes to the children of the node that is in the specified register in the input context of this change.\n\tType.Array(Type.Tuple([EncodedRegisterId, tNodeChange]));\n\n// A list of triplets (source, destination, isNodeTargeting) each representing a move of a node\n// from its current source register to a new destination register.\n// If the move is node targeting then the intention is to move a specific node which happens to be in the source register.\n// Otherwise the intention is to move whatever node happens to be in the source register.\n// These entries should not be interpreted as \"applied one after the other\", but rather as \"applied simultaneously\".\n// As such, changesets should not contain duplicated src or dst entries.\nconst EncodedMove = Type.Tuple([EncodedChangeAtomId, EncodedChangeAtomId]);\n\nconst EncodedReplace = Type.Object(\n\t{\n\t\t// Whether the field is empty in the input context of this change.\n\t\te: Type.Boolean(),\n\t\t// The ID for the node to put in this field, or undefined if the field should be emptied.\n\t\t// Will be \"self\" when the intention is to keep the current node in this field.\n\t\ts: Type.Optional(EncodedRegisterId),\n\t\t// An ID to associate with the node (if any) which is detached by this edit.\n\t\td: EncodedChangeAtomId,\n\t},\n\tnoAdditionalProps,\n);\nexport type EncodedReplace = Static<typeof EncodedReplace>;\n"]}
@@ -2,10 +2,11 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type Static } from "@sinclair/typebox";
6
- export declare const EncodedSchemaChange: import("@sinclair/typebox").TObject<{
7
- new: import("@sinclair/typebox").TUnsafe<import("../../util/utils.js").JsonCompatibleReadOnly>;
8
- old: import("@sinclair/typebox").TUnsafe<import("../../util/utils.js").JsonCompatibleReadOnly>;
5
+ import * as Type from "@sinclair/typebox";
6
+ import type { Static } from "@sinclair/typebox";
7
+ export declare const EncodedSchemaChange: Type.TObject<{
8
+ new: Type.TUnsafe<import("../../util/utils.js").JsonCompatibleReadOnly>;
9
+ old: Type.TUnsafe<import("../../util/utils.js").JsonCompatibleReadOnly>;
9
10
  }>;
10
11
  export type EncodedSchemaChange = Static<typeof EncodedSchemaChange>;
11
12
  //# sourceMappingURL=schemaChangeFormat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemaChangeFormat.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAItD,eAAO,MAAM,mBAAmB;;;EAG9B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
1
+ {"version":3,"file":"schemaChangeFormat.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIhD,eAAO,MAAM,mBAAmB;;;EAG9B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -3,11 +3,34 @@
3
3
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
4
  * Licensed under the MIT License.
5
5
  */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
19
+ }) : function(o, v) {
20
+ o["default"] = v;
21
+ });
22
+ var __importStar = (this && this.__importStar) || function (mod) {
23
+ if (mod && mod.__esModule) return mod;
24
+ var result = {};
25
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26
+ __setModuleDefault(result, mod);
27
+ return result;
28
+ };
6
29
  Object.defineProperty(exports, "__esModule", { value: true });
7
30
  exports.EncodedSchemaChange = void 0;
8
- const typebox_1 = require("@sinclair/typebox");
31
+ const Type = __importStar(require("@sinclair/typebox"));
9
32
  const index_js_1 = require("../../util/index.js");
10
- exports.EncodedSchemaChange = typebox_1.Type.Object({
33
+ exports.EncodedSchemaChange = Type.Object({
11
34
  new: index_js_1.JsonCompatibleReadOnlySchema,
12
35
  old: index_js_1.JsonCompatibleReadOnlySchema,
13
36
  });
@@ -1 +1 @@
1
- {"version":3,"file":"schemaChangeFormat.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeFormat.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAAsD;AAEtD,kDAAmE;AAEtD,QAAA,mBAAmB,GAAG,cAAI,CAAC,MAAM,CAAC;IAC9C,GAAG,EAAE,uCAA4B;IACjC,GAAG,EAAE,uCAA4B;CACjC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type Static, Type } from \"@sinclair/typebox\";\n\nimport { JsonCompatibleReadOnlySchema } from \"../../util/index.js\";\n\nexport const EncodedSchemaChange = Type.Object({\n\tnew: JsonCompatibleReadOnlySchema,\n\told: JsonCompatibleReadOnlySchema,\n});\n\nexport type EncodedSchemaChange = Static<typeof EncodedSchemaChange>;\n"]}
1
+ {"version":3,"file":"schemaChangeFormat.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeFormat.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,wDAA0C;AAG1C,kDAAmE;AAEtD,QAAA,mBAAmB,GAAG,IAAI,CAAC,MAAM,CAAC;IAC9C,GAAG,EAAE,uCAA4B;IACjC,GAAG,EAAE,uCAA4B;CACjC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as Type from \"@sinclair/typebox\";\nimport type { Static } from \"@sinclair/typebox\";\n\nimport { JsonCompatibleReadOnlySchema } from \"../../util/index.js\";\n\nexport const EncodedSchemaChange = Type.Object({\n\tnew: JsonCompatibleReadOnlySchema,\n\told: JsonCompatibleReadOnlySchema,\n});\n\nexport type EncodedSchemaChange = Static<typeof EncodedSchemaChange>;\n"]}
@@ -2,7 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type Static } from "@sinclair/typebox";
5
+ import * as Type from "@sinclair/typebox";
6
+ import type { Static } from "@sinclair/typebox";
6
7
  import { schemaFormatV1 } from "../../core/index.js";
7
8
  /**
8
9
  * Format for encoding as json.
@@ -14,22 +15,22 @@ import { schemaFormatV1 } from "../../core/index.js";
14
15
  * which can sometimes be an issue (for example handling that for "__proto__" can require care).
15
16
  * It also makes it simpler to determinately sort by keys.
16
17
  */
17
- export declare const Format: import("@sinclair/typebox").TObject<{
18
- version: import("@sinclair/typebox").TLiteral<import("../../util/brand.js").Brand<1, "SchemaFormatVersion">>;
19
- nodes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
20
- object: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
21
- kind: import("@sinclair/typebox").TUnsafe<schemaFormatV1.FieldKindIdentifier>;
22
- types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<schemaFormatV1.TreeNodeSchemaIdentifier<string>>>;
18
+ export declare const Format: Type.TObject<{
19
+ version: Type.TLiteral<import("../../util/brand.js").Brand<1, "SchemaFormatVersion">>;
20
+ nodes: Type.TRecord<Type.TString, Type.TObject<{
21
+ object: Type.TOptional<Type.TRecord<Type.TString, Type.TObject<{
22
+ kind: Type.TUnsafe<schemaFormatV1.FieldKindIdentifier>;
23
+ types: Type.TArray<Type.TUnsafe<schemaFormatV1.TreeNodeSchemaIdentifier<string>>>;
23
24
  }>>>;
24
- map: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
25
- kind: import("@sinclair/typebox").TUnsafe<schemaFormatV1.FieldKindIdentifier>;
26
- types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<schemaFormatV1.TreeNodeSchemaIdentifier<string>>>;
25
+ map: Type.TOptional<Type.TObject<{
26
+ kind: Type.TUnsafe<schemaFormatV1.FieldKindIdentifier>;
27
+ types: Type.TArray<Type.TUnsafe<schemaFormatV1.TreeNodeSchemaIdentifier<string>>>;
27
28
  }>>;
28
- leaf: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof schemaFormatV1.PersistedValueSchema>>;
29
+ leaf: Type.TOptional<Type.TEnum<typeof schemaFormatV1.PersistedValueSchema>>;
29
30
  }>>;
30
- root: import("@sinclair/typebox").TObject<{
31
- kind: import("@sinclair/typebox").TUnsafe<schemaFormatV1.FieldKindIdentifier>;
32
- types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<schemaFormatV1.TreeNodeSchemaIdentifier<string>>>;
31
+ root: Type.TObject<{
32
+ kind: Type.TUnsafe<schemaFormatV1.FieldKindIdentifier>;
33
+ types: Type.TArray<Type.TUnsafe<schemaFormatV1.TreeNodeSchemaIdentifier<string>>>;
33
34
  }>;
34
35
  }>;
35
36
  export type Format = Static<typeof Format>;
@@ -1 +1 @@
1
- {"version":3,"file":"formatV1.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/formatV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAsB,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAE1E,OAAO,EAAuB,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1E;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;EAOlB,CAAC;AACF,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"formatV1.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/formatV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,EAAiB,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAuB,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1E;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;EAOlB,CAAC;AACF,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,MAAM,CAAC,CAAC"}
@@ -3,9 +3,32 @@
3
3
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
4
  * Licensed under the MIT License.
5
5
  */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
19
+ }) : function(o, v) {
20
+ o["default"] = v;
21
+ });
22
+ var __importStar = (this && this.__importStar) || function (mod) {
23
+ if (mod && mod.__esModule) return mod;
24
+ var result = {};
25
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26
+ __setModuleDefault(result, mod);
27
+ return result;
28
+ };
6
29
  Object.defineProperty(exports, "__esModule", { value: true });
7
30
  exports.Format = void 0;
8
- const typebox_1 = require("@sinclair/typebox");
31
+ const Type = __importStar(require("@sinclair/typebox"));
9
32
  const index_js_1 = require("../../core/index.js");
10
33
  const noAdditionalProps = { additionalProperties: false };
11
34
  /**
@@ -18,9 +41,9 @@ const noAdditionalProps = { additionalProperties: false };
18
41
  * which can sometimes be an issue (for example handling that for "__proto__" can require care).
19
42
  * It also makes it simpler to determinately sort by keys.
20
43
  */
21
- exports.Format = typebox_1.Type.Object({
22
- version: typebox_1.Type.Literal(index_js_1.SchemaFormatVersion.v1),
23
- nodes: typebox_1.Type.Record(typebox_1.Type.String(), index_js_1.schemaFormatV1.TreeNodeSchemaDataFormat),
44
+ exports.Format = Type.Object({
45
+ version: Type.Literal(index_js_1.SchemaFormatVersion.v1),
46
+ nodes: Type.Record(Type.String(), index_js_1.schemaFormatV1.TreeNodeSchemaDataFormat),
24
47
  root: index_js_1.schemaFormatV1.FieldSchemaFormat,
25
48
  }, noAdditionalProps);
26
49
  //# sourceMappingURL=formatV1.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatV1.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/formatV1.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA0E;AAE1E,kDAA0E;AAE1E,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAEzE;;;;;;;;;GASG;AACU,QAAA,MAAM,GAAG,cAAI,CAAC,MAAM,CAChC;IACC,OAAO,EAAE,cAAI,CAAC,OAAO,CAAC,8BAAmB,CAAC,EAAE,CAAC;IAC7C,KAAK,EAAE,cAAI,CAAC,MAAM,CAAC,cAAI,CAAC,MAAM,EAAE,EAAE,yBAAc,CAAC,wBAAwB,CAAC;IAC1E,IAAI,EAAE,yBAAc,CAAC,iBAAiB;CACtC,EACD,iBAAiB,CACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ObjectOptions, type Static, Type } from \"@sinclair/typebox\";\n\nimport { SchemaFormatVersion, schemaFormatV1 } from \"../../core/index.js\";\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\n/**\n * Format for encoding as json.\n *\n * For consistency all lists are sorted and undefined values are omitted.\n *\n * This chooses to use lists of named objects instead of maps:\n * this choice is somewhat arbitrary, but avoids user data being used as object keys,\n * which can sometimes be an issue (for example handling that for \"__proto__\" can require care).\n * It also makes it simpler to determinately sort by keys.\n */\nexport const Format = Type.Object(\n\t{\n\t\tversion: Type.Literal(SchemaFormatVersion.v1),\n\t\tnodes: Type.Record(Type.String(), schemaFormatV1.TreeNodeSchemaDataFormat),\n\t\troot: schemaFormatV1.FieldSchemaFormat,\n\t},\n\tnoAdditionalProps,\n);\nexport type Format = Static<typeof Format>;\n"]}
1
+ {"version":3,"file":"formatV1.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/formatV1.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,wDAA0C;AAG1C,kDAA0E;AAE1E,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAEzE;;;;;;;;;GASG;AACU,QAAA,MAAM,GAAG,IAAI,CAAC,MAAM,CAChC;IACC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,8BAAmB,CAAC,EAAE,CAAC;IAC7C,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,yBAAc,CAAC,wBAAwB,CAAC;IAC1E,IAAI,EAAE,yBAAc,CAAC,iBAAiB;CACtC,EACD,iBAAiB,CACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as Type from \"@sinclair/typebox\";\nimport type { ObjectOptions, Static } from \"@sinclair/typebox\";\n\nimport { SchemaFormatVersion, schemaFormatV1 } from \"../../core/index.js\";\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\n/**\n * Format for encoding as json.\n *\n * For consistency all lists are sorted and undefined values are omitted.\n *\n * This chooses to use lists of named objects instead of maps:\n * this choice is somewhat arbitrary, but avoids user data being used as object keys,\n * which can sometimes be an issue (for example handling that for \"__proto__\" can require care).\n * It also makes it simpler to determinately sort by keys.\n */\nexport const Format = Type.Object(\n\t{\n\t\tversion: Type.Literal(SchemaFormatVersion.v1),\n\t\tnodes: Type.Record(Type.String(), schemaFormatV1.TreeNodeSchemaDataFormat),\n\t\troot: schemaFormatV1.FieldSchemaFormat,\n\t},\n\tnoAdditionalProps,\n);\nexport type Format = Static<typeof Format>;\n"]}
@@ -2,7 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type Static } from "@sinclair/typebox";
5
+ import * as Type from "@sinclair/typebox";
6
+ import type { Static } from "@sinclair/typebox";
6
7
  /**
7
8
  * Format for encoding as json.
8
9
  *
@@ -13,28 +14,28 @@ import { type Static } from "@sinclair/typebox";
13
14
  * which can sometimes be an issue (for example handling that for "__proto__" can require care).
14
15
  * It also makes it simpler to deterministically sort by keys.
15
16
  */
16
- export declare const Format: import("@sinclair/typebox").TObject<{
17
- version: import("@sinclair/typebox").TLiteral<import("../../util/brand.js").Brand<2, "SchemaFormatVersion">>;
18
- nodes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
19
- kind: import("@sinclair/typebox").TObject<{
20
- object: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
21
- kind: import("@sinclair/typebox").TUnsafe<import("../../core/index.js").FieldKindIdentifier>;
22
- types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("../../core/index.js").TreeNodeSchemaIdentifier<string>>>;
23
- metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<import("../../index.js").JsonCompatibleReadOnlyObject>>;
17
+ export declare const Format: Type.TObject<{
18
+ version: Type.TLiteral<import("../../util/brand.js").Brand<2, "SchemaFormatVersion">>;
19
+ nodes: Type.TRecord<Type.TString, Type.TObject<{
20
+ kind: Type.TObject<{
21
+ object: Type.TOptional<Type.TRecord<Type.TString, Type.TObject<{
22
+ kind: Type.TUnsafe<import("../../core/index.js").FieldKindIdentifier>;
23
+ types: Type.TArray<Type.TUnsafe<import("../../core/index.js").TreeNodeSchemaIdentifier<string>>>;
24
+ metadata: Type.TOptional<Type.TUnsafe<import("../../index.js").JsonCompatibleReadOnlyObject>>;
24
25
  }>>>;
25
- map: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
26
- kind: import("@sinclair/typebox").TUnsafe<import("../../core/index.js").FieldKindIdentifier>;
27
- types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("../../core/index.js").TreeNodeSchemaIdentifier<string>>>;
28
- metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<import("../../index.js").JsonCompatibleReadOnlyObject>>;
26
+ map: Type.TOptional<Type.TObject<{
27
+ kind: Type.TUnsafe<import("../../core/index.js").FieldKindIdentifier>;
28
+ types: Type.TArray<Type.TUnsafe<import("../../core/index.js").TreeNodeSchemaIdentifier<string>>>;
29
+ metadata: Type.TOptional<Type.TUnsafe<import("../../index.js").JsonCompatibleReadOnlyObject>>;
29
30
  }>>;
30
- leaf: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof import("../../core/schema-stored/formatV1.js").PersistedValueSchema>>;
31
+ leaf: Type.TOptional<Type.TEnum<typeof import("../../core/schema-stored/formatV1.js").PersistedValueSchema>>;
31
32
  }>;
32
- metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<import("../../index.js").JsonCompatibleReadOnlyObject>>;
33
+ metadata: Type.TOptional<Type.TUnsafe<import("../../index.js").JsonCompatibleReadOnlyObject>>;
33
34
  }>>;
34
- root: import("@sinclair/typebox").TObject<{
35
- kind: import("@sinclair/typebox").TUnsafe<import("../../core/index.js").FieldKindIdentifier>;
36
- types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("../../core/index.js").TreeNodeSchemaIdentifier<string>>>;
37
- metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<import("../../index.js").JsonCompatibleReadOnlyObject>>;
35
+ root: Type.TObject<{
36
+ kind: Type.TUnsafe<import("../../core/index.js").FieldKindIdentifier>;
37
+ types: Type.TArray<Type.TUnsafe<import("../../core/index.js").TreeNodeSchemaIdentifier<string>>>;
38
+ metadata: Type.TOptional<Type.TUnsafe<import("../../index.js").JsonCompatibleReadOnlyObject>>;
38
39
  }>;
39
40
  }>;
40
41
  export type Format = Static<typeof Format>;
@@ -1 +1 @@
1
- {"version":3,"file":"formatV2.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/formatV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAsB,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAM1E;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;EAOlB,CAAC;AACF,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"formatV2.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/formatV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,EAAiB,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAM/D;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;EAOlB,CAAC;AACF,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,MAAM,CAAC,CAAC"}
@@ -3,9 +3,32 @@
3
3
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
4
  * Licensed under the MIT License.
5
5
  */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
19
+ }) : function(o, v) {
20
+ o["default"] = v;
21
+ });
22
+ var __importStar = (this && this.__importStar) || function (mod) {
23
+ if (mod && mod.__esModule) return mod;
24
+ var result = {};
25
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26
+ __setModuleDefault(result, mod);
27
+ return result;
28
+ };
6
29
  Object.defineProperty(exports, "__esModule", { value: true });
7
30
  exports.Format = void 0;
8
- const typebox_1 = require("@sinclair/typebox");
31
+ const Type = __importStar(require("@sinclair/typebox"));
9
32
  const index_js_1 = require("../../core/index.js");
10
33
  const noAdditionalProps = { additionalProperties: false };
11
34
  /**
@@ -18,9 +41,9 @@ const noAdditionalProps = { additionalProperties: false };
18
41
  * which can sometimes be an issue (for example handling that for "__proto__" can require care).
19
42
  * It also makes it simpler to deterministically sort by keys.
20
43
  */
21
- exports.Format = typebox_1.Type.Object({
22
- version: typebox_1.Type.Literal(index_js_1.SchemaFormatVersion.v2),
23
- nodes: typebox_1.Type.Record(typebox_1.Type.String(), index_js_1.schemaFormatV2.TreeNodeSchemaDataFormat),
44
+ exports.Format = Type.Object({
45
+ version: Type.Literal(index_js_1.SchemaFormatVersion.v2),
46
+ nodes: Type.Record(Type.String(), index_js_1.schemaFormatV2.TreeNodeSchemaDataFormat),
24
47
  root: index_js_1.schemaFormatV2.FieldSchemaFormat,
25
48
  }, noAdditionalProps);
26
49
  //# sourceMappingURL=formatV2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatV2.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/formatV2.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA0E;AAE1E,kDAA0E;AAE1E,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAEzE;;;;;;;;;GASG;AACU,QAAA,MAAM,GAAG,cAAI,CAAC,MAAM,CAChC;IACC,OAAO,EAAE,cAAI,CAAC,OAAO,CAAC,8BAAmB,CAAC,EAAE,CAAC;IAC7C,KAAK,EAAE,cAAI,CAAC,MAAM,CAAC,cAAI,CAAC,MAAM,EAAE,EAAE,yBAAc,CAAC,wBAAwB,CAAC;IAC1E,IAAI,EAAE,yBAAc,CAAC,iBAAiB;CACtC,EACD,iBAAiB,CACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ObjectOptions, type Static, Type } from \"@sinclair/typebox\";\n\nimport { SchemaFormatVersion, schemaFormatV2 } from \"../../core/index.js\";\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\n/**\n * Format for encoding as json.\n *\n * For consistency all lists are sorted and undefined values are omitted.\n *\n * This chooses to use lists of named objects instead of maps:\n * this choice is somewhat arbitrary, but avoids user data being used as object keys,\n * which can sometimes be an issue (for example handling that for \"__proto__\" can require care).\n * It also makes it simpler to deterministically sort by keys.\n */\nexport const Format = Type.Object(\n\t{\n\t\tversion: Type.Literal(SchemaFormatVersion.v2),\n\t\tnodes: Type.Record(Type.String(), schemaFormatV2.TreeNodeSchemaDataFormat),\n\t\troot: schemaFormatV2.FieldSchemaFormat,\n\t},\n\tnoAdditionalProps,\n);\nexport type Format = Static<typeof Format>;\n"]}
1
+ {"version":3,"file":"formatV2.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/formatV2.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,wDAA0C;AAG1C,kDAA0E;AAE1E,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAEzE;;;;;;;;;GASG;AACU,QAAA,MAAM,GAAG,IAAI,CAAC,MAAM,CAChC;IACC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,8BAAmB,CAAC,EAAE,CAAC;IAC7C,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,yBAAc,CAAC,wBAAwB,CAAC;IAC1E,IAAI,EAAE,yBAAc,CAAC,iBAAiB;CACtC,EACD,iBAAiB,CACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as Type from \"@sinclair/typebox\";\nimport type { ObjectOptions, Static } from \"@sinclair/typebox\";\n\nimport { SchemaFormatVersion, schemaFormatV2 } from \"../../core/index.js\";\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\n/**\n * Format for encoding as json.\n *\n * For consistency all lists are sorted and undefined values are omitted.\n *\n * This chooses to use lists of named objects instead of maps:\n * this choice is somewhat arbitrary, but avoids user data being used as object keys,\n * which can sometimes be an issue (for example handling that for \"__proto__\" can require care).\n * It also makes it simpler to deterministically sort by keys.\n */\nexport const Format = Type.Object(\n\t{\n\t\tversion: Type.Literal(SchemaFormatVersion.v2),\n\t\tnodes: Type.Record(Type.String(), schemaFormatV2.TreeNodeSchemaDataFormat),\n\t\troot: schemaFormatV2.FieldSchemaFormat,\n\t},\n\tnoAdditionalProps,\n);\nexport type Format = Static<typeof Format>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/compose.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAEN,KAAK,sBAAsB,EAG3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACN,KAAK,iBAAiB,EAEtB,KAAK,kBAAkB,EAEvB,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EAEN,KAAK,eAAe,EAQpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAGN,KAAK,SAAS,EAEd,KAAK,IAAI,EAMT,MAAM,YAAY,CAAC;AA6BpB;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CACtB,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,SAAS,EAClB,YAAY,EAAE,kBAAkB,EAChC,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,iBAAiB,EAC1B,gBAAgB,EAAE,sBAAsB,GACtC,SAAS,CAQX;AAuZD,q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AAiB,EAC1B,gBAAgB,EAAE,sBAAsB,GACtC,SAAS,CAQX;AAwZD,qBAAa,YAAY;IASvB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IATlC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAY;IACrC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAuC;IAC5E,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAuC;gBAG1E,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,SAAS,EACF,WAAW,EAAE,eAAe,EAC5B,gBAAgB,EAAE,sBAAsB;IAQnD,OAAO,IAAI,OAAO;IAIlB,GAAG,IAAI,YAAY;IAyD1B,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,WAAW;IAiBnB,OAAO,CAAC,aAAa;CAUrB;AAED,UAAU,YAAY;IACrB,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,OAAO,CAAC,EAAE,IAAI,CAAC;CACf"}
@@ -242,6 +242,7 @@ function createNoopMark(length, nodeChange, cellId) {
242
242
  }
243
243
  function handleNodeChanges(baseMark, newMark, composeChild, moveEffects) {
244
244
  if (newMark.changes !== undefined) {
245
+ moveEffects.onMoveIn(newMark.changes);
245
246
  const baseSource = (0, moveEffectTable_js_1.getMoveIn)(baseMark);
246
247
  // TODO: Make sure composeChild is not called twice on the node changes.
247
248
  if (baseSource !== undefined) {
@@ -327,9 +328,6 @@ class ComposeQueue {
327
328
  dequeueBase(length = Number.POSITIVE_INFINITY) {
328
329
  const baseMark = this.baseMarks.dequeueUpTo(length);
329
330
  const movedChanges = getMovedChangesFromMark(this.moveEffects, baseMark);
330
- if (movedChanges !== undefined) {
331
- this.moveEffects.onMoveIn(movedChanges);
332
- }
333
331
  const newMark = createNoopMark(baseMark.count, movedChanges, (0, utils_js_1.getOutputCellId)(baseMark));
334
332
  return { baseMark, newMark };
335
333
  }
@@ -1 +1 @@
1
- {"version":3,"file":"compose.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/compose.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAEpF,kDAK6B;AAE7B,yDAKoC;AAGpC,6DAAuD;AACvD,iDAA2C;AAC3C,6DAU8B;AAC9B,yCAWoB;AACpB,yCA0BoB;AAEpB;;;;;;;;;;;GAWG;AACH,SAAgB,OAAO,CACtB,OAAkB,EAClB,OAAkB,EAClB,YAAgC,EAChC,MAAmB,EACnB,OAA0B,EAC1B,gBAAwC;IAExC,OAAO,gBAAgB,CACtB,OAAO,EACP,OAAO,EACP,YAAY,EACZ,OAA0B,EAC1B,gBAAgB,CAChB,CAAC;AACH,CAAC;AAfD,0BAeC;AAED,SAAS,gBAAgB,CACxB,YAAsB,EACtB,WAAqB,EACrB,YAAgC,EAChC,WAA4B,EAC5B,gBAAwC;IAExC,MAAM,OAAO,GAAG,IAAI,oCAAe,EAAE,CAAC;IACtC,MAAM,KAAK,GAAG,IAAI,YAAY,CAAC,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,CAAC,CAAC;IACzF,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;QACzB,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;QAC1C,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC3B,IAAA,iBAAM,EACL,QAAQ,KAAK,SAAS,EACtB,KAAK,CAAC,2DAA2D,CACjE,CAAC;YACF,OAAO,CAAC,IAAI,CACX,WAAW,CAAC,QAAQ,EAAE,WAAW,EAAE,CAAC,IAAY,EAAE,EAAE,CACnD,mBAAmB,CAAC,IAAI,EAAE,SAAS,EAAE,YAAY,CAAC,CAClD,CACD,CAAC;QACH,CAAC;aAAM,CAAC;YACP,+DAA+D;YAC/D,kGAAkG;YAClG,MAA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,EAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;QAC9E,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;SAAM,CAAC;QACP,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC;IAC/B,CAAC;AACF,CAAC;AAED,SAAS,mBAAmB,CAC3B,WAA4B,EAC5B,MAAwB,EACxB,QAAiC,EACjC,EAAU,EACV,KAAa;IAEb,MAAM,MAAM,GAAG,IAAA,kCAAa,EAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IACvE,IAAA,iBAAM,EAAC,MAAM,CAAC,MAAM,KAAK,KAAK,EAAE,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAClF,OAAO,MAAM,CAAC,KAAK,EAAE,iBAAiB,IAAI,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC;AAClE,CAAC;AAED,SAAS,4BAA4B,CACpC,WAA4B,EAC5B,MAAwB,EACxB,QAAiC,EACjC,EAAU,EACV,KAAa;IAEb,MAAM,MAAM,GAAG,IAAA,kCAAa,EAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IACvE,IAAA,iBAAM,EAAC,MAAM,CAAC,MAAM,KAAK,KAAK,EAAE,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAClF,OAAO,MAAM,CAAC,KAAK,EAAE,yBAAyB,CAAC;AAChD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ChangeAtomId,\n\ttype RevisionMetadataSource,\n\ttype RevisionTag,\n\toffsetChangeAtomId,\n} from \"../../core/index.js\";\nimport type { IdAllocator } from \"../../util/index.js\";\nimport {\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\ttype NodeChangeComposer,\n\ttype NodeId,\n} from \"../modular-schema/index.js\";\n\nimport type { MoveMarkEffect } from \"./helperTypes.js\";\nimport { MarkListFactory } from \"./markListFactory.js\";\nimport { MarkQueue } from \"./markQueue.js\";\nimport {\n\ttype MoveEffect,\n\ttype MoveEffectTable,\n\tgetCrossFieldTargetFromMove,\n\tgetMoveEffect,\n\tgetMoveIn,\n\tisMoveIn,\n\tisMoveMark,\n\tisMoveOut,\n\tsetMoveEffect,\n} from \"./moveEffectTable.js\";\nimport {\n\ttype Attach,\n\ttype CellMark,\n\ttype Changeset,\n\ttype Detach,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype MarkList,\n\ttype MoveId,\n\ttype NoopMark,\n\tNoopMarkType,\n} from \"./types.js\";\nimport {\n\tCellOrder,\n\tareEqualCellIds,\n\tareInputCellsEmpty,\n\tareOutputCellsEmpty,\n\tasAttachAndDetach,\n\tcellSourcesFromMarks,\n\tcompareCellPositionsUsingTombstones,\n\textractMarkEffect,\n\tgetEndpoint,\n\tgetInputCellId,\n\tgetOutputCellId,\n\tisAttach,\n\tisAttachAndDetachEffect,\n\tisDetach,\n\tisImpactfulCellRename,\n\tisNewAttach,\n\tisNoopMark,\n\tisRename,\n\tmarkEmptiesCells,\n\tmarkFillsCells,\n\tmarkHasCellEffect,\n\tnormalizeCellRename,\n\tsettleMark,\n\twithNodeChange,\n\twithRevision,\n} from \"./utils.js\";\n\n/**\n * Composes a sequence of changesets into a single changeset.\n * @param changes - The changesets to be applied.\n * Parts of the input may be reused in the output, but the input is not mutated.\n * Each changeset in the list is assumed to be applicable after the previous one.\n * @returns A changeset that is equivalent to applying each of the given `changes` in order.\n *\n * WARNING! This implementation is incomplete:\n * - Tombstone information is ignored.\n * - Support for moves is not implemented.\n * - Support for slices is not implemented.\n */\nexport function compose(\n\tchange1: Changeset,\n\tchange2: Changeset,\n\tcomposeChild: NodeChangeComposer,\n\t_genId: IdAllocator,\n\tmanager: CrossFieldManager,\n\trevisionMetadata: RevisionMetadataSource,\n): Changeset {\n\treturn composeMarkLists(\n\t\tchange1,\n\t\tchange2,\n\t\tcomposeChild,\n\t\tmanager as MoveEffectTable,\n\t\trevisionMetadata,\n\t);\n}\n\nfunction composeMarkLists(\n\tbaseMarkList: MarkList,\n\tnewMarkList: MarkList,\n\tcomposeChild: NodeChangeComposer,\n\tmoveEffects: MoveEffectTable,\n\trevisionMetadata: RevisionMetadataSource,\n): MarkList {\n\tconst factory = new MarkListFactory();\n\tconst queue = new ComposeQueue(baseMarkList, newMarkList, moveEffects, revisionMetadata);\n\twhile (!queue.isEmpty()) {\n\t\tconst { baseMark, newMark } = queue.pop();\n\t\tif (newMark === undefined) {\n\t\t\tassert(\n\t\t\t\tbaseMark !== undefined,\n\t\t\t\t0x4db /* Non-empty queue should not return two undefined marks */,\n\t\t\t);\n\t\t\tfactory.push(\n\t\t\t\tcomposeMark(baseMark, moveEffects, (node: NodeId) =>\n\t\t\t\t\tcomposeChildChanges(node, undefined, composeChild),\n\t\t\t\t),\n\t\t\t);\n\t\t} else {\n\t\t\t// We only compose changesets that will not be further rebased.\n\t\t\t// It is therefore safe to remove any intentions that have no impact in the context they apply to.\n\t\t\tconst settledNewMark = settleMark(newMark);\n\t\t\tif (baseMark === undefined) {\n\t\t\t\tfactory.push(\n\t\t\t\t\tcomposeMark(settledNewMark, moveEffects, (node: NodeId) =>\n\t\t\t\t\t\tcomposeChildChanges(undefined, node, composeChild),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// Past this point, we are guaranteed that `settledNewMark` and `baseMark` have the same length and\n\t\t\t\t// start at the same location in the revision after the base changes.\n\t\t\t\t// They therefore refer to the same range for that revision.\n\t\t\t\tconst settledBaseMark = settleMark(baseMark);\n\t\t\t\tconst composedMark = composeMarks(\n\t\t\t\t\tsettledBaseMark,\n\t\t\t\t\tsettledNewMark,\n\t\t\t\t\tcomposeChild,\n\t\t\t\t\tmoveEffects,\n\t\t\t\t);\n\t\t\t\tfactory.push(composedMark);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn factory.list;\n}\n\n/**\n * Composes two marks where `newMark` is based on the state produced by `baseMark`.\n * @param baseMark - The mark to compose with `newMark`.\n * Its output range should be the same as `newMark`'s input range.\n * @param newRev - The revision the new mark is part of.\n * @param newMark - The mark to compose with `baseMark`.\n * Its input range should be the same as `baseMark`'s output range.\n * @returns A mark that is equivalent to applying both `baseMark` and `newMark` successively.\n */\nfunction composeMarks(\n\tbaseMark: Mark,\n\tnewMark: Mark,\n\tcomposeChild: NodeChangeComposer,\n\tmoveEffects: MoveEffectTable,\n): Mark {\n\tconst nodeChange = handleNodeChanges(baseMark, newMark, composeChild, moveEffects);\n\n\treturn withUpdatedEndpoint(\n\t\twithNodeChange(composeMarksIgnoreChild(baseMark, newMark, moveEffects), nodeChange),\n\t\tbaseMark.count,\n\t\tmoveEffects,\n\t);\n}\n\nfunction composeMarksIgnoreChild(\n\tbaseMark: Mark,\n\tnewMark: Mark,\n\tmoveEffects: MoveEffectTable,\n): Mark {\n\tif (isNoopMark(baseMark)) {\n\t\treturn newMark;\n\t} else if (isNoopMark(newMark)) {\n\t\treturn baseMark;\n\t}\n\n\tif (isRename(baseMark) && isRename(newMark)) {\n\t\treturn { ...baseMark, idOverride: newMark.idOverride };\n\t} else if (isRename(baseMark)) {\n\t\tassert(\n\t\t\tisAttach(newMark) || isAttachAndDetachEffect(newMark),\n\t\t\t0x9f1 /* Unexpected mark type */,\n\t\t);\n\t\treturn { ...newMark, cellId: baseMark.cellId };\n\t} else if (isRename(newMark)) {\n\t\tassert(\n\t\t\tisDetach(baseMark) || isAttachAndDetachEffect(baseMark),\n\t\t\t0x9f2 /* Unexpected mark type */,\n\t\t);\n\t\treturn isDetach(baseMark)\n\t\t\t? { ...baseMark, idOverride: newMark.idOverride }\n\t\t\t: { ...baseMark, detach: { ...baseMark.detach, idOverride: newMark.idOverride } };\n\t}\n\n\tif (isImpactfulCellRename(newMark)) {\n\t\tconst newAttachAndDetach = asAttachAndDetach(newMark);\n\t\tassert(\n\t\t\tnewAttachAndDetach.cellId !== undefined,\n\t\t\t0x9f3 /* Impactful cell rename must target empty cell */,\n\t\t);\n\t\tconst newDetachRevision = newAttachAndDetach.detach.revision;\n\t\tif (markEmptiesCells(baseMark)) {\n\t\t\t// baseMark is a detach which cancels with the attach portion of the AttachAndDetach,\n\t\t\t// so we are just left with the detach portion of the AttachAndDetach.\n\t\t\tconst newDetach: CellMark<Detach> = {\n\t\t\t\t...newAttachAndDetach.detach,\n\t\t\t\tcount: baseMark.count,\n\t\t\t};\n\n\t\t\tif (isMoveIn(newAttachAndDetach.attach) && isMoveOut(newAttachAndDetach.detach)) {\n\t\t\t\tassert(isMoveOut(baseMark), 0x808 /* Unexpected mark type */);\n\n\t\t\t\t// The base changeset and new changeset both move these nodes.\n\t\t\t\t// Call the original position of the nodes A, the position after the base changeset is applied B,\n\t\t\t\t// and the position after the new changeset is applied C.\n\t\t\t\t// The new changeset moves the nodes from B, temporarily returns them to A, and then moves them to C.\n\t\t\t\t// The composition of the base and new changesets will be a move directly from A to C,\n\t\t\t\t// since the move from A to B cancels out with the return from B to A.\n\t\t\t\t// This if-block is handling marks at A.\n\t\t\t\t// When we compose the marks at B we will link the start of the base move (A to B)\n\t\t\t\t// with the end of the new move (B to C).\n\t\t\t\t// Because we are replacing the mark representing the start of the move with the new changeset's\n\t\t\t\t// move-out from A, we update the base move-in at B to consider that its start point.\n\t\t\t\tconst newDetachId = {\n\t\t\t\t\trevision: newDetachRevision,\n\t\t\t\t\tlocalId: newAttachAndDetach.detach.id,\n\t\t\t\t};\n\n\t\t\t\tsetTruncatedEndpointForInner(\n\t\t\t\t\tmoveEffects,\n\t\t\t\t\tCrossFieldTarget.Destination,\n\t\t\t\t\tgetEndpoint(baseMark),\n\t\t\t\t\tbaseMark.count,\n\t\t\t\t\tnewDetachId,\n\t\t\t\t);\n\n\t\t\t\tconst newEndpoint = getComposedEndpoint(\n\t\t\t\t\tmoveEffects,\n\t\t\t\t\tCrossFieldTarget.Source,\n\t\t\t\t\tbaseMark.revision,\n\t\t\t\t\tbaseMark.id,\n\t\t\t\t\tbaseMark.count,\n\t\t\t\t);\n\n\t\t\t\tif (newEndpoint !== undefined) {\n\t\t\t\t\tchangeFinalEndpoint(newDetach as MoveMarkEffect, newEndpoint);\n\t\t\t\t\tsetTruncatedEndpoint(\n\t\t\t\t\t\tmoveEffects,\n\t\t\t\t\t\tCrossFieldTarget.Destination,\n\t\t\t\t\t\tnewEndpoint,\n\t\t\t\t\t\tbaseMark.count,\n\t\t\t\t\t\tnewDetachId,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn newDetach;\n\t\t}\n\n\t\tif (isImpactfulCellRename(baseMark)) {\n\t\t\tassert(\n\t\t\t\tbaseMark.cellId !== undefined,\n\t\t\t\t0x9f4 /* Impactful cell rename must target empty cell */,\n\t\t\t);\n\t\t\tconst baseAttachAndDetach = asAttachAndDetach(baseMark);\n\t\t\tconst newOutputId = getOutputCellId(newAttachAndDetach);\n\n\t\t\tconst originalAttach = { ...baseAttachAndDetach.attach };\n\t\t\tconst finalDetach = { ...newAttachAndDetach.detach };\n\n\t\t\thandleMovePivot(baseMark.count, originalAttach, finalDetach, moveEffects);\n\n\t\t\tif (areEqualCellIds(newOutputId, baseAttachAndDetach.cellId)) {\n\t\t\t\treturn { count: baseAttachAndDetach.count, cellId: baseAttachAndDetach.cellId };\n\t\t\t}\n\n\t\t\t// `newMark`'s attach portion cancels with `baseMark`'s detach portion.\n\t\t\tconst detachRevision = finalDetach.revision;\n\t\t\tif (detachRevision !== undefined) {\n\t\t\t\tfinalDetach.revision = detachRevision;\n\t\t\t}\n\n\t\t\treturn normalizeCellRename(baseMark.cellId, baseMark.count, originalAttach, finalDetach);\n\t\t}\n\n\t\treturn normalizeCellRename(\n\t\t\tnewAttachAndDetach.cellId,\n\t\t\tnewAttachAndDetach.count,\n\t\t\tnewAttachAndDetach.attach,\n\t\t\tnewAttachAndDetach.detach,\n\t\t);\n\t}\n\tif (isImpactfulCellRename(baseMark)) {\n\t\tconst baseAttachAndDetach = asAttachAndDetach(baseMark);\n\t\tif (markFillsCells(newMark)) {\n\t\t\tconst originalAttach = withRevision(\n\t\t\t\t{\n\t\t\t\t\t...baseAttachAndDetach.attach,\n\t\t\t\t\tcellId: baseAttachAndDetach.cellId,\n\t\t\t\t\tcount: baseAttachAndDetach.count,\n\t\t\t\t},\n\t\t\t\tbaseAttachAndDetach.attach.revision,\n\t\t\t);\n\n\t\t\tif (isMoveIn(baseAttachAndDetach.attach) && isMoveOut(baseAttachAndDetach.detach)) {\n\t\t\t\tassert(isMoveIn(newMark), 0x809 /* Unexpected mark type */);\n\n\t\t\t\tconst originalAttachId = {\n\t\t\t\t\trevision: baseAttachAndDetach.attach.revision,\n\t\t\t\t\tlocalId: baseAttachAndDetach.attach.id,\n\t\t\t\t};\n\n\t\t\t\tsetTruncatedEndpointForInner(\n\t\t\t\t\tmoveEffects,\n\t\t\t\t\tCrossFieldTarget.Source,\n\t\t\t\t\tgetEndpoint(newMark),\n\t\t\t\t\tbaseAttachAndDetach.count,\n\t\t\t\t\toriginalAttachId,\n\t\t\t\t);\n\n\t\t\t\tconst newEndpoint = getComposedEndpoint(\n\t\t\t\t\tmoveEffects,\n\t\t\t\t\tCrossFieldTarget.Destination,\n\t\t\t\t\tnewMark.revision,\n\t\t\t\t\tnewMark.id,\n\t\t\t\t\tnewMark.count,\n\t\t\t\t);\n\n\t\t\t\tif (newEndpoint !== undefined) {\n\t\t\t\t\tchangeFinalEndpoint(originalAttach as MoveMarkEffect, newEndpoint);\n\t\t\t\t\tsetTruncatedEndpoint(\n\t\t\t\t\t\tmoveEffects,\n\t\t\t\t\t\tCrossFieldTarget.Source,\n\t\t\t\t\t\tnewEndpoint,\n\t\t\t\t\t\tbaseMark.count,\n\t\t\t\t\t\toriginalAttachId,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn originalAttach;\n\t\t} else {\n\t\t\t// Other mark types have been handled by previous conditional branches.\n\t\t\tassert(newMark.type === NoopMarkType, 0x80a /* Unexpected mark type */);\n\t\t\treturn baseMark;\n\t\t}\n\t}\n\n\tif (!markHasCellEffect(baseMark) && !markHasCellEffect(newMark)) {\n\t\treturn createNoopMark(newMark.count, undefined, getInputCellId(baseMark));\n\t} else if (!markHasCellEffect(baseMark)) {\n\t\treturn newMark;\n\t} else if (!markHasCellEffect(newMark)) {\n\t\treturn baseMark;\n\t} else if (areInputCellsEmpty(baseMark)) {\n\t\tassert(isDetach(newMark), 0x71c /* Unexpected mark type */);\n\t\tassert(isAttach(baseMark), 0x71d /* Expected generative mark */);\n\n\t\tconst attach = extractMarkEffect(baseMark);\n\t\tconst detach = extractMarkEffect(newMark);\n\n\t\thandleMovePivot(baseMark.count, attach, detach, moveEffects);\n\n\t\tif (areEqualCellIds(getOutputCellId(newMark), baseMark.cellId)) {\n\t\t\t// The output and input cell IDs are the same, so this mark has no effect.\n\t\t\treturn { count: baseMark.count, cellId: baseMark.cellId };\n\t\t}\n\t\treturn normalizeCellRename(baseMark.cellId, baseMark.count, attach, detach);\n\t} else {\n\t\tconst length = baseMark.count;\n\t\treturn createNoopMark(length, undefined);\n\t}\n}\n\n/**\n * Checks if `baseAttach` and `newDetach` are both moves, and if so updates their move endpoints as appropriate,\n * and removes their `finalEndpoint` endpoint fields. Note that can mutate `baseAttach` and `newDetach`.\n * If the effects are not both moves this function does nothing.\n * @param count - The number of cells targeted\n * @param baseAttach - The base attach effect at this location\n * @param newDetach - The new detach effect at this location\n */\nfunction handleMovePivot(\n\tcount: number,\n\tbaseAttach: Attach,\n\tnewDetach: Detach,\n\tmoveEffects: MoveEffectTable,\n): void {\n\tif (isMoveIn(baseAttach) && isMoveOut(newDetach)) {\n\t\tconst finalSource = getEndpoint(baseAttach);\n\t\tconst finalDest = getEndpoint(newDetach);\n\n\t\tsetEndpoint(moveEffects, CrossFieldTarget.Source, finalSource, count, finalDest);\n\n\t\tconst truncatedEndpoint1 = getTruncatedEndpointForInner(\n\t\t\tmoveEffects,\n\t\t\tCrossFieldTarget.Destination,\n\t\t\tbaseAttach.revision,\n\t\t\tbaseAttach.id,\n\t\t\tcount,\n\t\t);\n\n\t\tif (truncatedEndpoint1 !== undefined) {\n\t\t\tsetTruncatedEndpoint(\n\t\t\t\tmoveEffects,\n\t\t\t\tCrossFieldTarget.Destination,\n\t\t\t\tfinalDest,\n\t\t\t\tcount,\n\t\t\t\ttruncatedEndpoint1,\n\t\t\t);\n\t\t}\n\n\t\tsetEndpoint(moveEffects, CrossFieldTarget.Destination, finalDest, count, finalSource);\n\n\t\tconst truncatedEndpoint2 = getTruncatedEndpointForInner(\n\t\t\tmoveEffects,\n\t\t\tCrossFieldTarget.Source,\n\t\t\tnewDetach.revision,\n\t\t\tnewDetach.id,\n\t\t\tcount,\n\t\t);\n\n\t\tif (truncatedEndpoint2 !== undefined) {\n\t\t\tsetTruncatedEndpoint(\n\t\t\t\tmoveEffects,\n\t\t\t\tCrossFieldTarget.Source,\n\t\t\t\tfinalSource,\n\t\t\t\tcount,\n\t\t\t\ttruncatedEndpoint2,\n\t\t\t);\n\t\t}\n\n\t\t// The `finalEndpoint` field of AttachAndDetach move effect pairs is not used,\n\t\t// so we remove it as a normalization.\n\t\tdelete baseAttach.finalEndpoint;\n\t\tdelete newDetach.finalEndpoint;\n\t}\n}\n\nfunction createNoopMark(\n\tlength: number,\n\tnodeChange: NodeId | undefined,\n\tcellId?: ChangeAtomId,\n): Mark {\n\tconst mark: CellMark<NoopMark> = { count: length };\n\tif (nodeChange !== undefined) {\n\t\tassert(length === 1, 0x692 /* A mark with a node change must have length one */);\n\t\tmark.changes = nodeChange;\n\t}\n\tif (cellId !== undefined) {\n\t\tmark.cellId = cellId;\n\t}\n\treturn mark;\n}\n\nfunction handleNodeChanges(\n\tbaseMark: Mark,\n\tnewMark: Mark,\n\tcomposeChild: NodeChangeComposer,\n\tmoveEffects: MoveEffectTable,\n): NodeId | undefined {\n\tif (newMark.changes !== undefined) {\n\t\tconst baseSource = getMoveIn(baseMark);\n\n\t\t// TODO: Make sure composeChild is not called twice on the node changes.\n\t\tif (baseSource !== undefined) {\n\t\t\tsetModifyAfter(moveEffects, getEndpoint(baseSource), newMark.changes);\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\treturn composeChildChanges(baseMark.changes, newMark.changes, composeChild);\n}\n\nfunction composeChildChanges(\n\tbaseChange: NodeId | undefined,\n\tnewChange: NodeId | undefined,\n\tcomposeChild: NodeChangeComposer,\n): NodeId | undefined {\n\tif (baseChange === undefined && newChange === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn composeChild(baseChange, newChange);\n}\n\nfunction composeMark<TMark extends Mark>(\n\tmark: TMark,\n\tmoveEffects: MoveEffectTable,\n\tcomposeChild: (node: NodeId) => NodeId | undefined,\n): TMark {\n\tconst nodeChanges = mark.changes === undefined ? undefined : composeChild(mark.changes);\n\tconst updatedMark = withUpdatedEndpoint(mark, mark.count, moveEffects);\n\treturn withNodeChange(updatedMark, nodeChanges);\n}\n\nexport class ComposeQueue {\n\tprivate readonly baseMarks: MarkQueue;\n\tprivate readonly newMarks: MarkQueue;\n\tprivate readonly baseMarksCellSources: ReadonlySet<RevisionTag | undefined>;\n\tprivate readonly newMarksCellSources: ReadonlySet<RevisionTag | undefined>;\n\n\tpublic constructor(\n\t\tbaseMarks: Changeset,\n\t\tnewMarks: Changeset,\n\t\tprivate readonly moveEffects: MoveEffectTable,\n\t\tprivate readonly revisionMetadata: RevisionMetadataSource,\n\t) {\n\t\tthis.baseMarks = new MarkQueue(baseMarks, moveEffects);\n\t\tthis.newMarks = new MarkQueue(newMarks, moveEffects);\n\t\tthis.baseMarksCellSources = cellSourcesFromMarks(baseMarks, getOutputCellId);\n\t\tthis.newMarksCellSources = cellSourcesFromMarks(newMarks, getInputCellId);\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn this.baseMarks.isEmpty() && this.newMarks.isEmpty();\n\t}\n\n\tpublic pop(): ComposeMarks {\n\t\tconst baseMark = this.baseMarks.peek();\n\t\tconst newMark = this.newMarks.peek();\n\t\tif (baseMark === undefined && newMark === undefined) {\n\t\t\treturn {};\n\t\t} else if (baseMark === undefined) {\n\t\t\treturn this.dequeueNew();\n\t\t} else if (newMark === undefined) {\n\t\t\treturn this.dequeueBase();\n\t\t} else if (areOutputCellsEmpty(baseMark) && areInputCellsEmpty(newMark)) {\n\t\t\tconst baseCellId: ChangeAtomId =\n\t\t\t\tgetOutputCellId(baseMark) ?? fail(0xb29 /* Expected defined output ID */);\n\n\t\t\tif (markEmptiesCells(baseMark) && baseCellId.revision === undefined) {\n\t\t\t\t// The base revision should always be defined except when squashing changes into a transaction.\n\t\t\t\t// In the future, we want to support reattaches in the new change here.\n\t\t\t\t// We will need to be able to order the base mark relative to the new mark\n\t\t\t\t// (which requires the local changes to have a revision tag))\n\t\t\t\tassert(\n\t\t\t\t\tisNewAttach(newMark),\n\t\t\t\t\t0x695 /* TODO: Assign revision tags to each change in a transaction */,\n\t\t\t\t);\n\t\t\t\treturn this.dequeueNew();\n\t\t\t}\n\n\t\t\tconst newCellId = getInputCellId(newMark);\n\t\t\tassert(newCellId !== undefined, 0x89d /* Both marks should have cell IDs */);\n\t\t\tconst comparison = compareCellPositionsUsingTombstones(\n\t\t\t\tbaseCellId,\n\t\t\t\tnewCellId,\n\t\t\t\tthis.baseMarksCellSources,\n\t\t\t\tthis.newMarksCellSources,\n\t\t\t\tthis.revisionMetadata,\n\t\t\t);\n\t\t\tswitch (comparison) {\n\t\t\t\tcase CellOrder.SameCell: {\n\t\t\t\t\treturn this.dequeueBoth();\n\t\t\t\t}\n\t\t\t\tcase CellOrder.OldThenNew: {\n\t\t\t\t\treturn this.dequeueBase();\n\t\t\t\t}\n\t\t\t\tcase CellOrder.NewThenOld: {\n\t\t\t\t\treturn this.dequeueNew();\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tunreachableCase(comparison);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (areOutputCellsEmpty(baseMark)) {\n\t\t\treturn this.dequeueBase();\n\t\t} else if (areInputCellsEmpty(newMark)) {\n\t\t\treturn this.dequeueNew();\n\t\t} else {\n\t\t\treturn this.dequeueBoth();\n\t\t}\n\t}\n\n\tprivate dequeueBase(length: number = Number.POSITIVE_INFINITY): ComposeMarks {\n\t\tconst baseMark = this.baseMarks.dequeueUpTo(length);\n\t\tconst movedChanges = getMovedChangesFromMark(this.moveEffects, baseMark);\n\t\tif (movedChanges !== undefined) {\n\t\t\tthis.moveEffects.onMoveIn(movedChanges);\n\t\t}\n\n\t\tconst newMark = createNoopMark(baseMark.count, movedChanges, getOutputCellId(baseMark));\n\t\treturn { baseMark, newMark };\n\t}\n\n\tprivate dequeueNew(length: number = Number.POSITIVE_INFINITY): ComposeMarks {\n\t\tconst newMark = this.newMarks.dequeueUpTo(length);\n\t\tconst baseMark = createNoopMark(newMark.count, undefined, getInputCellId(newMark));\n\n\t\treturn {\n\t\t\tbaseMark,\n\t\t\tnewMark,\n\t\t};\n\t}\n\n\tprivate dequeueBoth(): ComposeMarks {\n\t\tconst length = this.peekMinLength();\n\t\tconst baseMark = this.baseMarks.dequeueUpTo(length);\n\t\tlet newMark = this.newMarks.dequeueUpTo(length);\n\t\tconst movedChanges = getMovedChangesFromMark(this.moveEffects, baseMark);\n\n\t\tif (movedChanges !== undefined) {\n\t\t\tassert(newMark.changes === undefined, 0x8da /* Unexpected node changeset collision */);\n\t\t\tnewMark = withNodeChange(newMark, movedChanges);\n\t\t}\n\n\t\treturn {\n\t\t\tbaseMark,\n\t\t\tnewMark,\n\t\t};\n\t}\n\n\tprivate peekMinLength(): number {\n\t\tconst baseMark = this.baseMarks.peek();\n\t\tconst newMark = this.newMarks.peek();\n\t\tassert(\n\t\t\tbaseMark !== undefined && newMark !== undefined,\n\t\t\t0x8db /* Cannot peek length unless both mark queues are non-empty */,\n\t\t);\n\n\t\treturn Math.min(newMark.count, baseMark.count);\n\t}\n}\n\ninterface ComposeMarks {\n\tbaseMark?: Mark;\n\tnewMark?: Mark;\n}\n\nfunction getMovedChangesFromMark(\n\tmoveEffects: MoveEffectTable,\n\tmarkEffect: MarkEffect,\n): NodeId | undefined {\n\tif (isAttachAndDetachEffect(markEffect)) {\n\t\treturn getMovedChangesFromMark(moveEffects, markEffect.detach);\n\t}\n\tif (!isMoveOut(markEffect)) {\n\t\treturn undefined;\n\t}\n\n\treturn getModifyAfter(moveEffects, markEffect.revision, markEffect.id);\n}\n\n// It is expected that the range from `id` to `id + count - 1` has the same move effect.\n// The call sites to this function are making queries about a mark which has already been split by a `MarkQueue`\n// to match the ranges in `moveEffects`.\n// TODO: Reduce the duplication between this and other MoveEffect helpers\nfunction getModifyAfter(\n\tmoveEffects: MoveEffectTable,\n\trevision: RevisionTag | undefined,\n\tid: MoveId,\n): NodeId | undefined {\n\tconst target = CrossFieldTarget.Source;\n\tconst effect = getMoveEffect(moveEffects, target, revision, id, 1);\n\n\tif (effect.value?.modifyAfter !== undefined) {\n\t\treturn effect.value.modifyAfter;\n\t}\n\n\treturn undefined;\n}\n\n// TODO: Reduce the duplication between this and other MoveEffect helpers\nfunction setModifyAfter(\n\tmoveEffects: MoveEffectTable,\n\t{ revision, localId: id }: ChangeAtomId,\n\tmodifyAfter: NodeId,\n): void {\n\tconst target = CrossFieldTarget.Source;\n\tconst count = 1;\n\tconst effect = getMoveEffect(moveEffects, target, revision, id, count, false);\n\tconst newEffect: MoveEffect =\n\t\teffect.value === undefined ? { modifyAfter } : { ...effect.value, modifyAfter };\n\tsetMoveEffect(moveEffects, target, revision, id, count, newEffect);\n}\n\nfunction setEndpoint(\n\tmoveEffects: MoveEffectTable,\n\ttarget: CrossFieldTarget,\n\tid: ChangeAtomId,\n\tcount: number,\n\tendpoint: ChangeAtomId,\n): void {\n\tconst effect = getMoveEffect(moveEffects, target, id.revision, id.localId, count, false);\n\tconst newEffect = effect.value === undefined ? { endpoint } : { ...effect.value, endpoint };\n\tsetMoveEffect(moveEffects, target, id.revision, id.localId, effect.length, newEffect);\n\n\tconst remainingCount = count - effect.length;\n\tif (remainingCount > 0) {\n\t\tsetEndpoint(\n\t\t\tmoveEffects,\n\t\t\ttarget,\n\t\t\toffsetChangeAtomId(id, effect.length),\n\t\t\tremainingCount,\n\t\t\toffsetChangeAtomId(endpoint, effect.length),\n\t\t);\n\t}\n}\n\nfunction setTruncatedEndpoint(\n\tmoveEffects: MoveEffectTable,\n\ttarget: CrossFieldTarget,\n\tid: ChangeAtomId,\n\tcount: number,\n\ttruncatedEndpoint: ChangeAtomId,\n): void {\n\tconst effect = getMoveEffect(moveEffects, target, id.revision, id.localId, count);\n\tconst newEffect =\n\t\teffect.value === undefined\n\t\t\t? { truncatedEndpoint }\n\t\t\t: { ...effect.value, truncatedEndpoint };\n\n\tsetMoveEffect(moveEffects, target, id.revision, id.localId, effect.length, newEffect);\n\n\tconst remainingCount = count - effect.length;\n\tif (remainingCount > 0) {\n\t\tsetTruncatedEndpoint(\n\t\t\tmoveEffects,\n\t\t\ttarget,\n\t\t\toffsetChangeAtomId(id, effect.length),\n\t\t\tremainingCount,\n\t\t\toffsetChangeAtomId(truncatedEndpoint, effect.length),\n\t\t);\n\t}\n}\n\nfunction setTruncatedEndpointForInner(\n\tmoveEffects: MoveEffectTable,\n\ttarget: CrossFieldTarget,\n\tid: ChangeAtomId,\n\tcount: number,\n\ttruncatedEndpointForInner: ChangeAtomId,\n): void {\n\tconst effect = getMoveEffect(moveEffects, target, id.revision, id.localId, count);\n\tconst newEffect =\n\t\teffect.value === undefined\n\t\t\t? { truncatedEndpointForInner }\n\t\t\t: { ...effect.value, truncatedEndpointForInner };\n\tsetMoveEffect(moveEffects, target, id.revision, id.localId, effect.length, newEffect);\n\n\tconst remainingCount = count - effect.length;\n\tif (remainingCount > 0) {\n\t\tsetTruncatedEndpointForInner(\n\t\t\tmoveEffects,\n\t\t\ttarget,\n\t\t\toffsetChangeAtomId(id, effect.length),\n\t\t\tremainingCount,\n\t\t\toffsetChangeAtomId(truncatedEndpointForInner, effect.length),\n\t\t);\n\t}\n}\n\nfunction withUpdatedEndpoint<TMark extends MarkEffect>(\n\tmark: TMark,\n\tcount: number,\n\teffects: MoveEffectTable,\n): TMark {\n\tif (isAttachAndDetachEffect(mark)) {\n\t\treturn {\n\t\t\t...mark,\n\t\t\tattach: withUpdatedEndpoint(mark.attach, count, effects),\n\t\t\tdetach: withUpdatedEndpoint(mark.detach, count, effects),\n\t\t};\n\t}\n\n\tif (!isMoveMark(mark)) {\n\t\treturn mark;\n\t}\n\tconst finalDest = getComposedEndpoint(\n\t\teffects,\n\t\tgetCrossFieldTargetFromMove(mark),\n\t\tmark.revision,\n\t\tmark.id,\n\t\tcount,\n\t);\n\n\tif (finalDest === undefined) {\n\t\treturn mark;\n\t}\n\n\tconst output = { ...mark };\n\tchangeFinalEndpoint(output, finalDest);\n\n\treturn output;\n}\n\nfunction changeFinalEndpoint(mark: MoveMarkEffect, endpoint: ChangeAtomId): void {\n\tif (areEqualCellIds(endpoint, { revision: mark.revision, localId: mark.id })) {\n\t\tdelete mark.finalEndpoint;\n\t} else {\n\t\tmark.finalEndpoint = endpoint;\n\t}\n}\n\nfunction getComposedEndpoint(\n\tmoveEffects: MoveEffectTable,\n\ttarget: CrossFieldTarget,\n\trevision: RevisionTag | undefined,\n\tid: MoveId,\n\tcount: number,\n): ChangeAtomId | undefined {\n\tconst effect = getMoveEffect(moveEffects, target, revision, id, count);\n\tassert(effect.length === count, 0x815 /* Expected effect to cover entire mark */);\n\treturn effect.value?.truncatedEndpoint ?? effect.value?.endpoint;\n}\n\nfunction getTruncatedEndpointForInner(\n\tmoveEffects: MoveEffectTable,\n\ttarget: CrossFieldTarget,\n\trevision: RevisionTag | undefined,\n\tid: MoveId,\n\tcount: number,\n): ChangeAtomId | undefined {\n\tconst effect = getMoveEffect(moveEffects, target, revision, id, count);\n\tassert(effect.length === count, 0x934 /* Expected effect to cover entire mark */);\n\treturn effect.value?.truncatedEndpointForInner;\n}\n"]}
1
+ {"version":3,"file":"compose.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/compose.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAEpF,kDAK6B;AAE7B,yDAKoC;AAGpC,6DAAuD;AACvD,iDAA2C;AAC3C,6DAU8B;AAC9B,yCAWoB;AACpB,yCA0BoB;AAEpB;;;;;;;;;;;GAWG;AACH,SAAgB,OAAO,CACtB,OAAkB,EAClB,OAAkB,EAClB,YAAgC,EAChC,MAAmB,EACnB,OAA0B,EAC1B,gBAAwC;IAExC,OAAO,gBAAgB,CACtB,OAAO,EACP,OAAO,EACP,YAAY,EACZ,OAA0B,EAC1B,gBAAgB,CAChB,CAAC;AACH,CAAC;AAfD,0BAeC;AAED,SAAS,gBAAgB,CACxB,YAAsB,EACtB,WAAqB,EACrB,YAAgC,EAChC,WAA4B,EAC5B,gBAAwC;IAExC,MAAM,OAAO,GAAG,IAAI,oCAAe,EAAE,CAAC;IACtC,MAAM,KAAK,GAAG,IAAI,YAAY,CAAC,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,CAAC,CAAC;IACzF,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;QACzB,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;QAC1C,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC3B,IAAA,iBAAM,EACL,QAAQ,KAAK,SAAS,EACtB,KAAK,CAAC,2DAA2D,CACjE,CAAC;YACF,OAAO,CAAC,IAAI,CACX,WAAW,CAAC,QAAQ,EAAE,WAAW,EAAE,CAAC,IAAY,EAAE,EAAE,CACnD,mBAAmB,CAAC,IAAI,EAAE,SAAS,EAAE,YAAY,CAAC,CAClD,CACD,CAAC;QACH,CAAC;aAAM,CAAC;YACP,+DAA+D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QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;QAC9E,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;SAAM,CAAC;QACP,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC;IAC/B,CAAC;AACF,CAAC;AAED,SAAS,mBAAmB,CAC3B,WAA4B,EAC5B,MAAwB,EACxB,QAAiC,EACjC,EAAU,EACV,KAAa;IAEb,MAAM,MAAM,GAAG,IAAA,kCAAa,EAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IACvE,IAAA,iBAAM,EAAC,MAAM,CAAC,MAAM,KAAK,KAAK,EAAE,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAClF,OAAO,MAAM,CAAC,KAAK,EAAE,iBAAiB,IAAI,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC;AAClE,CAAC;AAED,SAAS,4BAA4B,CACpC,WAA4B,EAC5B,MAAwB,EACxB,QAAiC,EACjC,EAAU,EACV,KAAa;IAEb,MAAM,MAAM,GAAG,IAAA,kCAAa,EAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IACvE,IAAA,iBAAM,EAAC,MAAM,CAAC,MAAM,KAAK,KAAK,EAAE,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAClF,OAAO,MAAM,CAAC,KAAK,EAAE,yBAAyB,CAAC;AAChD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ChangeAtomId,\n\ttype RevisionMetadataSource,\n\ttype RevisionTag,\n\toffsetChangeAtomId,\n} from \"../../core/index.js\";\nimport type { IdAllocator } from \"../../util/index.js\";\nimport {\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\ttype NodeChangeComposer,\n\ttype NodeId,\n} from \"../modular-schema/index.js\";\n\nimport type { MoveMarkEffect } from \"./helperTypes.js\";\nimport { MarkListFactory } from \"./markListFactory.js\";\nimport { MarkQueue } from \"./markQueue.js\";\nimport {\n\ttype MoveEffect,\n\ttype MoveEffectTable,\n\tgetCrossFieldTargetFromMove,\n\tgetMoveEffect,\n\tgetMoveIn,\n\tisMoveIn,\n\tisMoveMark,\n\tisMoveOut,\n\tsetMoveEffect,\n} from \"./moveEffectTable.js\";\nimport {\n\ttype Attach,\n\ttype CellMark,\n\ttype Changeset,\n\ttype Detach,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype MarkList,\n\ttype MoveId,\n\ttype NoopMark,\n\tNoopMarkType,\n} from \"./types.js\";\nimport {\n\tCellOrder,\n\tareEqualCellIds,\n\tareInputCellsEmpty,\n\tareOutputCellsEmpty,\n\tasAttachAndDetach,\n\tcellSourcesFromMarks,\n\tcompareCellPositionsUsingTombstones,\n\textractMarkEffect,\n\tgetEndpoint,\n\tgetInputCellId,\n\tgetOutputCellId,\n\tisAttach,\n\tisAttachAndDetachEffect,\n\tisDetach,\n\tisImpactfulCellRename,\n\tisNewAttach,\n\tisNoopMark,\n\tisRename,\n\tmarkEmptiesCells,\n\tmarkFillsCells,\n\tmarkHasCellEffect,\n\tnormalizeCellRename,\n\tsettleMark,\n\twithNodeChange,\n\twithRevision,\n} from \"./utils.js\";\n\n/**\n * Composes a sequence of changesets into a single changeset.\n * @param changes - The changesets to be applied.\n * Parts of the input may be reused in the output, but the input is not mutated.\n * Each changeset in the list is assumed to be applicable after the previous one.\n * @returns A changeset that is equivalent to applying each of the given `changes` in order.\n *\n * WARNING! This implementation is incomplete:\n * - Tombstone information is ignored.\n * - Support for moves is not implemented.\n * - Support for slices is not implemented.\n */\nexport function compose(\n\tchange1: Changeset,\n\tchange2: Changeset,\n\tcomposeChild: NodeChangeComposer,\n\t_genId: IdAllocator,\n\tmanager: CrossFieldManager,\n\trevisionMetadata: RevisionMetadataSource,\n): Changeset {\n\treturn composeMarkLists(\n\t\tchange1,\n\t\tchange2,\n\t\tcomposeChild,\n\t\tmanager as MoveEffectTable,\n\t\trevisionMetadata,\n\t);\n}\n\nfunction composeMarkLists(\n\tbaseMarkList: MarkList,\n\tnewMarkList: MarkList,\n\tcomposeChild: NodeChangeComposer,\n\tmoveEffects: MoveEffectTable,\n\trevisionMetadata: RevisionMetadataSource,\n): MarkList {\n\tconst factory = new MarkListFactory();\n\tconst queue = new ComposeQueue(baseMarkList, newMarkList, moveEffects, revisionMetadata);\n\twhile (!queue.isEmpty()) {\n\t\tconst { baseMark, newMark } = queue.pop();\n\t\tif (newMark === undefined) {\n\t\t\tassert(\n\t\t\t\tbaseMark !== undefined,\n\t\t\t\t0x4db /* Non-empty queue should not return two undefined marks */,\n\t\t\t);\n\t\t\tfactory.push(\n\t\t\t\tcomposeMark(baseMark, moveEffects, (node: NodeId) =>\n\t\t\t\t\tcomposeChildChanges(node, undefined, composeChild),\n\t\t\t\t),\n\t\t\t);\n\t\t} else {\n\t\t\t// We only compose changesets that will not be further rebased.\n\t\t\t// It is therefore safe to remove any intentions that have no impact in the context they apply to.\n\t\t\tconst settledNewMark = settleMark(newMark);\n\t\t\tif (baseMark === undefined) {\n\t\t\t\tfactory.push(\n\t\t\t\t\tcomposeMark(settledNewMark, moveEffects, (node: NodeId) =>\n\t\t\t\t\t\tcomposeChildChanges(undefined, node, composeChild),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// Past this point, we are guaranteed that `settledNewMark` and `baseMark` have the same length and\n\t\t\t\t// start at the same location in the revision after the base changes.\n\t\t\t\t// They therefore refer to the same range for that revision.\n\t\t\t\tconst settledBaseMark = settleMark(baseMark);\n\t\t\t\tconst composedMark = composeMarks(\n\t\t\t\t\tsettledBaseMark,\n\t\t\t\t\tsettledNewMark,\n\t\t\t\t\tcomposeChild,\n\t\t\t\t\tmoveEffects,\n\t\t\t\t);\n\t\t\t\tfactory.push(composedMark);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn factory.list;\n}\n\n/**\n * Composes two marks where `newMark` is based on the state produced by `baseMark`.\n * @param baseMark - The mark to compose with `newMark`.\n * Its output range should be the same as `newMark`'s input range.\n * @param newRev - The revision the new mark is part of.\n * @param newMark - The mark to compose with `baseMark`.\n * Its input range should be the same as `baseMark`'s output range.\n * @returns A mark that is equivalent to applying both `baseMark` and `newMark` successively.\n */\nfunction composeMarks(\n\tbaseMark: Mark,\n\tnewMark: Mark,\n\tcomposeChild: NodeChangeComposer,\n\tmoveEffects: MoveEffectTable,\n): Mark {\n\tconst nodeChange = handleNodeChanges(baseMark, newMark, composeChild, moveEffects);\n\n\treturn withUpdatedEndpoint(\n\t\twithNodeChange(composeMarksIgnoreChild(baseMark, newMark, moveEffects), nodeChange),\n\t\tbaseMark.count,\n\t\tmoveEffects,\n\t);\n}\n\nfunction composeMarksIgnoreChild(\n\tbaseMark: Mark,\n\tnewMark: Mark,\n\tmoveEffects: MoveEffectTable,\n): Mark {\n\tif (isNoopMark(baseMark)) {\n\t\treturn newMark;\n\t} else if (isNoopMark(newMark)) {\n\t\treturn baseMark;\n\t}\n\n\tif (isRename(baseMark) && isRename(newMark)) {\n\t\treturn { ...baseMark, idOverride: newMark.idOverride };\n\t} else if (isRename(baseMark)) {\n\t\tassert(\n\t\t\tisAttach(newMark) || isAttachAndDetachEffect(newMark),\n\t\t\t0x9f1 /* Unexpected mark type */,\n\t\t);\n\t\treturn { ...newMark, cellId: baseMark.cellId };\n\t} else if (isRename(newMark)) {\n\t\tassert(\n\t\t\tisDetach(baseMark) || isAttachAndDetachEffect(baseMark),\n\t\t\t0x9f2 /* Unexpected mark type */,\n\t\t);\n\t\treturn isDetach(baseMark)\n\t\t\t? { ...baseMark, idOverride: newMark.idOverride }\n\t\t\t: { ...baseMark, detach: { ...baseMark.detach, idOverride: newMark.idOverride } };\n\t}\n\n\tif (isImpactfulCellRename(newMark)) {\n\t\tconst newAttachAndDetach = asAttachAndDetach(newMark);\n\t\tassert(\n\t\t\tnewAttachAndDetach.cellId !== undefined,\n\t\t\t0x9f3 /* Impactful cell rename must target empty cell */,\n\t\t);\n\t\tconst newDetachRevision = newAttachAndDetach.detach.revision;\n\t\tif (markEmptiesCells(baseMark)) {\n\t\t\t// baseMark is a detach which cancels with the attach portion of the AttachAndDetach,\n\t\t\t// so we are just left with the detach portion of the AttachAndDetach.\n\t\t\tconst newDetach: CellMark<Detach> = {\n\t\t\t\t...newAttachAndDetach.detach,\n\t\t\t\tcount: baseMark.count,\n\t\t\t};\n\n\t\t\tif (isMoveIn(newAttachAndDetach.attach) && isMoveOut(newAttachAndDetach.detach)) {\n\t\t\t\tassert(isMoveOut(baseMark), 0x808 /* Unexpected mark type */);\n\n\t\t\t\t// The base changeset and new changeset both move these nodes.\n\t\t\t\t// Call the original position of the nodes A, the position after the base changeset is applied B,\n\t\t\t\t// and the position after the new changeset is applied C.\n\t\t\t\t// The new changeset moves the nodes from B, temporarily returns them to A, and then moves them to C.\n\t\t\t\t// The composition of the base and new changesets will be a move directly from A to C,\n\t\t\t\t// since the move from A to B cancels out with the return from B to A.\n\t\t\t\t// This if-block is handling marks at A.\n\t\t\t\t// When we compose the marks at B we will link the start of the base move (A to B)\n\t\t\t\t// with the end of the new move (B to C).\n\t\t\t\t// Because we are replacing the mark representing the start of the move with the new changeset's\n\t\t\t\t// move-out from A, we update the base move-in at B to consider that its start point.\n\t\t\t\tconst newDetachId = {\n\t\t\t\t\trevision: newDetachRevision,\n\t\t\t\t\tlocalId: newAttachAndDetach.detach.id,\n\t\t\t\t};\n\n\t\t\t\tsetTruncatedEndpointForInner(\n\t\t\t\t\tmoveEffects,\n\t\t\t\t\tCrossFieldTarget.Destination,\n\t\t\t\t\tgetEndpoint(baseMark),\n\t\t\t\t\tbaseMark.count,\n\t\t\t\t\tnewDetachId,\n\t\t\t\t);\n\n\t\t\t\tconst newEndpoint = getComposedEndpoint(\n\t\t\t\t\tmoveEffects,\n\t\t\t\t\tCrossFieldTarget.Source,\n\t\t\t\t\tbaseMark.revision,\n\t\t\t\t\tbaseMark.id,\n\t\t\t\t\tbaseMark.count,\n\t\t\t\t);\n\n\t\t\t\tif (newEndpoint !== undefined) {\n\t\t\t\t\tchangeFinalEndpoint(newDetach as MoveMarkEffect, newEndpoint);\n\t\t\t\t\tsetTruncatedEndpoint(\n\t\t\t\t\t\tmoveEffects,\n\t\t\t\t\t\tCrossFieldTarget.Destination,\n\t\t\t\t\t\tnewEndpoint,\n\t\t\t\t\t\tbaseMark.count,\n\t\t\t\t\t\tnewDetachId,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn newDetach;\n\t\t}\n\n\t\tif (isImpactfulCellRename(baseMark)) {\n\t\t\tassert(\n\t\t\t\tbaseMark.cellId !== undefined,\n\t\t\t\t0x9f4 /* Impactful cell rename must target empty cell */,\n\t\t\t);\n\t\t\tconst baseAttachAndDetach = asAttachAndDetach(baseMark);\n\t\t\tconst newOutputId = getOutputCellId(newAttachAndDetach);\n\n\t\t\tconst originalAttach = { ...baseAttachAndDetach.attach };\n\t\t\tconst finalDetach = { ...newAttachAndDetach.detach };\n\n\t\t\thandleMovePivot(baseMark.count, originalAttach, finalDetach, moveEffects);\n\n\t\t\tif (areEqualCellIds(newOutputId, baseAttachAndDetach.cellId)) {\n\t\t\t\treturn { count: baseAttachAndDetach.count, cellId: baseAttachAndDetach.cellId };\n\t\t\t}\n\n\t\t\t// `newMark`'s attach portion cancels with `baseMark`'s detach portion.\n\t\t\tconst detachRevision = finalDetach.revision;\n\t\t\tif (detachRevision !== undefined) {\n\t\t\t\tfinalDetach.revision = detachRevision;\n\t\t\t}\n\n\t\t\treturn normalizeCellRename(baseMark.cellId, baseMark.count, originalAttach, finalDetach);\n\t\t}\n\n\t\treturn normalizeCellRename(\n\t\t\tnewAttachAndDetach.cellId,\n\t\t\tnewAttachAndDetach.count,\n\t\t\tnewAttachAndDetach.attach,\n\t\t\tnewAttachAndDetach.detach,\n\t\t);\n\t}\n\tif (isImpactfulCellRename(baseMark)) {\n\t\tconst baseAttachAndDetach = asAttachAndDetach(baseMark);\n\t\tif (markFillsCells(newMark)) {\n\t\t\tconst originalAttach = withRevision(\n\t\t\t\t{\n\t\t\t\t\t...baseAttachAndDetach.attach,\n\t\t\t\t\tcellId: baseAttachAndDetach.cellId,\n\t\t\t\t\tcount: baseAttachAndDetach.count,\n\t\t\t\t},\n\t\t\t\tbaseAttachAndDetach.attach.revision,\n\t\t\t);\n\n\t\t\tif (isMoveIn(baseAttachAndDetach.attach) && isMoveOut(baseAttachAndDetach.detach)) {\n\t\t\t\tassert(isMoveIn(newMark), 0x809 /* Unexpected mark type */);\n\n\t\t\t\tconst originalAttachId = {\n\t\t\t\t\trevision: baseAttachAndDetach.attach.revision,\n\t\t\t\t\tlocalId: baseAttachAndDetach.attach.id,\n\t\t\t\t};\n\n\t\t\t\tsetTruncatedEndpointForInner(\n\t\t\t\t\tmoveEffects,\n\t\t\t\t\tCrossFieldTarget.Source,\n\t\t\t\t\tgetEndpoint(newMark),\n\t\t\t\t\tbaseAttachAndDetach.count,\n\t\t\t\t\toriginalAttachId,\n\t\t\t\t);\n\n\t\t\t\tconst newEndpoint = getComposedEndpoint(\n\t\t\t\t\tmoveEffects,\n\t\t\t\t\tCrossFieldTarget.Destination,\n\t\t\t\t\tnewMark.revision,\n\t\t\t\t\tnewMark.id,\n\t\t\t\t\tnewMark.count,\n\t\t\t\t);\n\n\t\t\t\tif (newEndpoint !== undefined) {\n\t\t\t\t\tchangeFinalEndpoint(originalAttach as MoveMarkEffect, newEndpoint);\n\t\t\t\t\tsetTruncatedEndpoint(\n\t\t\t\t\t\tmoveEffects,\n\t\t\t\t\t\tCrossFieldTarget.Source,\n\t\t\t\t\t\tnewEndpoint,\n\t\t\t\t\t\tbaseMark.count,\n\t\t\t\t\t\toriginalAttachId,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn originalAttach;\n\t\t} else {\n\t\t\t// Other mark types have been handled by previous conditional branches.\n\t\t\tassert(newMark.type === NoopMarkType, 0x80a /* Unexpected mark type */);\n\t\t\treturn baseMark;\n\t\t}\n\t}\n\n\tif (!markHasCellEffect(baseMark) && !markHasCellEffect(newMark)) {\n\t\treturn createNoopMark(newMark.count, undefined, getInputCellId(baseMark));\n\t} else if (!markHasCellEffect(baseMark)) {\n\t\treturn newMark;\n\t} else if (!markHasCellEffect(newMark)) {\n\t\treturn baseMark;\n\t} else if (areInputCellsEmpty(baseMark)) {\n\t\tassert(isDetach(newMark), 0x71c /* Unexpected mark type */);\n\t\tassert(isAttach(baseMark), 0x71d /* Expected generative mark */);\n\n\t\tconst attach = extractMarkEffect(baseMark);\n\t\tconst detach = extractMarkEffect(newMark);\n\n\t\thandleMovePivot(baseMark.count, attach, detach, moveEffects);\n\n\t\tif (areEqualCellIds(getOutputCellId(newMark), baseMark.cellId)) {\n\t\t\t// The output and input cell IDs are the same, so this mark has no effect.\n\t\t\treturn { count: baseMark.count, cellId: baseMark.cellId };\n\t\t}\n\t\treturn normalizeCellRename(baseMark.cellId, baseMark.count, attach, detach);\n\t} else {\n\t\tconst length = baseMark.count;\n\t\treturn createNoopMark(length, undefined);\n\t}\n}\n\n/**\n * Checks if `baseAttach` and `newDetach` are both moves, and if so updates their move endpoints as appropriate,\n * and removes their `finalEndpoint` endpoint fields. Note that can mutate `baseAttach` and `newDetach`.\n * If the effects are not both moves this function does nothing.\n * @param count - The number of cells targeted\n * @param baseAttach - The base attach effect at this location\n * @param newDetach - The new detach effect at this location\n */\nfunction handleMovePivot(\n\tcount: number,\n\tbaseAttach: Attach,\n\tnewDetach: Detach,\n\tmoveEffects: MoveEffectTable,\n): void {\n\tif (isMoveIn(baseAttach) && isMoveOut(newDetach)) {\n\t\tconst finalSource = getEndpoint(baseAttach);\n\t\tconst finalDest = getEndpoint(newDetach);\n\n\t\tsetEndpoint(moveEffects, CrossFieldTarget.Source, finalSource, count, finalDest);\n\n\t\tconst truncatedEndpoint1 = getTruncatedEndpointForInner(\n\t\t\tmoveEffects,\n\t\t\tCrossFieldTarget.Destination,\n\t\t\tbaseAttach.revision,\n\t\t\tbaseAttach.id,\n\t\t\tcount,\n\t\t);\n\n\t\tif (truncatedEndpoint1 !== undefined) {\n\t\t\tsetTruncatedEndpoint(\n\t\t\t\tmoveEffects,\n\t\t\t\tCrossFieldTarget.Destination,\n\t\t\t\tfinalDest,\n\t\t\t\tcount,\n\t\t\t\ttruncatedEndpoint1,\n\t\t\t);\n\t\t}\n\n\t\tsetEndpoint(moveEffects, CrossFieldTarget.Destination, finalDest, count, finalSource);\n\n\t\tconst truncatedEndpoint2 = getTruncatedEndpointForInner(\n\t\t\tmoveEffects,\n\t\t\tCrossFieldTarget.Source,\n\t\t\tnewDetach.revision,\n\t\t\tnewDetach.id,\n\t\t\tcount,\n\t\t);\n\n\t\tif (truncatedEndpoint2 !== undefined) {\n\t\t\tsetTruncatedEndpoint(\n\t\t\t\tmoveEffects,\n\t\t\t\tCrossFieldTarget.Source,\n\t\t\t\tfinalSource,\n\t\t\t\tcount,\n\t\t\t\ttruncatedEndpoint2,\n\t\t\t);\n\t\t}\n\n\t\t// The `finalEndpoint` field of AttachAndDetach move effect pairs is not used,\n\t\t// so we remove it as a normalization.\n\t\tdelete baseAttach.finalEndpoint;\n\t\tdelete newDetach.finalEndpoint;\n\t}\n}\n\nfunction createNoopMark(\n\tlength: number,\n\tnodeChange: NodeId | undefined,\n\tcellId?: ChangeAtomId,\n): Mark {\n\tconst mark: CellMark<NoopMark> = { count: length };\n\tif (nodeChange !== undefined) {\n\t\tassert(length === 1, 0x692 /* A mark with a node change must have length one */);\n\t\tmark.changes = nodeChange;\n\t}\n\tif (cellId !== undefined) {\n\t\tmark.cellId = cellId;\n\t}\n\treturn mark;\n}\n\nfunction handleNodeChanges(\n\tbaseMark: Mark,\n\tnewMark: Mark,\n\tcomposeChild: NodeChangeComposer,\n\tmoveEffects: MoveEffectTable,\n): NodeId | undefined {\n\tif (newMark.changes !== undefined) {\n\t\tmoveEffects.onMoveIn(newMark.changes);\n\t\tconst baseSource = getMoveIn(baseMark);\n\n\t\t// TODO: Make sure composeChild is not called twice on the node changes.\n\t\tif (baseSource !== undefined) {\n\t\t\tsetModifyAfter(moveEffects, getEndpoint(baseSource), newMark.changes);\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\treturn composeChildChanges(baseMark.changes, newMark.changes, composeChild);\n}\n\nfunction composeChildChanges(\n\tbaseChange: NodeId | undefined,\n\tnewChange: NodeId | undefined,\n\tcomposeChild: NodeChangeComposer,\n): NodeId | undefined {\n\tif (baseChange === undefined && newChange === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn composeChild(baseChange, newChange);\n}\n\nfunction composeMark<TMark extends Mark>(\n\tmark: TMark,\n\tmoveEffects: MoveEffectTable,\n\tcomposeChild: (node: NodeId) => NodeId | undefined,\n): TMark {\n\tconst nodeChanges = mark.changes === undefined ? undefined : composeChild(mark.changes);\n\tconst updatedMark = withUpdatedEndpoint(mark, mark.count, moveEffects);\n\treturn withNodeChange(updatedMark, nodeChanges);\n}\n\nexport class ComposeQueue {\n\tprivate readonly baseMarks: MarkQueue;\n\tprivate readonly newMarks: MarkQueue;\n\tprivate readonly baseMarksCellSources: ReadonlySet<RevisionTag | undefined>;\n\tprivate readonly newMarksCellSources: ReadonlySet<RevisionTag | undefined>;\n\n\tpublic constructor(\n\t\tbaseMarks: Changeset,\n\t\tnewMarks: Changeset,\n\t\tprivate readonly moveEffects: MoveEffectTable,\n\t\tprivate readonly revisionMetadata: RevisionMetadataSource,\n\t) {\n\t\tthis.baseMarks = new MarkQueue(baseMarks, moveEffects);\n\t\tthis.newMarks = new MarkQueue(newMarks, moveEffects);\n\t\tthis.baseMarksCellSources = cellSourcesFromMarks(baseMarks, getOutputCellId);\n\t\tthis.newMarksCellSources = cellSourcesFromMarks(newMarks, getInputCellId);\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn this.baseMarks.isEmpty() && this.newMarks.isEmpty();\n\t}\n\n\tpublic pop(): ComposeMarks {\n\t\tconst baseMark = this.baseMarks.peek();\n\t\tconst newMark = this.newMarks.peek();\n\t\tif (baseMark === undefined && newMark === undefined) {\n\t\t\treturn {};\n\t\t} else if (baseMark === undefined) {\n\t\t\treturn this.dequeueNew();\n\t\t} else if (newMark === undefined) {\n\t\t\treturn this.dequeueBase();\n\t\t} else if (areOutputCellsEmpty(baseMark) && areInputCellsEmpty(newMark)) {\n\t\t\tconst baseCellId: ChangeAtomId =\n\t\t\t\tgetOutputCellId(baseMark) ?? fail(0xb29 /* Expected defined output ID */);\n\n\t\t\tif (markEmptiesCells(baseMark) && baseCellId.revision === undefined) {\n\t\t\t\t// The base revision should always be defined except when squashing changes into a transaction.\n\t\t\t\t// In the future, we want to support reattaches in the new change here.\n\t\t\t\t// We will need to be able to order the base mark relative to the new mark\n\t\t\t\t// (which requires the local changes to have a revision tag))\n\t\t\t\tassert(\n\t\t\t\t\tisNewAttach(newMark),\n\t\t\t\t\t0x695 /* TODO: Assign revision tags to each change in a transaction */,\n\t\t\t\t);\n\t\t\t\treturn this.dequeueNew();\n\t\t\t}\n\n\t\t\tconst newCellId = getInputCellId(newMark);\n\t\t\tassert(newCellId !== undefined, 0x89d /* Both marks should have cell IDs */);\n\t\t\tconst comparison = compareCellPositionsUsingTombstones(\n\t\t\t\tbaseCellId,\n\t\t\t\tnewCellId,\n\t\t\t\tthis.baseMarksCellSources,\n\t\t\t\tthis.newMarksCellSources,\n\t\t\t\tthis.revisionMetadata,\n\t\t\t);\n\t\t\tswitch (comparison) {\n\t\t\t\tcase CellOrder.SameCell: {\n\t\t\t\t\treturn this.dequeueBoth();\n\t\t\t\t}\n\t\t\t\tcase CellOrder.OldThenNew: {\n\t\t\t\t\treturn this.dequeueBase();\n\t\t\t\t}\n\t\t\t\tcase CellOrder.NewThenOld: {\n\t\t\t\t\treturn this.dequeueNew();\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tunreachableCase(comparison);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (areOutputCellsEmpty(baseMark)) {\n\t\t\treturn this.dequeueBase();\n\t\t} else if (areInputCellsEmpty(newMark)) {\n\t\t\treturn this.dequeueNew();\n\t\t} else {\n\t\t\treturn this.dequeueBoth();\n\t\t}\n\t}\n\n\tprivate dequeueBase(length: number = Number.POSITIVE_INFINITY): ComposeMarks {\n\t\tconst baseMark = this.baseMarks.dequeueUpTo(length);\n\t\tconst movedChanges = getMovedChangesFromMark(this.moveEffects, baseMark);\n\t\tconst newMark = createNoopMark(baseMark.count, movedChanges, getOutputCellId(baseMark));\n\t\treturn { baseMark, newMark };\n\t}\n\n\tprivate dequeueNew(length: number = Number.POSITIVE_INFINITY): ComposeMarks {\n\t\tconst newMark = this.newMarks.dequeueUpTo(length);\n\t\tconst baseMark = createNoopMark(newMark.count, undefined, getInputCellId(newMark));\n\n\t\treturn {\n\t\t\tbaseMark,\n\t\t\tnewMark,\n\t\t};\n\t}\n\n\tprivate dequeueBoth(): ComposeMarks {\n\t\tconst length = this.peekMinLength();\n\t\tconst baseMark = this.baseMarks.dequeueUpTo(length);\n\t\tlet newMark = this.newMarks.dequeueUpTo(length);\n\t\tconst movedChanges = getMovedChangesFromMark(this.moveEffects, baseMark);\n\n\t\tif (movedChanges !== undefined) {\n\t\t\tassert(newMark.changes === undefined, 0x8da /* Unexpected node changeset collision */);\n\t\t\tnewMark = withNodeChange(newMark, movedChanges);\n\t\t}\n\n\t\treturn {\n\t\t\tbaseMark,\n\t\t\tnewMark,\n\t\t};\n\t}\n\n\tprivate peekMinLength(): number {\n\t\tconst baseMark = this.baseMarks.peek();\n\t\tconst newMark = this.newMarks.peek();\n\t\tassert(\n\t\t\tbaseMark !== undefined && newMark !== undefined,\n\t\t\t0x8db /* Cannot peek length unless both mark queues are non-empty */,\n\t\t);\n\n\t\treturn Math.min(newMark.count, baseMark.count);\n\t}\n}\n\ninterface ComposeMarks {\n\tbaseMark?: Mark;\n\tnewMark?: Mark;\n}\n\nfunction getMovedChangesFromMark(\n\tmoveEffects: MoveEffectTable,\n\tmarkEffect: MarkEffect,\n): NodeId | undefined {\n\tif (isAttachAndDetachEffect(markEffect)) {\n\t\treturn getMovedChangesFromMark(moveEffects, markEffect.detach);\n\t}\n\tif (!isMoveOut(markEffect)) {\n\t\treturn undefined;\n\t}\n\n\treturn getModifyAfter(moveEffects, markEffect.revision, markEffect.id);\n}\n\n// It is expected that the range from `id` to `id + count - 1` has the same move effect.\n// The call sites to this function are making queries about a mark which has already been split by a `MarkQueue`\n// to match the ranges in `moveEffects`.\n// TODO: Reduce the duplication between this and other MoveEffect helpers\nfunction getModifyAfter(\n\tmoveEffects: MoveEffectTable,\n\trevision: RevisionTag | undefined,\n\tid: MoveId,\n): NodeId | undefined {\n\tconst target = CrossFieldTarget.Source;\n\tconst effect = getMoveEffect(moveEffects, target, revision, id, 1);\n\n\tif (effect.value?.modifyAfter !== undefined) {\n\t\treturn effect.value.modifyAfter;\n\t}\n\n\treturn undefined;\n}\n\n// TODO: Reduce the duplication between this and other MoveEffect helpers\nfunction setModifyAfter(\n\tmoveEffects: MoveEffectTable,\n\t{ revision, localId: id }: ChangeAtomId,\n\tmodifyAfter: NodeId,\n): void {\n\tconst target = CrossFieldTarget.Source;\n\tconst count = 1;\n\tconst effect = getMoveEffect(moveEffects, target, revision, id, count, false);\n\tconst newEffect: MoveEffect =\n\t\teffect.value === undefined ? { modifyAfter } : { ...effect.value, modifyAfter };\n\tsetMoveEffect(moveEffects, target, revision, id, count, newEffect);\n}\n\nfunction setEndpoint(\n\tmoveEffects: MoveEffectTable,\n\ttarget: CrossFieldTarget,\n\tid: ChangeAtomId,\n\tcount: number,\n\tendpoint: ChangeAtomId,\n): void {\n\tconst effect = getMoveEffect(moveEffects, target, id.revision, id.localId, count, false);\n\tconst newEffect = effect.value === undefined ? { endpoint } : { ...effect.value, endpoint };\n\tsetMoveEffect(moveEffects, target, id.revision, id.localId, effect.length, newEffect);\n\n\tconst remainingCount = count - effect.length;\n\tif (remainingCount > 0) {\n\t\tsetEndpoint(\n\t\t\tmoveEffects,\n\t\t\ttarget,\n\t\t\toffsetChangeAtomId(id, effect.length),\n\t\t\tremainingCount,\n\t\t\toffsetChangeAtomId(endpoint, effect.length),\n\t\t);\n\t}\n}\n\nfunction setTruncatedEndpoint(\n\tmoveEffects: MoveEffectTable,\n\ttarget: CrossFieldTarget,\n\tid: ChangeAtomId,\n\tcount: number,\n\ttruncatedEndpoint: ChangeAtomId,\n): void {\n\tconst effect = getMoveEffect(moveEffects, target, id.revision, id.localId, count);\n\tconst newEffect =\n\t\teffect.value === undefined\n\t\t\t? { truncatedEndpoint }\n\t\t\t: { ...effect.value, truncatedEndpoint };\n\n\tsetMoveEffect(moveEffects, target, id.revision, id.localId, effect.length, newEffect);\n\n\tconst remainingCount = count - effect.length;\n\tif (remainingCount > 0) {\n\t\tsetTruncatedEndpoint(\n\t\t\tmoveEffects,\n\t\t\ttarget,\n\t\t\toffsetChangeAtomId(id, effect.length),\n\t\t\tremainingCount,\n\t\t\toffsetChangeAtomId(truncatedEndpoint, effect.length),\n\t\t);\n\t}\n}\n\nfunction setTruncatedEndpointForInner(\n\tmoveEffects: MoveEffectTable,\n\ttarget: CrossFieldTarget,\n\tid: ChangeAtomId,\n\tcount: number,\n\ttruncatedEndpointForInner: ChangeAtomId,\n): void {\n\tconst effect = getMoveEffect(moveEffects, target, id.revision, id.localId, count);\n\tconst newEffect =\n\t\teffect.value === undefined\n\t\t\t? { truncatedEndpointForInner }\n\t\t\t: { ...effect.value, truncatedEndpointForInner };\n\tsetMoveEffect(moveEffects, target, id.revision, id.localId, effect.length, newEffect);\n\n\tconst remainingCount = count - effect.length;\n\tif (remainingCount > 0) {\n\t\tsetTruncatedEndpointForInner(\n\t\t\tmoveEffects,\n\t\t\ttarget,\n\t\t\toffsetChangeAtomId(id, effect.length),\n\t\t\tremainingCount,\n\t\t\toffsetChangeAtomId(truncatedEndpointForInner, effect.length),\n\t\t);\n\t}\n}\n\nfunction withUpdatedEndpoint<TMark extends MarkEffect>(\n\tmark: TMark,\n\tcount: number,\n\teffects: MoveEffectTable,\n): TMark {\n\tif (isAttachAndDetachEffect(mark)) {\n\t\treturn {\n\t\t\t...mark,\n\t\t\tattach: withUpdatedEndpoint(mark.attach, count, effects),\n\t\t\tdetach: withUpdatedEndpoint(mark.detach, count, effects),\n\t\t};\n\t}\n\n\tif (!isMoveMark(mark)) {\n\t\treturn mark;\n\t}\n\tconst finalDest = getComposedEndpoint(\n\t\teffects,\n\t\tgetCrossFieldTargetFromMove(mark),\n\t\tmark.revision,\n\t\tmark.id,\n\t\tcount,\n\t);\n\n\tif (finalDest === undefined) {\n\t\treturn mark;\n\t}\n\n\tconst output = { ...mark };\n\tchangeFinalEndpoint(output, finalDest);\n\n\treturn output;\n}\n\nfunction changeFinalEndpoint(mark: MoveMarkEffect, endpoint: ChangeAtomId): void {\n\tif (areEqualCellIds(endpoint, { revision: mark.revision, localId: mark.id })) {\n\t\tdelete mark.finalEndpoint;\n\t} else {\n\t\tmark.finalEndpoint = endpoint;\n\t}\n}\n\nfunction getComposedEndpoint(\n\tmoveEffects: MoveEffectTable,\n\ttarget: CrossFieldTarget,\n\trevision: RevisionTag | undefined,\n\tid: MoveId,\n\tcount: number,\n): ChangeAtomId | undefined {\n\tconst effect = getMoveEffect(moveEffects, target, revision, id, count);\n\tassert(effect.length === count, 0x815 /* Expected effect to cover entire mark */);\n\treturn effect.value?.truncatedEndpoint ?? effect.value?.endpoint;\n}\n\nfunction getTruncatedEndpointForInner(\n\tmoveEffects: MoveEffectTable,\n\ttarget: CrossFieldTarget,\n\trevision: RevisionTag | undefined,\n\tid: MoveId,\n\tcount: number,\n): ChangeAtomId | undefined {\n\tconst effect = getMoveEffect(moveEffects, target, revision, id, count);\n\tassert(effect.length === count, 0x934 /* Expected effect to cover entire mark */);\n\treturn effect.value?.truncatedEndpointForInner;\n}\n"]}