@fluidframework/tree 2.73.0 → 2.74.0-368706

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 (1294) hide show
  1. package/.vscode/settings.json +2 -2
  2. package/api-report/tree.alpha.api.md +133 -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 +7 -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/codecs.d.ts +2 -2
  62. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  63. package/dist/feature-libraries/chunked-forest/codec/codecs.js +1 -1
  64. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  65. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +15 -7
  66. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
  67. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
  68. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
  69. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  70. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +90 -42
  71. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  72. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +234 -69
  73. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  74. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +4 -4
  75. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  76. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +33 -28
  77. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  78. package/dist/feature-libraries/default-schema/index.d.ts +2 -1
  79. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  80. package/dist/feature-libraries/default-schema/index.js +4 -2
  81. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  82. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +36 -0
  83. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
  84. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js +126 -0
  85. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
  86. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +7 -6
  87. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  88. package/dist/feature-libraries/default-schema/mappedEditBuilder.js +15 -0
  89. package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  90. package/dist/feature-libraries/deltaUtils.d.ts +1 -0
  91. package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
  92. package/dist/feature-libraries/deltaUtils.js +6 -1
  93. package/dist/feature-libraries/deltaUtils.js.map +1 -1
  94. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
  95. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  96. package/dist/feature-libraries/detachedFieldIndexSummarizer.js +41 -11
  97. package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  98. package/dist/feature-libraries/flex-tree/context.d.ts +9 -0
  99. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  100. package/dist/feature-libraries/flex-tree/context.js +6 -0
  101. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  102. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  103. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  104. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  105. package/dist/feature-libraries/flex-tree/lazyField.d.ts +8 -7
  106. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  107. package/dist/feature-libraries/flex-tree/lazyField.js +37 -8
  108. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  109. package/dist/feature-libraries/forest-summary/codec.d.ts +2 -2
  110. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  111. package/dist/feature-libraries/forest-summary/codec.js +4 -4
  112. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  113. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +9 -13
  114. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  115. package/dist/feature-libraries/forest-summary/forestSummarizer.js +22 -27
  116. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  117. package/dist/feature-libraries/forest-summary/format.d.ts +41 -5
  118. package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
  119. package/dist/feature-libraries/forest-summary/format.js +7 -7
  120. package/dist/feature-libraries/forest-summary/format.js.map +1 -1
  121. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +11 -9
  122. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  123. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +16 -29
  124. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  125. package/dist/feature-libraries/forest-summary/index.d.ts +2 -1
  126. package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
  127. package/dist/feature-libraries/forest-summary/index.js +3 -2
  128. package/dist/feature-libraries/forest-summary/index.js.map +1 -1
  129. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts +47 -0
  130. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
  131. package/dist/feature-libraries/forest-summary/summaryTypes.js +57 -0
  132. package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
  133. package/dist/feature-libraries/index.d.ts +5 -5
  134. package/dist/feature-libraries/index.d.ts.map +1 -1
  135. package/dist/feature-libraries/index.js +7 -4
  136. package/dist/feature-libraries/index.js.map +1 -1
  137. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  138. package/dist/feature-libraries/mapTreeCursor.js +1 -0
  139. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  140. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  141. package/dist/feature-libraries/mitigatedChangeFamily.js +2 -2
  142. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  143. package/dist/feature-libraries/modular-schema/comparison.d.ts +18 -2
  144. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  145. package/dist/feature-libraries/modular-schema/comparison.js +54 -3
  146. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  147. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
  148. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  149. package/dist/feature-libraries/modular-schema/crossFieldQueries.js +4 -7
  150. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  151. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +20 -52
  152. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  153. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  154. package/dist/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
  155. package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  156. package/dist/feature-libraries/modular-schema/fieldKind.js +0 -21
  157. package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  158. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  159. package/dist/feature-libraries/modular-schema/genericFieldKind.js +7 -10
  160. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  161. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js +2 -2
  162. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  163. package/dist/feature-libraries/modular-schema/index.d.ts +5 -5
  164. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  165. package/dist/feature-libraries/modular-schema/index.js +12 -8
  166. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  167. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +17 -0
  168. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
  169. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +388 -0
  170. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
  171. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +17 -0
  172. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
  173. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +413 -0
  174. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
  175. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +4 -4
  176. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  177. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +8 -284
  178. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  179. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +48 -15
  180. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  181. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1298 -465
  182. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  183. package/dist/feature-libraries/modular-schema/{modularChangeFormat.d.ts → modularChangeFormatV1.d.ts} +2 -2
  184. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
  185. package/dist/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +5 -5
  186. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
  187. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +146 -0
  188. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
  189. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +32 -0
  190. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
  191. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +50 -10
  192. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  193. package/dist/feature-libraries/modular-schema/modularChangeTypes.js +24 -3
  194. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  195. package/dist/feature-libraries/optional-field/index.d.ts +2 -2
  196. package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
  197. package/dist/feature-libraries/optional-field/index.js +1 -2
  198. package/dist/feature-libraries/optional-field/index.js.map +1 -1
  199. package/dist/feature-libraries/optional-field/optionalField.d.ts +5 -26
  200. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  201. package/dist/feature-libraries/optional-field/optionalField.js +217 -451
  202. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  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/schema-index/schemaSummarizer.d.ts +27 -8
  211. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  212. package/dist/feature-libraries/schema-index/schemaSummarizer.js +42 -16
  213. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  214. package/dist/feature-libraries/sequence-field/compose.d.ts +6 -7
  215. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  216. package/dist/feature-libraries/sequence-field/compose.js +80 -256
  217. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  218. package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  219. package/dist/feature-libraries/sequence-field/formatV2.js +1 -0
  220. package/dist/feature-libraries/sequence-field/formatV2.js.map +1 -1
  221. package/dist/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
  222. package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  223. package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  224. package/dist/feature-libraries/sequence-field/index.d.ts +2 -3
  225. package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
  226. package/dist/feature-libraries/sequence-field/index.js +1 -3
  227. package/dist/feature-libraries/sequence-field/index.js.map +1 -1
  228. package/dist/feature-libraries/sequence-field/invert.d.ts +3 -3
  229. package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  230. package/dist/feature-libraries/sequence-field/invert.js +65 -167
  231. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  232. package/dist/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  233. package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  234. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  235. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
  236. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  237. package/dist/feature-libraries/sequence-field/moveEffectTable.js +7 -86
  238. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  239. package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -3
  240. package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  241. package/dist/feature-libraries/sequence-field/rebase.js +106 -112
  242. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  243. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  244. package/dist/feature-libraries/sequence-field/replaceRevisions.js +16 -33
  245. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  246. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  247. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +0 -2
  248. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  249. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
  250. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  251. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +358 -179
  252. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  253. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  254. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +20 -60
  255. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  256. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  257. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  258. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
  259. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  260. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
  261. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  262. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +14 -109
  263. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  264. package/dist/feature-libraries/sequence-field/types.d.ts +30 -59
  265. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  266. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  267. package/dist/feature-libraries/sequence-field/utils.d.ts +15 -24
  268. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  269. package/dist/feature-libraries/sequence-field/utils.js +111 -299
  270. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  271. package/dist/feature-libraries/treeCompressionUtils.d.ts +2 -12
  272. package/dist/feature-libraries/treeCompressionUtils.d.ts.map +1 -1
  273. package/dist/feature-libraries/treeCompressionUtils.js +4 -14
  274. package/dist/feature-libraries/treeCompressionUtils.js.map +1 -1
  275. package/dist/index.d.ts +3 -3
  276. package/dist/index.d.ts.map +1 -1
  277. package/dist/index.js +6 -3
  278. package/dist/index.js.map +1 -1
  279. package/dist/packageVersion.d.ts +1 -1
  280. package/dist/packageVersion.d.ts.map +1 -1
  281. package/dist/packageVersion.js +1 -1
  282. package/dist/packageVersion.js.map +1 -1
  283. package/dist/shared-tree/independentView.d.ts +1 -1
  284. package/dist/shared-tree/independentView.d.ts.map +1 -1
  285. package/dist/shared-tree/independentView.js.map +1 -1
  286. package/dist/shared-tree/index.d.ts +1 -1
  287. package/dist/shared-tree/index.d.ts.map +1 -1
  288. package/dist/shared-tree/index.js.map +1 -1
  289. package/dist/shared-tree/schematizeTree.d.ts +4 -4
  290. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  291. package/dist/shared-tree/schematizeTree.js +2 -1
  292. package/dist/shared-tree/schematizeTree.js.map +1 -1
  293. package/dist/shared-tree/schematizingTreeView.d.ts +1 -5
  294. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  295. package/dist/shared-tree/schematizingTreeView.js +32 -33
  296. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  297. package/dist/shared-tree/sharedTree.d.ts +18 -15
  298. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  299. package/dist/shared-tree/sharedTree.js +15 -4
  300. package/dist/shared-tree/sharedTree.js.map +1 -1
  301. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  302. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  303. package/dist/shared-tree/sharedTreeChangeCodecs.js +1 -0
  304. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  305. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
  306. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  307. package/dist/shared-tree/sharedTreeChangeEnricher.js +25 -11
  308. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  309. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +6 -6
  310. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  311. package/dist/shared-tree/sharedTreeChangeFamily.js +2 -2
  312. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  313. package/dist/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
  314. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  315. package/dist/shared-tree/sharedTreeEditBuilder.js +13 -6
  316. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  317. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  318. package/dist/shared-tree/treeAlpha.js +1 -1
  319. package/dist/shared-tree/treeAlpha.js.map +1 -1
  320. package/dist/shared-tree/treeCheckout.d.ts +14 -12
  321. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  322. package/dist/shared-tree/treeCheckout.js +66 -17
  323. package/dist/shared-tree/treeCheckout.js.map +1 -1
  324. package/dist/shared-tree-core/branch.d.ts +3 -2
  325. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  326. package/dist/shared-tree-core/branch.js +4 -3
  327. package/dist/shared-tree-core/branch.js.map +1 -1
  328. package/dist/shared-tree-core/editManager.d.ts +2 -2
  329. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  330. package/dist/shared-tree-core/editManager.js +9 -9
  331. package/dist/shared-tree-core/editManager.js.map +1 -1
  332. package/dist/shared-tree-core/editManagerCodecs.d.ts +4 -0
  333. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  334. package/dist/shared-tree-core/editManagerCodecs.js +16 -6
  335. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  336. package/{lib/shared-tree-core/editManagerCodecsV5.d.ts → dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
  337. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
  338. package/dist/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +7 -7
  339. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
  340. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +20 -6
  341. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  342. package/dist/shared-tree-core/editManagerFormatCommons.js +22 -7
  343. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  344. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  345. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  346. package/dist/shared-tree-core/editManagerFormatV1toV4.js +1 -0
  347. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  348. package/dist/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
  349. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
  350. package/dist/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
  351. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
  352. package/dist/shared-tree-core/editManagerSummarizer.d.ts +29 -9
  353. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  354. package/dist/shared-tree-core/editManagerSummarizer.js +41 -13
  355. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  356. package/dist/shared-tree-core/index.d.ts +5 -3
  357. package/dist/shared-tree-core/index.d.ts.map +1 -1
  358. package/dist/shared-tree-core/index.js +8 -1
  359. package/dist/shared-tree-core/index.js.map +1 -1
  360. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  361. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  362. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  363. package/{lib/shared-tree-core/messageCodecV5.d.ts → dist/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
  364. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
  365. package/dist/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +6 -6
  366. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
  367. package/dist/shared-tree-core/messageCodecs.d.ts +4 -0
  368. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  369. package/dist/shared-tree-core/messageCodecs.js +16 -6
  370. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  371. package/dist/shared-tree-core/messageFormat.d.ts +20 -6
  372. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  373. package/dist/shared-tree-core/messageFormat.js +22 -7
  374. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  375. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
  376. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  377. package/dist/shared-tree-core/messageFormatV1ToV4.js +8 -1
  378. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  379. package/dist/shared-tree-core/{messageFormatV5.d.ts → messageFormatVSharedBranches.d.ts} +5 -7
  380. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
  381. package/dist/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
  382. package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
  383. package/dist/shared-tree-core/sharedTreeCore.d.ts +14 -47
  384. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  385. package/dist/shared-tree-core/sharedTreeCore.js +30 -18
  386. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  387. package/dist/shared-tree-core/summaryTypes.d.ts +94 -0
  388. package/dist/shared-tree-core/summaryTypes.d.ts.map +1 -0
  389. package/dist/shared-tree-core/summaryTypes.js +47 -0
  390. package/dist/shared-tree-core/summaryTypes.js.map +1 -0
  391. package/dist/shared-tree-core/versionedSummarizer.d.ts +67 -0
  392. package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
  393. package/dist/shared-tree-core/versionedSummarizer.js +63 -0
  394. package/dist/shared-tree-core/versionedSummarizer.js.map +1 -0
  395. package/dist/simple-tree/api/configuration.d.ts +3 -26
  396. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  397. package/dist/simple-tree/api/configuration.js +10 -21
  398. package/dist/simple-tree/api/configuration.js.map +1 -1
  399. package/dist/simple-tree/api/dirtyIndex.d.ts +11 -0
  400. package/dist/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  401. package/dist/simple-tree/api/dirtyIndex.js +7 -0
  402. package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
  403. package/dist/simple-tree/api/discrepancies.d.ts +1 -1
  404. package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
  405. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  406. package/dist/simple-tree/api/getSimpleSchema.d.ts +3 -3
  407. package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  408. package/dist/simple-tree/api/getSimpleSchema.js +9 -3
  409. package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
  410. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +16 -13
  411. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  412. package/dist/simple-tree/api/incrementalAllowedTypes.js +24 -14
  413. package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  414. package/dist/simple-tree/api/index.d.ts +4 -5
  415. package/dist/simple-tree/api/index.d.ts.map +1 -1
  416. package/dist/simple-tree/api/index.js +5 -6
  417. package/dist/simple-tree/api/index.js.map +1 -1
  418. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  419. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  420. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  421. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
  422. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  423. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  424. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  425. package/dist/simple-tree/api/schemaFactoryRecursive.js +0 -1
  426. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  427. package/dist/simple-tree/api/schemaFromSimple.d.ts +6 -1
  428. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  429. package/dist/simple-tree/api/schemaFromSimple.js +5 -0
  430. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  431. package/dist/simple-tree/api/schemaStatics.d.ts +12 -12
  432. package/dist/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
  433. package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  434. package/dist/simple-tree/api/simpleSchemaCodec.js +18 -6
  435. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  436. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  437. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  438. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  439. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
  440. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  441. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +13 -8
  442. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  443. package/dist/simple-tree/api/tree.d.ts +1 -1
  444. package/dist/simple-tree/api/tree.js.map +1 -1
  445. package/dist/simple-tree/api/typesUnsafe.d.ts +3 -3
  446. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  447. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  448. package/dist/simple-tree/core/allowedTypes.d.ts +2 -2
  449. package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
  450. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  451. package/dist/simple-tree/core/index.d.ts +1 -1
  452. package/dist/simple-tree/core/index.d.ts.map +1 -1
  453. package/dist/simple-tree/core/index.js +2 -3
  454. package/dist/simple-tree/core/index.js.map +1 -1
  455. package/dist/simple-tree/core/toStored.d.ts +17 -15
  456. package/dist/simple-tree/core/toStored.d.ts.map +1 -1
  457. package/dist/simple-tree/core/toStored.js +5 -40
  458. package/dist/simple-tree/core/toStored.js.map +1 -1
  459. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  460. package/dist/simple-tree/core/treeNodeKernel.js +1 -0
  461. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  462. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
  463. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  464. package/dist/simple-tree/core/unhydratedFlexTree.js +59 -8
  465. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  466. package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
  467. package/dist/simple-tree/core/walkSchema.js +4 -0
  468. package/dist/simple-tree/core/walkSchema.js.map +1 -1
  469. package/dist/simple-tree/createContext.d.ts.map +1 -1
  470. package/dist/simple-tree/createContext.js +20 -5
  471. package/dist/simple-tree/createContext.js.map +1 -1
  472. package/dist/simple-tree/fieldSchema.d.ts +7 -7
  473. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  474. package/dist/simple-tree/fieldSchema.js.map +1 -1
  475. package/dist/simple-tree/index.d.ts +8 -7
  476. package/dist/simple-tree/index.d.ts.map +1 -1
  477. package/dist/simple-tree/index.js +16 -13
  478. package/dist/simple-tree/index.js.map +1 -1
  479. package/dist/simple-tree/leafNodeSchema.d.ts +5 -5
  480. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  481. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  482. package/dist/simple-tree/node-kinds/array/arrayNode.js +6 -3
  483. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  484. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
  485. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  486. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  487. package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
  488. package/dist/simple-tree/node-kinds/common.js +1 -1
  489. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  490. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  491. package/dist/simple-tree/node-kinds/map/mapNode.js +2 -2
  492. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  493. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
  494. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  495. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  496. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  497. package/dist/simple-tree/node-kinds/object/objectNode.js +19 -18
  498. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  499. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
  500. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  501. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  502. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  503. package/dist/simple-tree/node-kinds/record/recordNode.js +4 -2
  504. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  505. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
  506. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  507. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  508. package/dist/simple-tree/prepareForInsertion.d.ts +54 -47
  509. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  510. package/dist/simple-tree/prepareForInsertion.js +183 -125
  511. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  512. package/dist/simple-tree/simpleSchema.d.ts +55 -23
  513. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  514. package/dist/simple-tree/simpleSchema.js +17 -0
  515. package/dist/simple-tree/simpleSchema.js.map +1 -1
  516. package/dist/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
  517. package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
  518. package/dist/simple-tree/simpleSchemaFormatV1.js +8 -1
  519. package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  520. package/dist/simple-tree/toStoredSchema.d.ts +58 -11
  521. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  522. package/dist/simple-tree/toStoredSchema.js +205 -30
  523. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  524. package/dist/simple-tree/treeSchema.d.ts +23 -0
  525. package/dist/simple-tree/treeSchema.d.ts.map +1 -0
  526. package/dist/simple-tree/treeSchema.js +25 -0
  527. package/dist/simple-tree/treeSchema.js.map +1 -0
  528. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
  529. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  530. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +29 -11
  531. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  532. package/dist/tableSchema.d.ts +117 -63
  533. package/dist/tableSchema.d.ts.map +1 -1
  534. package/dist/tableSchema.js +159 -58
  535. package/dist/tableSchema.js.map +1 -1
  536. package/dist/treeFactory.d.ts +5 -0
  537. package/dist/treeFactory.d.ts.map +1 -1
  538. package/dist/treeFactory.js +29 -8
  539. package/dist/treeFactory.js.map +1 -1
  540. package/dist/util/breakable.js +3 -3
  541. package/dist/util/breakable.js.map +1 -1
  542. package/dist/util/index.d.ts +2 -1
  543. package/dist/util/index.d.ts.map +1 -1
  544. package/dist/util/index.js +4 -1
  545. package/dist/util/index.js.map +1 -1
  546. package/dist/util/rangeMap.d.ts +24 -12
  547. package/dist/util/rangeMap.d.ts.map +1 -1
  548. package/dist/util/rangeMap.js +46 -6
  549. package/dist/util/rangeMap.js.map +1 -1
  550. package/dist/util/readSnapshotBlob.d.ts +13 -0
  551. package/dist/util/readSnapshotBlob.d.ts.map +1 -0
  552. package/dist/util/readSnapshotBlob.js +18 -0
  553. package/dist/util/readSnapshotBlob.js.map +1 -0
  554. package/dist/util/typeCheckTests.d.ts.map +1 -1
  555. package/dist/util/typeCheckTests.js.map +1 -1
  556. package/lib/alpha.d.ts +7 -2
  557. package/lib/codec/codec.d.ts +14 -1
  558. package/lib/codec/codec.d.ts.map +1 -1
  559. package/lib/codec/codec.js +11 -0
  560. package/lib/codec/codec.js.map +1 -1
  561. package/lib/codec/versioned/codec.d.ts +1 -1
  562. package/lib/codec/versioned/codec.d.ts.map +1 -1
  563. package/lib/codec/versioned/codec.js.map +1 -1
  564. package/lib/codec/versioned/format.d.ts +4 -1
  565. package/lib/codec/versioned/format.d.ts.map +1 -1
  566. package/lib/codec/versioned/format.js +4 -1
  567. package/lib/codec/versioned/format.js.map +1 -1
  568. package/lib/core/change-family/changeFamily.d.ts +4 -1
  569. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  570. package/lib/core/change-family/changeFamily.js.map +1 -1
  571. package/lib/core/change-family/index.d.ts +1 -1
  572. package/lib/core/change-family/index.d.ts.map +1 -1
  573. package/lib/core/change-family/index.js.map +1 -1
  574. package/lib/core/index.d.ts +3 -3
  575. package/lib/core/index.d.ts.map +1 -1
  576. package/lib/core/index.js +2 -2
  577. package/lib/core/index.js.map +1 -1
  578. package/lib/core/rebase/changeRebaser.d.ts +6 -1
  579. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  580. package/lib/core/rebase/changeRebaser.js.map +1 -1
  581. package/lib/core/rebase/index.d.ts +1 -1
  582. package/lib/core/rebase/index.d.ts.map +1 -1
  583. package/lib/core/rebase/index.js +1 -1
  584. package/lib/core/rebase/index.js.map +1 -1
  585. package/lib/core/rebase/types.d.ts +2 -1
  586. package/lib/core/rebase/types.d.ts.map +1 -1
  587. package/lib/core/rebase/types.js +3 -0
  588. package/lib/core/rebase/types.js.map +1 -1
  589. package/lib/core/rebase/utils.d.ts.map +1 -1
  590. package/lib/core/rebase/utils.js +25 -7
  591. package/lib/core/rebase/utils.js.map +1 -1
  592. package/lib/core/tree/detachedFieldIndex.d.ts +40 -13
  593. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  594. package/lib/core/tree/detachedFieldIndex.js +22 -13
  595. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  596. package/lib/core/tree/index.d.ts +4 -3
  597. package/lib/core/tree/index.d.ts.map +1 -1
  598. package/lib/core/tree/index.js +3 -2
  599. package/lib/core/tree/index.js.map +1 -1
  600. package/lib/core/tree/pathTree.d.ts +11 -3
  601. package/lib/core/tree/pathTree.d.ts.map +1 -1
  602. package/lib/core/tree/pathTree.js +12 -1
  603. package/lib/core/tree/pathTree.js.map +1 -1
  604. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  605. package/lib/feature-libraries/chunked-forest/basicChunk.js +8 -1
  606. package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  607. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  608. package/lib/feature-libraries/chunked-forest/chunkTree.js +4 -1
  609. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  610. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +2 -2
  611. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  612. package/lib/feature-libraries/chunked-forest/codec/codecs.js +2 -2
  613. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  614. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +15 -7
  615. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
  616. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
  617. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
  618. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  619. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +90 -42
  620. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  621. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +232 -69
  622. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  623. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +4 -4
  624. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  625. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +34 -29
  626. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  627. package/lib/feature-libraries/default-schema/index.d.ts +2 -1
  628. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  629. package/lib/feature-libraries/default-schema/index.js +2 -1
  630. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  631. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +36 -0
  632. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
  633. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js +122 -0
  634. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
  635. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +7 -6
  636. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  637. package/lib/feature-libraries/default-schema/mappedEditBuilder.js +15 -0
  638. package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  639. package/lib/feature-libraries/deltaUtils.d.ts +1 -0
  640. package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
  641. package/lib/feature-libraries/deltaUtils.js +5 -1
  642. package/lib/feature-libraries/deltaUtils.js.map +1 -1
  643. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
  644. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  645. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +38 -8
  646. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  647. package/lib/feature-libraries/flex-tree/context.d.ts +9 -0
  648. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  649. package/lib/feature-libraries/flex-tree/context.js +6 -0
  650. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  651. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  652. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  653. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  654. package/lib/feature-libraries/flex-tree/lazyField.d.ts +8 -7
  655. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  656. package/lib/feature-libraries/flex-tree/lazyField.js +38 -9
  657. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  658. package/lib/feature-libraries/forest-summary/codec.d.ts +2 -2
  659. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  660. package/lib/feature-libraries/forest-summary/codec.js +5 -5
  661. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  662. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +9 -13
  663. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  664. package/lib/feature-libraries/forest-summary/forestSummarizer.js +19 -24
  665. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  666. package/lib/feature-libraries/forest-summary/format.d.ts +41 -5
  667. package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
  668. package/lib/feature-libraries/forest-summary/format.js +3 -3
  669. package/lib/feature-libraries/forest-summary/format.js.map +1 -1
  670. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +11 -9
  671. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  672. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +13 -26
  673. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  674. package/lib/feature-libraries/forest-summary/index.d.ts +2 -1
  675. package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
  676. package/lib/feature-libraries/forest-summary/index.js +2 -1
  677. package/lib/feature-libraries/forest-summary/index.js.map +1 -1
  678. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts +47 -0
  679. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
  680. package/lib/feature-libraries/forest-summary/summaryTypes.js +53 -0
  681. package/lib/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
  682. package/lib/feature-libraries/index.d.ts +5 -5
  683. package/lib/feature-libraries/index.d.ts.map +1 -1
  684. package/lib/feature-libraries/index.js +4 -4
  685. package/lib/feature-libraries/index.js.map +1 -1
  686. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  687. package/lib/feature-libraries/mapTreeCursor.js +2 -1
  688. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  689. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  690. package/lib/feature-libraries/mitigatedChangeFamily.js +2 -2
  691. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  692. package/lib/feature-libraries/modular-schema/comparison.d.ts +18 -2
  693. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  694. package/lib/feature-libraries/modular-schema/comparison.js +55 -5
  695. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  696. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
  697. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  698. package/lib/feature-libraries/modular-schema/crossFieldQueries.js +3 -5
  699. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  700. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +20 -52
  701. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  702. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  703. package/lib/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
  704. package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  705. package/lib/feature-libraries/modular-schema/fieldKind.js +0 -21
  706. package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  707. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  708. package/lib/feature-libraries/modular-schema/genericFieldKind.js +7 -10
  709. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  710. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js +1 -1
  711. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  712. package/lib/feature-libraries/modular-schema/index.d.ts +5 -5
  713. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  714. package/lib/feature-libraries/modular-schema/index.js +4 -3
  715. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  716. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +17 -0
  717. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
  718. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +384 -0
  719. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
  720. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +17 -0
  721. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
  722. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +409 -0
  723. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
  724. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +4 -4
  725. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  726. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +10 -286
  727. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  728. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +48 -15
  729. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  730. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1284 -458
  731. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  732. package/lib/feature-libraries/modular-schema/{modularChangeFormat.d.ts → modularChangeFormatV1.d.ts} +2 -2
  733. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
  734. package/lib/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +2 -2
  735. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
  736. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +146 -0
  737. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
  738. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +29 -0
  739. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
  740. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +50 -10
  741. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  742. package/lib/feature-libraries/modular-schema/modularChangeTypes.js +20 -2
  743. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  744. package/lib/feature-libraries/optional-field/index.d.ts +2 -2
  745. package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
  746. package/lib/feature-libraries/optional-field/index.js +1 -1
  747. package/lib/feature-libraries/optional-field/index.js.map +1 -1
  748. package/lib/feature-libraries/optional-field/optionalField.d.ts +5 -26
  749. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  750. package/lib/feature-libraries/optional-field/optionalField.js +217 -449
  751. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  752. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
  753. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  754. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  755. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  756. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  757. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +55 -26
  758. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  759. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
  760. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  761. package/lib/feature-libraries/schema-index/schemaSummarizer.js +38 -12
  762. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  763. package/lib/feature-libraries/sequence-field/compose.d.ts +6 -7
  764. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  765. package/lib/feature-libraries/sequence-field/compose.js +82 -258
  766. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  767. package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  768. package/lib/feature-libraries/sequence-field/formatV2.js +1 -0
  769. package/lib/feature-libraries/sequence-field/formatV2.js.map +1 -1
  770. package/lib/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
  771. package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  772. package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  773. package/lib/feature-libraries/sequence-field/index.d.ts +2 -3
  774. package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
  775. package/lib/feature-libraries/sequence-field/index.js +0 -1
  776. package/lib/feature-libraries/sequence-field/index.js.map +1 -1
  777. package/lib/feature-libraries/sequence-field/invert.d.ts +3 -3
  778. package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  779. package/lib/feature-libraries/sequence-field/invert.js +67 -169
  780. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  781. package/lib/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  782. package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  783. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  784. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
  785. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  786. package/lib/feature-libraries/sequence-field/moveEffectTable.js +6 -80
  787. package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  788. package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -3
  789. package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  790. package/lib/feature-libraries/sequence-field/rebase.js +108 -114
  791. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  792. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  793. package/lib/feature-libraries/sequence-field/replaceRevisions.js +16 -33
  794. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  795. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  796. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +0 -2
  797. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  798. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
  799. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  800. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +350 -175
  801. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  802. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  803. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +21 -61
  804. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  805. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  806. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  807. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
  808. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  809. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
  810. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  811. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +14 -109
  812. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  813. package/lib/feature-libraries/sequence-field/types.d.ts +30 -59
  814. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  815. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  816. package/lib/feature-libraries/sequence-field/utils.d.ts +15 -24
  817. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  818. package/lib/feature-libraries/sequence-field/utils.js +107 -292
  819. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  820. package/lib/feature-libraries/treeCompressionUtils.d.ts +2 -12
  821. package/lib/feature-libraries/treeCompressionUtils.d.ts.map +1 -1
  822. package/lib/feature-libraries/treeCompressionUtils.js +3 -13
  823. package/lib/feature-libraries/treeCompressionUtils.js.map +1 -1
  824. package/lib/index.d.ts +3 -3
  825. package/lib/index.d.ts.map +1 -1
  826. package/lib/index.js +2 -2
  827. package/lib/index.js.map +1 -1
  828. package/lib/packageVersion.d.ts +1 -1
  829. package/lib/packageVersion.d.ts.map +1 -1
  830. package/lib/packageVersion.js +1 -1
  831. package/lib/packageVersion.js.map +1 -1
  832. package/lib/shared-tree/independentView.d.ts +1 -1
  833. package/lib/shared-tree/independentView.d.ts.map +1 -1
  834. package/lib/shared-tree/independentView.js.map +1 -1
  835. package/lib/shared-tree/index.d.ts +1 -1
  836. package/lib/shared-tree/index.d.ts.map +1 -1
  837. package/lib/shared-tree/index.js.map +1 -1
  838. package/lib/shared-tree/schematizeTree.d.ts +4 -4
  839. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  840. package/lib/shared-tree/schematizeTree.js +3 -2
  841. package/lib/shared-tree/schematizeTree.js.map +1 -1
  842. package/lib/shared-tree/schematizingTreeView.d.ts +1 -5
  843. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  844. package/lib/shared-tree/schematizingTreeView.js +35 -36
  845. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  846. package/lib/shared-tree/sharedTree.d.ts +18 -15
  847. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  848. package/lib/shared-tree/sharedTree.js +15 -4
  849. package/lib/shared-tree/sharedTree.js.map +1 -1
  850. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  851. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  852. package/lib/shared-tree/sharedTreeChangeCodecs.js +1 -0
  853. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  854. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
  855. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  856. package/lib/shared-tree/sharedTreeChangeEnricher.js +25 -11
  857. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  858. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +6 -6
  859. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  860. package/lib/shared-tree/sharedTreeChangeFamily.js +3 -3
  861. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  862. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
  863. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  864. package/lib/shared-tree/sharedTreeEditBuilder.js +11 -5
  865. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  866. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  867. package/lib/shared-tree/treeAlpha.js +2 -2
  868. package/lib/shared-tree/treeAlpha.js.map +1 -1
  869. package/lib/shared-tree/treeCheckout.d.ts +14 -12
  870. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  871. package/lib/shared-tree/treeCheckout.js +69 -20
  872. package/lib/shared-tree/treeCheckout.js.map +1 -1
  873. package/lib/shared-tree-core/branch.d.ts +3 -2
  874. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  875. package/lib/shared-tree-core/branch.js +4 -3
  876. package/lib/shared-tree-core/branch.js.map +1 -1
  877. package/lib/shared-tree-core/editManager.d.ts +2 -2
  878. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  879. package/lib/shared-tree-core/editManager.js +9 -9
  880. package/lib/shared-tree-core/editManager.js.map +1 -1
  881. package/lib/shared-tree-core/editManagerCodecs.d.ts +4 -0
  882. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  883. package/lib/shared-tree-core/editManagerCodecs.js +14 -5
  884. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  885. package/{dist/shared-tree-core/editManagerCodecsV5.d.ts → lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
  886. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
  887. package/lib/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +4 -4
  888. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
  889. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +20 -6
  890. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  891. package/lib/shared-tree-core/editManagerFormatCommons.js +22 -7
  892. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  893. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  894. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  895. package/lib/shared-tree-core/editManagerFormatV1toV4.js +1 -0
  896. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  897. package/lib/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
  898. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
  899. package/lib/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
  900. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
  901. package/lib/shared-tree-core/editManagerSummarizer.d.ts +29 -9
  902. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  903. package/lib/shared-tree-core/editManagerSummarizer.js +39 -11
  904. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  905. package/lib/shared-tree-core/index.d.ts +5 -3
  906. package/lib/shared-tree-core/index.d.ts.map +1 -1
  907. package/lib/shared-tree-core/index.js +4 -2
  908. package/lib/shared-tree-core/index.js.map +1 -1
  909. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  910. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  911. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  912. package/{dist/shared-tree-core/messageCodecV5.d.ts → lib/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
  913. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
  914. package/lib/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +3 -3
  915. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
  916. package/lib/shared-tree-core/messageCodecs.d.ts +4 -0
  917. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  918. package/lib/shared-tree-core/messageCodecs.js +14 -5
  919. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  920. package/lib/shared-tree-core/messageFormat.d.ts +20 -6
  921. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  922. package/lib/shared-tree-core/messageFormat.js +22 -7
  923. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  924. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
  925. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  926. package/lib/shared-tree-core/messageFormatV1ToV4.js +8 -1
  927. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  928. package/lib/shared-tree-core/{messageFormatV5.d.ts → messageFormatVSharedBranches.d.ts} +5 -7
  929. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
  930. package/lib/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
  931. package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
  932. package/lib/shared-tree-core/sharedTreeCore.d.ts +14 -47
  933. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  934. package/lib/shared-tree-core/sharedTreeCore.js +28 -16
  935. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  936. package/lib/shared-tree-core/summaryTypes.d.ts +94 -0
  937. package/lib/shared-tree-core/summaryTypes.d.ts.map +1 -0
  938. package/lib/shared-tree-core/summaryTypes.js +43 -0
  939. package/lib/shared-tree-core/summaryTypes.js.map +1 -0
  940. package/lib/shared-tree-core/versionedSummarizer.d.ts +67 -0
  941. package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
  942. package/lib/shared-tree-core/versionedSummarizer.js +59 -0
  943. package/lib/shared-tree-core/versionedSummarizer.js.map +1 -0
  944. package/lib/simple-tree/api/configuration.d.ts +3 -26
  945. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  946. package/lib/simple-tree/api/configuration.js +14 -25
  947. package/lib/simple-tree/api/configuration.js.map +1 -1
  948. package/lib/simple-tree/api/dirtyIndex.d.ts +11 -0
  949. package/lib/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  950. package/lib/simple-tree/api/dirtyIndex.js +7 -0
  951. package/lib/simple-tree/api/dirtyIndex.js.map +1 -1
  952. package/lib/simple-tree/api/discrepancies.d.ts +1 -1
  953. package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
  954. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  955. package/lib/simple-tree/api/getSimpleSchema.d.ts +3 -3
  956. package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  957. package/lib/simple-tree/api/getSimpleSchema.js +9 -3
  958. package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
  959. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +16 -13
  960. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  961. package/lib/simple-tree/api/incrementalAllowedTypes.js +23 -13
  962. package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  963. package/lib/simple-tree/api/index.d.ts +4 -5
  964. package/lib/simple-tree/api/index.d.ts.map +1 -1
  965. package/lib/simple-tree/api/index.js +3 -4
  966. package/lib/simple-tree/api/index.js.map +1 -1
  967. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  968. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  969. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  970. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
  971. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  972. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  973. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  974. package/lib/simple-tree/api/schemaFactoryRecursive.js +0 -1
  975. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  976. package/lib/simple-tree/api/schemaFromSimple.d.ts +6 -1
  977. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  978. package/lib/simple-tree/api/schemaFromSimple.js +5 -0
  979. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  980. package/lib/simple-tree/api/schemaStatics.d.ts +12 -12
  981. package/lib/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
  982. package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  983. package/lib/simple-tree/api/simpleSchemaCodec.js +15 -3
  984. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  985. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  986. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  987. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  988. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
  989. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  990. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +15 -10
  991. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  992. package/lib/simple-tree/api/tree.d.ts +1 -1
  993. package/lib/simple-tree/api/tree.js.map +1 -1
  994. package/lib/simple-tree/api/typesUnsafe.d.ts +3 -3
  995. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  996. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  997. package/lib/simple-tree/core/allowedTypes.d.ts +2 -2
  998. package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
  999. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  1000. package/lib/simple-tree/core/index.d.ts +1 -1
  1001. package/lib/simple-tree/core/index.d.ts.map +1 -1
  1002. package/lib/simple-tree/core/index.js +1 -1
  1003. package/lib/simple-tree/core/index.js.map +1 -1
  1004. package/lib/simple-tree/core/toStored.d.ts +17 -15
  1005. package/lib/simple-tree/core/toStored.d.ts.map +1 -1
  1006. package/lib/simple-tree/core/toStored.js +4 -37
  1007. package/lib/simple-tree/core/toStored.js.map +1 -1
  1008. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  1009. package/lib/simple-tree/core/treeNodeKernel.js +1 -0
  1010. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  1011. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
  1012. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  1013. package/lib/simple-tree/core/unhydratedFlexTree.js +58 -8
  1014. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  1015. package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
  1016. package/lib/simple-tree/core/walkSchema.js +5 -1
  1017. package/lib/simple-tree/core/walkSchema.js.map +1 -1
  1018. package/lib/simple-tree/createContext.d.ts.map +1 -1
  1019. package/lib/simple-tree/createContext.js +20 -5
  1020. package/lib/simple-tree/createContext.js.map +1 -1
  1021. package/lib/simple-tree/fieldSchema.d.ts +7 -7
  1022. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  1023. package/lib/simple-tree/fieldSchema.js.map +1 -1
  1024. package/lib/simple-tree/index.d.ts +8 -7
  1025. package/lib/simple-tree/index.d.ts.map +1 -1
  1026. package/lib/simple-tree/index.js +6 -5
  1027. package/lib/simple-tree/index.js.map +1 -1
  1028. package/lib/simple-tree/leafNodeSchema.d.ts +5 -5
  1029. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  1030. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  1031. package/lib/simple-tree/node-kinds/array/arrayNode.js +7 -4
  1032. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  1033. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
  1034. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  1035. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  1036. package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
  1037. package/lib/simple-tree/node-kinds/common.js +2 -2
  1038. package/lib/simple-tree/node-kinds/common.js.map +1 -1
  1039. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  1040. package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
  1041. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  1042. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
  1043. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  1044. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  1045. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  1046. package/lib/simple-tree/node-kinds/object/objectNode.js +20 -19
  1047. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  1048. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
  1049. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  1050. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  1051. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  1052. package/lib/simple-tree/node-kinds/record/recordNode.js +4 -2
  1053. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  1054. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
  1055. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  1056. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  1057. package/lib/simple-tree/prepareForInsertion.d.ts +54 -47
  1058. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  1059. package/lib/simple-tree/prepareForInsertion.js +183 -124
  1060. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  1061. package/lib/simple-tree/simpleSchema.d.ts +55 -23
  1062. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  1063. package/lib/simple-tree/simpleSchema.js +16 -1
  1064. package/lib/simple-tree/simpleSchema.js.map +1 -1
  1065. package/lib/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
  1066. package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
  1067. package/lib/simple-tree/simpleSchemaFormatV1.js +8 -1
  1068. package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  1069. package/lib/simple-tree/toStoredSchema.d.ts +58 -11
  1070. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  1071. package/lib/simple-tree/toStoredSchema.js +204 -31
  1072. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  1073. package/lib/simple-tree/treeSchema.d.ts +23 -0
  1074. package/lib/simple-tree/treeSchema.d.ts.map +1 -0
  1075. package/lib/simple-tree/treeSchema.js +21 -0
  1076. package/lib/simple-tree/treeSchema.js.map +1 -0
  1077. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
  1078. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  1079. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +26 -9
  1080. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  1081. package/lib/tableSchema.d.ts +117 -63
  1082. package/lib/tableSchema.d.ts.map +1 -1
  1083. package/lib/tableSchema.js +160 -59
  1084. package/lib/tableSchema.js.map +1 -1
  1085. package/lib/treeFactory.d.ts +5 -0
  1086. package/lib/treeFactory.d.ts.map +1 -1
  1087. package/lib/treeFactory.js +28 -8
  1088. package/lib/treeFactory.js.map +1 -1
  1089. package/lib/util/breakable.js +3 -3
  1090. package/lib/util/breakable.js.map +1 -1
  1091. package/lib/util/index.d.ts +2 -1
  1092. package/lib/util/index.d.ts.map +1 -1
  1093. package/lib/util/index.js +2 -1
  1094. package/lib/util/index.js.map +1 -1
  1095. package/lib/util/rangeMap.d.ts +24 -12
  1096. package/lib/util/rangeMap.d.ts.map +1 -1
  1097. package/lib/util/rangeMap.js +44 -5
  1098. package/lib/util/rangeMap.js.map +1 -1
  1099. package/lib/util/readSnapshotBlob.d.ts +13 -0
  1100. package/lib/util/readSnapshotBlob.d.ts.map +1 -0
  1101. package/lib/util/readSnapshotBlob.js +14 -0
  1102. package/lib/util/readSnapshotBlob.js.map +1 -0
  1103. package/lib/util/typeCheckTests.d.ts.map +1 -1
  1104. package/lib/util/typeCheckTests.js.map +1 -1
  1105. package/package.json +22 -22
  1106. package/src/codec/codec.ts +15 -1
  1107. package/src/codec/versioned/codec.ts +1 -1
  1108. package/src/codec/versioned/format.ts +4 -1
  1109. package/src/core/change-family/changeFamily.ts +5 -0
  1110. package/src/core/change-family/index.ts +1 -0
  1111. package/src/core/index.ts +7 -2
  1112. package/src/core/rebase/changeRebaser.ts +6 -1
  1113. package/src/core/rebase/index.ts +1 -0
  1114. package/src/core/rebase/types.ts +8 -1
  1115. package/src/core/rebase/utils.ts +31 -7
  1116. package/src/core/tree/detachedFieldIndex.ts +71 -14
  1117. package/src/core/tree/index.ts +9 -3
  1118. package/src/core/tree/pathTree.ts +16 -4
  1119. package/src/feature-libraries/chunked-forest/basicChunk.ts +7 -1
  1120. package/src/feature-libraries/chunked-forest/chunkTree.ts +6 -1
  1121. package/src/feature-libraries/chunked-forest/codec/codecs.ts +3 -7
  1122. package/src/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.ts +18 -11
  1123. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -9
  1124. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +393 -127
  1125. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +35 -38
  1126. package/src/feature-libraries/default-schema/index.ts +16 -5
  1127. package/src/feature-libraries/default-schema/locationBasedEditBuilder.ts +180 -0
  1128. package/src/feature-libraries/default-schema/mappedEditBuilder.ts +35 -9
  1129. package/src/feature-libraries/deltaUtils.ts +6 -1
  1130. package/src/feature-libraries/detachedFieldIndexSummarizer.ts +62 -15
  1131. package/src/feature-libraries/flex-tree/context.ts +17 -0
  1132. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +7 -8
  1133. package/src/feature-libraries/flex-tree/lazyField.ts +66 -24
  1134. package/src/feature-libraries/forest-summary/codec.ts +8 -8
  1135. package/src/feature-libraries/forest-summary/forestSummarizer.ts +47 -39
  1136. package/src/feature-libraries/forest-summary/format.ts +4 -4
  1137. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +23 -39
  1138. package/src/feature-libraries/forest-summary/index.ts +2 -1
  1139. package/src/feature-libraries/forest-summary/summaryTypes.ts +61 -0
  1140. package/src/feature-libraries/index.ts +23 -14
  1141. package/src/feature-libraries/mapTreeCursor.ts +2 -1
  1142. package/src/feature-libraries/mitigatedChangeFamily.ts +3 -1
  1143. package/src/feature-libraries/modular-schema/comparison.ts +63 -5
  1144. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +142 -44
  1145. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +36 -57
  1146. package/src/feature-libraries/modular-schema/fieldKind.ts +24 -40
  1147. package/src/feature-libraries/modular-schema/genericFieldKind.ts +10 -19
  1148. package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +1 -1
  1149. package/src/feature-libraries/modular-schema/index.ts +21 -15
  1150. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +732 -0
  1151. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +790 -0
  1152. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +32 -505
  1153. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +2542 -742
  1154. package/src/feature-libraries/modular-schema/{modularChangeFormat.ts → modularChangeFormatV1.ts} +2 -1
  1155. package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +62 -0
  1156. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +98 -10
  1157. package/src/feature-libraries/optional-field/index.ts +1 -3
  1158. package/src/feature-libraries/optional-field/optionalField.ts +317 -574
  1159. package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +24 -38
  1160. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +89 -35
  1161. package/src/feature-libraries/schema-index/schemaSummarizer.ts +59 -18
  1162. package/src/feature-libraries/sequence-field/compose.ts +134 -519
  1163. package/src/feature-libraries/sequence-field/formatV2.ts +1 -0
  1164. package/src/feature-libraries/sequence-field/helperTypes.ts +34 -19
  1165. package/src/feature-libraries/sequence-field/index.ts +0 -9
  1166. package/src/feature-libraries/sequence-field/invert.ts +103 -228
  1167. package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
  1168. package/src/feature-libraries/sequence-field/moveEffectTable.ts +8 -191
  1169. package/src/feature-libraries/sequence-field/rebase.ts +168 -203
  1170. package/src/feature-libraries/sequence-field/replaceRevisions.ts +31 -52
  1171. package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +0 -2
  1172. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +643 -220
  1173. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +56 -68
  1174. package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +25 -27
  1175. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +19 -129
  1176. package/src/feature-libraries/sequence-field/types.ts +34 -64
  1177. package/src/feature-libraries/sequence-field/utils.ts +133 -346
  1178. package/src/feature-libraries/treeCompressionUtils.ts +1 -15
  1179. package/src/index.ts +7 -2
  1180. package/src/packageVersion.ts +1 -1
  1181. package/src/shared-tree/independentView.ts +1 -1
  1182. package/src/shared-tree/index.ts +3 -2
  1183. package/src/shared-tree/schematizeTree.ts +21 -8
  1184. package/src/shared-tree/schematizingTreeView.ts +50 -68
  1185. package/src/shared-tree/sharedTree.ts +51 -30
  1186. package/src/shared-tree/sharedTreeChangeCodecs.ts +5 -1
  1187. package/src/shared-tree/sharedTreeChangeEnricher.ts +31 -11
  1188. package/src/shared-tree/sharedTreeChangeFamily.ts +9 -6
  1189. package/src/shared-tree/sharedTreeEditBuilder.ts +46 -12
  1190. package/src/shared-tree/treeAlpha.ts +2 -3
  1191. package/src/shared-tree/treeCheckout.ts +106 -33
  1192. package/src/shared-tree-core/branch.ts +8 -2
  1193. package/src/shared-tree-core/editManager.ts +16 -2
  1194. package/src/shared-tree-core/editManagerCodecs.ts +17 -5
  1195. package/src/shared-tree-core/{editManagerCodecsV5.ts → editManagerCodecsVSharedBranches.ts} +3 -3
  1196. package/src/shared-tree-core/editManagerFormatCommons.ts +22 -7
  1197. package/src/shared-tree-core/editManagerFormatV1toV4.ts +3 -1
  1198. package/src/shared-tree-core/{editManagerFormatV5.ts → editManagerFormatVSharedBranches.ts} +2 -2
  1199. package/src/shared-tree-core/editManagerSummarizer.ts +58 -16
  1200. package/src/shared-tree-core/index.ts +11 -3
  1201. package/src/shared-tree-core/messageCodecV1ToV4.ts +2 -1
  1202. package/src/shared-tree-core/{messageCodecV5.ts → messageCodecVSharedBranches.ts} +3 -3
  1203. package/src/shared-tree-core/messageCodecs.ts +17 -5
  1204. package/src/shared-tree-core/messageFormat.ts +22 -7
  1205. package/src/shared-tree-core/messageFormatV1ToV4.ts +16 -2
  1206. package/src/shared-tree-core/{messageFormatV5.ts → messageFormatVSharedBranches.ts} +4 -6
  1207. package/src/shared-tree-core/sharedTreeCore.ts +67 -76
  1208. package/src/shared-tree-core/summaryTypes.ts +122 -0
  1209. package/src/shared-tree-core/versionedSummarizer.ts +107 -0
  1210. package/src/simple-tree/api/configuration.ts +21 -68
  1211. package/src/simple-tree/api/dirtyIndex.ts +11 -0
  1212. package/src/simple-tree/api/discrepancies.ts +1 -1
  1213. package/src/simple-tree/api/getSimpleSchema.ts +13 -6
  1214. package/src/simple-tree/api/incrementalAllowedTypes.ts +34 -20
  1215. package/src/simple-tree/api/index.ts +4 -5
  1216. package/src/simple-tree/api/schemaCompatibilityTester.ts +1 -1
  1217. package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -2
  1218. package/src/simple-tree/api/schemaFactoryRecursive.ts +0 -2
  1219. package/src/simple-tree/api/schemaFromSimple.ts +11 -5
  1220. package/src/simple-tree/api/simpleSchemaCodec.ts +17 -3
  1221. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -1
  1222. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +18 -10
  1223. package/src/simple-tree/api/tree.ts +1 -1
  1224. package/src/simple-tree/api/typesUnsafe.ts +7 -3
  1225. package/src/simple-tree/core/allowedTypes.ts +3 -3
  1226. package/src/simple-tree/core/index.ts +2 -2
  1227. package/src/simple-tree/core/toStored.ts +22 -55
  1228. package/src/simple-tree/core/treeNodeKernel.ts +1 -0
  1229. package/src/simple-tree/core/unhydratedFlexTree.ts +87 -36
  1230. package/src/simple-tree/core/walkSchema.ts +6 -0
  1231. package/src/simple-tree/createContext.ts +26 -11
  1232. package/src/simple-tree/fieldSchema.ts +16 -7
  1233. package/src/simple-tree/index.ts +13 -12
  1234. package/src/simple-tree/node-kinds/array/arrayNode.ts +14 -7
  1235. package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +3 -3
  1236. package/src/simple-tree/node-kinds/common.ts +2 -5
  1237. package/src/simple-tree/node-kinds/map/mapNode.ts +9 -6
  1238. package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +3 -3
  1239. package/src/simple-tree/node-kinds/object/objectNode.ts +28 -27
  1240. package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +6 -2
  1241. package/src/simple-tree/node-kinds/record/recordNode.ts +15 -11
  1242. package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +3 -3
  1243. package/src/simple-tree/prepareForInsertion.ts +343 -200
  1244. package/src/simple-tree/simpleSchema.ts +79 -32
  1245. package/src/simple-tree/simpleSchemaFormatV1.ts +9 -1
  1246. package/src/simple-tree/toStoredSchema.ts +319 -61
  1247. package/src/simple-tree/treeSchema.ts +54 -0
  1248. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +42 -14
  1249. package/src/tableSchema.ts +485 -166
  1250. package/src/treeFactory.ts +32 -9
  1251. package/src/util/breakable.ts +4 -4
  1252. package/src/util/index.ts +5 -0
  1253. package/src/util/rangeMap.ts +72 -18
  1254. package/src/util/readSnapshotBlob.ts +23 -0
  1255. package/src/util/typeCheckTests.ts +0 -1
  1256. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
  1257. package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
  1258. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
  1259. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
  1260. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -50
  1261. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
  1262. package/dist/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
  1263. package/dist/shared-tree-core/editManagerCodecsV5.js.map +0 -1
  1264. package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
  1265. package/dist/shared-tree-core/editManagerFormatV5.js.map +0 -1
  1266. package/dist/shared-tree-core/messageCodecV5.d.ts.map +0 -1
  1267. package/dist/shared-tree-core/messageCodecV5.js.map +0 -1
  1268. package/dist/shared-tree-core/messageFormatV5.d.ts.map +0 -1
  1269. package/dist/shared-tree-core/messageFormatV5.js.map +0 -1
  1270. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
  1271. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
  1272. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +0 -177
  1273. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
  1274. package/docs/main/sequence-field/move-composition.md +0 -46
  1275. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
  1276. package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
  1277. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
  1278. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
  1279. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -46
  1280. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
  1281. package/lib/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
  1282. package/lib/shared-tree-core/editManagerCodecsV5.js.map +0 -1
  1283. package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
  1284. package/lib/shared-tree-core/editManagerFormatV5.js.map +0 -1
  1285. package/lib/shared-tree-core/messageCodecV5.d.ts.map +0 -1
  1286. package/lib/shared-tree-core/messageCodecV5.js.map +0 -1
  1287. package/lib/shared-tree-core/messageFormatV5.d.ts.map +0 -1
  1288. package/lib/shared-tree-core/messageFormatV5.js.map +0 -1
  1289. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
  1290. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
  1291. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +0 -171
  1292. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
  1293. package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +0 -57
  1294. package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +0 -209
@@ -3,23 +3,45 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { IChannelStorageService } from "@fluidframework/datastore-definitions/internal";
6
- import type { IExperimentalIncrementalSummaryContext, ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtime-definitions/internal";
6
+ import type { IExperimentalIncrementalSummaryContext, ITelemetryContext, MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
7
+ import type { SummaryTreeBuilder } from "@fluidframework/runtime-utils/internal";
7
8
  import type { DetachedFieldIndex } from "../core/index.js";
8
- import type { Summarizable, SummaryElementParser, SummaryElementStringifier } from "../shared-tree-core/index.js";
9
+ import { type Summarizable, type SummaryElementParser, type SummaryElementStringifier, VersionedSummarizer } from "../shared-tree-core/index.js";
10
+ /**
11
+ * The storage key for the blob in the summary containing schema data
12
+ */
13
+ export declare const detachedFieldIndexBlobKey = "DetachedFieldIndexBlob";
14
+ /**
15
+ * The versions for the detached field index summary format.
16
+ */
17
+ export declare const enum DetachedFieldIndexSummaryFormatVersion {
18
+ /**
19
+ * This version represents summary format before summary versioning was introduced.
20
+ */
21
+ v1 = 1,
22
+ /**
23
+ * This version adds metadata to the summary. This is backward compatible with version 1.
24
+ */
25
+ v2 = 2,
26
+ /**
27
+ * The latest version of the summary. Must be updated when a new version is added.
28
+ */
29
+ vLatest = 2
30
+ }
9
31
  /**
10
32
  * Provides methods for summarizing and loading a tree index.
11
33
  */
12
- export declare class DetachedFieldIndexSummarizer implements Summarizable {
34
+ export declare class DetachedFieldIndexSummarizer extends VersionedSummarizer<DetachedFieldIndexSummaryFormatVersion> implements Summarizable {
13
35
  private readonly detachedFieldIndex;
14
- readonly key = "DetachedFieldIndex";
15
- constructor(detachedFieldIndex: DetachedFieldIndex);
16
- summarize(props: {
36
+ constructor(detachedFieldIndex: DetachedFieldIndex, minVersionForCollab: MinimumVersionForCollab);
37
+ protected summarizeInternal(props: {
17
38
  stringify: SummaryElementStringifier;
18
39
  fullTree?: boolean;
19
40
  trackState?: boolean;
20
41
  telemetryContext?: ITelemetryContext;
21
42
  incrementalSummaryContext?: IExperimentalIncrementalSummaryContext;
22
- }): ISummaryTreeWithStats;
23
- load(services: IChannelStorageService, parse: SummaryElementParser): Promise<void>;
43
+ builder: SummaryTreeBuilder;
44
+ }): void;
45
+ protected loadInternal(services: IChannelStorageService, parse: SummaryElementParser): Promise<void>;
24
46
  }
25
47
  //# sourceMappingURL=detachedFieldIndexSummarizer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"detachedFieldIndexSummarizer.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/detachedFieldIndexSummarizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,KAAK,EACX,sCAAsC,EACtC,qBAAqB,EACrB,iBAAiB,EACjB,MAAM,8CAA8C,CAAC;AAGtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,KAAK,EACX,YAAY,EACZ,oBAAoB,EACpB,yBAAyB,EACzB,MAAM,8BAA8B,CAAC;AAQtC;;GAEG;AACH,qBAAa,4BAA6B,YAAW,YAAY;IAG7C,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IAFtD,SAAgB,GAAG,wBAAwB;gBAEP,kBAAkB,EAAE,kBAAkB;IAEnE,SAAS,CAAC,KAAK,EAAE;QACvB,SAAS,EAAE,yBAAyB,CAAC;QACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;QACrC,yBAAyB,CAAC,EAAE,sCAAsC,CAAC;KACnE,GAAG,qBAAqB;IAKZ,IAAI,CAChB,QAAQ,EAAE,sBAAsB,EAChC,KAAK,EAAE,oBAAoB,GACzB,OAAO,CAAC,IAAI,CAAC;CAQhB"}
1
+ {"version":3,"file":"detachedFieldIndexSummarizer.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/detachedFieldIndexSummarizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,KAAK,EACX,sCAAsC,EACtC,iBAAiB,EACjB,uBAAuB,EACvB,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,mBAAmB,EACnB,MAAM,8BAA8B,CAAC;AAGtC;;GAEG;AACH,eAAO,MAAM,yBAAyB,2BAA2B,CAAC;AAElE;;GAEG;AACH,0BAAkB,sCAAsC;IACvD;;OAEG;IACH,EAAE,IAAI;IACN;;OAEG;IACH,EAAE,IAAI;IACN;;OAEG;IACH,OAAO,IAAK;CACZ;AAiBD;;GAEG;AACH,qBAAa,4BACZ,SAAQ,mBAAmB,CAAC,sCAAsC,CAClE,YAAW,YAAY;IAGtB,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBAAlB,kBAAkB,EAAE,kBAAkB,EACvD,mBAAmB,EAAE,uBAAuB;IAU7C,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE;QAClC,SAAS,EAAE,yBAAyB,CAAC;QACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;QACrC,yBAAyB,CAAC,EAAE,sCAAsC,CAAC;QACnE,OAAO,EAAE,kBAAkB,CAAC;KAC5B,GAAG,IAAI;cAMQ,YAAY,CAC3B,QAAQ,EAAE,sBAAsB,EAChC,KAAK,EAAE,oBAAoB,GACzB,OAAO,CAAC,IAAI,CAAC;CAQhB"}
@@ -4,28 +4,58 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.DetachedFieldIndexSummarizer = void 0;
7
+ exports.DetachedFieldIndexSummarizer = exports.DetachedFieldIndexSummaryFormatVersion = exports.detachedFieldIndexBlobKey = void 0;
8
8
  const client_utils_1 = require("@fluid-internal/client-utils");
9
- const internal_1 = require("@fluidframework/shared-object-base/internal");
9
+ const index_js_1 = require("../shared-tree-core/index.js");
10
10
  /**
11
11
  * The storage key for the blob in the summary containing schema data
12
12
  */
13
- const detachedFieldIndexBlobKey = "DetachedFieldIndexBlob";
13
+ exports.detachedFieldIndexBlobKey = "DetachedFieldIndexBlob";
14
+ /**
15
+ * The versions for the detached field index summary format.
16
+ */
17
+ var DetachedFieldIndexSummaryFormatVersion;
18
+ (function (DetachedFieldIndexSummaryFormatVersion) {
19
+ /**
20
+ * This version represents summary format before summary versioning was introduced.
21
+ */
22
+ DetachedFieldIndexSummaryFormatVersion[DetachedFieldIndexSummaryFormatVersion["v1"] = 1] = "v1";
23
+ /**
24
+ * This version adds metadata to the summary. This is backward compatible with version 1.
25
+ */
26
+ DetachedFieldIndexSummaryFormatVersion[DetachedFieldIndexSummaryFormatVersion["v2"] = 2] = "v2";
27
+ /**
28
+ * The latest version of the summary. Must be updated when a new version is added.
29
+ */
30
+ DetachedFieldIndexSummaryFormatVersion[DetachedFieldIndexSummaryFormatVersion["vLatest"] = 2] = "vLatest";
31
+ })(DetachedFieldIndexSummaryFormatVersion || (exports.DetachedFieldIndexSummaryFormatVersion = DetachedFieldIndexSummaryFormatVersion = {}));
32
+ const supportedVersions = new Set([
33
+ 1 /* DetachedFieldIndexSummaryFormatVersion.v1 */,
34
+ 2 /* DetachedFieldIndexSummaryFormatVersion.v2 */,
35
+ ]);
36
+ /**
37
+ * Returns the summary version to use as per the given minimum version for collab.
38
+ */
39
+ function minVersionToDetachedFieldIndexSummaryFormatVersion(version) {
40
+ // Currently, version 2 is written which adds metadata blob to the summary.
41
+ return 2 /* DetachedFieldIndexSummaryFormatVersion.v2 */;
42
+ }
14
43
  /**
15
44
  * Provides methods for summarizing and loading a tree index.
16
45
  */
17
- class DetachedFieldIndexSummarizer {
18
- constructor(detachedFieldIndex) {
46
+ class DetachedFieldIndexSummarizer extends index_js_1.VersionedSummarizer {
47
+ constructor(detachedFieldIndex, minVersionForCollab) {
48
+ super("DetachedFieldIndex", minVersionToDetachedFieldIndexSummaryFormatVersion(minVersionForCollab), supportedVersions, true);
19
49
  this.detachedFieldIndex = detachedFieldIndex;
20
- this.key = "DetachedFieldIndex";
21
50
  }
22
- summarize(props) {
51
+ summarizeInternal(props) {
52
+ const { stringify, builder } = props;
23
53
  const data = this.detachedFieldIndex.encode();
24
- return (0, internal_1.createSingleBlobSummary)(detachedFieldIndexBlobKey, props.stringify(data));
54
+ builder.addBlob(exports.detachedFieldIndexBlobKey, stringify(data));
25
55
  }
26
- async load(services, parse) {
27
- if (await services.contains(detachedFieldIndexBlobKey)) {
28
- const detachedFieldIndexBuffer = await services.readBlob(detachedFieldIndexBlobKey);
56
+ async loadInternal(services, parse) {
57
+ if (await services.contains(exports.detachedFieldIndexBlobKey)) {
58
+ const detachedFieldIndexBuffer = await services.readBlob(exports.detachedFieldIndexBlobKey);
29
59
  const treeBufferString = (0, client_utils_1.bufferToString)(detachedFieldIndexBuffer, "utf8");
30
60
  const parsed = parse(treeBufferString);
31
61
  this.detachedFieldIndex.loadData(parsed);
@@ -1 +1 @@
1
- {"version":3,"file":"detachedFieldIndexSummarizer.js","sourceRoot":"","sources":["../../src/feature-libraries/detachedFieldIndexSummarizer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA8D;AAO9D,0EAAsF;AAUtF;;GAEG;AACH,MAAM,yBAAyB,GAAG,wBAAwB,CAAC;AAE3D;;GAEG;AACH,MAAa,4BAA4B;IAGxC,YAAoC,kBAAsC;QAAtC,uBAAkB,GAAlB,kBAAkB,CAAoB;QAF1D,QAAG,GAAG,oBAAoB,CAAC;IAEkC,CAAC;IAEvE,SAAS,CAAC,KAMhB;QACA,MAAM,IAAI,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC;QAC9C,OAAO,IAAA,kCAAuB,EAAC,yBAAyB,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAClF,CAAC;IAEM,KAAK,CAAC,IAAI,CAChB,QAAgC,EAChC,KAA2B;QAE3B,IAAI,MAAM,QAAQ,CAAC,QAAQ,CAAC,yBAAyB,CAAC,EAAE,CAAC;YACxD,MAAM,wBAAwB,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CAAC;YACpF,MAAM,gBAAgB,GAAG,IAAA,6BAAc,EAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC;YAC1E,MAAM,MAAM,GAAG,KAAK,CAAC,gBAAgB,CAA2B,CAAC;YACjE,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC1C,CAAC;IACF,CAAC;CACD;AA3BD,oEA2BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { bufferToString } from \"@fluid-internal/client-utils\";\nimport type { IChannelStorageService } from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tIExperimentalIncrementalSummaryContext,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { createSingleBlobSummary } from \"@fluidframework/shared-object-base/internal\";\n\nimport type { DetachedFieldIndex } from \"../core/index.js\";\nimport type {\n\tSummarizable,\n\tSummaryElementParser,\n\tSummaryElementStringifier,\n} from \"../shared-tree-core/index.js\";\nimport type { JsonCompatibleReadOnly } from \"../util/index.js\";\n\n/**\n * The storage key for the blob in the summary containing schema data\n */\nconst detachedFieldIndexBlobKey = \"DetachedFieldIndexBlob\";\n\n/**\n * Provides methods for summarizing and loading a tree index.\n */\nexport class DetachedFieldIndexSummarizer implements Summarizable {\n\tpublic readonly key = \"DetachedFieldIndex\";\n\n\tpublic constructor(private readonly detachedFieldIndex: DetachedFieldIndex) {}\n\n\tpublic summarize(props: {\n\t\tstringify: SummaryElementStringifier;\n\t\tfullTree?: boolean;\n\t\ttrackState?: boolean;\n\t\ttelemetryContext?: ITelemetryContext;\n\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext;\n\t}): ISummaryTreeWithStats {\n\t\tconst data = this.detachedFieldIndex.encode();\n\t\treturn createSingleBlobSummary(detachedFieldIndexBlobKey, props.stringify(data));\n\t}\n\n\tpublic async load(\n\t\tservices: IChannelStorageService,\n\t\tparse: SummaryElementParser,\n\t): Promise<void> {\n\t\tif (await services.contains(detachedFieldIndexBlobKey)) {\n\t\t\tconst detachedFieldIndexBuffer = await services.readBlob(detachedFieldIndexBlobKey);\n\t\t\tconst treeBufferString = bufferToString(detachedFieldIndexBuffer, \"utf8\");\n\t\t\tconst parsed = parse(treeBufferString) as JsonCompatibleReadOnly;\n\t\t\tthis.detachedFieldIndex.loadData(parsed);\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"detachedFieldIndexSummarizer.js","sourceRoot":"","sources":["../../src/feature-libraries/detachedFieldIndexSummarizer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA8D;AAU9D,2DAKsC;AAGtC;;GAEG;AACU,QAAA,yBAAyB,GAAG,wBAAwB,CAAC;AAElE;;GAEG;AACH,IAAkB,sCAajB;AAbD,WAAkB,sCAAsC;IACvD;;OAEG;IACH,+FAAM,CAAA;IACN;;OAEG;IACH,+FAAM,CAAA;IACN;;OAEG;IACH,yGAAY,CAAA;AACb,CAAC,EAbiB,sCAAsC,sDAAtC,sCAAsC,QAavD;AAED,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAyC;;;CAGzE,CAAC,CAAC;AAEH;;GAEG;AACH,SAAS,kDAAkD,CAC1D,OAAgC;IAEhC,2EAA2E;IAC3E,yDAAiD;AAClD,CAAC;AAED;;GAEG;AACH,MAAa,4BACZ,SAAQ,8BAA2D;IAGnE,YACkB,kBAAsC,EACvD,mBAA4C;QAE5C,KAAK,CACJ,oBAAoB,EACpB,kDAAkD,CAAC,mBAAmB,CAAC,EACvE,iBAAiB,EACjB,IAAI,CACJ,CAAC;QARe,uBAAkB,GAAlB,kBAAkB,CAAoB;IASxD,CAAC;IAES,iBAAiB,CAAC,KAO3B;QACA,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;QACrC,MAAM,IAAI,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC;QAC9C,OAAO,CAAC,OAAO,CAAC,iCAAyB,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7D,CAAC;IAES,KAAK,CAAC,YAAY,CAC3B,QAAgC,EAChC,KAA2B;QAE3B,IAAI,MAAM,QAAQ,CAAC,QAAQ,CAAC,iCAAyB,CAAC,EAAE,CAAC;YACxD,MAAM,wBAAwB,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,iCAAyB,CAAC,CAAC;YACpF,MAAM,gBAAgB,GAAG,IAAA,6BAAc,EAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC;YAC1E,MAAM,MAAM,GAAG,KAAK,CAAC,gBAAgB,CAA2B,CAAC;YACjE,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC1C,CAAC;IACF,CAAC;CACD;AAxCD,oEAwCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { bufferToString } from \"@fluid-internal/client-utils\";\nimport type { IChannelStorageService } from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tIExperimentalIncrementalSummaryContext,\n\tITelemetryContext,\n\tMinimumVersionForCollab,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport type { SummaryTreeBuilder } from \"@fluidframework/runtime-utils/internal\";\n\nimport type { DetachedFieldIndex } from \"../core/index.js\";\nimport {\n\ttype Summarizable,\n\ttype SummaryElementParser,\n\ttype SummaryElementStringifier,\n\tVersionedSummarizer,\n} from \"../shared-tree-core/index.js\";\nimport type { JsonCompatibleReadOnly } from \"../util/index.js\";\n\n/**\n * The storage key for the blob in the summary containing schema data\n */\nexport const detachedFieldIndexBlobKey = \"DetachedFieldIndexBlob\";\n\n/**\n * The versions for the detached field index summary format.\n */\nexport const enum DetachedFieldIndexSummaryFormatVersion {\n\t/**\n\t * This version represents summary format before summary versioning was introduced.\n\t */\n\tv1 = 1,\n\t/**\n\t * This version adds metadata to the summary. This is backward compatible with version 1.\n\t */\n\tv2 = 2,\n\t/**\n\t * The latest version of the summary. Must be updated when a new version is added.\n\t */\n\tvLatest = v2,\n}\n\nconst supportedVersions = new Set<DetachedFieldIndexSummaryFormatVersion>([\n\tDetachedFieldIndexSummaryFormatVersion.v1,\n\tDetachedFieldIndexSummaryFormatVersion.v2,\n]);\n\n/**\n * Returns the summary version to use as per the given minimum version for collab.\n */\nfunction minVersionToDetachedFieldIndexSummaryFormatVersion(\n\tversion: MinimumVersionForCollab,\n): DetachedFieldIndexSummaryFormatVersion {\n\t// Currently, version 2 is written which adds metadata blob to the summary.\n\treturn DetachedFieldIndexSummaryFormatVersion.v2;\n}\n\n/**\n * Provides methods for summarizing and loading a tree index.\n */\nexport class DetachedFieldIndexSummarizer\n\textends VersionedSummarizer<DetachedFieldIndexSummaryFormatVersion>\n\timplements Summarizable\n{\n\tpublic constructor(\n\t\tprivate readonly detachedFieldIndex: DetachedFieldIndex,\n\t\tminVersionForCollab: MinimumVersionForCollab,\n\t) {\n\t\tsuper(\n\t\t\t\"DetachedFieldIndex\",\n\t\t\tminVersionToDetachedFieldIndexSummaryFormatVersion(minVersionForCollab),\n\t\t\tsupportedVersions,\n\t\t\ttrue,\n\t\t);\n\t}\n\n\tprotected summarizeInternal(props: {\n\t\tstringify: SummaryElementStringifier;\n\t\tfullTree?: boolean;\n\t\ttrackState?: boolean;\n\t\ttelemetryContext?: ITelemetryContext;\n\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext;\n\t\tbuilder: SummaryTreeBuilder;\n\t}): void {\n\t\tconst { stringify, builder } = props;\n\t\tconst data = this.detachedFieldIndex.encode();\n\t\tbuilder.addBlob(detachedFieldIndexBlobKey, stringify(data));\n\t}\n\n\tprotected async loadInternal(\n\t\tservices: IChannelStorageService,\n\t\tparse: SummaryElementParser,\n\t): Promise<void> {\n\t\tif (await services.contains(detachedFieldIndexBlobKey)) {\n\t\t\tconst detachedFieldIndexBuffer = await services.readBlob(detachedFieldIndexBlobKey);\n\t\t\tconst treeBufferString = bufferToString(detachedFieldIndexBuffer, \"utf8\");\n\t\t\tconst parsed = parse(treeBufferString) as JsonCompatibleReadOnly;\n\t\t\tthis.detachedFieldIndex.loadData(parsed);\n\t\t}\n\t}\n}\n"]}
@@ -33,6 +33,7 @@ export interface FlexTreeContext {
33
33
  * If true, none of the nodes in this context can be used.
34
34
  */
35
35
  isDisposed(): boolean;
36
+ runInTransaction(fn: () => void): void;
36
37
  }
37
38
  /**
38
39
  * Subset of a hydrated context which can be used in more cases (like before the root and events are set up).
@@ -46,6 +47,13 @@ export interface FlexTreeHydratedContextMinimal {
46
47
  * The checkout object associated with this context.
47
48
  */
48
49
  readonly checkout: ITreeCheckout;
50
+ /**
51
+ * Returns a new {@link FlexTreeField} that will live as long as the caller allows up to the next call to {@link clear} or disposal of the context.
52
+ * @remarks
53
+ * Due to limited support for detached fields, not all operations are supported.
54
+ * Additionally if the detached field's content is deleted, the field will become out of schema if it is required: it must not be used after that point.
55
+ */
56
+ detachedField?(key: DetachedField, schema: FieldKindIdentifier): FlexTreeField;
49
57
  }
50
58
  /**
51
59
  * A common context of a "forest" of FlexTrees.
@@ -104,6 +112,7 @@ export declare class Context implements FlexTreeHydratedContext, IDisposable {
104
112
  isHydrated(): this is FlexTreeHydratedContext;
105
113
  isDisposed(): boolean;
106
114
  get schema(): TreeStoredSchema;
115
+ runInTransaction(fn: () => void): void;
107
116
  /**
108
117
  * Called before editing.
109
118
  * Clears all cursors so editing can proceed.
@@ -1 +1 @@
1
- {"version":3,"file":"context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vC;;OAEG;aACa,cAAc,EAAE,qBAAqB;IAzBtD,SAAgB,WAAW,EAAE,GAAG,CAAC,UAAU,CAAC,CAAa;IACzD,SAAgB,WAAW,EAAE,GAAG,CAAC,UAAU,CAAC,CAAa;IAEzD;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAiB;IAC3C,OAAO,CAAC,QAAQ,CAAS;IAEzB;;;;;OAKG;IACH,OAAO,CAAC,aAAa,CAA4B;gBAGhC,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,aAAa;IACvC;;OAEG;IACa,cAAc,EAAE,qBAAqB;IAe/C,UAAU,IAAI,IAAI,IAAI,uBAAuB;IAK7C,UAAU,IAAI,OAAO;IAI5B,IAAW,MAAM,IAAI,gBAAgB,CAEpC;IAEM,gBAAgB,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI;IAO7C;;;OAGG;IACH,OAAO,CAAC,cAAc;IAQf,CAAC,aAAa,CAAC,IAAI,IAAI;IAa9B;;;;;;OAMG;IACI,KAAK,IAAI,IAAI;IASpB;;;;;OAKG;IACH,IAAW,IAAI,IAAI,aAAa,CAK/B;IAED;;;;;OAKG;IACI,aAAa,CAAC,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,mBAAmB,GAAG,aAAa;IAUpF,IAAW,MAAM,IAAI,UAAU,CAAC,YAAY,CAAC,CAE5C;CACD"}
@@ -54,6 +54,12 @@ class Context {
54
54
  get schema() {
55
55
  return this.checkout.storedSchema;
56
56
  }
57
+ runInTransaction(fn) {
58
+ (0, internal_1.debugAssert)(() => !this.disposed || "Disposed");
59
+ this.checkout.transaction.start();
60
+ fn();
61
+ this.checkout.transaction.commit();
62
+ }
57
63
  /**
58
64
  * Called before editing.
59
65
  * Clears all cursors so editing can proceed.
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/context.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAA0E;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C,CAAC;IACjF,CAAC;IAED;;;;;OAKG;IACH,IAAW,IAAI;QACd,IAAA,iBAAM,EAAC,IAAI,CAAC,QAAQ,KAAK,KAAK,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAE/D,IAAI,CAAC,aAAa,KAAK,IAAI,CAAC,aAAa,CAAC,oBAAS,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QACvF,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;IAED;;;;;OAKG;IACI,aAAa,CAAC,GAAkB,EAAE,MAA2B;QACnE,IAAA,iBAAM,EAAC,IAAI,CAAC,QAAQ,KAAK,KAAK,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAE/D,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAC3D,IAAA,8BAAmB,EAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QACvD,MAAM,KAAK,GAAG,IAAA,wBAAS,EAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC9C,MAAM,CAAC,IAAI,EAAE,CAAC;QACd,OAAO,KAAK,CAAC;IACd,CAAC;IAED,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACpC,CAAC;CACD;AA/HD,0BA+HC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Listenable } from \"@fluidframework/core-interfaces\";\nimport { assert, debugAssert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype DetachedField,\n\ttype FieldKindIdentifier,\n\ttype ForestEvents,\n\ttype SchemaPolicy,\n\ttype TreeStoredSchema,\n\tanchorSlot,\n\tmoveToDetachedField,\n\trootField,\n} from \"../../core/index.js\";\nimport type { ITreeCheckout } from \"../../shared-tree/index.js\";\nimport { type IDisposable, disposeSymbol } from \"../../util/index.js\";\nimport type { NodeIdentifierManager } from \"../node-identifier/index.js\";\n\nimport type { FlexTreeField } from \"./flexTreeTypes.js\";\nimport type { LazyEntity } from \"./lazyEntity.js\";\nimport { makeField } from \"./lazyField.js\";\n\n/**\n * Context for FlexTrees.\n */\nexport interface FlexTreeContext {\n\t/**\n\t * Schema used within this context.\n\t * All data must conform to these schema.\n\t */\n\treadonly schema: TreeStoredSchema;\n\n\t/**\n\t * SchemaPolicy used within this context.\n\t */\n\treadonly schemaPolicy: SchemaPolicy;\n\n\t/**\n\t * If true, this context is the canonical context instance for a given view,\n\t * and its schema include all schema from the document.\n\t *\n\t * If false, this context was created for use in a unhydrated tree, and the full document schema is unknown.\n\t */\n\tisHydrated(): this is FlexTreeHydratedContext;\n\n\t/**\n\t * If true, none of the nodes in this context can be used.\n\t */\n\tisDisposed(): boolean;\n}\n\n/**\n * Subset of a hydrated context which can be used in more cases (like before the root and events are set up).\n */\nexport interface FlexTreeHydratedContextMinimal {\n\t/**\n\t * The {@link NodeIdentifierManager} responsible for allocating and compressing identifiers for nodes in this context.\n\t */\n\treadonly nodeKeyManager: NodeIdentifierManager;\n\n\t/**\n\t * The checkout object associated with this context.\n\t */\n\treadonly checkout: ITreeCheckout;\n}\n\n/**\n * A common context of a \"forest\" of FlexTrees.\n * It handles group operations like transforming cursors into anchors for edits.\n */\nexport interface FlexTreeHydratedContext\n\textends FlexTreeContext,\n\t\tFlexTreeHydratedContextMinimal {\n\treadonly events: Listenable<ForestEvents>;\n\t/**\n\t * Gets the root field of the tree.\n\t */\n\tget root(): FlexTreeField;\n}\n\n/**\n * Creating multiple flex tree contexts for the same branch, and thus with the same underlying AnchorSet does not work due to how TreeNode caching works.\n * This slot is used to detect if one already exists and error if creating a second.\n */\nexport const ContextSlot = anchorSlot<Context>();\n\n/**\n * Implementation of `FlexTreeHydratedContext`.\n *\n * @remarks An editor is required to edit the FlexTree.\n *\n * A {@link FlexTreeContext} which is used to manage the cursors and anchors within the FlexTrees:\n * This is necessary for supporting using this tree across edits to the forest, and not leaking memory.\n *\n * This context and the trees it produces observe the kinds of fields from the schema\n */\nexport class Context implements FlexTreeHydratedContext, IDisposable {\n\tpublic readonly withCursors: Set<LazyEntity> = new Set();\n\tpublic readonly withAnchors: Set<LazyEntity> = new Set();\n\n\t/**\n\t * Callbacks to run when disposing.\n\t *\n\t * Mainly event un-registration.\n\t */\n\tprivate readonly onDispose: (() => void)[];\n\tprivate disposed = false;\n\n\t/**\n\t * Stores the last accessed version of the root.\n\t * @remarks\n\t * Anything which can delete this field must clear it.\n\t * Currently \"clear\" is the only case.\n\t */\n\tprivate lazyRootCache: FlexTreeField | undefined;\n\n\tpublic constructor(\n\t\tpublic readonly schemaPolicy: SchemaPolicy,\n\t\tpublic readonly checkout: ITreeCheckout,\n\t\t/**\n\t\t * An object which handles node key generation and conversion\n\t\t */\n\t\tpublic readonly nodeKeyManager: NodeIdentifierManager,\n\t) {\n\t\tthis.onDispose = [\n\t\t\tthis.checkout.forest.events.on(\"beforeChange\", () => {\n\t\t\t\tthis.prepareForEdit();\n\t\t\t}),\n\t\t];\n\n\t\tassert(\n\t\t\t!this.checkout.forest.anchors.slots.has(ContextSlot),\n\t\t\t0x92b /* Cannot create second flex-tree from checkout */,\n\t\t);\n\t\tthis.checkout.forest.anchors.slots.set(ContextSlot, this);\n\t}\n\n\tpublic isHydrated(): this is FlexTreeHydratedContext {\n\t\tdebugAssert(() => !this.disposed || \"Disposed\");\n\t\treturn true;\n\t}\n\n\tpublic isDisposed(): boolean {\n\t\treturn this.disposed;\n\t}\n\n\tpublic get schema(): TreeStoredSchema {\n\t\treturn this.checkout.storedSchema;\n\t}\n\n\t/**\n\t * Called before editing.\n\t * Clears all cursors so editing can proceed.\n\t */\n\tprivate prepareForEdit(): void {\n\t\tassert(this.disposed === false, 0x802 /* use after dispose */);\n\t\tfor (const target of this.withCursors) {\n\t\t\ttarget.prepareForEdit();\n\t\t}\n\t\tassert(this.withCursors.size === 0, 0x773 /* prepareForEdit should remove all cursors */);\n\t}\n\n\tpublic [disposeSymbol](): void {\n\t\tassert(this.disposed === false, 0x803 /* double dispose */);\n\t\tthis.disposed = true;\n\t\tthis.clear();\n\t\tfor (const unregister of this.onDispose) {\n\t\t\tunregister();\n\t\t}\n\t\tthis.onDispose.length = 0;\n\n\t\tconst deleted = this.checkout.forest.anchors.slots.delete(ContextSlot);\n\t\tassert(deleted, 0x8c4 /* unexpected dispose */);\n\t}\n\n\t/**\n\t * Release any cursors and anchors held by tree entities created in this context.\n\t * @remarks\n\t * Ensures the cashed references to those entities on the Anchors are also cleared.\n\t * The tree entities are invalid to use after this, but the context may still be used\n\t * to create new trees starting from the root.\n\t */\n\tpublic clear(): void {\n\t\tfor (const target of this.withAnchors) {\n\t\t\ttarget[disposeSymbol]();\n\t\t}\n\t\tthis.lazyRootCache = undefined;\n\t\tassert(this.withCursors.size === 0, 0x774 /* free should remove all cursors */);\n\t\tassert(this.withAnchors.size === 0, 0x775 /* free should remove all anchors */);\n\t}\n\n\t/**\n\t * Gets the root field of the tree.\n\t * @remarks\n\t * This is a cached value: it should not be disposed by the accessor.\n\t * Like all other fields from this context, it will become invalid to use after {@link clear} is called or the {@link disposeSymbol} method is called.\n\t */\n\tpublic get root(): FlexTreeField {\n\t\tassert(this.disposed === false, 0x804 /* use after dispose */);\n\n\t\tthis.lazyRootCache ??= this.detachedField(rootField, this.schema.rootFieldSchema.kind);\n\t\treturn this.lazyRootCache;\n\t}\n\n\t/**\n\t * Returns a new {@link FlexTreeField} that will live as long as the caller allows up to the next call to {@link clear} or disposal of the context.\n\t * @remarks\n\t * Due to limited support for detached fields, not all operations are supported.\n\t * Additionally if the detached field's content is deleted, the field will become out of schema if it is required: it must not be used after that point.\n\t */\n\tpublic detachedField(key: DetachedField, schema: FieldKindIdentifier): FlexTreeField {\n\t\tassert(this.disposed === false, 0xb9c /* use after dispose */);\n\n\t\tconst cursor = this.checkout.forest.allocateCursor(\"root\");\n\t\tmoveToDetachedField(this.checkout.forest, cursor, key);\n\t\tconst field = makeField(this, schema, cursor);\n\t\tcursor.free();\n\t\treturn field;\n\t}\n\n\tpublic get events(): Listenable<ForestEvents> {\n\t\treturn this.checkout.forest.events;\n\t}\n}\n"]}
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/context.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAA0E;AAE1E,kDAS6B;AAE7B,kDAAsE;AAKtE,iDAA2C;AAsE3C;;;GAGG;AACU,QAAA,WAAW,GAAG,IAAA,qBAAU,GAAW,CAAC;AAEjD;;;;;;;;;GASG;AACH,MAAa,OAAO;IAoBnB,YACiB,YAA0B,EAC1B,QAAuB;IACvC;;OAEG;IACa,cAAqC;QALrC,iBAAY,GAAZ,YAAY,CAAc;QAC1B,aAAQ,GAAR,QAAQ,CAAe;QAIvB,mBAAc,GAAd,cAAc,CAAuB;QAzBtC,gBAAW,GAAoB,IAAI,GAAG,EAAE,CAAC;QACzC,gBAAW,GAAoB,IAAI,GAAG,EAAE,CAAC;QAQjD,aAAQ,GAAG,KAAK,CAAC;QAkBxB,IAAI,CAAC,SAAS,GAAG;YAChB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE;gBACnD,IAAI,CAAC,cAAc,EAAE,CAAC;YACvB,CAAC,CAAC;SACF,CAAC;QAEF,IAAA,iBAAM,EACL,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,mBAAW,CAAC,EACpD,KAAK,CAAC,kDAAkD,CACxD,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,mBAAW,EAAE,IAAI,CAAC,CAAC;IAC3D,CAAC;IAEM,UAAU;QAChB,IA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,CAAC;QACvD,MAAM,KAAK,GAAG,IAAA,wBAAS,EAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC9C,MAAM,CAAC,IAAI,EAAE,CAAC;QACd,OAAO,KAAK,CAAC;IACd,CAAC;IAED,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACpC,CAAC;CACD;AAtID,0BAsIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Listenable } from \"@fluidframework/core-interfaces\";\nimport { assert, debugAssert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype DetachedField,\n\ttype FieldKindIdentifier,\n\ttype ForestEvents,\n\ttype SchemaPolicy,\n\ttype TreeStoredSchema,\n\tanchorSlot,\n\tmoveToDetachedField,\n\trootField,\n} from \"../../core/index.js\";\nimport type { ITreeCheckout } from \"../../shared-tree/index.js\";\nimport { type IDisposable, disposeSymbol } from \"../../util/index.js\";\nimport type { NodeIdentifierManager } from \"../node-identifier/index.js\";\n\nimport type { FlexTreeField } from \"./flexTreeTypes.js\";\nimport type { LazyEntity } from \"./lazyEntity.js\";\nimport { makeField } from \"./lazyField.js\";\n\n/**\n * Context for FlexTrees.\n */\nexport interface FlexTreeContext {\n\t/**\n\t * Schema used within this context.\n\t * All data must conform to these schema.\n\t */\n\treadonly schema: TreeStoredSchema;\n\n\t/**\n\t * SchemaPolicy used within this context.\n\t */\n\treadonly schemaPolicy: SchemaPolicy;\n\n\t/**\n\t * If true, this context is the canonical context instance for a given view,\n\t * and its schema include all schema from the document.\n\t *\n\t * If false, this context was created for use in a unhydrated tree, and the full document schema is unknown.\n\t */\n\tisHydrated(): this is FlexTreeHydratedContext;\n\n\t/**\n\t * If true, none of the nodes in this context can be used.\n\t */\n\tisDisposed(): boolean;\n\n\trunInTransaction(fn: () => void): void;\n}\n\n/**\n * Subset of a hydrated context which can be used in more cases (like before the root and events are set up).\n */\nexport interface FlexTreeHydratedContextMinimal {\n\t/**\n\t * The {@link NodeIdentifierManager} responsible for allocating and compressing identifiers for nodes in this context.\n\t */\n\treadonly nodeKeyManager: NodeIdentifierManager;\n\n\t/**\n\t * The checkout object associated with this context.\n\t */\n\treadonly checkout: ITreeCheckout;\n\n\t/**\n\t * Returns a new {@link FlexTreeField} that will live as long as the caller allows up to the next call to {@link clear} or disposal of the context.\n\t * @remarks\n\t * Due to limited support for detached fields, not all operations are supported.\n\t * Additionally if the detached field's content is deleted, the field will become out of schema if it is required: it must not be used after that point.\n\t */\n\tdetachedField?(key: DetachedField, schema: FieldKindIdentifier): FlexTreeField;\n}\n\n/**\n * A common context of a \"forest\" of FlexTrees.\n * It handles group operations like transforming cursors into anchors for edits.\n */\nexport interface FlexTreeHydratedContext\n\textends FlexTreeContext,\n\t\tFlexTreeHydratedContextMinimal {\n\treadonly events: Listenable<ForestEvents>;\n\t/**\n\t * Gets the root field of the tree.\n\t */\n\tget root(): FlexTreeField;\n}\n\n/**\n * Creating multiple flex tree contexts for the same branch, and thus with the same underlying AnchorSet does not work due to how TreeNode caching works.\n * This slot is used to detect if one already exists and error if creating a second.\n */\nexport const ContextSlot = anchorSlot<Context>();\n\n/**\n * Implementation of `FlexTreeHydratedContext`.\n *\n * @remarks An editor is required to edit the FlexTree.\n *\n * A {@link FlexTreeContext} which is used to manage the cursors and anchors within the FlexTrees:\n * This is necessary for supporting using this tree across edits to the forest, and not leaking memory.\n *\n * This context and the trees it produces observe the kinds of fields from the schema\n */\nexport class Context implements FlexTreeHydratedContext, IDisposable {\n\tpublic readonly withCursors: Set<LazyEntity> = new Set();\n\tpublic readonly withAnchors: Set<LazyEntity> = new Set();\n\n\t/**\n\t * Callbacks to run when disposing.\n\t *\n\t * Mainly event un-registration.\n\t */\n\tprivate readonly onDispose: (() => void)[];\n\tprivate disposed = false;\n\n\t/**\n\t * Stores the last accessed version of the root.\n\t * @remarks\n\t * Anything which can delete this field must clear it.\n\t * Currently \"clear\" is the only case.\n\t */\n\tprivate lazyRootCache: FlexTreeField | undefined;\n\n\tpublic constructor(\n\t\tpublic readonly schemaPolicy: SchemaPolicy,\n\t\tpublic readonly checkout: ITreeCheckout,\n\t\t/**\n\t\t * An object which handles node key generation and conversion\n\t\t */\n\t\tpublic readonly nodeKeyManager: NodeIdentifierManager,\n\t) {\n\t\tthis.onDispose = [\n\t\t\tthis.checkout.forest.events.on(\"beforeChange\", () => {\n\t\t\t\tthis.prepareForEdit();\n\t\t\t}),\n\t\t];\n\n\t\tassert(\n\t\t\t!this.checkout.forest.anchors.slots.has(ContextSlot),\n\t\t\t0x92b /* Cannot create second flex-tree from checkout */,\n\t\t);\n\t\tthis.checkout.forest.anchors.slots.set(ContextSlot, this);\n\t}\n\n\tpublic isHydrated(): this is FlexTreeHydratedContext {\n\t\tdebugAssert(() => !this.disposed || \"Disposed\");\n\t\treturn true;\n\t}\n\n\tpublic isDisposed(): boolean {\n\t\treturn this.disposed;\n\t}\n\n\tpublic get schema(): TreeStoredSchema {\n\t\treturn this.checkout.storedSchema;\n\t}\n\n\tpublic runInTransaction(fn: () => void): void {\n\t\tdebugAssert(() => !this.disposed || \"Disposed\");\n\t\tthis.checkout.transaction.start();\n\t\tfn();\n\t\tthis.checkout.transaction.commit();\n\t}\n\n\t/**\n\t * Called before editing.\n\t * Clears all cursors so editing can proceed.\n\t */\n\tprivate prepareForEdit(): void {\n\t\tassert(this.disposed === false, 0x802 /* use after dispose */);\n\t\tfor (const target of this.withCursors) {\n\t\t\ttarget.prepareForEdit();\n\t\t}\n\t\tassert(this.withCursors.size === 0, 0x773 /* prepareForEdit should remove all cursors */);\n\t}\n\n\tpublic [disposeSymbol](): void {\n\t\tassert(this.disposed === false, 0x803 /* double dispose */);\n\t\tthis.disposed = true;\n\t\tthis.clear();\n\t\tfor (const unregister of this.onDispose) {\n\t\t\tunregister();\n\t\t}\n\t\tthis.onDispose.length = 0;\n\n\t\tconst deleted = this.checkout.forest.anchors.slots.delete(ContextSlot);\n\t\tassert(deleted, 0x8c4 /* unexpected dispose */);\n\t}\n\n\t/**\n\t * Release any cursors and anchors held by tree entities created in this context.\n\t * @remarks\n\t * Ensures the cashed references to those entities on the Anchors are also cleared.\n\t * The tree entities are invalid to use after this, but the context may still be used\n\t * to create new trees starting from the root.\n\t */\n\tpublic clear(): void {\n\t\tfor (const target of this.withAnchors) {\n\t\t\ttarget[disposeSymbol]();\n\t\t}\n\t\tthis.lazyRootCache = undefined;\n\t\tassert(this.withCursors.size === 0, 0x774 /* free should remove all cursors */);\n\t\tassert(this.withAnchors.size === 0, 0x775 /* free should remove all anchors */);\n\t}\n\n\t/**\n\t * Gets the root field of the tree.\n\t * @remarks\n\t * This is a cached value: it should not be disposed by the accessor.\n\t * Like all other fields from this context, it will become invalid to use after {@link clear} is called or the {@link disposeSymbol} method is called.\n\t */\n\tpublic get root(): FlexTreeField {\n\t\tassert(this.disposed === false, 0x804 /* use after dispose */);\n\n\t\tthis.lazyRootCache ??= this.detachedField(rootField, this.schema.rootFieldSchema.kind);\n\t\treturn this.lazyRootCache;\n\t}\n\n\t/**\n\t * Returns a new {@link FlexTreeField} that will live as long as the caller allows up to the next call to {@link clear} or disposal of the context.\n\t * @remarks\n\t * Due to limited support for detached fields, not all operations are supported.\n\t * Additionally if the detached field's content is deleted, the field will become out of schema if it is required: it must not be used after that point.\n\t */\n\tpublic detachedField(key: DetachedField, schema: FieldKindIdentifier): FlexTreeField {\n\t\tassert(this.disposed === false, 0xb9c /* use after dispose */);\n\n\t\tconst cursor = this.checkout.forest.allocateCursor(\"root\");\n\t\tmoveToDetachedField(this.checkout.forest, cursor, key);\n\t\tconst field = makeField(this, schema, cursor);\n\t\tcursor.free();\n\t\treturn field;\n\t}\n\n\tpublic get events(): Listenable<ForestEvents> {\n\t\treturn this.checkout.forest.events;\n\t}\n}\n"]}
@@ -3,8 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { type AnchorNode, type FieldKey, type FieldKindIdentifier, type ITreeCursorSynchronous, type NormalizedFieldUpPath, type TreeValue } from "../../core/index.js";
6
- import type { FieldKinds, SequenceFieldEditBuilder, ValueFieldEditBuilder, OptionalFieldEditBuilder } from "../default-schema/index.js";
7
- import type { MapTreeFieldViewGeneric, MapTreeNodeViewGeneric, MinimalFieldMap, MinimalMapTreeNodeView } from "../mapTreeCursor.js";
6
+ import type { FieldKinds, SequenceFieldEditor, RequiredFieldEditor, OptionalFieldEditor } from "../default-schema/index.js";
7
+ import type { MapTreeFieldViewGeneric, MapTreeNodeViewGeneric, MinimalFieldMap } from "../mapTreeCursor.js";
8
8
  import type { FlexFieldKind } from "../modular-schema/index.js";
9
9
  import type { FlexTreeContext, FlexTreeHydratedContext } from "./context.js";
10
10
  /**
@@ -250,7 +250,7 @@ export type FlexibleFieldContent = readonly FlexibleNodeContent[];
250
250
  /**
251
251
  * Tree for inserting as a node.
252
252
  */
253
- export type FlexibleNodeContent = MinimalMapTreeNodeView;
253
+ export type FlexibleNodeContent = FlexTreeNode;
254
254
  /**
255
255
  * {@link FlexTreeField} that stores a sequence of children.
256
256
  *
@@ -291,7 +291,7 @@ export interface FlexTreeSequenceField extends FlexTreeField {
291
291
  /**
292
292
  * Get an editor for this sequence.
293
293
  */
294
- readonly editor: SequenceFieldEditBuilder<FlexibleFieldContent>;
294
+ readonly editor: SequenceFieldEditor<FlexibleFieldContent, readonly FlexTreeNode[]>;
295
295
  }
296
296
  /**
297
297
  * Field that stores exactly one child.
@@ -301,7 +301,7 @@ export interface FlexTreeSequenceField extends FlexTreeField {
301
301
  */
302
302
  export interface FlexTreeRequiredField extends FlexTreeField {
303
303
  get content(): FlexTreeUnknownUnboxed;
304
- readonly editor: ValueFieldEditBuilder<FlexibleNodeContent>;
304
+ readonly editor: RequiredFieldEditor<FlexibleNodeContent, FlexTreeNode>;
305
305
  }
306
306
  /**
307
307
  * Field that stores zero or one child.
@@ -318,7 +318,7 @@ export interface FlexTreeRequiredField extends FlexTreeField {
318
318
  */
319
319
  export interface FlexTreeOptionalField extends FlexTreeField {
320
320
  get content(): FlexTreeUnknownUnboxed | undefined;
321
- readonly editor: OptionalFieldEditBuilder<FlexibleNodeContent>;
321
+ readonly editor: OptionalFieldEditor<FlexibleNodeContent, FlexTreeNode>;
322
322
  }
323
323
  /**
324
324
  * Schema aware specialization of {@link FlexTreeField}.
@@ -1 +1 @@
1
- {"version":3,"file":"flexTreeTypes.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/flexTreeTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EAEd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACX,UAAU,EACV,wBAAwB,EACxB,qBAAqB,EACrB,wBAAwB,EACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACX,uBAAuB,EACvB,sBAAsB,EACtB,eAAe,EACf,sBAAsB,EACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE7E;;;GAGG;AACH,eAAO,MAAM,YAAY,gEAAqC,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,cAAc,eAA2B,CAAC;AAMvD,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,YAAY,CAE5D;AAED,oBAAY,kBAAkB;IAC7B,IAAI,IAAA;IACJ,KAAK,IAAA;CACL;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,cAAc;IAC9B;;;OAGG;IACH,QAAQ,CAAC,CAAC,cAAc,CAAC,EAAE,kBAAkB,CAAC;IAE9C;;OAEG;IACH,QAAQ,CAAC,O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CAAC,QAAQ,GACtC,qBAAqB,GACrB,aAAa,CAAC;AAIpB;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,YAAY,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"flexTreeTypes.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/flexTreeTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kDAQ6B;AAiB7B;;;GAGG;AACU,QAAA,YAAY,GAAG,IAAA,qBAAU,GAAwB,CAAC;AAE/D;;GAEG;AACU,QAAA,cAAc,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAEvD,SAAS,gBAAgB,CAAC,CAAU;IACnC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,sBAAc,IAAI,CAAC,CAAC;AACnE,CAAC;AAED,SAAgB,cAAc,CAAC,CAAU;IACxC,OAAO,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,sBAAc,CAAC,KAAK,kBAAkB,CAAC,IAAI,CAAC;AAC7E,CAAC;AAFD,wCAEC;AAED,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC7B,2DAAI,CAAA;IACJ,6DAAK,CAAA;AACN,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAqCD;;;GAGG;AACH,IAAY,UA+CX;AA/CD,WAAY,UAAU;IACrB;;OAEG;IACH,uDAAc,CAAA;IAEd;;OAEG;IACH,iDAAW,CAAA;IAEX;;;;;;;;;;;;;;OAcG;IACH,iDAAW,CAAA;IAEX;;;;;;;;;;;;;;;;;OAiBG;IACH,yCAAO,CAAA;AACR,CAAC,EA/CW,UAAU,0BAAV,UAAU,QA+CrB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype AnchorNode,\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype ITreeCursorSynchronous,\n\ttype NormalizedFieldUpPath,\n\ttype TreeValue,\n\tanchorSlot,\n} from \"../../core/index.js\";\nimport type {\n\tFieldKinds,\n\tSequenceFieldEditBuilder,\n\tValueFieldEditBuilder,\n\tOptionalFieldEditBuilder,\n} from \"../default-schema/index.js\";\nimport type {\n\tMapTreeFieldViewGeneric,\n\tMapTreeNodeViewGeneric,\n\tMinimalFieldMap,\n\tMinimalMapTreeNodeView,\n} from \"../mapTreeCursor.js\";\nimport type { FlexFieldKind } from \"../modular-schema/index.js\";\n\nimport type { FlexTreeContext, FlexTreeHydratedContext } from \"./context.js\";\n\n/**\n * An anchor slot which records the {@link FlexTreeNode} associated with that anchor, if there is one.\n * @remarks This always points to a \"real\" {@link FlexTreeNode} (i.e. a `LazyTreeNode`), never to a \"raw\" node.\n */\nexport const flexTreeSlot = anchorSlot<HydratedFlexTreeNode>();\n\n/**\n * Indicates that an object is a flex tree.\n */\nexport const flexTreeMarker = Symbol(\"flexTreeMarker\");\n\nfunction isFlexTreeEntity(t: unknown): t is FlexTreeEntity {\n\treturn typeof t === \"object\" && t !== null && flexTreeMarker in t;\n}\n\nexport function isFlexTreeNode(t: unknown): t is FlexTreeNode {\n\treturn isFlexTreeEntity(t) && t[flexTreeMarker] === FlexTreeEntityKind.Node;\n}\n\nexport enum FlexTreeEntityKind {\n\tNode,\n\tField,\n}\n\n/**\n * Part of a tree.\n * Iterates over children.\n *\n * @privateRemarks\n * This exists mainly as a place to share common members between nodes and fields.\n * It is not expected to be useful or common to write code which handles this type directly.\n * If this assumption turns out to be false, and generically processing `UntypedEntity`s is useful,\n * then this interface should probably be extended with some down casting functionality (like `is`).\n *\n * TODO:\n * Design and document iterator invalidation rules and ordering rules.\n * Providing a custom iterator type with place anchor semantics would be a good approach.\n */\nexport interface FlexTreeEntity {\n\t/**\n\t * Indicates that an object is a specific kind of flex tree FlexTreeEntity.\n\t * This makes it possible to both down cast FlexTreeEntities safely as well as validate if an object is or is not a FlexTreeEntity.\n\t */\n\treadonly [flexTreeMarker]: FlexTreeEntityKind;\n\n\t/**\n\t * A common context of FlexTrees.\n\t */\n\treadonly context: FlexTreeContext;\n\n\t/**\n\t * Get a cursor for the underlying data.\n\t * @remarks\n\t * This cursor might be one the node uses in its implementation, and thus must be returned to its original location before using any other APIs to interact with the tree.\n\t * Must not be held onto across edits or any other tree API use.\n\t */\n\tborrowCursor(): ITreeCursorSynchronous;\n}\n\n/**\n * Status of the tree that a particular node belongs to.\n * @public\n */\nexport enum TreeStatus {\n\t/**\n\t * Is parented under the root field.\n\t */\n\tInDocument = 0,\n\n\t/**\n\t * Is not parented under the root field, but can be added back to the original document tree.\n\t */\n\tRemoved = 1,\n\n\t/**\n\t * Is removed and cannot be added back to the original document tree.\n\t * @remarks\n\t * Nodes can enter this state for multiple reasons:\n\t * - The node was removed and nothing (e.g. undo/redo history) kept it from being cleaned up.\n\t * - The {@link TreeView} was disposed or had a schema change which made the tree incompatible.\n\t *\n\t * Deleted nodes' contents should not be observed or edited. This includes functionality exposed via {@link (Tree:variable)},\n\t * with the exception of {@link TreeNodeApi.status}.\n\t *\n\t * @privateRemarks\n\t * There was planned work (AB#17948) to make the first reason a node could become \"Deleted\" impossible,\n\t * at least as an opt in feature,\n\t * by lifetime extending all nodes which are still possible to reach automatically.\n\t */\n\tDeleted = 2,\n\n\t/**\n\t * Is created but has not yet been inserted into the tree.\n\t * @remarks\n\t * See also {@link Unhydrated}.\n\t *\n\t * Nodes in the new state have some limitations:\n\t *\n\t * - Events are not currently triggered for changes. Fixes for this are planned.\n\t *\n\t * - Reading identifiers from nodes which were left unspecified (defaulted) when creating the tree will error.\n\t * This is because allocating unique identifiers in a compressible manner requires knowing which tree the nodes will be inserted into.\n\t *\n\t * - Transactions do not work: transactions apply to a single {@link TreeView}, and `New` nodes are not part of one.\n\t *\n\t * - Automatically generated {@link SchemaFactory.identifier | identifiers} will be less compressible if read.\n\t *\n\t * - {@link TreeIdentifierUtils.getShort} and {@link TreeNodeApi.shortId | Tree.shortId} cannot return their short identifiers.\n\t */\n\tNew = 3,\n}\n\n/**\n * Generic tree node API.\n *\n * Nodes are (shallowly) immutable and have a logical identity, a type and either a value or fields under string keys.\n *\n * This \"logical identity\" is exposed as the object identity: if a node is moved within a document,\n * the same {@link FlexTreeNode} instance will be used in the new location.\n * Similarly, edits applied to a node's sub-tree concurrently with the move of the node will still be applied to its subtree in its new location.\n *\n * @remarks\n * All editing is actually done via {@link FlexTreeField}s: the nodes are immutable other than that they contain mutable fields.\n *\n * All implementations should track read access in {@link currentObserver}'s observation methods as appropriate.\n */\nexport interface FlexTreeNode extends FlexTreeEntity, MapTreeNodeViewGeneric<FlexTreeNode> {\n\treadonly [flexTreeMarker]: FlexTreeEntityKind.Node;\n\n\t/**\n\t * Gets a field of this node, if it is not empty.\n\t */\n\ttryGetField(key: FieldKey): undefined | FlexTreeField;\n\n\t/**\n\t * Get the field for `key`.\n\t * @param key - which entry to look up.\n\t *\n\t * @remarks\n\t * All fields implicitly exist, so `getBoxed` can be called with any key and will always return a field.\n\t * Even if the field is empty, it will still be returned, and can be edited to insert content if allowed by the field kind.\n\t * See {@link FlexTreeNode.tryGetField} for a variant that does not allocate a field in the empty case.\n\t */\n\tgetBoxed(key: FieldKey): FlexTreeField;\n\n\t/**\n\t * The field this tree is in, and the index within that field.\n\t * @remarks\n\t * The behavior of this at the root (especially removed and unhydrated roots) is currently not very consistent.\n\t * Since very little relies on this, limit what it exposes to reduce the potential impact of inconsistent root handling.\n\t */\n\treadonly parentField: {\n\t\treadonly parent: Pick<FlexTreeField, \"parent\" | \"schema\" | \"key\">;\n\t\treadonly index: number;\n\t};\n\n\t/**\n\t * The non-empty fields on this node.\n\t */\n\treadonly fields: MinimalFieldMap<FlexTreeField>;\n\n\t/**\n\t * The non-empty fields on this node.\n\t */\n\t[Symbol.iterator](): IterableIterator<FlexTreeField>;\n\n\t/**\n\t * Returns an iterable of keys for non-empty fields.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, but `keys` will yield only the keys of fields which contain one or more nodes.\n\t *\n\t * No guarantees are made regarding the order of the keys returned.\n\t */\n\tkeys(): IterableIterator<FieldKey>;\n\n\t/**\n\t * If true, this node is a {@link HydratedFlexTreeNode}.\n\t *\n\t * If false, this node is unhydrated.\n\t */\n\tisHydrated(): this is HydratedFlexTreeNode;\n}\n\n/**\n * A FlexTreeNode that is hydrated, meaning it is associated with a {@link FlexTreeHydratedContext}.\n */\nexport interface HydratedFlexTreeNode extends FlexTreeNode {\n\t/**\n\t * {@inheritDoc FlexTreeNode.context}\n\t */\n\treadonly context: FlexTreeHydratedContext;\n\n\t/**\n\t * The anchor node associated with this node\n\t *\n\t * @remarks\n\t * The ref count keeping this alive is owned by the FlexTreeNode:\n\t * if holding onto this anchor for longer than the FlexTreeNode might be alive,\n\t * a separate Anchor (and thus ref count) must be allocated to keep it alive.\n\t */\n\treadonly anchorNode: AnchorNode;\n}\n\n/**\n * A collaboratively editable collection of nodes within a {@link FlexTreeEntity}.\n *\n * Fields are inherently part of their parent, and thus cannot be moved.\n * Instead their content can be moved, deleted or created.\n *\n * Editing operations are only valid on trees with the {@link TreeStatus#InDocument} `TreeStatus`.\n *\n * @remarks\n * Fields are used wherever an editable collection of nodes is required.\n * This is required in two places:\n * 1. To hold the children of non-leaf {@link FlexTreeNode}s.\n * 2. As the root of a {@link FlexTreeEntity}.\n *\n * Down-casting (via {@link FlexTreeField.is}) is required to access Schema-Aware APIs, including editing.\n * All content in the tree is accessible without down-casting, but if the schema is known,\n * the schema aware API may be more ergonomic.\n */\nexport interface FlexTreeField extends FlexTreeEntity, MapTreeFieldViewGeneric<FlexTreeNode> {\n\treadonly [flexTreeMarker]: FlexTreeEntityKind.Field;\n\n\t/**\n\t * The number of nodes in this field\n\t */\n\treadonly length: number;\n\n\t/**\n\t * The `FieldKey` this field is under.\n\t * Defines what part of its parent this field makes up.\n\t */\n\treadonly key: FieldKey;\n\n\t/**\n\t * The node which has this field on it under `fieldKey`.\n\t * `undefined` iff this field is a detached field.\n\t */\n\treadonly parent?: FlexTreeNode;\n\n\t/**\n\t * Type guard for narrowing / down-casting to a specific schema.\n\t */\n\tis<TKind extends FlexFieldKind>(kind: TKind): this is FlexTreeTypedField<TKind>;\n\n\t/**\n\t * Gets a node of this field by its index without unboxing.\n\t * @param index - Zero-based index of the item to retrieve. Negative values are interpreted from the end of the sequence.\n\t *\n\t * @returns The element in the sequence matching the given index. Always returns undefined if index \\< -sequence.length\n\t * or index \\>= sequence.length.\n\t *\n\t * @remarks\n\t * Semantics match {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at}.\n\t */\n\tboxedAt(index: number): FlexTreeNode | undefined;\n\n\t/**\n\t * Gets the FieldUpPath of a field.\n\t */\n\tgetFieldPath(): NormalizedFieldUpPath;\n\n\t/**\n\t * Schema for this entity.\n\t * If well-formed, it must follow this schema.\n\t */\n\treadonly schema: FieldKindIdentifier;\n}\n\n// #region Field Kinds\n\n/**\n * Typed tree for inserting as the content of a field.\n */\nexport type FlexibleFieldContent = readonly FlexibleNodeContent[];\n\n/**\n * Tree for inserting as a node.\n */\nexport type FlexibleNodeContent = MinimalMapTreeNodeView;\n\n/**\n * {@link FlexTreeField} that stores a sequence of children.\n *\n * Sequence fields can contain an ordered sequence any number of {@link FlexTreeNode}s which must be of the {@link FlexAllowedTypes} from the {@link FlexFieldSchema}).\n *\n * @remarks\n * Allows for concurrent editing based on index, adjusting the locations of indexes as needed so they apply to the same logical place in the sequence when rebased and merged.\n *\n * Edits to sequence fields are anchored relative to their surroundings, so concurrent edits can result in the indexes of nodes and edits getting shifted.\n * To hold onto locations in sequence across an edit, use anchors.\n *\n * @privateRemarks\n * TODO:\n * Add anchor API that can actually hold onto locations in a sequence.\n * Currently only nodes can be held onto with anchors, and this does not replicate the behavior implemented for editing.\n */\nexport interface FlexTreeSequenceField extends FlexTreeField {\n\t/**\n\t * Gets a node of this field by its index with unboxing.\n\t * @param index - Zero-based index of the item to retrieve. Negative values are interpreted from the end of the sequence.\n\t *\n\t * @returns The element in the sequence matching the given index. Always returns undefined if index \\< -sequence.length\n\t * or index \\>= array.length.\n\t *\n\t * @remarks\n\t * Semantics match {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at}.\n\t */\n\tat(index: number): FlexTreeUnknownUnboxed | undefined;\n\n\t/**\n\t * {@inheritdoc FlexTreeField.boxedAt}\n\t */\n\tboxedAt(index: number): FlexTreeNode | undefined;\n\n\t/**\n\t * Calls the provided callback function on each child of this sequence, and returns an array that contains the results.\n\t * @param callbackfn - A function that accepts the child and its index.\n\t */\n\tmap<U>(callbackfn: (value: FlexTreeUnknownUnboxed, index: number) => U): U[];\n\n\t/**\n\t * Get an editor for this sequence.\n\t */\n\treadonly editor: SequenceFieldEditBuilder<FlexibleFieldContent>;\n}\n\n/**\n * Field that stores exactly one child.\n *\n * @remarks\n * Unboxes its content, so in schema aware APIs which do unboxing, the RequiredField itself will be skipped over and its content will be returned directly.\n */\nexport interface FlexTreeRequiredField extends FlexTreeField {\n\tget content(): FlexTreeUnknownUnboxed;\n\n\treadonly editor: ValueFieldEditBuilder<FlexibleNodeContent>;\n}\n\n/**\n * Field that stores zero or one child.\n *\n * @remarks\n * Unboxes its content, so in schema aware APIs which do unboxing, the OptionalField itself will be skipped over and its content will be returned directly.\n *\n * @privateRemarks\n * TODO: Document merge semitics\n * TODO: Allow Optional fields to be used with last write wins OR first write wins merge resolution.\n * TODO:\n * Better centralize the documentation about what kinds of merge semantics are available for field kinds.\n * Maybe link editor?\n */\nexport interface FlexTreeOptionalField extends FlexTreeField {\n\tget content(): FlexTreeUnknownUnboxed | undefined;\n\n\treadonly editor: OptionalFieldEditBuilder<FlexibleNodeContent>;\n}\n\n// #endregion\n\n// #region Typed\n\n/**\n * Schema aware specialization of {@link FlexTreeField}.\n */\nexport type FlexTreeTypedField<Kind extends FlexFieldKind> =\n\tKind extends typeof FieldKinds.sequence\n\t\t? FlexTreeSequenceField\n\t\t: Kind extends typeof FieldKinds.required | typeof FieldKinds.identifier\n\t\t\t? FlexTreeRequiredField\n\t\t\t: Kind extends typeof FieldKinds.optional\n\t\t\t\t? FlexTreeOptionalField\n\t\t\t\t: FlexTreeField;\n\n// #endregion\n\n/**\n * Unboxed tree type for unknown schema cases.\n */\nexport type FlexTreeUnknownUnboxed = TreeValue | FlexTreeNode;\n"]}
1
+ {"version":3,"file":"flexTreeTypes.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/flexTreeTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kDAQ6B;AAgB7B;;;GAGG;AACU,QAAA,YAAY,GAAG,IAAA,qBAAU,GAAwB,CAAC;AAE/D;;GAEG;AACU,QAAA,cAAc,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAEvD,SAAS,gBAAgB,CAAC,CAAU;IACnC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,sBAAc,IAAI,CAAC,CAAC;AACnE,CAAC;AAED,SAAgB,cAAc,CAAC,CAAU;IACxC,OAAO,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,sBAAc,CAAC,KAAK,kBAAkB,CAAC,IAAI,CAAC;AAC7E,CAAC;AAFD,wCAEC;AAED,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC7B,2DAAI,CAAA;IACJ,6DAAK,CAAA;AACN,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAqCD;;;GAGG;AACH,IAAY,UA+CX;AA/CD,WAAY,UAAU;IACrB;;OAEG;IACH,uDAAc,CAAA;IAEd;;OAEG;IACH,iDAAW,CAAA;IAEX;;;;;;;;;;;;;;OAcG;IACH,iDAAW,CAAA;IAEX;;;;;;;;;;;;;;;;;OAiBG;IACH,yCAAO,CAAA;AACR,CAAC,EA/CW,UAAU,0BAAV,UAAU,QA+CrB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype AnchorNode,\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype ITreeCursorSynchronous,\n\ttype NormalizedFieldUpPath,\n\ttype TreeValue,\n\tanchorSlot,\n} from \"../../core/index.js\";\nimport type {\n\tFieldKinds,\n\tSequenceFieldEditor,\n\tRequiredFieldEditor,\n\tOptionalFieldEditor,\n} from \"../default-schema/index.js\";\nimport type {\n\tMapTreeFieldViewGeneric,\n\tMapTreeNodeViewGeneric,\n\tMinimalFieldMap,\n} from \"../mapTreeCursor.js\";\nimport type { FlexFieldKind } from \"../modular-schema/index.js\";\n\nimport type { FlexTreeContext, FlexTreeHydratedContext } from \"./context.js\";\n\n/**\n * An anchor slot which records the {@link FlexTreeNode} associated with that anchor, if there is one.\n * @remarks This always points to a \"real\" {@link FlexTreeNode} (i.e. a `LazyTreeNode`), never to a \"raw\" node.\n */\nexport const flexTreeSlot = anchorSlot<HydratedFlexTreeNode>();\n\n/**\n * Indicates that an object is a flex tree.\n */\nexport const flexTreeMarker = Symbol(\"flexTreeMarker\");\n\nfunction isFlexTreeEntity(t: unknown): t is FlexTreeEntity {\n\treturn typeof t === \"object\" && t !== null && flexTreeMarker in t;\n}\n\nexport function isFlexTreeNode(t: unknown): t is FlexTreeNode {\n\treturn isFlexTreeEntity(t) && t[flexTreeMarker] === FlexTreeEntityKind.Node;\n}\n\nexport enum FlexTreeEntityKind {\n\tNode,\n\tField,\n}\n\n/**\n * Part of a tree.\n * Iterates over children.\n *\n * @privateRemarks\n * This exists mainly as a place to share common members between nodes and fields.\n * It is not expected to be useful or common to write code which handles this type directly.\n * If this assumption turns out to be false, and generically processing `UntypedEntity`s is useful,\n * then this interface should probably be extended with some down casting functionality (like `is`).\n *\n * TODO:\n * Design and document iterator invalidation rules and ordering rules.\n * Providing a custom iterator type with place anchor semantics would be a good approach.\n */\nexport interface FlexTreeEntity {\n\t/**\n\t * Indicates that an object is a specific kind of flex tree FlexTreeEntity.\n\t * This makes it possible to both down cast FlexTreeEntities safely as well as validate if an object is or is not a FlexTreeEntity.\n\t */\n\treadonly [flexTreeMarker]: FlexTreeEntityKind;\n\n\t/**\n\t * A common context of FlexTrees.\n\t */\n\treadonly context: FlexTreeContext;\n\n\t/**\n\t * Get a cursor for the underlying data.\n\t * @remarks\n\t * This cursor might be one the node uses in its implementation, and thus must be returned to its original location before using any other APIs to interact with the tree.\n\t * Must not be held onto across edits or any other tree API use.\n\t */\n\tborrowCursor(): ITreeCursorSynchronous;\n}\n\n/**\n * Status of the tree that a particular node belongs to.\n * @public\n */\nexport enum TreeStatus {\n\t/**\n\t * Is parented under the root field.\n\t */\n\tInDocument = 0,\n\n\t/**\n\t * Is not parented under the root field, but can be added back to the original document tree.\n\t */\n\tRemoved = 1,\n\n\t/**\n\t * Is removed and cannot be added back to the original document tree.\n\t * @remarks\n\t * Nodes can enter this state for multiple reasons:\n\t * - The node was removed and nothing (e.g. undo/redo history) kept it from being cleaned up.\n\t * - The {@link TreeView} was disposed or had a schema change which made the tree incompatible.\n\t *\n\t * Deleted nodes' contents should not be observed or edited. This includes functionality exposed via {@link (Tree:variable)},\n\t * with the exception of {@link TreeNodeApi.status}.\n\t *\n\t * @privateRemarks\n\t * There was planned work (AB#17948) to make the first reason a node could become \"Deleted\" impossible,\n\t * at least as an opt in feature,\n\t * by lifetime extending all nodes which are still possible to reach automatically.\n\t */\n\tDeleted = 2,\n\n\t/**\n\t * Is created but has not yet been inserted into the tree.\n\t * @remarks\n\t * See also {@link Unhydrated}.\n\t *\n\t * Nodes in the new state have some limitations:\n\t *\n\t * - Events are not currently triggered for changes. Fixes for this are planned.\n\t *\n\t * - Reading identifiers from nodes which were left unspecified (defaulted) when creating the tree will error.\n\t * This is because allocating unique identifiers in a compressible manner requires knowing which tree the nodes will be inserted into.\n\t *\n\t * - Transactions do not work: transactions apply to a single {@link TreeView}, and `New` nodes are not part of one.\n\t *\n\t * - Automatically generated {@link SchemaFactory.identifier | identifiers} will be less compressible if read.\n\t *\n\t * - {@link TreeIdentifierUtils.getShort} and {@link TreeNodeApi.shortId | Tree.shortId} cannot return their short identifiers.\n\t */\n\tNew = 3,\n}\n\n/**\n * Generic tree node API.\n *\n * Nodes are (shallowly) immutable and have a logical identity, a type and either a value or fields under string keys.\n *\n * This \"logical identity\" is exposed as the object identity: if a node is moved within a document,\n * the same {@link FlexTreeNode} instance will be used in the new location.\n * Similarly, edits applied to a node's sub-tree concurrently with the move of the node will still be applied to its subtree in its new location.\n *\n * @remarks\n * All editing is actually done via {@link FlexTreeField}s: the nodes are immutable other than that they contain mutable fields.\n *\n * All implementations should track read access in {@link currentObserver}'s observation methods as appropriate.\n */\nexport interface FlexTreeNode extends FlexTreeEntity, MapTreeNodeViewGeneric<FlexTreeNode> {\n\treadonly [flexTreeMarker]: FlexTreeEntityKind.Node;\n\n\t/**\n\t * Gets a field of this node, if it is not empty.\n\t */\n\ttryGetField(key: FieldKey): undefined | FlexTreeField;\n\n\t/**\n\t * Get the field for `key`.\n\t * @param key - which entry to look up.\n\t *\n\t * @remarks\n\t * All fields implicitly exist, so `getBoxed` can be called with any key and will always return a field.\n\t * Even if the field is empty, it will still be returned, and can be edited to insert content if allowed by the field kind.\n\t * See {@link FlexTreeNode.tryGetField} for a variant that does not allocate a field in the empty case.\n\t */\n\tgetBoxed(key: FieldKey): FlexTreeField;\n\n\t/**\n\t * The field this tree is in, and the index within that field.\n\t * @remarks\n\t * The behavior of this at the root (especially removed and unhydrated roots) is currently not very consistent.\n\t * Since very little relies on this, limit what it exposes to reduce the potential impact of inconsistent root handling.\n\t */\n\treadonly parentField: {\n\t\treadonly parent: Pick<FlexTreeField, \"parent\" | \"schema\" | \"key\">;\n\t\treadonly index: number;\n\t};\n\n\t/**\n\t * The non-empty fields on this node.\n\t */\n\treadonly fields: MinimalFieldMap<FlexTreeField>;\n\n\t/**\n\t * The non-empty fields on this node.\n\t */\n\t[Symbol.iterator](): IterableIterator<FlexTreeField>;\n\n\t/**\n\t * Returns an iterable of keys for non-empty fields.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, but `keys` will yield only the keys of fields which contain one or more nodes.\n\t *\n\t * No guarantees are made regarding the order of the keys returned.\n\t */\n\tkeys(): IterableIterator<FieldKey>;\n\n\t/**\n\t * If true, this node is a {@link HydratedFlexTreeNode}.\n\t *\n\t * If false, this node is unhydrated.\n\t */\n\tisHydrated(): this is HydratedFlexTreeNode;\n}\n\n/**\n * A FlexTreeNode that is hydrated, meaning it is associated with a {@link FlexTreeHydratedContext}.\n */\nexport interface HydratedFlexTreeNode extends FlexTreeNode {\n\t/**\n\t * {@inheritDoc FlexTreeNode.context}\n\t */\n\treadonly context: FlexTreeHydratedContext;\n\n\t/**\n\t * The anchor node associated with this node\n\t *\n\t * @remarks\n\t * The ref count keeping this alive is owned by the FlexTreeNode:\n\t * if holding onto this anchor for longer than the FlexTreeNode might be alive,\n\t * a separate Anchor (and thus ref count) must be allocated to keep it alive.\n\t */\n\treadonly anchorNode: AnchorNode;\n}\n\n/**\n * A collaboratively editable collection of nodes within a {@link FlexTreeEntity}.\n *\n * Fields are inherently part of their parent, and thus cannot be moved.\n * Instead their content can be moved, deleted or created.\n *\n * Editing operations are only valid on trees with the {@link TreeStatus#InDocument} `TreeStatus`.\n *\n * @remarks\n * Fields are used wherever an editable collection of nodes is required.\n * This is required in two places:\n * 1. To hold the children of non-leaf {@link FlexTreeNode}s.\n * 2. As the root of a {@link FlexTreeEntity}.\n *\n * Down-casting (via {@link FlexTreeField.is}) is required to access Schema-Aware APIs, including editing.\n * All content in the tree is accessible without down-casting, but if the schema is known,\n * the schema aware API may be more ergonomic.\n */\nexport interface FlexTreeField extends FlexTreeEntity, MapTreeFieldViewGeneric<FlexTreeNode> {\n\treadonly [flexTreeMarker]: FlexTreeEntityKind.Field;\n\n\t/**\n\t * The number of nodes in this field\n\t */\n\treadonly length: number;\n\n\t/**\n\t * The `FieldKey` this field is under.\n\t * Defines what part of its parent this field makes up.\n\t */\n\treadonly key: FieldKey;\n\n\t/**\n\t * The node which has this field on it under `fieldKey`.\n\t * `undefined` iff this field is a detached field.\n\t */\n\treadonly parent?: FlexTreeNode;\n\n\t/**\n\t * Type guard for narrowing / down-casting to a specific schema.\n\t */\n\tis<TKind extends FlexFieldKind>(kind: TKind): this is FlexTreeTypedField<TKind>;\n\n\t/**\n\t * Gets a node of this field by its index without unboxing.\n\t * @param index - Zero-based index of the item to retrieve. Negative values are interpreted from the end of the sequence.\n\t *\n\t * @returns The element in the sequence matching the given index. Always returns undefined if index \\< -sequence.length\n\t * or index \\>= sequence.length.\n\t *\n\t * @remarks\n\t * Semantics match {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at}.\n\t */\n\tboxedAt(index: number): FlexTreeNode | undefined;\n\n\t/**\n\t * Gets the FieldUpPath of a field.\n\t */\n\tgetFieldPath(): NormalizedFieldUpPath;\n\n\t/**\n\t * Schema for this entity.\n\t * If well-formed, it must follow this schema.\n\t */\n\treadonly schema: FieldKindIdentifier;\n}\n\n// #region Field Kinds\n\n/**\n * Typed tree for inserting as the content of a field.\n */\nexport type FlexibleFieldContent = readonly FlexibleNodeContent[];\n\n/**\n * Tree for inserting as a node.\n */\nexport type FlexibleNodeContent = FlexTreeNode;\n\n/**\n * {@link FlexTreeField} that stores a sequence of children.\n *\n * Sequence fields can contain an ordered sequence any number of {@link FlexTreeNode}s which must be of the {@link FlexAllowedTypes} from the {@link FlexFieldSchema}).\n *\n * @remarks\n * Allows for concurrent editing based on index, adjusting the locations of indexes as needed so they apply to the same logical place in the sequence when rebased and merged.\n *\n * Edits to sequence fields are anchored relative to their surroundings, so concurrent edits can result in the indexes of nodes and edits getting shifted.\n * To hold onto locations in sequence across an edit, use anchors.\n *\n * @privateRemarks\n * TODO:\n * Add anchor API that can actually hold onto locations in a sequence.\n * Currently only nodes can be held onto with anchors, and this does not replicate the behavior implemented for editing.\n */\nexport interface FlexTreeSequenceField extends FlexTreeField {\n\t/**\n\t * Gets a node of this field by its index with unboxing.\n\t * @param index - Zero-based index of the item to retrieve. Negative values are interpreted from the end of the sequence.\n\t *\n\t * @returns The element in the sequence matching the given index. Always returns undefined if index \\< -sequence.length\n\t * or index \\>= array.length.\n\t *\n\t * @remarks\n\t * Semantics match {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at}.\n\t */\n\tat(index: number): FlexTreeUnknownUnboxed | undefined;\n\n\t/**\n\t * {@inheritdoc FlexTreeField.boxedAt}\n\t */\n\tboxedAt(index: number): FlexTreeNode | undefined;\n\n\t/**\n\t * Calls the provided callback function on each child of this sequence, and returns an array that contains the results.\n\t * @param callbackfn - A function that accepts the child and its index.\n\t */\n\tmap<U>(callbackfn: (value: FlexTreeUnknownUnboxed, index: number) => U): U[];\n\n\t/**\n\t * Get an editor for this sequence.\n\t */\n\treadonly editor: SequenceFieldEditor<FlexibleFieldContent, readonly FlexTreeNode[]>;\n}\n\n/**\n * Field that stores exactly one child.\n *\n * @remarks\n * Unboxes its content, so in schema aware APIs which do unboxing, the RequiredField itself will be skipped over and its content will be returned directly.\n */\nexport interface FlexTreeRequiredField extends FlexTreeField {\n\tget content(): FlexTreeUnknownUnboxed;\n\n\treadonly editor: RequiredFieldEditor<FlexibleNodeContent, FlexTreeNode>;\n}\n\n/**\n * Field that stores zero or one child.\n *\n * @remarks\n * Unboxes its content, so in schema aware APIs which do unboxing, the OptionalField itself will be skipped over and its content will be returned directly.\n *\n * @privateRemarks\n * TODO: Document merge semitics\n * TODO: Allow Optional fields to be used with last write wins OR first write wins merge resolution.\n * TODO:\n * Better centralize the documentation about what kinds of merge semantics are available for field kinds.\n * Maybe link editor?\n */\nexport interface FlexTreeOptionalField extends FlexTreeField {\n\tget content(): FlexTreeUnknownUnboxed | undefined;\n\n\treadonly editor: OptionalFieldEditor<FlexibleNodeContent, FlexTreeNode>;\n}\n\n// #endregion\n\n// #region Typed\n\n/**\n * Schema aware specialization of {@link FlexTreeField}.\n */\nexport type FlexTreeTypedField<Kind extends FlexFieldKind> =\n\tKind extends typeof FieldKinds.sequence\n\t\t? FlexTreeSequenceField\n\t\t: Kind extends typeof FieldKinds.required | typeof FieldKinds.identifier\n\t\t\t? FlexTreeRequiredField\n\t\t\t: Kind extends typeof FieldKinds.optional\n\t\t\t\t? FlexTreeOptionalField\n\t\t\t\t: FlexTreeField;\n\n// #endregion\n\n/**\n * Unboxed tree type for unknown schema cases.\n */\nexport type FlexTreeUnknownUnboxed = TreeValue | FlexTreeNode;\n"]}
@@ -2,11 +2,12 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type ExclusiveMapTree, type FieldAnchor, type FieldKey, type FieldKindIdentifier, type ITreeCursorSynchronous, type ITreeSubscriptionCursor, type NormalizedFieldUpPath, type TreeNavigationResult } from "../../core/index.js";
6
- import { type IDefaultEditBuilder, type OptionalFieldEditBuilder, type SequenceFieldEditBuilder, type ValueFieldEditBuilder } from "../default-schema/index.js";
5
+ import { type FieldAnchor, type FieldKey, type FieldKindIdentifier, type ITreeCursorSynchronous, type ITreeSubscriptionCursor, type NormalizedFieldUpPath, type TreeNavigationResult } from "../../core/index.js";
6
+ import { type SequenceFieldEditor, type RequiredFieldEditor, type DataEditor, type OptionalFieldEditor, type DetachedRootLocation, type DetachedRootsLocation } from "../default-schema/index.js";
7
+ import { type MinimalMapTreeNodeView } from "../mapTreeCursor.js";
7
8
  import type { FlexFieldKind } from "../modular-schema/index.js";
8
9
  import type { Context } from "./context.js";
9
- import { FlexTreeEntityKind, type FlexTreeField, type FlexTreeOptionalField, type FlexTreeRequiredField, type FlexTreeSequenceField, type FlexTreeTypedField, type FlexTreeUnknownUnboxed, type FlexibleFieldContent, type FlexibleNodeContent, type HydratedFlexTreeNode, flexTreeMarker } from "./flexTreeTypes.js";
10
+ import { FlexTreeEntityKind, type FlexTreeField, type FlexTreeNode, type FlexTreeOptionalField, type FlexTreeRequiredField, type FlexTreeSequenceField, type FlexTreeTypedField, type FlexTreeUnknownUnboxed, type FlexibleFieldContent, type FlexibleNodeContent, type HydratedFlexTreeNode, flexTreeMarker } from "./flexTreeTypes.js";
10
11
  import { LazyEntity } from "./lazyEntity.js";
11
12
  export declare function makeField(context: Context, schema: FieldKindIdentifier, cursor: ITreeSubscriptionCursor): FlexTreeField;
12
13
  /**
@@ -37,21 +38,21 @@ export declare abstract class LazyField extends LazyEntity<FieldAnchor> implemen
37
38
  * This path is not valid to hold onto across edits: this must be recalled for each edit.
38
39
  */
39
40
  getFieldPathForEditing(): NormalizedFieldUpPath;
40
- protected getEditor(): IDefaultEditBuilder<ITreeCursorSynchronous>;
41
+ protected getEditor(): DataEditor<ITreeCursorSynchronous, DetachedRootLocation, DetachedRootsLocation>;
41
42
  }
42
43
  export declare class LazySequence extends LazyField implements FlexTreeSequenceField {
43
44
  at(index: number): FlexTreeUnknownUnboxed | undefined;
44
45
  get asArray(): readonly FlexTreeUnknownUnboxed[];
45
- editor: SequenceFieldEditBuilder<FlexibleFieldContent>;
46
+ editor: SequenceFieldEditor<FlexibleFieldContent, readonly FlexTreeNode[]>;
46
47
  private sequenceEditor;
47
48
  }
48
49
  export declare class LazyValueField extends LazyField implements FlexTreeRequiredField {
49
- editor: ValueFieldEditBuilder<FlexibleNodeContent>;
50
+ editor: RequiredFieldEditor<FlexibleNodeContent, FlexTreeNode>;
50
51
  private valueFieldEditor;
51
52
  get content(): FlexTreeUnknownUnboxed;
52
53
  }
53
54
  export declare class LazyOptionalField extends LazyField implements FlexTreeOptionalField {
54
- editor: OptionalFieldEditBuilder<ExclusiveMapTree>;
55
+ editor: OptionalFieldEditor<MinimalMapTreeNodeView, FlexTreeNode>;
55
56
  private optionalEditor;
56
57
  get content(): FlexTreeUnknownUnboxed | undefined;
57
58
  }
@@ -1 +1 @@
1
- {"version":3,"file":"lazyField.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/lazyField.ts"],"names":[],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oB,EACpB,qBAAqB,CACrB;CAOD;AAOD,qBAAa,YAAa,SAAQ,SAAU,YAAW,qBAAqB;IACpE,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,sBAAsB,GAAG,SAAS;IAS5D,IAAW,OAAO,IAAI,SAAS,sBAAsB,EAAE,CAEtD;IAEM,MAAM,EAAE,mBAAmB,CAAC,oBAAoB,EAAE,SAAS,YAAY,EAAE,CAAC,CAc/E;IAEF,OAAO,CAAC,cAAc;CAOtB;AAED,qBAAa,cAAe,SAAQ,SAAU,YAAW,qBAAqB;IACtE,MAAM,EAAE,mBAAmB,CAAC,mBAAmB,EAAE,YAAY,CAAC,CAQnE;IAEF,OAAO,CAAC,gBAAgB;IAQxB,IAAW,OAAO,IAAI,sBAAsB,CAE3C;CACD;AAED,qBAAa,iBAAkB,SAAQ,SAAU,YAAW,qBAAqB;IACzE,MAAM,EAAE,mBAAmB,CAAC,sBAAsB,EAAE,YAAY,CAAC,CAkBtE;IAEF,OAAO,CAAC,cAAc;IAMtB,IAAW,OAAO,IAAI,sBAAsB,GAAG,SAAS,CAEvD;CACD;AAED,qBAAa,kBAAmB,SAAQ,SAAS;CAAG;AAoBpD;;GAEG;AACH,wBAAgB,eAAe,CAC9B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,uBAAuB,EAC/B,WAAW,EAAE,WAAW,GACtB,sBAAsB,CA8BxB"}
@@ -134,22 +134,29 @@ class LazyField extends lazyEntity_js_1.LazyEntity {
134
134
  */
135
135
  getFieldPathForEditing() {
136
136
  if (!this.isFreed()) {
137
- if (
138
137
  // Only allow editing if we are the root document field...
139
- (this.parent === undefined && this.anchor.fieldKey === index_js_1.rootFieldKey) ||
140
- // ...or are under a node in the document
141
- (this.parent !== undefined &&
142
- (0, utilities_js_1.treeStatusFromAnchorCache)(this.parent.anchorNode) === flexTreeTypes_js_1.TreeStatus.InDocument)) {
138
+ if (this.parent === undefined && this.anchor.fieldKey === index_js_1.rootFieldKey) {
143
139
  return this.getFieldPath();
144
140
  }
141
+ if (this.parent !== undefined) {
142
+ const status = (0, utilities_js_1.treeStatusFromAnchorCache)(this.parent.anchorNode);
143
+ // ...or are under a node that is hydrated and not deleted
144
+ if (status === flexTreeTypes_js_1.TreeStatus.InDocument || status === flexTreeTypes_js_1.TreeStatus.Removed) {
145
+ return this.getFieldPath();
146
+ }
147
+ }
145
148
  }
146
- throw new internal_2.UsageError("Editing only allowed on fields with TreeStatus.InDocument status");
149
+ throw new internal_2.UsageError("Editing only allowed on the root field or on fields under nodes with TreeStatus.InDocument or TreeStatus.Removed status");
147
150
  }
148
151
  getEditor() {
149
152
  return new index_js_3.MappedEditBuilder(this.context.checkout.editor, (cursor) => (0, index_js_4.combineChunks)(this.context.checkout.forest.chunkField(cursor)));
150
153
  }
151
154
  }
152
155
  exports.LazyField = LazyField;
156
+ function fieldFromNode(node) {
157
+ (0, internal_1.assert)(node instanceof lazyNode_js_1.LazyTreeNode, "Invalid tree type");
158
+ return node.anchorNode.parentField;
159
+ }
153
160
  class LazySequence extends LazyField {
154
161
  constructor() {
155
162
  super(...arguments);
@@ -160,6 +167,13 @@ class LazySequence extends LazyField {
160
167
  remove: (index, count) => {
161
168
  this.sequenceEditor().remove(index, count);
162
169
  },
170
+ attach: (index, content) => {
171
+ const contentLocations = content.map((node) => ({
172
+ field: fieldFromNode(node),
173
+ count: 1,
174
+ }));
175
+ this.sequenceEditor().attach(index, contentLocations);
176
+ },
163
177
  };
164
178
  }
165
179
  at(index) {
@@ -185,12 +199,15 @@ class LazyValueField extends LazyField {
185
199
  set: (newContent) => {
186
200
  this.valueFieldEditor().set((0, mapTreeCursor_js_1.cursorForMapTreeField)([newContent]));
187
201
  },
202
+ attach: (content) => {
203
+ const root = fieldFromNode(content);
204
+ this.valueFieldEditor().attach(root);
205
+ },
188
206
  };
189
207
  }
190
208
  valueFieldEditor() {
191
209
  const fieldPath = this.getFieldPathForEditing();
192
- const fieldEditor = this.getEditor().valueField(fieldPath);
193
- return fieldEditor;
210
+ return this.getEditor().valueField(fieldPath);
194
211
  }
195
212
  get content() {
196
213
  return this.atIndex(0);
@@ -204,6 +221,18 @@ class LazyOptionalField extends LazyField {
204
221
  set: (newContent, wasEmpty) => {
205
222
  this.optionalEditor().set(newContent !== undefined ? (0, mapTreeCursor_js_1.cursorForMapTreeField)([newContent]) : newContent, wasEmpty);
206
223
  },
224
+ attach: (content, wasEmpty) => {
225
+ if (content === undefined) {
226
+ this.optionalEditor().clear(wasEmpty);
227
+ }
228
+ else {
229
+ const root = fieldFromNode(content);
230
+ this.optionalEditor().attach(root, wasEmpty);
231
+ }
232
+ },
233
+ clear: (wasEmpty) => {
234
+ this.optionalEditor().clear(wasEmpty);
235
+ },
207
236
  };
208
237
  }
209
238
  optionalEditor() {