@fluidframework/tree 2.74.0-365691 → 2.74.0-370705

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 (1268) hide show
  1. package/.vscode/settings.json +2 -2
  2. package/api-report/tree.alpha.api.md +119 -85
  3. package/api-report/tree.beta.api.md +0 -1
  4. package/api-report/tree.legacy.beta.api.md +0 -1
  5. package/api-report/tree.legacy.public.api.md +0 -1
  6. package/api-report/tree.public.api.md +0 -1
  7. package/dist/alpha.d.ts +3 -2
  8. package/dist/codec/codec.d.ts +14 -1
  9. package/dist/codec/codec.d.ts.map +1 -1
  10. package/dist/codec/codec.js +11 -0
  11. package/dist/codec/codec.js.map +1 -1
  12. package/dist/codec/versioned/codec.d.ts +1 -1
  13. package/dist/codec/versioned/codec.d.ts.map +1 -1
  14. package/dist/codec/versioned/codec.js.map +1 -1
  15. package/dist/codec/versioned/format.d.ts +4 -1
  16. package/dist/codec/versioned/format.d.ts.map +1 -1
  17. package/dist/codec/versioned/format.js +4 -1
  18. package/dist/codec/versioned/format.js.map +1 -1
  19. package/dist/core/change-family/changeFamily.d.ts +4 -1
  20. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  21. package/dist/core/change-family/changeFamily.js.map +1 -1
  22. package/dist/core/change-family/index.d.ts +1 -1
  23. package/dist/core/change-family/index.d.ts.map +1 -1
  24. package/dist/core/change-family/index.js.map +1 -1
  25. package/dist/core/index.d.ts +3 -3
  26. package/dist/core/index.d.ts.map +1 -1
  27. package/dist/core/index.js +7 -4
  28. package/dist/core/index.js.map +1 -1
  29. package/dist/core/rebase/changeRebaser.d.ts +6 -1
  30. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  31. package/dist/core/rebase/changeRebaser.js.map +1 -1
  32. package/dist/core/rebase/index.d.ts +1 -1
  33. package/dist/core/rebase/index.d.ts.map +1 -1
  34. package/dist/core/rebase/index.js +2 -1
  35. package/dist/core/rebase/index.js.map +1 -1
  36. package/dist/core/rebase/types.d.ts +2 -1
  37. package/dist/core/rebase/types.d.ts.map +1 -1
  38. package/dist/core/rebase/types.js +5 -1
  39. package/dist/core/rebase/types.js.map +1 -1
  40. package/dist/core/rebase/utils.d.ts.map +1 -1
  41. package/dist/core/rebase/utils.js +25 -7
  42. package/dist/core/rebase/utils.js.map +1 -1
  43. package/dist/core/tree/detachedFieldIndex.d.ts +40 -13
  44. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  45. package/dist/core/tree/detachedFieldIndex.js +21 -12
  46. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  47. package/dist/core/tree/index.d.ts +4 -3
  48. package/dist/core/tree/index.d.ts.map +1 -1
  49. package/dist/core/tree/index.js +6 -2
  50. package/dist/core/tree/index.js.map +1 -1
  51. package/dist/core/tree/pathTree.d.ts +11 -3
  52. package/dist/core/tree/pathTree.d.ts.map +1 -1
  53. package/dist/core/tree/pathTree.js +14 -2
  54. package/dist/core/tree/pathTree.js.map +1 -1
  55. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  56. package/dist/feature-libraries/chunked-forest/basicChunk.js +7 -0
  57. package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  58. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  59. package/dist/feature-libraries/chunked-forest/chunkTree.js +4 -1
  60. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  61. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
  62. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
  63. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
  64. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
  65. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  66. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +91 -42
  67. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  68. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +238 -69
  69. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  70. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +4 -4
  71. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  72. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +33 -28
  73. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  74. package/dist/feature-libraries/default-schema/index.d.ts +2 -1
  75. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  76. package/dist/feature-libraries/default-schema/index.js +5 -2
  77. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  78. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +36 -0
  79. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
  80. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js +126 -0
  81. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
  82. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +7 -6
  83. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  84. package/dist/feature-libraries/default-schema/mappedEditBuilder.js +15 -0
  85. package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  86. package/dist/feature-libraries/deltaUtils.d.ts +1 -0
  87. package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
  88. package/dist/feature-libraries/deltaUtils.js +6 -1
  89. package/dist/feature-libraries/deltaUtils.js.map +1 -1
  90. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
  91. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  92. package/dist/feature-libraries/detachedFieldIndexSummarizer.js +41 -11
  93. package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  94. package/dist/feature-libraries/flex-tree/context.d.ts +9 -0
  95. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  96. package/dist/feature-libraries/flex-tree/context.js +6 -0
  97. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  98. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  99. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  100. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  101. package/dist/feature-libraries/flex-tree/lazyField.d.ts +8 -7
  102. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  103. package/dist/feature-libraries/flex-tree/lazyField.js +37 -8
  104. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  105. package/dist/feature-libraries/forest-summary/codec.d.ts +2 -2
  106. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  107. package/dist/feature-libraries/forest-summary/codec.js +4 -4
  108. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  109. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +9 -13
  110. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  111. package/dist/feature-libraries/forest-summary/forestSummarizer.js +21 -26
  112. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  113. package/dist/feature-libraries/forest-summary/format.d.ts +41 -5
  114. package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
  115. package/dist/feature-libraries/forest-summary/format.js +7 -7
  116. package/dist/feature-libraries/forest-summary/format.js.map +1 -1
  117. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +11 -9
  118. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  119. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +16 -29
  120. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  121. package/dist/feature-libraries/forest-summary/index.d.ts +2 -1
  122. package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
  123. package/dist/feature-libraries/forest-summary/index.js +3 -2
  124. package/dist/feature-libraries/forest-summary/index.js.map +1 -1
  125. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts +47 -0
  126. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
  127. package/dist/feature-libraries/forest-summary/summaryTypes.js +57 -0
  128. package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
  129. package/dist/feature-libraries/index.d.ts +4 -4
  130. package/dist/feature-libraries/index.d.ts.map +1 -1
  131. package/dist/feature-libraries/index.js +8 -3
  132. package/dist/feature-libraries/index.js.map +1 -1
  133. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  134. package/dist/feature-libraries/mapTreeCursor.js +1 -0
  135. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  136. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  137. package/dist/feature-libraries/mitigatedChangeFamily.js +2 -2
  138. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  139. package/dist/feature-libraries/modular-schema/comparison.d.ts +18 -2
  140. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  141. package/dist/feature-libraries/modular-schema/comparison.js +54 -3
  142. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  143. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
  144. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  145. package/dist/feature-libraries/modular-schema/crossFieldQueries.js +4 -7
  146. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  147. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +20 -52
  148. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  149. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  150. package/dist/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
  151. package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  152. package/dist/feature-libraries/modular-schema/fieldKind.js +0 -21
  153. package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  154. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  155. package/dist/feature-libraries/modular-schema/genericFieldKind.js +7 -10
  156. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  157. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js +2 -2
  158. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  159. package/dist/feature-libraries/modular-schema/index.d.ts +6 -6
  160. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  161. package/dist/feature-libraries/modular-schema/index.js +13 -8
  162. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  163. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +17 -0
  164. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
  165. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +388 -0
  166. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
  167. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +17 -0
  168. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
  169. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +413 -0
  170. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
  171. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  172. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  173. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +8 -284
  174. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  175. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +49 -15
  176. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  177. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1306 -465
  178. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  179. package/dist/feature-libraries/modular-schema/{modularChangeFormat.d.ts → modularChangeFormatV1.d.ts} +2 -2
  180. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
  181. package/dist/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +5 -5
  182. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
  183. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +146 -0
  184. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
  185. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +32 -0
  186. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
  187. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +50 -10
  188. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  189. package/dist/feature-libraries/modular-schema/modularChangeTypes.js +24 -3
  190. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  191. package/dist/feature-libraries/optional-field/index.d.ts +2 -2
  192. package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
  193. package/dist/feature-libraries/optional-field/index.js +1 -2
  194. package/dist/feature-libraries/optional-field/index.js.map +1 -1
  195. package/dist/feature-libraries/optional-field/optionalField.d.ts +5 -26
  196. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  197. package/dist/feature-libraries/optional-field/optionalField.js +217 -451
  198. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  199. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +23 -0
  200. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +1 -0
  201. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +31 -0
  202. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +1 -0
  203. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
  204. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  205. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  206. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  207. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  208. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +57 -28
  209. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  210. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +12 -0
  211. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +1 -0
  212. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js +57 -0
  213. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js.map +1 -0
  214. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  215. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +5 -1
  216. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  217. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
  218. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  219. package/dist/feature-libraries/schema-index/schemaSummarizer.js +42 -16
  220. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  221. package/dist/feature-libraries/sequence-field/compose.d.ts +6 -7
  222. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  223. package/dist/feature-libraries/sequence-field/compose.js +80 -256
  224. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  225. package/dist/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
  226. package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  227. package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  228. package/dist/feature-libraries/sequence-field/index.d.ts +2 -3
  229. package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
  230. package/dist/feature-libraries/sequence-field/index.js +1 -3
  231. package/dist/feature-libraries/sequence-field/index.js.map +1 -1
  232. package/dist/feature-libraries/sequence-field/invert.d.ts +3 -3
  233. package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  234. package/dist/feature-libraries/sequence-field/invert.js +65 -167
  235. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  236. package/dist/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  237. package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  238. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  239. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
  240. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  241. package/dist/feature-libraries/sequence-field/moveEffectTable.js +7 -86
  242. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  243. package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -3
  244. package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  245. package/dist/feature-libraries/sequence-field/rebase.js +106 -112
  246. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  247. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  248. package/dist/feature-libraries/sequence-field/replaceRevisions.js +16 -33
  249. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  250. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  251. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +0 -2
  252. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  253. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
  254. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  255. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +358 -179
  256. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  257. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  258. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +20 -60
  259. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  260. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  261. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  262. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
  263. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  264. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
  265. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  266. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +14 -109
  267. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  268. package/dist/feature-libraries/sequence-field/types.d.ts +30 -59
  269. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  270. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  271. package/dist/feature-libraries/sequence-field/utils.d.ts +15 -24
  272. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  273. package/dist/feature-libraries/sequence-field/utils.js +111 -299
  274. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  275. package/dist/index.d.ts +1 -1
  276. package/dist/index.d.ts.map +1 -1
  277. package/dist/index.js +3 -3
  278. package/dist/index.js.map +1 -1
  279. package/dist/packageVersion.d.ts +1 -1
  280. package/dist/packageVersion.js +1 -1
  281. package/dist/packageVersion.js.map +1 -1
  282. package/dist/shared-tree/independentView.d.ts +1 -1
  283. package/dist/shared-tree/independentView.d.ts.map +1 -1
  284. package/dist/shared-tree/independentView.js.map +1 -1
  285. package/dist/shared-tree/index.d.ts +1 -1
  286. package/dist/shared-tree/index.d.ts.map +1 -1
  287. package/dist/shared-tree/index.js.map +1 -1
  288. package/dist/shared-tree/schematizeTree.d.ts +4 -4
  289. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  290. package/dist/shared-tree/schematizeTree.js +2 -1
  291. package/dist/shared-tree/schematizeTree.js.map +1 -1
  292. package/dist/shared-tree/schematizingTreeView.d.ts +1 -5
  293. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  294. package/dist/shared-tree/schematizingTreeView.js +32 -33
  295. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  296. package/dist/shared-tree/sharedTree.d.ts +11 -5
  297. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  298. package/dist/shared-tree/sharedTree.js +14 -4
  299. package/dist/shared-tree/sharedTree.js.map +1 -1
  300. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  301. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  302. package/dist/shared-tree/sharedTreeChangeCodecs.js +1 -0
  303. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  304. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
  305. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  306. package/dist/shared-tree/sharedTreeChangeEnricher.js +26 -12
  307. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  308. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +5 -5
  309. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  310. package/dist/shared-tree/sharedTreeChangeFamily.js +10 -4
  311. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  312. package/dist/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
  313. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  314. package/dist/shared-tree/sharedTreeEditBuilder.js +14 -7
  315. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  316. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  317. package/dist/shared-tree/treeAlpha.js +1 -1
  318. package/dist/shared-tree/treeAlpha.js.map +1 -1
  319. package/dist/shared-tree/treeCheckout.d.ts +12 -10
  320. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  321. package/dist/shared-tree/treeCheckout.js +66 -17
  322. package/dist/shared-tree/treeCheckout.js.map +1 -1
  323. package/dist/shared-tree-core/branch.d.ts +3 -2
  324. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  325. package/dist/shared-tree-core/branch.js +4 -3
  326. package/dist/shared-tree-core/branch.js.map +1 -1
  327. package/dist/shared-tree-core/editManager.d.ts +2 -2
  328. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  329. package/dist/shared-tree-core/editManager.js +9 -9
  330. package/dist/shared-tree-core/editManager.js.map +1 -1
  331. package/dist/shared-tree-core/editManagerCodecs.d.ts +4 -0
  332. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  333. package/dist/shared-tree-core/editManagerCodecs.js +16 -6
  334. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  335. package/{lib/shared-tree-core/editManagerCodecsV5.d.ts → dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
  336. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
  337. package/dist/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +7 -7
  338. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
  339. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +20 -6
  340. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  341. package/dist/shared-tree-core/editManagerFormatCommons.js +22 -7
  342. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  343. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  344. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  345. package/dist/shared-tree-core/editManagerFormatV1toV4.js +1 -0
  346. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  347. package/dist/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
  348. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
  349. package/dist/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
  350. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
  351. package/dist/shared-tree-core/editManagerSummarizer.d.ts +29 -9
  352. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  353. package/dist/shared-tree-core/editManagerSummarizer.js +41 -13
  354. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  355. package/dist/shared-tree-core/index.d.ts +5 -3
  356. package/dist/shared-tree-core/index.d.ts.map +1 -1
  357. package/dist/shared-tree-core/index.js +8 -1
  358. package/dist/shared-tree-core/index.js.map +1 -1
  359. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  360. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  361. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  362. package/{lib/shared-tree-core/messageCodecV5.d.ts → dist/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
  363. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
  364. package/dist/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +6 -6
  365. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
  366. package/dist/shared-tree-core/messageCodecs.d.ts +4 -0
  367. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  368. package/dist/shared-tree-core/messageCodecs.js +16 -6
  369. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  370. package/dist/shared-tree-core/messageFormat.d.ts +20 -6
  371. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  372. package/dist/shared-tree-core/messageFormat.js +22 -7
  373. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  374. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
  375. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  376. package/dist/shared-tree-core/messageFormatV1ToV4.js +8 -1
  377. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  378. package/dist/shared-tree-core/{messageFormatV5.d.ts → messageFormatVSharedBranches.d.ts} +5 -7
  379. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
  380. package/dist/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
  381. package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
  382. package/dist/shared-tree-core/sharedTreeCore.d.ts +14 -47
  383. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  384. package/dist/shared-tree-core/sharedTreeCore.js +30 -18
  385. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  386. package/dist/shared-tree-core/summaryTypes.d.ts +94 -0
  387. package/dist/shared-tree-core/summaryTypes.d.ts.map +1 -0
  388. package/dist/shared-tree-core/summaryTypes.js +47 -0
  389. package/dist/shared-tree-core/summaryTypes.js.map +1 -0
  390. package/dist/shared-tree-core/versionedSummarizer.d.ts +67 -0
  391. package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
  392. package/dist/shared-tree-core/versionedSummarizer.js +63 -0
  393. package/dist/shared-tree-core/versionedSummarizer.js.map +1 -0
  394. package/dist/simple-tree/api/configuration.d.ts +3 -26
  395. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  396. package/dist/simple-tree/api/configuration.js +10 -21
  397. package/dist/simple-tree/api/configuration.js.map +1 -1
  398. package/dist/simple-tree/api/dirtyIndex.d.ts +11 -0
  399. package/dist/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  400. package/dist/simple-tree/api/dirtyIndex.js +7 -0
  401. package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
  402. package/dist/simple-tree/api/discrepancies.d.ts +1 -1
  403. package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
  404. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  405. package/dist/simple-tree/api/getSimpleSchema.d.ts +3 -3
  406. package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  407. package/dist/simple-tree/api/getSimpleSchema.js +9 -3
  408. package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
  409. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  410. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  411. package/dist/simple-tree/api/incrementalAllowedTypes.js +7 -0
  412. package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  413. package/dist/simple-tree/api/index.d.ts +3 -4
  414. package/dist/simple-tree/api/index.d.ts.map +1 -1
  415. package/dist/simple-tree/api/index.js +4 -5
  416. package/dist/simple-tree/api/index.js.map +1 -1
  417. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  418. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  419. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  420. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
  421. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  422. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  423. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  424. package/dist/simple-tree/api/schemaFactoryRecursive.js +0 -1
  425. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  426. package/dist/simple-tree/api/schemaFromSimple.d.ts +6 -1
  427. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  428. package/dist/simple-tree/api/schemaFromSimple.js +5 -0
  429. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  430. package/dist/simple-tree/api/schemaStatics.d.ts +12 -12
  431. package/dist/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
  432. package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  433. package/dist/simple-tree/api/simpleSchemaCodec.js +18 -6
  434. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  435. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  436. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  437. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  438. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
  439. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  440. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +13 -8
  441. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  442. package/dist/simple-tree/api/typesUnsafe.d.ts +3 -3
  443. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  444. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  445. package/dist/simple-tree/core/allowedTypes.d.ts +2 -2
  446. package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
  447. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  448. package/dist/simple-tree/core/index.d.ts +1 -1
  449. package/dist/simple-tree/core/index.d.ts.map +1 -1
  450. package/dist/simple-tree/core/index.js +2 -3
  451. package/dist/simple-tree/core/index.js.map +1 -1
  452. package/dist/simple-tree/core/toStored.d.ts +17 -15
  453. package/dist/simple-tree/core/toStored.d.ts.map +1 -1
  454. package/dist/simple-tree/core/toStored.js +5 -40
  455. package/dist/simple-tree/core/toStored.js.map +1 -1
  456. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
  457. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  458. package/dist/simple-tree/core/unhydratedFlexTree.js +59 -8
  459. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  460. package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
  461. package/dist/simple-tree/core/walkSchema.js +4 -0
  462. package/dist/simple-tree/core/walkSchema.js.map +1 -1
  463. package/dist/simple-tree/createContext.d.ts.map +1 -1
  464. package/dist/simple-tree/createContext.js +20 -5
  465. package/dist/simple-tree/createContext.js.map +1 -1
  466. package/dist/simple-tree/fieldSchema.d.ts +7 -7
  467. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  468. package/dist/simple-tree/fieldSchema.js.map +1 -1
  469. package/dist/simple-tree/index.d.ts +8 -7
  470. package/dist/simple-tree/index.d.ts.map +1 -1
  471. package/dist/simple-tree/index.js +15 -12
  472. package/dist/simple-tree/index.js.map +1 -1
  473. package/dist/simple-tree/leafNodeSchema.d.ts +5 -5
  474. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  475. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  476. package/dist/simple-tree/node-kinds/array/arrayNode.js +5 -3
  477. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  478. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
  479. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  480. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  481. package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
  482. package/dist/simple-tree/node-kinds/common.js +1 -1
  483. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  484. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  485. package/dist/simple-tree/node-kinds/map/mapNode.js +2 -2
  486. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  487. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
  488. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  489. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  490. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  491. package/dist/simple-tree/node-kinds/object/objectNode.js +18 -18
  492. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  493. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
  494. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  495. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  496. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  497. package/dist/simple-tree/node-kinds/record/recordNode.js +4 -2
  498. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  499. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
  500. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  501. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  502. package/dist/simple-tree/prepareForInsertion.d.ts +54 -47
  503. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  504. package/dist/simple-tree/prepareForInsertion.js +183 -125
  505. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  506. package/dist/simple-tree/simpleSchema.d.ts +55 -23
  507. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  508. package/dist/simple-tree/simpleSchema.js +17 -0
  509. package/dist/simple-tree/simpleSchema.js.map +1 -1
  510. package/dist/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
  511. package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
  512. package/dist/simple-tree/simpleSchemaFormatV1.js +8 -1
  513. package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  514. package/dist/simple-tree/toStoredSchema.d.ts +58 -11
  515. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  516. package/dist/simple-tree/toStoredSchema.js +205 -30
  517. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  518. package/dist/simple-tree/treeSchema.d.ts +23 -0
  519. package/dist/simple-tree/treeSchema.d.ts.map +1 -0
  520. package/dist/simple-tree/treeSchema.js +25 -0
  521. package/dist/simple-tree/treeSchema.js.map +1 -0
  522. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
  523. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  524. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +29 -11
  525. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  526. package/dist/tableSchema.d.ts +117 -63
  527. package/dist/tableSchema.d.ts.map +1 -1
  528. package/dist/tableSchema.js +159 -58
  529. package/dist/tableSchema.js.map +1 -1
  530. package/dist/treeFactory.d.ts.map +1 -1
  531. package/dist/treeFactory.js +17 -3
  532. package/dist/treeFactory.js.map +1 -1
  533. package/dist/util/index.d.ts +2 -1
  534. package/dist/util/index.d.ts.map +1 -1
  535. package/dist/util/index.js +4 -1
  536. package/dist/util/index.js.map +1 -1
  537. package/dist/util/rangeMap.d.ts +24 -12
  538. package/dist/util/rangeMap.d.ts.map +1 -1
  539. package/dist/util/rangeMap.js +46 -6
  540. package/dist/util/rangeMap.js.map +1 -1
  541. package/dist/util/readSnapshotBlob.d.ts +13 -0
  542. package/dist/util/readSnapshotBlob.d.ts.map +1 -0
  543. package/dist/util/readSnapshotBlob.js +18 -0
  544. package/dist/util/readSnapshotBlob.js.map +1 -0
  545. package/lib/alpha.d.ts +3 -2
  546. package/lib/codec/codec.d.ts +14 -1
  547. package/lib/codec/codec.d.ts.map +1 -1
  548. package/lib/codec/codec.js +11 -0
  549. package/lib/codec/codec.js.map +1 -1
  550. package/lib/codec/versioned/codec.d.ts +1 -1
  551. package/lib/codec/versioned/codec.d.ts.map +1 -1
  552. package/lib/codec/versioned/codec.js.map +1 -1
  553. package/lib/codec/versioned/format.d.ts +4 -1
  554. package/lib/codec/versioned/format.d.ts.map +1 -1
  555. package/lib/codec/versioned/format.js +4 -1
  556. package/lib/codec/versioned/format.js.map +1 -1
  557. package/lib/core/change-family/changeFamily.d.ts +4 -1
  558. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  559. package/lib/core/change-family/changeFamily.js.map +1 -1
  560. package/lib/core/change-family/index.d.ts +1 -1
  561. package/lib/core/change-family/index.d.ts.map +1 -1
  562. package/lib/core/change-family/index.js.map +1 -1
  563. package/lib/core/index.d.ts +3 -3
  564. package/lib/core/index.d.ts.map +1 -1
  565. package/lib/core/index.js +2 -2
  566. package/lib/core/index.js.map +1 -1
  567. package/lib/core/rebase/changeRebaser.d.ts +6 -1
  568. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  569. package/lib/core/rebase/changeRebaser.js.map +1 -1
  570. package/lib/core/rebase/index.d.ts +1 -1
  571. package/lib/core/rebase/index.d.ts.map +1 -1
  572. package/lib/core/rebase/index.js +1 -1
  573. package/lib/core/rebase/index.js.map +1 -1
  574. package/lib/core/rebase/types.d.ts +2 -1
  575. package/lib/core/rebase/types.d.ts.map +1 -1
  576. package/lib/core/rebase/types.js +3 -0
  577. package/lib/core/rebase/types.js.map +1 -1
  578. package/lib/core/rebase/utils.d.ts.map +1 -1
  579. package/lib/core/rebase/utils.js +25 -7
  580. package/lib/core/rebase/utils.js.map +1 -1
  581. package/lib/core/tree/detachedFieldIndex.d.ts +40 -13
  582. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  583. package/lib/core/tree/detachedFieldIndex.js +22 -13
  584. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  585. package/lib/core/tree/index.d.ts +4 -3
  586. package/lib/core/tree/index.d.ts.map +1 -1
  587. package/lib/core/tree/index.js +3 -2
  588. package/lib/core/tree/index.js.map +1 -1
  589. package/lib/core/tree/pathTree.d.ts +11 -3
  590. package/lib/core/tree/pathTree.d.ts.map +1 -1
  591. package/lib/core/tree/pathTree.js +12 -1
  592. package/lib/core/tree/pathTree.js.map +1 -1
  593. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  594. package/lib/feature-libraries/chunked-forest/basicChunk.js +8 -1
  595. package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  596. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  597. package/lib/feature-libraries/chunked-forest/chunkTree.js +4 -1
  598. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  599. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
  600. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
  601. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
  602. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
  603. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  604. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +91 -42
  605. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  606. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +236 -70
  607. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  608. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +4 -4
  609. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  610. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +34 -29
  611. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  612. package/lib/feature-libraries/default-schema/index.d.ts +2 -1
  613. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  614. package/lib/feature-libraries/default-schema/index.js +2 -1
  615. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  616. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +36 -0
  617. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
  618. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js +122 -0
  619. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
  620. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +7 -6
  621. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  622. package/lib/feature-libraries/default-schema/mappedEditBuilder.js +15 -0
  623. package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  624. package/lib/feature-libraries/deltaUtils.d.ts +1 -0
  625. package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
  626. package/lib/feature-libraries/deltaUtils.js +5 -1
  627. package/lib/feature-libraries/deltaUtils.js.map +1 -1
  628. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
  629. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  630. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +38 -8
  631. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  632. package/lib/feature-libraries/flex-tree/context.d.ts +9 -0
  633. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  634. package/lib/feature-libraries/flex-tree/context.js +6 -0
  635. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  636. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  637. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  638. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  639. package/lib/feature-libraries/flex-tree/lazyField.d.ts +8 -7
  640. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  641. package/lib/feature-libraries/flex-tree/lazyField.js +38 -9
  642. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  643. package/lib/feature-libraries/forest-summary/codec.d.ts +2 -2
  644. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  645. package/lib/feature-libraries/forest-summary/codec.js +5 -5
  646. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  647. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +9 -13
  648. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  649. package/lib/feature-libraries/forest-summary/forestSummarizer.js +17 -22
  650. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  651. package/lib/feature-libraries/forest-summary/format.d.ts +41 -5
  652. package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
  653. package/lib/feature-libraries/forest-summary/format.js +3 -3
  654. package/lib/feature-libraries/forest-summary/format.js.map +1 -1
  655. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +11 -9
  656. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  657. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +13 -26
  658. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  659. package/lib/feature-libraries/forest-summary/index.d.ts +2 -1
  660. package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
  661. package/lib/feature-libraries/forest-summary/index.js +2 -1
  662. package/lib/feature-libraries/forest-summary/index.js.map +1 -1
  663. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts +47 -0
  664. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
  665. package/lib/feature-libraries/forest-summary/summaryTypes.js +53 -0
  666. package/lib/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
  667. package/lib/feature-libraries/index.d.ts +4 -4
  668. package/lib/feature-libraries/index.d.ts.map +1 -1
  669. package/lib/feature-libraries/index.js +3 -3
  670. package/lib/feature-libraries/index.js.map +1 -1
  671. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  672. package/lib/feature-libraries/mapTreeCursor.js +2 -1
  673. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  674. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  675. package/lib/feature-libraries/mitigatedChangeFamily.js +2 -2
  676. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  677. package/lib/feature-libraries/modular-schema/comparison.d.ts +18 -2
  678. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  679. package/lib/feature-libraries/modular-schema/comparison.js +55 -5
  680. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  681. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
  682. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  683. package/lib/feature-libraries/modular-schema/crossFieldQueries.js +3 -5
  684. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  685. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +20 -52
  686. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  687. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  688. package/lib/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
  689. package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  690. package/lib/feature-libraries/modular-schema/fieldKind.js +0 -21
  691. package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  692. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  693. package/lib/feature-libraries/modular-schema/genericFieldKind.js +7 -10
  694. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  695. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js +1 -1
  696. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  697. package/lib/feature-libraries/modular-schema/index.d.ts +6 -6
  698. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  699. package/lib/feature-libraries/modular-schema/index.js +5 -4
  700. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  701. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +17 -0
  702. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
  703. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +384 -0
  704. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
  705. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +17 -0
  706. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
  707. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +409 -0
  708. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
  709. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  710. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  711. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +9 -285
  712. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  713. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +49 -15
  714. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  715. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1291 -458
  716. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  717. package/lib/feature-libraries/modular-schema/{modularChangeFormat.d.ts → modularChangeFormatV1.d.ts} +2 -2
  718. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
  719. package/lib/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +2 -2
  720. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
  721. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +146 -0
  722. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
  723. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +29 -0
  724. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
  725. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +50 -10
  726. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  727. package/lib/feature-libraries/modular-schema/modularChangeTypes.js +20 -2
  728. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  729. package/lib/feature-libraries/optional-field/index.d.ts +2 -2
  730. package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
  731. package/lib/feature-libraries/optional-field/index.js +1 -1
  732. package/lib/feature-libraries/optional-field/index.js.map +1 -1
  733. package/lib/feature-libraries/optional-field/optionalField.d.ts +5 -26
  734. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  735. package/lib/feature-libraries/optional-field/optionalField.js +217 -449
  736. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  737. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +23 -0
  738. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +1 -0
  739. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +27 -0
  740. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +1 -0
  741. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
  742. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  743. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  744. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  745. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  746. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +55 -26
  747. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  748. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +12 -0
  749. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +1 -0
  750. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js +53 -0
  751. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js.map +1 -0
  752. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  753. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +5 -1
  754. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  755. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
  756. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  757. package/lib/feature-libraries/schema-index/schemaSummarizer.js +38 -12
  758. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  759. package/lib/feature-libraries/sequence-field/compose.d.ts +6 -7
  760. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  761. package/lib/feature-libraries/sequence-field/compose.js +82 -258
  762. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  763. package/lib/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
  764. package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  765. package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  766. package/lib/feature-libraries/sequence-field/index.d.ts +2 -3
  767. package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
  768. package/lib/feature-libraries/sequence-field/index.js +0 -1
  769. package/lib/feature-libraries/sequence-field/index.js.map +1 -1
  770. package/lib/feature-libraries/sequence-field/invert.d.ts +3 -3
  771. package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  772. package/lib/feature-libraries/sequence-field/invert.js +67 -169
  773. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  774. package/lib/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  775. package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  776. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  777. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
  778. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  779. package/lib/feature-libraries/sequence-field/moveEffectTable.js +6 -80
  780. package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  781. package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -3
  782. package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  783. package/lib/feature-libraries/sequence-field/rebase.js +108 -114
  784. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  785. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  786. package/lib/feature-libraries/sequence-field/replaceRevisions.js +16 -33
  787. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  788. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  789. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +0 -2
  790. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  791. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
  792. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  793. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +350 -175
  794. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  795. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  796. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +21 -61
  797. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  798. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  799. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  800. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
  801. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  802. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
  803. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  804. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +14 -109
  805. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  806. package/lib/feature-libraries/sequence-field/types.d.ts +30 -59
  807. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  808. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  809. package/lib/feature-libraries/sequence-field/utils.d.ts +15 -24
  810. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  811. package/lib/feature-libraries/sequence-field/utils.js +107 -292
  812. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  813. package/lib/index.d.ts +1 -1
  814. package/lib/index.d.ts.map +1 -1
  815. package/lib/index.js +1 -1
  816. package/lib/index.js.map +1 -1
  817. package/lib/packageVersion.d.ts +1 -1
  818. package/lib/packageVersion.js +1 -1
  819. package/lib/packageVersion.js.map +1 -1
  820. package/lib/shared-tree/independentView.d.ts +1 -1
  821. package/lib/shared-tree/independentView.d.ts.map +1 -1
  822. package/lib/shared-tree/independentView.js.map +1 -1
  823. package/lib/shared-tree/index.d.ts +1 -1
  824. package/lib/shared-tree/index.d.ts.map +1 -1
  825. package/lib/shared-tree/index.js.map +1 -1
  826. package/lib/shared-tree/schematizeTree.d.ts +4 -4
  827. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  828. package/lib/shared-tree/schematizeTree.js +3 -2
  829. package/lib/shared-tree/schematizeTree.js.map +1 -1
  830. package/lib/shared-tree/schematizingTreeView.d.ts +1 -5
  831. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  832. package/lib/shared-tree/schematizingTreeView.js +35 -36
  833. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  834. package/lib/shared-tree/sharedTree.d.ts +11 -5
  835. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  836. package/lib/shared-tree/sharedTree.js +14 -4
  837. package/lib/shared-tree/sharedTree.js.map +1 -1
  838. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  839. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  840. package/lib/shared-tree/sharedTreeChangeCodecs.js +1 -0
  841. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  842. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
  843. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  844. package/lib/shared-tree/sharedTreeChangeEnricher.js +27 -13
  845. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  846. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +5 -5
  847. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  848. package/lib/shared-tree/sharedTreeChangeFamily.js +11 -5
  849. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  850. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
  851. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  852. package/lib/shared-tree/sharedTreeEditBuilder.js +12 -6
  853. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  854. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  855. package/lib/shared-tree/treeAlpha.js +2 -2
  856. package/lib/shared-tree/treeAlpha.js.map +1 -1
  857. package/lib/shared-tree/treeCheckout.d.ts +12 -10
  858. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  859. package/lib/shared-tree/treeCheckout.js +69 -20
  860. package/lib/shared-tree/treeCheckout.js.map +1 -1
  861. package/lib/shared-tree-core/branch.d.ts +3 -2
  862. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  863. package/lib/shared-tree-core/branch.js +4 -3
  864. package/lib/shared-tree-core/branch.js.map +1 -1
  865. package/lib/shared-tree-core/editManager.d.ts +2 -2
  866. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  867. package/lib/shared-tree-core/editManager.js +9 -9
  868. package/lib/shared-tree-core/editManager.js.map +1 -1
  869. package/lib/shared-tree-core/editManagerCodecs.d.ts +4 -0
  870. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  871. package/lib/shared-tree-core/editManagerCodecs.js +14 -5
  872. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  873. package/{dist/shared-tree-core/editManagerCodecsV5.d.ts → lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
  874. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
  875. package/lib/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +4 -4
  876. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
  877. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +20 -6
  878. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  879. package/lib/shared-tree-core/editManagerFormatCommons.js +22 -7
  880. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  881. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  882. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  883. package/lib/shared-tree-core/editManagerFormatV1toV4.js +1 -0
  884. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  885. package/lib/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
  886. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
  887. package/lib/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
  888. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
  889. package/lib/shared-tree-core/editManagerSummarizer.d.ts +29 -9
  890. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  891. package/lib/shared-tree-core/editManagerSummarizer.js +39 -11
  892. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  893. package/lib/shared-tree-core/index.d.ts +5 -3
  894. package/lib/shared-tree-core/index.d.ts.map +1 -1
  895. package/lib/shared-tree-core/index.js +4 -2
  896. package/lib/shared-tree-core/index.js.map +1 -1
  897. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  898. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  899. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  900. package/{dist/shared-tree-core/messageCodecV5.d.ts → lib/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
  901. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
  902. package/lib/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +3 -3
  903. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
  904. package/lib/shared-tree-core/messageCodecs.d.ts +4 -0
  905. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  906. package/lib/shared-tree-core/messageCodecs.js +14 -5
  907. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  908. package/lib/shared-tree-core/messageFormat.d.ts +20 -6
  909. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  910. package/lib/shared-tree-core/messageFormat.js +22 -7
  911. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  912. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
  913. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  914. package/lib/shared-tree-core/messageFormatV1ToV4.js +8 -1
  915. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  916. package/lib/shared-tree-core/{messageFormatV5.d.ts → messageFormatVSharedBranches.d.ts} +5 -7
  917. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
  918. package/lib/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
  919. package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
  920. package/lib/shared-tree-core/sharedTreeCore.d.ts +14 -47
  921. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  922. package/lib/shared-tree-core/sharedTreeCore.js +28 -16
  923. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  924. package/lib/shared-tree-core/summaryTypes.d.ts +94 -0
  925. package/lib/shared-tree-core/summaryTypes.d.ts.map +1 -0
  926. package/lib/shared-tree-core/summaryTypes.js +43 -0
  927. package/lib/shared-tree-core/summaryTypes.js.map +1 -0
  928. package/lib/shared-tree-core/versionedSummarizer.d.ts +67 -0
  929. package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
  930. package/lib/shared-tree-core/versionedSummarizer.js +59 -0
  931. package/lib/shared-tree-core/versionedSummarizer.js.map +1 -0
  932. package/lib/simple-tree/api/configuration.d.ts +3 -26
  933. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  934. package/lib/simple-tree/api/configuration.js +14 -25
  935. package/lib/simple-tree/api/configuration.js.map +1 -1
  936. package/lib/simple-tree/api/dirtyIndex.d.ts +11 -0
  937. package/lib/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  938. package/lib/simple-tree/api/dirtyIndex.js +7 -0
  939. package/lib/simple-tree/api/dirtyIndex.js.map +1 -1
  940. package/lib/simple-tree/api/discrepancies.d.ts +1 -1
  941. package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
  942. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  943. package/lib/simple-tree/api/getSimpleSchema.d.ts +3 -3
  944. package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  945. package/lib/simple-tree/api/getSimpleSchema.js +9 -3
  946. package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
  947. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  948. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  949. package/lib/simple-tree/api/incrementalAllowedTypes.js +8 -1
  950. package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  951. package/lib/simple-tree/api/index.d.ts +3 -4
  952. package/lib/simple-tree/api/index.d.ts.map +1 -1
  953. package/lib/simple-tree/api/index.js +2 -3
  954. package/lib/simple-tree/api/index.js.map +1 -1
  955. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  956. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  957. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  958. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
  959. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  960. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  961. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  962. package/lib/simple-tree/api/schemaFactoryRecursive.js +0 -1
  963. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  964. package/lib/simple-tree/api/schemaFromSimple.d.ts +6 -1
  965. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  966. package/lib/simple-tree/api/schemaFromSimple.js +5 -0
  967. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  968. package/lib/simple-tree/api/schemaStatics.d.ts +12 -12
  969. package/lib/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
  970. package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  971. package/lib/simple-tree/api/simpleSchemaCodec.js +15 -3
  972. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  973. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  974. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  975. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  976. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
  977. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  978. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +15 -10
  979. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  980. package/lib/simple-tree/api/typesUnsafe.d.ts +3 -3
  981. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  982. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  983. package/lib/simple-tree/core/allowedTypes.d.ts +2 -2
  984. package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
  985. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  986. package/lib/simple-tree/core/index.d.ts +1 -1
  987. package/lib/simple-tree/core/index.d.ts.map +1 -1
  988. package/lib/simple-tree/core/index.js +1 -1
  989. package/lib/simple-tree/core/index.js.map +1 -1
  990. package/lib/simple-tree/core/toStored.d.ts +17 -15
  991. package/lib/simple-tree/core/toStored.d.ts.map +1 -1
  992. package/lib/simple-tree/core/toStored.js +4 -37
  993. package/lib/simple-tree/core/toStored.js.map +1 -1
  994. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
  995. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  996. package/lib/simple-tree/core/unhydratedFlexTree.js +58 -8
  997. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  998. package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
  999. package/lib/simple-tree/core/walkSchema.js +5 -1
  1000. package/lib/simple-tree/core/walkSchema.js.map +1 -1
  1001. package/lib/simple-tree/createContext.d.ts.map +1 -1
  1002. package/lib/simple-tree/createContext.js +20 -5
  1003. package/lib/simple-tree/createContext.js.map +1 -1
  1004. package/lib/simple-tree/fieldSchema.d.ts +7 -7
  1005. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  1006. package/lib/simple-tree/fieldSchema.js.map +1 -1
  1007. package/lib/simple-tree/index.d.ts +8 -7
  1008. package/lib/simple-tree/index.d.ts.map +1 -1
  1009. package/lib/simple-tree/index.js +6 -5
  1010. package/lib/simple-tree/index.js.map +1 -1
  1011. package/lib/simple-tree/leafNodeSchema.d.ts +5 -5
  1012. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  1013. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  1014. package/lib/simple-tree/node-kinds/array/arrayNode.js +6 -4
  1015. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  1016. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
  1017. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  1018. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  1019. package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
  1020. package/lib/simple-tree/node-kinds/common.js +2 -2
  1021. package/lib/simple-tree/node-kinds/common.js.map +1 -1
  1022. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  1023. package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
  1024. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  1025. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
  1026. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  1027. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  1028. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  1029. package/lib/simple-tree/node-kinds/object/objectNode.js +19 -19
  1030. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  1031. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
  1032. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  1033. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  1034. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  1035. package/lib/simple-tree/node-kinds/record/recordNode.js +4 -2
  1036. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  1037. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
  1038. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  1039. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  1040. package/lib/simple-tree/prepareForInsertion.d.ts +54 -47
  1041. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  1042. package/lib/simple-tree/prepareForInsertion.js +183 -124
  1043. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  1044. package/lib/simple-tree/simpleSchema.d.ts +55 -23
  1045. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  1046. package/lib/simple-tree/simpleSchema.js +16 -1
  1047. package/lib/simple-tree/simpleSchema.js.map +1 -1
  1048. package/lib/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
  1049. package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
  1050. package/lib/simple-tree/simpleSchemaFormatV1.js +8 -1
  1051. package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  1052. package/lib/simple-tree/toStoredSchema.d.ts +58 -11
  1053. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  1054. package/lib/simple-tree/toStoredSchema.js +204 -31
  1055. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  1056. package/lib/simple-tree/treeSchema.d.ts +23 -0
  1057. package/lib/simple-tree/treeSchema.d.ts.map +1 -0
  1058. package/lib/simple-tree/treeSchema.js +21 -0
  1059. package/lib/simple-tree/treeSchema.js.map +1 -0
  1060. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
  1061. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  1062. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +26 -9
  1063. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  1064. package/lib/tableSchema.d.ts +117 -63
  1065. package/lib/tableSchema.d.ts.map +1 -1
  1066. package/lib/tableSchema.js +160 -59
  1067. package/lib/tableSchema.js.map +1 -1
  1068. package/lib/treeFactory.d.ts.map +1 -1
  1069. package/lib/treeFactory.js +18 -4
  1070. package/lib/treeFactory.js.map +1 -1
  1071. package/lib/util/index.d.ts +2 -1
  1072. package/lib/util/index.d.ts.map +1 -1
  1073. package/lib/util/index.js +2 -1
  1074. package/lib/util/index.js.map +1 -1
  1075. package/lib/util/rangeMap.d.ts +24 -12
  1076. package/lib/util/rangeMap.d.ts.map +1 -1
  1077. package/lib/util/rangeMap.js +44 -5
  1078. package/lib/util/rangeMap.js.map +1 -1
  1079. package/lib/util/readSnapshotBlob.d.ts +13 -0
  1080. package/lib/util/readSnapshotBlob.d.ts.map +1 -0
  1081. package/lib/util/readSnapshotBlob.js +14 -0
  1082. package/lib/util/readSnapshotBlob.js.map +1 -0
  1083. package/package.json +21 -21
  1084. package/src/codec/codec.ts +15 -1
  1085. package/src/codec/versioned/codec.ts +1 -1
  1086. package/src/codec/versioned/format.ts +4 -1
  1087. package/src/core/change-family/changeFamily.ts +5 -0
  1088. package/src/core/change-family/index.ts +1 -0
  1089. package/src/core/index.ts +7 -2
  1090. package/src/core/rebase/changeRebaser.ts +6 -1
  1091. package/src/core/rebase/index.ts +1 -0
  1092. package/src/core/rebase/types.ts +8 -1
  1093. package/src/core/rebase/utils.ts +31 -7
  1094. package/src/core/tree/detachedFieldIndex.ts +71 -14
  1095. package/src/core/tree/index.ts +9 -3
  1096. package/src/core/tree/pathTree.ts +16 -4
  1097. package/src/feature-libraries/chunked-forest/basicChunk.ts +7 -1
  1098. package/src/feature-libraries/chunked-forest/chunkTree.ts +6 -1
  1099. package/src/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.ts +15 -7
  1100. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -9
  1101. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +398 -127
  1102. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +35 -38
  1103. package/src/feature-libraries/default-schema/index.ts +17 -5
  1104. package/src/feature-libraries/default-schema/locationBasedEditBuilder.ts +180 -0
  1105. package/src/feature-libraries/default-schema/mappedEditBuilder.ts +35 -9
  1106. package/src/feature-libraries/deltaUtils.ts +6 -1
  1107. package/src/feature-libraries/detachedFieldIndexSummarizer.ts +62 -15
  1108. package/src/feature-libraries/flex-tree/context.ts +17 -0
  1109. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +7 -8
  1110. package/src/feature-libraries/flex-tree/lazyField.ts +66 -24
  1111. package/src/feature-libraries/forest-summary/codec.ts +8 -8
  1112. package/src/feature-libraries/forest-summary/forestSummarizer.ts +45 -37
  1113. package/src/feature-libraries/forest-summary/format.ts +4 -4
  1114. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +23 -39
  1115. package/src/feature-libraries/forest-summary/index.ts +2 -1
  1116. package/src/feature-libraries/forest-summary/summaryTypes.ts +61 -0
  1117. package/src/feature-libraries/index.ts +23 -9
  1118. package/src/feature-libraries/mapTreeCursor.ts +2 -1
  1119. package/src/feature-libraries/mitigatedChangeFamily.ts +3 -1
  1120. package/src/feature-libraries/modular-schema/comparison.ts +63 -5
  1121. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +142 -44
  1122. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +36 -57
  1123. package/src/feature-libraries/modular-schema/fieldKind.ts +24 -40
  1124. package/src/feature-libraries/modular-schema/genericFieldKind.ts +10 -19
  1125. package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +1 -1
  1126. package/src/feature-libraries/modular-schema/index.ts +22 -15
  1127. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +732 -0
  1128. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +790 -0
  1129. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +29 -499
  1130. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +2547 -739
  1131. package/src/feature-libraries/modular-schema/{modularChangeFormat.ts → modularChangeFormatV1.ts} +2 -1
  1132. package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +62 -0
  1133. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +98 -10
  1134. package/src/feature-libraries/optional-field/index.ts +1 -3
  1135. package/src/feature-libraries/optional-field/optionalField.ts +317 -574
  1136. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV3.ts +45 -0
  1137. package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +24 -38
  1138. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +89 -35
  1139. package/src/feature-libraries/optional-field/optionalFieldCodecV3.ts +94 -0
  1140. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +5 -1
  1141. package/src/feature-libraries/schema-index/schemaSummarizer.ts +59 -18
  1142. package/src/feature-libraries/sequence-field/compose.ts +134 -519
  1143. package/src/feature-libraries/sequence-field/helperTypes.ts +34 -19
  1144. package/src/feature-libraries/sequence-field/index.ts +0 -9
  1145. package/src/feature-libraries/sequence-field/invert.ts +103 -228
  1146. package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
  1147. package/src/feature-libraries/sequence-field/moveEffectTable.ts +8 -191
  1148. package/src/feature-libraries/sequence-field/rebase.ts +168 -203
  1149. package/src/feature-libraries/sequence-field/replaceRevisions.ts +31 -52
  1150. package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +0 -2
  1151. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +643 -220
  1152. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +56 -68
  1153. package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +25 -27
  1154. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +19 -129
  1155. package/src/feature-libraries/sequence-field/types.ts +34 -64
  1156. package/src/feature-libraries/sequence-field/utils.ts +133 -346
  1157. package/src/index.ts +3 -2
  1158. package/src/packageVersion.ts +1 -1
  1159. package/src/shared-tree/independentView.ts +1 -1
  1160. package/src/shared-tree/index.ts +3 -2
  1161. package/src/shared-tree/schematizeTree.ts +21 -8
  1162. package/src/shared-tree/schematizingTreeView.ts +50 -68
  1163. package/src/shared-tree/sharedTree.ts +39 -12
  1164. package/src/shared-tree/sharedTreeChangeCodecs.ts +5 -1
  1165. package/src/shared-tree/sharedTreeChangeEnricher.ts +33 -11
  1166. package/src/shared-tree/sharedTreeChangeFamily.ts +15 -5
  1167. package/src/shared-tree/sharedTreeEditBuilder.ts +47 -13
  1168. package/src/shared-tree/treeAlpha.ts +2 -3
  1169. package/src/shared-tree/treeCheckout.ts +104 -31
  1170. package/src/shared-tree-core/branch.ts +8 -2
  1171. package/src/shared-tree-core/editManager.ts +16 -2
  1172. package/src/shared-tree-core/editManagerCodecs.ts +17 -5
  1173. package/src/shared-tree-core/{editManagerCodecsV5.ts → editManagerCodecsVSharedBranches.ts} +3 -3
  1174. package/src/shared-tree-core/editManagerFormatCommons.ts +22 -7
  1175. package/src/shared-tree-core/editManagerFormatV1toV4.ts +3 -1
  1176. package/src/shared-tree-core/{editManagerFormatV5.ts → editManagerFormatVSharedBranches.ts} +2 -2
  1177. package/src/shared-tree-core/editManagerSummarizer.ts +58 -16
  1178. package/src/shared-tree-core/index.ts +11 -3
  1179. package/src/shared-tree-core/messageCodecV1ToV4.ts +2 -1
  1180. package/src/shared-tree-core/{messageCodecV5.ts → messageCodecVSharedBranches.ts} +3 -3
  1181. package/src/shared-tree-core/messageCodecs.ts +17 -5
  1182. package/src/shared-tree-core/messageFormat.ts +22 -7
  1183. package/src/shared-tree-core/messageFormatV1ToV4.ts +16 -2
  1184. package/src/shared-tree-core/{messageFormatV5.ts → messageFormatVSharedBranches.ts} +4 -6
  1185. package/src/shared-tree-core/sharedTreeCore.ts +67 -76
  1186. package/src/shared-tree-core/summaryTypes.ts +122 -0
  1187. package/src/shared-tree-core/versionedSummarizer.ts +107 -0
  1188. package/src/simple-tree/api/configuration.ts +21 -68
  1189. package/src/simple-tree/api/dirtyIndex.ts +11 -0
  1190. package/src/simple-tree/api/discrepancies.ts +1 -1
  1191. package/src/simple-tree/api/getSimpleSchema.ts +13 -6
  1192. package/src/simple-tree/api/incrementalAllowedTypes.ts +15 -3
  1193. package/src/simple-tree/api/index.ts +3 -4
  1194. package/src/simple-tree/api/schemaCompatibilityTester.ts +1 -1
  1195. package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -2
  1196. package/src/simple-tree/api/schemaFactoryRecursive.ts +0 -2
  1197. package/src/simple-tree/api/schemaFromSimple.ts +11 -5
  1198. package/src/simple-tree/api/simpleSchemaCodec.ts +17 -3
  1199. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -1
  1200. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +18 -10
  1201. package/src/simple-tree/api/typesUnsafe.ts +7 -3
  1202. package/src/simple-tree/core/allowedTypes.ts +3 -3
  1203. package/src/simple-tree/core/index.ts +2 -2
  1204. package/src/simple-tree/core/toStored.ts +22 -55
  1205. package/src/simple-tree/core/unhydratedFlexTree.ts +87 -36
  1206. package/src/simple-tree/core/walkSchema.ts +6 -0
  1207. package/src/simple-tree/createContext.ts +26 -11
  1208. package/src/simple-tree/fieldSchema.ts +16 -7
  1209. package/src/simple-tree/index.ts +12 -11
  1210. package/src/simple-tree/node-kinds/array/arrayNode.ts +12 -7
  1211. package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +3 -3
  1212. package/src/simple-tree/node-kinds/common.ts +2 -5
  1213. package/src/simple-tree/node-kinds/map/mapNode.ts +9 -6
  1214. package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +3 -3
  1215. package/src/simple-tree/node-kinds/object/objectNode.ts +26 -26
  1216. package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +6 -2
  1217. package/src/simple-tree/node-kinds/record/recordNode.ts +15 -11
  1218. package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +3 -3
  1219. package/src/simple-tree/prepareForInsertion.ts +343 -200
  1220. package/src/simple-tree/simpleSchema.ts +79 -32
  1221. package/src/simple-tree/simpleSchemaFormatV1.ts +9 -1
  1222. package/src/simple-tree/toStoredSchema.ts +319 -61
  1223. package/src/simple-tree/treeSchema.ts +54 -0
  1224. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +42 -14
  1225. package/src/tableSchema.ts +485 -166
  1226. package/src/treeFactory.ts +19 -5
  1227. package/src/util/index.ts +5 -0
  1228. package/src/util/rangeMap.ts +72 -18
  1229. package/src/util/readSnapshotBlob.ts +23 -0
  1230. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
  1231. package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
  1232. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
  1233. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
  1234. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -50
  1235. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
  1236. package/dist/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
  1237. package/dist/shared-tree-core/editManagerCodecsV5.js.map +0 -1
  1238. package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
  1239. package/dist/shared-tree-core/editManagerFormatV5.js.map +0 -1
  1240. package/dist/shared-tree-core/messageCodecV5.d.ts.map +0 -1
  1241. package/dist/shared-tree-core/messageCodecV5.js.map +0 -1
  1242. package/dist/shared-tree-core/messageFormatV5.d.ts.map +0 -1
  1243. package/dist/shared-tree-core/messageFormatV5.js.map +0 -1
  1244. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
  1245. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
  1246. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +0 -177
  1247. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
  1248. package/docs/main/sequence-field/move-composition.md +0 -46
  1249. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
  1250. package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
  1251. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
  1252. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
  1253. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -46
  1254. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
  1255. package/lib/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
  1256. package/lib/shared-tree-core/editManagerCodecsV5.js.map +0 -1
  1257. package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
  1258. package/lib/shared-tree-core/editManagerFormatV5.js.map +0 -1
  1259. package/lib/shared-tree-core/messageCodecV5.d.ts.map +0 -1
  1260. package/lib/shared-tree-core/messageCodecV5.js.map +0 -1
  1261. package/lib/shared-tree-core/messageFormatV5.d.ts.map +0 -1
  1262. package/lib/shared-tree-core/messageFormatV5.js.map +0 -1
  1263. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
  1264. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
  1265. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +0 -171
  1266. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
  1267. package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +0 -57
  1268. package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +0 -209
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,SAAS,EACT,KAAK,UAAU,EACf,KAAK,UAAU,EACf,UAAU,EACV,KAAK,YAAY,EACjB,KAAK,mBAAmB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,KAAK,WAAW,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACd,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,EAClB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,QAAQ,GACR,MAAM,aAAa,CAAC;AACrB,YAAY,EACX,UAAU,EACV,IAAI,IAAI,SAAS,EACjB,IAAI,IAAI,SAAS,EACjB,cAAc,IAAI,mBAAmB,EACrC,QAAQ,IAAI,aAAa,EACzB,mBAAmB,IAAI,wBAAwB,EAC/C,iBAAiB,IAAI,sBAAsB,EAC3C,uBAAuB,IAAI,4BAA4B,EACvD,kBAAkB,IAAI,uBAAuB,EAC7C,YAAY,IAAI,iBAAiB,GACjC,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,gBAAgB,EAAE,eAAe,EAAE,MAAM,cA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AC/B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,uCAAuC,EAAE,MAAM,+BAA+B,CAAC;AACxF,OAAO,EAAE,+BAA+B,EAAE,MAAM,qCAAqC,CAAC;AACtF,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC"}
@@ -5,7 +5,7 @@
5
5
  export { AnchorSet, anchorSlot, } from "./anchorSet.js";
6
6
  export { CursorLocationType, castCursorToSynchronous, mapCursorField, mapCursorFields, forEachNode, forEachNodeInSubtree, forEachField, iterateCursorField, inCursorField, inCursorNode, CursorMarker, isCursor, } from "./cursor.js";
7
7
  export { deepCopyMapTree } from "./mapTree.js";
8
- export { clonePath, topDownPath, getDepth, compareUpPaths, compareFieldUpPaths, isDetachedUpPathRoot as isDetachedUpPath, getDetachedFieldContainingPath, } from "./pathTree.js";
8
+ export { clonePath, topDownPath, getDepth, compareUpPaths, compareFieldUpPaths, isDetachedUpPathRoot, getDetachedFieldContainingPath, getDetachedFieldContainingFieldPath, } from "./pathTree.js";
9
9
  export { genericTreeDeleteIfEmpty, genericTreeKeys, getGenericTreeField, setGenericTreeField, } from "./treeTextFormat.js";
10
10
  export { EncodedJsonableTree } from "./persistedTreeTextFormat.js";
11
11
  export { EmptyKey, detachedFieldAsKey, keyAsDetachedField, rootFieldKey, rootField, aboveRootPlaceholder, } from "./types.js";
@@ -14,6 +14,7 @@ export { announceDelta, applyDelta, createAnnouncedVisitor, combineVisitors, mak
14
14
  export { SparseNode, getDescendant } from "./sparseTree.js";
15
15
  export { deltaForRootInitialization, makeDetachedNodeId, offsetDetachId, emptyDelta, } from "./deltaUtil.js";
16
16
  export { dummyRoot, cursorChunk, tryGetChunk, } from "./chunk.js";
17
- export { DetachedFieldIndex } from "./detachedFieldIndex.js";
17
+ export { DetachedFieldIndex, } from "./detachedFieldIndex.js";
18
18
  export { getCodecTreeForDetachedFieldIndexFormat } from "./detachedFieldIndexCodecs.js";
19
+ export { DetachedFieldIndexFormatVersion } from "./detachedFieldIndexFormatCommon.js";
19
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGN,SAAS,EAGT,UAAU,GAGV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEN,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACd,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,EAGlB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,QAAQ,GACR,MAAM,aAAa,CAAC;AAarB,OAAO,EAAuC,eAAe,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EACN,SAAS,EACT,WAAW,EACX,QAAQ,EAWR,cAAc,EACd,mBAAmB,EACnB,oBAAoB,IAAI,gBAAgB,EACxC,8BAA8B,GAE9B,MAAM,eAAe,CAAC;AACvB,OAAO,EAGN,wBAAwB,EACxB,eAAe,EAEf,mBAAmB,EAEnB,mBAAmB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACN,QAAQ,EAQR,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EAEZ,SAAS,EACT,oBAAoB,GACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAqB,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAEN,aAAa,EACb,UAAU,EACV,sBAAsB,EACtB,eAAe,EACf,sBAAsB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EACN,0BAA0B,EAC1B,kBAAkB,EAClB,cAAc,EACd,UAAU,GACV,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAEN,SAAS,EACT,WAAW,EACX,WAAW,GAEX,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,uCAAuC,EAAE,MAAM,+BAA+B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype Anchor,\n\ttype AnchorLocator,\n\tAnchorSet,\n\ttype AnchorSlot,\n\ttype AnchorNode,\n\tanchorSlot,\n\ttype AnchorEvents,\n\ttype AnchorSetRootEvents,\n} from \"./anchorSet.js\";\nexport {\n\ttype ITreeCursor,\n\tCursorLocationType,\n\tcastCursorToSynchronous,\n\tmapCursorField,\n\tmapCursorFields,\n\tforEachNode,\n\tforEachNodeInSubtree,\n\tforEachField,\n\titerateCursorField,\n\ttype ITreeCursorSynchronous,\n\ttype PathRootPrefix,\n\tinCursorField,\n\tinCursorNode,\n\tCursorMarker,\n\tisCursor,\n} from \"./cursor.js\";\nexport type {\n\tProtoNodes,\n\tRoot as DeltaRoot,\n\tMark as DeltaMark,\n\tDetachedNodeId as DeltaDetachedNodeId,\n\tFieldMap as DeltaFieldMap,\n\tDetachedNodeChanges as DeltaDetachedNodeChanges,\n\tDetachedNodeBuild as DeltaDetachedNodeBuild,\n\tDetachedNodeDestruction as DeltaDetachedNodeDestruction,\n\tDetachedNodeRename as DeltaDetachedNodeRename,\n\tFieldChanges as DeltaFieldChanges,\n} from \"./delta.js\";\nexport { type MapTree, type ExclusiveMapTree, deepCopyMapTree } from \"./mapTree.js\";\nexport {\n\tclonePath,\n\ttopDownPath,\n\tgetDepth,\n\ttype UpPath,\n\ttype NormalizedUpPath,\n\ttype INormalizedUpPath,\n\ttype NormalizedFieldUpPath,\n\ttype FieldUpPath,\n\ttype Range,\n\ttype RangeUpPath,\n\ttype PlaceUpPath,\n\ttype PlaceIndex,\n\ttype NodeIndex,\n\tcompareUpPaths,\n\tcompareFieldUpPaths,\n\tisDetachedUpPathRoot as isDetachedUpPath,\n\tgetDetachedFieldContainingPath,\n\ttype UpPathDefault,\n} from \"./pathTree.js\";\nexport {\n\ttype FieldMapObject,\n\ttype GenericFieldsNode,\n\tgenericTreeDeleteIfEmpty,\n\tgenericTreeKeys,\n\ttype GenericTreeNode,\n\tgetGenericTreeField,\n\ttype JsonableTree,\n\tsetGenericTreeField,\n} from \"./treeTextFormat.js\";\nexport { EncodedJsonableTree } from \"./persistedTreeTextFormat.js\";\nexport {\n\tEmptyKey,\n\ttype TreeType,\n\ttype ChildLocation,\n\ttype DetachedField,\n\ttype ChildCollection,\n\ttype RootField,\n\ttype Value,\n\ttype TreeValue,\n\tdetachedFieldAsKey,\n\tkeyAsDetachedField,\n\trootFieldKey,\n\ttype NodeData,\n\trootField,\n\taboveRootPlaceholder,\n} from \"./types.js\";\nexport { type DeltaVisitor, visitDelta } from \"./visitDelta.js\";\nexport {\n\ttype AnnouncedVisitor,\n\tannounceDelta,\n\tapplyDelta,\n\tcreateAnnouncedVisitor,\n\tcombineVisitors,\n\tmakeDetachedFieldIndex,\n} from \"./visitorUtils.js\";\n\nexport { SparseNode, getDescendant } from \"./sparseTree.js\";\n\nexport {\n\tdeltaForRootInitialization,\n\tmakeDetachedNodeId,\n\toffsetDetachId,\n\temptyDelta,\n} from \"./deltaUtil.js\";\n\nexport {\n\ttype TreeChunk,\n\tdummyRoot,\n\tcursorChunk,\n\ttryGetChunk,\n\ttype ChunkedCursor,\n} from \"./chunk.js\";\n\nexport { DetachedFieldIndex } from \"./detachedFieldIndex.js\";\n\nexport { getCodecTreeForDetachedFieldIndexFormat } from \"./detachedFieldIndexCodecs.js\";\nexport { type DetachedFieldIndexFormatVersion } from \"./detachedFieldIndexFormatCommon.js\";\n\nexport { type ForestRootId } from \"./detachedFieldIndexTypes.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,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esContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype Anchor,\n\ttype AnchorLocator,\n\tAnchorSet,\n\ttype AnchorSlot,\n\ttype AnchorNode,\n\tanchorSlot,\n\ttype AnchorEvents,\n\ttype AnchorSetRootEvents,\n} from \"./anchorSet.js\";\nexport {\n\ttype ITreeCursor,\n\tCursorLocationType,\n\tcastCursorToSynchronous,\n\tmapCursorField,\n\tmapCursorFields,\n\tforEachNode,\n\tforEachNodeInSubtree,\n\tforEachField,\n\titerateCursorField,\n\ttype ITreeCursorSynchronous,\n\ttype PathRootPrefix,\n\tinCursorField,\n\tinCursorNode,\n\tCursorMarker,\n\tisCursor,\n} from \"./cursor.js\";\nexport type {\n\tProtoNodes,\n\tRoot as DeltaRoot,\n\tMark as DeltaMark,\n\tDetachedNodeId as DeltaDetachedNodeId,\n\tFieldMap as DeltaFieldMap,\n\tDetachedNodeChanges as DeltaDetachedNodeChanges,\n\tDetachedNodeBuild as DeltaDetachedNodeBuild,\n\tDetachedNodeDestruction as DeltaDetachedNodeDestruction,\n\tDetachedNodeRename as DeltaDetachedNodeRename,\n\tFieldChanges as DeltaFieldChanges,\n} from \"./delta.js\";\nexport { type MapTree, type ExclusiveMapTree, deepCopyMapTree } from \"./mapTree.js\";\nexport {\n\tclonePath,\n\ttopDownPath,\n\tgetDepth,\n\ttype UpPath,\n\ttype NormalizedUpPath,\n\ttype INormalizedUpPath,\n\ttype NormalizedFieldUpPath,\n\ttype FieldUpPath,\n\ttype Range,\n\ttype RangeUpPath,\n\ttype PlaceUpPath,\n\ttype PlaceIndex,\n\ttype NodeIndex,\n\tcompareUpPaths,\n\tcompareFieldUpPaths,\n\tisDetachedUpPathRoot,\n\tgetDetachedFieldContainingPath,\n\tgetDetachedFieldContainingFieldPath,\n\ttype UpPathDefault,\n} from \"./pathTree.js\";\nexport {\n\ttype FieldMapObject,\n\ttype GenericFieldsNode,\n\tgenericTreeDeleteIfEmpty,\n\tgenericTreeKeys,\n\ttype GenericTreeNode,\n\tgetGenericTreeField,\n\ttype JsonableTree,\n\tsetGenericTreeField,\n} from \"./treeTextFormat.js\";\nexport { EncodedJsonableTree } from \"./persistedTreeTextFormat.js\";\nexport {\n\tEmptyKey,\n\ttype TreeType,\n\ttype ChildLocation,\n\ttype DetachedField,\n\ttype ChildCollection,\n\ttype RootField,\n\ttype Value,\n\ttype TreeValue,\n\tdetachedFieldAsKey,\n\tkeyAsDetachedField,\n\trootFieldKey,\n\ttype NodeData,\n\trootField,\n\taboveRootPlaceholder,\n} from \"./types.js\";\nexport { type DeltaVisitor, visitDelta } from \"./visitDelta.js\";\nexport {\n\ttype AnnouncedVisitor,\n\tannounceDelta,\n\tapplyDelta,\n\tcreateAnnouncedVisitor,\n\tcombineVisitors,\n\tmakeDetachedFieldIndex,\n} from \"./visitorUtils.js\";\n\nexport { SparseNode, getDescendant } from \"./sparseTree.js\";\n\nexport {\n\tdeltaForRootInitialization,\n\tmakeDetachedNodeId,\n\toffsetDetachId,\n\temptyDelta,\n} from \"./deltaUtil.js\";\n\nexport {\n\ttype TreeChunk,\n\tdummyRoot,\n\tcursorChunk,\n\ttryGetChunk,\n\ttype ChunkedCursor,\n} from \"./chunk.js\";\n\nexport {\n\tDetachedFieldIndex,\n\ttype DetachedFieldIndexCheckpoint,\n\ttype ReadOnlyDetachedFieldIndex,\n} from \"./detachedFieldIndex.js\";\n\nexport { getCodecTreeForDetachedFieldIndexFormat } from \"./detachedFieldIndexCodecs.js\";\nexport { DetachedFieldIndexFormatVersion } from \"./detachedFieldIndexFormatCommon.js\";\nexport { type FormatV1 } from \"./detachedFieldIndexFormatV1.js\";\n\nexport { type ForestRootId } from \"./detachedFieldIndexTypes.js\";\n"]}
@@ -104,7 +104,9 @@ export interface FieldUpPath<TUpPath = UpPath> {
104
104
  /**
105
105
  * Given an {@link UpPath}, checks if it is a path to a detached root.
106
106
  */
107
- export declare function isDetachedUpPathRoot<T>(path: UpPath<T> | NormalizedUpPath): path is NormalizedUpPathRoot;
107
+ export declare function isDetachedUpPathRoot<T>(path: UpPath<T> | NormalizedUpPath): path is NormalizedUpPathRoot & {
108
+ readonly detachedNodeId: DetachedNodeId;
109
+ };
108
110
  /**
109
111
  * Delimits the extend of a range.
110
112
  */
@@ -166,7 +168,7 @@ export declare function clonePath(path: UpPath | undefined): UpPath | undefined;
166
168
  * Gets the elements of the given `path`, ordered from root-most to child-most.
167
169
  * @remarks These elements are unchanged and therefore still point "up".
168
170
  */
169
- export declare function topDownPath(path: UpPath | undefined): UpPath[];
171
+ export declare function topDownPath<T extends UpPath<T>>(path: T | undefined): T[];
170
172
  /**
171
173
  * Returns true if and only if `a` and `b` describe the same path.
172
174
  * @remarks
@@ -180,9 +182,15 @@ export declare function compareUpPaths(a: UpPath | undefined, b: UpPath | undefi
180
182
  */
181
183
  export declare function compareFieldUpPaths(a: FieldUpPath, b: FieldUpPath): boolean;
182
184
  /**
183
- * Checks whether or not a given path is parented under the root field.
185
+ * Returns the field key for the root field.
184
186
  * @param path - the path you want to check.
185
187
  * @returns the {@link DetachedField} which contains the path.
186
188
  */
187
189
  export declare function getDetachedFieldContainingPath(path: UpPath): DetachedField;
190
+ /**
191
+ * Returns the field key for the root field.
192
+ * @param path - the path you want to check.
193
+ * @returns the {@link DetachedField} which contains the path.
194
+ */
195
+ export declare function getDetachedFieldContainingFieldPath(path: FieldUpPath): DetachedField;
188
196
  //# sourceMappingURL=pathTree.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pathTree.d.ts","sourceRoot":"","sources":["../../../src/core/tree/pathTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,KAAK,aAAa,EAAsB,MAAM,YAAY,CAAC;AAEpE;;;GAGG;AACH,MAAM,MAAM,aA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AAK,EAAE,UAAU,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQ7C;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;AAEhD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAaxE;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,SAAS,GAAG,CAAC,EAAE,CASzE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAYpF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAK3E;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAU1E;AAED;;;;GAIG;AACH,wBAAgB,mCAAmC,CAAC,IAAI,EAAE,WAAW,GAAG,aAAa,CAKpF"}
@@ -78,7 +78,7 @@ export function compareFieldUpPaths(a, b) {
78
78
  return compareUpPaths(a.parent, b.parent);
79
79
  }
80
80
  /**
81
- * Checks whether or not a given path is parented under the root field.
81
+ * Returns the field key for the root field.
82
82
  * @param path - the path you want to check.
83
83
  * @returns the {@link DetachedField} which contains the path.
84
84
  */
@@ -94,4 +94,15 @@ export function getDetachedFieldContainingPath(path) {
94
94
  }
95
95
  return keyAsDetachedField(path.parentField);
96
96
  }
97
+ /**
98
+ * Returns the field key for the root field.
99
+ * @param path - the path you want to check.
100
+ * @returns the {@link DetachedField} which contains the path.
101
+ */
102
+ export function getDetachedFieldContainingFieldPath(path) {
103
+ if (path.parent === undefined) {
104
+ return keyAsDetachedField(path.field);
105
+ }
106
+ return getDetachedFieldContainingPath(path.parent);
107
+ }
97
108
  //# sourceMappingURL=pathTree.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pathTree.js","sourceRoot":"","sources":["../../../src/core/tree/pathTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAsB,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAmHpE;;GAEG;AACH,MAAM,UAAU,oBAAoB,CACnC,IAAkC;IAElC,OAAQ,IAA6B,CAAC,cAAc,KAAK,SAAS,CAAC;AACpE,CAAC;AAgDD;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY;IACpC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;IACvB,OAAO,IAAI,KAAK,SAAS,EAAE,CAAC;QAC3B,KAAK,IAAI,CAAC,CAAC;QACX,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAcD,MAAM,UAAU,SAAS,CAAC,IAAwB;IACjD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,OAAO;QACN,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;QAC9B,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;KAC7B,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,IAAwB;IACnD,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,IAAI,IAAI,GAAG,IAAI,CAAC;IAChB,OAAO,IAAI,KAAK,SAAS,EAAE,CAAC;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C,CAAC;IACF,CAAC;IACD,OAAO,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { FieldKey } from \"../schema-stored/index.js\";\n\nimport type { DetachedNodeId } from \"./delta.js\";\nimport { type DetachedField, keyAsDetachedField } from \"./types.js\";\n\n/**\n * Identical to {@link UpPath}, but a duplicate declaration is needed to make\n * the default type parameter compile.\n */\nexport type UpPathDefault = UpPath;\n\n/**\n * Path from a location in the tree upward.\n * UpPaths can be used with deduplicated upper parts to allow\n * working with paths localized to part of the tree without incurring\n * costs related to the depth of the local subtree.\n *\n * UpPaths can be thought of as terminating at a special root node (that is `undefined`)\n * whose FieldKeys correspond to detached sequences.\n *\n * UpPaths can be mutated over time and should be considered to be invalidated when any edits occurs:\n * Use of an UpPath that was acquired before the most recent edit is undefined behavior.\n */\nexport interface UpPath<TParent = UpPathDefault> {\n\t/**\n\t * The parent, or undefined in the case where this path is a member of a detached sequence.\n\t */\n\treadonly parent: TParent | undefined;\n\t/**\n\t * The Field under which this path points.\n\t * Note that if `parent` returns `undefined`, this key corresponds to a detached sequence.\n\t */\n\treadonly parentField: FieldKey; // TODO: Type information, including when in DetachedField.\n\t/**\n\t * The index within `parentField` this path is pointing to.\n\t */\n\treadonly parentIndex: NodeIndex;\n}\n\n/**\n * Identical to {@link INormalizedUpPath}, but a duplicate declaration is needed to make the default type parameter compile.\n */\nexport type INormalizedUpPathDefault = INormalizedUpPath;\n\n/**\n * Identical to {@link UpPath}, but a with a {@link DetachedNodeId} to specify the ID of detached roots.\n * Note that document roots (i.e., any node in the root field) are not considered detached roots and therefore do not have an associated ID.\n *\n * Use this interface for implementing a class that needs to be used as a {@link NormalizedUpPath}.\n */\nexport interface INormalizedUpPath<TParent = INormalizedUpPathDefault>\n\textends UpPath<TParent> {\n\treadonly detachedNodeId: DetachedNodeId | undefined;\n}\n\n/**\n * Identical to {@link UpPath}, but a with a {@link DetachedNodeId} to specify the ID of detached roots.\n * Note that document roots (i.e., any node in the root field) are not considered detached roots and therefore do not have an associated ID.\n *\n * Prefer this type over {@link INormalizedUpPath} except when implementing a class that needs to be used as a {@link NormalizedUpPath}.\n */\nexport type NormalizedUpPath =\n\t| INormalizedUpPath<NormalizedUpPath>\n\t| NormalizedUpPathInterior<NormalizedUpPath>\n\t| NormalizedUpPathRoot;\n\n/**\n * The root element of a {@link NormalizedUpPath}.\n */\nexport interface NormalizedUpPathRoot extends UpPath<undefined> {\n\t/**\n\t * The ID associated with this node if it is a detached root.\n\t */\n\treadonly detachedNodeId: DetachedNodeId | undefined;\n}\n\n/**\n * Identical to {@link NormalizedUpPathInterior}, but a duplicate declaration is needed to make the default type parameter compile.\n */\nexport type NormalizedUpPathInteriorDefault = NormalizedUpPathInterior;\n\n/**\n * An interior (i.e., non-root) element of a {@link NormalizedUpPath}.\n */\nexport interface NormalizedUpPathInterior<\n\tTParent = NormalizedUpPathInteriorDefault | NormalizedUpPathRoot,\n> extends UpPath<TParent> {\n\t/**\n\t * The parent.\n\t */\n\treadonly parent: TParent;\n}\n\n/**\n * Path from a field in the tree upward.\n *\n * See {@link UpPath}.\n */\nexport type NormalizedFieldUpPath<TParent = NormalizedUpPath> = FieldUpPath<TParent>;\n\n/**\n * Path from a field in the tree upward.\n *\n * See {@link FieldUpPath} and {@link NormalizedUpPath}.\n */\nexport interface FieldUpPath<TUpPath = UpPath> {\n\t/**\n\t * The parent, or undefined in the case where this path is to a detached sequence.\n\t */\n\treadonly parent: TUpPath | undefined;\n\n\t/**\n\t * The Field to which this path points.\n\t * Note that if `parent` returns `undefined`, this key corresponds to a detached sequence.\n\t */\n\treadonly field: FieldKey; // TODO: Type information, including when in DetachedField.\n}\n\n/**\n * Given an {@link UpPath}, checks if it is a path to a detached root.\n */\nexport function isDetachedUpPathRoot<T>(\n\tpath: UpPath<T> | NormalizedUpPath,\n): path is NormalizedUpPathRoot {\n\treturn (path as NormalizedUpPathRoot).detachedNodeId !== undefined;\n}\n\n/**\n * Delimits the extend of a range.\n */\nexport interface Range {\n\t/**\n\t * The location before the first node.\n\t * Must be less than or equal to `end`.\n\t */\n\treadonly start: PlaceIndex;\n\t/**\n\t * The location after the last node.\n\t * Must be greater than or equal to `start`.\n\t */\n\treadonly end: PlaceIndex;\n}\n\n/**\n * A possibly empty range of nodes in a field.\n * This object only characterizes the location of the range, it does not own/contain the nodes in the range.\n */\nexport interface RangeUpPath<TUpPath extends UpPath = UpPath>\n\textends FieldUpPath<TUpPath>,\n\t\tRange {}\n\n/**\n * A place in a field.\n */\nexport interface PlaceUpPath<TUpPath extends UpPath = UpPath> extends FieldUpPath<TUpPath> {\n\t/**\n\t * The location in the field.\n\t */\n\treadonly index: PlaceIndex;\n}\n\n/**\n * Indicates the index of a node in a field.\n * Zero indicates the first node in a field.\n */\nexport type NodeIndex = number;\n\n/**\n * Indicates a place between nodes in a field or at the extremity of a field.\n * Zero indicates the place at the start of the field (before the first node if any).\n */\nexport type PlaceIndex = number;\n\n/**\n * Gets the number of nodes above this one.\n * @remarks\n * Zero when the path's parent is undefined, meaning the path represents a node in a detached field.\n * Runs in O(depth) time.\n */\nexport function getDepth(path: UpPath): number {\n\tlet depth = 0;\n\tlet next = path.parent;\n\twhile (next !== undefined) {\n\t\tdepth += 1;\n\t\tnext = next.parent;\n\t}\n\treturn depth;\n}\n\n/**\n * Creates deep copy of the provided path as simple JavaScript object.\n * @remarks This is safe to hold onto and use deep object comparisons on.\n */\nexport function clonePath(path: UpPath): UpPath;\n\n/**\n * Creates a deep copy of the provided path as simple JavaScript object.\n * @remarks This is safe to hold onto and use deep object comparisons on.\n */\nexport function clonePath(path: UpPath | undefined): UpPath | undefined;\n\nexport function clonePath(path: UpPath | undefined): UpPath | undefined {\n\tif (path === undefined) {\n\t\treturn undefined;\n\t}\n\treturn {\n\t\tparent: clonePath(path.parent),\n\t\tparentField: path.parentField,\n\t\tparentIndex: path.parentIndex,\n\t};\n}\n\n/**\n * Gets the elements of the given `path`, ordered from root-most to child-most.\n * @remarks These elements are unchanged and therefore still point \"up\".\n */\nexport function topDownPath(path: UpPath | undefined): UpPath[] {\n\tconst out: UpPath[] = [];\n\tlet curr = path;\n\twhile (curr !== undefined) {\n\t\tout.push(curr);\n\t\tcurr = curr.parent;\n\t}\n\tout.reverse();\n\treturn out;\n}\n\n/**\n * Returns true if and only if `a` and `b` describe the same path.\n * @remarks\n * Note that for mutable paths (as used in `AnchorSet`), this equality may change over time: this only checks if the two paths are currently the same.\n */\nexport function compareUpPaths(a: UpPath | undefined, b: UpPath | undefined): boolean {\n\tif (a === b) {\n\t\t// This handles the both `undefined` case, as well as provides an early out if a shared node is encountered.\n\t\treturn true;\n\t}\n\tif (a === undefined || b === undefined) {\n\t\treturn false;\n\t}\n\tif (a.parentField !== b.parentField || a.parentIndex !== b.parentIndex) {\n\t\treturn false;\n\t}\n\treturn compareUpPaths(a.parent, b.parent);\n}\n\n/**\n * Returns true if and only if `a` and `b` describe the same field path.\n * @remarks\n * Note that for mutable paths (as used in `AnchorSet`), this equality may change over time: this only checks if the two paths are currently the same.\n */\nexport function compareFieldUpPaths(a: FieldUpPath, b: FieldUpPath): boolean {\n\tif (a.field !== b.field) {\n\t\treturn false;\n\t}\n\treturn compareUpPaths(a.parent, b.parent);\n}\n\n/**\n * Checks whether or not a given path is parented under the root field.\n * @param path - the path you want to check.\n * @returns the {@link DetachedField} which contains the path.\n */\nexport function getDetachedFieldContainingPath(path: UpPath): DetachedField {\n\tlet currentPath = path;\n\twhile (currentPath !== undefined) {\n\t\tif (currentPath.parent === undefined) {\n\t\t\treturn keyAsDetachedField(currentPath.parentField);\n\t\t} else {\n\t\t\tcurrentPath = currentPath.parent;\n\t\t}\n\t}\n\treturn keyAsDetachedField(path.parentField);\n}\n"]}
1
+ {"version":3,"file":"pathTree.js","sourceRoot":"","sources":["../../../src/core/tree/pathTree.ts"],"names":[],"mappings":"AAAA;;;GAGG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ACpD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { FieldKey } from \"../schema-stored/index.js\";\n\nimport type { DetachedNodeId } from \"./delta.js\";\nimport { type DetachedField, keyAsDetachedField } from \"./types.js\";\n\n/**\n * Identical to {@link UpPath}, but a duplicate declaration is needed to make\n * the default type parameter compile.\n */\nexport type UpPathDefault = UpPath;\n\n/**\n * Path from a location in the tree upward.\n * UpPaths can be used with deduplicated upper parts to allow\n * working with paths localized to part of the tree without incurring\n * costs related to the depth of the local subtree.\n *\n * UpPaths can be thought of as terminating at a special root node (that is `undefined`)\n * whose FieldKeys correspond to detached sequences.\n *\n * UpPaths can be mutated over time and should be considered to be invalidated when any edits occurs:\n * Use of an UpPath that was acquired before the most recent edit is undefined behavior.\n */\nexport interface UpPath<TParent = UpPathDefault> {\n\t/**\n\t * The parent, or undefined in the case where this path is a member of a detached sequence.\n\t */\n\treadonly parent: TParent | undefined;\n\t/**\n\t * The Field under which this path points.\n\t * Note that if `parent` returns `undefined`, this key corresponds to a detached sequence.\n\t */\n\treadonly parentField: FieldKey; // TODO: Type information, including when in DetachedField.\n\t/**\n\t * The index within `parentField` this path is pointing to.\n\t */\n\treadonly parentIndex: NodeIndex;\n}\n\n/**\n * Identical to {@link INormalizedUpPath}, but a duplicate declaration is needed to make the default type parameter compile.\n */\nexport type INormalizedUpPathDefault = INormalizedUpPath;\n\n/**\n * Identical to {@link UpPath}, but a with a {@link DetachedNodeId} to specify the ID of detached roots.\n * Note that document roots (i.e., any node in the root field) are not considered detached roots and therefore do not have an associated ID.\n *\n * Use this interface for implementing a class that needs to be used as a {@link NormalizedUpPath}.\n */\nexport interface INormalizedUpPath<TParent = INormalizedUpPathDefault>\n\textends UpPath<TParent> {\n\treadonly detachedNodeId: DetachedNodeId | undefined;\n}\n\n/**\n * Identical to {@link UpPath}, but a with a {@link DetachedNodeId} to specify the ID of detached roots.\n * Note that document roots (i.e., any node in the root field) are not considered detached roots and therefore do not have an associated ID.\n *\n * Prefer this type over {@link INormalizedUpPath} except when implementing a class that needs to be used as a {@link NormalizedUpPath}.\n */\nexport type NormalizedUpPath =\n\t| INormalizedUpPath<NormalizedUpPath>\n\t| NormalizedUpPathInterior<NormalizedUpPath>\n\t| NormalizedUpPathRoot;\n\n/**\n * The root element of a {@link NormalizedUpPath}.\n */\nexport interface NormalizedUpPathRoot extends UpPath<undefined> {\n\t/**\n\t * The ID associated with this node if it is a detached root.\n\t */\n\treadonly detachedNodeId: DetachedNodeId | undefined;\n}\n\n/**\n * Identical to {@link NormalizedUpPathInterior}, but a duplicate declaration is needed to make the default type parameter compile.\n */\nexport type NormalizedUpPathInteriorDefault = NormalizedUpPathInterior;\n\n/**\n * An interior (i.e., non-root) element of a {@link NormalizedUpPath}.\n */\nexport interface NormalizedUpPathInterior<\n\tTParent = NormalizedUpPathInteriorDefault | NormalizedUpPathRoot,\n> extends UpPath<TParent> {\n\t/**\n\t * The parent.\n\t */\n\treadonly parent: TParent;\n}\n\n/**\n * Path from a field in the tree upward.\n *\n * See {@link UpPath}.\n */\nexport type NormalizedFieldUpPath<TParent = NormalizedUpPath> = FieldUpPath<TParent>;\n\n/**\n * Path from a field in the tree upward.\n *\n * See {@link FieldUpPath} and {@link NormalizedUpPath}.\n */\nexport interface FieldUpPath<TUpPath = UpPath> {\n\t/**\n\t * The parent, or undefined in the case where this path is to a detached sequence.\n\t */\n\treadonly parent: TUpPath | undefined;\n\n\t/**\n\t * The Field to which this path points.\n\t * Note that if `parent` returns `undefined`, this key corresponds to a detached sequence.\n\t */\n\treadonly field: FieldKey; // TODO: Type information, including when in DetachedField.\n}\n\n/**\n * Given an {@link UpPath}, checks if it is a path to a detached root.\n */\nexport function isDetachedUpPathRoot<T>(\n\tpath: UpPath<T> | NormalizedUpPath,\n): path is NormalizedUpPathRoot & { readonly detachedNodeId: DetachedNodeId } {\n\treturn (path as NormalizedUpPathRoot).detachedNodeId !== undefined;\n}\n\n/**\n * Delimits the extend of a range.\n */\nexport interface Range {\n\t/**\n\t * The location before the first node.\n\t * Must be less than or equal to `end`.\n\t */\n\treadonly start: PlaceIndex;\n\t/**\n\t * The location after the last node.\n\t * Must be greater than or equal to `start`.\n\t */\n\treadonly end: PlaceIndex;\n}\n\n/**\n * A possibly empty range of nodes in a field.\n * This object only characterizes the location of the range, it does not own/contain the nodes in the range.\n */\nexport interface RangeUpPath<TUpPath extends UpPath = UpPath>\n\textends FieldUpPath<TUpPath>,\n\t\tRange {}\n\n/**\n * A place in a field.\n */\nexport interface PlaceUpPath<TUpPath extends UpPath = UpPath> extends FieldUpPath<TUpPath> {\n\t/**\n\t * The location in the field.\n\t */\n\treadonly index: PlaceIndex;\n}\n\n/**\n * Indicates the index of a node in a field.\n * Zero indicates the first node in a field.\n */\nexport type NodeIndex = number;\n\n/**\n * Indicates a place between nodes in a field or at the extremity of a field.\n * Zero indicates the place at the start of the field (before the first node if any).\n */\nexport type PlaceIndex = number;\n\n/**\n * Gets the number of nodes above this one.\n * @remarks\n * Zero when the path's parent is undefined, meaning the path represents a node in a detached field.\n * Runs in O(depth) time.\n */\nexport function getDepth(path: UpPath): number {\n\tlet depth = 0;\n\tlet next = path.parent;\n\twhile (next !== undefined) {\n\t\tdepth += 1;\n\t\tnext = next.parent;\n\t}\n\treturn depth;\n}\n\n/**\n * Creates deep copy of the provided path as simple JavaScript object.\n * @remarks This is safe to hold onto and use deep object comparisons on.\n */\nexport function clonePath(path: UpPath): UpPath;\n\n/**\n * Creates a deep copy of the provided path as simple JavaScript object.\n * @remarks This is safe to hold onto and use deep object comparisons on.\n */\nexport function clonePath(path: UpPath | undefined): UpPath | undefined;\n\nexport function clonePath(path: UpPath | undefined): UpPath | undefined {\n\tif (path === undefined) {\n\t\treturn undefined;\n\t}\n\treturn {\n\t\tparent: clonePath(path.parent),\n\t\tparentField: path.parentField,\n\t\tparentIndex: path.parentIndex,\n\t};\n}\n\n/**\n * Gets the elements of the given `path`, ordered from root-most to child-most.\n * @remarks These elements are unchanged and therefore still point \"up\".\n */\nexport function topDownPath<T extends UpPath<T>>(path: T | undefined): T[] {\n\tconst out: T[] = [];\n\tlet curr = path;\n\twhile (curr !== undefined) {\n\t\tout.push(curr);\n\t\tcurr = curr.parent;\n\t}\n\tout.reverse();\n\treturn out;\n}\n\n/**\n * Returns true if and only if `a` and `b` describe the same path.\n * @remarks\n * Note that for mutable paths (as used in `AnchorSet`), this equality may change over time: this only checks if the two paths are currently the same.\n */\nexport function compareUpPaths(a: UpPath | undefined, b: UpPath | undefined): boolean {\n\tif (a === b) {\n\t\t// This handles the both `undefined` case, as well as provides an early out if a shared node is encountered.\n\t\treturn true;\n\t}\n\tif (a === undefined || b === undefined) {\n\t\treturn false;\n\t}\n\tif (a.parentField !== b.parentField || a.parentIndex !== b.parentIndex) {\n\t\treturn false;\n\t}\n\treturn compareUpPaths(a.parent, b.parent);\n}\n\n/**\n * Returns true if and only if `a` and `b` describe the same field path.\n * @remarks\n * Note that for mutable paths (as used in `AnchorSet`), this equality may change over time: this only checks if the two paths are currently the same.\n */\nexport function compareFieldUpPaths(a: FieldUpPath, b: FieldUpPath): boolean {\n\tif (a.field !== b.field) {\n\t\treturn false;\n\t}\n\treturn compareUpPaths(a.parent, b.parent);\n}\n\n/**\n * Returns the field key for the root field.\n * @param path - the path you want to check.\n * @returns the {@link DetachedField} which contains the path.\n */\nexport function getDetachedFieldContainingPath(path: UpPath): DetachedField {\n\tlet currentPath = path;\n\twhile (currentPath !== undefined) {\n\t\tif (currentPath.parent === undefined) {\n\t\t\treturn keyAsDetachedField(currentPath.parentField);\n\t\t} else {\n\t\t\tcurrentPath = currentPath.parent;\n\t\t}\n\t}\n\treturn keyAsDetachedField(path.parentField);\n}\n\n/**\n * Returns the field key for the root field.\n * @param path - the path you want to check.\n * @returns the {@link DetachedField} which contains the path.\n */\nexport function getDetachedFieldContainingFieldPath(path: FieldUpPath): DetachedField {\n\tif (path.parent === undefined) {\n\t\treturn keyAsDetachedField(path.field);\n\t}\n\treturn getDetachedFieldContainingPath(path.parent);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"basicChunk.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/basicChunk.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,kBAAkB,EAClB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,WAAW,EAEX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAc,MAAM,uBAAuB,CAAC;AAEtE;;GAEG;AACH,qBAAa,UAAW,SAAQ,oBAAqB,YAAW,SAAS;IAShE,IAAI,EAAE,wBAAwB;IACrC;;;;;;;OAOG;IACI,MAAM,EAAE,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC;IACzC;;OAEG;IACI,KAAK,CAAC;IArBd,SAAgB,cAAc,EAAE,MAAM,CAAK;IAE3C;;;;OAIG;gBAEK,IAAI,EAAE,wBAAwB;IACrC;;;;;;;OAOG;IACI,MAAM,EAAE,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC;IACzC;;OAEG;IACI,KAAK,CAAC,uBAAW;IAKlB,KAAK,IAAI,UAAU;IAYnB,MAAM,IAAI,aAAa;IAI9B,SAAS,CAAC,cAAc,IAAI,IAAI;CAOhC;AAED,MAAM,MAAM,aAAa,GAAG,SAAS,SAAS,EAAE,GAAG,SAAS,QAAQ,EAAE,CAAC;AAEvE;;;;;;;;;;;GAWG;AACH,qBAAa,gBAAiB,SAAQ,iBAAkB,YAAW,aAAa;IAsB9E,SAAS,CAAC,IAAI,EAAE,SAAS,SAAS,EAAE;IACpC,SAAS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,EACxB,YAAY,EAAE,aAAa,GAAG,SAAS;IAKlD,IAAW,CAAC,WAAW,CAAC,IAAI,SAAS,GAAG,SAAS,CAMhD;IAEM,WAAW,IAAI,OAAO;IAOtB,IAAI,IAAI,gBAAgB;IAiB/B,IAAW,IAAI,IAAI,kBAAkB,CAmBpC;IAEM,WAAW,IAAI,QAAQ;IAQ9B,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,cAAc;IAKf,cAAc,IAAI,MAAM;IAaxB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAS9B,OAAO,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,MAAM;IAa/C,OAAO,CAAC,gBAAgB;IAYjB,YAAY,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,WAAW;IAczD,OAAO,CAAC,aAAa;IA6Cd,UAAU,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI;IAkB/B,SAAS,IAAI,OAAO;IAYpB,UAAU,IAAI,OAAO;IAgBrB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAoDlC,SAAS,IAAI,OAAO;IAoBpB,QAAQ,IAAI,OAAO;IAiC1B,OAAO,CAAC,gBAAgB;IAUjB,SAAS,IAAI,IAAI;IAajB,QAAQ,IAAI,IAAI;IAqBvB,OAAO,CAAC,OAAO;IAKf,OAAO,CAAC,QAAQ;IAchB,IAAW,KAAK,IAAI,KAAK,CAKxB;IAED,IAAW,IAAI,IAAI,QAAQ,CAK1B;IAED,IAAW,UAAU,IAAI,MAAM,CAa9B;IAED;;;OAGG;IACH,OAAO,CAAC,YAAY;IAUpB,IAAW,UAAU,IAAI,MAAM,CAQ9B;IAED,IAAW,WAAW,IAAI,MAAM,CAK/B;CACD"}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { assert, oob, fail } from "@fluidframework/core-utils/internal";
5
+ import { assert, oob, fail, debugAssert } from "@fluidframework/core-utils/internal";
6
6
  import { cursorChunk, dummyRoot, } from "../../core/index.js";
7
7
  import { ReferenceCountedBase } from "../../util/index.js";
8
8
  import { SynchronousCursor, prefixPath } from "../treeCursorUtils.js";
@@ -34,6 +34,13 @@ export class BasicChunk extends ReferenceCountedBase {
34
34
  this.fields = fields;
35
35
  this.value = value;
36
36
  this.topLevelLength = 1;
37
+ debugAssert(() => {
38
+ for (const field of fields.values()) {
39
+ if (field.length === 0)
40
+ return "field must have at least one child";
41
+ }
42
+ return true;
43
+ });
37
44
  }
38
45
  clone() {
39
46
  const fields = new Map();
@@ -1 +1 @@
1
- {"version":3,"file":"basicChunk.js","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/basicChunk.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAExE,OAAO,EAYN,WAAW,EACX,SAAS,GACT,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEtE;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,oBAAoB;IAGnD;;;;OAIG;IACH,YACQ,IAA8B;IACrC;;;;;;;OAOG;IACI,MAAkC;IACzC;;OAEG;IACI,KAAiB;QAExB,KAAK,EAAE,CAAC;QAfD,SAAI,GAAJ,IAAI,CAA0B;QAS9B,WAAM,GAAN,MAAM,CAA4B;QAIlC,UAAK,GAAL,KAAK,CAAY;QArBT,mBAAc,GAAW,CAAC,CAAC;IAwB3C,CAAC;IAEM,KAAK;QACX,MAAM,MAAM,GAAG,IAAI,GAAG,EAAyB,CAAC;QAChD,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;Y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AAI,CAAC,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC;IAC3C,CAAC;IAED,IAAW,UAAU;QACpB,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACrC,IAAI,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,EAAE,CAAC;gBACrC,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;YAC3D,CAAC;YACD,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC;QACrC,CAAC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAED,IAAW,WAAW;QACrB,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACrC,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC;QACtC,CAAC;QACD,OAAO,CAAC,CAAC;IACV,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tCursorLocationType,\n\ttype FieldKey,\n\ttype FieldUpPath,\n\ttype PathRootPrefix,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeType,\n\ttype TreeValue,\n\ttype UpPath,\n\ttype Value,\n\ttype ChunkedCursor,\n\ttype TreeChunk,\n\tcursorChunk,\n\tdummyRoot,\n} from \"../../core/index.js\";\nimport { ReferenceCountedBase } from \"../../util/index.js\";\nimport { SynchronousCursor, prefixPath } from \"../treeCursorUtils.js\";\n\n/**\n * General purpose one node chunk.\n */\nexport class BasicChunk extends ReferenceCountedBase implements TreeChunk {\n\tpublic readonly topLevelLength: number = 1;\n\n\t/**\n\t * Create a tree chunk with ref count 1.\n\t *\n\t * Caller must have already accounted for references via `fields` to the children in the fields map (via `referenceAdded`).\n\t */\n\tpublic constructor(\n\t\tpublic type: TreeNodeSchemaIdentifier,\n\t\t/**\n\t\t * Fields of this node.\n\t\t * @remarks\n\t\t * This object has exclusive deep ownership of this map (which might mutate it in the future).\n\t\t * Any code editing this map must update child reference counts.\n\t\t *\n\t\t * Like with {@link MapTree}, fields with no nodes must be removed from the map.\n\t\t */\n\t\tpublic fields: Map<FieldKey, TreeChunk[]>,\n\t\t/**\n\t\t * The value on this node, if any.\n\t\t */\n\t\tpublic value?: TreeValue,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic clone(): BasicChunk {\n\t\tconst fields = new Map<FieldKey, TreeChunk[]>();\n\t\tfor (const [k, v] of this.fields) {\n\t\t\tconst field = v.map((child) => {\n\t\t\t\tchild.referenceAdded();\n\t\t\t\treturn child;\n\t\t\t});\n\t\t\tfields.set(k, field);\n\t\t}\n\t\treturn new BasicChunk(this.type, fields, this.value);\n\t}\n\n\tpublic cursor(): ChunkedCursor {\n\t\treturn new BasicChunkCursor([this], [], [], [], [], [dummyRoot], 0, 0, 0, undefined);\n\t}\n\n\tprotected onUnreferenced(): void {\n\t\tfor (const v of this.fields.values()) {\n\t\t\tfor (const child of v) {\n\t\t\t\tchild.referenceRemoved();\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport type SiblingsOrKey = readonly TreeChunk[] | readonly FieldKey[];\n\n/**\n * Cursor over basic chunks.\n *\n * @remarks This implementation is similar to StackCursor, however it is distinct because:\n * 1. The children are chunks, which might have a top level length that's greater than 1.\n * 2. It needs to be able to delegate to cursors of other chunk formats it does not natively understand (See TODO below).\n *\n * TODO:\n * This cursor currently only handles child chunks which are BasicChunks:\n * BasicChunks should be an optimized fast path, and arbitrary chunk formats,\n * like UniformChunk, should be supported by delegating to their cursor implementations.\n */\nexport class BasicChunkCursor extends SynchronousCursor implements ChunkedCursor {\n\t/**\n\t * Starts at root field which might be a detached sequence.\n\t *\n\t * @param root - sequence of BasicChunk which make up the contents of the root sequence.\n\t * Since this cursor starts in `Fields` mode at the root, the siblings array when in fields mode is just the field keys,\n\t * this is needed to get the actual root nodes when entering nodes of the root field.\n\t * @param siblingStack - Stack of collections of siblings along the path through the tree:\n\t * does not include current level (which is stored in `siblings`).\n\t * Even levels in the stack (starting from 0) are keys and odd levels are sequences of nodes.\n\t * @param indexStack - Stack of indices into the corresponding levels in `siblingStack`.\n\t * @param indexOfChunkStack - Index of chunk in array of chunks. Only for Node levels.\n\t * @param indexWithinChunkStack - Index within chunk selected by indexOfChunkStack. Only for Node levels.\n\t * @param siblings - Siblings at the current level (not included in `siblingStack`).\n\t * @param index - Index into `siblings`.\n\t * @param indexOfChunk - Index of chunk in array of chunks. Only for Nodes mode.\n\t * @param indexWithinChunk - Index within chunk selected by indexOfChunkStack. Only for Nodes mode.\n\t * @param nestedCursor - When the outer cursor (this `BasicChunkCursor` cursor)\n\t * navigates into a chunk it does not natively understand (currently anything other than `BasicChunk`s)\n\t * it creates the `nestedCursor` over that chunk, and delegates all operations to it.\n\t */\n\tpublic constructor(\n\t\tprotected root: readonly TreeChunk[],\n\t\tprotected readonly siblingStack: SiblingsOrKey[],\n\t\tprotected readonly indexStack: number[],\n\t\tprotected readonly indexOfChunkStack: number[],\n\t\t// TODO: Currently only BasicChunks are supported, and the currently always have a top level length of 1.\n\t\t// That makes this stack unneeded. When BasicChunkCursor is more feature complete, this stack should be reevaluated, and removed if possible.\n\t\tprotected readonly indexWithinChunkStack: number[],\n\t\tprotected siblings: SiblingsOrKey,\n\t\tprotected index: number,\n\t\tprotected indexOfChunk: number,\n\t\tprotected indexWithinChunk: number,\n\t\tprotected nestedCursor: ChunkedCursor | undefined,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic get [cursorChunk](): TreeChunk | undefined {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor[cursorChunk];\n\t\t}\n\t\tassert(this.mode === CursorLocationType.Nodes, 0x57a /* must be in nodes mode */);\n\t\treturn (this.siblings as TreeChunk[])[this.indexOfChunk];\n\t}\n\n\tpublic atChunkRoot(): boolean {\n\t\treturn (\n\t\t\tthis.siblingStack.length < 2 &&\n\t\t\t(this.nestedCursor === undefined || this.nestedCursor.atChunkRoot())\n\t\t);\n\t}\n\n\tpublic fork(): BasicChunkCursor {\n\t\t// Siblings arrays are not modified during navigation and do not need be be copied.\n\t\t// This allows this copy to be shallow, and `this.siblings` below to not be copied as all.\n\t\treturn new BasicChunkCursor(\n\t\t\tthis.root,\n\t\t\t[...this.siblingStack],\n\t\t\t[...this.indexStack],\n\t\t\t[...this.indexOfChunkStack],\n\t\t\t[...this.indexWithinChunkStack],\n\t\t\tthis.siblings,\n\t\t\tthis.index,\n\t\t\tthis.indexOfChunk,\n\t\t\tthis.indexWithinChunk,\n\t\t\tthis.nestedCursor?.fork(),\n\t\t);\n\t}\n\n\tpublic get mode(): CursorLocationType {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor.mode;\n\t\t}\n\t\t// Compute the number of nodes deep the current depth is.\n\t\t// We want the floor of the result, which can computed using a bitwise shift assuming the depth is less than 2^31, which seems safe.\n\t\t// eslint-disable-next-line no-bitwise\n\t\tconst halfHeight = (this.siblingStack.length + 1) >> 1;\n\t\tassert(\n\t\t\tthis.indexOfChunkStack.length === halfHeight,\n\t\t\t0x51c /* unexpected indexOfChunkStack */,\n\t\t);\n\t\tassert(\n\t\t\tthis.indexWithinChunkStack.length === halfHeight,\n\t\t\t0x51d /* unexpected indexWithinChunkStack */,\n\t\t);\n\t\treturn this.siblingStack.length % 2 === 0\n\t\t\t? CursorLocationType.Fields\n\t\t\t: CursorLocationType.Nodes;\n\t}\n\n\tpublic getFieldKey(): FieldKey {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor.getFieldKey();\n\t\t}\n\t\tassert(this.mode === CursorLocationType.Fields, 0x51e /* must be in fields mode */);\n\t\treturn this.siblings[this.index] as FieldKey;\n\t}\n\n\tprivate getStackedFieldKey(height: number): FieldKey {\n\t\tassert(height % 2 === 0, 0x51f /* must field height */);\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn this.siblingStack[height]![this.indexStack[height]!] as FieldKey;\n\t}\n\n\tprivate getStackedNodeIndex(height: number): number {\n\t\tassert(height % 2 === 1, 0x520 /* must be node height */);\n\t\tassert(height >= 0, 0x521 /* must not be above root */);\n\t\treturn this.indexStack[height] ?? oob();\n\t}\n\n\tprivate getStackedNode(height: number): BasicChunk {\n\t\tconst index = this.getStackedNodeIndex(height);\n\t\treturn (this.siblingStack[height] as readonly TreeChunk[])[index] as BasicChunk;\n\t}\n\n\tpublic getFieldLength(): number {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor.getFieldLength();\n\t\t}\n\t\tassert(this.mode === CursorLocationType.Fields, 0x522 /* must be in fields mode */);\n\t\tlet total = 0;\n\t\t// TODO: optimize?\n\t\tfor (const chunk of this.getField()) {\n\t\t\ttotal += chunk.topLevelLength;\n\t\t}\n\t\treturn total;\n\t}\n\n\tpublic enterNode(index: number): void {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\tthis.nestedCursor.enterNode(index);\n\t\t\treturn;\n\t\t}\n\t\tconst found = this.firstNode() && this.seekNodes(index);\n\t\tassert(found, 0x523 /* child must exist at index */);\n\t}\n\n\tpublic getPath(prefix?: PathRootPrefix): UpPath {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn (\n\t\t\t\tthis.nestedCursor.getPath(this.nestedPathPrefix(prefix)) ??\n\t\t\t\tfail(0xaee /* nested cursors should not be root */)\n\t\t\t);\n\t\t}\n\t\tassert(this.mode === CursorLocationType.Nodes, 0x524 /* must be in nodes mode */);\n\t\tconst path = this.getOffsetPath(0, prefix);\n\t\tassert(path !== undefined, 0x55c /* field root cursor should never have undefined path */);\n\t\treturn path;\n\t}\n\n\tprivate nestedPathPrefix(prefix?: PathRootPrefix): PathRootPrefix {\n\t\t// This uses index offset for actual node, when it should use offset for start of chunk.\n\t\t// To compensate, subtract this.indexWithinChunk below.\n\t\tconst rootPath: UpPath =\n\t\t\tthis.getOffsetPath(0, prefix) ?? fail(0xaef /* nested cursors should not be root */);\n\t\treturn {\n\t\t\tindexOffset: rootPath.parentIndex - this.indexWithinChunk,\n\t\t\trootFieldOverride: rootPath.parentField,\n\t\t\tparent: rootPath.parent,\n\t\t};\n\t}\n\n\tpublic getFieldPath(prefix?: PathRootPrefix): FieldUpPath {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor.getFieldPath(this.nestedPathPrefix(prefix));\n\t\t}\n\t\tassert(this.mode === CursorLocationType.Fields, 0x525 /* must be in fields mode */);\n\t\treturn {\n\t\t\tfield:\n\t\t\t\tthis.indexStack.length === 1\n\t\t\t\t\t? (prefix?.rootFieldOverride ?? this.getFieldKey())\n\t\t\t\t\t: this.getFieldKey(),\n\t\t\tparent: this.getOffsetPath(1, prefix),\n\t\t};\n\t}\n\n\tprivate getOffsetPath(\n\t\toffset: number,\n\t\tprefix: PathRootPrefix | undefined,\n\t): UpPath | undefined {\n\t\t// It is more efficient to handle prefix directly in here rather than delegating to PrefixedPath.\n\n\t\tconst length = this.indexStack.length - offset;\n\t\tif (length === -1) {\n\t\t\treturn prefix?.parent; // At root\n\t\t}\n\n\t\tassert(length > 0, 0x526 /* invalid offset to above root */);\n\t\tassert(length % 2 === 1, 0x527 /* offset path must point to node not field */);\n\n\t\t// Perf Note:\n\t\t// This is O(depth) in tree.\n\t\t// If many different anchors are created, this could be optimized to amortize the costs.\n\t\t// For example, the cursor could cache UpPaths from the anchorSet when creating an anchor,\n\t\t// then reuse them as a starting point when making another.\n\t\t// Could cache this at one depth, and remember the depth.\n\t\t// When navigating up, adjust cached anchor if present.\n\n\t\tlet path: UpPath | undefined;\n\t\tfunction updatePath(newPath: UpPath): void {\n\t\t\tpath = path === undefined ? prefixPath(prefix, newPath) : newPath;\n\t\t}\n\n\t\t// Skip top level, since root node in path is \"undefined\" and does not have a parent or index.\n\t\tfor (let height = 1; height < length; height += 2) {\n\t\t\tconst key = this.getStackedFieldKey(height - 1);\n\t\t\tupdatePath({\n\t\t\t\tparent: path,\n\t\t\t\tparentIndex: this.getStackedNodeIndex(height),\n\t\t\t\tparentField: key,\n\t\t\t});\n\t\t}\n\n\t\tupdatePath({\n\t\t\tparent: path,\n\t\t\tparentIndex: offset === 0 ? this.index : this.getStackedNodeIndex(length),\n\t\t\tparentField: this.getStackedFieldKey(length - 1),\n\t\t});\n\t\treturn path;\n\t}\n\n\tpublic enterField(key: FieldKey): void {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\tthis.nestedCursor.enterField(key);\n\t\t\treturn;\n\t\t}\n\t\tassert(this.mode === CursorLocationType.Nodes, 0x528 /* must be in nodes mode */);\n\t\tthis.siblingStack.push(this.siblings);\n\t\tthis.indexStack.push(this.index);\n\n\t\t// For fields, siblings are only used for key lookup and\n\t\t// nextField and which has arbitrary iteration order,\n\t\t// so making a array of just key here works.\n\t\t// This adds an allocation, so it's optimizing code simplicity and for the other use case (enumeration)\n\t\t// at the cost of an allocation here.\n\t\tthis.index = 0;\n\t\tthis.siblings = [key];\n\t}\n\n\tpublic nextField(): boolean {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor.nextField();\n\t\t}\n\t\tthis.index += 1;\n\t\tif (this.index === (this.siblings as []).length) {\n\t\t\tthis.exitField();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic firstField(): boolean {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor.firstField();\n\t\t}\n\t\tconst fields = this.getNode().fields;\n\t\tif (fields.size === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.siblingStack.push(this.siblings);\n\t\tthis.indexStack.push(this.index);\n\t\tthis.index = 0;\n\t\tthis.siblings = [...fields.keys()]; // TODO: avoid this copy\n\t\treturn true;\n\t}\n\n\tpublic seekNodes(offset: number): boolean {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\tconst atRoot = this.nestedCursor.atChunkRoot();\n\t\t\tconst stillIn = this.nestedCursor.seekNodes(offset);\n\t\t\tif (!atRoot) {\n\t\t\t\treturn stillIn;\n\t\t\t}\n\t\t\tif (!stillIn) {\n\t\t\t\tthis.nestedCursor = undefined;\n\t\t\t}\n\t\t}\n\t\tassert(\n\t\t\tthis.mode === CursorLocationType.Nodes,\n\t\t\t0x529 /* can only seekNodes when in Nodes */,\n\t\t);\n\t\tassert(this.indexOfChunk < this.siblings.length, 0x52a /* out of bounds indexOfChunk */);\n\n\t\tthis.indexWithinChunk += offset;\n\t\tif (offset >= 0) {\n\t\t\tconst chunks = (this.siblings as TreeChunk[]) ?? oob();\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\twhile (this.indexWithinChunk >= chunks[this.indexOfChunk]!.topLevelLength) {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tthis.indexWithinChunk -= chunks[this.indexOfChunk]!.topLevelLength;\n\t\t\t\tthis.indexOfChunk++;\n\t\t\t\tif (this.indexOfChunk === chunks.length) {\n\t\t\t\t\tthis.exitNode();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tassert(\n\t\t\t\t\tthis.indexOfChunk < this.siblings.length,\n\t\t\t\t\t0x52b /* out of bounds indexOfChunk */,\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tconst chunks = this.siblings as TreeChunk[];\n\t\t\twhile (this.indexWithinChunk < 0) {\n\t\t\t\tif (this.indexOfChunk === 0) {\n\t\t\t\t\tthis.exitNode();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tthis.indexOfChunk--;\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tthis.indexWithinChunk += chunks[this.indexOfChunk]!.topLevelLength;\n\t\t\t}\n\t\t}\n\n\t\tthis.index += offset;\n\t\tthis.initNestedCursor();\n\t\treturn true;\n\t}\n\n\tpublic firstNode(): boolean {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor.firstNode();\n\t\t}\n\t\tconst siblings = this.getField();\n\t\tif (siblings.length === 0) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.siblingStack.push(this.siblings);\n\t\tthis.indexStack.push(this.index);\n\t\tthis.indexOfChunkStack.push(this.indexOfChunk);\n\t\tthis.indexWithinChunkStack.push(this.indexWithinChunk);\n\t\tthis.index = 0;\n\t\tthis.siblings = siblings;\n\t\tthis.indexOfChunk = 0;\n\t\tthis.indexWithinChunk = 0;\n\t\tthis.initNestedCursor();\n\t\treturn true;\n\t}\n\n\tpublic nextNode(): boolean {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\tconst atRoot = this.nestedCursor.atChunkRoot();\n\t\t\tconst stillIn = this.nestedCursor.nextNode();\n\t\t\tif (!atRoot) {\n\t\t\t\treturn stillIn;\n\t\t\t}\n\t\t\tif (!stillIn) {\n\t\t\t\tthis.nestedCursor = undefined;\n\t\t\t}\n\t\t}\n\t\tassert(\n\t\t\tthis.mode === CursorLocationType.Nodes,\n\t\t\t0x52c /* can only nextNode when in Nodes */,\n\t\t);\n\t\tthis.indexWithinChunk++;\n\t\tif (\n\t\t\tthis.indexWithinChunk ===\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t(this.siblings as TreeChunk[])[this.indexOfChunk]!.topLevelLength\n\t\t) {\n\t\t\tthis.indexOfChunk++;\n\t\t\tif (this.indexOfChunk === (this.siblings as TreeChunk[]).length) {\n\t\t\t\tthis.exitNode();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tthis.indexWithinChunk = 0;\n\t\t\tthis.initNestedCursor();\n\t\t}\n\t\tthis.index++;\n\t\treturn true;\n\t}\n\n\tprivate initNestedCursor(): void {\n\t\tassert(\n\t\t\tthis.mode === CursorLocationType.Nodes,\n\t\t\t0x55d /* can only initNestedCursor when in Nodes */,\n\t\t);\n\t\tconst chunk = (this.siblings as TreeChunk[])[this.indexOfChunk] ?? oob();\n\t\tthis.nestedCursor = !(chunk instanceof BasicChunk) ? chunk.cursor() : undefined;\n\t\tthis.nestedCursor?.enterNode(this.indexWithinChunk);\n\t}\n\n\tpublic exitField(): void {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor.exitField();\n\t\t}\n\t\tassert(\n\t\t\tthis.mode === CursorLocationType.Fields,\n\t\t\t0x52d /* can only navigate up from field when in field */,\n\t\t);\n\t\tthis.siblings =\n\t\t\tthis.siblingStack.pop() ?? fail(0xaf0 /* Unexpected siblingStack.length */);\n\t\tthis.index = this.indexStack.pop() ?? fail(0xaf1 /* Unexpected indexStack.length */);\n\t}\n\n\tpublic exitNode(): void {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\tif (!this.nestedCursor.atChunkRoot()) {\n\t\t\t\treturn this.nestedCursor.exitNode();\n\t\t\t}\n\t\t\tthis.nestedCursor = undefined;\n\t\t}\n\t\tassert(\n\t\t\tthis.mode === CursorLocationType.Nodes,\n\t\t\t0x52e /* can only navigate up from node when in node */,\n\t\t);\n\t\tthis.siblings =\n\t\t\tthis.siblingStack.pop() ?? fail(0xaf2 /* Unexpected siblingStack.length */);\n\t\tthis.index = this.indexStack.pop() ?? fail(0xaf3 /* Unexpected indexStack.length */);\n\t\tthis.indexOfChunk =\n\t\t\tthis.indexOfChunkStack.pop() ?? fail(0xaf4 /* Unexpected indexOfChunkStack.length */);\n\t\tthis.indexWithinChunk =\n\t\t\tthis.indexWithinChunkStack.pop() ??\n\t\t\tfail(0xaf5 /* Unexpected indexWithinChunkStack.length */);\n\t}\n\n\tprivate getNode(): BasicChunk {\n\t\tassert(this.mode === CursorLocationType.Nodes, 0x52f /* can only get node when in node */);\n\t\treturn (this.siblings as TreeChunk[])[this.index] as BasicChunk;\n\t}\n\n\tprivate getField(): readonly TreeChunk[] {\n\t\tif (this.siblingStack.length === 0) {\n\t\t\treturn this.root;\n\t\t}\n\t\tassert(\n\t\t\tthis.mode === CursorLocationType.Fields,\n\t\t\t0x530 /* can only get field when in fields */,\n\t\t);\n\t\tconst parent = this.getStackedNode(this.indexStack.length - 1);\n\t\tconst key: FieldKey = this.getFieldKey();\n\t\tconst field = parent.fields.get(key) ?? [];\n\t\treturn field;\n\t}\n\n\tpublic get value(): Value {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor.value;\n\t\t}\n\t\treturn this.getNode().value;\n\t}\n\n\tpublic get type(): TreeType {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor.type;\n\t\t}\n\t\treturn this.getNode().type;\n\t}\n\n\tpublic get fieldIndex(): number {\n\t\tassert(\n\t\t\tthis.mode === CursorLocationType.Nodes,\n\t\t\t0x531 /* can only node's index when in node */,\n\t\t);\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\tif (this.nestedCursor.atChunkRoot()) {\n\t\t\t\t// TODO: this.index\n\t\t\t\treturn this.nestedCursor.fieldIndex + this.nestedOffset();\n\t\t\t}\n\t\t\treturn this.nestedCursor.fieldIndex;\n\t\t}\n\t\treturn this.index;\n\t}\n\n\t/**\n\t * Within the field that `nestedCursor` is nested in:\n\t * returns the index within that field of the first node that is part of the chunk nestedCursor traverses.\n\t */\n\tprivate nestedOffset(): number {\n\t\tassert(this.nestedCursor !== undefined, 0x55e /* nested offset requires nested cursor */);\n\t\tassert(\n\t\t\t!this.nestedCursor.atChunkRoot() ||\n\t\t\t\tthis.indexWithinChunk === this.nestedCursor.fieldIndex,\n\t\t\t0x55f /* indexes should match if at root */,\n\t\t);\n\t\treturn this.index - this.indexWithinChunk;\n\t}\n\n\tpublic get chunkStart(): number {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\tif (this.nestedCursor.atChunkRoot()) {\n\t\t\t\treturn this.nestedCursor.chunkStart + this.nestedOffset();\n\t\t\t}\n\t\t\treturn this.nestedCursor.chunkStart;\n\t\t}\n\t\treturn this.fieldIndex;\n\t}\n\n\tpublic get chunkLength(): number {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor.chunkLength;\n\t\t}\n\t\treturn 1;\n\t}\n}\n"]}
1
+ {"version":3,"file":"basicChunk.js","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/basicChunk.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAErF,OAAO,EAYN,WAAW,EACX,SAAS,GACT,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEtE;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,oBAAoB;IAGnD;;;;OAIG;IACH,YACQ,IAA8B;IACrC;;;;;;;OAOG;IACI,MAAkC;IACzC;;OAEG;IACI,KAAiB;QAExB,KAAK,EAAE,CAAC;QAfD,SAAI,GAAJ,IAAI,CAA0B;QAS9B,WAAM,GAAN,MAAM,CAA4B;QAIlC,UAAK,GAAL,KAAK,CAAY;QArBT,mBAAc,GAAW,CAAC,CAAC;QAwB1C,WAAW,CAAC,GAAG,EAAE;YAChB,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;gBACrC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;oBAAE,OAAO,oCAAoC,CAAC;YACrE,CAAC;YACD,OAAO,IAAI,CAAC;QACb,CAAC,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK;QACX,MAAM,MAAM,GAAG,IAAI,GAAG,EAAyB,CAAC;QAChD,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAClC,MAAM,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;gBAC7B,KAAK,CAAC,cAAc,EAAE,CAAC;gBACv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,SAAS,EAAE,CAAC;YACrC,IAAI,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,EAAE,CAAC;gBACrC,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;YAC3D,CAAC;YACD,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC;QACrC,CAAC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAED,IAAW,WAAW;QACrB,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACrC,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC;QACtC,CAAC;QACD,OAAO,CAAC,CAAC;IACV,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob, fail, debugAssert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tCursorLocationType,\n\ttype FieldKey,\n\ttype FieldUpPath,\n\ttype PathRootPrefix,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeType,\n\ttype TreeValue,\n\ttype UpPath,\n\ttype Value,\n\ttype ChunkedCursor,\n\ttype TreeChunk,\n\tcursorChunk,\n\tdummyRoot,\n} from \"../../core/index.js\";\nimport { ReferenceCountedBase } from \"../../util/index.js\";\nimport { SynchronousCursor, prefixPath } from \"../treeCursorUtils.js\";\n\n/**\n * General purpose one node chunk.\n */\nexport class BasicChunk extends ReferenceCountedBase implements TreeChunk {\n\tpublic readonly topLevelLength: number = 1;\n\n\t/**\n\t * Create a tree chunk with ref count 1.\n\t *\n\t * Caller must have already accounted for references via `fields` to the children in the fields map (via `referenceAdded`).\n\t */\n\tpublic constructor(\n\t\tpublic type: TreeNodeSchemaIdentifier,\n\t\t/**\n\t\t * Fields of this node.\n\t\t * @remarks\n\t\t * This object has exclusive deep ownership of this map (which might mutate it in the future).\n\t\t * Any code editing this map must update child reference counts.\n\t\t *\n\t\t * Like with {@link MapTree}, fields with no nodes must be removed from the map.\n\t\t */\n\t\tpublic fields: Map<FieldKey, TreeChunk[]>,\n\t\t/**\n\t\t * The value on this node, if any.\n\t\t */\n\t\tpublic value?: TreeValue,\n\t) {\n\t\tsuper();\n\t\tdebugAssert(() => {\n\t\t\tfor (const field of fields.values()) {\n\t\t\t\tif (field.length === 0) return \"field must have at least one child\";\n\t\t\t}\n\t\t\treturn true;\n\t\t});\n\t}\n\n\tpublic clone(): BasicChunk {\n\t\tconst fields = new Map<FieldKey, TreeChunk[]>();\n\t\tfor (const [k, v] of this.fields) {\n\t\t\tconst field = v.map((child) => {\n\t\t\t\tchild.referenceAdded();\n\t\t\t\treturn child;\n\t\t\t});\n\t\t\tfields.set(k, field);\n\t\t}\n\t\treturn new BasicChunk(this.type, fields, this.value);\n\t}\n\n\tpublic cursor(): ChunkedCursor {\n\t\treturn new BasicChunkCursor([this], [], [], [], [], [dummyRoot], 0, 0, 0, undefined);\n\t}\n\n\tprotected onUnreferenced(): void {\n\t\tfor (const v of this.fields.values()) {\n\t\t\tfor (const child of v) {\n\t\t\t\tchild.referenceRemoved();\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport type SiblingsOrKey = readonly TreeChunk[] | readonly FieldKey[];\n\n/**\n * Cursor over basic chunks.\n *\n * @remarks This implementation is similar to StackCursor, however it is distinct because:\n * 1. The children are chunks, which might have a top level length that's greater than 1.\n * 2. It needs to be able to delegate to cursors of other chunk formats it does not natively understand (See TODO below).\n *\n * TODO:\n * This cursor currently only handles child chunks which are BasicChunks:\n * BasicChunks should be an optimized fast path, and arbitrary chunk formats,\n * like UniformChunk, should be supported by delegating to their cursor implementations.\n */\nexport class BasicChunkCursor extends SynchronousCursor implements ChunkedCursor {\n\t/**\n\t * Starts at root field which might be a detached sequence.\n\t *\n\t * @param root - sequence of BasicChunk which make up the contents of the root sequence.\n\t * Since this cursor starts in `Fields` mode at the root, the siblings array when in fields mode is just the field keys,\n\t * this is needed to get the actual root nodes when entering nodes of the root field.\n\t * @param siblingStack - Stack of collections of siblings along the path through the tree:\n\t * does not include current level (which is stored in `siblings`).\n\t * Even levels in the stack (starting from 0) are keys and odd levels are sequences of nodes.\n\t * @param indexStack - Stack of indices into the corresponding levels in `siblingStack`.\n\t * @param indexOfChunkStack - Index of chunk in array of chunks. Only for Node levels.\n\t * @param indexWithinChunkStack - Index within chunk selected by indexOfChunkStack. Only for Node levels.\n\t * @param siblings - Siblings at the current level (not included in `siblingStack`).\n\t * @param index - Index into `siblings`.\n\t * @param indexOfChunk - Index of chunk in array of chunks. Only for Nodes mode.\n\t * @param indexWithinChunk - Index within chunk selected by indexOfChunkStack. Only for Nodes mode.\n\t * @param nestedCursor - When the outer cursor (this `BasicChunkCursor` cursor)\n\t * navigates into a chunk it does not natively understand (currently anything other than `BasicChunk`s)\n\t * it creates the `nestedCursor` over that chunk, and delegates all operations to it.\n\t */\n\tpublic constructor(\n\t\tprotected root: readonly TreeChunk[],\n\t\tprotected readonly siblingStack: SiblingsOrKey[],\n\t\tprotected readonly indexStack: number[],\n\t\tprotected readonly indexOfChunkStack: number[],\n\t\t// TODO: Currently only BasicChunks are supported, and the currently always have a top level length of 1.\n\t\t// That makes this stack unneeded. When BasicChunkCursor is more feature complete, this stack should be reevaluated, and removed if possible.\n\t\tprotected readonly indexWithinChunkStack: number[],\n\t\tprotected siblings: SiblingsOrKey,\n\t\tprotected index: number,\n\t\tprotected indexOfChunk: number,\n\t\tprotected indexWithinChunk: number,\n\t\tprotected nestedCursor: ChunkedCursor | undefined,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic get [cursorChunk](): TreeChunk | undefined {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor[cursorChunk];\n\t\t}\n\t\tassert(this.mode === CursorLocationType.Nodes, 0x57a /* must be in nodes mode */);\n\t\treturn (this.siblings as TreeChunk[])[this.indexOfChunk];\n\t}\n\n\tpublic atChunkRoot(): boolean {\n\t\treturn (\n\t\t\tthis.siblingStack.length < 2 &&\n\t\t\t(this.nestedCursor === undefined || this.nestedCursor.atChunkRoot())\n\t\t);\n\t}\n\n\tpublic fork(): BasicChunkCursor {\n\t\t// Siblings arrays are not modified during navigation and do not need be be copied.\n\t\t// This allows this copy to be shallow, and `this.siblings` below to not be copied as all.\n\t\treturn new BasicChunkCursor(\n\t\t\tthis.root,\n\t\t\t[...this.siblingStack],\n\t\t\t[...this.indexStack],\n\t\t\t[...this.indexOfChunkStack],\n\t\t\t[...this.indexWithinChunkStack],\n\t\t\tthis.siblings,\n\t\t\tthis.index,\n\t\t\tthis.indexOfChunk,\n\t\t\tthis.indexWithinChunk,\n\t\t\tthis.nestedCursor?.fork(),\n\t\t);\n\t}\n\n\tpublic get mode(): CursorLocationType {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor.mode;\n\t\t}\n\t\t// Compute the number of nodes deep the current depth is.\n\t\t// We want the floor of the result, which can computed using a bitwise shift assuming the depth is less than 2^31, which seems safe.\n\t\t// eslint-disable-next-line no-bitwise\n\t\tconst halfHeight = (this.siblingStack.length + 1) >> 1;\n\t\tassert(\n\t\t\tthis.indexOfChunkStack.length === halfHeight,\n\t\t\t0x51c /* unexpected indexOfChunkStack */,\n\t\t);\n\t\tassert(\n\t\t\tthis.indexWithinChunkStack.length === halfHeight,\n\t\t\t0x51d /* unexpected indexWithinChunkStack */,\n\t\t);\n\t\treturn this.siblingStack.length % 2 === 0\n\t\t\t? CursorLocationType.Fields\n\t\t\t: CursorLocationType.Nodes;\n\t}\n\n\tpublic getFieldKey(): FieldKey {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor.getFieldKey();\n\t\t}\n\t\tassert(this.mode === CursorLocationType.Fields, 0x51e /* must be in fields mode */);\n\t\treturn this.siblings[this.index] as FieldKey;\n\t}\n\n\tprivate getStackedFieldKey(height: number): FieldKey {\n\t\tassert(height % 2 === 0, 0x51f /* must field height */);\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn this.siblingStack[height]![this.indexStack[height]!] as FieldKey;\n\t}\n\n\tprivate getStackedNodeIndex(height: number): number {\n\t\tassert(height % 2 === 1, 0x520 /* must be node height */);\n\t\tassert(height >= 0, 0x521 /* must not be above root */);\n\t\treturn this.indexStack[height] ?? oob();\n\t}\n\n\tprivate getStackedNode(height: number): BasicChunk {\n\t\tconst index = this.getStackedNodeIndex(height);\n\t\treturn (this.siblingStack[height] as readonly TreeChunk[])[index] as BasicChunk;\n\t}\n\n\tpublic getFieldLength(): number {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor.getFieldLength();\n\t\t}\n\t\tassert(this.mode === CursorLocationType.Fields, 0x522 /* must be in fields mode */);\n\t\tlet total = 0;\n\t\t// TODO: optimize?\n\t\tfor (const chunk of this.getField()) {\n\t\t\ttotal += chunk.topLevelLength;\n\t\t}\n\t\treturn total;\n\t}\n\n\tpublic enterNode(index: number): void {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\tthis.nestedCursor.enterNode(index);\n\t\t\treturn;\n\t\t}\n\t\tconst found = this.firstNode() && this.seekNodes(index);\n\t\tassert(found, 0x523 /* child must exist at index */);\n\t}\n\n\tpublic getPath(prefix?: PathRootPrefix): UpPath {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn (\n\t\t\t\tthis.nestedCursor.getPath(this.nestedPathPrefix(prefix)) ??\n\t\t\t\tfail(0xaee /* nested cursors should not be root */)\n\t\t\t);\n\t\t}\n\t\tassert(this.mode === CursorLocationType.Nodes, 0x524 /* must be in nodes mode */);\n\t\tconst path = this.getOffsetPath(0, prefix);\n\t\tassert(path !== undefined, 0x55c /* field root cursor should never have undefined path */);\n\t\treturn path;\n\t}\n\n\tprivate nestedPathPrefix(prefix?: PathRootPrefix): PathRootPrefix {\n\t\t// This uses index offset for actual node, when it should use offset for start of chunk.\n\t\t// To compensate, subtract this.indexWithinChunk below.\n\t\tconst rootPath: UpPath =\n\t\t\tthis.getOffsetPath(0, prefix) ?? fail(0xaef /* nested cursors should not be root */);\n\t\treturn {\n\t\t\tindexOffset: rootPath.parentIndex - this.indexWithinChunk,\n\t\t\trootFieldOverride: rootPath.parentField,\n\t\t\tparent: rootPath.parent,\n\t\t};\n\t}\n\n\tpublic getFieldPath(prefix?: PathRootPrefix): FieldUpPath {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor.getFieldPath(this.nestedPathPrefix(prefix));\n\t\t}\n\t\tassert(this.mode === CursorLocationType.Fields, 0x525 /* must be in fields mode */);\n\t\treturn {\n\t\t\tfield:\n\t\t\t\tthis.indexStack.length === 1\n\t\t\t\t\t? (prefix?.rootFieldOverride ?? this.getFieldKey())\n\t\t\t\t\t: this.getFieldKey(),\n\t\t\tparent: this.getOffsetPath(1, prefix),\n\t\t};\n\t}\n\n\tprivate getOffsetPath(\n\t\toffset: number,\n\t\tprefix: PathRootPrefix | undefined,\n\t): UpPath | undefined {\n\t\t// It is more efficient to handle prefix directly in here rather than delegating to PrefixedPath.\n\n\t\tconst length = this.indexStack.length - offset;\n\t\tif (length === -1) {\n\t\t\treturn prefix?.parent; // At root\n\t\t}\n\n\t\tassert(length > 0, 0x526 /* invalid offset to above root */);\n\t\tassert(length % 2 === 1, 0x527 /* offset path must point to node not field */);\n\n\t\t// Perf Note:\n\t\t// This is O(depth) in tree.\n\t\t// If many different anchors are created, this could be optimized to amortize the costs.\n\t\t// For example, the cursor could cache UpPaths from the anchorSet when creating an anchor,\n\t\t// then reuse them as a starting point when making another.\n\t\t// Could cache this at one depth, and remember the depth.\n\t\t// When navigating up, adjust cached anchor if present.\n\n\t\tlet path: UpPath | undefined;\n\t\tfunction updatePath(newPath: UpPath): void {\n\t\t\tpath = path === undefined ? prefixPath(prefix, newPath) : newPath;\n\t\t}\n\n\t\t// Skip top level, since root node in path is \"undefined\" and does not have a parent or index.\n\t\tfor (let height = 1; height < length; height += 2) {\n\t\t\tconst key = this.getStackedFieldKey(height - 1);\n\t\t\tupdatePath({\n\t\t\t\tparent: path,\n\t\t\t\tparentIndex: this.getStackedNodeIndex(height),\n\t\t\t\tparentField: key,\n\t\t\t});\n\t\t}\n\n\t\tupdatePath({\n\t\t\tparent: path,\n\t\t\tparentIndex: offset === 0 ? this.index : this.getStackedNodeIndex(length),\n\t\t\tparentField: this.getStackedFieldKey(length - 1),\n\t\t});\n\t\treturn path;\n\t}\n\n\tpublic enterField(key: FieldKey): void {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\tthis.nestedCursor.enterField(key);\n\t\t\treturn;\n\t\t}\n\t\tassert(this.mode === CursorLocationType.Nodes, 0x528 /* must be in nodes mode */);\n\t\tthis.siblingStack.push(this.siblings);\n\t\tthis.indexStack.push(this.index);\n\n\t\t// For fields, siblings are only used for key lookup and\n\t\t// nextField and which has arbitrary iteration order,\n\t\t// so making a array of just key here works.\n\t\t// This adds an allocation, so it's optimizing code simplicity and for the other use case (enumeration)\n\t\t// at the cost of an allocation here.\n\t\tthis.index = 0;\n\t\tthis.siblings = [key];\n\t}\n\n\tpublic nextField(): boolean {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor.nextField();\n\t\t}\n\t\tthis.index += 1;\n\t\tif (this.index === (this.siblings as []).length) {\n\t\t\tthis.exitField();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic firstField(): boolean {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor.firstField();\n\t\t}\n\t\tconst fields = this.getNode().fields;\n\t\tif (fields.size === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.siblingStack.push(this.siblings);\n\t\tthis.indexStack.push(this.index);\n\t\tthis.index = 0;\n\t\tthis.siblings = [...fields.keys()]; // TODO: avoid this copy\n\t\treturn true;\n\t}\n\n\tpublic seekNodes(offset: number): boolean {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\tconst atRoot = this.nestedCursor.atChunkRoot();\n\t\t\tconst stillIn = this.nestedCursor.seekNodes(offset);\n\t\t\tif (!atRoot) {\n\t\t\t\treturn stillIn;\n\t\t\t}\n\t\t\tif (!stillIn) {\n\t\t\t\tthis.nestedCursor = undefined;\n\t\t\t}\n\t\t}\n\t\tassert(\n\t\t\tthis.mode === CursorLocationType.Nodes,\n\t\t\t0x529 /* can only seekNodes when in Nodes */,\n\t\t);\n\t\tassert(this.indexOfChunk < this.siblings.length, 0x52a /* out of bounds indexOfChunk */);\n\n\t\tthis.indexWithinChunk += offset;\n\t\tif (offset >= 0) {\n\t\t\tconst chunks = (this.siblings as TreeChunk[]) ?? oob();\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\twhile (this.indexWithinChunk >= chunks[this.indexOfChunk]!.topLevelLength) {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tthis.indexWithinChunk -= chunks[this.indexOfChunk]!.topLevelLength;\n\t\t\t\tthis.indexOfChunk++;\n\t\t\t\tif (this.indexOfChunk === chunks.length) {\n\t\t\t\t\tthis.exitNode();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tassert(\n\t\t\t\t\tthis.indexOfChunk < this.siblings.length,\n\t\t\t\t\t0x52b /* out of bounds indexOfChunk */,\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tconst chunks = this.siblings as TreeChunk[];\n\t\t\twhile (this.indexWithinChunk < 0) {\n\t\t\t\tif (this.indexOfChunk === 0) {\n\t\t\t\t\tthis.exitNode();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tthis.indexOfChunk--;\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tthis.indexWithinChunk += chunks[this.indexOfChunk]!.topLevelLength;\n\t\t\t}\n\t\t}\n\n\t\tthis.index += offset;\n\t\tthis.initNestedCursor();\n\t\treturn true;\n\t}\n\n\tpublic firstNode(): boolean {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor.firstNode();\n\t\t}\n\t\tconst siblings = this.getField();\n\t\tif (siblings.length === 0) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.siblingStack.push(this.siblings);\n\t\tthis.indexStack.push(this.index);\n\t\tthis.indexOfChunkStack.push(this.indexOfChunk);\n\t\tthis.indexWithinChunkStack.push(this.indexWithinChunk);\n\t\tthis.index = 0;\n\t\tthis.siblings = siblings;\n\t\tthis.indexOfChunk = 0;\n\t\tthis.indexWithinChunk = 0;\n\t\tthis.initNestedCursor();\n\t\treturn true;\n\t}\n\n\tpublic nextNode(): boolean {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\tconst atRoot = this.nestedCursor.atChunkRoot();\n\t\t\tconst stillIn = this.nestedCursor.nextNode();\n\t\t\tif (!atRoot) {\n\t\t\t\treturn stillIn;\n\t\t\t}\n\t\t\tif (!stillIn) {\n\t\t\t\tthis.nestedCursor = undefined;\n\t\t\t}\n\t\t}\n\t\tassert(\n\t\t\tthis.mode === CursorLocationType.Nodes,\n\t\t\t0x52c /* can only nextNode when in Nodes */,\n\t\t);\n\t\tthis.indexWithinChunk++;\n\t\tif (\n\t\t\tthis.indexWithinChunk ===\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t(this.siblings as TreeChunk[])[this.indexOfChunk]!.topLevelLength\n\t\t) {\n\t\t\tthis.indexOfChunk++;\n\t\t\tif (this.indexOfChunk === (this.siblings as TreeChunk[]).length) {\n\t\t\t\tthis.exitNode();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tthis.indexWithinChunk = 0;\n\t\t\tthis.initNestedCursor();\n\t\t}\n\t\tthis.index++;\n\t\treturn true;\n\t}\n\n\tprivate initNestedCursor(): void {\n\t\tassert(\n\t\t\tthis.mode === CursorLocationType.Nodes,\n\t\t\t0x55d /* can only initNestedCursor when in Nodes */,\n\t\t);\n\t\tconst chunk = (this.siblings as TreeChunk[])[this.indexOfChunk] ?? oob();\n\t\tthis.nestedCursor = !(chunk instanceof BasicChunk) ? chunk.cursor() : undefined;\n\t\tthis.nestedCursor?.enterNode(this.indexWithinChunk);\n\t}\n\n\tpublic exitField(): void {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor.exitField();\n\t\t}\n\t\tassert(\n\t\t\tthis.mode === CursorLocationType.Fields,\n\t\t\t0x52d /* can only navigate up from field when in field */,\n\t\t);\n\t\tthis.siblings =\n\t\t\tthis.siblingStack.pop() ?? fail(0xaf0 /* Unexpected siblingStack.length */);\n\t\tthis.index = this.indexStack.pop() ?? fail(0xaf1 /* Unexpected indexStack.length */);\n\t}\n\n\tpublic exitNode(): void {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\tif (!this.nestedCursor.atChunkRoot()) {\n\t\t\t\treturn this.nestedCursor.exitNode();\n\t\t\t}\n\t\t\tthis.nestedCursor = undefined;\n\t\t}\n\t\tassert(\n\t\t\tthis.mode === CursorLocationType.Nodes,\n\t\t\t0x52e /* can only navigate up from node when in node */,\n\t\t);\n\t\tthis.siblings =\n\t\t\tthis.siblingStack.pop() ?? fail(0xaf2 /* Unexpected siblingStack.length */);\n\t\tthis.index = this.indexStack.pop() ?? fail(0xaf3 /* Unexpected indexStack.length */);\n\t\tthis.indexOfChunk =\n\t\t\tthis.indexOfChunkStack.pop() ?? fail(0xaf4 /* Unexpected indexOfChunkStack.length */);\n\t\tthis.indexWithinChunk =\n\t\t\tthis.indexWithinChunkStack.pop() ??\n\t\t\tfail(0xaf5 /* Unexpected indexWithinChunkStack.length */);\n\t}\n\n\tprivate getNode(): BasicChunk {\n\t\tassert(this.mode === CursorLocationType.Nodes, 0x52f /* can only get node when in node */);\n\t\treturn (this.siblings as TreeChunk[])[this.index] as BasicChunk;\n\t}\n\n\tprivate getField(): readonly TreeChunk[] {\n\t\tif (this.siblingStack.length === 0) {\n\t\t\treturn this.root;\n\t\t}\n\t\tassert(\n\t\t\tthis.mode === CursorLocationType.Fields,\n\t\t\t0x530 /* can only get field when in fields */,\n\t\t);\n\t\tconst parent = this.getStackedNode(this.indexStack.length - 1);\n\t\tconst key: FieldKey = this.getFieldKey();\n\t\tconst field = parent.fields.get(key) ?? [];\n\t\treturn field;\n\t}\n\n\tpublic get value(): Value {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor.value;\n\t\t}\n\t\treturn this.getNode().value;\n\t}\n\n\tpublic get type(): TreeType {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor.type;\n\t\t}\n\t\treturn this.getNode().type;\n\t}\n\n\tpublic get fieldIndex(): number {\n\t\tassert(\n\t\t\tthis.mode === CursorLocationType.Nodes,\n\t\t\t0x531 /* can only node's index when in node */,\n\t\t);\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\tif (this.nestedCursor.atChunkRoot()) {\n\t\t\t\t// TODO: this.index\n\t\t\t\treturn this.nestedCursor.fieldIndex + this.nestedOffset();\n\t\t\t}\n\t\t\treturn this.nestedCursor.fieldIndex;\n\t\t}\n\t\treturn this.index;\n\t}\n\n\t/**\n\t * Within the field that `nestedCursor` is nested in:\n\t * returns the index within that field of the first node that is part of the chunk nestedCursor traverses.\n\t */\n\tprivate nestedOffset(): number {\n\t\tassert(this.nestedCursor !== undefined, 0x55e /* nested offset requires nested cursor */);\n\t\tassert(\n\t\t\t!this.nestedCursor.atChunkRoot() ||\n\t\t\t\tthis.indexWithinChunk === this.nestedCursor.fieldIndex,\n\t\t\t0x55f /* indexes should match if at root */,\n\t\t);\n\t\treturn this.index - this.indexWithinChunk;\n\t}\n\n\tpublic get chunkStart(): number {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\tif (this.nestedCursor.atChunkRoot()) {\n\t\t\t\treturn this.nestedCursor.chunkStart + this.nestedOffset();\n\t\t\t}\n\t\t\treturn this.nestedCursor.chunkStart;\n\t\t}\n\t\treturn this.fieldIndex;\n\t}\n\n\tpublic get chunkLength(): number {\n\t\tif (this.nestedCursor !== undefined) {\n\t\t\treturn this.nestedCursor.chunkLength;\n\t\t}\n\t\treturn 1;\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"chunkTree.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/chunkTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAEN,KAAK,QAAQ,EACb,KAAK,sBAAsB,EAG3B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EAEjC,KAAK,KAAK,EAIV,KAAK,SAAS,EAEd,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,KAAK,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAElE,MAAM,WAAW,UAAU;IAC1B;;OAEG;IACH,OAAO,IAAI,IAAI,CAAC;CAChB;AACD;;GAEG;AACH,wBAAgB,eAAe,CAC9B,MAAM,EAAE,4BAA4B,EACpC,MAAM,EAAE,YAAY,EACpB,yBAAyB,EAAE,yBAAyB,GAClD,QAAQ,CAkBV;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAS,SAAQ,WAAW,EAAE,UAAU;IACxD,QAAQ,CAAC,MAAM,EAAE,4BAA4B,CAAC;IAC9C,KAAK,CAAC,MAAM,EAAE,4BAA4B,GAAG,QAAQ,CAAC;CACtD;AAED;;;;;;;;GAQG;AAEH,qBAAa,WAAW;CAAG;AAE3B;;;GAGG;AACH,eAAO,MAAM,WAAW,aAAoB,CAAC;AAE7C;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;AAEhD,qBAAa,OAAQ,YAA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,eAAO,MAAM,kBAAkB,EAAE,WAUhC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,WAKlC,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,2BAA2B,EAAE,MAAM,CAAC;IAE7C;;OAEG;IACH,QAAQ,CAAC,4BAA4B,EAAE,MAAM,CAAC;IAE9C;;OAEG;IACH,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IAEvC;;OAEG;IACH,eAAe,CAAC,MAAM,EAAE,wBAAwB,GAAG,SAAS,CAAC;CAC7D;AAED,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,EAAE,aAAa,GAAG,SAAS,CAAC;CACjD;AAkBD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACzB,MAAM,EAAE,sBAAsB,EAC9B,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,OAAO,GACzB,SAAS,EAAE,CAqGb;AACD;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAC3B,MAAM,EAAE,sBAAsB,EAC9B,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,KAAK,EAAE,EACf,YAAY,CAAC,EAAE,aAAa,GAC1B,IAAI,CA4BN;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACrC,MAAM,EAAE,sBAAsB,EAC9B,KAAK,EAAE,SAAS,EAChB,iBAAiB,EAAE,MAAM,EACzB,kBAAkB,EAAE,OAAO,EAC3B,YAAY,CAAC,EAAE,aAAa,GAC1B,YAAY,CAqBd"}
@@ -239,7 +239,10 @@ export const basicOnlyChunkPolicy = {
239
239
  shapeFromSchema: () => polymorphic,
240
240
  };
241
241
  function newBasicChunkTree(cursor, policy) {
242
- return new BasicChunk(cursor.type, new Map(mapCursorFields(cursor, () => [cursor.getFieldKey(), chunkField(cursor, policy)])), cursor.value);
242
+ return new BasicChunk(cursor.type, new Map(mapCursorFields(cursor, () => {
243
+ debugAssert(() => cursor.getFieldLength() > 0 || "field must have at least one child");
244
+ return [cursor.getFieldKey(), chunkField(cursor, policy)];
245
+ })), cursor.value);
243
246
  }
244
247
  /**
245
248
  * Chunk a portion of a field.