@fluidframework/tree 2.90.0-378676 → 2.91.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1244) hide show
  1. package/.vscode/settings.json +6 -5
  2. package/CHANGELOG.md +342 -0
  3. package/README.md +1 -1
  4. package/alpha.d.ts +2 -2
  5. package/api-extractor/api-extractor-lint-alpha.cjs.json +1 -1
  6. package/api-extractor/api-extractor-lint-alpha.esm.json +1 -1
  7. package/api-extractor/api-extractor-lint-beta.cjs.json +1 -1
  8. package/api-extractor/api-extractor-lint-beta.esm.json +1 -1
  9. package/api-extractor/api-extractor-lint-bundle.json +1 -1
  10. package/api-extractor/api-extractor-lint-legacy.cjs.json +1 -1
  11. package/api-extractor/api-extractor-lint-legacy.esm.json +1 -1
  12. package/api-extractor/api-extractor-lint-public.cjs.json +1 -1
  13. package/api-extractor/api-extractor-lint-public.esm.json +1 -1
  14. package/api-extractor/api-extractor.current.json +1 -1
  15. package/api-extractor/api-extractor.legacy.json +2 -1
  16. package/api-extractor.json +1 -0
  17. package/api-report/tree.alpha.api.md +144 -40
  18. package/api-report/tree.beta.api.md +30 -0
  19. package/api-report/tree.legacy.beta.api.md +30 -0
  20. package/beta.d.ts +2 -2
  21. package/dist/codec/codec.d.ts +2 -0
  22. package/dist/codec/codec.d.ts.map +1 -1
  23. package/dist/codec/codec.js +4 -3
  24. package/dist/codec/codec.js.map +1 -1
  25. package/dist/codec/index.d.ts +1 -1
  26. package/dist/codec/index.d.ts.map +1 -1
  27. package/dist/codec/index.js +2 -1
  28. package/dist/codec/index.js.map +1 -1
  29. package/dist/codec/versioned/codec.d.ts +13 -1
  30. package/dist/codec/versioned/codec.d.ts.map +1 -1
  31. package/dist/codec/versioned/codec.js +18 -3
  32. package/dist/codec/versioned/codec.js.map +1 -1
  33. package/dist/codec/versioned/format.d.ts +22 -1
  34. package/dist/codec/versioned/format.d.ts.map +1 -1
  35. package/dist/codec/versioned/format.js +16 -3
  36. package/dist/codec/versioned/format.js.map +1 -1
  37. package/dist/codec/versioned/index.d.ts +1 -1
  38. package/dist/codec/versioned/index.d.ts.map +1 -1
  39. package/dist/codec/versioned/index.js +2 -1
  40. package/dist/codec/versioned/index.js.map +1 -1
  41. package/dist/core/change-family/changeFamily.d.ts +1 -4
  42. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  43. package/dist/core/change-family/changeFamily.js.map +1 -1
  44. package/dist/core/change-family/index.d.ts +1 -1
  45. package/dist/core/change-family/index.d.ts.map +1 -1
  46. package/dist/core/change-family/index.js.map +1 -1
  47. package/dist/core/index.d.ts +3 -4
  48. package/dist/core/index.d.ts.map +1 -1
  49. package/dist/core/index.js +4 -8
  50. package/dist/core/index.js.map +1 -1
  51. package/dist/core/rebase/changeRebaser.d.ts +1 -6
  52. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  53. package/dist/core/rebase/changeRebaser.js.map +1 -1
  54. package/dist/core/rebase/index.d.ts +1 -1
  55. package/dist/core/rebase/index.d.ts.map +1 -1
  56. package/dist/core/rebase/index.js +1 -2
  57. package/dist/core/rebase/index.js.map +1 -1
  58. package/dist/core/rebase/types.d.ts +78 -1
  59. package/dist/core/rebase/types.d.ts.map +1 -1
  60. package/dist/core/rebase/types.js +1 -5
  61. package/dist/core/rebase/types.js.map +1 -1
  62. package/dist/core/rebase/utils.d.ts.map +1 -1
  63. package/dist/core/rebase/utils.js +7 -25
  64. package/dist/core/rebase/utils.js.map +1 -1
  65. package/dist/core/tree/delta.d.ts +0 -5
  66. package/dist/core/tree/delta.d.ts.map +1 -1
  67. package/dist/core/tree/delta.js.map +1 -1
  68. package/dist/core/tree/detachedFieldIndex.d.ts +1 -13
  69. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  70. package/dist/core/tree/detachedFieldIndex.js +1 -14
  71. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  72. package/dist/core/tree/detachedFieldIndexTypes.d.ts +0 -4
  73. package/dist/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
  74. package/dist/core/tree/detachedFieldIndexTypes.js.map +1 -1
  75. package/dist/core/tree/index.d.ts +2 -2
  76. package/dist/core/tree/index.d.ts.map +1 -1
  77. package/dist/core/tree/index.js +3 -4
  78. package/dist/core/tree/index.js.map +1 -1
  79. package/dist/core/tree/pathTree.d.ts +3 -11
  80. package/dist/core/tree/pathTree.d.ts.map +1 -1
  81. package/dist/core/tree/pathTree.js +2 -14
  82. package/dist/core/tree/pathTree.js.map +1 -1
  83. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  84. package/dist/core/tree/visitDelta.js +13 -17
  85. package/dist/core/tree/visitDelta.js.map +1 -1
  86. package/dist/entrypoints/alpha.d.ts +6 -0
  87. package/dist/entrypoints/alpha.d.ts.map +1 -0
  88. package/dist/entrypoints/alpha.js +92 -0
  89. package/dist/entrypoints/alpha.js.map +1 -0
  90. package/dist/entrypoints/beta.d.ts +6 -0
  91. package/dist/entrypoints/beta.d.ts.map +1 -0
  92. package/dist/entrypoints/beta.js +43 -0
  93. package/dist/entrypoints/beta.js.map +1 -0
  94. package/{lib/core/schema-view/index.js → dist/entrypoints/internal.d.ts} +2 -2
  95. package/dist/entrypoints/internal.d.ts.map +1 -0
  96. package/dist/entrypoints/internal.js +28 -0
  97. package/dist/entrypoints/internal.js.map +1 -0
  98. package/dist/entrypoints/legacy.d.ts +6 -0
  99. package/dist/entrypoints/legacy.d.ts.map +1 -0
  100. package/dist/entrypoints/legacy.js +49 -0
  101. package/dist/entrypoints/legacy.js.map +1 -0
  102. package/dist/entrypoints/public.d.ts +6 -0
  103. package/dist/entrypoints/public.d.ts.map +1 -0
  104. package/dist/entrypoints/public.js +27 -0
  105. package/dist/entrypoints/public.js.map +1 -0
  106. package/dist/feature-libraries/changeAtomIdBTree.d.ts +2 -3
  107. package/dist/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  108. package/dist/feature-libraries/changeAtomIdBTree.js +2 -15
  109. package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -1
  110. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +8 -7
  111. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  112. package/dist/feature-libraries/chunked-forest/codec/codecs.js +22 -44
  113. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  114. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  115. package/dist/feature-libraries/chunked-forest/codec/format.js +11 -0
  116. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  117. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +3 -2
  118. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  119. package/dist/feature-libraries/chunked-forest/codec/index.js +2 -4
  120. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  121. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  122. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  123. package/dist/feature-libraries/chunked-forest/index.js +2 -4
  124. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  125. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +44 -92
  126. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  127. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +70 -220
  128. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  129. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  130. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +2 -12
  131. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  132. package/dist/feature-libraries/default-schema/index.d.ts +1 -2
  133. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  134. package/dist/feature-libraries/default-schema/index.js +2 -4
  135. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  136. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +6 -7
  137. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  138. package/dist/feature-libraries/default-schema/mappedEditBuilder.js +0 -15
  139. package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  140. package/dist/feature-libraries/deltaUtils.d.ts +0 -1
  141. package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
  142. package/dist/feature-libraries/deltaUtils.js +1 -6
  143. package/dist/feature-libraries/deltaUtils.js.map +1 -1
  144. package/dist/feature-libraries/flex-tree/context.d.ts +0 -9
  145. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  146. package/dist/feature-libraries/flex-tree/context.js +0 -6
  147. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  148. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  149. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  150. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  151. package/dist/feature-libraries/flex-tree/lazyField.d.ts +7 -8
  152. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  153. package/dist/feature-libraries/flex-tree/lazyField.js +8 -39
  154. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  155. package/dist/feature-libraries/flex-tree/observer.d.ts +17 -0
  156. package/dist/feature-libraries/flex-tree/observer.d.ts.map +1 -1
  157. package/dist/feature-libraries/flex-tree/observer.js.map +1 -1
  158. package/dist/feature-libraries/forest-summary/codec.d.ts +5 -12
  159. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  160. package/dist/feature-libraries/forest-summary/codec.js +33 -33
  161. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  162. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -2
  163. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  164. package/dist/feature-libraries/forest-summary/forestSummarizer.js +6 -7
  165. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  166. package/dist/feature-libraries/forest-summary/formatCommon.d.ts +6 -4
  167. package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  168. package/dist/feature-libraries/forest-summary/formatCommon.js +13 -11
  169. package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  170. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +19 -14
  171. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  172. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +31 -48
  173. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  174. package/dist/feature-libraries/forest-summary/index.d.ts +1 -1
  175. package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
  176. package/dist/feature-libraries/forest-summary/index.js +2 -2
  177. package/dist/feature-libraries/forest-summary/index.js.map +1 -1
  178. package/dist/feature-libraries/index.d.ts +6 -6
  179. package/dist/feature-libraries/index.d.ts.map +1 -1
  180. package/dist/feature-libraries/index.js +6 -11
  181. package/dist/feature-libraries/index.js.map +1 -1
  182. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +3 -3
  183. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  184. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  185. package/dist/feature-libraries/indexing/index.d.ts +1 -1
  186. package/dist/feature-libraries/indexing/index.d.ts.map +1 -1
  187. package/dist/feature-libraries/indexing/index.js.map +1 -1
  188. package/dist/feature-libraries/indexing/types.d.ts +15 -13
  189. package/dist/feature-libraries/indexing/types.d.ts.map +1 -1
  190. package/dist/feature-libraries/indexing/types.js.map +1 -1
  191. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  192. package/dist/feature-libraries/mitigatedChangeFamily.js +2 -2
  193. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  194. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +24 -100
  195. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  196. package/dist/feature-libraries/modular-schema/crossFieldQueries.js +12 -8
  197. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  198. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +1 -0
  199. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -1
  200. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js +14 -6
  201. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
  202. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +51 -85
  203. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  204. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  205. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  206. package/dist/feature-libraries/modular-schema/genericFieldKind.js +9 -4
  207. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  208. package/dist/feature-libraries/modular-schema/index.d.ts +3 -3
  209. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  210. package/dist/feature-libraries/modular-schema/index.js +3 -2
  211. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  212. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +22 -18
  213. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  214. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +158 -276
  215. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  216. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  217. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -1
  218. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  219. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +0 -1
  220. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  221. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +0 -8
  222. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  223. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +22 -56
  224. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  225. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +468 -1392
  226. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  227. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  228. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  229. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +2 -1
  230. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
  231. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +3 -3
  232. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
  233. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +10 -49
  234. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  235. package/dist/feature-libraries/modular-schema/modularChangeTypes.js +3 -3
  236. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  237. package/dist/feature-libraries/optional-field/optionalField.d.ts +32 -13
  238. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  239. package/dist/feature-libraries/optional-field/optionalField.js +446 -257
  240. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  241. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +31 -31
  242. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  243. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  244. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  245. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  246. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +28 -57
  247. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  248. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  249. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
  250. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  251. package/dist/feature-libraries/optional-field/requiredField.d.ts +2 -3
  252. package/dist/feature-libraries/optional-field/requiredField.d.ts.map +1 -1
  253. package/dist/feature-libraries/optional-field/requiredField.js +1 -6
  254. package/dist/feature-libraries/optional-field/requiredField.js.map +1 -1
  255. package/dist/feature-libraries/sequence-field/compose.d.ts +7 -6
  256. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  257. package/dist/feature-libraries/sequence-field/compose.js +259 -81
  258. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  259. package/dist/feature-libraries/sequence-field/helperTypes.d.ts +10 -14
  260. package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  261. package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  262. package/dist/feature-libraries/sequence-field/invert.d.ts +3 -3
  263. package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  264. package/dist/feature-libraries/sequence-field/invert.js +167 -65
  265. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  266. package/dist/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  267. package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  268. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  269. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +56 -4
  270. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  271. package/dist/feature-libraries/sequence-field/moveEffectTable.js +90 -7
  272. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  273. package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -3
  274. package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  275. package/dist/feature-libraries/sequence-field/rebase.js +116 -109
  276. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  277. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +9 -0
  278. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -0
  279. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +50 -0
  280. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -0
  281. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  282. package/dist/feature-libraries/sequence-field/replaceRevisions.js +32 -19
  283. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  284. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  285. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +2 -1
  286. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  287. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -22
  288. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  289. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +187 -388
  290. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  291. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  292. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +62 -20
  293. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  294. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  295. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  296. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +13 -13
  297. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  298. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +2 -3
  299. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  300. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +111 -16
  301. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  302. package/dist/feature-libraries/sequence-field/types.d.ts +74 -37
  303. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  304. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  305. package/dist/feature-libraries/sequence-field/utils.d.ts +25 -20
  306. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  307. package/dist/feature-libraries/sequence-field/utils.js +320 -159
  308. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  309. package/dist/index.d.ts +9 -3
  310. package/dist/index.d.ts.map +1 -1
  311. package/dist/index.js +4 -2
  312. package/dist/index.js.map +1 -1
  313. package/dist/packageVersion.d.ts +1 -1
  314. package/dist/packageVersion.d.ts.map +1 -1
  315. package/dist/packageVersion.js +1 -1
  316. package/dist/packageVersion.js.map +1 -1
  317. package/dist/shared-tree/independentView.d.ts.map +1 -1
  318. package/dist/shared-tree/independentView.js +3 -3
  319. package/dist/shared-tree/independentView.js.map +1 -1
  320. package/dist/shared-tree/index.d.ts +1 -1
  321. package/dist/shared-tree/index.d.ts.map +1 -1
  322. package/dist/shared-tree/index.js.map +1 -1
  323. package/dist/shared-tree/schematizeTree.d.ts +4 -4
  324. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  325. package/dist/shared-tree/schematizeTree.js +1 -2
  326. package/dist/shared-tree/schematizeTree.js.map +1 -1
  327. package/dist/shared-tree/schematizingTreeView.d.ts +10 -1
  328. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  329. package/dist/shared-tree/schematizingTreeView.js +70 -28
  330. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  331. package/dist/shared-tree/sharedTree.d.ts +3 -9
  332. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  333. package/dist/shared-tree/sharedTree.js +8 -11
  334. package/dist/shared-tree/sharedTree.js.map +1 -1
  335. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +0 -1
  336. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  337. package/dist/shared-tree/sharedTreeChangeCodecs.js +0 -8
  338. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  339. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
  340. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  341. package/dist/shared-tree/sharedTreeChangeFamily.js +2 -2
  342. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  343. package/dist/shared-tree/sharedTreeEditBuilder.d.ts +6 -16
  344. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  345. package/dist/shared-tree/sharedTreeEditBuilder.js +7 -14
  346. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  347. package/dist/shared-tree/tree.js +1 -1
  348. package/dist/shared-tree/tree.js.map +1 -1
  349. package/dist/shared-tree/treeAlpha.d.ts +8 -1
  350. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  351. package/dist/shared-tree/treeAlpha.js +48 -8
  352. package/dist/shared-tree/treeAlpha.js.map +1 -1
  353. package/dist/shared-tree/treeCheckout.d.ts +46 -16
  354. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  355. package/dist/shared-tree/treeCheckout.js +131 -74
  356. package/dist/shared-tree/treeCheckout.js.map +1 -1
  357. package/dist/shared-tree/unhydratedTreeContext.d.ts +20 -0
  358. package/dist/shared-tree/unhydratedTreeContext.d.ts.map +1 -0
  359. package/dist/shared-tree/unhydratedTreeContext.js +56 -0
  360. package/dist/shared-tree/unhydratedTreeContext.js.map +1 -0
  361. package/dist/shared-tree-core/branch.d.ts +2 -3
  362. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  363. package/dist/shared-tree-core/branch.js +3 -4
  364. package/dist/shared-tree-core/branch.js.map +1 -1
  365. package/dist/shared-tree-core/editManager.d.ts +2 -2
  366. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  367. package/dist/shared-tree-core/editManager.js +9 -9
  368. package/dist/shared-tree-core/editManager.js.map +1 -1
  369. package/dist/shared-tree-core/editManagerCodecs.d.ts +0 -4
  370. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  371. package/dist/shared-tree-core/editManagerCodecs.js +2 -10
  372. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  373. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +0 -1
  374. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  375. package/dist/shared-tree-core/editManagerFormatCommons.js +0 -6
  376. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  377. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  378. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  379. package/dist/shared-tree-core/editManagerFormatV1toV4.js +0 -1
  380. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  381. package/dist/shared-tree-core/index.d.ts +2 -2
  382. package/dist/shared-tree-core/index.d.ts.map +1 -1
  383. package/dist/shared-tree-core/index.js +1 -3
  384. package/dist/shared-tree-core/index.js.map +1 -1
  385. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  386. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  387. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  388. package/dist/shared-tree-core/messageCodecs.d.ts +0 -4
  389. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  390. package/dist/shared-tree-core/messageCodecs.js +2 -10
  391. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  392. package/dist/shared-tree-core/messageFormat.d.ts +0 -1
  393. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  394. package/dist/shared-tree-core/messageFormat.js +0 -6
  395. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  396. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +2 -2
  397. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  398. package/dist/shared-tree-core/messageFormatV1ToV4.js +0 -1
  399. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  400. package/dist/shared-tree-core/sharedTreeCore.d.ts +0 -1
  401. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  402. package/dist/shared-tree-core/sharedTreeCore.js +1 -1
  403. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  404. package/dist/shared-tree-core/transaction.d.ts +15 -27
  405. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  406. package/dist/shared-tree-core/transaction.js +7 -11
  407. package/dist/shared-tree-core/transaction.js.map +1 -1
  408. package/dist/simple-tree/api/configuration.d.ts +4 -0
  409. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  410. package/dist/simple-tree/api/configuration.js.map +1 -1
  411. package/dist/simple-tree/api/eraseSchemaDetails.d.ts +43 -0
  412. package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  413. package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  414. package/dist/simple-tree/api/identifierIndex.d.ts +2 -2
  415. package/dist/simple-tree/api/identifierIndex.d.ts.map +1 -1
  416. package/dist/simple-tree/api/identifierIndex.js +1 -1
  417. package/dist/simple-tree/api/identifierIndex.js.map +1 -1
  418. package/dist/simple-tree/api/index.d.ts +6 -5
  419. package/dist/simple-tree/api/index.d.ts.map +1 -1
  420. package/dist/simple-tree/api/index.js +2 -2
  421. package/dist/simple-tree/api/index.js.map +1 -1
  422. package/dist/simple-tree/api/schemaFactory.d.ts +3 -2
  423. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  424. package/dist/simple-tree/api/schemaFactory.js +3 -2
  425. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  426. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +125 -28
  427. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  428. package/dist/simple-tree/api/schemaFactoryAlpha.js +72 -7
  429. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  430. package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  431. package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  432. package/dist/simple-tree/api/schemaStatics.d.ts +10 -11
  433. package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
  434. package/dist/simple-tree/api/schemaStatics.js +13 -7
  435. package/dist/simple-tree/api/schemaStatics.js.map +1 -1
  436. package/dist/simple-tree/api/simpleTreeIndex.d.ts +15 -13
  437. package/dist/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
  438. package/dist/simple-tree/api/simpleTreeIndex.js +4 -4
  439. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  440. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +4 -4
  441. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +2 -2
  442. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  443. package/dist/simple-tree/api/transactionTypes.d.ts +22 -25
  444. package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
  445. package/dist/simple-tree/api/transactionTypes.js.map +1 -1
  446. package/dist/simple-tree/api/tree.d.ts +69 -132
  447. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  448. package/dist/simple-tree/api/tree.js.map +1 -1
  449. package/dist/simple-tree/api/typesUnsafe.d.ts +23 -2
  450. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  451. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  452. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +12 -16
  453. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  454. package/dist/simple-tree/core/unhydratedFlexTree.js +8 -59
  455. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  456. package/dist/simple-tree/fieldSchema.d.ts +7 -6
  457. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  458. package/dist/simple-tree/fieldSchema.js +3 -4
  459. package/dist/simple-tree/fieldSchema.js.map +1 -1
  460. package/dist/simple-tree/index.d.ts +4 -4
  461. package/dist/simple-tree/index.d.ts.map +1 -1
  462. package/dist/simple-tree/index.js +3 -3
  463. package/dist/simple-tree/index.js.map +1 -1
  464. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  465. package/dist/simple-tree/node-kinds/array/arrayNode.js +3 -5
  466. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  467. package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
  468. package/dist/simple-tree/node-kinds/common.js +1 -1
  469. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  470. package/dist/simple-tree/node-kinds/index.d.ts +1 -1
  471. package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
  472. package/dist/simple-tree/node-kinds/index.js.map +1 -1
  473. package/dist/simple-tree/node-kinds/map/mapNode.js +2 -2
  474. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  475. package/dist/simple-tree/node-kinds/object/index.d.ts +2 -2
  476. package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  477. package/dist/simple-tree/node-kinds/object/index.js.map +1 -1
  478. package/dist/simple-tree/node-kinds/object/objectNode.d.ts +43 -7
  479. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  480. package/dist/simple-tree/node-kinds/object/objectNode.js +19 -19
  481. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  482. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +26 -2
  483. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  484. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  485. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  486. package/dist/simple-tree/node-kinds/record/recordNode.js +2 -4
  487. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  488. package/dist/simple-tree/prepareForInsertion.d.ts +47 -54
  489. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  490. package/dist/simple-tree/prepareForInsertion.js +125 -183
  491. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  492. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +3 -8
  493. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  494. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +13 -27
  495. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  496. package/dist/text/textDomain.d.ts +27 -9
  497. package/dist/text/textDomain.d.ts.map +1 -1
  498. package/dist/text/textDomain.js +43 -7
  499. package/dist/text/textDomain.js.map +1 -1
  500. package/dist/text/textDomainFormatted.d.ts +16 -12
  501. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  502. package/dist/text/textDomainFormatted.js +97 -25
  503. package/dist/text/textDomainFormatted.js.map +1 -1
  504. package/dist/treeFactory.d.ts.map +1 -1
  505. package/dist/treeFactory.js +2 -12
  506. package/dist/treeFactory.js.map +1 -1
  507. package/dist/util/index.d.ts +1 -1
  508. package/dist/util/index.d.ts.map +1 -1
  509. package/dist/util/index.js +1 -2
  510. package/dist/util/index.js.map +1 -1
  511. package/dist/util/rangeMap.d.ts +10 -14
  512. package/dist/util/rangeMap.d.ts.map +1 -1
  513. package/dist/util/rangeMap.js +22 -62
  514. package/dist/util/rangeMap.js.map +1 -1
  515. package/dist/util/typeCheck.d.ts.map +1 -1
  516. package/dist/util/typeCheck.js.map +1 -1
  517. package/dist/util/typeUtils.d.ts.map +1 -1
  518. package/dist/util/typeUtils.js.map +1 -1
  519. package/docs/main/sequence-field/move-composition.md +46 -0
  520. package/eslint.config.mts +10 -2
  521. package/internal.d.ts +2 -2
  522. package/legacy.d.ts +4 -3
  523. package/lib/codec/codec.d.ts +2 -0
  524. package/lib/codec/codec.d.ts.map +1 -1
  525. package/lib/codec/codec.js +4 -3
  526. package/lib/codec/codec.js.map +1 -1
  527. package/lib/codec/index.d.ts +1 -1
  528. package/lib/codec/index.d.ts.map +1 -1
  529. package/lib/codec/index.js +1 -1
  530. package/lib/codec/index.js.map +1 -1
  531. package/lib/codec/versioned/codec.d.ts +13 -1
  532. package/lib/codec/versioned/codec.d.ts.map +1 -1
  533. package/lib/codec/versioned/codec.js +18 -3
  534. package/lib/codec/versioned/codec.js.map +1 -1
  535. package/lib/codec/versioned/format.d.ts +22 -1
  536. package/lib/codec/versioned/format.d.ts.map +1 -1
  537. package/lib/codec/versioned/format.js +15 -2
  538. package/lib/codec/versioned/format.js.map +1 -1
  539. package/lib/codec/versioned/index.d.ts +1 -1
  540. package/lib/codec/versioned/index.d.ts.map +1 -1
  541. package/lib/codec/versioned/index.js +1 -1
  542. package/lib/codec/versioned/index.js.map +1 -1
  543. package/lib/core/change-family/changeFamily.d.ts +1 -4
  544. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  545. package/lib/core/change-family/changeFamily.js.map +1 -1
  546. package/lib/core/change-family/index.d.ts +1 -1
  547. package/lib/core/change-family/index.d.ts.map +1 -1
  548. package/lib/core/change-family/index.js.map +1 -1
  549. package/lib/core/index.d.ts +3 -4
  550. package/lib/core/index.d.ts.map +1 -1
  551. package/lib/core/index.js +2 -3
  552. package/lib/core/index.js.map +1 -1
  553. package/lib/core/rebase/changeRebaser.d.ts +1 -6
  554. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  555. package/lib/core/rebase/changeRebaser.js.map +1 -1
  556. package/lib/core/rebase/index.d.ts +1 -1
  557. package/lib/core/rebase/index.d.ts.map +1 -1
  558. package/lib/core/rebase/index.js +1 -1
  559. package/lib/core/rebase/index.js.map +1 -1
  560. package/lib/core/rebase/types.d.ts +78 -1
  561. package/lib/core/rebase/types.d.ts.map +1 -1
  562. package/lib/core/rebase/types.js +0 -3
  563. package/lib/core/rebase/types.js.map +1 -1
  564. package/lib/core/rebase/utils.d.ts.map +1 -1
  565. package/lib/core/rebase/utils.js +7 -25
  566. package/lib/core/rebase/utils.js.map +1 -1
  567. package/lib/core/tree/delta.d.ts +0 -5
  568. package/lib/core/tree/delta.d.ts.map +1 -1
  569. package/lib/core/tree/delta.js.map +1 -1
  570. package/lib/core/tree/detachedFieldIndex.d.ts +1 -13
  571. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  572. package/lib/core/tree/detachedFieldIndex.js +2 -15
  573. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  574. package/lib/core/tree/detachedFieldIndexTypes.d.ts +0 -4
  575. package/lib/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
  576. package/lib/core/tree/detachedFieldIndexTypes.js.map +1 -1
  577. package/lib/core/tree/index.d.ts +2 -2
  578. package/lib/core/tree/index.d.ts.map +1 -1
  579. package/lib/core/tree/index.js +1 -1
  580. package/lib/core/tree/index.js.map +1 -1
  581. package/lib/core/tree/pathTree.d.ts +3 -11
  582. package/lib/core/tree/pathTree.d.ts.map +1 -1
  583. package/lib/core/tree/pathTree.js +1 -12
  584. package/lib/core/tree/pathTree.js.map +1 -1
  585. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  586. package/lib/core/tree/visitDelta.js +13 -17
  587. package/lib/core/tree/visitDelta.js.map +1 -1
  588. package/lib/entrypoints/alpha.d.ts +6 -0
  589. package/lib/entrypoints/alpha.d.ts.map +1 -0
  590. package/lib/entrypoints/alpha.js +12 -0
  591. package/lib/entrypoints/alpha.js.map +1 -0
  592. package/lib/entrypoints/beta.d.ts +6 -0
  593. package/lib/entrypoints/beta.d.ts.map +1 -0
  594. package/lib/entrypoints/beta.js +12 -0
  595. package/lib/entrypoints/beta.js.map +1 -0
  596. package/{src/core/schema-view/index.ts → lib/entrypoints/internal.d.ts} +2 -6
  597. package/lib/entrypoints/internal.d.ts.map +1 -0
  598. package/lib/entrypoints/internal.js +12 -0
  599. package/lib/entrypoints/internal.js.map +1 -0
  600. package/lib/entrypoints/legacy.d.ts +6 -0
  601. package/lib/entrypoints/legacy.d.ts.map +1 -0
  602. package/lib/entrypoints/legacy.js +15 -0
  603. package/lib/entrypoints/legacy.js.map +1 -0
  604. package/lib/entrypoints/public.d.ts +6 -0
  605. package/lib/entrypoints/public.d.ts.map +1 -0
  606. package/lib/entrypoints/public.js +10 -0
  607. package/lib/entrypoints/public.js.map +1 -0
  608. package/lib/feature-libraries/changeAtomIdBTree.d.ts +2 -3
  609. package/lib/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  610. package/lib/feature-libraries/changeAtomIdBTree.js +3 -15
  611. package/lib/feature-libraries/changeAtomIdBTree.js.map +1 -1
  612. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +8 -7
  613. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  614. package/lib/feature-libraries/chunked-forest/codec/codecs.js +25 -45
  615. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  616. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  617. package/lib/feature-libraries/chunked-forest/codec/format.js +11 -0
  618. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  619. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +3 -2
  620. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  621. package/lib/feature-libraries/chunked-forest/codec/index.js +2 -2
  622. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  623. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  624. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  625. package/lib/feature-libraries/chunked-forest/index.js +1 -1
  626. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  627. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +44 -92
  628. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  629. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +69 -217
  630. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  631. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  632. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +2 -12
  633. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  634. package/lib/feature-libraries/default-schema/index.d.ts +1 -2
  635. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  636. package/lib/feature-libraries/default-schema/index.js +1 -2
  637. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  638. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +6 -7
  639. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  640. package/lib/feature-libraries/default-schema/mappedEditBuilder.js +0 -15
  641. package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  642. package/lib/feature-libraries/deltaUtils.d.ts +0 -1
  643. package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
  644. package/lib/feature-libraries/deltaUtils.js +1 -5
  645. package/lib/feature-libraries/deltaUtils.js.map +1 -1
  646. package/lib/feature-libraries/flex-tree/context.d.ts +0 -9
  647. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  648. package/lib/feature-libraries/flex-tree/context.js +0 -6
  649. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  650. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  651. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  652. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  653. package/lib/feature-libraries/flex-tree/lazyField.d.ts +7 -8
  654. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  655. package/lib/feature-libraries/flex-tree/lazyField.js +9 -40
  656. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  657. package/lib/feature-libraries/flex-tree/observer.d.ts +17 -0
  658. package/lib/feature-libraries/flex-tree/observer.d.ts.map +1 -1
  659. package/lib/feature-libraries/flex-tree/observer.js.map +1 -1
  660. package/lib/feature-libraries/forest-summary/codec.d.ts +5 -12
  661. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  662. package/lib/feature-libraries/forest-summary/codec.js +35 -32
  663. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  664. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -2
  665. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  666. package/lib/feature-libraries/forest-summary/forestSummarizer.js +7 -8
  667. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  668. package/lib/feature-libraries/forest-summary/formatCommon.d.ts +6 -4
  669. package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  670. package/lib/feature-libraries/forest-summary/formatCommon.js +7 -4
  671. package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  672. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +19 -14
  673. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  674. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +30 -47
  675. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  676. package/lib/feature-libraries/forest-summary/index.d.ts +1 -1
  677. package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
  678. package/lib/feature-libraries/forest-summary/index.js +1 -1
  679. package/lib/feature-libraries/forest-summary/index.js.map +1 -1
  680. package/lib/feature-libraries/index.d.ts +6 -6
  681. package/lib/feature-libraries/index.d.ts.map +1 -1
  682. package/lib/feature-libraries/index.js +5 -5
  683. package/lib/feature-libraries/index.js.map +1 -1
  684. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts +3 -3
  685. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  686. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  687. package/lib/feature-libraries/indexing/index.d.ts +1 -1
  688. package/lib/feature-libraries/indexing/index.d.ts.map +1 -1
  689. package/lib/feature-libraries/indexing/index.js.map +1 -1
  690. package/lib/feature-libraries/indexing/types.d.ts +15 -13
  691. package/lib/feature-libraries/indexing/types.d.ts.map +1 -1
  692. package/lib/feature-libraries/indexing/types.js.map +1 -1
  693. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  694. package/lib/feature-libraries/mitigatedChangeFamily.js +2 -2
  695. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  696. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +24 -100
  697. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  698. package/lib/feature-libraries/modular-schema/crossFieldQueries.js +10 -7
  699. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  700. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +1 -0
  701. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -1
  702. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js +14 -6
  703. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
  704. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +51 -85
  705. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  706. package/lib/feature-libraries/modular-schema/fieldChangeHandler.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 +9 -4
  709. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  710. package/lib/feature-libraries/modular-schema/index.d.ts +3 -3
  711. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  712. package/lib/feature-libraries/modular-schema/index.js +1 -1
  713. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  714. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +22 -18
  715. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  716. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +144 -267
  717. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  718. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  719. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -1
  720. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  721. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +0 -1
  722. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  723. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +0 -8
  724. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  725. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +22 -56
  726. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  727. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +474 -1389
  728. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  729. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  730. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  731. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +2 -1
  732. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
  733. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +1 -1
  734. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
  735. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +10 -49
  736. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  737. package/lib/feature-libraries/modular-schema/modularChangeTypes.js +1 -1
  738. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  739. package/lib/feature-libraries/optional-field/optionalField.d.ts +32 -13
  740. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  741. package/lib/feature-libraries/optional-field/optionalField.js +442 -254
  742. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  743. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +31 -31
  744. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  745. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  746. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  747. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  748. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +26 -55
  749. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  750. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  751. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
  752. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  753. package/lib/feature-libraries/optional-field/requiredField.d.ts +2 -3
  754. package/lib/feature-libraries/optional-field/requiredField.d.ts.map +1 -1
  755. package/lib/feature-libraries/optional-field/requiredField.js +1 -5
  756. package/lib/feature-libraries/optional-field/requiredField.js.map +1 -1
  757. package/lib/feature-libraries/sequence-field/compose.d.ts +7 -6
  758. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  759. package/lib/feature-libraries/sequence-field/compose.js +261 -83
  760. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  761. package/lib/feature-libraries/sequence-field/helperTypes.d.ts +10 -14
  762. package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  763. package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  764. package/lib/feature-libraries/sequence-field/invert.d.ts +3 -3
  765. package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  766. package/lib/feature-libraries/sequence-field/invert.js +169 -67
  767. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  768. package/lib/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  769. package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  770. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  771. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +56 -4
  772. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  773. package/lib/feature-libraries/sequence-field/moveEffectTable.js +84 -6
  774. package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  775. package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -3
  776. package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  777. package/lib/feature-libraries/sequence-field/rebase.js +118 -111
  778. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  779. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +9 -0
  780. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -0
  781. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js +46 -0
  782. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -0
  783. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  784. package/lib/feature-libraries/sequence-field/replaceRevisions.js +32 -19
  785. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  786. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  787. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +3 -2
  788. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  789. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -22
  790. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  791. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +182 -379
  792. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  793. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  794. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +63 -21
  795. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  796. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  797. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  798. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +13 -13
  799. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  800. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +2 -3
  801. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  802. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +111 -16
  803. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  804. package/lib/feature-libraries/sequence-field/types.d.ts +74 -37
  805. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  806. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  807. package/lib/feature-libraries/sequence-field/utils.d.ts +25 -20
  808. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  809. package/lib/feature-libraries/sequence-field/utils.js +313 -155
  810. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  811. package/lib/index.d.ts +9 -3
  812. package/lib/index.d.ts.map +1 -1
  813. package/lib/index.js +9 -1
  814. package/lib/index.js.map +1 -1
  815. package/lib/packageVersion.d.ts +1 -1
  816. package/lib/packageVersion.d.ts.map +1 -1
  817. package/lib/packageVersion.js +1 -1
  818. package/lib/packageVersion.js.map +1 -1
  819. package/lib/shared-tree/independentView.d.ts.map +1 -1
  820. package/lib/shared-tree/independentView.js +4 -4
  821. package/lib/shared-tree/independentView.js.map +1 -1
  822. package/lib/shared-tree/index.d.ts +1 -1
  823. package/lib/shared-tree/index.d.ts.map +1 -1
  824. package/lib/shared-tree/index.js.map +1 -1
  825. package/lib/shared-tree/schematizeTree.d.ts +4 -4
  826. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  827. package/lib/shared-tree/schematizeTree.js +2 -3
  828. package/lib/shared-tree/schematizeTree.js.map +1 -1
  829. package/lib/shared-tree/schematizingTreeView.d.ts +10 -1
  830. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  831. package/lib/shared-tree/schematizingTreeView.js +71 -30
  832. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  833. package/lib/shared-tree/sharedTree.d.ts +3 -9
  834. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  835. package/lib/shared-tree/sharedTree.js +9 -12
  836. package/lib/shared-tree/sharedTree.js.map +1 -1
  837. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +0 -1
  838. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  839. package/lib/shared-tree/sharedTreeChangeCodecs.js +0 -8
  840. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  841. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
  842. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  843. package/lib/shared-tree/sharedTreeChangeFamily.js +3 -3
  844. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  845. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +6 -16
  846. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  847. package/lib/shared-tree/sharedTreeEditBuilder.js +6 -12
  848. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  849. package/lib/shared-tree/tree.js +1 -1
  850. package/lib/shared-tree/tree.js.map +1 -1
  851. package/lib/shared-tree/treeAlpha.d.ts +8 -1
  852. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  853. package/lib/shared-tree/treeAlpha.js +49 -9
  854. package/lib/shared-tree/treeAlpha.js.map +1 -1
  855. package/lib/shared-tree/treeCheckout.d.ts +46 -16
  856. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  857. package/lib/shared-tree/treeCheckout.js +134 -77
  858. package/lib/shared-tree/treeCheckout.js.map +1 -1
  859. package/lib/shared-tree/unhydratedTreeContext.d.ts +20 -0
  860. package/lib/shared-tree/unhydratedTreeContext.d.ts.map +1 -0
  861. package/lib/shared-tree/unhydratedTreeContext.js +52 -0
  862. package/lib/shared-tree/unhydratedTreeContext.js.map +1 -0
  863. package/lib/shared-tree-core/branch.d.ts +2 -3
  864. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  865. package/lib/shared-tree-core/branch.js +3 -4
  866. package/lib/shared-tree-core/branch.js.map +1 -1
  867. package/lib/shared-tree-core/editManager.d.ts +2 -2
  868. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  869. package/lib/shared-tree-core/editManager.js +9 -9
  870. package/lib/shared-tree-core/editManager.js.map +1 -1
  871. package/lib/shared-tree-core/editManagerCodecs.d.ts +0 -4
  872. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  873. package/lib/shared-tree-core/editManagerCodecs.js +1 -8
  874. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  875. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +0 -1
  876. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  877. package/lib/shared-tree-core/editManagerFormatCommons.js +0 -6
  878. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  879. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  880. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  881. package/lib/shared-tree-core/editManagerFormatV1toV4.js +0 -1
  882. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  883. package/lib/shared-tree-core/index.d.ts +2 -2
  884. package/lib/shared-tree-core/index.d.ts.map +1 -1
  885. package/lib/shared-tree-core/index.js +2 -2
  886. package/lib/shared-tree-core/index.js.map +1 -1
  887. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  888. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  889. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  890. package/lib/shared-tree-core/messageCodecs.d.ts +0 -4
  891. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  892. package/lib/shared-tree-core/messageCodecs.js +1 -8
  893. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  894. package/lib/shared-tree-core/messageFormat.d.ts +0 -1
  895. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  896. package/lib/shared-tree-core/messageFormat.js +0 -6
  897. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  898. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +2 -2
  899. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  900. package/lib/shared-tree-core/messageFormatV1ToV4.js +0 -1
  901. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  902. package/lib/shared-tree-core/sharedTreeCore.d.ts +0 -1
  903. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  904. package/lib/shared-tree-core/sharedTreeCore.js +1 -1
  905. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  906. package/lib/shared-tree-core/transaction.d.ts +15 -27
  907. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  908. package/lib/shared-tree-core/transaction.js +7 -11
  909. package/lib/shared-tree-core/transaction.js.map +1 -1
  910. package/lib/simple-tree/api/configuration.d.ts +4 -0
  911. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  912. package/lib/simple-tree/api/configuration.js.map +1 -1
  913. package/lib/simple-tree/api/eraseSchemaDetails.d.ts +43 -0
  914. package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  915. package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  916. package/lib/simple-tree/api/identifierIndex.d.ts +2 -2
  917. package/lib/simple-tree/api/identifierIndex.d.ts.map +1 -1
  918. package/lib/simple-tree/api/identifierIndex.js +2 -2
  919. package/lib/simple-tree/api/identifierIndex.js.map +1 -1
  920. package/lib/simple-tree/api/index.d.ts +6 -5
  921. package/lib/simple-tree/api/index.d.ts.map +1 -1
  922. package/lib/simple-tree/api/index.js +2 -2
  923. package/lib/simple-tree/api/index.js.map +1 -1
  924. package/lib/simple-tree/api/schemaFactory.d.ts +3 -2
  925. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  926. package/lib/simple-tree/api/schemaFactory.js +3 -2
  927. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  928. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +125 -28
  929. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  930. package/lib/simple-tree/api/schemaFactoryAlpha.js +66 -1
  931. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  932. package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  933. package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  934. package/lib/simple-tree/api/schemaStatics.d.ts +10 -11
  935. package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
  936. package/lib/simple-tree/api/schemaStatics.js +14 -8
  937. package/lib/simple-tree/api/schemaStatics.js.map +1 -1
  938. package/lib/simple-tree/api/simpleTreeIndex.d.ts +15 -13
  939. package/lib/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
  940. package/lib/simple-tree/api/simpleTreeIndex.js +2 -2
  941. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  942. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +4 -4
  943. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +2 -2
  944. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  945. package/lib/simple-tree/api/transactionTypes.d.ts +22 -25
  946. package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
  947. package/lib/simple-tree/api/transactionTypes.js.map +1 -1
  948. package/lib/simple-tree/api/tree.d.ts +69 -132
  949. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  950. package/lib/simple-tree/api/tree.js.map +1 -1
  951. package/lib/simple-tree/api/typesUnsafe.d.ts +23 -2
  952. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  953. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  954. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +12 -16
  955. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  956. package/lib/simple-tree/core/unhydratedFlexTree.js +8 -58
  957. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  958. package/lib/simple-tree/fieldSchema.d.ts +7 -6
  959. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  960. package/lib/simple-tree/fieldSchema.js +3 -4
  961. package/lib/simple-tree/fieldSchema.js.map +1 -1
  962. package/lib/simple-tree/index.d.ts +4 -4
  963. package/lib/simple-tree/index.d.ts.map +1 -1
  964. package/lib/simple-tree/index.js +2 -2
  965. package/lib/simple-tree/index.js.map +1 -1
  966. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  967. package/lib/simple-tree/node-kinds/array/arrayNode.js +4 -6
  968. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  969. package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
  970. package/lib/simple-tree/node-kinds/common.js +2 -2
  971. package/lib/simple-tree/node-kinds/common.js.map +1 -1
  972. package/lib/simple-tree/node-kinds/index.d.ts +1 -1
  973. package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
  974. package/lib/simple-tree/node-kinds/index.js.map +1 -1
  975. package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
  976. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  977. package/lib/simple-tree/node-kinds/object/index.d.ts +2 -2
  978. package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  979. package/lib/simple-tree/node-kinds/object/index.js.map +1 -1
  980. package/lib/simple-tree/node-kinds/object/objectNode.d.ts +43 -7
  981. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  982. package/lib/simple-tree/node-kinds/object/objectNode.js +20 -20
  983. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  984. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +26 -2
  985. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  986. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  987. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  988. package/lib/simple-tree/node-kinds/record/recordNode.js +2 -4
  989. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  990. package/lib/simple-tree/prepareForInsertion.d.ts +47 -54
  991. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  992. package/lib/simple-tree/prepareForInsertion.js +125 -184
  993. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  994. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +3 -8
  995. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  996. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +10 -23
  997. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  998. package/lib/text/textDomain.d.ts +27 -9
  999. package/lib/text/textDomain.d.ts.map +1 -1
  1000. package/lib/text/textDomain.js +45 -9
  1001. package/lib/text/textDomain.js.map +1 -1
  1002. package/lib/text/textDomainFormatted.d.ts +16 -12
  1003. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  1004. package/lib/text/textDomainFormatted.js +80 -8
  1005. package/lib/text/textDomainFormatted.js.map +1 -1
  1006. package/lib/treeFactory.d.ts.map +1 -1
  1007. package/lib/treeFactory.js +3 -13
  1008. package/lib/treeFactory.js.map +1 -1
  1009. package/lib/util/index.d.ts +1 -1
  1010. package/lib/util/index.d.ts.map +1 -1
  1011. package/lib/util/index.js +1 -1
  1012. package/lib/util/index.js.map +1 -1
  1013. package/lib/util/rangeMap.d.ts +10 -14
  1014. package/lib/util/rangeMap.d.ts.map +1 -1
  1015. package/lib/util/rangeMap.js +22 -61
  1016. package/lib/util/rangeMap.js.map +1 -1
  1017. package/lib/util/typeCheck.d.ts.map +1 -1
  1018. package/lib/util/typeCheck.js.map +1 -1
  1019. package/lib/util/typeUtils.d.ts.map +1 -1
  1020. package/lib/util/typeUtils.js.map +1 -1
  1021. package/package.json +49 -49
  1022. package/scripts/generate-entrypoint-sources.sh +29 -0
  1023. package/src/codec/codec.ts +5 -4
  1024. package/src/codec/index.ts +1 -0
  1025. package/src/codec/versioned/codec.ts +32 -6
  1026. package/src/codec/versioned/format.ts +17 -2
  1027. package/src/codec/versioned/index.ts +1 -1
  1028. package/src/core/change-family/changeFamily.ts +0 -5
  1029. package/src/core/change-family/index.ts +0 -1
  1030. package/src/core/index.ts +3 -10
  1031. package/src/core/rebase/changeRebaser.ts +1 -6
  1032. package/src/core/rebase/index.ts +2 -1
  1033. package/src/core/rebase/types.ts +80 -4
  1034. package/src/core/rebase/utils.ts +7 -31
  1035. package/src/core/tree/delta.ts +0 -6
  1036. package/src/core/tree/detachedFieldIndex.ts +1 -29
  1037. package/src/core/tree/detachedFieldIndexTypes.ts +0 -5
  1038. package/src/core/tree/index.ts +12 -13
  1039. package/src/core/tree/pathTree.ts +4 -16
  1040. package/src/core/tree/visitDelta.ts +11 -31
  1041. package/{dist/alpha.d.ts → src/entrypoints/alpha.ts} +22 -11
  1042. package/{lib/beta.d.ts → src/entrypoints/beta.ts} +6 -6
  1043. package/src/entrypoints/internal.ts +13 -0
  1044. package/{lib/legacy.d.ts → src/entrypoints/legacy.ts} +6 -6
  1045. package/{lib/public.d.ts → src/entrypoints/public.ts} +2 -5
  1046. package/src/feature-libraries/changeAtomIdBTree.ts +3 -28
  1047. package/src/feature-libraries/chunked-forest/codec/codecs.ts +59 -78
  1048. package/src/feature-libraries/chunked-forest/codec/format.ts +11 -0
  1049. package/src/feature-libraries/chunked-forest/codec/index.ts +3 -3
  1050. package/src/feature-libraries/chunked-forest/index.ts +2 -3
  1051. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +127 -369
  1052. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +4 -13
  1053. package/src/feature-libraries/default-schema/index.ts +5 -16
  1054. package/src/feature-libraries/default-schema/mappedEditBuilder.ts +9 -35
  1055. package/src/feature-libraries/deltaUtils.ts +1 -6
  1056. package/src/feature-libraries/flex-tree/context.ts +0 -17
  1057. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +8 -7
  1058. package/src/feature-libraries/flex-tree/lazyField.ts +24 -65
  1059. package/src/feature-libraries/flex-tree/observer.ts +17 -0
  1060. package/src/feature-libraries/forest-summary/codec.ts +46 -56
  1061. package/src/feature-libraries/forest-summary/forestSummarizer.ts +5 -14
  1062. package/src/feature-libraries/forest-summary/formatCommon.ts +14 -19
  1063. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +44 -74
  1064. package/src/feature-libraries/forest-summary/index.ts +1 -1
  1065. package/src/feature-libraries/index.ts +11 -26
  1066. package/src/feature-libraries/indexing/anchorTreeIndex.ts +3 -5
  1067. package/src/feature-libraries/indexing/index.ts +1 -1
  1068. package/src/feature-libraries/indexing/types.ts +15 -17
  1069. package/src/feature-libraries/mitigatedChangeFamily.ts +1 -3
  1070. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +47 -149
  1071. package/src/feature-libraries/modular-schema/defaultRevisionReplacer.ts +16 -8
  1072. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +58 -113
  1073. package/src/feature-libraries/modular-schema/genericFieldKind.ts +18 -7
  1074. package/src/feature-libraries/modular-schema/index.ts +16 -16
  1075. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +329 -604
  1076. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +0 -1
  1077. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +0 -14
  1078. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +754 -2695
  1079. package/src/feature-libraries/modular-schema/modularChangeFormatV1.ts +0 -1
  1080. package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +1 -1
  1081. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +10 -62
  1082. package/src/feature-libraries/optional-field/optionalField.ts +568 -359
  1083. package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +35 -31
  1084. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +35 -89
  1085. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +1 -5
  1086. package/src/feature-libraries/optional-field/requiredField.ts +2 -15
  1087. package/src/feature-libraries/sequence-field/compose.ts +522 -137
  1088. package/src/feature-libraries/sequence-field/helperTypes.ts +19 -34
  1089. package/src/feature-libraries/sequence-field/invert.ts +228 -102
  1090. package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
  1091. package/src/feature-libraries/sequence-field/moveEffectTable.ts +195 -8
  1092. package/src/feature-libraries/sequence-field/rebase.ts +207 -171
  1093. package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +57 -0
  1094. package/src/feature-libraries/sequence-field/replaceRevisions.ts +52 -26
  1095. package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +3 -8
  1096. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +229 -677
  1097. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +70 -56
  1098. package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +30 -28
  1099. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +131 -21
  1100. package/src/feature-libraries/sequence-field/types.ts +79 -40
  1101. package/src/feature-libraries/sequence-field/utils.ts +370 -211
  1102. package/src/index.ts +25 -3
  1103. package/src/packageVersion.ts +1 -1
  1104. package/src/shared-tree/independentView.ts +9 -15
  1105. package/src/shared-tree/index.ts +2 -3
  1106. package/src/shared-tree/schematizeTree.ts +8 -21
  1107. package/src/shared-tree/schematizingTreeView.ts +111 -48
  1108. package/src/shared-tree/sharedTree.ts +23 -40
  1109. package/src/shared-tree/sharedTreeChangeCodecs.ts +0 -8
  1110. package/src/shared-tree/sharedTreeChangeFamily.ts +4 -7
  1111. package/src/shared-tree/sharedTreeEditBuilder.ts +8 -43
  1112. package/src/shared-tree/tree.ts +1 -1
  1113. package/src/shared-tree/treeAlpha.ts +64 -11
  1114. package/src/shared-tree/treeCheckout.ts +161 -115
  1115. package/src/shared-tree/unhydratedTreeContext.ts +87 -0
  1116. package/src/shared-tree-core/branch.ts +2 -8
  1117. package/src/shared-tree-core/editManager.ts +2 -16
  1118. package/src/shared-tree-core/editManagerCodecs.ts +1 -11
  1119. package/src/shared-tree-core/editManagerFormatCommons.ts +0 -6
  1120. package/src/shared-tree-core/editManagerFormatV1toV4.ts +1 -3
  1121. package/src/shared-tree-core/index.ts +0 -2
  1122. package/src/shared-tree-core/messageCodecV1ToV4.ts +1 -2
  1123. package/src/shared-tree-core/messageCodecs.ts +1 -11
  1124. package/src/shared-tree-core/messageFormat.ts +0 -6
  1125. package/src/shared-tree-core/messageFormatV1ToV4.ts +1 -3
  1126. package/src/shared-tree-core/sharedTreeCore.ts +1 -4
  1127. package/src/shared-tree-core/transaction.ts +19 -39
  1128. package/src/simple-tree/api/configuration.ts +4 -0
  1129. package/src/simple-tree/api/eraseSchemaDetails.ts +60 -0
  1130. package/src/simple-tree/api/identifierIndex.ts +4 -4
  1131. package/src/simple-tree/api/index.ts +15 -2
  1132. package/src/simple-tree/api/schemaFactory.ts +11 -3
  1133. package/src/simple-tree/api/schemaFactoryAlpha.ts +262 -25
  1134. package/src/simple-tree/api/schemaFactoryBeta.ts +10 -1
  1135. package/src/simple-tree/api/schemaStatics.ts +79 -21
  1136. package/src/simple-tree/api/simpleTreeIndex.ts +26 -20
  1137. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +4 -4
  1138. package/src/simple-tree/api/transactionTypes.ts +24 -26
  1139. package/src/simple-tree/api/tree.ts +92 -131
  1140. package/src/simple-tree/api/typesUnsafe.ts +49 -1
  1141. package/src/simple-tree/core/unhydratedFlexTree.ts +35 -82
  1142. package/src/simple-tree/fieldSchema.ts +33 -11
  1143. package/src/simple-tree/index.ts +15 -4
  1144. package/src/simple-tree/node-kinds/array/arrayNode.ts +5 -7
  1145. package/src/simple-tree/node-kinds/common.ts +5 -2
  1146. package/src/simple-tree/node-kinds/index.ts +3 -0
  1147. package/src/simple-tree/node-kinds/map/mapNode.ts +4 -4
  1148. package/src/simple-tree/node-kinds/object/index.ts +3 -0
  1149. package/src/simple-tree/node-kinds/object/objectNode.ts +95 -37
  1150. package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +33 -2
  1151. package/src/simple-tree/node-kinds/record/recordNode.ts +9 -10
  1152. package/src/simple-tree/prepareForInsertion.ts +200 -342
  1153. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +15 -35
  1154. package/src/text/textDomain.ts +91 -12
  1155. package/src/text/textDomainFormatted.ts +127 -15
  1156. package/src/treeFactory.ts +4 -16
  1157. package/src/util/index.ts +0 -3
  1158. package/src/util/rangeMap.ts +34 -78
  1159. package/src/util/typeCheck.ts +1 -0
  1160. package/src/util/typeUtils.ts +4 -7
  1161. package/dist/beta.d.ts +0 -149
  1162. package/dist/core/schema-view/index.d.ts +0 -6
  1163. package/dist/core/schema-view/index.d.ts.map +0 -1
  1164. package/dist/core/schema-view/index.js +0 -10
  1165. package/dist/core/schema-view/index.js.map +0 -1
  1166. package/dist/core/schema-view/view.d.ts +0 -31
  1167. package/dist/core/schema-view/view.d.ts.map +0 -1
  1168. package/dist/core/schema-view/view.js +0 -18
  1169. package/dist/core/schema-view/view.js.map +0 -1
  1170. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +0 -40
  1171. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +0 -1
  1172. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js +0 -153
  1173. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js.map +0 -1
  1174. package/dist/feature-libraries/forest-summary/formatV1.d.ts +0 -12
  1175. package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +0 -1
  1176. package/dist/feature-libraries/forest-summary/formatV1.js +0 -10
  1177. package/dist/feature-libraries/forest-summary/formatV1.js.map +0 -1
  1178. package/dist/feature-libraries/forest-summary/formatV2.d.ts +0 -12
  1179. package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +0 -1
  1180. package/dist/feature-libraries/forest-summary/formatV2.js +0 -10
  1181. package/dist/feature-libraries/forest-summary/formatV2.js.map +0 -1
  1182. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.d.ts +0 -15
  1183. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.d.ts.map +0 -1
  1184. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.js +0 -296
  1185. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.js.map +0 -1
  1186. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.d.ts +0 -74
  1187. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.d.ts.map +0 -1
  1188. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.js +0 -35
  1189. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.js.map +0 -1
  1190. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +0 -23
  1191. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +0 -1
  1192. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +0 -31
  1193. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +0 -1
  1194. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +0 -12
  1195. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +0 -1
  1196. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js +0 -57
  1197. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js.map +0 -1
  1198. package/dist/legacy.d.ts +0 -156
  1199. package/dist/public.d.ts +0 -94
  1200. package/lib/alpha.d.ts +0 -300
  1201. package/lib/core/schema-view/index.d.ts +0 -6
  1202. package/lib/core/schema-view/index.d.ts.map +0 -1
  1203. package/lib/core/schema-view/index.js.map +0 -1
  1204. package/lib/core/schema-view/view.d.ts +0 -31
  1205. package/lib/core/schema-view/view.d.ts.map +0 -1
  1206. package/lib/core/schema-view/view.js +0 -14
  1207. package/lib/core/schema-view/view.js.map +0 -1
  1208. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +0 -40
  1209. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +0 -1
  1210. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js +0 -149
  1211. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js.map +0 -1
  1212. package/lib/feature-libraries/forest-summary/formatV1.d.ts +0 -12
  1213. package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +0 -1
  1214. package/lib/feature-libraries/forest-summary/formatV1.js +0 -7
  1215. package/lib/feature-libraries/forest-summary/formatV1.js.map +0 -1
  1216. package/lib/feature-libraries/forest-summary/formatV2.d.ts +0 -12
  1217. package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +0 -1
  1218. package/lib/feature-libraries/forest-summary/formatV2.js +0 -7
  1219. package/lib/feature-libraries/forest-summary/formatV2.js.map +0 -1
  1220. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.d.ts +0 -15
  1221. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.d.ts.map +0 -1
  1222. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.js +0 -292
  1223. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.js.map +0 -1
  1224. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.d.ts +0 -74
  1225. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.d.ts.map +0 -1
  1226. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.js +0 -32
  1227. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.js.map +0 -1
  1228. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +0 -23
  1229. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +0 -1
  1230. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +0 -27
  1231. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +0 -1
  1232. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +0 -12
  1233. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +0 -1
  1234. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js +0 -53
  1235. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js.map +0 -1
  1236. package/src/core/schema-view/README.md +0 -9
  1237. package/src/core/schema-view/view.ts +0 -38
  1238. package/src/feature-libraries/default-schema/locationBasedEditBuilder.ts +0 -231
  1239. package/src/feature-libraries/forest-summary/formatV1.ts +0 -11
  1240. package/src/feature-libraries/forest-summary/formatV2.ts +0 -11
  1241. package/src/feature-libraries/modular-schema/modularChangeCodecV3.ts +0 -649
  1242. package/src/feature-libraries/modular-schema/modularChangeFormatV3.ts +0 -67
  1243. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV3.ts +0 -45
  1244. package/src/feature-libraries/optional-field/optionalFieldCodecV3.ts +0 -94
