@fluidframework/tree 2.74.0 → 2.81.0-374083

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 (1318) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/api-report/tree.alpha.api.md +63 -9
  3. package/dist/alpha.d.ts +9 -0
  4. package/dist/codec/codec.d.ts +31 -3
  5. package/dist/codec/codec.d.ts.map +1 -1
  6. package/dist/codec/codec.js +10 -0
  7. package/dist/codec/codec.js.map +1 -1
  8. package/dist/codec/index.d.ts +2 -2
  9. package/dist/codec/index.d.ts.map +1 -1
  10. package/dist/codec/index.js +2 -2
  11. package/dist/codec/index.js.map +1 -1
  12. package/dist/codec/versioned/codec.d.ts +80 -22
  13. package/dist/codec/versioned/codec.d.ts.map +1 -1
  14. package/dist/codec/versioned/codec.js +137 -15
  15. package/dist/codec/versioned/codec.js.map +1 -1
  16. package/dist/codec/versioned/index.d.ts +1 -1
  17. package/dist/codec/versioned/index.d.ts.map +1 -1
  18. package/dist/codec/versioned/index.js +2 -2
  19. package/dist/codec/versioned/index.js.map +1 -1
  20. package/dist/core/change-family/changeFamily.d.ts +4 -1
  21. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  22. package/dist/core/change-family/changeFamily.js.map +1 -1
  23. package/dist/core/change-family/index.d.ts +1 -1
  24. package/dist/core/change-family/index.d.ts.map +1 -1
  25. package/dist/core/change-family/index.js.map +1 -1
  26. package/dist/core/index.d.ts +3 -3
  27. package/dist/core/index.d.ts.map +1 -1
  28. package/dist/core/index.js +7 -6
  29. package/dist/core/index.js.map +1 -1
  30. package/dist/core/rebase/changeRebaser.d.ts +42 -3
  31. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  32. package/dist/core/rebase/changeRebaser.js.map +1 -1
  33. package/dist/core/rebase/index.d.ts +2 -2
  34. package/dist/core/rebase/index.d.ts.map +1 -1
  35. package/dist/core/rebase/index.js +2 -2
  36. package/dist/core/rebase/index.js.map +1 -1
  37. package/dist/core/rebase/types.d.ts +52 -10
  38. package/dist/core/rebase/types.d.ts.map +1 -1
  39. package/dist/core/rebase/types.js +5 -12
  40. package/dist/core/rebase/types.js.map +1 -1
  41. package/dist/core/rebase/utils.d.ts.map +1 -1
  42. package/dist/core/rebase/utils.js +33 -11
  43. package/dist/core/rebase/utils.js.map +1 -1
  44. package/dist/core/schema-stored/schema.js +3 -3
  45. package/dist/core/schema-stored/schema.js.map +1 -1
  46. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  47. package/dist/core/tree/anchorSet.js +4 -4
  48. package/dist/core/tree/anchorSet.js.map +1 -1
  49. package/dist/core/tree/detachedFieldIndex.d.ts +7 -2
  50. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  51. package/dist/core/tree/detachedFieldIndex.js +21 -56
  52. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  53. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +18 -10
  54. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  55. package/dist/core/tree/detachedFieldIndexCodecCommon.js +6 -6
  56. package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  57. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts +2 -3
  58. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  59. package/dist/core/tree/detachedFieldIndexCodecV1.js +4 -5
  60. package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  61. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts +2 -3
  62. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  63. package/dist/core/tree/detachedFieldIndexCodecV2.js +4 -6
  64. package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  65. package/dist/core/tree/detachedFieldIndexCodecs.d.ts +5 -6
  66. package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  67. package/dist/core/tree/detachedFieldIndexCodecs.js +11 -41
  68. package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  69. package/dist/core/tree/index.d.ts +2 -2
  70. package/dist/core/tree/index.d.ts.map +1 -1
  71. package/dist/core/tree/index.js +5 -4
  72. package/dist/core/tree/index.js.map +1 -1
  73. package/dist/core/tree/mapTree.js +1 -1
  74. package/dist/core/tree/mapTree.js.map +1 -1
  75. package/dist/core/tree/pathTree.d.ts +11 -3
  76. package/dist/core/tree/pathTree.d.ts.map +1 -1
  77. package/dist/core/tree/pathTree.js +14 -2
  78. package/dist/core/tree/pathTree.js.map +1 -1
  79. package/dist/core/tree/sparseTree.d.ts.map +1 -1
  80. package/dist/core/tree/sparseTree.js +1 -0
  81. package/dist/core/tree/sparseTree.js.map +1 -1
  82. package/dist/core/tree/treeTextFormat.d.ts.map +1 -1
  83. package/dist/core/tree/treeTextFormat.js +5 -9
  84. package/dist/core/tree/treeTextFormat.js.map +1 -1
  85. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  86. package/dist/core/tree/visitDelta.js +3 -2
  87. package/dist/core/tree/visitDelta.js.map +1 -1
  88. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  89. package/dist/core/tree/visitorUtils.js +58 -18
  90. package/dist/core/tree/visitorUtils.js.map +1 -1
  91. package/dist/feature-libraries/changeAtomIdBTree.d.ts +16 -0
  92. package/dist/feature-libraries/changeAtomIdBTree.d.ts.map +1 -0
  93. package/dist/feature-libraries/changeAtomIdBTree.js +30 -0
  94. package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -0
  95. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  96. package/dist/feature-libraries/chunked-forest/basicChunk.js +8 -1
  97. package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  98. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  99. package/dist/feature-libraries/chunked-forest/chunkTree.js +4 -1
  100. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  101. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  102. package/dist/feature-libraries/chunked-forest/chunkedForest.js +9 -7
  103. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  104. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  105. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +7 -4
  106. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  107. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  108. package/dist/feature-libraries/chunked-forest/codec/codecs.js +19 -11
  109. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  110. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -3
  111. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  112. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +9 -5
  113. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  114. package/dist/feature-libraries/chunked-forest/uniformChunk.js +1 -1
  115. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  116. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +103 -44
  117. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  118. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +251 -77
  119. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  120. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -1
  121. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  122. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +22 -3
  123. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  124. package/dist/feature-libraries/default-schema/index.d.ts +2 -1
  125. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  126. package/dist/feature-libraries/default-schema/index.js +5 -2
  127. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  128. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +38 -0
  129. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
  130. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js +132 -0
  131. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
  132. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +9 -6
  133. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  134. package/dist/feature-libraries/default-schema/mappedEditBuilder.js +21 -0
  135. package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  136. package/dist/feature-libraries/deltaUtils.d.ts +1 -0
  137. package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
  138. package/dist/feature-libraries/deltaUtils.js +6 -1
  139. package/dist/feature-libraries/deltaUtils.js.map +1 -1
  140. package/dist/feature-libraries/flex-tree/context.d.ts +9 -0
  141. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  142. package/dist/feature-libraries/flex-tree/context.js +6 -0
  143. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  144. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  145. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  146. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  147. package/dist/feature-libraries/flex-tree/lazyField.d.ts +8 -7
  148. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  149. package/dist/feature-libraries/flex-tree/lazyField.js +44 -15
  150. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  151. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  152. package/dist/feature-libraries/forest-summary/forestSummarizer.js +3 -1
  153. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  154. package/dist/feature-libraries/index.d.ts +5 -4
  155. package/dist/feature-libraries/index.d.ts.map +1 -1
  156. package/dist/feature-libraries/index.js +15 -8
  157. package/dist/feature-libraries/index.js.map +1 -1
  158. package/dist/feature-libraries/indexing/anchorTreeIndex.js +6 -6
  159. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  160. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  161. package/dist/feature-libraries/mapTreeCursor.js +1 -0
  162. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  163. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  164. package/dist/feature-libraries/mitigatedChangeFamily.js +12 -3
  165. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  166. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  167. package/dist/feature-libraries/modular-schema/comparison.js +12 -9
  168. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  169. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
  170. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  171. package/dist/feature-libraries/modular-schema/crossFieldQueries.js +4 -7
  172. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  173. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +25 -0
  174. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -0
  175. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js +59 -0
  176. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -0
  177. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +22 -53
  178. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  179. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  180. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  181. package/dist/feature-libraries/modular-schema/genericFieldKind.js +7 -13
  182. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  183. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js +2 -2
  184. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  185. package/dist/feature-libraries/modular-schema/index.d.ts +7 -5
  186. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  187. package/dist/feature-libraries/modular-schema/index.js +12 -8
  188. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  189. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +32 -0
  190. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
  191. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +409 -0
  192. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
  193. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +15 -0
  194. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
  195. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +31 -0
  196. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
  197. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.d.ts +15 -0
  198. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.d.ts.map +1 -0
  199. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.js +393 -0
  200. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.js.map +1 -0
  201. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  202. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  203. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +32 -288
  204. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  205. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +60 -26
  206. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  207. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1519 -615
  208. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  209. package/{lib/feature-libraries/modular-schema/modularChangeFormat.d.ts → dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts} +5 -6
  210. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
  211. package/dist/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +7 -7
  212. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
  213. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +112 -0
  214. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
  215. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +21 -0
  216. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
  217. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.d.ts +146 -0
  218. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.d.ts.map +1 -0
  219. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.js +32 -0
  220. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.js.map +1 -0
  221. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +59 -13
  222. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  223. package/dist/feature-libraries/modular-schema/modularChangeTypes.js +3 -3
  224. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  225. package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -1
  226. package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
  227. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  228. package/dist/feature-libraries/object-forest/objectForest.js +7 -5
  229. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  230. package/dist/feature-libraries/optional-field/index.d.ts +2 -2
  231. package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
  232. package/dist/feature-libraries/optional-field/index.js +1 -2
  233. package/dist/feature-libraries/optional-field/index.js.map +1 -1
  234. package/dist/feature-libraries/optional-field/optionalField.d.ts +5 -26
  235. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  236. package/dist/feature-libraries/optional-field/optionalField.js +223 -450
  237. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  238. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +23 -0
  239. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +1 -0
  240. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +31 -0
  241. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +1 -0
  242. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
  243. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  244. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  245. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  246. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  247. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +57 -28
  248. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  249. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +12 -0
  250. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +1 -0
  251. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js +57 -0
  252. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js.map +1 -0
  253. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  254. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +5 -1
  255. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  256. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  257. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +14 -2
  258. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  259. package/dist/feature-libraries/schema-index/codec.d.ts +7 -21
  260. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  261. package/dist/feature-libraries/schema-index/codec.js +28 -70
  262. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  263. package/dist/feature-libraries/schema-index/index.d.ts +2 -2
  264. package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
  265. package/dist/feature-libraries/schema-index/index.js +2 -5
  266. package/dist/feature-libraries/schema-index/index.js.map +1 -1
  267. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +1 -9
  268. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  269. package/dist/feature-libraries/schema-index/schemaSummarizer.js +1 -12
  270. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  271. package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
  272. package/dist/feature-libraries/schemaChecker.js +11 -6
  273. package/dist/feature-libraries/schemaChecker.js.map +1 -1
  274. package/dist/feature-libraries/sequence-field/compose.d.ts +6 -7
  275. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  276. package/dist/feature-libraries/sequence-field/compose.js +91 -263
  277. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  278. package/dist/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
  279. package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  280. package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  281. package/dist/feature-libraries/sequence-field/index.d.ts +2 -3
  282. package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
  283. package/dist/feature-libraries/sequence-field/index.js +1 -3
  284. package/dist/feature-libraries/sequence-field/index.js.map +1 -1
  285. package/dist/feature-libraries/sequence-field/invert.d.ts +3 -3
  286. package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  287. package/dist/feature-libraries/sequence-field/invert.js +67 -168
  288. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  289. package/dist/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  290. package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  291. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  292. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
  293. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  294. package/dist/feature-libraries/sequence-field/moveEffectTable.js +10 -87
  295. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  296. package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -3
  297. package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  298. package/dist/feature-libraries/sequence-field/rebase.js +120 -119
  299. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  300. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts +2 -2
  301. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  302. package/dist/feature-libraries/sequence-field/replaceRevisions.js +35 -43
  303. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  304. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  305. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +0 -2
  306. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  307. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
  308. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  309. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +365 -179
  310. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  311. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  312. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +20 -60
  313. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  314. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  315. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  316. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
  317. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  318. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
  319. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  320. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +20 -112
  321. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  322. package/dist/feature-libraries/sequence-field/types.d.ts +30 -59
  323. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  324. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  325. package/dist/feature-libraries/sequence-field/utils.d.ts +15 -24
  326. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  327. package/dist/feature-libraries/sequence-field/utils.js +148 -318
  328. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  329. package/dist/feature-libraries/treeCursorUtils.js +7 -7
  330. package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
  331. package/dist/feature-libraries/treeTextCursor.js +2 -2
  332. package/dist/feature-libraries/treeTextCursor.js.map +1 -1
  333. package/dist/feature-libraries/valueUtilities.d.ts.map +1 -1
  334. package/dist/feature-libraries/valueUtilities.js +16 -8
  335. package/dist/feature-libraries/valueUtilities.js.map +1 -1
  336. package/dist/index.d.ts +4 -3
  337. package/dist/index.d.ts.map +1 -1
  338. package/dist/index.js +4 -1
  339. package/dist/index.js.map +1 -1
  340. package/dist/packageVersion.d.ts +1 -1
  341. package/dist/packageVersion.d.ts.map +1 -1
  342. package/dist/packageVersion.js +1 -1
  343. package/dist/packageVersion.js.map +1 -1
  344. package/dist/shared-tree/index.d.ts +1 -1
  345. package/dist/shared-tree/index.d.ts.map +1 -1
  346. package/dist/shared-tree/index.js.map +1 -1
  347. package/dist/shared-tree/schematizeTree.d.ts +4 -4
  348. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  349. package/dist/shared-tree/schematizeTree.js +2 -1
  350. package/dist/shared-tree/schematizeTree.js.map +1 -1
  351. package/dist/shared-tree/schematizingTreeView.d.ts +3 -8
  352. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  353. package/dist/shared-tree/schematizingTreeView.js +58 -44
  354. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  355. package/dist/shared-tree/sharedTree.d.ts +9 -3
  356. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  357. package/dist/shared-tree/sharedTree.js +72 -44
  358. package/dist/shared-tree/sharedTree.js.map +1 -1
  359. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  360. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  361. package/dist/shared-tree/sharedTreeChangeCodecs.js +10 -8
  362. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  363. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  364. package/dist/shared-tree/sharedTreeChangeEnricher.js +5 -3
  365. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  366. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +7 -6
  367. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  368. package/dist/shared-tree/sharedTreeChangeFamily.js +29 -18
  369. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  370. package/dist/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
  371. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  372. package/dist/shared-tree/sharedTreeEditBuilder.js +14 -7
  373. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  374. package/dist/shared-tree/treeAlpha.d.ts +35 -29
  375. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  376. package/dist/shared-tree/treeAlpha.js +21 -23
  377. package/dist/shared-tree/treeAlpha.js.map +1 -1
  378. package/dist/shared-tree/treeCheckout.d.ts +11 -10
  379. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  380. package/dist/shared-tree/treeCheckout.js +93 -25
  381. package/dist/shared-tree/treeCheckout.js.map +1 -1
  382. package/dist/shared-tree-core/branch.d.ts +6 -3
  383. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  384. package/dist/shared-tree-core/branch.js +13 -6
  385. package/dist/shared-tree-core/branch.js.map +1 -1
  386. package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  387. package/dist/shared-tree-core/branchCommitEnricher.js +1 -1
  388. package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
  389. package/dist/shared-tree-core/editManager.d.ts +2 -2
  390. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  391. package/dist/shared-tree-core/editManager.js +21 -15
  392. package/dist/shared-tree-core/editManager.js.map +1 -1
  393. package/dist/shared-tree-core/editManagerCodecs.d.ts +4 -0
  394. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  395. package/dist/shared-tree-core/editManagerCodecs.js +18 -5
  396. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  397. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +2 -0
  398. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  399. package/dist/shared-tree-core/editManagerFormatCommons.js +12 -0
  400. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  401. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  402. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  403. package/dist/shared-tree-core/editManagerFormatV1toV4.js +2 -0
  404. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  405. package/dist/shared-tree-core/editManagerSummarizer.js +3 -3
  406. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  407. package/dist/shared-tree-core/index.d.ts +2 -2
  408. package/dist/shared-tree-core/index.d.ts.map +1 -1
  409. package/dist/shared-tree-core/index.js +3 -1
  410. package/dist/shared-tree-core/index.js.map +1 -1
  411. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  412. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  413. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  414. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  415. package/dist/shared-tree-core/messageCodecVSharedBranches.js +2 -1
  416. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  417. package/dist/shared-tree-core/messageCodecs.d.ts +4 -0
  418. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  419. package/dist/shared-tree-core/messageCodecs.js +17 -5
  420. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  421. package/dist/shared-tree-core/messageFormat.d.ts +2 -0
  422. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  423. package/dist/shared-tree-core/messageFormat.js +12 -0
  424. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  425. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
  426. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  427. package/dist/shared-tree-core/messageFormatV1ToV4.js +9 -1
  428. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  429. package/dist/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  430. package/dist/shared-tree-core/sequenceIdUtils.js +4 -4
  431. package/dist/shared-tree-core/sequenceIdUtils.js.map +1 -1
  432. package/dist/shared-tree-core/sharedTreeCore.d.ts +1 -0
  433. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  434. package/dist/shared-tree-core/sharedTreeCore.js +13 -9
  435. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  436. package/dist/shared-tree-core/transaction.d.ts +25 -8
  437. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  438. package/dist/shared-tree-core/transaction.js +65 -30
  439. package/dist/shared-tree-core/transaction.js.map +1 -1
  440. package/dist/shared-tree-core/transactionEnricher.d.ts +2 -2
  441. package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  442. package/dist/shared-tree-core/transactionEnricher.js +3 -3
  443. package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
  444. package/dist/simple-tree/api/configuration.js +1 -1
  445. package/dist/simple-tree/api/configuration.js.map +1 -1
  446. package/dist/simple-tree/api/customTree.d.ts.map +1 -1
  447. package/dist/simple-tree/api/customTree.js +13 -9
  448. package/dist/simple-tree/api/customTree.js.map +1 -1
  449. package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
  450. package/dist/simple-tree/api/discrepancies.js +21 -17
  451. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  452. package/dist/simple-tree/api/index.d.ts +2 -2
  453. package/dist/simple-tree/api/index.d.ts.map +1 -1
  454. package/dist/simple-tree/api/index.js +2 -1
  455. package/dist/simple-tree/api/index.js.map +1 -1
  456. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  457. package/dist/simple-tree/api/schemaFactory.js +12 -8
  458. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  459. package/dist/simple-tree/api/schemaFactoryAlpha.js +1 -1
  460. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  461. package/dist/simple-tree/api/schemaFactoryBeta.js +1 -1
  462. package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  463. package/dist/simple-tree/api/schemaFromSimple.js +18 -9
  464. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  465. package/dist/simple-tree/api/simpleSchemaCodec.js +10 -5
  466. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  467. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  468. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +19 -15
  469. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  470. package/dist/simple-tree/api/simpleTreeIndex.js +10 -10
  471. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  472. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +244 -0
  473. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  474. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +297 -1
  475. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  476. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  477. package/dist/simple-tree/api/storedSchema.js +2 -3
  478. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  479. package/dist/simple-tree/api/transactionTypes.d.ts +17 -4
  480. package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
  481. package/dist/simple-tree/api/transactionTypes.js.map +1 -1
  482. package/dist/simple-tree/api/tree.d.ts +3 -1
  483. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  484. package/dist/simple-tree/api/tree.js.map +1 -1
  485. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  486. package/dist/simple-tree/api/treeNodeApi.js +21 -13
  487. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  488. package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
  489. package/dist/simple-tree/api/verboseTree.js +14 -9
  490. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  491. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  492. package/dist/simple-tree/core/treeNodeKernel.js +12 -5
  493. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  494. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
  495. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  496. package/dist/simple-tree/core/unhydratedFlexTree.js +79 -23
  497. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  498. package/dist/simple-tree/fieldSchema.d.ts +4 -4
  499. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  500. package/dist/simple-tree/fieldSchema.js.map +1 -1
  501. package/dist/simple-tree/getTreeNodeForField.d.ts.map +1 -1
  502. package/dist/simple-tree/getTreeNodeForField.js +2 -1
  503. package/dist/simple-tree/getTreeNodeForField.js.map +1 -1
  504. package/dist/simple-tree/index.d.ts +3 -3
  505. package/dist/simple-tree/index.d.ts.map +1 -1
  506. package/dist/simple-tree/index.js +4 -3
  507. package/dist/simple-tree/index.js.map +1 -1
  508. package/dist/simple-tree/leafNodeSchema.js +9 -6
  509. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  510. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  511. package/dist/simple-tree/node-kinds/array/arrayNode.js +22 -20
  512. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  513. package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
  514. package/dist/simple-tree/node-kinds/common.js +1 -1
  515. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  516. package/dist/simple-tree/node-kinds/map/mapNode.js +2 -2
  517. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  518. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  519. package/dist/simple-tree/node-kinds/object/objectNode.js +21 -22
  520. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  521. package/dist/simple-tree/node-kinds/record/recordNode.js +6 -5
  522. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  523. package/dist/simple-tree/prepareForInsertion.d.ts +54 -47
  524. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  525. package/dist/simple-tree/prepareForInsertion.js +184 -126
  526. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  527. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  528. package/dist/simple-tree/toStoredSchema.js +9 -5
  529. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  530. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
  531. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  532. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +31 -13
  533. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  534. package/dist/text/index.d.ts +6 -0
  535. package/dist/text/index.d.ts.map +1 -0
  536. package/dist/text/index.js +10 -0
  537. package/dist/text/index.js.map +1 -0
  538. package/dist/text/textDomain.d.ts +138 -0
  539. package/dist/text/textDomain.d.ts.map +1 -0
  540. package/dist/text/textDomain.js +121 -0
  541. package/dist/text/textDomain.js.map +1 -0
  542. package/dist/treeFactory.d.ts.map +1 -1
  543. package/dist/treeFactory.js +17 -3
  544. package/dist/treeFactory.js.map +1 -1
  545. package/dist/util/bTreeUtils.d.ts +12 -4
  546. package/dist/util/bTreeUtils.d.ts.map +1 -1
  547. package/dist/util/bTreeUtils.js +15 -19
  548. package/dist/util/bTreeUtils.js.map +1 -1
  549. package/dist/util/breakable.js +7 -9
  550. package/dist/util/breakable.js.map +1 -1
  551. package/dist/util/idAllocator.d.ts.map +1 -1
  552. package/dist/util/idAllocator.js +1 -2
  553. package/dist/util/idAllocator.js.map +1 -1
  554. package/dist/util/index.d.ts +1 -1
  555. package/dist/util/index.d.ts.map +1 -1
  556. package/dist/util/index.js +2 -1
  557. package/dist/util/index.js.map +1 -1
  558. package/dist/util/nestedMap.d.ts.map +1 -1
  559. package/dist/util/nestedMap.js +13 -13
  560. package/dist/util/nestedMap.js.map +1 -1
  561. package/dist/util/rangeMap.d.ts +24 -12
  562. package/dist/util/rangeMap.d.ts.map +1 -1
  563. package/dist/util/rangeMap.js +46 -6
  564. package/dist/util/rangeMap.js.map +1 -1
  565. package/dist/util/utils.d.ts.map +1 -1
  566. package/dist/util/utils.js +16 -15
  567. package/dist/util/utils.js.map +1 -1
  568. package/docs/user-facing/merge-semantics.md +3 -2
  569. package/eslint.config.mts +5 -48
  570. package/lib/alpha.d.ts +9 -0
  571. package/lib/codec/codec.d.ts +31 -3
  572. package/lib/codec/codec.d.ts.map +1 -1
  573. package/lib/codec/codec.js +10 -0
  574. package/lib/codec/codec.js.map +1 -1
  575. package/lib/codec/index.d.ts +2 -2
  576. package/lib/codec/index.d.ts.map +1 -1
  577. package/lib/codec/index.js +1 -1
  578. package/lib/codec/index.js.map +1 -1
  579. package/lib/codec/versioned/codec.d.ts +80 -22
  580. package/lib/codec/versioned/codec.d.ts.map +1 -1
  581. package/lib/codec/versioned/codec.js +138 -15
  582. package/lib/codec/versioned/codec.js.map +1 -1
  583. package/lib/codec/versioned/index.d.ts +1 -1
  584. package/lib/codec/versioned/index.d.ts.map +1 -1
  585. package/lib/codec/versioned/index.js +1 -1
  586. package/lib/codec/versioned/index.js.map +1 -1
  587. package/lib/core/change-family/changeFamily.d.ts +4 -1
  588. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  589. package/lib/core/change-family/changeFamily.js.map +1 -1
  590. package/lib/core/change-family/index.d.ts +1 -1
  591. package/lib/core/change-family/index.d.ts.map +1 -1
  592. package/lib/core/change-family/index.js.map +1 -1
  593. package/lib/core/index.d.ts +3 -3
  594. package/lib/core/index.d.ts.map +1 -1
  595. package/lib/core/index.js +2 -2
  596. package/lib/core/index.js.map +1 -1
  597. package/lib/core/rebase/changeRebaser.d.ts +42 -3
  598. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  599. package/lib/core/rebase/changeRebaser.js.map +1 -1
  600. package/lib/core/rebase/index.d.ts +2 -2
  601. package/lib/core/rebase/index.d.ts.map +1 -1
  602. package/lib/core/rebase/index.js +1 -1
  603. package/lib/core/rebase/index.js.map +1 -1
  604. package/lib/core/rebase/types.d.ts +52 -10
  605. package/lib/core/rebase/types.d.ts.map +1 -1
  606. package/lib/core/rebase/types.js +3 -10
  607. package/lib/core/rebase/types.js.map +1 -1
  608. package/lib/core/rebase/utils.d.ts.map +1 -1
  609. package/lib/core/rebase/utils.js +33 -11
  610. package/lib/core/rebase/utils.js.map +1 -1
  611. package/lib/core/schema-stored/schema.js +3 -3
  612. package/lib/core/schema-stored/schema.js.map +1 -1
  613. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  614. package/lib/core/tree/anchorSet.js +4 -4
  615. package/lib/core/tree/anchorSet.js.map +1 -1
  616. package/lib/core/tree/detachedFieldIndex.d.ts +7 -2
  617. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  618. package/lib/core/tree/detachedFieldIndex.js +23 -58
  619. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  620. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +18 -10
  621. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  622. package/lib/core/tree/detachedFieldIndexCodecCommon.js +4 -4
  623. package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  624. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts +2 -3
  625. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  626. package/lib/core/tree/detachedFieldIndexCodecV1.js +4 -5
  627. package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  628. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts +2 -3
  629. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  630. package/lib/core/tree/detachedFieldIndexCodecV2.js +4 -6
  631. package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  632. package/lib/core/tree/detachedFieldIndexCodecs.d.ts +5 -6
  633. package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  634. package/lib/core/tree/detachedFieldIndexCodecs.js +12 -39
  635. package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  636. package/lib/core/tree/index.d.ts +2 -2
  637. package/lib/core/tree/index.d.ts.map +1 -1
  638. package/lib/core/tree/index.js +2 -2
  639. package/lib/core/tree/index.js.map +1 -1
  640. package/lib/core/tree/mapTree.js +1 -1
  641. package/lib/core/tree/mapTree.js.map +1 -1
  642. package/lib/core/tree/pathTree.d.ts +11 -3
  643. package/lib/core/tree/pathTree.d.ts.map +1 -1
  644. package/lib/core/tree/pathTree.js +12 -1
  645. package/lib/core/tree/pathTree.js.map +1 -1
  646. package/lib/core/tree/sparseTree.d.ts.map +1 -1
  647. package/lib/core/tree/sparseTree.js +1 -0
  648. package/lib/core/tree/sparseTree.js.map +1 -1
  649. package/lib/core/tree/treeTextFormat.d.ts.map +1 -1
  650. package/lib/core/tree/treeTextFormat.js +5 -9
  651. package/lib/core/tree/treeTextFormat.js.map +1 -1
  652. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  653. package/lib/core/tree/visitDelta.js +3 -2
  654. package/lib/core/tree/visitDelta.js.map +1 -1
  655. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  656. package/lib/core/tree/visitorUtils.js +58 -18
  657. package/lib/core/tree/visitorUtils.js.map +1 -1
  658. package/lib/feature-libraries/changeAtomIdBTree.d.ts +16 -0
  659. package/lib/feature-libraries/changeAtomIdBTree.d.ts.map +1 -0
  660. package/lib/feature-libraries/changeAtomIdBTree.js +24 -0
  661. package/lib/feature-libraries/changeAtomIdBTree.js.map +1 -0
  662. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  663. package/lib/feature-libraries/chunked-forest/basicChunk.js +9 -2
  664. package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  665. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  666. package/lib/feature-libraries/chunked-forest/chunkTree.js +4 -1
  667. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  668. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  669. package/lib/feature-libraries/chunked-forest/chunkedForest.js +9 -7
  670. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  671. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  672. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +7 -4
  673. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  674. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  675. package/lib/feature-libraries/chunked-forest/codec/codecs.js +19 -11
  676. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  677. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -3
  678. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  679. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +9 -5
  680. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  681. package/lib/feature-libraries/chunked-forest/uniformChunk.js +1 -1
  682. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  683. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +103 -44
  684. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  685. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +249 -78
  686. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  687. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -1
  688. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  689. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +22 -3
  690. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  691. package/lib/feature-libraries/default-schema/index.d.ts +2 -1
  692. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  693. package/lib/feature-libraries/default-schema/index.js +2 -1
  694. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  695. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +38 -0
  696. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
  697. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js +128 -0
  698. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
  699. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +9 -6
  700. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  701. package/lib/feature-libraries/default-schema/mappedEditBuilder.js +21 -0
  702. package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  703. package/lib/feature-libraries/deltaUtils.d.ts +1 -0
  704. package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
  705. package/lib/feature-libraries/deltaUtils.js +5 -1
  706. package/lib/feature-libraries/deltaUtils.js.map +1 -1
  707. package/lib/feature-libraries/flex-tree/context.d.ts +9 -0
  708. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  709. package/lib/feature-libraries/flex-tree/context.js +6 -0
  710. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  711. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  712. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  713. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  714. package/lib/feature-libraries/flex-tree/lazyField.d.ts +8 -7
  715. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  716. package/lib/feature-libraries/flex-tree/lazyField.js +45 -16
  717. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  718. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  719. package/lib/feature-libraries/forest-summary/forestSummarizer.js +3 -1
  720. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  721. package/lib/feature-libraries/index.d.ts +5 -4
  722. package/lib/feature-libraries/index.d.ts.map +1 -1
  723. package/lib/feature-libraries/index.js +5 -4
  724. package/lib/feature-libraries/index.js.map +1 -1
  725. package/lib/feature-libraries/indexing/anchorTreeIndex.js +6 -6
  726. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  727. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  728. package/lib/feature-libraries/mapTreeCursor.js +2 -1
  729. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  730. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  731. package/lib/feature-libraries/mitigatedChangeFamily.js +12 -3
  732. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  733. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  734. package/lib/feature-libraries/modular-schema/comparison.js +12 -9
  735. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  736. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
  737. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  738. package/lib/feature-libraries/modular-schema/crossFieldQueries.js +3 -5
  739. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  740. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +25 -0
  741. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -0
  742. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js +55 -0
  743. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -0
  744. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +22 -53
  745. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  746. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  747. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  748. package/lib/feature-libraries/modular-schema/genericFieldKind.js +8 -14
  749. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  750. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js +1 -1
  751. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  752. package/lib/feature-libraries/modular-schema/index.d.ts +7 -5
  753. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  754. package/lib/feature-libraries/modular-schema/index.js +5 -3
  755. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  756. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +32 -0
  757. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
  758. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +402 -0
  759. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
  760. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +15 -0
  761. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
  762. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +27 -0
  763. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
  764. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.d.ts +15 -0
  765. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.d.ts.map +1 -0
  766. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.js +389 -0
  767. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.js.map +1 -0
  768. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  769. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  770. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +34 -290
  771. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  772. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +60 -26
  773. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  774. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1441 -546
  775. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  776. package/{dist/feature-libraries/modular-schema/modularChangeFormat.d.ts → lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts} +5 -6
  777. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
  778. package/lib/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +4 -4
  779. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
  780. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +112 -0
  781. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
  782. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +18 -0
  783. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
  784. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.d.ts +146 -0
  785. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.d.ts.map +1 -0
  786. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.js +29 -0
  787. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.js.map +1 -0
  788. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +59 -13
  789. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  790. package/lib/feature-libraries/modular-schema/modularChangeTypes.js +1 -1
  791. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  792. package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -1
  793. package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
  794. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  795. package/lib/feature-libraries/object-forest/objectForest.js +7 -5
  796. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  797. package/lib/feature-libraries/optional-field/index.d.ts +2 -2
  798. package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
  799. package/lib/feature-libraries/optional-field/index.js +1 -1
  800. package/lib/feature-libraries/optional-field/index.js.map +1 -1
  801. package/lib/feature-libraries/optional-field/optionalField.d.ts +5 -26
  802. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  803. package/lib/feature-libraries/optional-field/optionalField.js +223 -448
  804. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  805. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +23 -0
  806. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +1 -0
  807. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +27 -0
  808. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +1 -0
  809. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
  810. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  811. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  812. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  813. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  814. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +55 -26
  815. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  816. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +12 -0
  817. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +1 -0
  818. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js +53 -0
  819. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js.map +1 -0
  820. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  821. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +5 -1
  822. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  823. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  824. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +15 -3
  825. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  826. package/lib/feature-libraries/schema-index/codec.d.ts +7 -21
  827. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  828. package/lib/feature-libraries/schema-index/codec.js +30 -68
  829. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  830. package/lib/feature-libraries/schema-index/index.d.ts +2 -2
  831. package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
  832. package/lib/feature-libraries/schema-index/index.js +2 -2
  833. package/lib/feature-libraries/schema-index/index.js.map +1 -1
  834. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +1 -9
  835. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  836. package/lib/feature-libraries/schema-index/schemaSummarizer.js +0 -10
  837. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  838. package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
  839. package/lib/feature-libraries/schemaChecker.js +11 -6
  840. package/lib/feature-libraries/schemaChecker.js.map +1 -1
  841. package/lib/feature-libraries/sequence-field/compose.d.ts +6 -7
  842. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  843. package/lib/feature-libraries/sequence-field/compose.js +93 -265
  844. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  845. package/lib/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
  846. package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  847. package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  848. package/lib/feature-libraries/sequence-field/index.d.ts +2 -3
  849. package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
  850. package/lib/feature-libraries/sequence-field/index.js +0 -1
  851. package/lib/feature-libraries/sequence-field/index.js.map +1 -1
  852. package/lib/feature-libraries/sequence-field/invert.d.ts +3 -3
  853. package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  854. package/lib/feature-libraries/sequence-field/invert.js +69 -170
  855. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  856. package/lib/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  857. package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  858. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  859. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
  860. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  861. package/lib/feature-libraries/sequence-field/moveEffectTable.js +9 -81
  862. package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  863. package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -3
  864. package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  865. package/lib/feature-libraries/sequence-field/rebase.js +122 -121
  866. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  867. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts +2 -2
  868. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  869. package/lib/feature-libraries/sequence-field/replaceRevisions.js +36 -44
  870. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  871. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  872. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +0 -2
  873. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  874. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
  875. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  876. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +356 -174
  877. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  878. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  879. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +21 -61
  880. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  881. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  882. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  883. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
  884. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  885. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
  886. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  887. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +20 -112
  888. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  889. package/lib/feature-libraries/sequence-field/types.d.ts +30 -59
  890. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  891. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  892. package/lib/feature-libraries/sequence-field/utils.d.ts +15 -24
  893. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  894. package/lib/feature-libraries/sequence-field/utils.js +144 -311
  895. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  896. package/lib/feature-libraries/treeCursorUtils.js +7 -7
  897. package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
  898. package/lib/feature-libraries/treeTextCursor.js +2 -2
  899. package/lib/feature-libraries/treeTextCursor.js.map +1 -1
  900. package/lib/feature-libraries/valueUtilities.d.ts.map +1 -1
  901. package/lib/feature-libraries/valueUtilities.js +16 -8
  902. package/lib/feature-libraries/valueUtilities.js.map +1 -1
  903. package/lib/index.d.ts +4 -3
  904. package/lib/index.d.ts.map +1 -1
  905. package/lib/index.js +2 -1
  906. package/lib/index.js.map +1 -1
  907. package/lib/packageVersion.d.ts +1 -1
  908. package/lib/packageVersion.d.ts.map +1 -1
  909. package/lib/packageVersion.js +1 -1
  910. package/lib/packageVersion.js.map +1 -1
  911. package/lib/shared-tree/index.d.ts +1 -1
  912. package/lib/shared-tree/index.d.ts.map +1 -1
  913. package/lib/shared-tree/index.js.map +1 -1
  914. package/lib/shared-tree/schematizeTree.d.ts +4 -4
  915. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  916. package/lib/shared-tree/schematizeTree.js +3 -2
  917. package/lib/shared-tree/schematizeTree.js.map +1 -1
  918. package/lib/shared-tree/schematizingTreeView.d.ts +3 -8
  919. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  920. package/lib/shared-tree/schematizingTreeView.js +61 -47
  921. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  922. package/lib/shared-tree/sharedTree.d.ts +9 -3
  923. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  924. package/lib/shared-tree/sharedTree.js +41 -13
  925. package/lib/shared-tree/sharedTree.js.map +1 -1
  926. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  927. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  928. package/lib/shared-tree/sharedTreeChangeCodecs.js +10 -8
  929. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  930. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  931. package/lib/shared-tree/sharedTreeChangeEnricher.js +6 -4
  932. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  933. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +7 -6
  934. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  935. package/lib/shared-tree/sharedTreeChangeFamily.js +30 -19
  936. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  937. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
  938. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  939. package/lib/shared-tree/sharedTreeEditBuilder.js +12 -6
  940. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  941. package/lib/shared-tree/treeAlpha.d.ts +35 -29
  942. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  943. package/lib/shared-tree/treeAlpha.js +21 -23
  944. package/lib/shared-tree/treeAlpha.js.map +1 -1
  945. package/lib/shared-tree/treeCheckout.d.ts +11 -10
  946. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  947. package/lib/shared-tree/treeCheckout.js +97 -29
  948. package/lib/shared-tree/treeCheckout.js.map +1 -1
  949. package/lib/shared-tree-core/branch.d.ts +6 -3
  950. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  951. package/lib/shared-tree-core/branch.js +13 -6
  952. package/lib/shared-tree-core/branch.js.map +1 -1
  953. package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  954. package/lib/shared-tree-core/branchCommitEnricher.js +2 -2
  955. package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
  956. package/lib/shared-tree-core/editManager.d.ts +2 -2
  957. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  958. package/lib/shared-tree-core/editManager.js +21 -15
  959. package/lib/shared-tree-core/editManager.js.map +1 -1
  960. package/lib/shared-tree-core/editManagerCodecs.d.ts +4 -0
  961. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  962. package/lib/shared-tree-core/editManagerCodecs.js +16 -4
  963. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  964. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +2 -0
  965. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  966. package/lib/shared-tree-core/editManagerFormatCommons.js +12 -0
  967. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  968. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  969. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  970. package/lib/shared-tree-core/editManagerFormatV1toV4.js +2 -0
  971. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  972. package/lib/shared-tree-core/editManagerSummarizer.js +3 -3
  973. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  974. package/lib/shared-tree-core/index.d.ts +2 -2
  975. package/lib/shared-tree-core/index.d.ts.map +1 -1
  976. package/lib/shared-tree-core/index.js +2 -2
  977. package/lib/shared-tree-core/index.js.map +1 -1
  978. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  979. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  980. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  981. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  982. package/lib/shared-tree-core/messageCodecVSharedBranches.js +2 -1
  983. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  984. package/lib/shared-tree-core/messageCodecs.d.ts +4 -0
  985. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  986. package/lib/shared-tree-core/messageCodecs.js +15 -4
  987. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  988. package/lib/shared-tree-core/messageFormat.d.ts +2 -0
  989. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  990. package/lib/shared-tree-core/messageFormat.js +12 -0
  991. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  992. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
  993. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  994. package/lib/shared-tree-core/messageFormatV1ToV4.js +9 -1
  995. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  996. package/lib/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  997. package/lib/shared-tree-core/sequenceIdUtils.js +4 -4
  998. package/lib/shared-tree-core/sequenceIdUtils.js.map +1 -1
  999. package/lib/shared-tree-core/sharedTreeCore.d.ts +1 -0
  1000. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  1001. package/lib/shared-tree-core/sharedTreeCore.js +13 -9
  1002. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  1003. package/lib/shared-tree-core/transaction.d.ts +25 -8
  1004. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  1005. package/lib/shared-tree-core/transaction.js +67 -32
  1006. package/lib/shared-tree-core/transaction.js.map +1 -1
  1007. package/lib/shared-tree-core/transactionEnricher.d.ts +2 -2
  1008. package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  1009. package/lib/shared-tree-core/transactionEnricher.js +3 -3
  1010. package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
  1011. package/lib/simple-tree/api/configuration.js +1 -1
  1012. package/lib/simple-tree/api/configuration.js.map +1 -1
  1013. package/lib/simple-tree/api/customTree.d.ts.map +1 -1
  1014. package/lib/simple-tree/api/customTree.js +13 -9
  1015. package/lib/simple-tree/api/customTree.js.map +1 -1
  1016. package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
  1017. package/lib/simple-tree/api/discrepancies.js +21 -17
  1018. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  1019. package/lib/simple-tree/api/index.d.ts +2 -2
  1020. package/lib/simple-tree/api/index.d.ts.map +1 -1
  1021. package/lib/simple-tree/api/index.js +1 -1
  1022. package/lib/simple-tree/api/index.js.map +1 -1
  1023. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  1024. package/lib/simple-tree/api/schemaFactory.js +12 -8
  1025. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  1026. package/lib/simple-tree/api/schemaFactoryAlpha.js +1 -1
  1027. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  1028. package/lib/simple-tree/api/schemaFactoryBeta.js +1 -1
  1029. package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  1030. package/lib/simple-tree/api/schemaFromSimple.js +18 -9
  1031. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  1032. package/lib/simple-tree/api/simpleSchemaCodec.js +10 -5
  1033. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  1034. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  1035. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +19 -15
  1036. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  1037. package/lib/simple-tree/api/simpleTreeIndex.js +10 -10
  1038. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  1039. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +244 -0
  1040. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  1041. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +270 -0
  1042. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  1043. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  1044. package/lib/simple-tree/api/storedSchema.js +4 -7
  1045. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  1046. package/lib/simple-tree/api/transactionTypes.d.ts +17 -4
  1047. package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
  1048. package/lib/simple-tree/api/transactionTypes.js.map +1 -1
  1049. package/lib/simple-tree/api/tree.d.ts +3 -1
  1050. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  1051. package/lib/simple-tree/api/tree.js.map +1 -1
  1052. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  1053. package/lib/simple-tree/api/treeNodeApi.js +21 -13
  1054. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  1055. package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
  1056. package/lib/simple-tree/api/verboseTree.js +14 -9
  1057. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  1058. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  1059. package/lib/simple-tree/core/treeNodeKernel.js +12 -5
  1060. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  1061. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
  1062. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  1063. package/lib/simple-tree/core/unhydratedFlexTree.js +78 -23
  1064. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  1065. package/lib/simple-tree/fieldSchema.d.ts +4 -4
  1066. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  1067. package/lib/simple-tree/fieldSchema.js.map +1 -1
  1068. package/lib/simple-tree/getTreeNodeForField.d.ts.map +1 -1
  1069. package/lib/simple-tree/getTreeNodeForField.js +2 -1
  1070. package/lib/simple-tree/getTreeNodeForField.js.map +1 -1
  1071. package/lib/simple-tree/index.d.ts +3 -3
  1072. package/lib/simple-tree/index.d.ts.map +1 -1
  1073. package/lib/simple-tree/index.js +2 -2
  1074. package/lib/simple-tree/index.js.map +1 -1
  1075. package/lib/simple-tree/leafNodeSchema.js +9 -6
  1076. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  1077. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  1078. package/lib/simple-tree/node-kinds/array/arrayNode.js +23 -21
  1079. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  1080. package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
  1081. package/lib/simple-tree/node-kinds/common.js +2 -2
  1082. package/lib/simple-tree/node-kinds/common.js.map +1 -1
  1083. package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
  1084. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  1085. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  1086. package/lib/simple-tree/node-kinds/object/objectNode.js +22 -23
  1087. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  1088. package/lib/simple-tree/node-kinds/record/recordNode.js +6 -5
  1089. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  1090. package/lib/simple-tree/prepareForInsertion.d.ts +54 -47
  1091. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  1092. package/lib/simple-tree/prepareForInsertion.js +184 -125
  1093. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  1094. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  1095. package/lib/simple-tree/toStoredSchema.js +9 -5
  1096. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  1097. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
  1098. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  1099. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +28 -11
  1100. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  1101. package/lib/text/index.d.ts +6 -0
  1102. package/lib/text/index.d.ts.map +1 -0
  1103. package/lib/text/index.js +6 -0
  1104. package/lib/text/index.js.map +1 -0
  1105. package/lib/text/textDomain.d.ts +138 -0
  1106. package/lib/text/textDomain.d.ts.map +1 -0
  1107. package/lib/text/textDomain.js +118 -0
  1108. package/lib/text/textDomain.js.map +1 -0
  1109. package/lib/treeFactory.d.ts.map +1 -1
  1110. package/lib/treeFactory.js +18 -4
  1111. package/lib/treeFactory.js.map +1 -1
  1112. package/lib/util/bTreeUtils.d.ts +12 -4
  1113. package/lib/util/bTreeUtils.d.ts.map +1 -1
  1114. package/lib/util/bTreeUtils.js +16 -20
  1115. package/lib/util/bTreeUtils.js.map +1 -1
  1116. package/lib/util/breakable.js +7 -9
  1117. package/lib/util/breakable.js.map +1 -1
  1118. package/lib/util/idAllocator.d.ts.map +1 -1
  1119. package/lib/util/idAllocator.js +1 -2
  1120. package/lib/util/idAllocator.js.map +1 -1
  1121. package/lib/util/index.d.ts +1 -1
  1122. package/lib/util/index.d.ts.map +1 -1
  1123. package/lib/util/index.js +1 -1
  1124. package/lib/util/index.js.map +1 -1
  1125. package/lib/util/nestedMap.d.ts.map +1 -1
  1126. package/lib/util/nestedMap.js +13 -13
  1127. package/lib/util/nestedMap.js.map +1 -1
  1128. package/lib/util/rangeMap.d.ts +24 -12
  1129. package/lib/util/rangeMap.d.ts.map +1 -1
  1130. package/lib/util/rangeMap.js +44 -5
  1131. package/lib/util/rangeMap.js.map +1 -1
  1132. package/lib/util/utils.d.ts.map +1 -1
  1133. package/lib/util/utils.js +16 -15
  1134. package/lib/util/utils.js.map +1 -1
  1135. package/package.json +33 -33
  1136. package/src/codec/codec.ts +48 -8
  1137. package/src/codec/index.ts +4 -1
  1138. package/src/codec/versioned/codec.ts +340 -22
  1139. package/src/codec/versioned/index.ts +3 -1
  1140. package/src/core/change-family/changeFamily.ts +5 -0
  1141. package/src/core/change-family/index.ts +1 -0
  1142. package/src/core/index.ts +8 -3
  1143. package/src/core/rebase/changeRebaser.ts +46 -7
  1144. package/src/core/rebase/index.ts +4 -1
  1145. package/src/core/rebase/types.ts +71 -39
  1146. package/src/core/rebase/utils.ts +42 -14
  1147. package/src/core/schema-stored/schema.ts +3 -3
  1148. package/src/core/tree/anchorSet.ts +4 -4
  1149. package/src/core/tree/detachedFieldIndex.ts +29 -74
  1150. package/src/core/tree/detachedFieldIndexCodecCommon.ts +4 -8
  1151. package/src/core/tree/detachedFieldIndexCodecV1.ts +3 -7
  1152. package/src/core/tree/detachedFieldIndexCodecV2.ts +5 -9
  1153. package/src/core/tree/detachedFieldIndexCodecs.ts +21 -64
  1154. package/src/core/tree/index.ts +3 -2
  1155. package/src/core/tree/mapTree.ts +1 -1
  1156. package/src/core/tree/pathTree.ts +16 -4
  1157. package/src/core/tree/sparseTree.ts +1 -0
  1158. package/src/core/tree/treeTextFormat.ts +5 -9
  1159. package/src/core/tree/visitDelta.ts +6 -2
  1160. package/src/core/tree/visitorUtils.ts +55 -19
  1161. package/src/feature-libraries/changeAtomIdBTree.ts +56 -0
  1162. package/src/feature-libraries/chunked-forest/basicChunk.ts +8 -2
  1163. package/src/feature-libraries/chunked-forest/chunkTree.ts +6 -1
  1164. package/src/feature-libraries/chunked-forest/chunkedForest.ts +8 -6
  1165. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +7 -4
  1166. package/src/feature-libraries/chunked-forest/codec/codecs.ts +19 -11
  1167. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +4 -3
  1168. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -5
  1169. package/src/feature-libraries/chunked-forest/uniformChunk.ts +1 -1
  1170. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +442 -139
  1171. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +24 -6
  1172. package/src/feature-libraries/default-schema/index.ts +17 -5
  1173. package/src/feature-libraries/default-schema/locationBasedEditBuilder.ts +188 -0
  1174. package/src/feature-libraries/default-schema/mappedEditBuilder.ts +41 -9
  1175. package/src/feature-libraries/deltaUtils.ts +6 -1
  1176. package/src/feature-libraries/flex-tree/context.ts +17 -0
  1177. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +7 -8
  1178. package/src/feature-libraries/flex-tree/lazyField.ts +72 -30
  1179. package/src/feature-libraries/forest-summary/forestSummarizer.ts +3 -1
  1180. package/src/feature-libraries/index.ts +32 -13
  1181. package/src/feature-libraries/indexing/anchorTreeIndex.ts +5 -5
  1182. package/src/feature-libraries/mapTreeCursor.ts +2 -1
  1183. package/src/feature-libraries/mitigatedChangeFamily.ts +14 -7
  1184. package/src/feature-libraries/modular-schema/comparison.ts +12 -9
  1185. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +142 -44
  1186. package/src/feature-libraries/modular-schema/defaultRevisionReplacer.ts +70 -0
  1187. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +35 -64
  1188. package/src/feature-libraries/modular-schema/genericFieldKind.ts +11 -25
  1189. package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +1 -1
  1190. package/src/feature-libraries/modular-schema/index.ts +20 -16
  1191. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +912 -0
  1192. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +89 -0
  1193. package/src/feature-libraries/modular-schema/modularChangeCodecV3.ts +760 -0
  1194. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +52 -523
  1195. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +2756 -884
  1196. package/src/feature-libraries/modular-schema/{modularChangeFormat.ts → modularChangeFormatV1.ts} +5 -4
  1197. package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +34 -0
  1198. package/src/feature-libraries/modular-schema/modularChangeFormatV3.ts +62 -0
  1199. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +70 -14
  1200. package/src/feature-libraries/node-identifier/mockNodeIdentifierManager.ts +1 -1
  1201. package/src/feature-libraries/object-forest/objectForest.ts +7 -5
  1202. package/src/feature-libraries/optional-field/index.ts +1 -3
  1203. package/src/feature-libraries/optional-field/optionalField.ts +320 -576
  1204. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV3.ts +45 -0
  1205. package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +24 -38
  1206. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +89 -35
  1207. package/src/feature-libraries/optional-field/optionalFieldCodecV3.ts +94 -0
  1208. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +5 -1
  1209. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +18 -3
  1210. package/src/feature-libraries/schema-index/codec.ts +30 -90
  1211. package/src/feature-libraries/schema-index/index.ts +2 -4
  1212. package/src/feature-libraries/schema-index/schemaSummarizer.ts +0 -17
  1213. package/src/feature-libraries/schemaChecker.ts +11 -6
  1214. package/src/feature-libraries/sequence-field/compose.ts +147 -526
  1215. package/src/feature-libraries/sequence-field/helperTypes.ts +34 -19
  1216. package/src/feature-libraries/sequence-field/index.ts +0 -9
  1217. package/src/feature-libraries/sequence-field/invert.ts +103 -227
  1218. package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
  1219. package/src/feature-libraries/sequence-field/moveEffectTable.ts +11 -192
  1220. package/src/feature-libraries/sequence-field/rebase.ts +182 -210
  1221. package/src/feature-libraries/sequence-field/replaceRevisions.ts +54 -80
  1222. package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +0 -2
  1223. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +648 -220
  1224. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +56 -68
  1225. package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +25 -27
  1226. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +25 -132
  1227. package/src/feature-libraries/sequence-field/types.ts +34 -64
  1228. package/src/feature-libraries/sequence-field/utils.ts +171 -366
  1229. package/src/feature-libraries/treeCursorUtils.ts +7 -7
  1230. package/src/feature-libraries/treeTextCursor.ts +2 -2
  1231. package/src/feature-libraries/valueUtilities.ts +16 -8
  1232. package/src/index.ts +11 -0
  1233. package/src/packageVersion.ts +1 -1
  1234. package/src/shared-tree/index.ts +3 -2
  1235. package/src/shared-tree/schematizeTree.ts +21 -8
  1236. package/src/shared-tree/schematizingTreeView.ts +79 -83
  1237. package/src/shared-tree/sharedTree.ts +50 -17
  1238. package/src/shared-tree/sharedTreeChangeCodecs.ts +14 -9
  1239. package/src/shared-tree/sharedTreeChangeEnricher.ts +6 -2
  1240. package/src/shared-tree/sharedTreeChangeFamily.ts +44 -24
  1241. package/src/shared-tree/sharedTreeEditBuilder.ts +48 -13
  1242. package/src/shared-tree/treeAlpha.ts +60 -51
  1243. package/src/shared-tree/treeCheckout.ts +160 -73
  1244. package/src/shared-tree-core/branch.ts +21 -6
  1245. package/src/shared-tree-core/branchCommitEnricher.ts +3 -8
  1246. package/src/shared-tree-core/editManager.ts +43 -29
  1247. package/src/shared-tree-core/editManagerCodecs.ts +19 -4
  1248. package/src/shared-tree-core/editManagerFormatCommons.ts +12 -0
  1249. package/src/shared-tree-core/editManagerFormatV1toV4.ts +5 -1
  1250. package/src/shared-tree-core/editManagerSummarizer.ts +3 -3
  1251. package/src/shared-tree-core/index.ts +2 -0
  1252. package/src/shared-tree-core/messageCodecV1ToV4.ts +3 -1
  1253. package/src/shared-tree-core/messageCodecVSharedBranches.ts +2 -1
  1254. package/src/shared-tree-core/messageCodecs.ts +18 -4
  1255. package/src/shared-tree-core/messageFormat.ts +12 -1
  1256. package/src/shared-tree-core/messageFormatV1ToV4.ts +18 -2
  1257. package/src/shared-tree-core/sequenceIdUtils.ts +4 -4
  1258. package/src/shared-tree-core/sharedTreeCore.ts +15 -8
  1259. package/src/shared-tree-core/transaction.ts +115 -56
  1260. package/src/shared-tree-core/transactionEnricher.ts +5 -6
  1261. package/src/simple-tree/api/configuration.ts +1 -1
  1262. package/src/simple-tree/api/customTree.ts +14 -10
  1263. package/src/simple-tree/api/discrepancies.ts +23 -17
  1264. package/src/simple-tree/api/index.ts +5 -0
  1265. package/src/simple-tree/api/schemaFactory.ts +11 -7
  1266. package/src/simple-tree/api/schemaFactoryAlpha.ts +1 -1
  1267. package/src/simple-tree/api/schemaFactoryBeta.ts +1 -1
  1268. package/src/simple-tree/api/schemaFromSimple.ts +18 -9
  1269. package/src/simple-tree/api/simpleSchemaCodec.ts +10 -5
  1270. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +21 -17
  1271. package/src/simple-tree/api/simpleTreeIndex.ts +8 -8
  1272. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +501 -0
  1273. package/src/simple-tree/api/storedSchema.ts +10 -7
  1274. package/src/simple-tree/api/transactionTypes.ts +19 -4
  1275. package/src/simple-tree/api/tree.ts +3 -1
  1276. package/src/simple-tree/api/treeNodeApi.ts +21 -13
  1277. package/src/simple-tree/api/verboseTree.ts +14 -9
  1278. package/src/simple-tree/core/treeNodeKernel.ts +12 -5
  1279. package/src/simple-tree/core/unhydratedFlexTree.ts +109 -53
  1280. package/src/simple-tree/fieldSchema.ts +6 -4
  1281. package/src/simple-tree/getTreeNodeForField.ts +2 -1
  1282. package/src/simple-tree/index.ts +7 -1
  1283. package/src/simple-tree/leafNodeSchema.ts +8 -5
  1284. package/src/simple-tree/node-kinds/array/arrayNode.ts +32 -30
  1285. package/src/simple-tree/node-kinds/common.ts +2 -5
  1286. package/src/simple-tree/node-kinds/map/mapNode.ts +4 -4
  1287. package/src/simple-tree/node-kinds/object/objectNode.ts +29 -30
  1288. package/src/simple-tree/node-kinds/record/recordNode.ts +12 -12
  1289. package/src/simple-tree/prepareForInsertion.ts +343 -201
  1290. package/src/simple-tree/toStoredSchema.ts +9 -5
  1291. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +43 -15
  1292. package/src/text/README.md +8 -0
  1293. package/src/text/index.ts +6 -0
  1294. package/src/text/textDomain.ts +199 -0
  1295. package/src/treeFactory.ts +20 -5
  1296. package/src/util/bTreeUtils.ts +34 -23
  1297. package/src/util/breakable.ts +9 -9
  1298. package/src/util/idAllocator.ts +1 -2
  1299. package/src/util/index.ts +3 -0
  1300. package/src/util/nestedMap.ts +13 -15
  1301. package/src/util/rangeMap.ts +72 -18
  1302. package/src/util/utils.ts +14 -13
  1303. package/.eslintrc.cjs +0 -140
  1304. package/assertTagging.config.mjs +0 -14
  1305. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
  1306. package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
  1307. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
  1308. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
  1309. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -50
  1310. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
  1311. package/docs/main/sequence-field/move-composition.md +0 -46
  1312. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
  1313. package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
  1314. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
  1315. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
  1316. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -46
  1317. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
  1318. package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +0 -57
