@fluidframework/tree 2.41.0-338186 → 2.41.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 (1205) hide show
  1. package/CHANGELOG.md +341 -0
  2. package/api-report/tree.alpha.api.md +174 -4
  3. package/dist/alpha.d.ts +3 -0
  4. package/dist/codec/codec.d.ts +52 -7
  5. package/dist/codec/codec.d.ts.map +1 -1
  6. package/dist/codec/codec.js +60 -8
  7. package/dist/codec/codec.js.map +1 -1
  8. package/dist/core/change-family/editBuilder.d.ts.map +1 -1
  9. package/dist/core/change-family/editBuilder.js.map +1 -1
  10. package/dist/core/forest/forest.d.ts.map +1 -1
  11. package/dist/core/forest/forest.js.map +1 -1
  12. package/dist/core/index.d.ts +1 -1
  13. package/dist/core/index.d.ts.map +1 -1
  14. package/dist/core/index.js +2 -1
  15. package/dist/core/index.js.map +1 -1
  16. package/dist/core/rebase/types.d.ts +2 -2
  17. package/dist/core/rebase/types.js +2 -2
  18. package/dist/core/rebase/types.js.map +1 -1
  19. package/dist/core/rebase/utils.d.ts +0 -2
  20. package/dist/core/rebase/utils.d.ts.map +1 -1
  21. package/dist/core/rebase/utils.js +6 -10
  22. package/dist/core/rebase/utils.js.map +1 -1
  23. package/dist/core/schema-stored/formatV1.d.ts +0 -1
  24. package/dist/core/schema-stored/formatV1.d.ts.map +1 -1
  25. package/dist/core/schema-stored/formatV1.js +1 -2
  26. package/dist/core/schema-stored/formatV1.js.map +1 -1
  27. package/dist/core/schema-stored/index.d.ts +1 -1
  28. package/dist/core/schema-stored/index.d.ts.map +1 -1
  29. package/dist/core/schema-stored/index.js +2 -1
  30. package/dist/core/schema-stored/index.js.map +1 -1
  31. package/dist/core/schema-stored/schema.d.ts +6 -0
  32. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  33. package/dist/core/schema-stored/schema.js +8 -1
  34. package/dist/core/schema-stored/schema.js.map +1 -1
  35. package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  36. package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  37. package/dist/core/schema-stored/storedSchemaRepository.js +1 -1
  38. package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
  39. package/dist/core/tree/anchorSet.d.ts +2 -1
  40. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  41. package/dist/core/tree/anchorSet.js +4 -3
  42. package/dist/core/tree/anchorSet.js.map +1 -1
  43. package/dist/core/tree/chunk.d.ts.map +1 -1
  44. package/dist/core/tree/chunk.js.map +1 -1
  45. package/dist/core/tree/delta.d.ts.map +1 -1
  46. package/dist/core/tree/delta.js.map +1 -1
  47. package/dist/core/tree/deltaUtil.d.ts.map +1 -1
  48. package/dist/core/tree/deltaUtil.js.map +1 -1
  49. package/dist/core/tree/detachedFieldIndex.d.ts +1 -1
  50. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  51. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  52. package/dist/core/tree/detachedFieldIndexCodec.d.ts +1 -1
  53. package/dist/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
  54. package/dist/core/tree/detachedFieldIndexCodec.js +1 -1
  55. package/dist/core/tree/detachedFieldIndexCodec.js.map +1 -1
  56. package/dist/core/tree/pathTree.d.ts +12 -11
  57. package/dist/core/tree/pathTree.d.ts.map +1 -1
  58. package/dist/core/tree/pathTree.js +8 -7
  59. package/dist/core/tree/pathTree.js.map +1 -1
  60. package/dist/core/tree/treeTextFormat.d.ts +1 -1
  61. package/dist/core/tree/treeTextFormat.d.ts.map +1 -1
  62. package/dist/core/tree/treeTextFormat.js +1 -1
  63. package/dist/core/tree/treeTextFormat.js.map +1 -1
  64. package/dist/core/tree/visitDelta.d.ts +1 -1
  65. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  66. package/dist/core/tree/visitDelta.js.map +1 -1
  67. package/dist/core/tree/visitorUtils.d.ts +2 -2
  68. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  69. package/dist/core/tree/visitorUtils.js.map +1 -1
  70. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +1 -1
  71. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  72. package/dist/feature-libraries/chunked-forest/chunkTree.js +1 -1
  73. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  74. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +2 -2
  75. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  76. package/dist/feature-libraries/chunked-forest/chunkedForest.js +2 -2
  77. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  78. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -1
  79. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  80. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  81. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +2 -2
  82. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  83. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  84. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  85. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  86. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +8 -2
  87. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  88. package/dist/feature-libraries/chunked-forest/codec/codecs.js +12 -1
  89. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  90. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
  91. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  92. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  93. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
  94. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  95. package/dist/feature-libraries/chunked-forest/codec/index.js +2 -1
  96. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  97. package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
  98. package/dist/feature-libraries/chunked-forest/codec/nodeShape.js +1 -1
  99. package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
  100. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  101. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  102. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  103. package/dist/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
  104. package/dist/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
  105. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  106. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  107. package/dist/feature-libraries/chunked-forest/index.js +2 -1
  108. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  109. package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
  110. package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
  111. package/dist/feature-libraries/chunked-forest/sequenceChunk.js +4 -4
  112. package/dist/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
  113. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +1 -1
  114. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  115. package/dist/feature-libraries/chunked-forest/uniformChunk.js +1 -1
  116. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  117. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +1 -1
  118. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  119. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  120. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  121. package/dist/feature-libraries/default-schema/index.d.ts +1 -1
  122. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  123. package/dist/feature-libraries/default-schema/index.js +3 -2
  124. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  125. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  126. package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  127. package/dist/feature-libraries/default-schema/schemaChecker.d.ts +18 -14
  128. package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
  129. package/dist/feature-libraries/default-schema/schemaChecker.js +78 -54
  130. package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  131. package/dist/feature-libraries/flex-tree/context.d.ts +18 -2
  132. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  133. package/dist/feature-libraries/flex-tree/context.js +22 -6
  134. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  135. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +3 -2
  136. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  137. package/dist/feature-libraries/flex-tree/flexTreeTypes.js +3 -2
  138. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  139. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  140. package/dist/feature-libraries/flex-tree/lazyField.js +1 -1
  141. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  142. package/dist/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
  143. package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
  144. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +1 -1
  145. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  146. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  147. package/dist/feature-libraries/index.d.ts +3 -3
  148. package/dist/feature-libraries/index.d.ts.map +1 -1
  149. package/dist/feature-libraries/index.js +5 -4
  150. package/dist/feature-libraries/index.js.map +1 -1
  151. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +2 -2
  152. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  153. package/dist/feature-libraries/indexing/anchorTreeIndex.js +15 -15
  154. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  155. package/dist/feature-libraries/initializeForest.d.ts.map +1 -1
  156. package/dist/feature-libraries/initializeForest.js.map +1 -1
  157. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  158. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  159. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +1 -1
  160. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  161. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  162. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +1 -1
  163. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +1 -1
  164. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
  165. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  166. package/dist/feature-libraries/modular-schema/genericFieldKind.js +2 -2
  167. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  168. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  169. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  170. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.d.ts.map +1 -1
  171. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
  172. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts +0 -2
  173. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  174. package/dist/feature-libraries/modular-schema/isNeverTree.js +0 -2
  175. package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  176. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  177. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  178. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -0
  179. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  180. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +2 -0
  181. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  182. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  183. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  184. package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.d.ts.map +1 -1
  185. package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js +8 -3
  186. package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
  187. package/dist/feature-libraries/object-forest/objectForest.d.ts +22 -5
  188. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  189. package/dist/feature-libraries/object-forest/objectForest.js +296 -207
  190. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  191. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +2 -2
  192. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  193. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +3 -2
  194. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  195. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
  196. package/dist/feature-libraries/schema-index/codec.d.ts +6 -12
  197. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  198. package/dist/feature-libraries/schema-index/codec.js +8 -15
  199. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  200. package/dist/feature-libraries/schema-index/formatV1.d.ts +2 -2
  201. package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
  202. package/dist/feature-libraries/schema-index/formatV1.js +1 -1
  203. package/dist/feature-libraries/schema-index/formatV1.js.map +1 -1
  204. package/dist/feature-libraries/schema-index/index.d.ts +1 -1
  205. package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
  206. package/dist/feature-libraries/schema-index/index.js +1 -2
  207. package/dist/feature-libraries/schema-index/index.js.map +1 -1
  208. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +1 -1
  209. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  210. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  211. package/dist/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
  212. package/dist/feature-libraries/sequence-field/formatV3.js.map +1 -1
  213. package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  214. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  215. package/dist/feature-libraries/sequence-field/prune.d.ts.map +1 -1
  216. package/dist/feature-libraries/sequence-field/prune.js.map +1 -1
  217. package/dist/feature-libraries/sequence-field/rebase.js +1 -1
  218. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  219. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +1 -1
  220. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -1
  221. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
  222. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  223. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  224. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +1 -1
  225. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
  226. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js +1 -1
  227. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
  228. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
  229. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  230. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +1 -1
  231. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  232. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +1 -1
  233. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  234. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +2 -2
  235. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  236. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +1 -1
  237. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  238. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  239. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +1 -1
  240. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  241. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  242. package/dist/feature-libraries/sequence-field/utils.d.ts +7 -5
  243. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  244. package/dist/feature-libraries/sequence-field/utils.js +7 -5
  245. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  246. package/dist/feature-libraries/treeCursorUtils.d.ts.map +1 -1
  247. package/dist/feature-libraries/treeCursorUtils.js +3 -3
  248. package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
  249. package/dist/feature-libraries/treeTextCursor.d.ts +1 -1
  250. package/dist/feature-libraries/treeTextCursor.js +1 -1
  251. package/dist/feature-libraries/treeTextCursor.js.map +1 -1
  252. package/dist/feature-libraries/valueUtilities.d.ts.map +1 -1
  253. package/dist/feature-libraries/valueUtilities.js +6 -6
  254. package/dist/feature-libraries/valueUtilities.js.map +1 -1
  255. package/dist/index.d.ts +2 -2
  256. package/dist/index.d.ts.map +1 -1
  257. package/dist/index.js +2 -6
  258. package/dist/index.js.map +1 -1
  259. package/dist/jsonDomainSchema.d.ts.map +1 -1
  260. package/dist/jsonDomainSchema.js.map +1 -1
  261. package/dist/packageVersion.d.ts +1 -1
  262. package/dist/packageVersion.d.ts.map +1 -1
  263. package/dist/packageVersion.js +1 -1
  264. package/dist/packageVersion.js.map +1 -1
  265. package/dist/serializableDomainSchema.d.ts.map +1 -1
  266. package/dist/serializableDomainSchema.js.map +1 -1
  267. package/dist/shared-tree/checkoutFlexTreeView.d.ts.map +1 -1
  268. package/dist/shared-tree/checkoutFlexTreeView.js.map +1 -1
  269. package/dist/shared-tree/independentView.d.ts +1 -1
  270. package/dist/shared-tree/independentView.d.ts.map +1 -1
  271. package/dist/shared-tree/independentView.js +8 -3
  272. package/dist/shared-tree/independentView.js.map +1 -1
  273. package/dist/shared-tree/index.d.ts +1 -1
  274. package/dist/shared-tree/index.d.ts.map +1 -1
  275. package/dist/shared-tree/index.js.map +1 -1
  276. package/dist/shared-tree/schematizeTree.d.ts +1 -1
  277. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  278. package/dist/shared-tree/schematizeTree.js.map +1 -1
  279. package/dist/shared-tree/schematizingTreeView.d.ts +1 -1
  280. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  281. package/dist/shared-tree/schematizingTreeView.js +1 -1
  282. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  283. package/dist/shared-tree/sharedTree.d.ts +3 -3
  284. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  285. package/dist/shared-tree/sharedTree.js +8 -8
  286. package/dist/shared-tree/sharedTree.js.map +1 -1
  287. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +1 -1
  288. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  289. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  290. package/dist/shared-tree/tree.js +1 -1
  291. package/dist/shared-tree/tree.js.map +1 -1
  292. package/dist/shared-tree/treeAlpha.d.ts +84 -2
  293. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  294. package/dist/shared-tree/treeAlpha.js +75 -22
  295. package/dist/shared-tree/treeAlpha.js.map +1 -1
  296. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  297. package/dist/shared-tree/treeCheckout.js +3 -2
  298. package/dist/shared-tree/treeCheckout.js.map +1 -1
  299. package/dist/shared-tree-core/branch.d.ts +2 -2
  300. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  301. package/dist/shared-tree-core/branch.js +2 -2
  302. package/dist/shared-tree-core/branch.js.map +1 -1
  303. package/dist/shared-tree-core/branchCommitEnricher.d.ts +1 -1
  304. package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  305. package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
  306. package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  307. package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  308. package/dist/shared-tree-core/editManager.d.ts +3 -1
  309. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  310. package/dist/shared-tree-core/editManager.js +4 -2
  311. package/dist/shared-tree-core/editManager.js.map +1 -1
  312. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  313. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  314. package/dist/shared-tree-core/editManagerSummarizer.d.ts +1 -1
  315. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  316. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  317. package/dist/shared-tree-core/messageCodecs.d.ts +1 -1
  318. package/dist/shared-tree-core/messageCodecs.js +1 -1
  319. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  320. package/dist/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  321. package/dist/shared-tree-core/sequenceIdUtils.js.map +1 -1
  322. package/dist/shared-tree-core/sharedTreeCore.d.ts +2 -2
  323. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  324. package/dist/shared-tree-core/sharedTreeCore.js +4 -4
  325. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  326. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  327. package/dist/shared-tree-core/transaction.js +1 -1
  328. package/dist/shared-tree-core/transaction.js.map +1 -1
  329. package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  330. package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
  331. package/dist/sharedTreeAttributes.d.ts.map +1 -1
  332. package/dist/sharedTreeAttributes.js.map +1 -1
  333. package/dist/simple-tree/api/conciseTree.d.ts.map +1 -1
  334. package/dist/simple-tree/api/conciseTree.js +1 -1
  335. package/dist/simple-tree/api/conciseTree.js.map +1 -1
  336. package/dist/simple-tree/api/configuration.js +4 -4
  337. package/dist/simple-tree/api/configuration.js.map +1 -1
  338. package/dist/simple-tree/api/create.d.ts +2 -26
  339. package/dist/simple-tree/api/create.d.ts.map +1 -1
  340. package/dist/simple-tree/api/create.js +5 -42
  341. package/dist/simple-tree/api/create.js.map +1 -1
  342. package/dist/simple-tree/api/customTree.d.ts +1 -1
  343. package/dist/simple-tree/api/customTree.d.ts.map +1 -1
  344. package/dist/simple-tree/api/customTree.js +24 -24
  345. package/dist/simple-tree/api/customTree.js.map +1 -1
  346. package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  347. package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
  348. package/dist/simple-tree/api/identifierIndex.js +2 -2
  349. package/dist/simple-tree/api/identifierIndex.js.map +1 -1
  350. package/dist/simple-tree/api/index.d.ts +2 -3
  351. package/dist/simple-tree/api/index.d.ts.map +1 -1
  352. package/dist/simple-tree/api/index.js +4 -9
  353. package/dist/simple-tree/api/index.js.map +1 -1
  354. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  355. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  356. package/dist/simple-tree/api/schemaFactory.d.ts +5 -5
  357. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  358. package/dist/simple-tree/api/schemaFactory.js +8 -8
  359. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  360. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +1 -3
  361. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  362. package/dist/simple-tree/api/schemaFactoryAlpha.js +4 -6
  363. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  364. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +2 -2
  365. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  366. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  367. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  368. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  369. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  370. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  371. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +4 -6
  372. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  373. package/dist/simple-tree/api/storedSchema.d.ts +1 -1
  374. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  375. package/dist/simple-tree/api/storedSchema.js +7 -6
  376. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  377. package/dist/simple-tree/api/tree.d.ts +2 -2
  378. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  379. package/dist/simple-tree/api/tree.js.map +1 -1
  380. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
  381. package/dist/simple-tree/api/treeBeta.js +1 -1
  382. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  383. package/dist/simple-tree/api/treeNodeApi.d.ts +38 -3
  384. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  385. package/dist/simple-tree/api/treeNodeApi.js +42 -28
  386. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  387. package/dist/simple-tree/api/typesUnsafe.d.ts +1 -1
  388. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  389. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  390. package/dist/simple-tree/api/verboseTree.js +3 -3
  391. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  392. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  393. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +4 -6
  394. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  395. package/dist/simple-tree/core/context.d.ts.map +1 -1
  396. package/dist/simple-tree/core/context.js.map +1 -1
  397. package/dist/simple-tree/core/getOrCreateNode.d.ts +1 -1
  398. package/dist/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
  399. package/dist/simple-tree/core/getOrCreateNode.js +1 -1
  400. package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
  401. package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
  402. package/dist/simple-tree/core/treeNode.js +1 -1
  403. package/dist/simple-tree/core/treeNode.js.map +1 -1
  404. package/dist/simple-tree/core/treeNodeKernel.d.ts +8 -20
  405. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  406. package/dist/simple-tree/core/treeNodeKernel.js +19 -50
  407. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  408. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  409. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  410. package/dist/simple-tree/core/types.d.ts.map +1 -1
  411. package/dist/simple-tree/core/types.js.map +1 -1
  412. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  413. package/dist/simple-tree/core/unhydratedFlexTree.js +21 -21
  414. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  415. package/dist/simple-tree/core/withType.d.ts +1 -1
  416. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  417. package/dist/simple-tree/core/withType.js.map +1 -1
  418. package/dist/simple-tree/createContext.d.ts.map +1 -1
  419. package/dist/simple-tree/createContext.js.map +1 -1
  420. package/{lib/simple-tree/proxies.d.ts → dist/simple-tree/getTreeNodeForField.d.ts} +1 -1
  421. package/dist/simple-tree/getTreeNodeForField.d.ts.map +1 -0
  422. package/dist/simple-tree/{proxies.js → getTreeNodeForField.js} +1 -1
  423. package/dist/simple-tree/getTreeNodeForField.js.map +1 -0
  424. package/dist/simple-tree/index.d.ts +3 -10
  425. package/dist/simple-tree/index.d.ts.map +1 -1
  426. package/dist/simple-tree/index.js +17 -23
  427. package/dist/simple-tree/index.js.map +1 -1
  428. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  429. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  430. package/dist/simple-tree/{arrayNode.d.ts → node-kinds/array/arrayNode.d.ts} +3 -3
  431. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -0
  432. package/dist/simple-tree/{arrayNode.js → node-kinds/array/arrayNode.js} +10 -10
  433. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -0
  434. package/dist/simple-tree/{arrayNodeTypes.d.ts → node-kinds/array/arrayNodeTypes.d.ts} +3 -3
  435. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -0
  436. package/dist/simple-tree/{arrayNodeTypes.js → node-kinds/array/arrayNodeTypes.js} +1 -1
  437. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -0
  438. package/dist/simple-tree/node-kinds/array/index.d.ts +7 -0
  439. package/dist/simple-tree/node-kinds/array/index.d.ts.map +1 -0
  440. package/dist/simple-tree/node-kinds/array/index.js +16 -0
  441. package/dist/simple-tree/node-kinds/array/index.js.map +1 -0
  442. package/dist/simple-tree/node-kinds/index.d.ts +8 -0
  443. package/dist/simple-tree/node-kinds/index.d.ts.map +1 -0
  444. package/dist/simple-tree/node-kinds/index.js +26 -0
  445. package/dist/simple-tree/node-kinds/index.js.map +1 -0
  446. package/dist/simple-tree/node-kinds/map/index.d.ts +7 -0
  447. package/dist/simple-tree/node-kinds/map/index.d.ts.map +1 -0
  448. package/dist/simple-tree/node-kinds/map/index.js +13 -0
  449. package/dist/simple-tree/node-kinds/map/index.js.map +1 -0
  450. package/{lib/simple-tree → dist/simple-tree/node-kinds/map}/mapNode.d.ts +3 -3
  451. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -0
  452. package/dist/simple-tree/{mapNode.js → node-kinds/map/mapNode.js} +11 -11
  453. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -0
  454. package/dist/simple-tree/{mapNodeTypes.d.ts → node-kinds/map/mapNodeTypes.d.ts} +3 -3
  455. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -0
  456. package/dist/simple-tree/{mapNodeTypes.js → node-kinds/map/mapNodeTypes.js} +1 -1
  457. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -0
  458. package/dist/simple-tree/node-kinds/object/index.d.ts +7 -0
  459. package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -0
  460. package/dist/simple-tree/node-kinds/object/index.js +16 -0
  461. package/dist/simple-tree/node-kinds/object/index.js.map +1 -0
  462. package/{lib/simple-tree → dist/simple-tree/node-kinds/object}/objectNode.d.ts +17 -6
  463. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -0
  464. package/dist/simple-tree/{objectNode.js → node-kinds/object/objectNode.js} +49 -26
  465. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -0
  466. package/{lib/simple-tree → dist/simple-tree/node-kinds/object}/objectNodeTypes.d.ts +5 -5
  467. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -0
  468. package/dist/simple-tree/{objectNodeTypes.js → node-kinds/object/objectNodeTypes.js} +1 -1
  469. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -0
  470. package/dist/simple-tree/prepareForInsertion.d.ts +18 -6
  471. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  472. package/dist/simple-tree/prepareForInsertion.js +51 -22
  473. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  474. package/dist/simple-tree/schemaTypes.d.ts +2 -2
  475. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  476. package/dist/simple-tree/schemaTypes.js.map +1 -1
  477. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  478. package/dist/simple-tree/simpleSchema.js.map +1 -1
  479. package/dist/simple-tree/toMapTree.d.ts +2 -22
  480. package/dist/simple-tree/toMapTree.d.ts.map +1 -1
  481. package/dist/simple-tree/toMapTree.js +44 -23
  482. package/dist/simple-tree/toMapTree.js.map +1 -1
  483. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  484. package/dist/simple-tree/toStoredSchema.js +1 -1
  485. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  486. package/dist/simple-tree/treeNodeValid.d.ts +1 -1
  487. package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
  488. package/dist/simple-tree/treeNodeValid.js +10 -10
  489. package/dist/simple-tree/treeNodeValid.js.map +1 -1
  490. package/dist/simple-tree/walkFieldSchema.d.ts.map +1 -1
  491. package/dist/simple-tree/walkFieldSchema.js.map +1 -1
  492. package/dist/tableSchema.d.ts +119 -72
  493. package/dist/tableSchema.d.ts.map +1 -1
  494. package/dist/tableSchema.js +83 -36
  495. package/dist/tableSchema.js.map +1 -1
  496. package/dist/treeFactory.d.ts +1 -1
  497. package/dist/treeFactory.d.ts.map +1 -1
  498. package/dist/treeFactory.js +3 -3
  499. package/dist/treeFactory.js.map +1 -1
  500. package/dist/util/bTreeUtils.d.ts.map +1 -1
  501. package/dist/util/bTreeUtils.js.map +1 -1
  502. package/dist/util/breakable.d.ts +23 -4
  503. package/dist/util/breakable.d.ts.map +1 -1
  504. package/dist/util/breakable.js +12 -3
  505. package/dist/util/breakable.js.map +1 -1
  506. package/docs/SharedTree Philosophy.md +5 -5
  507. package/lib/alpha.d.ts +3 -0
  508. package/lib/codec/codec.d.ts +52 -7
  509. package/lib/codec/codec.d.ts.map +1 -1
  510. package/lib/codec/codec.js +60 -8
  511. package/lib/codec/codec.js.map +1 -1
  512. package/lib/core/change-family/editBuilder.d.ts.map +1 -1
  513. package/lib/core/change-family/editBuilder.js.map +1 -1
  514. package/lib/core/forest/forest.d.ts.map +1 -1
  515. package/lib/core/forest/forest.js.map +1 -1
  516. package/lib/core/index.d.ts +1 -1
  517. package/lib/core/index.d.ts.map +1 -1
  518. package/lib/core/index.js +1 -1
  519. package/lib/core/index.js.map +1 -1
  520. package/lib/core/rebase/types.d.ts +2 -2
  521. package/lib/core/rebase/types.js +2 -2
  522. package/lib/core/rebase/types.js.map +1 -1
  523. package/lib/core/rebase/utils.d.ts +0 -2
  524. package/lib/core/rebase/utils.d.ts.map +1 -1
  525. package/lib/core/rebase/utils.js +6 -10
  526. package/lib/core/rebase/utils.js.map +1 -1
  527. package/lib/core/schema-stored/formatV1.d.ts +0 -1
  528. package/lib/core/schema-stored/formatV1.d.ts.map +1 -1
  529. package/lib/core/schema-stored/formatV1.js +0 -1
  530. package/lib/core/schema-stored/formatV1.js.map +1 -1
  531. package/lib/core/schema-stored/index.d.ts +1 -1
  532. package/lib/core/schema-stored/index.d.ts.map +1 -1
  533. package/lib/core/schema-stored/index.js +1 -1
  534. package/lib/core/schema-stored/index.js.map +1 -1
  535. package/lib/core/schema-stored/schema.d.ts +6 -0
  536. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  537. package/lib/core/schema-stored/schema.js +7 -0
  538. package/lib/core/schema-stored/schema.js.map +1 -1
  539. package/lib/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  540. package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  541. package/lib/core/schema-stored/storedSchemaRepository.js +1 -1
  542. package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
  543. package/lib/core/tree/anchorSet.d.ts +2 -1
  544. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  545. package/lib/core/tree/anchorSet.js +4 -3
  546. package/lib/core/tree/anchorSet.js.map +1 -1
  547. package/lib/core/tree/chunk.d.ts.map +1 -1
  548. package/lib/core/tree/chunk.js.map +1 -1
  549. package/lib/core/tree/delta.d.ts.map +1 -1
  550. package/lib/core/tree/delta.js.map +1 -1
  551. package/lib/core/tree/deltaUtil.d.ts.map +1 -1
  552. package/lib/core/tree/deltaUtil.js.map +1 -1
  553. package/lib/core/tree/detachedFieldIndex.d.ts +1 -1
  554. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  555. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  556. package/lib/core/tree/detachedFieldIndexCodec.d.ts +1 -1
  557. package/lib/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
  558. package/lib/core/tree/detachedFieldIndexCodec.js +1 -1
  559. package/lib/core/tree/detachedFieldIndexCodec.js.map +1 -1
  560. package/lib/core/tree/pathTree.d.ts +12 -11
  561. package/lib/core/tree/pathTree.d.ts.map +1 -1
  562. package/lib/core/tree/pathTree.js +8 -7
  563. package/lib/core/tree/pathTree.js.map +1 -1
  564. package/lib/core/tree/treeTextFormat.d.ts +1 -1
  565. package/lib/core/tree/treeTextFormat.d.ts.map +1 -1
  566. package/lib/core/tree/treeTextFormat.js +1 -1
  567. package/lib/core/tree/treeTextFormat.js.map +1 -1
  568. package/lib/core/tree/visitDelta.d.ts +1 -1
  569. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  570. package/lib/core/tree/visitDelta.js.map +1 -1
  571. package/lib/core/tree/visitorUtils.d.ts +2 -2
  572. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  573. package/lib/core/tree/visitorUtils.js.map +1 -1
  574. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +1 -1
  575. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  576. package/lib/feature-libraries/chunked-forest/chunkTree.js +1 -1
  577. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  578. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +2 -2
  579. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  580. package/lib/feature-libraries/chunked-forest/chunkedForest.js +2 -2
  581. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  582. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -1
  583. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  584. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  585. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +2 -2
  586. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  587. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  588. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  589. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  590. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +8 -2
  591. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  592. package/lib/feature-libraries/chunked-forest/codec/codecs.js +10 -0
  593. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  594. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
  595. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  596. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  597. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
  598. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  599. package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
  600. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  601. package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
  602. package/lib/feature-libraries/chunked-forest/codec/nodeShape.js +1 -1
  603. package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
  604. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  605. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  606. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  607. package/lib/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
  608. package/lib/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
  609. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  610. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  611. package/lib/feature-libraries/chunked-forest/index.js +1 -1
  612. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  613. package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
  614. package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
  615. package/lib/feature-libraries/chunked-forest/sequenceChunk.js +1 -1
  616. package/lib/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
  617. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +1 -1
  618. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  619. package/lib/feature-libraries/chunked-forest/uniformChunk.js +1 -1
  620. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  621. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +1 -1
  622. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  623. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  624. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  625. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  626. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  627. package/lib/feature-libraries/default-schema/index.js +1 -1
  628. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  629. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  630. package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  631. package/lib/feature-libraries/default-schema/schemaChecker.d.ts +18 -14
  632. package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
  633. package/lib/feature-libraries/default-schema/schemaChecker.js +76 -53
  634. package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  635. package/lib/feature-libraries/flex-tree/context.d.ts +18 -2
  636. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  637. package/lib/feature-libraries/flex-tree/context.js +23 -7
  638. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  639. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +3 -2
  640. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  641. package/lib/feature-libraries/flex-tree/flexTreeTypes.js +3 -2
  642. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  643. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  644. package/lib/feature-libraries/flex-tree/lazyField.js +1 -1
  645. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  646. package/lib/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
  647. package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
  648. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +1 -1
  649. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  650. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  651. package/lib/feature-libraries/index.d.ts +3 -3
  652. package/lib/feature-libraries/index.d.ts.map +1 -1
  653. package/lib/feature-libraries/index.js +3 -3
  654. package/lib/feature-libraries/index.js.map +1 -1
  655. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts +2 -2
  656. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  657. package/lib/feature-libraries/indexing/anchorTreeIndex.js +1 -1
  658. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  659. package/lib/feature-libraries/initializeForest.d.ts.map +1 -1
  660. package/lib/feature-libraries/initializeForest.js.map +1 -1
  661. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  662. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  663. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +1 -1
  664. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  665. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  666. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +1 -1
  667. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +1 -1
  668. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
  669. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  670. package/lib/feature-libraries/modular-schema/genericFieldKind.js +2 -2
  671. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  672. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  673. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  674. package/lib/feature-libraries/modular-schema/genericFieldKindTypes.d.ts.map +1 -1
  675. package/lib/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
  676. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts +0 -2
  677. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  678. package/lib/feature-libraries/modular-schema/isNeverTree.js +0 -2
  679. package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  680. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  681. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  682. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -0
  683. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  684. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +2 -0
  685. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  686. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  687. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  688. package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.d.ts.map +1 -1
  689. package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js +8 -3
  690. package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
  691. package/lib/feature-libraries/object-forest/objectForest.d.ts +22 -5
  692. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  693. package/lib/feature-libraries/object-forest/objectForest.js +299 -209
  694. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  695. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +2 -2
  696. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  697. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +4 -3
  698. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  699. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
  700. package/lib/feature-libraries/schema-index/codec.d.ts +6 -12
  701. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  702. package/lib/feature-libraries/schema-index/codec.js +8 -15
  703. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  704. package/lib/feature-libraries/schema-index/formatV1.d.ts +2 -2
  705. package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
  706. package/lib/feature-libraries/schema-index/formatV1.js +2 -2
  707. package/lib/feature-libraries/schema-index/formatV1.js.map +1 -1
  708. package/lib/feature-libraries/schema-index/index.d.ts +1 -1
  709. package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
  710. package/lib/feature-libraries/schema-index/index.js +1 -1
  711. package/lib/feature-libraries/schema-index/index.js.map +1 -1
  712. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +1 -1
  713. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  714. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  715. package/lib/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
  716. package/lib/feature-libraries/sequence-field/formatV3.js.map +1 -1
  717. package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  718. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  719. package/lib/feature-libraries/sequence-field/prune.d.ts.map +1 -1
  720. package/lib/feature-libraries/sequence-field/prune.js.map +1 -1
  721. package/lib/feature-libraries/sequence-field/rebase.js +1 -1
  722. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  723. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +1 -1
  724. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -1
  725. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
  726. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  727. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  728. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +1 -1
  729. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
  730. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +1 -1
  731. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
  732. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
  733. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  734. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +1 -1
  735. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  736. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +1 -1
  737. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  738. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +2 -2
  739. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  740. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +1 -1
  741. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  742. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  743. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +1 -1
  744. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  745. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  746. package/lib/feature-libraries/sequence-field/utils.d.ts +7 -5
  747. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  748. package/lib/feature-libraries/sequence-field/utils.js +7 -5
  749. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  750. package/lib/feature-libraries/treeCursorUtils.d.ts.map +1 -1
  751. package/lib/feature-libraries/treeCursorUtils.js +3 -3
  752. package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
  753. package/lib/feature-libraries/treeTextCursor.d.ts +1 -1
  754. package/lib/feature-libraries/treeTextCursor.js +1 -1
  755. package/lib/feature-libraries/treeTextCursor.js.map +1 -1
  756. package/lib/feature-libraries/valueUtilities.d.ts.map +1 -1
  757. package/lib/feature-libraries/valueUtilities.js +1 -1
  758. package/lib/feature-libraries/valueUtilities.js.map +1 -1
  759. package/lib/index.d.ts +2 -2
  760. package/lib/index.d.ts.map +1 -1
  761. package/lib/index.js +0 -2
  762. package/lib/index.js.map +1 -1
  763. package/lib/jsonDomainSchema.d.ts.map +1 -1
  764. package/lib/jsonDomainSchema.js.map +1 -1
  765. package/lib/packageVersion.d.ts +1 -1
  766. package/lib/packageVersion.d.ts.map +1 -1
  767. package/lib/packageVersion.js +1 -1
  768. package/lib/packageVersion.js.map +1 -1
  769. package/lib/serializableDomainSchema.d.ts.map +1 -1
  770. package/lib/serializableDomainSchema.js.map +1 -1
  771. package/lib/shared-tree/checkoutFlexTreeView.d.ts.map +1 -1
  772. package/lib/shared-tree/checkoutFlexTreeView.js.map +1 -1
  773. package/lib/shared-tree/independentView.d.ts +1 -1
  774. package/lib/shared-tree/independentView.d.ts.map +1 -1
  775. package/lib/shared-tree/independentView.js +10 -5
  776. package/lib/shared-tree/independentView.js.map +1 -1
  777. package/lib/shared-tree/index.d.ts +1 -1
  778. package/lib/shared-tree/index.d.ts.map +1 -1
  779. package/lib/shared-tree/index.js +1 -1
  780. package/lib/shared-tree/index.js.map +1 -1
  781. package/lib/shared-tree/schematizeTree.d.ts +1 -1
  782. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  783. package/lib/shared-tree/schematizeTree.js.map +1 -1
  784. package/lib/shared-tree/schematizingTreeView.d.ts +1 -1
  785. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  786. package/lib/shared-tree/schematizingTreeView.js +1 -1
  787. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  788. package/lib/shared-tree/sharedTree.d.ts +3 -3
  789. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  790. package/lib/shared-tree/sharedTree.js +10 -10
  791. package/lib/shared-tree/sharedTree.js.map +1 -1
  792. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +1 -1
  793. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  794. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  795. package/lib/shared-tree/tree.js +1 -1
  796. package/lib/shared-tree/tree.js.map +1 -1
  797. package/lib/shared-tree/treeAlpha.d.ts +84 -2
  798. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  799. package/lib/shared-tree/treeAlpha.js +65 -12
  800. package/lib/shared-tree/treeAlpha.js.map +1 -1
  801. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  802. package/lib/shared-tree/treeCheckout.js +3 -2
  803. package/lib/shared-tree/treeCheckout.js.map +1 -1
  804. package/lib/shared-tree-core/branch.d.ts +2 -2
  805. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  806. package/lib/shared-tree-core/branch.js +2 -2
  807. package/lib/shared-tree-core/branch.js.map +1 -1
  808. package/lib/shared-tree-core/branchCommitEnricher.d.ts +1 -1
  809. package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  810. package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
  811. package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  812. package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  813. package/lib/shared-tree-core/editManager.d.ts +3 -1
  814. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  815. package/lib/shared-tree-core/editManager.js +4 -2
  816. package/lib/shared-tree-core/editManager.js.map +1 -1
  817. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  818. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  819. package/lib/shared-tree-core/editManagerSummarizer.d.ts +1 -1
  820. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  821. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  822. package/lib/shared-tree-core/messageCodecs.d.ts +1 -1
  823. package/lib/shared-tree-core/messageCodecs.js +1 -1
  824. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  825. package/lib/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  826. package/lib/shared-tree-core/sequenceIdUtils.js.map +1 -1
  827. package/lib/shared-tree-core/sharedTreeCore.d.ts +2 -2
  828. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  829. package/lib/shared-tree-core/sharedTreeCore.js +4 -4
  830. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  831. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  832. package/lib/shared-tree-core/transaction.js +1 -1
  833. package/lib/shared-tree-core/transaction.js.map +1 -1
  834. package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  835. package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
  836. package/lib/sharedTreeAttributes.d.ts.map +1 -1
  837. package/lib/sharedTreeAttributes.js.map +1 -1
  838. package/lib/simple-tree/api/conciseTree.d.ts.map +1 -1
  839. package/lib/simple-tree/api/conciseTree.js +1 -1
  840. package/lib/simple-tree/api/conciseTree.js.map +1 -1
  841. package/lib/simple-tree/api/configuration.js +1 -1
  842. package/lib/simple-tree/api/configuration.js.map +1 -1
  843. package/lib/simple-tree/api/create.d.ts +2 -26
  844. package/lib/simple-tree/api/create.d.ts.map +1 -1
  845. package/lib/simple-tree/api/create.js +2 -37
  846. package/lib/simple-tree/api/create.js.map +1 -1
  847. package/lib/simple-tree/api/customTree.d.ts +1 -1
  848. package/lib/simple-tree/api/customTree.d.ts.map +1 -1
  849. package/lib/simple-tree/api/customTree.js +3 -3
  850. package/lib/simple-tree/api/customTree.js.map +1 -1
  851. package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  852. package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
  853. package/lib/simple-tree/api/identifierIndex.js +1 -1
  854. package/lib/simple-tree/api/identifierIndex.js.map +1 -1
  855. package/lib/simple-tree/api/index.d.ts +2 -3
  856. package/lib/simple-tree/api/index.d.ts.map +1 -1
  857. package/lib/simple-tree/api/index.js +2 -5
  858. package/lib/simple-tree/api/index.js.map +1 -1
  859. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  860. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  861. package/lib/simple-tree/api/schemaFactory.d.ts +5 -5
  862. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  863. package/lib/simple-tree/api/schemaFactory.js +5 -5
  864. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  865. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +1 -3
  866. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  867. package/lib/simple-tree/api/schemaFactoryAlpha.js +1 -3
  868. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  869. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +2 -2
  870. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  871. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  872. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  873. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  874. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  875. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  876. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +1 -3
  877. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  878. package/lib/simple-tree/api/storedSchema.d.ts +1 -1
  879. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  880. package/lib/simple-tree/api/storedSchema.js +3 -2
  881. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  882. package/lib/simple-tree/api/tree.d.ts +2 -2
  883. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  884. package/lib/simple-tree/api/tree.js.map +1 -1
  885. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
  886. package/lib/simple-tree/api/treeBeta.js +1 -1
  887. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  888. package/lib/simple-tree/api/treeNodeApi.d.ts +38 -3
  889. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  890. package/lib/simple-tree/api/treeNodeApi.js +39 -28
  891. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  892. package/lib/simple-tree/api/typesUnsafe.d.ts +1 -1
  893. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  894. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  895. package/lib/simple-tree/api/verboseTree.js +1 -1
  896. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  897. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  898. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +1 -3
  899. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  900. package/lib/simple-tree/core/context.d.ts.map +1 -1
  901. package/lib/simple-tree/core/context.js.map +1 -1
  902. package/lib/simple-tree/core/getOrCreateNode.d.ts +1 -1
  903. package/lib/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
  904. package/lib/simple-tree/core/getOrCreateNode.js +2 -2
  905. package/lib/simple-tree/core/getOrCreateNode.js.map +1 -1
  906. package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
  907. package/lib/simple-tree/core/treeNode.js +1 -1
  908. package/lib/simple-tree/core/treeNode.js.map +1 -1
  909. package/lib/simple-tree/core/treeNodeKernel.d.ts +8 -20
  910. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  911. package/lib/simple-tree/core/treeNodeKernel.js +18 -49
  912. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  913. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  914. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  915. package/lib/simple-tree/core/types.d.ts.map +1 -1
  916. package/lib/simple-tree/core/types.js.map +1 -1
  917. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  918. package/lib/simple-tree/core/unhydratedFlexTree.js +3 -3
  919. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  920. package/lib/simple-tree/core/withType.d.ts +1 -1
  921. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  922. package/lib/simple-tree/core/withType.js.map +1 -1
  923. package/lib/simple-tree/createContext.d.ts.map +1 -1
  924. package/lib/simple-tree/createContext.js.map +1 -1
  925. package/{dist/simple-tree/proxies.d.ts → lib/simple-tree/getTreeNodeForField.d.ts} +1 -1
  926. package/lib/simple-tree/getTreeNodeForField.d.ts.map +1 -0
  927. package/lib/simple-tree/{proxies.js → getTreeNodeForField.js} +1 -1
  928. package/lib/simple-tree/getTreeNodeForField.js.map +1 -0
  929. package/lib/simple-tree/index.d.ts +3 -10
  930. package/lib/simple-tree/index.d.ts.map +1 -1
  931. package/lib/simple-tree/index.js +3 -7
  932. package/lib/simple-tree/index.js.map +1 -1
  933. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  934. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  935. package/lib/simple-tree/{arrayNode.d.ts → node-kinds/array/arrayNode.d.ts} +3 -3
  936. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -0
  937. package/lib/simple-tree/{arrayNode.js → node-kinds/array/arrayNode.js} +10 -10
  938. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -0
  939. package/lib/simple-tree/{arrayNodeTypes.d.ts → node-kinds/array/arrayNodeTypes.d.ts} +3 -3
  940. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -0
  941. package/lib/simple-tree/{arrayNodeTypes.js → node-kinds/array/arrayNodeTypes.js} +1 -1
  942. package/{dist/simple-tree → lib/simple-tree/node-kinds/array}/arrayNodeTypes.js.map +1 -1
  943. package/lib/simple-tree/node-kinds/array/index.d.ts +7 -0
  944. package/lib/simple-tree/node-kinds/array/index.d.ts.map +1 -0
  945. package/lib/simple-tree/node-kinds/array/index.js +7 -0
  946. package/lib/simple-tree/node-kinds/array/index.js.map +1 -0
  947. package/lib/simple-tree/node-kinds/index.d.ts +8 -0
  948. package/lib/simple-tree/node-kinds/index.d.ts.map +1 -0
  949. package/lib/simple-tree/node-kinds/index.js +8 -0
  950. package/lib/simple-tree/node-kinds/index.js.map +1 -0
  951. package/lib/simple-tree/node-kinds/map/index.d.ts +7 -0
  952. package/lib/simple-tree/node-kinds/map/index.d.ts.map +1 -0
  953. package/lib/simple-tree/node-kinds/map/index.js +7 -0
  954. package/lib/simple-tree/node-kinds/map/index.js.map +1 -0
  955. package/{dist/simple-tree → lib/simple-tree/node-kinds/map}/mapNode.d.ts +3 -3
  956. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -0
  957. package/lib/simple-tree/{mapNode.js → node-kinds/map/mapNode.js} +8 -8
  958. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -0
  959. package/lib/simple-tree/{mapNodeTypes.d.ts → node-kinds/map/mapNodeTypes.d.ts} +3 -3
  960. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -0
  961. package/lib/simple-tree/{mapNodeTypes.js → node-kinds/map/mapNodeTypes.js} +1 -1
  962. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -0
  963. package/lib/simple-tree/node-kinds/object/index.d.ts +7 -0
  964. package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -0
  965. package/lib/simple-tree/node-kinds/object/index.js +7 -0
  966. package/lib/simple-tree/node-kinds/object/index.js.map +1 -0
  967. package/{dist/simple-tree → lib/simple-tree/node-kinds/object}/objectNode.d.ts +17 -6
  968. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -0
  969. package/lib/simple-tree/{objectNode.js → node-kinds/object/objectNode.js} +35 -13
  970. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -0
  971. package/{dist/simple-tree → lib/simple-tree/node-kinds/object}/objectNodeTypes.d.ts +5 -5
  972. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -0
  973. package/lib/simple-tree/{objectNodeTypes.js → node-kinds/object/objectNodeTypes.js} +1 -1
  974. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -0
  975. package/lib/simple-tree/prepareForInsertion.d.ts +18 -6
  976. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  977. package/lib/simple-tree/prepareForInsertion.js +51 -22
  978. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  979. package/lib/simple-tree/schemaTypes.d.ts +2 -2
  980. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  981. package/lib/simple-tree/schemaTypes.js.map +1 -1
  982. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  983. package/lib/simple-tree/simpleSchema.js.map +1 -1
  984. package/lib/simple-tree/toMapTree.d.ts +2 -22
  985. package/lib/simple-tree/toMapTree.d.ts.map +1 -1
  986. package/lib/simple-tree/toMapTree.js +44 -22
  987. package/lib/simple-tree/toMapTree.js.map +1 -1
  988. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  989. package/lib/simple-tree/toStoredSchema.js +1 -1
  990. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  991. package/lib/simple-tree/treeNodeValid.d.ts +1 -1
  992. package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
  993. package/lib/simple-tree/treeNodeValid.js +2 -2
  994. package/lib/simple-tree/treeNodeValid.js.map +1 -1
  995. package/lib/simple-tree/walkFieldSchema.d.ts.map +1 -1
  996. package/lib/simple-tree/walkFieldSchema.js.map +1 -1
  997. package/lib/tableSchema.d.ts +119 -72
  998. package/lib/tableSchema.d.ts.map +1 -1
  999. package/lib/tableSchema.js +83 -36
  1000. package/lib/tableSchema.js.map +1 -1
  1001. package/lib/treeFactory.d.ts +1 -1
  1002. package/lib/treeFactory.d.ts.map +1 -1
  1003. package/lib/treeFactory.js +3 -3
  1004. package/lib/treeFactory.js.map +1 -1
  1005. package/lib/util/bTreeUtils.d.ts.map +1 -1
  1006. package/lib/util/bTreeUtils.js.map +1 -1
  1007. package/lib/util/breakable.d.ts +23 -4
  1008. package/lib/util/breakable.d.ts.map +1 -1
  1009. package/lib/util/breakable.js +12 -3
  1010. package/lib/util/breakable.js.map +1 -1
  1011. package/package.json +21 -21
  1012. package/src/codec/codec.ts +64 -8
  1013. package/src/core/change-family/editBuilder.ts +1 -0
  1014. package/src/core/forest/forest.ts +1 -1
  1015. package/src/core/index.ts +1 -0
  1016. package/src/core/rebase/types.ts +2 -2
  1017. package/src/core/rebase/utils.ts +10 -10
  1018. package/src/core/schema-stored/formatV1.ts +0 -2
  1019. package/src/core/schema-stored/index.ts +1 -0
  1020. package/src/core/schema-stored/schema.ts +9 -0
  1021. package/src/core/schema-stored/storedSchemaRepository.ts +2 -2
  1022. package/src/core/tree/anchorSet.ts +6 -5
  1023. package/src/core/tree/chunk.ts +2 -1
  1024. package/src/core/tree/delta.ts +1 -0
  1025. package/src/core/tree/deltaUtil.ts +1 -1
  1026. package/src/core/tree/detachedFieldIndex.ts +1 -1
  1027. package/src/core/tree/detachedFieldIndexCodec.ts +2 -2
  1028. package/src/core/tree/pathTree.ts +13 -12
  1029. package/src/core/tree/treeTextFormat.ts +2 -1
  1030. package/src/core/tree/visitDelta.ts +1 -1
  1031. package/src/core/tree/visitorUtils.ts +3 -2
  1032. package/src/feature-libraries/chunked-forest/chunkTree.ts +2 -2
  1033. package/src/feature-libraries/chunked-forest/chunkedForest.ts +4 -4
  1034. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +5 -5
  1035. package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +2 -2
  1036. package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +1 -0
  1037. package/src/feature-libraries/chunked-forest/codec/codecs.ts +15 -1
  1038. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +1 -1
  1039. package/src/feature-libraries/chunked-forest/codec/index.ts +1 -0
  1040. package/src/feature-libraries/chunked-forest/codec/nodeShape.ts +1 -1
  1041. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +1 -1
  1042. package/src/feature-libraries/chunked-forest/emptyChunk.ts +1 -0
  1043. package/src/feature-libraries/chunked-forest/index.ts +1 -0
  1044. package/src/feature-libraries/chunked-forest/sequenceChunk.ts +1 -1
  1045. package/src/feature-libraries/chunked-forest/uniformChunk.ts +2 -3
  1046. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +2 -2
  1047. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +1 -0
  1048. package/src/feature-libraries/default-schema/index.ts +6 -1
  1049. package/src/feature-libraries/default-schema/mappedEditBuilder.ts +1 -0
  1050. package/src/feature-libraries/default-schema/schemaChecker.ts +74 -48
  1051. package/src/feature-libraries/flex-tree/context.ts +29 -8
  1052. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +3 -2
  1053. package/src/feature-libraries/flex-tree/lazyField.ts +1 -1
  1054. package/src/feature-libraries/flex-tree/utilities.ts +1 -1
  1055. package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -1
  1056. package/src/feature-libraries/index.ts +3 -2
  1057. package/src/feature-libraries/indexing/anchorTreeIndex.ts +4 -2
  1058. package/src/feature-libraries/initializeForest.ts +1 -1
  1059. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +1 -0
  1060. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +1 -1
  1061. package/src/feature-libraries/modular-schema/fieldKindWithEditor.ts +1 -1
  1062. package/src/feature-libraries/modular-schema/genericFieldKind.ts +4 -2
  1063. package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +1 -0
  1064. package/src/feature-libraries/modular-schema/genericFieldKindTypes.ts +1 -0
  1065. package/src/feature-libraries/modular-schema/isNeverTree.ts +0 -2
  1066. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +1 -1
  1067. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +2 -0
  1068. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +1 -0
  1069. package/src/feature-libraries/node-identifier/mockNodeIdentifierManager.ts +11 -5
  1070. package/src/feature-libraries/object-forest/objectForest.ts +65 -7
  1071. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +5 -8
  1072. package/src/feature-libraries/schema-index/codec.ts +13 -21
  1073. package/src/feature-libraries/schema-index/formatV1.ts +2 -2
  1074. package/src/feature-libraries/schema-index/index.ts +0 -1
  1075. package/src/feature-libraries/schema-index/schemaSummarizer.ts +1 -1
  1076. package/src/feature-libraries/sequence-field/formatV3.ts +1 -0
  1077. package/src/feature-libraries/sequence-field/markQueue.ts +1 -0
  1078. package/src/feature-libraries/sequence-field/prune.ts +1 -0
  1079. package/src/feature-libraries/sequence-field/rebase.ts +1 -1
  1080. package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +1 -1
  1081. package/src/feature-libraries/sequence-field/replaceRevisions.ts +3 -1
  1082. package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +2 -2
  1083. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +3 -3
  1084. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +3 -3
  1085. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +2 -2
  1086. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +1 -1
  1087. package/src/feature-libraries/sequence-field/utils.ts +7 -5
  1088. package/src/feature-libraries/treeCursorUtils.ts +3 -3
  1089. package/src/feature-libraries/treeTextCursor.ts +1 -1
  1090. package/src/feature-libraries/valueUtilities.ts +1 -1
  1091. package/src/index.ts +1 -4
  1092. package/src/jsonDomainSchema.ts +0 -1
  1093. package/src/packageVersion.ts +1 -1
  1094. package/src/serializableDomainSchema.ts +1 -0
  1095. package/src/shared-tree/checkoutFlexTreeView.ts +1 -0
  1096. package/src/shared-tree/independentView.ts +10 -3
  1097. package/src/shared-tree/index.ts +4 -1
  1098. package/src/shared-tree/schematizeTree.ts +2 -1
  1099. package/src/shared-tree/schematizingTreeView.ts +2 -2
  1100. package/src/shared-tree/sharedTree.ts +26 -19
  1101. package/src/shared-tree/sharedTreeChangeFamily.ts +1 -1
  1102. package/src/shared-tree/tree.ts +1 -1
  1103. package/src/shared-tree/treeAlpha.ts +171 -26
  1104. package/src/shared-tree/treeCheckout.ts +3 -2
  1105. package/src/shared-tree-core/branch.ts +3 -4
  1106. package/src/shared-tree-core/branchCommitEnricher.ts +3 -1
  1107. package/src/shared-tree-core/defaultResubmitMachine.ts +2 -0
  1108. package/src/shared-tree-core/editManager.ts +4 -2
  1109. package/src/shared-tree-core/editManagerCodecs.ts +1 -0
  1110. package/src/shared-tree-core/editManagerSummarizer.ts +1 -1
  1111. package/src/shared-tree-core/messageCodecs.ts +1 -1
  1112. package/src/shared-tree-core/sequenceIdUtils.ts +1 -0
  1113. package/src/shared-tree-core/sharedTreeCore.ts +5 -5
  1114. package/src/shared-tree-core/transaction.ts +4 -2
  1115. package/src/shared-tree-core/transactionEnricher.ts +2 -0
  1116. package/src/sharedTreeAttributes.ts +1 -0
  1117. package/src/simple-tree/api/conciseTree.ts +3 -2
  1118. package/src/simple-tree/api/configuration.ts +1 -1
  1119. package/src/simple-tree/api/create.ts +4 -80
  1120. package/src/simple-tree/api/customTree.ts +4 -4
  1121. package/src/simple-tree/api/getSimpleSchema.ts +1 -0
  1122. package/src/simple-tree/api/identifierIndex.ts +1 -1
  1123. package/src/simple-tree/api/index.ts +8 -11
  1124. package/src/simple-tree/api/schemaCompatibilityTester.ts +2 -0
  1125. package/src/simple-tree/api/schemaFactory.ts +28 -23
  1126. package/src/simple-tree/api/schemaFactoryAlpha.ts +8 -6
  1127. package/src/simple-tree/api/schemaFactoryRecursive.ts +3 -3
  1128. package/src/simple-tree/api/schemaFromSimple.ts +3 -1
  1129. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -3
  1130. package/src/simple-tree/api/storedSchema.ts +5 -4
  1131. package/src/simple-tree/api/tree.ts +3 -4
  1132. package/src/simple-tree/api/treeBeta.ts +3 -2
  1133. package/src/simple-tree/api/treeNodeApi.ts +91 -42
  1134. package/src/simple-tree/api/typesUnsafe.ts +1 -1
  1135. package/src/simple-tree/api/verboseTree.ts +1 -1
  1136. package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +1 -3
  1137. package/src/simple-tree/core/context.ts +1 -0
  1138. package/src/simple-tree/core/getOrCreateNode.ts +4 -3
  1139. package/src/simple-tree/core/treeNode.ts +1 -1
  1140. package/src/simple-tree/core/treeNodeKernel.ts +32 -61
  1141. package/src/simple-tree/core/treeNodeSchema.ts +1 -0
  1142. package/src/simple-tree/core/types.ts +1 -1
  1143. package/src/simple-tree/core/unhydratedFlexTree.ts +4 -3
  1144. package/src/simple-tree/core/withType.ts +1 -1
  1145. package/src/simple-tree/createContext.ts +1 -0
  1146. package/src/simple-tree/{proxies.ts → getTreeNodeForField.ts} +2 -0
  1147. package/src/simple-tree/index.ts +17 -22
  1148. package/src/simple-tree/leafNodeSchema.ts +1 -0
  1149. package/src/simple-tree/{arrayNode.ts → node-kinds/array/arrayNode.ts} +11 -11
  1150. package/src/simple-tree/{arrayNodeTypes.ts → node-kinds/array/arrayNodeTypes.ts} +3 -3
  1151. package/src/simple-tree/node-kinds/array/index.ts +18 -0
  1152. package/src/simple-tree/node-kinds/index.ts +40 -0
  1153. package/src/simple-tree/node-kinds/map/index.ts +16 -0
  1154. package/src/simple-tree/{mapNode.ts → node-kinds/map/mapNode.ts} +10 -10
  1155. package/src/simple-tree/{mapNodeTypes.ts → node-kinds/map/mapNodeTypes.ts} +3 -3
  1156. package/src/simple-tree/node-kinds/object/index.ts +17 -0
  1157. package/src/simple-tree/{objectNode.ts → node-kinds/object/objectNode.ts} +63 -34
  1158. package/src/simple-tree/{objectNodeTypes.ts → node-kinds/object/objectNodeTypes.ts} +5 -5
  1159. package/src/simple-tree/prepareForInsertion.ts +68 -28
  1160. package/src/simple-tree/schemaTypes.ts +4 -3
  1161. package/src/simple-tree/simpleSchema.ts +1 -0
  1162. package/src/simple-tree/toMapTree.ts +13 -56
  1163. package/src/simple-tree/toStoredSchema.ts +3 -2
  1164. package/src/simple-tree/treeNodeValid.ts +3 -3
  1165. package/src/simple-tree/walkFieldSchema.ts +0 -1
  1166. package/src/tableSchema.ts +109 -62
  1167. package/src/treeFactory.ts +3 -5
  1168. package/src/util/bTreeUtils.ts +1 -0
  1169. package/src/util/breakable.ts +19 -4
  1170. package/dist/simple-tree/api/testRecursiveDomain.d.ts +0 -62
  1171. package/dist/simple-tree/api/testRecursiveDomain.d.ts.map +0 -1
  1172. package/dist/simple-tree/api/testRecursiveDomain.js +0 -45
  1173. package/dist/simple-tree/api/testRecursiveDomain.js.map +0 -1
  1174. package/dist/simple-tree/arrayNode.d.ts.map +0 -1
  1175. package/dist/simple-tree/arrayNode.js.map +0 -1
  1176. package/dist/simple-tree/arrayNodeTypes.d.ts.map +0 -1
  1177. package/dist/simple-tree/mapNode.d.ts.map +0 -1
  1178. package/dist/simple-tree/mapNode.js.map +0 -1
  1179. package/dist/simple-tree/mapNodeTypes.d.ts.map +0 -1
  1180. package/dist/simple-tree/mapNodeTypes.js.map +0 -1
  1181. package/dist/simple-tree/objectNode.d.ts.map +0 -1
  1182. package/dist/simple-tree/objectNode.js.map +0 -1
  1183. package/dist/simple-tree/objectNodeTypes.d.ts.map +0 -1
  1184. package/dist/simple-tree/objectNodeTypes.js.map +0 -1
  1185. package/dist/simple-tree/proxies.d.ts.map +0 -1
  1186. package/dist/simple-tree/proxies.js.map +0 -1
  1187. package/lib/simple-tree/api/testRecursiveDomain.d.ts +0 -62
  1188. package/lib/simple-tree/api/testRecursiveDomain.d.ts.map +0 -1
  1189. package/lib/simple-tree/api/testRecursiveDomain.js +0 -41
  1190. package/lib/simple-tree/api/testRecursiveDomain.js.map +0 -1
  1191. package/lib/simple-tree/arrayNode.d.ts.map +0 -1
  1192. package/lib/simple-tree/arrayNode.js.map +0 -1
  1193. package/lib/simple-tree/arrayNodeTypes.d.ts.map +0 -1
  1194. package/lib/simple-tree/arrayNodeTypes.js.map +0 -1
  1195. package/lib/simple-tree/mapNode.d.ts.map +0 -1
  1196. package/lib/simple-tree/mapNode.js.map +0 -1
  1197. package/lib/simple-tree/mapNodeTypes.d.ts.map +0 -1
  1198. package/lib/simple-tree/mapNodeTypes.js.map +0 -1
  1199. package/lib/simple-tree/objectNode.d.ts.map +0 -1
  1200. package/lib/simple-tree/objectNode.js.map +0 -1
  1201. package/lib/simple-tree/objectNodeTypes.d.ts.map +0 -1
  1202. package/lib/simple-tree/objectNodeTypes.js.map +0 -1
  1203. package/lib/simple-tree/proxies.d.ts.map +0 -1
  1204. package/lib/simple-tree/proxies.js.map +0 -1
  1205. package/src/simple-tree/api/testRecursiveDomain.ts +0 -53