@@ -1 +1 @@
1
- {"version":3,"file":"defaultEditBuilder.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultEditBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAGtE,OAAO,EAgBN,mBAAmB,EACnB,WAAW,GACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAKN,mBAAmB,EAEnB,kBAAkB,EAClB,SAAS,IAAI,gBAAgB,EAC7B,oBAAoB,IAAI,2BAA2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AC,UAAU,CAAC,KAAK,CAAC,CAAC;gBACjD,MAAM,MAAM,GAAmB,KAAK,CACnC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,CAAC,CAChE,CAAC;gBACF,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;YAChF,CAAC;SACD,CAAC;QACF,OAAO,WAAW,CAAC;IACpB,CAAC;CACD;AAwED;;GAEG;AACH,SAAS,qBAAqB,CAAC,KAAwB,EAAE,KAAwB;IAChF,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtD,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,OAAO,WAAW,GAAG,QAAQ,EAAE,CAAC;QAC/B,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,GAAG,EAAE,CAAC;QAC/C,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,GAAG,EAAE,CAAC;QAC/C,IACC,UAAU,KAAK,UAAU;YACzB,CAAC,UAAU,CAAC,WAAW,KAAK,UAAU,CAAC,WAAW;gBACjD,UAAU,CAAC,WAAW,KAAK,UAAU,CAAC,WAAW,CAAC,EAClD,CAAC;YACF,MAAM;QACP,CAAC;QACD,WAAW,IAAI,CAAC,CAAC;IAClB,CAAC;IACD,OAAO,WAAW,CAAC;AACpB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { CodecWriteOptions, ICodecFamily } from \"../../codec/index.js\";\nimport {\n\ttype ChangeAtomId,\n\ttype ChangeEncodingContext,\n\ttype ChangeFamily,\n\ttype ChangeFamilyEditor,\n\ttype ChangeRebaser,\n\ttype ChangesetLocalId,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaRoot,\n\ttype EditorOptions,\n\ttype NormalizedFieldUpPath,\n\ttype NormalizedUpPath,\n\ttype RevisionTag,\n\ttype TaggedChange,\n\ttype TreeChunk,\n\ttype UpPath,\n\tcompareFieldUpPaths,\n\ttopDownPath,\n} from \"../../core/index.js\";\nimport { brand, RangeMap } from \"../../util/index.js\";\nimport {\n\ttype EditDescription,\n\ttype FieldChangeset,\n\ttype FieldEditDescription,\n\ttype GlobalEditDescription,\n\tModularChangeFamily,\n\ttype ModularChangeset,\n\tModularEditBuilder,\n\tintoDelta as intoModularDelta,\n\trelevantRemovedRoots as relevantModularRemovedRoots,\n} from \"../modular-schema/index.js\";\nimport { optional, required } from \"../optional-field/index.js\";\nimport { sequence, type CellId } from \"../sequence-field/index.js\";\n\nimport { fieldKinds } from \"./defaultFieldKinds.js\";\n\nexport type DefaultChangeset = ModularChangeset;\n\n/**\n * Implementation of {@link ChangeFamily} based on the default set of supported field kinds.\n *\n * @sealed\n */\nexport class DefaultChangeFamily\n\timplements ChangeFamily<IdBasedChangeFamilyDataEditor, DefaultChangeset>\n{\n\tprivate readonly modularFamily: ModularChangeFamily;\n\n\tpublic constructor(\n\t\tcodecs: ICodecFamily<ModularChangeset, ChangeEncodingContext>,\n\t\tcodecOptions: CodecWriteOptions,\n\t) {\n\t\tthis.modularFamily = new ModularChangeFamily(fieldKinds, codecs, codecOptions);\n\t}\n\n\tpublic get rebaser(): ChangeRebaser<DefaultChangeset> {\n\t\treturn this.modularFamily.rebaser;\n\t}\n\n\tpublic get codecs(): ICodecFamily<DefaultChangeset, ChangeEncodingContext> {\n\t\treturn this.modularFamily.codecs;\n\t}\n\n\tpublic buildEditor(\n\t\tmintRevisionTag: () => RevisionTag,\n\t\tchangeReceiver: (change: TaggedChange<DefaultChangeset>) => void,\n\t\toptions?: EditorOptions,\n\t): IdBasedChangeFamilyDataEditor {\n\t\treturn new DefaultIdBasedDataEditor(\n\t\t\tthis,\n\t\t\tmintRevisionTag,\n\t\t\tchangeReceiver,\n\t\t\toptions,\n\t\t\tthis.modularFamily.codecOptions,\n\t\t);\n\t}\n}\n\n/**\n * @param change - The change to convert into a delta.\n */\nexport function intoDelta(taggedChange: TaggedChange<ModularChangeset>): DeltaRoot {\n\treturn intoModularDelta(taggedChange, fieldKinds);\n}\n\n/**\n * Returns the set of removed roots that should be in memory for the given change to be applied.\n * A removed root is relevant if any of the following is true:\n * - It is being inserted\n * - It is being restored\n * - It is being edited\n * - The ID it is associated with is being changed\n *\n * May be conservative by returning more removed roots than strictly necessary.\n *\n * Will never return IDs for non-root trees, even if they are removed.\n *\n * @param change - The change to be applied.\n */\nexport function relevantRemovedRoots(change: ModularChangeset): Iterable<DeltaDetachedNodeId> {\n\treturn relevantModularRemovedRoots(change, fieldKinds);\n}\n\nexport type DetachedRootIds = readonly DetachedRootIdRange[];\nexport interface DetachedRootIdRange {\n\treadonly first: ChangeAtomId;\n\treadonly count: number;\n}\n\n/**\n * Default editor for tree data changes.\n * @privateRemarks\n * When taking into account not just the content of the tree,\n * but also how the merge identities (and thus anchors, flex-tree and simple-tree nodes) of nodes before and after the edits correspond,\n * some edits are currently impossible to express.\n * Examples of these non-expressible edits include:\n *\n * - Changing the type of a node while keeping its merge identity.\n * - Changing the value of a leaf while keeping its merge identity.\n * - Swapping subtrees between two value fields.\n * - Replacing a node in the middle of a tree while reusing some of the old nodes decedents that were under value fields.\n *\n * At some point it will likely be worth supporting at least some of these, possibly using a mechanism that could support all of them if desired.\n * If/when such a mechanism becomes available, an evaluation should be done to determine if any existing editing operations should be changed to leverage it\n * (Possibly by adding opt ins at the view schema layer).\n */\nexport interface DataEditor<TContent, TDetachedRoot, TDetachedRoots> {\n\t/**\n\t * Moves a subsequence from one sequence field to another sequence field.\n\t *\n\t * Note that the `destinationIndex` is interpreted based on the state of the sequence *before* the move operation.\n\t * For example, `move(field, 0, 1, field, 2)` changes `[A, B, C]` to `[B, A, C]`.\n\t */\n\tmove(\n\t\tsourceField: NormalizedFieldUpPath,\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestinationField: NormalizedFieldUpPath,\n\t\tdestinationIndex: number,\n\t): void;\n\n\t/**\n\t * Add a constraint that, for this change to apply, the node at the given path must exist immediately before the change is applied.\n\t * @param path - The path to the node that must exist.\n\t */\n\taddNodeExistsConstraint(path: NormalizedUpPath): void;\n\n\t/**\n\t * Add a constraint that, for the revert of this change to apply, the node at the given path must exist immediately before the revert is applied.\n\t * @param path - The path to the node that must exist when reverting a change.\n\t */\n\taddNodeExistsConstraintOnRevert(path: NormalizedUpPath): void;\n\n\t/**\n\t * Add a constraint that, for this change to apply, the document must be in the same state immediately before this change is applied as it was before this change was authored.\n\t */\n\taddNoChangeConstraint(): void;\n\n\t/**\n\t * Add a constraint that, for the revert of this change to apply, the document must be in the same state immediately before the revert is applied as it was after this change was applied.\n\t */\n\taddNoChangeConstraintOnRevert(): void;\n\n\t/**\n\t * Builds the detached roots for the given content.\n\t * @param content - The content to be built into detached nodes.\n\t *\n\t * Requires SharedTreeFormatVersion.vDetachedRoots or later.\n\t */\n\tbuildRoots(content: TContent): TDetachedRoots;\n\n\t/**\n\t * @param field - the value field which is being edited under the parent node\n\t * @returns An object with methods to edit the given field of the given parent.\n\t * The returned object can be used (i.e., have its methods called) multiple times but its lifetime\n\t * is bounded by the lifetime of this edit builder.\n\t */\n\tvalueField(field: NormalizedFieldUpPath): RequiredFieldEditor<TContent, TDetachedRoot>;\n\n\t/**\n\t * @param field - the optional field which is being edited under the parent node\n\t * @returns An object with methods to edit the given field of the given parent.\n\t * The returned object can be used (i.e., have its methods called) multiple times but its lifetime\n\t * is bounded by the lifetime of this edit builder.\n\t */\n\toptionalField(field: NormalizedFieldUpPath): OptionalFieldEditor<TContent, TDetachedRoot>;\n\n\t/**\n\t * @param field - the sequence field which is being edited under the parent node\n\t *\n\t * @returns An object with methods to edit the given field of the given parent.\n\t * The returned object can be used (i.e., have its methods called) multiple times but its lifetime\n\t * is bounded by the lifetime of this edit builder.\n\t */\n\tsequenceField(field: NormalizedFieldUpPath): SequenceFieldEditor<TContent, TDetachedRoots>;\n}\n\nexport type IdBasedChangeFamilyDataEditor = ChangeFamilyEditor &\n\tDataEditor<TreeChunk, ChangeAtomId, DetachedRootIds>;\n\nexport function offsetChangesetLocalId(\n\tid: ChangesetLocalId,\n\toffset: number,\n): ChangesetLocalId {\n\treturn brand(id + offset);\n}\n\nexport function subtractChangesetLocalId(a: ChangesetLocalId, b: ChangesetLocalId): number {\n\treturn a - b;\n}\n\n/**\n * Implementation of {@link IdBasedChangeFamilyDataEditor} based on the default set of supported field kinds.\n * @sealed\n */\nexport class DefaultIdBasedDataEditor implements IdBasedChangeFamilyDataEditor {\n\tprivate readonly modularBuilder: ModularEditBuilder;\n\tprivate readonly nodesWithoutCells: RangeMap<ChangesetLocalId, true> = new RangeMap(\n\t\toffsetChangesetLocalId,\n\t\tsubtractChangesetLocalId,\n\t);\n\n\tpublic constructor(\n\t\tfamily: ChangeFamily<ChangeFamilyEditor, DefaultChangeset>,\n\t\tprivate readonly mintRevisionTag: () => RevisionTag,\n\t\tchangeReceiver: (change: TaggedChange<DefaultChangeset>) => void,\n\t\tprivate readonly options: EditorOptions = { enableDetachedRootEditing: false },\n\t\tcodecOptions: CodecWriteOptions,\n\t) {\n\t\tthis.modularBuilder = new ModularEditBuilder(\n\t\t\tfamily,\n\t\t\tfieldKinds,\n\t\t\tchangeReceiver,\n\t\t\tcodecOptions,\n\t\t\toptions,\n\t\t);\n\t}\n\n\tpublic enterTransaction(): void {\n\t\tif (this.modularBuilder.isInTransaction() === false) {\n\t\t\tthis.nodesWithoutCells.clear();\n\t\t}\n\t\tthis.modularBuilder.enterTransaction();\n\t}\n\tpublic exitTransaction(): void {\n\t\tthis.modularBuilder.exitTransaction();\n\t\tif (this.modularBuilder.isInTransaction() === false) {\n\t\t\tthis.nodesWithoutCells.clear();\n\t\t}\n\t}\n\n\tpublic addNodeExistsConstraint(path: NormalizedUpPath): void {\n\t\tthis.modularBuilder.addNodeExistsConstraint(path, this.mintRevisionTag());\n\t}\n\n\tpublic addNodeExistsConstraintOnRevert(path: NormalizedUpPath): void {\n\t\tthis.modularBuilder.addNodeExistsConstraintOnRevert(path, this.mintRevisionTag());\n\t}\n\n\tpublic addNoChangeConstraint(): void {\n\t\tthis.modularBuilder.addNoChangeConstraint(this.mintRevisionTag());\n\t}\n\n\tpublic addNoChangeConstraintOnRevert(): void {\n\t\tthis.modularBuilder.addNoChangeConstraintOnRevert(this.mintRevisionTag());\n\t}\n\n\tpublic buildRoots(content: TreeChunk): DetachedRootIds {\n\t\tconst detachedRoots = [];\n\t\tconst count = content.topLevelLength;\n\t\tif (count > 0) {\n\t\t\tconst buildRevision = this.mintRevisionTag();\n\t\t\tconst buildId = {\n\t\t\t\tlocalId: this.modularBuilder.generateId(count),\n\t\t\t\trevision: buildRevision,\n\t\t\t};\n\t\t\tconst build = this.modularBuilder.buildTrees(buildId.localId, content, buildRevision);\n\t\t\tthis.modularBuilder.submitChanges([build], buildRevision);\n\t\t\tdetachedRoots.push({ first: buildId, count });\n\t\t\tthis.nodesWithoutCells.set(buildId.localId, count, true);\n\t\t}\n\t\treturn detachedRoots;\n\t}\n\n\tpublic valueField(\n\t\tfield: NormalizedFieldUpPath,\n\t): RequiredFieldEditor<TreeChunk, ChangeAtomId> {\n\t\tconst makeAttachEditDescription = (\n\t\t\tfill: ChangeAtomId,\n\t\t\trevision: RevisionTag,\n\t\t): FieldEditDescription => {\n\t\t\tconst detachLocalId = this.modularBuilder.generateId();\n\t\t\tconst detach = { localId: detachLocalId, revision };\n\t\t\tconst change = required.changeHandler.editor.set({ fill, detach });\n\t\t\treturn {\n\t\t\t\ttype: \"field\",\n\t\t\t\tfield,\n\t\t\t\tfieldKind: required.identifier,\n\t\t\t\tchange: brand(change),\n\t\t\t\trevision,\n\t\t\t};\n\t\t};\n\t\treturn {\n\t\t\tset: (newContent: TreeChunk): void => {\n\t\t\t\tassert(newContent.topLevelLength === 1, \"Expected exactly one node\");\n\t\t\t\tconst revision = this.mintRevisionTag();\n\t\t\t\tconst buildLocalId = this.modularBuilder.generateId();\n\t\t\t\tconst buildId = { localId: buildLocalId, revision };\n\t\t\t\tconst build = this.modularBuilder.buildTrees(buildLocalId, newContent, revision);\n\t\t\t\tconst attach = makeAttachEditDescription(buildId, revision);\n\t\t\t\tthis.modularBuilder.submitChanges([build, attach], revision);\n\t\t\t},\n\n\t\t\tattach: (newContent: ChangeAtomId): void => {\n\t\t\t\tconst isWithoutCell = this.nodesWithoutCells.delete(newContent.localId, 1) === 1;\n\t\t\t\tif (!isWithoutCell) {\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\"A hydrated node that has been attached before cannot be attached into an object's required field. Assign new content to the field instead.\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst revision = this.mintRevisionTag();\n\t\t\t\tconst attach = makeAttachEditDescription(newContent, revision);\n\t\t\t\tthis.modularBuilder.submitChanges([attach], revision);\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic optionalField(\n\t\tfield: NormalizedFieldUpPath,\n\t): OptionalFieldEditor<TreeChunk, ChangeAtomId> {\n\t\tconst makeAttachEditDescription = (\n\t\t\tfill: ChangeAtomId,\n\t\t\trevision: RevisionTag,\n\t\t\twasEmpty: boolean,\n\t\t): FieldEditDescription => {\n\t\t\tconst detachLocalId = this.modularBuilder.generateId();\n\t\t\tconst detach = { localId: detachLocalId, revision };\n\t\t\tconst change = optional.changeHandler.editor.set(wasEmpty, { fill, detach });\n\t\t\treturn {\n\t\t\t\ttype: \"field\",\n\t\t\t\tfield,\n\t\t\t\tfieldKind: optional.identifier,\n\t\t\t\tchange: brand(change),\n\t\t\t\trevision,\n\t\t\t};\n\t\t};\n\t\tconst editBuilder = {\n\t\t\tset: (newContent: TreeChunk | undefined, wasEmpty: boolean): void => {\n\t\t\t\tif (newContent === undefined) {\n\t\t\t\t\teditBuilder.clear(wasEmpty);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tassert(newContent.topLevelLength === 1, \"Expected exactly one node\");\n\t\t\t\tconst revision = this.mintRevisionTag();\n\t\t\t\tconst buildLocalId = this.modularBuilder.generateId();\n\t\t\t\tconst buildId = { localId: buildLocalId, revision };\n\t\t\t\tconst build = this.modularBuilder.buildTrees(buildLocalId, newContent, revision);\n\t\t\t\tconst attach = makeAttachEditDescription(buildId, revision, wasEmpty);\n\t\t\t\tthis.modularBuilder.submitChanges([build, attach], revision);\n\t\t\t},\n\t\t\tattach: (content: ChangeAtomId | undefined, wasEmpty: boolean): void => {\n\t\t\t\tif (content === undefined) {\n\t\t\t\t\teditBuilder.clear(wasEmpty);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst isWithoutCell = this.nodesWithoutCells.delete(content.localId, 1) === 1;\n\t\t\t\tif (!isWithoutCell && this.options.enableDetachedRootEditing !== true) {\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`Attach edits require a minimum version for collaboration >= TBD.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst revision = this.mintRevisionTag();\n\t\t\t\tconst edits: EditDescription[] = [];\n\t\t\t\tlet stableSrcId: ChangeAtomId;\n\t\t\t\tif (isWithoutCell) {\n\t\t\t\t\tstableSrcId = content;\n\t\t\t\t} else {\n\t\t\t\t\t// If the node has an associated cell, then it may be concurrently moved to another location.\n\t\t\t\t\t// We use a rename to ensure that the node will be moved to a specific grave before the attach.\n\t\t\t\t\tstableSrcId = { localId: this.modularBuilder.generateId(), revision };\n\t\t\t\t\tconst rename: GlobalEditDescription = {\n\t\t\t\t\t\ttype: \"global\",\n\t\t\t\t\t\trevision,\n\t\t\t\t\t\trenames: [\n\t\t\t\t\t\t\t{ count: 1, oldId: content, newId: stableSrcId, detachLocation: undefined },\n\t\t\t\t\t\t],\n\t\t\t\t\t};\n\t\t\t\t\tedits.push(rename);\n\t\t\t\t}\n\t\t\t\tconst attach = makeAttachEditDescription(stableSrcId, revision, wasEmpty);\n\t\t\t\tedits.push(attach);\n\t\t\t\tthis.modularBuilder.submitChanges(edits, revision);\n\t\t\t},\n\t\t\tclear: (wasEmpty: boolean): void => {\n\t\t\t\tconst revision = this.mintRevisionTag();\n\t\t\t\tconst detach: ChangeAtomId = { localId: this.modularBuilder.generateId(), revision };\n\t\t\t\tconst optionalChange = optional.changeHandler.editor.clear(wasEmpty, detach);\n\t\t\t\tconst change: FieldChangeset = brand(optionalChange);\n\t\t\t\tconst edit: FieldEditDescription = {\n\t\t\t\t\ttype: \"field\",\n\t\t\t\t\tfield,\n\t\t\t\t\tfieldKind: optional.identifier,\n\t\t\t\t\tchange,\n\t\t\t\t\trevision,\n\t\t\t\t};\n\t\t\t\tthis.modularBuilder.submitChanges([edit], revision);\n\t\t\t},\n\t\t};\n\t\treturn editBuilder;\n\t}\n\n\tpublic move(\n\t\tsourceField: NormalizedFieldUpPath,\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestinationField: NormalizedFieldUpPath,\n\t\tdestIndex: number,\n\t): void {\n\t\tif (count === 0) {\n\t\t\treturn;\n\t\t} else if (count < 0 || !Number.isSafeInteger(count)) {\n\t\t\tthrow new UsageError(`Expected non-negative integer count, got ${count}.`);\n\t\t}\n\t\tconst revision = this.mintRevisionTag();\n\t\tconst detachCellId = this.modularBuilder.generateId(count);\n\t\tconst attachCellId: CellId = { localId: this.modularBuilder.generateId(count), revision };\n\t\tif (compareFieldUpPaths(sourceField, destinationField)) {\n\t\t\tconst change = sequence.changeHandler.editor.move(\n\t\t\t\tsourceIndex,\n\t\t\t\tcount,\n\t\t\t\tdestIndex,\n\t\t\t\tdetachCellId,\n\t\t\t\tattachCellId,\n\t\t\t\trevision,\n\t\t\t);\n\t\t\tthis.modularBuilder.submitChange(\n\t\t\t\tsourceField,\n\t\t\t\tsequence.identifier,\n\t\t\t\tbrand(change),\n\t\t\t\trevision,\n\t\t\t);\n\t\t} else {\n\t\t\tconst detachPath = topDownPath(sourceField.parent);\n\t\t\tconst attachPath = topDownPath(destinationField.parent);\n\t\t\tconst sharedDepth = getSharedPrefixLength(detachPath, attachPath);\n\t\t\tlet adjustedAttachField = destinationField;\n\t\t\t// `sharedDepth` is the number of elements, starting from the root, that both paths have in common.\n\t\t\tif (sharedDepth === detachPath.length) {\n\t\t\t\tconst lowestCommonAncestor: NormalizedUpPath | undefined = attachPath[sharedDepth];\n\t\t\t\tconst attachField = lowestCommonAncestor?.parentField ?? destinationField.field;\n\t\t\t\tif (attachField === sourceField.field) {\n\t\t\t\t\t// The detach occurs in an ancestor field of the field where the attach occurs.\n\t\t\t\t\tconst attachAncestorIndex = lowestCommonAncestor?.parentIndex ?? destIndex;\n\t\t\t\t\tif (attachAncestorIndex < sourceIndex) {\n\t\t\t\t\t\t// The attach path runs through a node located before the detached nodes.\n\t\t\t\t\t\t// No need to adjust the attach path.\n\t\t\t\t\t} else if (sourceIndex + count <= attachAncestorIndex) {\n\t\t\t\t\t\t// The attach path runs through a node located after the detached nodes.\n\t\t\t\t\t\t// adjust the index for the node at that depth of the path, so that it is interpreted correctly\n\t\t\t\t\t\t// in the composition performed by `submitChanges`.\n\t\t\t\t\t\tconst adjustedAttachAncestorIndex = attachAncestorIndex - count;\n\t\t\t\t\t\tlet parent: NormalizedUpPath =\n\t\t\t\t\t\t\tlowestCommonAncestor === undefined\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\tparent: undefined,\n\t\t\t\t\t\t\t\t\t\tdetachedNodeId: undefined,\n\t\t\t\t\t\t\t\t\t\tparentIndex: adjustedAttachAncestorIndex,\n\t\t\t\t\t\t\t\t\t\tparentField: destinationField.field,\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\t\t...lowestCommonAncestor,\n\t\t\t\t\t\t\t\t\t\tparentIndex: adjustedAttachAncestorIndex,\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (let i = sharedDepth + 1; i < attachPath.length; i += 1) {\n\t\t\t\t\t\t\tparent = {\n\t\t\t\t\t\t\t\t...(attachPath[i] ?? oob()),\n\t\t\t\t\t\t\t\tparent,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tadjustedAttachField = { parent, field: destinationField.field };\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\"Invalid move operation: the destination is located under one of the moved elements. Consider using the Tree.contains API to detect this.\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst moveOut = sequence.changeHandler.editor.remove(\n\t\t\t\tsourceIndex,\n\t\t\t\tcount,\n\t\t\t\tdetachCellId,\n\t\t\t\trevision,\n\t\t\t);\n\t\t\tconst moveIn = sequence.changeHandler.editor.insert(\n\t\t\t\tdestIndex,\n\t\t\t\tcount,\n\t\t\t\tattachCellId,\n\t\t\t\trevision,\n\t\t\t\tdetachCellId,\n\t\t\t);\n\n\t\t\tthis.modularBuilder.submitChanges(\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"field\",\n\t\t\t\t\t\tfield: sourceField,\n\t\t\t\t\t\tfieldKind: sequence.identifier,\n\t\t\t\t\t\tchange: brand(moveOut),\n\t\t\t\t\t\trevision,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"field\",\n\t\t\t\t\t\tfield: adjustedAttachField,\n\t\t\t\t\t\tfieldKind: sequence.identifier,\n\t\t\t\t\t\tchange: brand(moveIn),\n\t\t\t\t\t\trevision,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\trevision,\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic sequenceField(\n\t\tfield: NormalizedFieldUpPath,\n\t): SequenceFieldEditor<TreeChunk, DetachedRootIds> {\n\t\tconst makeAttachEditDescription = (\n\t\t\tindex: number,\n\t\t\t{ first, count }: DetachedRootIdRange,\n\t\t\trevision: RevisionTag,\n\t\t\tareWithoutCells: boolean,\n\t\t): EditDescription[] => {\n\t\t\tconst edits: EditDescription[] = [];\n\t\t\t// If the nodes have never been attached in cell, then we must use a cell ID that matches the build ID.\n\t\t\t// This ensures back-compatibility with the v1 ModularChangeFamily model which requires that every node be associated with cell\n\t\t\t// by generating an insert whose destination cell is the cell associated with the build ID.\n\t\t\tlet stableSrcId: ChangeAtomId;\n\t\t\tif (areWithoutCells) {\n\t\t\t\tstableSrcId = first;\n\t\t\t} else {\n\t\t\t\t// If the node has an associated cell, then it may be concurrently moved to another location.\n\t\t\t\t// We use a rename to ensure that the node will be moved to a specific grave before the attach.\n\t\t\t\tstableSrcId = { localId: this.modularBuilder.generateId(count), revision };\n\t\t\t\tconst rename: GlobalEditDescription = {\n\t\t\t\t\ttype: \"global\",\n\t\t\t\t\trevision,\n\t\t\t\t\trenames: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcount,\n\t\t\t\t\t\t\toldId: first,\n\t\t\t\t\t\t\tnewId: stableSrcId,\n\t\t\t\t\t\t\tdetachLocation: undefined,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t};\n\t\t\t\tedits.push(rename);\n\t\t\t}\n\t\t\tassert(stableSrcId.revision !== undefined, \"Detached nodes ID must have a revision\");\n\t\t\tconst change = sequence.changeHandler.editor.insert(\n\t\t\t\tindex,\n\t\t\t\tcount,\n\t\t\t\tstableSrcId,\n\t\t\t\tstableSrcId.revision,\n\t\t\t\tstableSrcId.localId,\n\t\t\t);\n\t\t\tconst attach: FieldEditDescription = {\n\t\t\t\ttype: \"field\",\n\t\t\t\tfield,\n\t\t\t\tfieldKind: sequence.identifier,\n\t\t\t\tchange: brand(change),\n\t\t\t\trevision,\n\t\t\t};\n\t\t\tedits.push(attach);\n\t\t\treturn edits;\n\t\t};\n\t\tconst editBuilder = {\n\t\t\tinsert: (index: number, content: TreeChunk): void => {\n\t\t\t\tconst count = content.topLevelLength;\n\t\t\t\tif (count === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst revision = this.mintRevisionTag();\n\t\t\t\tconst buildLocalId = this.modularBuilder.generateId();\n\t\t\t\tconst build = this.modularBuilder.buildTrees(buildLocalId, content, revision);\n\t\t\t\tconst roots: DetachedRootIdRange = {\n\t\t\t\t\tfirst: { localId: buildLocalId, revision },\n\t\t\t\t\tcount,\n\t\t\t\t};\n\n\t\t\t\tconst attach = makeAttachEditDescription(index, roots, revision, true);\n\t\t\t\tthis.modularBuilder.submitChanges([build, ...attach], revision);\n\t\t\t},\n\t\t\tattach: (index: number, newContent: DetachedRootIds): void => {\n\t\t\t\tconst attachRevision = this.mintRevisionTag();\n\t\t\t\tlet areAllWithoutCells = true;\n\t\t\t\tlet insertOffset = 0;\n\t\t\t\tconst edits: EditDescription[] = [];\n\t\t\t\tfor (const range of newContent) {\n\t\t\t\t\tif (range.count === 0) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tconst countWithoutCells = this.nodesWithoutCells.delete(\n\t\t\t\t\t\trange.first.localId,\n\t\t\t\t\t\trange.count,\n\t\t\t\t\t);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tcountWithoutCells === 0 || countWithoutCells === range.count,\n\t\t\t\t\t\t\"All detached roots within the same ID range must either all have or all not have a cell\",\n\t\t\t\t\t);\n\t\t\t\t\tconst areWithoutCells = countWithoutCells === range.count;\n\t\t\t\t\tif (!areWithoutCells) {\n\t\t\t\t\t\tareAllWithoutCells = false;\n\t\t\t\t\t}\n\t\t\t\t\tconst renameAndAttach = makeAttachEditDescription(\n\t\t\t\t\t\tindex + insertOffset,\n\t\t\t\t\t\trange,\n\t\t\t\t\t\tattachRevision,\n\t\t\t\t\t\tareWithoutCells,\n\t\t\t\t\t);\n\t\t\t\t\tedits.push(...renameAndAttach);\n\t\t\t\t\tinsertOffset += range.count;\n\t\t\t\t}\n\t\t\t\tif (!areAllWithoutCells && this.options.enableDetachedRootEditing !== true) {\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`Attach edits require a minimum version for collaboration >= TBD.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (edits.length > 0) {\n\t\t\t\t\tthis.modularBuilder.submitChanges(edits, attachRevision);\n\t\t\t\t}\n\t\t\t},\n\t\t\tremove: (index: number, count: number): void => {\n\t\t\t\tif (count === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst revision = this.mintRevisionTag();\n\t\t\t\tconst id = this.modularBuilder.generateId(count);\n\t\t\t\tconst change: FieldChangeset = brand(\n\t\t\t\t\tsequence.changeHandler.editor.remove(index, count, id, revision),\n\t\t\t\t);\n\t\t\t\tthis.modularBuilder.submitChange(field, sequence.identifier, change, revision);\n\t\t\t},\n\t\t};\n\t\treturn editBuilder;\n\t}\n}\n\nexport interface RequiredFieldEditor<TContent, TDetachedRoot> {\n\t/**\n\t * Issues a change which replaces the content of the field with the given detached node.\n\t * @param content - The content to be attached in the field in the given order.\n\t * Must represent a single detached node.\n\t * Must have been created in the same JS turn.\n\t *\n\t * Requires SharedTreeFormatVersion.vDetachedRoots or later.\n\t */\n\tattach(content: TDetachedRoot): void;\n\n\t/**\n\t * Issues a change which replaces the content of the field with `newContent`.\n\t * @param newContent - the new content for the field.\n\t */\n\tset(newContent: TContent): void;\n}\n\nexport interface OptionalFieldEditor<TContent, TDetachedRoots> {\n\t/**\n\t * Issues a change which replaces the content of the field with the given detached node.\n\t * @param content - The content to be attached in the field in the given order.\n\t * Must represent a single detached node.\n\t *\n\t * Requires SharedTreeFormatVersion.vDetachedRoots or later.\n\t */\n\tattach(content: TDetachedRoots | undefined, wasEmpty: boolean): void;\n\n\t/**\n\t * Issues a change which clears content of the field.\n\t * @param wasEmpty - whether the field is empty when creating this change\n\t */\n\tclear(wasEmpty: boolean): void;\n\n\t/**\n\t * Issues a change which replaces the content of the field with `newContent`\n\t * @param newContent - the new content for the field.\n\t * @param wasEmpty - whether the field is empty when creating this change\n\t */\n\tset(newContent: TContent | undefined, wasEmpty: boolean): void;\n}\n\n/**\n * Editor for the sequence field kind.\n */\nexport interface SequenceFieldEditor<TContent, TDetachedRoots, TRemoved = void> {\n\t/**\n\t * Issues a change which attaches a sequence of detached nodes at the given `index`.\n\t * @param index - The index at which to attach the detached nodes.\n\t * @param detachedContent - The content to be attached in the field in the given order. Each node must be detached.\n\t *\n\t * Requires SharedTreeFormatVersion.vDetachedRoots or later.\n\t */\n\tattach(index: number, detachedContent: TDetachedRoots): void;\n\n\t/**\n\t * Issues a change which inserts the `newContent` at the given `index`.\n\t * @param index - the index at which to insert the `newContent`.\n\t * @param newContent - the new content to be inserted in the field.\n\t */\n\tinsert(index: number, newContent: TContent): void;\n\n\t/**\n\t * Issues a change which removes `count` elements starting at the given `index`.\n\t * @param index - The index of the first removed element.\n\t * @param count - The number of elements to remove.\n\t */\n\tremove(index: number, count: number): TRemoved;\n}\n\n/**\n * Gets the number of path elements that both paths share, starting at index 0.\n */\nfunction getSharedPrefixLength(pathA: readonly UpPath[], pathB: readonly UpPath[]): number {\n\tconst minDepth = Math.min(pathA.length, pathB.length);\n\tlet sharedDepth = 0;\n\twhile (sharedDepth < minDepth) {\n\t\tconst detachStep = pathA[sharedDepth] ?? oob();\n\t\tconst attachStep = pathB[sharedDepth] ?? oob();\n\t\tif (\n\t\t\tdetachStep !== attachStep &&\n\t\t\t(detachStep.parentField !== attachStep.parentField ||\n\t\t\t\tdetachStep.parentIndex !== attachStep.parentIndex)\n\t\t) {\n\t\t\tbreak;\n\t\t}\n\t\tsharedDepth += 1;\n\t}\n\treturn sharedDepth;\n}\n"]}
1
+ {"version":3,"file":"defaultEditBuilder.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultEditBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,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M,QAAQ,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;gBACxC,MAAM,EAAE,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;gBACjD,MAAM,MAAM,GAAmB,KAAK,CACnC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,CAAC,CAChE,CAAC;gBACF,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;YAChF,CAAC;SACD,CAAC;IACH,CAAC;CACD;AAsCD;;GAEG;AACH,SAAS,qBAAqB,CAAC,KAAwB,EAAE,KAAwB;IAChF,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtD,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,OAAO,WAAW,GAAG,QAAQ,EAAE,CAAC;QAC/B,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,GAAG,EAAE,CAAC;QAC/C,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,GAAG,EAAE,CAAC;QAC/C,IACC,UAAU,KAAK,UAAU;YACzB,CAAC,UAAU,CAAC,WAAW,KAAK,UAAU,CAAC,WAAW;gBACjD,UAAU,CAAC,WAAW,KAAK,UAAU,CAAC,WAAW,CAAC,EAClD,CAAC;YACF,MAAM;QACP,CAAC;QACD,WAAW,IAAI,CAAC,CAAC;IAClB,CAAC;IACD,OAAO,WAAW,CAAC;AACpB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { CodecWriteOptions, ICodecFamily } from \"../../codec/index.js\";\nimport {\n\ttype ChangeAtomId,\n\ttype ChangeEncodingContext,\n\ttype ChangeFamily,\n\ttype ChangeFamilyEditor,\n\ttype ChangeRebaser,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaRoot,\n\ttype FieldUpPath,\n\ttype NormalizedFieldUpPath,\n\ttype NormalizedUpPath,\n\ttype RevisionTag,\n\ttype TaggedChange,\n\ttype TreeChunk,\n\ttype UpPath,\n\tcompareFieldUpPaths,\n\ttopDownPath,\n} from \"../../core/index.js\";\nimport { brand } from \"../../util/index.js\";\nimport {\n\ttype EditDescription,\n\ttype FieldChangeset,\n\ttype FieldEditDescription,\n\tModularChangeFamily,\n\ttype ModularChangeset,\n\tModularEditBuilder,\n\tintoDelta as intoModularDelta,\n\trelevantRemovedRoots as relevantModularRemovedRoots,\n} from \"../modular-schema/index.js\";\nimport { optional, type OptionalChangeset, required } from \"../optional-field/index.js\";\nimport { sequence, type CellId } from \"../sequence-field/index.js\";\n\nimport { fieldKinds } from \"./defaultFieldKinds.js\";\n\nexport type DefaultChangeset = ModularChangeset;\n\n/**\n * Implementation of {@link ChangeFamily} based on the default set of supported field kinds.\n *\n * @sealed\n */\nexport class DefaultChangeFamily\n\timplements ChangeFamily<DefaultEditBuilder, DefaultChangeset>\n{\n\tprivate readonly modularFamily: ModularChangeFamily;\n\n\tpublic constructor(\n\t\tcodecs: ICodecFamily<ModularChangeset, ChangeEncodingContext>,\n\t\tcodecOptions: CodecWriteOptions,\n\t) {\n\t\tthis.modularFamily = new ModularChangeFamily(fieldKinds, codecs, codecOptions);\n\t}\n\n\tpublic get rebaser(): ChangeRebaser<DefaultChangeset> {\n\t\treturn this.modularFamily.rebaser;\n\t}\n\n\tpublic get codecs(): ICodecFamily<DefaultChangeset, ChangeEncodingContext> {\n\t\treturn this.modularFamily.codecs;\n\t}\n\n\tpublic buildEditor(\n\t\tmintRevisionTag: () => RevisionTag,\n\t\tchangeReceiver: (change: TaggedChange<DefaultChangeset>) => void,\n\t): DefaultEditBuilder {\n\t\treturn new DefaultEditBuilder(\n\t\t\tthis,\n\t\t\tmintRevisionTag,\n\t\t\tchangeReceiver,\n\t\t\tthis.modularFamily.codecOptions,\n\t\t);\n\t}\n}\n\n/**\n * @param change - The change to convert into a delta.\n */\nexport function intoDelta(taggedChange: TaggedChange<ModularChangeset>): DeltaRoot {\n\treturn intoModularDelta(taggedChange, fieldKinds);\n}\n\n/**\n * Returns the set of removed roots that should be in memory for the given change to be applied.\n * A removed root is relevant if any of the following is true:\n * - It is being inserted\n * - It is being restored\n * - It is being edited\n * - The ID it is associated with is being changed\n *\n * May be conservative by returning more removed roots than strictly necessary.\n *\n * Will never return IDs for non-root trees, even if they are removed.\n *\n * @param change - The change to be applied.\n */\nexport function relevantRemovedRoots(change: ModularChangeset): Iterable<DeltaDetachedNodeId> {\n\treturn relevantModularRemovedRoots(change, fieldKinds);\n}\n\n/**\n * Default editor for transactional tree data changes.\n * @privateRemarks\n * When taking into account not just the content of the tree,\n * but also how the merge identities (and thus anchors, flex-tree and simple-tree nodes) of nodes before and after the edits correspond,\n * some edits are currently impossible to express.\n * Examples of these non-expressible edits include:\n *\n * - Changing the type of a node while keeping its merge identity.\n * - Changing the value of a leaf while keeping its merge identity.\n * - Swapping subtrees between two value fields.\n * - Replacing a node in the middle of a tree while reusing some of the old nodes decedents that were under value fields.\n *\n * At some point it will likely be worth supporting at least some of these, possibly using a mechanism that could support all of them if desired.\n * If/when such a mechanism becomes available, an evaluation should be done to determine if any existing editing operations should be changed to leverage it\n * (Possibly by adding opt ins at the view schema layer).\n */\nexport interface IDefaultEditBuilder<TContent = TreeChunk> {\n\t/**\n\t * @param field - the value field which is being edited under the parent node\n\t * @returns An object with methods to edit the given field of the given parent.\n\t * The returned object can be used (i.e., have its methods called) multiple times but its lifetime\n\t * is bounded by the lifetime of this edit builder.\n\t */\n\tvalueField(field: NormalizedFieldUpPath): ValueFieldEditBuilder<TContent>;\n\n\t/**\n\t * @param field - the optional field which is being edited under the parent node\n\t * @returns An object with methods to edit the given field of the given parent.\n\t * The returned object can be used (i.e., have its methods called) multiple times but its lifetime\n\t * is bounded by the lifetime of this edit builder.\n\t */\n\toptionalField(field: NormalizedFieldUpPath): OptionalFieldEditBuilder<TContent>;\n\n\t/**\n\t * @param field - the sequence field which is being edited under the parent node\n\t *\n\t * @returns An object with methods to edit the given field of the given parent.\n\t * The returned object can be used (i.e., have its methods called) multiple times but its lifetime\n\t * is bounded by the lifetime of this edit builder.\n\t */\n\tsequenceField(field: NormalizedFieldUpPath): SequenceFieldEditBuilder<TContent>;\n\n\t/**\n\t * Moves a subsequence from one sequence field to another sequence field.\n\t *\n\t * Note that the `destinationIndex` is interpreted based on the state of the sequence *before* the move operation.\n\t * For example, `move(field, 0, 1, field, 2)` changes `[A, B, C]` to `[B, A, C]`.\n\t */\n\tmove(\n\t\tsourceField: NormalizedFieldUpPath,\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestinationField: NormalizedFieldUpPath,\n\t\tdestinationIndex: number,\n\t): void;\n\n\t/**\n\t * Add a constraint that, for this change to apply, the node at the given path must exist immediately before the change is applied.\n\t * @param path - The path to the node that must exist.\n\t */\n\taddNodeExistsConstraint(path: NormalizedUpPath): void;\n\n\t/**\n\t * Add a constraint that, for the revert of this change to apply, the node at the given path must exist immediately before the revert is applied.\n\t * @param path - The path to the node that must exist when reverting a change.\n\t */\n\taddNodeExistsConstraintOnRevert(path: NormalizedUpPath): void;\n\n\t/**\n\t * Add a constraint that, for this change to apply, the document must be in the same state immediately before this change is applied as it was before this change was authored.\n\t */\n\taddNoChangeConstraint(): void;\n\n\t/**\n\t * Add a constraint that, for the revert of this change to apply, the document must be in the same state immediately before the revert is applied as it was after this change was applied.\n\t */\n\taddNoChangeConstraintOnRevert(): void;\n}\n\n/**\n * Implementation of {@link IDefaultEditBuilder} based on the default set of supported field kinds.\n * @sealed\n */\nexport class DefaultEditBuilder implements ChangeFamilyEditor, IDefaultEditBuilder {\n\tprivate readonly modularBuilder: ModularEditBuilder;\n\n\tpublic constructor(\n\t\tfamily: ChangeFamily<ChangeFamilyEditor, DefaultChangeset>,\n\t\tprivate readonly mintRevisionTag: () => RevisionTag,\n\t\tchangeReceiver: (change: TaggedChange<DefaultChangeset>) => void,\n\t\tcodecOptions: CodecWriteOptions,\n\t) {\n\t\tthis.modularBuilder = new ModularEditBuilder(\n\t\t\tfamily,\n\t\t\tfieldKinds,\n\t\t\tchangeReceiver,\n\t\t\tcodecOptions,\n\t\t);\n\t}\n\n\tpublic enterTransaction(): void {\n\t\tthis.modularBuilder.enterTransaction();\n\t}\n\tpublic exitTransaction(): void {\n\t\tthis.modularBuilder.exitTransaction();\n\t}\n\n\tpublic addNodeExistsConstraint(path: UpPath): void {\n\t\tthis.modularBuilder.addNodeExistsConstraint(path, this.mintRevisionTag());\n\t}\n\n\tpublic addNodeExistsConstraintOnRevert(path: UpPath): void {\n\t\tthis.modularBuilder.addNodeExistsConstraintOnRevert(path, this.mintRevisionTag());\n\t}\n\n\tpublic addNoChangeConstraint(): void {\n\t\tthis.modularBuilder.addNoChangeConstraint(this.mintRevisionTag());\n\t}\n\n\tpublic addNoChangeConstraintOnRevert(): void {\n\t\tthis.modularBuilder.addNoChangeConstraintOnRevert(this.mintRevisionTag());\n\t}\n\n\tpublic valueField(field: FieldUpPath): ValueFieldEditBuilder<TreeChunk> {\n\t\treturn {\n\t\t\tset: (newContent: TreeChunk): void => {\n\t\t\t\tassert(\n\t\t\t\t\tnewContent.topLevelLength === 1,\n\t\t\t\t\t0xc12 /* Value fields should have a single top level node */,\n\t\t\t\t);\n\t\t\t\tconst revision = this.mintRevisionTag();\n\t\t\t\tconst fill: ChangeAtomId = { localId: this.modularBuilder.generateId(), revision };\n\t\t\t\tconst detach: ChangeAtomId = { localId: this.modularBuilder.generateId(), revision };\n\t\t\t\tconst build = this.modularBuilder.buildTrees(fill.localId, newContent, revision);\n\t\t\t\tconst change: FieldChangeset = brand(\n\t\t\t\t\trequired.changeHandler.editor.set({\n\t\t\t\t\t\tfill,\n\t\t\t\t\t\tdetach,\n\t\t\t\t\t}),\n\t\t\t\t);\n\n\t\t\t\tconst edit: FieldEditDescription = {\n\t\t\t\t\ttype: \"field\",\n\t\t\t\t\tfield,\n\t\t\t\t\tfieldKind: required.identifier,\n\t\t\t\t\tchange,\n\t\t\t\t\trevision,\n\t\t\t\t};\n\t\t\t\tthis.modularBuilder.submitChanges([build, edit], revision);\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic optionalField(field: FieldUpPath): OptionalFieldEditBuilder<TreeChunk> {\n\t\treturn {\n\t\t\tset: (newContent: TreeChunk | undefined, wasEmpty: boolean): void => {\n\t\t\t\t// The choice to ban empty chunks here instead of treating them as a clear is a subjective choice made to err of the side of more explicitness and stricter validation.\n\t\t\t\tassert(\n\t\t\t\t\tnewContent === undefined || newContent.topLevelLength === 1,\n\t\t\t\t\t0xc13 /* optional fields should have a single top level node, or undefined */,\n\t\t\t\t);\n\t\t\t\tconst edits: EditDescription[] = [];\n\t\t\t\tlet optionalChange: OptionalChangeset;\n\t\t\t\tconst revision = this.mintRevisionTag();\n\t\t\t\tconst detach: ChangeAtomId = { localId: this.modularBuilder.generateId(), revision };\n\t\t\t\tif (newContent === undefined) {\n\t\t\t\t\toptionalChange = optional.changeHandler.editor.clear(wasEmpty, detach);\n\t\t\t\t} else {\n\t\t\t\t\tconst fill: ChangeAtomId = { localId: this.modularBuilder.generateId(), revision };\n\t\t\t\t\tconst build = this.modularBuilder.buildTrees(fill.localId, newContent, revision);\n\t\t\t\t\tedits.push(build);\n\n\t\t\t\t\toptionalChange = optional.changeHandler.editor.set(wasEmpty, {\n\t\t\t\t\t\tfill,\n\t\t\t\t\t\tdetach,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tconst change: FieldChangeset = brand(optionalChange);\n\t\t\t\tconst edit: FieldEditDescription = {\n\t\t\t\t\ttype: \"field\",\n\t\t\t\t\tfield,\n\t\t\t\t\tfieldKind: optional.identifier,\n\t\t\t\t\tchange,\n\t\t\t\t\trevision,\n\t\t\t\t};\n\t\t\t\tedits.push(edit);\n\n\t\t\t\tthis.modularBuilder.submitChanges(edits, revision);\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic move(\n\t\tsourceField: FieldUpPath,\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestinationField: FieldUpPath,\n\t\tdestIndex: number,\n\t): void {\n\t\tif (count === 0) {\n\t\t\treturn;\n\t\t} else if (count < 0 || !Number.isSafeInteger(count)) {\n\t\t\tthrow new UsageError(`Expected non-negative integer count, got ${count}.`);\n\t\t}\n\t\tconst revision = this.mintRevisionTag();\n\t\tconst detachCellId = this.modularBuilder.generateId(count);\n\t\tconst attachCellId: CellId = { localId: this.modularBuilder.generateId(count), revision };\n\t\tif (compareFieldUpPaths(sourceField, destinationField)) {\n\t\t\tconst change = sequence.changeHandler.editor.move(\n\t\t\t\tsourceIndex,\n\t\t\t\tcount,\n\t\t\t\tdestIndex,\n\t\t\t\tdetachCellId,\n\t\t\t\tattachCellId,\n\t\t\t\trevision,\n\t\t\t);\n\t\t\tthis.modularBuilder.submitChange(\n\t\t\t\tsourceField,\n\t\t\t\tsequence.identifier,\n\t\t\t\tbrand(change),\n\t\t\t\trevision,\n\t\t\t);\n\t\t} else {\n\t\t\tconst detachPath = topDownPath(sourceField.parent);\n\t\t\tconst attachPath = topDownPath(destinationField.parent);\n\t\t\tconst sharedDepth = getSharedPrefixLength(detachPath, attachPath);\n\t\t\tlet adjustedAttachField = destinationField;\n\t\t\t// After the above loop, `sharedDepth` is the number of elements, starting from the root,\n\t\t\t// that both paths have in common.\n\t\t\tif (sharedDepth === detachPath.length) {\n\t\t\t\tconst attachField = attachPath[sharedDepth]?.parentField ?? destinationField.field;\n\t\t\t\tif (attachField === sourceField.field) {\n\t\t\t\t\t// The detach occurs in an ancestor field of the field where the attach occurs.\n\t\t\t\t\tlet attachAncestorIndex = attachPath[sharedDepth]?.parentIndex ?? sourceIndex;\n\t\t\t\t\tif (attachAncestorIndex < sourceIndex) {\n\t\t\t\t\t\t// The attach path runs through a node located before the detached nodes.\n\t\t\t\t\t\t// No need to adjust the attach path.\n\t\t\t\t\t} else if (sourceIndex + count <= attachAncestorIndex) {\n\t\t\t\t\t\t// The attach path runs through a node located after the detached nodes.\n\t\t\t\t\t\t// adjust the index for the node at that depth of the path, so that it is interpreted correctly\n\t\t\t\t\t\t// in the composition performed by `submitChanges`.\n\t\t\t\t\t\tattachAncestorIndex -= count;\n\t\t\t\t\t\tlet parent: UpPath | undefined = attachPath[sharedDepth - 1];\n\t\t\t\t\t\tconst parentField = attachPath[sharedDepth] ?? oob();\n\t\t\t\t\t\tparent = {\n\t\t\t\t\t\t\tparent,\n\t\t\t\t\t\t\tparentIndex: attachAncestorIndex,\n\t\t\t\t\t\t\tparentField: parentField.parentField,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (let i = sharedDepth + 1; i < attachPath.length; i += 1) {\n\t\t\t\t\t\t\tparent = {\n\t\t\t\t\t\t\t\t...(attachPath[i] ?? oob()),\n\t\t\t\t\t\t\t\tparent,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tadjustedAttachField = { parent, field: destinationField.field };\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\"Invalid move operation: the destination is located under one of the moved elements. Consider using the Tree.contains API to detect this.\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst moveOut = sequence.changeHandler.editor.moveOut(\n\t\t\t\tsourceIndex,\n\t\t\t\tcount,\n\t\t\t\tdetachCellId,\n\t\t\t\trevision,\n\t\t\t);\n\t\t\tconst moveIn = sequence.changeHandler.editor.moveIn(\n\t\t\t\tdestIndex,\n\t\t\t\tcount,\n\t\t\t\tdetachCellId,\n\t\t\t\tattachCellId,\n\t\t\t\trevision,\n\t\t\t);\n\t\t\tthis.modularBuilder.submitChanges(\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"field\",\n\t\t\t\t\t\tfield: sourceField,\n\t\t\t\t\t\tfieldKind: sequence.identifier,\n\t\t\t\t\t\tchange: brand(moveOut),\n\t\t\t\t\t\trevision,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"field\",\n\t\t\t\t\t\tfield: adjustedAttachField,\n\t\t\t\t\t\tfieldKind: sequence.identifier,\n\t\t\t\t\t\tchange: brand(moveIn),\n\t\t\t\t\t\trevision,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\trevision,\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic sequenceField(field: FieldUpPath): SequenceFieldEditBuilder<TreeChunk> {\n\t\treturn {\n\t\t\tinsert: (index: number, content: TreeChunk): void => {\n\t\t\t\tconst length = content.topLevelLength;\n\t\t\t\tif (length === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst revision = this.mintRevisionTag();\n\t\t\t\tconst firstId: CellId = { localId: this.modularBuilder.generateId(length), revision };\n\t\t\t\tconst build = this.modularBuilder.buildTrees(firstId.localId, content, revision);\n\t\t\t\tconst change: FieldChangeset = brand(\n\t\t\t\t\tsequence.changeHandler.editor.insert(index, length, firstId, revision),\n\t\t\t\t);\n\t\t\t\tconst attach: FieldEditDescription = {\n\t\t\t\t\ttype: \"field\",\n\t\t\t\t\tfield,\n\t\t\t\t\tfieldKind: sequence.identifier,\n\t\t\t\t\tchange,\n\t\t\t\t\trevision,\n\t\t\t\t};\n\t\t\t\t// The changes have to be submitted together, otherwise they will be assigned different revisions,\n\t\t\t\t// which will prevent the build ID and the insert ID from matching.\n\t\t\t\tthis.modularBuilder.submitChanges([build, attach], revision);\n\t\t\t},\n\t\t\tremove: (index: number, count: number): void => {\n\t\t\t\tif (count === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst revision = this.mintRevisionTag();\n\t\t\t\tconst id = this.modularBuilder.generateId(count);\n\t\t\t\tconst change: FieldChangeset = brand(\n\t\t\t\t\tsequence.changeHandler.editor.remove(index, count, id, revision),\n\t\t\t\t);\n\t\t\t\tthis.modularBuilder.submitChange(field, sequence.identifier, change, revision);\n\t\t\t},\n\t\t};\n\t}\n}\n\nexport interface ValueFieldEditBuilder<TContent> {\n\t/**\n\t * Issues a change which replaces the current newContent of the field with `newContent`.\n\t * @param newContent - the new content for the field.\n\t */\n\tset(newContent: TContent): void;\n}\n\nexport interface OptionalFieldEditBuilder<TContent> {\n\t/**\n\t * Issues a change which replaces the current newContent of the field with `newContent`.\n\t * @param newContent - the new content for the field.\n\t * @param wasEmpty - whether the field is empty when creating this change.\n\t */\n\tset(newContent: TContent | undefined, wasEmpty: boolean): void;\n}\n\n/**\n * Edit builder for the sequence field kind.\n */\nexport interface SequenceFieldEditBuilder<TContent, TRemoved = void> {\n\t/**\n\t * Issues a change which inserts the `newContent` at the given `index`.\n\t * @param index - the index at which to insert the `newContent`.\n\t * @param newContent - the new content to be inserted in the field. Cursor can be in either Field or Node mode.\n\t */\n\tinsert(index: number, newContent: TContent): void;\n\n\t/**\n\t * Issues a change which removes `count` elements starting at the given `index`.\n\t * @param index - The index of the first removed element.\n\t * @param count - The number of elements to remove.\n\t */\n\tremove(index: number, count: number): TRemoved;\n}\n\n/**\n * Gets the number of path elements that both paths share, starting at index 0.\n */\nfunction getSharedPrefixLength(pathA: readonly UpPath[], pathB: readonly UpPath[]): number {\n\tconst minDepth = Math.min(pathA.length, pathB.length);\n\tlet sharedDepth = 0;\n\twhile (sharedDepth < minDepth) {\n\t\tconst detachStep = pathA[sharedDepth] ?? oob();\n\t\tconst attachStep = pathB[sharedDepth] ?? oob();\n\t\tif (\n\t\t\tdetachStep !== attachStep &&\n\t\t\t(detachStep.parentField !== attachStep.parentField ||\n\t\t\t\tdetachStep.parentIndex !== attachStep.parentIndex)\n\t\t) {\n\t\t\tbreak;\n\t\t}\n\t\tsharedDepth += 1;\n\t}\n\treturn sharedDepth;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"defaultFieldKinds.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultFieldKinds.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAEN,KAAK,mBAAmB,EACxB,4BAA4B,EAC5B,YAAY,EACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAE3B,aAAa,EACb,KAAK,gBAAgB,EACrB,0BAA0B,EAG1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAItD;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,kBAAkB,CAAC,CAAC,CAejD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,UAYxB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,SAAS,EAAE,SAOvB,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAChD,0BAA0B,EAC1B,sBAAsB,CA0CrB,CAAC;AAEH,wBAAgB,kCAAkC,CACjD,OAAO,EAAE,0BAA0B,GACjC,SAAS,CAcX;AAED;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,mBAAmB,EAAE,aAAa,CAEtE,CAAC;AAOF,MAAM,WAAW,UAChB,SAAQ,aAAa,CACpB,WAAW,CAAC,CAAC,CAAC,EACd,OAAO,yBAAyB,EAChC,YAAY,CAAC,MAAM,CACnB;CAAG;AACL,MAAM,WAAW,SAChB,SAA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,SAOvB,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAChD,0BAA0B,EAC1B,sBAAsB,CAgCrB,CAAC;AAEH,wBAAgB,kCAAkC,CACjD,OAAO,EAAE,0BAA0B,GACjC,SAAS,CAcX;AAED;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,mBAAmB,EAAE,aAAa,CAEtE,CAAC;AAOF,MAAM,WAAW,UAChB,SAAQ,aAAa,CACpB,WAAW,CAAC,CAAC,CAAC,EACd,OAAO,yBAAyB,EAChC,YAAY,CAAC,MAAM,CACnB;CAAG;AACL,MAAM,WAAW,SAChB,SAAQ,aAAa,CACpB,WAAW,CAAC,CAAC,CAAC,EACd,OAAO,4BAA4B,EACnC,YAAY,CAAC,SAAS,CACtB;CAAG;AAEL;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE;IAExB,QAAQ,CAAC,QAAQ,EAAE,OAAO,QAAQ,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,OAAO,QAAQ,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,OAAO,QAAQ,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;CAC4B,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,gBAEjC,CAAC"}
@@ -21,12 +21,12 @@ export const noChangeHandler = {
21
21
  }),
