@fluidframework/tree 2.113.1 → 2.115.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 (660) hide show
  1. package/CHANGELOG.md +289 -0
  2. package/api-report/tree.alpha.api.md +127 -39
  3. package/dist/core/change-family/changeFamily.d.ts +15 -4
  4. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  5. package/dist/core/change-family/changeFamily.js.map +1 -1
  6. package/dist/core/change-family/editBuilder.d.ts +2 -3
  7. package/dist/core/change-family/editBuilder.d.ts.map +1 -1
  8. package/dist/core/change-family/editBuilder.js +1 -2
  9. package/dist/core/change-family/editBuilder.js.map +1 -1
  10. package/dist/core/change-family/index.d.ts +1 -1
  11. package/dist/core/change-family/index.d.ts.map +1 -1
  12. package/dist/core/change-family/index.js.map +1 -1
  13. package/dist/core/index.d.ts +4 -3
  14. package/dist/core/index.d.ts.map +1 -1
  15. package/dist/core/index.js +3 -2
  16. package/dist/core/index.js.map +1 -1
  17. package/dist/core/rebase/index.d.ts +1 -1
  18. package/dist/core/rebase/index.d.ts.map +1 -1
  19. package/dist/core/rebase/index.js +2 -1
  20. package/dist/core/rebase/index.js.map +1 -1
  21. package/dist/core/rebase/types.d.ts +110 -0
  22. package/dist/core/rebase/types.d.ts.map +1 -1
  23. package/dist/core/rebase/types.js +47 -1
  24. package/dist/core/rebase/types.js.map +1 -1
  25. package/dist/core/tree/delta.d.ts +62 -16
  26. package/dist/core/tree/delta.d.ts.map +1 -1
  27. package/dist/core/tree/delta.js.map +1 -1
  28. package/dist/core/tree/detachedFieldIndex.d.ts +7 -13
  29. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  30. package/dist/core/tree/detachedFieldIndex.js +32 -46
  31. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  32. package/dist/core/tree/index.d.ts +1 -0
  33. package/dist/core/tree/index.d.ts.map +1 -1
  34. package/dist/core/tree/index.js.map +1 -1
  35. package/dist/core/tree/visitorUtils.d.ts +2 -4
  36. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  37. package/dist/core/tree/visitorUtils.js +2 -2
  38. package/dist/core/tree/visitorUtils.js.map +1 -1
  39. package/dist/entrypoints/alpha.d.ts +1 -1
  40. package/dist/entrypoints/alpha.d.ts.map +1 -1
  41. package/dist/entrypoints/alpha.js +8 -3
  42. package/dist/entrypoints/alpha.js.map +1 -1
  43. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +9 -6
  44. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  45. package/dist/feature-libraries/chunked-forest/codec/codecs.js +16 -13
  46. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  47. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  48. package/dist/feature-libraries/chunked-forest/uniformChunk.js +10 -2
  49. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  50. package/dist/feature-libraries/comparison-forest/comparisonForest.d.ts +51 -0
  51. package/dist/feature-libraries/comparison-forest/comparisonForest.d.ts.map +1 -0
  52. package/dist/feature-libraries/comparison-forest/comparisonForest.js +98 -0
  53. package/dist/feature-libraries/comparison-forest/comparisonForest.js.map +1 -0
  54. package/dist/feature-libraries/comparison-forest/index.d.ts +6 -0
  55. package/dist/feature-libraries/comparison-forest/index.d.ts.map +1 -0
  56. package/dist/feature-libraries/comparison-forest/index.js +10 -0
  57. package/dist/feature-libraries/comparison-forest/index.js.map +1 -0
  58. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +8 -6
  59. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  60. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
  61. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  62. package/dist/feature-libraries/default-schema/index.d.ts +1 -1
  63. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  64. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  65. package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
  66. package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
  67. package/dist/feature-libraries/default-schema/noChangeCodecs.js +3 -1
  68. package/dist/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
  69. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +6 -3
  70. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  71. package/dist/feature-libraries/detachedFieldIndexSummarizer.js +18 -6
  72. package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  73. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -3
  74. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  75. package/dist/feature-libraries/forest-summary/forestSummarizer.js +2 -3
  76. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  77. package/dist/feature-libraries/index.d.ts +4 -3
  78. package/dist/feature-libraries/index.d.ts.map +1 -1
  79. package/dist/feature-libraries/index.js +77 -72
  80. package/dist/feature-libraries/index.js.map +1 -1
  81. package/dist/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
  82. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  83. package/dist/feature-libraries/mitigatedChangeFamily.js +12 -0
  84. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  85. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +9 -1
  86. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  87. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  88. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
  89. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  90. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  91. package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
  92. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  93. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  94. package/dist/feature-libraries/modular-schema/invert.d.ts +15 -0
  95. package/dist/feature-libraries/modular-schema/invert.d.ts.map +1 -0
  96. package/dist/feature-libraries/modular-schema/invert.js +159 -0
  97. package/dist/feature-libraries/modular-schema/invert.js.map +1 -0
  98. package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts +3 -4
  99. package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
  100. package/dist/feature-libraries/modular-schema/minimizeModularChange.js +2 -2
  101. package/dist/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
  102. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +9 -9
  103. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  104. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +0 -2
  105. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  106. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +2 -2
  107. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  108. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  109. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  110. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  111. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  112. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -22
  113. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  114. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +53 -406
  115. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  116. package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts +61 -0
  117. package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -0
  118. package/dist/feature-libraries/modular-schema/modularChangeUtils.js +205 -0
  119. package/dist/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -0
  120. package/dist/feature-libraries/modular-schema/prune.d.ts +10 -0
  121. package/dist/feature-libraries/modular-schema/prune.d.ts.map +1 -0
  122. package/dist/feature-libraries/modular-schema/prune.js +49 -0
  123. package/dist/feature-libraries/modular-schema/prune.js.map +1 -0
  124. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +2 -2
  125. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  126. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  127. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
  128. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  129. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  130. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
  131. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  132. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  133. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +2 -2
  134. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  135. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  136. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +2 -2
  137. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  138. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  139. package/dist/feature-libraries/treeTextCursor.d.ts +15 -0
  140. package/dist/feature-libraries/treeTextCursor.d.ts.map +1 -1
  141. package/dist/feature-libraries/treeTextCursor.js +64 -1
  142. package/dist/feature-libraries/treeTextCursor.js.map +1 -1
  143. package/dist/index.d.ts +6 -4
  144. package/dist/index.d.ts.map +1 -1
  145. package/dist/index.js +10 -5
  146. package/dist/index.js.map +1 -1
  147. package/dist/packageVersion.d.ts +1 -1
  148. package/dist/packageVersion.js +1 -1
  149. package/dist/packageVersion.js.map +1 -1
  150. package/dist/shared-tree/serializedChange.d.ts +2 -2
  151. package/dist/shared-tree/serializedChange.d.ts.map +1 -1
  152. package/dist/shared-tree/serializedChange.js.map +1 -1
  153. package/dist/shared-tree/sharedTree.d.ts +11 -3
  154. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  155. package/dist/shared-tree/sharedTree.js +9 -7
  156. package/dist/shared-tree/sharedTree.js.map +1 -1
  157. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +2 -2
  158. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  159. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  160. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +41 -4
  161. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  162. package/dist/shared-tree/sharedTreeChangeFamily.js +57 -1
  163. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  164. package/dist/shared-tree/transactionMinimize.d.ts.map +1 -1
  165. package/dist/shared-tree/transactionMinimize.js +2 -2
  166. package/dist/shared-tree/transactionMinimize.js.map +1 -1
  167. package/dist/shared-tree/transactionPostProcessor.d.ts +2 -1
  168. package/dist/shared-tree/transactionPostProcessor.d.ts.map +1 -1
  169. package/dist/shared-tree/transactionPostProcessor.js.map +1 -1
  170. package/dist/shared-tree/treeCheckout.d.ts +13 -7
  171. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  172. package/dist/shared-tree/treeCheckout.js +59 -13
  173. package/dist/shared-tree/treeCheckout.js.map +1 -1
  174. package/dist/shared-tree-core/branch.d.ts +24 -9
  175. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  176. package/dist/shared-tree-core/branch.js +7 -0
  177. package/dist/shared-tree-core/branch.js.map +1 -1
  178. package/dist/shared-tree-core/editManager.d.ts +4 -4
  179. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  180. package/dist/shared-tree-core/editManager.js +2 -0
  181. package/dist/shared-tree-core/editManager.js.map +1 -1
  182. package/dist/shared-tree-core/editManagerCodecs.d.ts +3 -14
  183. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  184. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  185. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +11 -1
  186. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  187. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  188. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +4 -11
  189. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  190. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  191. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +4 -11
  192. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  193. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  194. package/dist/shared-tree-core/editManagerSummarizer.d.ts +4 -4
  195. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  196. package/dist/shared-tree-core/editManagerSummarizer.js +0 -1
  197. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  198. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
  199. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  200. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  201. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  202. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  203. package/dist/shared-tree-core/messageCodecs.d.ts +8 -1
  204. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  205. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  206. package/dist/shared-tree-core/sharedTreeCore.d.ts +5 -5
  207. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  208. package/dist/shared-tree-core/sharedTreeCore.js +1 -1
  209. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  210. package/dist/shared-tree-core/transaction.d.ts +10 -10
  211. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  212. package/dist/shared-tree-core/transaction.js +6 -3
  213. package/dist/shared-tree-core/transaction.js.map +1 -1
  214. package/dist/simple-tree/api/eraseSchemaDetails.d.ts +15 -0
  215. package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  216. package/dist/simple-tree/api/eraseSchemaDetails.js +15 -0
  217. package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  218. package/dist/simple-tree/api/index.d.ts +1 -1
  219. package/dist/simple-tree/api/index.d.ts.map +1 -1
  220. package/dist/simple-tree/api/index.js +2 -3
  221. package/dist/simple-tree/api/index.js.map +1 -1
  222. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +3 -3
  223. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  224. package/dist/simple-tree/api/schemaStatics.d.ts +6 -7
  225. package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
  226. package/dist/simple-tree/api/schemaStatics.js.map +1 -1
  227. package/dist/simple-tree/api/treeNodeApi.d.ts +20 -24
  228. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  229. package/dist/simple-tree/api/treeNodeApi.js +48 -49
  230. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  231. package/dist/simple-tree/core/treeNode.d.ts +5 -6
  232. package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
  233. package/dist/simple-tree/core/treeNode.js +2 -4
  234. package/dist/simple-tree/core/treeNode.js.map +1 -1
  235. package/dist/simple-tree/core/withType.d.ts +20 -7
  236. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  237. package/dist/simple-tree/core/withType.js +4 -7
  238. package/dist/simple-tree/core/withType.js.map +1 -1
  239. package/dist/simple-tree/index.d.ts +2 -2
  240. package/dist/simple-tree/index.d.ts.map +1 -1
  241. package/dist/simple-tree/index.js +3 -4
  242. package/dist/simple-tree/index.js.map +1 -1
  243. package/dist/simple-tree/leafNodeSchema.d.ts +6 -1
  244. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  245. package/dist/simple-tree/leafNodeSchema.js +0 -1
  246. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  247. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +53 -5
  248. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  249. package/dist/simple-tree/node-kinds/array/arrayNode.js +91 -10
  250. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  251. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +90 -0
  252. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  253. package/dist/simple-tree/node-kinds/map/mapNode.js +26 -1
  254. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  255. package/dist/simple-tree/node-kinds/object/objectNode.js +2 -2
  256. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  257. package/dist/simple-tree/node-kinds/record/recordNode.js +2 -2
  258. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  259. package/dist/text/codePointUtils.d.ts +2 -2
  260. package/dist/text/codePointUtils.js +2 -2
  261. package/dist/text/codePointUtils.js.map +1 -1
  262. package/dist/text/index.d.ts +3 -3
  263. package/dist/text/index.d.ts.map +1 -1
  264. package/dist/text/index.js +4 -4
  265. package/dist/text/index.js.map +1 -1
  266. package/dist/text/textDomain.d.ts +30 -18
  267. package/dist/text/textDomain.d.ts.map +1 -1
  268. package/dist/text/textDomain.js +44 -23
  269. package/dist/text/textDomain.js.map +1 -1
  270. package/dist/text/textDomainFormatted.d.ts +180 -82
  271. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  272. package/dist/text/textDomainFormatted.js +164 -84
  273. package/dist/text/textDomainFormatted.js.map +1 -1
  274. package/dist/text/textDomainFormattedDefault.d.ts +48 -25
  275. package/dist/text/textDomainFormattedDefault.d.ts.map +1 -1
  276. package/dist/text/textDomainFormattedDefault.js +24 -19
  277. package/dist/text/textDomainFormattedDefault.js.map +1 -1
  278. package/dist/treeDataStore.d.ts +49 -0
  279. package/dist/treeDataStore.d.ts.map +1 -0
  280. package/dist/treeDataStore.js +57 -0
  281. package/dist/treeDataStore.js.map +1 -0
  282. package/dist/treeFactory.d.ts +8 -3
  283. package/dist/treeFactory.d.ts.map +1 -1
  284. package/dist/treeFactory.js +6 -1
  285. package/dist/treeFactory.js.map +1 -1
  286. package/dist/util/compressedIds.d.ts +22 -2
  287. package/dist/util/compressedIds.d.ts.map +1 -1
  288. package/dist/util/compressedIds.js +22 -1
  289. package/dist/util/compressedIds.js.map +1 -1
  290. package/lib/core/change-family/changeFamily.d.ts +15 -4
  291. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  292. package/lib/core/change-family/changeFamily.js.map +1 -1
  293. package/lib/core/change-family/editBuilder.d.ts +2 -3
  294. package/lib/core/change-family/editBuilder.d.ts.map +1 -1
  295. package/lib/core/change-family/editBuilder.js +1 -2
  296. package/lib/core/change-family/editBuilder.js.map +1 -1
  297. package/lib/core/change-family/index.d.ts +1 -1
  298. package/lib/core/change-family/index.d.ts.map +1 -1
  299. package/lib/core/change-family/index.js.map +1 -1
  300. package/lib/core/index.d.ts +4 -3
  301. package/lib/core/index.d.ts.map +1 -1
  302. package/lib/core/index.js +2 -2
  303. package/lib/core/index.js.map +1 -1
  304. package/lib/core/rebase/index.d.ts +1 -1
  305. package/lib/core/rebase/index.d.ts.map +1 -1
  306. package/lib/core/rebase/index.js +1 -1
  307. package/lib/core/rebase/index.js.map +1 -1
  308. package/lib/core/rebase/types.d.ts +110 -0
  309. package/lib/core/rebase/types.d.ts.map +1 -1
  310. package/lib/core/rebase/types.js +46 -0
  311. package/lib/core/rebase/types.js.map +1 -1
  312. package/lib/core/tree/delta.d.ts +62 -16
  313. package/lib/core/tree/delta.d.ts.map +1 -1
  314. package/lib/core/tree/delta.js.map +1 -1
  315. package/lib/core/tree/detachedFieldIndex.d.ts +7 -13
  316. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  317. package/lib/core/tree/detachedFieldIndex.js +7 -21
  318. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  319. package/lib/core/tree/index.d.ts +1 -0
  320. package/lib/core/tree/index.d.ts.map +1 -1
  321. package/lib/core/tree/index.js.map +1 -1
  322. package/lib/core/tree/visitorUtils.d.ts +2 -4
  323. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  324. package/lib/core/tree/visitorUtils.js +2 -2
  325. package/lib/core/tree/visitorUtils.js.map +1 -1
  326. package/lib/entrypoints/alpha.d.ts +1 -1
  327. package/lib/entrypoints/alpha.d.ts.map +1 -1
  328. package/lib/entrypoints/alpha.js +1 -1
  329. package/lib/entrypoints/alpha.js.map +1 -1
  330. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +9 -6
  331. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  332. package/lib/feature-libraries/chunked-forest/codec/codecs.js +16 -13
  333. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  334. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  335. package/lib/feature-libraries/chunked-forest/uniformChunk.js +10 -2
  336. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  337. package/lib/feature-libraries/comparison-forest/comparisonForest.d.ts +51 -0
  338. package/lib/feature-libraries/comparison-forest/comparisonForest.d.ts.map +1 -0
  339. package/lib/feature-libraries/comparison-forest/comparisonForest.js +94 -0
  340. package/lib/feature-libraries/comparison-forest/comparisonForest.js.map +1 -0
  341. package/lib/feature-libraries/comparison-forest/index.d.ts +6 -0
  342. package/lib/feature-libraries/comparison-forest/index.d.ts.map +1 -0
  343. package/lib/feature-libraries/comparison-forest/index.js +6 -0
  344. package/lib/feature-libraries/comparison-forest/index.js.map +1 -0
  345. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +8 -6
  346. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  347. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
  348. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  349. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  350. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  351. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  352. package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
  353. package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
  354. package/lib/feature-libraries/default-schema/noChangeCodecs.js +3 -1
  355. package/lib/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
  356. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +6 -3
  357. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  358. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +16 -4
  359. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  360. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -3
  361. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  362. package/lib/feature-libraries/forest-summary/forestSummarizer.js +2 -3
  363. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  364. package/lib/feature-libraries/index.d.ts +4 -3
  365. package/lib/feature-libraries/index.d.ts.map +1 -1
  366. package/lib/feature-libraries/index.js +2 -1
  367. package/lib/feature-libraries/index.js.map +1 -1
  368. package/lib/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
  369. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  370. package/lib/feature-libraries/mitigatedChangeFamily.js +12 -0
  371. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  372. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +9 -1
  373. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  374. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  375. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
  376. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  377. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  378. package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
  379. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  380. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  381. package/lib/feature-libraries/modular-schema/invert.d.ts +15 -0
  382. package/lib/feature-libraries/modular-schema/invert.d.ts.map +1 -0
  383. package/lib/feature-libraries/modular-schema/invert.js +155 -0
  384. package/lib/feature-libraries/modular-schema/invert.js.map +1 -0
  385. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts +3 -4
  386. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
  387. package/lib/feature-libraries/modular-schema/minimizeModularChange.js +2 -2
  388. package/lib/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
  389. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +9 -9
  390. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  391. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +0 -2
  392. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  393. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +2 -2
  394. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  395. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  396. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  397. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  398. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  399. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -22
  400. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  401. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +16 -367
  402. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  403. package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts +61 -0
  404. package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -0
  405. package/lib/feature-libraries/modular-schema/modularChangeUtils.js +192 -0
  406. package/lib/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -0
  407. package/lib/feature-libraries/modular-schema/prune.d.ts +10 -0
  408. package/lib/feature-libraries/modular-schema/prune.d.ts.map +1 -0
  409. package/lib/feature-libraries/modular-schema/prune.js +45 -0
  410. package/lib/feature-libraries/modular-schema/prune.js.map +1 -0
  411. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +2 -2
  412. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  413. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  414. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
  415. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  416. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  417. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
  418. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  419. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  420. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +2 -2
  421. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  422. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  423. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +2 -2
  424. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  425. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  426. package/lib/feature-libraries/treeTextCursor.d.ts +15 -0
  427. package/lib/feature-libraries/treeTextCursor.d.ts.map +1 -1
  428. package/lib/feature-libraries/treeTextCursor.js +62 -1
  429. package/lib/feature-libraries/treeTextCursor.js.map +1 -1
  430. package/lib/index.d.ts +6 -4
  431. package/lib/index.d.ts.map +1 -1
  432. package/lib/index.js +4 -3
  433. package/lib/index.js.map +1 -1
  434. package/lib/packageVersion.d.ts +1 -1
  435. package/lib/packageVersion.js +1 -1
  436. package/lib/packageVersion.js.map +1 -1
  437. package/lib/shared-tree/serializedChange.d.ts +2 -2
  438. package/lib/shared-tree/serializedChange.d.ts.map +1 -1
  439. package/lib/shared-tree/serializedChange.js.map +1 -1
  440. package/lib/shared-tree/sharedTree.d.ts +11 -3
  441. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  442. package/lib/shared-tree/sharedTree.js +10 -8
  443. package/lib/shared-tree/sharedTree.js.map +1 -1
  444. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +2 -2
  445. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  446. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  447. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +41 -4
  448. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  449. package/lib/shared-tree/sharedTreeChangeFamily.js +55 -0
  450. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  451. package/lib/shared-tree/transactionMinimize.d.ts.map +1 -1
  452. package/lib/shared-tree/transactionMinimize.js +3 -3
  453. package/lib/shared-tree/transactionMinimize.js.map +1 -1
  454. package/lib/shared-tree/transactionPostProcessor.d.ts +2 -1
  455. package/lib/shared-tree/transactionPostProcessor.d.ts.map +1 -1
  456. package/lib/shared-tree/transactionPostProcessor.js.map +1 -1
  457. package/lib/shared-tree/treeCheckout.d.ts +13 -7
  458. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  459. package/lib/shared-tree/treeCheckout.js +61 -15
  460. package/lib/shared-tree/treeCheckout.js.map +1 -1
  461. package/lib/shared-tree-core/branch.d.ts +24 -9
  462. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  463. package/lib/shared-tree-core/branch.js +7 -0
  464. package/lib/shared-tree-core/branch.js.map +1 -1
  465. package/lib/shared-tree-core/editManager.d.ts +4 -4
  466. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  467. package/lib/shared-tree-core/editManager.js +2 -0
  468. package/lib/shared-tree-core/editManager.js.map +1 -1
  469. package/lib/shared-tree-core/editManagerCodecs.d.ts +3 -14
  470. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  471. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  472. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +11 -1
  473. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  474. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  475. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +4 -11
  476. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  477. package/lib/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
  478. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  479. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +4 -11
  480. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  481. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
  482. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  483. package/lib/shared-tree-core/editManagerSummarizer.d.ts +4 -4
  484. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  485. package/lib/shared-tree-core/editManagerSummarizer.js +0 -1
  486. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  487. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
  488. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  489. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  490. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  491. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  492. package/lib/shared-tree-core/messageCodecs.d.ts +8 -1
  493. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  494. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  495. package/lib/shared-tree-core/sharedTreeCore.d.ts +5 -5
  496. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  497. package/lib/shared-tree-core/sharedTreeCore.js +1 -1
  498. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  499. package/lib/shared-tree-core/transaction.d.ts +10 -10
  500. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  501. package/lib/shared-tree-core/transaction.js +6 -3
  502. package/lib/shared-tree-core/transaction.js.map +1 -1
  503. package/lib/simple-tree/api/eraseSchemaDetails.d.ts +15 -0
  504. package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  505. package/lib/simple-tree/api/eraseSchemaDetails.js +15 -0
  506. package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  507. package/lib/simple-tree/api/index.d.ts +1 -1
  508. package/lib/simple-tree/api/index.d.ts.map +1 -1
  509. package/lib/simple-tree/api/index.js +1 -1
  510. package/lib/simple-tree/api/index.js.map +1 -1
  511. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +3 -3
  512. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  513. package/lib/simple-tree/api/schemaStatics.d.ts +6 -7
  514. package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
  515. package/lib/simple-tree/api/schemaStatics.js.map +1 -1
  516. package/lib/simple-tree/api/treeNodeApi.d.ts +20 -24
  517. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  518. package/lib/simple-tree/api/treeNodeApi.js +46 -46
  519. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  520. package/lib/simple-tree/core/treeNode.d.ts +5 -6
  521. package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
  522. package/lib/simple-tree/core/treeNode.js +2 -4
  523. package/lib/simple-tree/core/treeNode.js.map +1 -1
  524. package/lib/simple-tree/core/withType.d.ts +20 -7
  525. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  526. package/lib/simple-tree/core/withType.js +4 -7
  527. package/lib/simple-tree/core/withType.js.map +1 -1
  528. package/lib/simple-tree/index.d.ts +2 -2
  529. package/lib/simple-tree/index.d.ts.map +1 -1
  530. package/lib/simple-tree/index.js +1 -1
  531. package/lib/simple-tree/index.js.map +1 -1
  532. package/lib/simple-tree/leafNodeSchema.d.ts +6 -1
  533. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  534. package/lib/simple-tree/leafNodeSchema.js +0 -1
  535. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  536. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +53 -5
  537. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  538. package/lib/simple-tree/node-kinds/array/arrayNode.js +93 -12
  539. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  540. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +90 -0
  541. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  542. package/lib/simple-tree/node-kinds/map/mapNode.js +27 -2
  543. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  544. package/lib/simple-tree/node-kinds/object/objectNode.js +3 -3
  545. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  546. package/lib/simple-tree/node-kinds/record/recordNode.js +3 -3
  547. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  548. package/lib/text/codePointUtils.d.ts +2 -2
  549. package/lib/text/codePointUtils.js +2 -2
  550. package/lib/text/codePointUtils.js.map +1 -1
  551. package/lib/text/index.d.ts +3 -3
  552. package/lib/text/index.d.ts.map +1 -1
  553. package/lib/text/index.js +3 -3
  554. package/lib/text/index.js.map +1 -1
  555. package/lib/text/textDomain.d.ts +30 -18
  556. package/lib/text/textDomain.d.ts.map +1 -1
  557. package/lib/text/textDomain.js +41 -22
  558. package/lib/text/textDomain.js.map +1 -1
  559. package/lib/text/textDomainFormatted.d.ts +180 -82
  560. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  561. package/lib/text/textDomainFormatted.js +165 -86
  562. package/lib/text/textDomainFormatted.js.map +1 -1
  563. package/lib/text/textDomainFormattedDefault.d.ts +48 -25
  564. package/lib/text/textDomainFormattedDefault.d.ts.map +1 -1
  565. package/lib/text/textDomainFormattedDefault.js +25 -20
  566. package/lib/text/textDomainFormattedDefault.js.map +1 -1
  567. package/lib/treeDataStore.d.ts +49 -0
  568. package/lib/treeDataStore.d.ts.map +1 -0
  569. package/lib/treeDataStore.js +52 -0
  570. package/lib/treeDataStore.js.map +1 -0
  571. package/lib/treeFactory.d.ts +8 -3
  572. package/lib/treeFactory.d.ts.map +1 -1
  573. package/lib/treeFactory.js +5 -0
  574. package/lib/treeFactory.js.map +1 -1
  575. package/lib/util/compressedIds.d.ts +22 -2
  576. package/lib/util/compressedIds.d.ts.map +1 -1
  577. package/lib/util/compressedIds.js +22 -1
  578. package/lib/util/compressedIds.js.map +1 -1
  579. package/package.json +32 -24
  580. package/src/core/change-family/changeFamily.ts +32 -4
  581. package/src/core/change-family/editBuilder.ts +1 -2
  582. package/src/core/change-family/index.ts +2 -0
  583. package/src/core/index.ts +11 -6
  584. package/src/core/rebase/index.ts +2 -0
  585. package/src/core/rebase/types.ts +113 -0
  586. package/src/core/tree/delta.ts +62 -16
  587. package/src/core/tree/detachedFieldIndex.ts +7 -38
  588. package/src/core/tree/index.ts +2 -0
  589. package/src/core/tree/visitorUtils.ts +3 -17
  590. package/src/entrypoints/alpha.ts +9 -1
  591. package/src/feature-libraries/chunked-forest/codec/codecs.ts +17 -14
  592. package/src/feature-libraries/chunked-forest/uniformChunk.ts +11 -1
  593. package/src/feature-libraries/comparison-forest/comparisonForest.ts +140 -0
  594. package/src/feature-libraries/comparison-forest/index.ts +6 -0
  595. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +20 -6
  596. package/src/feature-libraries/default-schema/index.ts +1 -0
  597. package/src/feature-libraries/default-schema/noChangeCodecs.ts +11 -3
  598. package/src/feature-libraries/detachedFieldIndexSummarizer.ts +33 -5
  599. package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -3
  600. package/src/feature-libraries/index.ts +5 -0
  601. package/src/feature-libraries/mitigatedChangeFamily.ts +21 -3
  602. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +10 -1
  603. package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +9 -4
  604. package/src/feature-libraries/modular-schema/index.ts +1 -0
  605. package/src/feature-libraries/modular-schema/invert.ts +338 -0
  606. package/src/feature-libraries/modular-schema/minimizeModularChange.ts +3 -5
  607. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +16 -13
  608. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +3 -1
  609. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +2 -1
  610. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +45 -644
  611. package/src/feature-libraries/modular-schema/modularChangeUtils.ts +340 -0
  612. package/src/feature-libraries/modular-schema/prune.ts +69 -0
  613. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +4 -2
  614. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +5 -2
  615. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +4 -2
  616. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +4 -2
  617. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +6 -3
  618. package/src/feature-libraries/treeTextCursor.ts +66 -1
  619. package/src/index.ts +11 -4
  620. package/src/packageVersion.ts +1 -1
  621. package/src/shared-tree/serializedChange.ts +2 -2
  622. package/src/shared-tree/sharedTree.ts +40 -15
  623. package/src/shared-tree/sharedTreeChangeCodecs.ts +11 -3
  624. package/src/shared-tree/sharedTreeChangeFamily.ts +77 -2
  625. package/src/shared-tree/transactionMinimize.ts +7 -3
  626. package/src/shared-tree/transactionPostProcessor.ts +5 -1
  627. package/src/shared-tree/treeCheckout.ts +136 -30
  628. package/src/shared-tree-core/branch.ts +41 -12
  629. package/src/shared-tree-core/editManager.ts +46 -25
  630. package/src/shared-tree-core/editManagerCodecs.ts +9 -21
  631. package/src/shared-tree-core/editManagerCodecsCommons.ts +14 -2
  632. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +18 -21
  633. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +18 -20
  634. package/src/shared-tree-core/editManagerSummarizer.ts +9 -6
  635. package/src/shared-tree-core/messageCodecV1ToV4.ts +3 -3
  636. package/src/shared-tree-core/messageCodecVSharedBranches.ts +2 -2
  637. package/src/shared-tree-core/messageCodecs.ts +12 -2
  638. package/src/shared-tree-core/sharedTreeCore.ts +16 -7
  639. package/src/shared-tree-core/transaction.ts +47 -25
  640. package/src/simple-tree/api/eraseSchemaDetails.ts +15 -0
  641. package/src/simple-tree/api/index.ts +0 -1
  642. package/src/simple-tree/api/schemaStatics.ts +2 -2
  643. package/src/simple-tree/api/treeNodeApi.ts +64 -48
  644. package/src/simple-tree/core/treeNode.ts +13 -10
  645. package/src/simple-tree/core/withType.ts +20 -7
  646. package/src/simple-tree/index.ts +1 -2
  647. package/src/simple-tree/leafNodeSchema.ts +6 -1
  648. package/src/simple-tree/node-kinds/array/arrayNode.ts +130 -16
  649. package/src/simple-tree/node-kinds/map/mapNode.ts +137 -5
  650. package/src/simple-tree/node-kinds/object/objectNode.ts +3 -3
  651. package/src/simple-tree/node-kinds/record/recordNode.ts +3 -3
  652. package/src/text/README.md +1 -1
  653. package/src/text/codePointUtils.ts +2 -2
  654. package/src/text/index.ts +3 -3
  655. package/src/text/textDomain.ts +50 -27
  656. package/src/text/textDomainFormatted.ts +384 -163
  657. package/src/text/textDomainFormattedDefault.ts +32 -32
  658. package/src/treeDataStore.ts +125 -0
  659. package/src/treeFactory.ts +11 -3
  660. package/src/util/compressedIds.ts +36 -3