@@ -7,16 +7,16 @@ export { allowsValue, assertAllowedValue, isTreeValue } from "./valueUtilities.j
7
7
  export { ForestSummarizer, getCodecTreeForForestFormat, ForestFormatVersion, } from "./forest-summary/index.js";
8
8
  export { cursorForMapTreeField, cursorForMapTreeNode, mapTreeFromCursor, mapTreeFieldFromCursor, type MinimalMapTreeNodeView, mapTreeFieldsWithField, mapTreeWithField, type MapTreeFieldViewGeneric, type MapTreeNodeViewGeneric, type MinimalFieldMap, } from "./mapTreeCursor.js";
9
9
  export { buildForest } from "./object-forest/index.js";
10
- export { SchemaSummarizer, encodeTreeSchema, makeSchemaCodec, makeSchemaCodecs, getCodecTreeForSchemaFormat, clientVersionToSchemaVersion, } from "./schema-index/index.js";
10
+ export { SchemaSummarizer, makeSchemaCodec, schemaCodecBuilder, } from "./schema-index/index.js";
11
11
  export { stackTreeNodeCursor, type CursorAdapter, prefixPath, prefixFieldPath, type CursorWithNode, stackTreeFieldCursor, } from "./treeCursorUtils.js";
12
12
  export { cursorForJsonableTreeNode, cursorForJsonableTreeField, jsonableTreeFromCursor, jsonableTreeFromFieldCursor, jsonableTreeFromForest, } from "./treeTextCursor.js";
