@fluidframework/tree 2.80.0 → 2.81.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 (1138) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/api-report/tree.alpha.api.md +42 -7
  3. package/dist/alpha.d.ts +5 -0
  4. package/dist/codec/codec.d.ts +2 -2
  5. package/dist/codec/codec.d.ts.map +1 -1
  6. package/dist/codec/codec.js +8 -8
  7. package/dist/codec/codec.js.map +1 -1
  8. package/dist/codec/versioned/codec.d.ts +1 -1
  9. package/dist/codec/versioned/codec.d.ts.map +1 -1
  10. package/dist/codec/versioned/codec.js +12 -12
  11. package/dist/codec/versioned/codec.js.map +1 -1
  12. package/dist/core/index.d.ts +1 -1
  13. package/dist/core/index.d.ts.map +1 -1
  14. package/dist/core/index.js.map +1 -1
  15. package/dist/core/rebase/index.d.ts +1 -1
  16. package/dist/core/rebase/index.d.ts.map +1 -1
  17. package/dist/core/rebase/index.js.map +1 -1
  18. package/dist/core/rebase/types.d.ts +44 -7
  19. package/dist/core/rebase/types.d.ts.map +1 -1
  20. package/dist/core/rebase/types.js.map +1 -1
  21. package/dist/core/rebase/utils.d.ts.map +1 -1
  22. package/dist/core/rebase/utils.js +5 -1
  23. package/dist/core/rebase/utils.js.map +1 -1
  24. package/dist/core/schema-stored/formatV2.d.ts.map +1 -1
  25. package/dist/core/schema-stored/formatV2.js +4 -4
  26. package/dist/core/schema-stored/formatV2.js.map +1 -1
  27. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  28. package/dist/core/tree/anchorSet.js +2 -1
  29. package/dist/core/tree/anchorSet.js.map +1 -1
  30. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  31. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  32. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +1 -1
  33. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  34. package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  35. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  36. package/dist/core/tree/detachedFieldIndexCodecV1.js +3 -3
  37. package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  38. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  39. package/dist/core/tree/detachedFieldIndexCodecV2.js +2 -2
  40. package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  41. package/dist/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
  42. package/dist/core/tree/detachedFieldIndexFormatV1.js +3 -3
  43. package/dist/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
  44. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  45. package/dist/core/tree/detachedFieldIndexFormatV2.js +4 -4
  46. package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  47. package/dist/core/tree/visitDelta.d.ts +1 -1
  48. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  49. package/dist/core/tree/visitDelta.js +3 -2
  50. package/dist/core/tree/visitDelta.js.map +1 -1
  51. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  52. package/dist/core/tree/visitorUtils.js +59 -19
  53. package/dist/core/tree/visitorUtils.js.map +1 -1
  54. package/dist/feature-libraries/changeAtomIdBTree.d.ts +6 -1
  55. package/dist/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  56. package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -1
  57. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +1 -1
  58. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  59. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  60. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  61. package/dist/feature-libraries/chunked-forest/chunkedForest.js +3 -1
  62. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  63. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -1
  64. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  65. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  66. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  67. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  68. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  69. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -1
  70. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  71. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  72. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
  73. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  74. package/dist/feature-libraries/chunked-forest/codec/codecs.js +1 -1
  75. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  76. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
  77. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  78. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -0
  79. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  80. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  81. package/dist/feature-libraries/chunked-forest/codec/format.js +1 -1
  82. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  83. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  84. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  85. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  86. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  87. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +2 -2
  88. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  89. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  90. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +17 -15
  91. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  92. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +10 -52
  93. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  94. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +23 -64
  95. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  96. package/dist/feature-libraries/default-schema/index.d.ts +1 -1
  97. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  98. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  99. package/dist/feature-libraries/fieldKindIdentifiers.d.ts +9 -0
  100. package/dist/feature-libraries/fieldKindIdentifiers.d.ts.map +1 -0
  101. package/dist/feature-libraries/fieldKindIdentifiers.js +16 -0
  102. package/dist/feature-libraries/fieldKindIdentifiers.js.map +1 -0
  103. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  104. package/dist/feature-libraries/flex-tree/lazyField.js +8 -8
  105. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  106. package/dist/feature-libraries/flex-tree/observer.d.ts +1 -1
  107. package/dist/feature-libraries/flex-tree/observer.d.ts.map +1 -1
  108. package/dist/feature-libraries/flex-tree/observer.js.map +1 -1
  109. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  110. package/dist/feature-libraries/forest-summary/codec.js +1 -1
  111. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  112. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  113. package/dist/feature-libraries/forest-summary/forestSummarizer.js +6 -4
  114. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  115. package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
  116. package/dist/feature-libraries/forest-summary/formatV1.js.map +1 -1
  117. package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
  118. package/dist/feature-libraries/forest-summary/formatV2.js.map +1 -1
  119. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +4 -4
  120. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  121. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +2 -2
  122. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  123. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -1
  124. package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -1
  125. package/dist/feature-libraries/index.d.ts +1 -1
  126. package/dist/feature-libraries/index.d.ts.map +1 -1
  127. package/dist/feature-libraries/index.js.map +1 -1
  128. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  129. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  130. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  131. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  132. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts +1 -1
  133. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  134. package/dist/feature-libraries/modular-schema/genericFieldKind.js +2 -2
  135. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  136. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +1 -1
  137. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  138. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +2 -0
  139. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  140. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  141. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -1
  142. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  143. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  144. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +1 -1
  145. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  146. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -2
  147. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  148. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +52 -43
  149. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  150. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +3 -3
  151. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  152. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  153. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  154. package/dist/feature-libraries/object-forest/objectForest.js +5 -3
  155. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  156. package/dist/feature-libraries/optional-field/index.d.ts +3 -3
  157. package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
  158. package/dist/feature-libraries/optional-field/index.js +4 -8
  159. package/dist/feature-libraries/optional-field/index.js.map +1 -1
  160. package/dist/feature-libraries/optional-field/optionalField.d.ts +10 -2
  161. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  162. package/dist/feature-libraries/optional-field/optionalField.js +13 -1
  163. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  164. package/dist/feature-libraries/optional-field/requiredField.d.ts +36 -0
  165. package/dist/feature-libraries/optional-field/requiredField.d.ts.map +1 -0
  166. package/dist/feature-libraries/optional-field/requiredField.js +27 -0
  167. package/dist/feature-libraries/optional-field/requiredField.js.map +1 -0
  168. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +1 -1
  169. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  170. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +7 -7
  171. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  172. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  173. package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  174. package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
  175. package/dist/feature-libraries/schemaChecker.js +1 -1
  176. package/dist/feature-libraries/schemaChecker.js.map +1 -1
  177. package/dist/feature-libraries/sequence-field/index.d.ts +2 -14
  178. package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
  179. package/dist/feature-libraries/sequence-field/index.js +3 -30
  180. package/dist/feature-libraries/sequence-field/index.js.map +1 -1
  181. package/dist/feature-libraries/sequence-field/rebase.js +1 -1
  182. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  183. package/dist/feature-libraries/sequence-field/sequenceKind.d.ts +16 -0
  184. package/dist/feature-libraries/sequence-field/sequenceKind.d.ts.map +1 -0
  185. package/dist/feature-libraries/sequence-field/sequenceKind.js +24 -0
  186. package/dist/feature-libraries/sequence-field/sequenceKind.js.map +1 -0
  187. package/dist/index.d.ts +3 -2
  188. package/dist/index.d.ts.map +1 -1
  189. package/dist/index.js +5 -1
  190. package/dist/index.js.map +1 -1
  191. package/dist/packageVersion.d.ts +1 -1
  192. package/dist/packageVersion.js +1 -1
  193. package/dist/packageVersion.js.map +1 -1
  194. package/dist/shared-tree/independentView.d.ts.map +1 -1
  195. package/dist/shared-tree/independentView.js +7 -7
  196. package/dist/shared-tree/independentView.js.map +1 -1
  197. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  198. package/dist/shared-tree/schematizingTreeView.js +12 -10
  199. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  200. package/dist/shared-tree/sharedTree.d.ts +2 -2
  201. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  202. package/dist/shared-tree/sharedTree.js +6 -33
  203. package/dist/shared-tree/sharedTree.js.map +1 -1
  204. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  205. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  206. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +31 -24
  207. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  208. package/dist/shared-tree/sharedTreeChangeEnricher.js +75 -58
  209. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  210. package/dist/shared-tree/tree.d.ts.map +1 -1
  211. package/dist/shared-tree/tree.js +14 -14
  212. package/dist/shared-tree/tree.js.map +1 -1
  213. package/dist/shared-tree/treeAlpha.d.ts +1 -1
  214. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  215. package/dist/shared-tree/treeAlpha.js +77 -77
  216. package/dist/shared-tree/treeAlpha.js.map +1 -1
  217. package/dist/shared-tree/treeCheckout.d.ts +21 -6
  218. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  219. package/dist/shared-tree/treeCheckout.js +93 -37
  220. package/dist/shared-tree/treeCheckout.js.map +1 -1
  221. package/dist/shared-tree-core/branch.d.ts +1 -1
  222. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  223. package/dist/shared-tree-core/branch.js +5 -1
  224. package/dist/shared-tree-core/branch.js.map +1 -1
  225. package/dist/shared-tree-core/branchCommitEnricher.d.ts +18 -31
  226. package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  227. package/dist/shared-tree-core/branchCommitEnricher.js +24 -76
  228. package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
  229. package/dist/shared-tree-core/branchIdCodec.d.ts.map +1 -1
  230. package/dist/shared-tree-core/branchIdCodec.js.map +1 -1
  231. package/dist/shared-tree-core/changeEnricher.d.ts +8 -43
  232. package/dist/shared-tree-core/changeEnricher.d.ts.map +1 -1
  233. package/dist/shared-tree-core/changeEnricher.js +0 -13
  234. package/dist/shared-tree-core/changeEnricher.js.map +1 -1
  235. package/dist/shared-tree-core/defaultResubmitMachine.d.ts +4 -12
  236. package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  237. package/dist/shared-tree-core/defaultResubmitMachine.js +26 -36
  238. package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  239. package/dist/shared-tree-core/editManager.d.ts +1 -1
  240. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  241. package/dist/shared-tree-core/editManager.js +13 -7
  242. package/dist/shared-tree-core/editManager.js.map +1 -1
  243. package/dist/shared-tree-core/editManagerCodecs.d.ts +1 -1
  244. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  245. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  246. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
  247. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  248. package/dist/shared-tree-core/editManagerCodecsCommons.js +1 -2
  249. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  250. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  251. package/dist/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
  252. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  253. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  254. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
  255. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  256. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  257. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  258. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  259. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  260. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +1 -1
  261. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  262. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js +1 -1
  263. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
  264. package/dist/shared-tree-core/index.d.ts +2 -2
  265. package/dist/shared-tree-core/index.d.ts.map +1 -1
  266. package/dist/shared-tree-core/index.js +1 -3
  267. package/dist/shared-tree-core/index.js.map +1 -1
  268. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  269. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  270. package/dist/shared-tree-core/messageCodecV1ToV4.js +1 -1
  271. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  272. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts +1 -1
  273. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  274. package/dist/shared-tree-core/messageCodecVSharedBranches.js +2 -2
  275. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  276. package/dist/shared-tree-core/messageCodecs.d.ts +2 -2
  277. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  278. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  279. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  280. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  281. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  282. package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
  283. package/dist/shared-tree-core/messageTypes.d.ts.map +1 -1
  284. package/dist/shared-tree-core/messageTypes.js.map +1 -1
  285. package/dist/shared-tree-core/sharedTreeCore.d.ts +8 -4
  286. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  287. package/dist/shared-tree-core/sharedTreeCore.js +13 -13
  288. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  289. package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
  290. package/dist/shared-tree-core/versionedSummarizer.js +1 -1
  291. package/dist/shared-tree-core/versionedSummarizer.js.map +1 -1
  292. package/dist/simple-tree/api/configuration.d.ts +2 -2
  293. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  294. package/dist/simple-tree/api/configuration.js +14 -14
  295. package/dist/simple-tree/api/configuration.js.map +1 -1
  296. package/dist/simple-tree/api/create.d.ts +1 -1
  297. package/dist/simple-tree/api/create.d.ts.map +1 -1
  298. package/dist/simple-tree/api/create.js +7 -7
  299. package/dist/simple-tree/api/create.js.map +1 -1
  300. package/dist/simple-tree/api/dirtyIndex.d.ts +1 -1
  301. package/dist/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  302. package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
  303. package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
  304. package/dist/simple-tree/api/discrepancies.js +23 -23
  305. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  306. package/dist/simple-tree/api/getJsonSchema.d.ts +1 -1
  307. package/dist/simple-tree/api/getJsonSchema.d.ts.map +1 -1
  308. package/dist/simple-tree/api/getJsonSchema.js +1 -1
  309. package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
  310. package/dist/simple-tree/api/identifierIndex.d.ts +2 -2
  311. package/dist/simple-tree/api/identifierIndex.d.ts.map +1 -1
  312. package/dist/simple-tree/api/identifierIndex.js.map +1 -1
  313. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  314. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  315. package/dist/simple-tree/api/incrementalAllowedTypes.js +6 -6
  316. package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  317. package/dist/simple-tree/api/index.d.ts +1 -1
  318. package/dist/simple-tree/api/index.d.ts.map +1 -1
  319. package/dist/simple-tree/api/index.js +2 -1
  320. package/dist/simple-tree/api/index.js.map +1 -1
  321. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  322. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  323. package/dist/simple-tree/api/schemaCompatibilityTester.js +1 -1
  324. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  325. package/dist/simple-tree/api/schemaCreationUtilities.d.ts +2 -2
  326. package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  327. package/dist/simple-tree/api/schemaCreationUtilities.js +7 -7
  328. package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  329. package/dist/simple-tree/api/schemaFactory.d.ts +2 -2
  330. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  331. package/dist/simple-tree/api/schemaFactory.js +7 -7
  332. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  333. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +6 -6
  334. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  335. package/dist/simple-tree/api/schemaFactoryAlpha.js +2 -2
  336. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  337. package/dist/simple-tree/api/schemaFactoryBeta.d.ts +2 -2
  338. package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  339. package/dist/simple-tree/api/schemaFactoryBeta.js +2 -1
  340. package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  341. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +1 -1
  342. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  343. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  344. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  345. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  346. package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
  347. package/dist/simple-tree/api/schemaStatics.js.map +1 -1
  348. package/dist/simple-tree/api/simpleSchemaCodec.d.ts +1 -1
  349. package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  350. package/dist/simple-tree/api/simpleSchemaCodec.js +17 -17
  351. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  352. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +2 -2
  353. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  354. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +6 -6
  355. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  356. package/dist/simple-tree/api/simpleTreeIndex.d.ts +1 -1
  357. package/dist/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
  358. package/dist/simple-tree/api/simpleTreeIndex.js +1 -1
  359. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  360. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +244 -0
  361. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  362. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +298 -2
  363. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  364. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  365. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  366. package/dist/simple-tree/api/tree.d.ts +5 -3
  367. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  368. package/dist/simple-tree/api/tree.js.map +1 -1
  369. package/dist/simple-tree/api/treeBeta.d.ts +1 -1
  370. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
  371. package/dist/simple-tree/api/treeBeta.js +2 -2
  372. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  373. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  374. package/dist/simple-tree/api/treeNodeApi.js +4 -4
  375. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  376. package/dist/simple-tree/api/typesUnsafe.d.ts +1 -1
  377. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  378. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  379. package/dist/simple-tree/api/verboseTree.d.ts +1 -1
  380. package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
  381. package/dist/simple-tree/api/verboseTree.js +22 -22
  382. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  383. package/dist/simple-tree/core/allowedTypes.d.ts +1 -1
  384. package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
  385. package/dist/simple-tree/core/allowedTypes.js +7 -7
  386. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  387. package/dist/simple-tree/core/context.d.ts.map +1 -1
  388. package/dist/simple-tree/core/context.js.map +1 -1
  389. package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
  390. package/dist/simple-tree/core/treeNode.js +1 -1
  391. package/dist/simple-tree/core/treeNode.js.map +1 -1
  392. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  393. package/dist/simple-tree/core/treeNodeKernel.js +7 -5
  394. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  395. package/dist/simple-tree/core/treeNodeSchema.d.ts +5 -5
  396. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  397. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  398. package/dist/simple-tree/core/treeNodeValid.d.ts +3 -3
  399. package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  400. package/dist/simple-tree/core/treeNodeValid.js +2 -2
  401. package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
  402. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +1 -1
  403. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  404. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  405. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  406. package/dist/simple-tree/core/withType.js.map +1 -1
  407. package/dist/simple-tree/createContext.d.ts.map +1 -1
  408. package/dist/simple-tree/createContext.js.map +1 -1
  409. package/dist/simple-tree/fieldSchema.d.ts +1 -1
  410. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  411. package/dist/simple-tree/fieldSchema.js.map +1 -1
  412. package/dist/simple-tree/index.d.ts +1 -1
  413. package/dist/simple-tree/index.d.ts.map +1 -1
  414. package/dist/simple-tree/index.js +3 -2
  415. package/dist/simple-tree/index.js.map +1 -1
  416. package/dist/simple-tree/leafNodeSchema.d.ts +1 -1
  417. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  418. package/dist/simple-tree/leafNodeSchema.js +15 -15
  419. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  420. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +1 -1
  421. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  422. package/dist/simple-tree/node-kinds/array/arrayNode.js +46 -46
  423. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  424. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +1 -1
  425. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  426. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  427. package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
  428. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  429. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +2 -2
  430. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  431. package/dist/simple-tree/node-kinds/map/mapNode.js +24 -24
  432. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  433. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +1 -1
  434. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  435. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  436. package/dist/simple-tree/node-kinds/object/objectNode.d.ts +2 -2
  437. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  438. package/dist/simple-tree/node-kinds/object/objectNode.js +9 -9
  439. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  440. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +3 -3
  441. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  442. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  443. package/dist/simple-tree/node-kinds/record/recordNode.d.ts +1 -1
  444. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  445. package/dist/simple-tree/node-kinds/record/recordNode.js +34 -34
  446. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  447. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +1 -1
  448. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  449. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  450. package/dist/simple-tree/prepareForInsertion.d.ts +2 -2
  451. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  452. package/dist/simple-tree/prepareForInsertion.js +13 -13
  453. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  454. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  455. package/dist/simple-tree/simpleSchema.js.map +1 -1
  456. package/dist/simple-tree/treeSchema.d.ts.map +1 -1
  457. package/dist/simple-tree/treeSchema.js.map +1 -1
  458. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +1 -1
  459. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  460. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +10 -10
  461. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  462. package/dist/tableSchema.d.ts.map +1 -1
  463. package/dist/tableSchema.js +22 -21
  464. package/dist/tableSchema.js.map +1 -1
  465. package/dist/text/index.d.ts +7 -0
  466. package/dist/text/index.d.ts.map +1 -0
  467. package/dist/text/index.js +12 -0
  468. package/dist/text/index.js.map +1 -0
  469. package/dist/text/textDomain.d.ts +146 -0
  470. package/dist/text/textDomain.d.ts.map +1 -0
  471. package/dist/text/textDomain.js +122 -0
  472. package/dist/text/textDomain.js.map +1 -0
  473. package/dist/text/textDomainFormatted.d.ts +572 -0
  474. package/dist/text/textDomainFormatted.d.ts.map +1 -0
  475. package/dist/text/textDomainFormatted.js +183 -0
  476. package/dist/text/textDomainFormatted.js.map +1 -0
  477. package/dist/treeFactory.d.ts.map +1 -1
  478. package/dist/treeFactory.js +9 -9
  479. package/dist/treeFactory.js.map +1 -1
  480. package/dist/util/bTreeUtils.d.ts +12 -4
  481. package/dist/util/bTreeUtils.d.ts.map +1 -1
  482. package/dist/util/bTreeUtils.js +14 -18
  483. package/dist/util/bTreeUtils.js.map +1 -1
  484. package/dist/util/nestedMap.js +12 -12
  485. package/dist/util/nestedMap.js.map +1 -1
  486. package/dist/util/readSnapshotBlob.d.ts +1 -1
  487. package/dist/util/readSnapshotBlob.d.ts.map +1 -1
  488. package/dist/util/readSnapshotBlob.js.map +1 -1
  489. package/docs/user-facing/merge-semantics.md +3 -2
  490. package/eslint.config.mts +8 -36
  491. package/lib/alpha.d.ts +5 -0
  492. package/lib/codec/codec.d.ts +2 -2
  493. package/lib/codec/codec.d.ts.map +1 -1
  494. package/lib/codec/codec.js +1 -1
  495. package/lib/codec/codec.js.map +1 -1
  496. package/lib/codec/versioned/codec.d.ts +1 -1
  497. package/lib/codec/versioned/codec.d.ts.map +1 -1
  498. package/lib/codec/versioned/codec.js +2 -2
  499. package/lib/codec/versioned/codec.js.map +1 -1
  500. package/lib/core/index.d.ts +1 -1
  501. package/lib/core/index.d.ts.map +1 -1
  502. package/lib/core/index.js.map +1 -1
  503. package/lib/core/rebase/index.d.ts +1 -1
  504. package/lib/core/rebase/index.d.ts.map +1 -1
  505. package/lib/core/rebase/index.js.map +1 -1
  506. package/lib/core/rebase/types.d.ts +44 -7
  507. package/lib/core/rebase/types.d.ts.map +1 -1
  508. package/lib/core/rebase/types.js.map +1 -1
  509. package/lib/core/rebase/utils.d.ts.map +1 -1
  510. package/lib/core/rebase/utils.js +5 -1
  511. package/lib/core/rebase/utils.js.map +1 -1
  512. package/lib/core/schema-stored/formatV2.d.ts.map +1 -1
  513. package/lib/core/schema-stored/formatV2.js +1 -1
  514. package/lib/core/schema-stored/formatV2.js.map +1 -1
  515. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  516. package/lib/core/tree/anchorSet.js +2 -1
  517. package/lib/core/tree/anchorSet.js.map +1 -1
  518. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  519. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  520. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +1 -1
  521. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  522. package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  523. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  524. package/lib/core/tree/detachedFieldIndexCodecV1.js +1 -1
  525. package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  526. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  527. package/lib/core/tree/detachedFieldIndexCodecV2.js +2 -2
  528. package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  529. package/lib/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
  530. package/lib/core/tree/detachedFieldIndexFormatV1.js +2 -2
  531. package/lib/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
  532. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  533. package/lib/core/tree/detachedFieldIndexFormatV2.js +2 -2
  534. package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  535. package/lib/core/tree/visitDelta.d.ts +1 -1
  536. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  537. package/lib/core/tree/visitDelta.js +3 -2
  538. package/lib/core/tree/visitDelta.js.map +1 -1
  539. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  540. package/lib/core/tree/visitorUtils.js +59 -19
  541. package/lib/core/tree/visitorUtils.js.map +1 -1
  542. package/lib/feature-libraries/changeAtomIdBTree.d.ts +6 -1
  543. package/lib/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  544. package/lib/feature-libraries/changeAtomIdBTree.js.map +1 -1
  545. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +1 -1
  546. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  547. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  548. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  549. package/lib/feature-libraries/chunked-forest/chunkedForest.js +3 -1
  550. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  551. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -1
  552. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  553. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  554. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  555. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  556. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  557. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -1
  558. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  559. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  560. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
  561. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  562. package/lib/feature-libraries/chunked-forest/codec/codecs.js +1 -1
  563. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  564. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
  565. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  566. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -0
  567. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  568. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  569. package/lib/feature-libraries/chunked-forest/codec/format.js +1 -1
  570. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  571. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  572. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  573. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  574. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  575. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +2 -2
  576. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  577. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  578. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +5 -3
  579. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  580. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +10 -52
  581. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  582. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +4 -45
  583. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  584. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  585. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  586. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  587. package/lib/feature-libraries/fieldKindIdentifiers.d.ts +9 -0
  588. package/lib/feature-libraries/fieldKindIdentifiers.d.ts.map +1 -0
  589. package/lib/feature-libraries/fieldKindIdentifiers.js +13 -0
  590. package/lib/feature-libraries/fieldKindIdentifiers.js.map +1 -0
  591. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  592. package/lib/feature-libraries/flex-tree/lazyField.js +1 -1
  593. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  594. package/lib/feature-libraries/flex-tree/observer.d.ts +1 -1
  595. package/lib/feature-libraries/flex-tree/observer.d.ts.map +1 -1
  596. package/lib/feature-libraries/flex-tree/observer.js.map +1 -1
  597. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  598. package/lib/feature-libraries/forest-summary/codec.js +1 -1
  599. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  600. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  601. package/lib/feature-libraries/forest-summary/forestSummarizer.js +6 -4
  602. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  603. package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
  604. package/lib/feature-libraries/forest-summary/formatV1.js.map +1 -1
  605. package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
  606. package/lib/feature-libraries/forest-summary/formatV2.js.map +1 -1
  607. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +4 -4
  608. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  609. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +2 -2
  610. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  611. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -1
  612. package/lib/feature-libraries/forest-summary/summaryTypes.js.map +1 -1
  613. package/lib/feature-libraries/index.d.ts +1 -1
  614. package/lib/feature-libraries/index.d.ts.map +1 -1
  615. package/lib/feature-libraries/index.js.map +1 -1
  616. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  617. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  618. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  619. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  620. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts +1 -1
  621. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  622. package/lib/feature-libraries/modular-schema/genericFieldKind.js +2 -2
  623. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  624. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +1 -1
  625. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  626. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +2 -0
  627. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  628. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  629. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -1
  630. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  631. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  632. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +1 -1
  633. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  634. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -2
  635. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  636. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +52 -43
  637. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  638. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +3 -3
  639. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  640. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  641. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  642. package/lib/feature-libraries/object-forest/objectForest.js +5 -3
  643. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  644. package/lib/feature-libraries/optional-field/index.d.ts +3 -3
  645. package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
  646. package/lib/feature-libraries/optional-field/index.js +2 -2
  647. package/lib/feature-libraries/optional-field/index.js.map +1 -1
  648. package/lib/feature-libraries/optional-field/optionalField.d.ts +10 -2
  649. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  650. package/lib/feature-libraries/optional-field/optionalField.js +14 -2
  651. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  652. package/lib/feature-libraries/optional-field/requiredField.d.ts +36 -0
  653. package/lib/feature-libraries/optional-field/requiredField.d.ts.map +1 -0
  654. package/lib/feature-libraries/optional-field/requiredField.js +24 -0
  655. package/lib/feature-libraries/optional-field/requiredField.js.map +1 -0
  656. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +1 -1
  657. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  658. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +1 -1
  659. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  660. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  661. package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  662. package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
  663. package/lib/feature-libraries/schemaChecker.js +1 -1
  664. package/lib/feature-libraries/schemaChecker.js.map +1 -1
  665. package/lib/feature-libraries/sequence-field/index.d.ts +2 -14
  666. package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
  667. package/lib/feature-libraries/sequence-field/index.js +1 -13
  668. package/lib/feature-libraries/sequence-field/index.js.map +1 -1
  669. package/lib/feature-libraries/sequence-field/rebase.js +1 -1
  670. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  671. package/lib/feature-libraries/sequence-field/sequenceKind.d.ts +16 -0
  672. package/lib/feature-libraries/sequence-field/sequenceKind.d.ts.map +1 -0
  673. package/lib/feature-libraries/sequence-field/sequenceKind.js +21 -0
  674. package/lib/feature-libraries/sequence-field/sequenceKind.js.map +1 -0
  675. package/lib/index.d.ts +3 -2
  676. package/lib/index.d.ts.map +1 -1
  677. package/lib/index.js +2 -1
  678. package/lib/index.js.map +1 -1
  679. package/lib/packageVersion.d.ts +1 -1
  680. package/lib/packageVersion.js +1 -1
  681. package/lib/packageVersion.js.map +1 -1
  682. package/lib/shared-tree/independentView.d.ts.map +1 -1
  683. package/lib/shared-tree/independentView.js +3 -3
  684. package/lib/shared-tree/independentView.js.map +1 -1
  685. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  686. package/lib/shared-tree/schematizingTreeView.js +12 -10
  687. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  688. package/lib/shared-tree/sharedTree.d.ts +2 -2
  689. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  690. package/lib/shared-tree/sharedTree.js +6 -33
  691. package/lib/shared-tree/sharedTree.js.map +1 -1
  692. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  693. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  694. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +31 -24
  695. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  696. package/lib/shared-tree/sharedTreeChangeEnricher.js +73 -55
  697. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  698. package/lib/shared-tree/tree.d.ts.map +1 -1
  699. package/lib/shared-tree/tree.js +7 -7
  700. package/lib/shared-tree/tree.js.map +1 -1
  701. package/lib/shared-tree/treeAlpha.d.ts +1 -1
  702. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  703. package/lib/shared-tree/treeAlpha.js +3 -3
  704. package/lib/shared-tree/treeAlpha.js.map +1 -1
  705. package/lib/shared-tree/treeCheckout.d.ts +21 -6
  706. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  707. package/lib/shared-tree/treeCheckout.js +67 -11
  708. package/lib/shared-tree/treeCheckout.js.map +1 -1
  709. package/lib/shared-tree-core/branch.d.ts +1 -1
  710. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  711. package/lib/shared-tree-core/branch.js +5 -1
  712. package/lib/shared-tree-core/branch.js.map +1 -1
  713. package/lib/shared-tree-core/branchCommitEnricher.d.ts +18 -31
  714. package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  715. package/lib/shared-tree-core/branchCommitEnricher.js +24 -76
  716. package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
  717. package/lib/shared-tree-core/branchIdCodec.d.ts.map +1 -1
  718. package/lib/shared-tree-core/branchIdCodec.js.map +1 -1
  719. package/lib/shared-tree-core/changeEnricher.d.ts +8 -43
  720. package/lib/shared-tree-core/changeEnricher.d.ts.map +1 -1
  721. package/lib/shared-tree-core/changeEnricher.js +1 -11
  722. package/lib/shared-tree-core/changeEnricher.js.map +1 -1
  723. package/lib/shared-tree-core/defaultResubmitMachine.d.ts +4 -12
  724. package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  725. package/lib/shared-tree-core/defaultResubmitMachine.js +28 -38
  726. package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  727. package/lib/shared-tree-core/editManager.d.ts +1 -1
  728. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  729. package/lib/shared-tree-core/editManager.js +13 -7
  730. package/lib/shared-tree-core/editManager.js.map +1 -1
  731. package/lib/shared-tree-core/editManagerCodecs.d.ts +1 -1
  732. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  733. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  734. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
  735. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  736. package/lib/shared-tree-core/editManagerCodecsCommons.js +1 -2
  737. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  738. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  739. package/lib/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
  740. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  741. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  742. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
  743. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  744. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  745. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  746. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  747. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  748. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +1 -1
  749. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  750. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js +1 -1
  751. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
  752. package/lib/shared-tree-core/index.d.ts +2 -2
  753. package/lib/shared-tree-core/index.d.ts.map +1 -1
  754. package/lib/shared-tree-core/index.js +0 -1
  755. package/lib/shared-tree-core/index.js.map +1 -1
  756. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  757. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  758. package/lib/shared-tree-core/messageCodecV1ToV4.js +1 -1
  759. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  760. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts +1 -1
  761. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  762. package/lib/shared-tree-core/messageCodecVSharedBranches.js +2 -2
  763. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  764. package/lib/shared-tree-core/messageCodecs.d.ts +2 -2
  765. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  766. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  767. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  768. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  769. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  770. package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
  771. package/lib/shared-tree-core/messageTypes.d.ts.map +1 -1
  772. package/lib/shared-tree-core/messageTypes.js.map +1 -1
  773. package/lib/shared-tree-core/sharedTreeCore.d.ts +8 -4
  774. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  775. package/lib/shared-tree-core/sharedTreeCore.js +14 -14
  776. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  777. package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
  778. package/lib/shared-tree-core/versionedSummarizer.js +1 -1
  779. package/lib/shared-tree-core/versionedSummarizer.js.map +1 -1
  780. package/lib/simple-tree/api/configuration.d.ts +2 -2
  781. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  782. package/lib/simple-tree/api/configuration.js +4 -4
  783. package/lib/simple-tree/api/configuration.js.map +1 -1
  784. package/lib/simple-tree/api/create.d.ts +1 -1
  785. package/lib/simple-tree/api/create.d.ts.map +1 -1
  786. package/lib/simple-tree/api/create.js +1 -1
  787. package/lib/simple-tree/api/create.js.map +1 -1
  788. package/lib/simple-tree/api/dirtyIndex.d.ts +1 -1
  789. package/lib/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  790. package/lib/simple-tree/api/dirtyIndex.js.map +1 -1
  791. package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
  792. package/lib/simple-tree/api/discrepancies.js +3 -3
  793. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  794. package/lib/simple-tree/api/getJsonSchema.d.ts +1 -1
  795. package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -1
  796. package/lib/simple-tree/api/getJsonSchema.js +1 -1
  797. package/lib/simple-tree/api/getJsonSchema.js.map +1 -1
  798. package/lib/simple-tree/api/identifierIndex.d.ts +2 -2
  799. package/lib/simple-tree/api/identifierIndex.d.ts.map +1 -1
  800. package/lib/simple-tree/api/identifierIndex.js.map +1 -1
  801. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  802. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  803. package/lib/simple-tree/api/incrementalAllowedTypes.js +3 -3
  804. package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  805. package/lib/simple-tree/api/index.d.ts +1 -1
  806. package/lib/simple-tree/api/index.d.ts.map +1 -1
  807. package/lib/simple-tree/api/index.js +1 -1
  808. package/lib/simple-tree/api/index.js.map +1 -1
  809. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  810. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  811. package/lib/simple-tree/api/schemaCompatibilityTester.js +1 -1
  812. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  813. package/lib/simple-tree/api/schemaCreationUtilities.d.ts +2 -2
  814. package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  815. package/lib/simple-tree/api/schemaCreationUtilities.js +1 -1
  816. package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  817. package/lib/simple-tree/api/schemaFactory.d.ts +2 -2
  818. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  819. package/lib/simple-tree/api/schemaFactory.js +2 -2
  820. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  821. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +6 -6
  822. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  823. package/lib/simple-tree/api/schemaFactoryAlpha.js +2 -2
  824. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  825. package/lib/simple-tree/api/schemaFactoryBeta.d.ts +2 -2
  826. package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  827. package/lib/simple-tree/api/schemaFactoryBeta.js +2 -1
  828. package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  829. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +1 -1
  830. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  831. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  832. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  833. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  834. package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
  835. package/lib/simple-tree/api/schemaStatics.js.map +1 -1
  836. package/lib/simple-tree/api/simpleSchemaCodec.d.ts +1 -1
  837. package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  838. package/lib/simple-tree/api/simpleSchemaCodec.js +3 -3
  839. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  840. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +2 -2
  841. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  842. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +6 -6
  843. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  844. package/lib/simple-tree/api/simpleTreeIndex.d.ts +1 -1
  845. package/lib/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
  846. package/lib/simple-tree/api/simpleTreeIndex.js +1 -1
  847. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  848. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +244 -0
  849. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  850. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +271 -1
  851. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  852. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  853. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  854. package/lib/simple-tree/api/tree.d.ts +5 -3
  855. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  856. package/lib/simple-tree/api/tree.js.map +1 -1
  857. package/lib/simple-tree/api/treeBeta.d.ts +1 -1
  858. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
  859. package/lib/simple-tree/api/treeBeta.js +2 -2
  860. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  861. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  862. package/lib/simple-tree/api/treeNodeApi.js +4 -4
  863. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  864. package/lib/simple-tree/api/typesUnsafe.d.ts +1 -1
  865. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  866. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  867. package/lib/simple-tree/api/verboseTree.d.ts +1 -1
  868. package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
  869. package/lib/simple-tree/api/verboseTree.js +3 -3
  870. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  871. package/lib/simple-tree/core/allowedTypes.d.ts +1 -1
  872. package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
  873. package/lib/simple-tree/core/allowedTypes.js +2 -2
  874. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  875. package/lib/simple-tree/core/context.d.ts.map +1 -1
  876. package/lib/simple-tree/core/context.js.map +1 -1
  877. package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
  878. package/lib/simple-tree/core/treeNode.js +1 -1
  879. package/lib/simple-tree/core/treeNode.js.map +1 -1
  880. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  881. package/lib/simple-tree/core/treeNodeKernel.js +7 -5
  882. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  883. package/lib/simple-tree/core/treeNodeSchema.d.ts +5 -5
  884. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  885. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  886. package/lib/simple-tree/core/treeNodeValid.d.ts +3 -3
  887. package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  888. package/lib/simple-tree/core/treeNodeValid.js +2 -2
  889. package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
  890. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +1 -1
  891. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  892. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  893. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  894. package/lib/simple-tree/core/withType.js.map +1 -1
  895. package/lib/simple-tree/createContext.d.ts.map +1 -1
  896. package/lib/simple-tree/createContext.js.map +1 -1
  897. package/lib/simple-tree/fieldSchema.d.ts +1 -1
  898. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  899. package/lib/simple-tree/fieldSchema.js.map +1 -1
  900. package/lib/simple-tree/index.d.ts +1 -1
  901. package/lib/simple-tree/index.d.ts.map +1 -1
  902. package/lib/simple-tree/index.js +1 -1
  903. package/lib/simple-tree/index.js.map +1 -1
  904. package/lib/simple-tree/leafNodeSchema.d.ts +1 -1
  905. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  906. package/lib/simple-tree/leafNodeSchema.js +2 -2
  907. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  908. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +1 -1
  909. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  910. package/lib/simple-tree/node-kinds/array/arrayNode.js +5 -5
  911. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  912. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +1 -1
  913. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  914. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  915. package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
  916. package/lib/simple-tree/node-kinds/common.js.map +1 -1
  917. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +2 -2
  918. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  919. package/lib/simple-tree/node-kinds/map/mapNode.js +6 -6
  920. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  921. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +1 -1
  922. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  923. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  924. package/lib/simple-tree/node-kinds/object/objectNode.d.ts +2 -2
  925. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  926. package/lib/simple-tree/node-kinds/object/objectNode.js +3 -3
  927. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  928. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +3 -3
  929. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  930. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  931. package/lib/simple-tree/node-kinds/record/recordNode.d.ts +1 -1
  932. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  933. package/lib/simple-tree/node-kinds/record/recordNode.js +4 -4
  934. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  935. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +1 -1
  936. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  937. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  938. package/lib/simple-tree/prepareForInsertion.d.ts +2 -2
  939. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  940. package/lib/simple-tree/prepareForInsertion.js +4 -4
  941. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  942. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  943. package/lib/simple-tree/simpleSchema.js.map +1 -1
  944. package/lib/simple-tree/treeSchema.d.ts.map +1 -1
  945. package/lib/simple-tree/treeSchema.js.map +1 -1
  946. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +1 -1
  947. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  948. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +2 -2
  949. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  950. package/lib/tableSchema.d.ts.map +1 -1
  951. package/lib/tableSchema.js +2 -1
  952. package/lib/tableSchema.js.map +1 -1
  953. package/lib/text/index.d.ts +7 -0
  954. package/lib/text/index.d.ts.map +1 -0
  955. package/lib/text/index.js +7 -0
  956. package/lib/text/index.js.map +1 -0
  957. package/lib/text/textDomain.d.ts +146 -0
  958. package/lib/text/textDomain.d.ts.map +1 -0
  959. package/lib/text/textDomain.js +118 -0
  960. package/lib/text/textDomain.js.map +1 -0
  961. package/lib/text/textDomainFormatted.d.ts +572 -0
  962. package/lib/text/textDomainFormatted.d.ts.map +1 -0
  963. package/lib/text/textDomainFormatted.js +180 -0
  964. package/lib/text/textDomainFormatted.js.map +1 -0
  965. package/lib/treeFactory.d.ts.map +1 -1
  966. package/lib/treeFactory.js +2 -2
  967. package/lib/treeFactory.js.map +1 -1
  968. package/lib/util/bTreeUtils.d.ts +12 -4
  969. package/lib/util/bTreeUtils.d.ts.map +1 -1
  970. package/lib/util/bTreeUtils.js +15 -19
  971. package/lib/util/bTreeUtils.js.map +1 -1
  972. package/lib/util/nestedMap.js +12 -12
  973. package/lib/util/nestedMap.js.map +1 -1
  974. package/lib/util/readSnapshotBlob.d.ts +1 -1
  975. package/lib/util/readSnapshotBlob.d.ts.map +1 -1
  976. package/lib/util/readSnapshotBlob.js.map +1 -1
  977. package/package.json +25 -25
  978. package/src/codec/codec.ts +10 -7
  979. package/src/codec/versioned/codec.ts +3 -3
  980. package/src/core/index.ts +2 -0
  981. package/src/core/rebase/index.ts +2 -0
  982. package/src/core/rebase/types.ts +57 -20
  983. package/src/core/rebase/utils.ts +8 -4
  984. package/src/core/schema-stored/formatV2.ts +2 -1
  985. package/src/core/tree/anchorSet.ts +2 -1
  986. package/src/core/tree/detachedFieldIndex.ts +1 -1
  987. package/src/core/tree/detachedFieldIndexCodecCommon.ts +2 -1
  988. package/src/core/tree/detachedFieldIndexCodecV1.ts +2 -2
  989. package/src/core/tree/detachedFieldIndexCodecV2.ts +3 -3
  990. package/src/core/tree/detachedFieldIndexFormatV1.ts +3 -2
  991. package/src/core/tree/detachedFieldIndexFormatV2.ts +3 -2
  992. package/src/core/tree/visitDelta.ts +8 -5
  993. package/src/core/tree/visitorUtils.ts +57 -20
  994. package/src/feature-libraries/changeAtomIdBTree.ts +9 -1
  995. package/src/feature-libraries/chunked-forest/chunkTree.ts +1 -1
  996. package/src/feature-libraries/chunked-forest/chunkedForest.ts +3 -1
  997. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +1 -1
  998. package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +1 -1
  999. package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +1 -1
  1000. package/src/feature-libraries/chunked-forest/codec/codecs.ts +2 -2
  1001. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +2 -1
  1002. package/src/feature-libraries/chunked-forest/codec/format.ts +1 -1
  1003. package/src/feature-libraries/chunked-forest/codec/formatGeneric.ts +1 -0
  1004. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +3 -3
  1005. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +5 -10
  1006. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +22 -110
  1007. package/src/feature-libraries/default-schema/index.ts +0 -5
  1008. package/src/feature-libraries/fieldKindIdentifiers.ts +16 -0
  1009. package/src/feature-libraries/flex-tree/lazyField.ts +1 -1
  1010. package/src/feature-libraries/flex-tree/observer.ts +3 -1
  1011. package/src/feature-libraries/forest-summary/codec.ts +1 -1
  1012. package/src/feature-libraries/forest-summary/forestSummarizer.ts +9 -7
  1013. package/src/feature-libraries/forest-summary/formatV1.ts +1 -0
  1014. package/src/feature-libraries/forest-summary/formatV2.ts +1 -0
  1015. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +9 -7
  1016. package/src/feature-libraries/forest-summary/summaryTypes.ts +1 -0
  1017. package/src/feature-libraries/index.ts +0 -5
  1018. package/src/feature-libraries/mapTreeCursor.ts +1 -1
  1019. package/src/feature-libraries/modular-schema/fieldKindConfiguration.ts +1 -0
  1020. package/src/feature-libraries/modular-schema/genericFieldKind.ts +2 -2
  1021. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +3 -1
  1022. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +2 -2
  1023. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +3 -2
  1024. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +83 -74
  1025. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +3 -3
  1026. package/src/feature-libraries/object-forest/objectForest.ts +5 -3
  1027. package/src/feature-libraries/optional-field/index.ts +6 -8
  1028. package/src/feature-libraries/optional-field/optionalField.ts +31 -0
  1029. package/src/feature-libraries/optional-field/requiredField.ts +62 -0
  1030. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +1 -1
  1031. package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +1 -0
  1032. package/src/feature-libraries/schemaChecker.ts +3 -2
  1033. package/src/feature-libraries/sequence-field/index.ts +2 -51
  1034. package/src/feature-libraries/sequence-field/rebase.ts +1 -1
  1035. package/src/feature-libraries/sequence-field/sequenceKind.ts +40 -0
  1036. package/src/index.ts +7 -0
  1037. package/src/packageVersion.ts +1 -1
  1038. package/src/shared-tree/independentView.ts +4 -3
  1039. package/src/shared-tree/schematizingTreeView.ts +17 -13
  1040. package/src/shared-tree/sharedTree.ts +9 -46
  1041. package/src/shared-tree/sharedTreeChangeCodecs.ts +1 -0
  1042. package/src/shared-tree/sharedTreeChangeEnricher.ts +87 -66
  1043. package/src/shared-tree/tree.ts +10 -10
  1044. package/src/shared-tree/treeAlpha.ts +26 -25
  1045. package/src/shared-tree/treeCheckout.ts +119 -23
  1046. package/src/shared-tree-core/branch.ts +9 -5
  1047. package/src/shared-tree-core/branchCommitEnricher.ts +25 -77
  1048. package/src/shared-tree-core/branchIdCodec.ts +1 -0
  1049. package/src/shared-tree-core/changeEnricher.ts +8 -52
  1050. package/src/shared-tree-core/defaultResubmitMachine.ts +39 -51
  1051. package/src/shared-tree-core/editManager.ts +32 -32
  1052. package/src/shared-tree-core/editManagerCodecs.ts +2 -2
  1053. package/src/shared-tree-core/editManagerCodecsCommons.ts +7 -6
  1054. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +1 -1
  1055. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +2 -2
  1056. package/src/shared-tree-core/editManagerFormatCommons.ts +1 -0
  1057. package/src/shared-tree-core/editManagerFormatV1toV4.ts +1 -0
  1058. package/src/shared-tree-core/editManagerFormatVSharedBranches.ts +3 -2
  1059. package/src/shared-tree-core/index.ts +2 -5
  1060. package/src/shared-tree-core/messageCodecV1ToV4.ts +3 -3
  1061. package/src/shared-tree-core/messageCodecVSharedBranches.ts +4 -4
  1062. package/src/shared-tree-core/messageCodecs.ts +2 -2
  1063. package/src/shared-tree-core/messageFormatV1ToV4.ts +1 -0
  1064. package/src/shared-tree-core/messageFormatVSharedBranches.ts +1 -0
  1065. package/src/shared-tree-core/messageTypes.ts +1 -0
  1066. package/src/shared-tree-core/sharedTreeCore.ts +27 -28
  1067. package/src/shared-tree-core/versionedSummarizer.ts +3 -1
  1068. package/src/simple-tree/api/configuration.ts +9 -9
  1069. package/src/simple-tree/api/create.ts +7 -6
  1070. package/src/simple-tree/api/dirtyIndex.ts +4 -2
  1071. package/src/simple-tree/api/discrepancies.ts +9 -8
  1072. package/src/simple-tree/api/getJsonSchema.ts +4 -3
  1073. package/src/simple-tree/api/identifierIndex.ts +4 -2
  1074. package/src/simple-tree/api/incrementalAllowedTypes.ts +6 -5
  1075. package/src/simple-tree/api/index.ts +3 -0
  1076. package/src/simple-tree/api/schemaCompatibilityTester.ts +3 -3
  1077. package/src/simple-tree/api/schemaCreationUtilities.ts +4 -3
  1078. package/src/simple-tree/api/schemaFactory.ts +16 -17
  1079. package/src/simple-tree/api/schemaFactoryAlpha.ts +22 -22
  1080. package/src/simple-tree/api/schemaFactoryBeta.ts +18 -16
  1081. package/src/simple-tree/api/schemaFactoryRecursive.ts +1 -1
  1082. package/src/simple-tree/api/schemaFromSimple.ts +1 -1
  1083. package/src/simple-tree/api/schemaStatics.ts +2 -0
  1084. package/src/simple-tree/api/simpleSchemaCodec.ts +12 -11
  1085. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +24 -22
  1086. package/src/simple-tree/api/simpleTreeIndex.ts +6 -4
  1087. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +504 -1
  1088. package/src/simple-tree/api/storedSchema.ts +2 -1
  1089. package/src/simple-tree/api/tree.ts +5 -3
  1090. package/src/simple-tree/api/treeBeta.ts +3 -3
  1091. package/src/simple-tree/api/treeNodeApi.ts +14 -13
  1092. package/src/simple-tree/api/typesUnsafe.ts +7 -8
  1093. package/src/simple-tree/api/verboseTree.ts +6 -5
  1094. package/src/simple-tree/core/allowedTypes.ts +4 -4
  1095. package/src/simple-tree/core/context.ts +1 -1
  1096. package/src/simple-tree/core/treeNode.ts +1 -1
  1097. package/src/simple-tree/core/treeNodeKernel.ts +7 -5
  1098. package/src/simple-tree/core/treeNodeSchema.ts +7 -6
  1099. package/src/simple-tree/core/treeNodeValid.ts +9 -9
  1100. package/src/simple-tree/core/unhydratedFlexTree.ts +1 -1
  1101. package/src/simple-tree/core/withType.ts +3 -2
  1102. package/src/simple-tree/createContext.ts +1 -0
  1103. package/src/simple-tree/fieldSchema.ts +1 -2
  1104. package/src/simple-tree/index.ts +3 -0
  1105. package/src/simple-tree/leafNodeSchema.ts +3 -3
  1106. package/src/simple-tree/node-kinds/array/arrayNode.ts +17 -16
  1107. package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +2 -2
  1108. package/src/simple-tree/node-kinds/common.ts +1 -1
  1109. package/src/simple-tree/node-kinds/map/mapNode.ts +16 -15
  1110. package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +2 -2
  1111. package/src/simple-tree/node-kinds/object/objectNode.ts +11 -11
  1112. package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +8 -7
  1113. package/src/simple-tree/node-kinds/record/recordNode.ts +12 -12
  1114. package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +1 -2
  1115. package/src/simple-tree/prepareForInsertion.ts +10 -8
  1116. package/src/simple-tree/simpleSchema.ts +1 -0
  1117. package/src/simple-tree/treeSchema.ts +1 -0
  1118. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +2 -2
  1119. package/src/tableSchema.ts +3 -1
  1120. package/src/text/README.md +8 -0
  1121. package/src/text/index.ts +7 -0
  1122. package/src/text/textDomain.ts +199 -0
  1123. package/src/text/textDomainFormatted.ts +309 -0
  1124. package/src/treeFactory.ts +4 -4
  1125. package/src/util/bTreeUtils.ts +33 -22
  1126. package/src/util/nestedMap.ts +12 -12
  1127. package/src/util/readSnapshotBlob.ts +4 -2
  1128. package/.eslintrc.cjs +0 -125
  1129. package/assertTagging.config.mjs +0 -14
  1130. package/dist/shared-tree-core/transactionEnricher.d.ts +0 -23
  1131. package/dist/shared-tree-core/transactionEnricher.d.ts.map +0 -1
  1132. package/dist/shared-tree-core/transactionEnricher.js +0 -74
  1133. package/dist/shared-tree-core/transactionEnricher.js.map +0 -1
  1134. package/lib/shared-tree-core/transactionEnricher.d.ts +0 -23
  1135. package/lib/shared-tree-core/transactionEnricher.d.ts.map +0 -1
  1136. package/lib/shared-tree-core/transactionEnricher.js +0 -70
  1137. package/lib/shared-tree-core/transactionEnricher.js.map +0 -1
  1138. package/src/shared-tree-core/transactionEnricher.ts +0 -74