@@ -3,10 +3,10 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { Lazy, oob, fail, assert } from "@fluidframework/core-utils/internal";
6
+ import { Lazy, oob, fail, assert, clamp } from "@fluidframework/core-utils/internal";
7
7
  import { UsageError } from "@fluidframework/telemetry-utils/internal";
8
8
 
9
- import { EmptyKey, ObjectNodeStoredSchema } from "../../../core/index.js";
9
+ import { EmptyKey, ObjectNodeStoredSchema, type DeltaMark } from "../../../core/index.js";
10
10
  import type {
11
11
  FlexibleFieldContent,
12
12
  FlexTreeNode,
@@ -23,7 +23,7 @@ import type { NodeSchemaOptionsAlpha, System_Unsafe } from "../../api/index.js";
23
23
  import {
24
24
  CompatibilityLevel,
25
25
  type WithType,
26
- // eslint-disable-next-line import-x/no-deprecated
26
+ // eslint-disable-next-line import-x/no-deprecated -- Required to implement the deprecated typeNameSymbol API.
27
27
  typeNameSymbol,
28
28
  NodeKind,
29
29
  type TreeNode,
@@ -158,6 +158,11 @@ export interface TreeArrayNode<
158
158
  * Removes the item at the specified location.
159
159
  * @param index - The index at which to remove the item.
160
160
  * @throws Throws if `index` is not in the range [0, `array.length`).
161
+ * @remarks
162
+ * The item to remove is determined when this method is called, not when the resulting edit is sequenced.
163
+ * This means that, once the edit is sequenced, the item being removed may no longer be at `index`,
164
+ * and may in fact no longer be in this array at all (for example, if a concurrent edit moved it to another array).
165
+ * This operation removes that item from wherever it then resides.
161
166
  */
162
167
  removeAt(index: number): void;
163
168
 
@@ -534,12 +539,22 @@ export interface TreeArrayNodeAlpha<
534
539
  /**
535
540
  * Removes the last item from the array and returns it.
536
541
  * @returns The removed item, or `undefined` if the array is empty (in which case the array is not modified).
542
+ * @remarks
543
+ * Equivalent to `removeAt(array.length - 1)`, additionally returning the removed item:
544
+ * see {@link (TreeArrayNode:interface).removeAt} for details, including merge semantics with concurrent edits.
545
+ * In particular, the item removed is the one that is last at the time this method is called,
546
+ * not the one that is last at the time the resulting edit is sequenced.
537
547
  */
538
548
  pop(): T | undefined;
539
549
 
540
550
  /**
541
551
  * Removes the first item from the array and returns it.
542
552
  * @returns The removed item, or `undefined` if the array is empty (in which case the array is not modified).
553
+ * @remarks
554
+ * Equivalent to `removeAt(0)`, additionally returning the removed item:
555
+ * see {@link (TreeArrayNode:interface).removeAt} for details, including merge semantics with concurrent edits.
556
+ * In particular, the item removed is the one that is first at the time this method is called,
557
+ * not the one that is first at the time the resulting edit is sequenced.
543
558
  */
544
559
  shift(): T | undefined;
545
560
 
@@ -550,8 +565,10 @@ export interface TreeArrayNodeAlpha<
550
565
  * @remarks
551
566
  * Unlike `Array.prototype.unshift`, this method does not return the new length of the array.
552
567
  *
553
- * Equivalent to `insertAt(0, ...value)`:
554
- * see {@link (TreeArrayNode:interface).insertAt} for details, including merge semantics with concurrent edits.
568
+ * All items inserted by a single call to this method are inserted consecutively.
569
+ * The order of the inserted items relative to other concurrently inserted items is fully specified:
570
+ * Concurrently unshifting `[A, B]` and `[X, Y]` will yield `[A, B, X, Y]` if the edit unshifting `[A, B]`
571
+ * is sequenced after the edit unshifting `[X, Y]`.
555
572
  */
556
573
  unshift(...value: readonly (TNew | IterableTreeArrayContent<TNew>)[]): void;
557
574
 
@@ -563,6 +580,8 @@ export interface TreeArrayNodeAlpha<
563
580
  * Must be a non-negative integer no greater than the number of items from `start` to the end of the array.
564
581
  * @param items - The item(s) to insert at `start`.
565
582
  * @returns An array containing the item(s) that were removed.
583
+ * @remarks
584
+ * See {@link (TreeArrayNode:interface).insertAt} for the merge semantics of the inserted items.
566
585
  */
567
586
  splice(
568
587
  start: number,
@@ -1515,7 +1534,7 @@ export function arraySchema<
1515
1534
  public static readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined =
1516
1535
  persistedMetadata;
1517
1536
 
1518
- // eslint-disable-next-line import-x/no-deprecated
1537
+ // eslint-disable-next-line import-x/no-deprecated -- Required to implement the deprecated typeNameSymbol API.
1519
1538
  public get [typeNameSymbol](): TName {
1520
1539
  return identifier;
1521
1540
  }
@@ -1649,11 +1668,21 @@ export interface ArrayPlaceAnchor {
1649
1668
  * The current index within the array that this anchor refers to.
1650
1669
  * @remarks
1651
1670
  * This value is updated as the array is edited in a way that depends on the specific anchor implementation.
1652
- * This index may take on a value from 0 to the length of the array (inclusive).
1671
+ * This index is a value from 0 to the current length of the array (inclusive).
1653
1672
  * If used as the index to insert content into the array, this means it can point to any location in the array,
1654
1673
  * including just after the last child.
1674
+ * @throws A {@link @fluidframework/telemetry-utils#UsageError} if the anchor has been {@link ArrayPlaceAnchor.dispose | disposed}.
1655
1675
  */
1656
1676
  get index(): number;
1677
+
1678
+ /**
1679
+ * Stop tracking this anchor and release any resources it holds.
1680
+ * @remarks
1681
+ * Call this when the anchor is no longer needed (for example when a tracked cursor position is discarded).
1682
+ * Interacting with an anchor (including reading its properties) after it has been disposed is invalid and will throw.
1683
+ * Calling `dispose` more than once has no effect.
1684
+ */
1685
+ dispose(): void;
1657
1686
  }
1658
1687
 
1659
1688
  /**
@@ -1671,9 +1700,29 @@ export interface ArrayPlaceAnchor {
1671
1700
  * This is intended to track a location that might be used for an insertion point (for example in a text editor): future changes to its details should
1672
1701
  * make it behave better for such uses.
1673
1702
  *
1674
- * The current implementation is known to behave particularly poorly if the child which was at the original anchor point's index is removed
1675
- * (jumps to the end of the array): this behavior is subject to change.
1703
+ * In rare cases the tracked index cannot be updated precisely and the anchor falls back to best-effort behavior:
1704
+ * it keeps reporting a valid in-bounds index, but that index may no longer correspond to the same logical position
1705
+ * as before the change (this can happen when an incremental delta is unavailable for a change, such as during a
1706
+ * schema change). Consumers that require an accurate position across such changes should re-derive it from their
1707
+ * own state rather than relying solely on this anchor.
1676
1708
  * @privateRemarks
1709
+ * The index is maintained incrementally from the shallow (insert/remove) delta delivered by the array node's
1710
+ * `childrenChangedAfterBatch` event: inserts and removes before the anchor point shift it, while edits after it
1711
+ * (or a removal of the span it sits between) leave it in place. This keeps the anchor pinned to the gap between
1712
+ * children even when the child originally at its index is removed.
1713
+ *
1714
+ * The best-effort behavior noted in the public remarks is the no-delta path: when the composed delta is unavailable
1715
+ * (see {@link NodeChangedDataDelta.delta}), the exact shift is unknown so the index is only clamped back into range.
1716
+ * This is intentionally weak rather than reintroducing a per-edit O(n) snapshot of the array to diff old-vs-new
1717
+ * (which would defeat the point of delta-based tracking) for a case that is rare and, for this alpha API, acceptable
1718
+ * to degrade. A stronger fallback could instead let a consumer that already maintains the array contents re-seed the
1719
+ * anchor's position on this path, so it lives with the consumer that has the data instead of being duplicated here.
1720
+ *
1721
+ * TODO: The no-delta case above is one of several places whose behavior is limited by changes for which a composed
1722
+ * delta cannot be produced (see {@link NodeChangedDataDelta.delta}). The underlying eventing limitation should be
1723
+ * fixed so a delta is always available; when adding new code constrained by it, note it here (or track it centrally)
1724
+ * so the full set of affected call sites is known and can be prioritized.
1725
+ *
1677
1726
  * When stabilized, this should probably become a method on {@link (TreeArrayNode:interface)}.
1678
1727
  * Future versions of this should use rebaser / changeset logic to do a better job of tracking a location across removals or reinsertion.
1679
1728
  * How this would work, especially for unhydrated nodes is not yet clear.
@@ -1683,17 +1732,82 @@ export function createArrayInsertionAnchor(
1683
1732
  node: TreeArrayNode,
1684
1733
  currentIndex: number,
1685
1734
  ): ArrayPlaceAnchor {
1735
+ // An out-of-range or non-integer index is a usage error. An index equal to the array length is valid
1736
+ // (it points just past the last child).
1686
1737
  const field = getInnerNode(node).getBoxed(EmptyKey);
1687
- const child = field.boxedAt(currentIndex);
1738
+ validateIndex(currentIndex, field, "createArrayInsertionAnchor", /* allowOnePastEnd */ true);
1739
+ let trackedIndex = currentIndex;
1740
+
1741
+ const kernel = getKernel(node);
1742
+ let off: (() => void) | undefined = kernel.events.on(
1743
+ "childrenChangedAfterBatch",
1744
+ ({ fieldMarks }) => {
1745
+ const marks = fieldMarks.get(EmptyKey);
1746
+ // This event fires after the change is applied, so the field reflects the post-edit length.
1747
+ const length = getInnerNode(node).getBoxed(EmptyKey).length;
1748
+ if (marks === undefined) {
1749
+ // No-delta path: the composed delta is unavailable, so the exact shift is unknown. Keep the
1750
+ // index valid by clamping it to the current length (best-effort). See this function's
1751
+ // @privateRemarks for when this happens and why the fallback is intentionally weak.
1752
+ trackedIndex = clamp(trackedIndex, 0, length);
1753
+ return;
1754
+ }
1755
+ // Clamp defensively so a malformed or partial delta can never push the tracked index outside the
1756
+ // valid insertion range while the anchor is live (adjustIndexForArrayDelta has no final clamp).
1757
+ trackedIndex = clamp(adjustIndexForArrayDelta(trackedIndex, marks), 0, length);
1758
+ },
1759
+ );
1760
+
1688
1761
  return {
1689
1762
  get index() {
1690
- if (child === undefined) {
1691
- return field.length;
1692
- }
1693
- if (child.parentField.parent !== field) {
1694
- return field.length;
1763
+ if (off === undefined) {
1764
+ throw new UsageError("Cannot read the index of a disposed ArrayPlaceAnchor.");
1695
1765
  }
1696
- return child.parentField.index;
1766
+ return trackedIndex;
1767
+ },
1768
+ dispose() {
1769
+ off?.();
1770
+ off = undefined;
1697
1771
  },
1698
1772
  };
1699
1773
  }
1774
+
1775
+ /**
1776
+ * Compute the new index of an {@link ArrayPlaceAnchor} after applying a shallow array delta.
1777
+ * @remarks
1778
+ * The marks cover the array's sequence field in order. `readPosition` walks the pre-edit array as the marks are
1779
+ * consumed while `index` stays fixed at the anchor's pre-edit location; comparing the two (both in pre-edit
1780
+ * coordinates) shifts `newIndex` to keep the anchor in the same gap between children as content is inserted or
1781
+ * removed around it. Each mark is a removal (`detach`), an insertion (`attach`), or a retain (neither); a mark may
1782
+ * carry both `detach` and `attach`, which is handled as a removal followed by an insertion. The per-mark behavior is
1783
+ * commented inline below.
1784
+ */
1785
+ function adjustIndexForArrayDelta(index: number, marks: readonly DeltaMark[]): number {
1786
+ let readPosition = 0;
1787
+ let newIndex = index;
1788
+ for (const mark of marks) {
1789
+ // A removal consumes pre-edit content: if it lies entirely before the anchor it pulls the anchor left,
1790
+ // and if it contains the anchor's position the anchor collapses to the start of the removed span.
1791
+ if (mark.detach !== undefined) {
1792
+ const removeEnd = readPosition + mark.count;
1793
+ if (removeEnd <= index) {
1794
+ newIndex -= mark.count;
1795
+ } else if (readPosition < index) {
1796
+ newIndex -= index - readPosition;
1797
+ }
1798
+ readPosition += mark.count;
1799
+ }
1800
+ if (mark.attach !== undefined) {
1801
+ // Content inserted at or before the anchor pushes it right; inserting exactly at the anchor leaves the
1802
+ // anchor after the new content (insertion-point behavior). Inserted content is new, so it does not
1803
+ // advance the pre-edit read position.
1804
+ if (readPosition <= index) {
1805
+ newIndex += mark.count;
1806
+ }
1807
+ } else if (mark.detach === undefined) {
1808
+ // Retain: existing content that was neither inserted nor removed.
1809
+ readPosition += mark.count;
1810
+ }
1811
+ }
1812
+ return newIndex;
1813
+ }
@@ -22,14 +22,18 @@ import {
22
22
  type JsonCompatibleReadOnlyObject,
23
23
  type RestrictiveStringRecord,
24
24
  } from "../../../util/index.js";
25
- import type { NodeSchemaOptionsAlpha } from "../../api/index.js";
25
+ import type {
26
+ NodeSchemaOptionsAlpha,
27
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- Referenced by TSDoc {@link} in this file.
28
+ RunTransactionParamsAlpha,
29
+ } from "../../api/index.js";
26
30
  import {
27
31
  CompatibilityLevel,
28
32
  getKernel,
29
33
  type InnerNode,
30
34
  NodeKind,
31
35
  type TreeNodeSchema,
32
- // eslint-disable-next-line import-x/no-deprecated
36
+ // eslint-disable-next-line import-x/no-deprecated -- Required to implement the deprecated typeNameSymbol API.
33
37
  typeNameSymbol,
34
38
  type TreeNode,
35
39
  typeSchemaSymbol,
@@ -166,7 +170,105 @@ export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTyp
166
170
  export interface TreeMapNodeAlpha<T extends ImplicitAllowedTypes = ImplicitAllowedTypes>
167
171
  extends FluidReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>,
168
172
  TreeNode,
169
- Pick<TreeMapNode<T>, "set" | "delete"> {}
173
+ Pick<TreeMapNode<T>, "set" | "delete"> {
174
+ /**
175
+ * Removes all elements from the map.
176
+ * @remarks
177
+ * The merge semantics of this operation are loosely specified. Either of the following may occur:
178
+ *
179
+ * - `clear` may remove all elements that were in the map when the edit was authored,
180
+ * even if some of those elements have since been moved elsewhere in the tree
181
+ * (in which case they are removed from their new location).
182
+ *
183
+ * - `clear` may remove all elements that are in the map when the edit is sequenced,
184
+ * even if some of those elements were not yet in the map when the edit was authored.
185
+ */
186
+ clear(): void;
187
+ /**
188
+ * Returns the value at `key`, first inserting `fallbackValue` if this map has no entry for `key`.
189
+ *
190
+ * @param key - The key of the element to return or insert at.
191
+ * @param fallbackValue - The value to insert if `key` has no entry.
192
+ * @returns The value at `key`, which may be the provided `fallbackValue`
193
+ * if the map had no previous entry for `key`.
194
+ *
195
+ * @remarks
196
+ * The check for the presence of an existing entry with the given `key` is performed at the time the edit is authored.
197
+ * This has implications for the merge semantics of this operation:
198
+ *
199
+ * - If no entry is present for `key` at authoring time (thus leading to an insert)
200
+ * while a peer concurrently inserts a value for the same `key`,
201
+ * then the two inserts will race and the one that is sequenced second will overwrite the value inserted by the one
202
+ * that is sequenced first.
203
+ *
204
+ * - If an entry is present for `key` at authoring time (thus leading to no insert)
205
+ * while a peer concurrently deletes the entry for `key`,
206
+ * then the map will end up with no entry for `key` no matter how the two edits are sequenced.
207
+ *
208
+ * - If an entry is present for `key` at authoring time (thus leading to no insert)
209
+ * while a peer concurrently inserts a new entry for `key`,
210
+ * then the map will end up with the entry set by the peer no matter how the two edits are sequenced.
211
+ *
212
+ * These last two points mean that, upon sequencing of an edit made with this API,
213
+ * there is no guarantee that the entry for the given key will be the current one (if any) or the fallback one.
214
+ * If such a guarantee is important, then consider using {@link RunTransactionParamsAlpha.preconditions}
215
+ * to ensure the edit only applies when appropriate.
216
+ *
217
+ * This API is **not** equivalent to the following alternative:
218
+ *
219
+ * ```typescript
220
+ * map.set(key, map.get(key) ?? fallbackValue);
221
+ * ```
222
+ *
223
+ * They differ in the following ways:
224
+ *
225
+ * - This API treats entries containing `null` values as populated.
226
+ * By contrast, the above alternative's usage of `??` means that a `null` entry is treated as equivalent to a missing entry.
227
+ *
228
+ * - This API only inserts/sets the entry for the given `key` when there is no current one.
229
+ * By contrast, the above alternative always performs an insert.
230
+ * That insert will throw an error for non-leaf types (objects, maps, arrays, and records) in cases where the entry
231
+ * is already populated, because inserting a node that was already inserted is not supported.
232
+ * It will always succeed for leaf types (number, string, boolean, null, and handle) since a new node is created
233
+ * from the value.
234
+ * Note that even in the cases where it does not throw,
235
+ * the `set` operation has the potential to overwrite entries that are concurrently inserted even when the map had
236
+ * an entry for `key`, which is not the case with this API.
237
+ *
238
+ * Avoid using this API to write a default value into the document when the application could instead return that
239
+ * default when reading a missing entry, which is much less costly.
240
+ * A more appropriate use of this API is when the value to be optionally inserted varies with the key.
241
+ */
242
+ getOrInsert(
243
+ key: string,
244
+ fallbackValue: InsertableTreeNodeFromImplicitAllowedTypes<T>,
245
+ ): TreeNodeFromImplicitAllowedTypes<T>;
246
+
247
+ /**
248
+ * Returns the value at `key`, first inserting the value produced by `callback` if this map has no entry for `key`.
249
+ *
250
+ * @param key - The key of the element to return or insert at.
251
+ * @param callback - Invoked with `key` to produce the value to insert if `key` has no entry.
252
+ * Not invoked if an entry is present.
253
+ * @returns The value at `key`, which may be the value produced by `callback`
254
+ * if the map had no previous entry for `key`.
255
+ *
256
+ * @remarks
257
+ * This API is equivalent to {@link TreeMapNodeAlpha.getOrInsert} except that the fallback value is computed lazily:
258
+ * `callback` is only invoked when the map has no entry for `key`.
259
+ * Prefer this API over {@link TreeMapNodeAlpha.getOrInsert} when producing the fallback value is expensive.
260
+ *
261
+ * The check for the presence of an existing entry with the given `key` is performed at the time the edit is authored.
262
+ * See {@link TreeMapNodeAlpha.getOrInsert} for the implications this has on the merge semantics of this operation.
263
+ *
264
+ * If `callback` throws, no edit is made and the error is propagated to the caller.
265
+ * If `callback` sets an entry for `key` in this map, that entry is overwritten with the value `callback` returned.
266
+ */
267
+ getOrInsertComputed(
268
+ key: string,
269
+ callback: (key: string) => InsertableTreeNodeFromImplicitAllowedTypes<T>,
270
+ ): TreeNodeFromImplicitAllowedTypes<T>;
271
+ }
170
272
 
171
273
  // TreeMapNode is invariant over schema type, so for this handler to work with all schema, the only possible type for the schema is `any`.
172
274
  // This is not ideal, but no alternatives are possible.
@@ -247,6 +349,28 @@ abstract class CustomMapNodeBase<const T extends ImplicitAllowedTypes> extends T
247
349
  this.editor(key).set(mapTree, field.length === 0);
248
350
  return this;
249
351
  }
352
+ public getOrInsert(
353
+ key: string,
354
+ fallbackValue: InsertableTreeNodeFromImplicitAllowedTypes<T>,
355
+ ): TreeNodeFromImplicitAllowedTypes<T> {
356
+ const existing = this.get(key);
357
+ if (existing !== undefined) {
358
+ return existing;
359
+ }
360
+ this.set(key, fallbackValue);
361
+ return this.get(key);
362
+ }
363
+ public getOrInsertComputed(
364
+ key: string,
365
+ callback: (key: string) => InsertableTreeNodeFromImplicitAllowedTypes<T>,
366
+ ): TreeNodeFromImplicitAllowedTypes<T> {
367
+ const existing = this.get(key);
368
+ if (existing !== undefined) {
369
+ return existing;
370
+ }
371
+ this.set(key, callback(key));
372
+ return this.get(key);
373
+ }
250
374
  public get size(): number {
251
375
  return count(this.innerNode.keys());
252
376
  }
@@ -265,7 +389,15 @@ abstract class CustomMapNodeBase<const T extends ImplicitAllowedTypes> extends T
265
389
  callbackFn.call(thisArg, node, field.key, this);
266
390
  }
267
391
  }
268
- // TODO: add `clear` once we have established merge semantics for it.
392
+ public clear(): void {
393
+ const node = this.innerNode;
394
+ const transaction = node.isHydrated() ? node.context.checkout.transaction : undefined;
395
+ transaction?.start();
396
+ for (const key of [...node.keys()]) {
397
+ this.delete(key);
398
+ }
399
+ transaction?.commit();
400
+ }
269
401
  }