22
22
  codecsFactory: () => noChangeCodecFamily,
23
23
  editor: { buildChildChanges: () => fail(0xb0d /* Child changes not supported */) },
24
- intoDelta: (change, deltaFromChild) => ({ marks: [] }),
24
+ intoDelta: (change, deltaFromChild) => ({}),
25
+ relevantRemovedRoots: (change) => [],
25
26
  isEmpty: (change) => true,
26
27
  getNestedChanges: (change) => [],
27
28
  createEmpty: () => 0,
28
29
  getCrossFieldKeys: () => [],
29
- getDetachCellIds: () => [],
30
30
  };
31
31
  /**
32
32
  * Exactly one identifier.
@@ -103,16 +103,6 @@ export const fieldKindConfigurations = new Map([
103
103
  [identifier.identifier, { kind: identifier, formatVersion: 1 }],
104
104
  ]),
105
105
  ],
106
- [
107
- ModularChangeFormatVersion.vDetachedRoots,
108
- new Map([
109
- [required.identifier, { kind: required, formatVersion: 2 }],
110
- [optional.identifier, { kind: optional, formatVersion: 3 }],
111
- [sequence.identifier, { kind: sequence, formatVersion: 2 }],
112
- [forbidden.identifier, { kind: forbidden, formatVersion: 1 }],
113
- [identifier.identifier, { kind: identifier, formatVersion: 1 }],
114
- ]),
115
- ],
116
106
  ]);
117
107
  export function getCodecTreeForModularChangeFormat(version) {
118
108
  const dependencies = fieldKindConfigurations.get(version) ?? fail(0xc7c /* Unknown modular change format */);