13
13
  import * as SequenceField from "./sequence-field/index.js";
14
14
  export { SequenceField };
15
- export { isNeverField, ModularEditBuilder, type FieldEditDescription as EditDescription, type FieldChangeHandler, type FieldChangeRebaser, type FieldEditor, type FieldChangeMap, type FieldChange, type FieldChangeset, type ToDelta, type ModularChangeset, makeModularChangeCodecFamily, type NodeChangeComposer, type NodeChangeInverter, type NodeChangeRebaser, type NodeChangePruner, type CrossFieldManager, CrossFieldTarget, FlexFieldKind, type FullSchemaPolicy, allowsRepoSuperset, type GenericChangeset, genericFieldKind, type HasFieldChanges, type NodeExistsConstraint, ModularChangeFamily, type RelevantRemovedRootsFromChild, EncodedModularChangeset, updateRefreshers, type NodeId, type FieldChangeEncodingContext, type FieldKindConfiguration, type FieldKindConfigurationEntry, isNeverTree, } from "./modular-schema/index.js";
16
- export { mapRootChanges } from "./deltaUtils.js";
15
+ export { isNeverField, ModularEditBuilder, type FieldEditDescription as EditDescription, type FieldChangeHandler, type FieldChangeRebaser, type FieldEditor, type FieldChangeMap, type FieldChange, type FieldChangeset, type ToDelta, type ModularChangeset, makeModularChangeCodecFamily, type NodeChangeComposer, type NodeChangeInverter, type NodeChangeRebaser, type NodeChangePruner, type ComposeNodeManager, type InvertNodeManager, type RebaseNodeManager, CrossFieldTarget, FlexFieldKind, type FullSchemaPolicy, allowsRepoSuperset, type GenericChangeset, genericFieldKind, type HasFieldChanges, type NodeExistsConstraint, ModularChangeFamily, EncodedModularChangesetV1, EncodedModularChangesetV2, updateRefreshers, type NodeId, type FieldChangeEncodingContext, type FieldKindConfiguration, type FieldKindConfigurationEntry, isNeverTree, DefaultRevisionReplacer, } from "./modular-schema/index.js";
16
+ export { mapRootChanges, nodeIdFromChangeAtom, changeAtomFromDetachedNodeId, } from "./deltaUtils.js";
17
17
  export { type TreeChunk, chunkTree, chunkField, chunkFieldSingle, buildChunkedForest, defaultChunkPolicy, type FieldBatch, type FieldBatchCodec, FieldBatchFormatVersion, getCodecTreeForFieldBatchFormat, makeTreeChunker, makeFieldBatchCodec, type FieldBatchEncodingContext, emptyChunk, combineChunks, type IncrementalEncodingPolicy, defaultIncrementalEncodingPolicy, } from "./chunked-forest/index.js";
18
18
  export { compareLocalNodeIdentifiers, createNodeIdentifierManager, isStableNodeIdentifier, type LocalNodeIdentifier, MockNodeIdentifierManager, type NodeIdentifierManager, nodeKeyTreeIdentifier, type StableNodeIdentifier, } from "./node-identifier/index.js";
19
- export { FieldKinds, type Required, type Optional, type Sequence, type Identifier, type Forbidden, type DefaultChangeset, DefaultChangeFamily, DefaultEditBuilder, type IDefaultEditBuilder, type ValueFieldEditBuilder, type OptionalFieldEditBuilder, type SequenceFieldEditBuilder, defaultSchemaPolicy, fieldKinds, fieldKindConfigurations, intoDelta, relevantRemovedRoots, getCodecTreeForModularChangeFormat, type ModularChangeFormatVersion, } from "./default-schema/index.js";
19
+ export { FieldKinds, type Required, type Optional, type Sequence, type Identifier, type Forbidden, type DefaultChangeset, type DetachedRootIds, DefaultChangeFamily, type IdBasedChangeFamilyDataEditor, DefaultIdBasedDataEditor, type DataEditor, type RequiredFieldEditor, type OptionalFieldEditor, type SequenceFieldEditor, defaultSchemaPolicy, fieldKinds, fieldKindConfigurations, intoDelta, relevantRemovedRoots, getBuildsIds, type DetachedRootLocation, type DetachedRootsLocation, type DetachedRootIdRange, type Locator, LocationBasedDataEditor, type ILocationBasedDataEditor, getCodecTreeForModularChangeFormat, type ModularChangeFormatVersion, } from "./default-schema/index.js";
20
20
  export { SchemaValidationError, isNodeInSchema, isFieldInSchema, throwOutOfSchema, } from "./schemaChecker.js";
21
21
  export { type FlexTreeOptionalField, type FlexTreeRequiredField, type FlexTreeSequenceField, type FlexTreeContext, type FlexTreeHydratedContext, type FlexTreeTypedField, type FlexTreeEntity, type FlexTreeField, type FlexTreeNode, TreeStatus, Context, type FlexTreeNodeEvents, type FlexTreeUnknownUnboxed, isFlexTreeNode, ContextSlot, flexTreeMarker, assertFlexTreeEntityNotFreed, flexTreeSlot, getSchemaAndPolicy, LazyEntity, treeStatusFromAnchorCache, indexForAt, FlexTreeEntityKind, type FlexibleNodeContent, type FlexibleFieldContent, type FlexTreeHydratedContextMinimal, type HydratedFlexTreeNode, getOrCreateHydratedFlexTreeNode, currentObserver, withObservation, type Observer, } from "./flex-tree/index.js";
22
22
  export { TreeCompressionStrategy } from "./treeCompressionUtils.js";
@@ -25,4 +25,5 @@ export { DetachedFieldIndexSummarizer } from "./detachedFieldIndexSummarizer.js"
25
25
  export { type SchemaChange, makeSchemaChangeCodecs, EncodedSchemaChange, getCodecTreeForSchemaChangeFormat, } from "./schema-edits/index.js";
26
26
  export { makeMitigatedChangeFamily } from "./mitigatedChangeFamily.js";
27
27
  export { type KeyFinder, AnchorTreeIndex, hasElement, type TreeIndex, type TreeIndexKey, type TreeIndexNodes, } from "./indexing/index.js";
28
+ export { type ChangeAtomIdBTree, getFromChangeAtomIdMap, setInChangeAtomIdMap, } from "./changeAtomIdBTree.js";
28
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,QAAQ,EACb,UAAU,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EACN,gBAAgB,EAChB,2BAA2B,EAC3B,mBAAmB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,qBAAqB,EACrB,oBAAoB,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,aAAa,EAClB,KAAK,YAAY,EACjB,UAAU,EACV,OAAO,EACP,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,cAAc,EACd,WAAW,EAEX,cAAc,EACd,4BAA4B,EAC5B,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,yBAAyB,EACzB,UAAU,EACV,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACnC,KAAK,oBAAoB,EACzB,+BAA+B,EAC/B,eAAe,EACf,eAAe,EACf,KAAK,QAAQ,GACb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,OAAO,EACN,KAAK,YAAY,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,iCAAiC,GACjC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EACN,KAAK,SAAS,EACd,eAAe,EACf,UAAU,EACV,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,cAAc,GACnB,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,QAAQ,EACb,UAAU,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EACN,gBAAgB,EAChB,2BAA2B,EAC3B,mBAAmB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,sBAAsB,E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BAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,UAAU,EACV,OAAO,EACP,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,cAAc,EACd,WAAW,EAEX,cAAc,EACd,4BAA4B,EAC5B,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,yBAAyB,EACzB,UAAU,EACV,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACnC,KAAK,oBAAoB,EACzB,+BAA+B,EAC/B,eAAe,EACf,eAAe,EACf,KAAK,QAAQ,GACb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,OAAO,EACN,KAAK,YAAY,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,iCAAiC,GACjC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EACN,KAAK,SAAS,EACd,eAAe,EACf,UAAU,EACV,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,cAAc,GACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,KAAK,iBAAiB,EACtB,sBAAsB,EACtB,oBAAoB,GACpB,MAAM,wBAAwB,CAAC"}
@@ -27,8 +27,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
27
27
  return result;
28
28
  };
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.makeTreeChunker = exports.getCodecTreeForFieldBatchFormat = exports.FieldBatchFormatVersion = exports.defaultChunkPolicy = exports.buildChunkedForest = exports.chunkFieldSingle = exports.chunkField = exports.chunkTree = exports.mapRootChanges = exports.isNeverTree = exports.updateRefreshers = exports.EncodedModularChangeset = exports.ModularChangeFamily = exports.genericFieldKind = exports.allowsRepoSuperset = exports.FlexFieldKind = exports.CrossFieldTarget = exports.makeModularChangeCodecFamily = exports.ModularEditBuilder = exports.isNeverField = exports.SequenceField = exports.jsonableTreeFromForest = exports.jsonableTreeFromFieldCursor = exports.jsonableTreeFromCursor = exports.cursorForJsonableTreeField = exports.cursorForJsonableTreeNode = exports.stackTreeFieldCursor = exports.prefixFieldPath = exports.prefixPath = exports.stackTreeNodeCursor = exports.clientVersionToSchemaVersion = exports.getCodecTreeForSchemaFormat = exports.makeSchemaCodecs = exports.makeSchemaCodec = exports.encodeTreeSchema = exports.SchemaSummarizer = exports.buildForest = exports.mapTreeWithField = exports.mapTreeFieldsWithField = exports.mapTreeFieldFromCursor = exports.mapTreeFromCursor = exports.cursorForMapTreeNode = exports.cursorForMapTreeField = exports.ForestFormatVersion = exports.getCodecTreeForForestFormat = exports.ForestSummarizer = exports.isTreeValue = exports.assertAllowedValue = exports.allowsValue = exports.toDownPath = void 0;
31
- exports.hasElement = exports.AnchorTreeIndex = exports.makeMitigatedChangeFamily = exports.getCodecTreeForSchemaChangeFormat = exports.EncodedSchemaChange = exports.makeSchemaChangeCodecs = exports.DetachedFieldIndexSummarizer = exports.valueSchemaAllows = exports.TreeCompressionStrategy = exports.withObservation = exports.currentObserver = exports.getOrCreateHydratedFlexTreeNode = exports.FlexTreeEntityKind = exports.indexForAt = exports.treeStatusFromAnchorCache = exports.LazyEntity = exports.getSchemaAndPolicy = exports.flexTreeSlot = exports.assertFlexTreeEntityNotFreed = exports.flexTreeMarker = exports.ContextSlot = exports.isFlexTreeNode = exports.Context = exports.TreeStatus = exports.throwOutOfSchema = exports.isFieldInSchema = exports.isNodeInSchema = exports.SchemaValidationError = exports.getCodecTreeForModularChangeFormat = exports.relevantRemovedRoots = exports.intoDelta = exports.fieldKindConfigurations = exports.fieldKinds = exports.defaultSchemaPolicy = exports.DefaultEditBuilder = exports.DefaultChangeFamily = exports.FieldKinds = exports.nodeKeyTreeIdentifier = exports.MockNodeIdentifierManager = exports.isStableNodeIdentifier = exports.createNodeIdentifierManager = exports.compareLocalNodeIdentifiers = exports.defaultIncrementalEncodingPolicy = exports.combineChunks = exports.emptyChunk = exports.makeFieldBatchCodec = void 0;
30
+ exports.getCodecTreeForFieldBatchFormat = exports.FieldBatchFormatVersion = exports.defaultChunkPolicy = exports.buildChunkedForest = exports.chunkFieldSingle = exports.chunkField = exports.chunkTree = exports.changeAtomFromDetachedNodeId = exports.nodeIdFromChangeAtom = exports.mapRootChanges = exports.DefaultRevisionReplacer = exports.isNeverTree = exports.updateRefreshers = exports.EncodedModularChangesetV2 = exports.EncodedModularChangesetV1 = exports.ModularChangeFamily = exports.genericFieldKind = exports.allowsRepoSuperset = exports.FlexFieldKind = exports.CrossFieldTarget = exports.makeModularChangeCodecFamily = exports.ModularEditBuilder = exports.isNeverField = exports.SequenceField = exports.jsonableTreeFromForest = exports.jsonableTreeFromFieldCursor = exports.jsonableTreeFromCursor = exports.cursorForJsonableTreeField = exports.cursorForJsonableTreeNode = exports.stackTreeFieldCursor = exports.prefixFieldPath = exports.prefixPath = exports.stackTreeNodeCursor = exports.schemaCodecBuilder = exports.makeSchemaCodec = exports.SchemaSummarizer = exports.buildForest = exports.mapTreeWithField = exports.mapTreeFieldsWithField = exports.mapTreeFieldFromCursor = exports.mapTreeFromCursor = exports.cursorForMapTreeNode = exports.cursorForMapTreeField = exports.ForestFormatVersion = exports.getCodecTreeForForestFormat = exports.ForestSummarizer = exports.isTreeValue = exports.assertAllowedValue = exports.allowsValue = exports.toDownPath = void 0;
31
+ exports.getFromChangeAtomIdMap = exports.hasElement = exports.AnchorTreeIndex = exports.makeMitigatedChangeFamily = exports.getCodecTreeForSchemaChangeFormat = exports.EncodedSchemaChange = exports.makeSchemaChangeCodecs = exports.DetachedFieldIndexSummarizer = exports.valueSchemaAllows = exports.TreeCompressionStrategy = exports.withObservation = exports.currentObserver = exports.getOrCreateHydratedFlexTreeNode = exports.FlexTreeEntityKind = exports.indexForAt = exports.treeStatusFromAnchorCache = exports.LazyEntity = exports.getSchemaAndPolicy = exports.flexTreeSlot = exports.assertFlexTreeEntityNotFreed = exports.flexTreeMarker = exports.ContextSlot = exports.isFlexTreeNode = exports.Context = exports.TreeStatus = exports.throwOutOfSchema = exports.isFieldInSchema = exports.isNodeInSchema = exports.SchemaValidationError = exports.getCodecTreeForModularChangeFormat = exports.LocationBasedDataEditor = exports.getBuildsIds = exports.relevantRemovedRoots = exports.intoDelta = exports.fieldKindConfigurations = exports.fieldKinds = exports.defaultSchemaPolicy = exports.DefaultIdBasedDataEditor = exports.DefaultChangeFamily = exports.FieldKinds = exports.nodeKeyTreeIdentifier = exports.MockNodeIdentifierManager = exports.isStableNodeIdentifier = exports.createNodeIdentifierManager = exports.compareLocalNodeIdentifiers = exports.defaultIncrementalEncodingPolicy = exports.combineChunks = exports.emptyChunk = exports.makeFieldBatchCodec = exports.makeTreeChunker = void 0;
32
+ exports.setInChangeAtomIdMap = void 0;
32
33
  var editableTreeBinder_js_1 = require("./editableTreeBinder.js");