@@ -2,16 +2,31 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type DetachedFieldIndex, type IEditableForest, type IForestSubscription, type ReadOnlyDetachedFieldIndex, type RevisionTag, type TreeStoredSchemaRepository } from "../core/index.js";
5
+ import type { IIdCompressor } from "@fluidframework/id-compressor";
6
+ import { type DetachedFieldIndex, type IEditableForest, type IForestSubscription, type ReadOnlyDetachedFieldIndex, type TaggedChange, type TreeStoredSchemaRepository } from "../core/index.js";
6
7
  import { disposeSymbol } from "../util/index.js";
7
8
  import type { SharedTreeChange } from "./sharedTreeChangeTypes.js";
8
- import type { ChangeEnricherMutableCheckout, ChangeEnricherReadonlyCheckout } from "../shared-tree-core/index.js";
9
- import type { IIdCompressor } from "@fluidframework/id-compressor";
10
- export declare class SharedTreeReadonlyChangeEnricher implements ChangeEnricherReadonlyCheckout<SharedTreeChange> {
11
- protected readonly borrowedForest: IForestSubscription;
9
+ interface BorrowedState {
10
+ readonly forest: IForestSubscription;
11
+ readonly removedRoots: ReadOnlyDetachedFieldIndex;
12
+ }
13
+ interface OwnedState {
14
+ readonly forest: IEditableForest;
15
+ readonly removedRoots: DetachedFieldIndex;
16
+ }
17
+ export declare class SharedTreeChangeEnricher {
12
18
  private readonly schema;
13
- protected readonly borrowedRemovedRoots: ReadOnlyDetachedFieldIndex;
14
19
  private readonly idCompressor?;
20
+ private readonly onEnrichCommit?;
21
+ private readonly onRefresherAdded?;
22
+ private readonly onForkState?;
23
+ private readonly onApplyChange?;
24
+ /**
25
+ * Queue of changes to be applied before querying for detached roots.
26
+ */
27
+ private readonly changeQueue;
28
+ protected readonly borrowed: BorrowedState;
29
+ protected owned?: OwnedState;
15
30
  /**
16
31
  * @param borrowedForest - The state based on which to enrich changes.
17
32
  * Not owned by the constructed instance.
@@ -19,25 +34,17 @@ export declare class SharedTreeReadonlyChangeEnricher implements ChangeEnricherR
19
34
  * @param borrowedRemovedRoots - The set of removed roots based on which to enrich changes.
20
35
  * Not owned by the constructed instance.
21
36
  * @param idCompressor - The id compressor to use when chunking trees.
37
+ * @param onEnrichCommit - Optional callback invoked whenever a commit is enriched.
38
+ * @param onRefresherAdded - Optional callback invoked whenever a refresher is added during enrichment.
39
+ * @param onForkState - Optional callback invoked whenever the enricher forks its state.
40
+ * @param onApplyChange - Optional callback invoked whenever a change is applied to the owned state.
22
41
  */
23
- constructor(borrowedForest: IForestSubscription, schema: TreeStoredSchemaRepository, borrowedRemovedRoots: ReadOnlyDetachedFieldIndex, idCompressor?: IIdCompressor | undefined);
24
- fork(): ChangeEnricherMutableCheckout<SharedTreeChange>;
25
- updateChangeEnrichments(change: SharedTreeChange): SharedTreeChange;
26
- private readonly getDetachedRoot;
27
- }
28
- export declare class SharedTreeMutableChangeEnricher extends SharedTreeReadonlyChangeEnricher implements ChangeEnricherMutableCheckout<SharedTreeChange> {
29
- private readonly forest;
30
- private readonly removedRoots;
31
- /**
32
- * @param forest - The state based on which to enrich changes.
33
- * Owned by the constructed instance.
34
- * @param schema - The schema that corresponds to the forest.
35
- * @param removedRoots - The set of removed roots based on which to enrich changes.
36
- * Owned by the constructed instance.
37
- * @param idCompressor - The id compressor to use when chunking trees.
38
- */
39
- constructor(forest: IEditableForest, schema: TreeStoredSchemaRepository, removedRoots: DetachedFieldIndex, idCompressor?: IIdCompressor);
40
- applyTipChange(change: SharedTreeChange, revision?: RevisionTag): void;
42
+ constructor(borrowedForest: IForestSubscription, borrowedRemovedRoots: ReadOnlyDetachedFieldIndex, schema: TreeStoredSchemaRepository, idCompressor?: IIdCompressor | undefined, onEnrichCommit?: (() => void) | undefined, onRefresherAdded?: (() => void) | undefined, onForkState?: (() => void) | undefined, onApplyChange?: (() => void) | undefined);
43
+ enrich(change: SharedTreeChange): SharedTreeChange;
44
+ private getDetachedRoot;
45
+ enqueueChange(change: TaggedChange<SharedTreeChange> | (() => TaggedChange<SharedTreeChange>)): void;
46
+ private purgeChangeQueue;
41
47
  [disposeSymbol](): void;
42
48
  }
49
+ export {};
43
50
  //# sourceMappingURL=sharedTreeChangeEnricher.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sharedTreeChangeEnricher.d.ts","sourceRoot":"","sources":["../../src/shared-tree/sharedTreeChangeEnricher.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAGN,KAAK,kBAAkB,EACvB,KAA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AAmB,EACnC,oBAAoB,EAAE,0BAA0B,EAC/B,MAAM,EAAE,0BAA0B,EAClC,YAAY,CAAC,2BAAe,EAC5B,cAAc,CAAC,SAAQ,IAAI,aAAA,EAC3B,gBAAgB,CAAC,SAAQ,IAAI,aAAA,EAC7B,WAAW,CAAC,SAAQ,IAAI,aAAA,EACxB,aAAa,CAAC,SAAQ,IAAI,aAAA;IAQrC,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB;IAUzD,OAAO,CAAC,eAAe;IAkBhB,aAAa,CACnB,MAAM,EAAE,YAAY,CAAC,gBAAgB,CAAC,GAAG,CAAC,MAAM,YAAY,CAAC,gBAAgB,CAAC,CAAC,GAC7E,IAAI;IAIP,OAAO,CAAC,gBAAgB;IAwCjB,CAAC,aAAa,CAAC,IAAI,IAAI;CAG9B"}
@@ -4,13 +4,13 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.SharedTreeMutableChangeEnricher = exports.SharedTreeReadonlyChangeEnricher = void 0;
7
+ exports.SharedTreeChangeEnricher = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const index_js_1 = require("../core/index.js");
10
10
  const index_js_2 = require("../feature-libraries/index.js");
11
11
  const index_js_3 = require("../util/index.js");
12
12
  const sharedTreeChangeFamily_js_1 = require("./sharedTreeChangeFamily.js");
13
- class SharedTreeReadonlyChangeEnricher {
13
+ class SharedTreeChangeEnricher {
14
14
  /**
15
15
  * @param borrowedForest - The state based on which to enrich changes.
16
16
  * Not owned by the constructed instance.
@@ -18,76 +18,93 @@ class SharedTreeReadonlyChangeEnricher {
18
18
  * @param borrowedRemovedRoots - The set of removed roots based on which to enrich changes.
19
19
  * Not owned by the constructed instance.
20
20
  * @param idCompressor - The id compressor to use when chunking trees.
21
+ * @param onEnrichCommit - Optional callback invoked whenever a commit is enriched.
22
+ * @param onRefresherAdded - Optional callback invoked whenever a refresher is added during enrichment.
23
+ * @param onForkState - Optional callback invoked whenever the enricher forks its state.
24
+ * @param onApplyChange - Optional callback invoked whenever a change is applied to the owned state.
21
25
  */
22
- constructor(borrowedForest, schema, borrowedRemovedRoots, idCompressor) {
23
- this.borrowedForest = borrowedForest;
26
+ constructor(borrowedForest, borrowedRemovedRoots, schema, idCompressor, onEnrichCommit, onRefresherAdded, onForkState, onApplyChange) {
24
27
  this.schema = schema;
25
- this.borrowedRemovedRoots = borrowedRemovedRoots;
26
28
  this.idCompressor = idCompressor;
27
- this.getDetachedRoot = (id) => {
28
- const root = this.borrowedRemovedRoots.tryGetEntry(id);
29
- if (root !== undefined) {
30
- const cursor = this.borrowedForest.getCursorAboveDetachedFields();
31
- const parentField = this.borrowedRemovedRoots.toFieldKey(root);
32
- cursor.enterField(parentField);
33
- cursor.enterNode(0);
34
- return (0, index_js_2.chunkTree)(cursor, {
35
- policy: index_js_2.defaultChunkPolicy,
36
- idCompressor: this.idCompressor,
37
- });
38
- }
39
- return undefined;
29
+ this.onEnrichCommit = onEnrichCommit;
30
+ this.onRefresherAdded = onRefresherAdded;
31
+ this.onForkState = onForkState;
32
+ this.onApplyChange = onApplyChange;
33
+ /**
34
+ * Queue of changes to be applied before querying for detached roots.
35
+ */
36
+ this.changeQueue = [];
37
+ this.borrowed = {
38
+ forest: borrowedForest,
39
+ removedRoots: borrowedRemovedRoots,
40
40
  };
41
41
  }
42
- fork() {
43
- return new SharedTreeMutableChangeEnricher(this.borrowedForest.clone(this.schema, new index_js_1.AnchorSet()), this.schema, this.borrowedRemovedRoots.clone());
42
+ enrich(change) {
43
+ this.onEnrichCommit?.();
44
+ return (0, sharedTreeChangeFamily_js_1.updateRefreshers)(change, (id) => this.getDetachedRoot(id), index_js_2.relevantRemovedRoots, index_js_2.updateRefreshers);
44
45
  }
45
- updateChangeEnrichments(change) {
46
- return (0, sharedTreeChangeFamily_js_1.updateRefreshers)(change, this.getDetachedRoot, index_js_2.relevantRemovedRoots, index_js_2.updateRefreshers);
46
+ getDetachedRoot(id) {
47
+ this.purgeChangeQueue();
48
+ const state = this.owned ?? this.borrowed;
49
+ const root = state.removedRoots.tryGetEntry(id);
50
+ if (root !== undefined) {
51
+ const cursor = state.forest.getCursorAboveDetachedFields();
52
+ const parentField = state.removedRoots.toFieldKey(root);
53
+ cursor.enterField(parentField);
54
+ cursor.enterNode(0);
55
+ this.onRefresherAdded?.();
56
+ return (0, index_js_2.chunkTree)(cursor, {
57
+ policy: index_js_2.defaultChunkPolicy,
58
+ idCompressor: this.idCompressor,
59
+ });
60
+ }
61
+ return undefined;
47
62
  }
48
- }
49
- exports.SharedTreeReadonlyChangeEnricher = SharedTreeReadonlyChangeEnricher;
50
- class SharedTreeMutableChangeEnricher extends SharedTreeReadonlyChangeEnricher {
51
- /**
52
- * @param forest - The state based on which to enrich changes.
53
- * Owned by the constructed instance.
54
- * @param schema - The schema that corresponds to the forest.
55
- * @param removedRoots - The set of removed roots based on which to enrich changes.
56
- * Owned by the constructed instance.
57
- * @param idCompressor - The id compressor to use when chunking trees.
58
- */
59
- constructor(forest, schema, removedRoots, idCompressor) {
60
- super(forest, schema, removedRoots, idCompressor);
61
- this.forest = forest;
62
- this.removedRoots = removedRoots;
63
+ enqueueChange(change) {
64
+ this.changeQueue.push(typeof change === "function" ? change : () => change);
63
65
  }
64
- applyTipChange(change, revision) {
65
- for (const dataOrSchemaChange of change.changes) {
66
- const type = dataOrSchemaChange.type;
67
- switch (type) {
68
- case "data": {
69
- const delta = (0, index_js_2.intoDelta)((0, index_js_1.tagChange)(dataOrSchemaChange.innerChange, revision));
70
- const visitor = this.forest.acquireVisitor();
71
- (0, index_js_1.visitDelta)(delta, visitor, this.removedRoots, revision);
72
- visitor.free();
73
- break;
74
- }
75
- case "schema": {
76
- // This enricher doesn't need to maintain schema information.
77
- // Note that the refreshers being generated through `updateChangeEnrichments` will be encoded using
78
- // the schema that was used in the input context of the data changeset these refreshers are on.
79
- // See the encoding logic in SharedTreeCore for details.
80
- break;
81
- }
82
- default: {
83
- (0, internal_1.unreachableCase)(type);
66
+ purgeChangeQueue() {
67
+ if (this.changeQueue.length === 0) {
68
+ return;
69
+ }
70
+ if (this.owned === undefined) {
71
+ this.onForkState?.();
72
+ this.owned = {
73
+ forest: this.borrowed.forest.clone(this.schema, new index_js_1.AnchorSet()),
74
+ removedRoots: this.borrowed.removedRoots.clone(),
75
+ };
76
+ }
77
+ for (const getChange of this.changeQueue) {
78
+ const { change, revision } = getChange();
79
+ this.onApplyChange?.();
80
+ for (const dataOrSchemaChange of change.changes) {
81
+ const type = dataOrSchemaChange.type;
82
+ switch (type) {
83
+ case "data": {
84
+ const delta = (0, index_js_2.intoDelta)((0, index_js_1.tagChange)(dataOrSchemaChange.innerChange, revision));
85
+ const visitor = this.owned.forest.acquireVisitor();
86
+ (0, index_js_1.visitDelta)(delta, visitor, this.owned.removedRoots, revision);
87
+ visitor.free();
88
+ break;
89
+ }
90
+ case "schema": {
91
+ // This enricher doesn't need to maintain schema information.
92
+ // Note that the refreshers being generated through `updateChangeEnrichments` will be encoded using
93
+ // the schema that was used in the input context of the data changeset these refreshers are on.
94
+ // See the encoding logic in SharedTreeCore for details.
95
+ break;
96
+ }
97
+ default: {
98
+ (0, internal_1.unreachableCase)(type);
99
+ }
84
100
  }
85
101
  }
86
102
  }
103
+ this.changeQueue.length = 0;
87
104
  }
88
105
  [index_js_3.disposeSymbol]() {
89
106
  // TODO: in the future, forest and/or its AnchorSet may require disposal.
90
107
  }
91
108
  }
92
- exports.SharedTreeMutableChangeEnricher = SharedTreeMutableChangeEnricher;
109
+ exports.SharedTreeChangeEnricher = SharedTreeChangeEnricher;
93
110
  //# sourceMappingURL=sharedTreeChangeEnricher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sharedTreeChangeEnricher.js","sourceRoot":"","sources":["../../src/shared-tree/sharedTreeChangeEnricher.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAsE;AACtE,+CAW0B;AAC1B,4DAOuC;AACvC,+CA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MIT License.\n */\n\nimport { unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport {\n\tAnchorSet,\n\ttype DeltaDetachedNodeId,\n\ttype DetachedFieldIndex,\n\ttype IEditableForest,\n\ttype IForestSubscription,\n\ttype ReadOnlyDetachedFieldIndex,\n\ttype RevisionTag,\n\ttype TreeStoredSchemaRepository,\n\ttagChange,\n\tvisitDelta,\n} from \"../core/index.js\";\nimport {\n\ttype TreeChunk,\n\tchunkTree,\n\tdefaultChunkPolicy,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tupdateRefreshers as updateDataChangeRefreshers,\n} from \"../feature-libraries/index.js\";\nimport { disposeSymbol } from \"../util/index.js\";\nimport { updateRefreshers } from \"./sharedTreeChangeFamily.js\";\nimport type { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\nimport type {\n\tChangeEnricherMutableCheckout,\n\tChangeEnricherReadonlyCheckout,\n} from \"../shared-tree-core/index.js\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nexport class SharedTreeReadonlyChangeEnricher\n\timplements ChangeEnricherReadonlyCheckout<SharedTreeChange>\n{\n\t/**\n\t * @param borrowedForest - The state based on which to enrich changes.\n\t * Not owned by the constructed instance.\n\t * @param schema - The schema that corresponds to the forest.\n\t * @param borrowedRemovedRoots - The set of removed roots based on which to enrich changes.\n\t * Not owned by the constructed instance.\n\t * @param idCompressor - The id compressor to use when chunking trees.\n\t */\n\tpublic constructor(\n\t\tprotected readonly borrowedForest: IForestSubscription,\n\t\tprivate readonly schema: TreeStoredSchemaRepository,\n\t\tprotected readonly borrowedRemovedRoots: ReadOnlyDetachedFieldIndex,\n\t\tprivate readonly idCompressor?: IIdCompressor,\n\t) {}\n\n\tpublic fork(): ChangeEnricherMutableCheckout<SharedTreeChange> {\n\t\treturn new SharedTreeMutableChangeEnricher(\n\t\t\tthis.borrowedForest.clone(this.schema, new AnchorSet()),\n\t\t\tthis.schema,\n\t\t\tthis.borrowedRemovedRoots.clone(),\n\t\t);\n\t}\n\n\tpublic updateChangeEnrichments(change: SharedTreeChange): SharedTreeChange {\n\t\treturn updateRefreshers(\n\t\t\tchange,\n\t\t\tthis.getDetachedRoot,\n\t\t\trelevantRemovedRoots,\n\t\t\tupdateDataChangeRefreshers,\n\t\t);\n\t}\n\n\tprivate readonly getDetachedRoot = (id: DeltaDetachedNodeId): TreeChunk | undefined => {\n\t\tconst root = this.borrowedRemovedRoots.tryGetEntry(id);\n\t\tif (root !== undefined) {\n\t\t\tconst cursor = this.borrowedForest.getCursorAboveDetachedFields();\n\t\t\tconst parentField = this.borrowedRemovedRoots.toFieldKey(root);\n\t\t\tcursor.enterField(parentField);\n\t\t\tcursor.enterNode(0);\n\t\t\treturn chunkTree(cursor, {\n\t\t\t\tpolicy: defaultChunkPolicy,\n\t\t\t\tidCompressor: this.idCompressor,\n\t\t\t});\n\t\t}\n\t\treturn undefined;\n\t};\n}\n\nexport class SharedTreeMutableChangeEnricher\n\textends SharedTreeReadonlyChangeEnricher\n\timplements ChangeEnricherMutableCheckout<SharedTreeChange>\n{\n\t/**\n\t * @param forest - The state based on which to enrich changes.\n\t * Owned by the constructed instance.\n\t * @param schema - The schema that corresponds to the forest.\n\t * @param removedRoots - The set of removed roots based on which to enrich changes.\n\t * Owned by the constructed instance.\n\t * @param idCompressor - The id compressor to use when chunking trees.\n\t */\n\tpublic constructor(\n\t\tprivate readonly forest: IEditableForest,\n\t\tschema: TreeStoredSchemaRepository,\n\t\tprivate readonly removedRoots: DetachedFieldIndex,\n\t\tidCompressor?: IIdCompressor,\n\t) {\n\t\tsuper(forest, schema, removedRoots, idCompressor);\n\t}\n\n\tpublic applyTipChange(change: SharedTreeChange, revision?: RevisionTag): void {\n\t\tfor (const dataOrSchemaChange of change.changes) {\n\t\t\tconst type = dataOrSchemaChange.type;\n\t\t\tswitch (type) {\n\t\t\t\tcase \"data\": {\n\t\t\t\t\tconst delta = intoDelta(tagChange(dataOrSchemaChange.innerChange, revision));\n\t\t\t\t\tconst visitor = this.forest.acquireVisitor();\n\t\t\t\t\tvisitDelta(delta, visitor, this.removedRoots, revision);\n\t\t\t\t\tvisitor.free();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"schema\": {\n\t\t\t\t\t// This enricher doesn't need to maintain schema information.\n\t\t\t\t\t// Note that the refreshers being generated through `updateChangeEnrichments` will be encoded using\n\t\t\t\t\t// the schema that was used in the input context of the data changeset these refreshers are on.\n\t\t\t\t\t// See the encoding logic in SharedTreeCore for details.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tunreachableCase(type);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic [disposeSymbol](): void {\n\t\t// TODO: in the future, forest and/or its AnchorSet may require disposal.\n\t}\n}\n"]}
1
+ {"version":3,"file":"sharedTreeChangeEnricher.js","sourceRoot":"","sources":["../../src/shared-tree/sharedTreeChangeEnricher.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAsE;AAGtE,+CAW0B;AAC1B,4DAOuC;AACvC,+CAAiD;AAEjD,2EAA+D;AAa/D,MAAa,wBAAwB;IAQpC;;;;;;;;;;;OAWG;IACH,YACC,cAAmC,EACnC,oBAAgD,EAC/B,MAAkC,EAClC,YAA4B,EAC5B,cAA2B,EAC3B,gBAA6B,EAC7B,WAAwB,EACxB,aAA0B;QAL1B,WAAM,GAAN,MAAM,CAA4B;QAClC,iBAAY,GAAZ,YAAY,CAAgB;QAC5B,mBAAc,GAAd,cAAc,CAAa;QAC3B,qBAAgB,GAAhB,gBAAgB,CAAa;QAC7B,gBAAW,GAAX,WAAW,CAAa;QACxB,kBAAa,GAAb,aAAa,CAAa;QA3B5C;;WAEG;QACc,gBAAW,GAA6C,EAAE,CAAC;QA0B3E,IAAI,CAAC,QAAQ,GAAG;YACf,MAAM,EAAE,cAAc;YACtB,YAAY,EAAE,oBAAoB;SAClC,CAAC;IACH,CAAC;IAEM,MAAM,CAAC,MA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AAC,CAAC;oBACvB,CAAC;gBACF,CAAC;YACF,CAAC;QACF,CAAC;QACD,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7B,CAAC;IAEM,CAAC,wBAAa,CAAC;QACrB,yEAAyE;IAC1E,CAAC;CACD;AAjHD,4DAiHC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport {\n\tAnchorSet,\n\ttype DeltaDetachedNodeId,\n\ttype DetachedFieldIndex,\n\ttype IEditableForest,\n\ttype IForestSubscription,\n\ttype ReadOnlyDetachedFieldIndex,\n\ttype TaggedChange,\n\ttype TreeStoredSchemaRepository,\n\ttagChange,\n\tvisitDelta,\n} from \"../core/index.js\";\nimport {\n\ttype TreeChunk,\n\tchunkTree,\n\tdefaultChunkPolicy,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tupdateRefreshers as updateDataChangeRefreshers,\n} from \"../feature-libraries/index.js\";\nimport { disposeSymbol } from \"../util/index.js\";\n\nimport { updateRefreshers } from \"./sharedTreeChangeFamily.js\";\nimport type { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\n\ninterface BorrowedState {\n\treadonly forest: IForestSubscription;\n\treadonly removedRoots: ReadOnlyDetachedFieldIndex;\n}\n\ninterface OwnedState {\n\treadonly forest: IEditableForest;\n\treadonly removedRoots: DetachedFieldIndex;\n}\n\nexport class SharedTreeChangeEnricher {\n\t/**\n\t * Queue of changes to be applied before querying for detached roots.\n\t */\n\tprivate readonly changeQueue: (() => TaggedChange<SharedTreeChange>)[] = [];\n\tprotected readonly borrowed: BorrowedState;\n\tprotected owned?: OwnedState;\n\n\t/**\n\t * @param borrowedForest - The state based on which to enrich changes.\n\t * Not owned by the constructed instance.\n\t * @param schema - The schema that corresponds to the forest.\n\t * @param borrowedRemovedRoots - The set of removed roots based on which to enrich changes.\n\t * Not owned by the constructed instance.\n\t * @param idCompressor - The id compressor to use when chunking trees.\n\t * @param onEnrichCommit - Optional callback invoked whenever a commit is enriched.\n\t * @param onRefresherAdded - Optional callback invoked whenever a refresher is added during enrichment.\n\t * @param onForkState - Optional callback invoked whenever the enricher forks its state.\n\t * @param onApplyChange - Optional callback invoked whenever a change is applied to the owned state.\n\t */\n\tpublic constructor(\n\t\tborrowedForest: IForestSubscription,\n\t\tborrowedRemovedRoots: ReadOnlyDetachedFieldIndex,\n\t\tprivate readonly schema: TreeStoredSchemaRepository,\n\t\tprivate readonly idCompressor?: IIdCompressor,\n\t\tprivate readonly onEnrichCommit?: () => void,\n\t\tprivate readonly onRefresherAdded?: () => void,\n\t\tprivate readonly onForkState?: () => void,\n\t\tprivate readonly onApplyChange?: () => void,\n\t) {\n\t\tthis.borrowed = {\n\t\t\tforest: borrowedForest,\n\t\t\tremovedRoots: borrowedRemovedRoots,\n\t\t};\n\t}\n\n\tpublic enrich(change: SharedTreeChange): SharedTreeChange {\n\t\tthis.onEnrichCommit?.();\n\t\treturn updateRefreshers(\n\t\t\tchange,\n\t\t\t(id) => this.getDetachedRoot(id),\n\t\t\trelevantRemovedRoots,\n\t\t\tupdateDataChangeRefreshers,\n\t\t);\n\t}\n\n\tprivate getDetachedRoot(id: DeltaDetachedNodeId): TreeChunk | undefined {\n\t\tthis.purgeChangeQueue();\n\t\tconst state = this.owned ?? this.borrowed;\n\t\tconst root = state.removedRoots.tryGetEntry(id);\n\t\tif (root !== undefined) {\n\t\t\tconst cursor = state.forest.getCursorAboveDetachedFields();\n\t\t\tconst parentField = state.removedRoots.toFieldKey(root);\n\t\t\tcursor.enterField(parentField);\n\t\t\tcursor.enterNode(0);\n\t\t\tthis.onRefresherAdded?.();\n\t\t\treturn chunkTree(cursor, {\n\t\t\t\tpolicy: defaultChunkPolicy,\n\t\t\t\tidCompressor: this.idCompressor,\n\t\t\t});\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tpublic enqueueChange(\n\t\tchange: TaggedChange<SharedTreeChange> | (() => TaggedChange<SharedTreeChange>),\n\t): void {\n\t\tthis.changeQueue.push(typeof change === \"function\" ? change : () => change);\n\t}\n\n\tprivate purgeChangeQueue(): void {\n\t\tif (this.changeQueue.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tif (this.owned === undefined) {\n\t\t\tthis.onForkState?.();\n\t\t\tthis.owned = {\n\t\t\t\tforest: this.borrowed.forest.clone(this.schema, new AnchorSet()),\n\t\t\t\tremovedRoots: this.borrowed.removedRoots.clone(),\n\t\t\t};\n\t\t}\n\t\tfor (const getChange of this.changeQueue) {\n\t\t\tconst { change, revision } = getChange();\n\t\t\tthis.onApplyChange?.();\n\t\t\tfor (const dataOrSchemaChange of change.changes) {\n\t\t\t\tconst type = dataOrSchemaChange.type;\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase \"data\": {\n\t\t\t\t\t\tconst delta = intoDelta(tagChange(dataOrSchemaChange.innerChange, revision));\n\t\t\t\t\t\tconst visitor = this.owned.forest.acquireVisitor();\n\t\t\t\t\t\tvisitDelta(delta, visitor, this.owned.removedRoots, revision);\n\t\t\t\t\t\tvisitor.free();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"schema\": {\n\t\t\t\t\t\t// This enricher doesn't need to maintain schema information.\n\t\t\t\t\t\t// Note that the refreshers being generated through `updateChangeEnrichments` will be encoded using\n\t\t\t\t\t\t// the schema that was used in the input context of the data changeset these refreshers are on.\n\t\t\t\t\t\t// See the encoding logic in SharedTreeCore for details.\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tunreachableCase(type);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.changeQueue.length = 0;\n\t}\n\n\tpublic [disposeSymbol](): void {\n\t\t// TODO: in the future, forest and/or its AnchorSet may require disposal.\n\t}\n}\n"]}
@@ -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E,SAAS,qBAAqB,EAAO,GAClD,OAAO,GAAG,OAAO,QAAQ,CAoB3B"}
@@ -5,17 +5,17 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.runTransaction = exports.Tree = void 0;
8
- const internal_1 = require("@fluidframework/telemetry-utils/internal");
9
- const internal_2 = require("@fluidframework/core-utils/internal");
10
- const index_js_1 = require("../simple-tree/index.js");
8
+ const internal_1 = require("@fluidframework/core-utils/internal");
9
+ const internal_2 = require("@fluidframework/telemetry-utils/internal");
10
+ const index_js_1 = require("../feature-libraries/index.js");
11
+ const index_js_2 = require("../simple-tree/index.js");
11
12
  const schematizingTreeView_js_1 = require("./schematizingTreeView.js");
12
- const index_js_2 = require("../feature-libraries/index.js");
13
13
  /**
14
14
  * The {@link (Tree:interface)} singleton which holds various functions for interacting with {@link TreeNode}s.
15
15
  * @public
16
16
  */
17
17
  exports.Tree = {
18
- ...index_js_1.treeNodeApi,
18
+ ...index_js_2.treeNodeApi,
19
19
  // Note: the implementation details of `createRunTransaction` are deprecated.
20
20
  // We have introduced replacement `@alpha` APIs on `TreeBranch`, but until they are `@public`, we can't reasonably deprecated this.
21
21
  // Once they have been promoted to public, we can deprecate this API.
@@ -32,13 +32,13 @@ exports.Tree = {
32
32
  },
33
33
  };
34
34
  // TODO: Add more constraint types here
35
+ /** A type-safe helper to add a "rollback" property (as required by the `RunTransaction` interface) to a given object */
36
+ function defineRollbackProperty(target) {
37
+ Reflect.defineProperty(target, "rollback", { value: index_js_2.rollback });
38
+ return target;
39
+ }
35
40
  /** Creates a copy of `runTransaction` with the `rollback` property added so as to satisfy the `RunTransaction` interface. */
36
41
  function createRunTransaction() {
37
- /** A type-safe helper to add a "rollback" property (as required by the `RunTransaction` interface) to a given object */
38
- function defineRollbackProperty(target) {
39
- Reflect.defineProperty(target, "rollback", { value: index_js_1.rollback });
40
- return target;
41
- }
42
42
  return defineRollbackProperty(runTransaction.bind({}));
43
43
  }
44
44
  /**
@@ -55,11 +55,11 @@ function runTransaction(treeOrNode, transaction, preconditions = []) {
55
55
  else {
56
56
  const node = treeOrNode;
57
57
  const t = transaction;
58
- const context = (0, index_js_1.getInnerNode)(node).context;
58
+ const context = (0, index_js_2.getInnerNode)(node).context;
59
59
  if (context.isHydrated() === false) {
60
- throw new internal_1.UsageError("Transactions cannot be run on Unhydrated nodes. Transactions apply to a TreeView and Unhydrated nodes are not part of a TreeView.");
60
+ throw new internal_2.UsageError("Transactions cannot be run on Unhydrated nodes. Transactions apply to a TreeView and Unhydrated nodes are not part of a TreeView.");
61
61
  }
62
- (0, internal_2.assert)(context instanceof index_js_2.Context, 0xbe3 /* Expected context to be a Context instance. */);
62
+ (0, internal_1.assert)(context instanceof index_js_1.Context, 0xbe3 /* Expected context to be a Context instance. */);
63
63
  return runTransactionInCheckout(context.checkout, () => t(node), preconditions);
64
64
  }
65
65
  }
@@ -82,7 +82,7 @@ function runTransactionInCheckout(checkout, transaction, preconditions) {
82
82
  checkout.transaction.abort();
83
83
  throw error;
84
84
  }
85
- if (result === index_js_1.rollback) {
85
+ if (result === index_js_2.rollback) {
86
86
  checkout.transaction.abort();
87
87
  }
88
88
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"tree.js","sourceRoot":"","sources":["../../src/shared-tree/tree.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uEAAsE;AACtE,kEAA6D;AAE7D,sDASiC;AAEjC,uEAGmC;AAEnC,4DAAwD;AA+BxD;;;GAGG;AACU,QAAA,IAAI,GAAS;IACzB,GAAG,sBAAW;IAEd,6EAA6E;IAC7E,mIAAmI;IACnI,qEAAqE;IACrE,cAAc,EAAE,oBAAoB,EAAE;IAEtC,QAAQ,CAAC,MAAgB,EAAE,KAAe;QACzC,IAAI,OAAO,GAAyB,KAAK,CAAC;QAC1C,OAAO,OAAO,KAAK,SAAS,EAAE,CAAC;YAC9B,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;gBACxB,OAAO,IAAI,CAAC;YACb,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AC;IACjF,CAAC;AACF,CAAC;AA9BD,wCA8BC;AAED;;;GAGG;AACH,SAAS,wBAAwB,CAChC,QAAuB,EACvB,WAA4C,EAC5C,aAA+C;IAE/C,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IAC7B,IAAA,qDAA2B,EAAC,QAAQ,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;IAE5D,IAAI,MAAsC,CAAC;IAC3C,IAAI,CAAC;QACJ,MAAM,GAAG,WAAW,EAAE,CAAC;IACxB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,qHAAqH;QACrH,kGAAkG;QAClG,uJAAuJ;QACvJ,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QAC7B,MAAM,KAAK,CAAC;IACb,CAAC;IAED,IAAI,MAAM,KAAK,mBAAQ,EAAE,CAAC;QACzB,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IAC9B,CAAC;SAAM,CAAC;QACP,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;IAC/B,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ImplicitFieldSchema,\n\ttype TreeNode,\n\ttype TreeNodeApi,\n\ttype TreeView,\n\tgetInnerNode,\n\ttreeNodeApi,\n\trollback,\n\ttype TransactionConstraint,\n} from \"../simple-tree/index.js\";\n\nimport {\n\taddConstraintsToTransaction,\n\tSchematizingSimpleTreeView,\n} from \"./schematizingTreeView.js\";\nimport type { ITreeCheckout } from \"./treeCheckout.js\";\nimport { Context } from \"../feature-libraries/index.js\";\n\n/**\n * Provides various functions for interacting with {@link TreeNode}s.\n * @remarks\n * This type should only be used via the {@link (Tree:variable)} export.\n * @system @sealed @public\n */\nexport interface Tree extends TreeNodeApi {\n\t/**\n\t * Run a {@link RunTransaction | transaction}.\n\t */\n\treadonly runTransaction: RunTransaction;\n\t/**\n\t * Check if the subtree defined by `node` contains `other`.\n\t *\n\t * @returns true if `other` is an inclusive descendant of `node`, and false otherwise.\n\t * @remarks\n\t * This includes direct and indirect children:\n\t * as long as `node` is an ancestor of `other` (occurs in its parentage chain), this returns true, regardless of the number of levels of the tree between.\n\t *\n\t * `node` is considered to contain itself, so the case where `node === other` returns true.\n\t *\n\t * This is handy when checking if moving `node` into `other` would create a cycle and would thus be invalid.\n\t *\n\t * This check walks the parents of `other` looking for `node`,\n\t * and thus runs in time proportional to the depth of child in the tree.\n\t */\n\tcontains(node: TreeNode, other: TreeNode): boolean;\n}\n\n/**\n * The {@link (Tree:interface)} singleton which holds various functions for interacting with {@link TreeNode}s.\n * @public\n */\nexport const Tree: Tree = {\n\t...treeNodeApi,\n\n\t// Note: the implementation details of `createRunTransaction` are deprecated.\n\t// We have introduced replacement `@alpha` APIs on `TreeBranch`, but until they are `@public`, we can't reasonably deprecated this.\n\t// Once they have been promoted to public, we can deprecate this API.\n\trunTransaction: createRunTransaction(),\n\n\tcontains(parent: TreeNode, child: TreeNode): boolean {\n\t\tlet toCheck: TreeNode | undefined = child;\n\t\twhile (toCheck !== undefined) {\n\t\t\tif (toCheck === parent) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\ttoCheck = Tree.parent(toCheck);\n\t\t}\n\t\treturn false;\n\t},\n};\n\n/**\n * A function which runs a transaction in a SharedTree.\n * @privateRemarks\n * This interface exists so that the (generously) overloaded `Tree.runTransaction` function can have the \"rollback\" property hanging off of it.\n * The rollback property being available on the function itself gives users a convenient option for rolling back a transaction without having to import another symbol.\n * @sealed @public\n */\nexport interface RunTransaction {\n\t/**\n\t * The {@link rollback} object used to roll back a transaction.\n\t */\n\treadonly rollback: typeof rollback;\n\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode, TResult>(\n\t\tnode: TNode,\n\t\ttransaction: (node: TNode) => TResult,\n\t): TResult;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t// TODO: TreeView is invariant over the schema, so to accept any view, `any` is the only real option unless a non generic (or covariant) base type for view is introduced (which is planned).\n\t// This use of any is actually type safe as it is only used as a constraint, and the actual strongly typed view (TView) is passed to the callback.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t<TView extends TreeView<any>, TResult>(\n\t\ttree: TView,\n\t\ttransaction: (root: TView[\"root\"]) => TResult,\n\t): TResult;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * At any point during the transaction, the function may return the special {@link RunTransaction.rollback | rollback value} (`Tree.runTransaction.rollback`) to abort the transaction and discard any changes it made so far.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back (whether by an error or by returning the {@link RunTransaction.rollback} | rollback value), a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode, TResult>(\n\t\tnode: TNode,\n\t\ttransaction: (node: TNode) => TResult | typeof rollback,\n\t): TResult | typeof rollback;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * At any point during the transaction, the function may return the special {@link RunTransaction.rollback | rollback value} (`Tree.runTransaction.rollback`) to abort the transaction and discard any changes it made so far.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back (whether by an error or by returning the {@link RunTransaction.rollback} | rollback value), a corresponding change event will also be emitted for the rollback.\n\t */\n\t// See comment on previous overload about use of any here.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t<TView extends TreeView<any>, TResult>(\n\t\ttree: TView,\n\t\ttransaction: (root: TView[\"root\"]) => TResult | typeof rollback,\n\t): TResult | typeof rollback;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode>(node: TNode, transaction: (node: TNode) => void): void;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t// See comment on previous overload about use of any here.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t<TView extends TreeView<any>>(tree: TView, transaction: (root: TView[\"root\"]) => void): void;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode, TResult>(\n\t\tnode: TNode,\n\t\ttransaction: (node: TNode) => TResult,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): TResult;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t// See comment on previous overload about use of any here.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t<TView extends TreeView<any>, TResult>(\n\t\ttree: TView,\n\t\ttransaction: (root: TView[\"root\"]) => TResult,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): TResult;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * At any point during the transaction, the function may return the special {@link RunTransaction.rollback | rollback value} (`Tree.runTransaction.rollback`) to abort the transaction and discard any changes it made so far.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back (whether by an error or by returning the {@link RunTransaction.rollback} | rollback value), a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode, TResult>(\n\t\tnode: TNode,\n\t\ttransaction: (node: TNode) => TResult | typeof rollback,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): TResult | typeof rollback;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * At any point during the transaction, the function may return the special {@link RunTransaction.rollback | rollback value} (`Tree.runTransaction.rollback`) to abort the transaction and discard any changes it made so far.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back (whether by an error or by returning the {@link RunTransaction.rollback} | rollback value), a corresponding change event will also be emitted for the rollback.\n\t */\n\t// See comment on previous overload about use of any here.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t<TView extends TreeView<any>, TResult>(\n\t\ttree: TView,\n\t\ttransaction: (root: TView[\"root\"]) => TResult | typeof rollback,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): TResult | typeof rollback;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode>(\n\t\tnode: TNode,\n\t\ttransaction: (node: TNode) => void,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): void;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t// See comment on previous overload about use of any here.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t<TView extends TreeView<any>>(\n\t\ttree: TView,\n\t\ttransaction: (root: TView[\"root\"]) => void,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): void;\n}\n\n// TODO: Add more constraint types here\n\n/** Creates a copy of `runTransaction` with the `rollback` property added so as to satisfy the `RunTransaction` interface. */\nfunction createRunTransaction(): RunTransaction {\n\t/** A type-safe helper to add a \"rollback\" property (as required by the `RunTransaction` interface) to a given object */\n\tfunction defineRollbackProperty<T extends object>(\n\t\ttarget: T,\n\t): T & { rollback: typeof rollback } {\n\t\tReflect.defineProperty(target, \"rollback\", { value: rollback });\n\t\treturn target as T & { readonly rollback: typeof rollback };\n\t}\n\n\treturn defineRollbackProperty(runTransaction.bind({}));\n}\n\n/**\n * Run the given transaction.\n * @remarks\n * This API is not publicly exported but is exported outside of this module so that test code may unit test the `Tree.runTransaction` function directly without being restricted to its public API overloads.\n * @deprecated This API catches exceptions then tries to modify the tree before rethrowing: this is not robust. Use {@link TreeViewAlpha.runTransaction} instead which does not try to edit content in the error case.\n */\nexport function runTransaction<\n\tTNode extends TreeNode,\n\tTRoot extends ImplicitFieldSchema,\n\tTResult,\n>(\n\ttreeOrNode: TNode | TreeView<TRoot>,\n\ttransaction:\n\t\t| ((node: TNode) => TResult | typeof rollback)\n\t\t| ((root: TRoot) => TResult | typeof rollback),\n\tpreconditions: readonly TransactionConstraint[] = [],\n): TResult | typeof rollback {\n\tif (treeOrNode instanceof SchematizingSimpleTreeView) {\n\t\tconst t = transaction as (root: TRoot) => TResult | typeof rollback;\n\t\treturn runTransactionInCheckout(\n\t\t\ttreeOrNode.checkout,\n\t\t\t() => t(treeOrNode.root as TRoot),\n\t\t\tpreconditions,\n\t\t);\n\t} else {\n\t\tconst node = treeOrNode as TNode;\n\t\tconst t = transaction as (node: TNode) => TResult | typeof rollback;\n\t\tconst context = getInnerNode(node).context;\n\t\tif (context.isHydrated() === false) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"Transactions cannot be run on Unhydrated nodes. Transactions apply to a TreeView and Unhydrated nodes are not part of a TreeView.\",\n\t\t\t);\n\t\t}\n\t\tassert(context instanceof Context, 0xbe3 /* Expected context to be a Context instance. */);\n\t\treturn runTransactionInCheckout(context.checkout, () => t(node), preconditions);\n\t}\n}\n\n/**\n * Run the given transaction.\n * @deprecated This API catches exceptions then tries to modify the tree before rethrowing: this is not robust. Use {@link TreeViewAlpha.runTransaction} instead which does not try to editing content in the error case.\n */\nfunction runTransactionInCheckout<TResult>(\n\tcheckout: ITreeCheckout,\n\ttransaction: () => TResult | typeof rollback,\n\tpreconditions: readonly TransactionConstraint[],\n): TResult | typeof rollback {\n\tcheckout.transaction.start();\n\taddConstraintsToTransaction(checkout, false, preconditions);\n\n\tlet result: ReturnType<typeof transaction>;\n\ttry {\n\t\tresult = transaction();\n\t} catch (error) {\n\t\t// If the transaction has an unhandled error, abort and rollback the transaction but continue to propagate the error.\n\t\t// This might try and modify the tree or trigger events while things are in an inconsistent state.\n\t\t// It is up to the user of runTransaction to ensure that does not cause problems (and they have no robust way to do that, which is why its deprecated).\n\t\tcheckout.transaction.abort();\n\t\tthrow error;\n\t}\n\n\tif (result === rollback) {\n\t\tcheckout.transaction.abort();\n\t} else {\n\t\tcheckout.transaction.commit();\n\t}\n\n\treturn result;\n}\n"]}
1
+ {"version":3,"file":"tree.js","sourceRoot":"","sources":["../../src/shared-tree/tree.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAC7D,uEAAsE;AAEtE,4DAAwD;AACxD,sDASiC;AAEjC,uEAGmC;AAgCnC;;;GAGG;AACU,QAAA,IAAI,GAAS;IACzB,GAAG,sBAAW;IAEd,6EAA6E;IAC7E,mIAAmI;IACnI,qEAAqE;IACrE,cAAc,EAAE,oBAAoB,EAAE;IAEtC,QAAQ,CAAC,MAAgB,EAAE,KAAe;QACzC,IAAI,OAAO,GAAyB,KAAK,CAAC;QAC1C,OAAO,OAAO,KAAK,SAAS,EAAE,CAAC;YAC9B,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;gBACxB,OAAO,IAAI,CAAC;YACb,CAAC;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jF,CAAC;AACF,CAAC;AA9BD,wCA8BC;AAED;;;GAGG;AACH,SAAS,wBAAwB,CAChC,QAAuB,EACvB,WAA4C,EAC5C,aAA+C;IAE/C,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IAC7B,IAAA,qDAA2B,EAAC,QAAQ,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;IAE5D,IAAI,MAAsC,CAAC;IAC3C,IAAI,CAAC;QACJ,MAAM,GAAG,WAAW,EAAE,CAAC;IACxB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,qHAAqH;QACrH,kGAAkG;QAClG,uJAAuJ;QACvJ,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QAC7B,MAAM,KAAK,CAAC;IACb,CAAC;IAED,IAAI,MAAM,KAAK,mBAAQ,EAAE,CAAC;QACzB,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IAC9B,CAAC;SAAM,CAAC;QACP,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;IAC/B,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { Context } from \"../feature-libraries/index.js\";\nimport {\n\ttype ImplicitFieldSchema,\n\ttype TreeNode,\n\ttype TreeNodeApi,\n\ttype TreeView,\n\tgetInnerNode,\n\ttreeNodeApi,\n\trollback,\n\ttype TransactionConstraint,\n} from \"../simple-tree/index.js\";\n\nimport {\n\taddConstraintsToTransaction,\n\tSchematizingSimpleTreeView,\n} from \"./schematizingTreeView.js\";\nimport type { ITreeCheckout } from \"./treeCheckout.js\";\n\n/**\n * Provides various functions for interacting with {@link TreeNode}s.\n * @remarks\n * This type should only be used via the {@link (Tree:variable)} export.\n * @system @sealed @public\n */\nexport interface Tree extends TreeNodeApi {\n\t/**\n\t * Run a {@link RunTransaction | transaction}.\n\t */\n\treadonly runTransaction: RunTransaction;\n\t/**\n\t * Check if the subtree defined by `node` contains `other`.\n\t *\n\t * @returns true if `other` is an inclusive descendant of `node`, and false otherwise.\n\t * @remarks\n\t * This includes direct and indirect children:\n\t * as long as `node` is an ancestor of `other` (occurs in its parentage chain), this returns true, regardless of the number of levels of the tree between.\n\t *\n\t * `node` is considered to contain itself, so the case where `node === other` returns true.\n\t *\n\t * This is handy when checking if moving `node` into `other` would create a cycle and would thus be invalid.\n\t *\n\t * This check walks the parents of `other` looking for `node`,\n\t * and thus runs in time proportional to the depth of child in the tree.\n\t */\n\tcontains(node: TreeNode, other: TreeNode): boolean;\n}\n\n/**\n * The {@link (Tree:interface)} singleton which holds various functions for interacting with {@link TreeNode}s.\n * @public\n */\nexport const Tree: Tree = {\n\t...treeNodeApi,\n\n\t// Note: the implementation details of `createRunTransaction` are deprecated.\n\t// We have introduced replacement `@alpha` APIs on `TreeBranch`, but until they are `@public`, we can't reasonably deprecated this.\n\t// Once they have been promoted to public, we can deprecate this API.\n\trunTransaction: createRunTransaction(),\n\n\tcontains(parent: TreeNode, child: TreeNode): boolean {\n\t\tlet toCheck: TreeNode | undefined = child;\n\t\twhile (toCheck !== undefined) {\n\t\t\tif (toCheck === parent) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\ttoCheck = Tree.parent(toCheck);\n\t\t}\n\t\treturn false;\n\t},\n};\n\n/**\n * A function which runs a transaction in a SharedTree.\n * @privateRemarks\n * This interface exists so that the (generously) overloaded `Tree.runTransaction` function can have the \"rollback\" property hanging off of it.\n * The rollback property being available on the function itself gives users a convenient option for rolling back a transaction without having to import another symbol.\n * @sealed @public\n */\nexport interface RunTransaction {\n\t/**\n\t * The {@link rollback} object used to roll back a transaction.\n\t */\n\treadonly rollback: typeof rollback;\n\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode, TResult>(\n\t\tnode: TNode,\n\t\ttransaction: (node: TNode) => TResult,\n\t): TResult;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t// TODO: TreeView is invariant over the schema, so to accept any view, `any` is the only real option unless a non generic (or covariant) base type for view is introduced (which is planned).\n\t// This use of any is actually type safe as it is only used as a constraint, and the actual strongly typed view (TView) is passed to the callback.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t<TView extends TreeView<any>, TResult>(\n\t\ttree: TView,\n\t\ttransaction: (root: TView[\"root\"]) => TResult,\n\t): TResult;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * At any point during the transaction, the function may return the special {@link RunTransaction.rollback | rollback value} (`Tree.runTransaction.rollback`) to abort the transaction and discard any changes it made so far.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back (whether by an error or by returning the {@link RunTransaction.rollback} | rollback value), a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode, TResult>(\n\t\tnode: TNode,\n\t\ttransaction: (node: TNode) => TResult | typeof rollback,\n\t): TResult | typeof rollback;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * At any point during the transaction, the function may return the special {@link RunTransaction.rollback | rollback value} (`Tree.runTransaction.rollback`) to abort the transaction and discard any changes it made so far.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back (whether by an error or by returning the {@link RunTransaction.rollback} | rollback value), a corresponding change event will also be emitted for the rollback.\n\t */\n\t// See comment on previous overload about use of any here.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t<TView extends TreeView<any>, TResult>(\n\t\ttree: TView,\n\t\ttransaction: (root: TView[\"root\"]) => TResult | typeof rollback,\n\t): TResult | typeof rollback;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode>(node: TNode, transaction: (node: TNode) => void): void;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t// See comment on previous overload about use of any here.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t<TView extends TreeView<any>>(tree: TView, transaction: (root: TView[\"root\"]) => void): void;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode, TResult>(\n\t\tnode: TNode,\n\t\ttransaction: (node: TNode) => TResult,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): TResult;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t// See comment on previous overload about use of any here.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t<TView extends TreeView<any>, TResult>(\n\t\ttree: TView,\n\t\ttransaction: (root: TView[\"root\"]) => TResult,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): TResult;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * At any point during the transaction, the function may return the special {@link RunTransaction.rollback | rollback value} (`Tree.runTransaction.rollback`) to abort the transaction and discard any changes it made so far.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back (whether by an error or by returning the {@link RunTransaction.rollback} | rollback value), a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode, TResult>(\n\t\tnode: TNode,\n\t\ttransaction: (node: TNode) => TResult | typeof rollback,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): TResult | typeof rollback;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * At any point during the transaction, the function may return the special {@link RunTransaction.rollback | rollback value} (`Tree.runTransaction.rollback`) to abort the transaction and discard any changes it made so far.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @returns The value returned by the inner `transaction` function.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back (whether by an error or by returning the {@link RunTransaction.rollback} | rollback value), a corresponding change event will also be emitted for the rollback.\n\t */\n\t// See comment on previous overload about use of any here.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t<TView extends TreeView<any>, TResult>(\n\t\ttree: TView,\n\t\ttransaction: (root: TView[\"root\"]) => TResult | typeof rollback,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): TResult | typeof rollback;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param node - The node that will be passed to `transaction`.\n\t * This is typically the root node of the subtree that will be modified by the transaction.\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the provided `node`.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t<TNode extends TreeNode>(\n\t\tnode: TNode,\n\t\ttransaction: (node: TNode) => void,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): void;\n\t/**\n\t * Apply one or more edits to the tree as a single atomic unit.\n\t * @param tree - The tree which will be edited by the transaction\n\t * @param transaction - The function to run as the body of the transaction.\n\t * This function is passed the root of the tree.\n\t * @param preconditions - An optional list of {@link TransactionConstraint | constraints} that are checked just before the transaction begins.\n\t * If any of the constraints are not met when `runTransaction` is called, it will throw an error.\n\t * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.\n\t * @remarks\n\t * All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.\n\t * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.\n\t * However, using a transaction has the following additional consequences:\n\t *\n\t * - If reverted (e.g. via an \"undo\" operation), all the changes in the transaction are reverted together.\n\t *\n\t * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.\n\t *\n\t * Local change events will be emitted for each change as the transaction is being applied.\n\t * If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.\n\t * If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.\n\t */\n\t// See comment on previous overload about use of any here.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t<TView extends TreeView<any>>(\n\t\ttree: TView,\n\t\ttransaction: (root: TView[\"root\"]) => void,\n\t\tpreconditions?: readonly TransactionConstraint[],\n\t): void;\n}\n\n// TODO: Add more constraint types here\n\n/** A type-safe helper to add a \"rollback\" property (as required by the `RunTransaction` interface) to a given object */\nfunction defineRollbackProperty<T extends object>(\n\ttarget: T,\n): T & { rollback: typeof rollback } {\n\tReflect.defineProperty(target, \"rollback\", { value: rollback });\n\treturn target as T & { readonly rollback: typeof rollback };\n}\n\n/** Creates a copy of `runTransaction` with the `rollback` property added so as to satisfy the `RunTransaction` interface. */\nfunction createRunTransaction(): RunTransaction {\n\treturn defineRollbackProperty(runTransaction.bind({}));\n}\n\n/**\n * Run the given transaction.\n * @remarks\n * This API is not publicly exported but is exported outside of this module so that test code may unit test the `Tree.runTransaction` function directly without being restricted to its public API overloads.\n * @deprecated This API catches exceptions then tries to modify the tree before rethrowing: this is not robust. Use {@link TreeViewAlpha.runTransaction} instead which does not try to edit content in the error case.\n */\nexport function runTransaction<\n\tTNode extends TreeNode,\n\tTRoot extends ImplicitFieldSchema,\n\tTResult,\n>(\n\ttreeOrNode: TNode | TreeView<TRoot>,\n\ttransaction:\n\t\t| ((node: TNode) => TResult | typeof rollback)\n\t\t| ((root: TRoot) => TResult | typeof rollback),\n\tpreconditions: readonly TransactionConstraint[] = [],\n): TResult | typeof rollback {\n\tif (treeOrNode instanceof SchematizingSimpleTreeView) {\n\t\tconst t = transaction as (root: TRoot) => TResult | typeof rollback;\n\t\treturn runTransactionInCheckout(\n\t\t\ttreeOrNode.checkout,\n\t\t\t() => t(treeOrNode.root as TRoot),\n\t\t\tpreconditions,\n\t\t);\n\t} else {\n\t\tconst node = treeOrNode as TNode;\n\t\tconst t = transaction as (node: TNode) => TResult | typeof rollback;\n\t\tconst context = getInnerNode(node).context;\n\t\tif (context.isHydrated() === false) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"Transactions cannot be run on Unhydrated nodes. Transactions apply to a TreeView and Unhydrated nodes are not part of a TreeView.\",\n\t\t\t);\n\t\t}\n\t\tassert(context instanceof Context, 0xbe3 /* Expected context to be a Context instance. */);\n\t\treturn runTransactionInCheckout(context.checkout, () => t(node), preconditions);\n\t}\n}\n\n/**\n * Run the given transaction.\n * @deprecated This API catches exceptions then tries to modify the tree before rethrowing: this is not robust. Use {@link TreeViewAlpha.runTransaction} instead which does not try to editing content in the error case.\n */\nfunction runTransactionInCheckout<TResult>(\n\tcheckout: ITreeCheckout,\n\ttransaction: () => TResult | typeof rollback,\n\tpreconditions: readonly TransactionConstraint[],\n): TResult | typeof rollback {\n\tcheckout.transaction.start();\n\taddConstraintsToTransaction(checkout, false, preconditions);\n\n\tlet result: ReturnType<typeof transaction>;\n\ttry {\n\t\tresult = transaction();\n\t} catch (error) {\n\t\t// If the transaction has an unhandled error, abort and rollback the transaction but continue to propagate the error.\n\t\t// This might try and modify the tree or trigger events while things are in an inconsistent state.\n\t\t// It is up to the user of runTransaction to ensure that does not cause problems (and they have no robust way to do that, which is why its deprecated).\n\t\tcheckout.transaction.abort();\n\t\tthrow error;\n\t}\n\n\tif (result === rollback) {\n\t\tcheckout.transaction.abort();\n\t} else {\n\t\tcheckout.transaction.commit();\n\t}\n\n\treturn result;\n}\n"]}
@@ -4,9 +4,9 @@
4
4
  */
5
5
  import type { IFluidHandle } from "@fluidframework/core-interfaces";
6
6
  import type { IIdCompressor } from "@fluidframework/id-compressor";
7
+ import { type ICodecOptions, type CodecWriteOptions } from "../codec/index.js";
7
8
  import { TreeNode, type Unhydrated, type ImplicitFieldSchema, type InsertableField, type TreeFieldFromImplicitField, type TreeLeafValue, type UnsafeUnknownSchema, type TreeEncodingOptions, type VerboseTree, type TreeBranch, type TreeParsingOptions, type ConciseTree, type TreeNodeSchema, type TreeBranchAlpha } from "../simple-tree/index.js";
8
9
  import { type JsonCompatible } from "../util/index.js";
9
- import { type ICodecOptions, type CodecWriteOptions } from "../codec/index.js";
10
10
  /**
11
11
  * A utility interface for manipulating node identifiers.
12
12
  * @remarks
@@ -1 +1 @@
1
- {"version":3,"file":"treeAlpha.d.ts","sourceR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