@@ -1 +1 @@
1
- {"version":3,"file":"defaultFieldKinds.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultFieldKinds.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAG3D,OAAO,EAGN,4BAA4B,EAC5B,YAAY,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAKN,aAAa,EAEb,0BAA0B,EAE1B,+BAA+B,GAC/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAA0B;IACrD,OAAO,EAAE,+BAA+B,CAAC;QACxC,OAAO,EAAE,CAAC,OAAU,EAAE,OAAU,EAAE,EAAE,CAAC,CAAC;QACtC,MAAM,EAAE,CAAC,OAAU,EAAE,EAAE,CAAC,CAAC;QACzB,MAAM,EAAE,CAAC,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AAC,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAC9B,IAAI,EAAE,aAAa,GAAG,EAAE;QACxB,OAAO,EAAE,aAAa;KACtB,CAAC,CACF,CAAC;IACF,OAAO;QACN,IAAI,EAAE,eAAe;QACrB,OAAO;QACP,QAAQ;KACR,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAoD,IAAI,GAAG,CACjF,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,CACnF,CAAC;AAoBF;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAOnB,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;AAE5D;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAqB;IACpD,UAAU;CACV,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\n\nimport type { CodecTree } from \"../../codec/index.js\";\nimport {\n\ttype DeltaFieldChanges,\n\ttype FieldKindIdentifier,\n\tforbiddenFieldKindIdentifier,\n\tMultiplicity,\n} from \"../../core/index.js\";\nimport { identifierFieldIdentifier } from \"../fieldKindIdentifiers.js\";\nimport {\n\ttype FieldChangeHandler,\n\ttype FieldEditor,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\tModularChangeFormatVersion,\n\ttype ToDelta,\n\treferenceFreeFieldChangeRebaser,\n} from \"../modular-schema/index.js\";\nimport { optional, required } from \"../optional-field/index.js\";\nimport { sequence } from \"../sequence-field/index.js\";\n\nimport { noChangeCodecFamily } from \"./noChangeCodecs.js\";\n\n/**\n * ChangeHandler that only handles no-op / identity changes.\n */\nexport const noChangeHandler: FieldChangeHandler<0> = {\n\trebaser: referenceFreeFieldChangeRebaser({\n\t\tcompose: (change1: 0, change2: 0) => 0,\n\t\tinvert: (changes: 0) => 0,\n\t\trebase: (change: 0, over: 0) => 0,\n\t\tmute: (changes: 0) => 0,\n\t}),\n\tcodecsFactory: () => noChangeCodecFamily,\n\teditor: { buildChildChanges: () => fail(0xb0d /* Child changes not supported */) },\n\tintoDelta: (change, deltaFromChild: ToDelta): DeltaFieldChanges => ({ marks: [] }),\n\tisEmpty: (change: 0) => true,\n\tgetNestedChanges: (change: 0) => [],\n\tcreateEmpty: () => 0,\n\tgetCrossFieldKeys: () => [],\n\tgetDetachCellIds: () => [],\n};\n\n/**\n * Exactly one identifier.\n */\nexport const identifier: Identifier = new FlexFieldKind(\n\tidentifierFieldIdentifier,\n\tMultiplicity.Single,\n\t{\n\t\tchangeHandler: noChangeHandler,\n\t\t// By omitting required here,\n\t\t// this is making a policy choice that a schema upgrade cannot be done from required to identifier.\n\t\t// Since an identifier can be upgraded into a required field,\n\t\t// preventing the inverse helps ensure that schema upgrades are monotonic.\n\t\t// Which direction is allowed is a subjective policy choice.\n\t\tallowMonotonicUpgradeFrom: new Set([]),\n\t},\n);\n\n/**\n * Exactly 0 items.\n *\n * Using Forbidden makes what types are listed for allowed in a field irrelevant\n * since the field will never have values in it.\n *\n * Using Forbidden is equivalent to picking a kind that permits empty (like sequence or optional)\n * and having no allowed types (or only never types).\n * Because of this, its possible to express everything constraint wise without Forbidden,\n * but using Forbidden can be more semantically clear than optional with no allowed types.\n *\n * For view schema, this can be useful if you need to:\n * - run a specific out of schema handler when a field is present,\n * but otherwise are ignoring or tolerating (ex: via extra fields) unmentioned fields.\n * - prevent a specific field from being used as an extra field\n * (perhaps for some past of future compatibility reason)\n * - keep a field in a schema for metadata purposes\n * (ex: for improved error messaging, error handling or documentation)\n * that is not used in this specific version of the schema (ex: to document what it was or will be used for).\n *\n * For stored schema, this can be useful if you need to:\n * - have a field which can have its schema updated to Optional or Sequence of any type.\n * - to exclude a field from extra fields\n * - for the schema system to use as a default for fields which aren't declared\n * (ex: when updating a field that did not exist into one that does)\n *\n * See {@link emptyField} for a constant, reusable field using Forbidden.\n */\nexport const forbidden: Forbidden = new FlexFieldKind(\n\tforbiddenFieldKindIdentifier,\n\tMultiplicity.Forbidden,\n\t{\n\t\tchangeHandler: noChangeHandler,\n\t\tallowMonotonicUpgradeFrom: new Set(),\n\t},\n);\n\nexport const fieldKindConfigurations: ReadonlyMap<\n\tModularChangeFormatVersion,\n\tFieldKindConfiguration\n> = new Map<ModularChangeFormatVersion, FieldKindConfiguration>([\n\t[\n\t\tModularChangeFormatVersion.v3,\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 2 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n\t[\n\t\tModularChangeFormatVersion.v4,\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 3 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n\t[\n\t\tModularChangeFormatVersion.v5,\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 3 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n\t[\n\t\tModularChangeFormatVersion.vDetachedRoots,\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 3 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 2 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n]);\n\nexport function getCodecTreeForModularChangeFormat(\n\tversion: ModularChangeFormatVersion,\n): CodecTree {\n\tconst dependencies =\n\t\tfieldKindConfigurations.get(version) ?? fail(0xc7c /* Unknown modular change format */);\n\tconst children: CodecTree[] = [...dependencies.entries()].map(\n\t\t([key, { formatVersion }]) => ({\n\t\t\tname: `FieldKind:${key}`,\n\t\t\tversion: formatVersion,\n\t\t}),\n\t);\n\treturn {\n\t\tname: \"ModularChange\",\n\t\tversion,\n\t\tchildren,\n\t};\n}\n\n/**\n * All supported field kinds.\n *\n * @privateRemarks\n * Before making a SharedTree format change which impacts which set of field kinds are allowed,\n * code which uses this should be audited for compatibility considerations.\n */\nexport const fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind> = new Map(\n\t[required, optional, sequence, identifier, forbidden].map((s) => [s.identifier, s]),\n);\n\n// Create named Aliases for nicer intellisense.\n\n// TODO: Find a way to make docs like {@inheritDoc required} work in vscode.\n// TODO: ensure thy work in generated docs.\n// TODO: add these comments to the rest of the cases below.\nexport interface Identifier\n\textends FlexFieldKind<\n\t\tFieldEditor<0>,\n\t\ttypeof identifierFieldIdentifier,\n\t\tMultiplicity.Single\n\t> {}\nexport interface Forbidden\n\textends FlexFieldKind<\n\t\tFieldEditor<0>,\n\t\ttypeof forbiddenFieldKindIdentifier,\n\t\tMultiplicity.Forbidden\n\t> {}\n\n/**\n * Default FieldKinds with their editor types erased.\n */\nexport const FieldKinds: {\n\t// TODO: inheritDoc for these somehow\n\treadonly required: typeof required;\n\treadonly optional: typeof optional;\n\treadonly sequence: typeof sequence;\n\treadonly identifier: Identifier;\n\treadonly forbidden: Forbidden;\n} = { required, optional, sequence, identifier, forbidden };\n\n/**\n * FullSchemaPolicy with the default field kinds.\n */\nexport const defaultSchemaPolicy: FullSchemaPolicy = {\n\tfieldKinds,\n};\n"]}
1
+ {"version":3,"file":"defaultFieldKinds.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultFieldKinds.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAG3D,OAAO,EAGN,4BAA4B,EAC5B,YAAY,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAMN,aAAa,EAEb,0BAA0B,EAE1B,+BAA+B,GAC/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAA0B;IACrD,OAAO,EAAE,+BAA+B,CAAC;QACxC,OAAO,EAAE,CAAC,OAAU,EAAE,OAAU,EAAE,EAAE,CAAC,CAAC;QACtC,MAAM,EAAE,CAAC,OAAU,EAAE,EAAE,CAAC,CAAC;QACzB,MAAM,EAAE,CAAC,MAAS,EAAE,IAAO,EAAE,EAAE,CAAC,CAAC;QACjC,IAAI,EAAE,CAAC,OAAU,EAAE,EAAE,CAAC,CAAC;KACvB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CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\n\nimport type { CodecTree } from \"../../codec/index.js\";\nimport {\n\ttype DeltaDetachedNodeId,\n\ttype FieldKindIdentifier,\n\tforbiddenFieldKindIdentifier,\n\tMultiplicity,\n} from \"../../core/index.js\";\nimport { identifierFieldIdentifier } from \"../fieldKindIdentifiers.js\";\nimport {\n\ttype FieldChangeDelta,\n\ttype FieldChangeHandler,\n\ttype FieldEditor,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\tModularChangeFormatVersion,\n\ttype ToDelta,\n\treferenceFreeFieldChangeRebaser,\n} from \"../modular-schema/index.js\";\nimport { optional, required } from \"../optional-field/index.js\";\nimport { sequence } from \"../sequence-field/index.js\";\n\nimport { noChangeCodecFamily } from \"./noChangeCodecs.js\";\n\n/**\n * ChangeHandler that only handles no-op / identity changes.\n */\nexport const noChangeHandler: FieldChangeHandler<0> = {\n\trebaser: referenceFreeFieldChangeRebaser({\n\t\tcompose: (change1: 0, change2: 0) => 0,\n\t\tinvert: (changes: 0) => 0,\n\t\trebase: (change: 0, over: 0) => 0,\n\t\tmute: (changes: 0) => 0,\n\t}),\n\tcodecsFactory: () => noChangeCodecFamily,\n\teditor: { buildChildChanges: () => fail(0xb0d /* Child changes not supported */) },\n\tintoDelta: (change, deltaFromChild: ToDelta): FieldChangeDelta => ({}),\n\trelevantRemovedRoots: (change): Iterable<DeltaDetachedNodeId> => [],\n\tisEmpty: (change: 0) => true,\n\tgetNestedChanges: (change: 0) => [],\n\tcreateEmpty: () => 0,\n\tgetCrossFieldKeys: () => [],\n};\n\n/**\n * Exactly one identifier.\n */\nexport const identifier: Identifier = new FlexFieldKind(\n\tidentifierFieldIdentifier,\n\tMultiplicity.Single,\n\t{\n\t\tchangeHandler: noChangeHandler,\n\t\t// By omitting required here,\n\t\t// this is making a policy choice that a schema upgrade cannot be done from required to identifier.\n\t\t// Since an identifier can be upgraded into a required field,\n\t\t// preventing the inverse helps ensure that schema upgrades are monotonic.\n\t\t// Which direction is allowed is a subjective policy choice.\n\t\tallowMonotonicUpgradeFrom: new Set([]),\n\t},\n);\n\n/**\n * Exactly 0 items.\n *\n * Using Forbidden makes what types are listed for allowed in a field irrelevant\n * since the field will never have values in it.\n *\n * Using Forbidden is equivalent to picking a kind that permits empty (like sequence or optional)\n * and having no allowed types (or only never types).\n * Because of this, its possible to express everything constraint wise without Forbidden,\n * but using Forbidden can be more semantically clear than optional with no allowed types.\n *\n * For view schema, this can be useful if you need to:\n * - run a specific out of schema handler when a field is present,\n * but otherwise are ignoring or tolerating (ex: via extra fields) unmentioned fields.\n * - prevent a specific field from being used as an extra field\n * (perhaps for some past of future compatibility reason)\n * - keep a field in a schema for metadata purposes\n * (ex: for improved error messaging, error handling or documentation)\n * that is not used in this specific version of the schema (ex: to document what it was or will be used for).\n *\n * For stored schema, this can be useful if you need to:\n * - have a field which can have its schema updated to Optional or Sequence of any type.\n * - to exclude a field from extra fields\n * - for the schema system to use as a default for fields which aren't declared\n * (ex: when updating a field that did not exist into one that does)\n *\n * See {@link emptyField} for a constant, reusable field using Forbidden.\n */\nexport const forbidden: Forbidden = new FlexFieldKind(\n\tforbiddenFieldKindIdentifier,\n\tMultiplicity.Forbidden,\n\t{\n\t\tchangeHandler: noChangeHandler,\n\t\tallowMonotonicUpgradeFrom: new Set(),\n\t},\n);\n\nexport const fieldKindConfigurations: ReadonlyMap<\n\tModularChangeFormatVersion,\n\tFieldKindConfiguration\n> = new Map<ModularChangeFormatVersion, FieldKindConfiguration>([\n\t[\n\t\tModularChangeFormatVersion.v3,\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 2 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n\t[\n\t\tModularChangeFormatVersion.v4,\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 3 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n\t[\n\t\tModularChangeFormatVersion.v5,\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 3 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n]);\n\nexport function getCodecTreeForModularChangeFormat(\n\tversion: ModularChangeFormatVersion,\n): CodecTree {\n\tconst dependencies =\n\t\tfieldKindConfigurations.get(version) ?? fail(0xc7c /* Unknown modular change format */);\n\tconst children: CodecTree[] = [...dependencies.entries()].map(\n\t\t([key, { formatVersion }]) => ({\n\t\t\tname: `FieldKind:${key}`,\n\t\t\tversion: formatVersion,\n\t\t}),\n\t);\n\treturn {\n\t\tname: \"ModularChange\",\n\t\tversion,\n\t\tchildren,\n\t};\n}\n\n/**\n * All supported field kinds.\n *\n * @privateRemarks\n * Before making a SharedTree format change which impacts which set of field kinds are allowed,\n * code which uses this should be audited for compatibility considerations.\n */\nexport const fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind> = new Map(\n\t[required, optional, sequence, identifier, forbidden].map((s) => [s.identifier, s]),\n);\n\n// Create named Aliases for nicer intellisense.\n\n// TODO: Find a way to make docs like {@inheritDoc required} work in vscode.\n// TODO: ensure thy work in generated docs.\n// TODO: add these comments to the rest of the cases below.\nexport interface Identifier\n\textends FlexFieldKind<\n\t\tFieldEditor<0>,\n\t\ttypeof identifierFieldIdentifier,\n\t\tMultiplicity.Single\n\t> {}\nexport interface Forbidden\n\textends FlexFieldKind<\n\t\tFieldEditor<0>,\n\t\ttypeof forbiddenFieldKindIdentifier,\n\t\tMultiplicity.Forbidden\n\t> {}\n\n/**\n * Default FieldKinds with their editor types erased.\n */\nexport const FieldKinds: {\n\t// TODO: inheritDoc for these somehow\n\treadonly required: typeof required;\n\treadonly optional: typeof optional;\n\treadonly sequence: typeof sequence;\n\treadonly identifier: Identifier;\n\treadonly forbidden: Forbidden;\n} = { required, optional, sequence, identifier, forbidden };\n\n/**\n * FullSchemaPolicy with the default field kinds.\n */\nexport const defaultSchemaPolicy: FullSchemaPolicy = {\n\tfieldKinds,\n};\n"]}
@@ -3,7 +3,6 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  export { FieldKinds, fieldKinds, fieldKindConfigurations, getCodecTreeForModularChangeFormat, defaultSchemaPolicy, } from "./defaultFieldKinds.js";
6
- export { type DefaultChangeset, type DetachedRootIds, type DetachedRootIdRange, DefaultChangeFamily, type IdBasedChangeFamilyDataEditor, DefaultIdBasedDataEditor, type DataEditor, type RequiredFieldEditor, type OptionalFieldEditor, type SequenceFieldEditor, intoDelta, relevantRemovedRoots, } from "./defaultEditBuilder.js";
7
- export { type DetachedRootLocation, type DetachedRootsLocation, type Locator, LocationBasedDataEditor, type ILocationBasedDataEditor, } from "./locationBasedEditBuilder.js";
6
+ export { type DefaultChangeset, DefaultChangeFamily, DefaultEditBuilder, type IDefaultEditBuilder, type ValueFieldEditBuilder, type OptionalFieldEditBuilder, type SequenceFieldEditBuilder, intoDelta, relevantRemovedRoots, } from "./defaultEditBuilder.js";
8
7
  export { MappedEditBuilder } from "./mappedEditBuilder.js";