33
34
  Object.defineProperty(exports, "toDownPath", { enumerable: true, get: function () { return editableTreeBinder_js_1.toDownPath; } });
34
35
  var valueUtilities_js_1 = require("./valueUtilities.js");
@@ -50,11 +51,8 @@ var index_js_2 = require("./object-forest/index.js");
50
51
  Object.defineProperty(exports, "buildForest", { enumerable: true, get: function () { return index_js_2.buildForest; } });
51
52
  var index_js_3 = require("./schema-index/index.js");
52
53
  Object.defineProperty(exports, "SchemaSummarizer", { enumerable: true, get: function () { return index_js_3.SchemaSummarizer; } });
53
- Object.defineProperty(exports, "encodeTreeSchema", { enumerable: true, get: function () { return index_js_3.encodeTreeSchema; } });
54
54
  Object.defineProperty(exports, "makeSchemaCodec", { enumerable: true, get: function () { return index_js_3.makeSchemaCodec; } });
55
- Object.defineProperty(exports, "makeSchemaCodecs", { enumerable: true, get: function () { return index_js_3.makeSchemaCodecs; } });
56
- Object.defineProperty(exports, "getCodecTreeForSchemaFormat", { enumerable: true, get: function () { return index_js_3.getCodecTreeForSchemaFormat; } });
57
- Object.defineProperty(exports, "clientVersionToSchemaVersion", { enumerable: true, get: function () { return index_js_3.clientVersionToSchemaVersion; } });
55
+ Object.defineProperty(exports, "schemaCodecBuilder", { enumerable: true, get: function () { return index_js_3.schemaCodecBuilder; } });
58
56
  var treeCursorUtils_js_1 = require("./treeCursorUtils.js");
59
57
  Object.defineProperty(exports, "stackTreeNodeCursor", { enumerable: true, get: function () { return treeCursorUtils_js_1.stackTreeNodeCursor; } });
60
58
  Object.defineProperty(exports, "prefixPath", { enumerable: true, get: function () { return treeCursorUtils_js_1.prefixPath; } });