@@ -1 +1 @@
1
- {"version":3,"file":"markQueue.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/markQueue.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,KAAK,eAAe,EAA2B,MAAM,sBAAsB,CAAC;AACrF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,qBAAa,SAAS;IAKpB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAL7B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,OAAO,CAAC,KAAK,CAAK;gBAGA,IAAI,EAAE,SAAS,IAAI,EAAE,EACrB,WAAW,EAAE,eAAe;IAKvC,OAAO,IAAI,OAAO;IAIlB,OAAO,IAAI,IAAI;IAMf,UAAU,IAAI,IAAI,GAAG,SAAS;IAarC;;;;OAIG;IACI,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAWjC,IAAI,IAAI,IAAI,GAAG,SAAS;CAO/B"}
1
+ {"version":3,"file":"markQueue.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/markQueue.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,eAAe,EAA2B,MAAM,sBAAsB,CAAC;AACrF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,qBAAa,SAAS;IAKpB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAL7B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,OAAO,CAAC,KAAK,CAAK;gBAGA,IAAI,EAAE,SAAS,IAAI,EAAE,EACrB,WAAW,EAAE,eAAe;IAKvC,OAAO,IAAI,OAAO;IAIlB,OAAO,IAAI,IAAI;IAMf,UAAU,IAAI,IAAI,GAAG,S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E,CAAC,EAAE,EAAE,CAAC;YAChD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,IAAA,cAAG,GAAE,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACI,WAAW,CAAC,MAAc;QAChC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC5B,IAAI,IAAI,CAAC,KAAK,IAAI,MAAM,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC;QACb,CAAC;QAED,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,IAAA,oBAAS,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvB,OAAO,KAAK,CAAC;IACd,CAAC;IAEM,IAAI;QACV,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAC/B,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACxB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AAzDD,8BAyDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob } from \"@fluidframework/core-utils/internal\";\nimport { type MoveEffectTable, splitMarkForMoveEffects } from \"./moveEffectTable.js\";\nimport type { Mark } from \"./types.js\";\nimport { splitMark } from \"./utils.js\";\n\nexport class MarkQueue {\n\tprivate readonly stack: Mark[] = [];\n\tprivate index = 0;\n\n\tpublic constructor(\n\t\tprivate readonly list: readonly Mark[],\n\t\tprivate readonly moveEffects: MoveEffectTable,\n\t) {\n\t\tthis.list = list;\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn this.peek() === undefined;\n\t}\n\n\tpublic dequeue(): Mark {\n\t\tconst output = this.tryDequeue();\n\t\tassert(output !== undefined, 0x4e2 /* Unexpected end of mark queue */);\n\t\treturn output;\n\t}\n\n\tpublic tryDequeue(): Mark | undefined {\n\t\tconst mark = this.stack.length > 0 ? this.stack.pop() : this.list[this.index++];\n\t\tif (mark === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst splitMarks = splitMarkForMoveEffects(mark, this.moveEffects);\n\t\tfor (let i = splitMarks.length - 1; i > 0; i--) {\n\t\t\tthis.stack.push(splitMarks[i] ?? oob());\n\t\t}\n\t\treturn splitMarks[0];\n\t}\n\n\t/**\n\t * Dequeues the first `length` sized portion of the next mark,\n\t * or the entire next mark if `length` is longer than the mark's length.\n\t * @param length - The length to dequeue, measured in the input context.\n\t */\n\tpublic dequeueUpTo(length: number): Mark {\n\t\tconst mark = this.dequeue();\n\t\tif (mark.count <= length) {\n\t\t\treturn mark;\n\t\t}\n\n\t\tconst [mark1, mark2] = splitMark(mark, length);\n\t\tthis.stack.push(mark2);\n\t\treturn mark1;\n\t}\n\n\tpublic peek(): Mark | undefined {\n\t\tconst mark = this.tryDequeue();\n\t\tif (mark !== undefined) {\n\t\t\tthis.stack.push(mark);\n\t\t}\n\t\treturn mark;\n\t}\n}\n"]}
1
+ {"version":3,"file":"markQueue.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/markQueue.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAkE;AAElE,6DAAqF;AAErF,yCAAuC;AAEvC,MAAa,SAAS;IAIrB,YACkB,IAAqB,EACrB,WAA4B;QAD5B,SAAI,GAAJ,IAAI,CAAiB;QACrB,gBAAW,GAAX,WAAW,CAAiB;QAL7B,UAAK,GAAW,EAAE,CAAC;QAC5B,UAAK,GAAG,CAAC,CAAC;QAMjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;IAEM,OAAO;QACb,OAAO,IAAI,CAAC,IAAI,EAAE,KAAK,SAA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;IAEM,IAAI;QACV,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAC/B,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACxB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AAzDD,8BAyDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob } from \"@fluidframework/core-utils/internal\";\n\nimport { type MoveEffectTable, splitMarkForMoveEffects } from \"./moveEffectTable.js\";\nimport type { Mark } from \"./types.js\";\nimport { splitMark } from \"./utils.js\";\n\nexport class MarkQueue {\n\tprivate readonly stack: Mark[] = [];\n\tprivate index = 0;\n\n\tpublic constructor(\n\t\tprivate readonly list: readonly Mark[],\n\t\tprivate readonly moveEffects: MoveEffectTable,\n\t) {\n\t\tthis.list = list;\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn this.peek() === undefined;\n\t}\n\n\tpublic dequeue(): Mark {\n\t\tconst output = this.tryDequeue();\n\t\tassert(output !== undefined, 0x4e2 /* Unexpected end of mark queue */);\n\t\treturn output;\n\t}\n\n\tpublic tryDequeue(): Mark | undefined {\n\t\tconst mark = this.stack.length > 0 ? this.stack.pop() : this.list[this.index++];\n\t\tif (mark === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst splitMarks = splitMarkForMoveEffects(mark, this.moveEffects);\n\t\tfor (let i = splitMarks.length - 1; i > 0; i--) {\n\t\t\tthis.stack.push(splitMarks[i] ?? oob());\n\t\t}\n\t\treturn splitMarks[0];\n\t}\n\n\t/**\n\t * Dequeues the first `length` sized portion of the next mark,\n\t * or the entire next mark if `length` is longer than the mark's length.\n\t * @param length - The length to dequeue, measured in the input context.\n\t */\n\tpublic dequeueUpTo(length: number): Mark {\n\t\tconst mark = this.dequeue();\n\t\tif (mark.count <= length) {\n\t\t\treturn mark;\n\t\t}\n\n\t\tconst [mark1, mark2] = splitMark(mark, length);\n\t\tthis.stack.push(mark2);\n\t\treturn mark1;\n\t}\n\n\tpublic peek(): Mark | undefined {\n\t\tconst mark = this.tryDequeue();\n\t\tif (mark !== undefined) {\n\t\t\tthis.stack.push(mark);\n\t\t}\n\t\treturn mark;\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"prune.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/prune.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,wBAAgB,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,GAAG,SAAS,CASlF"}
1
+ {"version":3,"file":"prune.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/prune.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,wBAAgB,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,GAAG,SAAS,CASlF"}
@@ -1 +1 @@
1
- {"version":3,"file":"prune.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/prune.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,6DAAuD;AAEvD,yCAA4C;AAE5C,SAAgB,KAAK,CAAC,SAAoB,EAAE,SAA2B;IACtE,MAAM,MAAM,GAAG,IAAI,oCAAe,EAAE,CAAC;IACrC,KAAK,IAAI,IAAI,IAAI,SAAS,EAAE,CAAC;QAC5B,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAChC,IAAI,GAAG,IAAA,yBAAc,EAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QACtD,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACpB,CAAC;AATD,sBASC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { NodeChangePruner } from \"../modular-schema/index.js\";\nimport { MarkListFactory } from \"./markListFactory.js\";\nimport type { Changeset } from \"./types.js\";\nimport { withNodeChange } from \"./utils.js\";\n\nexport function prune(changeset: Changeset, pruneNode: NodeChangePruner): Changeset {\n\tconst pruned = new MarkListFactory();\n\tfor (let mark of changeset) {\n\t\tif (mark.changes !== undefined) {\n\t\t\tmark = withNodeChange(mark, pruneNode(mark.changes));\n\t\t}\n\t\tpruned.push(mark);\n\t}\n\treturn pruned.list;\n}\n"]}
1
+ {"version":3,"file":"prune.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/prune.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,6DAAuD;AAEvD,yCAA4C;AAE5C,SAAgB,KAAK,CAAC,SAAoB,EAAE,SAA2B;IACtE,MAAM,MAAM,GAAG,IAAI,oCAAe,EAAE,CAAC;IACrC,KAAK,IAAI,IAAI,IAAI,SAAS,EAAE,CAAC;QAC5B,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAChC,IAAI,GAAG,IAAA,yBAAc,EAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QACtD,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACpB,CAAC;AATD,sBASC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { NodeChangePruner } from \"../modular-schema/index.js\";\n\nimport { MarkListFactory } from \"./markListFactory.js\";\nimport type { Changeset } from \"./types.js\";\nimport { withNodeChange } from \"./utils.js\";\n\nexport function prune(changeset: Changeset, pruneNode: NodeChangePruner): Changeset {\n\tconst pruned = new MarkListFactory();\n\tfor (let mark of changeset) {\n\t\tif (mark.changes !== undefined) {\n\t\t\tmark = withNodeChange(mark, pruneNode(mark.changes));\n\t\t}\n\t\tpruned.push(mark);\n\t}\n\treturn pruned.list;\n}\n"]}
@@ -202,7 +202,7 @@ function rebaseMarkIgnoreChild(currMark, baseMark, moveEffects) {
202
202
  return rebasedMark;
203
203
  }