9
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,EACV,UAAU,EACV,uBAAuB,EACvB,kCAAkC,EAClC,mBAAmB,GACnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACN,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,mBAAmB,EACnB,KAAK,6BAA6B,EAClC,wBAAwB,EACxB,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,SAAS,EACT,oBAAoB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACN,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,OAAO,EACZ,uBAAuB,EACvB,KAAK,wBAAwB,GAC7B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,EACV,UAAU,EACV,uBAAuB,EACvB,kCAAkC,EAClC,mBAAmB,GACnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACN,KAAK,gBAAgB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,SAAS,EACT,oBAAoB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -3,7 +3,6 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  export { FieldKinds, fieldKinds, fieldKindConfigurations, getCodecTreeForModularChangeFormat, defaultSchemaPolicy, } from "./defaultFieldKinds.js";
6
- export { DefaultChangeFamily, DefaultIdBasedDataEditor, intoDelta, relevantRemovedRoots, } from "./defaultEditBuilder.js";
7
- export { LocationBasedDataEditor, } from "./locationBasedEditBuilder.js";
6
+ export { DefaultChangeFamily, DefaultEditBuilder, intoDelta, relevantRemovedRoots, } from "./defaultEditBuilder.js";
8
7
  export { MappedEditBuilder } from "./mappedEditBuilder.js";