@@ -78,11 +76,15 @@ Object.defineProperty(exports, "FlexFieldKind", { enumerable: true, get: functio
78
76
  Object.defineProperty(exports, "allowsRepoSuperset", { enumerable: true, get: function () { return index_js_4.allowsRepoSuperset; } });
79
77
  Object.defineProperty(exports, "genericFieldKind", { enumerable: true, get: function () { return index_js_4.genericFieldKind; } });
80
78
  Object.defineProperty(exports, "ModularChangeFamily", { enumerable: true, get: function () { return index_js_4.ModularChangeFamily; } });
81
- Object.defineProperty(exports, "EncodedModularChangeset", { enumerable: true, get: function () { return index_js_4.EncodedModularChangeset; } });
79
+ Object.defineProperty(exports, "EncodedModularChangesetV1", { enumerable: true, get: function () { return index_js_4.EncodedModularChangesetV1; } });
80
+ Object.defineProperty(exports, "EncodedModularChangesetV2", { enumerable: true, get: function () { return index_js_4.EncodedModularChangesetV2; } });
82
81
  Object.defineProperty(exports, "updateRefreshers", { enumerable: true, get: function () { return index_js_4.updateRefreshers; } });
83
82
  Object.defineProperty(exports, "isNeverTree", { enumerable: true, get: function () { return index_js_4.isNeverTree; } });
83
+ Object.defineProperty(exports, "DefaultRevisionReplacer", { enumerable: true, get: function () { return index_js_4.DefaultRevisionReplacer; } });
84
84
  var deltaUtils_js_1 = require("./deltaUtils.js");
85
85
  Object.defineProperty(exports, "mapRootChanges", { enumerable: true, get: function () { return deltaUtils_js_1.mapRootChanges; } });
86
+ Object.defineProperty(exports, "nodeIdFromChangeAtom", { enumerable: true, get: function () { return deltaUtils_js_1.nodeIdFromChangeAtom; } });
87
+ Object.defineProperty(exports, "changeAtomFromDetachedNodeId", { enumerable: true, get: function () { return deltaUtils_js_1.changeAtomFromDetachedNodeId; } });
86
88
  var index_js_5 = require("./chunked-forest/index.js");
87
89
  Object.defineProperty(exports, "chunkTree", { enumerable: true, get: function () { return index_js_5.chunkTree; } });
88
90
  Object.defineProperty(exports, "chunkField", { enumerable: true, get: function () { return index_js_5.chunkField; } });
@@ -105,12 +107,14 @@ Object.defineProperty(exports, "nodeKeyTreeIdentifier", { enumerable: true, get:
105
107
  var index_js_7 = require("./default-schema/index.js");
106
108
  Object.defineProperty(exports, "FieldKinds", { enumerable: true, get: function () { return index_js_7.FieldKinds; } });
107
109
  Object.defineProperty(exports, "DefaultChangeFamily", { enumerable: true, get: function () { return index_js_7.DefaultChangeFamily; } });
108
- Object.defineProperty(exports, "DefaultEditBuilder", { enumerable: true, get: function () { return index_js_7.DefaultEditBuilder; } });
110
+ Object.defineProperty(exports, "DefaultIdBasedDataEditor", { enumerable: true, get: function () { return index_js_7.DefaultIdBasedDataEditor; } });
109
111
  Object.defineProperty(exports, "defaultSchemaPolicy", { enumerable: true, get: function () { return index_js_7.defaultSchemaPolicy; } });
110
112
  Object.defineProperty(exports, "fieldKinds", { enumerable: true, get: function () { return index_js_7.fieldKinds; } });
111
113
  Object.defineProperty(exports, "fieldKindConfigurations", { enumerable: true, get: function () { return index_js_7.fieldKindConfigurations; } });
112
114
  Object.defineProperty(exports, "intoDelta", { enumerable: true, get: function () { return index_js_7.intoDelta; } });
113
115
  Object.defineProperty(exports, "relevantRemovedRoots", { enumerable: true, get: function () { return index_js_7.relevantRemovedRoots; } });
116
+ Object.defineProperty(exports, "getBuildsIds", { enumerable: true, get: function () { return index_js_7.getBuildsIds; } });
117
+ Object.defineProperty(exports, "LocationBasedDataEditor", { enumerable: true, get: function () { return index_js_7.LocationBasedDataEditor; } });
114
118
  Object.defineProperty(exports, "getCodecTreeForModularChangeFormat", { enumerable: true, get: function () { return index_js_7.getCodecTreeForModularChangeFormat; } });
115
119
  var schemaChecker_js_1 = require("./schemaChecker.js");
116
120
  Object.defineProperty(exports, "SchemaValidationError", { enumerable: true, get: function () { return schemaChecker_js_1.SchemaValidationError; } });
@@ -149,4 +153,7 @@ Object.defineProperty(exports, "makeMitigatedChangeFamily", { enumerable: true,
149
153
  var index_js_10 = require("./indexing/index.js");
150
154
  Object.defineProperty(exports, "AnchorTreeIndex", { enumerable: true, get: function () { return index_js_10.AnchorTreeIndex; } });
151
155
  Object.defineProperty(exports, "hasElement", { enumerable: true, get: function () { return index_js_10.hasElement; } });
156
+ var changeAtomIdBTree_js_1 = require("./changeAtomIdBTree.js");
157
+ Object.defineProperty(exports, "getFromChangeAtomIdMap", { enumerable: true, get: function () { return changeAtomIdBTree_js_1.getFromChangeAtomIdMap; } });
158
+ Object.defineProperty(exports, "setInChangeAtomIdMap", { enumerable: true, get: function () { return changeAtomIdBTree_js_1.setInChangeAtomIdMap; } });
152
159
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iEAGiC;AADhC,mHAAA,UAAU,OAAA;AAEX,yDAAmF;AAA1E,gHAAA,WAAW,OAAA;AAAE,uHAAA,kBAAkB,OAAA;AAAE,gHAAA,WAAW,OAAA;AAErD,sDAImC;AAHlC,4GAAA,gBAAgB,OAAA;AAChB,uHAAA,2BAA2B,OAAA;AAC3B,+GAAA,mBAAmB,OAAA;AAEpB,uDAW4B;AAV3B,yHAAA,qBAAqB,OAAA;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AAA;AAErC,oDAKiC;AAHhC,kHAAA,sBAAsB,OAAA;AACtB,+GAAA,mBAAmB,OAAA;AACnB,6HAAA,iCAAiC,OAAA;AAGlC,uEAAuE;AAA9D,qIAAA,yBAAyB,OAAA;AAElC,iDAO6B;AAL5B,4GAAA,eAAe,OAAA;AACf,uGAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype DownPath,\n\ttoDownPath,\n} from \"./editableTreeBinder.js\";\nexport { allowsValue, assertAllowedValue, isTreeValue } from \"./valueUtilities.js\";\n\nexport {\n\tForestSummarizer,\n\tgetCodecTreeForForestFormat,\n\tForestFormatVersion,\n} from \"./forest-summary/index.js\";\nexport {\n\tcursorForMapTreeField,\n\tcursorForMapTreeNode,\n\tmapTreeFromCursor,\n\tmapTreeFieldFromCursor,\n\ttype MinimalMapTreeNodeView,\n\tmapTreeFieldsWithField,\n\tmapTreeWithField,\n\ttype MapTreeFieldViewGeneric,\n\ttype MapTreeNodeViewGeneric,\n\ttype MinimalFieldMap,\n} from \"./mapTreeCursor.js\";\nexport { buildForest } from \"./object-forest/index.js\";\nexport {\n\tSchemaSummarizer,\n\tencodeTreeSchema,\n\tmakeSchemaCodec,\n\tmakeSchemaCodecs,\n\tgetCodecTreeForSchemaFormat,\n\tclientVersionToSchemaVersion,\n} from \"./schema-index/index.js\";\nexport {\n\tstackTreeNodeCursor,\n\ttype CursorAdapter,\n\tprefixPath,\n\tprefixFieldPath,\n\ttype CursorWithNode,\n\tstackTreeFieldCursor,\n} from \"./treeCursorUtils.js\";\nexport {\n\tcursorForJsonableTreeNode,\n\tcursorForJsonableTreeField,\n\tjsonableTreeFromCursor,\n\tjsonableTreeFromFieldCursor,\n\tjsonableTreeFromForest,\n} from \"./treeTextCursor.js\";\n\n// Split this up into separate import and export for compatibility with API-Extractor.\nimport * as SequenceField from \"./sequence-field/index.js\";\nexport { SequenceField };\n\nexport {\n\tisNeverField,\n\tModularEditBuilder,\n\ttype FieldEditDescription as EditDescription,\n\ttype FieldChangeHandler,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype FieldChangeMap,\n\ttype FieldChange,\n\ttype FieldChangeset,\n\ttype ToDelta,\n\ttype ModularChangeset,\n\tmakeModularChangeCodecFamily,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\tallowsRepoSuperset,\n\ttype GenericChangeset,\n\tgenericFieldKind,\n\ttype HasFieldChanges,\n\ttype NodeExistsConstraint,\n\tModularChangeFamily,\n\ttype RelevantRemovedRootsFromChild,\n\tEncodedModularChangeset,\n\tupdateRefreshers,\n\ttype NodeId,\n\ttype FieldChangeEncodingContext,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tisNeverTree,\n} from \"./modular-schema/index.js\";\n\nexport { mapRootChanges } from \"./deltaUtils.js\";\n\nexport {\n\ttype TreeChunk,\n\tchunkTree,\n\tchunkField,\n\tchunkFieldSingle,\n\tbuildChunkedForest,\n\tdefaultChunkPolicy,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tFieldBatchFormatVersion,\n\tgetCodecTreeForFieldBatchFormat,\n\tmakeTreeChunker,\n\tmakeFieldBatchCodec,\n\ttype FieldBatchEncodingContext,\n\temptyChunk,\n\tcombineChunks,\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n} from \"./chunked-forest/index.js\";\n\nexport {\n\tcompareLocalNodeIdentifiers,\n\tcreateNodeIdentifierManager,\n\tisStableNodeIdentifier,\n\ttype LocalNodeIdentifier,\n\tMockNodeIdentifierManager,\n\ttype NodeIdentifierManager,\n\tnodeKeyTreeIdentifier,\n\ttype StableNodeIdentifier,\n} from \"./node-identifier/index.js\";\n\nexport {\n\tFieldKinds,\n\ttype Required,\n\ttype Optional,\n\ttype Sequence,\n\ttype Identifier,\n\ttype Forbidden,\n\ttype DefaultChangeset,\n\tDefaultChangeFamily,\n\tDefaultEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\tdefaultSchemaPolicy,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tgetCodecTreeForModularChangeFormat,\n\ttype ModularChangeFormatVersion,\n} from \"./default-schema/index.js\";\n\nexport {\n\tSchemaValidationError,\n\tisNodeInSchema,\n\tisFieldInSchema,\n\tthrowOutOfSchema,\n} from \"./schemaChecker.js\";\n\nexport {\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeContext,\n\ttype FlexTreeHydratedContext,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeEntity,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\tTreeStatus,\n\tContext,\n\ttype FlexTreeNodeEvents,\n\ttype FlexTreeUnknownUnboxed,\n\tisFlexTreeNode,\n\tContextSlot,\n\t// Internal\n\tflexTreeMarker,\n\tassertFlexTreeEntityNotFreed,\n\tflexTreeSlot,\n\tgetSchemaAndPolicy,\n\tLazyEntity,\n\ttreeStatusFromAnchorCache,\n\tindexForAt,\n\tFlexTreeEntityKind,\n\ttype FlexibleNodeContent,\n\ttype FlexibleFieldContent,\n\ttype FlexTreeHydratedContextMinimal,\n\ttype HydratedFlexTreeNode,\n\tgetOrCreateHydratedFlexTreeNode,\n\tcurrentObserver,\n\twithObservation,\n\ttype Observer,\n} from \"./flex-tree/index.js\";\n\nexport { TreeCompressionStrategy } from \"./treeCompressionUtils.js\";\n\nexport { valueSchemaAllows } from \"./valueUtilities.js\";\n\nexport { DetachedFieldIndexSummarizer } from \"./detachedFieldIndexSummarizer.js\";\n\nexport {\n\ttype SchemaChange,\n\tmakeSchemaChangeCodecs,\n\tEncodedSchemaChange,\n\tgetCodecTreeForSchemaChangeFormat,\n} from \"./schema-edits/index.js\";\n\nexport { makeMitigatedChangeFamily } from \"./mitigatedChangeFamily.js\";\n\nexport {\n\ttype KeyFinder,\n\tAnchorTreeIndex,\n\thasElement,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n} from \"./indexing/index.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iEAGiC;AADhC,mHAAA,UAAU,OAAA;AAEX,yDAAmF;AAA1E,gHAAA,WAAW,OAAA;AAAE,uHAAA,kBAAkB,OAAA;AAAE,gHAAA,WAAW,OAAA;AAErD,sDAImC;AAHlC,4GAAA,gBAAgB,OAAA;AAChB,uHAAA,2BAA2B,OAAA;AAC3B,+GAAA,mBAAmB,OAAA;AAEpB,uDAW4B;AAV3B,yHAAA,qBAAqB,OAAA;AACrB,wHAAA,oBAAoB,OAAA;AACpB,qHAAA,iBAAiB,OAAA;AACjB,0HAAA,sBAAsB,OAAA;AAEtB,0HAAA,sBAAsB,OAAA;AACtB,oHAAA,gBAAgB,OAAA;AAKjB,qDAAuD;AAA9C,uGAAA,WAAW,OAAA;AACpB,oDAIiC;AAHhC,4GAAA,gBAAgB,OAAA;AAChB,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAEnB,2DAO8B;AAN7B,yHAAA,mBAAmB,OAAA;AAEnB,gHAAA,UAAU,OAAA;AACV,qHAAA,eAAe,OAAA;AAEf,0HAAA,oBAAoB,OAAA;AAErB,yDAM6B;AAL5B,8HAAA,yBAAyB,OAAA;AACzB,+HAAA,0BAA0B,OAAA;AAC1B,2HAAA,sBAAsB,OAAA;AACtB,gIAAA,2BAA2B,OAAA;AAC3B,2HAAA,sBAAsB,OAAA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AoB,OAAA;AACpB,wGAAA,YAAY,OAAA;AAKZ,mHAAA,uBAAuB,OAAA;AAEvB,8HAAA,kCAAkC,OAAA;AAInC,uDAK4B;AAJ3B,yHAAA,qBAAqB,OAAA;AACrB,kHAAA,cAAc,OAAA;AACd,mHAAA,eAAe,OAAA;AACf,oHAAA,gBAAgB,OAAA;AAGjB,iDAiC8B;AAvB7B,sGAAA,UAAU,OAAA;AACV,mGAAA,OAAO,OAAA;AAGP,0GAAA,cAAc,OAAA;AACd,uGAAA,WAAW,OAAA;AACX,WAAW;AACX,0GAAA,cAAc,OAAA;AACd,wHAAA,4BAA4B,OAAA;AAC5B,wGAAA,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAClB,sGAAA,UAAU,OAAA;AACV,qHAAA,yBAAyB,OAAA;AACzB,sGAAA,UAAU,OAAA;AACV,8GAAA,kBAAkB,OAAA;AAKlB,2HAAA,+BAA+B,OAAA;AAC/B,2GAAA,eAAe,OAAA;AACf,2GAAA,eAAe,OAAA;AAIhB,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAEhC,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAE1B,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AAErC,oDAKiC;AAHhC,kHAAA,sBAAsB,OAAA;AACtB,+GAAA,mBAAmB,OAAA;AACnB,6HAAA,iCAAiC,OAAA;AAGlC,uEAAuE;AAA9D,qIAAA,yBAAyB,OAAA;AAElC,iDAO6B;AAL5B,4GAAA,eAAe,OAAA;AACf,uGAAA,UAAU,OAAA;AAMX,+DAIgC;AAF/B,8HAAA,sBAAsB,OAAA;AACtB,4HAAA,oBAAoB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype DownPath,\n\ttoDownPath,\n} from \"./editableTreeBinder.js\";\nexport { allowsValue, assertAllowedValue, isTreeValue } from \"./valueUtilities.js\";\n\nexport {\n\tForestSummarizer,\n\tgetCodecTreeForForestFormat,\n\tForestFormatVersion,\n} from \"./forest-summary/index.js\";\nexport {\n\tcursorForMapTreeField,\n\tcursorForMapTreeNode,\n\tmapTreeFromCursor,\n\tmapTreeFieldFromCursor,\n\ttype MinimalMapTreeNodeView,\n\tmapTreeFieldsWithField,\n\tmapTreeWithField,\n\ttype MapTreeFieldViewGeneric,\n\ttype MapTreeNodeViewGeneric,\n\ttype MinimalFieldMap,\n} from \"./mapTreeCursor.js\";\nexport { buildForest } from \"./object-forest/index.js\";\nexport {\n\tSchemaSummarizer,\n\tmakeSchemaCodec,\n\tschemaCodecBuilder,\n} from \"./schema-index/index.js\";\nexport {\n\tstackTreeNodeCursor,\n\ttype CursorAdapter,\n\tprefixPath,\n\tprefixFieldPath,\n\ttype CursorWithNode,\n\tstackTreeFieldCursor,\n} from \"./treeCursorUtils.js\";\nexport {\n\tcursorForJsonableTreeNode,\n\tcursorForJsonableTreeField,\n\tjsonableTreeFromCursor,\n\tjsonableTreeFromFieldCursor,\n\tjsonableTreeFromForest,\n} from \"./treeTextCursor.js\";\n\n// Split this up into separate import and export for compatibility with API-Extractor.\nimport * as SequenceField from \"./sequence-field/index.js\";\nexport { SequenceField };\n\nexport {\n\tisNeverField,\n\tModularEditBuilder,\n\ttype FieldEditDescription as EditDescription,\n\ttype FieldChangeHandler,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype FieldChangeMap,\n\ttype FieldChange,\n\ttype FieldChangeset,\n\ttype ToDelta,\n\ttype ModularChangeset,\n\tmakeModularChangeCodecFamily,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\ttype ComposeNodeManager,\n\ttype InvertNodeManager,\n\ttype RebaseNodeManager,\n\tCrossFieldTarget,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\tallowsRepoSuperset,\n\ttype GenericChangeset,\n\tgenericFieldKind,\n\ttype HasFieldChanges,\n\ttype NodeExistsConstraint,\n\tModularChangeFamily,\n\tEncodedModularChangesetV1,\n\tEncodedModularChangesetV2,\n\tupdateRefreshers,\n\ttype NodeId,\n\ttype FieldChangeEncodingContext,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tisNeverTree,\n\tDefaultRevisionReplacer,\n} from \"./modular-schema/index.js\";\n\nexport {\n\tmapRootChanges,\n\tnodeIdFromChangeAtom,\n\tchangeAtomFromDetachedNodeId,\n} from \"./deltaUtils.js\";\n\nexport {\n\ttype TreeChunk,\n\tchunkTree,\n\tchunkField,\n\tchunkFieldSingle,\n\tbuildChunkedForest,\n\tdefaultChunkPolicy,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tFieldBatchFormatVersion,\n\tgetCodecTreeForFieldBatchFormat,\n\tmakeTreeChunker,\n\tmakeFieldBatchCodec,\n\ttype FieldBatchEncodingContext,\n\temptyChunk,\n\tcombineChunks,\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n} from \"./chunked-forest/index.js\";\n\nexport {\n\tcompareLocalNodeIdentifiers,\n\tcreateNodeIdentifierManager,\n\tisStableNodeIdentifier,\n\ttype LocalNodeIdentifier,\n\tMockNodeIdentifierManager,\n\ttype NodeIdentifierManager,\n\tnodeKeyTreeIdentifier,\n\ttype StableNodeIdentifier,\n} from \"./node-identifier/index.js\";\n\nexport {\n\tFieldKinds,\n\ttype Required,\n\ttype Optional,\n\ttype Sequence,\n\ttype Identifier,\n\ttype Forbidden,\n\ttype DefaultChangeset,\n\ttype DetachedRootIds,\n\tDefaultChangeFamily,\n\ttype IdBasedChangeFamilyDataEditor,\n\tDefaultIdBasedDataEditor,\n\ttype DataEditor,\n\ttype RequiredFieldEditor,\n\ttype OptionalFieldEditor,\n\ttype SequenceFieldEditor,\n\tdefaultSchemaPolicy,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tgetBuildsIds,\n\ttype DetachedRootLocation,\n\ttype DetachedRootsLocation,\n\ttype DetachedRootIdRange,\n\ttype Locator,\n\tLocationBasedDataEditor,\n\ttype ILocationBasedDataEditor,\n\tgetCodecTreeForModularChangeFormat,\n\ttype ModularChangeFormatVersion,\n} from \"./default-schema/index.js\";\n\nexport {\n\tSchemaValidationError,\n\tisNodeInSchema,\n\tisFieldInSchema,\n\tthrowOutOfSchema,\n} from \"./schemaChecker.js\";\n\nexport {\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeContext,\n\ttype FlexTreeHydratedContext,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeEntity,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\tTreeStatus,\n\tContext,\n\ttype FlexTreeNodeEvents,\n\ttype FlexTreeUnknownUnboxed,\n\tisFlexTreeNode,\n\tContextSlot,\n\t// Internal\n\tflexTreeMarker,\n\tassertFlexTreeEntityNotFreed,\n\tflexTreeSlot,\n\tgetSchemaAndPolicy,\n\tLazyEntity,\n\ttreeStatusFromAnchorCache,\n\tindexForAt,\n\tFlexTreeEntityKind,\n\ttype FlexibleNodeContent,\n\ttype FlexibleFieldContent,\n\ttype FlexTreeHydratedContextMinimal,\n\ttype HydratedFlexTreeNode,\n\tgetOrCreateHydratedFlexTreeNode,\n\tcurrentObserver,\n\twithObservation,\n\ttype Observer,\n} from \"./flex-tree/index.js\";\n\nexport { TreeCompressionStrategy } from \"./treeCompressionUtils.js\";\n\nexport { valueSchemaAllows } from \"./valueUtilities.js\";\n\nexport { DetachedFieldIndexSummarizer } from \"./detachedFieldIndexSummarizer.js\";\n\nexport {\n\ttype SchemaChange,\n\tmakeSchemaChangeCodecs,\n\tEncodedSchemaChange,\n\tgetCodecTreeForSchemaChangeFormat,\n} from \"./schema-edits/index.js\";\n\nexport { makeMitigatedChangeFamily } from \"./mitigatedChangeFamily.js\";\n\nexport {\n\ttype KeyFinder,\n\tAnchorTreeIndex,\n\thasElement,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n} from \"./indexing/index.js\";\n\nexport {\n\ttype ChangeAtomIdBTree,\n\tgetFromChangeAtomIdMap,\n\tsetInChangeAtomIdMap,\n} from \"./changeAtomIdBTree.js\";\n"]}
@@ -314,14 +314,14 @@ class AnchorTreeIndex {
314
314
  * Given a cursor in field mode, indexes all nodes under the field and then indexes all nodes up the spine.
315
315
  */
316
316
  indexSpine(cursor) {
317
- if ((0, index_js_1.keyAsDetachedField)(cursor.getFieldKey()) !== index_js_1.rootField) {
318
- cursor.exitField();
319
- cursor.exitNode();
320
- }
321
- else {
317
+ if ((0, index_js_1.keyAsDetachedField)(cursor.getFieldKey()) === index_js_1.rootField) {
322
318
  // return early if we're already at the root field
323
319
  return;
324
320
  }
321
+ else {
322
+ cursor.exitField();
323
+ cursor.exitNode();
324
+ }
325
325
  // walk up the spine and index nodes until we reach the root
326
326
  while (cursor.mode === 1 /* CursorLocationType.Fields */ &&
327
327
  (0, index_js_1.keyAsDetachedField)(cursor.getFieldKey()) !== index_js_1.rootField) {
@@ -374,7 +374,7 @@ function filterNodes(anchorNodes, filter) {
374
374
  * Checks that an array is of the type {@link TreeIndexNodes} and has at least one element.
375
375
  */
376
376
  function hasElement(array) {
377
- return array.length >= 1;
377
+ return array.length > 0;
378
378
  }
379
379
  exports.hasElement = hasElement;
380
380
  //# sourceMappingURL=anchorTreeIndex.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"anchorTreeIndex.js","sourceRoot":"","sources":["../../../src/feature-libraries/indexing/anchorTreeIndex.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AAEnE,kDAkB6B;AAC7B,kDAAiE;AACjE,oDAAmD;AAiBnD;;;;;;;GAOG;AACH,MAAa,eAAe;IA4B3B;;;;;;;;OAQG;IACH,YACkB,MAA2B,EAC3B,OAEe,EACf,QAAyE,EACzE,eAA6D,EAC7D,iBAAiB,KAAK;Q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C;AAED;;GAEG;AACH,SAAgB,UAAU,CAAI,KAAmB;IAChD,OAAO,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;AAC1B,CAAC;AAFD,gCAEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype Anchor,\n\ttype AnchorNode,\n\ttype FieldKey,\n\ttype TreeNodeSchemaIdentifier,\n\tforEachField,\n\tforEachNode,\n\ttype ITreeSubscriptionCursor,\n\tcreateAnnouncedVisitor,\n\ttype IForestSubscription,\n\ttype AnnouncedVisitor,\n\tCursorLocationType,\n\trootField,\n\ttype UpPath,\n\tkeyAsDetachedField,\n\tcompareUpPaths,\n\tTreeNavigationResult,\n\ttype ITreeCursorSynchronous,\n} from \"../../core/index.js\";\nimport { disposeSymbol, getOrCreate } from \"../../util/index.js\";\nimport { TreeStatus } from \"../flex-tree/index.js\";\n\nimport type { TreeIndex, TreeIndexKey, TreeIndexNodes } from \"./types.js\";\n\n/**\n * A function that gets the value to index a node on, must be pure and functional.\n * The given cursor should point to the node that will be indexed.\n *\n * @returns a value the index will use as the key for the given node\n *\n * @remarks\n * This function does not own the cursor in any way, it walks the cursor to find the key the node is indexed on\n * but returns the cursor to the state it was in before being passed to the function. It should also not be disposed by this function\n * and must be disposed elsewhere.\n */\nexport type KeyFinder<TKey extends TreeIndexKey> = (tree: ITreeSubscriptionCursor) => TKey;\n\n/**\n * An index from some arbitrary keys to anchor nodes. Keys can be anything that is a {@link TreeValue}.\n * A key can map to multiple nodes but each collection of nodes only results in a single value.\n *\n * @remarks\n * Detached nodes are stored in the index but filtered out when any public facing apis are called. This means that\n * calling {@link keys} will not include any keys that are stored in the index but only map to detached nodes.\n */\nexport class AnchorTreeIndex<TKey extends TreeIndexKey, TValue>\n\timplements TreeIndex<TKey, TValue>\n{\n\tpublic disposed = false;\n\t/**\n\t * Caches {@link KeyFinder}s for each schema definition. If a schema maps to null, it does not\n\t * need to be considered at all for this index. This allows us to skip subtrees that aren't relevant\n\t * as a performance optimization.\n\t */\n\tprivate readonly keyFinders = new Map<TreeNodeSchemaIdentifier, KeyFinder<TKey> | null>();\n\t/**\n\t * The actual index from keys to anchor nodes.\n\t */\n\tprivate readonly keyToNodes = new Map<TKey, AnchorNode[]>();\n\t/**\n\t * Maintained for efficient removal of anchor nodes from the index when updating their keys\n\t */\n\tprivate readonly nodeToKey = new Map<AnchorNode, TKey>();\n\t/**\n\t * Keeps track of anchors for disposal.\n\t */\n\tprivate readonly anchors = new Map<AnchorNode, Anchor[]>();\n\t/**\n\t * The key finder that is registered on the forest to keep this index updated, maintained\n\t * here for deregistration on disposal\n\t */\n\tprivate readonly keyFinder = this.acquireVisitor.bind(this);\n\n\t/**\n\t * @param forest - the forest that is being indexed\n\t * @param indexer - a function that retrieves the key finder based on a given schema or undefined if the schema does not have an associated key finder\n\t * @param getValue - a pure and functional function that returns the associated value of one or more anchor nodes, can be used to map and filter the indexed anchor nodes\n\t * so that the values returned from the index are more usable\n\t * @param checkTreeStatus - a function that gets the tree status from an anchor node, used for filtering out detached nodes\n\t * @param isShallowIndex - indicates if this index is shallow, meaning that it only allows nodes to be keyed off of fields directly under them rather than anywhere in their subtree.\n\t * As a performance optimization, re-indexing up the spine can be turned off for shallow indexes.\n\t */\n\tpublic constructor(\n\t\tprivate readonly forest: IForestSubscription,\n\t\tprivate readonly indexer: (\n\t\t\tschemaId: TreeNodeSchemaIdentifier,\n\t\t) => KeyFinder<TKey> | undefined,\n\t\tprivate readonly getValue: (anchorNodes: TreeIndexNodes<AnchorNode>) => TValue | undefined,\n\t\tprivate readonly checkTreeStatus: (node: AnchorNode) => TreeStatus | undefined,\n\t\tprivate readonly isShallowIndex = false,\n\t) {\n\t\tthis.forest.registerAnnouncedVisitor(this.keyFinder);\n\n\t\tconst detachedFieldKeys: FieldKey[] = [];\n\t\tconst detachedFieldsCursor = forest.getCursorAboveDetachedFields();\n\t\tforEachField(detachedFieldsCursor, (field) => {\n\t\t\tdetachedFieldKeys.push(field.getFieldKey());\n\t\t});\n\n\t\t// index all existing trees (this includes the primary document tree and all other detached/removed trees)\n\t\tfor (const fieldKey of detachedFieldKeys) {\n\t\t\tconst cursor = forest.allocateCursor();\n\t\t\tforest.tryMoveCursorToField({ fieldKey, parent: undefined }, cursor);\n\t\t\tthis.indexField(cursor);\n\t\t\tcursor.free();\n\t\t}\n\t}\n\n\t/**\n\t * Creates an announced visitor that responds to edits to the forest and updates the index accordingly.\n\t */\n\tprivate acquireVisitor(): AnnouncedVisitor {\n\t\tthis.checkNotDisposed(\n\t\t\t\"visitor getter should be deregistered from the forest when index is disposed\",\n\t\t);\n\t\tlet parentField: FieldKey | undefined;\n\t\tlet parent: UpPath | undefined;\n\n\t\treturn createAnnouncedVisitor({\n\t\t\t// nodes (and their entire subtrees) are added to the index as soon as they are created\n\t\t\tafterCreate: (content: readonly ITreeCursorSynchronous[], destination: FieldKey) => {\n\t\t\t\tconst detachedCursor = this.forest.allocateCursor();\n\t\t\t\tassert(\n\t\t\t\t\tthis.forest.tryMoveCursorToField(\n\t\t\t\t\t\t{ fieldKey: destination, parent: undefined },\n\t\t\t\t\t\tdetachedCursor,\n\t\t\t\t\t) === TreeNavigationResult.Ok,\n\t\t\t\t\t0xa8a /* destination of created nodes must be a valid detached field */,\n\t\t\t\t);\n\t\t\t\tthis.indexField(detachedCursor);\n\t\t\t\tdetachedCursor.free();\n\t\t\t},\n\t\t\tafterAttach: () => {\n\t\t\t\tassert(parent !== undefined, 0xa99 /* must have a parent */);\n\t\t\t\tthis.reIndexSpine(parent);\n\t\t\t},\n\t\t\tafterDetach: (_source, _count_, _destination, isReplaced) => {\n\t\t\t\tif (isReplaced) {\n\t\t\t\t\t// If the node will be replaced, we defer re-indexing until the corresponding attach event.\n\t\t\t\t\t// This has performance benefits but is also required to avoid experiencing the error case where the field that is used as the indexing key is empty.\n\t\t\t\t} else {\n\t\t\t\t\tassert(parent !== undefined, 0xa9a /* must have a parent */);\n\t\t\t\t\tthis.reIndexSpine(parent);\n\t\t\t\t}\n\t\t\t},\n\t\t\t// the methods below are used to keep track of the path that has been traversed by the visitor\n\t\t\t// this is required so that cursors can be moved to the correct location when index updates are required\n\t\t\tenterNode(index: number): void {\n\t\t\t\tassert(parentField !== undefined, 0xa8d /* must be in a field to enter node */);\n\n\t\t\t\tparent = {\n\t\t\t\t\tparent,\n\t\t\t\t\tparentField,\n\t\t\t\t\tparentIndex: index,\n\t\t\t\t};\n\t\t\t\tparentField = undefined;\n\t\t\t},\n\t\t\texitNode(index: number): void {\n\t\t\t\tassert(parent !== undefined, 0xa8e /* must have parent node */);\n\t\t\t\tconst temp = parent;\n\t\t\t\tparentField = temp.parentField;\n\t\t\t\tparent = temp.parent;\n\t\t\t},\n\t\t\tenterField: (key: FieldKey) => {\n\t\t\t\tparentField = key;\n\t\t\t},\n\t\t\texitField(key: FieldKey): void {\n\t\t\t\tparentField = undefined;\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * Returns the value associated with the given key if it has been indexed\n\t */\n\tpublic get(key: TKey): TValue | undefined {\n\t\tthis.checkNotDisposed();\n\t\treturn this.getFilteredValue(this.keyToNodes.get(key));\n\t}\n\n\t/**\n\t * Returns true iff the key exists in the index\n\t */\n\tpublic has(key: TKey): boolean {\n\t\tthis.checkNotDisposed();\n\t\treturn this.get(key) !== undefined;\n\t}\n\n\t/**\n\t * Returns the number of values that are indexed\n\t */\n\tpublic get size(): number {\n\t\tthis.checkNotDisposed();\n\t\tlet s = 0;\n\t\tfor (const nodes of this.keyToNodes.values()) {\n\t\t\tif (this.getFilteredValue(nodes) !== undefined) {\n\t\t\t\ts += 1;\n\t\t\t}\n\t\t}\n\t\treturn s;\n\t}\n\n\t/**\n\t * Returns all keys in the index\n\t */\n\tpublic *keys(): IterableIterator<TKey> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tif (this.getFilteredValue(nodes) !== undefined) {\n\t\t\t\tyield key;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterable of values in the index\n\t */\n\tpublic *values(): IterableIterator<TValue> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const nodes of this.keyToNodes.values()) {\n\t\t\tconst filtered = this.getFilteredValue(nodes);\n\t\t\tif (filtered !== undefined) {\n\t\t\t\tyield filtered;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the index\n\t */\n\tpublic *entries(): IterableIterator<[TKey, TValue]> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tconst filtered = this.getFilteredValue(nodes);\n\t\t\tif (filtered !== undefined) {\n\t\t\t\tyield [key, filtered];\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<[TKey, TValue]> {\n\t\tthis.checkNotDisposed();\n\t\treturn this.entries();\n\t}\n\n\t/**\n\t * Applies the provided callback to each entry in the index.\n\t */\n\tpublic forEach(\n\t\tcallbackfn: (value: TValue, key: TKey, map: AnchorTreeIndex<TKey, TValue>) => void,\n\t\tthisArg?: unknown,\n\t): void {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tconst filtered = this.getFilteredValue(nodes);\n\t\t\tif (filtered !== undefined) {\n\t\t\t\tcallbackfn.call(thisArg, filtered, key, this);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the index, including ones that are detached.\n\t * This function should only be used for testing purposes, it is not exposed as part of the public {@link TreeIndex} API.\n\t */\n\tpublic *allEntries(): IterableIterator<[TKey, TValue]> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tconst value = this.getValue(nodes as unknown as TreeIndexNodes<AnchorNode>);\n\t\t\tif (value !== undefined) {\n\t\t\t\tyield [key, value];\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic dispose(): void {\n\t\tthis[disposeSymbol]();\n\t}\n\n\t/**\n\t * Disposes this index and all the anchors it holds onto.\n\t */\n\tpublic [disposeSymbol](): void {\n\t\tthis.checkNotDisposed(\"index is already disposed\");\n\t\tfor (const anchors of this.anchors.values()) {\n\t\t\tfor (const anchor of anchors) {\n\t\t\t\tthis.forest.forgetAnchor(anchor);\n\t\t\t}\n\t\t}\n\t\tthis.keyToNodes.clear();\n\t\tthis.anchors.clear();\n\t\tthis.forest.deregisterAnnouncedVisitor(this.keyFinder);\n\t\tthis.disposed = true;\n\t}\n\n\t/**\n\t * Checks if the spine needs to be re-indexed and if so, re-indexes it starting from the given path.\n\t */\n\tprivate reIndexSpine(path: UpPath): void {\n\t\tconst cursor = this.forest.allocateCursor();\n\t\tthis.forest.moveCursorToPath(path, cursor);\n\t\tassert(\n\t\t\tcursor.mode === CursorLocationType.Nodes,\n\t\t\t0xa9b /* attach should happen in a node */,\n\t\t);\n\t\tcursor.exitNode();\n\t\t// TODO ADO:36390 avoid re-indexing the whole field when not necessary\n\t\tthis.indexField(cursor);\n\t\tif (!this.isShallowIndex) {\n\t\t\tthis.indexSpine(cursor);\n\t\t}\n\t\tcursor.clear();\n\t}\n\n\tprivate checkNotDisposed(errorMessage?: string): void {\n\t\tif (this.disposed) {\n\t\t\tif (errorMessage !== undefined) {\n\t\t\t\tthrow new Error(errorMessage);\n\t\t\t}\n\t\t\tassert(false, 0xa8f /* invalid operation on a disposed index */);\n\t\t}\n\t}\n\n\t/**\n\t * Given a cursor in node mode, indexes it.\n\t */\n\tprivate indexNode(nodeCursor: ITreeSubscriptionCursor): void {\n\t\tconst keyFinder = getOrCreate(\n\t\t\tthis.keyFinders,\n\t\t\t// the node schema type to look up\n\t\t\tnodeCursor.type,\n\t\t\t// if the indexer does not return a key finder for this schema, we cache a null value to indicate the indexer\n\t\t\t// does not need to be called if this schema is encountered in the future\n\t\t\t(schema) => this.indexer(schema) ?? null,\n\t\t);\n\n\t\tif (keyFinder !== null) {\n\t\t\tconst expectedPath = nodeCursor.getPath();\n\t\t\tconst key = keyFinder(nodeCursor);\n\t\t\t// TODO: determine perf impact of this check, alternative is not doing it in which case (if the key finder is not pure and functional),\n\t\t\t// an error may be thrown further down the line if the structure of the nodes aren't expected or the contents of the index could be inaccurate\n\t\t\tif (!compareUpPaths(nodeCursor.getPath(), expectedPath)) {\n\t\t\t\tthrow new Error(\"key finder should be pure and functional\");\n\t\t\t}\n\t\t\tconst anchor = nodeCursor.buildAnchor();\n\t\t\tconst anchorNode =\n\t\t\t\tthis.forest.anchors.locate(anchor) ?? fail(0xb16 /* expected anchor node */);\n\n\t\t\t// check if this anchor node already exists in the index\n\t\t\tconst existingKey = this.nodeToKey.get(anchorNode);\n\t\t\tif (existingKey !== undefined) {\n\t\t\t\t// if the node already exists but has the same key, we return early\n\t\t\t\tif (existingKey === key) {\n\t\t\t\t\tthis.forest.forgetAnchor(anchor);\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\t// if the node has a different key, we remove the existing one first because it means the key had been detached\n\t\t\t\t\tthis.removeAnchor(anchorNode, existingKey);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tgetOrCreate(this.keyToNodes, key, () => []).push(anchorNode);\n\t\t\tthis.nodeToKey.set(anchorNode, key);\n\n\t\t\tgetOrCreate(this.anchors, anchorNode, () => []).push(anchor);\n\t\t\t// when the anchor node is destroyed, delete it from the index\n\t\t\tanchorNode.events.on(\"afterDestroy\", () => {\n\t\t\t\tthis.removeAnchor(anchorNode, key);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Given a cursor in field mode, recursively indexes all nodes under the field.\n\t */\n\tprivate indexField(fieldCursor: ITreeSubscriptionCursor): void {\n\t\tforEachNode(fieldCursor, (nodeCursor) => {\n\t\t\tthis.indexNode(nodeCursor);\n\n\t\t\tforEachField(nodeCursor, (f) => {\n\t\t\t\tthis.indexField(f);\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Given a cursor in field mode, indexes all nodes under the field and then indexes all nodes up the spine.\n\t */\n\tprivate indexSpine(cursor: ITreeSubscriptionCursor): void {\n\t\tif (keyAsDetachedField(cursor.getFieldKey()) !== rootField) {\n\t\t\tcursor.exitField();\n\t\t\tcursor.exitNode();\n\t\t} else {\n\t\t\t// return early if we're already at the root field\n\t\t\treturn;\n\t\t}\n\n\t\t// walk up the spine and index nodes until we reach the root\n\t\twhile (\n\t\t\tcursor.mode === CursorLocationType.Fields &&\n\t\t\tkeyAsDetachedField(cursor.getFieldKey()) !== rootField\n\t\t) {\n\t\t\tforEachNode(cursor, (nodeCursor) => {\n\t\t\t\tthis.indexNode(nodeCursor);\n\t\t\t});\n\n\t\t\tcursor.exitField();\n\t\t\tcursor.exitNode();\n\t\t}\n\t}\n\n\tprivate removeAnchor(anchorNode: AnchorNode, key: TKey): void {\n\t\tconst indexedNodes = this.keyToNodes.get(key);\n\t\tassert(\n\t\t\tindexedNodes !== undefined,\n\t\t\t0xa90 /* destroyed anchor node should be tracked by index */,\n\t\t);\n\t\tconst index = indexedNodes.indexOf(anchorNode);\n\t\tassert(index !== -1, 0xa91 /* destroyed anchor node should be tracked by index */);\n\t\tconst newNodes = filterNodes(indexedNodes, (n) => n !== anchorNode);\n\t\tif (newNodes !== undefined && newNodes.length > 0) {\n\t\t\tthis.keyToNodes.set(key, newNodes);\n\t\t} else {\n\t\t\tthis.keyToNodes.delete(key);\n\t\t}\n\t\tthis.nodeToKey.delete(anchorNode);\n\t\tassert(\n\t\t\tthis.anchors.delete(anchorNode),\n\t\t\t0xa92 /* destroyed anchor should be tracked by index */,\n\t\t);\n\t}\n\n\t/**\n\t * Filters out any anchor nodes that are detached and returns the value for the remaining nodes.\n\t */\n\tprivate getFilteredValue(anchorNodes: AnchorNode[] | undefined): TValue | undefined {\n\t\tconst attachedNodes = filterNodes(anchorNodes, (anchorNode) => {\n\t\t\tconst nodeStatus = this.checkTreeStatus(anchorNode);\n\t\t\treturn nodeStatus === TreeStatus.InDocument;\n\t\t});\n\n\t\tif (attachedNodes !== undefined && hasElement(attachedNodes)) {\n\t\t\treturn this.getValue(attachedNodes);\n\t\t}\n\t}\n}\n\n/**\n * Filters the given anchor nodes based on the given filter function.\n */\nfunction filterNodes(\n\tanchorNodes: readonly AnchorNode[] | undefined,\n\tfilter: (node: AnchorNode) => boolean,\n): AnchorNode[] | undefined {\n\tif (anchorNodes !== undefined) {\n\t\treturn anchorNodes.filter(filter);\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Checks that an array is of the type {@link TreeIndexNodes} and has at least one element.\n */\nexport function hasElement<T>(array: readonly T[]): array is TreeIndexNodes<T> {\n\treturn array.length >= 1;\n}\n"]}
1
+ {"version":3,"file":"anchorTreeIndex.js","sourceRoot":"","sources":["../../../src/feature-libraries/indexing/anchorTreeIndex.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AAEnE,kDAkB6B;AAC7B,kDAAiE;AACjE,oDAAmD;AAiBnD;;;;;;;GAOG;AACH,MAAa,eAAe;IA4B3B;;;;;;;;OAQG;IACH,YACkB,MAA2B,EAC3B,OAEe,EACf,QAAyE,EACzE,eAA6D,EAC7D,iBAAiB,KAAK;QANtB,WAAM,GAAN,MAAM,CAAqB;QAC3B,YAAO,GAAP,OAAO,CAEQ;QACf,aAAQ,GAAR,QAAQ,CAAiE;QACzE,oBAAe,GAAf,eAAe,CAA8C;QAC7D,mBAAc,GAAd,cAAc,CAAQ;QAzCjC,aAAQ,GAAG,KAAK,CAAC;QACxB;;;;WAIG;QACc,eAAU,GAAG,IAAI,GAAG,EAAoD,CAAC;QAC1F;;WAEG;QACc,eAAU,GAAG,IAAI,GAAG,EAAsB,CAAC;QAC5D;;WAEG;QACc,cAAS,GAAG,IAAI,GAAG,EAAoB,CAAC;QACzD;;WAEG;QACc,YAAO,GAAG,IAAI,GAAG,EAAwB,CAAC;QAC3D;;;WAGG;Q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AAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAClC,IAAA,iBAAM,EACL,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,EAC/B,KAAK,CAAC,iDAAiD,CACvD,CAAC;IACH,CAAC;IAED;;OAEG;IACK,gBAAgB,CAAC,WAAqC;QAC7D,MAAM,aAAa,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,EAAE;YAC7D,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;YACpD,OAAO,UAAU,KAAK,qBAAU,CAAC,UAAU,CAAC;QAC7C,CAAC,CAAC,CAAC;QAEH,IAAI,aAAa,KAAK,SAAS,IAAI,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;YAC9D,OAAO,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QACrC,CAAC;IACF,CAAC;CACD;AAhZD,0CAgZC;AAED;;GAEG;AACH,SAAS,WAAW,CACnB,WAA8C,EAC9C,MAAqC;IAErC,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAgB,UAAU,CAAI,KAAmB;IAChD,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AACzB,CAAC;AAFD,gCAEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype Anchor,\n\ttype AnchorNode,\n\ttype FieldKey,\n\ttype TreeNodeSchemaIdentifier,\n\tforEachField,\n\tforEachNode,\n\ttype ITreeSubscriptionCursor,\n\tcreateAnnouncedVisitor,\n\ttype IForestSubscription,\n\ttype AnnouncedVisitor,\n\tCursorLocationType,\n\trootField,\n\ttype UpPath,\n\tkeyAsDetachedField,\n\tcompareUpPaths,\n\tTreeNavigationResult,\n\ttype ITreeCursorSynchronous,\n} from \"../../core/index.js\";\nimport { disposeSymbol, getOrCreate } from \"../../util/index.js\";\nimport { TreeStatus } from \"../flex-tree/index.js\";\n\nimport type { TreeIndex, TreeIndexKey, TreeIndexNodes } from \"./types.js\";\n\n/**\n * A function that gets the value to index a node on, must be pure and functional.\n * The given cursor should point to the node that will be indexed.\n *\n * @returns a value the index will use as the key for the given node\n *\n * @remarks\n * This function does not own the cursor in any way, it walks the cursor to find the key the node is indexed on\n * but returns the cursor to the state it was in before being passed to the function. It should also not be disposed by this function\n * and must be disposed elsewhere.\n */\nexport type KeyFinder<TKey extends TreeIndexKey> = (tree: ITreeSubscriptionCursor) => TKey;\n\n/**\n * An index from some arbitrary keys to anchor nodes. Keys can be anything that is a {@link TreeValue}.\n * A key can map to multiple nodes but each collection of nodes only results in a single value.\n *\n * @remarks\n * Detached nodes are stored in the index but filtered out when any public facing apis are called. This means that\n * calling {@link keys} will not include any keys that are stored in the index but only map to detached nodes.\n */\nexport class AnchorTreeIndex<TKey extends TreeIndexKey, TValue>\n\timplements TreeIndex<TKey, TValue>\n{\n\tpublic disposed = false;\n\t/**\n\t * Caches {@link KeyFinder}s for each schema definition. If a schema maps to null, it does not\n\t * need to be considered at all for this index. This allows us to skip subtrees that aren't relevant\n\t * as a performance optimization.\n\t */\n\tprivate readonly keyFinders = new Map<TreeNodeSchemaIdentifier, KeyFinder<TKey> | null>();\n\t/**\n\t * The actual index from keys to anchor nodes.\n\t */\n\tprivate readonly keyToNodes = new Map<TKey, AnchorNode[]>();\n\t/**\n\t * Maintained for efficient removal of anchor nodes from the index when updating their keys\n\t */\n\tprivate readonly nodeToKey = new Map<AnchorNode, TKey>();\n\t/**\n\t * Keeps track of anchors for disposal.\n\t */\n\tprivate readonly anchors = new Map<AnchorNode, Anchor[]>();\n\t/**\n\t * The key finder that is registered on the forest to keep this index updated, maintained\n\t * here for deregistration on disposal\n\t */\n\tprivate readonly keyFinder = this.acquireVisitor.bind(this);\n\n\t/**\n\t * @param forest - the forest that is being indexed\n\t * @param indexer - a function that retrieves the key finder based on a given schema or undefined if the schema does not have an associated key finder\n\t * @param getValue - a pure and functional function that returns the associated value of one or more anchor nodes, can be used to map and filter the indexed anchor nodes\n\t * so that the values returned from the index are more usable\n\t * @param checkTreeStatus - a function that gets the tree status from an anchor node, used for filtering out detached nodes\n\t * @param isShallowIndex - indicates if this index is shallow, meaning that it only allows nodes to be keyed off of fields directly under them rather than anywhere in their subtree.\n\t * As a performance optimization, re-indexing up the spine can be turned off for shallow indexes.\n\t */\n\tpublic constructor(\n\t\tprivate readonly forest: IForestSubscription,\n\t\tprivate readonly indexer: (\n\t\t\tschemaId: TreeNodeSchemaIdentifier,\n\t\t) => KeyFinder<TKey> | undefined,\n\t\tprivate readonly getValue: (anchorNodes: TreeIndexNodes<AnchorNode>) => TValue | undefined,\n\t\tprivate readonly checkTreeStatus: (node: AnchorNode) => TreeStatus | undefined,\n\t\tprivate readonly isShallowIndex = false,\n\t) {\n\t\tthis.forest.registerAnnouncedVisitor(this.keyFinder);\n\n\t\tconst detachedFieldKeys: FieldKey[] = [];\n\t\tconst detachedFieldsCursor = forest.getCursorAboveDetachedFields();\n\t\tforEachField(detachedFieldsCursor, (field) => {\n\t\t\tdetachedFieldKeys.push(field.getFieldKey());\n\t\t});\n\n\t\t// index all existing trees (this includes the primary document tree and all other detached/removed trees)\n\t\tfor (const fieldKey of detachedFieldKeys) {\n\t\t\tconst cursor = forest.allocateCursor();\n\t\t\tforest.tryMoveCursorToField({ fieldKey, parent: undefined }, cursor);\n\t\t\tthis.indexField(cursor);\n\t\t\tcursor.free();\n\t\t}\n\t}\n\n\t/**\n\t * Creates an announced visitor that responds to edits to the forest and updates the index accordingly.\n\t */\n\tprivate acquireVisitor(): AnnouncedVisitor {\n\t\tthis.checkNotDisposed(\n\t\t\t\"visitor getter should be deregistered from the forest when index is disposed\",\n\t\t);\n\t\tlet parentField: FieldKey | undefined;\n\t\tlet parent: UpPath | undefined;\n\n\t\treturn createAnnouncedVisitor({\n\t\t\t// nodes (and their entire subtrees) are added to the index as soon as they are created\n\t\t\tafterCreate: (content: readonly ITreeCursorSynchronous[], destination: FieldKey) => {\n\t\t\t\tconst detachedCursor = this.forest.allocateCursor();\n\t\t\t\tassert(\n\t\t\t\t\tthis.forest.tryMoveCursorToField(\n\t\t\t\t\t\t{ fieldKey: destination, parent: undefined },\n\t\t\t\t\t\tdetachedCursor,\n\t\t\t\t\t) === TreeNavigationResult.Ok,\n\t\t\t\t\t0xa8a /* destination of created nodes must be a valid detached field */,\n\t\t\t\t);\n\t\t\t\tthis.indexField(detachedCursor);\n\t\t\t\tdetachedCursor.free();\n\t\t\t},\n\t\t\tafterAttach: () => {\n\t\t\t\tassert(parent !== undefined, 0xa99 /* must have a parent */);\n\t\t\t\tthis.reIndexSpine(parent);\n\t\t\t},\n\t\t\tafterDetach: (_source, _count_, _destination, isReplaced) => {\n\t\t\t\tif (isReplaced) {\n\t\t\t\t\t// If the node will be replaced, we defer re-indexing until the corresponding attach event.\n\t\t\t\t\t// This has performance benefits but is also required to avoid experiencing the error case where the field that is used as the indexing key is empty.\n\t\t\t\t} else {\n\t\t\t\t\tassert(parent !== undefined, 0xa9a /* must have a parent */);\n\t\t\t\t\tthis.reIndexSpine(parent);\n\t\t\t\t}\n\t\t\t},\n\t\t\t// the methods below are used to keep track of the path that has been traversed by the visitor\n\t\t\t// this is required so that cursors can be moved to the correct location when index updates are required\n\t\t\tenterNode(index: number): void {\n\t\t\t\tassert(parentField !== undefined, 0xa8d /* must be in a field to enter node */);\n\n\t\t\t\tparent = {\n\t\t\t\t\tparent,\n\t\t\t\t\tparentField,\n\t\t\t\t\tparentIndex: index,\n\t\t\t\t};\n\t\t\t\tparentField = undefined;\n\t\t\t},\n\t\t\texitNode(index: number): void {\n\t\t\t\tassert(parent !== undefined, 0xa8e /* must have parent node */);\n\t\t\t\tconst temp = parent;\n\t\t\t\tparentField = temp.parentField;\n\t\t\t\tparent = temp.parent;\n\t\t\t},\n\t\t\tenterField: (key: FieldKey) => {\n\t\t\t\tparentField = key;\n\t\t\t},\n\t\t\texitField(key: FieldKey): void {\n\t\t\t\tparentField = undefined;\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * Returns the value associated with the given key if it has been indexed\n\t */\n\tpublic get(key: TKey): TValue | undefined {\n\t\tthis.checkNotDisposed();\n\t\treturn this.getFilteredValue(this.keyToNodes.get(key));\n\t}\n\n\t/**\n\t * Returns true iff the key exists in the index\n\t */\n\tpublic has(key: TKey): boolean {\n\t\tthis.checkNotDisposed();\n\t\treturn this.get(key) !== undefined;\n\t}\n\n\t/**\n\t * Returns the number of values that are indexed\n\t */\n\tpublic get size(): number {\n\t\tthis.checkNotDisposed();\n\t\tlet s = 0;\n\t\tfor (const nodes of this.keyToNodes.values()) {\n\t\t\tif (this.getFilteredValue(nodes) !== undefined) {\n\t\t\t\ts += 1;\n\t\t\t}\n\t\t}\n\t\treturn s;\n\t}\n\n\t/**\n\t * Returns all keys in the index\n\t */\n\tpublic *keys(): IterableIterator<TKey> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tif (this.getFilteredValue(nodes) !== undefined) {\n\t\t\t\tyield key;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterable of values in the index\n\t */\n\tpublic *values(): IterableIterator<TValue> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const nodes of this.keyToNodes.values()) {\n\t\t\tconst filtered = this.getFilteredValue(nodes);\n\t\t\tif (filtered !== undefined) {\n\t\t\t\tyield filtered;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the index\n\t */\n\tpublic *entries(): IterableIterator<[TKey, TValue]> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tconst filtered = this.getFilteredValue(nodes);\n\t\t\tif (filtered !== undefined) {\n\t\t\t\tyield [key, filtered];\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<[TKey, TValue]> {\n\t\tthis.checkNotDisposed();\n\t\treturn this.entries();\n\t}\n\n\t/**\n\t * Applies the provided callback to each entry in the index.\n\t */\n\tpublic forEach(\n\t\tcallbackfn: (value: TValue, key: TKey, map: AnchorTreeIndex<TKey, TValue>) => void,\n\t\tthisArg?: unknown,\n\t): void {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tconst filtered = this.getFilteredValue(nodes);\n\t\t\tif (filtered !== undefined) {\n\t\t\t\tcallbackfn.call(thisArg, filtered, key, this);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the index, including ones that are detached.\n\t * This function should only be used for testing purposes, it is not exposed as part of the public {@link TreeIndex} API.\n\t */\n\tpublic *allEntries(): IterableIterator<[TKey, TValue]> {\n\t\tthis.checkNotDisposed();\n\t\tfor (const [key, nodes] of this.keyToNodes.entries()) {\n\t\t\tconst value = this.getValue(nodes as unknown as TreeIndexNodes<AnchorNode>);\n\t\t\tif (value !== undefined) {\n\t\t\t\tyield [key, value];\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic dispose(): void {\n\t\tthis[disposeSymbol]();\n\t}\n\n\t/**\n\t * Disposes this index and all the anchors it holds onto.\n\t */\n\tpublic [disposeSymbol](): void {\n\t\tthis.checkNotDisposed(\"index is already disposed\");\n\t\tfor (const anchors of this.anchors.values()) {\n\t\t\tfor (const anchor of anchors) {\n\t\t\t\tthis.forest.forgetAnchor(anchor);\n\t\t\t}\n\t\t}\n\t\tthis.keyToNodes.clear();\n\t\tthis.anchors.clear();\n\t\tthis.forest.deregisterAnnouncedVisitor(this.keyFinder);\n\t\tthis.disposed = true;\n\t}\n\n\t/**\n\t * Checks if the spine needs to be re-indexed and if so, re-indexes it starting from the given path.\n\t */\n\tprivate reIndexSpine(path: UpPath): void {\n\t\tconst cursor = this.forest.allocateCursor();\n\t\tthis.forest.moveCursorToPath(path, cursor);\n\t\tassert(\n\t\t\tcursor.mode === CursorLocationType.Nodes,\n\t\t\t0xa9b /* attach should happen in a node */,\n\t\t);\n\t\tcursor.exitNode();\n\t\t// TODO ADO:36390 avoid re-indexing the whole field when not necessary\n\t\tthis.indexField(cursor);\n\t\tif (!this.isShallowIndex) {\n\t\t\tthis.indexSpine(cursor);\n\t\t}\n\t\tcursor.clear();\n\t}\n\n\tprivate checkNotDisposed(errorMessage?: string): void {\n\t\tif (this.disposed) {\n\t\t\tif (errorMessage !== undefined) {\n\t\t\t\tthrow new Error(errorMessage);\n\t\t\t}\n\t\t\tassert(false, 0xa8f /* invalid operation on a disposed index */);\n\t\t}\n\t}\n\n\t/**\n\t * Given a cursor in node mode, indexes it.\n\t */\n\tprivate indexNode(nodeCursor: ITreeSubscriptionCursor): void {\n\t\tconst keyFinder = getOrCreate(\n\t\t\tthis.keyFinders,\n\t\t\t// the node schema type to look up\n\t\t\tnodeCursor.type,\n\t\t\t// if the indexer does not return a key finder for this schema, we cache a null value to indicate the indexer\n\t\t\t// does not need to be called if this schema is encountered in the future\n\t\t\t(schema) => this.indexer(schema) ?? null,\n\t\t);\n\n\t\tif (keyFinder !== null) {\n\t\t\tconst expectedPath = nodeCursor.getPath();\n\t\t\tconst key = keyFinder(nodeCursor);\n\t\t\t// TODO: determine perf impact of this check, alternative is not doing it in which case (if the key finder is not pure and functional),\n\t\t\t// an error may be thrown further down the line if the structure of the nodes aren't expected or the contents of the index could be inaccurate\n\t\t\tif (!compareUpPaths(nodeCursor.getPath(), expectedPath)) {\n\t\t\t\tthrow new Error(\"key finder should be pure and functional\");\n\t\t\t}\n\t\t\tconst anchor = nodeCursor.buildAnchor();\n\t\t\tconst anchorNode =\n\t\t\t\tthis.forest.anchors.locate(anchor) ?? fail(0xb16 /* expected anchor node */);\n\n\t\t\t// check if this anchor node already exists in the index\n\t\t\tconst existingKey = this.nodeToKey.get(anchorNode);\n\t\t\tif (existingKey !== undefined) {\n\t\t\t\t// if the node already exists but has the same key, we return early\n\t\t\t\tif (existingKey === key) {\n\t\t\t\t\tthis.forest.forgetAnchor(anchor);\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\t// if the node has a different key, we remove the existing one first because it means the key had been detached\n\t\t\t\t\tthis.removeAnchor(anchorNode, existingKey);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tgetOrCreate(this.keyToNodes, key, () => []).push(anchorNode);\n\t\t\tthis.nodeToKey.set(anchorNode, key);\n\n\t\t\tgetOrCreate(this.anchors, anchorNode, () => []).push(anchor);\n\t\t\t// when the anchor node is destroyed, delete it from the index\n\t\t\tanchorNode.events.on(\"afterDestroy\", () => {\n\t\t\t\tthis.removeAnchor(anchorNode, key);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Given a cursor in field mode, recursively indexes all nodes under the field.\n\t */\n\tprivate indexField(fieldCursor: ITreeSubscriptionCursor): void {\n\t\tforEachNode(fieldCursor, (nodeCursor) => {\n\t\t\tthis.indexNode(nodeCursor);\n\n\t\t\tforEachField(nodeCursor, (f) => {\n\t\t\t\tthis.indexField(f);\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Given a cursor in field mode, indexes all nodes under the field and then indexes all nodes up the spine.\n\t */\n\tprivate indexSpine(cursor: ITreeSubscriptionCursor): void {\n\t\tif (keyAsDetachedField(cursor.getFieldKey()) === rootField) {\n\t\t\t// return early if we're already at the root field\n\t\t\treturn;\n\t\t} else {\n\t\t\tcursor.exitField();\n\t\t\tcursor.exitNode();\n\t\t}\n\n\t\t// walk up the spine and index nodes until we reach the root\n\t\twhile (\n\t\t\tcursor.mode === CursorLocationType.Fields &&\n\t\t\tkeyAsDetachedField(cursor.getFieldKey()) !== rootField\n\t\t) {\n\t\t\tforEachNode(cursor, (nodeCursor) => {\n\t\t\t\tthis.indexNode(nodeCursor);\n\t\t\t});\n\n\t\t\tcursor.exitField();\n\t\t\tcursor.exitNode();\n\t\t}\n\t}\n\n\tprivate removeAnchor(anchorNode: AnchorNode, key: TKey): void {\n\t\tconst indexedNodes = this.keyToNodes.get(key);\n\t\tassert(\n\t\t\tindexedNodes !== undefined,\n\t\t\t0xa90 /* destroyed anchor node should be tracked by index */,\n\t\t);\n\t\tconst index = indexedNodes.indexOf(anchorNode);\n\t\tassert(index !== -1, 0xa91 /* destroyed anchor node should be tracked by index */);\n\t\tconst newNodes = filterNodes(indexedNodes, (n) => n !== anchorNode);\n\t\tif (newNodes !== undefined && newNodes.length > 0) {\n\t\t\tthis.keyToNodes.set(key, newNodes);\n\t\t} else {\n\t\t\tthis.keyToNodes.delete(key);\n\t\t}\n\t\tthis.nodeToKey.delete(anchorNode);\n\t\tassert(\n\t\t\tthis.anchors.delete(anchorNode),\n\t\t\t0xa92 /* destroyed anchor should be tracked by index */,\n\t\t);\n\t}\n\n\t/**\n\t * Filters out any anchor nodes that are detached and returns the value for the remaining nodes.\n\t */\n\tprivate getFilteredValue(anchorNodes: AnchorNode[] | undefined): TValue | undefined {\n\t\tconst attachedNodes = filterNodes(anchorNodes, (anchorNode) => {\n\t\t\tconst nodeStatus = this.checkTreeStatus(anchorNode);\n\t\t\treturn nodeStatus === TreeStatus.InDocument;\n\t\t});\n\n\t\tif (attachedNodes !== undefined && hasElement(attachedNodes)) {\n\t\t\treturn this.getValue(attachedNodes);\n\t\t}\n\t}\n}\n\n/**\n * Filters the given anchor nodes based on the given filter function.\n */\nfunction filterNodes(\n\tanchorNodes: readonly AnchorNode[] | undefined,\n\tfilter: (node: AnchorNode) => boolean,\n): AnchorNode[] | undefined {\n\tif (anchorNodes !== undefined) {\n\t\treturn anchorNodes.filter(filter);\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Checks that an array is of the type {@link TreeIndexNodes} and has at least one element.\n */\nexport function hasElement<T>(array: readonly T[]): array is TreeI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cursor.nextField()) {
80
80
  const field = (0, index_js_1.mapCursorField)(cursor, mapTreeFromCursor);
81
+ (0, internal_1.debugAssert)(() => field.length > 0 || "field must have at least one child");
81
82
  fields.set(cursor.getFieldKey(), field);
82
83
  }
83
84
  const node = {
@@ -1 +1 @@
1
- {"version":3,"file":"mapTreeCursor.js","sourceRoot":"","sources":["../../src/feature-libraries/mapTreeCursor.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,+CAa0B;AAE1B,6DAM8B;AA6C9B,CAAC;AAID,CAAC;AAED;;GAEG;AACH,SAAgB,oBAAoB,CACnC,IAAO;IAEP,4FAA4F;IAC5F,yGAAyG;IACzG,MAAM,YAAY,GAAG,OAAuE,CAAC;IAC7F,OAAO,IAAA,wCAAmB,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AAChD,CAAC;AAPD,oDAOC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAC/B,QAA4B,EAC5B,GAAG,GAAG,uBAAY,EAClB,IAAI,GAAG,+BAAoB;IAE3B,OAAO;QACN,IAAI;QACJ,MAAM,EAAE,sBAAsB,CAAC,QAAQ,EAAE,GAAG,CAAC;KAC7C,CAAC;AACH,CAAC;AATD,4CASC;AAED;;;;GAIG;AACH,SAAgB,sBAAsB,CACrC,QAAW,EACX,GAAa;IAEb,OAAO,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;AAChE,CAAC;AALD,wDAKC;AAED;;GAEG;AACH,SAAgB,qBAAqB,CACpC,IAAkB,EAClB,gBAA+B,oBAAS;IAExC,MAAM,GAAG,GAAG,IAAA,6BAAkB,EAAC,aAAa,CAAC,CAAC;IAC9C,MAAM,YAAY,GAAG,OAAsC,CAAC;IAC5D,MAAM,SAAS,GAA8B;QAC5C,IAAI,EAAE,+BAAoB;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AC,MAAM,EAAE,iBAAiB,CAAC,CAAC;QAC5E,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,IAAI,GAAqB;QAC9B,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,MAAM;KACN,CAAC;IAEF,OAAO,IAAI,CAAC;AACb,CAAC;AAfD,8CAeC;AAED;;GAEG;AACH,SAAgB,sBAAsB,CAAC,MAAmB;IACzD,IAAA,iBAAM,EAAC,MAAM,CAAC,IAAI,sCAA8B,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACnF,OAAO,IAAA,yBAAc,EAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAClD,CAAC;AAHD,wDAGC","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 {\n\tCursorLocationType,\n\ttype DetachedField,\n\ttype ExclusiveMapTree,\n\ttype FieldKey,\n\ttype ITreeCursor,\n\ttype MapTree,\n\ttype NodeData,\n\taboveRootPlaceholder,\n\tdetachedFieldAsKey,\n\tmapCursorField,\n\trootField,\n\trootFieldKey,\n} from \"../core/index.js\";\n\nimport {\n\ttype CursorAdapter,\n\ttype CursorWithNode,\n\ttype Field,\n\tstackTreeFieldCursor,\n\tstackTreeNodeCursor,\n} from \"./treeCursorUtils.js\";\nimport type { requireAssignableTo } from \"../util/index.js\";\n\n/**\n * A generic variant of {@link MapTree} that can be used to strongly type trees implementing a MapTree-like API.\n * @remarks\n * Due to how TypeScript handles recursive generic types, explicitly named extension interfaces work best for parameterizing this, and a default type parameter can't be provided.\n * @see {@link MinimalMapTreeNodeView} for a minimal configuration of this interface.\n */\nexport interface MapTreeNodeViewGeneric<TNode> extends NodeData {\n\t/**\n\t * The non-empty fields on this node.\n\t * @remarks\n\t * This is the subset of map needed to view the tree.\n\t * Theoretically `Symbol.iterator` and \"keys\" are redundant.\n\t */\n\treadonly fields: MinimalFieldMap<MapTreeFieldViewGeneric<TNode>>;\n}\n\n/**\n * A minimal map for the fields of a {@link MapTreeNodeViewGeneric}.\n * @remarks\n * Subset of map, so can be implemented by `Map<FieldKey, TField>`.\n */\nexport interface MinimalFieldMap<TField> {\n\t[Symbol.iterator]: () => Iterator<[FieldKey, TField]>;\n\tget: (key: FieldKey) => TField | undefined;\n}\n\n/**\n * A field in {@link MapTreeNodeViewGeneric}.\n * @remarks\n * Subset of array, so can be implemented by `TNode[]`.\n */\nexport interface MapTreeFieldViewGeneric<TNode> {\n\treadonly [Symbol.iterator]: () => Iterator<TNode>;\n\treadonly length: number;\n}\n\n/**\n * Like {@link MapTree} but with the minimal properties needed for reading.\n */\nexport interface MinimalMapTreeNodeView\n\textends MapTreeNodeViewGeneric<MinimalMapTreeNodeView> {}\n\n{\n\t// Check that these interfaces are subsets of MapTree as intended:\n\ttype _check1 = requireAssignableTo<MapTree, MinimalMapTreeNodeView>;\n\ttype _check2 = requireAssignableTo<MapTree, MapTreeNodeViewGeneric<MapTree>>;\n}\n\n/**\n * Returns an {@link ITreeCursorSynchronous} in nodes mode for a single {@link MapTree}.\n */\nexport function cursorForMapTreeNode<T extends MapTreeNodeViewGeneric<T>>(\n\troot: T,\n): CursorWithNode<T> {\n\t// There doesn't seem to be a clean way to get TypeScript to type check this without casting\n\t// without declaring the adapter inside this generic function and needlessly recreating it on every call.\n\tconst adapterTyped = adapter as CursorAdapter<MapTreeNodeViewGeneric<T>> as CursorAdapter<T>;\n\treturn stackTreeNodeCursor(adapterTyped, root);\n}\n\n/**\n * Creates an {@link ExclusiveMapTree} with a single field and no value.\n * @remarks\n * This handles ensuring the field is omitted if empty, and defaults to making the node above the root.\n */\nexport function mapTreeWithField(\n\tchildren: ExclusiveMapTree[],\n\tkey = rootFieldKey,\n\ttype = aboveRootPlaceholder,\n): ExclusiveMapTree {\n\treturn {\n\t\ttype,\n\t\tfields: mapTreeFieldsWithField(children, key),\n\t};\n}\n\n/**\n * Creates a Map suitable for use as {@link MapTree.fields} with a single field.\n * @remarks\n * This handles ensuring the field is omitted if empty.\n */\nexport function mapTreeFieldsWithField<T extends readonly unknown[]>(\n\tchildren: T,\n\tkey: FieldKey,\n): Map<FieldKey, T> {\n\treturn new Map(children.length === 0 ? [] : [[key, children]]);\n}\n\n/**\n * Returns an {@link ITreeCursorSynchronous} in fields mode for a MapTree field.\n */\nexport function cursorForMapTreeField<T extends MapTreeNodeViewGeneric<T>>(\n\troot: readonly T[],\n\tdetachedField: DetachedField = rootField,\n): CursorWithNode<T> {\n\tconst key = detachedFieldAsKey(detachedField);\n\tconst adapterTyped = adapter as unknown as CursorAdapter<T>;\n\tconst dummyRoot: MapTreeNodeViewGeneric<T> = {\n\t\ttype: aboveRootPlaceholder,\n\t\tfields: mapTreeFieldsWithField(root, key),\n\t};\n\treturn stackTreeFieldCursor(adapterTyped, dummyRoot as T, detachedField);\n}\n\nconst adapter: CursorAdapter<MinimalMapTreeNodeView> = {\n\tvalue: (node) => node.value,\n\ttype: (node) => node.type,\n\tkeysFromNode: (node) => Array.from(node.fields, ([key, field]) => key),\n\tgetFieldFromNode: (node, key): Field<MinimalMapTreeNodeView> => {\n\t\tconst field = node.fields.get(key) as\n\t\t\t| MinimalMapTreeNodeView[]\n\t\t\t| Iterable<MinimalMapTreeNodeView>\n\t\t\t| undefined;\n\t\tif (field === undefined) {\n\t\t\treturn [];\n\t\t}\n\t\tif (Array.isArray(field)) {\n\t\t\treturn field as readonly MinimalMapTreeNodeView[];\n\t\t}\n\t\t// TODO: this copy could be avoided by using Array.at instead of indexing in `Field`, but that requires ES2022.\n\t\treturn [...field] as readonly MinimalMapTreeNodeView[];\n\t},\n};\n\n/**\n * Extract a MapTree from the contents of the given ITreeCursor's current node.\n */\nexport function mapTreeFromCursor(cursor: ITreeCursor): ExclusiveMapTree {\n\tassert(cursor.mode === CursorLocationType.Nodes, 0x3b7 /* must start at node */);\n\tconst fields: Map<FieldKey, ExclusiveMapTree[]> = new Map();\n\tfor (let inField = cursor.firstField(); inField; inField = cursor.nextField()) {\n\t\tconst field: ExclusiveMapTree[] = mapCursorField(cursor, mapTreeFromCursor);\n\t\tfields.set(cursor.getFieldKey(), field);\n\t}\n\n\tconst node: ExclusiveMapTree = {\n\t\ttype: cursor.type,\n\t\tvalue: cursor.value,\n\t\tfields,\n\t};\n\n\treturn node;\n}\n\n/**\n * Extract an array of MapTrees (a field) from the contents of the given ITreeCursor's current field.\n */\nexport function mapTreeFieldFromCursor(cursor: ITreeCursor): ExclusiveMapTree[] {\n\tassert(cursor.mode === CursorLocationType.Fields, 0xa03 /* must start at field */);\n\treturn mapCursorField(cursor, mapTreeFromCursor);\n}\n"]}
1
+ {"version":3,"file":"mapTreeCursor.js","sourceRoot":"","sources":["../../src/feature-libraries/mapTreeCursor.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA0E;AAE1E,+CAa0B;AAE1B,6DAM8B;AA6C9B,CAAC;AAID,CAAC;AAED;;GAEG;AACH,SAAgB,oBAAoB,CACnC,IAAO;IAEP,4FAA4F;IAC5F,yGAAyG;IACzG,MAAM,YAAY,GAAG,OAAuE,CAAC;IAC7F,OAAO,IAAA,wCAAmB,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AAChD,CAAC;AAPD,oDAOC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAC/B,QAA4B,EAC5B,GAAG,GAAG,uBAAY,EAClB,IAAI,GAAG,+BAAoB;IAE3B,OAAO;QACN,IAAI;QACJ,MAAM,EAAE,sBAAsB,CAAC,QAAQ,EAAE,GAAG,CAAC;KAC7C,CAAC;AACH,CAAC;AATD,4CASC;AAED;;;;GAIG;AACH,SAAgB,sBAAsB,CACrC,QAAW,EACX,GAAa;IAEb,OAAO,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAA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gB,iBAAiB,CAAC,MAAmB;IACpD,IAAA,iBAAM,EAAC,MAAM,CAAC,IAAI,qCAA6B,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACjF,MAAM,MAAM,GAAsC,IAAI,GAAG,EAAE,CAAC;IAC5D,KAAK,IAAI,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC;QAC/E,MAAM,KAAK,GAAuB,IAAA,yBAAc,EAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;QAC5E,IAAA,sBAAW,EAAC,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,oCAAoC,CAAC,CAAC;QAC5E,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,IAAI,GAAqB;QAC9B,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,MAAM;KACN,CAAC;IAEF,OAAO,IAAI,CAAC;AACb,CAAC;AAhBD,8CAgBC;AAED;;GAEG;AACH,SAAgB,sBAAsB,CAAC,MAAmB;IACzD,IAAA,iBAAM,EAAC,MAAM,CAAC,IAAI,sCAA8B,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACnF,OAAO,IAAA,yBAAc,EAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAClD,CAAC;AAHD,wDAGC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, debugAssert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tCursorLocationType,\n\ttype DetachedField,\n\ttype ExclusiveMapTree,\n\ttype FieldKey,\n\ttype ITreeCursor,\n\ttype MapTree,\n\ttype NodeData,\n\taboveRootPlaceholder,\n\tdetachedFieldAsKey,\n\tmapCursorField,\n\trootField,\n\trootFieldKey,\n} from \"../core/index.js\";\n\nimport {\n\ttype CursorAdapter,\n\ttype CursorWithNode,\n\ttype Field,\n\tstackTreeFieldCursor,\n\tstackTreeNodeCursor,\n} from \"./treeCursorUtils.js\";\nimport type { requireAssignableTo } from \"../util/index.js\";\n\n/**\n * A generic variant of {@link MapTree} that can be used to strongly type trees implementing a MapTree-like API.\n * @remarks\n * Due to how TypeScript handles recursive generic types, explicitly named extension interfaces work best for parameterizing this, and a default type parameter can't be provided.\n * @see {@link MinimalMapTreeNodeView} for a minimal configuration of this interface.\n */\nexport interface MapTreeNodeViewGeneric<TNode> extends NodeData {\n\t/**\n\t * The non-empty fields on this node.\n\t * @remarks\n\t * This is the subset of map needed to view the tree.\n\t * Theoretically `Symbol.iterator` and \"keys\" are redundant.\n\t */\n\treadonly fields: MinimalFieldMap<MapTreeFieldViewGeneric<TNode>>;\n}\n\n/**\n * A minimal map for the fields of a {@link MapTreeNodeViewGeneric}.\n * @remarks\n * Subset of map, so can be implemented by `Map<FieldKey, TField>`.\n */\nexport interface MinimalFieldMap<TField> {\n\t[Symbol.iterator]: () => Iterator<[FieldKey, TField]>;\n\tget: (key: FieldKey) => TField | undefined;\n}\n\n/**\n * A field in {@link MapTreeNodeViewGeneric}.\n * @remarks\n * Subset of array, so can be implemented by `TNode[]`.\n */\nexport interface MapTreeFieldViewGeneric<TNode> {\n\treadonly [Symbol.iterator]: () => Iterator<TNode>;\n\treadonly length: number;\n}\n\n/**\n * Like {@link MapTree} but with the minimal properties needed for reading.\n */\nexport interface MinimalMapTreeNodeView\n\textends MapTreeNodeViewGeneric<MinimalMapTreeNodeView> {}\n\n{\n\t// Check that these interfaces are subsets of MapTree as intended:\n\ttype _check1 = requireAssignableTo<MapTree, MinimalMapTreeNodeView>;\n\ttype _check2 = requireAssignableTo<MapTree, MapTreeNodeViewGeneric<MapTree>>;\n}\n\n/**\n * Returns an {@link ITreeCursorSynchronous} in nodes mode for a single {@link MapTree}.\n */\nexport function cursorForMapTreeNode<T extends MapTreeNodeViewGeneric<T>>(\n\troot: T,\n): CursorWithNode<T> {\n\t// There doesn't seem to be a clean way to get TypeScript to type check this without casting\n\t// without declaring the adapter inside this generic function and needlessly recreating it on every call.\n\tconst adapterTyped = adapter as CursorAdapter<MapTreeNodeViewGeneric<T>> as CursorAdapter<T>;\n\treturn stackTreeNodeCursor(adapterTyped, root);\n}\n\n/**\n * Creates an {@link ExclusiveMapTree} with a single field and no value.\n * @remarks\n * This handles ensuring the field is omitted if empty, and defaults to making the node above the root.\n */\nexport function mapTreeWithField(\n\tchildren: ExclusiveMapTree[],\n\tkey = rootFieldKey,\n\ttype = aboveRootPlaceholder,\n): ExclusiveMapTree {\n\treturn {\n\t\ttype,\n\t\tfields: mapTreeFieldsWithField(children, key),\n\t};\n}\n\n/**\n * Creates a Map suitable for use as {@link MapTree.fields} with a single field.\n * @remarks\n * This handles ensuring the field is omitted if empty.\n */\nexport function mapTreeFieldsWithField<T extends readonly unknown[]>(\n\tchildren: T,\n\tkey: FieldKey,\n): Map<FieldKey, T> {\n\treturn new Map(children.length === 0 ? [] : [[key, children]]);\n}\n\n/**\n * Returns an {@link ITreeCursorSynchronous} in fields mode for a MapTree field.\n */\nexport function cursorForMapTreeField<T extends MapTreeNodeViewGeneric<T>>(\n\troot: readonly T[],\n\tdetachedField: DetachedField = rootField,\n): CursorWithNode<T> {\n\tconst key = detachedFieldAsKey(detachedField);\n\tconst adapterTyped = adapter as unknown as CursorAdapter<T>;\n\tconst dummyRoot: MapTreeNodeViewGeneric<T> = {\n\t\ttype: aboveRootPlaceholder,\n\t\tfields: mapTreeFieldsWithField(root, key),\n\t};\n\treturn stackTreeFieldCursor(adapterTyped, dummyRoot as T, detachedField);\n}\n\nconst adapter: CursorAdapter<MinimalMapTreeNodeView> = {\n\tvalue: (node) => node.value,\n\ttype: (node) => node.type,\n\tkeysFromNode: (node) => Array.from(node.fields, ([key, field]) => key),\n\tgetFieldFromNode: (node, key): Field<MinimalMapTreeNodeView> => {\n\t\tconst field = node.fields.get(key) as\n\t\t\t| MinimalMapTreeNodeView[]\n\t\t\t| Iterable<MinimalMapTreeNodeView>\n\t\t\t| undefined;\n\t\tif (field === undefined) {\n\t\t\treturn [];\n\t\t}\n\t\tif (Array.isArray(field)) {\n\t\t\treturn field as readonly MinimalMapTreeNodeView[];\n\t\t}\n\t\t// TODO: this copy could be avoided by using Array.at instead of indexing in `Field`, but that requires ES2022.\n\t\treturn [...field] as readonly MinimalMapTreeNodeView[];\n\t},\n};\n\n/**\n * Extract a MapTree from the contents of the given ITreeCursor's current node.\n */\nexport function mapTreeFromCursor(cursor: ITreeCursor): ExclusiveMapTree {\n\tassert(cursor.mode === CursorLocationType.Nodes, 0x3b7 /* must start at node */);\n\tconst fields: Map<FieldKey, ExclusiveMapTree[]> = new Map();\n\tfor (let inField = cursor.firstField(); inField; inField = cursor.nextField()) {\n\t\tconst field: ExclusiveMapTree[] = mapCursorField(cursor, mapTreeFromCursor);\n\t\tdebugAssert(() => field.length > 0 || \"field must have at least one child\");\n\t\tfields.set(cursor.getFieldKey(), field);\n\t}\n\n\tconst node: ExclusiveMapTree = {\n\t\ttype: cursor.type,\n\t\tvalue: cursor.value,\n\t\tfields,\n\t};\n\n\treturn node;\n}\n\n/**\n * Extract an array of MapTrees (a field) from the contents of the given ITreeCursor's current field.\n */\nexport function mapTreeFieldFromCursor(cursor: ITreeCursor): ExclusiveMapTree[] {\n\tassert(cursor.mode === CursorLocationType.Fields, 0xa03 /* must start at field */);\n\treturn mapCursorField(cursor, mapTreeFromCursor);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"mitigatedChangeFamily.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/mitigatedChangeFamily.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,YAAY,EACZ,kBAAkB,EAClB,aAAa,EAIb,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,SAAS,kBAAkB,EAAE,OAAO,EACpF,uBAAuB,EAAE,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,EACvD,cAAc,EAAE,OAAO,EACvB,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAC/B,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAWhC;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAC3C,kBAAkB,EAAE,aAAa,CAAC,OAAO,CAAC,EAC1C,cAAc,EAAE,OAAO,EACvB,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAC/B,aAAa,CAAC,OAAO,CAAC,CAmCxB"}
1
+ {"version":3,"file":"mitigatedChangeFamily.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/mitigatedChangeFamily.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,YAAY,EACZ,kBAAkB,EAClB,aAAa,EAMb,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,SAAS,kBAAkB,EAAE,OAAO,EACpF,uBAAuB,EAAE,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,EACvD,cAAc,EAAE,OAAO,EACvB,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAC/B,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAYhC;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAC3C,kBAAkB,EAAE,aAAa,CAAC,OAAO,CAAC,EAC1C,cAAc,EAAE,OAAO,EACvB,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAC/B,aAAa,CAAC,OAAO,CAAC,CAuCxB"}
@@ -21,8 +21,8 @@ exports.makeMitigatedRebaser = exports.makeMitigatedChangeFamily = void 0;
21
21
  */
22
22
  function makeMitigatedChangeFamily(unmitigatedChangeFamily, fallbackChange, onError) {
23
23
  return {
24
- buildEditor: (mintRevisionTag, changeReceiver) => {
25
- return unmitigatedChangeFamily.buildEditor(mintRevisionTag, changeReceiver);
24
+ buildEditor: (mintRevisionTag, changeReceiver, options) => {
25
+ return unmitigatedChangeFamily.buildEditor(mintRevisionTag, changeReceiver, options);
26
26
  },
27
27
  rebaser: makeMitigatedRebaser(unmitigatedChangeFamily.rebaser, fallbackChange, onError),
28
28
  codecs: unmitigatedChangeFamily.codecs,
@@ -49,7 +49,16 @@ function makeMitigatedRebaser(unmitigatedRebaser, fallbackChange, onError) {
49
49
  rebase: (change, over, revisionMetadata) => {
50
50
  return withFallback(() => unmitigatedRebaser.rebase(change, over, revisionMetadata));
51
51
  },
52
- changeRevision: (change, newRevision, rollbackOf) => withFallback(() => unmitigatedRebaser.changeRevision(change, newRevision, rollbackOf)),
52
+ getRevisions: (change) => {
53
+ try {
54
+ return unmitigatedRebaser.getRevisions(change);
55
+ }
56
+ catch (error) {
57
+ onError(error);
58
+ return new Set();
59
+ }
60
+ },
61
+ changeRevision: (change, replacer) => withFallback(() => unmitigatedRebaser.changeRevision(change, replacer)),
53
62
  };
54
63
  }
55
64
  exports.makeMitigatedRebaser = makeMitigatedRebaser;
@@ -1 +1 @@
1
- {"version":3,"file":"mitigatedChangeFamily.js","sourceRoot":"","sources":["../../src/feature-libraries/mitigatedChangeFamily.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH;;;;;;;;;;;;;GAaG;AACH,SAAgB,yBAAyB,CACxC,uBAAuD,EACvD,cAAuB,EACvB,OAAiC;IAEjC,OAAO;QACN,WAAW,EAAE,CACZ,eAAkC,EAClC,cAAuD,EAC7C,EAAE;YACZ,OAAO,uBAAuB,CAAC,WAAW,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;QAC7E,CAAC;QACD,OAAO,EAAE,oBAAoB,CAAC,uBAAuB,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC;QACvF,MAAM,EAAE,uBAAuB,CAAC,MAAM;KACtC,CAAC;AACH,CAAC;AAfD,8DAeC;AAED,SAAgB,oBAAoB,CACnC,kBAA0C,EAC1C,cAAuB,EACvB,OAAiC;IAEjC,MAAM,YAAY,GAAG,CAAC,EAAiB,EAAW,EAAE;QACnD,IAAI,CAAC;YACJ,OAAO,EAAE,EAAE,CAAC;QACb,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACzB,OAAO,CAAC,KAAK,CAAC,CAAC;YACf,OAAO,cAAc,CAAC;QACvB,CAAC;IACF,CAAC,CAAC;IAEF,OAAO;QACN,OAAO,EAAE,CAAC,OAAgC,EAAW,EAAE;YACtD,OAAO,YAAY,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QAChE,CAAC;QACD,MAAM,EAAE,CACP,OAA8B,EAC9B,UAAmB,EACnB,QAAqB,EACX,EAAE;YACZ,OAAO,YAAY,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;QACrF,CAAC;QACD,MAAM,EAAE,CACP,MAA6B,EAC7B,IAA2B,EAC3B,gBAAwC,EAC9B,EAAE;YACZ,OAAO,YAAY,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC;QACtF,CAAC;QACD,cAAc,EAAE,CACf,MAAe,EACf,WAAoC,EACpC,UAAwB,EACd,EAAE,CACZ,YAAY,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;KACvF,CAAC;AACH,CAAC;AAvCD,oDAuCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tChangeFamily,\n\tChangeFamilyEditor,\n\tChangeRebaser,\n\tRevisionMetadataSource,\n\tRevisionTag,\n\tTaggedChange,\n} from \"../core/index.js\";\n\n/**\n * Makes a given `ChangeFamily` safer to use by wrapping some of its functions in try-catch blocks.\n *\n * Mitigated functions:\n * - {@link ChangeFamily.intoDelta} (an empty Delta is returned instead)\n * - {@link ChangeRebaser.rebase} (the given `fallbackChange` is returned instead)\n * - {@link ChangeRebaser.invert} (the given `fallbackChange` is returned instead)\n * - {@link ChangeRebaser.compose} (the given `fallbackChange` is returned instead)\n *\n * @param unmitigatedChangeFamily - The change family to mitigate.\n * @param fallbackChange - A changeset to use as a fallback when one of the mitigated functions throws.\n * @param onError - A callback invoked for each error thrown.\n * @returns a mitigated change family.\n */\nexport function makeMitigatedChangeFamily<TEditor extends ChangeFamilyEditor, TChange>(\n\tunmitigatedChangeFamily: ChangeFamily<TEditor, TChange>,\n\tfallbackChange: TChange,\n\tonError: (error: unknown) => void,\n): ChangeFamily<TEditor, TChange> {\n\treturn {\n\t\tbuildEditor: (\n\t\t\tmintRevisionTag: () => RevisionTag,\n\t\t\tchangeReceiver: (change: TaggedChange<TChange>) => void,\n\t\t): TEditor => {\n\t\t\treturn unmitigatedChangeFamily.buildEditor(mintRevisionTag, changeReceiver);\n\t\t},\n\t\trebaser: makeMitigatedRebaser(unmitigatedChangeFamily.rebaser, fallbackChange, onError),\n\t\tcodecs: unmitigatedChangeFamily.codecs,\n\t};\n}\n\nexport function makeMitigatedRebaser<TChange>(\n\tunmitigatedRebaser: ChangeRebaser<TChange>,\n\tfallbackChange: TChange,\n\tonError: (error: unknown) => void,\n): ChangeRebaser<TChange> {\n\tconst withFallback = (fn: () => TChange): TChange => {\n\t\ttry {\n\t\t\treturn fn();\n\t\t} catch (error: unknown) {\n\t\t\tonError(error);\n\t\t\treturn fallbackChange;\n\t\t}\n\t};\n\n\treturn {\n\t\tcompose: (changes: TaggedChange<TChange>[]): TChange => {\n\t\t\treturn withFallback(() => unmitigatedRebaser.compose(changes));\n\t\t},\n\t\tinvert: (\n\t\t\tchanges: TaggedChange<TChange>,\n\t\t\tisRollback: boolean,\n\t\t\trevision: RevisionTag,\n\t\t): TChange => {\n\t\t\treturn withFallback(() => unmitigatedRebaser.invert(changes, isRollback, revision));\n\t\t},\n\t\trebase: (\n\t\t\tchange: TaggedChange<TChange>,\n\t\t\tover: TaggedChange<TChange>,\n\t\t\trevisionMetadata: RevisionMetadataSource,\n\t\t): TChange => {\n\t\t\treturn withFallback(() => unmitigatedRebaser.rebase(change, over, revisionMetadata));\n\t\t},\n\t\tchangeRevision: (\n\t\t\tchange: TChange,\n\t\t\tnewRevision: RevisionTag | undefined,\n\t\t\trollbackOf?: RevisionTag,\n\t\t): TChange =>\n\t\t\twithFallback(() => unmitigatedRebaser.changeRevision(change, newRevision, rollbackOf)),\n\t};\n}\n"]}
1
+ {"version":3,"file":"mitigatedChangeFamily.js","sourceRoot":"","sources":["../../src/feature-libraries/mitigatedChangeFamily.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAaH;;;;;;;;;;;;;GAaG;AACH,SAAgB,yBAAyB,CACxC,uBAAuD,EACvD,cAAuB,EACvB,OAAiC;IAEjC,OAAO;QACN,WAAW,EAAE,CACZ,eAAkC,EAClC,cAAuD,EACvD,OAAuB,EACb,EAAE;YACZ,OAAO,uBAAuB,CAAC,WAAW,CAAC,eAAe,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;QACtF,CAAC;QACD,OAAO,EAAE,oBAAoB,CAAC,uBAAuB,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC;QACvF,MAAM,EAAE,uBAAuB,CAAC,MAAM;KACtC,CAAC;AACH,CAAC;AAhBD,8DAgBC;AAED,SAAgB,oBAAoB,CACnC,kBAA0C,EAC1C,cAAuB,EACvB,OAAiC;IAEjC,MAAM,YAAY,GAAG,CAAC,EAAiB,EAAW,EAAE;QACnD,IAAI,CAAC;YACJ,OAAO,EAAE,EAAE,CAAC;QACb,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACzB,OAAO,CAAC,KAAK,CAAC,CAAC;YACf,OAAO,cAAc,CAAC;QACvB,CAAC;IACF,CAAC,CAAC;IAEF,OAAO;QACN,OAAO,EAAE,CAAC,OAAgC,EAAW,EAAE;YACtD,OAAO,YAAY,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QAChE,CAAC;QACD,MAAM,EAAE,CACP,OAA8B,EAC9B,UAAmB,EACnB,QAAqB,EACX,EAAE;YACZ,OAAO,YAAY,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;QACrF,CAAC;QACD,MAAM,EAAE,CACP,MAA6B,EAC7B,IAA2B,EAC3B,gBAAwC,EAC9B,EAAE;YACZ,OAAO,YAAY,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC;QACtF,CAAC;QACD,YAAY,EAAE,CAAC,MAAe,EAAgC,EAAE;YAC/D,IAAI,CAAC;gBACJ,OAAO,kBAAkB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;YAChD,CAAC;YAAC,OAAO,KAAc,EAAE,CAAC;gBACzB,OAAO,CAAC,KAAK,CAAC,CAAC;gBACf,OAAO,IAAI,GAAG,EAAE,CAAC;YAClB,CAAC;QACF,CAAC;QACD,cAAc,EAAE,CAAC,MAAe,EAAE,QAA0B,EAAW,EAAE,CACxE,YAAY,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;KACxE,CAAC;AACH,CAAC;AA3CD,oDA2CC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tChangeFamily,\n\tChangeFamilyEditor,\n\tChangeRebaser,\n\tEditorOptions,\n\tRevisionMetadataSource,\n\tRevisionReplacer,\n\tRevisionTag,\n\tTaggedChange,\n} from \"../core/index.js\";\n\n/**\n * Makes a given `ChangeFamily` safer to use by wrapping some of its functions in try-catch blocks.\n *\n * Mitigated functions:\n * - {@link ChangeFamily.intoDelta} (an empty Delta is returned instead)\n * - {@link ChangeRebaser.rebase} (the given `fallbackChange` is returned instead)\n * - {@link ChangeRebaser.invert} (the given `fallbackChange` is returned instead)\n * - {@link ChangeRebaser.compose} (the given `fallbackChange` is returned instead)\n *\n * @param unmitigatedChangeFamily - The change family to mitigate.\n * @param fallbackChange - A changeset to use as a fallback when one of the mitigated functions throws.\n * @param onError - A callback invoked for each error thrown.\n * @returns a mitigated change family.\n */\nexport function makeMitigatedChangeFamily<TEditor extends ChangeFamilyEditor, TChange>(\n\tunmitigatedChangeFamily: ChangeFamily<TEditor, TChange>,\n\tfallbackChange: TChange,\n\tonError: (error: unknown) => void,\n): ChangeFamily<TEditor, TChange> {\n\treturn {\n\t\tbuildEditor: (\n\t\t\tmintRevisionTag: () => RevisionTag,\n\t\t\tchangeReceiver: (change: TaggedChange<TChange>) => void,\n\t\t\toptions?: EditorOptions,\n\t\t): TEditor => {\n\t\t\treturn unmitigatedChangeFamily.buildEditor(mintRevisionTag, changeReceiver, options);\n\t\t},\n\t\trebaser: makeMitigatedRebaser(unmitigatedChangeFamily.rebaser, fallbackChange, onError),\n\t\tcodecs: unmitigatedChangeFamily.codecs,\n\t};\n}\n\nexport function makeMitigatedRebaser<TChange>(\n\tunmitigatedRebaser: ChangeRebaser<TChange>,\n\tfallbackChange: TChange,\n\tonError: (error: unknown) => void,\n): ChangeRebaser<TChange> {\n\tconst withFallback = (fn: () => TChange): TChange => {\n\t\ttry {\n\t\t\treturn fn();\n\t\t} catch (error: unknown) {\n\t\t\tonError(error);\n\t\t\treturn fallbackChange;\n\t\t}\n\t};\n\n\treturn {\n\t\tcompose: (changes: TaggedChange<TChange>[]): TChange => {\n\t\t\treturn withFallback(() => unmitigatedRebaser.compose(changes));\n\t\t},\n\t\tinvert: (\n\t\t\tchanges: TaggedChange<TChange>,\n\t\t\tisRollback: boolean,\n\t\t\trevision: RevisionTag,\n\t\t): TChange => {\n\t\t\treturn withFallback(() => unmitigatedRebaser.invert(changes, isRollback, revision));\n\t\t},\n\t\trebase: (\n\t\t\tchange: TaggedChange<TChange>,\n\t\t\tover: TaggedChange<TChange>,\n\t\t\trevisionMetadata: RevisionMetadataSource,\n\t\t): TChange => {\n\t\t\treturn withFallback(() => unmitigatedRebaser.rebase(change, over, revisionMetadata));\n\t\t},\n\t\tgetRevisions: (change: TChange): Set<RevisionTag | undefined> => {\n\t\t\ttry {\n\t\t\t\treturn unmitigatedRebaser.getRevisions(change);\n\t\t\t} catch (error: unknown) {\n\t\t\t\tonError(error);\n\t\t\t\treturn new Set();\n\t\t\t}\n\t\t},\n\t\tchangeRevision: (change: TChange, replacer: RevisionReplacer): TChange =>\n\t\t\twithFallback(() => unmitigatedRebaser.changeRevision(change, replacer)),\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"comparison.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAGN,YAAY,EAEZ,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,WAAW,EAEhB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,oBAAoB,GAAG,SAAS,EAC1C,QAAQ,EAAE,oBAAoB,GAAG,SAAS,GACxC,OAAO,CA0ET;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,QAAQ,EAAE,WAAW,GAAG,SAAS,EACjC,QAAQ,EA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,CAET;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,qBAAqB,EAC/B,QAAQ,EAAE,qBAAqB,EAC/B,aAAa,GAAE,OAAc,GAC3B,OAAO,CAsBT;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CACjD,QAAQ,EAAE,WAAW,EACrB,QAAQ,EAAE,WAAW,GACnB,OAAO,CAOT;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,gBAAgB,GACxB,OAAO,CAwBT;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACzC,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,YAAY,GACpB,OAAO,CAsBT"}
@@ -88,10 +88,8 @@ exports.allowsValueSuperset = allowsValueSuperset;
88
88
  * See also {@link FieldKindOptions.allowMonotonicUpgradeFrom} for constraints on the implementation.
89
89
  */
90
90
  function allowsFieldSuperset(policy, originalData, original, superset, monotonicOnly = true) {
91
- if (!monotonicOnly) {
92
- if ((0, isNeverTree_js_1.isNeverField)(policy, originalData, original)) {
93
- return true;
94
- }
91
+ if (!monotonicOnly && (0, isNeverTree_js_1.isNeverField)(policy, originalData, original)) {
92
+ return true;
95
93
  }
96
94
  if (!allowsTreeSchemaIdentifierSuperset(original.types, superset.types)) {
97
95
  return false;
@@ -161,16 +159,21 @@ function allowsMultiplicitySuperset(original, superset) {
161
159
  return true;
162
160
  }
163
161
  switch (superset) {
164
- case index_js_1.Multiplicity.Forbidden:
162
+ case index_js_1.Multiplicity.Forbidden: {
165
163
  return false;
166
- case index_js_1.Multiplicity.Optional:
164
+ }
165
+ case index_js_1.Multiplicity.Optional: {
167
166
  return original === index_js_1.Multiplicity.Single || original === index_js_1.Multiplicity.Forbidden;
168
- case index_js_1.Multiplicity.Single:
167
+ }
168
+ case index_js_1.Multiplicity.Single: {
169
169
  return false;
170
- case index_js_1.Multiplicity.Sequence:
170
+ }
171
+ case index_js_1.Multiplicity.Sequence: {
171
172
  return true;
172
- default:
173
+ }
174
+ default: {
173
175
  return (0, internal_1.unreachableCase)(superset);
176
+ }
174
177
  }
175
178
  }
176
179
  exports.allowsMultiplicitySuperset = allowsMultiplicitySuperset;
@@ -1 +1 @@
1
- {"version":3,"file":"comparison.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAEpF,kDAW6B;AAC7B,kDAAkD;AAGlD,qDAA6D;AAE7D;;;;;;GAMG;AACH,SAAgB,kBAAkB,CACjC,MAAwB,EACxB,YAA8B,EAC9B,QAA0C,EAC1C,QAA0C;IAE1C,IAAI,IAAA,4BAAW,EAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,IAAA,4BAAW,EAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;QACjD,OAAO,KAAK,CAAC;IACd,CAAC;IACD,IAAA,iBAAM,EAAC,QAAQ,KAAK,SAAS,EAAE,KAAK,CAAC,4CAA4C,CAAC,CAAC;IACnF,IAAA,iBAAM,EAAC,QAAQ,KAAK,SAAS,EAAE,KAAK,CAAC,4CAA4C,CAAC,CAAC;IACnF,IAAI,QAAQ,YAAY,+BAAoB,EAAE,CAAC;QAC9C,IAAI,QAAQ,YAAY,+BAAoB,EAAE,CAAC;YAC9C,OAAO,mBAAmB,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;QACpE,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IAED,IAAI,QAAQ,YAAY,+BAAoB,EAAE,CAAC;QAC9C,OAAO,KAAK,CAAC;IACd,CAAC;IAED,IAAA,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AkB,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACjF,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,mIAAmI;IACnI,2CAA2C;IAC3C,OAAO,IAAI,CAAC;AACb,CAAC;AA5BD,gDA4BC;AAED;;;;GAIG;AACH,SAAgB,0BAA0B,CACzC,QAAsB,EACtB,QAAsB;IAEtB,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IACb,CAAC;IAED,QAAQ,QAAQ,EAAE,CAAC;QAClB,KAAK,uBAAY,CAAC,SAAS;YAC1B,OAAO,KAAK,CAAC;QACd,KAAK,uBAAY,CAAC,QAAQ;YACzB,OAAO,QAAQ,KAAK,uBAAY,CAAC,MAAM,IAAI,QAAQ,KAAK,uBAAY,CAAC,SAAS,CAAC;QAChF,KAAK,uBAAY,CAAC,MAAM;YACvB,OAAO,KAAK,CAAC;QACd,KAAK,uBAAY,CAAC,QAAQ;YACzB,OAAO,IAAI,CAAC;QACb;YACC,OAAO,IAAA,0BAAe,EAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;AACF,CAAC;AApBD,gEAoBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tMultiplicity,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n\tstoredEmptyFieldSchema,\n} from \"../../core/index.js\";\nimport { compareSets } from \"../../util/index.js\";\n\nimport type { FullSchemaPolicy } from \"./fieldKind.js\";\nimport { isNeverField, isNeverTree } from \"./isNeverTree.js\";\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * `undefined` TreeNodeStoredSchema means the schema is not present (and thus treated as a NeverTree).\n */\nexport function allowsTreeSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeNodeStoredSchema | undefined,\n\tsuperset: TreeNodeStoredSchema | undefined,\n): boolean {\n\tif (isNeverTree(policy, originalData, original)) {\n\t\treturn true;\n\t}\n\tif (isNeverTree(policy, originalData, superset)) {\n\t\treturn false;\n\t}\n\tassert(original !== undefined, 0x716 /* only never trees have undefined schema */);\n\tassert(superset !== undefined, 0x717 /* only never trees have undefined schema */);\n\tif (original instanceof LeafNodeStoredSchema) {\n\t\tif (superset instanceof LeafNodeStoredSchema) {\n\t\t\treturn allowsValueSuperset(original.leafValue, superset.leafValue);\n\t\t}\n\t\treturn false;\n\t}\n\n\tif (superset instanceof LeafNodeStoredSchema) {\n\t\treturn false;\n\t}\n\n\tassert(\n\t\toriginal instanceof MapNodeStoredSchema || original instanceof ObjectNodeStoredSchema,\n\t\t0x893 /* unsupported node kind */,\n\t);\n\tassert(\n\t\tsuperset instanceof MapNodeStoredSchema || superset instanceof ObjectNodeStoredSchema,\n\t\t0x894 /* unsupported node kind */,\n\t);\n\n\tif (original instanceof MapNodeStoredSchema) {\n\t\tif (superset instanceof MapNodeStoredSchema) {\n\t\t\treturn allowsFieldSuperset(policy, originalData, original.mapFields, superset.mapFields);\n\t\t}\n\t\treturn false;\n\t}\n\n\tassert(original instanceof ObjectNodeStoredSchema, 0x895 /* unsupported node kind */);\n\tif (superset instanceof MapNodeStoredSchema) {\n\t\tfor (const [_key, field] of original.objectNodeFields) {\n\t\t\tif (!allowsFieldSuperset(policy, originalData, field, superset.mapFields)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\tassert(superset instanceof ObjectNodeStoredSchema, 0x896 /* unsupported node kind */);\n\n\treturn compareSets({\n\t\ta: original.objectNodeFields,\n\t\tb: superset.objectNodeFields,\n\t\taExtra: (originalField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(originalField) ??\n\t\t\t\t\tfail(0xb17 /* missing expected field */),\n\t\t\t\tstoredEmptyFieldSchema,\n\t\t\t),\n\t\tbExtra: (supersetField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\tstoredEmptyFieldSchema,\n\t\t\t\tsuperset.objectNodeFields.get(supersetField) ??\n\t\t\t\t\tfail(0xb18 /* missing expected field */),\n\t\t\t),\n\t\tsame: (sameField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(sameField) ?? fail(0xb19 /* missing expected field */),\n\t\t\t\tsuperset.objectNodeFields.get(sameField) ?? fail(0xb1a /* missing expected field */),\n\t\t\t),\n\t});\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsValueSuperset(\n\toriginal: ValueSchema | undefined,\n\tsuperset: ValueSchema | undefined,\n): boolean {\n\treturn original === superset;\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * @param monotonicOnly - If true, only allow changes of field kinds which are explicitly listed in {@link FieldKindOptions.allowMonotonicUpgradeFrom}.\n * This prevents this function from considering two different schema as equivalent, preventing upgrades which would allow their inverse.\n * This prevents infinite upgrade loops where two clients could keep upgrading between two schema.\n *\n * @remarks\n * True if a client should be able to {@link TreeView.upgradeSchema} from a field schema using this field kind and `originalTypes` to `superset`.\n *\n * @privateRemarks\n * See also {@link FieldKindOptions.allowMonotonicUpgradeFrom} for constraints on the implementation.\n */\nexport function allowsFieldSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeFieldStoredSchema,\n\tsuperset: TreeFieldStoredSchema,\n\tmonotonicOnly: boolean = true,\n): boolean {\n\tif (!monotonicOnly) {\n\t\tif (isNeverField(policy, originalData, original)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tif (!allowsTreeSchemaIdentifierSuperset(original.types, superset.types)) {\n\t\treturn false;\n\t}\n\n\tif (original.kind === superset.kind) {\n\t\treturn true;\n\t}\n\n\tconst supersetKind = policy.fieldKinds.get(superset.kind) ?? fail(0xb1b /* missing kind */);\n\n\tif (monotonicOnly) {\n\t\treturn supersetKind.options.allowMonotonicUpgradeFrom.has(original.kind);\n\t} else {\n\t\tconst originalKind =\n\t\t\tpolicy.fieldKinds.get(original.kind) ?? fail(0xcab /* missing kind */);\n\t\treturn allowsMultiplicitySuperset(originalKind.multiplicity, supersetKind.multiplicity);\n\t}\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsTreeSchemaIdentifierSuperset(\n\toriginal: TreeTypeSet,\n\tsuperset: TreeTypeSet,\n): boolean {\n\tfor (const originalType of original) {\n\t\tif (!superset.has(originalType)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * A version of this that assumes a specific root field could be slightly more permissive in some simple cases,\n * however if any extra fields and fields with unconstrained types are reachable,\n * it would have to compare everything anyway.\n */\nexport function allowsRepoSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginal: TreeStoredSchema,\n\tsuperset: TreeStoredSchema,\n): boolean {\n\t{\n\t\tif (\n\t\t\t!allowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginal,\n\t\t\t\toriginal.rootFieldSchema,\n\t\t\t\tsuperset.rootFieldSchema,\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t// Check if all schema in original are included in superset, and permit a superset of the node content.\n\t// Note that any schema from `original.nodeSchema` can be used as the schema for a node at the root of a detached field,\n\t// so we must check all of them, even if they are not reachable from the root field schema.\n\tfor (const [key, schema] of original.nodeSchema) {\n\t\tif (!allowsTreeSuperset(policy, original, schema, superset.nodeSchema.get(key))) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t// Any schema in superset not in original are already known to be superset of original since they are \"never\" due to being missing.\n\t// Therefore, we do not need to check them.\n\treturn true;\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsMultiplicitySuperset(\n\toriginal: Multiplicity,\n\tsuperset: Multiplicity,\n): boolean {\n\tif (original === superset) {\n\t\treturn true;\n\t}\n\n\tswitch (superset) {\n\t\tcase Multiplicity.Forbidden:\n\t\t\treturn false;\n\t\tcase Multiplicity.Optional:\n\t\t\treturn original === Multiplicity.Single || original === Multiplicity.Forbidden;\n\t\tcase Multiplicity.Single:\n\t\t\treturn false;\n\t\tcase Multiplicity.Sequence:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn unreachableCase(superset);\n\t}\n}\n"]}
1
+ {"version":3,"file":"comparison.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAEpF,kDAW6B;AAC7B,kDAAkD;AAGlD,qDAA6D;AAE7D;;;;;;GAMG;AACH,SAAgB,kBAAkB,CACjC,MAAwB,EACxB,YAA8B,EAC9B,QAA0C,EAC1C,QAA0C;IAE1C,IAAI,IAAA,4BAAW,EAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,IAAA,4BAAW,EAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;QACjD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Y,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC5B,OAAO,IAAI,CAAC;QACb,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,OAAO,IAAA,0BAAe,EAAC,QAAQ,CAAC,CAAC;QAClC,CAAC;IACF,CAAC;AACF,CAAC;AAzBD,gEAyBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tMultiplicity,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n\tstoredEmptyFieldSchema,\n} from \"../../core/index.js\";\nimport { compareSets } from \"../../util/index.js\";\n\nimport type { FullSchemaPolicy } from \"./fieldKind.js\";\nimport { isNeverField, isNeverTree } from \"./isNeverTree.js\";\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * `undefined` TreeNodeStoredSchema means the schema is not present (and thus treated as a NeverTree).\n */\nexport function allowsTreeSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeNodeStoredSchema | undefined,\n\tsuperset: TreeNodeStoredSchema | undefined,\n): boolean {\n\tif (isNeverTree(policy, originalData, original)) {\n\t\treturn true;\n\t}\n\tif (isNeverTree(policy, originalData, superset)) {\n\t\treturn false;\n\t}\n\tassert(original !== undefined, 0x716 /* only never trees have undefined schema */);\n\tassert(superset !== undefined, 0x717 /* only never trees have undefined schema */);\n\tif (original instanceof LeafNodeStoredSchema) {\n\t\tif (superset instanceof LeafNodeStoredSchema) {\n\t\t\treturn allowsValueSuperset(original.leafValue, superset.leafValue);\n\t\t}\n\t\treturn false;\n\t}\n\n\tif (superset instanceof LeafNodeStoredSchema) {\n\t\treturn false;\n\t}\n\n\tassert(\n\t\toriginal instanceof MapNodeStoredSchema || original instanceof ObjectNodeStoredSchema,\n\t\t0x893 /* unsupported node kind */,\n\t);\n\tassert(\n\t\tsuperset instanceof MapNodeStoredSchema || superset instanceof ObjectNodeStoredSchema,\n\t\t0x894 /* unsupported node kind */,\n\t);\n\n\tif (original instanceof MapNodeStoredSchema) {\n\t\tif (superset instanceof MapNodeStoredSchema) {\n\t\t\treturn allowsFieldSuperset(policy, originalData, original.mapFields, superset.mapFields);\n\t\t}\n\t\treturn false;\n\t}\n\n\tassert(original instanceof ObjectNodeStoredSchema, 0x895 /* unsupported node kind */);\n\tif (superset instanceof MapNodeStoredSchema) {\n\t\tfor (const [_key, field] of original.objectNodeFields) {\n\t\t\tif (!allowsFieldSuperset(policy, originalData, field, superset.mapFields)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\tassert(superset instanceof ObjectNodeStoredSchema, 0x896 /* unsupported node kind */);\n\n\treturn compareSets({\n\t\ta: original.objectNodeFields,\n\t\tb: superset.objectNodeFields,\n\t\taExtra: (originalField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(originalField) ??\n\t\t\t\t\tfail(0xb17 /* missing expected field */),\n\t\t\t\tstoredEmptyFieldSchema,\n\t\t\t),\n\t\tbExtra: (supersetField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\tstoredEmptyFieldSchema,\n\t\t\t\tsuperset.objectNodeFields.get(supersetField) ??\n\t\t\t\t\tfail(0xb18 /* missing expected field */),\n\t\t\t),\n\t\tsame: (sameField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(sameField) ?? fail(0xb19 /* missing expected field */),\n\t\t\t\tsuperset.objectNodeFields.get(sameField) ?? fail(0xb1a /* missing expected field */),\n\t\t\t),\n\t});\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsValueSuperset(\n\toriginal: ValueSchema | undefined,\n\tsuperset: ValueSchema | undefined,\n): boolean {\n\treturn original === superset;\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * @param monotonicOnly - If true, only allow changes of field kinds which are explicitly listed in {@link FieldKindOptions.allowMonotonicUpgradeFrom}.\n * This prevents this function from considering two different schema as equivalent, preventing upgrades which would allow their inverse.\n * This prevents infinite upgrade loops where two clients could keep upgrading between two schema.\n *\n * @remarks\n * True if a client should be able to {@link TreeView.upgradeSchema} from a field schema using this field kind and `originalTypes` to `superset`.\n *\n * @privateRemarks\n * See also {@link FieldKindOptions.allowMonotonicUpgradeFrom} for constraints on the implementation.\n */\nexport function allowsFieldSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeFieldStoredSchema,\n\tsuperset: TreeFieldStoredSchema,\n\tmonotonicOnly: boolean = true,\n): boolean {\n\tif (!monotonicOnly && isNeverField(policy, originalData, original)) {\n\t\treturn true;\n\t}\n\n\tif (!allowsTreeSchemaIdentifierSuperset(original.types, superset.types)) {\n\t\treturn false;\n\t}\n\n\tif (original.kind === superset.kind) {\n\t\treturn true;\n\t}\n\n\tconst supersetKind = policy.fieldKinds.get(superset.kind) ?? fail(0xb1b /* missing kind */);\n\n\tif (monotonicOnly) {\n\t\treturn supersetKind.options.allowMonotonicUpgradeFrom.has(original.kind);\n\t} else {\n\t\tconst originalKind =\n\t\t\tpolicy.fieldKinds.get(original.kind) ?? fail(0xcab /* missing kind */);\n\t\treturn allowsMultiplicitySuperset(originalKind.multiplicity, supersetKind.multiplicity);\n\t}\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsTreeSchemaIdentifierSuperset(\n\toriginal: TreeTypeSet,\n\tsuperset: TreeTypeSet,\n): boolean {\n\tfor (const originalType of original) {\n\t\tif (!superset.has(originalType)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * A version of this that assumes a specific root field could be slightly more permissive in some simple cases,\n * however if any extra fields and fields with unconstrained types are reachable,\n * it would have to compare everything anyway.\n */\nexport function allowsRepoSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginal: TreeStoredSchema,\n\tsuperset: TreeStoredSchema,\n): boolean {\n\t{\n\t\tif (\n\t\t\t!allowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginal,\n\t\t\t\toriginal.rootFieldSchema,\n\t\t\t\tsuperset.rootFieldSchema,\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t// Check if all schema in original are included in superset, and permit a superset of the node content.\n\t// Note that any schema from `original.nodeSchema` can be used as the schema for a node at the root of a detached field,\n\t// so we must check all of them, even if they are not reachable from the root field schema.\n\tfor (const [key, schema] of original.nodeSchema) {\n\t\tif (!allowsTreeSuperset(policy, original, schema, superset.nodeSchema.get(key))) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t// Any schema in superset not in original are already known to be superset of original since they are \"never\" due to being missing.\n\t// Therefore, we do not need to check them.\n\treturn true;\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsMultiplicitySuperset(\n\toriginal: Multiplicity,\n\tsuperset: Multiplicity,\n): boolean {\n\tif (original === superset) {\n\t\treturn true;\n\t}\n\n\tswitch (superset) {\n\t\tcase Multiplicity.Forbidden: {\n\t\t\treturn false;\n\t\t}\n\t\tcase Multiplicity.Optional: {\n\t\t\treturn original === Multiplicity.Single || original === Multiplicity.Forbidden;\n\t\t}\n\t\tcase Multiplicity.Single: {\n\t\t\treturn false;\n\t\t}\n\t\tcase Multiplicity.Sequence: {\n\t\t\treturn true;\n\t\t}\n\t\tdefault: {\n\t\t\treturn unreachableCase(superset);\n\t\t}\n\t}\n}\n"]}