204
204
  /**
205
- * @returns A pair of marks that represent the effects which should remain in place in the face of concurrent move,
205
+ * Returns a pair of marks that represent the effects which should remain in place in the face of concurrent move,
206
206
  * and the effects that should be sent to the move destination.
207
207
  */
208
208
  function separateEffectsForMove(mark) {
@@ -1 +1 @@
1
- {"version":3,"file":"rebase.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/rebase.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA8E;AAG9E,kDAA4E;AAC5E,yDAOoC;AAEpC,6DAAuD;AACvD,iDAA2C;AAC3C,6DAQ8B;AAC9B,yCAaoB;AACpB,yCAoBoB;AAEpB;;;;;GAKG;AACH,SAAgB,MAAM,CACrB,MAAiB,EACjB,IAAe,EACf,WAA8B,EAC9B,KAAkB,EAClB,OAA0B,EAC1B,gBAAwC;IAExC,OAAO,cAAc,CACpB,MAAM,EACN,IAAI,EACJ,gBAAgB,EAChB,WAAW,EACX,KAAK,EACL,OAA0B,CAC1B,CAAC;AACH,CAAC;AAhBD,wBAgBC;AAED,SAAS,cAAc,CACtB,YAAsB,EACtB,YAAsB,EACtB,QAAgC,EAChC,WAA8B,EAC9B,KAAkB,EAClB,WAA0C;IAE1C,MAAM,OAAO,GAAG,IAAI,oCAAe,EAAE,CAAC;IACtC,MAAM,KAAK,GAAG,IAAI,WAAW,CAA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ClB,CAAC;AACF,CAAC;AAED,SAAS,mBAAmB,CAC3B,WAA4B,EAC5B,QAAiC,EACjC,EAAU,EACV,KAAa;IAEb,OAAO,IAAA,kCAAa,EAAC,WAAW,EAAE,2BAAgB,CAAC,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC,KAAK;QACzF,EAAE,cAAc,CAAC;AACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport type { ChangeAtomId, RevisionMetadataSource, RevisionTag } from \"../../core/index.js\";\nimport { type IdAllocator, type Mutable, brand } from \"../../util/index.js\";\nimport {\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\ttype NodeChangeRebaser,\n\tNodeAttachState,\n\ttype NodeId,\n\ttype RebaseRevisionMetadata,\n} from \"../modular-schema/index.js\";\n\nimport { MarkListFactory } from \"./markListFactory.js\";\nimport { MarkQueue } from \"./markQueue.js\";\nimport {\n\ttype MoveEffect,\n\ttype MoveEffectTable,\n\tgetMoveEffect,\n\tisMoveIn,\n\tisMoveMark,\n\tisMoveOut,\n\tsetMoveEffect,\n} from \"./moveEffectTable.js\";\nimport {\n\ttype CellId,\n\ttype CellMark,\n\ttype Changeset,\n\ttype Detach,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype MarkList,\n\ttype MoveId,\n\ttype MoveIn,\n\ttype MoveOut,\n\ttype NoopMark,\n\tNoopMarkType,\n} from \"./types.js\";\nimport {\n\tCellOrder,\n\tareInputCellsEmpty,\n\tcellSourcesFromMarks,\n\tcloneCellId,\n\tcloneMark,\n\tcompareCellPositionsUsingTombstones,\n\textractMarkEffect,\n\tgetDetachOutputCellId,\n\tgetEndpoint,\n\tgetInputCellId,\n\tisAttachAndDetachEffect,\n\tisDetach,\n\tisNewAttach,\n\tisRename,\n\tisTombstone,\n\tmarkEmptiesCells,\n\tmarkFillsCells,\n\tsplitMarkEffect,\n\twithNodeChange,\n} from \"./utils.js\";\n\n/**\n * Rebases `change` over `base` assuming they both apply to the same initial state.\n * @param change - The changeset to rebase.\n * @param base - The changeset to rebase over.\n * @returns A changeset that performs the changes in `change` but does so assuming `base` has been applied first.\n */\nexport function rebase(\n\tchange: Changeset,\n\tbase: Changeset,\n\trebaseChild: NodeChangeRebaser,\n\tgenId: IdAllocator,\n\tmanager: CrossFieldManager,\n\trevisionMetadata: RebaseRevisionMetadata,\n): Changeset {\n\treturn rebaseMarkList(\n\t\tchange,\n\t\tbase,\n\t\trevisionMetadata,\n\t\trebaseChild,\n\t\tgenId,\n\t\tmanager as MoveEffectTable,\n\t);\n}\n\nfunction rebaseMarkList(\n\tcurrMarkList: MarkList,\n\tbaseMarkList: MarkList,\n\tmetadata: RebaseRevisionMetadata,\n\trebaseChild: NodeChangeRebaser,\n\tgenId: IdAllocator,\n\tmoveEffects: CrossFieldManager<MoveEffect>,\n): MarkList {\n\tconst factory = new MarkListFactory();\n\tconst queue = new RebaseQueue(baseMarkList, currMarkList, metadata, moveEffects);\n\n\twhile (!queue.isEmpty()) {\n\t\tconst { baseMark, newMark: currMark } = queue.pop();\n\t\tconst rebasedMark = rebaseMark(currMark, baseMark, rebaseChild, moveEffects);\n\t\tfactory.push(rebasedMark);\n\t}\n\n\treturn factory.list;\n}\n\n/**\n * Generates a NoOp mark that targets the same cells as the input mark.\n * @param mark - The mark the NoOp should target.\n * @param revision - The revision, if available.\n * @returns A NoOp mark that targets the same cells as the input mark.\n */\nfunction generateNoOpWithCellId(mark: Mark): CellMark<NoopMark> {\n\tconst length = mark.count;\n\tconst cellId = getInputCellId(mark);\n\treturn cellId === undefined ? { count: length } : { count: length, cellId };\n}\n\nclass RebaseQueue {\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 metadata: RevisionMetadataSource,\n\t\tprivate readonly moveEffects: MoveEffectTable,\n\t) {\n\t\tthis.baseMarks = new MarkQueue(baseMarks, moveEffects);\n\t\tthis.newMarks = new MarkQueue(newMarks, moveEffects);\n\t\tthis.baseMarksCellSources = cellSourcesFromMarks(baseMarks, getInputCellId);\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(): RebaseMarks {\n\t\tconst baseMark = this.baseMarks.peek();\n\t\tconst newMark = this.newMarks.peek();\n\t\tassert(\n\t\t\t!(baseMark === undefined && newMark === undefined),\n\t\t\t0x722 /* Cannot pop from empty queue */,\n\t\t);\n\n\t\tif (baseMark === undefined) {\n\t\t\tconst dequeuedNewMark = this.newMarks.dequeue();\n\t\t\treturn {\n\t\t\t\tbaseMark: generateNoOpWithCellId(dequeuedNewMark),\n\t\t\t\tnewMark: dequeuedNewMark,\n\t\t\t};\n\t\t} else if (newMark === undefined) {\n\t\t\treturn this.dequeueBase();\n\t\t} else if (areInputCellsEmpty(baseMark) && areInputCellsEmpty(newMark)) {\n\t\t\tconst baseId = getInputCellId(baseMark);\n\t\t\tconst newId = getInputCellId(newMark);\n\t\t\tassert(\n\t\t\t\tbaseId !== undefined && newId !== undefined,\n\t\t\t\t0x89f /* Both marks should have cell IDs */,\n\t\t\t);\n\t\t\tconst comparison = compareCellPositionsUsingTombstones(\n\t\t\t\tbaseId,\n\t\t\t\tnewId,\n\t\t\t\tthis.baseMarksCellSources,\n\t\t\t\tthis.newMarksCellSources,\n\t\t\t\tthis.metadata,\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\tcase CellOrder.OldThenNew:\n\t\t\t\t\treturn this.dequeueBase();\n\t\t\t\tcase CellOrder.NewThenOld:\n\t\t\t\t\treturn this.dequeueNew();\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(comparison);\n\t\t\t}\n\t\t} else if (areInputCellsEmpty(newMark)) {\n\t\t\treturn this.dequeueNew();\n\t\t} else if (areInputCellsEmpty(baseMark)) {\n\t\t\treturn this.dequeueBase();\n\t\t} else {\n\t\t\treturn this.dequeueBoth();\n\t\t}\n\t}\n\n\tprivate dequeueBase(length?: number): RebaseMarks {\n\t\tconst baseMark =\n\t\t\tlength !== undefined ? this.baseMarks.dequeueUpTo(length) : this.baseMarks.dequeue();\n\n\t\tlet newMark: Mark = generateNoOpWithCellId(baseMark);\n\n\t\tconst movedEffect = getMovedEffectFromBaseMark(this.moveEffects, baseMark);\n\n\t\tif (movedEffect !== undefined) {\n\t\t\tnewMark = addMovedMarkEffect(newMark, movedEffect);\n\t\t}\n\n\t\treturn {\n\t\t\tbaseMark,\n\t\t\tnewMark,\n\t\t};\n\t}\n\n\tprivate dequeueNew(): RebaseMarks {\n\t\tconst newMark = this.newMarks.dequeue();\n\t\treturn { newMark, baseMark: generateNoOpWithCellId(newMark) };\n\t}\n\n\tprivate dequeueBoth(): RebaseMarks {\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\t0x69c /* Cannot dequeue both unless both mark queues are non-empty */,\n\t\t);\n\t\tconst length = Math.min(newMark.count, baseMark.count);\n\t\tconst sizedBaseMark = this.baseMarks.dequeueUpTo(length);\n\t\tconst sizedNewMark = this.newMarks.dequeueUpTo(length);\n\t\tconst movedMark = getMovedEffectFromBaseMark(this.moveEffects, sizedBaseMark);\n\t\treturn {\n\t\t\tbaseMark: sizedBaseMark,\n\t\t\tnewMark:\n\t\t\t\tmovedMark === undefined ? sizedNewMark : addMovedMarkEffect(sizedNewMark, movedMark),\n\t\t};\n\t}\n}\n\n/**\n * Combines `mark` and `effect` into a single mark.\n * This function is only intended to handle cases where `mark` is part of a changeset being rebased\n * and `effect` is an effect from the same changeset whose target has been moved by the base changeset.\n * @returns a mark which has the composite effect of `mark` and `effect`.\n */\nfunction addMovedMarkEffect(mark: Mark, effect: Detach): Mark {\n\tif (isMoveIn(mark) && isMoveOut(effect)) {\n\t\treturn { ...mark, type: \"Insert\" };\n\t} else if (isRename(mark) && isMoveOut(effect)) {\n\t\treturn { ...effect, count: mark.count, idOverride: mark.idOverride };\n\t} else if (isAttachAndDetachEffect(mark) && isMoveIn(mark.attach) && isMoveOut(effect)) {\n\t\treturn { ...mark.detach, count: mark.count };\n\t} else if (isTombstone(mark)) {\n\t\treturn { ...mark, ...effect };\n\t}\n\tassert(false, 0x818 /* Unexpected combination of mark effects at source and destination */);\n}\n\n/**\n * Represents the marks rebasing should process next.\n * If `baseMark` and `newMark` are both defined, then they are `SizedMark`s covering the same range of nodes.\n */\ninterface RebaseMarks {\n\tbaseMark: Mark;\n\tnewMark: Mark;\n}\n\nfunction rebaseMark(\n\tcurrMark: Mark,\n\tbaseMark: Mark,\n\trebaseChild: NodeChangeRebaser,\n\tmoveEffects: MoveEffectTable,\n): Mark {\n\tconst rebasedMark = rebaseNodeChange(cloneMark(currMark), baseMark, rebaseChild);\n\tconst movedNodeChanges = getMovedChangesFromBaseMark(moveEffects, baseMark);\n\tif (movedNodeChanges !== undefined) {\n\t\tassert(\n\t\t\trebasedMark.changes === undefined,\n\t\t\t0x8dc /* Unexpected collision of new node changes */,\n\t\t);\n\t\trebasedMark.changes = movedNodeChanges;\n\t\tmoveEffects.onMoveIn(movedNodeChanges);\n\t}\n\n\treturn rebaseMarkIgnoreChild(rebasedMark, baseMark, moveEffects);\n}\n\nfunction rebaseMarkIgnoreChild(\n\tcurrMark: Mark,\n\tbaseMark: Mark,\n\tmoveEffects: MoveEffectTable,\n): Mark {\n\tlet rebasedMark: Mark;\n\tif (isDetach(baseMark)) {\n\t\tif (baseMark.cellId !== undefined) {\n\t\t\t// Detaches on empty cells have an implicit revive effect.\n\t\t\tdelete currMark.cellId;\n\t\t}\n\t\tassert(\n\t\t\t!isNewAttach(currMark),\n\t\t\t0x69d /* A new attach should not be rebased over its cell being emptied */,\n\t\t);\n\t\tconst baseCellId = getDetachOutputCellId(baseMark);\n\n\t\tif (isMoveOut(baseMark)) {\n\t\t\tassert(isMoveMark(baseMark), 0x6f0 /* Only move marks have move IDs */);\n\t\t\tassert(\n\t\t\t\t!isNewAttach(currMark),\n\t\t\t\t0x819 /* New attaches should not be rebased over moves */,\n\t\t\t);\n\t\t\tconst { remains, follows } = separateEffectsForMove(extractMarkEffect(currMark));\n\t\t\tif (follows !== undefined) {\n\t\t\t\tsendEffectToDest(follows, moveEffects, getEndpoint(baseMark), baseMark.count);\n\t\t\t}\n\n\t\t\tif (currMark.changes !== undefined) {\n\t\t\t\tmoveRebasedChanges(currMark.changes, moveEffects, getEndpoint(baseMark));\n\t\t\t}\n\t\t\trebasedMark = { ...(remains ?? {}), count: baseMark.count };\n\t\t} else {\n\t\t\trebasedMark = currMark;\n\t\t}\n\t\trebasedMark = makeDetachedMark(rebasedMark, cloneCellId(baseCellId));\n\t} else if (markFillsCells(baseMark)) {\n\t\trebasedMark = isAttachAndDetachEffect(currMark)\n\t\t\t? withNodeChange({ ...currMark.detach, count: currMark.count }, currMark.changes)\n\t\t\t: withCellId(currMark, undefined);\n\t} else if (isAttachAndDetachEffect(baseMark)) {\n\t\tassert(\n\t\t\tbaseMark.cellId !== undefined,\n\t\t\t0x81a /* AttachAndDetach mark should target an empty cell */,\n\t\t);\n\t\tconst halfRebasedMark = rebaseMarkIgnoreChild(\n\t\t\tcurrMark,\n\t\t\t{ ...baseMark.attach, cellId: cloneCellId(baseMark.cellId), count: baseMark.count },\n\t\t\tmoveEffects,\n\t\t);\n\t\trebasedMark = rebaseMarkIgnoreChild(\n\t\t\thalfRebasedMark,\n\t\t\t{ ...baseMark.detach, count: baseMark.count },\n\t\t\tmoveEffects,\n\t\t);\n\t} else if (isRename(baseMark)) {\n\t\treturn withCellId(currMark, getDetachOutputCellId(baseMark));\n\t} else {\n\t\trebasedMark = currMark;\n\t}\n\treturn rebasedMark;\n}\n\n/**\n * @returns A pair of marks that represent the effects which should remain in place in the face of concurrent move,\n * and the effects that should be sent to the move destination.\n */\nfunction separateEffectsForMove(mark: MarkEffect): {\n\tremains?: MarkEffect;\n\tfollows?: Detach;\n} {\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase \"Remove\":\n\t\tcase \"MoveOut\": {\n\t\t\t// There are two scenarios that lead to a Detach mark having an idOverride:\n\t\t\t// 1. The detach is a rollback (the idOverride the original id that the cell had in the input context of the attach being rolled back).\n\t\t\t// 2. The detach has been composed with a Rename (the idOverride is the cell id in the output context of the rename).\n\t\t\t// Since rollbacks are never rebased, we can safely assume that the idOverride is due to a Rename (scenario #2).\n\t\t\t// While the detach must follow the node that it targets, the rename must remain in place because it targets the cell.\n\t\t\tif (mark.idOverride !== undefined) {\n\t\t\t\tconst remains: MarkEffect = { type: \"Rename\", idOverride: mark.idOverride };\n\t\t\t\tconst follows: Mutable<MarkEffect> = { ...mark };\n\t\t\t\tdelete follows.idOverride;\n\t\t\t\treturn { remains, follows };\n\t\t\t}\n\t\t\treturn { follows: mark };\n\t\t}\n\t\tcase \"AttachAndDetach\":\n\t\t\treturn { follows: mark.detach, remains: mark.attach };\n\t\tcase \"MoveIn\":\n\t\tcase \"Rename\":\n\t\t\treturn { remains: mark };\n\t\tcase NoopMarkType:\n\t\t\treturn {};\n\t\tcase \"Insert\": {\n\t\t\tconst follows: MoveOut = {\n\t\t\t\ttype: \"MoveOut\",\n\t\t\t\tid: mark.id,\n\t\t\t};\n\t\t\tconst remains: MoveIn = {\n\t\t\t\ttype: \"MoveIn\",\n\t\t\t\tid: mark.id,\n\t\t\t};\n\t\t\tif (mark.revision !== undefined) {\n\t\t\t\tfollows.revision = mark.revision;\n\t\t\t\tremains.revision = mark.revision;\n\t\t\t}\n\t\t\treturn { remains, follows };\n\t\t}\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\n// TODO: Reduce the duplication between this and other MoveEffect helpers\nfunction sendEffectToDest(\n\tmarkEffect: Detach,\n\tmoveEffects: MoveEffectTable,\n\t{ revision, localId: id }: ChangeAtomId,\n\tcount: number,\n): void {\n\tconst effect = getMoveEffect(\n\t\tmoveEffects,\n\t\tCrossFieldTarget.Destination,\n\t\trevision,\n\t\tid,\n\t\tcount,\n\t\tfalse,\n\t);\n\tif (effect.length < count) {\n\t\tconst [markEffect1, markEffect2] = splitMarkEffect(markEffect, effect.length);\n\t\tconst newEffect =\n\t\t\teffect.value !== undefined\n\t\t\t\t? { ...effect.value, movedMark: markEffect1 }\n\t\t\t\t: { movedMark: markEffect1 };\n\t\tsetMoveEffect(\n\t\t\tmoveEffects,\n\t\t\tCrossFieldTarget.Destination,\n\t\t\trevision,\n\t\t\tid,\n\t\t\teffect.length,\n\t\t\tnewEffect,\n\t\t);\n\t\tsendEffectToDest(\n\t\t\tmarkEffect2,\n\t\t\tmoveEffects,\n\t\t\t{ revision, localId: brand(id + effect.length) },\n\t\t\tcount - effect.length,\n\t\t);\n\t} else {\n\t\tconst newEffect: MoveEffect =\n\t\t\teffect.value !== undefined\n\t\t\t\t? { ...effect.value, movedEffect: markEffect }\n\t\t\t\t: { movedEffect: markEffect };\n\t\tsetMoveEffect(moveEffects, CrossFieldTarget.Destination, revision, id, count, newEffect);\n\t}\n}\n\nfunction moveRebasedChanges(\n\tnodeChange: NodeId,\n\tmoveEffects: MoveEffectTable,\n\t{ revision, localId: id }: ChangeAtomId,\n): void {\n\tconst effect = getMoveEffect(\n\t\tmoveEffects,\n\t\tCrossFieldTarget.Destination,\n\t\trevision,\n\t\tid,\n\t\t1,\n\t\tfalse,\n\t).value;\n\n\tconst newEffect =\n\t\teffect !== undefined\n\t\t\t? { ...effect, rebasedChanges: nodeChange }\n\t\t\t: { rebasedChanges: nodeChange };\n\n\tsetMoveEffect(moveEffects, CrossFieldTarget.Destination, revision, id, 1, newEffect);\n}\n\nfunction rebaseNodeChange(\n\tcurrMark: Mark,\n\tbaseMark: Mark,\n\tnodeRebaser: NodeChangeRebaser,\n): Mark {\n\tconst baseChange = baseMark.changes;\n\tconst currChange = currMark.changes;\n\n\tif (baseChange === undefined && currChange === undefined) {\n\t\treturn currMark;\n\t}\n\n\tconst nodeState = nodeStateAfterMark(baseMark);\n\treturn withNodeChange(currMark, nodeRebaser(currChange, baseChange, nodeState));\n}\n\nfunction nodeStateAfterMark(mark: Mark): NodeAttachState {\n\tif (markEmptiesCells(mark)) {\n\t\treturn NodeAttachState.Detached;\n\t} else if (markFillsCells(mark)) {\n\t\treturn NodeAttachState.Attached;\n\t} else {\n\t\treturn mark.cellId === undefined ? NodeAttachState.Attached : NodeAttachState.Detached;\n\t}\n}\n\nfunction makeDetachedMark(mark: Mark, cellId: ChangeAtomId): Mark {\n\tassert(mark.cellId === undefined, 0x69f /* Expected mark to be attached */);\n\treturn { ...mark, cellId };\n}\n\nfunction withCellId<TMark extends Mark>(mark: TMark, cellId: CellId | undefined): TMark {\n\tconst newMark = { ...mark, cellId };\n\tif (cellId === undefined) {\n\t\tdelete newMark.cellId;\n\t}\n\treturn newMark;\n}\n\nfunction getMovedEffectFromBaseMark(\n\tmoveEffects: MoveEffectTable,\n\tbaseMark: Mark,\n): Detach | undefined {\n\tif (isMoveIn(baseMark)) {\n\t\treturn getMovedEffect(moveEffects, baseMark.revision, baseMark.id, baseMark.count);\n\t} else if (isAttachAndDetachEffect(baseMark) && isMoveIn(baseMark.attach)) {\n\t\treturn getMovedEffect(\n\t\t\tmoveEffects,\n\t\t\tbaseMark.attach.revision,\n\t\t\tbaseMark.attach.id,\n\t\t\tbaseMark.count,\n\t\t);\n\t} else {\n\t\treturn undefined;\n\t}\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 getMovedEffect(\n\tmoveEffects: MoveEffectTable,\n\trevision: RevisionTag | undefined,\n\tid: MoveId,\n\tcount: number,\n): Detach | undefined {\n\tconst effect = getMoveEffect(moveEffects, CrossFieldTarget.Destination, revision, id, count);\n\tassert(effect.length === count, 0x6f3 /* Expected effect to cover entire mark */);\n\tconst movedEffect = effect.value?.movedEffect;\n\tif (movedEffect === undefined) {\n\t\treturn undefined;\n\t}\n\tif (isMoveOut(movedEffect)) {\n\t\tmoveEffects.moveKey(CrossFieldTarget.Source, movedEffect.revision, movedEffect.id, count);\n\t}\n\treturn movedEffect;\n}\n\nfunction getMovedChangesFromBaseMark(\n\tmoveEffects: MoveEffectTable,\n\tbaseMark: Mark,\n): NodeId | undefined {\n\tif (isMoveIn(baseMark)) {\n\t\treturn getMovedNodeChanges(moveEffects, baseMark.revision, baseMark.id, baseMark.count);\n\t} else if (isAttachAndDetachEffect(baseMark) && isMoveIn(baseMark.attach)) {\n\t\treturn getMovedNodeChanges(\n\t\t\tmoveEffects,\n\t\t\tbaseMark.attach.revision,\n\t\t\tbaseMark.attach.id,\n\t\t\tbaseMark.count,\n\t\t);\n\t} else {\n\t\treturn undefined;\n\t}\n}\n\nfunction getMovedNodeChanges(\n\tmoveEffects: MoveEffectTable,\n\trevision: RevisionTag | undefined,\n\tid: MoveId,\n\tcount: number,\n): NodeId | undefined {\n\treturn getMoveEffect(moveEffects, CrossFieldTarget.Destination, revision, id, count).value\n\t\t?.rebasedChanges;\n}\n"]}
1
+ {"version":3,"file":"rebase.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/rebase.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA8E;AAG9E,kDAA4E;AAC5E,yDAOoC;AAEpC,6DAAuD;AACvD,iDAA2C;AAC3C,6DAQ8B;AAC9B,yCAaoB;AACpB,yCAoBoB;AAEpB;;;;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mBAAmB,CAAC,WAAW,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzF,CAAC;SAAM,IAAI,IAAA,kCAAuB,EAAC,QAAQ,CAAC,IAAI,IAAA,6BAAQ,EAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3E,OAAO,mBAAmB,CACzB,WAAW,EACX,QAAQ,CAAC,MAAM,CAAC,QAAQ,EACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,EAClB,QAAQ,CAAC,KAAK,CACd,CAAC;IACH,CAAC;SAAM,CAAC;QACP,OAAO,SAAS,CAAC;IAClB,CAAC;AACF,CAAC;AAED,SAAS,mBAAmB,CAC3B,WAA4B,EAC5B,QAAiC,EACjC,EAAU,EACV,KAAa;IAEb,OAAO,IAAA,kCAAa,EAAC,WAAW,EAAE,2BAAgB,CAAC,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC,KAAK;QACzF,EAAE,cAAc,CAAC;AACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport type { ChangeAtomId, RevisionMetadataSource, RevisionTag } from \"../../core/index.js\";\nimport { type IdAllocator, type Mutable, brand } from \"../../util/index.js\";\nimport {\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\ttype NodeChangeRebaser,\n\tNodeAttachState,\n\ttype NodeId,\n\ttype RebaseRevisionMetadata,\n} from \"../modular-schema/index.js\";\n\nimport { MarkListFactory } from \"./markListFactory.js\";\nimport { MarkQueue } from \"./markQueue.js\";\nimport {\n\ttype MoveEffect,\n\ttype MoveEffectTable,\n\tgetMoveEffect,\n\tisMoveIn,\n\tisMoveMark,\n\tisMoveOut,\n\tsetMoveEffect,\n} from \"./moveEffectTable.js\";\nimport {\n\ttype CellId,\n\ttype CellMark,\n\ttype Changeset,\n\ttype Detach,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype MarkList,\n\ttype MoveId,\n\ttype MoveIn,\n\ttype MoveOut,\n\ttype NoopMark,\n\tNoopMarkType,\n} from \"./types.js\";\nimport {\n\tCellOrder,\n\tareInputCellsEmpty,\n\tcellSourcesFromMarks,\n\tcloneCellId,\n\tcloneMark,\n\tcompareCellPositionsUsingTombstones,\n\textractMarkEffect,\n\tgetDetachOutputCellId,\n\tgetEndpoint,\n\tgetInputCellId,\n\tisAttachAndDetachEffect,\n\tisDetach,\n\tisNewAttach,\n\tisRename,\n\tisTombstone,\n\tmarkEmptiesCells,\n\tmarkFillsCells,\n\tsplitMarkEffect,\n\twithNodeChange,\n} from \"./utils.js\";\n\n/**\n * Rebases `change` over `base` assuming they both apply to the same initial state.\n * @param change - The changeset to rebase.\n * @param base - The changeset to rebase over.\n * @returns A changeset that performs the changes in `change` but does so assuming `base` has been applied first.\n */\nexport function rebase(\n\tchange: Changeset,\n\tbase: Changeset,\n\trebaseChild: NodeChangeRebaser,\n\tgenId: IdAllocator,\n\tmanager: CrossFieldManager,\n\trevisionMetadata: RebaseRevisionMetadata,\n): Changeset {\n\treturn rebaseMarkList(\n\t\tchange,\n\t\tbase,\n\t\trevisionMetadata,\n\t\trebaseChild,\n\t\tgenId,\n\t\tmanager as MoveEffectTable,\n\t);\n}\n\nfunction rebaseMarkList(\n\tcurrMarkList: MarkList,\n\tbaseMarkList: MarkList,\n\tmetadata: RebaseRevisionMetadata,\n\trebaseChild: NodeChangeRebaser,\n\tgenId: IdAllocator,\n\tmoveEffects: CrossFieldManager<MoveEffect>,\n): MarkList {\n\tconst factory = new MarkListFactory();\n\tconst queue = new RebaseQueue(baseMarkList, currMarkList, metadata, moveEffects);\n\n\twhile (!queue.isEmpty()) {\n\t\tconst { baseMark, newMark: currMark } = queue.pop();\n\t\tconst rebasedMark = rebaseMark(currMark, baseMark, rebaseChild, moveEffects);\n\t\tfactory.push(rebasedMark);\n\t}\n\n\treturn factory.list;\n}\n\n/**\n * Generates a NoOp mark that targets the same cells as the input mark.\n * @param mark - The mark the NoOp should target.\n * @param revision - The revision, if available.\n * @returns A NoOp mark that targets the same cells as the input mark.\n */\nfunction generateNoOpWithCellId(mark: Mark): CellMark<NoopMark> {\n\tconst length = mark.count;\n\tconst cellId = getInputCellId(mark);\n\treturn cellId === undefined ? { count: length } : { count: length, cellId };\n}\n\nclass RebaseQueue {\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 metadata: RevisionMetadataSource,\n\t\tprivate readonly moveEffects: MoveEffectTable,\n\t) {\n\t\tthis.baseMarks = new MarkQueue(baseMarks, moveEffects);\n\t\tthis.newMarks = new MarkQueue(newMarks, moveEffects);\n\t\tthis.baseMarksCellSources = cellSourcesFromMarks(baseMarks, getInputCellId);\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(): RebaseMarks {\n\t\tconst baseMark = this.baseMarks.peek();\n\t\tconst newMark = this.newMarks.peek();\n\t\tassert(\n\t\t\t!(baseMark === undefined && newMark === undefined),\n\t\t\t0x722 /* Cannot pop from empty queue */,\n\t\t);\n\n\t\tif (baseMark === undefined) {\n\t\t\tconst dequeuedNewMark = this.newMarks.dequeue();\n\t\t\treturn {\n\t\t\t\tbaseMark: generateNoOpWithCellId(dequeuedNewMark),\n\t\t\t\tnewMark: dequeuedNewMark,\n\t\t\t};\n\t\t} else if (newMark === undefined) {\n\t\t\treturn this.dequeueBase();\n\t\t} else if (areInputCellsEmpty(baseMark) && areInputCellsEmpty(newMark)) {\n\t\t\tconst baseId = getInputCellId(baseMark);\n\t\t\tconst newId = getInputCellId(newMark);\n\t\t\tassert(\n\t\t\t\tbaseId !== undefined && newId !== undefined,\n\t\t\t\t0x89f /* Both marks should have cell IDs */,\n\t\t\t);\n\t\t\tconst comparison = compareCellPositionsUsingTombstones(\n\t\t\t\tbaseId,\n\t\t\t\tnewId,\n\t\t\t\tthis.baseMarksCellSources,\n\t\t\t\tthis.newMarksCellSources,\n\t\t\t\tthis.metadata,\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\tcase CellOrder.OldThenNew:\n\t\t\t\t\treturn this.dequeueBase();\n\t\t\t\tcase CellOrder.NewThenOld:\n\t\t\t\t\treturn this.dequeueNew();\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(comparison);\n\t\t\t}\n\t\t} else if (areInputCellsEmpty(newMark)) {\n\t\t\treturn this.dequeueNew();\n\t\t} else if (areInputCellsEmpty(baseMark)) {\n\t\t\treturn this.dequeueBase();\n\t\t} else {\n\t\t\treturn this.dequeueBoth();\n\t\t}\n\t}\n\n\tprivate dequeueBase(length?: number): RebaseMarks {\n\t\tconst baseMark =\n\t\t\tlength !== undefined ? this.baseMarks.dequeueUpTo(length) : this.baseMarks.dequeue();\n\n\t\tlet newMark: Mark = generateNoOpWithCellId(baseMark);\n\n\t\tconst movedEffect = getMovedEffectFromBaseMark(this.moveEffects, baseMark);\n\n\t\tif (movedEffect !== undefined) {\n\t\t\tnewMark = addMovedMarkEffect(newMark, movedEffect);\n\t\t}\n\n\t\treturn {\n\t\t\tbaseMark,\n\t\t\tnewMark,\n\t\t};\n\t}\n\n\tprivate dequeueNew(): RebaseMarks {\n\t\tconst newMark = this.newMarks.dequeue();\n\t\treturn { newMark, baseMark: generateNoOpWithCellId(newMark) };\n\t}\n\n\tprivate dequeueBoth(): RebaseMarks {\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\t0x69c /* Cannot dequeue both unless both mark queues are non-empty */,\n\t\t);\n\t\tconst length = Math.min(newMark.count, baseMark.count);\n\t\tconst sizedBaseMark = this.baseMarks.dequeueUpTo(length);\n\t\tconst sizedNewMark = this.newMarks.dequeueUpTo(length);\n\t\tconst movedMark = getMovedEffectFromBaseMark(this.moveEffects, sizedBaseMark);\n\t\treturn {\n\t\t\tbaseMark: sizedBaseMark,\n\t\t\tnewMark:\n\t\t\t\tmovedMark === undefined ? sizedNewMark : addMovedMarkEffect(sizedNewMark, movedMark),\n\t\t};\n\t}\n}\n\n/**\n * Combines `mark` and `effect` into a single mark.\n * This function is only intended to handle cases where `mark` is part of a changeset being rebased\n * and `effect` is an effect from the same changeset whose target has been moved by the base changeset.\n * @returns a mark which has the composite effect of `mark` and `effect`.\n */\nfunction addMovedMarkEffect(mark: Mark, effect: Detach): Mark {\n\tif (isMoveIn(mark) && isMoveOut(effect)) {\n\t\treturn { ...mark, type: \"Insert\" };\n\t} else if (isRename(mark) && isMoveOut(effect)) {\n\t\treturn { ...effect, count: mark.count, idOverride: mark.idOverride };\n\t} else if (isAttachAndDetachEffect(mark) && isMoveIn(mark.attach) && isMoveOut(effect)) {\n\t\treturn { ...mark.detach, count: mark.count };\n\t} else if (isTombstone(mark)) {\n\t\treturn { ...mark, ...effect };\n\t}\n\tassert(false, 0x818 /* Unexpected combination of mark effects at source and destination */);\n}\n\n/**\n * Represents the marks rebasing should process next.\n * If `baseMark` and `newMark` are both defined, then they are `SizedMark`s covering the same range of nodes.\n */\ninterface RebaseMarks {\n\tbaseMark: Mark;\n\tnewMark: Mark;\n}\n\nfunction rebaseMark(\n\tcurrMark: Mark,\n\tbaseMark: Mark,\n\trebaseChild: NodeChangeRebaser,\n\tmoveEffects: MoveEffectTable,\n): Mark {\n\tconst rebasedMark = rebaseNodeChange(cloneMark(currMark), baseMark, rebaseChild);\n\tconst movedNodeChanges = getMovedChangesFromBaseMark(moveEffects, baseMark);\n\tif (movedNodeChanges !== undefined) {\n\t\tassert(\n\t\t\trebasedMark.changes === undefined,\n\t\t\t0x8dc /* Unexpected collision of new node changes */,\n\t\t);\n\t\trebasedMark.changes = movedNodeChanges;\n\t\tmoveEffects.onMoveIn(movedNodeChanges);\n\t}\n\n\treturn rebaseMarkIgnoreChild(rebasedMark, baseMark, moveEffects);\n}\n\nfunction rebaseMarkIgnoreChild(\n\tcurrMark: Mark,\n\tbaseMark: Mark,\n\tmoveEffects: MoveEffectTable,\n): Mark {\n\tlet rebasedMark: Mark;\n\tif (isDetach(baseMark)) {\n\t\tif (baseMark.cellId !== undefined) {\n\t\t\t// Detaches on empty cells have an implicit revive effect.\n\t\t\tdelete currMark.cellId;\n\t\t}\n\t\tassert(\n\t\t\t!isNewAttach(currMark),\n\t\t\t0x69d /* A new attach should not be rebased over its cell being emptied */,\n\t\t);\n\t\tconst baseCellId = getDetachOutputCellId(baseMark);\n\n\t\tif (isMoveOut(baseMark)) {\n\t\t\tassert(isMoveMark(baseMark), 0x6f0 /* Only move marks have move IDs */);\n\t\t\tassert(\n\t\t\t\t!isNewAttach(currMark),\n\t\t\t\t0x819 /* New attaches should not be rebased over moves */,\n\t\t\t);\n\t\t\tconst { remains, follows } = separateEffectsForMove(extractMarkEffect(currMark));\n\t\t\tif (follows !== undefined) {\n\t\t\t\tsendEffectToDest(follows, moveEffects, getEndpoint(baseMark), baseMark.count);\n\t\t\t}\n\n\t\t\tif (currMark.changes !== undefined) {\n\t\t\t\tmoveRebasedChanges(currMark.changes, moveEffects, getEndpoint(baseMark));\n\t\t\t}\n\t\t\trebasedMark = { ...(remains ?? {}), count: baseMark.count };\n\t\t} else {\n\t\t\trebasedMark = currMark;\n\t\t}\n\t\trebasedMark = makeDetachedMark(rebasedMark, cloneCellId(baseCellId));\n\t} else if (markFillsCells(baseMark)) {\n\t\trebasedMark = isAttachAndDetachEffect(currMark)\n\t\t\t? withNodeChange({ ...currMark.detach, count: currMark.count }, currMark.changes)\n\t\t\t: withCellId(currMark, undefined);\n\t} else if (isAttachAndDetachEffect(baseMark)) {\n\t\tassert(\n\t\t\tbaseMark.cellId !== undefined,\n\t\t\t0x81a /* AttachAndDetach mark should target an empty cell */,\n\t\t);\n\t\tconst halfRebasedMark = rebaseMarkIgnoreChild(\n\t\t\tcurrMark,\n\t\t\t{ ...baseMark.attach, cellId: cloneCellId(baseMark.cellId), count: baseMark.count },\n\t\t\tmoveEffects,\n\t\t);\n\t\trebasedMark = rebaseMarkIgnoreChild(\n\t\t\thalfRebasedMark,\n\t\t\t{ ...baseMark.detach, count: baseMark.count },\n\t\t\tmoveEffects,\n\t\t);\n\t} else if (isRename(baseMark)) {\n\t\treturn withCellId(currMark, getDetachOutputCellId(baseMark));\n\t} else {\n\t\trebasedMark = currMark;\n\t}\n\treturn rebasedMark;\n}\n\n/**\n * Returns a pair of marks that represent the effects which should remain in place in the face of concurrent move,\n * and the effects that should be sent to the move destination.\n */\nfunction separateEffectsForMove(mark: MarkEffect): {\n\tremains?: MarkEffect;\n\tfollows?: Detach;\n} {\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase \"Remove\":\n\t\tcase \"MoveOut\": {\n\t\t\t// There are two scenarios that lead to a Detach mark having an idOverride:\n\t\t\t// 1. The detach is a rollback (the idOverride the original id that the cell had in the input context of the attach being rolled back).\n\t\t\t// 2. The detach has been composed with a Rename (the idOverride is the cell id in the output context of the rename).\n\t\t\t// Since rollbacks are never rebased, we can safely assume that the idOverride is due to a Rename (scenario #2).\n\t\t\t// While the detach must follow the node that it targets, the rename must remain in place because it targets the cell.\n\t\t\tif (mark.idOverride !== undefined) {\n\t\t\t\tconst remains: MarkEffect = { type: \"Rename\", idOverride: mark.idOverride };\n\t\t\t\tconst follows: Mutable<MarkEffect> = { ...mark };\n\t\t\t\tdelete follows.idOverride;\n\t\t\t\treturn { remains, follows };\n\t\t\t}\n\t\t\treturn { follows: mark };\n\t\t}\n\t\tcase \"AttachAndDetach\":\n\t\t\treturn { follows: mark.detach, remains: mark.attach };\n\t\tcase \"MoveIn\":\n\t\tcase \"Rename\":\n\t\t\treturn { remains: mark };\n\t\tcase NoopMarkType:\n\t\t\treturn {};\n\t\tcase \"Insert\": {\n\t\t\tconst follows: MoveOut = {\n\t\t\t\ttype: \"MoveOut\",\n\t\t\t\tid: mark.id,\n\t\t\t};\n\t\t\tconst remains: MoveIn = {\n\t\t\t\ttype: \"MoveIn\",\n\t\t\t\tid: mark.id,\n\t\t\t};\n\t\t\tif (mark.revision !== undefined) {\n\t\t\t\tfollows.revision = mark.revision;\n\t\t\t\tremains.revision = mark.revision;\n\t\t\t}\n\t\t\treturn { remains, follows };\n\t\t}\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\n// TODO: Reduce the duplication between this and other MoveEffect helpers\nfunction sendEffectToDest(\n\tmarkEffect: Detach,\n\tmoveEffects: MoveEffectTable,\n\t{ revision, localId: id }: ChangeAtomId,\n\tcount: number,\n): void {\n\tconst effect = getMoveEffect(\n\t\tmoveEffects,\n\t\tCrossFieldTarget.Destination,\n\t\trevision,\n\t\tid,\n\t\tcount,\n\t\tfalse,\n\t);\n\tif (effect.length < count) {\n\t\tconst [markEffect1, markEffect2] = splitMarkEffect(markEffect, effect.length);\n\t\tconst newEffect =\n\t\t\teffect.value !== undefined\n\t\t\t\t? { ...effect.value, movedMark: markEffect1 }\n\t\t\t\t: { movedMark: markEffect1 };\n\t\tsetMoveEffect(\n\t\t\tmoveEffects,\n\t\t\tCrossFieldTarget.Destination,\n\t\t\trevision,\n\t\t\tid,\n\t\t\teffect.length,\n\t\t\tnewEffect,\n\t\t);\n\t\tsendEffectToDest(\n\t\t\tmarkEffect2,\n\t\t\tmoveEffects,\n\t\t\t{ revision, localId: brand(id + effect.length) },\n\t\t\tcount - effect.length,\n\t\t);\n\t} else {\n\t\tconst newEffect: MoveEffect =\n\t\t\teffect.value !== undefined\n\t\t\t\t? { ...effect.value, movedEffect: markEffect }\n\t\t\t\t: { movedEffect: markEffect };\n\t\tsetMoveEffect(moveEffects, CrossFieldTarget.Destination, revision, id, count, newEffect);\n\t}\n}\n\nfunction moveRebasedChanges(\n\tnodeChange: NodeId,\n\tmoveEffects: MoveEffectTable,\n\t{ revision, localId: id }: ChangeAtomId,\n): void {\n\tconst effect = getMoveEffect(\n\t\tmoveEffects,\n\t\tCrossFieldTarget.Destination,\n\t\trevision,\n\t\tid,\n\t\t1,\n\t\tfalse,\n\t).value;\n\n\tconst newEffect =\n\t\teffect !== undefined\n\t\t\t? { ...effect, rebasedChanges: nodeChange }\n\t\t\t: { rebasedChanges: nodeChange };\n\n\tsetMoveEffect(moveEffects, CrossFieldTarget.Destination, revision, id, 1, newEffect);\n}\n\nfunction rebaseNodeChange(\n\tcurrMark: Mark,\n\tbaseMark: Mark,\n\tnodeRebaser: NodeChangeRebaser,\n): Mark {\n\tconst baseChange = baseMark.changes;\n\tconst currChange = currMark.changes;\n\n\tif (baseChange === undefined && currChange === undefined) {\n\t\treturn currMark;\n\t}\n\n\tconst nodeState = nodeStateAfterMark(baseMark);\n\treturn withNodeChange(currMark, nodeRebaser(currChange, baseChange, nodeState));\n}\n\nfunction nodeStateAfterMark(mark: Mark): NodeAttachState {\n\tif (markEmptiesCells(mark)) {\n\t\treturn NodeAttachState.Detached;\n\t} else if (markFillsCells(mark)) {\n\t\treturn NodeAttachState.Attached;\n\t} else {\n\t\treturn mark.cellId === undefined ? NodeAttachState.Attached : NodeAttachState.Detached;\n\t}\n}\n\nfunction makeDetachedMark(mark: Mark, cellId: ChangeAtomId): Mark {\n\tassert(mark.cellId === undefined, 0x69f /* Expected mark to be attached */);\n\treturn { ...mark, cellId };\n}\n\nfunction withCellId<TMark extends Mark>(mark: TMark, cellId: CellId | undefined): TMark {\n\tconst newMark = { ...mark, cellId };\n\tif (cellId === undefined) {\n\t\tdelete newMark.cellId;\n\t}\n\treturn newMark;\n}\n\nfunction getMovedEffectFromBaseMark(\n\tmoveEffects: MoveEffectTable,\n\tbaseMark: Mark,\n): Detach | undefined {\n\tif (isMoveIn(baseMark)) {\n\t\treturn getMovedEffect(moveEffects, baseMark.revision, baseMark.id, baseMark.count);\n\t} else if (isAttachAndDetachEffect(baseMark) && isMoveIn(baseMark.attach)) {\n\t\treturn getMovedEffect(\n\t\t\tmoveEffects,\n\t\t\tbaseMark.attach.revision,\n\t\t\tbaseMark.attach.id,\n\t\t\tbaseMark.count,\n\t\t);\n\t} else {\n\t\treturn undefined;\n\t}\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 getMovedEffect(\n\tmoveEffects: MoveEffectTable,\n\trevision: RevisionTag | undefined,\n\tid: MoveId,\n\tcount: number,\n): Detach | undefined {\n\tconst effect = getMoveEffect(moveEffects, CrossFieldTarget.Destination, revision, id, count);\n\tassert(effect.length === count, 0x6f3 /* Expected effect to cover entire mark */);\n\tconst movedEffect = effect.value?.movedEffect;\n\tif (movedEffect === undefined) {\n\t\treturn undefined;\n\t}\n\tif (isMoveOut(movedEffect)) {\n\t\tmoveEffects.moveKey(CrossFieldTarget.Source, movedEffect.revision, movedEffect.id, count);\n\t}\n\treturn movedEffect;\n}\n\nfunction getMovedChangesFromBaseMark(\n\tmoveEffects: MoveEffectTable,\n\tbaseMark: Mark,\n): NodeId | undefined {\n\tif (isMoveIn(baseMark)) {\n\t\treturn getMovedNodeChanges(moveEffects, baseMark.revision, baseMark.id, baseMark.count);\n\t} else if (isAttachAndDetachEffect(baseMark) && isMoveIn(baseMark.attach)) {\n\t\treturn getMovedNodeChanges(\n\t\t\tmoveEffects,\n\t\t\tbaseMark.attach.revision,\n\t\t\tbaseMark.attach.id,\n\t\t\tbaseMark.count,\n\t\t);\n\t} else {\n\t\treturn undefined;\n\t}\n}\n\nfunction getMovedNodeChanges(\n\tmoveEffects: MoveEffectTable,\n\trevision: RevisionTag | undefined,\n\tid: MoveId,\n\tcount: number,\n): NodeId | undefined {\n\treturn getMoveEffect(moveEffects, CrossFieldTarget.Destination, revision, id, count).value\n\t\t?.rebasedChanges;\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { type DeltaDetachedNodeId } from "../../core/index.js";
6
- import type { Changeset } from "./types.js";
7
6
  import type { RelevantRemovedRootsFromChild } from "../modular-schema/index.js";
7
+ import type { Changeset } from "./types.js";
8
8
  export declare function relevantRemovedRoots(change: Changeset, relevantRemovedRootsFromChild: RelevantRemovedRootsFromChild): Iterable<DeltaDetachedNodeId>;
9
9
  //# sourceMappingURL=relevantRemovedRoots.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"relevantRemovedRoots.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/relevantRemovedRoots.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,mBAAmB,EAAkB,MAAM,qBAAqB,CAAC;AAG/E,OAAO,KAAK,EAAE,SAAS,EAAQ,MAAM,YAAY,CAAC;AAElD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAEhF,wBAAiB,oBAAoB,CACpC,MAAM,EAAE,SAAS,EACjB,6BAA6B,EAAE,6BAA6B,GAC1D,QAAQ,CAAC,mBAAmB,CAAC,CAgB/B"}
1
+ {"version":3,"file":"relevantRemovedRoots.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/relevantRemovedRoots.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,mBAAmB,EAAkB,MAAM,qBAAqB,CAAC;AAE/E,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAEhF,OAAO,KAAK,EAAE,SAAS,EAAQ,MAAM,YAAY,CAAC;AAGlD,wBAAiB,oBAAoB,CACpC,MAAM,EAAE,SAAS,EACjB,6BAA6B,EAAE,6BAA6B,GAC1D,QAAQ,CAAC,mBAAmB,CAAC,CAgB/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"relevantRemovedRoots.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/relevantRemovedRoots.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,kDAA+E;AAC/E,oDAAwD;AAGxD,yCAAuF;AAGvF,QAAe,CAAC,CAAC,oBAAoB,CACpC,MAAiB,EACjB,6BAA4D;IAE5D,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,4BAA4B,CAAC,IAAI,CAAC,EAAE,CAAC;YACxC,IAAA,iBAAM,EACL,IAAI,CAAC,MAAM,KAAK,SAAS,EACzB,KAAK,CAAC,oEAAoE,CAC1E,CAAC;YACF,MAAM,MAAM,GAAG,IAAA,oCAAoB,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxC,MAAM,IAAA,yBAAc,EAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YACjC,CAAC;QACF,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAChC,KAAK,CAAC,CAAC,6BAA6B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpD,CAAC;IACF,CAAC;AACF,CAAC;AAnBD,oDAmBC;AAED,SAAS,4BAA4B,CAAC,IAAU;IAC/C,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC/B,MAAM,MAAM,GAAG,IAAA,kCAAuB,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;QAClE,IAAI,IAAA,mBAAQ,EAAC,MAAM,CAAC,EAAE,CAAC;YACtB,2CAA2C;YAC3C,OAAO,IAAI,CAAC;QACb,CAAC;aAAM,IAAI,IAAA,iCAAsB,EAAC,IAAI,CAAC,EAAE,CAAC;YACzC,2DAA2D;YAC3D,OAAO,IAAI,CAAC;QACb,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAChC,qCAAqC;YACrC,uFAAuF;YACvF,kGAAkG;YAClG,8DAA8D;YAC9D,8FAA8F;YAC9F,+FAA+F;YAC/F,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { type DeltaDetachedNodeId, offsetDetachId } from \"../../core/index.js\";\nimport { nodeIdFromChangeAtom } from \"../deltaUtils.js\";\n\nimport type { Changeset, Mark } from \"./types.js\";\nimport { isAttachAndDetachEffect, isDetachOfRemovedNodes, isInsert } from \"./utils.js\";\nimport type { RelevantRemovedRootsFromChild } from \"../modular-schema/index.js\";\n\nexport function* relevantRemovedRoots(\n\tchange: Changeset,\n\trelevantRemovedRootsFromChild: RelevantRemovedRootsFromChild,\n): Iterable<DeltaDetachedNodeId> {\n\tfor (const mark of change) {\n\t\tif (refersToRelevantRemovedRoots(mark)) {\n\t\t\tassert(\n\t\t\t\tmark.cellId !== undefined,\n\t\t\t\t0x81d /* marks referring to removed trees must have an assigned cell ID */,\n\t\t\t);\n\t\t\tconst nodeId = nodeIdFromChangeAtom(mark.cellId);\n\t\t\tfor (let i = 0; i < mark.count; i += 1) {\n\t\t\t\tyield offsetDetachId(nodeId, i);\n\t\t\t}\n\t\t}\n\t\tif (mark.changes !== undefined) {\n\t\t\tyield* relevantRemovedRootsFromChild(mark.changes);\n\t\t}\n\t}\n}\n\nfunction refersToRelevantRemovedRoots(mark: Mark): boolean {\n\tif (mark.cellId !== undefined) {\n\t\tconst effect = isAttachAndDetachEffect(mark) ? mark.attach : mark;\n\t\tif (isInsert(effect)) {\n\t\t\t// This tree is being inserted or restored.\n\t\t\treturn true;\n\t\t} else if (isDetachOfRemovedNodes(mark)) {\n\t\t\t// This removed tree is being restored as part of a detach.\n\t\t\treturn true;\n\t\t}\n\t\tif (mark.changes !== undefined) {\n\t\t\t// This removed tree is being edited.\n\t\t\t// Note: there is a possibility that the child changes only affect a distant descendant\n\t\t\t// which may have been removed from this (removed) subtree. In such a case, this tree is not truly\n\t\t\t// relevant, but including it is the conservative thing to do.\n\t\t\t// In the future, we may represent changes to removed trees using the ID of the lowest removed\n\t\t\t// ancestor, which would allow us to avoid including such trees when they truly are not needed.\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n"]}
1
+ {"version":3,"file":"relevantRemovedRoots.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/relevantRemovedRoots.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,kDAA+E;AAC/E,oDAAwD;AAIxD,yCAAuF;AAEvF,QAAe,CAAC,CAAC,oBAAoB,CACpC,MAAiB,EACjB,6BAA4D;IAE5D,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,4BAA4B,CAAC,IAAI,CAAC,EAAE,CAAC;YACxC,IAAA,iBAAM,EACL,IAAI,CAAC,MAAM,KAAK,SAAS,EACzB,KAAK,CAAC,oEAAoE,CAC1E,CAAC;YACF,MAAM,MAAM,GAAG,IAAA,oCAAoB,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxC,MAAM,IAAA,yBAAc,EAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YACjC,CAAC;QACF,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAChC,KAAK,CAAC,CAAC,6BAA6B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpD,CAAC;IACF,CAAC;AACF,CAAC;AAnBD,oDAmBC;AAED,SAAS,4BAA4B,CAAC,IAAU;IAC/C,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC/B,MAAM,MAAM,GAAG,IAAA,kCAAuB,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;QAClE,IAAI,IAAA,mBAAQ,EAAC,MAAM,CAAC,EAAE,CAAC;YACtB,2CAA2C;YAC3C,OAAO,IAAI,CAAC;QACb,CAAC;aAAM,IAAI,IAAA,iCAAsB,EAAC,IAAI,CAAC,EAAE,CAAC;YACzC,2DAA2D;YAC3D,OAAO,IAAI,CAAC;QACb,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAChC,qCAAqC;YACrC,uFAAuF;YACvF,kGAAkG;YAClG,8DAA8D;YAC9D,8FAA8F;YAC9F,+FAA+F;YAC/F,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { type DeltaDetachedNodeId, offsetDetachId } from \"../../core/index.js\";\nimport { nodeIdFromChangeAtom } from \"../deltaUtils.js\";\nimport type { RelevantRemovedRootsFromChild } from \"../modular-schema/index.js\";\n\nimport type { Changeset, Mark } from \"./types.js\";\nimport { isAttachAndDetachEffect, isDetachOfRemovedNodes, isInsert } from \"./utils.js\";\n\nexport function* relevantRemovedRoots(\n\tchange: Changeset,\n\trelevantRemovedRootsFromChild: RelevantRemovedRootsFromChild,\n): Iterable<DeltaDetachedNodeId> {\n\tfor (const mark of change) {\n\t\tif (refersToRelevantRemovedRoots(mark)) {\n\t\t\tassert(\n\t\t\t\tmark.cellId !== undefined,\n\t\t\t\t0x81d /* marks referring to removed trees must have an assigned cell ID */,\n\t\t\t);\n\t\t\tconst nodeId = nodeIdFromChangeAtom(mark.cellId);\n\t\t\tfor (let i = 0; i < mark.count; i += 1) {\n\t\t\t\tyield offsetDetachId(nodeId, i);\n\t\t\t}\n\t\t}\n\t\tif (mark.changes !== undefined) {\n\t\t\tyield* relevantRemovedRootsFromChild(mark.changes);\n\t\t}\n\t}\n}\n\nfunction refersToRelevantRemovedRoots(mark: Mark): boolean {\n\tif (mark.cellId !== undefined) {\n\t\tconst effect = isAttachAndDetachEffect(mark) ? mark.attach : mark;\n\t\tif (isInsert(effect)) {\n\t\t\t// This tree is being inserted or restored.\n\t\t\treturn true;\n\t\t} else if (isDetachOfRemovedNodes(mark)) {\n\t\t\t// This removed tree is being restored as part of a detach.\n\t\t\treturn true;\n\t\t}\n\t\tif (mark.changes !== undefined) {\n\t\t\t// This removed tree is being edited.\n\t\t\t// Note: there is a possibility that the child changes only affect a distant descendant\n\t\t\t// which may have been removed from this (removed) subtree. In such a case, this tree is not truly\n\t\t\t// relevant, but including it is the conservative thing to do.\n\t\t\t// In the future, we may represent changes to removed trees using the ID of the lowest removed\n\t\t\t// ancestor, which would allow us to avoid including such trees when they truly are not needed.\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"replaceRevisions.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/replaceRevisions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,KAAK,WAAW,EAAwB,MAAM,qBAAqB,CAAC;AAE7E,OAAO,EACN,KAAK,SAAS,EAQd,MAAM,YAAY,CAAC;AAIpB,wBAAgB,gBAAgB,CAC/B,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,EAChD,WAAW,EAAE,WAAW,GAAG,SAAS,GAClC,SAAS,CAQX"}
1
+ {"version":3,"file":"replaceRevisions.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/replaceRevisions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,WAAW,EAAwB,MAAM,qBAAqB,CAAC;AAI7E,OAAO,EACN,KAAK,SAAS,EAQd,MAAM,YAAY,CAAC;AAGpB,wBAAgB,gBAAgB,CAC/B,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,EAChD,WAAW,EAAE,WAAW,GAAG,SAAS,GAClC,SAAS,CAQX"}
@@ -1 +1 @@
1
- {"version":3,"file":"replaceRevisions.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/replaceRevisions.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAsE;AACtE,kDAA6E;AAC7E,6DAAuD;AACvD,yCASoB;AAEpB,yCAAgD;AAEhD,SAAgB,gBAAgB,CAC/B,SAAoB,EACpB,kBAAgD,EAChD,WAAoC;IAEpC,MAAM,YAAY,GAAG,IAAI,oCAAe,EAAE,CAAC;IAC3C,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC9B,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAAC;QACtE,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,YAAY,CAAC,IAAI,CAAC;AAC1B,CAAC;AAZD,4CAYC;AAED,SAAS,UAAU,CAClB,IAAU,EACV,kBAAgD,EAChD,WAAoC;IAEpC,MAAM,WAAW,GAAG,EAAE,GAAG,YAAY,CAAC,IAAI,EAAE,kBAAkB,EAAE,WAAW,CAAC,EAAE,CAAC;IAC/E,IAAI,IAAI,CAA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ft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport { type RevisionTag, replaceAtomRevisions } from \"../../core/index.js\";\nimport { MarkListFactory } from \"./markListFactory.js\";\nimport {\n\ttype Changeset,\n\ttype Detach,\n\ttype HasMoveFields,\n\ttype HasRevisionTag,\n\ttype Mark,\n\ttype MarkEffect,\n\tNoopMarkType,\n\ttype Rename,\n} from \"./types.js\";\nimport type { MoveMarkEffect } from \"./helperTypes.js\";\nimport { isDetach, isRename } from \"./utils.js\";\n\nexport function replaceRevisions(\n\tchangeset: Changeset,\n\trevisionsToReplace: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): Changeset {\n\tconst updatedMarks = new MarkListFactory();\n\tfor (const mark of changeset) {\n\t\tconst updatedMark = updateMark(mark, revisionsToReplace, newRevision);\n\t\tupdatedMarks.push(updatedMark);\n\t}\n\n\treturn updatedMarks.list;\n}\n\nfunction updateMark(\n\tmark: Mark,\n\trevisionsToReplace: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): Mark {\n\tconst updatedMark = { ...updateEffect(mark, revisionsToReplace, newRevision) };\n\tif (mark.cellId !== undefined) {\n\t\tupdatedMark.cellId = replaceAtomRevisions(mark.cellId, revisionsToReplace, newRevision);\n\t}\n\n\tif (mark.changes !== undefined) {\n\t\tupdatedMark.changes = replaceAtomRevisions(mark.changes, revisionsToReplace, newRevision);\n\t}\n\n\treturn updatedMark;\n}\n\nfunction updateEffect<TMark extends MarkEffect>(\n\tinput: TMark,\n\trevisionsToReplace: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): TMark {\n\tconst mark =\n\t\tisDetach(input) || isRename(input)\n\t\t\t? updateIdOverride(input, revisionsToReplace, newRevision)\n\t\t\t: input;\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase \"Rename\":\n\t\tcase NoopMarkType:\n\t\t\treturn mark;\n\t\tcase \"AttachAndDetach\":\n\t\t\treturn {\n\t\t\t\t...mark,\n\t\t\t\tattach: updateEffect(mark.attach, revisionsToReplace, newRevision),\n\t\t\t\tdetach: updateEffect(mark.detach, revisionsToReplace, newRevision),\n\t\t\t};\n\t\tcase \"MoveIn\":\n\t\tcase \"MoveOut\":\n\t\t\treturn updateMoveEffect<TMark & MoveMarkEffect>(\n\t\t\t\t// For some reason, TypeScript is not able to infer that `mark` cannot be a `NoopMark` here.\n\t\t\t\tmark as MoveMarkEffect,\n\t\t\t\trevisionsToReplace,\n\t\t\t\tnewRevision,\n\t\t\t);\n\t\tcase \"Insert\":\n\t\tcase \"Remove\":\n\t\t\treturn updateRevision<TMark & HasRevisionTag>(mark, revisionsToReplace, newRevision);\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\nfunction updateIdOverride<TEffect extends Detach | Rename>(\n\teffect: TEffect,\n\trevisionsToReplace: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): TEffect {\n\tif (effect.idOverride !== undefined) {\n\t\tconst idOverride = replaceAtomRevisions(\n\t\t\teffect.idOverride,\n\t\t\trevisionsToReplace,\n\t\t\tnewRevision,\n\t\t);\n\t\treturn { ...effect, idOverride };\n\t} else {\n\t\treturn effect;\n\t}\n}\n\nfunction updateMoveEffect<TEffect extends HasMoveFields>(\n\teffect: TEffect,\n\trevisionsToReplace: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): TEffect {\n\treturn effect.finalEndpoint !== undefined\n\t\t? updateRevision(\n\t\t\t\t{\n\t\t\t\t\t...effect,\n\t\t\t\t\tfinalEndpoint: updateRevision(effect.finalEndpoint, revisionsToReplace, newRevision),\n\t\t\t\t},\n\t\t\t\trevisionsToReplace,\n\t\t\t\tnewRevision,\n\t\t\t)\n\t\t: updateRevision(effect, revisionsToReplace, newRevision);\n}\n\nfunction updateRevision<T extends HasRevisionTag>(\n\tinput: T,\n\trevisionsToReplace: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): T {\n\treturn revisionsToReplace.has(input.revision) ? withRevision(input, newRevision) : input;\n}\n\nfunction withRevision<T extends HasRevisionTag>(\n\tinput: T,\n\trevision: RevisionTag | undefined,\n): T {\n\tconst updated = { ...input, revision };\n\tif (revision === undefined) {\n\t\tdelete updated.revision;\n\t}\n\n\treturn updated;\n}\n"]}
1
+ {"version":3,"file":"replaceRevisions.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/replaceRevisions.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAsE;AAEtE,kDAA6E;AAG7E,6DAAuD;AACvD,yCASoB;AACpB,yCAAgD;AAEhD,SAAgB,gBAAgB,CAC/B,SAAoB,EACpB,kBAAgD,EAChD,WAAoC;IAEpC,MAAM,YAAY,GAAG,IAAI,oCAAe,EAAE,CAAC;IAC3C,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC9B,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAAC;QACtE,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,YAAY,CAAC,IAAI,CAAC;AAC1B,CAAC;AAZD,4CAYC;AAED,SAAS,UAAU,CAClB,IAAU,EACV,kBAAgD,EAChD,WAAoC;IAEpC,MAAM,WAAW,GAAG,EAAE,GAAG,YAAY,CAAC,IAAI,EAAE,kBAAkB,EAAE,WAAW,CAAC,EAAE,CAAC;IAC/E,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC/B,WAAW,CAAC,MAAM,GAAG,IAAA,+BAAoB,EAAC,IAAI,CAAC,MAAM,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAAC;IACzF,CAAC;IAED,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAChC,WAAW,CAAC,OAAO,GAAG,IAAA,+BAAoB,EAAC,IAAI,CAAC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CAAC;QACF,OAAO,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,CAAC;IAClC,CAAC;SAAM,CAAC;QACP,OAAO,MAAM,CAAC;IACf,CAAC;AACF,CAAC;AAED,SAAS,gBAAgB,CACxB,MAAe,EACf,kBAAgD,EAChD,WAAoC;IAEpC,OAAO,MAAM,CAAC,aAAa,KAAK,SAAS;QACxC,CAAC,CAAC,cAAc,CACd;YACC,GAAG,MAAM;YACT,aAAa,EAAE,cAAc,CAAC,MAAM,CAAC,aAAa,EAAE,kBAAkB,EAAE,WAAW,CAAC;SACpF,EACD,kBAAkB,EAClB,WAAW,CACX;QACF,CAAC,CAAC,cAAc,CAAC,MAAM,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAAC;AAC5D,CAAC;AAED,SAAS,cAAc,CACtB,KAAQ,EACR,kBAAgD,EAChD,WAAoC;IAEpC,OAAO,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC1F,CAAC;AAED,SAAS,YAAY,CACpB,KAAQ,EACR,QAAiC;IAEjC,MAAM,OAAO,GAAG,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,CAAC;IACvC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,OAAO,CAAC,QAAQ,CAAC;IACzB,CAAC;IAED,OAAO,OAAO,CAAC;AAChB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport { type RevisionTag, replaceAtomRevisions } from \"../../core/index.js\";\n\nimport type { MoveMarkEffect } from \"./helperTypes.js\";\nimport { MarkListFactory } from \"./markListFactory.js\";\nimport {\n\ttype Changeset,\n\ttype Detach,\n\ttype HasMoveFields,\n\ttype HasRevisionTag,\n\ttype Mark,\n\ttype MarkEffect,\n\tNoopMarkType,\n\ttype Rename,\n} from \"./types.js\";\nimport { isDetach, isRename } from \"./utils.js\";\n\nexport function replaceRevisions(\n\tchangeset: Changeset,\n\trevisionsToReplace: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): Changeset {\n\tconst updatedMarks = new MarkListFactory();\n\tfor (const mark of changeset) {\n\t\tconst updatedMark = updateMark(mark, revisionsToReplace, newRevision);\n\t\tupdatedMarks.push(updatedMark);\n\t}\n\n\treturn updatedMarks.list;\n}\n\nfunction updateMark(\n\tmark: Mark,\n\trevisionsToReplace: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): Mark {\n\tconst updatedMark = { ...updateEffect(mark, revisionsToReplace, newRevision) };\n\tif (mark.cellId !== undefined) {\n\t\tupdatedMark.cellId = replaceAtomRevisions(mark.cellId, revisionsToReplace, newRevision);\n\t}\n\n\tif (mark.changes !== undefined) {\n\t\tupdatedMark.changes = replaceAtomRevisions(mark.changes, revisionsToReplace, newRevision);\n\t}\n\n\treturn updatedMark;\n}\n\nfunction updateEffect<TMark extends MarkEffect>(\n\tinput: TMark,\n\trevisionsToReplace: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): TMark {\n\tconst mark =\n\t\tisDetach(input) || isRename(input)\n\t\t\t? updateIdOverride(input, revisionsToReplace, newRevision)\n\t\t\t: input;\n\tconst type = mark.type;\n\tswitch (type) {\n\t\tcase \"Rename\":\n\t\tcase NoopMarkType:\n\t\t\treturn mark;\n\t\tcase \"AttachAndDetach\":\n\t\t\treturn {\n\t\t\t\t...mark,\n\t\t\t\tattach: updateEffect(mark.attach, revisionsToReplace, newRevision),\n\t\t\t\tdetach: updateEffect(mark.detach, revisionsToReplace, newRevision),\n\t\t\t};\n\t\tcase \"MoveIn\":\n\t\tcase \"MoveOut\":\n\t\t\treturn updateMoveEffect<TMark & MoveMarkEffect>(\n\t\t\t\t// For some reason, TypeScript is not able to infer that `mark` cannot be a `NoopMark` here.\n\t\t\t\tmark as MoveMarkEffect,\n\t\t\t\trevisionsToReplace,\n\t\t\t\tnewRevision,\n\t\t\t);\n\t\tcase \"Insert\":\n\t\tcase \"Remove\":\n\t\t\treturn updateRevision<TMark & HasRevisionTag>(mark, revisionsToReplace, newRevision);\n\t\tdefault:\n\t\t\tunreachableCase(type);\n\t}\n}\n\nfunction updateIdOverride<TEffect extends Detach | Rename>(\n\teffect: TEffect,\n\trevisionsToReplace: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): TEffect {\n\tif (effect.idOverride !== undefined) {\n\t\tconst idOverride = replaceAtomRevisions(\n\t\t\teffect.idOverride,\n\t\t\trevisionsToReplace,\n\t\t\tnewRevision,\n\t\t);\n\t\treturn { ...effect, idOverride };\n\t} else {\n\t\treturn effect;\n\t}\n}\n\nfunction updateMoveEffect<TEffect extends HasMoveFields>(\n\teffect: TEffect,\n\trevisionsToReplace: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): TEffect {\n\treturn effect.finalEndpoint !== undefined\n\t\t? updateRevision(\n\t\t\t\t{\n\t\t\t\t\t...effect,\n\t\t\t\t\tfinalEndpoint: updateRevision(effect.finalEndpoint, revisionsToReplace, newRevision),\n\t\t\t\t},\n\t\t\t\trevisionsToReplace,\n\t\t\t\tnewRevision,\n\t\t\t)\n\t\t: updateRevision(effect, revisionsToReplace, newRevision);\n}\n\nfunction updateRevision<T extends HasRevisionTag>(\n\tinput: T,\n\trevisionsToReplace: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): T {\n\treturn revisionsToReplace.has(input.revision) ? withRevision(input, newRevision) : input;\n}\n\nfunction withRevision<T extends HasRevisionTag>(\n\tinput: T,\n\trevision: RevisionTag | undefined,\n): T {\n\tconst updated = { ...input, revision };\n\tif (revision === undefined) {\n\t\tdelete updated.revision;\n\t}\n\n\treturn updated;\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  import { type IJsonCodec } from "../../codec/index.js";
6
6
  import type { ChangeEncodingContext, EncodedRevisionTag, RevisionTag } from "../../core/index.js";
7
7
  import { type JsonCompatibleReadOnly } from "../../util/index.js";
8
- import { type Changeset } from "./types.js";
9
8
  import type { FieldChangeEncodingContext } from "../index.js";
9
+ import { type Changeset } from "./types.js";
10
10
  export declare function makeV1Codec(revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>): IJsonCodec<Changeset, JsonCompatibleReadOnly, JsonCompatibleReadOnly, FieldChangeEncodingContext>;
11
11
  //# sourceMappingURL=sequenceFieldCodecV1.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sequenceFieldCodecV1.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,KAAK,EACX,qBAAqB,EAErB,kBAAkB,EAClB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,sBAAsB,EAAuB,MAAM,qBAAqB,CAAC;AAQvF,OAAO,EAIN,KAAK,SAAS,EAUd,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAG9D,wBAAgB,WAAW,CAC1B,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,GACC,UAAU,CACZ,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,CAC1B,CA0RA"}
1
+ {"version":3,"file":"sequenceFieldCodecV1.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,KAAK,EACX,qBAAqB,EAErB,kBAAkB,EAClB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,sBAAsB,EAAuB,MAAM,qBAAqB,CAAC;AAEvF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAQ9D,OAAO,EAIN,KAAK,SAAS,EAUd,MAAM,YAAY,CAAC;AAGpB,wBAAgB,WAAW,CAC1B,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,GACC,UAAU,CACZ,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,CAC1B,CA0RA"}
@@ -9,10 +9,10 @@ const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const index_js_1 = require("../../codec/index.js");
10
10
  const index_js_2 = require("../../util/index.js");
11
11
  const changeAtomIdCodec_js_1 = require("../changeAtomIdCodec.js");
12
+ const index_js_3 = require("../modular-schema/index.js");
12
13
  const formatV1_js_1 = require("./formatV1.js");
13
14
  const types_js_1 = require("./types.js");
14
15
  const utils_js_1 = require("./utils.js");
15
- const index_js_3 = require("../modular-schema/index.js");
16
16
  function makeV1Codec(revisionTagCodec) {
17
17
  const changeAtomIdCodec = (0, changeAtomIdCodec_js_1.makeChangeAtomIdCodec)(revisionTagCodec);
18
18
  const markEffectCodec = {
@@ -1 +1 @@
1
- {"version":3,"file":"sequenceFieldCodecV1.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAGpF,mDAAqF;AAOrF,kDAAuF;AACvF,kEAAgE;AAEhE,+CAIuB;AACvB,yCAcoB;AACpB,yCAA6D;AAE7D,yDAAkE;AAElE,SAAgB,WAAW,CAC1B,gBAKC;IAOD,MAAM,iBAAiB,GAAG,IAAA,4CAAqB,EAAC,gBAAgB,CAAC,CAAC;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BAClF,uHAAuH;oBACvH,+GAA+G;oBAC/G,4FAA4F;oBAC5F,YAAY,GAAG,IAAA,8BAAmB,EACjC,YAAY,CAAC,MAAM,EACnB,YAAY,CAAC,KAAK,EAClB,YAAY,CAAC,MAAM,EACnB,YAAY,CAAC,MAAM,CACnB,CAAC;gBACH,CAAC;gBACD,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;oBAChC,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACzD,CAAC;gBACD,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAC1B,CAAC;YACD,OAAO,KAAK,CAAC;QACd,CAAC;QACD,aAAa,EAAE,IAAA,uBAAe,EAAC,+BAAoB,CAAC;KACpD,CAAC;AACH,CAAC;AAtSD,kCAsSC;AAED;;GAEG;AACH,MAAM,aAAa,GAAqB,IAAA,gBAAK,EAAC,CAAC,CAAC,CAAC,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\";\nimport type { TAnySchema } from \"@sinclair/typebox\";\n\nimport { DiscriminatedUnionDispatcher, type IJsonCodec } from \"../../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tChangesetLocalId,\n\tEncodedRevisionTag,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport { type JsonCompatibleReadOnly, type Mutable, brand } from \"../../util/index.js\";\nimport { makeChangeAtomIdCodec } from \"../changeAtomIdCodec.js\";\n\nimport {\n\tChangeset as ChangesetSchema,\n\tDetachIdOverrideType,\n\ttype Encoded,\n} from \"./formatV1.js\";\nimport {\n\ttype Attach,\n\ttype AttachAndDetach,\n\ttype CellId,\n\ttype Changeset,\n\ttype Detach,\n\ttype Insert,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype MoveIn,\n\ttype MoveOut,\n\tNoopMarkType,\n\ttype Remove,\n\ttype Rename,\n} from \"./types.js\";\nimport { isNoopMark, normalizeCellRename } from \"./utils.js\";\nimport type { FieldChangeEncodingContext } from \"../index.js\";\nimport { EncodedNodeChangeset } from \"../modular-schema/index.js\";\n\nexport function makeV1Codec(\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): IJsonCodec<\n\tChangeset,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tFieldChangeEncodingContext\n> {\n\tconst changeAtomIdCodec = makeChangeAtomIdCodec(revisionTagCodec);\n\tconst markEffectCodec: IJsonCodec<\n\t\tMarkEffect,\n\t\tEncoded.MarkEffect,\n\t\tEncoded.MarkEffect,\n\t\tChangeEncodingContext\n\t> = {\n\t\tencode(effect: MarkEffect, context: ChangeEncodingContext): Encoded.MarkEffect {\n\t\t\tfunction encodeRevision(\n\t\t\t\trevision: RevisionTag | undefined,\n\t\t\t): EncodedRevisionTag | undefined {\n\t\t\t\tif (revision === undefined || revision === context.revision) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn revisionTagCodec.encode(revision, context);\n\t\t\t}\n\n\t\t\tconst type = effect.type;\n\t\t\tswitch (type) {\n\t\t\t\tcase \"MoveIn\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmoveIn: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tfinalEndpoint:\n\t\t\t\t\t\t\t\teffect.finalEndpoint === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.finalEndpoint, context),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Insert\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tinsert: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Remove\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdelete: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tidOverride:\n\t\t\t\t\t\t\t\teffect.idOverride === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\t\t\t// An arbitrary override type is chosen here. It only had an impact on lineage logic which was not enabled in V1.\n\t\t\t\t\t\t\t\t\t\t\ttype: DetachIdOverrideType.Unattach,\n\t\t\t\t\t\t\t\t\t\t\tid: cellIdCodec.encode(effect.idOverride, context),\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"MoveOut\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmoveOut: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tfinalEndpoint:\n\t\t\t\t\t\t\t\teffect.finalEndpoint === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.finalEndpoint, context),\n\t\t\t\t\t\t\tidOverride:\n\t\t\t\t\t\t\t\teffect.idOverride === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\t\t\t// An arbitrary override type is chosen here. It only had an impact on lineage logic which was not enabled in V1.\n\t\t\t\t\t\t\t\t\t\t\ttype: DetachIdOverrideType.Unattach,\n\t\t\t\t\t\t\t\t\t\t\tid: cellIdCodec.encode(effect.idOverride, context),\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"AttachAndDetach\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tattachAndDetach: {\n\t\t\t\t\t\t\tattach: markEffectCodec.encode(effect.attach, context) as Encoded.Attach,\n\t\t\t\t\t\t\tdetach: markEffectCodec.encode(effect.detach, context) as Encoded.Detach,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Rename\":\n\t\t\t\t\t// In documents generated by clients on release >=2.2 (i.e., running the code from the PR that added this comment),\n\t\t\t\t\t// renames are encoded as AttachAndDetach with a special id.\n\t\t\t\t\t// This ensures forward-compatibility of clients on release <=2.1 with documents/ops generated by clients on release >=2.2.\n\t\t\t\t\treturn markEffectCodec.encode(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: \"AttachAndDetach\",\n\t\t\t\t\t\t\tattach: { type: \"MoveIn\", id: renameLocalId },\n\t\t\t\t\t\t\tdetach: { type: \"MoveOut\", id: renameLocalId, idOverride: effect.idOverride },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t);\n\t\t\t\tcase NoopMarkType:\n\t\t\t\t\tfail(0xb2b /* Mark type: NoopMarkType should not be encoded. */);\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(type);\n\t\t\t}\n\t\t},\n\t\tdecode(encoded: Encoded.MarkEffect, context: ChangeEncodingContext): MarkEffect {\n\t\t\treturn decoderLibrary.dispatch(encoded, context);\n\t\t},\n\t};\n\n\tfunction decodeRevision(\n\t\tencodedRevision: EncodedRevisionTag | undefined,\n\t\tcontext: ChangeEncodingContext,\n\t): RevisionTag {\n\t\tif (encodedRevision === undefined) {\n\t\t\tassert(context.revision !== undefined, 0x965 /* Implicit revision should be provided */);\n\t\t\treturn context.revision;\n\t\t}\n\n\t\treturn revisionTagCodec.decode(encodedRevision, context);\n\t}\n\n\tconst decoderLibrary = new DiscriminatedUnionDispatcher<\n\t\tEncoded.MarkEffect,\n\t\t/* args */ [context: ChangeEncodingContext],\n\t\tMarkEffect\n\t>({\n\t\tmoveIn(encoded: Encoded.MoveIn, context: ChangeEncodingContext): MoveIn {\n\t\t\tconst { id, finalEndpoint, revision } = encoded;\n\t\t\tconst mark: MoveIn = {\n\t\t\t\ttype: \"MoveIn\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (finalEndpoint !== undefined) {\n\t\t\t\tmark.finalEndpoint = changeAtomIdCodec.decode(finalEndpoint, context);\n\t\t\t}\n\t\t\treturn mark;\n\t\t},\n\t\tinsert(encoded: Encoded.Insert, context: ChangeEncodingContext): Insert {\n\t\t\tconst { id, revision } = encoded;\n\t\t\tconst mark: Insert = {\n\t\t\t\ttype: \"Insert\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\treturn mark;\n\t\t},\n\t\tdelete(encoded: Encoded.Remove, context: ChangeEncodingContext): Remove {\n\t\t\tconst { id, revision, idOverride } = encoded;\n\t\t\tconst mark: Mutable<Remove> = {\n\t\t\t\ttype: \"Remove\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (idOverride !== undefined) {\n\t\t\t\tmark.idOverride = cellIdCodec.decode(idOverride.id, context);\n\t\t\t}\n\t\t\treturn mark;\n\t\t},\n\t\tmoveOut(encoded: Encoded.MoveOut, context: ChangeEncodingContext): MoveOut {\n\t\t\tconst { id, finalEndpoint, idOverride, revision } = encoded;\n\t\t\tconst mark: Mutable<MoveOut> = {\n\t\t\t\ttype: \"MoveOut\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (finalEndpoint !== undefined) {\n\t\t\t\tmark.finalEndpoint = changeAtomIdCodec.decode(finalEndpoint, context);\n\t\t\t}\n\t\t\tif (idOverride !== undefined) {\n\t\t\t\tmark.idOverride = cellIdCodec.decode(idOverride.id, context);\n\t\t\t}\n\n\t\t\treturn mark;\n\t\t},\n\t\tattachAndDetach(\n\t\t\tencoded: Encoded.AttachAndDetach,\n\t\t\tcontext: ChangeEncodingContext,\n\t\t): AttachAndDetach | Rename {\n\t\t\tconst attach = decoderLibrary.dispatch(encoded.attach, context) as Attach;\n\t\t\tconst detach = decoderLibrary.dispatch(encoded.detach, context) as Detach;\n\t\t\t// In documents generated by clients on release >=2.2 (i.e., running the code from the PR that added this comment),\n\t\t\t// renames are encoded as AttachAndDetach with a special id.\n\t\t\t// This ensures forward-compatibility of clients on release <=2.1 with documents/ops generated by clients on release >=2.2.\n\t\t\tif (attach.id === renameLocalId) {\n\t\t\t\tassert(detach.idOverride !== undefined, 0x9f7 /* Rename must have idOverride */);\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"Rename\",\n\t\t\t\t\tidOverride: detach.idOverride,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttype: \"AttachAndDetach\",\n\t\t\t\tattach,\n\t\t\t\tdetach,\n\t\t\t};\n\t\t},\n\t});\n\n\tconst cellIdCodec: IJsonCodec<\n\t\tCellId,\n\t\tEncoded.CellId,\n\t\tEncoded.CellId,\n\t\tChangeEncodingContext\n\t> = {\n\t\tencode: (cellId: CellId, context: ChangeEncodingContext): Encoded.CellId => {\n\t\t\tconst encoded: Encoded.CellId = {\n\t\t\t\tatom: changeAtomIdCodec.encode(cellId, context),\n\t\t\t};\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: ({ atom }: Encoded.CellId, context: ChangeEncodingContext): CellId => {\n\t\t\treturn changeAtomIdCodec.decode(atom, context);\n\t\t},\n\t};\n\n\t/**\n\t * If we want to make the node change aspect of this codec more type-safe, we could adjust generics\n\t * to be in terms of the schema rather than the concrete type of the node change.\n\t */\n\ttype NodeChangeSchema = TAnySchema;\n\n\treturn {\n\t\tencode: (\n\t\t\tchangeset: Changeset,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): JsonCompatibleReadOnly & Encoded.Changeset<NodeChangeSchema> => {\n\t\t\tconst jsonMarks: Encoded.Changeset<NodeChangeSchema> = [];\n\t\t\tfor (const mark of changeset) {\n\t\t\t\tconst encodedMark: Encoded.Mark<NodeChangeSchema> = {\n\t\t\t\t\tcount: mark.count,\n\t\t\t\t};\n\t\t\t\tif (!isNoopMark(mark)) {\n\t\t\t\t\tencodedMark.effect = markEffectCodec.encode(mark, context.baseContext);\n\t\t\t\t}\n\t\t\t\tif (mark.cellId !== undefined) {\n\t\t\t\t\tencodedMark.cellId = cellIdCodec.encode(mark.cellId, context.baseContext);\n\t\t\t\t}\n\t\t\t\tif (mark.changes !== undefined) {\n\t\t\t\t\tencodedMark.changes = context.encodeNode(mark.changes);\n\t\t\t\t}\n\t\t\t\tjsonMarks.push(encodedMark);\n\t\t\t}\n\t\t\treturn jsonMarks;\n\t\t},\n\t\tdecode: (\n\t\t\tchangeset: Encoded.Changeset<NodeChangeSchema>,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): Changeset => {\n\t\t\tconst marks: Changeset = [];\n\t\t\tfor (const mark of changeset) {\n\t\t\t\tconst decodedMark: Mark = {\n\t\t\t\t\tcount: mark.count,\n\t\t\t\t};\n\n\t\t\t\tif (mark.effect !== undefined) {\n\t\t\t\t\tObject.assign(decodedMark, markEffectCodec.decode(mark.effect, context.baseContext));\n\t\t\t\t}\n\t\t\t\tif (mark.cellId !== undefined) {\n\t\t\t\t\tdecodedMark.cellId = cellIdCodec.decode(mark.cellId, context.baseContext);\n\t\t\t\t}\n\t\t\t\t// Type deduction wrongly narrows the type of `decodedMark` to `NoopMark & HasMarkFields`.\n\t\t\t\t// We declare a new casted copy of `decodedMark` to recover the correct type.\n\t\t\t\tlet decodedMark2 = decodedMark as Mark;\n\t\t\t\tif (decodedMark2.cellId !== undefined && decodedMark2.type === \"AttachAndDetach\") {\n\t\t\t\t\t// In documents generated by clients on release <=2.1 (i.e., not running the code from the PR that added this comment),\n\t\t\t\t\t// rename-like AttachAndDetach marks are not normalized to Rename marks thus requiring this normalization step.\n\t\t\t\t\t// This ensures backward compatibility with documents generated by clients on release <=2.1.\n\t\t\t\t\tdecodedMark2 = normalizeCellRename(\n\t\t\t\t\t\tdecodedMark2.cellId,\n\t\t\t\t\t\tdecodedMark2.count,\n\t\t\t\t\t\tdecodedMark2.attach,\n\t\t\t\t\t\tdecodedMark2.detach,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (mark.changes !== undefined) {\n\t\t\t\t\tdecodedMark2.changes = context.decodeNode(mark.changes);\n\t\t\t\t}\n\t\t\t\tmarks.push(decodedMark2);\n\t\t\t}\n\t\t\treturn marks;\n\t\t},\n\t\tencodedSchema: ChangesetSchema(EncodedNodeChangeset),\n\t};\n}\n\n/**\n * Arbitrary ID that is used to indicate a Rename effect.\n */\nconst renameLocalId: ChangesetLocalId = brand(-1);\n"]}
1
+ {"version":3,"file":"sequenceFieldCodecV1.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAGpF,mDAAqF;AAOrF,kDAAuF;AACvF,kEAAgE;AAEhE,yDAAkE;AAElE,+CAIuB;AACvB,yCAcoB;AACpB,yCAA6D;AAE7D,SAAgB,WAAW,CAC1B,gBAKC;IAOD,MAAM,iBAAiB,GAAG,IAAA,4CAAqB,EAAC,gBAAgB,CAAC,CAAC;IAClE,MAAM,eAAe,GAKjB;QACH,MAAM,CAAC,MAAkB,EAAE,OAA8B;YACxD,SAAS,cAAc,CACtB,QAAiC;gBAEjC,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,OAAO,CAAC,QAAQ,EAAE,CAAC;oBAC7D,OAAO,SAAS,CAAC;gBAClB,CAAC;gBAED,OAAO,gBAAgB,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACnD,CAAC;YAED,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;YACzB,QAAQ,IAAI,EAAE,C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IAAI,CAAC,YAAY,CAAC,CAAC;YAC1B,CAAC;YACD,OAAO,KAAK,CAAC;QACd,CAAC;QACD,aAAa,EAAE,IAAA,uBAAe,EAAC,+BAAoB,CAAC;KACpD,CAAC;AACH,CAAC;AAtSD,kCAsSC;AAED;;GAEG;AACH,MAAM,aAAa,GAAqB,IAAA,gBAAK,EAAC,CAAC,CAAC,CAAC,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\";\nimport type { TAnySchema } from \"@sinclair/typebox\";\n\nimport { DiscriminatedUnionDispatcher, type IJsonCodec } from \"../../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tChangesetLocalId,\n\tEncodedRevisionTag,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport { type JsonCompatibleReadOnly, type Mutable, brand } from \"../../util/index.js\";\nimport { makeChangeAtomIdCodec } from \"../changeAtomIdCodec.js\";\nimport type { FieldChangeEncodingContext } from \"../index.js\";\nimport { EncodedNodeChangeset } from \"../modular-schema/index.js\";\n\nimport {\n\tChangeset as ChangesetSchema,\n\tDetachIdOverrideType,\n\ttype Encoded,\n} from \"./formatV1.js\";\nimport {\n\ttype Attach,\n\ttype AttachAndDetach,\n\ttype CellId,\n\ttype Changeset,\n\ttype Detach,\n\ttype Insert,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype MoveIn,\n\ttype MoveOut,\n\tNoopMarkType,\n\ttype Remove,\n\ttype Rename,\n} from \"./types.js\";\nimport { isNoopMark, normalizeCellRename } from \"./utils.js\";\n\nexport function makeV1Codec(\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): IJsonCodec<\n\tChangeset,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tFieldChangeEncodingContext\n> {\n\tconst changeAtomIdCodec = makeChangeAtomIdCodec(revisionTagCodec);\n\tconst markEffectCodec: IJsonCodec<\n\t\tMarkEffect,\n\t\tEncoded.MarkEffect,\n\t\tEncoded.MarkEffect,\n\t\tChangeEncodingContext\n\t> = {\n\t\tencode(effect: MarkEffect, context: ChangeEncodingContext): Encoded.MarkEffect {\n\t\t\tfunction encodeRevision(\n\t\t\t\trevision: RevisionTag | undefined,\n\t\t\t): EncodedRevisionTag | undefined {\n\t\t\t\tif (revision === undefined || revision === context.revision) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn revisionTagCodec.encode(revision, context);\n\t\t\t}\n\n\t\t\tconst type = effect.type;\n\t\t\tswitch (type) {\n\t\t\t\tcase \"MoveIn\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmoveIn: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tfinalEndpoint:\n\t\t\t\t\t\t\t\teffect.finalEndpoint === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.finalEndpoint, context),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Insert\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tinsert: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Remove\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdelete: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tidOverride:\n\t\t\t\t\t\t\t\teffect.idOverride === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\t\t\t// An arbitrary override type is chosen here. It only had an impact on lineage logic which was not enabled in V1.\n\t\t\t\t\t\t\t\t\t\t\ttype: DetachIdOverrideType.Unattach,\n\t\t\t\t\t\t\t\t\t\t\tid: cellIdCodec.encode(effect.idOverride, context),\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"MoveOut\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmoveOut: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tfinalEndpoint:\n\t\t\t\t\t\t\t\teffect.finalEndpoint === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.finalEndpoint, context),\n\t\t\t\t\t\t\tidOverride:\n\t\t\t\t\t\t\t\teffect.idOverride === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\t\t\t// An arbitrary override type is chosen here. It only had an impact on lineage logic which was not enabled in V1.\n\t\t\t\t\t\t\t\t\t\t\ttype: DetachIdOverrideType.Unattach,\n\t\t\t\t\t\t\t\t\t\t\tid: cellIdCodec.encode(effect.idOverride, context),\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"AttachAndDetach\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tattachAndDetach: {\n\t\t\t\t\t\t\tattach: markEffectCodec.encode(effect.attach, context) as Encoded.Attach,\n\t\t\t\t\t\t\tdetach: markEffectCodec.encode(effect.detach, context) as Encoded.Detach,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Rename\":\n\t\t\t\t\t// In documents generated by clients on release >=2.2 (i.e., running the code from the PR that added this comment),\n\t\t\t\t\t// renames are encoded as AttachAndDetach with a special id.\n\t\t\t\t\t// This ensures forward-compatibility of clients on release <=2.1 with documents/ops generated by clients on release >=2.2.\n\t\t\t\t\treturn markEffectCodec.encode(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: \"AttachAndDetach\",\n\t\t\t\t\t\t\tattach: { type: \"MoveIn\", id: renameLocalId },\n\t\t\t\t\t\t\tdetach: { type: \"MoveOut\", id: renameLocalId, idOverride: effect.idOverride },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t);\n\t\t\t\tcase NoopMarkType:\n\t\t\t\t\tfail(0xb2b /* Mark type: NoopMarkType should not be encoded. */);\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(type);\n\t\t\t}\n\t\t},\n\t\tdecode(encoded: Encoded.MarkEffect, context: ChangeEncodingContext): MarkEffect {\n\t\t\treturn decoderLibrary.dispatch(encoded, context);\n\t\t},\n\t};\n\n\tfunction decodeRevision(\n\t\tencodedRevision: EncodedRevisionTag | undefined,\n\t\tcontext: ChangeEncodingContext,\n\t): RevisionTag {\n\t\tif (encodedRevision === undefined) {\n\t\t\tassert(context.revision !== undefined, 0x965 /* Implicit revision should be provided */);\n\t\t\treturn context.revision;\n\t\t}\n\n\t\treturn revisionTagCodec.decode(encodedRevision, context);\n\t}\n\n\tconst decoderLibrary = new DiscriminatedUnionDispatcher<\n\t\tEncoded.MarkEffect,\n\t\t/* args */ [context: ChangeEncodingContext],\n\t\tMarkEffect\n\t>({\n\t\tmoveIn(encoded: Encoded.MoveIn, context: ChangeEncodingContext): MoveIn {\n\t\t\tconst { id, finalEndpoint, revision } = encoded;\n\t\t\tconst mark: MoveIn = {\n\t\t\t\ttype: \"MoveIn\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (finalEndpoint !== undefined) {\n\t\t\t\tmark.finalEndpoint = changeAtomIdCodec.decode(finalEndpoint, context);\n\t\t\t}\n\t\t\treturn mark;\n\t\t},\n\t\tinsert(encoded: Encoded.Insert, context: ChangeEncodingContext): Insert {\n\t\t\tconst { id, revision } = encoded;\n\t\t\tconst mark: Insert = {\n\t\t\t\ttype: \"Insert\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\treturn mark;\n\t\t},\n\t\tdelete(encoded: Encoded.Remove, context: ChangeEncodingContext): Remove {\n\t\t\tconst { id, revision, idOverride } = encoded;\n\t\t\tconst mark: Mutable<Remove> = {\n\t\t\t\ttype: \"Remove\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (idOverride !== undefined) {\n\t\t\t\tmark.idOverride = cellIdCodec.decode(idOverride.id, context);\n\t\t\t}\n\t\t\treturn mark;\n\t\t},\n\t\tmoveOut(encoded: Encoded.MoveOut, context: ChangeEncodingContext): MoveOut {\n\t\t\tconst { id, finalEndpoint, idOverride, revision } = encoded;\n\t\t\tconst mark: Mutable<MoveOut> = {\n\t\t\t\ttype: \"MoveOut\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (finalEndpoint !== undefined) {\n\t\t\t\tmark.finalEndpoint = changeAtomIdCodec.decode(finalEndpoint, context);\n\t\t\t}\n\t\t\tif (idOverride !== undefined) {\n\t\t\t\tmark.idOverride = cellIdCodec.decode(idOverride.id, context);\n\t\t\t}\n\n\t\t\treturn mark;\n\t\t},\n\t\tattachAndDetach(\n\t\t\tencoded: Encoded.AttachAndDetach,\n\t\t\tcontext: ChangeEncodingContext,\n\t\t): AttachAndDetach | Rename {\n\t\t\tconst attach = decoderLibrary.dispatch(encoded.attach, context) as Attach;\n\t\t\tconst detach = decoderLibrary.dispatch(encoded.detach, context) as Detach;\n\t\t\t// In documents generated by clients on release >=2.2 (i.e., running the code from the PR that added this comment),\n\t\t\t// renames are encoded as AttachAndDetach with a special id.\n\t\t\t// This ensures forward-compatibility of clients on release <=2.1 with documents/ops generated by clients on release >=2.2.\n\t\t\tif (attach.id === renameLocalId) {\n\t\t\t\tassert(detach.idOverride !== undefined, 0x9f7 /* Rename must have idOverride */);\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"Rename\",\n\t\t\t\t\tidOverride: detach.idOverride,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttype: \"AttachAndDetach\",\n\t\t\t\tattach,\n\t\t\t\tdetach,\n\t\t\t};\n\t\t},\n\t});\n\n\tconst cellIdCodec: IJsonCodec<\n\t\tCellId,\n\t\tEncoded.CellId,\n\t\tEncoded.CellId,\n\t\tChangeEncodingContext\n\t> = {\n\t\tencode: (cellId: CellId, context: ChangeEncodingContext): Encoded.CellId => {\n\t\t\tconst encoded: Encoded.CellId = {\n\t\t\t\tatom: changeAtomIdCodec.encode(cellId, context),\n\t\t\t};\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: ({ atom }: Encoded.CellId, context: ChangeEncodingContext): CellId => {\n\t\t\treturn changeAtomIdCodec.decode(atom, context);\n\t\t},\n\t};\n\n\t/**\n\t * If we want to make the node change aspect of this codec more type-safe, we could adjust generics\n\t * to be in terms of the schema rather than the concrete type of the node change.\n\t */\n\ttype NodeChangeSchema = TAnySchema;\n\n\treturn {\n\t\tencode: (\n\t\t\tchangeset: Changeset,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): JsonCompatibleReadOnly & Encoded.Changeset<NodeChangeSchema> => {\n\t\t\tconst jsonMarks: Encoded.Changeset<NodeChangeSchema> = [];\n\t\t\tfor (const mark of changeset) {\n\t\t\t\tconst encodedMark: Encoded.Mark<NodeChangeSchema> = {\n\t\t\t\t\tcount: mark.count,\n\t\t\t\t};\n\t\t\t\tif (!isNoopMark(mark)) {\n\t\t\t\t\tencodedMark.effect = markEffectCodec.encode(mark, context.baseContext);\n\t\t\t\t}\n\t\t\t\tif (mark.cellId !== undefined) {\n\t\t\t\t\tencodedMark.cellId = cellIdCodec.encode(mark.cellId, context.baseContext);\n\t\t\t\t}\n\t\t\t\tif (mark.changes !== undefined) {\n\t\t\t\t\tencodedMark.changes = context.encodeNode(mark.changes);\n\t\t\t\t}\n\t\t\t\tjsonMarks.push(encodedMark);\n\t\t\t}\n\t\t\treturn jsonMarks;\n\t\t},\n\t\tdecode: (\n\t\t\tchangeset: Encoded.Changeset<NodeChangeSchema>,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): Changeset => {\n\t\t\tconst marks: Changeset = [];\n\t\t\tfor (const mark of changeset) {\n\t\t\t\tconst decodedMark: Mark = {\n\t\t\t\t\tcount: mark.count,\n\t\t\t\t};\n\n\t\t\t\tif (mark.effect !== undefined) {\n\t\t\t\t\tObject.assign(decodedMark, markEffectCodec.decode(mark.effect, context.baseContext));\n\t\t\t\t}\n\t\t\t\tif (mark.cellId !== undefined) {\n\t\t\t\t\tdecodedMark.cellId = cellIdCodec.decode(mark.cellId, context.baseContext);\n\t\t\t\t}\n\t\t\t\t// Type deduction wrongly narrows the type of `decodedMark` to `NoopMark & HasMarkFields`.\n\t\t\t\t// We declare a new casted copy of `decodedMark` to recover the correct type.\n\t\t\t\tlet decodedMark2 = decodedMark as Mark;\n\t\t\t\tif (decodedMark2.cellId !== undefined && decodedMark2.type === \"AttachAndDetach\") {\n\t\t\t\t\t// In documents generated by clients on release <=2.1 (i.e., not running the code from the PR that added this comment),\n\t\t\t\t\t// rename-like AttachAndDetach marks are not normalized to Rename marks thus requiring this normalization step.\n\t\t\t\t\t// This ensures backward compatibility with documents generated by clients on release <=2.1.\n\t\t\t\t\tdecodedMark2 = normalizeCellRename(\n\t\t\t\t\t\tdecodedMark2.cellId,\n\t\t\t\t\t\tdecodedMark2.count,\n\t\t\t\t\t\tdecodedMark2.attach,\n\t\t\t\t\t\tdecodedMark2.detach,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (mark.changes !== undefined) {\n\t\t\t\t\tdecodedMark2.changes = context.decodeNode(mark.changes);\n\t\t\t\t}\n\t\t\t\tmarks.push(decodedMark2);\n\t\t\t}\n\t\t\treturn marks;\n\t\t},\n\t\tencodedSchema: ChangesetSchema(EncodedNodeChangeset),\n\t};\n}\n\n/**\n * Arbitrary ID that is used to indicate a Rename effect.\n */\nconst renameLocalId: ChangesetLocalId = brand(-1);\n"]}
@@ -5,10 +5,10 @@
5
5
  import { type IJsonCodec } from "../../codec/index.js";
6
6
  import type { ChangeEncodingContext, EncodedRevisionTag, RevisionTag } from "../../core/index.js";
7
7
  import { type JsonCompatibleReadOnly } from "../../util/index.js";
8
- import { type Encoded } from "./formatV2.js";
9
- import { type Changeset, type MarkEffect } from "./types.js";
10
8
  import type { FieldChangeEncodingContext } from "../index.js";
9
+ import { type Encoded } from "./formatV2.js";
11
10
  import type { SequenceCodecHelpers } from "./helperTypes.js";
11
+ import { type Changeset, type MarkEffect } from "./types.js";
12
12
  export declare function makeV2CodecHelpers(revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>): SequenceCodecHelpers<MarkEffect, Encoded.MarkEffect>;
13
13
  export declare function makeV2Codec(revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>): IJsonCodec<Changeset, JsonCompatibleReadOnly, JsonCompatibleReadOnly, FieldChangeEncodingContext>;
14
14
  //# sourceMappingURL=sequenceFieldCodecV2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sequenceFieldCodecV2.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAGN,KAAK,UAAU,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACX,qBAAqB,EAErB,kBAAkB,EAClB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,sBAAsB,EAAuB,MAAM,qBAAqB,CAAC;AAGvF,OAAO,EAAgC,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAGN,KAAK,SAAS,EAId,KAAK,UAAU,EAMf,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAE9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,wBAAgB,kBAAkB,CACjC,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,GACC,oBAAoB,CAAC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,CAyMtD;AAED,wBAAgB,WAAW,CAC1B,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,GACC,UAAU,CACZ,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,CAC1B,CAsEA"}
1
+ {"version":3,"file":"sequenceFieldCodecV2.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAGN,KAAK,UAAU,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACX,qBAAqB,EAErB,kBAAkB,EAClB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,sBAAsB,EAAuB,MAAM,qBAAqB,CAAC;AAEvF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAG9D,OAAO,EAAgC,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAGN,KAAK,SAAS,EAId,KAAK,UAAU,EAMf,MAAM,YAAY,CAAC;AAGpB,wBAAgB,kBAAkB,CACjC,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,GACC,oBAAoB,CAAC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,CAyMtD;AAED,wBAAgB,WAAW,CAC1B,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,GACC,UAAU,CACZ,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,CAC1B,CAsEA"}
@@ -9,10 +9,10 @@ const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const index_js_1 = require("../../codec/index.js");
10
10
  const index_js_2 = require("../../util/index.js");
11
11
  const changeAtomIdCodec_js_1 = require("../changeAtomIdCodec.js");
12
+ const index_js_3 = require("../modular-schema/index.js");
12
13
  const formatV2_js_1 = require("./formatV2.js");
13
14
  const types_js_1 = require("./types.js");
14
15
  const utils_js_1 = require("./utils.js");
15
- const index_js_3 = require("../modular-schema/index.js");
16
16
  function makeV2CodecHelpers(revisionTagCodec) {
17
17
  const changeAtomIdCodec = (0, changeAtomIdCodec_js_1.makeChangeAtomIdCodec)(revisionTagCodec);
18
18
  const markEffectCodec = {
@@ -1 +1 @@
1
- {"version":3,"file":"sequenceFieldCodecV2.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAGpF,mDAI8B;AAO9B,kDAAuF;AACvF,kEAAgE;AAEhE,+CAA2E;AAC3E,yCAaoB;AACpB,yCAA6D;AAE7D,yDAAkE;AAGlE,SAAgB,kBAAkB,CACjC,gBAKC;IAED,MAAM,iBAAiB,GAAG,IAAA,4CAAqB,EAAC,gBAAgB,CAAC,CAAC;IAClE,MAAM,eAAe,GAKjB;QACH,MAAM,CAAC,MAAkB,EAAE,OAA8B;YACxD,SAAS,cAAc,CACtB,QAAiC;gBAEjC,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,OAAO,CAAC,QAAQ,EAAE,CAAC;oBAC7D,OAAO,SAAS,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KACpD,CAAC;AACH,CAAC;AAlFD,kCAkFC;AAED;;GAEG;AACH,MAAM,aAAa,GAAqB,IAAA,gBAAK,EAAC,CAAC,CAAC,CAAC,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\";\nimport type { TAnySchema } from \"@sinclair/typebox\";\n\nimport {\n\tDiscriminatedUnionDispatcher,\n\ttype DiscriminatedUnionLibrary,\n\ttype IJsonCodec,\n} from \"../../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tChangesetLocalId,\n\tEncodedRevisionTag,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport { type JsonCompatibleReadOnly, type Mutable, brand } from \"../../util/index.js\";\nimport { makeChangeAtomIdCodec } from \"../changeAtomIdCodec.js\";\n\nimport { Changeset as ChangesetSchema, type Encoded } from \"./formatV2.js\";\nimport {\n\ttype Attach,\n\ttype AttachAndDetach,\n\ttype Changeset,\n\ttype Detach,\n\ttype Insert,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype MoveIn,\n\ttype MoveOut,\n\tNoopMarkType,\n\ttype Remove,\n\ttype Rename,\n} from \"./types.js\";\nimport { isNoopMark, normalizeCellRename } from \"./utils.js\";\nimport type { FieldChangeEncodingContext } from \"../index.js\";\nimport { EncodedNodeChangeset } from \"../modular-schema/index.js\";\nimport type { SequenceCodecHelpers } from \"./helperTypes.js\";\n\nexport function makeV2CodecHelpers(\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): SequenceCodecHelpers<MarkEffect, Encoded.MarkEffect> {\n\tconst changeAtomIdCodec = makeChangeAtomIdCodec(revisionTagCodec);\n\tconst markEffectCodec: IJsonCodec<\n\t\tMarkEffect,\n\t\tEncoded.MarkEffect,\n\t\tEncoded.MarkEffect,\n\t\tChangeEncodingContext\n\t> = {\n\t\tencode(effect: MarkEffect, context: ChangeEncodingContext): Encoded.MarkEffect {\n\t\t\tfunction encodeRevision(\n\t\t\t\trevision: RevisionTag | undefined,\n\t\t\t): EncodedRevisionTag | undefined {\n\t\t\t\tif (revision === undefined || revision === context.revision) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn revisionTagCodec.encode(revision, context);\n\t\t\t}\n\n\t\t\tconst type = effect.type;\n\t\t\tswitch (type) {\n\t\t\t\tcase \"MoveIn\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmoveIn: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tfinalEndpoint:\n\t\t\t\t\t\t\t\teffect.finalEndpoint === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.finalEndpoint, context),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Insert\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tinsert: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Remove\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tremove: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tidOverride:\n\t\t\t\t\t\t\t\teffect.idOverride === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.idOverride, context),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"MoveOut\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmoveOut: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tfinalEndpoint:\n\t\t\t\t\t\t\t\teffect.finalEndpoint === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.finalEndpoint, context),\n\t\t\t\t\t\t\tidOverride:\n\t\t\t\t\t\t\t\teffect.idOverride === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.idOverride, context),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"AttachAndDetach\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tattachAndDetach: {\n\t\t\t\t\t\t\tattach: markEffectCodec.encode(effect.attach, context) as Encoded.Attach,\n\t\t\t\t\t\t\tdetach: markEffectCodec.encode(effect.detach, context) as Encoded.Detach,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Rename\":\n\t\t\t\t\t// In documents generated by clients on release >=2.2 (i.e., running the code from the PR that added this comment),\n\t\t\t\t\t// renames are encoded as AttachAndDetach with a special id.\n\t\t\t\t\t// This ensures forward-compatibility of clients on release <=2.1 with documents/ops generated by clients on release >=2.2.\n\t\t\t\t\treturn markEffectCodec.encode(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: \"AttachAndDetach\",\n\t\t\t\t\t\t\tattach: { type: \"MoveIn\", id: renameLocalId },\n\t\t\t\t\t\t\tdetach: { type: \"MoveOut\", id: renameLocalId, idOverride: effect.idOverride },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t);\n\t\t\t\tcase NoopMarkType:\n\t\t\t\t\tfail(0xb2c /* Mark type: NoopMarkType should not be encoded. */);\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(type);\n\t\t\t}\n\t\t},\n\t\tdecode(encoded: Encoded.MarkEffect, context: ChangeEncodingContext): MarkEffect {\n\t\t\treturn decoderDispatcher.dispatch(encoded, context);\n\t\t},\n\t};\n\n\tfunction decodeRevision(\n\t\tencodedRevision: EncodedRevisionTag | undefined,\n\t\tcontext: ChangeEncodingContext,\n\t): RevisionTag {\n\t\tif (encodedRevision === undefined) {\n\t\t\tassert(context.revision !== undefined, 0x996 /* Implicit revision should be provided */);\n\t\t\treturn context.revision;\n\t\t}\n\n\t\treturn revisionTagCodec.decode(encodedRevision, context);\n\t}\n\n\tconst decoderLibrary: DiscriminatedUnionLibrary<\n\t\tEncoded.MarkEffect,\n\t\t/* args */ [context: ChangeEncodingContext],\n\t\tMarkEffect\n\t> = {\n\t\tmoveIn(encoded: Encoded.MoveIn, context: ChangeEncodingContext): MoveIn {\n\t\t\tconst { id, finalEndpoint, revision } = encoded;\n\t\t\tconst mark: MoveIn = {\n\t\t\t\ttype: \"MoveIn\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (finalEndpoint !== undefined) {\n\t\t\t\tmark.finalEndpoint = changeAtomIdCodec.decode(finalEndpoint, context);\n\t\t\t}\n\t\t\treturn mark;\n\t\t},\n\t\tinsert(encoded: Encoded.Insert, context: ChangeEncodingContext): Insert {\n\t\t\tconst { id, revision } = encoded;\n\t\t\tconst mark: Insert = {\n\t\t\t\ttype: \"Insert\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\treturn mark;\n\t\t},\n\t\tremove(encoded: Encoded.Remove, context: ChangeEncodingContext): Remove {\n\t\t\tconst { id, revision, idOverride } = encoded;\n\t\t\tconst mark: Mutable<Remove> = {\n\t\t\t\ttype: \"Remove\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (idOverride !== undefined) {\n\t\t\t\tmark.idOverride = changeAtomIdCodec.decode(idOverride, context);\n\t\t\t}\n\t\t\treturn mark;\n\t\t},\n\t\tmoveOut(encoded: Encoded.MoveOut, context: ChangeEncodingContext): MoveOut {\n\t\t\tconst { id, finalEndpoint, idOverride, revision } = encoded;\n\t\t\tconst mark: Mutable<MoveOut> = {\n\t\t\t\ttype: \"MoveOut\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (finalEndpoint !== undefined) {\n\t\t\t\tmark.finalEndpoint = changeAtomIdCodec.decode(finalEndpoint, context);\n\t\t\t}\n\t\t\tif (idOverride !== undefined) {\n\t\t\t\tmark.idOverride = changeAtomIdCodec.decode(idOverride, context);\n\t\t\t}\n\n\t\t\treturn mark;\n\t\t},\n\t\tattachAndDetach(\n\t\t\tencoded: Encoded.AttachAndDetach,\n\t\t\tcontext: ChangeEncodingContext,\n\t\t): AttachAndDetach | Rename {\n\t\t\tconst attach = decoderDispatcher.dispatch(encoded.attach, context) as Attach;\n\t\t\tconst detach = decoderDispatcher.dispatch(encoded.detach, context) as Detach;\n\t\t\t// In documents generated by clients on release >=2.2 (i.e., running the code from the PR that added this comment),\n\t\t\t// renames are encoded as AttachAndDetach with a special id.\n\t\t\t// This ensures forward-compatibility of clients on release <=2.1 with documents/ops generated by clients on release >=2.2.\n\t\t\tif (attach.id === renameLocalId) {\n\t\t\t\tassert(detach.idOverride !== undefined, 0x9f8 /* Rename must have idOverride */);\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"Rename\",\n\t\t\t\t\tidOverride: detach.idOverride,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttype: \"AttachAndDetach\",\n\t\t\t\tattach,\n\t\t\t\tdetach,\n\t\t\t};\n\t\t},\n\t};\n\n\tconst decoderDispatcher = new DiscriminatedUnionDispatcher<\n\t\tEncoded.MarkEffect,\n\t\t/* args */ [context: ChangeEncodingContext],\n\t\tMarkEffect\n\t>(decoderLibrary);\n\n\treturn {\n\t\tchangeAtomIdCodec,\n\t\tmarkEffectCodec,\n\t\tdecoderLibrary,\n\t\tdecodeRevision,\n\t};\n}\n\nexport function makeV2Codec(\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): IJsonCodec<\n\tChangeset,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tFieldChangeEncodingContext\n> {\n\tconst { markEffectCodec, changeAtomIdCodec } = makeV2CodecHelpers(revisionTagCodec);\n\t/**\n\t * If we want to make the node change aspect of this codec more type-safe, we could adjust generics\n\t * to be in terms of the schema rather than the concrete type of the node change.\n\t */\n\ttype NodeChangeSchema = TAnySchema;\n\n\treturn {\n\t\tencode: (\n\t\t\tchangeset: Changeset,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): JsonCompatibleReadOnly & Encoded.Changeset<NodeChangeSchema> => {\n\t\t\tconst jsonMarks: Encoded.Changeset<NodeChangeSchema> = [];\n\t\t\tfor (const mark of changeset) {\n\t\t\t\tconst encodedMark: Encoded.Mark<NodeChangeSchema> = {\n\t\t\t\t\tcount: mark.count,\n\t\t\t\t};\n\t\t\t\tif (!isNoopMark(mark)) {\n\t\t\t\t\tencodedMark.effect = markEffectCodec.encode(mark, context.baseContext);\n\t\t\t\t}\n\t\t\t\tif (mark.cellId !== undefined) {\n\t\t\t\t\tencodedMark.cellId = changeAtomIdCodec.encode(mark.cellId, context.baseContext);\n\t\t\t\t}\n\t\t\t\tif (mark.changes !== undefined) {\n\t\t\t\t\tencodedMark.changes = context.encodeNode(mark.changes);\n\t\t\t\t}\n\t\t\t\tjsonMarks.push(encodedMark);\n\t\t\t}\n\t\t\treturn jsonMarks;\n\t\t},\n\t\tdecode: (\n\t\t\tchangeset: Encoded.Changeset<NodeChangeSchema>,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): Changeset => {\n\t\t\tconst marks: Changeset = [];\n\t\t\tfor (const mark of changeset) {\n\t\t\t\tconst decodedMark: Mark = {\n\t\t\t\t\tcount: mark.count,\n\t\t\t\t};\n\n\t\t\t\tif (mark.effect !== undefined) {\n\t\t\t\t\tObject.assign(decodedMark, markEffectCodec.decode(mark.effect, context.baseContext));\n\t\t\t\t}\n\t\t\t\tif (mark.cellId !== undefined) {\n\t\t\t\t\tdecodedMark.cellId = changeAtomIdCodec.decode(mark.cellId, context.baseContext);\n\t\t\t\t}\n\t\t\t\t// Type deduction wrongly narrows the type of `decodedMark` to `NoopMark & HasMarkFields`.\n\t\t\t\t// We declare a new casted copy of `decodedMark` to recover the correct type.\n\t\t\t\tlet decodedMark2 = decodedMark as Mark;\n\t\t\t\tif (decodedMark2.cellId !== undefined && decodedMark2.type === \"AttachAndDetach\") {\n\t\t\t\t\t// In documents generated by clients on release <=2.1 (i.e., not running the code from the PR that added this comment),\n\t\t\t\t\t// rename-like AttachAndDetach marks are not normalized to Rename marks thus requiring this normalization step.\n\t\t\t\t\t// This ensures backward compatibility with documents generated by clients on release <=2.1.\n\t\t\t\t\tdecodedMark2 = normalizeCellRename(\n\t\t\t\t\t\tdecodedMark2.cellId,\n\t\t\t\t\t\tdecodedMark2.count,\n\t\t\t\t\t\tdecodedMark2.attach,\n\t\t\t\t\t\tdecodedMark2.detach,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (mark.changes !== undefined) {\n\t\t\t\t\tdecodedMark2.changes = context.decodeNode(mark.changes);\n\t\t\t\t}\n\t\t\t\tmarks.push(decodedMark2);\n\t\t\t}\n\t\t\treturn marks;\n\t\t},\n\t\tencodedSchema: ChangesetSchema(EncodedNodeChangeset),\n\t};\n}\n\n/**\n * Arbitrary ID that is used to indicate a Rename effect.\n */\nconst renameLocalId: ChangesetLocalId = brand(-1);\n"]}
1
+ {"version":3,"file":"sequenceFieldCodecV2.js","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAGpF,mDAI8B;AAO9B,kDAAuF;AACvF,kEAAgE;AAEhE,yDAAkE;AAElE,+CAA2E;AAE3E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M,CACnB,CAAC;gBACH,CAAC;gBACD,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;oBAChC,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACzD,CAAC;gBACD,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAC1B,CAAC;YACD,OAAO,KAAK,CAAC;QACd,CAAC;QACD,aAAa,EAAE,IAAA,uBAAe,EAAC,+BAAoB,CAAC;KACpD,CAAC;AACH,CAAC;AAlFD,kCAkFC;AAED;;GAEG;AACH,MAAM,aAAa,GAAqB,IAAA,gBAAK,EAAC,CAAC,CAAC,CAAC,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\";\nimport type { TAnySchema } from \"@sinclair/typebox\";\n\nimport {\n\tDiscriminatedUnionDispatcher,\n\ttype DiscriminatedUnionLibrary,\n\ttype IJsonCodec,\n} from \"../../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tChangesetLocalId,\n\tEncodedRevisionTag,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport { type JsonCompatibleReadOnly, type Mutable, brand } from \"../../util/index.js\";\nimport { makeChangeAtomIdCodec } from \"../changeAtomIdCodec.js\";\nimport type { FieldChangeEncodingContext } from \"../index.js\";\nimport { EncodedNodeChangeset } from \"../modular-schema/index.js\";\n\nimport { Changeset as ChangesetSchema, type Encoded } from \"./formatV2.js\";\nimport type { SequenceCodecHelpers } from \"./helperTypes.js\";\nimport {\n\ttype Attach,\n\ttype AttachAndDetach,\n\ttype Changeset,\n\ttype Detach,\n\ttype Insert,\n\ttype Mark,\n\ttype MarkEffect,\n\ttype MoveIn,\n\ttype MoveOut,\n\tNoopMarkType,\n\ttype Remove,\n\ttype Rename,\n} from \"./types.js\";\nimport { isNoopMark, normalizeCellRename } from \"./utils.js\";\n\nexport function makeV2CodecHelpers(\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): SequenceCodecHelpers<MarkEffect, Encoded.MarkEffect> {\n\tconst changeAtomIdCodec = makeChangeAtomIdCodec(revisionTagCodec);\n\tconst markEffectCodec: IJsonCodec<\n\t\tMarkEffect,\n\t\tEncoded.MarkEffect,\n\t\tEncoded.MarkEffect,\n\t\tChangeEncodingContext\n\t> = {\n\t\tencode(effect: MarkEffect, context: ChangeEncodingContext): Encoded.MarkEffect {\n\t\t\tfunction encodeRevision(\n\t\t\t\trevision: RevisionTag | undefined,\n\t\t\t): EncodedRevisionTag | undefined {\n\t\t\t\tif (revision === undefined || revision === context.revision) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn revisionTagCodec.encode(revision, context);\n\t\t\t}\n\n\t\t\tconst type = effect.type;\n\t\t\tswitch (type) {\n\t\t\t\tcase \"MoveIn\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmoveIn: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tfinalEndpoint:\n\t\t\t\t\t\t\t\teffect.finalEndpoint === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.finalEndpoint, context),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Insert\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tinsert: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Remove\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tremove: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tidOverride:\n\t\t\t\t\t\t\t\teffect.idOverride === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.idOverride, context),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"MoveOut\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmoveOut: {\n\t\t\t\t\t\t\trevision: encodeRevision(effect.revision),\n\t\t\t\t\t\t\tfinalEndpoint:\n\t\t\t\t\t\t\t\teffect.finalEndpoint === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.finalEndpoint, context),\n\t\t\t\t\t\t\tidOverride:\n\t\t\t\t\t\t\t\teffect.idOverride === undefined\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: changeAtomIdCodec.encode(effect.idOverride, context),\n\t\t\t\t\t\t\tid: effect.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"AttachAndDetach\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tattachAndDetach: {\n\t\t\t\t\t\t\tattach: markEffectCodec.encode(effect.attach, context) as Encoded.Attach,\n\t\t\t\t\t\t\tdetach: markEffectCodec.encode(effect.detach, context) as Encoded.Detach,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\tcase \"Rename\":\n\t\t\t\t\t// In documents generated by clients on release >=2.2 (i.e., running the code from the PR that added this comment),\n\t\t\t\t\t// renames are encoded as AttachAndDetach with a special id.\n\t\t\t\t\t// This ensures forward-compatibility of clients on release <=2.1 with documents/ops generated by clients on release >=2.2.\n\t\t\t\t\treturn markEffectCodec.encode(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: \"AttachAndDetach\",\n\t\t\t\t\t\t\tattach: { type: \"MoveIn\", id: renameLocalId },\n\t\t\t\t\t\t\tdetach: { type: \"MoveOut\", id: renameLocalId, idOverride: effect.idOverride },\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t);\n\t\t\t\tcase NoopMarkType:\n\t\t\t\t\tfail(0xb2c /* Mark type: NoopMarkType should not be encoded. */);\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(type);\n\t\t\t}\n\t\t},\n\t\tdecode(encoded: Encoded.MarkEffect, context: ChangeEncodingContext): MarkEffect {\n\t\t\treturn decoderDispatcher.dispatch(encoded, context);\n\t\t},\n\t};\n\n\tfunction decodeRevision(\n\t\tencodedRevision: EncodedRevisionTag | undefined,\n\t\tcontext: ChangeEncodingContext,\n\t): RevisionTag {\n\t\tif (encodedRevision === undefined) {\n\t\t\tassert(context.revision !== undefined, 0x996 /* Implicit revision should be provided */);\n\t\t\treturn context.revision;\n\t\t}\n\n\t\treturn revisionTagCodec.decode(encodedRevision, context);\n\t}\n\n\tconst decoderLibrary: DiscriminatedUnionLibrary<\n\t\tEncoded.MarkEffect,\n\t\t/* args */ [context: ChangeEncodingContext],\n\t\tMarkEffect\n\t> = {\n\t\tmoveIn(encoded: Encoded.MoveIn, context: ChangeEncodingContext): MoveIn {\n\t\t\tconst { id, finalEndpoint, revision } = encoded;\n\t\t\tconst mark: MoveIn = {\n\t\t\t\ttype: \"MoveIn\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (finalEndpoint !== undefined) {\n\t\t\t\tmark.finalEndpoint = changeAtomIdCodec.decode(finalEndpoint, context);\n\t\t\t}\n\t\t\treturn mark;\n\t\t},\n\t\tinsert(encoded: Encoded.Insert, context: ChangeEncodingContext): Insert {\n\t\t\tconst { id, revision } = encoded;\n\t\t\tconst mark: Insert = {\n\t\t\t\ttype: \"Insert\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\treturn mark;\n\t\t},\n\t\tremove(encoded: Encoded.Remove, context: ChangeEncodingContext): Remove {\n\t\t\tconst { id, revision, idOverride } = encoded;\n\t\t\tconst mark: Mutable<Remove> = {\n\t\t\t\ttype: \"Remove\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (idOverride !== undefined) {\n\t\t\t\tmark.idOverride = changeAtomIdCodec.decode(idOverride, context);\n\t\t\t}\n\t\t\treturn mark;\n\t\t},\n\t\tmoveOut(encoded: Encoded.MoveOut, context: ChangeEncodingContext): MoveOut {\n\t\t\tconst { id, finalEndpoint, idOverride, revision } = encoded;\n\t\t\tconst mark: Mutable<MoveOut> = {\n\t\t\t\ttype: \"MoveOut\",\n\t\t\t\tid,\n\t\t\t};\n\n\t\t\tmark.revision = decodeRevision(revision, context);\n\t\t\tif (finalEndpoint !== undefined) {\n\t\t\t\tmark.finalEndpoint = changeAtomIdCodec.decode(finalEndpoint, context);\n\t\t\t}\n\t\t\tif (idOverride !== undefined) {\n\t\t\t\tmark.idOverride = changeAtomIdCodec.decode(idOverride, context);\n\t\t\t}\n\n\t\t\treturn mark;\n\t\t},\n\t\tattachAndDetach(\n\t\t\tencoded: Encoded.AttachAndDetach,\n\t\t\tcontext: ChangeEncodingContext,\n\t\t): AttachAndDetach | Rename {\n\t\t\tconst attach = decoderDispatcher.dispatch(encoded.attach, context) as Attach;\n\t\t\tconst detach = decoderDispatcher.dispatch(encoded.detach, context) as Detach;\n\t\t\t// In documents generated by clients on release >=2.2 (i.e., running the code from the PR that added this comment),\n\t\t\t// renames are encoded as AttachAndDetach with a special id.\n\t\t\t// This ensures forward-compatibility of clients on release <=2.1 with documents/ops generated by clients on release >=2.2.\n\t\t\tif (attach.id === renameLocalId) {\n\t\t\t\tassert(detach.idOverride !== undefined, 0x9f8 /* Rename must have idOverride */);\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"Rename\",\n\t\t\t\t\tidOverride: detach.idOverride,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttype: \"AttachAndDetach\",\n\t\t\t\tattach,\n\t\t\t\tdetach,\n\t\t\t};\n\t\t},\n\t};\n\n\tconst decoderDispatcher = new DiscriminatedUnionDispatcher<\n\t\tEncoded.MarkEffect,\n\t\t/* args */ [context: ChangeEncodingContext],\n\t\tMarkEffect\n\t>(decoderLibrary);\n\n\treturn {\n\t\tchangeAtomIdCodec,\n\t\tmarkEffectCodec,\n\t\tdecoderLibrary,\n\t\tdecodeRevision,\n\t};\n}\n\nexport function makeV2Codec(\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): IJsonCodec<\n\tChangeset,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tFieldChangeEncodingContext\n> {\n\tconst { markEffectCodec, changeAtomIdCodec } = makeV2CodecHelpers(revisionTagCodec);\n\t/**\n\t * If we want to make the node change aspect of this codec more type-safe, we could adjust generics\n\t * to be in terms of the schema rather than the concrete type of the node change.\n\t */\n\ttype NodeChangeSchema = TAnySchema;\n\n\treturn {\n\t\tencode: (\n\t\t\tchangeset: Changeset,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): JsonCompatibleReadOnly & Encoded.Changeset<NodeChangeSchema> => {\n\t\t\tconst jsonMarks: Encoded.Changeset<NodeChangeSchema> = [];\n\t\t\tfor (const mark of changeset) {\n\t\t\t\tconst encodedMark: Encoded.Mark<NodeChangeSchema> = {\n\t\t\t\t\tcount: mark.count,\n\t\t\t\t};\n\t\t\t\tif (!isNoopMark(mark)) {\n\t\t\t\t\tencodedMark.effect = markEffectCodec.encode(mark, context.baseContext);\n\t\t\t\t}\n\t\t\t\tif (mark.cellId !== undefined) {\n\t\t\t\t\tencodedMark.cellId = changeAtomIdCodec.encode(mark.cellId, context.baseContext);\n\t\t\t\t}\n\t\t\t\tif (mark.changes !== undefined) {\n\t\t\t\t\tencodedMark.changes = context.encodeNode(mark.changes);\n\t\t\t\t}\n\t\t\t\tjsonMarks.push(encodedMark);\n\t\t\t}\n\t\t\treturn jsonMarks;\n\t\t},\n\t\tdecode: (\n\t\t\tchangeset: Encoded.Changeset<NodeChangeSchema>,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t): Changeset => {\n\t\t\tconst marks: Changeset = [];\n\t\t\tfor (const mark of changeset) {\n\t\t\t\tconst decodedMark: Mark = {\n\t\t\t\t\tcount: mark.count,\n\t\t\t\t};\n\n\t\t\t\tif (mark.effect !== undefined) {\n\t\t\t\t\tObject.assign(decodedMark, markEffectCodec.decode(mark.effect, context.baseContext));\n\t\t\t\t}\n\t\t\t\tif (mark.cellId !== undefined) {\n\t\t\t\t\tdecodedMark.cellId = changeAtomIdCodec.decode(mark.cellId, context.baseContext);\n\t\t\t\t}\n\t\t\t\t// Type deduction wrongly narrows the type of `decodedMark` to `NoopMark & HasMarkFields`.\n\t\t\t\t// We declare a new casted copy of `decodedMark` to recover the correct type.\n\t\t\t\tlet decodedMark2 = decodedMark as Mark;\n\t\t\t\tif (decodedMark2.cellId !== undefined && decodedMark2.type === \"AttachAndDetach\") {\n\t\t\t\t\t// In documents generated by clients on release <=2.1 (i.e., not running the code from the PR that added this comment),\n\t\t\t\t\t// rename-like AttachAndDetach marks are not normalized to Rename marks thus requiring this normalization step.\n\t\t\t\t\t// This ensures backward compatibility with documents generated by clients on release <=2.1.\n\t\t\t\t\tdecodedMark2 = normalizeCellRename(\n\t\t\t\t\t\tdecodedMark2.cellId,\n\t\t\t\t\t\tdecodedMark2.count,\n\t\t\t\t\t\tdecodedMark2.attach,\n\t\t\t\t\t\tdecodedMark2.detach,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (mark.changes !== undefined) {\n\t\t\t\t\tdecodedMark2.changes = context.decodeNode(mark.changes);\n\t\t\t\t}\n\t\t\t\tmarks.push(decodedMark2);\n\t\t\t}\n\t\t\treturn marks;\n\t\t},\n\t\tencodedSchema: ChangesetSchema(EncodedNodeChangeset),\n\t};\n}\n\n/**\n * Arbitrary ID that is used to indicate a Rename effect.\n */\nconst renameLocalId: ChangesetLocalId = brand(-1);\n"]}
@@ -5,7 +5,7 @@
5
5
  import { type IJsonCodec } from "../../codec/index.js";
6
6
  import type { ChangeEncodingContext, EncodedRevisionTag, RevisionTag } from "../../core/index.js";
7
7
  import type { JsonCompatibleReadOnly } from "../../util/index.js";
8
- import type { Changeset } from "./types.js";
9
8
  import type { FieldChangeEncodingContext } from "../index.js";
9
+ import type { Changeset } from "./types.js";
10
10
  export declare function makeV3Codec(revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>): IJsonCodec<Changeset, JsonCompatibleReadOnly, JsonCompatibleReadOnly, FieldChangeEncodingContext>;
11
11
  //# sourceMappingURL=sequenceFieldCodecV3.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sequenceFieldCodecV3.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,KAAK,EACX,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAGlE,OAAO,KAAK,EAAE,SAAS,EAA4B,MAAM,YAAY,CAAC;AAEtE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAI9D,wBAAgB,WAAW,CAC1B,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,GACC,UAAU,CACZ,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,CAC1B,CAmGA"}
1
+ {"version":3,"file":"sequenceFieldCodecV3.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,KAAK,EACX,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAK9D,OAAO,KAAK,EAAE,SAAS,EAA4B,MAAM,YAAY,CAAC;AAGtE,wBAAgB,WAAW,CAC1B,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,GACC,UAAU,CACZ,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,CAC1B,CAmGA"}
@@ -6,10 +6,10 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.makeV3Codec = void 0;
8
8
  const index_js_1 = require("../../codec/index.js");
9
- const formatV3_js_1 = require("./formatV3.js");
10
- const utils_js_1 = require("./utils.js");
11
9
  const index_js_2 = require("../modular-schema/index.js");
10
+ const formatV3_js_1 = require("./formatV3.js");
12
11
  const sequenceFieldCodecV2_js_1 = require("./sequenceFieldCodecV2.js");
12
+ const utils_js_1 = require("./utils.js");
13
13
  function makeV3Codec(revisionTagCodec) {
14
14
  const { changeAtomIdCodec: atomIdCodec, markEffectCodec: markEffectV2Codec, decoderLibrary: decoderLibraryV2, } = (0, sequenceFieldCodecV2_js_1.makeV2CodecHelpers)(revisionTagCodec);
15
15
  const markEffectCodec = {