9
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,EACV,UAAU,EACV,uBAAuB,EACvB,kCAAkC,EAClC,mBAAmB,GACnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAIN,mBAAmB,EAEnB,wBAAwB,EAKxB,SAAS,EACT,oBAAoB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAIN,uBAAuB,GAEvB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tFieldKinds,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tgetCodecTreeForModularChangeFormat,\n\tdefaultSchemaPolicy,\n} from \"./defaultFieldKinds.js\";\n\nexport {\n\ttype DefaultChangeset,\n\ttype DetachedRootIds,\n\ttype DetachedRootIdRange,\n\tDefaultChangeFamily,\n\ttype IdBasedChangeFamilyDataEditor,\n\tDefaultIdBasedDataEditor,\n\ttype DataEditor,\n\ttype RequiredFieldEditor,\n\ttype OptionalFieldEditor,\n\ttype SequenceFieldEditor,\n\tintoDelta,\n\trelevantRemovedRoots,\n} from \"./defaultEditBuilder.js\";\n\nexport {\n\ttype DetachedRootLocation,\n\ttype DetachedRootsLocation,\n\ttype Locator,\n\tLocationBasedDataEditor,\n\ttype ILocationBasedDataEditor,\n} from \"./locationBasedEditBuilder.js\";\n\nexport { MappedEditBuilder } from \"./mappedEditBuilder.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,EACV,UAAU,EACV,uBAAuB,EACvB,kCAAkC,EAClC,mBAAmB,GACnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAEN,mBAAmB,EACnB,kBAAkB,EAKlB,SAAS,EACT,oBAAoB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tFieldKinds,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tgetCodecTreeForModularChangeFormat,\n\tdefaultSchemaPolicy,\n} from \"./defaultFieldKinds.js\";\n\nexport {\n\ttype DefaultChangeset,\n\tDefaultChangeFamily,\n\tDefaultEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\tintoDelta,\n\trelevantRemovedRoots,\n} from \"./defaultEditBuilder.js\";\n\nexport { MappedEditBuilder } from \"./mappedEditBuilder.js\";\n"]}
@@ -3,18 +3,17 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { NormalizedFieldUpPath, NormalizedUpPath } from "../../core/index.js";
6
- import type { DataEditor, OptionalFieldEditor, SequenceFieldEditor, RequiredFieldEditor } from "./defaultEditBuilder.js";
6
+ import type { IDefaultEditBuilder, OptionalFieldEditBuilder, SequenceFieldEditBuilder, ValueFieldEditBuilder } from "./defaultEditBuilder.js";
7
7
  /**
8
8
  * An IDefaultEditBuilder implementation based on another IDefaultEditBuilder that uses a different content type for insertions.
9
9
  */