270
402
 
271
403
  /**
@@ -353,7 +485,7 @@ export function mapSchema<
353
485
  public static readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined =
354
486
  persistedMetadata;
355
487
 
356
- // eslint-disable-next-line import-x/no-deprecated
488
+ // eslint-disable-next-line import-x/no-deprecated -- Required to implement the deprecated typeNameSymbol API.
357
489
  public get [typeNameSymbol](): TName {
358
490
  return identifier;
359
491
  }
@@ -32,7 +32,7 @@ import {
32
32
  type TreeNodeSchema,
33
33
  NodeKind,
34
34
  type WithType,
35
- // eslint-disable-next-line import-x/no-deprecated
35
+ // eslint-disable-next-line import-x/no-deprecated -- Required to handle the deprecated typeNameSymbol API.
36
36
  typeNameSymbol,
37
37
  typeSchemaSymbol,
38
38
  type InternalTreeNode,
@@ -335,7 +335,7 @@ function createProxyHandler(
335
335
  if (propertyKey === typeSchemaSymbol) {
336
336
  return schema;
337
337
  }
338
- // eslint-disable-next-line import-x/no-deprecated
338
+ // eslint-disable-next-line import-x/no-deprecated -- Required to handle the deprecated typeNameSymbol API.
339
339
  if (propertyKey === typeNameSymbol) {
340
340
  return schema.identifier;
341
341
  }
@@ -633,7 +633,7 @@ export function objectSchema<
633
633
  public static readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined =
634
634
  nodeOptions.persistedMetadata;
635
635
 
636
- // eslint-disable-next-line import-x/no-deprecated
636
+ // eslint-disable-next-line import-x/no-deprecated -- Required to implement the deprecated typeNameSymbol API.
637
637
  public get [typeNameSymbol](): TName {
638
638
  return identifier;
639
639
  }
@@ -17,7 +17,7 @@ import type { NodeSchemaOptionsAlpha } from "../../api/index.js";
17
17
  import {
18
18
  type TreeNodeSchema,
19
19
  NodeKind,
20
- // eslint-disable-next-line import-x/no-deprecated
20
+ // eslint-disable-next-line import-x/no-deprecated -- Required to handle the deprecated typeNameSymbol API.
21
21
  typeNameSymbol,
22
22
  typeSchemaSymbol,
23
23
  type UnhydratedFlexTreeNode,
@@ -78,7 +78,7 @@ function createRecordNodeProxy(
78
78
  case typeSchemaSymbol: {
79
79
  return schema;
80
80
  }
81
- // eslint-disable-next-line import-x/no-deprecated
81
+ // eslint-disable-next-line import-x/no-deprecated -- Required to handle the deprecated typeNameSymbol API.
82
82
  case typeNameSymbol: {
83
83
  return schema.identifier;
84
84
  }
@@ -370,7 +370,7 @@ export function recordSchema<
370
370
  public static readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined =
371
371
  persistedMetadata;
372
372
 
373
- // eslint-disable-next-line import-x/no-deprecated
373
+ // eslint-disable-next-line import-x/no-deprecated -- Required to implement the deprecated typeNameSymbol API.
374
374
  public get [typeNameSymbol](): TName {
375
375
  return identifier;
376
376
  }
@@ -5,4 +5,4 @@ A collection of text related types, schema and utilities for working with text b
5
5
  ## Status
6
6
 
7
7
  Very early work in progress.
8
- See doc comment on `TextAsTree` for more details.
8
+ See doc comment on `PlainText` for more details.
@@ -9,7 +9,7 @@ import { UsageError } from "@fluidframework/telemetry-utils/internal";
9
9
  * Returns the number of Unicode code points in `value`.
10
10
  * @remarks
11
11
  * Use this to translate a JavaScript string length (which is in UTF-16 code units) into
12
- * the atom/code-point space used by {@link TextAsTree}.
12
+ * the atom/code-point space used by {@link PlainText} and {@link FormattedText}.
13
13
  *
14
14
  * @example
15
15
  * ```typescript
@@ -33,7 +33,7 @@ export function codePointCount(value: string): number {
33
33
  * Returns the number of UTF-16 code units occupied by the first `count` Unicode code points in `value`,
34
34
  * starting at UTF-16 index `start`.
35
35
  * @remarks
36
- * Use this to translate {@link TextAsTree}-space counts (code points) into JavaScript string indices (UTF-16).
36
+ * Use this to translate {@link PlainText}-space counts (code points) into JavaScript string indices (UTF-16).
37
37
  * One code point outside the Basic Multilingual Plane (e.g. most emoji) occupies two UTF-16 code units.
38
38
  *
39
39
  * Validates that the requested `count` code points are fully consumable from `start`; silent truncation
package/src/text/index.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- export { TextAsTree } from "./textDomain.js";
7
- export { FormattedTextAsTree } from "./textDomainFormatted.js";
8
- export { FormattedTextAsTreeDefault } from "./textDomainFormattedDefault.js";
6
+ export { PlainText } from "./textDomain.js";
7
+ export { FormattedText } from "./textDomainFormatted.js";
8
+ export { FormattedTextDefault } from "./textDomainFormattedDefault.js";
9
9
  export { codePointCount, utf16LengthForCodePoints } from "./codePointUtils.js";