10
- export declare class MappedEditBuilder<TBase, TAdapted, TDetachedRoot, TDetachedRoots> implements DataEditor<TAdapted, TDetachedRoot, TDetachedRoots> {
10
+ export declare class MappedEditBuilder<TBase, TAdapted> implements IDefaultEditBuilder<TAdapted> {
11
11
  private readonly baseBuilder;
12
12
  private readonly mapDelegate;
13
- constructor(baseBuilder: DataEditor<TBase, TDetachedRoot, TDetachedRoots>, mapDelegate: (input: TAdapted) => TBase);
14
- buildRoots(content: TAdapted): TDetachedRoots;
15
- valueField(field: NormalizedFieldUpPath): RequiredFieldEditor<TAdapted, TDetachedRoot>;
16
- optionalField(field: NormalizedFieldUpPath): OptionalFieldEditor<TAdapted, TDetachedRoot>;
17
- sequenceField(field: NormalizedFieldUpPath): SequenceFieldEditor<TAdapted, TDetachedRoots>;
13
+ constructor(baseBuilder: IDefaultEditBuilder<TBase>, mapDelegate: (input: TAdapted) => TBase);
14
+ valueField(field: NormalizedFieldUpPath): ValueFieldEditBuilder<TAdapted>;
15
+ optionalField(field: NormalizedFieldUpPath): OptionalFieldEditBuilder<TAdapted>;
16
+ sequenceField(field: NormalizedFieldUpPath): SequenceFieldEditBuilder<TAdapted>;
18
17
  move(sourceField: NormalizedFieldUpPath, sourceIndex: number, count: number, destinationField: NormalizedFieldUpPath, destinationIndex: number): void;
19
18
  addNodeExistsConstraint(path: NormalizedUpPath): void;
20
19
  addNodeExistsConstraintOnRevert(path: NormalizedUpPath): void;
@@ -1 +1 @@
1
- {"version":3,"file":"mappedEditBuilder.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/mappedEditBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,KAAK,EACX,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,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nB,wBAAwB,EACxB,wBAAwB,EACxB,qBAAqB,EACrB,MAAM,yBAAyB,CAAC;AAEjC;;GAEG;AACH,qBAAa,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAE,YAAW,mBAAmB,CAAC,QAAQ,CAAC;IAEtF,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,WAAW;gBADX,WAAW,EAAE,mBAAmB,CAAC,KAAK,CAAC,EACvC,WAAW,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,KAAK;IAElD,UAAU,CAAC,KAAK,EAAE,qBAAqB,GAAG,qBAAqB,CAAC,QAAQ,CAAC;IASzE,aAAa,CAAC,KAAK,EAAE,qBAAqB,GAAG,wBAAwB,CAAC,QAAQ,CAAC;IAU/E,aAAa,CAAC,KAAK,EAAE,qBAAqB,GAAG,wBAAwB,CAAC,QAAQ,CAAC;IAY/E,IAAI,CACV,WAAW,EAAE,qBAAqB,EAClC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,qBAAqB,EACvC,gBAAgB,EAAE,MAAM,GACtB,IAAI;IAGA,uBAAuB,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;IAGrD,+BAA+B,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;IAG7D,qBAAqB,IAAI,IAAI;IAG7B,6BAA6B,IAAI,IAAI;CAG5C"}
@@ -10,9 +10,6 @@ export class MappedEditBuilder {
10
10
  this.baseBuilder = baseBuilder;
11
11
  this.mapDelegate = mapDelegate;
12
12
  }
13
- buildRoots(content) {
14
- return this.baseBuilder.buildRoots(this.mapDelegate(content));
15
- }
16
13
  valueField(field) {
17
14
  const baseField = this.baseBuilder.valueField(field);
18
15
  return {
@@ -20,9 +17,6 @@ export class MappedEditBuilder {
20
17
  const mappedContent = this.mapDelegate(newContent);
21
18
  baseField.set(mappedContent);
22
19
  },
23
- attach: (content) => {
24
- baseField.attach(content);
25
- },
26
20
  };
27
21
  }
28
22
  optionalField(field) {
@@ -32,12 +26,6 @@ export class MappedEditBuilder {
32
26
  const mappedContent = newContent === undefined ? undefined : this.mapDelegate(newContent);
33
27
  baseField.set(mappedContent, wasEmpty);
34
28
  },
35
- attach: (content, wasEmpty) => {
36
- baseField.attach(content, wasEmpty);
37
- },
38
- clear(wasEmpty) {
39
- baseField.clear(wasEmpty);
40
- },
41
29
  };
42
30
  }
43
31
  sequenceField(field) {
@@ -50,9 +38,6 @@ export class MappedEditBuilder {
50
38
  remove: (index, count) => {
51
39
  baseField.remove(index, count);
52
40
  },
53
- attach: (index, detachedContent) => {
54
- baseField.attach(index, detachedContent);
55
- },
56
41
  };
57
42
  }
58
43
  move(sourceField, sourceIndex, count, destinationField, destinationIndex) {
@@ -1 +1 @@
1
- {"version":3,"file":"mappedEditBuilder.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/mappedEditBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAG7B,YACkB,WAA6D,EAC7D,WAAuC;QADvC,gBAAW,GAAX,WAAW,CAAkD;QAC7D,gBAAW,GAAX,WAAW,CAA4B;IACtD,CAAC;IAEG,UAAU,CAAC,OAAiB;QAClC,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/D,CAAC;IAEM,UAAU,CAChB,KAA4B;QAE5B,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACrD,OAAO;YACN,GAAG,EAAE,CAAC,UAAoB,EAAQ,EAAE;gBACnC,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;gBACnD,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;YAC9B,CAAC;YACD,MAAM,EAAE,CAAC,OAAsB,EAAQ,EAAE;gBACxC,S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AAe,CAAC,CAAC;YAC1C,CAAC;SACD,CAAC;IACH,CAAC;IACM,IAAI,CACV,WAAkC,EAClC,WAAmB,EACnB,KAAa,EACb,gBAAuC,EACvC,gBAAwB;QAExB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;IAC5F,CAAC;IACM,uBAAuB,CAAC,IAAsB;QACpD,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IACM,+BAA+B,CAAC,IAAsB;QAC5D,IAAI,CAAC,WAAW,CAAC,+BAA+B,CAAC,IAAI,CAAC,CAAC;IACxD,CAAC;IACM,qBAAqB;QAC3B,IAAI,CAAC,WAAW,CAAC,qBAAqB,EAAE,CAAC;IAC1C,CAAC;IACM,6BAA6B;QACnC,IAAI,CAAC,WAAW,CAAC,6BAA6B,EAAE,CAAC;IAClD,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { NormalizedFieldUpPath, NormalizedUpPath } from \"../../core/index.js\";\n\nimport type {\n\tDataEditor,\n\tOptionalFieldEditor,\n\tSequenceFieldEditor,\n\tRequiredFieldEditor,\n} from \"./defaultEditBuilder.js\";\n\n/**\n * An IDefaultEditBuilder implementation based on another IDefaultEditBuilder that uses a different content type for insertions.\n */\nexport class MappedEditBuilder<TBase, TAdapted, TDetachedRoot, TDetachedRoots>\n\timplements DataEditor<TAdapted, TDetachedRoot, TDetachedRoots>\n{\n\tpublic constructor(\n\t\tprivate readonly baseBuilder: DataEditor<TBase, TDetachedRoot, TDetachedRoots>,\n\t\tprivate readonly mapDelegate: (input: TAdapted) => TBase,\n\t) {}\n\n\tpublic buildRoots(content: TAdapted): TDetachedRoots {\n\t\treturn this.baseBuilder.buildRoots(this.mapDelegate(content));\n\t}\n\n\tpublic valueField(\n\t\tfield: NormalizedFieldUpPath,\n\t): RequiredFieldEditor<TAdapted, TDetachedRoot> {\n\t\tconst baseField = this.baseBuilder.valueField(field);\n\t\treturn {\n\t\t\tset: (newContent: TAdapted): void => {\n\t\t\t\tconst mappedContent = this.mapDelegate(newContent);\n\t\t\t\tbaseField.set(mappedContent);\n\t\t\t},\n\t\t\tattach: (content: TDetachedRoot): void => {\n\t\t\t\tbaseField.attach(content);\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic optionalField(\n\t\tfield: NormalizedFieldUpPath,\n\t): OptionalFieldEditor<TAdapted, TDetachedRoot> {\n\t\tconst baseField = this.baseBuilder.optionalField(field);\n\t\treturn {\n\t\t\tset: (newContent: TAdapted | undefined, wasEmpty: boolean): void => {\n\t\t\t\tconst mappedContent =\n\t\t\t\t\tnewContent === undefined ? undefined : this.mapDelegate(newContent);\n\t\t\t\tbaseField.set(mappedContent, wasEmpty);\n\t\t\t},\n\t\t\tattach: (content, wasEmpty: boolean): void => {\n\t\t\t\tbaseField.attach(content, wasEmpty);\n\t\t\t},\n\t\t\tclear(wasEmpty: boolean): void {\n\t\t\t\tbaseField.clear(wasEmpty);\n\t\t\t},\n\t\t};\n\t}\n\tpublic sequenceField(\n\t\tfield: NormalizedFieldUpPath,\n\t): SequenceFieldEditor<TAdapted, TDetachedRoots> {\n\t\tconst baseField = this.baseBuilder.sequenceField(field);\n\t\treturn {\n\t\t\tinsert: (index: number, content: TAdapted): void => {\n\t\t\t\tconst mappedContent = this.mapDelegate(content);\n\t\t\t\tbaseField.insert(index, mappedContent);\n\t\t\t},\n\t\t\tremove: (index: number, count: number): void => {\n\t\t\t\tbaseField.remove(index, count);\n\t\t\t},\n\t\t\tattach: (index: number, detachedContent: TDetachedRoots): void => {\n\t\t\t\tbaseField.attach(index, detachedContent);\n\t\t\t},\n\t\t};\n\t}\n\tpublic move(\n\t\tsourceField: NormalizedFieldUpPath,\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestinationField: NormalizedFieldUpPath,\n\t\tdestinationIndex: number,\n\t): void {\n\t\tthis.baseBuilder.move(sourceField, sourceIndex, count, destinationField, destinationIndex);\n\t}\n\tpublic addNodeExistsConstraint(path: NormalizedUpPath): void {\n\t\tthis.baseBuilder.addNodeExistsConstraint(path);\n\t}\n\tpublic addNodeExistsConstraintOnRevert(path: NormalizedUpPath): void {\n\t\tthis.baseBuilder.addNodeExistsConstraintOnRevert(path);\n\t}\n\tpublic addNoChangeConstraint(): void {\n\t\tthis.baseBuilder.addNoChangeConstraint();\n\t}\n\tpublic addNoChangeConstraintOnRevert(): void {\n\t\tthis.baseBuilder.addNoChangeConstraintOnRevert();\n\t}\n}\n"]}
1
+ {"version":3,"file":"mappedEditBuilder.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/mappedEditBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAC7B,YACkB,WAAuC,EACvC,WAAuC;QADvC,gBAAW,GAAX,WAAW,CAA4B;QACvC,gBAAW,GAAX,WAAW,CAA4B;IACtD,CAAC;IACG,UAAU,CAAC,KAA4B;QAC7C,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACrD,OAAO;YACN,GAAG,EAAE,CAAC,UAAoB,EAAQ,EAAE;gBACnC,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;gBACnD,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;YAC9B,CAAC;SACD,CAAC;IACH,CAAC;IACM,aAAa,CAAC,KAA4B;QAChD,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACxD,OAAO;YACN,GAAG,EAAE,CAAC,UAAgC,EAAE,QAAiB,EAAQ,EAAE;gBAClE,MAAM,aAAa,GAClB,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CA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under the MIT License.\n */\n\nimport type { NormalizedFieldUpPath, NormalizedUpPath } from \"../../core/index.js\";\n\nimport type {\n\tIDefaultEditBuilder,\n\tOptionalFieldEditBuilder,\n\tSequenceFieldEditBuilder,\n\tValueFieldEditBuilder,\n} from \"./defaultEditBuilder.js\";\n\n/**\n * An IDefaultEditBuilder implementation based on another IDefaultEditBuilder that uses a different content type for insertions.\n */\nexport class MappedEditBuilder<TBase, TAdapted> implements IDefaultEditBuilder<TAdapted> {\n\tpublic constructor(\n\t\tprivate readonly baseBuilder: IDefaultEditBuilder<TBase>,\n\t\tprivate readonly mapDelegate: (input: TAdapted) => TBase,\n\t) {}\n\tpublic valueField(field: NormalizedFieldUpPath): ValueFieldEditBuilder<TAdapted> {\n\t\tconst baseField = this.baseBuilder.valueField(field);\n\t\treturn {\n\t\t\tset: (newContent: TAdapted): void => {\n\t\t\t\tconst mappedContent = this.mapDelegate(newContent);\n\t\t\t\tbaseField.set(mappedContent);\n\t\t\t},\n\t\t};\n\t}\n\tpublic optionalField(field: NormalizedFieldUpPath): OptionalFieldEditBuilder<TAdapted> {\n\t\tconst baseField = this.baseBuilder.optionalField(field);\n\t\treturn {\n\t\t\tset: (newContent: TAdapted | undefined, wasEmpty: boolean): void => {\n\t\t\t\tconst mappedContent =\n\t\t\t\t\tnewContent === undefined ? undefined : this.mapDelegate(newContent);\n\t\t\t\tbaseField.set(mappedContent, wasEmpty);\n\t\t\t},\n\t\t};\n\t}\n\tpublic sequenceField(field: NormalizedFieldUpPath): SequenceFieldEditBuilder<TAdapted> {\n\t\tconst baseField = this.baseBuilder.sequenceField(field);\n\t\treturn {\n\t\t\tinsert: (index: number, content: TAdapted): void => {\n\t\t\t\tconst mappedContent = this.mapDelegate(content);\n\t\t\t\tbaseField.insert(index, mappedContent);\n\t\t\t},\n\t\t\tremove: (index: number, count: number): void => {\n\t\t\t\tbaseField.remove(index, count);\n\t\t\t},\n\t\t};\n\t}\n\tpublic move(\n\t\tsourceField: NormalizedFieldUpPath,\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestinationField: NormalizedFieldUpPath,\n\t\tdestinationIndex: number,\n\t): void {\n\t\tthis.baseBuilder.move(sourceField, sourceIndex, count, destinationField, destinationIndex);\n\t}\n\tpublic addNodeExistsConstraint(path: NormalizedUpPath): void {\n\t\tthis.baseBuilder.addNodeExistsConstraint(path);\n\t}\n\tpublic addNodeExistsConstraintOnRevert(path: NormalizedUpPath): void {\n\t\tthis.baseBuilder.addNodeExistsConstraintOnRevert(path);\n\t}\n\tpublic addNoChangeConstraint(): void {\n\t\tthis.baseBuilder.addNoChangeConstraint();\n\t}\n\tpublic addNoChangeConstraintOnRevert(): void {\n\t\tthis.baseBuilder.addNoChangeConstraintOnRevert();\n\t}\n}\n"]}
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { type ChangeAtomId, type DeltaDetachedNodeId, type DeltaRoot } from "../core/index.js";
6
6
  export declare function nodeIdFromChangeAtom(changeAtom: ChangeAtomId): DeltaDetachedNodeId;
7
- export declare function changeAtomFromDetachedNodeId(changeAtom: DeltaDetachedNodeId): ChangeAtomId;
8
7
  /**
9
8
  * Converts a `Delta.Root` whose tree content is represented with by `TIn` instances
10
9
  * into a `Delta.Root`whose tree content is represented with by `TOut` instances.
@@ -1 +1 @@
1
- {"version":3,"file":"deltaUtils.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/deltaUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,SAAS,EAGd,MAAM,kBAAkB,CAAC;AAG1B,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,YAAY,GAAG,mBAAmB,CAElF;AAED,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,mBAAmB,GAAG,YAAY,CAE1F;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,IAAI,EACvC,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC,EACpB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,GACvB,SAAS,CAAC,IAAI,CAAC,CAyBjB"}
1
+ {"version":3,"file":"deltaUtils.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/deltaUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,SAAS,EAEd,MAAM,kBAAkB,CAAC;AAG1B,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,YAAY,GAAG,mBAAmB,CAElF;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,IAAI,EACvC,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC,EACpB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,GACvB,SAAS,CAAC,IAAI,CAAC,CAyBjB"}
@@ -2,14 +2,10 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { makeChangeAtomId, makeDetachedNodeId, } from "../core/index.js";
6
- import { brand } from "../util/index.js";
5
+ import { makeDetachedNodeId, } from "../core/index.js";
7
6
  export function nodeIdFromChangeAtom(changeAtom) {
8
7
  return makeDetachedNodeId(changeAtom.revision, changeAtom.localId);
9
8
  }
10
- export function changeAtomFromDetachedNodeId(changeAtom) {
11
- return makeChangeAtomId(brand(changeAtom.minor), changeAtom.major);
12
- }
13
9
  /**
14
10
  * Converts a `Delta.Root` whose tree content is represented with by `TIn` instances
15
11
  * into a `Delta.Root`whose tree content is represented with by `TOut` instances.
@@ -1 +1 @@
1
- {"version":3,"file":"deltaUtils.js","sourceRoot":"","sources":["../../src/feature-libraries/deltaUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAIN,gBAAgB,EAChB,kBAAkB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAgB,MAAM,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AC1D,KAAK;YACL,KAAK;YACL,KAAK;SACL,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype ChangeAtomId,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaRoot,\n\tmakeChangeAtomId,\n\tmakeDetachedNodeId,\n} from \"../core/index.js\";\nimport { brand, type Mutable } from \"../util/index.js\";\n\nexport function nodeIdFromChangeAtom(changeAtom: ChangeAtomId): DeltaDetachedNodeId {\n\treturn makeDetachedNodeId(changeAtom.revision, changeAtom.localId);\n}\n\nexport function changeAtomFromDetachedNodeId(changeAtom: DeltaDetachedNodeId): ChangeAtomId {\n\treturn makeChangeAtomId(brand(changeAtom.minor), changeAtom.major);\n}\n\n/**\n * Converts a `Delta.Root` whose tree content is represented with by `TIn` instances\n * into a `Delta.Root`whose tree content is represented with by `TOut` instances.\n *\n * This function is useful for converting `Delta`s that represent tree content with cursors\n * into `Delta`s that represent tree content with a deep-comparable representation of the content.\n * See {@link assertDeltaEqual}.\n * @param root - The delta to convert. Not mutated.\n * @param func - The functions used to map tree content.\n */\nexport function mapRootChanges<TIn, TOut>(\n\troot: DeltaRoot<TIn>,\n\tfunc: (tree: TIn) => TOut,\n): DeltaRoot<TOut> {\n\tconst out: Mutable<DeltaRoot<TOut>> = {};\n\tif (root.fields !== undefined) {\n\t\tout.fields = root.fields;\n\t}\n\tif (root.build !== undefined) {\n\t\tout.build = root.build.map(({ id, trees }) => ({\n\t\t\tid,\n\t\t\ttrees: func(trees),\n\t\t}));\n\t}\n\tif (root.global !== undefined) {\n\t\tout.global = root.global.map(({ id, fields }) => ({\n\t\t\tid,\n\t\t\tfields,\n\t\t}));\n\t}\n\tif (root.rename !== undefined) {\n\t\tout.rename = root.rename.map(({ count, oldId, newId }) => ({\n\t\t\tcount,\n\t\t\toldId,\n\t\t\tnewId,\n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EAAE,CAAC,CAAC;YAC1D,KAAK;YACL,KAAK;YACL,KAAK;SACL,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype ChangeAtomId,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaRoot,\n\tmakeDetachedNodeId,\n} from \"../core/index.js\";\nimport type { Mutable } from \"../util/index.js\";\n\nexport function nodeIdFromChangeAtom(changeAtom: ChangeAtomId): DeltaDetachedNodeId {\n\treturn makeDetachedNodeId(changeAtom.revision, changeAtom.localId);\n}\n\n/**\n * Converts a `Delta.Root` whose tree content is represented with by `TIn` instances\n * into a `Delta.Root`whose tree content is represented with by `TOut` instances.\n *\n * This function is useful for converting `Delta`s that represent tree content with cursors\n * into `Delta`s that represent tree content with a deep-comparable representation of the content.\n * See {@link assertDeltaEqual}.\n * @param root - The delta to convert. Not mutated.\n * @param func - The functions used to map tree content.\n */\nexport function mapRootChanges<TIn, TOut>(\n\troot: DeltaRoot<TIn>,\n\tfunc: (tree: TIn) => TOut,\n): DeltaRoot<TOut> {\n\tconst out: Mutable<DeltaRoot<TOut>> = {};\n\tif (root.fields !== undefined) {\n\t\tout.fields = root.fields;\n\t}\n\tif (root.build !== undefined) {\n\t\tout.build = root.build.map(({ id, trees }) => ({\n\t\t\tid,\n\t\t\ttrees: func(trees),\n\t\t}));\n\t}\n\tif (root.global !== undefined) {\n\t\tout.global = root.global.map(({ id, fields }) => ({\n\t\t\tid,\n\t\t\tfields,\n\t\t}));\n\t}\n\tif (root.rename !== undefined) {\n\t\tout.rename = root.rename.map(({ count, oldId, newId }) => ({\n\t\t\tcount,\n\t\t\toldId,\n\t\t\tnewId,\n\t\t}));\n\t}\n\treturn out;\n}\n"]}
@@ -33,7 +33,6 @@ 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;
37
36
  }
38
37
  /**
39
38
  * Subset of a hydrated context which can be used in more cases (like before the root and events are set up).
@@ -47,13 +46,6 @@ export interface FlexTreeHydratedContextMinimal {
47
46
  * The checkout object associated with this context.
48
47
  */
49
48
  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;
57
49
  }
58
50
  /**
59
51
  * A common context of a "forest" of FlexTrees.
@@ -112,7 +104,6 @@ export declare class Context implements FlexTreeHydratedContext, IDisposable {
112
104
  isHydrated(): this is FlexTreeHydratedContext;
113
105
  isDisposed(): boolean;
114
106
  get schema(): TreeStoredSchema;
115
- runInTransaction(fn: () => void): void;
116
107
  /**
117
108
  * Called before editing.
118
109
  * Clears all cursors so editing can proceed.
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/context.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAGlE,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EAIrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,KAAK,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KA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I,gBAAgB,CAEpC;IAED;;;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"}
@@ -51,12 +51,6 @@ export class Context {
51
51
  get schema() {
52
52
  return this.checkout.storedSchema;
53
53
  }
54
- runInTransaction(fn) {
55
- debugAssert(() => !this.disposed || "Disposed");
56
- this.checkout.transaction.start(false);
57
- fn();
58
- this.checkout.transaction.commit();
59
- }
60
54
  /**
61
55
  * Called before editing.
62
56
  * 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,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAE1E,OAAO,EAMN,UAAU,EACV,mBAAmB,EACnB,SAAS,GACT,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAoB,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKtE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAsE3C;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,EAAW,CAAC;AAEjD;;;;;;;;;GASG;AACH,MAAM,OAAO,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,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AAC;QAE/D,IAAI,CAAC,aAAa,KAAK,IAAI,CAAC,aAAa,CAAC,SAAS,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,MAAM,CAAC,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,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QACvD,MAAM,KAAK,GAAG,SAAS,CAAC,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","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(false);\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"]}
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/context.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAE1E,OAAO,EAMN,UAAU,EACV,mBAAmB,EACnB,SAAS,GACT,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAoB,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKtE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AA4D3C;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,EAAW,CAAC;AAEjD;;;;;;;;;GASG;AACH,MAAM,OAAO,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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AAE,MAAM,EAAE,GAAG,CAAC,CAAC;QACvD,MAAM,KAAK,GAAG,SAAS,CAAC,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","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"]}